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
Check if userA is owner of userB
public function isOwner(User $userA, User $userB) { return $userA->uuid === $userB->user_uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }", "public function isOwner();", "public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }", "public function isOwnedBy(UserInterface $user);", "public function isOwner($user)\n {\n\n if ($this->m_role_created == $user->getId())\n return true;\n else\n return false;\n\n }", "public static function isOwner(): bool\n\t{\n\t\tif(in_array( 'owner', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t\treturn false;\n\t}", "function isOwner( $user, $imagecategory )\r\n {\r\n if ( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT UserID from eZImageCatalogue_Category WHERE ID='$imagecategory'\");\r\n $userID = $res[$db->fieldName(\"UserID\")];\r\n if ( $userID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }", "public function sameOwner(User $userA, User $userB)\n {\n return $userA->user_uuid === $userB->user_uuid;\n }", "public function isOwner()\n\t{\n\t\treturn is_null($this->CreatedBy) || $this->CreatedBy === Yii::app()->user->GUID;\n\t}", "public function isOwner(\\VMB\\UserBundle\\Entity\\User $user = null)\n {\n return $user && $this->getOwner() && $user->getId() == $this->getOwner()->getId();\n }", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "public function ownedBy(User $user){\n\n\t\treturn $this->user_id == $user->id;\n\n\t}", "public static function ownerOnly(){\n return TRUE;\n }", "function isOwner() {\n return $this->getIsOwner();\n }", "function isOwner($facebookID){\n\t\tif($facebookID == $this->fk_member_id){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }", "public function hasOwner()\n {\n return $this->owner !== null;\n }", "public function isOwner(){\n return (count($this->rooms()) > 0);\n }", "public function isOwner()\r\n {\r\n return $this->owner;\r\n }", "public function isOwnedBy($user)\n {\n if (($entry = $this->getEntry())) {\n return $entry->isOwnedBy($user);\n } else {\n return false;\n }\n }", "protected function owner_matches_current_user()\n {\n }", "public function isOwner(UserObject $userObject){\n if(is_callable($this->checkOwner)){\n $check = $this->checkOwner;\n return $check($userObject);\n }\n CoreLog::debug('No checkOwner method defined');\n return false;\n }", "private function check_is_owner($user_id)\n {\n if ($user_id != current_user_id()) {\n show_error(lang('not_authorized'), 403);\n }\n }", "public function isOwner($id=''){\n\t\n\tif(empty($id)) $id = $this->id;\n\t \t\n \t$sql=$this->_db->select()->from($this->m_table)->where(\"id=?\",$id)->where(\"user_id =?\",$_SESSION['user_id']);\n \t$rs =$this->_db->fetchCol($sql);\n \t\n \tif(!empty($rs)){\n \t\treturn true;\n \t}\n \treturn false;\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public function getAmOwnerAttribute() {\n\t\t$userId = user('id');\n\t\tif(empty($userId)) { return false; }\n\t\t\n\t\treturn $userId == $this->attributes['user_id'];\n\t}", "function isOwner() {\n if($this->is_owner === null) {\n $company = $this->getCompany();\n $this->is_owner = instance_of($company, 'Company') ? $company->getIsOwner() : false;\n } // if\n return $this->is_owner;\n }", "public function ownedBy(User $user) {\n // Check to see if the user id = the user id passed in.\n return $this->user_id == $user->id;\n }", "public function testIsUserPhotoOwner()\n {\n $this->seed();\n\n $isOwner = Photo::isUserPhotoOwner(1,1);\n $this->assertTrue($isOwner);\n\n $isOwner = Photo::isUserPhotoOwner(1,3);\n $this->assertTrue(!$isOwner);\n }", "function isOwner($table,$referenceKey,$userReferenceKey,$referenceId){\n\t// var_dump('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \tif(Auth::check() && $table){\n \t\t$isOwner = \\DB::select('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \t\t$result = (!empty($isOwner)) ? true :false;\n \t}\n \telse\n \t\t$result = false;\n\n\treturn $result;\n}", "public function ownerLoggedIn()\n {\n // For now just check session for an email and owner type\n if ( empty($_SESSION['email']) || $_SESSION['type'] != 'owner')\n return false;\n else\n return true;\n\n }", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "public function isOwner(User $user) : bool\n {\n foreach (config('dan.owners') as $usr) {\n if (fnmatch($usr, $user)) {\n return true;\n }\n }\n\n return false;\n }", "public function ownedBy(User $user)\n {\n return $this->user_id === $user->id;\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function isFromOwner()\n {\n return $this->fromOwner;\n }", "public function ownerOnly(User $user, Load $load)\n {\n \n return ($load->user_id === $user->id);\n }", "public function owns($image)\n {\n return $this->id === $image->user_id;\n }", "function checkAdminOwner() {\n //Ensure user is logged in\n if(Auth::guest()) {\n return false;\n }\n //Ensure that the user is an admin or an owner\n $roles = Auth::user()->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == \"admin\" || $role->name == \"owner\") {\n //Double check to make sure user is not banned\n if(checkSingleRole(\"banned\") == false)\n return true;\n else\n return false; //User is an admin but is banned\n }\n }\n //User is not an admin or an owner\n return false;\n}", "public function isOwner(AccountInterface $account);", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function ownedBy(User $user)\n {\n return $this->created_by == $user->id;\n }", "public function isToApiOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } elseif (($this->api === null) || ($this->api->owner_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->api->owner_id);\n }\n }", "public function isOwnedBy($comment, $user) {\n return $this->field('id', array('id' => $comment, 'user_id' => $user)) !== false;\n }", "function is_session_owner ($session_id, $user_agent, $remote_addr, $ip) {\n\t\t$session_data = $this->get($session_id);\n\t\treturn $session_data ? $this->is_session_owner_internal($session_data, $user_agent, $remote_addr, $ip) : false;\n\t}", "public function isUserOwner($user, $mmobj)\n {\n return $this->mmobjService->isUserOwner($user, $mmobj);\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function isAdminOrOwner($user_id)\n\t{\n\t\t$user = User::model()->findByPk($user_id);\n\t\tif ($user !== null)\n\t\t{\n\t\t\treturn $user->isAdmin() ||\n\t\t\t($user->canCreateAdventure() && $user_id == $this->createdBy)\n\t\t\t;\n\t\t}\n\t\treturn false;\n\t}", "public function owns($related): bool\n {\n return $this->id == $related->user_id;\n }", "public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }", "function getOwnedAttribute()\n {\n if (!!Auth::user()) return Auth::id() === $this->user_id;\n return false;\n }", "public function owner(User $user, Task $task)\n {\n return $user->id === $task->user_id;\n }", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function isOwnerBooking()\n {\n return ($this->getStatus() == 'O');\n }", "public function GetisOwnerThisRecord(){\n return ($this->{$this->nameFieldUserId}==h::userId());\n}", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "function token_ensure_owner( $p_token_id, $p_owner_id ) {\r\n\t\t$c_token_id = db_prepare_int( $p_token_id );\r\n\t\t$t_tokens_table\t= config_get( 'mantis_tokens_table' );\r\n\r\n\t\t$query = \"SELECT owner\r\n\t\t\t\t \tFROM $t_tokens_table\r\n\t\t\t\t \tWHERE id='$c_token_id'\";\r\n\t\t$result = db_query( $query );\r\n\r\n\t\tif( db_result( $result ) != $p_owner_id ) {\r\n\t\t\ttrigger_error( ERROR_GENERIC, ERROR );\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function isPostOwner($id) {\n $post = Post::where('id','=',$id)->first();\n return ($this->id == $post->user->id);\n }", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "function isBlogOwner( $pUserId=NULL ) {\n\t\t$ret = FALSE;\n\t\tglobal $gBitUser;\n\t\tif( empty( $pUserId ) && $gBitUser->isValid() ) {\n\t\t\t$pUserId = $gBitUser->mUserId;\n\t\t}\n\t\tif( $this->isValid() && ($pUserId == $this->mInfo[\"blog_user_id\"]) ) {\n\t\t\t$ret = 'y';\n\t\t}\n\t\treturn $ret;\n\t}", "public function isOwnerOfGroup($group);", "public function isWorker(User $userA, User $userB)\n {\n return $userA->user_uuid === $userB->uuid;\n }", "public function isOwned(User $user = null) : string {\n $id = $user ? $user->getId() : \"none\";\n return $this->getUserId() . \" == \" . $id ;\n return $this->isOwner() ? \"Yes\" : \"No\" ;\n }", "public function hasUser();", "public function isAssignee(UserInterface $user);", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "public function hasOwnershipAccess ($store_id, $viewing_user_id) {\n\t \n\t $this->load->model('user/user');\n\t \t \n\t if ($this->model_user_user->isAdmin($viewing_user_id)) {\n\t return true;\n\t } \t \n\n // SPS:\n if ($this->user->isSPS()) {\n return $this->user->getSPS()->isAdmin();\n }\n\t \n\t $sql = \"\n\t \tSELECT\t\tS.store_id\n\t \tFROM\t\tstore as S,\n\t \t\t\t\tuser as U\n\t \tWHERE\t\t1\n\t \t\tAND\t\tS.user_id = U.user_id\n\t \t\tAND\t\tS.store_id = '{$store_id}'\n\t \t\tAND\t\tU.user_id = '{$viewing_user_id}'\n\t \";\n\t \n\t $result = $this->db->query($sql);\n\t \n\t return (boolean) $result->row;\n\t \n\t}", "public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}", "function publisher_userIsAuthor($itemObj)\r\n{\r\n global $xoopsUser;\r\n return (is_object($xoopsUser) && is_object($itemObj) && ($xoopsUser->uid() == $itemObj->uid()));\r\n}", "protected function isBotOwner(User $user, Bot $bot)\n {\n return $user->id == $bot->user_id;\n }", "private function _ownedByCurrentUser($id) {\n if (empty($id)) {\n return false;\n }\n $queryResult = $this->Entries->findById($id)->limit(1);\n foreach ($queryResult as $entry) {\n if ($entry['user_id'] === $this->Auth->user('id')) {\n return true;\n }\n }\n return false;\n }", "function canArchive($user) {\n if($this->isOwner()) {\n return false;\n } else {\n return $user->isPeopleManager();\n } // if\n }", "public function isOwnerOf( $attr )\n {\n // SOL TICKET #2\n // Dependiendo del tipo de relacion se si un objeto es duenio de otro:\n // - 1) Si la relacion es A (1)->(1) B entonces se necesita belongsTo explicito para no salvar en cascada relaciones que en realidad son blandas (p.e. modelado de *->1 donde el lado * en realidad es blando). (desde el modelo, esto es igual a (*)->(1))\n // - 2) Si la relacion es A (1)<->(1) B entonces se necesita belongsTo para saber cual es el lado fuerte.\n // - 3) Si la relacion es A (1)->(*) B entonces B belongsTo A.\n // - 4) Si la relacion es A (1)<->(*) B entonces B belongsTo A.\n // - 5) Si la relacion es A (*)->(*) B entonces B belongsTo A. (desde el modelo, es lo mismo que (1)->(*))\n // - 6) Si la relacion es A (*)<->(*) B entonces se necesita belongsTo en algun lado.\n //\n // La clase actual es A, el obj es de clase B.\n\n $_thisClass = get_class($this); //self::$thisClass; // get_class da PO, deberia usar otro valor y no la clase...\n\n // Verifico si tengo el atributo y esta en una relacion (hasMany o hasOne).\n //\n if (array_key_exists( $attr, $this->hasOne ))\n {\n $obj = new $this->hasOne[$attr]();\n\n // Si la relacion es unidireccional, se es duenio del otro solo si el otro declara belongsTo mi clase.\n if ($obj->hasOneOfThis( $_thisClass )) // 2) bidireccional 1..1\n {\n return $obj->belonsToClass( $_thisClass ); // Si el objeto que quiero saber si soy duenio pertenece a mi => si soy duenio de el.\n }\n else // 1) unidireccional 1..1\n {\n //return true;\n return $obj->belonsToClass( $_thisClass ); // Ahora se pide belongsTo obligatorio para 1..1 unidireccional (esto evita que se salven en cascada links que realmente son blandos)\n }\n }\n else if (array_key_exists( $attr, $this->hasMany ))\n {\n // Si tengo una relacion hasMany con migo mismo, tengo 1->* o *->*, para ambos casos debería devolver true.\n if ($this->hasMany[$attr] == $_thisClass) return true;\n \n $obj = new $this->hasMany[$attr]();\n\n if ($obj->hasOneOfThis( $_thisClass )) // 4) bidireccional 1..*\n {\n return true;\n }\n else\n {\n // 6) bidireccional *..*\n if ($obj->hasManyOfThis( $_thisClass ))\n {\n return $obj->belonsToClass( $_thisClass ); // problema: get_class(this) tira PO...\n }\n else // casos 3 o 5, como es unidireccional, toma el control la clase del lado que no es visto de la otra.\n {\n return true;\n }\n }\n }\n\n // Si llega aca deberia tirar un warning xq el atributo que me pasaron no es de una relacion...\n return false;\n \n }", "private function _isOwner(&$row, $user = null)\n {\n if (!array_key_exists($this->owner_field, $row)) {\n // No owner field found: error\n return null;\n }\n\n isset($user) || $user = TIP::getUserId();\n if ($row[$this->owner_field] != $user) {\n // Owner and user do not match: return \"not owned row\" condition\n return false;\n }\n\n if ($this->privilege == TIP_PRIVILEGE_MANAGER ||\n $this->privilege == TIP_PRIVILEGE_ADMIN ||\n is_null($this->ownership_expiration)) {\n // Ownership does not expire: return \"owned row\" condition\n return true;\n }\n\n if (!array_key_exists($this->creation_field, $row)) {\n // Ownership expiration set but creation field not found: error\n return null;\n }\n\n // Check if the ownership expired\n $creation = TIP::getTimestamp($row[$this->creation_field], 'sql');\n if (is_null($creation)) {\n // TIP::getTimestamp() failed: error\n return null;\n }\n\n $expiration = strtotime($this->ownership_expiration, $creation);\n if ($expiration === false) {\n // strtotime() failed (wrong expiration format?): error\n return null;\n }\n\n // The row is owned only if now is before the expiration time\n return time() < $expiration;\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function owns(Model $model)\n {\n return $this->id == $model->user_id;\n }", "public function has_access($owner, $name) {\n $stmt = $this->pdo->prepare('select * from share where owner_id = :owner_id and user_id = :id and file_id in (select id from file where owner_id = :owner_id and filename = :name)');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':owner_id', $owner->id);\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return count($res) == 1;\n }", "public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }", "private static function canAccess($request, $address){\n $currentUser_Account = $request->user;\n $user = $address->get_user();\n return ($user != null && $currentUser_Account->getId() === $user->getId()) || User_Precondition::ownerRequired($request);\n }", "public function OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }", "public function viewableByOwnerOnly();", "function setOwner($user) \n {\n return $this->instance->setOwner($user);\n }", "private function _checkOwnerShip($targetId, $userRole, $entityId){\n\n $target = 'Users';\n $associationRoute = $this->_getFromKnownRoutes($this->reqController, $userRole); \n if(!$associationRoute){\n $associationRoute = $this->_getAssociationRoute($this->reqController, $target, [], []);\n }\n if(!$associationRoute){\n return true;\n }\n if ($associationRoute == $target) {\n if($targetId == $entityId){\n return true;\n }\n return false;\n\n }elseif ($associationRoute[0] == $target && count($associationRoute) == 1) {\n $direct = true;\n $tableObject = TableRegistry::get($this->reqController);\n $associations = $tableObject->associations();\n $foreignKey = $associations->get($target)->foreignKey();\n $entity = $tableObject->findById($entityId)->where([$foreignKey => $targetId])->first();\n\n } else{\n $direct = false;\n $pathToModel = $this->_decorateRoute($associationRoute);\n $tableObject = TableRegistry::get($this->reqController);\n $entity = $tableObject->findById($entityId)->matching($pathToModel, function($q) use ($targetId, $target){\n return $q->where([$target.'.id' => $targetId]);\n })->first();\n }\n\n //Check Vendor OwnerShip\n if(isset($entity) && $entity){\n return true;\n }\n unset($entity);\n //Check Super Admin OwnerShip\n \n return false;\n }", "public function isOwner($id, $login){ \n $q = $this->slcOrdrFild(\"author\", $id);\n return $this->check($q, $login);\n }", "public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }", "function check_owner ($username, $domain)\n{\n $result = db_query (\"SELECT * FROM domain_admins WHERE username='$username' AND domain='$domain' AND active='1'\");\n if ($result['rows'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "public function owns($article)\n {\n return $this->id == $article->user_id;\n }", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "function canEdit($user) {\n if($user->getId() == $this->getId()) {\n return true; // user can change his own account\n } // if\n\n return $user->isCompanyManager($this->getCompany());\n }", "public function owner(User $user, Task $task){\n return $user->id === $task->user_id; //validar que sea el mismo dueño de esa informacion.\n }", "function canBeAccessedByUser($user)\n\t{\n\t\tif($user->isRoot())\n\t\t\treturn true;\n\n\t\tif($this->get('id') == $this->root_group_id)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "private function isFileOwner($id){\n $query = \\Drupal::database()->select('ol_file', 'fr');\n $query->addField('fr', 'user_id');\n $query->condition('fr.id', $id);\n $uid = $query->execute()->fetchField();\n return ($uid == $this->current_user->id());\n }", "public function isFriendOf($user_guid);", "function verify_objects ($conn, $username) {\n\t\t$sql = \"select count(*) as count from all_objects where owner = upper(:username)\";\n\t\t$stmt = oci_parse($conn->dbconn, $sql);\n\t\toci_bind_by_name($stmt, \":username\", $username);\n\t\toci_execute($stmt, OCI_DEFAULT);\n\t\twhile (($row = oci_fetch_array($stmt, OCI_BOTH)) != false) \n\t\t\t$count = $row['COUNT'];\n\t\tif ($count === \"0\")\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function isBelongingTo(User $user)\r\n {\r\n return true;\r\n }", "function otherUserCanViewIssue( $user, $issueID ) {\r\n\t\t$query= \"SELECT Level FROM issues WHERE ID = '$issueID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$value = mysql_fetch_array($result);\r\n\t\textract($value);\r\n\t\t$query2 = \"SELECT Creator FROM issues WHERE ID = '$issueID'\";\r\n\t\t$result2 = mysql_query($query2);\r\n\t\t$value2 = mysql_fetch_array($result2);\r\n\t\textract($value2);\r\n\t\t$userID = $_SESSION['userid'];\r\n\t\tif($Level == 'A')\r\n\t\t\tif($this->getUserAccessLevel($user) > 7 || $this->getUserAccessLevel($user) == 5)\r\n\t\t\t\treturn TRUE;\r\n\t\t\telseif($Creator == $userID)\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\t\telseif($Level == 'B')\t\r\n\t\t\treturn $this->getUserAccessLevel($user) > 3;\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "public function isUserAssignable()\r\n {\r\n return strpos($this->assignRole,'ROLE_USER') !== false ? true : false;\r\n }", "public function iN_CheckChatUserOwnersID($userID, $chatID) {\n\t\t$chatID = mysqli_real_escape_string($this->db, $chatID);\n\t\tif($this->iN_CheckChatIDExist($chatID) == '1'){\n $query = mysqli_query($this->db,\"SELECT user_one, user_two FROM i_chat_users WHERE chat_id = '$chatID' AND (user_one = '$userID' OR user_two = '$userID')\") or die(mysqli_error($this->db));\n\t\t if(mysqli_num_rows($query) == '1'){\n return true;\n\t\t }else{\n\t\t\t return false;\n\t\t }\n\t\t}\n\t}" ]
[ "0.73773444", "0.729978", "0.72988683", "0.72786283", "0.7213585", "0.7178543", "0.7029212", "0.70000166", "0.6997243", "0.6941019", "0.68980515", "0.67981243", "0.6788356", "0.6753567", "0.67530346", "0.6751261", "0.67500144", "0.6718592", "0.6717396", "0.66925955", "0.6673843", "0.6661762", "0.665275", "0.6584906", "0.6565118", "0.6557074", "0.6551516", "0.6551218", "0.65504736", "0.65467376", "0.65456086", "0.65351576", "0.65160453", "0.64708155", "0.6462819", "0.6459525", "0.64470196", "0.64437556", "0.6438273", "0.6433505", "0.6386454", "0.6351042", "0.6345428", "0.6330754", "0.63223845", "0.63209563", "0.6316564", "0.63114583", "0.6281151", "0.62773365", "0.6274557", "0.6262006", "0.6222536", "0.62219626", "0.6207701", "0.6206848", "0.6198087", "0.61877793", "0.61368436", "0.6130371", "0.61257654", "0.6113839", "0.61058056", "0.610204", "0.6089363", "0.60832787", "0.6071654", "0.60446304", "0.60317594", "0.6016173", "0.60153687", "0.60126", "0.6012492", "0.59893423", "0.59830713", "0.597085", "0.59610164", "0.5951761", "0.59455687", "0.5929175", "0.59248805", "0.5922708", "0.5900865", "0.58986455", "0.58798766", "0.5869237", "0.5864768", "0.5813811", "0.58135474", "0.58135474", "0.5807196", "0.5790757", "0.5786235", "0.57848084", "0.5780422", "0.5778081", "0.57777214", "0.57622665", "0.5756495", "0.57495564" ]
0.80140126
0
Check if userA is worker of userB
public function isWorker(User $userA, User $userB) { return $userA->user_uuid === $userB->uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function isWorker(User $u = null) {\n\t\tif($u === null) $u = User::load();\n\t\treturn $u->isWorker();\n\t}", "public function actingAsWorker()\n {\n $user = User::where('email', UserTableSeeder::WORKER_CREDENTIALS['email'])->firstOrFail();\n\n return $this->actingAs($user);\n }", "static function customer(User $u = null) {\n\t\tif($u === null) $u = User::load();\n\t\treturn !$u->isWorker();\n\t}", "public function worker(){ \n return $this->hasOne('App\\Models\\User','id','worker_id');\n }", "function isVisible() {\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\t\n\t\tif(empty($worker)) {\n\t\t\treturn false;\n\t\t} elseif($worker->is_superuser) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isParticipant(UserInterface $user);", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "public function hasUser();", "function can_message_each_other($user_id1, $user_id2) {\n\n\tif (user_is_at_least_role(ROLE_ADMIN, $user_id1) || user_is_at_least_role(ROLE_ADMIN, $user_id2)) {\n\t\t// Everyone can talk to an admin\n\t\treturn true;\n\t} else if (get_relationship($user_id1, $user_id2) == LIKE && get_relationship($user_id2, $user_id1) == LIKE) {\n\t\t// If they like each other mutually\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function isRunningSchedulerWorker()\n {\n $pids = $this->redis->hKeys(self::$workerKey);\n $schedulerPid = $this->redis->get(self::$schedulerWorkerKey);\n\n if ($schedulerPid !== false && is_array($pids)) {\n if (in_array($schedulerPid, $pids)) {\n return true;\n }\n // Pid is outdated, remove it\n $this->unregisterSchedulerWorker();\n return false;\n }\n return false;\n }", "public function isAssignee(UserInterface $user);", "function buddy($userid){\n \t//of user with id=$_SESSION[userid]\n \t\n \t$buddies = $this->buddyListArray();\n\t\n\tif(in_array($userid, $buddies) OR $userid == getUser()){\n\t\treturn true;\n\t}\n return false;\n }", "function otherUserIsWatchingIssue( $user, $issueID ) {\r\n\t\tif(empty($this->link)){\r\n\t\t\techo \"Not connected to database. Unexpected error. Contact your system administrator.\";\r\n\t\t\texit;\t\r\n\t\t}\r\n\t\t$query = \"SELECT issueid FROM issuewatch WHERE userid='$user' and issueid='$issueID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\treturn mysql_num_rows($result) > 0;\r\n\t\t\r\n\t}", "public function isOwnedBy(UserInterface $user);", "private function checkWorkers() {\n global $workers;\n $living = array();\n\n // Find any dead workers\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->debug(\"Checking worker $workerID (pid $pid)\");\n\n // Check if this worker still exists as a process\n if (pcntl_waitpid($pid, $status, WNOHANG|WUNTRACED) === $pid) {\n // If the worker exited normally, stop tracking it\n if (pcntl_wifexited($status) && pcntl_wexitstatus($status) === 0) {\n gosUtility_parallel::$logger->info(\"Worker $workerID (pid $pid) exited normally\");\n unset($workers[$workerID]);\n }\n }\n\n // If it has a session ID, then it's still living\n if (posix_getsid($pid))\n $living[] = $pid;\n }\n\n // Start new workers to replace dead ones\n $dead = array_diff($workers, $living);\n foreach ($dead as $workerID => $deadPID) {\n gosUtility_parallel::$logger->warn(\"Worker $workerID (pid $deadPID) died. Conscripting replacement...\");\n\n unset($workers[$workerID]);\n $this->startWorker($workerID);\n }\n }", "private function _isMine(): bool {\n\t\treturn $this->isMyServer() && $this->isMyPID();\n\t}", "public function hasJob(): bool;", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "public function isOwner(User $userA, User $userB)\n {\n return $userA->uuid === $userB->user_uuid;\n }", "public function isJoin();", "public function workers()\n {\n return $this->belongsToMany(\"App\\User\")\n ->where(\"owner_id\", Auth::id());\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "function user_active($user){\n global $ini;\n $MSGKEY = $ini[$user]['queue_id'];\n if (msg_queue_exists($MSGKEY)){\n $queue = msg_get_queue($MSGKEY); \n $queue_status = msg_stat_queue($queue);\n if((time() - $queue_status['msg_ctime']) <= 2)return TRUE;\n }\n return FALSE;\n}", "private function isUser() : bool\n {\n return $this->role('user');\n }", "function wp_sub_user_exists_on_site( int $user_id, int $site_id ) : bool {\n\t$allowed = in_array( $site_id, get_user_meta( $user_id, \\WP_SUB\\WP_Separate_User_Base::SITE_META_KEY, false ) );\n\n\treturn apply_filters( 'wp_sub_user_exists_on_network', $allowed, $user_id, $site_id );\n}", "public function userCanRequest($user)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$id = $this->userCanInitiateProcess($user);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true ;\n\t}", "function isSubmittedBy();", "public function isParticipant()\n {\n if($this->hasRole('Participant'))\n return true;\n else\n return false;\n }", "public function isUserWinner() {\n if($this->winnerType == \"player\" && $this->winnerID == CD()->id) {\n return true;\n }\n return false;\n }", "public function hasGotSupervisor($userid)\n {\n return is_object(R::findOne('finalchoice', 'user_id=? AND supervisor_id IS NOT NULL', [$userid]));\n }", "public function isSchedulerWorker($worker)\n {\n list($host, $pid, $queue) = explode(':', (string)$worker);\n return $pid === $this->redis->get(self::$schedulerWorkerKey);\n }", "public function isprojectsupervisor()\n {\n return $this->hasuser() && $this->user()->isprojectsupervisor();\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "public static function Match($userOne, $userTwo): bool\n\t{\n\t\treturn $userOne->Username == $userTwo->Username\n\t\t && get_class($userOne) == get_class($userTwo);\n\t}", "function canSendWelcomeMessage($user) {\n return $user->isPeopleManager() || $user->isCompanyManager($this->getCompany());\n }", "static function user_already_has_a_relationship_with($user1, $user2) {\n global $con;\n\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `relationship` WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\";\";\n $query = mysqli_query($con, $sql);\n if (mysqli_fetch_object($query)->count == 0) {\n return false;\n }\n return true;\n }", "function wp_sub_user_exists_on_network( int $user_id, int $network_id ) : bool {\n\t$networks = (array) get_user_meta( $user_id, \\WP_SUB\\WP_Separate_User_Base::NETWORK_META_KEY, false );\n\t$networks = array_filter( $networks );\n\n\t$allowed = in_array( $network_id, $networks );\n\treturn apply_filters( 'wp_sub_user_exists_on_network', $allowed, $user_id, $network_id );\n}", "public function isUserAssignable()\r\n {\r\n return strpos($this->assignRole,'ROLE_USER') !== false ? true : false;\r\n }", "function otherUserCanWatchIssue( $user, $issueID ) {\r\n\t\treturn $this->otherUserCanViewIssue( $user, $issueID );\r\n\t}", "public function currentUserHasManagerAccess()\n {\n $user = Service::getCurrentUser();\n \n if (!$user) {\n return false;\n }\n \n if ($this->userManagesSite($user)) {\n return true;\n }\n \n if ($user->isAdmin()) {\n return true;\n }\n \n return false;\n }", "public static function exists($workerId)\n\t{\n\t\treturn (bool)Resque::redis()->sismember('workers', $workerId);\n\t}", "function friendable($user1ID, $user2ID) {\n if($user1ID == $user2ID) {\n return false;\n }\n $db = new DataBase();\n\n $sql = 'SELECT COUNT(*) as count FROM Friends WHERE userID = \\'' . $user1ID . '\\' AND friendID = \\'' . $user2ID . '\\'';\n $result = $db->select($sql);\n\n if($result['count'] == 0) {\n return true;\n }\n\n return false;\n }", "function is_pro_user($user_id = false) {\r\n\t\tglobal $wpdb, $current_user, $current_site;\r\n\r\n\t\tif ( !$user_id ) {\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t}\r\n $user_id = intval($user_id);\r\n\r\n\t\tif ( is_super_admin($user_id) )\r\n\t\t\treturn true;\r\n\r\n\t\t//very db intensive, so we cache (1 hour)\r\n\t\t$expire_time = time()-3600;\r\n\t\t@list($expire, $is_pro) = get_user_meta($user_id, 'psts_user', true);\r\n\t\tif ($expire && $expire >= $expire_time) {\r\n\t return $is_pro;\r\n\t }\r\n\r\n\t\t//TODO - add option to select which user levels from supporter blog will be supporter user. Right now it's all (>= Subscriber)\r\n\t\t//$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE 'wp_%_capabilities' AND `meta_value` LIKE '%administrator%'\");\r\n\t\t$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE '{$wpdb->base_prefix}%_capabilities'\");\r\n\t if (!$results) {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0));\r\n\t return false;\r\n\t }\r\n\r\n\t foreach ($results as $row) {\r\n\t\t $tmp = explode('_', $row->meta_key);\r\n\t\t //skip main blog\r\n\t\t if ($tmp[1] != $current_site->blogid)\r\n\t $blog_ids[] = $tmp[1];\r\n\t }\r\n\t $blog_ids = implode(',',$blog_ids);\r\n\r\n\t $count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"' AND blog_ID IN ($blog_ids)\");\r\n\t if ($count) {\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 1)); //update cache\r\n\t return true;\r\n\t } else {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0)); //update cache\r\n\t return false;\r\n\t }\r\n\t}", "public function issupervisor($userid)\n {\n return is_object(R::findOne('role', 'user_id = ? AND rolename_id = ?', [$userid, '6']));\n }", "protected function checkSchedulerUser() {}", "public function isUserPlayer()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'P');\n\t}", "public function isBelongingTo(User $user)\r\n {\r\n return true;\r\n }", "public abstract function hasWaitingLobby(): bool;", "private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}", "public function hasPartinUsers(){\n return $this->_has(2);\n }", "public function isMySelf(): bool\n\t{\n\t\tif (auth()->user()) return ($this->id === auth()->id());\n\n\t\treturn false;\n\t}", "public function isResearcher(){\n\t\t$member = Member::CurrentUser();\n\t\t$group = SiteConfig::current_site_config()->ResearchGroup();\n\t\tif($group && $member){\n\t\t\treturn $member->inGroup($group->Code);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}", "function wp_sub_user_exists( int $user_id, int $network = 0, int $site = 0 ) : bool {\n\t$callers = wp_list_pluck( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), 'function' );\n\tarray_shift( $callers );\n\n\t// Prevent recursions\n\tif ( in_array( __FUNCTION__, $callers ) ) {\n\t\treturn true;\n\t}\n\n\t// Fill defaults\n\tif ( empty( $network ) ) {\n\t\t$network = get_current_site()->id;\n\t}\n\n\tif ( empty( $site ) ) {\n\t\t$site = get_current_blog_id();\n\t}\n\n\t$allowed = false;\n\n\tif ( is_super_admin( $user_id ) ) {\n\t\t$allowed = true;\n\t} else if ( wp_sub_user_exists_on_network( $user_id, $network ) ) {\n\t\t// Check if user can access network\n\t\t$allowed = true;\n\t} else if ( wp_sub_user_exists_on_site( $user_id, $site ) ) {\n\t\t// Check if user can access site\n\t\t$allowed = true;\n\t}\n\n\treturn apply_filters( 'wp_sub_user_exists', $allowed, $user_id, $network, $site );\n}", "function is_pro_user($user_id = false) {\r\n global $psts;\r\n\treturn $psts->is_pro_user($user_id);\r\n}", "public function belongsTo($userid) {\n return ($this->sender_id == $userid || in_array($userid, $this->recipientIds));\n }", "function isUserfollowing($userA, $userB)\n{\n global $conn;\n\n $sql = \"SELECT * FROM `user_follows` WHERE userA=$userA AND userB=$userB\";\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) == 0) {\n\n # userA is not following\n return false;\n } else {\n\n # userA is following\n return true;\n }\n}", "public function testServersUserIsASubuserOfAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = factory(User::class)->times(3)->create();\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n ];\n\n // Set user 0 as a subuser of server 1. Thus, we should get two servers\n // back in the response when making the API call as user 0.\n Subuser::query()->create([\n 'user_id' => $users[0]->id,\n 'server_id' => $servers[1]->id,\n 'permissions' => [Permission::ACTION_WEBSOCKET_CONNECT],\n ]);\n\n $response = $this->actingAs($users[0])->getJson('/api/client');\n\n $response->assertOk();\n $response->assertJsonCount(2, 'data');\n $response->assertJsonPath('data.0.attributes.server_owner', true);\n $response->assertJsonPath('data.0.attributes.identifier', $servers[0]->uuidShort);\n $response->assertJsonPath('data.1.attributes.server_owner', false);\n $response->assertJsonPath('data.1.attributes.identifier', $servers[1]->uuidShort);\n }", "public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }", "public function broadcastWhen() {\n $return = false;\n $ids_to_broadcast = [$this->message->userId, $this->message->receiverUserId];\n if (in_array($this->message->userId, $ids_to_broadcast) || in_array($this->message->receiverUserId, $ids_to_broadcast)) $return = true;\n return $return;\n }", "function wac_is_tenant($user=''){\n\t if ($user && !empty($user)) {\n\t\tif (!is_object($user)) {\n\t\t\t$user = new WP_User(absint($user));\n\t\t}\n\t\treturn (is_array($user->roles) && in_array('subscriber', $user->roles));\n\t} else {\n\t\treturn false;\n\t}\n}", "public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }", "public function hasJob($name);", "public function isMember()\n {\n return $this->role == 3;\n }", "public function OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }", "public function isReporter(UserInterface $user);", "protected function do_can_execute($user) {\r\n \t\t$ret = false;\r\n \t\t$inst = $this->get_instance();\r\n \t\tif ($inst instanceof IStatusHolder) {\r\n \t\t\t$new_status = $this->get_params();\r\n\t\t\t$ret = ($inst->get_status() != $new_status);\r\n\t\t\t// Note that functions below are not be called, if $ret becomes false\t\r\n \t\t\t$ret = $ret && parent::do_can_execute($user);\r\n\t\t\t$ret = $ret && $this->do_can_execute_status($user, $inst, $new_status);\r\n \t\t}\r\n \t\treturn $ret;\r\n \t}", "public function hasuser()\n {\n return is_object($this->luser);\n }", "function isLeader(User $user) {\n return $user instanceof User && $this->object->getLeaderId() == $user->getId();\n }", "static function user_has_added_user($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 1);\n }", "public function create(User $user, Workout $workout)\n {\n return (auth()->user()->id === $workout->user->id);\n }", "static function users_have_added_them_both($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1 OR \n `user2` = \".$user1.\" AND `user1` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 2);\n }", "public function isProcessInstance();", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "public function isActiveMember(Users $user)\n {\n }", "public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }", "public function isMaster();", "function has_schedule_caps( $user_id ) {\r\n $is_ok = true;\r\n \r\n //Treat super admins\r\n if( is_super_admin( $user_id ) ) {\r\n $this->add_schedule_caps( $user_id );\r\n }\r\n \r\n $user = new WP_User( $user_id );\r\n foreach( $this->caps as $c )\r\n if ( !$user->has_cap( $c ) )\r\n $is_ok = false;\r\n \r\n if( !get_option( 'bpsp_allow_only_admins' ) )\r\n if( !bp_group_is_admin() )\r\n $is_ok = false;\r\n \r\n return $is_ok;\r\n }", "public function isUserMemberAllowedAccess()\n\t{\n\t\t$BlockedEmployeeStatuses \t=\tarray\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t'Locked:Excessive-Login-Attempts',\n\t\t\t\t\t\t\t\t\t);\n\n\t\treturn (\t$this->getSiteUser()->getUserMemberID()*1 > 0\n\t\t\t\t&& \t!in_array\n\t\t\t\t\t(\n\t\t\t\t\t\t$this->getEmployeeStatusByMemberID($this->getSiteUser()->getUserMemberID()),\n\t\t\t\t\t\t$BlockedEmployeeStatuses\n\t\t\t\t\t)\n\t\t\t\t\t? \tTRUE\n\t\t\t\t\t: \tFALSE);\n\t}", "public function isHoneysWith(User $user)\n {\n return (DB::table('userlink')\n ->where(['user1' => $user->id, 'user2' => $this->id])\n ->orwhere(['user2' => $user->id, 'user1' => $this->id])\n ->count() !=0 );\n }", "function can_do_listinstancejobs() {\n if (has_capability('block/php_report:manageschedules', get_context_instance(CONTEXT_SYSTEM))) {\n //user can manage schedules globally, so allow access\n return true;\n }\n\n //obtain the report shortname and instance\n $report_shortname = $this->required_param('report', PARAM_ALPHAEXT);\n $report_instance = php_report::get_default_instance($report_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n\n //false is returned in the case of permissions failure\n return $report_instance !== false;\n }", "public function ownedBy(User $user){\n\n\t\treturn $this->user_id == $user->id;\n\n\t}", "public function isFriendsWith($user_guid);", "public function isUttMember()\n\t{\n\t\treturn $this->isUser() && ! $this->user->getIsStudent() && ! $this->user->getKeepActive();\n\t}", "public function getWorker();", "public function getWorker();", "public function isShared() : bool;", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "public function isSelf()\n {\n return $this->auth->isAssociate() && $this->auth->info('id') == $this->associate->getId();\n }", "public function isParticipating($id_user, $id_event) {\n \t//$participants = Participant::where('id_user', '=', $id_user, 'AND', 'id_event', '=', $id_event)->get();\n $participants = Participant::whereRaw('id_user =' . $id_user . ' and id_event=' . $id_event)->get();\n\n \treturn count($participants) >= 1;\n }", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "public function isNeedToSendPush($user_id);", "protected function salonAuthUser() : SalonWorker\n {\n return $this->createProfessionalNotAdmin(['salon_id' => $this->salon->id]);\n }", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "public static function isSharedWithUser($a_usr_id,$a_calendar_id)\r\n\t{\r\n\t\tglobal $ilDB,$rbacreview;\r\n\t\t\r\n\t\t$query = 'SELECT * FROM cal_shared '.\r\n\t\t\t\"WHERE cal_id = \".$ilDB->quote($a_calendar_id ,'integer').\" \";\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$obj_ids[$row->obj_id] = $row->obj_type;\r\n\t\t}\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($a_usr_id);\r\n\t\tforeach($obj_ids as $id => $type)\r\n\t\t{\r\n\t\t\tswitch($type)\r\n\t\t\t{\r\n\t\t\t\tcase self::TYPE_USR:\r\n\t\t\t\t\tif($a_usr_id == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::TYPE_ROLE:\r\n\t\t\t\t\tif(in_array($id,$assigned_roles))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "public function isEqualTo(UserInterface $user): bool;", "public function join(User $user, User $model) {\n if ($user->hasRole(AuthServiceProvider::ADMIN)) return true;\n if ($user->hasPermissionTo('benutzer-bearbeiten')) return true;\n }", "public function isSubscribed()\n {\n // TODO there seems to be an inconsistency when getting database records via Repository or via ObjectStorage\n // TODO when getting via Repository, a Typo3bb-FrontendUser is returned\n // TODO when getting via ObjectStorage, IglarpTemplate-FrontendUser is returned\n $user = FrontendUserUtility::getCurrentUser();\n if (is_null($user)) {\n return false;\n } else {\n return $this->subscribers->contains($user);\n }\n }", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "protected function owner_matches_current_user()\n {\n }" ]
[ "0.70354295", "0.643147", "0.62396526", "0.5804154", "0.5792822", "0.5654928", "0.5624355", "0.5523166", "0.5380856", "0.5371569", "0.5357272", "0.5354128", "0.53426313", "0.5315583", "0.5297405", "0.529039", "0.5287794", "0.5270491", "0.52415025", "0.5238871", "0.52181643", "0.5200574", "0.51997733", "0.5196693", "0.5187125", "0.5181197", "0.5168674", "0.51672655", "0.5166557", "0.5154989", "0.5144666", "0.5127698", "0.5127239", "0.51260823", "0.51160216", "0.5114781", "0.5113957", "0.51129216", "0.5103733", "0.5102308", "0.51016927", "0.5096707", "0.5091007", "0.508193", "0.50790465", "0.50789297", "0.50762737", "0.5058512", "0.504606", "0.5042704", "0.5030598", "0.50294334", "0.50241965", "0.5023627", "0.50222754", "0.5021984", "0.5008763", "0.5008613", "0.5008409", "0.50082785", "0.5005874", "0.49932858", "0.49903762", "0.4988707", "0.49685782", "0.4961145", "0.49584702", "0.4954396", "0.49536014", "0.49502915", "0.4935159", "0.49338996", "0.49302214", "0.49300072", "0.49278563", "0.49219173", "0.49189237", "0.4917276", "0.49162993", "0.4913699", "0.4905369", "0.4901654", "0.48991832", "0.4887894", "0.4887894", "0.48871398", "0.48826814", "0.4881598", "0.48810828", "0.4878862", "0.48768467", "0.48676395", "0.48671252", "0.4863378", "0.48632634", "0.48627758", "0.4858981", "0.48556626", "0.48542675", "0.48539945" ]
0.8376263
0
Check if device is property of user
public function isProperty(Model $model, User $user) { return $model->user_uuid === $user->uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function getIsUserAttribute()\n {\n return $this->attributes['user_type'] == '3';\n }", "abstract public function deviceExists($devId, $user = null);", "public function providerHasDevices(): bool;", "public function hasUserLoginToTwoDevices($user_id){\n $user = User::where(['name'=>$user_id])->withCount('devices')->first();\n if($user){\n //user found check number of devices\n if($user->devices_count == 2){\n return true;\n }else{\n return false;\n }\n }else {\n //user not found insert to device to database\n return false;\n }\n }", "function is_smartphone()\n {\n return dev::isSmartphone();\n }", "public function testGetDeviceType()\n {\n $this->assertEquals($this->attributes->name, $this->user->getDeviceType());\n }", "public function doesUserAssociationExist(){\r\n\t\tif($this->userDevices){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getHasPhysicalDevice()\n {\n if (array_key_exists(\"hasPhysicalDevice\", $this->_propDict)) {\n return $this->_propDict[\"hasPhysicalDevice\"];\n } else {\n return null;\n }\n }", "public function hasuser()\n {\n return is_object($this->luser);\n }", "public static function check ()\n {\n return (bool)self::$user;\n }", "public function isDevice($device) \r\n {\r\n $var = 'is' . ucfirst($device);\r\n $return = (bool) preg_match('/' . $this->mobileDevices[$device] . '/i', $this->userAgent);\r\n\r\n if ($device != 'generic' && $return == true) \r\n\t{\r\n\t $this->isGeneric = false;\r\n }\r\n return $return;\r\n }", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}", "public function isSystem()\n {\n return $this->getAttribute('id') == self::SYSTEM_USER_ID;\n }", "protected function isUser($user, $property = 'username')\n\t{\n\t\tswitch ( Stringify::lowercase($property) ) {\n\t\t\tcase 'username':\n\t\t\t\treturn username_exists(sanitize_user($user));\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\treturn email_exists($user);\n\t\t\t\tbreak;\n\t\t\tcase 'id':\n\t\t\t\t$id = (int)$user;\n\t\t\t\t$user = new WP_User($id);\n\t\t\t\treturn $user->exists();\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "public function hasUser();", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "static public function IsValidDeviceID() {\n if (self::GetDeviceID() === \"validate\" || self::GetDeviceID() === \"webservice\")\n return false;\n else\n return true;\n }", "public function is_connected($user_id){\n return (bool) get_user_meta($user_id, $this->umeta_id, true);\n }", "public function isMobileDevice()\n\t{\n\n\t\tif (isset($this->_properties['mobileDevice']) &&\n\t\t\t$this->_properties['mobileDevice'] == TRUE) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "function wac_is_vendor($uid=''){\n\t$cUID = (!empty($uid))? $uid : get_current_user_id();\n\tif(is_user_wcmp_vendor( $cUID )){\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "public function hasMultipleDevices()\n {\n return false;\n }", "function getUserDevice()\n {\n $userAgent = Request()->header('User-Agent');\n $agent = new Agent();\n\n if ($agent->isMobile($userAgent)) {\n return 'mobile';\n } else {\n return 'desktop';\n }\n\n }", "function isMobile($ua)\n{\n global $defaultJSON;\n $isMob='0'; \n $tree = Mobi_Mtld_DA_Api::getTreeFromFile($defaultJSON);\n if (Mobi_Mtld_DA_Api::getProperty($tree,$ua,\"mobileDevice\")=='1')\n $isMob='1';\n return $isMob;\n}", "public function hasdeveloper()\n {\n return $this->hasuser() && $this->user()->isdeveloper();\n }", "private function _isMobile(){\n\t\t/* getting user agent reference */\n\t\t$this->load->library('user_agent');\n\t\t\n\t\t/* return the requested device type */\n\t\treturn $this->agent->is_mobile();\n\t}", "public function isUserManager()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'M');\n\t}", "public function isSystemUser(): bool\n {\n return $this->system;\n }", "public function getOwnAccountProperty()\n {\n return $this->staff->id == Auth::user()->id;\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public static function hasProperty($userId) {\n\t\t$criteria = new CDbCriteria ();\n\t\t$criteria->condition = 'user_id=:userId';\n\t\t$criteria->params = array (':userId' => $userId );\n\t\t$properties = Property::model ()->findAll ( $criteria );\n\t\tif ($properties)\n\t\treturn true;\n\t\telse\n\t\treturn false;\n\t}", "abstract function getUserProfileProperty($user, $property_name);", "public function checkIOSCustomers(){\n $user = Customer::where('id', $this->authUser->id)->first();\n if (!empty($user) && count($user->toArray()) > 0) {\n $user->device_token = '';\n $user->acesstype = \"mobile\";\n $user->device_type = $this->request->device_type;\n return ($user->save()) ? $user->makeHidden([ 'id','access_token' ]) : 0;\n }else{\n return false;\n }\n }", "public function deviceConditionMatchesRobot() {}", "public function deviceConditionMatchesRobot() {}", "public function isFromVendor(): bool;", "public function val_user_identity($value) {\n $value = strtolower($this->input->prepare_user_identity_phone($value));\n if (empty($value)) return false;\n\n $this->load->model('user_model');\n if ($this->user_model->is($value) || $this->user_model->is_dod($value)) return false;\n \n return true;\n }", "public static function is_mobile() {\n\t\t//If is the first checking\n\t\tif (self::$mobile==null) {\n\t\t\t//If exists the variable nomob\n\t\t\tif (GET::exists('nomob')) {\n\t\t\t\t//Se the user is from a PC\n\t\t\t\tCOOKIE::set('ale_mobile','false',30*24*60);\n\t\t\t\tself::$mobile=false;\n\t\t\t} else {\n\t\t\t\t//Check if was calculated the device of the user\n\t\t\t\tif (COOKIE::exists('ale_mobile'))\n\t\t\t\t\tself::$mobile=COOKIE::val('ale_mobile')=='true';\t//Set the old value\n\t\t\t\telse {\n\t\t\t\t\t//Find what device is\n\t\t\t\t\tself::$mobile = false;\n\t\t\t\t\t//List of devices\n\t\t\t\t\t$devices = array(\n\t\t\t\t\t\t\t\"Android\" => \"android.*mobile\",\n\t\t\t\t\t\t\t\"Androidtablet\" => \"android(?!.*mobile)\",\n\t\t\t\t\t\t\t\"Blackberry\" => \"blackberry\",\n\t\t\t\t\t\t\t\"Blackberrytablet\" => \"rim tablet os\",\n\t\t\t\t\t\t\t\"Iphone\" => \"(iphone|ipod)\",\n\t\t\t\t\t\t\t\"Ipad\" => \"(ipad)\",\n\t\t\t\t\t\t\t\"Palm\" => \"(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)\",\n\t\t\t\t\t\t\t\"Windows\" => \"windows ce; (iemobile|ppc|smartphone)\",\n\t\t\t\t\t\t\t\"Windowsphone\" => \"windows phone os\",\n\t\t\t\t\t\t\t\"Generic\" => \"(webos|android|kindle|mobile|mmp|midp|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap|opera mini|opera mobi)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t//If is from a wap connection\n\t\t\t\t\tif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\telseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') > 0 || strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') > 0) {\n\t\t\t\t\t\t//If accept a wap response is a mobile device\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Control all the devices to find it\n\t\t\t\t\t\tforeach ($devices as $device => $regexp) \n\t\t\t\t\t\t\tif(preg_match(\"/$regexp/i\", $_SERVER['HTTP_USER_AGENT'])) \n\t\t\t\t\t\t\t\tself::$mobile = true;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Set a cookie to not calculate again\n\t\t\t\tCOOKIE::set('ale_mobile',(self::$mobile)?'true':'false',30*24*60);\n\t\t\t}\n\t\t}\n\t\treturn self::$mobile;\n\t}", "private function isUser() : bool\n {\n return $this->role('user');\n }", "public function providerHasDevices(): bool\n {\n return $this->providerHasDevices;\n }", "function gupnp_root_device_get_available($root_device)\n{\n}", "public function userDevice()\n {\n return $this->hasOne(UserDevice::class);\n }", "public function hasUsershow(){\n return $this->_has(32);\n }", "function isUser(){\n\t\tif(isset($_SESSION['type']) && $_SESSION['type']=='user')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getIsAdminAttribute()\n {\n return $this->attributes['user_type'] == '1';\n }", "public function isLoginValid2($user_id,$device_id){\n\n $deviceLimit = 2;\n\n //retrive device or create new one if doesnt exist\n $params = [\n 'user_id' => $user_id,\n 'device_id' => $device_id\n ];\n \n $device = Device::where($params)->first();\n\n if (!$device) {\n\n // check if not exceed limit \n if (Device::where(['user_id'=>$user_id, 'is_banned'=>false])->count() <= $deviceLimit) {\n return true;\n }else{\n // the device is above llmit\n return false;\n }\n\n }else {\n // check if banned\n if ($device->is_banned) {\n // the device is banned user is not pemmitted to login\n return false;\n }else{\n return true;\n }\n }\n\n }", "public function view(User $user, DeviceParameter $deviceParameter)\n {\n return true; // TODO: Change as needed, but leave it true if no policy\n }", "public function validate_session_other_device($user, $ip)\n {\n if ($this->db->from('ec_client')->where(array('email' => $user, 'status' => 1, 'ip' => $ip))->count_all_results() > 0){\n return TRUE;\n }else if ($this->db->from('ec_client')->where(array('email' => $user, 'status' => 0, 'ip' => ''))->count_all_results() > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function getUserExiste(){\n return $this->userExist;\n }", "function is($prop){\n \treturn $this->get_property($prop)==1?true:false;\n }", "function _is_user_mac() {\n\t\treturn IMFORZA_Utils::is_user_mac();\n\t}", "static function checkPermissionWithSpecificProperty($pid)\n\t{\n if( !HelperOspropertyCommon::isAgent() && !HelperOspropertyCommon::isCompanyAdmin())\n\t\t{\n return false;\n }\n\t\telseif(HelperOspropertyCommon::isAgent())\n\t\t{ \n\t\t\t//is Agent\n if(HelperOspropertyCommon::isOwner($pid))\n\t\t\t{\n return true;\n }\n\t\t\telse\n\t\t\t{\n return false;\n }\n }\n\t\telseif(HelperOspropertyCommon::isCompanyAdmin())\n\t\t{\n if(HelperOspropertyCommon::isCompanyOwner($pid))\n\t\t\t{\n return true;\n }\n\t\t\telse\n\t\t\t{\n return false;\n }\n }\n }", "function is_iphone()\n {\n return dev::isIphone();\n }", "public function isUserProtected() {\n\t $mobileStatus = $this->getMobileUserStatus($this->getAuthUserId(), $this->getAuthUserEmail());\n\t return ($mobileStatus == RublonMagentoModule::YES ? RublonMagentoModule::PROTECTION_TYPE_MOBILE : RublonMagentoModule::PROTECTION_TYPE_EMAIL); \t \n\t}", "public function is_developer() {\n\t\treturn $this->user->exists() && in_array(self::DEVELOPER_ROLE_NAME, $this->user->roles);\n\t}", "public function check(HasDeviceIdRequest $request)\n {\n $device = $request->getDevice();\n return response()->json(['success' => $device && $device->user_id]);\n }", "public function hasUserCharacters(){\n $this->filter('userCharacters', ['active = ?', 1]);\n return is_object($this->userCharacters);\n }", "public function hasMobile(){\n return $this->_has(4);\n }", "public function checkForProfile()\n\t\t{\n\t\t\treturn (!Auth::user()->profiles) ? false : true;\n\t\t}", "function usr_has_profile($db, $uid) {\n $rv=0;\n $q='SELECT flags from user WHERE id='.intval($uid).';';\n $res=$db->query($q);\n if ($res) {\n $d=$res->fetch(PDO::FETCH_ASSOC);\n if ($d['flags'] & 1 ) $rv|=2;\n }\n $q='SELECT ukey from auth WHERE user_id='.intval($uid).';';\n $res=$db->query($q);\n if ($res) {\n $d=$res->fetch(PDO::FETCH_ASSOC);\n if (!empty($d['ukey'])) $rv|=1;\n }\n return $rv;\n }", "public function setHasPhysicalDevice($val)\n {\n $this->_propDict[\"hasPhysicalDevice\"] = boolval($val);\n return $this;\n }", "static function checkExistingPropertyMembership(){\n\t global $mainframe,$configClass;\n $available_plans = self::getAllPlans();\n if(count($available_plans) > 0){\n foreach ($available_plans as $plan){\n $params = new JRegistry() ;\n $params->loadString($plan->params);\n $isOsproperty = $params->get('isospplugin',0);\n if($isOsproperty == 1){\n return true;\n }\n }\n }\n return false;\n }", "public function view(User $user, Property $property)\n {\n\n if($user->isAdmin()) return Response::allow();\n\n return (in_array('properties-read', $user->role->permissions->pluck('title')->toArray()) && $property->user->is($user))\n ? Response::allow()\n : Response::deny('You lack sufficient permissions to view properties');\n }", "public function isTablet () : bool {\n\t}", "public function isUsersAllowedDevicesExceeded($userid)\n {\n $users_active_dev_count = $this->checkUserDevicesCount($userid);\n $devices_allowed_count = $this->devicesAllowedCount();\n $user_waiting_count = 1;\n if (($users_active_dev_count + $user_waiting_count) > $devices_allowed_count)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "protected function isNVMe($dev)\n\t{\n\t\treturn(strpos($dev, '/dev/nvme') !== false);\n\t}", "public function getIsClientAttribute()\n {\n return $this->attributes['user_type'] == '2';\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "function user_verify(){\n \n $verify = false;\n \n if( isset($_SESSION['user_id']) ){\n \n if( isset($_SESSION['user_ip']) && $_SERVER['REMOTE_ADDR'] == $_SESSION['user_ip'] ){\n \n if( isset($_SESSION['user_agent']) && $_SERVER['HTTP_USER_AGENT'] == $_SESSION['user_agent'] ){\n \n $verify = true;\n\n }\n \n }\n \n }\n \n return $verify;\n \n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasDeviceFileByUuid()\n {\n return FALSE;\n }", "protected function detectUserDevice()\n {\n //get the language id for chapter site\n $userModel = new Model_User();\n \n //get the chapter site defaultlanguage\n $this->_chapLanguageId = $userModel->getUserLanguage($this->_chapId);\n \n //Set chap default language to emglish if $_chapLanguageId is empty\n $this->_chapLanguageId = (empty($this->_chapLanguageId)) ? 1 : $this->_chapLanguageId;\n \n //If chap is multilingual\n $sessionLanguage = new Zend_Session_Namespace('languagesession');\n if($sessionLanguage->id){\n $this->_chapLanguageId = $sessionLanguage->id;\n }\n else{\n if($this->_chapId == 81604 || $this->_chapId == 274515 || $this->_chapId == 110721 || $this->_chapId == 276531 || $this->_chapId == 280316\n || $this->_chapId == 320345 || $this->_chapId == 324405 || $this->_chapId == 326728 || $this->_chapId == 320345 \n || $this->_chapId == 585480 || $this->_chapId == 585474 || $this->_chapId == 282227 ){ //This is for temporary for qelasy\n $this->_chapLanguageId = 2;\n }\n if($this->_chapId == 115189){ //For YCoins\n \n $sessionCounty = new Zend_Session_Namespace('county');\n $this->_chapLanguageId = ($sessionCounty->code == 'JP') ? 24 : 1; \n //$this->_chapLanguageId = ($sessionCounty->code == 'JP') ? 24 : 1; \n\n }\n \n if($this->_chapId == 136079){ //For YCoins\n \t$this->_chapLanguageId = 4;\n }\n \n \n if($this->_chapId == 283006){ //For YCoins\n \t$this->_chapLanguageId = 22;\n }\n\n \n if($this->_chapId == 726355){ //For YCoins\n \t$this->_chapLanguageId = 57;\n }\n \n \n }\n \n //$nexApi = new Nexva_Api_NexApi();\n $nexApi = new Nexva_Api_QelasyApi();\n $categories = $nexApi->categoryAction($this->_chapId,$this->_chapLanguageId,$this->_grade);\n \n $this->view->categories = $categories;\n \n $userAgent = $_SERVER['HTTP_USER_AGENT']; \n \n if($userAgent) \n { \n /*\n * I have uncommented this to add new detection engine this is old code.. so In case any error comment the new detection code and uncomment the old one. \n * start\n * \n */\n \n //$deviceSession = new Zend_Session_Namespace('Device'); \n \n //Iniate device detection using Device detection adapter\n //$deviceDetector = Nexva_DeviceDetection_Adapter_TeraWurfl::getInstance();\n \n //Detect the device\n //$exactMatch = $deviceDetector->detectDeviceByUserAgent($userAgent);\n\n //Device barand name\n //$brandName = $deviceDetector->getDeviceAttribute('brand_name', 'product_info');\n //Zend_Debug::dump($deviceDetector->getDeviceAttribute('product_info'));die();\n //Zend_Debug::dump($brandName);die();\n \n //Get the Device ID of nexva db\n //$deviceId = $deviceDetector->getNexvaDeviceId();\n \n \n \n /*\n * I have uncommented this to add new detection engine this is old code.. so In case any error comment the new detection code and uncomment the old one.\n * end\n *\n */\n \n \n \n \n /*\n * Detection Script Start we need to find a better way to implemnt this as i am doing this in hurry bcos shaun need to put this live up\n *\n *\n */\n \n /******* comment start **************************************************************\n \n \n $deviceModel = new Model_Device();\n // Check whether this is a device previosly detected by the WURFL if the use WURFL\n // check for neXva device table for user agnet\n $row = $deviceModel->fetchRow(\"useragent = '\".$_SERVER['HTTP_USER_AGENT'].\"' and detection_type = 'wurfl'\");\n \n \n if(!is_null($row)) {\n \n \t$deviceDetector = Nexva_DeviceDetection_Adapter_TeraWurfl::getInstance();\n \t$exactMatch = $deviceDetector->detectDeviceByUserAgent();\n \t//If this is not a wireless device redirect to the main site\n \t$isWireless = $deviceDetector->getDeviceAttribute('is_wireless_device', 'product_info');\n \n \t// get properties from the Wurfl\n \t$brandName = $deviceDetector->getDeviceAttribute('brand_name', 'product_info');\n \t$modelName = $deviceDetector->getDeviceAttribute('model_name', 'product_info');\n \t$marketing_name = $deviceDetector->getDeviceAttribute('marketing_name', 'product_info');\n \t$inputMethod = $deviceDetector->getDeviceAttribute('pointing_method', 'product_info');\n \t$osVersion = $deviceDetector->getDeviceAttribute('device_os_version', 'product_info');\n \t$isWireless = $deviceDetector->getDeviceAttribute('is_wireless_device', 'product_info');\n \t//get nexva device Id\n \t$deviceId = $deviceDetector->getNexvaDeviceId();\n \t\n \t\n \t\n \n \n } else {\n \n \t$deviceDetection = Nexva_DeviceDetection_Adapter_HandsetDetection::getInstance();\n \t$deviceInfo = $deviceDetection->getNexvaDeviceId($_SERVER['HTTP_USER_AGENT']);\n \t//If this is not a wireless device redirect to the main site\n \t$isWireless = $deviceInfo->is_mobile_device;\n \n \n \t// get properties from the Wurfl\n \t$brandName = $deviceInfo->brand;\n \t$modelName = $deviceInfo->model;\n \t$marketing_name = $deviceInfo->marketing_name;\n \t$inputMethod = $deviceInfo->pointing_method;\n \t$osVersion = $deviceInfo->device_os_version;\n \t$exactMatch = $deviceInfo;\n \t//get nexva device Id\n \t$deviceId = $deviceInfo->id;\n \t$isWireless = $deviceInfo->is_mobile_device;\n \t\n \t\n \t\n \t\n \n }\n \n\n \n */\n \n $session = new Zend_Session_Namespace(\"devices_partner_web\");\n $deviceId = $session->deviceId;\n \n \n if(!isset($deviceId) and $session->is_check == false) {\n \n $deviceDetection = Nexva_DeviceDetection_Adapter_HandsetDetection::getInstance();\n $deviceInfo = $deviceDetection->getNexvaDeviceId($_SERVER['HTTP_USER_AGENT']);\n //If this is not a wireless device redirect to the main site\n $deviceId = $deviceInfo->id;\n $session->deviceId = $deviceId;\n $session->is_check = true;\n $session->platfrom = $deviceInfo->platform;\n \n \n } \n \n\n $this->_deviceId = $deviceId;\n \n }\n else\n {\n $this->_deviceId = null;\n }\n \n }", "public static function detect(){\n\t\t\n\t\t// Get user agent\n\t\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n\t\t// Check the most popular mobile browsers\n\t\tif(stripos($user_agent, \"iphone\") ||\n\t\t stripos($user_agent, \"ipod\") ||\n\t\t stripos($user_agent, \"ipad\") ||\n\t\t stripos($user_agent, \"android\") ||\n\t\t stripos($user_agent, \"opera mini\") ||\n\t\t stripos($user_agent, \"mobile\")) return true;\n\t\t\n\t\t// Return false if user is not mobile\n\t\treturn false;\t\n\t}", "public function isTestUser() {\n $retVal = false;\n\n if (strtolower($this->username) == 'appletest') {\n $retVal = true;\n }\n\n return $retVal;\n }", "public function isUser()\n\t{\n\t\tif( $this->permission != array_search( 'user', $this->permissions ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public function hasDeviceFileById()\n {\n return FALSE;\n }", "function user_AuthIsUser() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['user']) && ($AUTH['user'] !== 0);\n}", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "static function isTrackable()\n {\n if(!Auth::check())\n return true;\n $user = Auth::User();\n if(stristr($user->type, 'Employee') || stristr($user->type, 'Demo'))\n return false;\n return true;\n }", "function is_tablet()\n {\n return dev::isTablet();\n }", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "public static function sensorAllowed($sensor)\n { \n if (count($_SESSION['_user_vision']['sensor']) > 0) \n {\n return (@$_SESSION['_user_vision']['sensor'][$sensor]) ? TRUE : FALSE;\n } \n \n return TRUE;\n }", "function is_pro_user($user_id = false) {\r\n global $psts;\r\n\treturn $psts->is_pro_user($user_id);\r\n}", "public static function isConnected() {\n return isset($_SESSION['userid']);\n }" ]
[ "0.6401842", "0.61350274", "0.61258274", "0.6044968", "0.5960383", "0.5945353", "0.5929077", "0.5912315", "0.58376336", "0.5824356", "0.5797431", "0.5703687", "0.56442", "0.56157184", "0.56096417", "0.5606107", "0.55995375", "0.55718386", "0.5569786", "0.5542428", "0.5528709", "0.5492164", "0.54912996", "0.54787004", "0.547698", "0.54736084", "0.54700935", "0.54679084", "0.5455157", "0.5440903", "0.5417874", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.54069936", "0.5402725", "0.5401287", "0.5388119", "0.53864795", "0.53859526", "0.53812575", "0.5377267", "0.53752357", "0.5371296", "0.5367481", "0.5363408", "0.53537816", "0.53472424", "0.53358597", "0.533578", "0.5332884", "0.53240186", "0.5322787", "0.5308232", "0.52822196", "0.5269226", "0.5264848", "0.5257263", "0.5256529", "0.5252743", "0.5235216", "0.52340657", "0.5233962", "0.5225126", "0.5224034", "0.52228487", "0.52212244", "0.5217598", "0.5217374", "0.52169174", "0.5216764", "0.52158684", "0.5214797", "0.5206911", "0.5204445", "0.5204445", "0.5204445", "0.5204445", "0.5204445", "0.51864266", "0.51854146", "0.5182919", "0.51802516", "0.51796275", "0.5171812", "0.5167032", "0.51669854", "0.5156727", "0.514993", "0.5139758", "0.51343167", "0.51317716", "0.51304644" ]
0.6222893
1
original replacement "($1) $2$3"
public function format_phone($phone) { $phone = preg_replace("/[^0-9]/", "", $phone); if(strlen($phone) == 10){ return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/","$1$2$3",$phone); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function virgule($nombre)\n{\n\t$nombre = preg_replace('#(.+),(.+)#','$1.$2',$nombre);\n\treturn $nombre;\n}", "function translate_replace($params){\n $string = array_shift($params);\n foreach ($params as $value){\n $replace[] = $value;\n }\n return XT::translate_replace($string, $replace);\n}", "public function substitute( array $substitute );", "function encode_preg_replace2nd($str)\n{\n $str = str_replace(\"\\\\\",\"\\\\\\\\\",$str);\n $str = str_replace('$','\\\\$',$str);\n return $str;\n}", "function smarty_modifier_myreplace($string, $search) {\n\tif (count($search) > 0) {\n\t\t$newstring = strtr($string, $search);\n\t\treturn $newstring;\n\t} else {\n\t\treturn $string;\n\t}\n}", "function format_result($input)\n{\n return str_replace(array(' ', '(', ')'), array('-', '-', ''), $input);\n}", "function add3dots($string, $repl, $limit) \r\n{\r\n if(strlen($string) > $limit) \r\n {\r\n return substr($string, 0, $limit) . $repl; \r\n }\r\n else \r\n {\r\n return $string;\r\n }\r\n}", "function cmfcString_replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function FrontgetReplace($str, $frlp, $trlp) {\r\n $reqstr = str_replace($frlp, $trlp, $str);\r\n return $reqstr;\r\n}", "function payment_id_replacer($in){\n $out = preg_replace_callback(\"(\\{[0-9]+\\})\",\n function ($matches) {\n\n switch ((int)$matches) {\n\n case 1:\n return 'Bank Deposit / Transfer';\n break;\n case 2:\n return 'Payment From My Wallet';\n break;\n case 3:\n return 'Payment Via Paystack';\n break;\n default:\n return '';\n break;\n }\n }, $in);\n return $out;\n}", "function acf_str_replace($string = '', $search_replace = array())\n{\n}", "function replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}", "protected function backtickAlias($fields) {\n\t\treturn preg_replace('/\\b(\\w+)\\./i', '`${1}`.',$fields);\n\t}", "function joinStr($str, $args){\n\t//$str = '將在%{level}級時解鎖%{name}';\n\tif(preg_match_all(\"/\\%{([\\d\\w\\_]+)}/\", $str, $match)){\n\t\t$r = [];\n\t\t$_args = [];\n\t\tforeach($match[1] as $_m){\n\t\t\t//$r[] = '\".@$args[\"'.$_m.'\"].\"';\n\t\t\t$r[] = \"%s\";\n\t\t\t$_args[] = $args[$_m];\n\t\t}\n\t\t$s = str_replace($match[0], $r, $str);\n\t\t$str = vsprintf($s, $_args);\n\t\t//var_dump(eval('$str = '.$s.';'));\n\t\t//var_dump($str);\n\t\treturn $str;\n\t}else{\n\t\treturn $str;\n\t}\n}", "public function replace(&$input, $args)\n {\n $args = $this->getArgs($args);\n $search = array_keys($args);\n $replace = array_values($args);\n $input = str_replace($search, $replace, $input);\n }", "function expression_function_replace($string, $search, $replacement = null)\n{\n if ($replacement === null) {\n if (!is_array($search)) {\n throw new \\InvalidArgumentException(\n '$search must be an array if only two arguments are supplied to replace'\n );\n }\n\n return str_replace(array_keys($search), $search, $string);\n } else {\n return str_replace($search, $replacement, $string);\n }\n}", "function replace( $search, $replace ) {\n\treturn partial( 'str_replace', $search, $replace );\n}", "static function expandString(\n\t\t$expression,\n\t\t$params = array())\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$expression = str_replace('$'.$key, $value, $expression);\n\t\t}\n\t\treturn $expression;\n\t}", "public function testReplaceTags()\n\t{\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{2}}3', '', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{args:2}}3', 'args', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143$var',$this->obj->replace_tags('1{{args:2}}3$var', 'args', array(\"2\"=>\"4\")));\n\t}", "function replace($p, $str){\n $p2 = __t($p)->map(function($x) use($str){return $str;});\n return $p2();\n }", "public function replace($items);", "private static function replaceVar(string $text, array $params): string\n {\n if ($text === '')\n return '';\n\n return sprintf($text, ...$params); // TODO improve this\n }", "function str_placeholder($replace, $string)\n {\n return str_replace(\n array_keys($replace),\n array_values($replace),\n $string\n );\n }", "function __(string $original, ...$args): string\n {\n $text = Translator::getTranslator()->gettext($original);\n return Translator::getFormatter()->format($text, $args);\n }", "private function substitute(&$x) {\n if ($x == \"!\" || $x == \"not\" || $x == \"¬\") {\n $x = -1;\n # xor operator becomes -2\n } elseif ($x == \"^\" || $x == \"xor\" || $x == \"⊕\") {\n $x = -2;\n # xand operator becomes -3\n } elseif ($x == \"+\" || $x == \"xand\" || $x == \"⊖\") {\n $x = -3;\n # literal placeholders gets replaced\n } elseif (isset($this->literals[$x])) {\n $y = $this->literals[$x];\n # double escaped wrapper characters should be decoded\n foreach ($this->wrappers as $w)\n $y = str_replace(\"\\\\$w\", $w, $y);\n $x = $y;\n }\n }", "public function strreplace( $orig, $old, $new ) {\n\t\treturn \"REPLACE({$orig}, {$old}, {$new})\";\n\t}", "function lwreplace($lwchar){\n return(str_replace(' ','',$lwchar));\n}", "private static function replaceParameters(string &$text, array $parameters) : string\n {\n foreach ($parameters as $parameter) {\n $text = preg_replace(\"/%s/\", $parameter, $text, 1);\n }\n\n return $text;\n }", "function aQuote($matches){\n// print \"matches:\\n\";\n// print_r($matches);\n// print \"\\n\";\n\n $matches[1] = str_replace('**' , '', $matches[1]);\n list($type, $val) = preg_split('/:/', $matches[1]);\n\n switch($type){\n case 'localVar':\n return \"\\\". \\${$val} .\\\"\";\n break;\n case 'fieldVal':\n return \"\\\". dbQuote(\\$data['{$val}']) .\\\"\";\n break;\n case 'fieldChkVal':\n return \"\\\". dbQuote(\\$data['{$val}'], 'bool') .\\\"\";\n break;\n case 'fieldDateVal':\n return \"\\\". dbQuote(\\$data['{$val}'], 'date') .\\\"\";\n break;\n case 'fieldDateTimeVal':\n return \"\\\". dbQuote(\\$data['{$val}'], 'datetime') .\\\"\";\n break;\n case 'fieldIntVal':\n return \"\\\". dbQuote(\\$data['{$val}'], 'int') .\\\"\";\n break;\n case 'fieldMoneyVal':\n return \"\\\". dbQuote(\\$data['{$val}'], 'money') .\\\"\";\n break;\n case 'UserID':\n return \"\\\".\\$User->PersonID.\\\"\";\n break;\n case 'PR-ID':\n return \"\\\".\\$recordID.\\\"\";\n break;\n case 'RecordID':\n return \"\\\".\\$recordID.\\\"\";\n break;\n default:\n return $val;\n }\n\n //return \"replaced\";\n}", "public function pregReplaceCallback($matches) {\n if (!empty($matches[3])) {\n $tag = implode('', array_slice($matches, 2, 4));\n return '<' . $tag . '>';\n }\n\n return '';\n }", "public function testReplace3()\n {\n $this->assertEquals(Str::replace('foo', 'y', 'o'), 'foo');\n }", "function changeA($v1)\n{\n//WARNING! DO NOT USE FOR EMAILS ! Function removes the @ sign and the fullstop!\n\n//\t$Cust_Addr = strtr($Cust_Addr, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n//\t$Cust_Addr = preg_replace('/\\s/u', '_', $Cust_Addr);//this baby also does the trick!!!\n\n//$html_reg = '/<+\\s*\\/*\\s*([A-Z][A-Z0-9]*)\\b[^>]*\\/*\\s*>+/i';\n//$v1 = htmlentities( preg_replace( $html_reg, '', $v1 ) );\n//echo \"<br>after htmlent:\".$v1.\"<br><br><br>\";\n$v1 = preg_replace(\"/'/\",\"_\",$v1);\n$v1 = preg_replace(\"/‘/\",\"_\",$v1);\n$v1 = preg_replace(\"/’/\",\"_\",$v1);\n$v1 = preg_replace(\"/&/\",\"and\",$v1);\n$v1 = preg_replace(\"/,/\",\"+\",$v1);\n$v1 = preg_replace(\"/…/\",\".\",$v1);\n$v1 = preg_replace(\"/…/\", '_', $v1);\n$v1 = str_replace(' ', '_', $v1);\n\n$v1 = preg_replace(\"/&nbsp;/\",\"_\",$v1);\n$v1 = preg_replace(\"/ /\",\"_\",$v1);\n\n//$v1 = strtr($v1, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n\n$v1 = str_replace(\" \",\"_\",$v1);\n$v1 = str_replace(\"&nbsp;\",\"_\",$v1);\n\n//echo \"<br>afterstreplacec:\".$v1.\"<br><br><br>\";\n\n/*\n$old_pattern = array(\"/[^a-zA-Z0-9]/\", \"/_+/\", \"/_$/\");\n$new_pattern = array(\"_\", \"_\", \"\");\n$v2 = preg_replace($old_pattern, $new_pattern , $v1);\n//All characters but a to z, A to z and 0 to 9 are replaced by an underscore. Multiple connected underscores are reduced to a single underscore and trailing underscores are removed.\n*/\n$v2 = $v1;\nreturn $v2;\n}", "public function insertEscaped(...$field_values);", "function setPlaceholders($placeholders, $tpl) {\r\n $keys = array();\r\n $values = array();\r\n\r\n foreach ($placeholders as $key => $value) {\r\n $keys[] = '[+' . $key . '+]';\r\n $values[] = $value;\r\n }\r\n\r\n return str_replace($keys, $values, $tpl);\r\n }", "function concatPlaceholder($ch1){\n\treturn (\"placeholder=\".'\"'.$ch1.'\"');\n}", "function str_a_replace($array, $string) {\n foreach ($array as $from => $to)\n $string = str_replace($from, $to, $string);\n \n return $string;\n}", "function __replace_special_name($leters = array(),$name = \"\", $idx = 0){\n\t\t\n\t\tif(count($leters) > $idx){\n\t\t\t$name = str_replace($leters[$idx][0], $leters[$idx][1], $name);\n\t\t\treturn $this->__replace_special_name($leters,$name,++$idx);\n\t\t}else{\n\t\t\treturn $name;\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "function replaceShortCode( $text, $array){\n\t$shortCodes = array( '%fname%', '%lname%', '%address%', '%address2%', '%city%', '%state%', '%zip%', '%pnumber%', \n\t\t\t\t\t\t '%pnumbertype%', '%snumber%', '%snumberType%', '%email%', '%job%', '%cover%', '%resume%', '%siteName%' );\n\t$variables = array( $array->fname, $array->lname, $array->address, $array->address2, $array->city, $array->state, $array->zip, $array->pnumber, \n\t\t\t\t\t\t $array->pnumbertype, $array->snumber, $array->snumberType, $array->email, $array->job, $array->cover, $array->resume, get_option( 'blogname' ) );\n\t\n\t$newText = str_replace( $shortCodes, $variables, $text );\n\t\n\treturn $newText;\n}", "function insertValue($cont,$sel,$prop,$val){\n $pattern = '/('.preg_quote($sel).'\\s*\\{[\\w\\s:\\-;\\(\\)#]*)}/xi';\n return preg_replace($pattern, '$1 ' . $prop . \" : \" . $val .\";\\n}\",$cont);\n}", "function changesqlquote($str,$rep=\"'\")\r\n{\r\n\treturn str_replace(\"`\", $rep, $str);\r\n}", "public function get_replace()\n {\n return preg_replace('/^insert/', 'replace', $this->get_insert());\n }", "function subs($s,$s1,$s2,$s3){\n$ss='';\n$i1=0;$i2=0;$i3=0;\nfor ($i=0;$i<strlen($s);$i++)\n switch($s[$i]){\n case '@':\n if ($i1>=strlen($s1)) continue; \n $ss=$ss.$s1[$i1];$i1++;\n break;\n case '#':\n if ($i2>=strlen($s2)) continue; \n $ss=$ss.$s2[$i2];$i2++;\n break;\n case '$':\n if ($i3>=strlen($s3)) continue;\n $ss=$ss.$s3[$i3];$i3++;\n break;\n default: $ss=$ss.$s[$i];\n }\nreturn $ss;\n}", "function macro_replace(string $source, array $macros): string\n{\n foreach ($macros as $key => $value) {\n if (is_string($value)) {\n $source = str_replace('{{' . $key . '}}', $value, $source);\n }\n }\n return $source;\n}", "function replace($template,$_DICTIONARY){\n\t\tforeach ($_DICTIONARY as $clave=>$valor) {\n\t\t\t$template = str_replace('#'.$clave.'#', $valor, $template);\n\t\t}\t\t\n\t\treturn $template;\n\t}", "function our_str_replace($find, &$replacements, $subject)\n\n{\n\n $l = strlen($find);\n\n // allocate some memory\n\n $new_subject = str_repeat(' ', strlen($subject));\n\n $new_subject = '';\n\n foreach($replacements as $r)\n\n {\n\n if(($pos = strpos($subject, $find)) === false) break;\n\n $new_subject .= substr($subject, 0, $pos).$r;\n\n $subject = substr($subject, $pos+$l);\n\n // the above appears to be the fastest method\n\n //$subject = substr_replace($subject, $r, $pos, $l);\n\n //$subject = substr($subject, 0, $pos).$r.substr($subject, $pos+strlen($find));\n\n }\n\n $new_subject .= $subject;\n\n return $new_subject;\n\n}", "function langEchoReplaceVariables($string, $replace = array(), $language = '', $lower = '', $deleteEnters = false){\n\treturn langEcho($string, $language, $lower, $replace, $deleteEnters);\n}", "function replace_view($arr){\n $re='';\n $string='@$re='.$arr[0].'?'.$arr[0].':$arr[0];';\n eval($string);\n return $re;\n}", "function escapeString($string) {\nreturn preg_replace('/([\\,;])/','\\\\\\$1', $string);\n}", "private function replaceQuotes($matches) {\n\n\t\t\tif ( !$matches[1] ) {\n\t\t\t\t$matches[1] = 'Someone';\n\t\t\t}\n\t\t\t$replacement = sprintf('<div class=\"bbcodeplus-quote\"><i>%s wrote</i><br/><br/>%s</div>', $matches[1], $matches[2]);\n\t\t\treturn $replacement;\n\t\t}", "function replaceDefaultHook($str)\r\n{\r\n\tglobal $default_hooks,$default_replace;\t\r\n\treturn (str_replace($default_hooks,$default_replace,$str));\r\n}", "function n__(string $original, string $plural, int $value, ...$args): string\n {\n $text = Translator::getTranslator()->ngettext($original, $plural, $value);\n return Translator::getFormatter()->format($text, $args);\n }", "function _amd_pseudodoc_fix($matches){\n\t// are in fact global\n//\t$out = $matches[1];\n//\t$args = trim($matches[2]);\n//\tif($args != \"\"){\n//\t\t$pseudo = \"){\\n\\n/*=====\\n\";\n//\t\t$newargs = array();\n//\t\tforeach(explode(\",\", $args) as $arg){\n//\t\t\t$arg = trim($arg);\n//\t\t\t$newargs[] = \"_$arg\";\n//\t\t\t$pseudo .= \"\\tvar _$arg = $arg;\\n\";\n//\t\t}\n//\t\t$out .= join(\",\", $newargs);\n//\t\t$pseudo .= \"\\n=====*/\\n\\n\";\n//\t\t$out .= $pseudo;\n//\t}else{\n//\t\t$out .= \"){\";\n//\t}\n//\t\n//\treturn $out;\n\n\t// turn (dojo, dijit) into (this.dojo, this.dijit);\n\t$args = $matches[3];\n\t$freshargs = preg_replace('/\\w+/', \"_$0\", $args);\n\t$newargs = $args; // preg_replace('/\\w+/', \"this.$0\", $args);\n\t$body = $matches[4];\n\n\treturn \";(function\" . $freshargs . \"{\" . $body . \"})\" . $args . \";\";\n\t\n}", "function str_replace_from_offset($search, $replace, $subject, $count = -1, $offset = 0) {\r\n\t\t$substr = substr($subject, $offset);\r\n\t\t$substr = str_replace($search, $replace, $substr, $count);\r\n\t\t$subject = substr($subject, 0, $offset) . $substr;\r\n\t\treturn $subject;\r\n\t}", "public function s_callback($matches) {\n $x = $matches[0];\n if ($this->accent != \"yes\") {\n // remove accent characters from slp1 text: /,^,\\\n $y = $matches[1]; // $x = <s>$y</s>\n $y = $this->remove_slp1_accent($y);\n $x = \"<s>$y</s>\";\n }\n return $x;\n}", "function _replacePlaceholdersInSQL(&$data){\n // allow current user name in filter:\n $data['sql'] = str_replace('%user%', $_SERVER['REMOTE_USER'], $data['sql']);\n // allow current date in filter:\n $data['sql'] = str_replace('%now%', dformat(null, '%Y-%m-%d'),$data['sql']);\n }", "function product_id_replacer($in){\n $out = preg_replace_callback(\"([0-9]+)\",\n function ($matches) {\n switch ((int)$matches) {\n case 1:\n return '<b>Data Purchase</b>';\n break;\n case 2:\n return '<b>Airtime Purchase</b>';\n break;\n case 3:\n return '<b>TV Subscription Purchase</b>';\n break;\n case 4:\n return '<b>Electricity Bill</b>';\n break;\n case 5:\n return '<b>Recharge Card</b>';\n break;\n case 6:\n return '<b>Wallet Funding</b>';\n break;\n case 7:\n return '<b>Wallet Transfer</b>';\n break;\n case 8:\n return '<b>Airtime to Cash - Pin</b>';\n break;\n default:\n return '';\n break;\n }\n\n }, $in);\n return $out;\n}", "function wp_sprintf($pattern, ...$args)\n {\n }", "private function removeQuotes($matches) {\n\n\t\t\tif ( !$matches[1] ) {\n\t\t\t\t$matches[1] = 'Someone';\n\t\t\t}\n\t\t\t$replacement = sprintf('%s said: \"%s\"', $matches[1], $matches[2]);\n\t\t\treturn $replacement;\n\t\t}", "static function escapeRegexReplacement($string)\n\t{\n\t\t$string = str_replace('\\\\', '\\\\\\\\', $string);\n\t\t$string = str_replace('$', '\\\\$', $string);\n\t\treturn $string;\n\t}", "protected function adjustFields(){\n\t\tforeach($this->fields as $key => $field)\n\t\t{\n\t\t\t$this->fields[$key] = sprintf(\"`%s`\", $field);\n\t\t}\n\t\treturn join(FuriousExpressionsDB::FieldSeparator, $this->fields);\n\t}", "static function gsub($pattern, &$replacements, $subject) {\n return preg_replace_callback($pattern, function ($m) use (&$replacements) {\n return array_shift($replacements);\n }, $subject);\n }", "private function _str_replace($p_str){\n\t\t// $to = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');\n\n\t\t// $str = explode(',',str_replace($from, $to, $p_str));\n\n\t\t// return str_replace('/\\s+/', ' ', word_limiter($str[0],7,''));\n\t\treturn preg_replace('/\\s+/', ' ',$p_str);\n\t}", "function reformat_keywords($keywordsraw){\n\t\t $keywords_array = (explode(' ', $keywordsraw));\n\n\t\t // fix the key words with 's and ,s\n\t\t $keywords = '\\'';\n\t\t foreach ($keywords_array as $key => $value) {\n\t\t \tif ($key > 0) {\n\t\t \t\t$keywords = $keywords . ', ';\n\t\t \t}\n\t\t \t$keywords = $keywords . $value;\n\t\t }\n\t\t $keywords = $keywords.'\\'';\n\t\t return $keywords;\n\t\t}", "private function _substitute_variable($text, $variable, $object, $function)\n\t{\n\t\tif (strstr($text, $variable))\n\t\t{\n\t\t\t$value = call_user_func(array($object, $function));\n\t\t\t$text = str_replace($variable, $value, $text);\n\t\t}\n\t\treturn $text;\n\t}", "function replace($x) {\n\t$k1=array(' - ','ß','ä','ö','ü','Ä','Ö','Ü',' ',':','&','?','!','\"',',','.',\"\\'\",\"/\");\n\t$k2=array('-','ss','ae','oe','ue','ae','oe','ue','-','-','und','','','','','',\"\",\"-\");\n\tfor ($i='0';$i<count($k1);$i++) {$x = str_replace($k1[$i],$k2[$i],$x);}\n\treturn $x;\n}", "function qoute_replacment($phrase){\r\n\t$find = array(\"\\’\", \"’\", \"\\‘\", \"‘\", \"\\'\", \"'\", \"—\", '\\”', '”', '\\“', '“', '\\\"', '\"',\"\\n\",\"\\r\",\"…\");\r\n\t//defince what to replace the find array with\r\n\t$replace = array(\"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"-\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\",\"&nbsp;\",\"&nbsp;\",\"...\");\r\n\t//html entities code incase you want that\r\n\t#$replace = array(\"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\",\"—\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\");\r\n\t//do the replacing\r\n\t$newphrase = str_replace($find, $replace, $phrase);\r\n \t//return the replacing for output\r\n\treturn $newphrase;\r\n}", "abstract public function replace($translations);", "function replace_occurrence($string, $values)\n{\n $occurrences = $values->map(function ($message, $key) {\n return [\n 'key' => \":$key\",\n 'message' => $message,\n ];\n });\n\n return str_ireplace(\n $occurrences->pluck('key')->toArray(), $occurrences->pluck('message')->toArray(), $string\n );\n}", "public function prepare() {\n\t\t$args = func_get_args();\n\t\tfor ($i = 1; $i < func_num_args(); ++$i) {\n\t\t\t$args[$i] = $this->escape($args[$i]);\n\t\t}\n\t\t\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "public function register_replacements() {\n\t\trank_math_register_var_replacement(\n\t\t\t'randomword',\n\t\t\t[\n\t\t\t\t'name' => esc_html__( 'Random Word', 'rank-math' ),\n\t\t\t\t'description' => esc_html__( 'Persistent random word chosen from a list', 'rank-math' ),\n\t\t\t\t'variable' => 'randomword(word1|word2|word3)',\n\t\t\t\t'example' => ' ',\n\t\t\t],\n\t\t\t[ $this, 'get_randomword' ]\n\t\t);\n\t}", "public function testReplace1()\n {\n $this->assertEquals(Str::replace('foo', 'oo', 'yy'), 'fyy');\n }", "public function quoteInto($sql) {\n\t\t$args = func_get_args();\n\n\t\tif (count($args) < 2 || (count($args) == 2 && !is_array($args[1]))) {\n\t\t\t// Nothing special happening here, pass it through to the default method.\n\t\t\t// We do this instead of calling $this->_zendDb->quoteInto($sql, $args[1])\n\t\t\t// because we're not sure if args[1] is there or not.\n\t\t\treturn call_user_func_array(array($this->_db, 'quoteInto'), $args);\n\t\t}\n\n\t\t// We are going to run our own replacement method.\n\t\t$replacements = $args;\n\t\tarray_shift($replacements);\n\n\t\tif (is_array($replacements[0])) {\n\t\t\t// Here, we are passed an array of replacements with key/value combos\n\t\t\t// that correspond to \":key\" => \"sqlValueToBeEscaped\".\n\t\t\t$replacements = $replacements[0];\n\t\t}\n\n\t\t// If we are using \"?\" placeholders, we need to change them over to indexed-placeholders.\n\t\t$pieces = explode('?', $sql);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $i => $piece) {\n\t\t\t$sql .= $piece;\n\n\t\t\tif ($i == count($pieces) -1) {\n\t\t\t\t// We are on the last one, skip.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sql .= ':'.$i;\n\t\t}\n\n\t\t// At this point, we are using \":key\" placeholders.\n\t\t$pieces = preg_split('/:(\\w+)\\b/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $key => $piece) {\n\t\t\tif ($key % 2 == 0) {\n\t\t\t\t// We are on a piece of the query.\n\t\t\t\t$sql .= $piece;\n\t\t\t} else {\n\t\t\t\t// We are on a placeholder.\n\t\t\t\t$sql .= $this->_db->quote($replacements[$piece]);\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "private function replaceVariables( $value_with_placeholders, array $variable_set )\n {\n $variable_set = array_combine( array_map( function( $key )\n {\n return '[' . $key . ']';\n }, array_keys( $variable_set ) ), array_values( $variable_set ) );\n\n return strtr( $value_with_placeholders, $variable_set );\n }", "function string_format($format, $string, $placeHolder = \"#\")\n{\n\t$numMatches = preg_match_all(\"/($placeHolder+)/\", $format, $matches);\n\tforeach ($matches[0] as $match)\n\t{\n\t\t$matchLen = strlen($match);\n\t\t$format = preg_replace(\"/$placeHolder+/\", substr($string, 0, $matchLen), $format, 1);\n\t\t$string = substr($string, $matchLen);\n\t}\n\treturn $format;\n}", "public static function wrap(string $phrase): string {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\t\tif (count($args) === 1 && is_array($args[0])) {\n\t\t\t$args = $args[0];\n\t\t}\n\t\t$skip_s = [];\n\t\t$skip_r = [];\n\t\t$match = false;\n\t\t$global_match_index = 0;\n\t\twhile (preg_match('/\\[([0-9]+:)?([^\\[\\]]*)]/', $phrase, $match, PREG_OFFSET_CAPTURE)) {\n\t\t\t$match_len = strlen($match[0][0]);\n\t\t\t$match_off = $match[0][1];\n\t\t\t$match_string = $match[2][0];\n\t\t\tif ($match[1][1] < 0) {\n\t\t\t\t$index = $global_match_index;\n\t\t\t} else {\n\t\t\t\t$index = intval($match[1][0]);\n\t\t\t}\n\t\t\t$global_match_index++;\n\t\t\t$replace_value = $args[$index] ?? '[]';\n\t\t\t[$left, $right] = explode('[]', $replace_value, 2) + [null, '', ];\n\t\t\tif ($left === null) {\n\t\t\t\t$replace_value = '(*' . count($skip_s) . '*)';\n\t\t\t\t$skip_s[] = $replace_value;\n\t\t\t\t$skip_r[] = $match[0][0];\n\t\t\t} else {\n\t\t\t\t$replace_value = $left . $match_string . $right;\n\t\t\t}\n\t\t\t$phrase = substr($phrase, 0, $match_off) . $replace_value . substr($phrase, $match_off + $match_len);\n\t\t}\n\n\t\tif (count($skip_s) === 0) {\n\t\t\treturn $phrase;\n\t\t}\n\t\treturn str_replace($skip_s, $skip_r, $phrase);\n\t}", "function replace($text){\n\t\t\t\t\t\t\t\t\t\t$arrayText = array('TRUONG TIEU HOC','TRUONG THCS', 'TRUONG THPT');\n\t\t\t\t\t\t\t\t\t\t$str = \"\";\n\t\t\t\t\t\t\t\t\t\tfor ($i=0; $i < 3 ; $i++) { \n\t\t\t\t\t\t\t\t\t\t\tif (strpos($text, $arrayText[$i]) !== false) {\n\t\t\t\t\t\t\t\t\t\t\t\t$str = str_replace($arrayText[$i],\"\",$text);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn $str;\n\t\t\t\t\t\t\t\t\t}", "private static function internal_replace_callback($matches) {\n $underlines = '';\n for ($i = 0; $i < core_text::strlen($matches[0]); $i++) {\n $underlines .= '_';\n }\n return $underlines;\n }", "function replace_credential($credentials, $credName, $newValue)\n\t{\n\t\t$newCredentials = '';\n\t\t$tempCredString = explode(\"'$credName'\", $credentials);\n\t\t$newCredentials = $tempCredString[0] . \"'$credName', '$newValue');\";\n\t\t$tempCredString = explode(\";\", $tempCredString[1]);\n\t\tunset($tempCredString[0]);\n\t\t$tempCredString = implode(';', $tempCredString);\n\t\t$newCredentials = $newCredentials . $tempCredString;\n\t\treturn $newCredentials;\n\t}", "protected function doReplacements( array $array ) {\n\t\t$args = [\n\t\t\t$this[ Argument::NAMES ][ Name::SINGULAR_NAME_UC ],\n\t\t\t$this[ Argument::NAMES ][ Name::SINGULAR_NAME_LC ],\n\t\t\t$this[ Argument::NAMES ][ Name::PLURAL_NAME_UC ],\n\t\t\t$this[ Argument::NAMES ][ Name::PLURAL_NAME_LC ],\n\t\t];\n\n\t\tforeach ( $array as $key => $string ) {\n\t\t\t$array[ $key ] = sprintf( $string, ...$args );\n\t\t}\n\n\t\treturn $array;\n\t}", "public function replace( $old, $new );", "static function strReplace($search, array $replace, $subject) {\n foreach ($replace as $value) {\n $subject = preg_replace(\"/$search/\", $value, $subject, 1);\n }\n\n return $subject;\n }", "function addSlhs($elm){return \"'\".$elm.\"'\";}", "function replace_variables_in_string($str, array $variables)\n {\n return preg_replace_callback('#{(.*?)}#',\n function($match) use ($variables){\n $match[1]=trim($match[1],'$');\n return $variables[$match[1]];\n },\n ' '.$template.' ');\n }", "public function getShortcodeReplace();", "function replacevars($arrSubstitutes)\n {\n foreach($arrSubstitutes as $var=>$value)\n {\n $this->template = str_replace('<!--['.strtoupper($var).']-->',$value,$this->template);\n }\n \n }", "function replaceDefaultHook($str) {\n global $default_hooks, $default_replace;\n return (str_replace($default_hooks, $default_replace, $str));\n}", "function tmpl($tmpl, $args=array()) {\n\t\t\n\t\tforeach($args as $name => $value) {\n\t\t\t$tmpl = preg_replace(\"/{\" . preg_quote($name) . \"}/\", $value, $tmpl);\n\t\t}\n\t\t\n\t\treturn $tmpl;\n\t\t\n\t}", "function db_table_prefix_replace($needle, $replacement, $subject)\n{\n\t// check that needle exists\n\tif (($pos = strpos($subject, $needle)) === false) {\n\t\treturn $subject;\n\t}\n\t\n\t// if there are no ', replace all occurrences\n\tif (strpos($subject, \"'\") === false) {\n\t\treturn str_replace($needle, $replacement, $subject);\n\t}\n\t\n\t$needle_len = strlen($needle);\n\t// find needle\n\twhile (($pos = strpos($subject, $needle, $pos)) !== false) {\n\t\t// get the first part of string\n\t\t$tmp = substr($subject, 0, $pos);\n\t\t// remove slashed single quotes\n\t\t$tmp = str_replace(\"\\'\", '', $tmp);\n\t\t// if we have even count of ', it means that we are not in the quotes\n\t\tif (substr_count($tmp, \"'\") % 2 == 0) {\n\t\t\t// so we should make a replacement\n\t\t\t$subject = substr_replace($subject, $replacement, $pos, $needle_len);\n\t\t} else {\n\t\t\t// we are in the quotes, skip replacement and move forward\n\t\t\t$pos += $needle_len;\n\t\t}\n\t}\n\n\treturn $subject;\n}", "function str_replace_array($search, array $replace, $subject)\n\t{\n\t\tforeach ($replace as $value)\n\t\t{\n\t\t\t$subject = preg_replace('/'.$search.'/', $value, $subject, 1);\n\t\t}\n\n\t\treturn $subject;\n\t}", "public function replace($selector, $replacement);", "function reverse_order_substr_preg_replace($pattern, $part_to_change_preg_order, $code, $replacement_to_eval) {\r\n\t\t//var_dump('/' . str_replace(\"'\", \"\\\\'\", $pattern) . '/is', str_replace(\"'\", \"\\\\'\", $pattern), $pattern);\r\n\t\tpreg_match_all('/' . $pattern . '/is', $code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$full_match = $matches[0][$counter][0];\r\n\t\t\t$part_to_change = $matches[$part_to_change_preg_order][$counter][0];\r\n\t\t\t$offset = $matches[0][$counter][1];\r\n\t\t\t//var_dump($replacement_to_eval, eval($replacement_to_eval), $part_to_change, $this->file);\r\n\t\t\teval($replacement_to_eval);\r\n\t\t\t$replacement = str_replace($part_to_change, $changed_part, $full_match); // perhaps not perfect\r\n\t\t\t//var_dump($part_to_change, $replacement);\r\n\t\t\t$code = substr($code, 0, $offset) . $replacement . substr($code, $offset + strlen($full_match));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\treturn $code;\r\n\t}", "function tf($string){\n\t$args=func_get_args();\n\t$r=CLang::translate(array_shift($args),'a');\n\treturn vsprintf($r!==false ? $r : $string,$args);\n}", "function strReplaceFirst($from, $to, $subject) {\n\t\t$from = '/'.preg_quote($from, '/').'/';\n\t\treturn preg_replace($from, $to, $subject, 1);\n\t}", "protected function replacePlaceholdersCb($matches)\n {\n $strPlaceholder = $matches[0];\n $strSparqlVariable = array_search(\n $strPlaceholder,\n $this->arTmpPlaceholders\n );\n $strDbPlaceholder = $this->dbConn->Param($strSparqlVariable);\n $this->arTmpVariablePositions[] = $strSparqlVariable;\n\n return $strDbPlaceholder;\n }", "protected function replaceParameters(string $stub, array $parameters): string\n\t{\n\t\treturn str_replace(\n\t\t\t['DummyParameters', 'DummyParameter', '{{ parameters }}', '{{ parameter }}', '{{parameters}}', '{{parameter}}'],\n\t\t\timplode(', ', $parameters),\n\t\t\t$stub\n\t\t);\n\t}", "function r($search, $replace, $subject) {\n\t\treturn str_replace($search, $replace, $subject);\n\t}", "protected function _replace($table, $keys, $values)\n\t{\n\t\treturn 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';\n\t}", "private function _replaceVariable($str, $pos, $var, $repl)\n {\n $expr = substr($str, $pos, strpos($str, ')', $pos + 1) - $pos + 1);\n $eqsign = strpos($expr, '=');\n if (false !== $eqsign)\n {\n $name = substr($expr, $eqsign + 1, strlen($expr) - $eqsign - 2);\n }\n return substr_replace($str, \"(?P<$name>$repl)\", $pos, strlen($expr));\n }", "function replaceTargetedStrings($data){\r\n\tglobal $logfile;\r\n\r\n\t//$blort = \"\\nreplaceTargetedStrings( '\" . $data . \"') \\n\";\r\n\r\n\t$data = str_replace(\"\\t\", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\r\n/*\r\n\t\t//MarcEdit will choke on the < and > so we'd just have to replace them again anyway\r\n\t$data = str_replace(\"&lt;\", \"<\", $data);\r\n\t$data = str_replace(\"&gt;\", \">\", $data);\r\n*/\r\n\r\n\t$data = str_replace('\" content=\"', ' = ', $data);\r\n\t/*\r\n\t\t$blort .= \"\\nnow data ='\" . $data . \"'\\t\";\r\n\t\t$junkRep = str_replace(\"&lt;\", \"<\", $data);\r\n\t\t$blort .= \"if we do a replace it looks like '\" . $junkRep . \"'\\n\";\r\n\t\tappendFile($logfile, $blort);\r\n\t*/\r\n\r\n\treturn $data;\r\n}", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }" ]
[ "0.62748206", "0.6217898", "0.5920853", "0.5919817", "0.5756857", "0.57458156", "0.5726343", "0.56902534", "0.5679878", "0.5677174", "0.5649041", "0.5608493", "0.55879533", "0.55860096", "0.5580428", "0.55334085", "0.5505586", "0.5492033", "0.5458721", "0.5436347", "0.5419616", "0.541517", "0.5398969", "0.53792024", "0.5373296", "0.53683746", "0.5328658", "0.530905", "0.5308844", "0.5306688", "0.53039587", "0.5279194", "0.5265903", "0.5263181", "0.5259231", "0.52590156", "0.52546686", "0.5249354", "0.52443486", "0.52267474", "0.52234346", "0.521641", "0.5194475", "0.51930153", "0.5191415", "0.5187721", "0.51842546", "0.51769596", "0.51712203", "0.5167011", "0.5154965", "0.514615", "0.51407063", "0.5128134", "0.51216406", "0.5121535", "0.5104708", "0.50941974", "0.50881034", "0.5069644", "0.5067887", "0.5064469", "0.5063078", "0.5059664", "0.5056925", "0.5050444", "0.5044263", "0.5043958", "0.50401324", "0.5037756", "0.50352126", "0.503349", "0.5030545", "0.5023514", "0.5022634", "0.502013", "0.50170606", "0.50156534", "0.50078183", "0.50023854", "0.5001954", "0.49987397", "0.4994818", "0.49904013", "0.4990074", "0.4987469", "0.498644", "0.49817333", "0.49813437", "0.49660844", "0.49638367", "0.49624985", "0.49604693", "0.4947587", "0.49430016", "0.49425402", "0.49391618", "0.49382785", "0.49379426", "0.49357927", "0.49348098" ]
0.0
-1
add_action( 'woocommerce_review_order_before_payment', 'wcpg_pay_on_credit_script' ); / This action hook calculates the interest to be paid
function pay_on_credit_apply_interest_fee() { $payment_method = WC()->session->get('chosen_payment_method'); $payment_duration = WC()->session->get('chosen_payment_duration'); if ( $payment_method === "wcpg-pay-on-credit" ) { $label = __( 'Interest Fee', 'wcpg-pay-on-credit' ); $amount = 0; switch ($payment_duration) { case '4': $percentage = 0.05; $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage; break; case '6': $percentage = 0.1; $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage; break; default: # code... break; } WC()->cart->add_fee( $label, $amount, false, '' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ec_woocommerce_custom_surcharge() {\nglobal $woocommerce;\n \n\tif ( is_admin() && ! defined( 'DOING_AJAX' ) )\n\treturn;\n\t \n\t$percentage = 0.01;\n\t$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;\n\t$woocommerce->cart->add_fee( 'Surcharge', $surcharge, true, 'standard' );\n \n}", "public function calculatePayment()\n {\n }", "function calculateInterestPayment($n){\n global $P, $N, $c, $r, $REM, $PRINC;\n $INTER = $c - calculatePrincipalPayment($n);\n return round($INTER, 2);\n}", "function idealpay() {\r\n\r\n return theme('idealpay', array('gojira_idealpay_form'=>drupal_get_form('gojira_idealpay_form'), 'paymentinfo'=>Subscriptions::getNewPaymentInfo()));\r\n}", "public function processPayment();", "function clinic_payment_calculation($appliaction)\n{\n\tif ($appliaction->application_type == 1) {\n\t\t$payment_array['form_chargis'] = 200;\n\t\t$payment_array['registration_chargis'] = 500;\n\t\t$payment_array['renual_charges'] = 250*2;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'] + $payment_array['renual_charges'];\n\t} else {\n\t\t$peneltyOnTotalMonth = getDiffrentBetweenTwoDatesInMonth($appliaction->date_of_expiry_certificate,date('Y-m-d'));\n\t\t$payment_array['form_chargis'] = 100;\n\t\t$payment_array['registration_chargis'] = 250*3 + $peneltyOnTotalMonth*100;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'];\n\t}\n\treturn json_decode(json_encode($payment_array));\n}", "function calculate_interest($amount=0,$interest=0,$long=0,$type=0,$date=\"\"){\n \n $ending_balance = $amount;\n $data['total_interest'] = 0;\n $data['total_payment'] = 0;\n if($type == 0){\n $primary = round( $amount / $long );\n $interest_ = round( ( $amount * ( $interest / 100 ) ) / 12 );\n $installment_payment = $primary + $interest_;\n for($i=1;$i<=$long;$i++){\n $date_ = date('Y-m-d',strtotime('+'.$i.' month',strtotime($date)));\n if($i == $long){\n $primary = $ending_balance;\n $interest_ = $installment_payment - $primary;\n }\n $ending_balance -= $primary;\n $data['detail'][$i] = array(\n 'installment_payment' => $installment_payment,\n 'primary' => $primary,\n 'interest' => $interest_,\n 'ending_balance' => $ending_balance,\n 'date' => $date_\n );\n $data['total_interest'] += $interest_;\n $data['total_payment'] += $installment_payment;\n }\n }elseif($type == 1){\n $primary = round( $amount / $long );\n for($i=1;$i<=$long;$i++){\n $date_ = date('Y-m-d',strtotime('+'.$i.' month',strtotime($date)));\n $interest_ = round( ( $amount - ( ( $i - 1 ) * $primary ) ) * ( $interest / 100 ) / 12 );\n $installment_payment= $primary + $interest_;\n if($i == $long){\n $primary = $ending_balance;\n $interest_ = $installment_payment - $primary;\n }\n $ending_balance -= $primary;\n $data['detail'][$i] = array(\n 'installment_payment' => $installment_payment,\n 'primary' => $primary,\n 'interest' => $interest_,\n 'ending_balance' => $ending_balance,\n 'date' => $date_\n );\n $data['total_interest'] += $interest_;\n $data['total_payment'] += $installment_payment;\n }\n }elseif($type == 2){\n $int = ( $interest / 100 ) / 12;\n $cal1 = pow(( 1 + $int ),$long);\n $cal2 = 1 / ( 1 - ( 1 / $cal1 ) ); \n $installment_payment = round($amount * $int * $cal2);\n for($i=1;$i<=$long;$i++){\n $date_ = date('Y-m-d',strtotime('+'.$i.' month',strtotime($date)));\n $interest_ = round( ( $ending_balance * ( $interest / 100 ) ) / 12 );\n $primary = $installment_payment - $interest_;\n if($i == $long){\n $primary = $ending_balance;\n $interest_ = $installment_payment - $primary;\n }\n $ending_balance -= $primary;\n $data['detail'][$i] = array(\n 'installment_payment' => $installment_payment,\n 'primary' => $primary,\n 'interest' => $interest_,\n 'ending_balance' => $ending_balance,\n 'date' => $date_\n );\n $data['total_interest'] += $interest_;\n $data['total_payment'] += $installment_payment;\n }\n }\n \n return $data;\n }", "function lab_payment_calculation($appliaction)\n{\n\tif ($appliaction->application_type == 1) {\n\t\t$payment_array['form_chargis'] = 200;\n\t\t$payment_array['registration_chargis'] = 500;\n\t\t$payment_array['renual_charges'] = 250*2;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'] + $payment_array['renual_charges'];\n\t} else {\n\t\t$peneltyOnTotalMonth = getDiffrentBetweenTwoDatesInMonth($appliaction->date_of_expiry_certificate,date('Y-m-d'));\n\t\t$payment_array['form_chargis'] = 100;\n\t\t$payment_array['registration_chargis'] = 250*3 + $peneltyOnTotalMonth*100;\n\t\t$payment_array['total_amount'] = $payment_array['form_chargis'] + $payment_array['registration_chargis'];\n\t}\n\treturn json_decode(json_encode($payment_array));\n}", "function interest_rate() {\n require_once plugin_dir_path(__FILE__) . 'partials/interest_rate.php';\n }", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "function confirm_order($order, $comments, $ecpay_feedback) {\r\n\t\t$order->add_order_note($comments, true);\r\n\t\t\r\n\t\t$order->payment_complete();\r\n\r\n\t\t// call invoice model\r\n\t\t$invoice_active_ecpay \t= 0 ;\r\n\t\t$invoice_active_allpay \t= 0 ;\r\n\r\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\r\n\r\n\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\r\n\r\n\t\tforeach($active_plugins as $key => $value)\r\n\t\t{\r\n\t\t\tif ( (strpos($value,'/woocommerce-ecpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_ecpay = 1;\r\n\t }\r\n\r\n\t if ( (strpos($value,'/woocommerce-allpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_allpay = 1;\r\n\t }\t\t\t\r\n\t\t}\r\n\r\n\t\tif($invoice_active_ecpay == 0 && $invoice_active_allpay == 1)\t\t// allpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/allpay_invoice/woocommerce-allpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_allpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_allpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_allpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('allpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($invoice_active_ecpay == 1 && $invoice_active_allpay == 0)\t//ecpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/ecpay_invoice/woocommerce-ecpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_ecpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_ecpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_ecpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('ecpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function hookPaymentReturn()\n {\n }", "public function process_payment( $order_id ) {\n\n\t\t\tif ( class_exists( 'myCRED_Core' ) ) :\n\n\t\t\t\t$settings = mycred_part_woo_settings();\n\t\t\t\t$user_id = get_current_user_id();\n\t\t\t\t$mycred = mycred( $settings['point_type'] );\n\n\t\t\t\t// Excluded from usage\n\t\t\t\tif ( $mycred->exclude_user( $user_id ) ) {\n\t\t\t\t\twc_add_notice( __( 'You are not allowed to use this feature.', 'storefront-child' ), 'error' );\n\t\t\t\t}\n\n\t\t\t\t$balance = $mycred->get_users_balance( $user_id );\n\t\t\t\t$amount = $this->get_order_total();\n\n\t\t\t\t// Invalid amount\n\t\t\t\tif ( $amount == $mycred->zero() ) {\n\t\t\t\t\twc_add_notice( __( 'Amount can not be zero.', 'storefront-child' ), 'error' );\n\t\t\t\t}\n\t\t\t\t// Too high amount\n\t\t\t\tif ( $balance < $amount ) {\n\t\t\t\t\twc_add_notice( __( 'Insufficient Funds.', 'storefront-child' ), 'error' );\n\n\t\t\t\t}\n\t\t\t\tif ( wc_get_notices( 'error' ) ) {\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t'result' => 'fail',\n\t\t\t\t\t\t'redirect' => '',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$order = wc_get_order( $order_id );\n\t\t\t\t$public_view_order_url = esc_url( $order->get_view_order_url() );\n\t\t\t\t// Deduct amount\n\t\t\t\t$mycred->add_creds(\n\t\t\t\t\t'partial_payment',\n\t\t\t\t\t$user_id,\n\t\t\t\t\t0 - $amount,\n\t\t\t\t\t__( 'Order: ', 'storefront-child' ) . '<a href=\"' . $public_view_order_url . '\">' . $order_id . '</a>',\n\t\t\t\t\t$order_id,\n\t\t\t\t\t'',\n\t\t\t\t\t$settings['point_type']\n\t\t\t\t);\n\n\t\t\t\t//update success order\n\n\t\t\t\t$status = 'wc-' === substr( $this->order_status, 0, 3 ) ? substr( $this->order_status, 3 ) : $this->order_status;\n\n\t\t\t\t// Set order status\n\t\t\t\t$order->update_status( $status, __( 'Checkout with gold payment. ', 'storefront-child' ) );\n\n\t\t\t\t// Reduce stock levels\n\t\t\t\twc_reduce_stock_levels( $order_id );\n\n\t\t\t\t// Remove cart\n\t\t\t\tWC()->cart->empty_cart();\n\n\t\t\t\twc_clear_notices();\n\n\t\t\t\t// Return thankyou redirect\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'redirect' => $this->get_return_url( $order )\n\t\t\t\t);\n\t\t\tendif;\n\n\t\t}", "public function payment(){\n\n\t}", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "function field_collection_contributions_rules_complete_contribution($order) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items->getIterator() as $delta => $line_item_wrapper) {\n if (!isset($product_wrapper)) {\n isset($line_item_wrapper->commerce_product) ? $product_wrapper = $line_item_wrapper->commerce_product->value() : NULL;\n }\n }\n\n // Go over the price components to figure out donation and fee.\n foreach($order->commerce_order_total['und'][0]['data']['components'] as $delta => $component) {\n if($component['name'] === 'base_price') {\n $donation = $component['price']['amount'];\n }\n if ($component['name'] === 'fee') {\n $fee = $component['price']['amount'];\n }\n }\n\n\n // If the charity is paying the fee take that out of the donation.\n // @todo - Figure out how to automatically calculate the fee with and without the using paying it.\n if (!isset($fee)) {\n $fee = $donation * .1;\n $donation = $donation - $fee;\n }\n $donation = commerce_currency_amount_to_decimal($donation, commerce_default_currency());\n\n // get fields on the product\n // @todo - Ben - Figure out why the product wrapper can't access the field_collection values.\n $meter_item = field_get_items('commerce_product', $product_wrapper, 'field_donation_meter');\n $item_collection = field_collection_field_get_entity($meter_item[0]);\n $meter_wrapper = entity_metadata_wrapper('field_collection_item', $item_collection);\n\n // Add donation to total donations.\n // @todo - Ben - Get field_donation_current as an input from the rule setup.\n $current = $meter_wrapper->field_donation_current->value();\n\n // @todo - Ben - Get field_donation_goal as an input from the rule setup.\n $goal = $meter_wrapper->field_donation_goal->value();\n if (($current + $donation) > $goal) {\n $current = $goal;\n }\n else {\n $current += $donation;\n }\n $meter_wrapper->field_donation_current->set($current);\n $meter_wrapper->save();\n}", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "function wp_aff_handle_woocommerce_subscription_payment($order) {\n if (!is_object($order)) {\n $order = new WC_Order($order);\n }\n\n $order_id = $order->id;\n $total = $order->order_total;\n $shipping = $order->get_total_shipping();//get_shipping();\n $sale_amount = $total - $shipping;\n $txn_id = $order_id . \"_\" . date(\"Y-m-d\"); //Add the subscription charge date to make this unique\n $item_id = \"\";\n $buyer_email = $order->billing_email;\n $buyer_name = $order->billing_first_name . \" \" . $order->billing_last_name;\n \n $referrer = get_post_meta($order_id, '_wp_aff_ap_id', true);\n if(empty($referrer)){\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - couldn't get referrer ID from cookie. Checking IP address...\", true);\n $ip_address = get_post_meta($order_id, '_customer_ip_address', true);\n if (empty($ip_address)) {\n wp_affiliate_log_debug(\"WooCommerce Subscription Affiliate integration - customer IP address is missing in WooCommerce order.\", false);\n return;\n }\n $referrer = wp_aff_get_referrer_id_from_ip_address($ip_address);\n }\n \n $order_status = $order->status;\n\n //apply filter for coupon check\n $referrer = apply_filters('aff_woo_before_awarding_commission_filter', $referrer, $order);\n\n $debug_data = \"WooCommerce subscripiton payment - Commission tracking debug data: \" . $referrer . \"|\" . $sale_amount . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $ip_address . \"|\" . $buyer_name;\n wp_affiliate_log_debug($debug_data, true);\n\n if (!empty($referrer)) {\n wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, '', '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - This is not an affiliate referred sale!\", true);\n }\n}", "function get_payment_rate($subtotal) {}", "public function woocommerce_checkout_payment() {\n\t\t$js_url = WC()->session->get( 'swedbank_pay_checkout_js_url' );\n\n\t\twc_get_template(\n\t\t\t'checkout/swedbank-pay/instant-checkout/payment.php',\n\t\t\tarray(\n\t\t\t\t//'checkout' => WC()->checkout()\n\t\t\t\t'js_url' => $js_url,\n\t\t\t),\n\t\t\t'',\n\t\t\tdirname( __FILE__ ) . '/../templates/'\n\t\t);\n\t}", "public function checkout_order_processed( $order_id ) {\n \n // Do not proceed if deposit feature is disabled\n if ( get_option( 'woo_payment_option' ) == 'disabled' ) {\n return false;\n }\n \n //Ensure we don't pass in null values, otherwise we'll flip out when sending e-mails\n $_POST['total_order_cost_hidden'] == '' ? $_POST['total_order_cost_hidden'] = 0 : $_POST['total_order_cost_hidden'] = $_POST['total_order_cost_hidden'] ;\n $_POST['deposit_amount_hidden'] == '' ? $_POST['deposit_amount_hidden'] = 0 : $_POST['deposit_amount_hidden'] = $_POST['deposit_amount_hidden'] ;\n $_POST['remaining_balance_hidden'] == '' ? $_POST['remaining_balance_hidden'] = 0 : $_POST['remaining_balance_hidden'] = $_POST['remaining_balance_hidden'] ;\n \n update_post_meta( $order_id, 'order_total', esc_attr( $_POST[ 'total_order_cost_hidden' ] ) );\n update_post_meta( $order_id, 'deposit_amount', esc_attr( $_POST[ 'deposit_amount_hidden' ] ) );\n update_post_meta( $order_id, 'remaining_balance', esc_attr( $_POST[ 'remaining_balance_hidden' ] ) );\n }", "public function process_pct_payment($payload)\n\t{\n\t \n\t # Load user model\n\t $this->load->model('user');\n\t $result = $this->user->sign_in($this->input->post('username'), $this->input->post('userpassword'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnNum = \"PCTINT\".time();\n\t $userId = $result;\n\t $itemNumber = $this->input->post('item_id');\n\t $itemName = $this->input->post('item_name');\n\t $itemCategory = $this->input->post('category_id');\n\t $grossAmount = $this->input->post('invoice_amount');\n\t \n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $email = $profile->{User::_EMAIL};\n\t \n\t \n\t $this->load->model('psss_purchase_history','psss');\n\t \n\t $this->psss->create_purchase_history($txnNum, $userId, $itemNumber, $itemName, $itemCategory, $grossAmount, \"PCT\", $email, 'Internal Wallet');\n// \t $this->message->setFlashMessage(Message::PAYMENT_SUCCESS, array('id'=>'1'));\n\t $response = array('flag'=>1, 'message'=>Message::PAYMENT_SUCCESS);\n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($userId, 1, $txnNum, 'Data Purchase', $grossAmount);\n\t \n\t \n\t # Now since the payment is done, we need to subtract gross amount\n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $walletAmount = $profile->{user::_PCT_WALLET_AMOUNT};\n\t $updatedAmount = ($walletAmount - $grossAmount);\n\t \n\t $this->user->update_pct_wallet_amount($userId, $updatedAmount); \n\t \n\t return $response;\n\t}", "public function userwise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['userDebit'] = $this->ledger_model->userDebit();\n\t\t$data['userCredit'] = $this->ledger_model->userCredit();\n\t\t\n\t\t\t\n\t\t\n\t\ttheme('userwise_payspec',$data);\n\t}", "function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}", "function process_payment( $order_id ) {\n global $woocommerce;\n \n // Create the order object\n $order = new WC_Order( $order_id );\n // Get response object template\n $successResponse = $this->getResponseTemplate( $order );\n // Get data for charge to midtrans API\n $params = $this->getPaymentRequestData( $order_id );\n // Add acquiring bank params\n if (strlen($this->get_option('acquring_bank')) > 0)\n $params['credit_card']['bank'] = strtoupper ($this->get_option('acquring_bank'));\n\n // Empty the cart because payment is initiated.\n $woocommerce->cart->empty_cart();\n try {\n $snapResponse = WC_Midtrans_API::createSnapTransaction( $params, $this->id );\n } catch (Exception $e) {\n $this->setLogError( $e->getMessage() );\n WC_Midtrans_Utils::json_print_exception( $e, $this );\n exit();\n }\n\n // If `enable_redirect` admin config used, snap redirect\n if(property_exists($this,'enable_redirect') && $this->enable_redirect == 'yes'){\n $redirectUrl = $snapResponse->redirect_url;\n }else{\n $redirectUrl = $order->get_checkout_payment_url( true ).\"&snap_token=\".$snapResponse->token;\n }\n\n // Store snap token & snap redirect url to $order metadata\n $order->update_meta_data('_mt_payment_snap_token',$snapResponse->token);\n $order->update_meta_data('_mt_payment_url',$snapResponse->redirect_url);\n $order->save();\n\n if(property_exists($this,'enable_immediate_reduce_stock') && $this->enable_immediate_reduce_stock == 'yes'){\n // Reduce item stock on WC, item also auto reduced on order `pending` status changes\n wc_reduce_stock_levels($order);\n }\n\n $successResponse['redirect'] = $redirectUrl;\n return $successResponse;\n }", "function fp_add_fee_from_cart()\r\n {\r\n if(isset($_POST['fp_apply_points'])) \t{\r\n add_action( 'woocommerce_cart_calculate_fees', array( $this , 'fp_woo_add_cart_fee' ), 10, 1);\r\n $_SESSION['fp_action']=\"apply\";\r\n }\r\n }", "public function payee_payments()\n\t{\n\t\t//permittedArea();\n\n\t\ttheme('payee_payments');\n\t}", "public function recordPointsForOrderEvent($observer){\n\t\tif(Mage::getStoreConfig('rewardpointspro/rewardpointspro/enabled')&& Mage::getStoreConfig('rewardpointspro/display/product_rewards')){ \n\t\t\t$order = $observer->getEvent()->getOrder();\n\t\t\t$items =$order->getItemsCollection();\n\t\t\t$customer_id_from_event = $order->getCustomerId();\n\t\t\t$customerId = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCustomerId();\n\t\t\t$rewardPoints = 0;\n\t\t\t$prodIds = array();\n\t\t\tforeach ($items as $_item) {\n\t\t\t\t$prodIds[] = $_item->getProductId();\n\t\t\t}\n\t\t\t$prod = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('reward_points_pro')->addIdFilter($prodIds);\n\t\t\t//sum up points per product per quantity\n\t\t\tforeach ($items as $_item) {\n\t\t\t$rewardPoints += $prod->getItemById($_item->getProductId())->getRewardPointsPro() * $_item->getQtyOrdered();\n\t\t\t}\n\t\t\t//record points for item into db\n\t\t\t$this->recordPoints($rewardPoints, $customerId);\n\t\t\t$discounted = Mage::getSingleton('customer/session')->getApplyPoints();\n\t\t\t//subtract points for this order\n\t\t\t$this->useCouponPoints($discounted, $customerId); \n\t\t \n\t\t}\n\t\tMage::getSingleton('customer/session')->setdisc(0);\n\t}", "public function payment_scripts() {\n\t\t$this->log('payment_scripts called in xendit' . PHP_EOL);\n\n \t\tif ( ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_order'] ) && ! is_add_payment_method_page() ) {\n \t\t\treturn;\n \t\t}\n\n\t\twp_enqueue_script( 'xendit', 'https://js.xendit.co/v1/xendit.min.js', '', WC_XENDIT_VERSION, true );\n\t\twp_enqueue_script( 'woocommerce_xendit', plugins_url( 'assets/js/xendit.js', WC_XENDIT_MAIN_FILE ), array( 'jquery', 'xendit' ), WC_XENDIT_VERSION, true );\n\n \t\t$xendit_params = array(\n \t\t\t'key' => $this->publishable_key\n \t\t);\n\n \t\t// If we're on the pay page we need to pass xendit.js the address of the order.\n\t\t// TODO: implement direct payments from the order\n \t\tif ( isset( $_GET['pay_for_order'] ) && 'true' === $_GET['pay_for_order'] ) {\n \t\t\t$order_id = wc_get_order_id_by_order_key( urldecode( $_GET['key'] ) );\n \t\t\t$order = wc_get_order( $order_id );\n\n\t\t\techo $order->get_total();\n\n \t\t\t$xendit_params['billing_first_name'] = $order->get_billing_first_name();\n \t\t\t$xendit_params['billing_last_name'] = $order->get_billing_last_name();\n \t\t\t$xendit_params['billing_address_1'] = $order->get_billing_address_1();\n \t\t\t$xendit_params['billing_address_2'] = $order->get_billing_address_2();\n \t\t\t$xendit_params['billing_state'] = $order->get_billing_state();\n \t\t\t$xendit_params['billing_city'] = $order->get_billing_city();\n \t\t\t$xendit_params['billing_postcode'] = $order->get_billing_postcode();\n \t\t\t$xendit_params['billing_country'] = $order->get_billing_country();\n\t\t\t$xendit_params['amount'] \t\t\t = $order->get_total() * 100;\n \t\t}\n\n \t\t// merge localized messages to be use in JS\n \t\t$xendit_params = array_merge( $xendit_params, $this->get_localized_messages() );\n\n \t\twp_localize_script( 'woocommerce_xendit', 'wc_xendit_params', apply_filters( 'wc_xendit_params', $xendit_params ) );\n \t}", "public function pay();", "public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "abstract public function amountOwed(int $orderID): float;", "abstract protected function handlePayment();", "function init_process_payment() {\r\n global $woocommerce;\r\n\r\n\t if((isset($_GET['ng_netgiroSignature']) && $_GET['ng_netgiroSignature'])\r\n\t\t && $_GET['ng_orderid'] && $_GET['ng_transactionid'] ) {\r\n \r\n\t\tif ( function_exists( 'wc_get_order' ) ) {\r\n\t\t\t$order = wc_get_order( $_GET['ng_orderid'] );\r\n\t\t} else {\r\n\t\t\t$order = new WC_Order( $_GET['ng_orderid'] );\r\n\t\t} \r\n\t\t\r\n\t\t$str = $this->secretkey . $_GET['ng_orderid'];\r\n $hash = hash('sha256', $str);\r\n if($hash==$_GET['ng_signature']) {\r\n $order -> payment_complete();\r\n $order -> add_order_note('Netgíró greiðsla tókst<br/>Tilvísunarnúmer frá Netgíró: '.$_REQUEST['ng_invoiceNumber']); \r\n $woocommerce->cart->empty_cart();\r\n wp_redirect($this->get_return_url( $order ));\r\n exit;\r\n } else {\r\n // Set order status to failed\r\n $order -> update_status('failed');\r\n $order -> add_order_note('Netgiro payment failed. Woocommerce order id: ' . $_GET['ng_orderid'] . ' and Netgiro reference no.: ' . $_REQUEST['ng_invoiceNumber'] . ' does relate to signature: ' . $_GET['ng_signature']); \r\n\t\t \r\n\t\t wc_add_notice(\"Ekki tókst að staðfesta Netgíró greiðslu! Vinsamlega hafðu samband við verslun og athugað stöðuna á pöntun þinni nr. \" . $_GET['ng_orderid'], 'error');\r\n\t\t wp_redirect($this->get_return_url( $order ));\r\n\t\t exit;\r\n }\r\n }\r\n }", "public function getCustomGiftcardAmount();", "function compute_interest($date) {\n $money = 0;\n if ($this->earning->interest_schedule) {\n $this->earning->set_balance($this->get_balance());\n $money = $this->earning->compute_interest($date);\n $this->set_balance($this->earning->get_balance());\n }\n return $money;\n }", "function hook_confirmed_deposit($trans) { \n\n}", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "function _exp_checkout_do_payment() {\n global $event_details;\n $event_id = $event_details['ID'];\n\n if ( is_null( $event_id ) ) {\n return false;\n }\n\n $regis_id = $this->erm->get_regis_id();\n $post_ID = $_SESSION['__epl']['post_ID'];\n $this->ecm->setup_event_details( $event_id );\n $_totals = $this->erm->calculate_totals();\n $total = $_totals['money_totals']['grand_total'];\n\n $this->epl->load_file( 'libraries/gateways/twocheckout/twocheckout.php' );\n $twocheckout_response = new TCO_Payment();\n $twocheckout_response->setAcctInfo();\n $response = $twocheckout_response->getResponse();\n if ( is_array( $response )) {\n $data['post_ID'] = $post_ID;\n $data['_epl_regis_status'] = '5';\n $data['_epl_grand_total'] = $total;\n $data['_epl_payment_amount'] = $response['total'];\n $data['_epl_payment_date'] = current_time( 'mysql' );\n $data['_epl_payment_method'] = '_tco';\n $data['_epl_transaction_id'] = $response['order_number'];\n\n $data = apply_filters( 'epl_tco_response_data', $data, $response );\n\n $this->erm->update_payment_data( $data );\n\n return true;\n } else {\n $error = 'ERROR: ' . 'MD5 Hash does not match! Contact the seller!';\n }\n }", "public function sc_handle_store_credit_application() {\n\t\t\t$apply_before_tax = get_option( 'woocommerce_smart_coupon_apply_before_tax', 'no' );\n\n\t\t\tif ( $this->is_wc_gte_30() && 'yes' === $apply_before_tax ) {\n\t\t\t\tinclude_once 'class-wc-sc-apply-before-tax.php';\n\t\t\t} else {\n\t\t\t\tadd_action( 'wp_loaded', array( $this, 'smart_coupons_discount_total_filters' ), 20 );\n\t\t\t\tadd_action( 'woocommerce_order_after_calculate_totals', array( $this, 'order_calculate_discount_amount' ), 10, 2 );\n\t\t\t}\n\t\t}", "public function processPayment(Payment $payment): void\n {\n }", "function ProcessChargebackAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Chargeback amount notifications inform you that a customer\n * has initiated a chargeback against an order and that Google Checkout\n * has approved the chargeback. A <chargeback-amount-notification>\n * contains the order number that Google assigned to the order,\n * the value of the most recent chargeback against the order\n * and the total amount that has been charged back against the\n * order. Google Checkout will send a <chargeback-amount-notification>\n * after approving the chargeback.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <chargeback-amount-notification> to your internal systems that\n * process this order data.\n */\n SendNotificationAcknowledgment();\n}", "public function visit($order) {\n\n\t\t$order->setPhase('paid');\n\t\treturn 0;\n\t}", "public function acceptPayment($receipt)\n\t{\n\t}", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "function learndash_enroll_with_zero_price(): void {\n\tif (\n\t\tempty( $_POST['nonce'] ) ||\n\t\t! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'learndash-coupon-nonce' ) ||\n\t\tempty( (int) $_POST['post_id'] ) ||\n\t\t! is_user_logged_in()\n\t) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid request.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if we are processing a course/group.\n\n\t$product = Product::find( (int) $_POST['post_id'] );\n\n\tif ( ! $product ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Product not found.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if the price by coupon is 0.\n\n\ttry {\n\t\t$product_pricing = $product->get_pricing();\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$user = wp_get_current_user();\n\t$price = learndash_get_price_by_coupon( $product_pricing->price, $product->get_id(), $user->ID );\n\n\tif ( $price > 0 ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'You have to pay for access.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Attach a coupon.\n\n\t$coupon_data = learndash_get_attached_coupon_data( $product->get_id(), $user->ID );\n\n\tif ( empty( $coupon_data ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tlearndash_attach_coupon( $product->get_id(), $coupon_data->coupon_id, $product_pricing->price, 0 );\n\n\t// Create a transaction.\n\n\t$transaction_id = learndash_transaction_create(\n\t\tarray(\n\t\t\tTransaction::$meta_key_is_free => true,\n\t\t),\n\t\t$product->get_post(),\n\t\t$user\n\t);\n\n\t$transaction = Transaction::find( $transaction_id );\n\n\tif ( ! $transaction ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Enroll.\n\n\t$product->enroll( $user );\n\n\t// Redirect.\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'redirect_url' => Learndash_Unknown_Gateway::get_url_success(\n\t\t\t\tarray( $product )\n\t\t\t),\n\t\t)\n\t);\n}", "abstract public function pay(int $orderID, $amount);", "public function mycred_pro_reward_order_points( $order_id ){\n\n\t\tif ( ! function_exists( 'mycred' ) ) return;\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$items_number = 0;\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\t\t\t$quantity = $item->get_quantity();\n\t\t\t$items_number += $quantity;\n\t\t}\n\n\t\t// Load myCRED\n\t\t$mycred = mycred();\n\n\t\t// Do not payout if order was paid using points\n\t\tif ( $order->get_payment_method() == 'mycred' ) return;\n\n\t\tif ( ! $mycred ) return;\n\n\t\t// Make sure user only gets points once per order\n\t\tif ( $mycred->has_entry( 'reward', $order_id, $order->get_user_id() ) ) return;\n\n\t\t// Reward example 10 * order items in points.\n\t\t$reward = 10 * $items_number;\n\n\t\t// Add reward\n\t\t$mycred->add_creds(\n\t\t\t'reward',\n\t\t\t$order->get_user_id(),\n\t\t\t$reward,\n\t\t\t'Reward for store purchase',\n\t\t\t$order_id,\n\t\t\tarray( 'ref_type' => 'post' )\n\t\t);\n\t}", "function getScoreCost (&$labor, $quantity) {\n\tif ($_POST[\"score\"] == \"score\") {\n\t\t$scoreLabor = (HOUR * .16);\n\t\t$scoreLabor += (($quantity * .000833) * HOUR);\n\t}\nelse {\n\t$scoreLabor = 0;\n\t}\n$labor += $scoreLabor;\n}", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "function calculatePrincipalPayment($n){\n $n--;\n global $P, $N, $c, $r, $REM;\n $PRINC = calculateRemainingAmmount($n) - calculateRemainingAmmount($n+1);\n return round($PRINC, 2);\n}", "function mantis_woocommerce_inject($order_id)\n{\n $advertiser = get_option('mantis_advertiser_id');\n\n if (!$advertiser) {\n return;\n }\n\n $order = new WC_Order( $order_id );\n\n $transaction = $order->get_order_number();\n $revenue = $order->get_total();\n\n require(dirname(__FILE__) . '/html/advertiser/config.php');\n}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function onAfterPayment($context, &$transaction, $params, $project, $reward) {\n \n $app = JFactory::getApplication();\n /** @var $app JSite **/\n \n if($app->isAdmin()) {\n return;\n }\n\n $doc = JFactory::getDocument();\n /** @var $doc JDocumentHtml **/\n \n // Check document type\n $docType = $doc->getType();\n if(strcmp(\"raw\", $docType) != 0){\n return;\n }\n \n if(strcmp(\"com_crowdfunding.notify.paypal\", $context) != 0){\n return;\n }\n \n // Send mails\n $this->sendMails($project, $transaction);\n }", "public function onPayment()\n {\n $this->extend('onPayment');\n }", "function regiomino_cart_paymentinfo_form_submit($form, &$form_state) {\r\n\tglobal $user;\r\n\t$userobject = user_load($user->uid);\r\n\r\n\t\t$userobject->field_use_balance_for_purchase['und'][0]['value'] = $form_state['values']['paywithbalance'];\r\n\r\n\t\tif($form_state['values']['paywithbalance'] == '1') {\r\n\t\t\t$userobject->field_payment['und'][0]['value'] = $form_state['values']['paymentbalance'];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$userobject->field_payment['und'][0]['value'] = $form_state['values']['payment'];\r\n\t\t}\r\n\t\t$userobject->field_bankaccountholder[LANGUAGE_NONE][0]['value'] = $form_state['values']['bankaccountholder'];\r\n\t\t$userobject->field_bankaccount[LANGUAGE_NONE][0]['value'] = $form_state['values']['bankaccount'];\r\n\t\t$userobject->field_bankcode[LANGUAGE_NONE][0]['value'] = $form_state['values']['bankcode'];\r\n\t\t\r\n\t\tuser_save($userobject);\r\n\t\r\n\tdrupal_goto('checkout/verify');\r\n}", "function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}", "private function sellTrasactionAddsMoney(){\n\n }", "public function process_payment($order_id){\r\n\r\n $order = wc_get_order( $order_id );\r\n // Mark as on-hold (we're awaiting the cheque)\r\n $order->update_status( 'on-hold', _x( 'Awaiting check payment', 'Check payment method', 'azericard' ) );\r\n\r\n // Reduce stock levels\r\n wc_reduce_stock_levels( $order_id );\r\n\r\n // Remove cart\r\n WC()->cart->empty_cart();\r\n\r\n // Return thankyou redirect\r\n return array(\r\n 'result' => 'success',\r\n 'redirect' => $this->get_return_url( $order ),\r\n );\r\n\r\n }", "function interestPerCycle($principal, $intRateFactor, $termLength)\n{\n # At the start of the cycle, calculate 30 days of interest and add to principal\n $simple_daily_int = $principal * $intRateFactor;\n # Interest to add equals simple daily interest * days since last payment (30)\n $int_to_add = $simple_daily_int * $termLength;\n return $int_to_add;\n}", "public function getInsuranceAmount();", "function add_payment_pr($data){\n\t\tif($this->check_money($data['Clientpayment']['amount'])){\n\t\t\t\t$this->do_pr_invoice($data);\n\t\t}\n\t}", "public function payment_scripts() {\n\n \t}", "function woo_add_cart_fee() {\n \n global $woocommerce;\n\t\n $woocommerce->cart->add_fee( __('Custom', 'woocommerce'), 5 );\n\t\n}", "function calculateCurrency($prijs, $country)\r\n {\r\n }", "public function payment_scripts() {\n \n\t \t}", "public function process_payment( $order_id ) {\n\n $order = wc_get_order( $order_id );\n $order->update_meta_data( '_barter_price', $this->minterControll->getBarterPrice($order->get_total()) );\n $order->update_meta_data( '_barter_token', MinterController::getBarterTokenName());\n // Mark as on-hold (we're awaiting the payment)\n $order->update_status( MinterController::getUnpaidStatus(), __( 'Awaiting Barter', 'wc-gateway-barter' ) );\n //$order->add_meta_data('MinterPaySum',);\n // Reduce stock levels\n wc_reduce_stock_levels($order_id);\n\n // Remove cart\n WC()->cart->empty_cart();\n\n // Return thankyou redirect\n return array(\n 'result' \t=> 'success',\n 'redirect'\t=> $this->get_return_url( $order )\n );\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }", "function compute_money_total($available, $frozen, $investment, $loaned, $interest, $owned, $fine)\n{\n return ($available + $frozen + $investment - ($loaned + $interest + $owned + $fine));\n}", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "public function custom_thankyou_page()\n {\n\n global $woocommerce;\n //respuesta del comercion tras envio de post desde seguripago\n $sp_recepcion = new seguripagoRecepcionInmediato($this->sp_idSocio, $this->sp_key, $this->sp_modo);\n\n $data = $sp_recepcion->recibir();\n $id_order = ltrim($data['num_pedido'], '0');\n $id_order = (int) $id_order;\n $order = new WC_Order( $id_order );\n /**\n * Valide aquí si el número de pedido ($data['num_pedido']) existe en su sistema.\n */\n\n if ( !isset($order->id))\n $mensaje = $this->log_payment(\"numero de orden invalido\");\n\n /**\n * Valide aquí si el número de pedido ya fue cancelado.\n */\n if ( $order->get_status() <> 'pending' )\n $mensaje = $this->log_payment(\"estado de pedido\");\n\n /**\n * Valide aquí si el importe informado por SeguriPago ($data['importe']) coincide\n * con el monto registrado en su sistema.\n */\n //$importe = (int) $data['importe'];\n\n if ( $order->get_total() <> (int) $data['importe'])\n $mensaje = $this->log_payment(\"importe del pedido\");\n\n /**\n * Validar aquí el vencimiento del pago.\n */\n //$data['fecha_vencimiento']\n\n //validando la moneda\n if ( 'PEN' <> $order->get_order_currency())\n $mensaje = $this->log_payment(\"moneda del pedido\");\n\n if ( isset($mensaje) ) return $mensaje;\n /**\n * Actualice su base de datos con la información recibida.\n */\n\n $sp_recepcion->confirmar();\n\n\n\n if($data['resultado'] == \"1\")\n {\n\n /**\n * MENSAJE PARA PAGO INMEDIATO (SeguriCrédito)\n */\n if($data['tipo_respuesta'] == \"1\")\n {\n /**\n * Envíar aquí un mensaje al usuario indicando que la operación fue aceptada\n * y dar otra información que crea conveniente.\n */\n\n include(\"includes/seguripago/plantillas/respuesta_inmediato_aceptado.php\");\n\n // Mark order processing\n $order->update_status( 'processing' );\n\n /**\n * MENSAJE PARA PAGO DIFERIDO (SeguriCash y otros)\n */\n }\n else\n {\n /**\n * Envíar aquí un mensaje al usuario indicando que se generó un número de cupón\n * a ser cancelado en las entidades financieras BCP, Scotia, según lo establecido\n * en SeguriPago.\n *\n * Se pasa como parámetro la ruta del logo del comercio y el segundo parámetro\n * indica si se mostrará la orden de pago, en modo completo (true) o resumido (false - default)\n * Ver MANUAL.txt para más detalle.\n */\n $ruta_logo = PLUGIN_DIR . 'assets/images/qhatu-logo.png';\n $html = $sp_recepcion->pantallaSeguricash( $ruta_logo, $this->title, true);\n\n /**\n * Enviar $html por correo (opcional)\n */\n\n $subject = sprintf( __( 'Pendiente de pago para la Orden %s ', 'Seguripago' ), $id_order );\n\n $customer = new WC_Customer( $order_id );\n\n //Filtro para indicar que email debe ser enviado en modo HTML\n add_filter('wp_mail_content_type',create_function('', 'return \"text/html\";'));\n\n wp_mail( $order->billing_email, $subject, $html, 'header');\n\n echo \"<center><div style='width:700px;'>$html</div></center>\";\n\n // Change the status to pending / unpaid\n //$order->update_status('pending');\n\n }\n /**\n * ---------------------- MENSAJE PARA PAGO DESAPROBADO ------------------------\n */\n } else {\n /**\n * Envíar aquí un mensaje al usuario indicando que la operación no fue aceptada.\n */\n $mailer = WC()->mailer();\n\n $message = $mailer->wrap_message( 'Error al pagar' , 'Pago a través de seguripago falló' );\n\n $subject = sprintf( __( 'Pendiente de pago para la Orden %s ', 'Seguripago' ), $id_order );\n\n //Filtro para indicar que email debe ser enviado en modo HTML\n add_filter('wp_mail_content_type',create_function('', 'return \"text/html\";'));\n\n wp_mail( $order->billing_email, $subject, $message, 'header');\n\n // Mark order complete\n $message = 'Pago a través de seguripago falló';\n $order->update_status('failed', $message );\n\n include(\"includes/seguripago/plantillas/respuesta_inmediato_rechazado.php\");\n }\n // Empty cart and clear session\n $woocommerce->cart->empty_cart();\n\n }", "public function webhook() {\n\n\t\t$this->log( 'Fire webhook' );\n\n\t\t/* \n\t\t * Received redirect from acquiring service with succesful order status\n\t\t */\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' and isset( $_POST['payment_id'] ) ) {\n\n\t\t\t$this->log( 'Received callback from acquiring service with order processing status' );\n\t\t\t$this->log( print_r($_POST, true ) );\n\n\t\t\t// Get payment UUID\n\t\t\t$paymentcode = isset( $_POST['payment_id'] ) ? $_POST['payment_id'] : null;\n\n\t\t\t// Get our Order ID returned through acquiring\n\t\t\t$order_id = isset ( $_POST['cf'] ) ? $_POST['cf'] : null;\n\n\t\t\t// Get Order status (ОК, КО, CANCEL, CHARGEBACK)\n\t\t\t$status = isset ( $_POST['status'] ) ? $_POST['status'] : null;\n\n\t\t\t// Get Order signature to verify payment validity\n\t\t\t$sign = isset ( $_POST['sign'] ) ? $_POST['sign'] : null;\n\t\t\t$sign_check = md5( $this->merchant_id . $paymentcode . $status . $order_id . $this->secret_word );\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t// Validate payment data\n\t\t\tif( $sign == $sign_check ) {\n\n\t\t\t\tswitch( $status ) {\n\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t// Payment succesful\n\n\t\t\t\t\t\t// Check if Order stay in our payment method\n\t\t\t\t\t\tif( $order->get_payment_method() == $this->id ) {\n\n\t\t\t\t\t\t\t// Link acquiring payment UUID with our Order\n\t\t\t\t\t\t\tif( strlen( $paymentcode ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_' . $this->id . '_paymentcode', $paymentcode );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set Order status to Processing\n\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t$this->log( 'Payment processed sucesfully' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Wrong payment method\n\t\t\t\t\t\t\t$this->log( 'Wrong payment method' );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'КО':\n\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment not processed' );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment cancelled by acquirer' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clear http output. \n\t\techo '0';\n\t\texit;\n \t}", "function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "function get_installment($rate, $pricipal, $installment, $interest_method = 1, $interval = 1) {\n\n $amount = 0;\n $rate_required = 0;\n if ($interval == 1) {\n //monthly\n $rate_required = (($rate / 12) / 100);\n }else if($interval == 2){\n //weekly\n $rate_required = (($rate / 52) / 100); \n }\n\n if ($interest_method == 1) {\n $up = pow((1 + $rate_required), $installment);\n\n $down = (pow((1 + $rate_required), $installment) - 1);\n\n $amount = (($pricipal * ($up / $down)) * $rate_required);\n } else if ($interest_method == 2) {\n $interest_per_month = $rate_required * $pricipal;\n $amount = ($pricipal / $installment) + $interest_per_month;\n }\n\n return round($amount, 2);\n }", "function apptivo_ecommerce_checkout_order_review() {\t\r\n\t\r\n\tapptivo_ecommerce_get_template('checkout/checkout_review_order.php', false);\r\n}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}", "function process_payment($order_id) {\t\t\r\n\t\tif ( function_exists( 'wc_get_order' ) ) {\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t} else {\r\n\t\t\t$order = new WC_Order( $order_id );\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn array(\r\n\t\t\t\t'result' => 'success',\r\n\t\t\t\t'redirect' => $order->get_checkout_payment_url( true )\r\n\t\t);\r\n }", "function ihc_twocheckout_submit($u_id, $l_id, $code='', $ihc_country=FALSE){\n\n\tIhc_User_Logs::set_user_id($u_id);\n\tIhc_User_Logs::set_level_id($l_id);\n\tIhc_User_Logs::write_log( __('2Checkout Payment: Start process', 'ihc'), 'payments');\n\n\t$level_data = get_option('ihc_levels');\n\t$amount = $level_data[$l_id]['price'];\n\t$currency = get_option('ihc_currency');\n\t$checkout_account_num = get_option('ihc_twocheckout_account_number');\n\t$custom_currency_code = get_option('ihc_custom_currency_code');\n\tif ($custom_currency_code){\n\t\t$currency = $custom_currency_code;\n\t}\n\n\t/*************************** DYNAMIC PRICE ***************************/\n\tif (ihc_is_magic_feat_active('level_dynamic_price') && isset($_POST['ihc_dynamic_price'])){\n\t\t$temp_amount = $_POST['ihc_dynamic_price'];\n\t\tif (ihc_check_dynamic_price_from_user($l_id, $temp_amount)){\n\t\t\t$amount = $temp_amount;\n\t\t\tIhc_User_Logs::write_log( __('2Chekcout Payment: Dynamic price on - Amount is set by the user @ ', 'ihc') . $amount . $currency, 'payments');\n\t\t}\n\t}\n\t/**************************** DYNAMIC PRICE ***************************/\n\n\t//========= DISCOUNT\n\tif ($code){\n\t\t$coupon_data = ihc_check_coupon($code, $l_id);\n\t\tif ($coupon_data){\n\t\t\tIhc_User_Logs::write_log( __('2Checkout Payment: the user used the following coupon: ', 'ihc') . $code, 'payments');\n\t\t\tif (isset($level_data[$l_id]['access_type']) && $level_data[$l_id]['access_type']=='regular_period'){\n\t\t\t\t//discount on recurring payment\n\t\t\t\tif (empty($coupon_data['reccuring'])){\n\t\t\t\t\t//just one time\n\t\t\t\t\t$discount_once = -($amount - ihc_coupon_return_price_after_decrease($amount, $coupon_data, TRUE, $u_id, $l_id));\n\t\t\t\t} else {\n\t\t\t\t\t//on every payment\n\t\t\t\t\t$amount = ihc_coupon_return_price_after_decrease($amount, $coupon_data, TRUE, $u_id, $l_id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//discount on single payment\n\t\t\t\t$amount = ihc_coupon_return_price_after_decrease($amount, $coupon_data, TRUE, $u_id, $l_id);\n\t\t\t}\n\t\t}\n\t}\n\n\t///TAXES\n\t$state = get_user_meta($u_id, 'ihc_state', TRUE);\n\t$country = ($ihc_country==FALSE) ? '' : $ihc_country;\n\t$taxes_data = ihc_get_taxes_for_amount_by_country($country, $state, $amount);\n\tif ($taxes_data && !empty($taxes_data['total'])){\n\t\t$taxes = $taxes_data['total'];\n\t\t$amount += $taxes;\n\t\tIhc_User_Logs::write_log( __('2Checkout Payment: taxes value: ', 'ihc') . $taxes . $currency, 'payments');\n\t}\n\n\t$li_0_name = (empty($level_data[$l_id]['label'])) ? 'Level ' . $l_id : $level_data[$l_id]['label'];\n\n\tIhc_User_Logs::write_log( __('2Checkout Payment: amount set @ ', 'ihc') . $amount . $currency, 'payments');\n\n\t$params_arr = array(\n\t\t\t'sid' => $checkout_account_num,\n\t\t\t'mode' => '2CO',\n\t\t\t'pay_method' => 'CC',\n\t\t\t'li_0_type' => 'product',\n\t\t\t'li_0_name' => $li_0_name,\n\t\t\t'li_0_product_id' => $l_id,\n\t\t\t'li_0_quantity' => 1,\n\t\t\t'li_0_price' => $amount,\n\t\t\t'li_0_tangible' => 'N',\n\t\t\t'li_0_description' => json_encode(array(\"u_id\" => $u_id, \"l_id\" => $l_id)),\n\t\t\t'currency_code' => $currency,\n\t\t\t'x_receipt_link_url' => admin_url(\"admin-ajax.php\") . \"?action=ihc_twocheckout_ins\",//\n\t\t\t'purchase_step' => 'billing-information',\n\t);\n\n\t//====================== RECURRING\n\tif (isset($level_data[$l_id]['access_type']) && $level_data[$l_id]['access_type']=='regular_period'){\n\n\t\tswitch ($level_data[$l_id]['access_regular_time_type']){\n\t\t\tcase 'D':\n\t\t\t\t$weeks = $level_data[$l_id]['access_regular_time_value'] / 7;\n\t\t\t\tif ($weeks<1){\n\t\t\t\t\t$weeks = 1;\n\t\t\t\t}\n\t\t\t\t$reccurence_time = ceil($weeks) . ' Week';\n\t\t\t\t$billing = ceil($weeks) . ' Week';\n\t\t\t\tbreak;\n\t\t\tcase 'W':\n\t\t\t\t$reccurence_time = $level_data[$l_id]['access_regular_time_value'] . ' Week';\n\t\t\t\t$billing = $level_data[$l_id]['billing_limit_num'] . ' Week';\n\t\t\t\tbreak;\n\t\t\tcase 'M':\n\t\t\t\t$reccurence_time = $level_data[$l_id]['access_regular_time_value'] . ' Month';\n\t\t\t\t$billing = $level_data[$l_id]['billing_limit_num'] . ' Month';\n\t\t\t\tbreak;\n\t\t\tcase 'Y':\n\t\t\t\t$reccurence_time = $level_data[$l_id]['access_regular_time_value'] . ' Year';\n\t\t\t\t$billing = $level_data[$l_id]['billing_limit_num'] . ' Year';\n\t\t\t\tbreak;\n\t\t}\n\t\t$params_arr['li_0_recurrence'] = $reccurence_time;//billing frequency. Ex. �1 Week� to bill order once a week. (Can use # Week, # Month, or # Year)\n\t\t$params_arr['li_0_duration'] = $billing;//how long to continue billing. Ex. �1 Year�, to continue billing for 1 year. (Forever or # Week, # Month, # Year)\n\n\t\t//trial for a single subscribe payment\n\t\tif (isset($level_data[$l_id]['access_trial_type']) && $level_data[$l_id]['access_trial_type']==2 && isset($level_data[$l_id]['access_trial_couple_cycles']) && $level_data[$l_id]['access_trial_couple_cycles']>0){\n\t\t\t////DISCOUNT\n\t\t\t$params_arr['li_0_startup_fee'] = $level_data[$l_id]['access_trial_price'] - $amount;\n\t\t\tif (!empty($discount_once)){\n\t\t\t\t//discount just once on recurring with trial period\n\t\t\t\t$params_arr['li_0_startup_fee'] = $params_arr['li_0_startup_fee'] + $discount_once;\n\t\t\t}\n\t\t} else if (!empty($discount_once)){\n\t\t\t//discount just once on recurring without trial period\n\t\t\t$params_arr['li_0_startup_fee'] = $discount_once;\n\t\t}\n\n\t\t/// TAXES\n\t\tif (isset($params_arr['li_0_startup_fee']) && !empty($ihc_country)){\n\t\t\t$state = get_user_meta($u_id, 'ihc_state', TRUE);\n\t\t\t$country = ($ihc_country==FALSE) ? '' : $ihc_country;\n\t\t\t$taxes_data = ihc_get_taxes_for_amount_by_country($country, $state, $params_arr['li_0_startup_fee']);\n\t\t\tif ($taxes_data && !empty($taxes_data['total'])){\n\t\t\t\t$taxes = $taxes_data['total'];\n\t\t\t\t$params_arr['li_0_startup_fee'] += $taxes;\n\t\t\t\tIhc_User_Logs::write_log( __('2Checkout Payment: taxes value: ', 'ihc') . $taxes . $currency, 'payments');\n\t\t\t}\n\t\t}\n\t}\n\n\t$sandbox = get_option('ihc_twocheckout_sandbox');\n\tif ($sandbox){\n\t\t$base_url = \"sandbox.2checkout.com\";\n\t\t$params_arr['demo'] = 'Y';\n\t\tIhc_User_Logs::write_log( __('2Checkout Payment: Set Sandbox mode.', 'ihc'), 'payments');\n\t} else {\n\t\t$base_url = \"www.2checkout.com\";\n\t\tIhc_User_Logs::write_log( __('2Checkout Payment: Set Live mode.', 'ihc'), 'payments');\n\t}\n\n\t$params_str = '';\n\tforeach ($params_arr as $k=>$v){\n\t\tif (empty($params_str)){\n\t\t\t$params_str = '?';\n\t\t} else {\n\t\t\t$params_str .= '&';\n\t\t}\n\t\t$params_str .= urlencode($k) . \"=\" . urlencode($v);\n\t}\n\n\tIhc_User_Logs::write_log( __('2Checkout Payment: Submit data to 2checkout.', 'ihc'), 'payments');\n\t$redirect_url = 'https://' . $base_url . '/checkout/purchase' . $params_str;\n\n\t//logout user...\n\t//wp_logout();\n\twp_redirect( $redirect_url );\n\texit();\n}", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function discountvoucherpurchase_civicrm_postProcess($formName, &$form ) {\n if($formName == 'CRM_Contribute_Form_Contribution_Confirm' && isset($form->_id) && $form->_id == 24){\n $params = array(\n 'code' => $form->_params['contactID'] . '-' . $form->_params['contributionID'],\n 'description' => 'gift from ' . $form->_params['email-5'],\n 'amount' => 100,\n 'amount_type' => 1,\n 'count_max' => 1,\n 'memberships'=> array(7,22),\n 'version' => 3,\n 'multi_valued' => array('memberships' => 1),\n );\n $code = civicrm_api('DiscountCode', 'create', $params);\n }\n}", "public function __construct() {\n \n $this->id = 'wcpg-pay-on-credit'; // payment gateway plugin ID\n $this->icon = ''; // URL of the icon that will be displayed on checkout page near your gateway name\n $this->has_fields = true; // in case you need a custom credit card form\n $this->method_title = 'Pay On Credit Gateway';\n $this->method_description = 'Pay on credit gateway'; // will be displayed on the options page\n $this->domain = 'wcpg-pay-on-credit';\n \n // gateways can support subscriptions, refunds, saved payment methods,\n // but in this tutorial we begin with simple payments\n $this->supports = array(\n 'products'\n );\n\n\n // Define \"payment duration\" radio buttons options field\n $this->options = array(\n '4' => __( '4 Months Payment', $this->domain ),\n '6' => __( '6 Months Payment', $this->domain ),\n ); \n \n // Method with all the options fields\n $this->init_form_fields();\n \n // Load the settings.\n $this->init_settings();\n $this->title = $this->get_option( 'title' );\n $this->description = $this->get_option( 'description' );\n $this->instructions = $this->get_option( 'instructions' );\n $this->order_status = $this->get_option( 'order_status' );\n $this->status_text = $this->get_option( 'status_text' );\n $this->enabled = $this->get_option( 'enabled' );\n \n // This action hook saves the settings\n add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\n add_action( 'woocommerce_checkout_create_order', array( $this, 'save_order_payment_type_meta_data' ), 10, 2 );\n add_filter( 'woocommerce_get_order_item_totals', array( $this, 'display_payment_duration_order_item_totals'), 10, 3 );\n add_action( 'woocommerce_admin_order_data_after_billing_address', array( $this, 'display_payment_type_order_edit_pages'), 10, 1 );\n add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) );\n\n // Customer Emails\n add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 ); \n \n // We need custom JavaScript to obtain a token\n add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) );\n \n \n \t\t}", "public function thankyou_page_kdbayar() {\n\t\tglobal $woocommerce;\n \n\t\t$invoice = $_POST['invoice'];\n\t\t$result_code = $_POST['result_code'];\n\t\t\n\t\t$customer_order = new WC_Order( $invoice );\n\t\t\n\t\tif($result_code == '00'){\n\t\t\t// Payment successful\n\t\t\t$customer_order->add_order_note( __( 'Finnet processing payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// paid order marked\n\t\t\t$customer_order->update_status('processing');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}elseif ($result_code == '05') {\n\t\t\t// Payment expired\n\t\t\t$customer_order->add_order_note( __( 'Finnet expired payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// expired order marked\n\t\t\t$customer_order->update_status('failed');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}\n\t}", "function learndash_coupons_init() {\n\t\tadd_action( 'wp_ajax_learndash_apply_coupon', 'learndash_apply_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_remove_coupon', 'learndash_remove_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_enroll_with_zero_price', 'learndash_enroll_with_zero_price' );\n\t\tadd_action( 'learndash_transaction_created', 'learndash_process_coupon_after_transaction' );\n\t\tadd_filter( 'learndash_get_price_by_coupon', 'learndash_get_price_by_coupon', 10, 3 );\n\t}", "function getfaircoin_edd_updated_edited_purchase( $payment_id ) {\r\n // get the payment meta\r\n $payment_meta = edd_get_payment_meta( $payment_id );\r\n // update our fairaddress number\r\n $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : false;\r\n $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : false;\r\n // update the payment meta with the new array\r\n update_post_meta( $payment_id, '_edd_payment_meta', $payment_meta );\r\n}", "public function payment_scripts() {\n if (!is_checkout()) {\n return;\n }\n\n wp_enqueue_script('openpay', 'https://openpay.s3.amazonaws.com/openpay.v1.min.js', '', '1.0', true);\n wp_enqueue_script('openpay_fraud', 'https://openpay.s3.amazonaws.com/openpay-data.v1.min.js', '', '1.0', true);\n wp_enqueue_script('woocommerce_openpay', plugins_url('assets/js/openpay.js', dirname(__FILE__)), array('openpay'), WC_OPENPAY_VERSION, true);\n\n $openpay_params = array(\n 'merchant_id' => $this->merchant_id,\n 'public_key' => $this->publishable_key,\n 'sandbox_mode' => $this->testmode,\n 'i18n_terms' => __('Please accept the terms and conditions first', 'openpay-woosubscriptions'),\n 'i18n_required_fields' => __('Please fill in required checkout fields first', 'openpay-woosubscriptions'),\n );\n\n // If we're on the pay page we need to pass openpay.js the address of the order.\n if (is_checkout_pay_page() && isset($_GET['order']) && isset($_GET['order_id'])) {\n $order_key = urldecode($_GET['order']);\n $order_id = absint($_GET['order_id']);\n $order = new WC_Order($order_id);\n\n if ($order->id == $order_id && $order->order_key == $order_key) {\n $openpay_params['billing_first_name'] = $order->billing_first_name;\n $openpay_params['billing_last_name'] = $order->billing_last_name;\n $openpay_params['billing_address_1'] = $order->billing_address_1;\n $openpay_params['billing_address_2'] = $order->billing_address_2;\n $openpay_params['billing_state'] = $order->billing_state;\n $openpay_params['billing_city'] = $order->billing_city;\n $openpay_params['billing_postcode'] = $order->billing_postcode;\n $openpay_params['billing_country'] = $order->billing_country;\n }\n }\n\n wp_localize_script('woocommerce_openpay', 'wc_openpay_params', $openpay_params);\n }", "function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}", "function wyz_business_stats_time_spent() {\n\tif ( ! isset( $_POST['timeSpent'] ) || ! isset($_POST['id']) || ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'wyz_ajax_custom_nonce' ) )\n\t\treturn;\n\t$id = esc_html( $_POST['id'] );\n\tif( false === get_post_status( $id ) || WyzHelpers::wyz_is_current_user_author( $id ) )\n\t\treturn;\n\t$time = int_val(esc_html($_POST['timeSpent']));\n\tif ( is_nan( $time ) )return;\n\t$count = WyzHelpers::get_business_visits_count( $id );\n\tif( ! $count )return;\n\t$total_time = WyzHelpers::get_business_visits_total_time( $id );\n\t$total_time += $time;\n\t$avg_time = $total_time/$count;\n\tupdate_post_meta( $id, 'wyz_business_visits_average_time', $avg_time);\n\tupdate_post_meta( $id, 'wyz_business_visits_total_time', $total_time);\n\twp_die();\n}", "public function calculate_deposit_callback() {\n\t\n // Do not proceed if deposit feature is disabled\n if (get_option( 'woo_payment_option' ) == 'disabled') {\n \n return false;\n }\n \n\t if ($_POST['deposit_option'] == 'full') {\n \t\t\n \t\tWC()->session->set( 'deposit_option', 'full' );\n\t\t} else {\n \t\t\n \t\tWC()->session->set( 'deposit_option', 'deposit' );\n\t\t}\n\t\t\n\t\techo $this->calculate_cart_total( WC()->cart );\n\t\t\n\t\tdie();\n\t}", "function payment_complete( $order ){\n\n if( $order->status == 'processing' ){\n\n $order->update_status( 'completed' );\n\n add_post_meta( $order->id, '_paid_date', current_time('mysql'), true );\n\n $this_order = array(\n 'ID' => $order->id,\n 'post_date' => current_time( 'mysql', 0 ),\n 'post_date_gmt' => current_time( 'mysql', 1 )\n );\n wp_update_post( $this_order );\n \n if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $order->id ) ) {\n $order->reduce_order_stock(); // Payment is complete so reduce stock levels\n }\n\n do_action( 'woocommerce_payment_complete', $order->id );\n }\n }", "function apptivo_ecommerce_order_review() {\r\n apptivo_ecommerce_get_template('checkout/review_order.php', false);\r\n}", "function update_after_fre_review($project_id, $comment_id) {\n global $wpdb;\n if (isset($_POST['score']) && $_POST['score']) {\n $rate = (int)$_POST['score'];\n if ($rate > 5) $rate = 5;\n update_comment_meta($comment_id, 'et_rate', $rate);\n update_post_meta($project_id, 'rating_score', $rate);\n }\n $employer_id = (int)get_post_field('post_author', $project_id);\n $profile_id = get_user_meta($employer_id, 'user_profile_id', true);\n $sql = \"SELECT AVG(M.meta_value) as rate_point, COUNT(C.comment_ID) as count\n FROM $wpdb->posts as p \n join $wpdb->comments as C \n ON p.ID = C.comment_post_ID \n join $wpdb->commentmeta as M \n ON C.comment_ID = M.comment_id\n WHERE \n p.post_author = $employer_id\n AND p.post_status ='complete'\n AND p.post_type ='\" . PROJECT . \"' \n AND M.meta_key = 'et_rate'\n AND C.comment_type ='fr_review'\n AND C.comment_approved = 1\";\n \n $results = $wpdb->get_results($sql);\n \n if ($results) {\n wp_cache_set(\"reviews-{$employer_id}\", $results[0]->count);\n \n // update post rating score\n update_post_meta($profile_id, 'rating_score', $results[0]->rate_point);\n } else {\n update_post_meta($profile_id, 'rating_score', $rate);\n }\n\n // send mail to employer.\n $this->mail->review_employer_email($project_id);\n }", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "function charge_deposit($acc_number,$sum)\n\t{\n\t $this->db->query(\"UPDATE pamm_summaries SET deposit = deposit+$sum WHERE acc_number=$acc_number\");\n\t}", "function process_payment( $order_id )\n {\n\n //cuando hace click en proceder al pago, luego de elegir seguripago\n //finalizar-comprar/ 1\n\n $order = new WC_Order( $order_id );\n\n return array\n (\n 'result' => 'success',\n 'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('pay'))))\n );\n }", "function getFoldCost ($quantity, &$labor) {\n\tif ($_POST[\"fold\"] == \"fold\"){\n\t\t$foldLabor = HOUR * FOLDSETUP;\n\t\t$foldLabor += (($quantity * FOLDTIME) * HOUR);\n\t}\nelse {\n\t$foldLabor = 0;\n\t}\n$labor += $foldLabor;\n}" ]
[ "0.6457636", "0.6354419", "0.63102514", "0.58677727", "0.58461505", "0.57832384", "0.57083666", "0.5694343", "0.56919396", "0.5687329", "0.56806856", "0.56623244", "0.5660489", "0.5656696", "0.56446207", "0.56108165", "0.56063044", "0.55687577", "0.55647063", "0.5519983", "0.5516733", "0.5512749", "0.5511662", "0.55044675", "0.55004466", "0.5467348", "0.54570997", "0.5449297", "0.5434623", "0.54324216", "0.54323286", "0.5427665", "0.5426427", "0.5408273", "0.54001796", "0.53800875", "0.53642416", "0.5344433", "0.53396153", "0.53344727", "0.53256696", "0.53255296", "0.5320558", "0.531955", "0.53135294", "0.52992916", "0.5288489", "0.5288191", "0.5287304", "0.5276998", "0.5261861", "0.5257998", "0.52575123", "0.5252873", "0.52517456", "0.52503234", "0.52475363", "0.5242828", "0.52375007", "0.52318823", "0.5218688", "0.52149427", "0.5213395", "0.5200867", "0.5196228", "0.5184627", "0.5176459", "0.5175359", "0.51746446", "0.51581895", "0.5150873", "0.51496476", "0.5143335", "0.5139995", "0.5137248", "0.51367694", "0.5135055", "0.51287836", "0.5124611", "0.51206344", "0.51195407", "0.5107123", "0.51034576", "0.51029235", "0.51006436", "0.5099672", "0.50970674", "0.5096442", "0.5095491", "0.5087073", "0.50842035", "0.5082916", "0.507557", "0.50740373", "0.50698185", "0.506788", "0.5063431", "0.5058554", "0.5057645", "0.5055304" ]
0.713603
0
Class constructor, more about it in Step 3
public function __construct() { $this->id = 'wcpg-pay-on-credit'; // payment gateway plugin ID $this->icon = ''; // URL of the icon that will be displayed on checkout page near your gateway name $this->has_fields = true; // in case you need a custom credit card form $this->method_title = 'Pay On Credit Gateway'; $this->method_description = 'Pay on credit gateway'; // will be displayed on the options page $this->domain = 'wcpg-pay-on-credit'; // gateways can support subscriptions, refunds, saved payment methods, // but in this tutorial we begin with simple payments $this->supports = array( 'products' ); // Define "payment duration" radio buttons options field $this->options = array( '4' => __( '4 Months Payment', $this->domain ), '6' => __( '6 Months Payment', $this->domain ), ); // Method with all the options fields $this->init_form_fields(); // Load the settings. $this->init_settings(); $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->instructions = $this->get_option( 'instructions' ); $this->order_status = $this->get_option( 'order_status' ); $this->status_text = $this->get_option( 'status_text' ); $this->enabled = $this->get_option( 'enabled' ); // This action hook saves the settings add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_checkout_create_order', array( $this, 'save_order_payment_type_meta_data' ), 10, 2 ); add_filter( 'woocommerce_get_order_item_totals', array( $this, 'display_payment_duration_order_item_totals'), 10, 3 ); add_action( 'woocommerce_admin_order_data_after_billing_address', array( $this, 'display_payment_type_order_edit_pages'), 10, 1 ); add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) ); // Customer Emails add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 ); // We need custom JavaScript to obtain a token add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private function __construct() {}", "final private function __construct() {}", "private final function __construct() {}", "function _construct() {\n \t\n\t\t\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(){}", "function _construct(){ }", "final private function __construct()\n\t{\n\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct()\t{}", "final private function __construct() {\n\t\t\t}", "function __constructor(){}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "protected abstract function __construct();", "public function construct()\n\t\t{\n\t\t}", "public function _construct()\n\t{\n\n\t}", "private function __construct( )\n {\n\t}", "final private function __construct(){\r\r\n\t}", "final private function __construct()\n {\n }", "private function __construct()\r\n {}", "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 () {}", "private function __construct()\r\r\n\t{\r\r\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "function __construct() ;", "private function __construct() {\r\n\t\r\n\t}" ]
[ "0.84098613", "0.84098613", "0.83704025", "0.8352889", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.8338245", "0.83377904", "0.83213454", "0.8310251", "0.8310251", "0.8310251", "0.8282062", "0.8272928", "0.82344157", "0.8218252", "0.82178366", "0.82040983", "0.8196824", "0.8185418", "0.8175531", "0.8166928", "0.8161235", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155542", "0.8155391", "0.8155391", "0.8155383", "0.8137232", "0.8135489", "0.8131244", "0.8129155", "0.8120274" ]
0.0
-1
Plugin options, we deal with it in Step 3 too
public function init_form_fields(){ $this->form_fields = apply_filters( 'wc_pay_on_credit_form_fields', array( 'enabled' => array( 'title' => __( 'Enable/Disable', $this->domain ), 'type' => 'checkbox', 'label' => __( 'Enable Pay On Credit', $this->domain ), 'default' => 'yes' ), 'title' => array( 'title' => __( 'Title', $this->domain ), 'type' => 'text', 'description' => __( 'This controls the title for the payment method the customer sees during checkout.', $this->domain ), 'default' => __( 'Pay On Credit', $this->domain ), 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Description', $this->domain ), 'type' => 'textarea', 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ), 'default' => __( 'Split your cost over a period and pay', $this->domain ), 'desc_tip' => true, ), 'instructions' => array( 'title' => __( 'Instructions', $this->domain ), 'type' => 'textarea', 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ), 'default' => '', // Empty by default 'desc_tip' => true, ), 'order_status' => array( 'title' => __( 'Order Status', $this->domain ), 'type' => 'select', 'description' => __( 'Choose whether order status you wish after checkout.', $this->domain ), 'default' => 'wc-completed', 'desc_tip' => true, 'class' => 'wc-enhanced-select', 'options' => wc_get_order_statuses() ), 'status_text' => array( 'title' => __( 'Order Status Text', $this->domain ), 'type' => 'text', 'description' => __( 'Set the text for the selected order status.', $this->domain ), 'default' => __( 'Order is completed', $this->domain ), 'desc_tip' => true, ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TS_VCSC_Set_Plugin_Options() {\r\n\t\t// Redirect Option\r\n\t\tadd_option('ts_vcsc_extend_settings_redirect', \t\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_activation', \t\t\t\t\t\t0);\r\n\t\t// Options for Theme Authors\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypes', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeWidget',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTeam',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTestimonial',\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeLogo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeSkillset',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_additions', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_codeeditors', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_fontimport', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_iconicum', \t\t\t\t \t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_dashboard', \t\t\t\t\t\t1);\r\n\t\t// Options for Custom CSS/JS Editor\r\n\t\tadd_option('ts_vcsc_extend_settings_customCSS',\t\t\t\t\t\t\t'/* Welcome to the Custom CSS Editor! Please add all your Custom CSS here. */');\r\n\t\tadd_option('ts_vcsc_extend_settings_customJS', \t\t\t\t '/* Welcome to the Custom JS Editor! Please add all your Custom JS here. */');\r\n\t\t// Other Options\r\n\t\tadd_option('ts_vcsc_extend_settings_frontendEditor', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_buffering', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_mainmenu', \t\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsDomain', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_previewImages',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_visualSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativeSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativePaginator',\t\t\t\t\t'200');\r\n\t\tadd_option('ts_vcsc_extend_settings_backendPreview',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_extended', \t\t\t\t 0);\r\n\t\tadd_option('ts_vcsc_extend_settings_systemInfo',\t\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_socialDefaults', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_builtinLightbox', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_lightboxIntegration', \t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowAutoUpdate', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowNotification', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowDeprecated', \t\t\t\t\t0);\r\n\t\t// Font Active / Inactive\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMedia',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcon',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceAwesome',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceBrankic',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCountricons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCurrencies',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceElegant',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceEntypo',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFoundation',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceGenericons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcoMoon',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMonuments',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceSocialMedia',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceTypicons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFontsAll',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Awesome',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Entypo',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Linecons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_OpenIconic',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Typicons',\t\t\t\t0);\t\t\r\n\t\t// Custom Font Data\r\n\t\tadd_option('ts_vcsc_extend_settings_IconFontSettings',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustom',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomArray',\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomJSON',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPath',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPHP', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomName',\t\t\t\t\t'Custom User Font');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomAuthor',\t\t\t\t'Custom User');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomCount',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDate',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDirectory',\t\t\t'');\r\n\t\t// Row + Column Extensions\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRows',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsColumns',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRowEffectsBreak',\t\t\t'600');\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothScroll',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothSpeed',\t\t\t\t'30');\r\n\t\t// Custom Post Types\r\n\t\tadd_option('ts_vcsc_extend_settings_customWidgets',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTeam',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTestimonial',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customSkillset',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customTimelines', \t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customLogo', \t\t\t\t\t\t0);\r\n\t\t// tinyMCE Icon Shortcode Generator\r\n\t\tadd_option('ts_vcsc_extend_settings_useIconGenerator',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_useTinyMCEMedia', \t\t\t\t\t1);\r\n\t\t// Standard Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_StandardElements',\t\t\t\t\t'');\r\n\t\t// Demo Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_DemoElements', \t\t\t\t\t\t'');\r\n\t\t// WooCommerce Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceUse',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceElements',\t\t\t\t'');\r\n\t\t// bbPress Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressUse',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressElements',\t\t\t\t\t'');\r\n\t\t// Options for External Files\r\n\t\tadd_option('ts_vcsc_extend_settings_loadForcable',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadLightbox', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadTooltip', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadFonts', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadEnqueue',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHeader',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadjQuery', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadModernizr',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadWaypoints', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadCountTo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadMooTools', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadDetector', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHammerNew', \t\t\t\t\t1);\r\n\t\t// Google Font Manager Settings\r\n\t\tadd_option('ts_vcsc_extend_settings_allowGoogleManager', \t\t\t\t1);\r\n\t\t// Single Page Navigator\r\n\t\tadd_option('ts_vcsc_extend_settings_allowPageNavigator', \t\t\t\t0);\r\n\t\t// EnlighterJS - Syntax Highlighter\r\n\t\tadd_option('ts_vcsc_extend_settings_allowEnlighterJS',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowThemeBuilder',\t\t\t\t\t0);\r\n\t\t// Post Type Menu Positions\r\n\t\t$TS_VCSC_Menu_Positions_Defaults_Init = array(\r\n\t\t\t'ts_widgets'\t\t\t\t\t=> 50,\r\n\t\t\t'ts_timeline'\t\t\t\t\t=> 51,\r\n\t\t\t'ts_team'\t\t\t\t\t\t=> 52,\r\n\t\t\t'ts_testimonials'\t\t\t\t=> 53,\r\n\t\t\t'ts_skillsets'\t\t\t\t\t=> 54,\r\n\t\t\t'ts_logos'\t\t\t\t\t\t=> 55,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_menuPositions',\t\t\t\t\t\t$TS_VCSC_Menu_Positions_Defaults_Init);\r\n\t\t// Row Toggle Settings\r\n\t\t$TS_VCSC_Row_Toggle_Defaults_Init = array(\r\n\t\t\t'Large Devices' => 1200,\r\n\t\t\t'Medium Devices' => 992,\r\n\t\t\t'Small Devices' => 768,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_rowVisibilityLimits', \t\t\t\t$TS_VCSC_Row_Toggle_Defaults_Init);\r\n\t\t// Language Settings: Countdown\r\n\t\t$TS_VCSC_Countdown_Language_Defaults_Init = array(\r\n\t\t\t'DayPlural' => 'Days',\r\n\t\t\t'DaySingular' => 'Day',\r\n\t\t\t'HourPlural' => 'Hours',\r\n\t\t\t'HourSingular' => 'Hour',\r\n\t\t\t'MinutePlural' => 'Minutes',\r\n\t\t\t'MinuteSingular' => 'Minute',\r\n\t\t\t'SecondPlural' => 'Seconds',\r\n\t\t\t'SecondSingular' => 'Second',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsCountdown', \t\t\t$TS_VCSC_Countdown_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps PLUS\r\n\t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init = array(\r\n\t\t\t'ListenersStart' => 'Start Listeners',\r\n\t\t\t'ListenersStop' => 'Stop Listeners',\r\n\t\t\t'MobileShow' => 'Show Google Map',\r\n\t\t\t'MobileHide' => 'Hide Google Map',\r\n\t\t\t'StyleDefault' => 'Google Standard',\r\n\t\t\t'StyleLabel' => 'Change Map Style',\r\n\t\t\t'FilterAll' => 'All Groups',\r\n\t\t\t'FilterLabel' => 'Filter by Groups',\r\n\t\t\t'SelectLabel' => 'Zoom to Location',\r\n\t\t\t'ControlsOSM' => 'Open Street',\r\n\t\t\t'ControlsHome' => 'Home',\r\n\t\t\t'ControlsBounds' => 'Fit All',\r\n\t\t\t'ControlsBike' => 'Bicycle Trails',\r\n\t\t\t'ControlsTraffic' => 'Traffic',\r\n\t\t\t'ControlsTransit' => 'Transit',\r\n\t\t\t'TrafficMiles' => 'Miles per Hour',\r\n\t\t\t'TrafficKilometer' => 'Kilometers per Hour',\r\n\t\t\t'TrafficNone' => 'No Data Available',\r\n\t\t\t'SearchButton' => 'Search Location',\r\n\t\t\t'SearchHolder' => 'Enter address to search for ...',\r\n\t\t\t'SearchGoogle' => 'View on Google Maps',\r\n\t\t\t'SearchDirections' => 'Get Directions',\r\n\t\t\t'OtherLink' => 'Learn More!',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMapPLUS', \t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps (Deprecated)\r\n\t\t$TS_VCSC_Google_Map_Language_Defaults_Init = array(\r\n\t\t\t'TextCalcShow' => 'Show Address Input',\r\n\t\t\t'TextCalcHide' => 'Hide Address Input',\r\n\t\t\t'TextDirectionShow' => 'Show Directions',\r\n\t\t\t'TextDirectionHide' => 'Hide Directions',\r\n\t\t\t'TextResetMap' => 'Reset Map',\r\n\t\t\t'PrintRouteText' \t\t\t => 'Print Route',\r\n\t\t\t'TextViewOnGoogle' => 'View on Google',\r\n\t\t\t'TextButtonCalc' => 'Show Route',\r\n\t\t\t'TextSetTarget' => 'Please enter your Start Address:',\r\n\t\t\t'TextGeoLocation' => 'Get My Location',\r\n\t\t\t'TextTravelMode' => 'Travel Mode',\r\n\t\t\t'TextDriving' => 'Driving',\r\n\t\t\t'TextWalking' => 'Walking',\r\n\t\t\t'TextBicy' => 'Bicycling',\r\n\t\t\t'TextWP' => 'Optimize Waypoints',\r\n\t\t\t'TextButtonAdd' => 'Add Stop on the Way',\r\n\t\t\t'TextDistance' => 'Total Distance:',\r\n\t\t\t'TextMapHome' => 'Home',\r\n\t\t\t'TextMapBikes' => 'Bicycle Trails',\r\n\t\t\t'TextMapTraffic' => 'Traffic',\r\n\t\t\t'TextMapSpeedMiles' => 'Miles Per Hour',\r\n\t\t\t'TextMapSpeedKM' => 'Kilometers Per Hour',\r\n\t\t\t'TextMapNoData' => 'No Data Available!',\r\n\t\t\t'TextMapMiles' => 'Miles',\r\n\t\t\t'TextMapKilometes' => 'Kilometers',\r\n\t\t\t'TextMapActivate' => 'Show Google Map',\r\n\t\t\t'TextMapDeactivate' => 'Hide Google Map',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMap', \t\t\t$TS_VCSC_Google_Map_Language_Defaults_Init);\r\n\t\t// Language Settings: Isotope Posts\r\n\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init = array(\r\n\t\t\t'ButtonFilter'\t\t => 'Filter Posts', \r\n\t\t\t'ButtonLayout'\t\t => 'Change Layout',\r\n\t\t\t'ButtonSort'\t\t => 'Sort Criteria',\r\n\t\t\t// Standard Post Strings\r\n\t\t\t'Date' \t\t\t\t => 'Post Date', \r\n\t\t\t'Modified' \t\t\t => 'Post Modified', \r\n\t\t\t'Title' \t\t\t => 'Post Title', \r\n\t\t\t'Author' \t\t\t => 'Post Author', \r\n\t\t\t'PostID' \t\t\t => 'Post ID', \r\n\t\t\t'Comments' \t\t\t => 'Number of Comments',\r\n\t\t\t// Layout Strings\r\n\t\t\t'SeeAll'\t\t\t => 'See All',\r\n\t\t\t'Timeline' \t\t\t => 'Timeline',\r\n\t\t\t'Masonry' \t\t\t => 'Centered Masonry',\r\n\t\t\t'FitRows'\t\t\t => 'Fit Rows',\r\n\t\t\t'StraightDown' \t\t => 'Straigt Down',\r\n\t\t\t// WooCommerce Strings\r\n\t\t\t'WooFilterProducts' => 'Filter Products',\r\n\t\t\t'WooTitle' => 'Product Title',\r\n\t\t\t'WooPrice' => 'Product Price',\r\n\t\t\t'WooRating' => 'Product Rating',\r\n\t\t\t'WooDate' => 'Product Date',\r\n\t\t\t'WooModified' => 'Product Modified',\r\n\t\t\t// General Strings\r\n\t\t\t'Categories' => 'Categories',\r\n\t\t\t'Tags' => 'Tags',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsIsotopePosts', \t\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init);\r\n\t\t// Options for Lightbox Settings\r\n\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init = array(\r\n\t\t\t'thumbs' => 'bottom',\r\n\t\t\t'thumbsize' => 50,\r\n\t\t\t'animation' => 'random',\r\n\t\t\t'captions' => 'data-title',\r\n\t\t\t'closer' => 1, // true/false\r\n\t\t\t'duration' => 5000,\r\n\t\t\t'share' => 0, // true/false\r\n\t\t\t'social' \t => 'fb,tw,gp,pin',\r\n\t\t\t'notouch' => 1, // true/false\r\n\t\t\t'bgclose'\t\t\t => 1, // true/false\r\n\t\t\t'nohashes'\t\t\t => 1, // true/false\r\n\t\t\t'keyboard'\t\t\t => 1, // 0/1\r\n\t\t\t'fullscreen'\t\t => 1, // 0/1\r\n\t\t\t'zoom'\t\t\t\t => 1, // 0/1\r\n\t\t\t'fxspeed'\t\t\t => 300,\r\n\t\t\t'scheme'\t\t\t => 'dark',\r\n\t\t\t'removelight' => 0,\r\n\t\t\t'customlight' => 0,\r\n\t\t\t'customcolor'\t\t => '#ffffff',\r\n\t\t\t'backlight' \t\t => '#ffffff',\r\n\t\t\t'usecolor' \t\t => 0, // true/false\r\n\t\t\t'background' => '',\r\n\t\t\t'repeat' => 'no-repeat',\r\n\t\t\t'overlay' => '#000000',\r\n\t\t\t'noise' => '',\r\n\t\t\t'cors' => 0, // true/false\r\n\t\t\t'scrollblock' => 'css',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxSettings',\t\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxAnimation', \t\t\t'random');\r\n\t\t// Options for Envato Sales Data\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoData', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoInfo', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoLink', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoPrice', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoRating', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoSales', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoCheck', \t\t\t\t\t 0);\r\n\t\t$roles \t\t\t\t\t\t\t\t= get_editable_roles();\r\n\t\tforeach ($GLOBALS['wp_roles']->role_objects as $key => $role) {\r\n\t\t\tif (isset($roles[$key]) && $role->has_cap('edit_pages') && !$role->has_cap('ts_vcsc_extend')) {\r\n\t\t\t\t$role->add_cap('ts_vcsc_extend');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function initPlugin()\n {\n $this->getAdminOptions();\n }", "function load_plugin() {\n global $fb_opt_name, $gp_opt_name, $popup_fb_page, $popup_delay, $fb_popup_box;\n \n if(is_admin()&& get_option('Activated_Plugin')=='Plugin-Slug') {\n delete_option('Activated_Plugin');\n add_option($fb_opt_name,'on');\n add_option($gp_opt_name,'on');\n add_option($popup_fb_page,'codesamplez');\n add_option($popup_delay,'2');\n add_option($fb_popup_box,'on');\n }\n}", "abstract public function pluginDetails();", "public function load_options() {\n\t\t$this->disable_hash = get_option( 'health-check-disable-plugin-hash', null );\n\t\t$this->allowed_plugins = get_option( 'health-check-allowed-plugins', array() );\n\t\t$this->default_theme = ( 'yes' === get_option( 'health-check-default-theme', 'yes' ) ? true : false );\n\t\t$this->active_plugins = $this->get_unfiltered_plugin_list();\n\t\t$this->current_theme = get_option( 'health-check-current-theme', false );\n\t}", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "public function options() {}", "protected function initOptions()\n {\n }", "protected function get_options()\n\t{}", "protected function doPrePluginOptionsSave() {\r\n\r\n\t\t\t$oDp = $this->loadDataProcessor();\r\n\r\n\t\t\t$sAuthKey = $this->getPluginAuthKey();\r\n\t\t\tif ( empty( $sAuthKey ) || strlen( $sAuthKey ) != 24 ) {\r\n\t\t\t\t$this->setOpt( 'key', $oDp->GenerateRandomString( 24, 7 ) );\r\n\t\t\t}\r\n\r\n\t\t\t$nActivatedAt = $this->getOpt( 'activated_at' );\r\n\t\t\tif ( empty( $nActivatedAt ) ) {\r\n\t\t\t\t$this->setOpt( 'activated_at', $oDp->GetRequestTime() );\r\n\t\t\t}\r\n\t\t\t$nInstalledAt = $this->getOpt( 'installed_at' );\r\n\t\t\tif ( empty( $nInstalledAt ) ) {\r\n\t\t\t\t$this->setOpt( 'installed_at', $oDp->GetRequestTime() );\r\n\t\t\t}\r\n\r\n\t\t\t$this->setOpt( 'installed_version', $this->getController()->getVersion() );\r\n\r\n\t\t\t$nInstalledAt = $this->getOpt( 'installation_time' );\r\n\t\t\tif ( empty( $nInstalledAt ) || $nInstalledAt <= 0 ) {\r\n\t\t\t\t$this->setOpt( 'installation_time', time() );\r\n\t\t\t}\r\n\t\t}", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "public function flow_process_admin_options() {\r\n\r\n $hasFile = false;\r\n $nombrePlugin = basename(__DIR__);\r\n $idFileInput = \"woocommerce_\" . $this->id . \"_logo-small\";\r\n if (isset($_FILES[$idFileInput])) {\r\n $file = $_FILES[$idFileInput];\r\n $hasFile = $file['size']>0;\r\n if ($hasFile) {\r\n move_uploaded_file($file['tmp_name'], PLUGIN_DIR_flow.\"images/custom-logo-small.png\");\r\n }\r\n }\r\n\r\n $post_data = $this->get_post_data();\r\n $anyErrors = false;\r\n\r\n if(empty($post_data['woocommerce_'.$this->id.'_api_key'])){\r\n update_option('woocommerce_flow_api_key_valid', false);\r\n $anyErrors = true;\r\n }\r\n else{\r\n update_option('woocommerce_flow_api_key_valid', true);\r\n }\r\n\r\n if(empty($post_data['woocommerce_'.$this->id.'_secret_key'])){\r\n update_option('woocommerce_flow_secret_key_valid', false);\r\n $anyErrors = true;\r\n }\r\n else{\r\n update_option('woocommerce_flow_secret_key_valid', true);\r\n }\r\n\r\n if(!$anyErrors)\r\n $this->process_admin_options();\r\n\r\n return ;\r\n\r\n }", "static function optionsIns();", "public function options_load();", "function eventspractice_options() {\n\n $options = array (\n 'Option 1' => 'A',\n 'Option 2' => 'B',\n 'Option 3' => 'C'\n );\n\n if ( !get_option( 'eventspractice_options' ) ){\n add_option( 'eventspractice_option', $options );\n }\n update_option( 'eventspractice_option', $options );\n\n\n // add_option( 'eventspractice_option', 'My NEW Plugin Options' );\n // update_option( 'eventspractice_option', 'This is a test with the Options API' );\n // delete_option( 'eventspractice_option' );\n\n}", "function fmp_plugin_menu() {\n\tadd_options_page( 'FilemakerPro Importer', 'FilemakerPro Importer', 'manage_options', 'fmp-importer-options', 'fmp_plugin_options');\n}", "public function setup_plugin_url()\n {\n }", "function plugin_validate_options($opts){ \t\r\n\t\treturn $opts;\r\n\t}", "public function setArguments() {\n\n $theme = wp_get_theme(); // For use with some settings. Not necessary.\n\n $this->args = array(\n // TYPICAL -> Change these values as you need/desire\n 'opt_name' => 'tb_options',\n // This is where your data is stored in the database and also becomes your global variable name.\n 'display_name' => $theme->get( 'Name' ),\n // Name that appears at the top of your panel\n 'display_version' => $theme->get( 'Version' ),\n // Version that appears at the top of your panel\n 'menu_type' => 'menu',\n //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)\n 'allow_sub_menu' => true,\n // Show the sections below the admin menu item or not\n 'menu_title' => __( 'Theme Options', 'slova' ),\n 'page_title' => __( 'Theme Options', 'slova' ),\n // You will need to generate a Google API key to use this feature.\n // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth\n 'google_api_key' => '',\n // Set it you want google fonts to update weekly. A google_api_key value is required.\n 'google_update_weekly' => false,\n // Must be defined to add google fonts to the typography module\n 'async_typography' => true,\n // Use a asynchronous font on the front end or font string\n //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader\n 'admin_bar' => true,\n // Show the panel pages on the admin bar\n 'admin_bar_icon' => 'dashicons-portfolio',\n // Choose an icon for the admin bar menu\n 'admin_bar_priority' => 50,\n // Choose an priority for the admin bar menu\n 'global_variable' => '',\n // Set a different name for your global variable other than the opt_name\n 'dev_mode' => false,\n // Show the time the page took to load, etc\n 'update_notice' => false,\n // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo\n 'customizer' => true,\n // Enable basic customizer support\n //'open_expanded' => true, // Allow you to start the panel in an expanded way initially.\n //'disable_save_warn' => true, // Disable the save warning when a user changes a field\n\n // OPTIONAL -> Give you extra features\n 'page_priority' => null,\n // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.\n 'page_parent' => 'themes.php',\n // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n 'page_permissions' => 'manage_options',\n // Permissions needed to access the options panel.\n 'menu_icon' => '',\n // Specify a custom URL to an icon\n 'last_tab' => '',\n // Force your panel to always open to a specific tab (by id)\n 'page_icon' => 'icon-themes',\n // Icon displayed in the admin panel next to your menu_title\n 'page_slug' => '_options',\n // Page slug used to denote the panel\n 'save_defaults' => true,\n // On load save the defaults to DB before user clicks save or not\n 'default_show' => false,\n // If true, shows the default value next to each field that is not the default value.\n 'default_mark' => '',\n // What to print by the field's title if the value shown is default. Suggested: *\n 'show_import_export' => true,\n // Shows the Import/Export panel when not used as a field.\n\n // CAREFUL -> These options are for advanced use only\n 'transient_time' => 60 * MINUTE_IN_SECONDS,\n 'output' => true,\n // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output\n 'output_tag' => true,\n // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head\n // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it.\n\n // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.\n 'database' => '',\n // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!\n 'system_info' => false,\n // REMOVE\n\n // HINTS\n 'hints' => array(\n 'icon' => 'icon-question-sign',\n 'icon_position' => 'right',\n 'icon_color' => 'lightgray',\n 'icon_size' => 'normal',\n 'tip_style' => array(\n 'color' => 'light',\n 'shadow' => true,\n 'rounded' => false,\n 'style' => '',\n ),\n 'tip_position' => array(\n 'my' => 'top left',\n 'at' => 'bottom right',\n ),\n 'tip_effect' => array(\n 'show' => array(\n 'effect' => 'slide',\n 'duration' => '500',\n 'event' => 'mouseover',\n ),\n 'hide' => array(\n 'effect' => 'slide',\n 'duration' => '500',\n 'event' => 'click mouseleave',\n ),\n ),\n )\n );\n\t\t\t\t\n // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Visit us on GitHub',\n 'icon' => 'el-icon-github'\n //'img' => '', // You can use icon OR img. IMG needs to be a full URL.\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Like us on Facebook',\n 'icon' => 'el-icon-facebook'\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Follow us on Twitter',\n 'icon' => 'el-icon-twitter'\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Find us on LinkedIn',\n 'icon' => 'el-icon-linkedin'\n );\n }", "private function initRequirePlugin(){\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Options Framework', // The plugin name\n\t\t 'slug' => 'options-framework', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WooCommerce', // The plugin name\n\t\t 'slug' => 'woocommerce', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Contact Form 7', // The plugin name\n\t\t 'slug' => 'contact-form-7', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t 'source'\t\t\t\t => get_stylesheet_directory_uri() . '/sub/plugins/contact-form-7.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WPBakery Visual Composer', // The plugin name\n\t\t 'slug' => 'js_composer', // The plugin slug (typically the folder name)\n\t\t 'required' => true,\n\t\t 'source' => get_stylesheet_directory_uri() . '/sub/plugins/js_composer.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Revolution Slider', // The plugin name\n 'slug' => 'revslider', // The plugin slug (typically the folder name)\n 'required' => true, // If false, the plugin is only 'recommended' instead of required\n 'source' => get_stylesheet_directory_uri() . '/sub/plugins/revslider.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Wishlist', // The plugin name\n 'slug' => 'yith-woocommerce-wishlist', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH Woocommerce Compare', // The plugin name\n 'slug' => 'yith-woocommerce-compare', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Zoom Magnifier', // The plugin name\n\t\t 'slug' => 'yith-woocommerce-zoom-magnifier', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'MailChimp', // The plugin name\n\t\t 'slug' => 'mailchimp-for-wp', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\t}", "function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}", "abstract function options();", "public function plugin_info()\n {\n }", "function optionsframework_options() {\n\n\t$options = array();\n\t\n\t//GENERAL\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('General', 'wpex'),\n\t\t\"type\" \t=> 'heading',\n\t);\n\t\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Custom Logo', 'wpex'),\n\t\t\"desc\" \t=> __('Upload your custom logo.', 'wpex'),\n\t\t\"std\" \t=> '',\n\t\t\"id\" \t=> 'custom_logo',\n\t\t\"type\" \t=> 'upload',\n\t);\n\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Notification Bar', 'att'),\n\t\t\"desc\" \t=> __('Enter your text for the notification bar.', 'att'),\n\t\t\"std\" \t=> 'This is your notification bar...you can <a href=\"#\">add a link here &rarr;</a> if you want.',\n\t\t\"id\" \t=> 'notification',\n\t\t\"type\" \t=> 'textarea',\n\t);\n\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Custom Excerpt Lenght', 'wpex'),\n\t\t\"desc\" \t=> __('Enter your desired custom excerpt length.', 'wpex'),\n\t\t\"id\" \t=> 'excerpt_length',\n\t\t\"std\" \t=> '17',\n\t\t\"type\" \t=> 'text'\n\t);\n\t\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('AJAX Loading Instead of Pagination?', 'wpex'),\n\t\t\"desc\" \t=> __('Check box to enable the load more button rather then generic 1,2,3 pagination.', 'wpex'),\n\t\t\"id\" \t=> 'ajax_loading',\n\t\t\"std\" \t=> '1',\n\t\t\"type\" \t=> 'checkbox',\n\t);\n\t\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Custom WP Gallery?', 'wpex'),\n\t\t\"desc\" \t=> __('This theme outputs a custom gallery style for the WordPress shortcode, if you don\\'t like it or are using a plugin for this you can unselect the custom functionality here.', 'wpex'),\n\t\t\"id\" \t=> 'custom_wp_gallery',\n\t\t\"std\" \t=> '1',\n\t\t\"type\" \t=> 'checkbox'\n\t);\n\t\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Enable Retina Support', 'wpex'),\n\t\t\"desc\"\t=> __('Check this box to enable retina support for featured images. If enabled for every cropped featured image the theme will create a second one that is retina optimized. So keep disabled to save server space.', 'wpex'),\n\t\t\"id\"\t=> 'enable_retina',\n\t\t\"std\"\t=> '0',\n\t\t\"type\"\t=> 'checkbox'\n\t);\n\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Featured Images For Single Posts', 'wpex'),\n\t\t\"desc\"\t=> __('Check this box to enable the display of featured images in single posts.', 'wpex'),\n\t\t\"id\"\t=> 'single_thumb',\n\t\t\"std\"\t=> '1',\n\t\t\"type\"\t=> 'checkbox'\n\t);\n\t\t\n\t\n\t//HOMEPAGE\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Home', 'wpex'),\n\t\t\"type\" \t=> 'heading',\n\t);\t\n\t\t\n\t$options[] = array(\n\t\t\"name\" \t=> __('Homepage Content', 'att'),\n\t\t\"desc\" \t=> __('Use this field to add content to your homepage area right below the main slider (or instead of the slider if you aren\\'t using it) and right above the latest posts.', 'att'),\n\t\t\"std\" \t=> '',\n\t\t\"id\" \t=> 'homepage_content',\n\t\t\"type\" \t=> 'editor',\n\t);\n\t\t\t\n\t\t\n\t//Slider\n\t$options[] = array(\n\t\t\"name\" \t=> __('Slides', 'att'),\n\t\t\"type\" \t=> 'heading',\n\t);\n\t\t\t\n\t\tif ( class_exists( 'Symple_Slides_Post_Type' ) ) {\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t\t=> __('Toggle: Slideshow', 'att'),\n\t\t\t\t\"desc\" \t\t=> __('Check this box to enable automatic slideshow for your slides.', 'att'),\n\t\t\t\t\"id\" \t\t=> \"slides_slideshow\",\n\t\t\t\t\"std\" \t\t=> \"true\",\n\t\t\t\t\"type\" \t\t=> \"select\",\n\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t'true' \t\t=> 'true',\n\t\t\t\t\t'false' \t=> 'false'\n\t\t\t) );\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t\t=> __('Toggle: Randomize', 'att'),\n\t\t\t\t\"desc\" \t\t=> __('Check this box to enable the randomize feature for your slides.', 'att'),\n\t\t\t\t\"id\" \t\t=> \"slides_randomize\",\n\t\t\t\t\"std\" \t\t=> \"false\",\n\t\t\t\t\"type\" \t\t=> \"select\",\n\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t'true' \t\t=> 'true',\n\t\t\t\t\t'false' \t=> 'false'\n\t\t\t) );\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t\t=> __('Animation', 'att'),\n\t\t\t\t\"desc\" \t\t=> __('Select your animation of choice.', 'att'),\n\t\t\t\t\"id\" \t\t=> \"slides_animation\",\n\t\t\t\t\"std\" \t\t=> \"slide\",\n\t\t\t\t\"type\" \t\t=> \"select\",\n\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t'fade' \t\t=> 'fade',\n\t\t\t\t\t'slide' \t=> 'slide'\n\t\t\t) );\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t\t=> __('Direction', 'att'),\n\t\t\t\t\"desc\" \t\t=> __('Select the direction for your slides. Slide animation only & if using the <strong>vertical direction</strong> all slides must have the same height.', 'att'),\n\t\t\t\t\"id\" \t\t=> \"slides_direction\",\n\t\t\t\t\"std\" \t\t=> \"horizontal\",\n\t\t\t\t\"type\" \t\t=> \"select\",\n\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t'horizontal' \t=> 'horizontal',\n\t\t\t\t\t'vertical' \t\t=> 'vertical'\n\t\t\t) );\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t=> __('SlideShow Speed', 'att'),\n\t\t\t\t\"desc\" \t=> __('Enter your preferred slideshow speed in milliseconds.', 'att'),\n\t\t\t\t\"id\" \t=> \"slideshow_speed\",\n\t\t\t\t\"std\" \t=> \"7000\",\n\t\t\t\t\"type\" \t=> \"text\",\n\t\t\t);\n\t\t\t\t\n\t\t\t$options[] = array(\n\t\t\t\t\"name\" \t=> __('Animation Speed', 'att'),\n\t\t\t\t\"desc\" \t=> __('Enter your preferred animation speed in milliseconds.', 'att'),\n\t\t\t\t\"id\" \t=> \"animation_speed\",\n\t\t\t\t\"std\" \t=> \"600\",\n\t\t\t\t\"type\" \t=> \"text\",\n\t\t\t);\n\t\t}\n\t\t\t\n\t\t$options[] = array(\n\t\t\t\"name\" \t=> __('Slider Alternative', 'att'),\n\t\t\t\"desc\" \t=> __('If you prefer to use another slider you can enter the <strong>shortcode</strong> here.', 'att'),\n\t\t\t\"id\" \t=> \"slides_alt\",\n\t\t\t\"std\" \t=> \"\",\n\t\t\t\"type\" \t=> \"textarea\",\n\t\t);\n\n\treturn $options;\n}", "private function plugin_load_settings() {\r\n\t\tif (empty($this->options)) {\r\n\t\t\t$this->options = get_option( $this->options_name );\r\n\t\t}\r\n\t\tif ( !is_array( $this->options ) ) {\r\n\t\t\t$this->options = array();\r\n\t\t}\r\n\t\t$this->options = wp_parse_args($this->options, $this->defaults);\r\n\t}", "private function gather_plugin_options() {\n $options = array();\n foreach ( $this->OPTIONS as $value ) {\n $options[ $value ] = get_option( $value );\n }\n return array( '_wp_super_cache_options' => $options );\n }", "function options_page(){\r\n include($this->plugin_dir.'/include/options-page.php');\r\n }", "function charity_is_hope_trx_donations_importer_set_options($options=array()) {\n\t\tif ( in_array('trx_donations', (array)charity_is_hope_storage_get('required_plugins')) && charity_is_hope_exists_trx_donations() ) {\n\t\t\t// Add slugs to export options for this plugin\n\t\t\t$options['additional_options'][] = 'trx_donations_options';\n\t\t}\n\t\treturn $options;\n\t}", "function cmh_init(){\r\n\tregister_setting( 'cmh_plugin_options', 'cmh_options', 'cmh_validate_options' );\r\n}", "function init_integrated_options() {\n\t\t$this->permalink_sections();\n\n\t}", "public function options_init() {\n\t\t\tglobal $allowedtags;\n\t\t\t$allowedtags['p'] = array();\n\t\t\t$this->allowedtags = $allowedtags;\n\n\t\t // set options equal to defaults\n\t\t $this->_options = get_option( $this->options_group[0]['options_name'] );\n\t\t if ( false === $this->_options ) {\n\t\t\t\t$this->_options = $this->get_defaults();\n\t\t }\n\t\t if ( isset( $_GET['undo'] ) && !isset( $_GET['settings-updated'] ) && is_array( $this->get_option('previous') ) ) {\n\t\t \t$this->_options = $this->get_option('previous');\n\t\t }\n\t\t update_option( $this->options_group[0]['options_name'], $this->_options );\t\t\n\t\t \n\t\t}", "public function init_plugin()\n {\n }", "function setup_framework_options(){\n$args = array();\n\n//Set it to dev mode to view the class settings/info in the form - default is false\n$args['dev_mode'] = false;\n\n//google api key MUST BE DEFINED IF YOU WANT TO USE GOOGLE WEBFONTS\n//$args['google_api_key'] = '***';\n\n//Remove the default stylesheet? make sure you enqueue another one all the page will look whack!\n//$args['stylesheet_override'] = true;\n\n//Choose to disable the import/export feature\n$args['show_import_export'] = false;\n\n//Choose a custom option name for your theme options, the default is the theme name in lowercase with spaces replaced by underscores\n$args['opt_name'] = 'paraiso_linux';\n\n//Custom menu icon\n//$args['menu_icon'] = '';\n\n//Custom menu title for options page - default is \"Options\"\n$args['menu_title'] = __('Opciones del tema', 'nhp-opts');\n\n//Custom Page Title for options page - default is \"Options\"\n$args['page_title'] = __('Opciones del theme de Paraiso Linux', 'nhp-opts');\n\n//Custom page slug for options page (wp-admin/themes.php?page=***) - default is \"nhp_theme_options\"\n$args['page_slug'] = 'pl_theme_options';\n\n//Custom page capability - default is set to \"manage_options\"\n//$args['page_cap'] = 'manage_options';\n\n//page type - \"menu\" (adds a top menu section) or \"submenu\" (adds a submenu) - default is set to \"menu\"\n//$args['page_type'] = 'submenu';\n\n//parent menu - default is set to \"themes.php\" (Appearance)\n//the list of available parent menus is available here: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n//$args['page_parent'] = 'themes.php';\n\n//custom page location - default 100 - must be unique or will override other items\n$args['page_position'] = 27;\n\n//Custom page icon class (used to override the page icon next to heading)\n//$args['page_icon'] = 'icon-themes';\n\n//Want to disable the sections showing as a submenu in the admin? uncomment this line\n//$args['allow_sub_menu'] = false;\n\t\t\n//Set the Help Sidebar for the options page - no sidebar by default\t\t\t\t\t\t\t\t\t\t\n$args['help_sidebar'] = __('<p>This is the sidebar content, HTML is allowed.</p>', 'nhp-opts');\n\n\n\n$sections = array();\n\t\t\t\t\n$sections[] = array(\n\t\t\t\t'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_107_text_resize.png',\n\t\t\t\t'title' => __('Adsense', 'nhp-opts'),\n\t\t\t\t'desc' => __('<p class=\"description\">Bloques de adsense</p>', 'nhp-opts'),\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-bloque-superior',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Bloque superior', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\t\n\t\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-bloque-inferior',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Bloque inferior', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\n\t\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-analytics',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Analytics', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\t\t\t\t\n\t\t\t\t\n\t$tabs = array();\n\t\t\t\n\t\n\tif(file_exists(trailingslashit(get_stylesheet_directory()).'README.html')){\n\t\t$tabs['theme_docs'] = array(\n\t\t\t\t\t\t'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_071_book.png',\n\t\t\t\t\t\t'title' => __('Documentation', 'nhp-opts'),\n\t\t\t\t\t\t'content' => nl2br(file_get_contents(trailingslashit(get_stylesheet_directory()).'README.html'))\n\t\t\t\t\t\t);\n\t}//if\n\n\tglobal $NHP_Options;\n\t$NHP_Options = new NHP_Options($sections, $args, $tabs);\n\n}", "abstract protected function options(): array;", "function optionsframework_options() {\n\n\t$options = array();\n\t$options[] = array(\n\t\t'name' => __('Logo Upload', 'options_check'),\n\t\t'desc' => __('Logo Upload', 'options_check'),\n\t\t'id' => 'logo_upload',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('Footer Copyright', 'options_check'),\n\t\t'desc' => __('text input field.', 'options_check'),\n\t\t'id' => 'footer_copyright',\n\t\t'std' => 'Text',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('Blog description', 'options_check'),\n\t\t'desc' => __('Blog description.', 'options_check'),\n\t\t'id' => 'blog_description',\n\t\t'std' => 'Default Text',\n\t\t'type' => 'textarea');\n\n\t/**\n\t * For $settings options see:\n\t * http://codex.wordpress.org/Function_Reference/wp_editor\n\t *\n\t * 'media_buttons' are not supported as there is no post to attach items to\n\t * 'textarea_name' is set by the 'id' you choose\n\t */\n\n\n\treturn $options;\n}", "public function add_global_custom_options()\n {\n add_options_page('Plugin options', 'Plugin options', 'manage_options', 'functions','global_custom_options');\n }", "private function manage_plugins( $option = NULL ){\n\t\tif ( 'skip' === $option )\n\t\t\treturn;\n\n\t\t# default plugin set\n\t\t$std_plugin = array(\n\t\t\t'debug-bar',\n\t\t\t'debug-bar-console',\n\t\t\t'debug-bar-cron',\n\t\t\t'debug-bar-extender',\n\t\t\t'developer',\n\t\t\t'log-viewer',\n\t\t\t'monster-widget',\n\t\t\t'piglatin',\n\t\t\t'regenerate-thumbnails',\n\t\t\t'rewrite-rules-inspector',\n\t\t\t'rtl-tester',\n\t\t\t'simply-show-ids',\n\t\t\t'theme-check',\n\t\t\t'theme-test-drive',\n\t\t\t'user-switching',\n\t\t\t'wordpress-importer',\n\t\t\t'wordpress-beta-tester',\n\t\t);\n\n\t\t# wpcom VIP plugin set\n\t\t$vip_plugin = array(\n\t\t\t'grunion-contact-form',\n\t\t\t'jetpack',\n\t\t\t'mp6',\n\t\t\t'polldaddy',\n\t\t\t'vip-scanner',\n\t\t);\n\t\t\n\t\t# plugin developers bundle\n\t\t$dev_plugin = array(\n\t\t\t'log-deprecated-notices',\n\t\t);\n\t\t\n\t\t# debug plugin bundle (author's choice)\n\t\t# please file a pull request to include/exclude plugins\n\t\t$debug_plugin = array(\n\t\t\t'debug-bar-actions-and-filters-addon',\n\t\t\t'debug-bar-constants',\n\t\t\t'debug-my-plugin',\n\t\t\t'debug-objects',\n\t\t\t'uploadplus',\n\t\t);\n\n\t\tswitch ( $option ):\n\t\tcase 'vip':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $vip_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'devel':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $dev_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'debug':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $debug_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'all':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $vip_plugin, $dev_plugin, $debug_plugin );\n\n\t\tcase 'theme':\n\t\tdefault:\n\t\t\t\t$plugin_list = $std_plugin;\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\t\t$skip_activation = array( 'piglatin', 'wordpress-beta-tester' );\n\t\t# do install\n\t\tforeach ( $plugin_list as $plugin ) :\n\t\t\t$res = WP_CLI::launch( 'wp plugin status '.$plugin, false );\n\t\t\t\n\t\t\tif ( isset( $res ) && $res === 1 ) {\n\t\t\t\t# install plugin (maybe skip piglatin)\n\t\t\t\t$cmdflag = ( in_array( $plugin, $skip_activation ) ) ? '' : ' --activate';\n\t\t\t\tWP_CLI::launch( 'wp plugin install ' . $plugin . $cmdflag );\n\t\t\t} else {\n\t\t\t\t# activate plugin (maybe skip piglatin)\n\t\t\t\tif ( false === in_array( $plugin, $skip_activation ) )\n\t\t\t\t\tWP_CLI::launch( 'wp plugin activate '.$plugin );\n\t\t\t}\n\t\tendforeach;\n\t}", "public function attachPluginOptions(&$args)\n {\n $request = $args['request'];\n\n if ($this->isAppropriatePage($request)) {\n $args['plugins']['MibewEmoji'] = array(\n 'imagesDir' => ($request->getBasePath() . '/'\n . str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath())\n . '/vendor/emojify.js/images/emoji'),\n 'ignoreEmoticons' => $this->config['ignore_emoticons'],\n );\n }\n }", "public function set_plugin_properties() {\n $this->plugin\t= get_plugin_data( SALESFORCE__PLUGIN_FILE );\n $this->basename = plugin_basename( SALESFORCE__PLUGIN_FILE );\n $this->active\t= is_plugin_active( $this->basename );\n }", "public function plugin_options() {\n\n if (!current_user_can('manage_options')) {\n wp_die( __('You do not have sufficient permissions to access this page.') );\n }\n\n echo $this->loadforum();\n }", "function debuggify_get_options($action = NULL){\n\n global $debuggify_settings_name;\n\n // Plugin Defaults\n $defaults = array(\n 'apikey' => '6487a4edf9e534c6164579dd327b01f4',\n 'enabled' => '0'\n );\n\n //Return default settings\n if($action == \"reset\"){\n delete_option($debuggify_settings_name);\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\n }\n\n //Get the settings from the database\n $database_settings = get_option($debuggify_settings_name);\n if($database_settings){\n $need_to_update = false;\n\n //Check whether all the settings are present or not\n foreach($defaults as $k => $v){\n\n if( !array_key_exists( $k, $database_settings)) {\n $database_settings[$k] = $v;\n $need_to_update = true;\n }\n }\n\n if($need_to_update) {\n update_option($debuggify_settings_name, $database_settings);\n }\n\n return $database_settings;\n }else{\n //Add the settings\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\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}", "function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n $options = array();\r\n \r\n $options['years'] = htmlspecialchars($_POST['years']);\r\n $options['mini'] = $_POST['mini'];\r\n $options['posts'] = $_POST['posts'];\r\n $options['pages'] = $_POST['pages'];\r\n \r\n update_option($this->db_option, $options);\r\n \r\n echo '<div class=\"updated fade\"><p>Plugin settings saved.</p></div>';\r\n }\r\n \r\n $layout = $options['layout'];\r\n $years = stripslashes($options['years']);\r\n $mini = $options['mini'] == 'on' ? 'checked' : '';\r\n $posts = $options['posts'] == 'on' ? 'checked' : '';\r\n $pages = $options['pages'] == 'on' ? 'checked' : '';\r\n \r\n // URL for form submit, equals our current page\r\n $action_url = $_SERVER['REQUEST_URI'];\r\n \r\n include('snazzy-archives-options.php');\r\n }", "function options() {\n require( TEMPLATE_PATH . \"/options.php\" );\n}", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "public function configureOptions();", "public function plugin_register_options() {\r\n\t\tregister_setting( $this->options_group, $this->options_name , array(&$this, 'plugin_validate_options' ));\r\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 add_options_packages() {\n $this->configure_propack();\n }", "function getOptions() ;", "function sh_custom_settings_options_callback(){\n echo 'Add your custom information';\n}", "function optionsframework_options() {\n\n\t// Multicheck Defaults\n\t$multicheck_defaults = array(\n\t\t'one' => '1',\n\t\t'five' => '1'\n\t);\n\n\t// Background Defaults\n\t$background_defaults = array(\n\t\t'color' => '',\n\t\t'image' => '',\n\t\t'repeat' => 'repeat',\n\t\t'position' => 'top center',\n\t\t'attachment'=>'scroll' );\n\n\t// Typography Defaults\n\t$typography_defaults = array(\n\t\t'face' => 'yahei',\n\t\t'style' => 'normal',\n\t\t'color' => '#383121' );\n\t\t\n\t$typography_content = array(\n\t\t'size' => '13px',\n\t\t'face' => 'yahei',\n\t\t'style' => 'normal',\n\t\t'color' => '#000000' );\n\t\t\n\t// Typography Options\n\t$typography_options = array(\n\t\t'sizes' => false\n\t);\n\n\t// Pull all the categories into an array\n\t$options_categories = array();\n\t$options_categories_obj = get_categories();\n\tforeach ($options_categories_obj as $category) {\n\t\t$options_categories[$category->cat_ID] = $category->cat_name;\n\t}\n\n\t// Pull all the pages into an array\n\t$options_pages = array();\n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t// $options_pages[''] = 'Select a page:';\n\tforeach ($options_pages_obj as $page) {\n\t\t$options_pages[$page->ID] = $page->post_title;\n\t}\n\n\n\t$adsdesc = '可添加广告联盟代码或自定义代码';\n\n\n\n\t$qrcode = get_stylesheet_directory_uri() . '/static/img/qrcode.png';\n\t$logo = get_stylesheet_directory_uri() . '/static/img/logo.png';\n\t$favicon = get_stylesheet_directory_uri() . '/static/img/favicon.ico';\n\t$footer_iconbg = get_stylesheet_directory_uri() . '/static/img/3.png';\n\t$home_slide = get_stylesheet_directory_uri() . '/static/img/slide.jpg';\n\n\t$options = array();\n\n\n\t\n\t$options[] = array(\n\t\t'name' => '基本',\n\t\t'type' => 'heading');\n\n\n\t$options[] = array(\n\t\t'name' => \"主题风格\",\n\t\t'desc' => \"13种颜色供选择,点击选择你喜欢的颜色,保存后前端展示会有所改变。\",\n\t\t'id' => \"theme_color\",\n\t\t'std' => \"#1d1d1d\",\n\t\t'type' => \"colorradio\",\n\t\t'options' => array(\n\t\t\t'#1d1d1d' => 1,\n\t\t\t'#2CDB87' => 2,\n\t\t\t'#00D6AC' => 3,\n\t\t\t'#FF6651' => 4,\n\t\t\t'#EA84FF' => 5,\n\t\t\t'#FDAC5F' => 6,\n\t\t\t'#FD77B2' => 7,\n\t\t\t'#76BDFF' => 8,\n\t\t\t'#C38CFF' => 9,\n\t\t\t'#FF926F' => 10,\n\t\t\t'#8AC78F' => 11,\n\t\t\t'#C7C183' => 12,\n\t\t\t'#1E88E5' => 13\n\t\t)\n\t);\n\n\t\n\n\t$options[] = array(\n\t\t'id' => 'theme_color_custom',\n\t\t'std' => \"\",\n\t\t'desc' => '不喜欢上面提供的颜色,你好可以在这里自定义设置,如果不用自定义颜色清空即可(默认不用自定义)',\n\t\t'type' => \"color\");\n\n\t$options[] = array(\n\t\t'name' => 'Favicon图标',\n\t\t'id' => 'favicon',\n\t\t'desc' => '',\n\t\t'std' => $favicon,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => 'Logo 电脑端',\n\t\t'id' => 'logo',\n\t\t'desc' => '建议尺寸:140*60px 格式:png',\n\t\t'std' => $logo,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => 'Logo 手机端',\n\t\t'id' => 'logo_src_m',\n\t\t'desc' => '最大高:30px;建议尺寸:180*60px 格式:png',\n\t\t'std' => $logo,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => '登录Logo',\n\t\t'id' => 'logo_login',\n\t\t'desc' => '建议尺寸:100*100px 格式:png',\n\t\t'std' => $logo,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => 'PC端导航栏登录注册',\n\t\t'id' => 'sign_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '底部侧边栏显示搜索按钮',\n\t\t'id' => 'nav_search',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '开启左下角QQ联系按钮',\n\t\t'id' => 'footer_qq',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '显示');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'footer_qqhao',\n\t\t'type' => \"text\",\n\t\t'std' => '200933220',\n\t\t'desc' => 'QQ号码');\n\n\n\t$options[] = array(\n\t\t'name' => '首页顶部',\n\t\t'type' => 'heading');\n\t\n\t$options[] = array(\n\t\t'name' => 'V1.5新增-首页顶部风格',\n\t\t'id' => 'home_header_style',\n\t\t'desc' => '',\n\t\t'options' => array(\n\t\t\t'style_0' => 'Banner+标题按钮',\n\t\t\t'style_1' => 'Banner+搜索框',\n\t\t\t'style_2' => '幻灯片布局'\n\t\t),\n\t\t'std' => 'style_0',\n\t\t'type' => \"radio\"\n\t);\n\n\t$options[] = array(\n\t\t'name' => '首页banner图片',\n\t\t'id' => 'banner_img',\n\t\t'type' => \"upload\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '首页banner标题',\n\t\t'id' => 'banner_title',\n\t\t'type' => \"text\",\n\t\t'std' => 'iDowns',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '首页banner描述',\n\t\t'id' => 'banner_desc',\n\t\t'type' => \"text\",\n\t\t'std' => '可能是最不专业的wordpress建站仿站、二次开发、主题插件折腾人!',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '首页banner按钮',\n\t\t'id' => 'banner_btn',\n\t\t'type' => \"text\",\n\t\t'std' => '查看详情',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '首页banner链接',\n\t\t'id' => 'banner_link',\n\t\t'type' => \"text\",\n\t\t'std' => 'http://ylit.cc/',\n\t\t'desc' => '');\n\n\t$options[] = array(\n 'name' => 'V1.5新增-幻灯片排序',\n 'id' => 'focusslide_sort',\n 'desc' => '默认:1 2 3(设置1 3 5 则按顺序只显示3个幻灯片,数字用空格隔开)',\n 'std' => '1 2 3',\n 'type' => 'text');\n \n for ($i=1; $i <= 3; $i++) { \n $options[] = array(\n 'name' => '图'.$i,\n 'id' => 'focusslide_title_'.$i,\n 'desc' => '标题(可不填)',\n 'std' => 'iDowns主题 - 精品WordPress Theme',\n 'type' => 'text');\n\n $options[] = array(\n 'id' => 'focusslide_href_'.$i,\n 'desc' => '链接',\n 'std' => '#',\n 'type' => 'text');\n\n $options[] = array(\n 'id' => 'focusslide_blank_'.$i,\n 'std' => true,\n 'desc' => '新窗口打开',\n 'type' => 'checkbox');\n \n $options[] = array(\n 'id' => 'focusslide_src_'.$i,\n 'desc' => '图片,建议尺寸:'.'1920*600',\n 'std' => $home_slide,\n 'type' => 'upload');\n\t}\n\n\n\n\t$options[] = array(\n\t\t'name' => '首页模块',\n\t\t'type' => 'heading');\n\n\n\t\n\n\t$options[] = array(\n\t\t'name' => '首页分类菜单',\n\t\t'id' => 'home_cat',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '显示(在WP后台菜单-新建一个菜单,把全部分类目录设置为分类导航菜单,既可实现ajax查看分类下文章)');\n\n\t$options[] = array(\n\t\t'name' => '首页关键字(keywords)',\n\t\t'id' => 'keywords',\n\t\t'std' => 'iDowns,虚拟资源分享下载主题,wordpress主题定制',\n\t\t'desc' => '关键字有利于SEO优化,建议个数在5-10之间,用英文逗号隔开',\n\t\t'settings' => array(\n\t\t\t'rows' => 4\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => '首页描述(description)',\n\t\t'id' => 'description',\n\t\t'std' => 'iDowns,虚拟资源分享下载主题,不专业提供wordpress主题定制开发服务',\n\t\t'desc' => '描述有利于SEO优化,建议字数在30-70之间',\n\t\t'settings' => array(\n\t\t\t'rows' => 4\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => 'V1.5新增-首页顶部推荐文章模块风格',\n\t\t'id' => 'home_box_style',\n\t\t'desc' => '',\n\t\t'options' => array(\n\t\t\t'style_0' => 'boxcms+卡片风格',\n\t\t\t'style_1' => 'boxcms+列表风格',\n\t\t\t'style_2' => '不启用'\n\t\t),\n\t\t'std' => 'style_0',\n\t\t'type' => \"radio\"\n\t);\n\n\n\tif ( $options_categories ) {\n $options[] = array(\n 'name' => __( '首页顶部推荐文章所属分类' ),\n 'desc' => __( '建议为此模块设一个分类为“首页推荐”。' ),\n 'std' => 1,\n 'id' => 'home_cms_categories',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_postnum',\n\t\t'std' => 3,\n\t\t'desc' => '默认:3,显示文章数',\n\t\t'type' => 'text');\n\n $options[] = array(\n\t\t'name' => 'V1.5新增-首页粒子特效条',\n\t\t'id' => 'home_particles',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '显示');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_particles_tite',\n\t\t'type' => \"text\",\n\t\t'std' => '优雅的主题大概总有人喜欢',\n\t\t'desc' => '大标题');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_particles_desc',\n\t\t'type' => \"text\",\n\t\t'std' => '你好,欢迎来到WordPress主题世界,推荐几款主题',\n\t\t'desc' => '副标题');\n\n\n\n\t$options[] = array(\n\t\t'name' => '开启首页会员价格表模块',\n\t\t'id' => 'home_pricing',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '显示');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_prictite',\n\t\t'type' => \"text\",\n\t\t'std' => '会员特权',\n\t\t'desc' => '员价格表标题');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_pricdesc',\n\t\t'type' => \"text\",\n\t\t'std' => '开通本站会员,VIP素材资源免费下载,节省你撩妹的时间!',\n\t\t'desc' => '副标题');\n\n\t$options[] = array(\n\t\t'name' => '价格1',\n\t\t'id' => 'home_pricing1',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<li>节省23%</li> <li>购买原创素材9折</li> <li>全球CDN极速访问</li> <li>无广告直接下</li>',\n\t\t'desc' => '---1---会员价格表内容');\n\n\t$options[] = array(\n\t\t'name' => '价格2',\n\t\t'id' => 'home_pricing2',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<li>节省32%</li> <li>购买原创素材9折</li> <li>全球CDN极速访问</li> <li>无广告直接下</li>',\n\t\t'desc' => '---2---会员价格表内容');\n\n\t$options[] = array(\n\t\t'name' => '价格3',\n\t\t'id' => 'home_pricing3',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<li>节省38%</li> <li>购买原创素材9折</li> <li>全球CDN极速访问</li> <li>无广告直接下</li>',\n\t\t'desc' => '---3---会员价格表内容');\n\n\t$options[] = array(\n\t\t'name' => '开启首页底部按钮模块',\n\t\t'id' => 'home_btn',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '显示');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_btntite',\n\t\t'type' => \"text\",\n\t\t'std' => '更多精彩资源分享',\n\t\t'desc' => '按钮模块主标题');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_btndesc',\n\t\t'type' => \"text\",\n\t\t'std' => '本站致力分享整合行业最新原创精品作资源!',\n\t\t'desc' => '副标题');\n\n\t$options[] = array(\n\t\t'name' => '友情链接',\n\t\t'id' => 'friendlink',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '按钮1',\n\t\t'id' => 'home_btntext1',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-browser\"></i>关于我们</a>',\n\t\t'desc' => '---1---按钮文字');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_btnlink1',\n\t\t'type' => \"text\",\n\t\t'std' => '#',\n\t\t'desc' => '---1---按钮链接');\n\n\t$options[] = array(\n\t\t'name' => '按钮2',\n\t\t'id' => 'home_btntext2',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-download\"></i>下载教程</a>',\n\t\t'desc' => '---2---按钮文字');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_btnlink2',\n\t\t'type' => \"text\",\n\t\t'std' => '#',\n\t\t'desc' => '---2---按钮链接');\n\n\t$options[] = array(\n\t\t'name' => '按钮3',\n\t\t'id' => 'home_btntext3',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-web\"></i>在线咨询</a>',\n\t\t'desc' => '---3---按钮文字');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_btnlink3',\n\t\t'type' => \"text\",\n\t\t'std' => '#',\n\t\t'desc' => '---3---按钮链接');\n\n\n\n\t$options[] = array(\n\t\t'name' => 'CMS+',\n\t\t'type' => 'heading');\n\n\n\n\t$options[] = array(\n\t\t'name' => '首页文章底部CMS_A-----------',\n\t\t'id' => 'home_cms_a',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\tif ( $options_categories ) {\n $options[] = array(\n 'name' => __( '模块1分类' ),\n 'desc' => __( '只显示有文章的分类选项(左右两大块布局)' ),\n 'std' => 1,\n 'id' => 'home_cms_cat_a_a',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_num_a_a',\n\t\t'std' => 5,\n\t\t'desc' => '默认:5,显示文章数',\n\t\t'type' => 'text');\n\n\n\n if ( $options_categories ) {\n $options[] = array(\n 'name' => __( '模块2分类' ),\n 'desc' => __( '只显示有文章的分类选项(左右两大块布局)' ),\n 'std' => 1,\n 'id' => 'home_cms_cat_a_b',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_num_a_b',\n\t\t'std' => 5,\n\t\t'desc' => '默认:5,显示文章数',\n\t\t'type' => 'text');\n\n\n\t// CMS_B\n\t$options[] = array(\n\t\t'name' => '首页文章底部CMS_B-----------',\n\t\t'id' => 'home_cms_b',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\tif ( $options_categories ) {\n $options[] = array(\n 'name' => __( '模块1分类' ),\n 'desc' => __( '只显示有文章的分类选项(三个小块布局)' ),\n 'std' => 1,\n 'id' => 'home_cms_cat_b_a',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_num_b_a',\n\t\t'std' => 5,\n\t\t'desc' => '默认:5,显示文章数',\n\t\t'type' => 'text');\n\n\n\n if ( $options_categories ) {\n $options[] = array(\n 'name' => __( '模块2分类' ),\n 'desc' => __( '只显示有文章的分类选项(左右两大块布局)' ),\n 'std' => 1,\n 'id' => 'home_cms_cat_b_b',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_num_b_b',\n\t\t'std' => 5,\n\t\t'desc' => '默认:5,显示文章数',\n\t\t'type' => 'text');\n\n\n if ( $options_categories ) {\n $options[] = array(\n 'name' => __( '模块3分类' ),\n 'desc' => __( '只显示有文章的分类选项(左右两大块布局)' ),\n 'std' => 1,\n 'id' => 'home_cms_cat_b_c',\n 'type' => 'select',\n 'options' => $options_categories\n );\n }\n\n $options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'home_cms_num_b_c',\n\t\t'std' => 5,\n\t\t'desc' => '默认:5,显示文章数',\n\t\t'type' => 'text');\n\n\n // END\n\n\n\n\n\n\n\t$options[] = array(\n\t\t'name' => '功能',\n\t\t'type' => 'heading');\n\n\n\t$options[] = array(\n\t\t'name' => '文章列表风格',\n\t\t'id' => 'home_postlist',\n\t\t'desc' => '',\n\t\t'options' => array(\n\t\t\t'style_0' => '网格布局',\n\t\t\t'style_1' => '列表布局'\n\t\t),\n\t\t'std' => 'style_0',\n\t\t'type' => \"select\"\n\t);\n\n\t$options[] = array(\n\t\t'name' => 'V1.7+ 开启顶部菜单浮动效果',\n\t\t'id' => 'is_header_sps',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'');\n\n\n\t$options[] = array(\n\t\t'name' => '开启登陆注册组件弹窗',\n\t\t'id' => 'isloginpop',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(关闭后跳转到独立登录页面)');\n\n\t$options[] = array(\n\t\t'name' => 'V1.7+ 搜索排除页面类型',\n\t\t'id' => 'isserach_page',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(只显示搜索到的文章)');\n\n\n\t$options[] = array(\n\t\t'name' => 'V1.7+ 开启文章侧边栏滑动',\n\t\t'id' => 'is_sidebar_top',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启(只在文章页面生效)');\n\n\n\t$options[] = array(\n\t\t'name' => '上传文件重命名',\n\t\t'id' => 'file_rename',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(该功能会针对上传的文件和图片重命名,如:09075549994.jpg)');\n\n\t$options[] = array(\n\t\t'name' => '自动将文章中上传的第一张图片缩略图设为特色图像',\n\t\t'id' => 'set_postthumbnail',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(如果没有添加文章缩略图,将自动获取文章中的第一张图片的缩略图设置为特色图像,开启后只在保存和发布文章时有效)');\n\n\t$options[] = array(\n\t\t'name' => '自动将文章中的第一张图片设为特色图像-支持外链',\n\t\t'id' => 'thumb_postfirstimg_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启'.'(如果文章没有缩略图,自动将文章中的第一张图片设为特色图像)');\n\n\n\t$options[] = array(\n\t\t'name' => 'Ajax文章列表自动加载',\n\t\t'id' => 'ajax_list_load',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启(关闭将使用翻页按钮)');\n\n\t$options[] = array(\n\t\t'name' => '图片延迟加载',\n\t\t'id' => 'lazyload',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启 (文章列表图片延迟加载,给网站提速)');\n\n\t$options[] = array(\n\t\t'name' => '熊掌号',\n\t\t'id' => 'xiongzhang',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启(资源自动推送给百度,申请地址https://xiongzhang.baidu.com/)');\n\n\t$options[] = array(\n\t\t'name' => '熊掌号appid',\n\t\t'desc' => 'appid如果填写错误,或者未审核通过,会造报错,导致某些js无法加载',\n\t\t'id' => 'xiongzhang_appid',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '注册验证码',\n\t\t'id' => 'captcha',\n\t\t'desc' => '',\n\t\t'options' => array(\n\t\t\t'image' => '图形验证码',\n\t\t\t'email' => '邮件验证码'\n\t\t),\n\t\t'std' => 'image',\n\t\t'type' => \"radio\");\n\n\t$options[] = array(\n\t\t'name' => '边栏固定序号',\n\t\t'id' => 'sidebar_fixed',\n\t\t'type' => \"text\",\n\t\t'std' => '1,2',\n\t\t'desc' => '输入边栏小工具的序号,多个用半角英文逗号隔开,例如:1,2');\n\n\n\t$options[] = array(\n\t\t'name' => '充值固定金额',\n\t\t'id' => 'recharge_price_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '固定金额',\n\t\t'id' => 'recharge_price',\n\t\t'type' => \"text\",\n\t\t'std' => '1,5,10,50,100',\n\t\t'desc' => '输入价格,多个用半角英文逗号隔开,例如:1,5,10,50,100');\n\t\n\t$options[] = array(\n\t\t'name' => '全站右下-通知弹窗',\n\t\t'id' => 'all_page_tips',\n\t\t'std' => 'iDowns,虚拟资源分享下载主题,不专业提供wordpress主题定制开发服务,现已更新至V1.8版本!',\n\t\t'desc' => '推介纯文本内容即可!',\n\t\t'settings' => array(\n\t\t\t'rows' => 4\n\t\t),\n\t\t'type' => 'textarea');\n\n\t\n\t$options[] = array(\n\t\t'name' => '文章',\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '列表页banner图片',\n\t\t'id' => 'banner_archive_img',\n\t\t'type' => \"upload\",\n\t\t'std' => '',\n\t\t'desc' => '已做灰度处理,请上传一张高180px的图片,repeat-x模式');\n\n\t$options[] = array(\n\t\t'name' => '视频文章解析接口',\n\t\t'desc' => '默认用https://cdn.yangju.vip/k/?url=,可以自行切换,主题https和http站点对应',\n\t\t'id' => 'video_url_auto',\n\t\t'std' => 'https://cdn.yangju.vip/k/?url=',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => '分类页筛选',\n\t\t'id' => 'filter',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启(分类页标签/排序筛选)');\n\n\t$options[] = array(\n\t\t'name' => '筛选标签IDs',\n\t\t'desc' => '输入标签ID列表,多个用英文半角逗号隔开',\n\t\t'id' => 'filter_tags',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '文章阅读数',\n\t\t'id' => 'post_views',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\t$options[] = array(\n\t\t'name' => 'V1.7+ 开启商城文章新样式',\n\t\t'id' => 'is_shop_posts_box',\n\t\t'desc' => '开启',\n\t\t'std' => false,\n\t\t'type' => \"checkbox\");\n\n\n\t$options[] = array(\n\t\t'name' => '下载框位置',\n\t\t'id' => 'down_position',\n\t\t'desc' => '',\n\t\t'options' => array(\n\t\t\t'side' => '边栏',\n\t\t\t'top' => '内容上',\n\t\t\t'bottom' => '内容下',\n\t\t\t'sidetop' => '边栏与内容上',\n\t\t\t'sidebottom' => '边栏与内容下'\n\t\t),\n\t\t'std' => 'side',\n\t\t'type' => \"radio\");\n\n\t$options[] = array(\n\t\t'name' => '资源下载数',\n\t\t'id' => 'post_downloads',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\n\t$options[] = array(\n\t\t'name' => '文章标签',\n\t\t'id' => 'post_tags',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\n\t$options[] = array(\n\t\t'name' => '分享',\n\t\t'id' => 'post_share',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\n\t$options[] = array(\n\t\t'name' => '上一篇和下一篇文章',\n\t\t'id' => 'post_nav',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\n\t$options[] = array(\n\t\t'name' => '相关文章',\n\t\t'id' => 'post_related',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '价格显示',\n\t\t'id' => 'post_price',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '隐藏(列表页item的价格)');\n\n\t$options[] = array(\n\t\t'name' => '评论显示已购买',\n\t\t'id' => 'post_comment_bought',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\n\t$options[] = array(\n\t\t'name' => '底部',\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '开启底部四个图标文字块',\n\t\t'id' => 'footer_iconbox',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => '模块背景图片',\n\t\t'id' => 'footer_iconbg',\n\t\t'desc' => '建议尺寸:1600*400px 格式:jpeg或png',\n\t\t'std' => $footer_iconbg,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => '底部块-1',\n\t\t'id' => 'footer_icon1',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-message\"></i>',\n\t\t'desc' => '图标代码');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'footer_text1',\n\t\t'type' => \"textarea\",\n\t\t'std' => 'QQ:200933220 </br> 不定期在线',\n\t\t'desc' => '文字');\n\n\t$options[] = array(\n\t\t'name' => '底部块-2',\n\t\t'id' => 'footer_icon2',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-cloud\"></i>',\n\t\t'desc' => '图标代码');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'footer_text2',\n\t\t'type' => \"textarea\",\n\t\t'std' => 'iDowns Theme <br> 每周更新优化',\n\t\t'desc' => '文字');\n\n\t$options[] = array(\n\t\t'name' => '底部块-3',\n\t\t'id' => 'footer_icon3',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-mail\"></i>',\n\t\t'desc' => '图标代码');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'footer_text3',\n\t\t'type' => \"textarea\",\n\t\t'std' => '[email protected] <br> 7x24小时及时回复',\n\t\t'desc' => '文字');\n\n\t$options[] = array(\n\t\t'name' => '底部块-4',\n\t\t'id' => 'footer_icon4',\n\t\t'type' => \"textarea\",\n\t\t'std' => '<i class=\"dripicons dripicons-user-id\"></i>',\n\t\t'desc' => '会员制度');\n\n\t$options[] = array(\n\t\t'name' => '',\n\t\t'id' => 'footer_text4',\n\t\t'type' => \"textarea\",\n\t\t'std' => 'USER VIP <br> 会员专属下载',\n\t\t'desc' => '文字');\n\n\n\t$options[] = array(\n\t\t'name' => '底部版权',\n\t\t'desc' => '可加html标签',\n\t\t'id' => 'copyright',\n\t\t'std' => 'Copyright © <a href=\"https://ylit.cc\"> iDowns. </a> All Rights Reserved.',\n\t\t'type' => 'textarea');\n\t\n\t$options[] = array(\n\t\t'name' => '自定义CSS样式',\n\t\t'desc' => '位于&lt;/head&gt;之前,直接写样式代码,不用添加&lt;style&gt;标签',\n\t\t'id' => 'css',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\n\t$options[] = array(\n\t\t'name' => '自定义底部代码',\n\t\t'desc' => '位于&lt;/body&gt;之前,若是js代码需添加&lt;script&gt;标签',\n\t\t'id' => 'js',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => '网站统计代码',\n\t\t'desc' => '位于底部,会被隐藏,但不影响统计效果',\n\t\t'id' => 'analysis',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\n\n\t$options[] = array(\n\t\t'name' => '社交登录',\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '登陆框文字',\n\t\t'id' => 'oauth_no_txt',\n\t\t'type' => \"text\",\n\t\t'std' => '卧槽~你还有脸回来',\n\t\t'desc' => '当不开启任何三方登陆时候,将显示文本信息');\n\n\t$options[] = array(\n\t\t'name' => 'QQ登录',\n\t\t'id' => 'oauth_qq',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => 'qq id',\n\t\t'id' => 'oauth_qqid',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => 'qq key',\n\t\t'id' => 'oauth_qqkey',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '微博登录',\n\t\t'id' => 'oauth_weibo',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => 'weibo id',\n\t\t'id' => 'oauth_weiboid',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => 'weibo key',\n\t\t'id' => 'oauth_weibokey',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => '微信登录',\n\t\t'id' => 'oauth_weixin',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => '开启');\n\n\t$options[] = array(\n\t\t'name' => 'weixin id',\n\t\t'id' => 'oauth_weixinid',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => 'weixin srcret',\n\t\t'id' => 'oauth_weixinkey',\n\t\t'type' => \"text\",\n\t\t'std' => '',\n\t\t'desc' => '');\n\n\t$options[] = array(\n\t\t'name' => 'SMTP邮件配置',\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'name' => 'SMTP服务',\n\t\t'desc' => '是否启用SMTP服务',\n\t\t'id' => 'mail_smtps',\n\t\t'std' => '0',\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'name' => '发信人',\n\t\t'desc' => '请填写发件人姓名',\n\t\t'id' => 'mail_name',\n\t\t'std' => 'YouName',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => '邮件服务器',\n\t\t'desc' => '请填写SMTP服务器地址',\n\t\t'id' => 'mail_host',\n\t\t'std' => 'smtp.qq.com',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => '服务器端口',\n\t\t'desc' => '请填写SMTP服务器端口',\n\t\t'id' => 'mail_port',\n\t\t'std' => '465',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => '邮箱帐号',\n\t\t'desc' => '请填写邮箱账号',\n\t\t'id' => 'mail_username',\n\t\t'std' => '[email protected]',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => '邮箱密码',\n\t\t'desc' => '请填写邮箱密码',\n\t\t'id' => 'mail_passwd',\n\t\t'std' => '123456789',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => '启用SMTPAuth服务',\n\t\t'desc' => '是否启用SMTPAuth服务',\n\t\t'id' => 'mail_smtpauth',\n\t\t'std' => '1',\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'name' => 'SMTPSecure设置',\n\t\t'desc' => '若启用SMTPAuth服务则填写ssl,若不启用则留空',\n\t\t'id' => 'mail_smtpsecure',\n\t\t'std' => 'ssl',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => '广告位',\n\t\t'type' => 'heading' );\n\n\t$ads = array(\n\t\t//'ad_list_insert' => '列表插播(第三个位置)',\n\t\t'ad_banner_footer' => '首页banner下',\n\t\t'ad_home_footer' => '首页下',\n\t\t'ad_list_header' => '列表上',\n\t\t'ad_list_footer' => '列表下',\n\t\t'ad_post_header' => '文章内容上',\n\t\t'ad_post_footer' => '文章内容下',\n\t\t'ad_post_comment' => '文章评论下',\n\t\t'ad_erphpdown' => '下载页面',\n\t);\n\n\tforeach ($ads as $key => $adtit) {\n\t\t$options[] = array(\n\t\t\t'name' => $adtit,\n\t\t\t'id' => $key.'_s',\n\t\t\t'std' => false,\n\t\t\t'desc' => '开启',\n\t\t\t'type' => 'checkbox');\n\t\t$options[] = array(\n\t\t\t'desc' => $adsdesc,\n\t\t\t'id' => $key,\n\t\t\t'std' => '',\n\t\t\t'settings'=>array('rows'=>6),\n\t\t\t'type' => 'textarea');\n\t}\n\n\n\t$options[] = array(\n\t\t'name' => 'V1.8+ 辅助优化',\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'name' => '开启网站内容css渐入动效',\n\t\t'id' => 'is_css_animation',\n\t\t'type' => \"checkbox\",\n\t\t'std' => flase,\n\t\t'desc' => '开启'.'(开启后细腻的一逼,兼容各种浏览器)');\n\n\t$options[] = array(\n\t\t'name' => 'loading动画加载',\n\t\t'id' => 'isloading',\n\t\t'type' => \"checkbox\",\n\t\t'std' => flase,\n\t\t'desc' => '开启'.'(开启全站打开页面时loading动画加载,IE低版本会出现不熄火的现象!)');\n\n\t$options[] = array(\n\t\t'name' => '启用网站源码压缩',\n\t\t'id' => 'iswebgizp',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(可增网页加打开速度)');\n\n\t$options[] = array(\n\t\t'name' => '移除 WP_Head 无关紧要的代码',\n\t\t'desc' => '开启',\n\t\t'id' => 'remove_head_links',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '禁用日志修订功能',\n\t\t'desc' => '开启',\n\t\t'id' => 'diable_revision',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '移除 admin bar 顶部黑边',\n\t\t'desc' => '开启',\n\t\t'id' => 'remove_admin_bar',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '禁用 XML-RPC 接口',\n\t\t'desc' => '开启',\n\t\t'id' => 'disable_xml_rpc',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '彻底关闭 pingback',\n\t\t'desc' => '开启',\n\t\t'id' => 'disable_trackbacks',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '网站前台不加载语言包',\n\t\t'desc' => '开启',\n\t\t'id' => 'locale',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '屏蔽 Emoji',\n\t\t'desc' => '开启',\n\t\t'id' => 'disable_emoji',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '屏蔽 REST API',\n\t\t'desc' => '开启',\n\t\t'id' => 'disable_rest_api',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\t\n\t$options[] = array(\n\t\t'name' => '百度主动推送',\n\t\t'desc' => '开启 <a href=\"http://zhanzhang.baidu.com/linksubmit/index\" target=\"_blank\">查看主动推送效果</a>',\n\t\t'id' => 'baidu_sitemap_api',\n\t\t'std' => false,\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '百度主动推送api接口',\n\t\t'desc' => '在百度站长平台获取主动推送接口地址,比如:http://data.zz.baidu.com/urls?site=域名&token=一组字符, <a class=\"button-primary\" rel=\"nofollow\" href=\"http://zhanzhang.baidu.com/linksubmit/index\" target=\"_blank\">主动推送接口地址</a>',\n\t\t'id' => 'baidu_sitemap_api_url',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '关于CDN加速',\n\t\t'desc' => '现在CDN、产品和选择越来越多,仅仅弄一个设置选项,无法满足,所以有需求的,建议安装相应的插件,插件是个好东西,不要觉得插件多会影响啥,草他妈的收费CDN。',\n\t\t'id' => 'caotamadeCDN',\n\t\t'std' => true,\n\t\t'type' => 'checkbox');\n\n\n\treturn $options;\n}", "function options_panel() {\r\n // Include options panel\r\n include($this->pluginPath . \"/includes/settings.php\");\r\n }", "function optionsframework_options() {\n\n\t$options = array();\n\n\t$options[] = array(\n\t\t'name' => __( 'Basic Settings', 'twentyseventyseven-child-2' ),\n\t\t'type' => 'heading'\n\t);\n\n\t$options[] = array(\n\t\t'name' => __( 'Upload Logo', 'twentyseventyseven-child-2' ),\n\t\t'desc' => __( 'This creates a full size uploader that previews the image.', 'twentyseventyseven-child-2' ),\n\t\t'id' => 'upload-logo',\n\t\t'type' => 'upload'\n\t);\n\n\t$options[] = array(\n\t\t'name' => __( 'Limit Post to show on Front Page', 'twentyseventyseven-child-2' ),\n\t\t'desc' => __( 'Limit Post', 'twentyseventyseven-child-2' ),\n\t\t'id' => 'limit-post-frontpage',\n\t\t'std' => '1',\n\t\t'type' => 'checkbox'\n\t);\n\n\t$options[] = array(\n\t\t'name' => __( 'Posts to limit', 'twentyseventyseven-child-2' ),\n\t\t'desc' => __( 'Posts.', 'twentyseventyseven-child-2' ),\n\t\t'id' => 'limit-post-frontpage-value',\n\t\t'std' => '0',\n\t\t'class' => 'mini',\n\t\t'type' => 'text'\n\t);\n\n\t$options[] = array(\n\t\t'name' => __( 'Show Sidebar on Front Page', 'twentyseventyseven-child-2' ),\n\t\t'desc' => __( 'Show Sidebar', 'twentyseventyseven-child-2' ),\n\t\t'id' => 'show-sidebar-frontpage',\n\t\t'std' => '1',\n\t\t'type' => 'checkbox'\n\t);\n\n\treturn $options;\n}", "protected function doPrePluginOptionsSave() {\n\t\t$oDp = $this->loadDP();\n\n\t\tif ( $this->getOpt( 'activated_at', 0 ) <= 0 ) {\n\t\t\t$this->setOpt( 'activated_at', $oDp->time() );\n\t\t}\n\t\tif ( $this->getOpt( 'installation_time', 0 ) <= 0 ) {\n\t\t\t$this->setOpt( 'installation_time', $oDp->time() );\n\t\t}\n\n\t\t$this->setOpt( 'installed_version', $this->getController()->getVersion() );\n\t}", "function install_plugin_information()\n {\n }", "protected function __construct() {\n\t\t\t// Full path to main file\n\t\t\t$this->plugin_file= __FILE__;\n\t\t\t$this->plugin_dir = dirname( $this->plugin_file );\n\t\t\t$this->options = $this->get_saved_options();\n\t\t}", "function optionsframework_options() {\n\n\t// Typograpgy CSS list\n\t$typography = options_stylesheets_get_file_list(\n\t\tget_stylesheet_directory() . '/css/typography/', // $directory_path\n\t\t'css', // $filetype\n\t\tget_stylesheet_directory_uri() . '/css/typography/' // $directory_uri\n\t);\n\n\n\t// Layout CSS list\n\t$layout = options_stylesheets_get_file_list(\n\t\tget_stylesheet_directory() . '/css/layout/', // $directory_path\n\t\t'css', // $filetype\n\t\tget_stylesheet_directory_uri() . '/css/layout/' // $directory_uri\n\t);\n\t\n\t// Colors CSS list\n\t$colors = options_stylesheets_get_file_list(\n\t\tget_stylesheet_directory() . '/css/colors/', // $directory_path\n\t\t'css', // $filetype\n\t\tget_stylesheet_directory_uri() . '/css/colors/' // $directory_uri\n\t);\n\n\n\n\n\t$options = array();\n\t\t\n\n// Typography\n// typography in the Theme options\n\t\n \t$options['typography'] = array( \n\t\t\"name\" => \"Typography\",\n \t\t\"id\" => \"typography\",\n \t\t\"type\" => \"radio\",\n \t\t\"options\" => $typography );\n\n\n// Colors\n// Colors in the Theme options\n\t\n \t$options['colors'] = array( \n\t\t\"name\" => \"Colors\",\n \t\t\"id\" => \"colors\",\n \t\t\"type\" => \"radio\",\n \t\t\"options\" => $colors );\n \n\t// Color Picker\n\t\t\n $options['example_colorpicker'] = array(\n \t\"name\" => \"Colorpicker\",\n \t\"id\" => \"example_colorpicker\",\n \t\"std\" => \"#666666\",\n \t\"type\" => \"color\" );\n\n\n\n// Layout\n// Layout in the Theme options\n\t\n \t$options['layout'] = array( \n\t\t\"name\" => \"Layout CSS variants\",\n \t\t\"id\" => \"layout\",\n \t\t\"type\" => \"radio\",\n \t\t\"options\" => $layout );\n \n\n\n// site Width setting \n\t\t\n \t$options['site_width'] = array(\n \t \t\"name\" => \"Site Width\",\n \t \"id\" => \"site_width\",\n \t \"std\" => \"Default Value\",\n \t \"type\" => \"text\" );\n\n// Logo uploader\n\n\t$options['logo'] = array(\n\t\t\"name\" => \"Logo image\",\n\t\t\"desc\" => \"This creates a full size uploader that previews the image.\",\n\t\t\"id\" => \"logo\",\n\t\t\"type\" => \"upload\" );\n\t\t\n\n\treturn $options;\n}", "public function initializePlugin();", "function inkpro_create_options() {\r\n\treturn array();\r\n}", "public function additional_plugin_setup() {\n\n\t\t$page_main = $this->_admin_pages[ 'vfb-pro' ];\n\n\t\t// If first time editing, disable advanced items by default.\n\t\tif( false === get_user_option( 'manage' . $page_main . 'columnshidden' ) ) {\n\t\t\t$user = wp_get_current_user();\n\t\t\tupdate_user_option( $user->ID, 'manage' . $page_main . 'columnshidden', array( 0 => 'merge-tag' ), true );\n\t\t}\n\n\t\tif ( !get_option( 'vfb_dashboard_widget_options' ) ) {\n\t\t\t$widget_options['vfb_dashboard_recent_entries'] = array(\n\t\t\t\t'items' => 5,\n\t\t\t);\n\t\t\tupdate_option( 'vfb_dashboard_widget_options', $widget_options );\n\t\t}\n\n\t}", "private function skyword_defaults() {\n\t\t$tmp = get_option('skyword_plugin_options');\n\t if(!is_array($tmp)) {\n\t\t\t$arr = array(\n\t\t\t\"skyword_api_key\"=>null, \n\t\t\t\"skyword_enable_ogtags\" => true, \n\t\t\t\"skyword_enable_metatags\" => true, \n\t\t\t\"skyword_enable_googlenewstag\" => true,\n\t\t\t\"skyword_enable_pagetitle\" => true,\n\t\t\t\"skyword_enable_sitemaps\" => true,\n\t\t\t\"skyword_generate_all_sitemaps\" => true,\n\t\t\t\"skyword_generate_news_sitemaps\" => true,\n\t\t\t\"skyword_generate_pages_sitemaps\" => true,\n\t\t\t\"skyword_generate_categories_sitemaps\" => true,\n\t\t\t\"skyword_generate_tags_sitemaps\" => true\n\t\t\t);\n\t\t\tupdate_option('skyword_plugin_options', $arr);\n\t\t}\n\t}", "function options() {\n\t\tif ( ! current_user_can( 'manage_options' ) )\t{\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t\t}\n\t\tinclude WP_PLUGIN_DIR . '/qoorate/admin_options_page.php';\n\t}", "public static function getAvailableOptions() {\n $output = array();\n\n // Settings for activated plugins\n $activatedPlugins = Helper::getActivatedPlugins();\n foreach ($activatedPlugins as $plugin) {\n $output[] = WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'];\n $output[] = WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'] . '_form_text';\n $output[] = WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'] . '_error_message';\n switch ($plugin['id']) {\n case 'gravity-forms' :\n case 'contact-form-7' :\n $output[] = WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'] . '_forms';\n break;\n }\n switch ($plugin['id']) {\n case 'gravity-forms' :\n case 'woocommerce' :\n case 'wordpress' :\n $output[] = WP_GDPR_C_PREFIX . '_integrations_' . $plugin['id'] . '_required_message';\n break;\n }\n }\n\n // Settings for the checklist\n foreach (Helper::getCheckList() as $id => $check) {\n $output[] = WP_GDPR_C_PREFIX . '_general_' . $id;\n }\n\n // Settings for the general things\n $output[] = WP_GDPR_C_PREFIX . '_settings_privacy_policy_page';\n $output[] = WP_GDPR_C_PREFIX . '_settings_privacy_policy_text';\n $output[] = WP_GDPR_C_PREFIX . '_settings_enable_access_request';\n if (Helper::isEnabled('enable_access_request', 'settings')) {\n $output[] = WP_GDPR_C_PREFIX . '_settings_access_request_page';\n $output[] = WP_GDPR_C_PREFIX . '_settings_access_request_form_checkbox_text';\n $output[] = WP_GDPR_C_PREFIX . '_settings_delete_request_form_explanation_text';\n }\n $output[] = WP_GDPR_C_PREFIX . '_settings_consents_modal_title';\n $output[] = WP_GDPR_C_PREFIX . '_settings_consents_modal_explanation_text';\n $output[] = WP_GDPR_C_PREFIX . '_settings_consents_bar_explanation_text';\n\n return $output;\n }", "static function get_options(){\n\t\t\t\tglobal $gdlr_core_item_pdb;\n\t\t\t\t\n\t\t\t\treturn array(\n\t\t\t\t\t'general' => array(\n\t\t\t\t\t\t'title' => esc_html__('General', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'image' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Image', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'upload',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'thumbnail-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Thumbnail Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'combobox',\n\t\t\t\t\t\t\t\t'options' => 'thumbnail-size',\n\t\t\t\t\t\t\t\t'default' => 'full'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Title', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'default' => esc_html__('Promo Box Item Title', 'goodlayers-core'),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'tinymce',\n\t\t\t\t\t\t\t\t'default' => esc_html__('Promo box item sample content', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'wrapper-class' => 'gdlr-core-fullsize'\n\t\t\t\t\t\t\t),\t\n\t\t\t\t\t\t\t'text-align' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Text Align', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'radioimage',\n\t\t\t\t\t\t\t\t'options' => 'text-align',\n\t\t\t\t\t\t\t\t'default' => 'center'\n\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\t'frame' => array(\n\t\t\t\t\t\t'title' => esc_html__('Frame Style', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'enable-frame' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Enable Frame', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t\t'default' => 'enable'\n\t\t\t\t\t\t\t), \n\t\t\t\t\t\t\t'enable-shadow' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Enable Shadow', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t\t'default' => 'enable',\n\t\t\t\t\t\t\t\t'condition' => array( 'enable-frame' => 'enable' )\n\t\t\t\t\t\t\t), \n\t\t\t\t\t\t\t'frame-padding' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Frame Padding', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t'item-type' => 'padding',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel',\n\t\t\t\t\t\t\t\t'default' => array( 'top'=>'30px', 'right'=>'30px', 'bottom'=>'10px', 'left'=>'30px', 'settings'=>'unlink' ),\n\t\t\t\t\t\t\t\t'condition' => array( 'enable-frame' => 'enable' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'frame-background-color' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Frame Background Color', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t\t\t\t'condition' => array( 'enable-frame' => 'enable' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'frame-border-width' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Frame Border Width', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t'item-type' => 'padding',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel',\n\t\t\t\t\t\t\t\t'default' => array( 'top'=>'0px', 'right'=>'1px', 'bottom'=>'1px', 'left'=>'1px', 'settings'=>'unlink' ),\n\t\t\t\t\t\t\t\t'condition' => array( 'enable-frame' => 'enable' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'frame-border-color' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Frame Border Color', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t\t\t\t'condition' => array( 'enable-frame' => 'enable' )\n\t\t\t\t\t\t\t), \n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'typography' => array(\n\t\t\t\t\t\t'title' => esc_html__('Typography', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'title-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Title Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'fontslider',\n\t\t\t\t\t\t\t\t'default' => '14px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'fontslider',\n\t\t\t\t\t\t\t\t'default' => '14px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t'title' => esc_html__('Color', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'title-color' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Title Color', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'colorpicker'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-color' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Color', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'colorpicker'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'spacing' => array(\n\t\t\t\t\t\t'title' => esc_html__('Spacing', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'padding-bottom' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Padding Bottom ( Item )', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel',\n\t\t\t\t\t\t\t\t'default' => $gdlr_core_item_pdb\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}", "public function options_update() {\n\t\tregister_setting( $this->plugin_name, $this->plugin_name, array($this, 'validate', 'default' => array( \"url_nerd_instance\" => \"\", \"category_weight\" => \"0.04\", \"entity_weight\" => \"0.7\" ) ) );\n\t}", "function optionsframework_options() {\n\t\t$options_pages = array(); \n\t\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t\t$options_pages[''] = 'Select a page:';\n\t\tforeach ($options_pages_obj as $page):\n\t\t\t$options_pages[$page->ID] = $page->post_title;\n\t\tendforeach;\n\t\n\t\t// If using image radio buttons, define a directory path\n\t\t$imagepath = get_template_directory_uri() . '/lib/assets/images/icons/';\n\t\n\t\t$options = array();\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('General Settings', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Favicon', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('To upload your favicon to the site, simply add the URL to it or upload and select it using the Upload button here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_custom_favicon',\n\t\t\t'type' \t\t=> 'upload');\n\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('RSS Link', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Add in the URL of your RSS feed here to overwrite the defaut WordPress ones.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_rss',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Custom CSS', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Not 100% happy with our lovely styles? Here you can add some custom CSS if you require minor changes to the ones we\\'ve created. We won\\'t be offended, honest :)', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_custom_css',\n\t\t\t'type' \t\t=> 'textarea');\t\n\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Google Analytics (or custom Javascript)', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If you\\'re hooked up with Google Analytics you can paste the Javascript includes for it here (without the script tags). Or alternatively if you just want some custom Javascript added on top of ours, add that here too.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_custom_js',\n\t\t\t'type' \t\t=> 'textarea');\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Show Breadcrumb Trail?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will show the breadcrumb trail on all pages in the header.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_show_breadcrumbs',\n\t\t\t'std' \t\t=> '1',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Application Form ID', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_application_form_id',\n\t\t\t'desc'\t\t=> 'If you have added an applcation form for the jobs section of your site using the Contact Form & plugin, you can add the ID of the form here for it to be pulled out automatically.',\n\t\t\t'std' \t\t=> '',\n\t\t\t'type' \t\t=> 'text');\t\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Header', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Custom Logo', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('To upload a custom logo, simply add the URL to it or upload and select it using the Upload button here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_custom_logo',\n\t\t\t'type' \t\t=> 'upload');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Header Text', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_header_text',\n\t\t\t'des'\t\t=> 'You can add some text to the header if you like. Keep it short and sweet mind; nobody likes a waffler :)',\n\t\t\t'std' \t\t=> '',\n\t\t\t'type' \t\t=> 'text');\t\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Contact Telephone', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your contact telephone number here to go in the header.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_header_phone',\n\t\t\t'type' \t\t=> 'text');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __('Footer', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __('Copyright Text', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter the text for your copyright here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_footer_copyright',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Hide FrogsThemes Link?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will hide our link :\\'( <--sad face', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_hide_ft_link',\n\t\t\t'std' \t\t=> '0',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Blog', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Style', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Select if you prefer the blog to be as a list or in masonry.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_blog_style',\n\t\t\t'options' \t=> array('list' => __('List', 'frogsthemes'), 'masonry' => __('Masonry', 'frogsthemes')),\n\t\t\t'std'\t\t=> 'list',\n\t\t\t'type' \t\t=> 'select');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Show Share Links?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will show the share links on all posts.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_show_share_links',\n\t\t\t'std' \t\t=> '1',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Show Author Box?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will show the author box on all posts.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_show_author',\n\t\t\t'std' \t\t=> '1',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Show Next/Previous Links?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will show the next/previous post links on all posts.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_show_next_prev',\n\t\t\t'std' \t\t=> '1',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Show Related Posts?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will show the related posts section. These are related by tag.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_show_related_posts',\n\t\t\t'std' \t\t=> '1',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Slider', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Speed of Transition', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter the speed you would like the transition to be in milliseconds (1000 = 1 second).', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_slider_speed',\n\t\t\t'std'\t\t=> '600',\n\t\t\t'type' \t\t=> 'text');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Pause Time', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter the time you would like the gallery to pause between transitions in milliseconds (1000 = 1 second).', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_slider_pause',\n\t\t\t'std'\t\t=> '7000',\n\t\t\t'type' \t\t=> 'text');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Auto Start?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will automatically start the gallery.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_slider_auto_start',\n\t\t\t'std' \t\t=> '0',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Auto Loop?', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('If checked, this will automatically loop through the gallery.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_slider_loop',\n\t\t\t'std' \t\t=> '0',\n\t\t\t'type' \t\t=> 'checkbox');\n\t\t/*\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Animation Type', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Select which effect you would like to use when going between slides.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_slider_transition',\n\t\t\t'options' \t=> array('fade' => __('Fade', 'frogsthemes'), 'slide' => __('Slide', 'frogsthemes')),\n\t\t\t'std'\t\t=> 'fade',\n\t\t\t'type' \t\t=> 'select');\n\t\t*/\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Connections', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Facebook URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full Facebook URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_facebook',\n\t\t\t'type' \t\t=> 'text');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Twitter URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full Twitter URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_twitter',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Google+ URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full Google+ URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_google_plus',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'LinkedIn URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full LinkedIn URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_linkedin',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'Pinterest URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full Pinterest URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_pinterest',\n\t\t\t'type' \t\t=> 'text');\n\t\t\n\t\t$options[] = array( \n\t\t\t'name' \t\t=> __( 'YouTube URL', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('Enter your full YouTube URL here.', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'ft_youtube',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Twitter API Options', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'heading');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Twitter API', 'frogsthemes'),\n\t\t\t'desc' \t\t=> __('To use the Twitter API, you need to sign up for an <a href=\"https://dev.twitter.com/apps\" target=\"_blank\">app with Twitter</a>.', 'frogsthemes'),\n\t\t\t'type' \t\t=> 'info');\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Consumer Key', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'consumer_key',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Consumer Secret', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'consumer_secret',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Access Token', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'access_token',\n\t\t\t'type' \t\t=> 'text');\n\t\t\t\t\t\t\t\n\t\t$options[] = array(\n\t\t\t'name' \t\t=> __( 'Access Token Secret', 'frogsthemes'),\n\t\t\t'id' \t\t=> 'access_token_secret',\n\t\t\t'type' \t\t=> 'text');\n\t\n\t\treturn apply_filters('optionsframework_options', $options);\n\t}", "public function configureTgmPluginActivationLibrary()\n {\n $data = $this->getData();\n\n if ( !isset($data['plugins']) || empty($data['plugins']))\n {\n return;\n }\n\n // The default TGMPA settings\n $defaults = array(\n 'default_path' => Paths::theme('vendor/bundled'),\n 'menu' => dirname(Paths::theme()) . '-install-plugins',\n 'has_notices' => true,\n 'dismissable' => true,\n 'dismiss_msg' => '',\n 'is_automatic' => true,\n 'message' => '',\n 'strings' => array(\n 'page_title' => __( 'Install Required Plugins', 'baobab' ),\n 'menu_title' => __( 'Install Plugins', 'baobab' ),\n 'installing' => __( 'Installing Plugin: %s', 'baobab' ), // %s = plugin name.\n 'oops' => __( 'Something went wrong with the plugin API.', 'baobab' ),\n 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s).\n 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).\n 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).\n 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).\n 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).\n 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).\n 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s).\n 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).\n 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),\n 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),\n 'return' => __( 'Return to Required Plugins Installer', 'baobab' ),\n 'plugin_activated' => __( 'Plugin activated successfully.', 'baobab' ),\n 'complete' => __( 'All plugins installed and activated successfully. %s', 'baobab' ), // %s = dashboard link.\n 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.\n )\n );\n\n // Merge user configuration with defaults\n $config = isset($data['options']) ? array_merge_recursive($defaults, $data['options']) : $defaults;\n\n tgmpa($data['plugins'], $config);\n }", "function load_settings() {\r\n $options = get_option($this->optionsName);\r\n\r\n if ($old_setting = get_option('custom_page_extension')) {\r\n delete_option('custom_page_extension');\r\n }\r\n\r\n $defaults = array(\r\n 'extension' => ($old_setting != \"\") ? $old_setting : 'html',\r\n );\r\n\r\n $this->options = (object) wp_parse_args($options, $defaults);\r\n }", "protected function get_registered_options()\n {\n }", "public function testPluginOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->plugin('DebugKit', ['path' => '/debugger'], function (RouteBuilder $routes): void {\n $this->assertSame('/debugger', $routes->path());\n $this->assertEquals(['plugin' => 'DebugKit'], $routes->params());\n });\n\n $routes->plugin('Contacts', ['_namePrefix' => 'contacts:'], function (RouteBuilder $routes): void {\n $this->assertSame('contacts:', $routes->namePrefix());\n });\n }", "public function additional_plugin_setup() {\n\n $page_main = $this->_admin_pages['swpm'];\n\n if (!get_option('swpm_dashboard_widget_options')) {\n $widget_options['swpm_dashboard_recent_entries'] = array(\n 'items' => 5,\n );\n update_option('swpm_dashboard_widget_options', $widget_options);\n }\n }", "function getOptions() {\n if (!$theOptions = get_option($this->optionsName)) \n\t\t\t{//default options\n $theOptions = array('hits_ie6_pngfix_method'=>'THM1', //Added V2.0\n\t\t\t\t\t\t\t\t\t'hits_ie6_pngfix_THM_CSSSelector'=>'img, div', //Added V2.1\n\t\t\t\t\t\t\t\t\t//'hits_ie6_pngfix_THM_image_path'=>'Initiated',//Added V2.2 Removed in V3.2\n\t\t\t\t\t\t\t\t\t'hits_ie6_pngfix_version'=>$this->version, //Added V2.3\n\t\t\t\t\t\t\t\t\t'hits_ie6_debug'=>\"false\", //Added V3.0\n\t\t\t\t\t\t\t\t\t'hits_ie6_pngfix_pagesAreCached'=>'false' //Added V3.1\n\t\t\t\t\t\t\t\t\t//'hits_ie6_pngfix_image_path'=>'Initiated'//Added V3.2 Removed in V3.3\n\t\t\t\t\t\t\t\t\t);\n update_option($this->optionsName, $theOptions);\n\t\t\t\t$this->persist_optionsFile();\n }\n $this->options = $theOptions;\n \n\t\t\t//check for missing fields on an upgrade\n\t\t\t$missingOptions=false;\n\t\t\tif(!$this->options['hits_ie6_pngfix_version'] || (strcmp($this->options['hits_ie6_pngfix_version'],$this->version)!=0))\n\t\t\t{\n\t\t\t\t$missingOptions=true;\n\t\t\t\t//an upgrade, run upgrade specific tasks.\n\t\t\t\t\n\t\t\t\t//upgrading from pre-version 2.2\n\t\t\t\tif(!$this->options['hits_ie6_pngfix_THM_CSSSelector'])\n\t\t\t\t{\n\t\t\t\t\tif(strcmp($this->options['hits_ie6_pngfix_method'],'THM1')==0)\n\t\t\t\t\t\t$this->options['hits_ie6_pngfix_THM_CSSSelector'] = 'img,div';\n\t\t\t\t\telse if(strcmp($this->options['hits_ie6_pngfix_method'],'THM2')==0)\n\t\t\t\t\t\t$this->options['hits_ie6_pngfix_THM_CSSSelector'] = 'img, div, a, input';\n\t\t\t\t}\t\t\t\t\n\t\t\t\t//upgrading from version 2.2\n\t\t\t\t\n\t\t\t\t//set the version and update the database.\n\t\t\t\t$this->options['hits_ie6_pngfix_version']=$this->version;\n\t\t\t\t\n\t\t\t\t//added in 3.0\n\t\t\t\tif(!$this->options['hits_ie6_debug'])\n\t\t\t\t{\n\t\t\t\t\t$this->options['hits_ie6_debug']=\"false\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//added in 3.1\n\t\t\t\tif(!$this->options['hits_ie6_pngfix_pagesAreCached'])\n\t\t\t\t{\n\t\t\t\t\t$this->options['hits_ie6_pngfix_pagesAreCached']='false';\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//upgrading to V3.2\n\t\t\t\tif($this->options['hits_ie6_pngfix_THM_image_path'])\n\t\t\t\t{\n\t\t\t\t\t//remove the old options\t\n\t\t\t\t\tunset($this->options['hits_ie6_pngfix_THM_image_path']);\n\t\t\t\t}\n\t\t\t\tif($this->options['hits_ie6_pngfix_image_path'])\n\t\t\t\t{\n\t\t\t\t\t//remove old option\n\t\t\t\t\tunset($this->options['hits_ie6_pngfix_image_path']);\n\t\t\t\t}\n\t\t\t\t$this->persist_optionsFile();\n\t\t\t}\n\t\t\t\n\t\t\t//if missing options found, update them.\n\t\t\tif($missingOptions==true)\n\t\t\t\t$this->saveAdminOptions();\n }", "public function view_option_page() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . 'options.php';\n\t}", "function ajx_plugin_menu() {\r\n\t\t\r\n\t\tadd_options_page( 'Ajaxify Plugin Options', 'Ajaxify', 'manage_options', 'aj-id', 'ajaxify_options' );\r\n\t}", "protected function _getOptions() { return array(); }", "function gumlet_plugin_activate()\n{\n if (!get_option('gumlet_settings')) {\n update_option('gumlet_settings', [\"lazy_load\" => 1, \"original_images\" => 1, \"auto_compress\"=> 1, \"server_webp\"=> 0]);\n }\n}", "abstract public function getOptions();", "protected function defineCommandOptions(){}", "function wwm_2015_optionsframework_options() {\r\n\r\n\t$options = array();\r\n\t//Set the Section Tab Title\r\n\t$options[] = array(\r\n\t\t'name' => __('General Options', 'wwm_2015'),\r\n\t\t'type' => 'heading');\r\n\t\t//Logo\r\n\t\t\t$options[] = array(\r\n\t\t\t\t'name' => __('Main Logo', 'wwm_2015'),\r\n\t\t\t\t'desc' => __('Make sure to use a PNG, with a transparent background (the gray that you see above, is coded in...just for visibility purposes).', 'wwm_2015'),\r\n\t\t\t\t'id' => 'main_logo',\r\n\t\t\t\t'type' => 'upload',\r\n\t\t\t\t'class' => 'large-12 medium-12 small-12 columns');\t\t\r\n\t\t//Primary Color\r\n\t\t\t$options[] = array(\r\n\t\t\t\t\t'name' => __('Primary Color?', 'wwm_2015'),\r\n\t\t\t\t\t'desc' => __('The main color in the scheme', 'wwm_2015'),\r\n\t\t\t\t\t'id' => 'primary_color',\r\n\t\t\t\t\t'std' => '#565b7b',\r\n\t\t\t\t\t'default'=>'#565b7b',\r\n\t\t\t\t\t'type' => 'color',\r\n\t\t\t\t\t'class'=>'large-6 medium-12 small-12 columns'\r\n\t\t\t\t);\t\r\n\t\t//Secondary Color\r\n\t\t\t$options[] = array(\r\n\t\t\t\t\t'name' => __('Secondary Color?', 'wwm_2015'),\r\n\t\t\t\t\t'desc' => __('The secondary color in the scheme', 'wwm_2015'),\r\n\t\t\t\t\t'id' => 'secondary_color',\r\n\t\t\t\t\t'std' => '#d3e2f7',\r\n\t\t\t\t\t'default'=>'#d3e2f7',\r\n\t\t\t\t\t'type' => 'color',\r\n\t\t\t\t\t'class'=>'large-6 medium-12 small-12 columns'\r\n\t\t\t\t);\t\t\r\n\treturn $options;\r\n}", "protected static abstract function getOptions();", "function of_option_setup()\t{\n\t\n\tglobal $of_options, $options_machine;\n\t\n\t$options_machine = new Options_Machine($of_options);\n\t\t\n\tif (!get_option(OPTIONS)){\n\t\t\n\t\t$defaults = (array) $options_machine->Defaults;\n\t\tupdate_option(OPTIONS,$defaults);\n\t\tgenerate_options_css($defaults); \n\t\t\n\t}\n\t\n\t\n}", "public function options($opts)\n {\n }", "public function init()\n {\n global $kong_helpdesk_options;\n $this->options = $kong_helpdesk_options;\n }", "public function plugin_setup() {\n\n\t\t//Get plugin Data information\n\t\tif ( ! function_exists( 'get_plugin_data' ) ) {\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t}\n\t\t$plugin_data = get_plugin_data( __FILE__ );\n\n\t\t//Get Option\n\t\tself::$option = get_option( 'wp_online_pub_opt' );\n\n\t\t//Get Plugin Version\n\t\tself::$plugin_version = $plugin_data['Version'];\n\n\t\t//Set Variable\n\t\tself::$plugin_url = plugins_url( '', __FILE__ );\n\t\tself::$plugin_path = plugin_dir_path( __FILE__ );\n\n\t\t//Set Text Domain\n\t\t$this->load_language( 'wp-onlinepub' );\n\n\t\t//Load Composer\n\t\tinclude_once dirname( __FILE__ ) . '/vendor/autoload.php';\n\n\t\t//set plugin option\n\t\tnew \\WP_OnlinePub\\Gravity_Form();\n\t\tnew \\WP_OnlinePub\\Ticket();\n\t\tnew \\WP_OnlinePub\\Admin_Setting_Api();\n\t\tnew \\WP_OnlinePub\\Admin_Page();\n\t\tnew \\WP_OnlinePub\\Front();\n\t\tnew \\WP_OnlinePub\\Payment();\n\t\tnew \\WP_OnlinePub\\Ajax();\n\n\t\t//Test Service\n\t\tif ( isset( $_GET['test'] ) ) {\n\t\t\t//self::send_mail('admin', 'عنوان ایمیل','matn email test');\n\t\t\t//exit;\n\t\t}\n\t}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function set_options_filter() {\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @since 10.0.0\n\t\t *\n\t\t * @return array\n\t\t */\n\t\t$config = apply_filters( 'gu_set_options', [] );\n\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @return null|array\n\t\t */\n\t\t$config = empty( $config ) ? apply_filters_deprecated( 'github_updater_set_options', [ [] ], '6.1.0', 'gu_set_options' ) : $config;\n\n\t\tforeach ( array_keys( self::$git_servers ) as $git ) {\n\t\t\tunset( $config[ \"{$git}_access_token\" ], $config[ \"{$git}_enterprise_token\" ] );\n\t\t}\n\n\t\tif ( ! empty( $config ) ) {\n\t\t\t$config = $this->sanitize( $config );\n\t\t\tself::$options = array_merge( get_site_option( 'git_updater' ), $config );\n\t\t\tupdate_site_option( 'git_updater', self::$options );\n\t\t}\n\t}", "public function setArguments() {\n\n $theme = wp_get_theme(); // For use with some settings. Not necessary.\n\n $this->args = array(\n // TYPICAL -> Change these values as you need/desire\n 'opt_name' => 'neattheme', // This is where your data is stored in the database and also becomes your global variable name.\n 'display_name' => $theme->get('Name'), // Name that appears at the top of your panel\n 'display_version' => $theme->get('Version'), // Version that appears at the top of your panel\n 'menu_type' => 'submenu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)\n 'allow_sub_menu' => true, // Show the sections below the admin menu item or not\n 'menu_title' => __('Theme Options', 'neat'),\n 'page' => __('Theme Options', 'neat'),\n // You will need to generate a Google API key to use this feature.\n // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth\n 'google_api_key' => '', // Must be defined to add google fonts to the typography module\n 'async_typography' => true,\n //'admin_bar' => false, // Show the panel pages on the admin bar\n 'global_variable' => '', // Set a different name for your global variable other than the opt_name\n 'dev_mode' => false, // Show the time the page took to load, etc\n 'customizer' => true, // Enable basic customizer support\n // OPTIONAL -> Give you extra features\n 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.\n 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n 'page_permissions' => 'manage_options', // Permissions needed to access the options panel.\n 'menu_icon' => '', // Specify a custom URL to an icon\n 'last_tab' => '', // Force your panel to always open to a specific tab (by id)\n 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title\n 'page_slug' => '_options', // Page slug used to denote the panel\n 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not\n 'default_show' => false, // If true, shows the default value next to each field that is not the default value.\n 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *\n // CAREFUL -> These options are for advanced use only\n 'transient_time' => 60 * MINUTE_IN_SECONDS,\n 'output' => true, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output\n 'output_tag' => true, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head\n //'domain' \t=> 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.\n //'footer_credit' \t=> '', // Disable the footer credit of Redux. Please leave if you can help it.\n // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.\n 'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!\n 'show_import_export' => true, // REMOVE\n 'system_info' => false, // REMOVE\n 'help_tabs' => array(),\n 'help_sidebar' => '', // __( '', $this->args['domain'] ); \n );\n $this->args['share_icons'][] = array(\n 'url' => 'https://twitter.com/marstheme',\n 'title' => 'Follow us on Twitter',\n 'icon' => 'el-icon-twitter'\n );\n // Panel Intro text -> before the form\n if (!isset($this->args['global_variable']) || $this->args['global_variable'] !== false) {\n if (!empty($this->args['global_variable'])) {\n $v = $this->args['global_variable'];\n } else {\n $v = str_replace(\"-\", \"_\", $this->args['opt_name']);\n }\n $this->args['intro_text'] = sprintf(__('<p>Did you know that Redux sets a global variable for you? To access any of your saved options from within your code you can use your global variable: <strong>$%1$s</strong></p>', 'neat'), $v);\n } else {\n $this->args['intro_text'] = __('<p>This text is displayed above the options panel. It isn\\'t required, but more info is always better! The intro_text field accepts all HTML.</p>', 'neat');\n }\n\n // Add content after the form.\n //$this->args['footer_text'] = __('<p>This text is displayed below the options panel. It isn\\'t required, but more info is always better! The footer_text field accepts all HTML.</p>', 'neat');\n }", "function activate() {\n\t\t\tadd_option('h2utp_options', json_encode($this->options));\n\t\t}", "function get_arguments_views_plugins() {\n return array(\n 'argument default' => array(\n 'param' => array(\n 'title' => t('GET parameter from URL'),\n 'handler' => 'get_arguments_plugin_argument_default_param',\n ),\n ),\n );\n}", "function plugin_options_page() {\n?>\n<div>\n<h2>SOPA intro page Settings</h2>\nOptions relating to the Custom Plugin.\n<form action=\"options.php\" method=\"post\">\n<?php settings_fields('plugin_options'); ?>\n<?php do_settings_sections(PLUGIN_SLUG); ?>\n\n<p class=\"submit\">\n<input type=\"submit\" name=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n</p>\n</form></div>\n\n<?php }", "function optionsframework_options() {\n\n\t// Test data\n\t$test_array = array(\n\t\t'one' => __('One', 'options_framework_theme'),\n\t\t'two' => __('Two', 'options_framework_theme'),\n\t\t'three' => __('Three', 'options_framework_theme'),\n\t\t'four' => __('Four', 'options_framework_theme'),\n\t\t'five' => __('Five', 'options_framework_theme')\n\t);\n\n\t// Multicheck Array\n\t$multicheck_array = array(\n\t\t'one' => __('French Toast', 'options_framework_theme'),\n\t\t'two' => __('Pancake', 'options_framework_theme'),\n\t\t'three' => __('Omelette', 'options_framework_theme'),\n\t\t'four' => __('Crepe', 'options_framework_theme'),\n\t\t'five' => __('Waffle', 'options_framework_theme')\n\t);\n\n\t// Multicheck Defaults\n\t$multicheck_defaults = array(\n\t\t'one' => '1',\n\t\t'five' => '1'\n\t);\n\n\n\t$multicheck_nums = array(\n\t\t'1' => '1',\n\t\t'2' => '2',\n\t\t'3' => '3',\n\t\t'4' => '4',\n\t\t'5' => '5'\n\t);\n\n\t// Background Defaults\n\t$background_defaults = array(\n\t\t'color' => '',\n\t\t'image' => '',\n\t\t'repeat' => 'repeat',\n\t\t'position' => 'top center',\n\t\t'attachment'=>'scroll' );\n\n\t// Typography Defaults\n\t$typography_defaults = array(\n\t\t'size' => '15px',\n\t\t'face' => 'georgia',\n\t\t'style' => 'bold',\n\t\t'color' => '#bada55' );\n\n\t// Typography Options\n\t$typography_options = array(\n\t\t'sizes' => array( '6','12','14','16','20' ),\n\t\t'faces' => array( 'Helvetica Neue' => 'Helvetica Neue','Arial' => 'Arial' ),\n\t\t'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ),\n\t\t'color' => false\n\t);\n\n\t// Pull all the categories into an array\n\t$options_categories = array();\n\t$options_categories_obj = get_categories();\n\tforeach ($options_categories_obj as $category) {\n\t\t$options_categories[$category->cat_ID] = $category->cat_name;\n\t}\n\n\t// Pull all tags into an array\n\t$options_tags = array();\n\t$options_tags_obj = get_tags();\n\tforeach ( $options_tags_obj as $tag ) {\n\t\t$options_tags[$tag->term_id] = $tag->name;\n\t}\n\n\n\t// Pull all the pages into an array\n\t$options_pages = array();\n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t// $options_pages[''] = 'Select a page:';\n\tforeach ($options_pages_obj as $page) {\n\t\t$options_pages[$page->ID] = $page->post_title;\n\t}\n\n\t$options_linkcats = array();\n\t$options_linkcats_obj = get_terms('link_category');\n\tforeach ( $options_linkcats_obj as $tag ) {\n\t\t$options_linkcats[$tag->term_id] = $tag->name;\n\t}\n\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_template_directory_uri() . '/img/';\n\t$qrcode = get_template_directory_uri() . '/img/qrcode.png';\n\t$adsdesc = __('可添加任意广告联盟代码或自定义代码', 'haoui');\n\n\t$options = array();\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('基本', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('Logo', 'haoui'),\n\t\t'id' => 'logo_src',\n\t\t'std' => $imagepath . 'logo.png',\n\t\t'desc' => '建议尺寸200x50',\n\t\t'type' => 'upload');\n\t\n\t$options[] = array(\n\t\t'name' => __('字体logo', 'haoui'),\n\t\t'id' => 'logo_style',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui').__('(开启后图片logo会失效,字体logo修改教程请查看群文件)', 'haoui'));\n\t\t\n\t$options[] = array(\n\t\t'name' => __('布局', 'haoui'),\n\t\t'id' => 'layout',\n\t\t'std' => \"2\",\n\t\t'type' => \"radio\",\n\t\t'desc' => __(\"2种布局供选择,点击选择你喜欢的布局方式,保存后前端展示会有所改变。\", 'haoui'),\n\t\t'options' => array(\n\t\t\t'2' => __('有侧边栏', 'haoui'),\n\t\t\t'1' => __('无侧边栏', 'haoui')\n\t\t));\n\t$options[] = array(\n\t\t'name' => __('全局小米兰亭字体', 'haoui'),\n\t\t'id' => 'all_fonts',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(开启后全局文字将会有一定变化,请查看前台效果)', 'haoui'));\n\t\t\n\t$options[] = array(\n\t\t'name' => __(\"主题风格\", 'haoui'),\n\t\t'desc' => __(\"14种颜色供选择,点击选择你喜欢的颜色,保存后前端展示会有所改变。\", 'haoui'),\n\t\t'id' => \"theme_skin\",\n\t\t'std' => \"45B6F7\",\n\t\t'type' => \"colorradio\",\n\t\t'options' => array(\n\t\t\t'45B6F7' => 100,\n\t\t\t'FF5E52' => 1,\n\t\t\t'2CDB87' => 2,\n\t\t\t'00D6AC' => 3,\n\t\t\t'16C0F8' => 4,\n\t\t\t'EA84FF' => 5,\n\t\t\t'FDAC5F' => 6,\n\t\t\t'FD77B2' => 7,\n\t\t\t'76BDFF' => 8,\n\t\t\t'C38CFF' => 9,\n\t\t\t'FF926F' => 10,\n\t\t\t'8AC78F' => 11,\n\t\t\t'C7C183' => 12,\n\t\t\t'555555' => 13\n\t\t)\n\t);\n\n\t$options[] = array(\n\t\t'id' => 'theme_skin_custom',\n\t\t'std' => \"\",\n\t\t'desc' => __('不喜欢上面提供的颜色,你好可以在这里自定义设置,如果不用自定义颜色清空即可(默认不用自定义)', 'haoui'),\n\t\t'type' => \"color\");\n\n\t\n\n\t$options[] = array(\n\t\t'name' => __('网页最大宽度', 'haoui'),\n\t\t'id' => 'site_width',\n\t\t'std' => 1200,\n\t\t'class' => 'mini',\n\t\t'desc' => __('默认:1200,单位:px(像素)', 'haoui'),\n\t\t'type' => 'text');\n\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\t$options[] = array(\n\t\t'name' => __('底部友情链接', 'haoui'),\n\t\t'id' => 'flinks_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(开启后会在页面底部增加一个链接模块)', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'flinks_home_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('只在首页开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'flinks_m_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('在手机端显示,不勾选则不在手机端显示', 'haoui'));\n $options[] = array(\n\t\t'id' => 'gd_links',\n\t\t'std' => '/links',\n\t\t'class' => 'op-multicheck mini',\n\t\t'desc' => __('侧边栏更多友链地址'),\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'flinks_cat',\n\t\t'options' => $options_linkcats,\n\t\t'class' => 'op-multicheck mini',\n\t\t'desc' => __('选择一个底部友情链接的链接分类', 'haoui'),\n\t\t'type' => 'select');\n\n\n\t$options[] = array(\n\t\t'name' => __('jQuery底部加载', 'haoui'),\n\t\t'id' => 'jquery_bom',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(可提高页面内容加载速度,但部分依赖jQuery的插件可能失效)', 'haoui'));\n\n\n\t$options[] = array(\n\t\t'name' => __('Gravatar 头像获取', 'haoui'),\n\t\t'id' => 'gravatar_url',\n\t\t'std' => \"ssl\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t\t'no' => __('原有方式', 'haoui'),\n\t\t\t'ssl' => __('从Gravatar官方ssl获取', 'haoui'),\n\t\t\t'duoshuo' => __('从多说服务器获取', 'haoui')\n\t\t));\n\n\t$options[] = array(\n\t\t'name' => __('JS文件托管(可大幅提速JS加载)', 'haoui'),\n\t\t'id' => 'js_outlink',\n\t\t'std' => \"no\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t\t'no' => __('不托管', 'haoui'),\n\t\t\t'baidu' => __('百度', 'haoui'),\n\t\t\t'360' => __('360(新接口,推荐)', 'haoui'),\n\t\t\t'he' => __('框架来源站点(分别引入jquery和bootstrap官方站点JS文件)', 'haoui')\n\t\t));\n\n\t$options[] = array(\n\t\t'name' => __('网站整体变灰', 'haoui'),\n\t\t'id' => 'site_gray',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(支持IE、Chrome,基本上覆盖了大部分用户,不会降低访问速度)', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('分类url去除category字样', 'haoui'),\n\t\t'id' => 'no_categoty',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(主题已内置no-category插件功能,请不要安装插件;<b>开启后请去设置-固定连接中点击保存即可)</b>', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('品牌文字', 'haoui'),\n\t\t'id' => 'brand',\n\t\t'std' => \"欢迎光临\\n我们一直在努力\",\n\t\t'desc' => __('显示在Logo旁边的两个短文字,请换行填写两句文字(短文字介绍)', 'haoui'),\n\t\t'settings' => array(\n\t\t\t'rows' => 2\n\t\t),\n\t\t'type' => 'textarea');\n\n\t\n\n\t$options[] = array(\n\t\t'name' => __('网站底部信息', 'haoui'),\n\t\t'id' => 'footer_seo',\n\t\t'std' => '<a href=\"'.site_url('/sitemap.xml').'\">'.__('网站地图', 'haoui').'</a>'.\"\\n\",\n\t\t'desc' => __('备案号可写于此,网站地图可自行使用sitemap插件自动生成', 'haoui'),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('手机端导航', 'haoui'),\n\t\t'id' => 'm_navbar',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('百度自定义站内搜索', 'haoui'),\n\t\t'id' => 'search_baidu',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'search_baidu_code',\n\t\t'std' => '',\n\t\t'desc' => __('此处存放百度自定义站内搜索代码,请自行去 http://zn.baidu.com/ 设置并获取', 'haoui'),\n\t\t'settings' => array(\n\t\t\t'rows' => 2\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('PC端滚动时导航固定', 'haoui'),\n\t\t'id' => 'nav_fixed',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('由于网址导航左侧菜单的固定,故对网址导航页面无效', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('新窗口打开文章', 'haoui'),\n\t\t'id' => 'target_blank',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\n\n\t$options[] = array(\n\t\t'name' => __('首页不显示该分类下文章', 'haoui'),\n\t\t'id' => 'notinhome',\n\t\t'options' => $options_categories,\n\t\t'type' => 'multicheck');\n\n\t$options[] = array(\n\t\t'name' => __('首页不显示以下ID的文章', 'haoui'),\n\t\t'id' => 'notinhome_post',\n\t\t'std' => \"11245\\n12846\",\n\t\t'desc' => __('每行填写一个文章ID', 'haoui'),\n\t\t'settings' => array(\n\t\t\t'rows' => 2\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('分页无限加载页数', 'haoui'),\n\t\t'id' => 'ajaxpager',\n\t\t'std' => 5,\n\t\t'class' => 'mini',\n\t\t'desc' => __('为0时表示不开启该功能', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('列表模式', 'haoui'),\n\t\t'id' => 'list_type',\n\t\t'std' => \"thumb\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t\t'thumb' => __('图文模式(缩略图尺寸:220*150px,默认已自动裁剪)', 'haoui'),\n\t\t\t'text' => __('文字模式 ', 'haoui'),\n\t\t\t'thumb_if_has' => __('图文模式,无特色图时自动转换为文字模式 ', 'haoui'),\n\t\t));\n\n\t$options[] = array(\n\t\t'name' => '底部QQ咨询',\n\t\t'id' => 'fqq_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启'.'(开启后会在网站底部右下角增加一个QQ咨询按钮。QQ通讯组件可以到 shang.qq.com 进行相关设置)');\n\n\t$options[] = array(\n\t\t'id' => 'fqq_id',\n\t\t'desc' => 'QQ号码',\n\t\t'std' => '4700003344',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'id' => 'fqq_tip',\n\t\t'desc' => '按钮提示文字。默认:QQ咨询',\n\t\t'std' => 'QQ咨询',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => __('SEO', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('全站连接符', 'haoui'),\n\t\t'id' => 'connector',\n\t\t'desc' => __('一经选择,切勿更改,对SEO不友好,一般为“-”或“_”', 'haoui'),\n\t\t'std' => _hui('connector') ? _hui('connector') : '-',\n\t\t'type' => 'text',\n\t\t'class' => 'mini');\n\n\t$options[] = array(\n\t\t'name' => 'SEO标题(title)',\n\t\t'id' => 'hometitle',\n\t\t'std' => '',\n\t\t'desc' => '完全自定义的首页标题让搜索引擎更喜欢,该设置为空则自动采用后台-设置-常规中的“站点标题+副标题”的形式',\n\t\t'settings' => array(\n\t\t\t'rows' => 2\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('首页关键字(keywords)', 'haoui'),\n\t\t'id' => 'keywords',\n\t\t'std' => '一个网站, 一个牛x的网站',\n\t\t'desc' => __('关键字有利于SEO优化,建议个数在5-10之间,用英文逗号隔开', 'haoui'),\n\t\t'settings' => array(\n\t\t\t'rows' => 2\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('首页描述(description)', 'haoui'),\n\t\t'id' => 'description',\n\t\t'std' => __('源码社 www.nicedowns.com 精品商业资源免费下载', 'haoui'),\n\t\t'desc' => __('描述有利于SEO优化,建议字数在30-70之间', 'haoui'),\n\t\t'settings' => array(\n\t\t\t'rows' => 3\n\t\t),\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('文章和页面SEO设置', 'haoui'),\n\t\t'id' => 'post_keywords_description_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('文章评论内链接添加nofollow跳转', 'haoui'),\n\t\t'id' => 'nofollow_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('文章内外链go跳转', 'haoui'),\n\t\t'id' => 'go_tiaozhuan_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启【去页面新建页面,选择模板 <b><i>外链跳转</b></i> 固定链接设为 <b>http://你的域名/go</b> 】', 'haoui'));\n\n\t\t// ============首页布局==========================================================================================================\n\t$options[] = array(\n\t\t'name' => __('首页布局', 'haoui'),\n\t\t'type' => 'heading');\n\n\n\t\t $options[] = array(\n\t\t'name' => __( '首页显示模式', 'theme-textdomain' ),\n\t\t'desc' => __( '设置首页显示风格.', 'theme-textdomain' ),\n\t\t'id' => 'index-s',\n\t\t'std' => 'index-blog',\n\t\t'type' => 'radio',\n\t\t'options' => array('index-blog' => __( '博客模式', 'theme-textdomain' ),'index-card' => __( '卡片模式', 'theme-textdomain' ),'index-cms' => __( 'CMS模式', 'theme-textdomain' ),)\n\t);\n\t\n\t$options[] = array(\n\t\t'name' => __('CMS最新文章', 'haoui'),\n\t\t'id' => 'index_cms_new',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启(开启博客模式和卡片模式请关闭)', 'haoui'));\n\t$options[] = array(\n\t\t'id' => 'index_cms_new_list',\n\t\t'type' => \"text\",\n\t\t'std' => '5',\n\t\t'desc' => __('显示数量', 'haoui').__('(置顶文章不包括其中)', 'haoui'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'name' => __( 'CMS首页排除的分类', 'theme-textdomain' ),\n\t\t'desc' => __( '排除的分类ID将不会显示在首页,中间用英文逗号隔开例如:1,2,3', 'theme-textdomain' ),\n\t\t'id' => 'cmsundisplaycats',\n\t\t'std' => '',\n\t\t'class' => 'mini',\n\t\t'type' => 'text'\n\t);\n\t\n\t$options[] = array(\n\t\t'name' => __( 'CMS自定义分类排序', 'theme-textdomain' ),\n\t\t'desc' => __( '自定义首页CMS分类排序,依次填写分类ID,中间用英文逗号隔开例如:1,2,3', 'theme-textdomain' ),\n\t\t'id' => 'example_text',\n\t\t'std' => '',\n\t\t'class' => 'mini',\n\t\t'type' => 'text'\n\t);\n\n if ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS并列双栏模板', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,该模板为分类并列模板,推荐偶数个分类勾选该模板,并在分类输出排序中使其相邻,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t}\n\tif ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS1,顶部焦点图', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories_1',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t}\n\tif ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS2,左侧焦点图', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories_2',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t\t\t$options[] = array(\n\t\t'desc' => __('CMS2底部广告', 'haoui'),\n\t\t'id' => 'bar_2_asb',\n\t\t'std' => '',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'textarea');\n\t}\n\t\n\tif ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS3,右侧焦点图', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories_3',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t\t\t$options[] = array(\n\t\t'desc' => __('CMS3底部广告', 'haoui'),\n\t\t'id' => 'bar_3_asb',\n\t\t'std' => '',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'textarea');\n\t}\n\n\tif ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS4,三列三行,首行为焦点图', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories_4',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t}\n\n\tif ( $options_categories ) { \n\t\t$options[] = array(\n\t\t\t'name' => __( '首页CMS5,图文对称模板', 'theme-textdomain' ),\n\t\t\t'desc' => __( '要使用该模板,请勾选对应分类,同一分类不要勾选多个模板', 'theme-textdomain' ),\n\t\t\t'id' => 'example_checkbox_categories_5',\n\t\t\t'type' => 'multicheck',\n\t\t\t'options' => $options_categories\n\t\t);\n\t}\t\t\n\t$options[] = array(\n\t\t'name' => __('首页最新评论 or 随机文章推荐', 'haoui'),\n\t\t'id' => 'latest_visit_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(开启后会在banner下增加一个模块,展示最新发表过评论的文章,经典模式下显示随机文章,手机默认不显示', 'haoui'));\n $options[] = array(\n\t\t'name' => __('关闭前台登录', 'haoui'),\n\t\t'id' => 'ligin_off',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('关闭'));\n\n\t$options[] = array(\n\t\t'name' => __('首页随机文章/热门文章', 'haoui'),\n\t\t'id' => 'index_page_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui').__('(开启后会在公告下新增一个模块,若是开启“经典模式”则只显示热门文章且手机不显示)', 'haoui'));\n\t$options[] = array(\n\t\t'desc' => __('随机文章⬇⬇⬇⬇⬇'));\n\t$options[] = array(\n\t\t'id' => 'index_suiji_h3',\n\t\t'type' => \"text\",\n\t\t'std' => '随机推荐',\n\t\t'desc' => __('随机推荐标题'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'id' => 'index_suiji_item',\n\t\t'type' => \"text\",\n\t\t'std' => '4',\n\t\t'desc' => __('显示数量', 'haoui').__('(此为随机文章数量)', 'haoui'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'id' => 'index_suiji_text',\n\t\t'type' => \"text\",\n\t\t'std' => '荐',\n\t\t'desc' => __('随机推荐文字', 'haoui').__('(将显示在每条推荐的前面,建议一个字,支持fonts图标)', 'haoui'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'desc' => __('热门文章⬇⬇⬇⬇⬇'));\n\t$options[] = array(\n\t\t'id' => 'index_rem_h3',\n\t\t'type' => \"text\",\n\t\t'std' => '30天热门',\n\t\t'desc' => __('热门推荐标题'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'id' => 'index_rem_item',\n\t\t'type' => \"text\",\n\t\t'std' => '4',\n\t\t'desc' => __('显示数量', 'haoui').__('(此为随机文章数量)', 'haoui'),\n\t\t'class' => 'op-multicheck mini');\n\t$options[] = array(\n\t\t'id' => 'index_rem_date',\n\t\t'type' => \"text\",\n\t\t'std' => '30',\n\t\t'desc' => __('时间/单位/天', 'haoui').__('(显示多长时间内评论最多的文章)', 'haoui'),\n\t\t'class' => 'op-multicheck mini');\n\t\t\t$options[] = array(\n\t\t'name' => __('首页工具箱', 'haoui'),\n\t\t'id' => 'index_tool_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('手机端默认不显示', 'haoui'),\n\t\t'id' => 'index_tool',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => '<article class=\"excerpt-list\">\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-l\">\n <i class=\"fa fa-cogs\"></i>\n <h4>常用工具</h4>\n <p>各种建站小工具</p>\n <a class=\"btn btn-primary btn-sm\" href=\"#\">点击进入</a></div>\n </div>\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-2\">\n <i class=\"fa fa-music\"></i>\n <h4>FM音乐</h4>\n <p>音乐点播页面</p>\n <a class=\"btn btn-primary btn-sm\" href=\"http://fm.relzz.com\">点击进入</a></div>\n </div>\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-3\">\n <i class=\"fa fa-list\"></i>\n <h4>文章归档</h4>\n <p>所有文章都搁着</p>\n <a class=\"btn btn-primary btn-sm\" href=\"#\">点击进入</a></div>\n </div>\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-4\">\n <i class=\"fa fa-link\"></i>\n <h4>友情链接</h4>\n <p>网站合作互赢!</p>\n <a class=\"btn btn-primary btn-sm\" href=\"/links\">点击进入</a></div>\n </div>\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-5\">\n <i class=\"fa fa-twitch\"></i>\n <h4>留言互动</h4>\n <p>意见反馈提问区</p>\n <a class=\"btn btn-primary btn-sm\" href=\"#\">点击进入</a></div>\n </div>\n <div class=\"col-sm-2 col-xs-4 col-list\">\n <div class=\"indexebox indexebox-6\">\n <i class=\"fa fa-wordpress fa-spin fa-3x fa-fw\"></i>\n <h4>唯爱网络</h4>\n <p>专注资源分享</p>\n <a class=\"btn btn-danger btn-sm\" href=\"http://www.vizyw.com\">点击进入</a></div>\n </div>\n</article>',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('首页最新发布显示置顶文章', 'haoui'),\n\t\t'id' => 'home_sticky_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\t\t$options[] = array(\n\t\t'id' => 'home_sticky_n',\n\t\t'options' => $multicheck_nums,\n\t\t'desc' => __('置顶文章显示数目', 'haoui'),\n\t\t'class' => 'op-multicheck mini',\n\t\t'type' => 'select');\n\n\t\t\n\t$options[] = array(\n\t\t'name' => __('后台登录密码保护', 'haoui'),\n\t\t'id' => 'login_security',\n\t\t'type' => 'checkbox',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n $options[] = array(\n\t 'desc' => __('示列:修改后你的登录地址为:<b>/wp-login.php?密码域=密码</b> 如我设置的密码域为 vieu 密码为 2018 则后台登录地址为<b>:/wp-login.php?vieu=2018</b> 如非通过此链接访问默认跳转到指定网站'),\n\t\t'class' => 'op-multicheck');\n\t$options[] = array(\n\t\t'id' => 'login_security_title',\n\t\t'std' => '',\n\t\t'desc' => __('密码域'),\n\t\t'class' => 'op-multicheck mini',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'login_security_pass',\n\t\t'std' => '',\n\t\t'desc' => __('密码'),\n\t\t'class' => 'op-multicheck mini',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'login_security_url',\n\t\t'std' => '',\n\t\t'desc' => __('错误跳转链接'),\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\n $options[] = array(\n\t\t'name' => __('自动使用文章第一张图作为缩略图', 'haoui'),\n\t\t'id' => 'thumb_postfirstimg_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').',特别注意:如果文章已经设置特色图像或外链缩略图输入,此功能将无效。');\n\n\t$options[] = array(\n\t\t'id' => 'thumb_postfirstimg_lastname',\n\t\t'std' => '',\n\t\t'desc' => __('自动缩略图后缀将自动加入文章第一张图的地址后缀之前。比如:文章中的第一张图地址是“aaa/bbb.jpg”,此处填写的字符是“-220x150”,那么缩略图的实际地址就变成了“aaa/bbb-220x150.jpg”。默认为空。', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('外链缩略图输入', 'haoui'),\n\t\t'id' => 'thumblink_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('开启', 'haoui').' 开启后会在后台编辑文章时出现外链缩略图地址输入框,填写一个图片地址即可在文章列表中显示。注意:如果文章添加了特色图像,列表中显示的缩略图优先选择该特色图像。');\n\t\n\t$options[] = array(\n\t\t'name' => __('WOW加载特效', 'haoui'),\n\t\t'id' => 'the_wow_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('显示页面', 'haoui'),\n\t\t'id' => 'the_wow_comt1',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('首页', 'haoui'));\n\t$options[] = array(\n\t\t'id' => 'the_wow_comt2',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('文章页', 'haoui'));\n\t$options[] = array(\n\t\t'id' => 'the_wow_comt3',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('侧边栏', 'haoui'));\n $options[] = array(\n\t\t'id' => 'the_wow_comt4',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('内容抖动', 'haoui'));\t\t\n\t$options[] = array(\n\t'name' => __('样式', 'haoui'),\n\t\t'id' => 'the_wow_style',\n\t\t'std' => \"fadeInUp\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t\t'fadeInUp' => __('默认', 'haoui'),\n\t\t\t'zoomIn' => __('弹出', 'haoui'),\n\t\t\t'pulse' => __('跳动', 'haoui'),\n\t\t\t'swing' => __('晃动', 'haoui'),\n\t\t\t'bounceIn' => __('跳出', 'haoui'),\n\t\t\t'bounceInUp' => __('下拉', 'haoui'),\n\t\t\t'flipInX' => __('上下翻转', 'haoui'),\n\t\t\t'flipInY' => __('左右翻转', 'haoui')\n\t\t));\n\n $options[] = array(\n\t\t'name' => '侧栏关于我们',\n\t\t'id' => 'celan_about_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => '开启');\n\t\t\n $options[] = array(\n\t\t'id' => 'celan_date_s',\n\t\t'type' => \"checkbox\",\n\t\t'class' => 'op-multicheck',\n\t\t'std' => true,\n\t\t'desc' => '显示时间');\n\n $options[] = array(\n\t\t'id' => 'celan_statistics_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => '站点统计');\n\t\t\n $options[] = array(\n\t\t'id' => 'celan_last_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => '最后更新');\n\t\t$options[] = array(\n 'desc' => '背景图(建议尺寸360*200)');\n\t\t\n $options[] = array(\n\t\t'id' => 'celan_img_s',\n\t\t'std' => $imagepath . 'about_bg.png',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'upload');\n\t\n\t$options[] = array(\n\t\t'id' => 'celan_title_s',\n\t\t'std' => '关于我们',\n\t\t'desc' => __('标题', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'celan_keyword_s',\n\t\t'std' => '专注于网络资源搜集共享与发布!',\n\t\t'desc' => __('推广语', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'celan_description_s',\n\t\t'std' => '本站从2014年开始至今始终坚持免费搜集分享各种网络资源,现如今本站已发展形成网站源码、主题模板、WordPress教程、破解软件、电脑软件、操作系统、经验教程、影视资源等各个领域的资源!',\n\t\t'desc' => __('详细介绍(支持html代码)', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'textarea');\n\t\t\n\t\t\n/*\n\t$options[] = array(\n\t\t'name' => __('评论数只显示人为评论数量', 'haoui'),\n\t\t'id' => 'comment_number_remove_trackback',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__('(部分文章有trackback导致评论数的增加,这个可以过滤掉) ', 'haoui'));\n*/\n\n\n\t// =======================自定义背景===============================================================================================\n\t\n\t$options[] = array(\n\t\t'name' => __('自定义背景', 'haoui'),\n\t\t'type' => 'heading');\n$options[]=array(\n'name'=>__('开启自定义网站背景','haoui'),\n'id'=>'bg_checker',\n'desc'=>__('勾选之后请设置下面的值','haoui'),\n'type'=>'checkbox'\n);\n$options[] = array(\n'name'=>__('自定义背景个颜色','haoui'),\n'id' => 'wp_bg_color',\n'std' => \"\",\n'desc' => __('选中文字颜色,请选择一种颜色,自行配合颜色', 'haoui'),\n'type' => \"color\");\n$options[] = array(\n'name'=>__('自定背景图片','haoui'),\n'id' => 'wp_bg_img',\n'std' => \"\",\n'desc' => __('自行上传一张图片作为背景图片,优先级低于上面的,也就是一旦设置了颜色,此选项失效', 'haoui'),\n'type' => \"upload\");\n\t$options[] = array(\n\t\t'name' => __('布局', 'haoui'),\n\t\t'id' => 'wp_bg_style',\n\t\t'std' => \"no-repeat\",\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\t'no-repeat' => __('不重复显示', 'haoui'),\n\t\t\t'repeat' => __('重复显示', 'haoui'),\n\t\t));\n\t\t\t$options[] = array(\n\t\t'name' => __('背景滚动', 'haoui'),\n\t\t'id' => 'wp_bg_gd',\n\t\t'std' => \"fixed\",\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\t'fixed' => __('不滚动', 'haoui'),\n\t\t\t'scroll' => __('滚动', 'haoui'),\n\t\t));\n\t\t\t$options[] = array(\n\t\t'name' => __('是否填满屏幕', 'haoui'),\n\t\t'id' => 'wp_bg_size',\n\t\t'std' => \"\",\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\n\t\t\t'' => __('原始', 'haoui'),\t\n\t\t\t'background-size:100%;' => __('填满', 'haoui'),\n\t\t));\n$options[]=array(\n'name'=>__('===================================================================================','haoui'),\n);\t\t\n$options[]=array(\n'name'=>__('开启自定义登陆页面背景','haoui'),\n'id'=>'login_bg_checker',\n'desc'=>__('勾选之后请设置下面的值','haoui'),\n'type'=>'checkbox'\n);\n$options[] = array(\n'name'=>__('自定义背景个颜色','haoui'),\n'id' => 'login_bg_color',\n'std' => \"\",\n'desc' => __('选中文字颜色,请选择一种颜色,自行配合颜色', 'haoui'),\n'type' => \"color\");\n$options[] = array(\n'name'=>__('自定背景图片','haoui'),\n'id' => 'login_bg_img',\n'std' => \"\",\n'desc' => __('自行上传一张图片作为背景图片,优先级低于上面的,也就是一旦设置了颜色,此选项失效', 'haoui'),\n'type' => \"upload\");\n$options[]=array(\n'name'=>__('开启自定义登陆页logo','haoui'),\n'id'=>'login_logo',\n'desc'=>__('勾选之后请设置下面的值','haoui'),\n'type'=>'checkbox'\n);\n\n$options[] = array(\n'id' => 'login_logo_img',\n'std' => \"\",\n'desc' => __('logo地址,图片尺寸为120*120', 'haoui'),\n'type' => \"upload\");\n\n$options[] = array(\n\t\t'id' => 'login_logo_url',\n\t\t'std' => '',\n\t\t'desc' => __('自定义logo跳转链接,留空为首页', 'haoui'),\n\t\t'type' => 'text');\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('文章页', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('面包屑导航', 'haoui'),\n\t\t'id' => 'breadcrumbs_single_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('面包屑导航', 'haoui').' / '.__('用“正文”替代标题', 'haoui'),\n\t\t'id' => 'breadcrumbs_single_text',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('文章摘要', 'haoui'),\n\t\t'id' => 'breadcrumbs_zhaiyao_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启(可以在文章编辑页面上方显示,编辑文章时添加自定义摘要)', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('图片弹窗预览', 'haoui'),\n\t\t'id' => 'lightbox_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('弹窗付图片注明', 'haoui'),\n\t\t'id' => 'lightbox_caption_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('分享功能(手机端不显示)', 'haoui'),\n\t\t'id' => 'share_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => '点赞',\n\t\t'id' => 'post_like_s',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\t\t\n\t$options[] = array(\n\t\t'name' => '侧边栏收缩',\n\t\t'id' => 'bianlan_on_s',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\t$options[] = array(\n\t\t'name' => __('分享海报', 'haoui'),\n\t\t'id' => 'bigger-share_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启(注意二维码api与左边栏的二维码api是一样的,开启前请确认API可用有效)', 'haoui'));\n\t$options[] = array(\n\t\t'id' => 'bigger-share-sub',\n\t\t'desc' => '海报宣传语',\n 'class' => 'op-multicheck',\n\t\t'std' => __('专注于网络资源搜集共享与发布!', 'haoui'),\n\t\t'type' => 'text');\t\n\t$options[] = array(\n\t\t'id' => 'bigger-share-logo',\n\t\t'desc' => '海报logo(尺寸:200*50)',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => $imagepath . 'logo.png',\n\t\t'type' => 'upload');\t\t\t\t\n\n\t\t\n\t$options[] = array(\n\t\t'name' => '打赏',\n\t\t'id' => 'post_rewards_s',\n\t\t'desc' => '开启',\n\t\t'std' => true,\n\t\t'type' => \"checkbox\");\n\n\t$options[] = array(\n\t\t'name' => '打赏:显示文字',\n\t\t'id' => 'post_rewards_text',\n\t\t'std' => '打赏',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '打赏:弹出层标题',\n\t\t'id' => 'post_rewards_title',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => '觉得文章有用就打赏一下文章作者',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '打赏:支付宝收款二维码',\n\t\t'id' => 'post_rewards_alipay',\n\t\t'desc' => '',\n\t\t'std' => $qrcode,\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => '打赏:微信收款二维码',\n\t\t'id' => 'post_rewards_wechat',\n\t\t'desc' => '',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => $qrcode,\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('文章小部件开启', 'haoui'),\n\t\t'id' => 'post_plugin_view',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('阅读量(无需安装插件)', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_comm',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('列表评论数', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_like',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('列表点赞', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_date_m',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('手机端列表时间 ', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_author',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('列表作者名', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_cat',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('列表分类链接', 'haoui'));\n\n\t$options[] = array(\n\t\t'id' => 'post_plugin_cat_m',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('手机端列表分类链接', 'haoui'));\n\n\n\t$options[] = array(\n\t\t'name' => __('文章缩略图异步加载', 'haoui'),\n\t\t'id' => 'thumbnail_src',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('文章上一页下一页', 'haoui'),\n\t\t'id' => 'post_prevnext_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\n\t$options[] = array(\n\t\t'name' => __('相关文章', 'haoui'),\n\t\t'id' => 'post_related_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\t\n\t$options[] = array(\n\t\t'id' => 'related_m',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('手机端不显示', 'haoui'));\n\t\n\t$options[] = array(\n\t\t'id' => 'post_related_style',\n\t\t'std' => \"relates-thumb\",\n\t\t'type' => \"radio\",\n\t\t'class' => 'op-multicheck',\n\t\t'options' => array(\n\t\t\t'relates-thumb' => __('图文模式', 'haoui'),\n\t\t\t'relates-text' => __('文字模式', 'haoui')\n\t\t));\n\t\t\n\t$options[] = array(\n\t\t'desc' => __('相关文章标题', 'haoui'),\n\t\t'id' => 'related_title',\n\t\t'class' => 'op-multicheck mini',\n\t\t'std' => __('相关推荐', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'desc' => __('相关文章显示数量', 'haoui'),\n\t\t'id' => 'post_related_n',\n\t\t'std' => 4,\n\t\t'class' => 'op-multicheck mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('文章来源', 'haoui'),\n\t\t'id' => 'post_from_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\t\n\t$options[] = array(\n\t\t'id' => 'post_from_h1',\n\t\t'std' => __('来源:', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('来源显示字样', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'id' => 'post_from_link_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('来源加链接', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('内容段落缩进', 'haoui'),\n\t\t'id' => 'post_p_indent_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui').__(' 开启后只对前台文章展示有效,对后台编辑器中的格式无效', 'haoui'));\n\n\t/*$options[] = array(\n\t\t'name' => __('文章段落缩进', 'haoui'),\n\t\t'id' => 'post_p_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'));*/\n\n\t$options[] = array(\n\t\t'name' => __('文章页尾版权提示', 'haoui'),\n\t\t'id' => 'post_copyright_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('文章页尾版权提示前缀', 'haoui'),\n\t\t'id' => 'post_copyright',\n\t\t'std' => __('未经允许不得转载:', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('自动添加关键字和描述', 'haoui'),\n\t\t'id' => 'site_keywords_description_s',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui').__('(开启后所有页面将自动使用主题配置的关键字和描述,具体规则可以自行查看页面源码得知)', 'haoui'));\n\t\t\n\t\t\n\n\n \n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('独立下载页', 'haoui'),\n\t\t'type' => 'heading' );\n $options[] = array(\n\t 'name' => __('========文章下载页配置========', 'haoui'));\n\t$options[] = array(\n\t\t'name' => '在线演示功能',\n\t\t'desc' => '使用前去页面新建页面,选择模板 <b><i>在线演示</b></i> 固定链接设为 <b>http://你的域名/demo</b> ');\t\n\t$options[] = array(\n\t 'name' => __('新窗口下载', 'haoui'),\n\t\t'id' => 'down_blank_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启(开启后跳转新窗口下载,关闭为弹窗下载。开启前请前往 <b><i>页面-新建页面-选择在线下载模板</b></i> 且固定链接设为 <b><i>http://你的域名/down</b></i> )', 'haoui'),\n\t\t'type' => 'checkbox');\n $options[] = array(\n\t\t'name' => __('背景(建议尺寸800x280)', 'haoui'),\n\t\t'id' => 'down_bg_src',\n\t\t'std' => $imagepath . 'down_bg.png',\n\t\t'type' => 'upload');\t\n\t$options[] = array(\n\t\t'name' => __('自定义下载说明', 'haoui'),\n\t\t'id' => 'down_sm',\n\t\t'std' => '本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有,若为付费资源,请在下载后24小时之内自觉删除,若作商业用途,请到原网站购买,由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系本站删除,我们将及时处理!',\n\t\t'desc' => __('代码', 'haoui'),\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'name' => __('自定义广告', 'haoui'),\n\t\t'id' => 'down_asb1',\n\t\t'std' => '',\n\t\t'desc' => __('代码', 'haoui'),\n\t\t'type' => 'textarea');\n\t $options[] = array(\n\t 'name' => __('========下载详情页配置========', 'haoui'));\n\t\t\n $options[] = array(\n\t\t'name' => __('右侧提示图(建议尺寸250x250)', 'haoui'),\n\t\t'id' => 'down_tishi_src',\n\t\t'std' => $imagepath . 'download.png',\n\t\t'type' => 'upload');\t\n\t$options[] = array(\n\t\t'name' => __('详情页广告', 'haoui'),\n\t\t'id' => 'down_asb2',\n\t\t'std' => '',\n\t\t'desc' => __('代码', 'haoui'),\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'name' => __('详情页下载说明', 'haoui'),\n\t\t'id' => 'down_xqsm',\n\t\t'std' => ' <p>1、本站提供的压缩包若无特别说明,解压密码均为<em>www.vizyw.com</em>。</p>\n <p>2、下载后文件若为压缩包格式,请安装7Z软件或者其它压缩软件进行解压。</p>\n\t\t<p>3、文件比较大的时候,建议使用下载工具进行下载,浏览器下载有时候会自动中断,导致下载错误。</p>\n\t\t<p>4、资源可能会由于内容问题被和谐,导致下载链接不可用,遇到此问题,请到文章页面进行反馈,我们会及时进行更新的。</p>\n\t\t<p>5、其他下载问题请自行搜索教程,这里不一一讲解。</p>',\n\t\t'desc' => __('代码', 'haoui'),\n\t\t'type' => 'textarea');\t\t\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('文章页左边栏', 'haoui'),\n\t\t'type' => 'heading' );\n \n\t\t\n\t$options[] = array(\n\t 'name' => __('文章左边栏是否开启', 'haoui'),\n\t\t'id' => 'left_sd_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'left_post_authordesc_s',\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('文章作者介绍', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'left_qrcode_s',\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('文章二维码', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'left_qrcode_url_s',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => 'https://viapi.cn/qrcode/?text=',\n\t\t'desc' => __('二维码接口', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('文章标签', 'haoui'),\n\t\t'id' => 'left_tags_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启(文章标签目前在文章左侧,手机端文章内容下)', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'id' => 'left_tags_style',\n\t\t'std' => \"left-tags-gray\",\n\t\t'type' => \"radio\",\n\t\t'class' => 'op-multicheck',\n\t\t'options' => array(\n\t\t\t'left-tags-gray' => __('默认样式', 'haoui'),\n\t\t\t'left-tags' => __('彩色标签', 'haoui')\n\t\t));\n\t$options[] = array(\n\t\t'name' => __('自定义广告', 'haoui'),\n\t\t'id' => 'left_asb_s',\n\t\t'std' => '',\n\t\t'desc' => __('代码', 'haoui'),\n\t\t'type' => 'textarea');\n\t\n\t\n // ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('新浪图床', 'haoui'),\n\t\t'type' => 'heading' );\n\t\n\t$options[] = array(\n\t 'name' => __('是否开启新浪图床上传媒体', 'haoui'),\n\t\t'id' => 'sinaimg_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t\n\t$options[] = array(\n\t\t'desc' => __('什么是新浪图床?这个功能是把你网站的图片媒体文件上传到新浪然后提取图片直链调用到你自己的文章内使用,有利于提高网站媒体的加载速度,所有图片将存储在你自己的微博账号之下。'));\n\t$options[] = array(\n\t\t'desc' => __('开启前请先打开 <b><i>action/sinaimg.php</i></b> 改成自己的微博账号,然后随便上传什么图片试一下,如果有问题看一下 <b><i>action</i></b> 目录下是否生成了 <b><i>sina_config.php</i></b> 文件,如果没有就说明账号没有获取成功,须将 <b><i>action</i></b> 目录设为可写(生成成功后可关闭可写)。如使用一段时间后出现上传出错或是无法上传等问题,删除 <b><i>sina_config.php</i></b> 重新获取一下即可,实在不行换个号'));\n\n\t// ======================================================================================================================\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('会员中心', 'haoui'),\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'id' => 'user_page_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启会员中心', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('选择会员中心页面', 'haoui'),\n\t\t'id' => 'user_page',\n\t\t'desc' => '如果没有合适的页面作为会员中心,你需要去新建一个页面再来选择',\n\t\t'options' => $options_pages,\n\t\t'type' => 'select');\n\n\t$options[] = array(\n\t\t'name' => __('选择找回密码页面', 'haoui'),\n\t\t'id' => 'user_rp',\n\t\t'desc' => '如果没有合适的页面作为找回密码页面,你需要去新建一个页面再来选择',\n\t\t'options' => $options_pages,\n\t\t'type' => 'select');\n\n\t$options[] = array(\n\t\t'name' => __('允许用户发布文章', 'haoui'),\n\t\t'id' => 'tougao_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('有新投稿邮件通知', 'haoui'),\n\t\t'id' => 'tougao_mail_send',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'desc' => __('投稿通知接收邮箱', 'haoui'),\n\t\t'id' => 'tougao_mail_to',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => __('禁止昵称关键字', 'haoui'),\n\t\t'desc' => __('一行一个关键字,用户昵称将不能使用或包含这些关键字,对编辑以下职位有效', 'haoui'),\n\t\t'id' => 'user_nickname_out',\n\t\t'std' => \"赌博\\n博彩\\n彩票\\n性爱\\n色情\\n做爱\\n爱爱\\n淫秽\\n傻b\\n妈的\\n妈b\\nadmin\\ntest\",\n\t\t'type' => 'textarea');\n\n\n\n\n\n\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('网站公告', 'haoui'),\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'id' => 'minicat_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'minicat_home_s',\n\t\t'std' => true,\n\t\t'desc' => __('在首页显示公告分类最新文章', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('首页模块前缀', 'haoui'),\n\t\t'id' => 'minicat_home_title',\n\t\t'desc' => '默认为:网站公告',\n\t\t'std' => '网站公告',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('选择分类设置为公告', 'haoui'),\n\t\t'desc' => __('选择一个使用公告展示模版,分类下文章将全文输出到公告类列表', 'haoui'),\n\t\t'id' => 'minicat',\n\t\t'options' => $options_categories,\n\t\t'type' => 'select');\n\n\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('首页焦点图', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'id' => 'focusslide_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('说明:默认为企业风格,全屏显示幻灯片(建议尺寸1900*500)。经典模式在3.5系列有些更改,一张非全屏banner(建议尺寸900*500)', 'haoui'));\n\t$options[] = array(\n\t\t'name' => __('样式', 'haoui'),\n\t\t'id' => 'banner_style',\n\t\t'std' => \"3\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t '3' => __('展示', 'haoui'),\n\t\t\t'2' => __('企业', 'haoui'),\n\t\t\t'1' => __('经典', 'haoui')\n\t\t));\n\t$options[] = array(\n\t\t'name' => __('排序', 'haoui'),\n\t\t'id' => 'focusslide_sort',\n\t\t'desc' => '默认:1 2 3 4 5',\n\t\t'std' => '1 2 3 4 5',\n\t\t'type' => 'text');\n\n\tfor ($i=1; $i <= 5; $i++) { \n\t\n\t$options[] = array(\n\t\t'desc' => '---------------------------------------');\t\n\t$options[] = array(\n\t\t'name' => __('图', 'haoui').$i,\n\t\t'id' => 'focusslide_src_'.$i,\n\t\t'desc' => __('背景图片,尺寸:', 'haoui').'1900*400或900*500',\n\t\t'std' => $imagepath . 'vieu.jpg',\n\t\t'type' => 'upload');\t\n\t$options[] = array(\n\t 'class' => 'op-multicheck',\n\t\t'id' => 'focusslide_src_zhanshi_'.$i,\n\t\t'desc' => __('展示图片'.$i.'(只在开启展示模式启用),尺寸:500*280 透明背景 .png,.gif', 'haoui'),\n\t\t'std' => $imagepath . 'zhanshi.png',\n\t\t'type' => 'upload');\n\t\t$options[] = array(\n\t\t\n\t\t'desc' => __('展示图位置'));\n\t$options[] = array(\n\t'class' => 'op-multicheck',\n\t\t'id' => 'focusslide_zsstyle_'.$i,\n\t\t'std' => \"1\",\n\t\t'type' => \"radio\",\n\t\t'options' => array(\n\t\t\t'1' => __('右侧', 'haoui'),\n\t\t\t'2' => __('左侧', 'haoui')\n\t\t));\t\n\t$options[] = array(\n\t\t'id' => 'focusslide_title_'.$i,\n\t\t'desc' => '标题',\n\t\t'std' => 'Vieu主题',\n\t\t'type' => 'text');\n\t\t\n\t$options[] = array(\n\t\t'id' => 'focusslide_text_'.$i,\n\t\t'desc' => '内容',\n\t\t'std' => '<h4>由唯爱网络原创开发,本站为Vieu主题唯一官方站</h4><h3>支持百度熊掌号,适用于垂直站点、科技博客、个人站,扁平化设计、简洁白色、超多功能配置、会员中心、直达链接、自动缩略图<br>Vieu主题基于WordPress程序,响应式布局支持电脑、平板和手机的完美展示</h3>',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'focusslide_button_'.$i,\n\t\t'desc' => '按钮1',\n\t\t'std' => '了解详情',\n\t\t'class' => 'op-multicheck',\n\t\t'type' => 'text');\t\n $multicheck_nums = array(\n 'primary' => '原始',\n 'default' => '默认',\n 'info' => '淡蓝',\n 'warning' => '橙色',\n 'danger' => '红色',\n\t\t'success' => '绿色'\n );\n $options[] = array(\n 'id' => 'focusslide_color_'.$i,\n\t\t'desc' => '按钮样式',\n\t\t'class' => 'op-multicheck',\n 'options' => $multicheck_nums,\n 'type' => 'select');\n\n\t$options[] = array(\n\t\t// 'name' => __('链接到', 'haoui'),\n\t\t'id' => 'focusslide_href_'.$i,\n\t\t'desc' => __('链接', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'std' => 'http://www.nicedowns.com',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'id' => 'focusslide_blank_'.$i,\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('新窗口打开', 'haoui'),\n\t\t'type' => 'checkbox');\n\t\n\t$options[] = array(\n\t\t'id' => 'focusslide_button_two_'.$i,\n\t\t'desc' => '按钮2',\n\t\t'std' => '了解详情',\n\t\t'type' => 'text');\t\n $options[] = array(\n 'id' => 'focusslide_color_two_'.$i,\n\t\t'desc' => '按钮样式',\n\t\t'class' => 'op-multicheck',\n 'options' => $multicheck_nums,\n 'type' => 'select');\n\n\t$options[] = array(\n\t\t// 'name' => __('链接到', 'haoui'),\n\t\t'id' => 'focusslide_href_two_'.$i,\n\t\t'desc' => __('链接', 'haoui'),\n\t\t'class' => 'op-multicheck',\n\t\t'std' => 'http://www.nicedowns.com',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'id' => 'focusslide_blank_two_'.$i,\n\t\t'std' => true,\n\t\t'class' => 'op-multicheck',\n\t\t'desc' => __('新窗口打开', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t}\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('侧栏随动', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('首页', 'haoui'),\n\t\t'id' => 'sideroll_index_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'sideroll_index',\n\t\t'std' => '1 2',\n\t\t'class' => 'mini',\n\t\t'desc' => __('设置随动模块,多个模块之间用空格隔开即可!默认:“1 2”,表示第1和第2个模块,建议最多3个模块 ', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('分类/标签/搜索页', 'haoui'),\n\t\t'id' => 'sideroll_list_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'sideroll_list',\n\t\t'std' => '1 2',\n\t\t'class' => 'mini',\n\t\t'desc' => __('设置随动模块,多个模块之间用空格隔开即可!默认:“1 2”,表示第1和第2个模块,建议最多3个模块 ', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('文章页', 'haoui'),\n\t\t'id' => 'sideroll_post_s',\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'id' => 'sideroll_post',\n\t\t'std' => '1 2',\n\t\t'class' => 'mini',\n\t\t'desc' => __('设置随动模块,多个模块之间用空格隔开即可!默认:“1 2”,表示第1和第2个模块,建议最多3个模块 ', 'haoui'),\n\t\t'type' => 'text');\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('独立页面', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('读者墙', 'haoui'),\n\t\t'id' => 'readwall_limit_time',\n\t\t'std' => 200,\n\t\t'class' => 'mini',\n\t\t'desc' => __('限制在多少月内,单位:月', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'id' => 'readwall_limit_number',\n\t\t'std' => 200,\n\t\t'class' => 'mini',\n\t\t'desc' => __('显示个数', 'haoui'),\n\t\t'type' => 'text');\n\n\t/*$options[] = array(\n\t\t'name' => __('页面左侧菜单设置', 'haoui'),\n\t\t'id' => 'page_menu',\n\t\t'options' => $options_pages,\n\t\t'type' => 'multicheck');*/\n\n\t$options[] = array(\n\t\t'name' => __('友情链接分类选择', 'haoui'),\n\t\t'id' => 'page_links_cat',\n\t\t'options' => $options_linkcats,\n\t\t'type' => 'multicheck');\n\n\t$options[] = array(\n\t\t'name' => __('网址导航标题下描述', 'haoui'),\n\t\t'id' => 'navpage_desc',\n\t\t'std' => '这里显示的是网址导航的一句话描述...',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('选择链接分类到网址导航', 'haoui'),\n\t\t'id' => 'navpage_cats',\n\t\t'options' => $options_linkcats,\n\t\t'type' => 'multicheck');\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('字符', 'haoui'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('首页最新发布标题', 'haoui'),\n\t\t'id' => 'index_list_title',\n\t\t'std' => __('最新发布', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('首页最新发布标题右侧', 'haoui'),\n\t\t'id' => 'index_list_title_r',\n\t\t'std' => '<a href=\"链接地址\">显示文字</a><a href=\"链接地址\">显示文字</a><a href=\"链接地址\">显示文字</a><a href=\"链接地址\">显示文字</a>',\n\t\t'type' => 'textarea');\n\t\t\n\t$options[] = array(\n\t\t'name' => __('文章隐藏内容提示', 'haoui'),\n\t\t'id' => 'collapse_title',\n\t\t'std' => __('阅读全文', 'haoui'),\n\t\t'type' => 'text');\n\t\t\n\t$options[] = array(\n\t\t'name' => __('评论标题', 'haoui'),\n\t\t'id' => 'comment_title',\n\t\t'std' => __('评论', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('评论框默认字符', 'haoui'),\n\t\t'id' => 'comment_text',\n\t\t'std' => __('你的评论可以一针见血', 'haoui'),\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('评论提交按钮字符', 'haoui'),\n\t\t'id' => 'comment_submit_text',\n\t\t'std' => __('提交评论', 'haoui'),\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => __('文章内全网VIP视频解析', 'haoui'),\n\t\t'id' => 'vieu_video_s',\n\t\t'std' => true,\n\t\t'desc' => '开启(视频解析接口支持全网VIP影视,文章内使用格式 <b><i> [video]视频播放地址[/video] </i></b> 【如腾讯视频的就是腾讯视频的视频播放地址。如https://v.qq.com/x/page/c0376z3bdo6.html】)',\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'name' => __('视频解析接口', 'haoui'),\n\t\t'id' => 'videoapi_url',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => 'http://www.viapi.cn/tv/jiexi.php?url=',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => __('公众号加密', 'haoui'),\n\t\t'desc' => '调用格式 <b><i> [gzhhide key=\"密码\"]加密内容[/gzhhide] </i></b> ');\n\t$options[] = array(\n\t\t'id' => 'gzhhide_title',\n\t\t'desc' => '隐藏提示',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => '抱歉!隐藏内容,请输入密码后可见!',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'desc' => __('详细提示内容'),\n\t\t'id' => 'gzhhide_box',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => '请打开微信扫描右边的二维码回复数字2018获取密码,也可以微信直接搜索“唯爱网络”关注微信公众号获取密码。',\n\t\t'type' => 'textarea');\t\n\t$options[] = array(\n\t\t'id' => 'gzhhide_code',\n\t\t'class' => 'op-multicheck',\n\t\t'std' => $imagepath . 'qrcode.png',\n\t\t'desc' => __('微信公众号二维码,建议图片尺寸:', 'haoui').'200x200px',\n\t\t'type' => 'upload');\n\n\t\t\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('社交', 'haoui'),\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'name' => __('此处填写内容移置文章页左边栏', 'haoui'));\n\n\t$options[] = array(\n\t\t'name' => __('微博', 'haoui'),\n\t\t'id' => 'weibo',\n\t\t'std' => 'http://www.nicedowns.com',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('腾讯QQ', 'haoui'),\n\t\t'id' => 'qq',\n\t\t'std' => '470000334',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('微信帐号', 'haoui'),\n\t\t'id' => 'wechat',\n\t\t'std' => '唯爱网络',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'wechat_qr',\n\t\t'std' => $imagepath . 'qrcode.png',\n\t\t'desc' => __('微信二维码,建议图片尺寸:', 'haoui').'200x200px',\n\t\t'type' => 'upload');\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('广告位', 'haoui'),\n\t\t'type' => 'heading' ); \n\t$options[] = array(\n\t\t'name' => __('全局右下角弹窗', 'haoui'),\n\t\t'id' => 'wintip_srollbar_s',\n\t\t'std' => false,\n\t\t'desc' => ' 显示',\n\t\t'type' => 'checkbox');\t\n\t$options[] = array(\n\t\t'id' => 'wintip_m',\n\t\t'std' => false,\n\t\t'desc' => '手机端不显示',\n\t\t'type' => 'checkbox');\t\n\t$options[] = array(\n\t\t'desc' => '时间/单位分钟',\n\t\t'id' => 'wintip_time',\n\t\t'std' => '10',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'desc' => '标题',\n\t\t'id' => 'wintip_title',\n\t\t'std' => 'Vieu3.3主题',\n\t\t'type' => 'text');\t\n\t$options[] = array(\n\t\t'desc' => '按钮文字',\n\t\t'id' => 'wintip_button',\n\t\t'std' => '了解一下',\n\t\t'type' => 'text');\t\n\t$options[] = array(\n\t\t'desc' => '跳转链接',\n\t\t'id' => 'wintip_url',\n\t\t'std' => 'http://www.nicedowns.com',\n\t\t'type' => 'text');\t\n\t$options[] = array(\n\t\t'id' => 'wintip_blank',\n\t\t'std' => false,\n\t\t'desc' => '新窗口打开',\n\t\t'type' => 'checkbox');\t\n\t$options[] = array(\n\t\t'desc' => __('内容'),\n\t\t'id' => 'wintip_asb',\n\t\t'std' => '专业打造轻量级个人企业风格博客主题!专注于前端开发,全站响应式布局自适应模板。',\n\t\t'type' => 'textarea');\t\n\t\t\n\t$options[] = array(\n\t\t'name' => __('文章页正文结尾文字广告', 'haoui'),\n\t\t'id' => 'ads_post_footer_s',\n\t\t'std' => false,\n\t\t'desc' => ' 显示',\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => '前标题',\n\t\t'id' => 'ads_post_footer_pretitle',\n\t\t'std' => '唯爱网络',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'desc' => '标题',\n\t\t'id' => 'ads_post_footer_title',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'desc' => '链接',\n\t\t'id' => 'ads_post_footer_link',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'id' => 'ads_post_footer_link_blank',\n\t\t'type' => \"checkbox\",\n\t\t'std' => true,\n\t\t'desc' => __('开启', 'haoui') .' ('. __('新窗口打开链接', 'haoui').')');\n\n\n\t$options[] = array(\n\t\t'name' => __('首页文章列表上', 'haoui'),\n\t\t'id' => 'ads_index_01_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_index_01',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_index_01_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('首页分页下', 'haoui'),\n\t\t'id' => 'ads_index_02_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_index_02',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_index_02_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('文章页正文上', 'haoui'),\n\t\t'id' => 'ads_post_01_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_post_01',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_post_01_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('文章页正文下', 'haoui'),\n\t\t'id' => 'ads_post_02_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_post_02',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_post_02_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('文章页评论上', 'haoui'),\n\t\t'id' => 'ads_post_03_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_post_03',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_post_03_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('分类页列表上', 'haoui'),\n\t\t'id' => 'ads_cat_01_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_cat_01',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_cat_01_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('标签页列表上', 'haoui'),\n\t\t'id' => 'ads_tag_01_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_tag_01',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_tag_01_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('搜索页列表上', 'haoui'),\n\t\t'id' => 'ads_search_01_s',\n\t\t'std' => false,\n\t\t'desc' => __('开启', 'haoui'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'desc' => __('非手机端', 'haoui').' '.$adsdesc,\n\t\t'id' => 'ads_search_01',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\t$options[] = array(\n\t\t'id' => 'ads_search_01_m',\n\t\t'std' => '',\n\t\t'desc' => __('手机端', 'haoui').' '.$adsdesc,\n\t\t'type' => 'textarea');\n\n\n\n\t// ======================================================================================================================\n\t$options[] = array(\n\t\t'name' => __('自定义代码', 'haoui'),\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'name' => __('自定义网站底部内容', 'haoui'),\n\t\t'desc' => __('该块显示在网站底部版权上方,可已定义放一些链接或者图片之类的内容。', 'haoui'),\n\t\t'id' => 'fcode',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('自定义CSS样式', 'haoui'),\n\t\t'desc' => __('位于</head>之前,直接写样式代码,不用添加&lt;style&gt;标签', 'haoui'),\n\t\t'id' => 'csscode',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('自定义头部代码', 'haoui'),\n\t\t'desc' => __('位于</head>之前,这部分代码是在主要内容显示之前加载,通常是CSS样式、自定义的<meta>标签、全站头部JS等需要提前加载的代码', 'haoui'),\n\t\t'id' => 'headcode',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('自定义底部代码', 'haoui'),\n\t\t'desc' => __('位于&lt;/body&gt;之前,这部分代码是在主要内容加载完毕加载,通常是JS代码', 'haoui'),\n\t\t'id' => 'footcode',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('网站统计代码', 'haoui'),\n\t\t'desc' => __('位于底部,用于添加第三方流量数据统计代码,如:Google analytics、百度统计、CNZZ、51la,国内站点推荐使用百度统计,国外站点推荐使用Google analytics', 'haoui'),\n\t\t'id' => 'trackcode',\n\t\t'std' => '',\n\t\t'type' => 'textarea');\n\n\n\n\n\n\n\n\t$options[] = array(\n\t\t'name' => __('百度熊掌号', 'haoui'),\n\t\t'type' => 'heading' );\n\n\t$options[] = array(\n\t\t'name' => __('百度熊掌号', 'haoui'),\n\t\t'id' => 'xzh_on',\n\t\t'std' => false,\n\t\t'desc' => ' 开启',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '百度熊掌号 Appid',\n\t\t'id' => 'xzh_appid',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '百度熊掌号 推送密钥 token',\n\t\t'id' => 'xzh_post_token',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('粉丝关注', 'haoui'),\n\t\t'id' => 'xzh_render_head',\n\t\t'std' => false,\n\t\t'desc' => ' 吸顶bar',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'class' => 'op-multicheck',\n\t\t'id' => 'xzh_render_body',\n\t\t'std' => true,\n\t\t'desc' => ' 文章段落间bar',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'class' => 'op-multicheck',\n\t\t'id' => 'xzh_render_tail',\n\t\t'std' => true,\n\t\t'desc' => ' 底部bar',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('添加JSON_LD数据', 'haoui'),\n\t\t'id' => 'xzh_jsonld_single',\n\t\t'std' => true,\n\t\t'desc' => ' 文章页',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'class' => 'op-multicheck',\n\t\t'id' => 'xzh_jsonld_page',\n\t\t'std' => false,\n\t\t'desc' => ' 页面',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('添加JSON_LD数据 - 不添加图片', 'haoui'),\n\t\t'id' => 'xzh_jsonld_img',\n\t\t'std' => false,\n\t\t'desc' => ' 开启',\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('新增文章实时推送', 'haoui'),\n\t\t'id' => 'xzh_post_on',\n\t\t'std' => false,\n\t\t'desc' => ' 开启 (使用此功能,你还需要开启本页中的 百度熊掌号 和 Appid以及token的设置)',\n\t\t'type' => 'checkbox');\n\n\t\n\t\n\n\n\t/**\n\t * For $settings options see:\n\t * http://codex.wordpress.org/Function_Reference/wp_editor\n\t *\n\t * 'media_buttons' are not supported as there is no post to attach items to\n\t * 'textarea_name' is set by the 'id' you choose\n\t */\n/*\n\t$wp_editor_settings = array(\n\t\t'wpautop' => true, // Default\n\t\t'textarea_rows' => 5,\n\t\t'tinymce' => array( 'plugins' => 'wordpress' )\n\t);\n\n\t$options[] = array(\n\t\t'name' => __('Default Text Editor', 'options_framework_theme'),\n\t\t'desc' => sprintf( __( 'You can also pass settings to the editor. Read more about wp_editor in <a href=\"%1$s\" target=\"_blank\">the WordPress codex</a>', 'options_framework_theme' ), 'http://codex.wordpress.org/Function_Reference/wp_editor' ),\n\t\t'id' => 'example_editor',\n\t\t'type' => 'editor',\n\t\t'settings' => $wp_editor_settings );\n\n*/\n\n\treturn $options;\n}", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Midtrans.', 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form. generated from `init_form_fields`\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }" ]
[ "0.7159061", "0.7022751", "0.67372566", "0.6723235", "0.6692813", "0.6684491", "0.6684491", "0.6684491", "0.6684491", "0.6684491", "0.6671828", "0.66435015", "0.66230845", "0.6606579", "0.6557367", "0.6557367", "0.6556103", "0.65409267", "0.6531412", "0.65183", "0.65162015", "0.6503699", "0.6470178", "0.6452897", "0.64482665", "0.64407086", "0.64356637", "0.6435467", "0.643435", "0.6428057", "0.64194375", "0.64160657", "0.6414563", "0.64039016", "0.6390566", "0.63891", "0.63761693", "0.6365143", "0.63600594", "0.63415873", "0.63328487", "0.63278204", "0.6317491", "0.63022923", "0.62943584", "0.62926096", "0.62925225", "0.6283881", "0.62837887", "0.62655807", "0.6256956", "0.6252121", "0.6244811", "0.62427914", "0.62422615", "0.6241716", "0.6239245", "0.62298423", "0.6220003", "0.62160367", "0.6207363", "0.6206925", "0.6205099", "0.6200898", "0.61991376", "0.619705", "0.61863595", "0.6185917", "0.6177582", "0.6167485", "0.61673325", "0.61634886", "0.61607677", "0.6157503", "0.61525106", "0.615251", "0.6150125", "0.6141502", "0.6135514", "0.6116713", "0.61164784", "0.61145073", "0.61134094", "0.61108273", "0.6101775", "0.61017203", "0.6098961", "0.6097509", "0.6092307", "0.6079845", "0.6079399", "0.6069526", "0.6069526", "0.6068643", "0.60661894", "0.6064574", "0.60638463", "0.6056541", "0.6048423", "0.6046895", "0.60418594" ]
0.0
-1
You will need it if you want your custom credit card form, Step 4 is about it
public function payment_fields(){ if ( $description = $this->get_description() ) { echo wpautop( wptexturize( $description ) ); } echo '<style>#payment_duration_field label.radio { display:inline-block;margin: .1em 2em 0 .05em !important;}</style>'; $option_keys = array_keys($this->options); woocommerce_form_field( 'payment_duration', array( 'type' => 'radio', 'class' => array('payment_duration form-row-wide'), //'label' => __('Payment Information', $this->domain), 'options' => $this->options, ), reset( $option_keys ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}", "public function creditCardPayment()\n {\n }", "public function payment_fields() {\n echo '<p><strong>Pay securely using your credit card</strong> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/visa.svg\" alt=\"Visa\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/mastercard.svg\" alt=\"Mastercard\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/discover.svg\" alt=\"Discover\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/amex.svg\" alt=\"Amex\" class=\"card-img\" width=\"32\"></p>';\n // Trying render payment form\n // Call orginal payment the Woocommerce\n $this->form();\n }", "function give_get_cc_form( $form_id ) {\n\n\tob_start();\n\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_before_cc_fields', $form_id );\n\t?>\n\t<fieldset id=\"give_cc_fields-<?php echo $form_id; ?>\" class=\"give-do-validate\">\n\t\t<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>\n\t\t<?php if ( is_ssl() ) : ?>\n\t\t\t<div id=\"give_secure_site_wrapper-<?php echo $form_id; ?>\">\n\t\t\t\t<span class=\"give-icon padlock\"></span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t<p id=\"give-card-number-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_number-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Card Number', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The (typically) 16 digits on the front of your credit card.', 'give' ) ); ?>\n\t\t\t\t<span class=\"card-type\"></span>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_number\" id=\"card_number-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-number give-input required\" placeholder=\"<?php _e( 'Card number', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-cvc-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_cvc-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'CVC', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" size=\"4\" autocomplete=\"off\" name=\"card_cvc\" id=\"card_cvc-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-cvc give-input required\" placeholder=\"<?php _e( 'Security code', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-name-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_name-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Cardholder Name', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The name of the credit card account holder.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"text\" autocomplete=\"off\" name=\"card_name\" id=\"card_name-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-name give-input required\" placeholder=\"<?php esc_attr_e( 'Cardholder Name', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, before expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_before_cc_expiration' );\n\t\t?>\n\t\t<p class=\"card-expiration form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_expiry-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Expiration', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The date your credit card expires, typically on the front of the card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"hidden\" id=\"card_exp_month-<?php echo $form_id; ?>\" name=\"card_exp_month\"\n\t\t\t class=\"card-expiry-month\"/>\n\t\t\t<input type=\"hidden\" id=\"card_exp_year-<?php echo $form_id; ?>\" name=\"card_exp_year\"\n\t\t\t class=\"card-expiry-year\"/>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_expiry\" id=\"card_expiry-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-expiry give-input required\" placeholder=\"<?php esc_attr_e( 'MM / YY', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, after expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_after_cc_expiration', $form_id );\n\t\t?>\n\t</fieldset>\n\t<?php\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_after_cc_fields', $form_id );\n\n\techo ob_get_clean();\n}", "function commerce_oz_migs_2p_submit_form($payment_method, $pane_values, $checkout_pane, $order) {\n \n//\t// dsm($payment_method, '$payment_method');\n//\t// dsm($checkout_pane);\n//\t// dsm($pane_values);\n//\t// dsm($order);\n \t \t \t\n // Include the Drupal Commerce credit card file for forms\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n \n\t$settings = _commweb_get_var('commerce_oz_gateway_' . $payment_method['gateway_provider']);\n \n// \tdsm($settings, '$settings');\n\n $form_params = array();\n $form_defaults = array();\n \n // Use CVV Field?\n if($settings['commerce_oz_use_cvv'] == 'cvv')\n {\n \t$form_params['code'] = '';\n }\n \n // Use Card Holder Name Field ?\n if($settings['commerce_oz_use_card_name'] == 'name')\n {\n \t$form_params['owner'] = 'Card Holder';\n }\n \n \n // set the defaults for testing\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n\n\t\t \t$form_defaults['number'] = $settings['commerce_oz_test_card_number'];\n\t\t \t$form_defaults['code'] = $settings['commerce_oz_test_card_cvv'];\n\t\t \t$form_defaults['exp_month'] = $settings['commerce_oz_test_card_exp_month'];\n\t\t \t$form_defaults['exp_year'] = $settings['commerce_oz_test_card_exp_year'];\n\t\t}\n\t\t\n\n $gateway = commerce_oz_load_gateway_provider($payment_method['gateway_provider']);\n \n \t$form = commerce_payment_credit_card_form($form_params, $form_defaults);\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/' . $payment_method['gateway_provider'] . '_68.png';\n\t\n\t$descText = '<a href=\"' . $gateway['owner_website'] . '\"><img src=\"' . $logopath . '\" /></a><br />Enter your payment details below and Click Continue.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n $form['commweb_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => t($payment_method['title']),\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \n\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n // // dsm($form);\n \n \n $form['credit_card']['number']['#description'] = t('<strong>Test Mode</strong> - You can only use the credit cards listed here to test in Test Mode. Valid card numbers are:\n \t\t<br /><br />Master:&nbsp;&nbsp;5123456789012346\n <br />Visa:&nbsp;&nbsp;&nbsp;&nbsp;4987654321098769\n <br />Amex:&nbsp;&nbsp;&nbsp;345678901234564\n <br />Diners:&nbsp;&nbsp;30123456789019\n <br /><br />All CommWeb Test Cards must use 05-2013 as the Expiry Date.');\n\n $form['credit_card']['exp_year']['#description'] = t('<strong>est Mode</strong> - All CommWeb Test Cards must use 05-2013 as the Expiry Date');\n\n $form['credit_card']['owner']['#description'] = t('<strong>Test Mode</strong> - Transactions do NOT require or use the Card Owner field. If you choose to request this information from your users it will however be stored with the transaction record.');\n\n \n \n // Provide a textfield to pass different Amounts to MIGS \n $form['credit_card']['test_amount'] = array(\n '#input' => TRUE,\n\n '#type' => 'textfield',\n '#size' => 6,\n '#maxlength' => 10,\n \t\t\n '#title' => t('Test Mode - Custom Amount'), \n '#default_value' => $order->commerce_order_total['und'][0]['amount'],\n '#disabled' => FALSE,\n '#description' => t('<strong>Test Mode</strong> - Update the Amount (in cents) sent for processing to change your desired transaction response.<br /> Valid amounts are <br />xxx00 = Approved\n <br />xxx05 = Declined. Contact Bank.\n <br />xxx10 = Transaction could not be processed.\n <br />xxx33 = Expired Card.\n <br />xxx50 = Unspecified Failure.\n <br />xxx51 = Insufficient Funds.\n <br />xxx68 = Communications failure with bank'),\n '#required' => FALSE, \n ); \n \n }\n \n \n \t$form['commweb_3p_head']['credit_card'] = $form['credit_card'];\n\tunset($form['credit_card']);\n\t\n//\t// dsm($form);\n\t\n return $form;\n \n}", "function edd_stripe_new_card_form() {\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'edds' ) );\n\t\tedd_print_errors();\n\t\treturn;\n\t}\n?>\n\n<p id=\"edd-card-name-wrap\">\n\t<label for=\"card_name\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Name on the Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\t<span class=\"edd-description\"><?php esc_html_e( 'The name printed on the front of your credit card.', 'edds' ); ?></span>\n\t<input type=\"text\" name=\"card_name\" id=\"card_name\" class=\"card-name edd-input required\" placeholder=\"<?php esc_attr_e( 'Card name', 'edds' ); ?>\" autocomplete=\"cc-name\" />\n</p>\n\n<div id=\"edd-card-wrap\">\n\t<label for=\"edd-card-element\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Credit Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\n\t<div id=\"edd-stripe-card-element\"></div>\n\t<div id=\"edd-stripe-card-errors\" role=\"alert\"></div>\n\n\t<p></p><!-- Extra spacing -->\n</div>\n\n<?php\n\t/**\n\t * Allow output of extra content before the credit card expiration field.\n\t *\n\t * This content no longer appears before the credit card expiration field\n\t * with the introduction of Stripe Elements.\n\t *\n\t * @deprecated 2.7\n\t * @since unknown\n\t */\n\tdo_action( 'edd_before_cc_expiration' );\n}", "function payment_fields() {\n if ($this->description) echo wpautop(wptexturize($this->description));\n ?>\n <ol class=\"my-list\">\n <li>Entrez votre numéro MTN Mobile Money dans le champ de formulaire ci-dessous</li>\n <li>Vous recevrez un message vous demandant de composer *126# et d'entrer votre code PIN</li>\n <li>Composez *126# et entrez votre code PIN pour confirmer votre paiement</li>\n <li>Si le paiement est effectué, votre commande sera automatiquement validé</li>\n </ol>\n\n <label for=\"\">Entrez votre numéro MTN Mobile Money</label>\n\n <input type=\"text\" name=\"gt_user_momo_number\" value=\"\"\n style=\"background-color: #fff; border-radius: 0px; color: #222;\"required class=\"form-controll\"\n placeholder=\"Enter your phone number\">\n <?php\n }", "public function payment_fields()\r\n {\r\n \r\n // ok, let's display some description before the payment form\r\n if ($this->description) {\r\n // display the description with <p> tags etc.\r\n echo wpautop(wp_kses_post($this->description));\r\n }\r\n \r\n // I will echo() the form, but you can close PHP tags and print it directly in HTML\r\n echo '<fieldset id=\"wc-' . esc_attr($this->id) . '-cc-form\" class=\"wc-credit-card-form wc-payment-form\" style=\"background:transparent;\">';\r\n \r\n // Add this action hook if you want your custom gateway to support it\r\n do_action('woocommerce_momo_form_start', $this->id);\r\n \r\n // I recommend to use inique IDs, because other gateways could already use #ccNo, #expdate, #cvc\r\n echo '<div class=\"form-row form-row-wide\"><label>Mobile Wallet Provider <span class=\"required\">*</span></label>\r\n\t\t\t\t<select id=\"epaygh_mobile_wallet_network\" name=\"epaygh_mobile_wallet_network\">\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"mtn\" selected>MTN</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"airtel\">Airtel</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"tigo\">Tigo</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"vodafone\">Vodafone</option>\r\n\t\t\t\t</select>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Mobile Wallet Number <span class=\"required\">*</span></label>\r\n\t\t\t\t<input id=\"epaygh_mobile_wallet_number\" name=\"epaygh_mobile_wallet_number\" type=\"tel\">\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Voucher </label>\r\n\t\t\t\t\t<input id=\"epaygh_payment_voucher\" name=\"epaygh_payment_voucher\" type=\"text\" autocomplete=\"off\"><br>\r\n\t\t\t\t\t<span class=\"required\">Leave empty if mobile network is not Vodafone</span>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"clear\"></div>';\r\n \r\n do_action('woocommerce_momo_form_end', $this->id);\r\n \r\n echo '<div class=\"clear\"></div></fieldset>';\r\n }", "public static function getCreditCardForm($order, $amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $data = null, $test_mode = false, $prefill = true)\n {\n $time = time();\n $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);\n $sim = new AuthorizeNetSIM_Form(\n array(\n 'x_amount' => $amount,\n 'x_fp_sequence' => $fp_sequence,\n 'x_fp_hash' => $fp,\n 'x_fp_timestamp' => $time,\n 'x_relay_response'=> \"TRUE\",\n 'x_relay_url' => $relay_response_url,\n 'x_login' => $api_login_id,\n 'x_order' => $order,\n //'x_test_request' => true,\n )\n );\n $hidden_fields = $sim->getHiddenFieldString();\n $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);\n $billing_address = (!empty($data['user'])) ? '<div class=\"row\"><label style=\"margin-left:30px; color:#ff8500\">BILLING ADDRESS</label><input type=\"checkbox\" style=\"margin-right:5px;\" id=\"billing\">Use my contact Address here</div>' : \"\"; //BILLING ADDRESS\n $exp_m = '';\n for($i = 1; $i<=12; $i++){\n $j = ($i < 10) ? \"0\".$i : $i;\n $exp_m .= \"<option value='{$j}'>{$j}</option>\";\n } \n\n $Y = date(\"Y\");\n $exp_y = '';\n for($i = $Y; $i < $Y+11; $i++){\n $val = substr($i, -2);\n $exp_y .= \"<option value='{$val}'>{$i}</option>\";\n }\n /*\n<div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <div class=\"date form_datetime b_date\" data-date=\"'.date(\"Y-m-d\").'\" data-date-format=\"mm/dd\" data-link-field=\"dtp_input1\">\n <input size=\"16\" type=\"text\" name=\"x_exp_date\" class=\"form-control1 form-control-bus date_input input-sm\" style=\"width:22%\" value=\"04/17\" readonly>\n <span class=\"add-on\" style=\"float:left;\"><i class=\"icon-th\"></i></span>\n <input type=\"hidden\" id=\"dtp_input1\" value=\"\" />\n </div>\n </div>\n */\n\n \n $form = '\n <div class=\"row payment\" style=\"width:100%;margin:0 auto;text-align:center\"><form method=\"post\" action=\"'.$post_url.'\">\n '.$hidden_fields.'\n <div class=\"row\" style=\"margin-left: -60px;\">\n <label>Card type</label>\n <select name=\"card_type\">\n <option value=\"Visa\">Visa</option>\n <option value=\"American Express\">American Express</option>\n <option value=\"Diners Club\">Diners Club</option>\n <option value=\"Discover\">Discover</option>\n <option value=\"MasterCard\">MasterCard</option>\n <option value=\"UATP Card\">UATP Card</option>\n </select>\n </div>\n <div class=\"row\">\n <label>Card Number</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" autocomplete=\"off\" size=\"25\" title=\"Card num\" data-toggle=\"popover\" data-content=\"Please enter your card number\" data-type=\"number\" name=\"x_card_num\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <select name=\"exp_m\" style=\"float:left\">'.$exp_m.'</select>\n <select name=\"exp_y\" style=\"float:left\">'.$exp_y.'</select>\n <input type=\"hidden\" name=\"x_exp_date\" value=\"\">\n </div>\n <div class=\"row\">\n <label style=\"margin-left: 20px;\">CCV</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" data-type=\"number\" autocomplete=\"off\" name=\"x_card_code\" value=\"\"></input>&nbsp;&nbsp;<a class=\"glyphicon glyphicon-question-sign\" data-toggle=\"modal\" data-target=\"#myModal\">\n</a>\n </div>\n <div class=\"row\">\n <label>First Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"first name\" name=\"x_first_name\" data-content=\"John\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Last Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"last name\" name=\"x_last_name\" data-content=\"Doe\" value=\"\"></input>\n </div>'.$billing_address.'\n <div class=\"row\">\n <label>Steet Address</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address\" name=\"x_address\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label></label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address2\" name=\"x_address2\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>City</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"city\" name=\"x_city\" data-content=\"Boston\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>State</label>\n <select class=\"text required form-control2 input-sm bfh-states\" id=\"state\" name=\"x_state\" data-country=\"country\"></select>\n </div>\n <div class=\"row\">\n <label>Zip Code</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"zip\" data-type=\"number\" name=\"x_zip\" data-content=\"02142\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Country</label>\n <select id=\"country\" name=\"x_country\" class=\"text required form-control2 input-sm bfh-countries\" data-country=\"US\"></select>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <label style=\"text-align:center; color:red; margin:0 auto\">amount: $'.$amount.'</label>\n </div>\n </div>\n <div class=\"row\" style=\"text-align:center\">\n<button type=\"button\" id=\"btn-pay\" class=\"noprint btn btn-primary \">Payment</button>\n </div>\n </form></div>';\n return $form;\n }", "public function payment_fields() {\n\t\t\t\t?>\n\t\t\t\t<div class=\"wc-gateway-havanao\">\n\t\t\t\t\t<p><?php _e( 'Please enter the mobile number you want to charge:' ); ?></p>\n\t\t\t\t\t<input type=\"text\" name=\"havanao_phone_number\" class=\"wc-gateway-havanao__phone-number\" />\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}", "function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "protected function buildCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $plugin = $this->plugin;\n $config = $plugin->getConfig();\n\n $amount = 0;\n // Loading order for loading total price and customer.\n $param = \\Drupal::routeMatch()->getParameter('commerce_order');\n if (isset($param)) {\n if(method_exists($param,'id')) {\n $order_id = $param->id();\n $order = Order::load($order_id);\n $getOrder = $order->getTotalPrice()->getNumber();\n $amount = number_format($getOrder, 2,'.','');\n }\n }\n \n // Build a month select list that shows months with a leading zero.\n $months = [];\n for ($i = 1; $i < 13; $i++) {\n $month = str_pad($i, 2, '0', STR_PAD_LEFT);\n $months[$month] = $month;\n }\n // Build a year select list that uses a 4 digit key with a 2 digit value.\n $current_year = date('Y');\n $years = [];\n for ($i = 0; $i < 14; $i++) {\n $years[$current_year + $i] = $current_year + $i;\n }\n\n $parcelas = [\n -1 => 'Escolha a quantidade de parcelas...',\n ];\n\n $element['#attributes']['class'][] = 'credit-card-form';\n // Placeholder for the detected card type. Set by validateCreditCardForm().\n $element['type'] = [\n '#type' => 'hidden',\n '#value' => '',\n ];\n $element['number'] = [\n '#type' => 'textfield',\n '#title' => t('Card number'),\n '#attributes' => [\n 'autocomplete' => 'off', \n 'id' => 'card-number'\n ],\n '#required' => TRUE,\n '#maxlength' => 19,\n '#size' => 20,\n '#suffix' => '<div id=\"show-card-brand\"></div>',\n ];\n\n $element['expiration'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__expiration'],\n ],\n ];\n\n $element['expiration']['month'] = [\n '#type' => 'select',\n '#title' => t('Month'),\n '#options' => $months,\n '#default_value' => date('m'),\n '#required' => TRUE,\n '#attributes' => ['id' => 'expiration-month'],\n ];\n\n $element['expiration']['divider'] = [\n '#type' => 'item',\n '#title' => '',\n '#markup' => '<span class=\"credit-card-form__divider\">/</span>',\n ];\n\n $element['expiration']['year'] = [\n '#type' => 'select',\n '#title' => t('Year'),\n '#options' => $years,\n '#default_value' => $current_year,\n '#required' => TRUE,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n '#attributes' => ['id' => 'expiration-year'],\n ];\n\n $element['expiration']['security_code'] = [\n '#type' => 'textfield',\n '#title' => t('CVV'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'security-code',\n ],\n '#required' => TRUE,\n '#maxlength' => 10,\n '#size' => 10,\n ];\n\n $element['card_holder_name'] = [\n '#type' => 'textfield',\n '#title' => t('Nome Impresso no cartão'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'holder-name',\n ],\n '#required' => TRUE,\n '#maxlength' => 60,\n '#size' => 60,\n ];\n\n $element['information'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__information'],\n ],\n ];\n\n $element['information']['cpf'] = [\n '#type' => 'textfield',\n '#title' => t('CPF do titular'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'cpf-card',\n ],\n '#required' => TRUE,\n '#maxlength' => 20,\n '#size' => 20,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n ];\n\n $element['information']['birth_date'] = [\n '#type' => 'date',\n '#title' => t('Data de aniversário'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'birth-card',\n ],\n '#date_date_format' => 'd/m/Y',\n '#required' => TRUE,\n ];\n\n $element['installments'] = [\n '#type' => 'select',\n '#title' => t('Deseja parcelar?'),\n '#options' => $parcelas,\n '#default_value' => $parcelas,\n '#required' => TRUE,\n '#attributes' => ['id' => 'installments'],\n '#validated' => TRUE,\n ];\n\n $element['sender_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'sender-hash'],\n ];\n\n $element['card_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-hash'],\n ];\n\n $element['card_brand'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-brand'],\n ];\n\n $element['#attached']['library'][] = 'commerce_pagseguro_v2/pagseguro_sandbox';\n\n $session = $this->getSession($config);\n // Passing the params session to the .js.\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['session'] = $session;\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['amount'] = $amount;\n\n return $element;\n }", "public function askForCard()\n {\n }", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) {\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc';\n $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE);\n $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree');\n $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']);\n $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null;\n $form['payment_method'] = array(\n '#type' => 'fieldset', \n '#title' => t('Payment Method Details'),\n );\n $form['payment_method']['ca_cardholder_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Cardholder Name'),\n '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '',\n );\n // NOTE: A hidden field is changable via Firebug. Value is not.\n // Because there's no validation, this would have allowed any user with access to this form\n // to change any credit card on the website for any user, providing they guess another ca_token.\n //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token);\n $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid);\n \n\n \n // Prepare the fields to include on the credit card form.\n $fields = array(\n 'code' => '',\n );\n\n // Add the credit card types array if necessary.\n $card_types = array_diff(array_values($payment['settings']['card_types']), array(0));\n if (!empty($card_types)) {\n $fields['type'] = $card_types;\n }\n \n $defaults = array(\n 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '',\n 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', \n 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', \n 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '',\n );\n \n // load oder\n $order = commerce_order_load($sub['order_id']);\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // get profile id\n $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value();\n \n // load customer profile\n $profile = commerce_customer_profile_load($profile_id);\n \n if (isset($profile->commerce_customer_address['und']['0']['first_name'])) {\n $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ;\n }\n if (isset($profile->commerce_customer_address['und']['0']['last_name'])) {\n $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) {\n // //company\n $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :'';\n }\n if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) {\n //state\n $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['premise'])) {\n //address 2\n $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['locality'])) {\n //city\n $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) {\n //postal code\n $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) {\n // address 1\n $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : '';\n }\n \n // Add the field related form elements.\n $form_state['customer_profile'] = $profile;\n // Attach address field to form\n field_attach_form('commerce_customer_profile', $profile, $form, $form_state);\n $form['commerce_customer_address']['#weight'] = '0';\n $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n \n \n $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate';\n $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit';\n return $form;\n}", "function TrialSignupForm(){\n\t $cardType = array(\n\t \t\"visa\"=>\"<img src='themes/attwiz/images/visa.png' height=30px></img>\",\n\t \t\"mc\"=>\"<img src='themes/attwiz/images/mastercard.jpeg' height=30px></img>\",\n\t \t\"amex\"=>\"<img src='themes/attwiz/images/ae.jpeg' height=30px></img>\",\n\t \t\"discover\"=>\"<img src='themes/attwiz/images/discover.jpeg' height=30px></img>\"\n\t );\n\t $monthArray = array();\n\t for($i =1;$i <=12; $i++){\n\t \t$monthArray[$i]=date('F',mktime(0,0,0,$i));\n\t }\n\t\t$yearArray = array();\n\t $currentYear = date('Y');\n\t\tfor($i =0;$i <=10; $i++){\n\t \t$yearArray[$currentYear+$i]=$currentYear+$i;\n\t }\n\t $trialExpiryDate = date('F-j-Y',mktime(0,0,0,date('n')+1,date('j'),date('Y')));\n\t $subscriptionInfo = \"<div id='SubscriptionInfo'><h2>Post-Trial Subscription Selection</h2>\n\t <p>Your 10 heatmaps will expire on $trialExpiryDate, at which time your account \n\t will be replenished with a new allocation of heatmap credits according to the \n\t subscription level you choose below. You may cancel your subscription any time \n\t before your trial period ends and your credit card will only be charged 1 dollar.</p></div>\";\n\t $subscriptionType = array(\n\t \t\t\"1\"=>\"Bronze - (10 heatmaps for $27.00 / month)\",\n\t \t\t\"2\"=>\"Silver - (50 heatmaps for $97.00 / month)\",\n\t \t\t\"3\"=>\"Gold - (200 heatmaps for $197.00 / month)\"\n\t );\n\t\t$whatsThis = '<span id=\"WhatsThis\"><a id=\"WhatsThisImage\" href=\"themes/attwiz/images/cvv.jpg\" title=\"What\\'s this?\">What\\'s this?</a></span>';\n\t\t$fields = new FieldList(\n\t\t\tnew TextField('FirstName', 'First Name'),\n\t\t\tnew TextField('LastName', 'Last Name'),\n\t\t\tnew TextField('Company', 'Company(optional)'),\n\t\t\tnew TextField('StreetAddress1', 'Street Address1'),\n\t\t\tnew TextField('StreetAddress2', 'Street Address2(optional)'),\n\t\t\tnew TextField('City', 'City'),\n\t\t\tnew TextField('State', 'State/Province'),\n\t\t\tnew TextField('PostalCode', 'Zip/Poatal Code'),\n\t\t\tnew CountryDropdownField('Country'),\n\t\t\tnew OptionsetField('CreditCardType','Credit Card Type',$cardType,'visa'),\n\t\t\tnew TextField('NameOnCard', 'Name On Card'),\n\t\t\tnew NumericField('CreditCardNumber', 'Credit Card Number'),\n\t\t\tnew PasswordField('CVVCode', 'Security/CVV Code'),\n\t\t\tnew LiteralField('WhatIsThis', $whatsThis),\n\t\t\tnew DropdownField('ExpirationMonth','Expiration Date',$monthArray),\n\t\t\tnew DropdownField('ExpirationYear','',$yearArray),\n\t\t\tnew LiteralField('SubscriptionInfo', $subscriptionInfo),\n\t\t\tnew OptionsetField('SubscriptionType','',$subscriptionType,'1'),\n\t\t\tnew CheckboxField('Agreement',' I understand that this is a recurring subscription and I will be billed monthly unless I cancel.')\n\t\t);\n\t // Create action\n\t $actions = new FieldList(\n\t\t\t$submit = new FormAction('doSignup','Start Trial')\n\t );\n\t $submit->setAttribute('src', 'themes/attwiz/images/button_startmytrialnow.gif');\n\t\t// Create action\n\t\t$validator = new RequiredFields(\n\t\t\t\t\t\t\t'FirstName',\n\t\t\t\t\t\t\t'LastName',\n\t\t\t\t\t\t\t'StreetAddress1',\n\t\t\t\t\t\t\t'City',\n\t\t\t\t\t\t\t'State',\n\t\t\t\t\t\t\t'PoatalCode',\n\t\t\t\t\t\t\t'Country',\n\t\t\t\t\t\t\t'CreditCardType',\n\t\t\t\t\t\t\t'NameOnCard',\n\t\t\t\t\t\t\t'CreditCardNumber',\n\t\t\t\t\t\t\t'CVVCode',\n\t\t\t\t\t\t\t'ExpirationMonth',\n\t\t\t\t\t\t\t'ExpirationYear',\n\t\t\t\t\t\t\t'SubscriptionInfo',\n\t\t\t\t\t\t\t'SubscriptionType'\n\t\t);\n\t\t\n\t\t$validator = null;\n\t \t$form = new Form($this, 'TrialSignupForm', $fields, $actions, $validator);\n\t \t$data = Session::get(\"FormInfo.Form_TrialSignupForm.data\"); \n\t\tif(is_array($data)) \n\t\t $form->loadDataFrom($data);\n\t\treturn $form;\t\t\n\t}", "protected function form()\n\t{\n\t\t$form = new Form(new Card);\n\n\t\t$form->footer(function ($footer) {\n\t\t\t// 去掉重置按钮\n\t\t\t$footer->disableReset();\n\t\t\t// 去掉查看\n\t\t\t$footer->disableViewCheck();\n\t\t\t// 去掉继续编辑按钮\n\t\t\t$footer->disableEditingCheck();\n\t\t\t// 去掉继续创建按钮\n\t\t\t$footer->disableCreatingCheck();\n\t\t});\n\n\t\t$form -> text('card', __('卡号'));\n\t\t$form -> text('password', __('密码'));\n\t\t//$form ->switch('type', __('类型'));\n\t\t$form->select('type', __('类型'))->options([1 => '天卡', 2 => '周卡', 3 => '月卡', 4 => '季卡', 5 => '半年卡', 6 => '年卡']);\n\t\t$states = [\n\t\t\t'on' => ['value' => 1, 'text' => '已充值', 'color' => 'danger'],\n\t\t\t'off' => ['value' => 0, 'text' => '未充值', 'color' => 'success'],\n\t\t];\n\t\t$form ->switch('consume', __('是否已充值'))->states($states);\n\t\t$form -> text('key', __('被充值Key'));\n\t\t$form -> datetime('consumetime', __('充值时间'))->default(date('Y-m-d H:i:s'));\n $states1 = [\n 'on' => ['value' => 0, 'text' => '未封卡', 'color' => 'success'],\n 'off' => ['value' => 1, 'text' => '被封卡', 'color' => 'danger'],\n ];\n $form ->switch('beifeng', __('是否被封'))->states($states1);\n\n\t\treturn $form;\n\t}", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<p class=\"form-row form-row-wide\">\n\t\t\t<label for=\"social-security-number\">\n\t\t\t\t<?php echo __( 'Social Security Number', 'payex-woocommerce-payments' ); ?>\n\t\t\t\t<abbr class=\"required\">*</abbr>\n\t\t\t</label>\n\t\t\t<input type=\"text\" class=\"input-text required-entry\" name=\"social-security-number\"\n\t\t\t\t id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t</p>\n\t\t<?php\n\t}", "function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}", "function display_card_form($name){\n?>\n<form action='../model/process.php' method='post'>\n<table border='0' width='100%' cellspacing='0'>\n <tr>\n <th colspan='2' bgcolor=\"#cccccc\">Credit Card Details</th>\n </tr>\n <tr>\n <td align='right'>Type:</td>\n <td>\n <select name='card_type'>\n <option value='VISA'>VISA</option>\n <option value='MasterCard'>MasterCard</option>\n <option value='American Express'>American Express</option>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Number:</td>\n <td>\n <input type='text' name='card_number' value='' maxlength='16' size='40'>\n </td>\n </tr>\n <tr>\n <td align='right'>AMEX code (if required):</td>\n <td>\n <input type='text' name='amex_code' value='' maxlength='4' size='4'>\n </td>\n </tr>\n <tr>\n <td align='right'>Expiry Date:</td>\n <td>Month\n <select name='card_month'>\n <option value='01'>01</option>\n <option value='02'>02</option>\n <option value='03'>03</option>\n <option value='04'>04</option>\n <option value='05'>05</option>\n <option value='06'>06</option>\n <option value='07'>07</option>\n <option value='08'>08</option>\n <option value='09'>09</option>\n <option value='10'>10</option>\n <option value='11'>11</option>\n <option value='12'>12</option>\n </select>\n Year\n <select name='card_year'>\n <?php\n for ($year=date('Y'); $year<date('Y')+10; $year++) {\n echo '<option value=\"' . $year . '\">' . $year . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Name on Card:</td>\n <td>\n <input type='text' name='card_name' value='<?php echo $name; ?>'\n maxlength='40' size='40'>\n </td>\n </tr>\n <tr>\n <td colspan='2' align='center'>\n <p><strong>Please press <em>Purchase</em> to confirm your purchase, or\n <em>Continue Shopping</em> to add or remove items.</em></strong></p>\n <?php display_form_button('purchase', 'Purchase These Items'); ?>\n </td>\n </tr>\n </form>\n<?\n}", "public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\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$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}", "function getFormCC($confirmation)\n {\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_OWNER . '</div>',\n 'field' => '<span id=\"card-owner-field\"></span><span id=\"card-owner-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_NUMBER . '</div>',\n 'field' => '<span id=\"card-number-field\"></span><span id=\"card-number-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_EXPIRY . '</div>',\n 'field' => '<span class=\"paymill-expiry\"><span id=\"card-expiry-month-field\"></span>&nbsp;<span id=\"card-expiry-year-field\"></span></span><span id=\"card-expiry-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC . '<span class=\"tooltip\" title=\"' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC_TOOLTIP . '\">?</span></div>',\n 'field' => '<span id=\"card-cvc-field\" class=\"card-cvc-row\"></span><span id=\"card-cvc-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'field' => '<form id=\"paymill_form\" action=\"' . xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '\" method=\"post\" style=\"display: none;\"></form>'\n )\n );\n \n return $confirmation;\n }", "public function js_credit_card_scriptchangecard()\n\t{\n\t\t// with radio buttons, suitable for form use\n\t\treturn \"\n\t\tfunction ChangeCard(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tout_txt = '<table width=\\\"100%\\\"><tr>';\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tchecked = i==0?' CHECKED':'';\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tcard_id = cardlist[val][code][2];\n\t\t\t\t\t\tpayment_gateway_id = cardlist[val][code][3];\n\n\t\t\t\t\t\tout_txt += '<td height=50><input type=\\\"radio\\\" name=\\\"payment_methods\\\" id=\\\"card_'+ code +'\\\" value=\\\"'+ card_id + \\\"%%\\\" + payment_gateway_id + \\\"%%\\\" + code +'\\\" align=\\\"absmiddle\\\"'+ checked +'> <label for=\\\"card_'+ code +'\\\" onclick=\\\"document.getElementById(\\'card_' + code + '\\').click();\\\">';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (cur_card[1] != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '<img src=\\\"/images/'+ cur_card[1] +'\\\" align=\\\"absmiddle\\\" alt=\\\"'+ cur_card[0] +'\\\" title=\\\"'+ cur_card[0] +'\\\"></lable></td>';\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\tout_txt += '<label for=\\\"card_'+ code +'\\\">'+ cur_card[0] +'</lable></td>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i%2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '</tr><tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif (i%2)\n\t\t\t\t\t{\n\t\t\t\t\t\tout_txt += '<td></td>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tobj.innerHTML = out_txt+'</tr></table>';\n\t\t\t}\n\t\t}\n\n\t\tfunction HideCard(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tout_txt = '<input type=\\\"hidden\\\" name=\\\"payment_methods\\\" id=\\\"card_'+ code +'\\\" value=\\\"'+ code +'\\\">';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tobj.innerHTML = out_txt;\n\t\t\t}\n\t\t}\n\n\t\tfunction ChangeCardNoRadio(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tout_txt = '';\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tvar i = 0;\n\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tif (cur_card[1] != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '<img width=\\\"60\\\" src=\\\"/images/'+ cur_card[1] +'\\\" align=\\\"absmiddle\\\" alt=\\\"'+ cur_card[0] +'\\\" title=\\\"'+ cur_card[0] +'\\\">&nbsp;';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tobj.innerHTML = out_txt;\n\t\t\t}\n\t\t}\n\n\t\tfunction InitCard(obj)\n\t\t{\n\t\t\tfor (var i in cardlist)\n\t\t\t{\n\t\t\t\tobj.options[obj.options.length]=new Option(cardlist[i][0], i);\n\t\t\t}\n\t\t}\";\n\t}", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "public function payment_fields() {\n\n $cc_form = new WC_Payment_Gateway_CC;\n $cc_form->id = $this->id;\n $cc_form->supports = $this->supports;\n $this->cc_form = $cc_form;\n $this->images_dir = plugin_dir_url(__FILE__).'../assets/images/';\n \n $form_template = realpath(dirname(__FILE__)).'/../templates/payment_form.php'; \n include_once($form_template); \n }", "function print_direct_payment_form($amount = 0, $description = '', $currency = '', $customencrypted = '', $returnurl = '')\n {\n global $ilance, $ilconfig, $headinclude;\n\t\t$ts = time();\n\t\t$sess_id = md5(rand());\n\t\t$_SESSION['ilancedata']['user']['ts'] = $ts;\n\t\t$order_id = $customencrypted;\n\t\t$amount = str_replace(array(',', '.'), '', sprintf(\"%01.2f\", $ilance->currency->string_to_number($amount)));\n\t\t$sig = md5($ilconfig['platnosci_pos_id'] . $sess_id . $ilconfig['platnosci_pos_auth_key'] . $amount . $description . $order_id . $_SESSION['ilancedata']['user']['firstname'] . $_SESSION['ilancedata']['user']['lastname'] . $_SESSION['ilancedata']['user']['address'] . $_SESSION['ilancedata']['user']['city'] . $_SESSION['ilancedata']['user']['postalzip'] . $_SESSION['ilancedata']['user']['email'] . IPADDRESS . $ts . $ilconfig['platnosci_pos_key1']);\n\t\t$html = '<form action=\"https://www.platnosci.pl/paygw/ISO/NewPayment/xml\" method=\"POST\" name=\"payform\">\n<input type=\"hidden\" name=\"first_name\" value=\"' . $_SESSION['ilancedata']['user']['firstname'] . '\">\n<input type=\"hidden\" name=\"last_name\" value=\"' . $_SESSION['ilancedata']['user']['lastname'] . '\">\n<input type=\"hidden\" name=\"email\" value=\"' . $_SESSION['ilancedata']['user']['email'] . '\">\n<input type=\"hidden\" name=\"street\" value=\"' . $_SESSION['ilancedata']['user']['address'] . '\">\n<input type=\"hidden\" name=\"city\" value=\"' . $_SESSION['ilancedata']['user']['city'] . '\">\n<input type=\"hidden\" name=\"post_code\" value=\"' . $_SESSION['ilancedata']['user']['postalzip'] . '\">\n<input type=\"hidden\" name=\"order_id\" value=\"' . $customencrypted . '\">\n<input type=\"hidden\" name=\"pos_id\" value=\"' . $ilconfig['platnosci_pos_id'] . '\">\n<input type=\"hidden\" name=\"pos_auth_key\" value=\"' . $ilconfig['platnosci_pos_auth_key'] . '\">\n<input type=\"hidden\" name=\"session_id\" value=\"' . $sess_id . '\">\n<input type=\"hidden\" name=\"amount\" value=\"' . $amount . '\">\n<input type=\"hidden\" name=\"desc\" value=\"' . $description . '\">\n<input type=\"hidden\" name=\"client_ip\" value=\"' . IPADDRESS . '\">\n<input type=\"hidden\" name=\"js\" value=\"1\">';\n\t\t\t\t/*\n\t\t\t\t * <input type=\"hidden\" name=\"ts\" value=\"'.$ts.'\">\n\t\t\t\t<input type=\"hidden\" name=\"sig\" value=\"'.$sig.'\">\n\t\t\t\t */\n\t\t\t\t$headinclude .= '<script type=\"text/javascript\">\n<!--\ndocument.forms[\\'payform\\'].js.value=1;\n-->\n</script>';\n return $html; \n }", "function payment_fields() { \n\n\t\tif($this->description) echo '<p>'.$this->description.'</p>';\n\n\t\tif('veritrans_direct'==$this->select_veritrans_payment) : ?>\t\n <p class=\"form-row validate-required\" id=\"veritrans_credit_card_field\">\n <label for=\"veritrans_credit_card_field\">\n <?php _e('Credit Card Number'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <input type=\"text\" class=\"input-text veritrans_credit_card\" maxlength=\"16\">\n </p>\n\n <p class=\"form-row\" id=\"veritrans_card_exp_month_field\">\n <label for=\"veritrans_card_exp_month_field\">\n <?php _e('Expiration Date - Month', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <select class=\"veritrans_card_exp_month\">\n <?php $month_list = array(\n '01' => '01 - January',\n '02' => '02 - February',\n '03' => '03 - March',\n '04' => '04 - April',\n '05' => '05 - May',\n '06' => '06 - June',\n '07' => '07 - July',\n '08' => '08 - August',\n '09' => '09 - September',\n '10' => '10 - October',\n '11' => '11 - November',\n '12' => '12 - December'\n ); ?>\n <option value=\"\">--</option>\n <?php foreach( $month_list as $month => $name ) : ?>\n <option value=\"<?php echo $month; ?>\"><?php echo $name; ?></option>\n <?php endforeach; ?>\n </select>\n </p>\n\n <p class=\"form-row\" id=\"veritrans_card_exp_year_field\">\n <label for=\"veritrans_card_exp_year_field\">\n <?php _e('Expiration Date - Year', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <select class=\"veritrans_card_exp_year\">\n <option value=\"\">--</option>\n <?php $years = range( date(\"Y\"), date(\"Y\") + 14 );\n foreach( $years as $year ) : ?>\n <option value=\"<?php echo $year; ?>\"><?php echo $year; ?></option>\n <?php endforeach; ?>\n </select>\n </p>\n\n <p class=\"form-row validate-required\" id=\"veritrans_security_field\" maxlength=\"3\">\n <label for=\"veritrans_security_field\">\n <?php _e('Security Code', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\"><a target=\"_blank\" href=\"https://www.veritrans.co.id/payment-help.html\">[?]</a></abbr>\n </label>\n <input type=\"text\" class=\"input-text veritrans_security\">\n </p>\n\n <input type=\"text\" name=\"veritrans_token_id\" class=\"hide\" style=\"display:none\">\n <?php endif; ?>\n <?php }", "public function creditCardProvider()\n\t{\n\t\treturn [\n\t\t\t'null_test' => [\n\t\t\t\t'amex',\n\t\t\t\tnull,\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'random_test' => [\n\t\t\t\t'amex',\n\t\t\t\t$this->generateCardNum('37', 16),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'invalid_type' => [\n\t\t\t\t'shorty',\n\t\t\t\t'1111 1111 1111 1111',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'invalid_length' => [\n\t\t\t\t'amex',\n\t\t\t\t'',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'not_numeric' => [\n\t\t\t\t'amex',\n\t\t\t\t'abcd efgh ijkl mnop',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'bad_length' => [\n\t\t\t\t'amex',\n\t\t\t\t'3782 8224 6310 0051',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'bad_prefix' => [\n\t\t\t\t'amex',\n\t\t\t\t'3582 8224 6310 0051',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'amex1' => [\n\t\t\t\t'amex',\n\t\t\t\t'3782 8224 6310 005',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'amex2' => [\n\t\t\t\t'amex',\n\t\t\t\t'3714 4963 5398 431',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub1' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t'3056 9309 0259 04',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersculb2' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t'3852 0000 0232 37',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover1' => [\n\t\t\t\t'discover',\n\t\t\t\t'6011 1111 1111 1117',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover2' => [\n\t\t\t\t'discover',\n\t\t\t\t'6011 0009 9013 9424',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb1' => [\n\t\t\t\t'jcb',\n\t\t\t\t'3530 1113 3330 0000',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb2' => [\n\t\t\t\t'jcb',\n\t\t\t\t'3566 0020 2036 0505',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard1' => [\n\t\t\t\t'mastercard',\n\t\t\t\t'5555 5555 5555 4444',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard2' => [\n\t\t\t\t'mastercard',\n\t\t\t\t'5105 1051 0510 5100',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa1' => [\n\t\t\t\t'visa',\n\t\t\t\t'4111 1111 1111 1111',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa2' => [\n\t\t\t\t'visa',\n\t\t\t\t'4012 8888 8888 1881',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa3' => [\n\t\t\t\t'visa',\n\t\t\t\t'4222 2222 2222 2',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort1' => [\n\t\t\t\t'dankort',\n\t\t\t\t'5019 7170 1010 3742',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay1' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay2' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 17),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay3' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay4' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay5' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(63, 19),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'carteblanche1' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(300, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche2' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(301, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche3' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(302, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche4' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(303, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche5' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(304, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche6' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(305, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche7' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(306, 14),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'dinersclub3' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(300, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub4' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(301, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub5' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(302, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub6' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(303, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub7' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(304, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub8' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(305, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub9' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(309, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub10' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(36, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub11' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(38, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub12' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(39, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub13' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(54, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub14' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(55, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub15' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(300, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub16' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(301, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub17' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(302, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub18' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(303, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub19' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(304, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub20' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(305, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub21' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(309, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub22' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(36, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub23' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(38, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub24' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(39, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub25' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(54, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub26' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(55, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover3' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(6011, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover4' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(622, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover5' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(644, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover6' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(645, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover7' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(656, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover8' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(647, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover9' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(648, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover10' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(649, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover11' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(65, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover12' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(6011, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover13' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(622, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover14' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(644, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover15' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(645, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover16' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(656, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover17' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(647, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover18' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(648, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover19' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(649, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover20' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(65, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment1' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment2' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 17),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment3' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment4' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb1' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(352, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb2' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(353, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb3' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(354, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb4' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(355, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb5' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(356, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb6' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(357, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb7' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(358, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro1' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro2' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro3' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro4' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro5' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro6' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro7' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro8' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro9' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro10' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro11' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro12' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro13' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro14' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro15' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro16' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro17' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro18' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro19' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro20' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro21' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro22' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro23' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro24' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro25' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro26' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro27' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro28' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro29' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro30' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro31' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro32' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro33' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro34' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro35' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro36' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro37' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro38' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro39' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro40' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro41' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro42' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro43' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro44' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro45' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro46' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro47' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro48' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro49' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro50' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro51' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro52' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro53' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro54' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro55' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro56' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro57' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro58' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro59' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro60' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro61' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro62' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro63' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro64' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro65' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro66' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro67' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro68' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro69' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro70' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro71' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro72' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro73' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro74' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro75' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro91' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro92' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro93' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro94' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro95' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro96' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro97' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro98' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro99' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro100' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro101' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro102' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro103' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro104' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro105' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro106' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro107' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro108' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro109' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro110' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro111' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro112' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro113' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro114' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro115' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro116' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro117' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro118' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro119' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro120' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort1' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(5019, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort2' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4175, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort3' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4571, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort4' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir1' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2200, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir2' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2201, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir3' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2202, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir4' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2203, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir5' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2204, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard1' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(51, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard2' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(52, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard3' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(53, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard4' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(54, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard5' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(55, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard6' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(22, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard7' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(23, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard8' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(24, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard9' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(25, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard10' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(26, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard11' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(27, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa1' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa2' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa3' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'uatp' => [\n\t\t\t\t'uatp',\n\t\t\t\t$this->generateCardNum(1, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve1' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(506, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve2' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(650, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve3' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(506, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve4' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(650, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'cibc1' => [\n\t\t\t\t'cibc',\n\t\t\t\t$this->generateCardNum(4506, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'rbc1' => [\n\t\t\t\t'rbc',\n\t\t\t\t$this->generateCardNum(45, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'tdtrust' => [\n\t\t\t\t'tdtrust',\n\t\t\t\t$this->generateCardNum(589297, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'scotia1' => [\n\t\t\t\t'scotia',\n\t\t\t\t$this->generateCardNum(4536, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'bmoabm1' => [\n\t\t\t\t'bmoabm',\n\t\t\t\t$this->generateCardNum(500, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'hsbc' => [\n\t\t\t\t'hsbc',\n\t\t\t\t$this->generateCardNum(56, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'hsbc' => [\n\t\t\t\t'hsbc',\n\t\t\t\t$this->generateCardNum(57, 16),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t];\n\t}", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function give_donation_form_validate_cc() {\n\n\t$card_data = give_get_donation_cc_info();\n\n\t// Validate the card zip.\n\tif ( ! empty( $card_data['card_zip'] ) ) {\n\t\tif ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) {\n\t\t\tgive_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) );\n\t\t}\n\t}\n\n\t// Ensure no spaces.\n\tif ( ! empty( $card_data['card_number'] ) ) {\n\t\t$card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no \"+\" signs.\n\t\t$card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces.\n\t}\n\n\t// This should validate card numbers at some point too.\n\treturn $card_data;\n}", "function show_my_text_on_checkout() {\n echo '<p>All credit card details are processed and stored securely via Stripe.</p>'; \n}", "function payment_fields() {\n?>\n\t\t<?php if ($this->tran_mode=='sandbox') : ?><p><?php _e('TEST MODE/SANDBOX ENABLED', WC_Authorize_SIM::TEXT_DOMAIN); ?></p><?php endif; ?>\n\t\t<?php if ($this->description) : ?><p><?php echo wpautop(wptexturize($this->description)); ?></p><?php endif; ?>\n<?php\n\n\t}", "function give_show_purchase_form( $form_id, $args ) {\n\n\t$payment_mode = give_get_chosen_gateway( $form_id );\n\n\tif ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {\n\t\t$form_id = $_POST['give_form_id'];\n\t}\n\n\t/**\n\t * Fire before donation form render.\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_payment_fields_top', $form_id );\n\n\tif ( give_can_checkout() && isset( $form_id ) ) {\n\n\t\t/**\n\t\t * Fires while displaying donation form, before registration login.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_register_login', $form_id, $args );\n\n\t\t/**\n\t\t * Fire when register/login form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_register_login_fields', $form_id, $args );\n\n\t\t/**\n\t\t * Fire when credit card form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_cc_form', $form_id, $args );\n\n\t\t// Load the credit card form and allow gateways to load their own if they wish.\n\t\tif ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {\n\t\t\t/**\n\t\t\t * Fires while displaying donation form, credit card form fields for a given gateway.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( \"give_{$payment_mode}_cc_form\", $form_id, $args );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires while displaying donation form, credit card form fields.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( 'give_cc_form', $form_id, $args );\n\t\t}\n\n\t\t/**\n\t\t * Fire after credit card form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_after_cc_form', $form_id, $args );\n\n\t} else {\n\t\t/**\n\t\t * Fire if user can not donate.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_no_access', $form_id );\n\n\t}\n\n\t/**\n\t * Fire after donation form rendered.\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_payment_fields_bottom', $form_id, $args );\n}", "public function payment_fields() {\n\t\t$description = $this->get_description();\n\n\t\tif ( 'yes' == $this->sandbox ) {\n\t\t\t$description .= ' ' . sprintf( __( 'TEST MODE ENABLED. Use a test card: %s', 'woocommerce' ), '<a href=\"https://www.simplify.com/commerce/docs/tutorial/index#testing\">https://www.simplify.com/commerce/docs/tutorial/index#testing</a>' );\n\t\t}\n\n\t\tif ( $description ) {\n\t\t\techo wpautop( wptexturize( trim( $description ) ) );\n\t\t}\n\t}", "public function gateway_cc_form()\n {\n // register the action to remove default CC form\n return;\n }", "public function init_form_fields(){\n \n $this->form_fields = apply_filters( 'wc_pay_on_credit_form_fields', array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Pay On Credit', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title for the payment method the customer sees during checkout.', $this->domain ),\n 'default' => __( 'Pay On Credit', $this->domain ),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __( 'Split your cost over a period and pay', $this->domain ),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '', // Empty by default\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'description' => __( 'Choose whether order status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'class' => 'wc-enhanced-select',\n 'options' => wc_get_order_statuses()\n ),\n 'status_text' => array(\n 'title' => __( 'Order Status Text', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'Set the text for the selected order status.', $this->domain ),\n 'default' => __( 'Order is completed', $this->domain ),\n 'desc_tip' => true,\n ),\n ) );\n }", "function payment_fields() {\n\t\t\tif ( $this->description ) echo wpautop( wptexturize( $this->description ) );\n\t\t\tdo_action( 'tgm_jigoshop_payment_fields' ); // allow for insertion of custom code if needed\n\t\t}", "public function payment_fields() {\n\t\t$message = $this->get_sandbox_form_message( $this->get_transaction_address( 'country' ) );\n\t\twc_get_template(\n\t\t\t'sandbox-checkout-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_sandbox_mode' => $this->is_sandbox_mode,\n\t\t\t\t'message' => $message,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\t$description = $this->get_description();\n\t\tif ( isset( $description ) ) {\n\t\t\techo wp_kses_post( wpautop( wptexturize( $description ) ) );\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'debit-card/payment-form.php',\n\t\t\tarray(\n\t\t\t\t'cart_total' => $this->get_order_total(),\n\t\t\t\t'id' => $this->id,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\tparent::checkout_rate_conversion( WC_EBANX_Constants::CURRENCY_CODE_MXN );\n\n\t\twc_get_template(\n\t\t\t'bacen-international-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_international' => $this->is_international(),\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\t}", "function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}", "public function payment_fields() {\n \n\t\t\n \n\t\t}", "function honeycomb_credit() {\n\t\t?>\n\t\t<div class=\"site-info\">\n\t\t\t<?php echo esc_html( apply_filters( 'honeycomb_copyright_text', $content = '&copy; ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>\n\t\t\t<?php if ( apply_filters( 'honeycomb_credit_link', true ) ) { ?>\n\t\t\t<br /> <?php echo __(sprintf( esc_attr__( '%1$s powered by %2$s.', 'honeycomb' ), 'Honeycomb', '<a href=\"https://wp-property-hive.com\" title=\"Property Hive - The Leading WordPress Platform For Estate Agency Websites\" rel=\"author\">Property Hive</a>' ), 'propertyhive'); ?>\n\t\t\t<?php } ?>\n\t\t</div><!-- .site-info -->\n\t\t<?php\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 }", "public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {\n\t\t$number = str_replace(' ','',$number);\n\t\t$number = trim($number);\n\n\t\t$this->Param('name', $name, 'credit_card');\n\t\t$this->Param('card_num', $number, 'credit_card');\n\t\t$this->Param('exp_month', $exp_month, 'credit_card');\n\t\t$this->Param('exp_year', $exp_year, 'credit_card');\n\t\tif($security_code) {\n\t\t\t$this->Param('cvv', $security_code, 'credit_card');\n\t\t}\n\n\t\treturn true;\n\t}", "public function CreditCard($name, $number, $exp_month, $exp_year, $security_code = FALSE) {\n\t\t$number = str_replace(' ','',$number);\n\t\t$number = trim($number);\n\n\t\t$this->Param('name', $name, 'credit_card');\n\t\t$this->Param('card_num', $number, 'credit_card');\n\t\t$this->Param('exp_month', $exp_month, 'credit_card');\n\t\t$this->Param('exp_year', $exp_year, 'credit_card');\n\t\tif($security_code) {\n\t\t\t$this->Param('cvv', $security_code, 'credit_card');\n\t\t}\n\n\t\treturn true;\n\t}", "function init_form_fields() {\n /**\n * Build array of configurations that will be displayed on Admin Panel\n */\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'acquring_bank' => array(\n 'title' => __( 'Acquiring Bank', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Acquiring Bank', 'midtrans-woocommerce' ),\n 'description' => __( 'You should leave it empty, it will be auto configured. </br> Alternatively may specify your card-payment acquiring bank for this payment option. </br> Options: BCA, BRI, DANAMON, MAYBANK, BNI, MANDIRI, CIMB, etc (Only choose 1 bank).' , 'midtrans-woocommerce' ),\n 'default' => ''\n )\n ));\n // Make this payment method enabled by default\n $this->form_fields['enabled']['default'] = 'yes';\n }", "function validateCC($cc_num, $type) {\n if ($type == \"American\") {$pattern = \"/^([34|37]{2})([0-9]{13})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Dinners\") {$pattern = \"/^([30|36|38]{2})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Discover\") {$pattern = \"/^([6011]{4})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Master\") {$pattern = \"/^([51|52|53|54|55]{2})([0-9]{14})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Visa\") {$pattern = \"/^([4]{1})([0-9]{12,15})$/\"; if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}}\n\n if($verified == false) {\n //if validation fail, print a message\n echo \"Credit card invalid. Please make sure that you entered a valid credit card \";\n } \n}", "function cardNumber()\n\t\t{\n\t\t\techo $this->card_number;\n\t\t}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \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(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\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\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function build_payment_form($host_obj)\n\t\t{\n\t\t\t$host_obj->add_field('CREDITCARDTYPE', 'Credit Card Type')->renderAs(frm_dropdown)->comment('Please select a credit card type.', 'above')->validation()->fn('trim')->required();\n\t\t\t$host_obj->add_field('FIRSTNAME', 'First Name', 'left')->renderAs(frm_text)->comment('Cardholder first name', 'above')->validation()->fn('trim')->required('Please specify a cardholder first name');\n\t\t\t$host_obj->add_field('LASTNAME', 'Last Name', 'right')->renderAs(frm_text)->comment('Cardholder last name', 'above')->validation()->fn('trim')->required('Please specify a cardholder last name');\n\t\t\t$host_obj->add_field('ACCT', 'Credit Card Number', 'left')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify a credit card number')->regexp('/^[0-9]+$/', 'Credit card number can contain only digits.');\n\t\t\t$host_obj->add_field('CVV2', 'CVV2', 'right')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify Card Verification Number')->numeric();\n\n\t\t\t$host_obj->add_field('EXPDATE_MONTH', 'Expiration Month', 'left')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration month')->numeric();\n\t\t\t$host_obj->add_field('EXPDATE_YEAR', 'Expiration Year', 'right')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration year')->numeric();\n\n\t\t\t$host_obj->add_field('START_MONTH', 'Start Month', 'left')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\t\t\t$host_obj->add_field('START_YEAR', 'Start Year', 'right')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\n\t\t\t$host_obj->add_field('ISSUE', 'Issue Number')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\t\t}", "public function actionPaymentdebitcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n \t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<?php if ( $this->mode === 'SELECT' ): ?>\n\t\t\t<label for=\"factoring-menu\"></label>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Please select payment method:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<select name=\"factoring-menu\" id=\"factoring-menu\" class=\"required-entry\">\n\t\t\t\t<option selected value=\"FINANCING\"><?php echo __( 'Financing Invoice', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t\t<option value=\"CREDITACCOUNT\"><?php echo __( 'Part Payment', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t</select>\n\t\t\t<div class=\"clear\"></div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $this->checkout_field !== 'yes' ): ?>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Social Security Number:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<input type=\"text\" name=\"social-security-number\" id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t<?php endif; ?>\n\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function payment_fields() {\n\t\t$message = $this->get_sandbox_form_message( $this->get_transaction_address( 'country' ) );\n\t\twc_get_template(\n\t\t\t'sandbox-checkout-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_sandbox_mode' => $this->is_sandbox_mode,\n\t\t\t\t'message' => $message,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\t$description = $this->get_description();\n\t\tif ( isset( $description ) ) {\n\t\t\techo wp_kses_post( wpautop( wptexturize( $description ) ) );\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'tef/payment-form.php',\n\t\t\tarray(\n\t\t\t\t'title' => $this->title,\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'id' => $this->id,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\tparent::checkout_rate_conversion( WC_EBANX_Constants::CURRENCY_CODE_BRL );\n\t}", "private function creditCardPayment($data)\n {\n $creditCard = $this->createSelling(new CreditCard, $data);\n\n // Set billing information for credit card\n $creditCard->setBilling()->setAddress()->withParameters(\n 'Av. Paulista',\n '1578',\n 'Bela Vista',\n '01310-200',\n 'São Paulo',\n 'SP',\n 'BRA',\n 'Museu'\n );\n\n $creditCard->setToken($data['cardToken']);\n\n // Set the installment quantity and value (could be obtained using the Installments\n // service, that have an example here in \\public\\getInstallments.php)\n $availableInstallments = $this->getInstallments($data['cardBrand']);\n\n $choosenInstallment = Arr::where($availableInstallments, function ($installment) use ($data) {\n return $installment->getQuantity() == $data['installments'];\n });\n $choosenInstallment = Arr::first($choosenInstallment);\n\n $creditCard->setInstallment()->withParameters(\n $choosenInstallment->getQuantity(),\n $choosenInstallment->getAmount(),\n $this->noInterestInstallments\n );\n\n // Set credit card holder information\n $creditCard->setHolder()->setBirthdate('01/01/2000');\n $creditCard->setHolder()->setName($data['cardName']); // Equals in Credit Card\n $creditCard->setHolder()->setPhone()->withParameters(\n 11,\n 999999999\n );\n $creditCard->setHolder()->setDocument()->withParameters(\n 'CPF',\n '10173649076'\n );\n\n try {\n // Get the crendentials and register the boleto payment\n $result = $creditCard->register(\n Configure::getAccountCredentials()\n );\n // code\n // grossAmount\n // netAmount\n // $pagamento = Pagamentos::create();\n // $pagamento->codigo_transacao = $result->getCode();\n // $pagamento->valor = $result->getGrossAmount();\n // $pagamento->valor_pagseguro = $result->getNetAmount();\n dd($result);\n } catch (Exception $e) {\n dd($e, 'Credit Card');\n }\n }", "function show_form( $atts=null, $form=true ) {\n global $wpdb, $isPolitical, $currencySymbol, $eligibility;\n \n $check_security = $this->check_security();\n \n if($check_security!==true) {\n return false;\n exit();\n }\n \n extract( shortcode_atts( array(\n 'amounts' => null,\n 'amount_as_input' => null,\n 'source' => null,\n 'thanks_url' => null,\n 'custom_amt_off' => 'false',\n 'button' => 'Submit',\n 'default_state' => null\n ), $atts ) );\n if(isset($_GET['amounts']) && !empty($_GET['amounts'])) {\n $amounts = $_GET['amounts'];\n }\n \n if(isset($_GET['source'])) {\n $source = $_GET['source'];\n } else if(isset($_GET['refcode'])) {\n $source = $_GET['refcode'];\n }\n \n if($amounts) {\n $amounts = explode(',', $amounts);\n $this->custom_amt_options = array();\n \n foreach($amounts as $amount) {\n $ths_amt = round($amount, 0);\n $ths_amt = (string) $ths_amt;\n $this->custom_amt_options[$ths_amt*100] = '$'.$ths_amt;\n }\n $this->custom_amt_options['custom'] = '<label for=\"custom_dollar_amt\">Other:</label> $<input type=\"text\" %s class=\"amount custom_dollar_amt\" /> <small>('.strtoupper($currencySymbol).')</small>';\n }\n \n $form_fields = '';\n // Loop through and generate the elements\n \n if(isset($source) && !empty($source)) {\n $form_fields .= '<input type=\"hidden\" name=\"Source\" value=\"'.$source.'\" />';\n }\n \n if(isset($this->config_errors) && !empty($this->config_errors)) {\n $form_fields .= $this->config_errors;\n }\n foreach($this->fieldsets as $fieldset_name => $fields) {\n if($isPolitical!=='true' && $fieldset_name=='Employment') {\n continue;\n } else {\n if(isset($thanks_url)) {\n $form_fields .= '<input type=\"hidden\" value=\"'.$thanks_url.'\" id=\"thanks_url\" />';\n }\n $form_fields .= '<fieldset><legend>'.$fieldset_name.'</legend>';\n if(isset($fields['html_intro'])) {\n $form_fields .= $fields['html_intro'];\n unset($fields['html_intro']);\n }\n foreach($fields as $field_key => $field) {\n if(!isset($field['type'])) {\n var_dump($field);\n }\n switch($field['type']) {\n case 'text':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= 'name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"';\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= ' id=\"'.$field['id'].'\" value=\"\"';\n }\n if(!empty($field['label']) && (!isset($field['show_placeholder']) || $field['show_placeholder']=='true')) {\n $form_fields .= ' placeholder=\"'.$field['label'].'\"';\n }\n $form_fields .= ' />';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'file':\n $file = true;\n $form_fields .= '\n <div class=\"file';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true && $field['required']=='true') {\n $form_fields .= '<div class=\"errMsg\">You must provide a '.$field['label'].'.</div>';\n } else if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">There was a problem uploading your file.</div>';\n }\n \n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"file\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" />\n </div>\n ';\n break;\n case 'hidden':\n $form_fields .= '<input type=\"hidden\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n } else if(isset($field['value'])) {\n $form_fields .= $field['value'];\n }\n $form_fields .= '\" />';\n break;\n case 'password':\n $form_fields .= '\n <div class=\"password ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"password\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"/>\n </div>\n ';\n break;\n case 'textarea':\n $form_fields .= '\n <div class=\"textarea';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <textarea name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '</textarea>\n </div>\n ';\n break;\n case 'checkbox':\n if(isset($field['options']) && !empty($field['options'])) {\n $form_fields .= '<fieldset id=\"ngp_'.$field['slug'].'\" class=\"checkboxgroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error\">\n <div class=\"errMsg\">You must check at least one.</div>';\n } else {\n $form_fields .= '\">';\n }\n $form_fields .= '<legend>'.$field['label'];\n if($field['required']=='true') $form_fields .= '<span class=\"required\">*</span>';\n $form_fields .= '</legend>';\n $i = 0;\n foreach($field['options'] as $val) {\n $i++;\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" value=\"'.$val.'\" name=\"'.$field['slug'].'['.$i.']['.$val.']\" id=\"option_'.$i.'_'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"option_'.$i.'_'.$field['slug'].'\">'.$val.'</label></div>'.\"\\r\\n\";\n }\n $form_fields .= '</fieldset>';\n } else {\n $form_fields .= '<div id=\"ngp_'.$field['slug'].'\" class=\"checkbox\">';\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"'.$field['slug'].'\">'.$field['label'].'</label></div>'.\"\\r\\n\";\n $form_fields .= '</div>';\n }\n break;\n case 'radio':\n if(isset($field['slug'])) {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['slug'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n } else {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['id'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n }\n $form_fields .= '\"><legend>'.$field['label'];\n if($field['required']=='true') { $form_fields .= '<span class=\"required\">*</span>'; }\n $form_fields .= '</legend>';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n $i = 0;\n if($field['label']=='Amount' && isset($this->custom_amt_options)) {\n $the_options = $this->custom_amt_options;\n } else {\n $the_options = $field['options'];\n }\n \n if(isset($_GET['amt']) && empty($_POST)) {\n if(strpos($_GET['amt'], '.')===false) {\n $get_amt = $_GET['amt'];\n } else {\n $get_amt = $_GET['amt'];\n }\n \n if(array_key_exists($get_amt, $the_options)) {\n $amt = $get_amt;\n } else {\n $custom_amt = $_GET['amt'];\n }\n } else if(isset($_POST['custom_dollar_amt'])) {\n $custom_amt = $_POST['custom_dollar_amt'];\n } else if(isset($field['slug']) && isset($_POST[$field['slug']])) {\n $amt = $_POST[$field['slug']];\n }\n \n foreach($the_options as $val => $labe) {\n $i++;\n if($val=='custom' && $custom_amt_off=='false') {\n $replace = (isset($custom_amt)) ? 'value=\"'.$custom_amt.'\"' : '';\n $form_fields .= '<div class=\"radio custom-donation-amt\">'.sprintf($labe, $replace).'</div>'.\"\\r\\n\";\n } else {\n $form_fields .= '<div class=\"radio\"><input type=\"radio\" value=\"'.$val.'\"';\n if(isset($field['slug'])) {\n $form_fields .= ' name=\"'.$field['slug'].'\"';\n $form_fields .= ' id=\"'.$i.'_'.$field['slug'].'\" class=\"amount '.$field['slug'].'\"';\n } else {\n $form_fields .= ' id=\"'.$i.'_'.$field['id'].'\" class=\"amount '.$field['id'].'\"';\n }\n if(isset($amt) && $amt==$val) {\n $form_fields .= ' checked';\n }\n $form_fields .= '> <label for=\"'.$i.'_';\n if(isset($field['slug'])) {\n $form_fields .= $field['slug'];\n } else {\n $form_fields .= $field['id'];\n }\n $form_fields .= '\">'.$labe.'</label></div>'.\"\\r\\n\";\n }\n }\n $form_fields .= '</fieldset>';\n break;\n case 'select':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select id=\"'.$field['id'].'\">'.\"\\r\\n\";\n }\n $field_ref = (isset($field['slug'])) ? $field['slug'] : $field['id'];\n if($field_ref!='State' && $field_ref!='cardExpiryMonth' && $field_ref!='cardExpiryYear') {\n $form_fields .= '\n <option>Select an option...</option>\n ';\n }\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\"';\n if(isset($field['slug']) && isset($_POST[$field['slug']]) && $_POST[$field['slug']]==$key) {\n $form_fields .= ' selected=\"selected\"';\n } else if(!empty($default_state) && $default_state==$key) {\n $form_fields .= ' selected=\"selected\"';\n }\n $form_fields .= '>'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '</select>';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'multiselect':\n $form_fields .= '\n <div class=\"multiselect ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <select multiple name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\">'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '\n </select>\n </div>\n ';\n break;\n }\n }\n $form_fields .= '</fieldset>';\n }\n }\n \n $return = '';\n \n if(!empty($form_fields)) {\n $return .= '<div id=\"stripe-msgs\" style=\"display:none;\"></div><form name=\"stripe_payment\" class=\"stripe_payment_submission\" id=\"stripe-payment-form\" action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">';\n \n // if(function_exists('wp_nonce_field')) {\n // $return .= wp_nonce_field('stripe_nonce_field', 'stripe_add', true, false);\n // }\n \n $return .= $form_fields;\n \n $return .= '<div class=\"submit\">\n <input type=\"submit\" value=\"'.$button.'\" />\n </div>\n <div class=\"stripe-payment-form-row-progress\">\n <span class=\"message\"></span>\n </div>';\n if($isPolitical==='true') {\n $return .= str_replace('{{button}}', $button, $eligibility);\n }\n // $return .= '<p class=\"addtl-donation-footer-info\">'.str_replace(\"\\r\\n\", '<br />', str_replace('&lt;i&gt;', '<i>', str_replace('&lt;/i&gt;', '</i>', str_replace('&lt;u&gt;', '<u>', str_replace('&lt;/u&gt;', '</u>', str_replace('&lt;b&gt;', '<b>', str_replace('&lt;/b&gt;', '</b>', get_option('stripe_payments_footer_info')))))))).'</p>';\n $return .= '</form>';\n \n return $return;\n }\n }", "public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "function debit($total, $creditCard)\n {\n }", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}", "private function validatePaymentFields(){\n }", "function spgateway_credit_MetaData() {\n return array(\n 'DisplayName' => 'spgateway - 信用卡',\n 'APIVersion' => '1.1', // Use API Version 1.1\n 'DisableLocalCredtCardInput' => false,\n 'TokenisedStorage' => false,\n );\n}", "function payment_fields() {\n\t\t\tif ($this->description) echo wpautop(wptexturize($this->description));\n\t\t}", "function payment_fields() {\n\t\t\tif ($this->description) echo wpautop(wptexturize($this->description));\n\t\t}", "function payment_fields(){\r\n if($this -> description) echo wpautop(wptexturize($this -> description));\r\n }", "public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }", "function wp_stripe_shortcode_legacy( $atts ){\n\n return wp_stripe_form();\n}", "public function card();", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function redirect_form()\n{\n global $pxpay;\n \n $request = new PxPayRequest();\n \n $http_host = getenv(\"HTTP_HOST\");\n $request_uri = getenv(\"SCRIPT_NAME\");\n $server_url = \"http://$http_host\";\n #$script_url = \"$server_url/$request_uri\"; //using this code before PHP version 4.3.4\n #$script_url = \"$server_url$request_uri\"; //Using this code after PHP version 4.3.4\n $script_url = (version_compare(PHP_VERSION, \"4.3.4\", \">=\")) ?\"$server_url$request_uri\" : \"$server_url/$request_uri\";\n $EnableAddBillCard = 1;\n \n # the following variables are read from the form\n $Quantity = $_REQUEST[\"Quantity\"];\n $MerchantReference = sprintf('%04x%04x-%04x-%04x',mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0x0fff) | 0x4000);\n $Address1 = $_REQUEST[\"Address1\"];\n $Address2 = $_REQUEST[\"Address2\"];\n $Address3 = $_REQUEST[\"Address3\"];\n \n #Calculate AmountInput\n $AmountInput = 21.50;\n \n #Generate a unique identifier for the transaction\n $TxnId = uniqid(\"ID\");\n \n #Set PxPay properties\n $request->setMerchantReference($MerchantReference);\n $request->setAmountInput($AmountInput);\n $request->setTxnData1($Address1);\n $request->setTxnData2($Address2);\n $request->setTxnData3($Address3);\n $request->setTxnType(\"Purchase\");\n $request->setCurrencyInput(\"NZD\");\n $request->setEmailAddress(\"[email protected]\");\n $request->setUrlFail($script_url);\t\t\t# can be a dedicated failure page\n $request->setUrlSuccess($script_url);\t\t\t# can be a dedicated success page\n $request->setTxnId($TxnId);\n $request->setRecurringMode(\"recurringinitial\");\n #The following properties are not used in this case\n $request->setEnableAddBillCard($EnableAddBillCard);\n # $request->setBillingId($BillingId);\n # $request->setOpt($Opt);\n\n \n #Call makeRequest function to obtain input XML\n $request_string = $pxpay->makeRequest($request);\n #Obtain output XML\n $response = new MifMessage($request_string);\n \n #Parse output XML\n $url = $response->get_element_text(\"URI\");\n $valid = $response->get_attribute(\"valid\");\n \n #Redirect to payment page\n header(\"Location: \".$url);\n}", "function payment_fields()\n {\n if ($this->description) {\n echo wpautop(wptexturize($this->description));\n }\n }", "public function payment_fields() {\n\n\t\tWC()->session->set( 'decred_amount', null );\n\n\t\ttry {\n\n\t\t\t$dcr_amount = $this->get_dcr_amount();\n\n\t\t\t// save amount now to retrieve it later when order created.\n\t\t\tWC()->session->set( 'decred_amount', $dcr_amount );\n\n\t\t\trequire __DIR__ . '/html-checkout.php';\n\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// TODO log $e.\n\t\t\tprintf(\n\t\t\t\t// translators: don't translate error message.\n\t\t\t\tesc_html__( 'There was an error while trying to get the DCR amount: \"%s\".', 'decred' ),\n\t\t\t\t$e->getMessage()\n\t\t\t);\n\t\t}\n\t}", "public function addCard()\n {\n }", "function CCValidationSolution($Number) {\r\n global $CardName, $CardNumber, $language;\r\n\r\n require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CCVAL_FUNCTION); \r\n\r\n\r\n// Get rid of spaces and non-numeric characters.\r\n $Number = OnlyNumericSolution($Number);\r\n\r\n// Do the first four digits fit within proper ranges? If so, who's the card issuer and how long should the number be?\r\n $NumberLeft = substr($Number, 0, 4);\r\n $NumberLength = strlen($Number);\r\n\r\n if ( ($NumberLeft >= 3000) && ($NumberLeft <= 3059) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3600) && ($NumberLeft <= 3699) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3800) && ($NumberLeft <= 3889) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3400) && ($NumberLeft <= 3499) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3700) && ($NumberLeft <= 3799) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3528) && ($NumberLeft <= 3589) ) {\r\n $CardName = 'JCB';\r\n $ShouldLength = 16;\r\n } elseif ( ($NumberLeft >= 3890) && ($NumberLeft <= 3899) ) {\r\n $CardName = 'Carte Blache';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 4000) && ($NumberLeft <= 4999) ) {\r\n $CardName = 'Visa';\r\n if ($NumberLength > 14) {\r\n $ShouldLength = 16;\r\n } elseif ($NumberLength < 14) {\r\n $ShouldLength = 13;\r\n }\r\n } elseif ( ($NumberLeft >= 5100) && ($NumberLeft <= 5599) ) {\r\n $CardName = 'MasterCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 5610) {\r\n $CardName = 'Australian BankCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 6011) {\r\n $CardName = 'Discover/Novus';\r\n $ShouldLength = 16;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, $NumberLeft);\r\n return $cc_val;\r\n }\r\n\r\n// Is the number the right length?\r\n if ($NumberLength <> $ShouldLength) {\r\n $Missing = $NumberLength - $ShouldLength;\r\n if ($Missing < 0) {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n }\r\n\r\n return $cc_val;\r\n }\r\n\r\n// Does the number pass the Mod 10 Algorithm Checksum?\r\n if (Mod10Solution($Number)) {\r\n $CardNumber = $Number;\r\n return true;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n return $cc_val;\r\n }\r\n }", "function form() {\n\tglobal $cert_amt_tbl;\n\t\n\t$certificates_form = table_form_header('* indicates required field');\n\t$certificates_form .= table_form_field('Sort:','<input name=\"crtamt_sort\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->crtamt_sort.'\">');\n\t$certificates_form .= table_form_field('<span class=\"required\">*Discount Amount:</span>','<input name=\"discount_amount\" type=\"text\" size=\"5\" maxlength=\"15\" value=\"'.$cert_amt_tbl->discount_amount.'\">');\n\t$certificates_form .= table_form_field('Discount Cost:','<input name=\"cost\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->cost.'\">');\n\t$certificates_form .= table_form_field('Min Spend Amounts:','<input name=\"min_spend_amts\" type=\"text\" size=\"30\" value=\"'.$cert_amt_tbl->min_spend_amts.'\">');\n\t$certificates_form .= table_span_form_field('<center><input name=\"id\" type=\"hidden\" value=\"'.$cert_amt_tbl->id.'\"><input name=\"submit\" type=\"submit\" value=\"Submit\"></center>');\n\t\n return $certificates_form;\n }", "public function show(CreditCard $creditCard)\n {\n //\n }", "public function stripe_credit_card(Request $request, $subscription_uid) {\n $subscription = \\Acelle\\Model\\Subscription::findByUid($subscription_uid);\n $order_id = $subscription->getOrderID();\n $result = null;\n\n // Check billing information\n if( $this->checkBillingInformation($request, $subscription) !== true ) {\n return redirect()->away($this->checkBillingInformation($request, $subscription));\n }\n\n $payment_method = \\Acelle\\Model\\PaymentMethod::getByType(\\Acelle\\Model\\PaymentMethod::TYPE_STRIPE_CREDIT_CARD);\n $apiSecretKey = $payment_method->getOption('api_secret_key');\n $apiPublishableKey = $payment_method->getOption('api_publishable_key');\n\n try {\n \\Stripe\\Stripe::setApiKey($apiSecretKey);\n\n // validate and save posted data\n if ($request->isMethod('post')) {\n\n // Token is created using Stripe.js or Checkout!\n // Get the payment token submitted by the form:\n $token = $request->stripeToken;\n\n // Charge the user's card:\n $result = \\Stripe\\Charge::create(array(\n \"amount\" => $subscription->stripePrice(),\n \"currency\" => $subscription->currency_code,\n \"description\" => trans('messages.stripe_checkout_description', ['order' => $order_id]),\n \"source\" => $token,\n ));\n\n $payment = new Payment();\n $payment->subscription_id = $subscription->id;\n $payment->payment_method_id = $payment_method->id;\n $payment->data = serialize($result);\n $payment->status = 'success';\n $payment->action = \\Acelle\\Model\\Payment::ACTION_PAID;\n $payment->payment_method_name = trans('messages.' . $payment_method->type);\n $payment->order_id = $order_id;\n\n // billing information\n $billing_information = $request->session()->get('billing_information');\n if (isset($billing_information)) {\n $payment->tax_number = $billing_information['tax_number'];\n $payment->billing_address = $billing_information['billing_address'];\n $request->session()->forget('billing_information');\n }\n\n $payment->save();\n $subscription->setPaid();\n\n // try enabling the subscription, proceed anyway if failed\n try {\n $subscription->enable();\n } catch (\\Exception $ex) {\n // just suppress the error and leave the subscription disabled\n LaravelLog::warning(\"Cannot enable subscription {$subscription->id}, proceed anyway\");\n }\n\n return redirect()->action('PaymentController@success', $subscription->uid);\n }\n\n } catch(\\Stripe_CardError $e) {\n $error_message = \"\";\n // Since it's a decline, Stripe_CardError will be caught\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n $error_message .= 'Status is:' . $e->getHttpStatus() . \"\\n\";\n $error_message .= 'Type is:' . $err['type'] . \"\\n\";\n $error_message .= 'Code is:' . $err['code'] . \"\\n\";\n // param is '' in this case\n $error_message .= 'Param is:' . $err['param'] . \"\\n\";\n $error_message .= 'Message is:' . $err['message'] . \"\\n\";\n } catch (\\Stripe_InvalidRequestError $e) {\n $error_message = $e->getMessage();\n } catch (\\Stripe_AuthenticationError $e) {\n // Authentication with Stripe's API failed\n // (maybe you changed API keys recently)\n $error_message = $e->getMessage();\n } catch (\\Stripe_ApiConnectionError $e) {\n // Network communication with Stripe failed\n } catch (\\Stripe_Error $e) {\n // Display a very generic error to the user, and maybe send\n // yourself an email\n $error_message = $e->getMessage();\n } catch (\\Exception $e) {\n // Something else happened, completely unrelated to Stripe\n $error_message = $e->getMessage();\n }\n\n if (isset($error_message)) {\n PaymentLog::error(trans('messages.something_went_wrong_with_payment') . ': ' .$error_message);\n return view('somethingWentWrong', ['message' => trans('messages.something_went_wrong_with_payment', ['error' => $error_message])]);\n }\n\n return view('payments.stripe_credit_card', [\n 'subscription' => $subscription,\n 'apiPublishableKey' => $apiPublishableKey,\n 'result' => $result,\n 'payment_method' => $payment_method,\n ]);\n }", "public function _prePayment( $data )\n{\n\t$jinput = JFactory::getApplication()->input;\n\n\t// Prepare the payment form\n\t$vars->order_id = $data['order_id'];\n\t$vars->orderpayment_id = $data['orderpayment_id'];\n\t$vars->orderpayment_amount = $data['orderpayment_amount'];\n\t$vars->orderpayment_type = $this->_element;\n\n\t$vars->cardholder = $jinput->get(\"cardholder\");\n\t$vars->payment_mode = $jinput->get(\"payment_mode\");\n\n\t// Credit card\n\t$vars->cardnum = $jinput->get(\"cardnum\");\n\t$month = $jinput->get(\"month\");\n\t$year = $jinput->get(\"year\");\n\t$card_exp = $month . ' / ' . $year;\n\t$vars->cardexp = $card_exp;\n\n\t$vars->cardcvv = $jinput->get(\"cardcvv\");\n\t$vars->cardnum_last4 = substr($jinput->get(\"cardnum\"), -4);\n\n\t// Debit card\n\t$vars->accnum = $jinput->get(\"accnum\");\n\t$vars->accnum_last4 = substr($jinput->get(\"accnum\"), -4);\n\t$vars->banknum = $jinput->get(\"banknum\");\n\t$vars->country = $jinput->get(\"country\");\n\n\t// Token\n\t$vars->token12 = $jinput->get(\"token12\");\n\n\t// Lets check the values submitted\n\t$html = $this->_getLayout('prepayment', $vars);\n\n\treturn $html;\n}", "function payment_fields() {\r\n if ($this->description) {\r\n echo wpautop(wptexturize($this->description));\r\n }\r\n }", "public function isUseCreditCard()\n {\n return $this->useCreditCard;\n }", "public function createCreditCard(CreditCard $creditCard): CreditCard;", "public function creditCardFormAdd()\n {\n\t\tif(isset($_POST[\"addBankDetails\"])){\n\t\t\t$this->form_validation->set_rules('cc_number', 'Credit Card Number:', 'required|min_length[15]',\n\t\t\t\tarray('required' => 'Please fill your correct Credit Card number.',\n\t\t\t\t\t'min_length' => 'Should be Numeric and have 15 or 16 digits.'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('cc_ccv', 'Verification Code:', 'required|min_length[3]',\n\t\t\t\tarray('required' => 'Please fill in your Credit card verification code.',\n\t\t\t\t\t'min_length' => 'Should be Numeric and have 3 digits.'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('nickname', 'Card Name:', 'required',\n\t\t\t\tarray('required' => 'Please fill in Card Name field.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('f_name', 'Cardholder Name:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your first name.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('c_address1', 'Address:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your address.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_city', 'City:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your city.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_state', 'State:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your state.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('v_zip', 'Zip Code:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your zip postal code.')\n\t\t\t);\n\t\t\t$this->form_validation->set_rules('cty', 'Country:', 'required',\n\t\t\t\tarray('required' => 'Please fill in your country.')\n\t\t\t);\n\t\t\t$form = $this->input->post(NULL, TRUE);\n\t\t\tif($this->form_validation->run() !== FALSE) {\n\t\t\t\t$addcreditinfo = $this->banks->addcreditinfo($form);\n\t\t\t\tif($addcreditinfo == TRUE){ ?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t$(document).ready(function(){\n\t\t\t\t\t\t\t$(\"#credit_card_info_form\").trigger('reset');\n\t\t\t\t\t\t});\n\t\t\t\t\t</script> <?php\n\t\t\t\t\t//------Credit Cards Detail Form Default Parameters--->\t\n\t\t\t\t\t$data[\"cc_number\"] = \"\";\n\t\t\t\t\t$data[\"cc_month\"] = \"\";\n\t\t\t\t\t$data[\"cc_year\"] = \"\";\n\t\t\t\t\t$data[\"cc_ccv\"] = \"\";\n\t\t\t\t\t$data[\"nickname\"] = \"\";\n\t\t\t\t\t$data[\"f_name\"] = \"\";\n\t\t\t\t\t$data[\"c_address1\"] = \"\";\n\t\t\t\t\t$data[\"v_city\"] = \"\";\n\t\t\t\t\t$data[\"v_state\"] = \"\";\n\t\t\t\t\t$data[\"v_zip\"] = \"\";\n\t\t\t\t\t$data[\"cty\"] = \"\";\n\t\t\t\t\t//------./Credit Cards Detail Form Default Parameters--->\n\n\t\t\t\t\t$data[\"cc_amount\"] = \"\";\n\t\t\t\t\t$data[\"selectAccount\"] = \"\";\n\t\t\t\t\t$data[\"getBalance\"] = $this->banks->getbalanceinfo();\n\t\t\t\t\t$data[\"msg\"] = \"Credit account has been added successfully.\";\n\t\t\t\t\t$data['getcreditinfo'] = $this->banks->getCreditInfo();\n\t\t\t\t\t$data['getbankinfo'] = $this->banks->getBankInfo();\n\t\t\t\t\t//$data['getRecurringinfo'] = $this->banks->getRecurringInfo();\n\t\t\t\t\t$data['title'] = \"Account Summary\";\n\t\t\t\t\t$this->load->view('header', $data);\n\t\t\t\t\t$this->load->view('bank/inc_account_summary2', $data);\n\t\t\t\t\t$this->load->view('footer');\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$this->accountSummary();\n\t\t\t}\n\t\t}\n\t}", "function FormatCreditCard($cc)\n{\n\t$cc = str_replace(array('-',' '),'',$cc);\n\t// Get the CC Length\n\t$cc_length = strlen($cc);\n\t// Initialize the new credit card to contian the last four digits\n\t$newCreditCard = substr($cc,-4);\n\t// Walk backwards through the credit card number and add a dash after every fourth digit\n\tfor($i=$cc_length-5;$i>=0;$i--){\n\t\t// If on the fourth character add a dash\n\t\tif((($i+1)-$cc_length)%4 == 0){\n\t\t\t$newCreditCard = '-'.$newCreditCard;\n\t\t}\n\t\t// Add the current character to the new credit card\n\t\t$newCreditCard = $cc[$i].$newCreditCard;\n\t}\n\t// Return the formatted credit card number\n\treturn $newCreditCard;\n}", "public function payment_fields() {\n\t\tparent::payment_fields();\n\n\t\tif ( $this->allow_gift_cards === true ) {\n\t\t\t$path = dirname(plugin_dir_path(__FILE__));\n\n\t\t\tinclude_once $path . '/../assets/frontend/HeartlandGiftFields.php';\n\t\t\twp_enqueue_style('heartland-gift-cards', $path . '/../assets/frontend/css/heartland-gift-cards.css');\n\t\t}\n\t}", "static function pmpro_checkout_after_form()\n\t\t{\n\t\t?>\n\t\t<script>\n\t\t\t<!--\n\t\t\t//choosing payment method\n\t\t\tjQuery('input[name=gateway]').click(function() {\n\t\t\t\tif(jQuery(this).val() == 'paypal')\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').hide();\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').show();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').show();\n\t\t\t\t\tjQuery('#pmpro_submit_span').show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_submit_span').hide();\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//select the radio button if the label is clicked on\n\t\t\tjQuery('a.pmpro_radio').click(function() {\n\t\t\t\tjQuery(this).prev().click();\n\t\t\t});\n\t\t\t-->\n\t\t</script>\n\t\t<?php\n\t\t}", "protected function secure_payment_fields() {\n\t\treturn array(\n\t\t\t'card-number-field' => array(\n\t\t\t\t'class' => 'card-number',\n\t\t\t\t'label' => esc_html__( 'Credit Card Number', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( '•••• •••• •••• ••••', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Number', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'card-expiry-field' => array(\n\t\t\t\t'class' => 'card-expiration',\n\t\t\t\t'label' => esc_html__( 'Credit Card Expiration Date', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( 'MM / YYYY', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Expiration Date', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'card-cvc-field' => array(\n\t\t\t\t'class' => 'card-cvv',\n\t\t\t\t'label' => esc_html__( 'Credit Card Security Code', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( '•••', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Security Code', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function give_get_donation_cc_info() {\n\n\t// Sanitize the values submitted with donation form.\n\t$post_data = give_clean( $_POST ); // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\t$cc_info = array();\n\t$cc_info['card_name'] = ! empty( $post_data['card_name'] ) ? $post_data['card_name'] : '';\n\t$cc_info['card_number'] = ! empty( $post_data['card_number'] ) ? $post_data['card_number'] : '';\n\t$cc_info['card_cvc'] = ! empty( $post_data['card_cvc'] ) ? $post_data['card_cvc'] : '';\n\t$cc_info['card_exp_month'] = ! empty( $post_data['card_exp_month'] ) ? $post_data['card_exp_month'] : '';\n\t$cc_info['card_exp_year'] = ! empty( $post_data['card_exp_year'] ) ? $post_data['card_exp_year'] : '';\n\t$cc_info['card_address'] = ! empty( $post_data['card_address'] ) ? $post_data['card_address'] : '';\n\t$cc_info['card_address_2'] = ! empty( $post_data['card_address_2'] ) ? $post_data['card_address_2'] : '';\n\t$cc_info['card_city'] = ! empty( $post_data['card_city'] ) ? $post_data['card_city'] : '';\n\t$cc_info['card_state'] = ! empty( $post_data['card_state'] ) ? $post_data['card_state'] : '';\n\t$cc_info['card_country'] = ! empty( $post_data['billing_country'] ) ? $post_data['billing_country'] : '';\n\t$cc_info['card_zip'] = ! empty( $post_data['card_zip'] ) ? $post_data['card_zip'] : '';\n\n\t// Return cc info.\n\treturn $cc_info;\n}", "public function getCreditCard()\n {\n return $this->creditCard;\n }", "function pre_confirmation_check() {\n global $_POST, $messageStack;\n\n\t// if the card number has the blanked out middle number fields, it has been processed, show message that \n\t// the charges were not processed through the merchant gateway and continue posting payment.\n\tif (strpos($_POST['paymentech_field_1'],'*') !== false) {\n \t$messageStack->add(MODULE_PAYMENT_PAYMENTECH_NO_DUPS, 'caution');\n\t\treturn false;\n\t}\n\n include(DIR_FS_MODULES . 'general/classes/cc_validation.php');\n\n $cc_validation = new cc_validation();\n $result = $cc_validation->validate($_POST['paymentech_field_1'], $_POST['paymentech_field_2'], $_POST['paymentech_field_3'], $_POST['paymentech_field_4']);\n $error = '';\n switch ($result) {\n case -1:\n $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));\n break;\n case -2:\n case -3:\n case -4:\n $error = TEXT_CCVAL_ERROR_INVALID_DATE;\n break;\n case false:\n $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;\n break;\n }\n\n if ( ($result == false) || ($result < 1) ) {\n $messageStack->add($error . '<!-- ['.$this->code.'] -->', 'error');\n return true;\n }\n\n $this->cc_card_type = $cc_validation->cc_type;\n $this->cc_card_number = $cc_validation->cc_number;\n $this->cc_cvv2 = $_POST['paymentech_field_4'];\n $this->cc_expiry_month = $cc_validation->cc_expiry_month;\n $this->cc_expiry_year = $cc_validation->cc_expiry_year;\n\treturn false;\n }", "public function getChangeNumberCardForm(){\n $cards = $this->getCardsWithoutCustomer();\n $choices = array();\n foreach ($cards as $availableCard){\n $choices[\"Card n°\".$availableCard->getNumber()] = $availableCard->getNumber();\n }\n\n $form = $this->formFactory->create()\n ->add('number', ChoiceType::class, array(\n \"choices\" => $choices,\n 'attr' => array(\n \"class\" => \"browser-default\"\n )\n ));\n\n return $form;\n }", "public function payment_fields(){\r\n if($this->description) echo wpautop(wptexturize($this->description));\r\n }", "public function setup_form() {\n\t\t?>\n\t\t<tr>\n\t\t\t<td colspan=\"2\">\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"wpsc-manual-gateway-setup\"><?php _e( 'Instructions', 'wpsc' ); ?></label><br />\n\t\t\t\t\t<textarea id=\"wpsc-manual-gateway-setup\" cols='' rows='10' name='<?php echo esc_attr( $this->setting->get_field_name( 'payment_instructions' ) ); ?>'><?php echo esc_textarea( wp_unslash( $this->setting->get( 'payment_instructions' ) ) ); ?></textarea><br />\n\t\t\t\t\t<small><?php _e('Enter the payment instructions that you wish to display to your customers when they make a purchase.', 'wpsc'); ?></small><br />\n\t\t\t\t\t<small><?php _e('For example, this is where you the Shop Owner might enter your bank account details or address so that your customer can make their manual payment.', 'wpsc'); ?></small>\n\t\t\t\t</p>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\t}", "function init_form_fields() {\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'method_enabled' => array(\n 'title' => __( 'Allowed Payment Method', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Customize allowed payment method, separate payment method code with coma. e.g: bank_transfer,credit_card. <br>Leave it default if you are not sure.', 'midtrans-woocommerce' ),\n 'default' => 'credit_card'\n ),\n 'bin_number' => array(\n 'title' => __( 'Allowed CC BINs', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Allowed CC BINs', 'midtrans-woocommerce' ),\n 'description' => __( 'Fill with CC BIN numbers (or bank name) that you want to allow to use this payment button. </br> Separate BIN number with coma Example: 4,5,4811,bni,mandiri', 'midtrans-woocommerce' ),\n 'default' => ''\n ),\n 'promo_code' => array(\n 'title' => __( 'Promo Code', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Promo Code that would be used for discount. Leave blank if you are not using promo code.', 'midtrans-woocommerce' ),\n 'default' => 'onlinepromomid'\n )\n ));\n }", "function add_credit_card($contact_id,$data)\n {\n $last_4 = substr($data['CardNumber'],-4);\n $cc_id = $this->locateCard($contact_id,$last_4);\n\n if($cc_id == 0) //Doesn't Exist\n {\n //Add Card\n $cc_id = $this->dsAdd('CreditCard',$data);\n return $cc_id;\n }\n elseif($cc_id > 0)\n {\n //Check if card as same expiration date\n $card_data = $this->dsLoad('CreditCard',$cc_id,array('ExpirationMonth','ExpirationYear'));\n if(\n $card_data['ExpirationMonth'] == $data['ExpirationMonth'] &&\n $card_data['ExpirationYear'] == $data['ExpirationMonth']) {\n return $cc_id;\n }\n else\n {\n //Update CC Dates\n return $this->dsUpdate('CreditCard',$cc_id,array('ExpirationYear' => $data['ExpirationYear'],'ExpirationMonth' => $data['ExpirationMonth']));\n }\n\n\n }\n else\n {\n return FALSE;\n }\n\n }", "public function newPostAction()\n {\n // The card\n $card = Mage::getModel('mbiz_cc/cc');\n\n try {\n $post = $this->getRequest()->getPost();\n\n $card->setData(array(\n 'customer' => $this->_getCustomerSession()->getCustomer(),\n 'dateval' => isset($post['dateval-month'], $post['dateval-year']) ? sprintf('%02d%02d', (int) $post['dateval-month'], $post['dateval-year'] - 2000) : null,\n 'cvv' => isset($post['cvv']) ? $post['cvv'] : null,\n 'type' => isset($post['type']) ? $post['type'] : null,\n 'owner' => isset($post['owner']) ? $post['owner'] : null,\n 'number' => isset($post['number']) ? $post['number'] : null,\n ));\n\n /* INFO:\n * To specify the token you can use the event \"cc_validate_before\"\n */\n\n $errors = $card->validate();\n\n if ($errors) {\n foreach ($errors as $error) {\n $this->_getSession()->addError($error);\n }\n } else {\n $card->save();\n $this->_getSession()->addSuccess($this->__('Credit card saved successfully.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n $this->_redirect('customer/cc/index');\n }", "public function stripeformAction() {\n\n $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['armpayments']);\n $apiSecretKey = $this->conf['stripeApiKey'];\n $publishKey = $this->conf['stripePubKey'];\n $stripeObj = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('ARM\\\\Armpayments\\\\Libraries\\\\Stripe\\\\T3Stripe', $apiSecretKey, $publishKey);\n $stripeObj->init();\n\n $orderid = $this->request->getArgument('orderid');\n $amount = $this->request->getArgument('amount');\n $amountCent = intval($this->request->getArgument('amountcent'));\n $vat = $this->request->getArgument('vat');\n $tablename = $this->request->getArgument('tablename');\n $currency = $this->request->getArgument('currency');\n $description = $this->request->getArgument('description');\n $method = $this->request->getArgument('method');\n $mail = $this->request->getArgument('email');\n\n $this->view->assign('stripePubKey', $publishKey);\n $this->view->assign('orderid', $orderid);\n $this->view->assign('amount', $amount);\n $this->view->assign('amountCent', $amountCent);\n $this->view->assign('vat', $vat);\n $this->view->assign('currency', $currency);\n $this->view->assign('description', urldecode($description));\n $this->view->assign('tablename', $tablename); \n $this->view->assign('method', $method);\n $this->view->assign('email', $mail);\n\n }", "function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "public function getCreditCard()\n\t{\n\t\treturn $this->credit_card;\n\t}", "public function payment_fields() {\n\t\t$user = wp_get_current_user();\n\t\t$display_tokenization = $this->supports( 'tokenization' ) && is_checkout();\n\t\t$total = WC()->cart->total;\n\n\t\tif ( $user->ID ) {\n\t\t\t$user_email = get_user_meta( $user->ID, 'billing_email', true );\n\t\t\t$user_email = $user_email ? $user_email : $user->user_email;\n\t\t} else {\n\t\t\t$user_email = '';\n\t\t}\n\n\t\techo '<div\n\t\t\tid=\"xendit-payment-data\"\n\t\t\tdata-description=\"\"\n\t\t\tdata-email=\"' . esc_attr( $user_email ) . '\"\n\t\t\tdata-amount=\"' . esc_attr( $this->get_xendit_amount( $total ) ) . '\"\n\t\t\tdata-name=\"' . esc_attr( $this->statement_descriptor ) . '\"\n\t\t\tdata-currency=\"' . esc_attr( strtolower( get_woocommerce_currency() ) ) . '\"\n\t\t\tdata-locale=\"' . esc_attr( 'en' ) . '\"\n\t\t\tdata-image=\"' . esc_attr( $this->xendit_checkout_image ) . '\"\n\t\t\tdata-allow-remember-me=\"' . esc_attr( $this->saved_cards ? 'true' : 'false' ) . '\">';\n\n\t\tif ( $this->description ) {\n\t\t\techo apply_filters( 'wc_xendit_description', wpautop( wp_kses_post( $this->description ) ) );\n\t\t}\n\n\t\tif ( $display_tokenization ) {\n\t\t\t$this->tokenization_script();\n\t\t}\n\n\t\t$this->form();\n\t\techo '</div>';\n\t}", "public function getCheckoutForm(){\r\n\r\n $form='\r\n <form id=\"paypal_checkout\" action=\"https://www.sandbox.paypal.com/cgi-bin/webscr\" method=\"post\">';\r\n\r\n //==> Variables defining a cart, there shouldn't be a need to change those <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"cmd\" value=\"_cart\" />\r\n <input type=\"hidden\" name=\"upload\" value=\"1\" />\t\t\t\r\n <input type=\"hidden\" name=\"no_note\" value=\"0\" />\t\t\t\t\t\t\r\n <input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF\" />\t\t\t\t\t\r\n <input type=\"hidden\" name=\"tax\" value=\"0\" />\t\t\t\r\n <input type=\"hidden\" name=\"rm\" value=\"2\" />';\r\n \r\n //==> Personnalised variables, they get their values from the specified settings nd the class attributes <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"business\" value=\"'.$this->business.'\" />\r\n <input type=\"hidden\" name=\"handling_cart\" value=\"'.$this->shipping.'\" />\r\n <input type=\"hidden\" name=\"currency_code\" value=\"'.$this->currency.'\" />\r\n <input type=\"hidden\" name=\"lc\" value=\"'.$this->location.'\" />\r\n <input type=\"hidden\" name=\"return\" value=\"'.$this->returnurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"cbt\" value=\"'.$this->returntxt.'\" />\r\n <input type=\"hidden\" name=\"cancel_return\" value=\"'.$this->cancelurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"custom\" value=\"'.$this->custom.'\" />';\r\n\r\n //==> The items of the cart <==//\r\n $cpt=1;\r\n if(!empty($this->items)){foreach($this->items as $item){\r\n $form.='\r\n <div id=\"item_'.$cpt.'\" class=\"itemwrap\">\r\n <input type=\"hidden\" name=\"item_name_'.$cpt.'\" value=\"'.$item['name'].'\" />\r\n <input type=\"hidden\" name=\"quantity_'.$cpt.'\" value=\"'.$item['quantity'].'\" />\r\n <input type=\"hidden\" name=\"amount_'.$cpt.'\" value=\"'.$item['price'].'\" />\r\n <input type=\"hidden\" name=\"shipping_'.$cpt.'\" value=\"'.$item['shipping'].'\" />\r\n </div>';\r\n $cpt++;\r\n }}\r\n\r\n //==> The submit button, (you can specify here your own button) <==//\r\n $form.='\r\n <input id=\"ppcheckoutbtn\" type=\"submit\" value=\"Checkout\" class=\"button\" />\r\n </form>';\r\n\r\n return $form;\r\n }", "public function processCreditCard()\n {\n $this->load();\n\n $multiBuyer = new MultiBuyer($this->request, [self::INDEX_CREDIT_CARD]);\n $multiBuyerCustomer = $multiBuyer->createCustomers();\n\n if (!$this->isValidateCreditCardRequest()) {\n Log::create()\n ->error(LogMessages::INVALID_CREDIT_CARD_REQUEST, __METHOD__)\n ->withOrderId($this->session->data['order_id']);\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $card = $this->fillCreditCardData(0);\n $orderData = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n $orderData['saveCreditCard'] = $card['saveThisCard'];\n\n try {\n $response = $this->createCreditCardOrder(\n (double)$card['paymentDetails'][2],\n $card['paymentDetails'][0],\n $orderData,\n $card['cardToken'],\n [$card['cardId']],\n isset($multiBuyerCustomer[0]) ? $multiBuyerCustomer[0] : null\n );\n } catch (Exception $e) {\n Log::create()\n ->error(LogMessages::UNABLE_TO_CREATE_ORDER, __METHOD__)\n ->withOrderId($this->session->data['order_id'])\n ->withException($e);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderStatus = $this->getOrder()->translateStatusFromMP($response);\n if (!$orderStatus) {\n Log::create()\n ->error(LogMessages::UNKNOWN_ORDER_STATUS, __METHOD__)\n ->withResponseStatus($response->status)\n ->withOrderId($this->session->data['order_id']);\n\n $this->response->redirect($this->url->link('checkout/failure'));\n }\n\n $orderComment = $this->data['order_statuses'][$response->status];\n\n $newOrder = $this->getOrder();\n $newOrder->updateOrderStatus($orderStatus, $orderComment);\n\n $this->saveMPOrderId($response->id, $this->session->data['order_id']);\n\n $this->saveOrderCreditcardInfo($response->charges[0]);\n\n $this->response->redirect($this->url->link('checkout/success', '', true));\n }", "function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}" ]
[ "0.7503272", "0.7391417", "0.7170573", "0.7110351", "0.7044694", "0.7041549", "0.6821951", "0.6719731", "0.67184037", "0.65490043", "0.6494395", "0.64865166", "0.64793754", "0.64654046", "0.64470005", "0.6410393", "0.62688303", "0.62668586", "0.6253865", "0.6247276", "0.6232648", "0.6228458", "0.6218657", "0.62153083", "0.6194322", "0.6193811", "0.6192663", "0.6183785", "0.6182903", "0.6164683", "0.6157589", "0.6067444", "0.60543865", "0.60457397", "0.60284346", "0.6028313", "0.6020105", "0.601541", "0.600943", "0.60042053", "0.5999525", "0.5993931", "0.59887755", "0.59887755", "0.59660363", "0.59642226", "0.5955768", "0.5938362", "0.593195", "0.59217435", "0.5895545", "0.58846897", "0.5883382", "0.5882419", "0.5869965", "0.58690345", "0.58643913", "0.58542573", "0.58526206", "0.5842764", "0.5837076", "0.5837076", "0.5834186", "0.58340263", "0.58290565", "0.58233684", "0.5821372", "0.58204275", "0.58127034", "0.5807949", "0.5794343", "0.5788798", "0.57876915", "0.5786401", "0.578214", "0.578114", "0.5780998", "0.5780966", "0.5771353", "0.57641417", "0.575711", "0.57543", "0.57531667", "0.5746085", "0.57436836", "0.5741972", "0.57419115", "0.57392156", "0.5736509", "0.5734124", "0.57340676", "0.572623", "0.57214826", "0.57179075", "0.5705713", "0.5702999", "0.5697285", "0.5696806", "0.5691833", "0.5689906", "0.5685157" ]
0.0
-1
/ Custom CSS and JS, in most cases required only when you decided to go with a custom credit card form
public function payment_scripts() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function edds_credit_card_form( $echo = true ) {\n\n\tglobal $edd_options;\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'edds' ) );\n\t\treturn;\n\t}\n\n\tob_start(); ?>\n\n\t<?php if ( ! wp_script_is ( 'edd-stripe-js' ) ) : ?>\n\t\t<?php edd_stripe_js( true ); ?>\n\t<?php endif; ?>\n\n\t<?php do_action( 'edd_before_cc_fields' ); ?>\n\n\t<fieldset id=\"edd_cc_fields\" class=\"edd-do-validate\">\n\t\t<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>\n\t\t<?php if( is_ssl() ) : ?>\n\t\t\t<div id=\"edd_secure_site_wrapper\">\n\t\t\t\t<span class=\"padlock\">\n\t\t\t\t\t<svg class=\"edd-icon edd-icon-lock\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"28\" viewBox=\"0 0 18 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\t?>\n\t\t<?php if ( ! empty( $existing_cards ) ) { edd_stripe_existing_card_field_radio( get_current_user_id() ); } ?>\n\n\t\t<div class=\"edd-stripe-new-card\" <?php if ( ! empty( $existing_cards ) ) { echo 'style=\"display: none;\"'; } ?>>\n\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t<?php do_action( 'edd_after_cc_expiration' ); ?>\n\t\t</div>\n\n\t</fieldset>\n\t<?php\n\n\tdo_action( 'edd_after_cc_fields' );\n\n\t$form = ob_get_clean();\n\n\tif ( false !== $echo ) {\n\t\techo $form;\n\t}\n\n\treturn $form;\n}", "function give_get_cc_form( $form_id ) {\n\n\tob_start();\n\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_before_cc_fields', $form_id );\n\t?>\n\t<fieldset id=\"give_cc_fields-<?php echo $form_id; ?>\" class=\"give-do-validate\">\n\t\t<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>\n\t\t<?php if ( is_ssl() ) : ?>\n\t\t\t<div id=\"give_secure_site_wrapper-<?php echo $form_id; ?>\">\n\t\t\t\t<span class=\"give-icon padlock\"></span>\n\t\t\t\t<span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>\n\t\t\t</div>\n\t\t<?php endif; ?>\n\t\t<p id=\"give-card-number-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_number-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Card Number', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The (typically) 16 digits on the front of your credit card.', 'give' ) ); ?>\n\t\t\t\t<span class=\"card-type\"></span>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_number\" id=\"card_number-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-number give-input required\" placeholder=\"<?php _e( 'Card number', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-cvc-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_cvc-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'CVC', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"tel\" size=\"4\" autocomplete=\"off\" name=\"card_cvc\" id=\"card_cvc-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-cvc give-input required\" placeholder=\"<?php _e( 'Security code', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\n\t\t<p id=\"give-card-name-wrap-<?php echo $form_id; ?>\" class=\"form-row form-row-two-thirds form-row-responsive\">\n\t\t\t<label for=\"card_name-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Cardholder Name', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The name of the credit card account holder.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"text\" autocomplete=\"off\" name=\"card_name\" id=\"card_name-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-name give-input required\" placeholder=\"<?php esc_attr_e( 'Cardholder Name', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, before expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_before_cc_expiration' );\n\t\t?>\n\t\t<p class=\"card-expiration form-row form-row-one-third form-row-responsive\">\n\t\t\t<label for=\"card_expiry-<?php echo $form_id; ?>\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Expiration', 'give' ); ?>\n\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The date your credit card expires, typically on the front of the card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input type=\"hidden\" id=\"card_exp_month-<?php echo $form_id; ?>\" name=\"card_exp_month\"\n\t\t\t class=\"card-expiry-month\"/>\n\t\t\t<input type=\"hidden\" id=\"card_exp_year-<?php echo $form_id; ?>\" name=\"card_exp_year\"\n\t\t\t class=\"card-expiry-year\"/>\n\n\t\t\t<input type=\"tel\" autocomplete=\"off\" name=\"card_expiry\" id=\"card_expiry-<?php echo $form_id; ?>\"\n\t\t\t class=\"card-expiry give-input required\" placeholder=\"<?php esc_attr_e( 'MM / YY', 'give' ); ?>\"\n\t\t\t required aria-required=\"true\"/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card info form, after expiration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_after_cc_expiration', $form_id );\n\t\t?>\n\t</fieldset>\n\t<?php\n\t/**\n\t * Fires while rendering credit card info form, before the fields.\n\t *\n\t * @param int $form_id The form ID.\n\t *\n\t * @since 1.0\n\t *\n\t */\n\tdo_action( 'give_after_cc_fields', $form_id );\n\n\techo ob_get_clean();\n}", "function edd_stripe_new_card_form() {\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'edds' ) );\n\t\tedd_print_errors();\n\t\treturn;\n\t}\n?>\n\n<p id=\"edd-card-name-wrap\">\n\t<label for=\"card_name\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Name on the Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\t<span class=\"edd-description\"><?php esc_html_e( 'The name printed on the front of your credit card.', 'edds' ); ?></span>\n\t<input type=\"text\" name=\"card_name\" id=\"card_name\" class=\"card-name edd-input required\" placeholder=\"<?php esc_attr_e( 'Card name', 'edds' ); ?>\" autocomplete=\"cc-name\" />\n</p>\n\n<div id=\"edd-card-wrap\">\n\t<label for=\"edd-card-element\" class=\"edd-label\">\n\t\t<?php esc_html_e( 'Credit Card', 'edds' ); ?>\n\t\t<span class=\"edd-required-indicator\">*</span>\n\t</label>\n\n\t<div id=\"edd-stripe-card-element\"></div>\n\t<div id=\"edd-stripe-card-errors\" role=\"alert\"></div>\n\n\t<p></p><!-- Extra spacing -->\n</div>\n\n<?php\n\t/**\n\t * Allow output of extra content before the credit card expiration field.\n\t *\n\t * This content no longer appears before the credit card expiration field\n\t * with the introduction of Stripe Elements.\n\t *\n\t * @deprecated 2.7\n\t * @since unknown\n\t */\n\tdo_action( 'edd_before_cc_expiration' );\n}", "public function payment_fields() {\n echo '<p><strong>Pay securely using your credit card</strong> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/visa.svg\" alt=\"Visa\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/mastercard.svg\" alt=\"Mastercard\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/discover.svg\" alt=\"Discover\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/amex.svg\" alt=\"Amex\" class=\"card-img\" width=\"32\"></p>';\n // Trying render payment form\n // Call orginal payment the Woocommerce\n $this->form();\n }", "public function payment_fields() {\n\t\tparent::payment_fields();\n\n\t\tif ( $this->allow_gift_cards === true ) {\n\t\t\t$path = dirname(plugin_dir_path(__FILE__));\n\n\t\t\tinclude_once $path . '/../assets/frontend/HeartlandGiftFields.php';\n\t\t\twp_enqueue_style('heartland-gift-cards', $path . '/../assets/frontend/css/heartland-gift-cards.css');\n\t\t}\n\t}", "protected function buildCreditCardForm(array $element, FormStateInterface $form_state) {\n\n $plugin = $this->plugin;\n $config = $plugin->getConfig();\n\n $amount = 0;\n // Loading order for loading total price and customer.\n $param = \\Drupal::routeMatch()->getParameter('commerce_order');\n if (isset($param)) {\n if(method_exists($param,'id')) {\n $order_id = $param->id();\n $order = Order::load($order_id);\n $getOrder = $order->getTotalPrice()->getNumber();\n $amount = number_format($getOrder, 2,'.','');\n }\n }\n \n // Build a month select list that shows months with a leading zero.\n $months = [];\n for ($i = 1; $i < 13; $i++) {\n $month = str_pad($i, 2, '0', STR_PAD_LEFT);\n $months[$month] = $month;\n }\n // Build a year select list that uses a 4 digit key with a 2 digit value.\n $current_year = date('Y');\n $years = [];\n for ($i = 0; $i < 14; $i++) {\n $years[$current_year + $i] = $current_year + $i;\n }\n\n $parcelas = [\n -1 => 'Escolha a quantidade de parcelas...',\n ];\n\n $element['#attributes']['class'][] = 'credit-card-form';\n // Placeholder for the detected card type. Set by validateCreditCardForm().\n $element['type'] = [\n '#type' => 'hidden',\n '#value' => '',\n ];\n $element['number'] = [\n '#type' => 'textfield',\n '#title' => t('Card number'),\n '#attributes' => [\n 'autocomplete' => 'off', \n 'id' => 'card-number'\n ],\n '#required' => TRUE,\n '#maxlength' => 19,\n '#size' => 20,\n '#suffix' => '<div id=\"show-card-brand\"></div>',\n ];\n\n $element['expiration'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__expiration'],\n ],\n ];\n\n $element['expiration']['month'] = [\n '#type' => 'select',\n '#title' => t('Month'),\n '#options' => $months,\n '#default_value' => date('m'),\n '#required' => TRUE,\n '#attributes' => ['id' => 'expiration-month'],\n ];\n\n $element['expiration']['divider'] = [\n '#type' => 'item',\n '#title' => '',\n '#markup' => '<span class=\"credit-card-form__divider\">/</span>',\n ];\n\n $element['expiration']['year'] = [\n '#type' => 'select',\n '#title' => t('Year'),\n '#options' => $years,\n '#default_value' => $current_year,\n '#required' => TRUE,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n '#attributes' => ['id' => 'expiration-year'],\n ];\n\n $element['expiration']['security_code'] = [\n '#type' => 'textfield',\n '#title' => t('CVV'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'security-code',\n ],\n '#required' => TRUE,\n '#maxlength' => 10,\n '#size' => 10,\n ];\n\n $element['card_holder_name'] = [\n '#type' => 'textfield',\n '#title' => t('Nome Impresso no cartão'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'holder-name',\n ],\n '#required' => TRUE,\n '#maxlength' => 60,\n '#size' => 60,\n ];\n\n $element['information'] = [\n '#type' => 'container',\n '#attributes' => [\n 'class' => ['credit-card-form__information'],\n ],\n ];\n\n $element['information']['cpf'] = [\n '#type' => 'textfield',\n '#title' => t('CPF do titular'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'cpf-card',\n ],\n '#required' => TRUE,\n '#maxlength' => 20,\n '#size' => 20,\n '#prefix' => '<span>&nbsp;&nbsp;',\n '$suffix' => '</span>',\n ];\n\n $element['information']['birth_date'] = [\n '#type' => 'date',\n '#title' => t('Data de aniversário'),\n '#attributes' => [\n 'autocomplete' => 'off',\n 'id' => 'birth-card',\n ],\n '#date_date_format' => 'd/m/Y',\n '#required' => TRUE,\n ];\n\n $element['installments'] = [\n '#type' => 'select',\n '#title' => t('Deseja parcelar?'),\n '#options' => $parcelas,\n '#default_value' => $parcelas,\n '#required' => TRUE,\n '#attributes' => ['id' => 'installments'],\n '#validated' => TRUE,\n ];\n\n $element['sender_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'sender-hash'],\n ];\n\n $element['card_hash'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-hash'],\n ];\n\n $element['card_brand'] = [\n '#type' => 'hidden',\n '#default_value' => '',\n '#attributes' => ['id' => 'card-brand'],\n ];\n\n $element['#attached']['library'][] = 'commerce_pagseguro_v2/pagseguro_sandbox';\n\n $session = $this->getSession($config);\n // Passing the params session to the .js.\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['session'] = $session;\n $element['#attached']['drupalSettings']['commercePagseguroV2']['commercePagseguro']['amount'] = $amount;\n\n return $element;\n }", "public function payment_fields()\r\n {\r\n \r\n // ok, let's display some description before the payment form\r\n if ($this->description) {\r\n // display the description with <p> tags etc.\r\n echo wpautop(wp_kses_post($this->description));\r\n }\r\n \r\n // I will echo() the form, but you can close PHP tags and print it directly in HTML\r\n echo '<fieldset id=\"wc-' . esc_attr($this->id) . '-cc-form\" class=\"wc-credit-card-form wc-payment-form\" style=\"background:transparent;\">';\r\n \r\n // Add this action hook if you want your custom gateway to support it\r\n do_action('woocommerce_momo_form_start', $this->id);\r\n \r\n // I recommend to use inique IDs, because other gateways could already use #ccNo, #expdate, #cvc\r\n echo '<div class=\"form-row form-row-wide\"><label>Mobile Wallet Provider <span class=\"required\">*</span></label>\r\n\t\t\t\t<select id=\"epaygh_mobile_wallet_network\" name=\"epaygh_mobile_wallet_network\">\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"mtn\" selected>MTN</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"airtel\">Airtel</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"tigo\">Tigo</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"vodafone\">Vodafone</option>\r\n\t\t\t\t</select>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Mobile Wallet Number <span class=\"required\">*</span></label>\r\n\t\t\t\t<input id=\"epaygh_mobile_wallet_number\" name=\"epaygh_mobile_wallet_number\" type=\"tel\">\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Voucher </label>\r\n\t\t\t\t\t<input id=\"epaygh_payment_voucher\" name=\"epaygh_payment_voucher\" type=\"text\" autocomplete=\"off\"><br>\r\n\t\t\t\t\t<span class=\"required\">Leave empty if mobile network is not Vodafone</span>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"clear\"></div>';\r\n \r\n do_action('woocommerce_momo_form_end', $this->id);\r\n \r\n echo '<div class=\"clear\"></div></fieldset>';\r\n }", "function commerce_oz_migs_2p_submit_form($payment_method, $pane_values, $checkout_pane, $order) {\n \n//\t// dsm($payment_method, '$payment_method');\n//\t// dsm($checkout_pane);\n//\t// dsm($pane_values);\n//\t// dsm($order);\n \t \t \t\n // Include the Drupal Commerce credit card file for forms\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n \n\t$settings = _commweb_get_var('commerce_oz_gateway_' . $payment_method['gateway_provider']);\n \n// \tdsm($settings, '$settings');\n\n $form_params = array();\n $form_defaults = array();\n \n // Use CVV Field?\n if($settings['commerce_oz_use_cvv'] == 'cvv')\n {\n \t$form_params['code'] = '';\n }\n \n // Use Card Holder Name Field ?\n if($settings['commerce_oz_use_card_name'] == 'name')\n {\n \t$form_params['owner'] = 'Card Holder';\n }\n \n \n // set the defaults for testing\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n\n\t\t \t$form_defaults['number'] = $settings['commerce_oz_test_card_number'];\n\t\t \t$form_defaults['code'] = $settings['commerce_oz_test_card_cvv'];\n\t\t \t$form_defaults['exp_month'] = $settings['commerce_oz_test_card_exp_month'];\n\t\t \t$form_defaults['exp_year'] = $settings['commerce_oz_test_card_exp_year'];\n\t\t}\n\t\t\n\n $gateway = commerce_oz_load_gateway_provider($payment_method['gateway_provider']);\n \n \t$form = commerce_payment_credit_card_form($form_params, $form_defaults);\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/' . $payment_method['gateway_provider'] . '_68.png';\n\t\n\t$descText = '<a href=\"' . $gateway['owner_website'] . '\"><img src=\"' . $logopath . '\" /></a><br />Enter your payment details below and Click Continue.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n $form['commweb_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => t($payment_method['title']),\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \n\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n // // dsm($form);\n \n \n $form['credit_card']['number']['#description'] = t('<strong>Test Mode</strong> - You can only use the credit cards listed here to test in Test Mode. Valid card numbers are:\n \t\t<br /><br />Master:&nbsp;&nbsp;5123456789012346\n <br />Visa:&nbsp;&nbsp;&nbsp;&nbsp;4987654321098769\n <br />Amex:&nbsp;&nbsp;&nbsp;345678901234564\n <br />Diners:&nbsp;&nbsp;30123456789019\n <br /><br />All CommWeb Test Cards must use 05-2013 as the Expiry Date.');\n\n $form['credit_card']['exp_year']['#description'] = t('<strong>est Mode</strong> - All CommWeb Test Cards must use 05-2013 as the Expiry Date');\n\n $form['credit_card']['owner']['#description'] = t('<strong>Test Mode</strong> - Transactions do NOT require or use the Card Owner field. If you choose to request this information from your users it will however be stored with the transaction record.');\n\n \n \n // Provide a textfield to pass different Amounts to MIGS \n $form['credit_card']['test_amount'] = array(\n '#input' => TRUE,\n\n '#type' => 'textfield',\n '#size' => 6,\n '#maxlength' => 10,\n \t\t\n '#title' => t('Test Mode - Custom Amount'), \n '#default_value' => $order->commerce_order_total['und'][0]['amount'],\n '#disabled' => FALSE,\n '#description' => t('<strong>Test Mode</strong> - Update the Amount (in cents) sent for processing to change your desired transaction response.<br /> Valid amounts are <br />xxx00 = Approved\n <br />xxx05 = Declined. Contact Bank.\n <br />xxx10 = Transaction could not be processed.\n <br />xxx33 = Expired Card.\n <br />xxx50 = Unspecified Failure.\n <br />xxx51 = Insufficient Funds.\n <br />xxx68 = Communications failure with bank'),\n '#required' => FALSE, \n ); \n \n }\n \n \n \t$form['commweb_3p_head']['credit_card'] = $form['credit_card'];\n\tunset($form['credit_card']);\n\t\n//\t// dsm($form);\n\t\n return $form;\n \n}", "function payment_fields() { \n\n\t\tif($this->description) echo '<p>'.$this->description.'</p>';\n\n\t\tif('veritrans_direct'==$this->select_veritrans_payment) : ?>\t\n <p class=\"form-row validate-required\" id=\"veritrans_credit_card_field\">\n <label for=\"veritrans_credit_card_field\">\n <?php _e('Credit Card Number'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <input type=\"text\" class=\"input-text veritrans_credit_card\" maxlength=\"16\">\n </p>\n\n <p class=\"form-row\" id=\"veritrans_card_exp_month_field\">\n <label for=\"veritrans_card_exp_month_field\">\n <?php _e('Expiration Date - Month', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <select class=\"veritrans_card_exp_month\">\n <?php $month_list = array(\n '01' => '01 - January',\n '02' => '02 - February',\n '03' => '03 - March',\n '04' => '04 - April',\n '05' => '05 - May',\n '06' => '06 - June',\n '07' => '07 - July',\n '08' => '08 - August',\n '09' => '09 - September',\n '10' => '10 - October',\n '11' => '11 - November',\n '12' => '12 - December'\n ); ?>\n <option value=\"\">--</option>\n <?php foreach( $month_list as $month => $name ) : ?>\n <option value=\"<?php echo $month; ?>\"><?php echo $name; ?></option>\n <?php endforeach; ?>\n </select>\n </p>\n\n <p class=\"form-row\" id=\"veritrans_card_exp_year_field\">\n <label for=\"veritrans_card_exp_year_field\">\n <?php _e('Expiration Date - Year', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\">*</abbr>\n </label>\n <select class=\"veritrans_card_exp_year\">\n <option value=\"\">--</option>\n <?php $years = range( date(\"Y\"), date(\"Y\") + 14 );\n foreach( $years as $year ) : ?>\n <option value=\"<?php echo $year; ?>\"><?php echo $year; ?></option>\n <?php endforeach; ?>\n </select>\n </p>\n\n <p class=\"form-row validate-required\" id=\"veritrans_security_field\" maxlength=\"3\">\n <label for=\"veritrans_security_field\">\n <?php _e('Security Code', 'woocommerce'); ?>\n <abbr class=\"required\" title=\"required\"><a target=\"_blank\" href=\"https://www.veritrans.co.id/payment-help.html\">[?]</a></abbr>\n </label>\n <input type=\"text\" class=\"input-text veritrans_security\">\n </p>\n\n <input type=\"text\" name=\"veritrans_token_id\" class=\"hide\" style=\"display:none\">\n <?php endif; ?>\n <?php }", "function TrialSignupForm(){\n\t $cardType = array(\n\t \t\"visa\"=>\"<img src='themes/attwiz/images/visa.png' height=30px></img>\",\n\t \t\"mc\"=>\"<img src='themes/attwiz/images/mastercard.jpeg' height=30px></img>\",\n\t \t\"amex\"=>\"<img src='themes/attwiz/images/ae.jpeg' height=30px></img>\",\n\t \t\"discover\"=>\"<img src='themes/attwiz/images/discover.jpeg' height=30px></img>\"\n\t );\n\t $monthArray = array();\n\t for($i =1;$i <=12; $i++){\n\t \t$monthArray[$i]=date('F',mktime(0,0,0,$i));\n\t }\n\t\t$yearArray = array();\n\t $currentYear = date('Y');\n\t\tfor($i =0;$i <=10; $i++){\n\t \t$yearArray[$currentYear+$i]=$currentYear+$i;\n\t }\n\t $trialExpiryDate = date('F-j-Y',mktime(0,0,0,date('n')+1,date('j'),date('Y')));\n\t $subscriptionInfo = \"<div id='SubscriptionInfo'><h2>Post-Trial Subscription Selection</h2>\n\t <p>Your 10 heatmaps will expire on $trialExpiryDate, at which time your account \n\t will be replenished with a new allocation of heatmap credits according to the \n\t subscription level you choose below. You may cancel your subscription any time \n\t before your trial period ends and your credit card will only be charged 1 dollar.</p></div>\";\n\t $subscriptionType = array(\n\t \t\t\"1\"=>\"Bronze - (10 heatmaps for $27.00 / month)\",\n\t \t\t\"2\"=>\"Silver - (50 heatmaps for $97.00 / month)\",\n\t \t\t\"3\"=>\"Gold - (200 heatmaps for $197.00 / month)\"\n\t );\n\t\t$whatsThis = '<span id=\"WhatsThis\"><a id=\"WhatsThisImage\" href=\"themes/attwiz/images/cvv.jpg\" title=\"What\\'s this?\">What\\'s this?</a></span>';\n\t\t$fields = new FieldList(\n\t\t\tnew TextField('FirstName', 'First Name'),\n\t\t\tnew TextField('LastName', 'Last Name'),\n\t\t\tnew TextField('Company', 'Company(optional)'),\n\t\t\tnew TextField('StreetAddress1', 'Street Address1'),\n\t\t\tnew TextField('StreetAddress2', 'Street Address2(optional)'),\n\t\t\tnew TextField('City', 'City'),\n\t\t\tnew TextField('State', 'State/Province'),\n\t\t\tnew TextField('PostalCode', 'Zip/Poatal Code'),\n\t\t\tnew CountryDropdownField('Country'),\n\t\t\tnew OptionsetField('CreditCardType','Credit Card Type',$cardType,'visa'),\n\t\t\tnew TextField('NameOnCard', 'Name On Card'),\n\t\t\tnew NumericField('CreditCardNumber', 'Credit Card Number'),\n\t\t\tnew PasswordField('CVVCode', 'Security/CVV Code'),\n\t\t\tnew LiteralField('WhatIsThis', $whatsThis),\n\t\t\tnew DropdownField('ExpirationMonth','Expiration Date',$monthArray),\n\t\t\tnew DropdownField('ExpirationYear','',$yearArray),\n\t\t\tnew LiteralField('SubscriptionInfo', $subscriptionInfo),\n\t\t\tnew OptionsetField('SubscriptionType','',$subscriptionType,'1'),\n\t\t\tnew CheckboxField('Agreement',' I understand that this is a recurring subscription and I will be billed monthly unless I cancel.')\n\t\t);\n\t // Create action\n\t $actions = new FieldList(\n\t\t\t$submit = new FormAction('doSignup','Start Trial')\n\t );\n\t $submit->setAttribute('src', 'themes/attwiz/images/button_startmytrialnow.gif');\n\t\t// Create action\n\t\t$validator = new RequiredFields(\n\t\t\t\t\t\t\t'FirstName',\n\t\t\t\t\t\t\t'LastName',\n\t\t\t\t\t\t\t'StreetAddress1',\n\t\t\t\t\t\t\t'City',\n\t\t\t\t\t\t\t'State',\n\t\t\t\t\t\t\t'PoatalCode',\n\t\t\t\t\t\t\t'Country',\n\t\t\t\t\t\t\t'CreditCardType',\n\t\t\t\t\t\t\t'NameOnCard',\n\t\t\t\t\t\t\t'CreditCardNumber',\n\t\t\t\t\t\t\t'CVVCode',\n\t\t\t\t\t\t\t'ExpirationMonth',\n\t\t\t\t\t\t\t'ExpirationYear',\n\t\t\t\t\t\t\t'SubscriptionInfo',\n\t\t\t\t\t\t\t'SubscriptionType'\n\t\t);\n\t\t\n\t\t$validator = null;\n\t \t$form = new Form($this, 'TrialSignupForm', $fields, $actions, $validator);\n\t \t$data = Session::get(\"FormInfo.Form_TrialSignupForm.data\"); \n\t\tif(is_array($data)) \n\t\t $form->loadDataFrom($data);\n\t\treturn $form;\t\t\n\t}", "public function registerJqueryPaymentScripts() {\n $view = $this->getView();\n JqueryPaymentAsset::register($view);\n if ($this->applyJqueryPaymentFormat) {\n $js = \"jQuery(function($) {\n $('input[data-stripe=\" . self::NUMBER_ID . \"]').payment('formatCardNumber');\n $('input[data-stripe=\" . self::CVC_ID . \"]').payment('formatCardCVC');\n $('input[data-stripe=\" . self::EXP_ID . \"]').payment('formatCardExpiry');\n $('input[data-stripe=\" . self::NAME_ID . \"]').payment('formatCardName');\n $('input[data-stripe=\" . self::POSTAL_CODE_ID . \"]').payment('formatCardPostalCode');\n });\";\n $view->registerJs($js);\n }\n //Jquery client validation submit\n if ($this->applyJqueryPaymentValidation) {\n $js = 'jQuery(function($) {\n $.fn.toggleInputError = function(erred) {\n this.closest(\".form-group\").toggleClass(\"' . $this->errorClass . '\", erred);\n return this;\n };\n $(\"#' . $this->options['id'] . ' button\").on(\"click\", function(e) {\n var $form = $(\"#' . $this->options['id'] . '\");\n var $number = $(\"input[data-stripe=' . self::NUMBER_ID . ']\");\n var $cvc = $(\"input[data-stripe=' . self::CVC_ID . ']\");\n var $exp = $(\"input[data-stripe=' . self::EXP_ID . ']\");\n var $exp = $(\"input[data-stripe=' . self::NAME_ID . ']\");\n var $exp = $(\"input[data-stripe=' . self::POSTAL_CODE_ID . ']\");\n var cardType = $.payment.cardType($number.val());\n $(\"#' . $this->brandContainerId . '\").text(cardType);\n $number.toggleInputError(!$.payment.validateCardNumber($number.val()));\n $cvc.toggleInputError(!$.payment.validateCardCVC($cvc.val(), cardType));\n if ($exp.length) {\n $exp.toggleInputError(!$.payment.validateCardExpiry($exp.payment(\"cardExpiryVal\")));\n var fullDate = $exp.val();\n var res = fullDate.split(\" / \", 2);\n $month.val(res[0]);\n $year.val(res[1]);\n }else{\n $month.toggleInputError(!$.payment.validateCardExpiry($month.val(), $year.val()));\n $year.toggleInputError(!$.payment.validateCardExpiry($month.val(), $year.val()));\n }\n if($form.find(\".' . $this->errorClass . '\").length != 0){\n e.preventDefault();\n return false;\n }else{\n $(this).prop(\"disabled\", true);\n Stripe.card.createToken($form, stripeResponseHandler);\n return true;\n }\n });\n });';\n $view->registerJs($js);\n }\n }", "public function creditCardPayment()\n {\n }", "function honeycomb_credit() {\n\t\t?>\n\t\t<div class=\"site-info\">\n\t\t\t<?php echo esc_html( apply_filters( 'honeycomb_copyright_text', $content = '&copy; ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>\n\t\t\t<?php if ( apply_filters( 'honeycomb_credit_link', true ) ) { ?>\n\t\t\t<br /> <?php echo __(sprintf( esc_attr__( '%1$s powered by %2$s.', 'honeycomb' ), 'Honeycomb', '<a href=\"https://wp-property-hive.com\" title=\"Property Hive - The Leading WordPress Platform For Estate Agency Websites\" rel=\"author\">Property Hive</a>' ), 'propertyhive'); ?>\n\t\t\t<?php } ?>\n\t\t</div><!-- .site-info -->\n\t\t<?php\n\t}", "public function js_credit_card_scriptchangecard()\n\t{\n\t\t// with radio buttons, suitable for form use\n\t\treturn \"\n\t\tfunction ChangeCard(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tout_txt = '<table width=\\\"100%\\\"><tr>';\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tchecked = i==0?' CHECKED':'';\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tcard_id = cardlist[val][code][2];\n\t\t\t\t\t\tpayment_gateway_id = cardlist[val][code][3];\n\n\t\t\t\t\t\tout_txt += '<td height=50><input type=\\\"radio\\\" name=\\\"payment_methods\\\" id=\\\"card_'+ code +'\\\" value=\\\"'+ card_id + \\\"%%\\\" + payment_gateway_id + \\\"%%\\\" + code +'\\\" align=\\\"absmiddle\\\"'+ checked +'> <label for=\\\"card_'+ code +'\\\" onclick=\\\"document.getElementById(\\'card_' + code + '\\').click();\\\">';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (cur_card[1] != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '<img src=\\\"/images/'+ cur_card[1] +'\\\" align=\\\"absmiddle\\\" alt=\\\"'+ cur_card[0] +'\\\" title=\\\"'+ cur_card[0] +'\\\"></lable></td>';\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\tout_txt += '<label for=\\\"card_'+ code +'\\\">'+ cur_card[0] +'</lable></td>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i%2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '</tr><tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif (i%2)\n\t\t\t\t\t{\n\t\t\t\t\t\tout_txt += '<td></td>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tobj.innerHTML = out_txt+'</tr></table>';\n\t\t\t}\n\t\t}\n\n\t\tfunction HideCard(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tout_txt = '<input type=\\\"hidden\\\" name=\\\"payment_methods\\\" id=\\\"card_'+ code +'\\\" value=\\\"'+ code +'\\\">';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tobj.innerHTML = out_txt;\n\t\t\t}\n\t\t}\n\n\t\tfunction ChangeCardNoRadio(val, obj)\n\t\t{\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tout_txt = '';\n\t\t\t\tif (val != '')\n\t\t\t\t{\n\t\t\t\t\tvar i = 0;\n\n\t\t\t\t\tfor (var code in cardlist[val])\n\t\t\t\t\t{\n\t\t\t\t\t\tcur_card = cardlist[val][code];\n\t\t\t\t\t\tif (cur_card[1] != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout_txt += '<img width=\\\"60\\\" src=\\\"/images/'+ cur_card[1] +'\\\" align=\\\"absmiddle\\\" alt=\\\"'+ cur_card[0] +'\\\" title=\\\"'+ cur_card[0] +'\\\">&nbsp;';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tobj.innerHTML = out_txt;\n\t\t\t}\n\t\t}\n\n\t\tfunction InitCard(obj)\n\t\t{\n\t\t\tfor (var i in cardlist)\n\t\t\t{\n\t\t\t\tobj.options[obj.options.length]=new Option(cardlist[i][0], i);\n\t\t\t}\n\t\t}\";\n\t}", "function commerce_braintree_creditcard_edit_form($form, &$form_state, $sid) {\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n $form_state['build_info']['files']['form'] = drupal_get_path('module', 'commerce_braintree') . '/commerce_braintree.form.inc';\n $sub = commerce_braintree_subscription_local_get(array('sid' => $sid), FALSE);\n $payment = commerce_payment_method_instance_load('braintree|commerce_payment_braintree');\n $creditcard = commerce_braintree_creditcard_get_by_token($sub['token']);\n $billing_address = isset($creditcard->billingAddress) ? $creditcard->billingAddress : null;\n $form['payment_method'] = array(\n '#type' => 'fieldset', \n '#title' => t('Payment Method Details'),\n );\n $form['payment_method']['ca_cardholder_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Cardholder Name'),\n '#default_value' => isset($creditcard->cardholderName) ? $creditcard->cardholderName : '',\n );\n // NOTE: A hidden field is changable via Firebug. Value is not.\n // Because there's no validation, this would have allowed any user with access to this form\n // to change any credit card on the website for any user, providing they guess another ca_token.\n //$form['payment_method']['ca_token'] = array('#type' => 'value', '#value' => $token);\n $form['payment_method']['sid'] = array('#type' => 'value', '#value' => $sid);\n \n\n \n // Prepare the fields to include on the credit card form.\n $fields = array(\n 'code' => '',\n );\n\n // Add the credit card types array if necessary.\n $card_types = array_diff(array_values($payment['settings']['card_types']), array(0));\n if (!empty($card_types)) {\n $fields['type'] = $card_types;\n }\n \n $defaults = array(\n 'type' => isset($creditcard->cardType) ? $creditcard->cardType : '',\n 'number' => isset($creditcard->maskedNumber) ? $creditcard->maskedNumber : '', \n 'exp_month' => isset($creditcard->expirationMonth) ? $creditcard->expirationMonth : '', \n 'exp_year' => isset($creditcard->expirationYear) ? $creditcard->expirationYear : '',\n );\n \n // load oder\n $order = commerce_order_load($sub['order_id']);\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n // get profile id\n $profile_id = $order_wrapper->commerce_customer_billing->profile_id->value();\n \n // load customer profile\n $profile = commerce_customer_profile_load($profile_id);\n \n if (isset($profile->commerce_customer_address['und']['0']['first_name'])) {\n $profile->commerce_customer_address['und']['0']['first_name'] = isset($billing_address->firstName) ? $billing_address->firstName :'' ;\n }\n if (isset($profile->commerce_customer_address['und']['0']['last_name'])) {\n $profile->commerce_customer_address['und']['0']['last_name'] = isset($billing_address->lastName) ? $billing_address->lastName : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['organisation_name'])) {\n // //company\n $profile->commerce_customer_address['und']['0']['organisation_name'] = isset($billing_address->company) ? $billing_address->company :'';\n }\n if (isset($profile->commerce_customer_address['und']['0']['administrative_area'])) {\n //state\n $profile->commerce_customer_address['und']['0']['administrative_area'] = isset($billing_address->region) ? $billing_address->region : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['premise'])) {\n //address 2\n $profile->commerce_customer_address['und']['0']['premise'] = isset($billing_address->extendedAddress) ? $billing_address->extendedAddress : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['locality'])) {\n //city\n $profile->commerce_customer_address['und']['0']['locality'] = isset($billing_address->locality) ? $billing_address->locality : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['postal_code'])) {\n //postal code\n $profile->commerce_customer_address['und']['0']['postal_code'] = isset($billing_address->postalCode) ? $billing_address->postalCode : '';\n }\n if (isset($profile->commerce_customer_address['und']['0']['thoroughfare'])) {\n // address 1\n $profile->commerce_customer_address['und']['0']['thoroughfare'] = isset($billing_address->streetAddress) ? $billing_address->streetAddress : '';\n }\n \n // Add the field related form elements.\n $form_state['customer_profile'] = $profile;\n // Attach address field to form\n field_attach_form('commerce_customer_profile', $profile, $form, $form_state);\n $form['commerce_customer_address']['#weight'] = '0';\n $form['payment_method'] += commerce_payment_credit_card_form($fields, $defaults);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n \n \n $form['#validate'][] = 'commerce_braintree_creditcard_edit_form_validate';\n $form['#submit'][] = 'commerce_braintree_creditcard_edit_form_submit';\n return $form;\n}", "public function payment_fields() {\n\n $cc_form = new WC_Payment_Gateway_CC;\n $cc_form->id = $this->id;\n $cc_form->supports = $this->supports;\n $this->cc_form = $cc_form;\n $this->images_dir = plugin_dir_url(__FILE__).'../assets/images/';\n \n $form_template = realpath(dirname(__FILE__)).'/../templates/payment_form.php'; \n include_once($form_template); \n }", "public function init_form_fields(){\n \n $this->form_fields = apply_filters( 'wc_pay_on_credit_form_fields', array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Pay On Credit', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title for the payment method the customer sees during checkout.', $this->domain ),\n 'default' => __( 'Pay On Credit', $this->domain ),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __( 'Split your cost over a period and pay', $this->domain ),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '', // Empty by default\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'description' => __( 'Choose whether order status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'class' => 'wc-enhanced-select',\n 'options' => wc_get_order_statuses()\n ),\n 'status_text' => array(\n 'title' => __( 'Order Status Text', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'Set the text for the selected order status.', $this->domain ),\n 'default' => __( 'Order is completed', $this->domain ),\n 'desc_tip' => true,\n ),\n ) );\n }", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<p class=\"form-row form-row-wide\">\n\t\t\t<label for=\"social-security-number\">\n\t\t\t\t<?php echo __( 'Social Security Number', 'payex-woocommerce-payments' ); ?>\n\t\t\t\t<abbr class=\"required\">*</abbr>\n\t\t\t</label>\n\t\t\t<input type=\"text\" class=\"input-text required-entry\" name=\"social-security-number\"\n\t\t\t\t id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t</p>\n\t\t<?php\n\t}", "function wpcf_footer_credit_render() {\n $option = get_option('wpcf_footer_credit', false);\n if (!empty($option['active'])) {\n // Set message\n $data = wpcf_footer_credit_defaults();\n if (isset($option['message']) && isset($data[$option['message']])) {\n $message = $data[$option['message']];\n } else {\n $message = $data[0];\n }\n $template = get_template();\n if ($template == 'canvas') {\n echo '<p style=\"margin-bottom:10px;\">' . $message . '</p>';\n } else if ($template == 'genesis') {\n echo '<div id=\"types-credits\" class=\"creds\"><p>' . $message . '</p></div>';\n } else if ($template == 'thesis_18') {\n echo '<p>' . $message . '</p>';\n } else if ($template == 'headway') {\n echo '<p style=\"float:none;\" class=\"footer-left footer-headway-link footer-link\">' . $message . '</p>';\n } else if ($template == 'twentyeleven') {\n echo $message . '<br />';\n } else if ($template == 'twentyten') {\n echo str_replace('<a ', '<a style=\"background:none;\" ', $message) . '<br />';\n } else {\n echo '<div id=\"types-credits\" style=\"margin: 10px 0 10px 0;width:95%;text-align:center;font-size:0.9em;\">' . $message . '</div>';\n }\n }\n}", "function javascript_validation() {\n $js = ' if (payment_method == \"' . $this->code . '\") {' . \"\\n\" .\n ' var cc_owner = document.getElementById(\"paymentech_field_0\").value;' . \"\\n\" .\n ' var cc_number = document.getElementById(\"paymentech_field_1\").value;' . \"\\n\";\n if (MODULE_PAYMENT_PAYMENTECH_USE_CVV == 'True') {\n $js .= ' var cc_cvv = document.getElementById(\"paymentech_field_4\").value;' . \"\\n\";\n }\n $js .= ' if (cc_owner == \"\" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . \"\\n\" .\n ' error_message = error_message + \"' . MODULE_PAYMENT_PAYMENTECH_TEXT_JS_CC_OWNER . '\";' . \"\\n\" .\n ' error = 1;' . \"\\n\" .\n ' }' . \"\\n\" .\n ' if (cc_number == \"\" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . \"\\n\" .\n ' error_message = error_message + \"' . MODULE_PAYMENT_PAYMENTECH_TEXT_JS_CC_NUMBER . '\";' . \"\\n\" .\n ' error = 1;' . \"\\n\" .\n ' }' . \"\\n\";\n if (MODULE_PAYMENT_PAYMENTECH_USE_CVV == 'True') {\n $js .= ' if (cc_cvv == \"\" || cc_cvv.length < \"3\" || cc_cvv.length > \"4\") {' . \"\\n\".\n ' error_message = error_message + \"' . MODULE_PAYMENT_PAYMENTECH_TEXT_JS_CC_CVV . '\";' . \"\\n\" .\n ' error = 1;' . \"\\n\" .\n ' }' . \"\\n\" ;\n }\n $js .= ' }' . \"\\n\";\n\n return $js;\n }", "function payment_fields() {\n if ($this->description) echo wpautop(wptexturize($this->description));\n ?>\n <ol class=\"my-list\">\n <li>Entrez votre numéro MTN Mobile Money dans le champ de formulaire ci-dessous</li>\n <li>Vous recevrez un message vous demandant de composer *126# et d'entrer votre code PIN</li>\n <li>Composez *126# et entrez votre code PIN pour confirmer votre paiement</li>\n <li>Si le paiement est effectué, votre commande sera automatiquement validé</li>\n </ol>\n\n <label for=\"\">Entrez votre numéro MTN Mobile Money</label>\n\n <input type=\"text\" name=\"gt_user_momo_number\" value=\"\"\n style=\"background-color: #fff; border-radius: 0px; color: #222;\"required class=\"form-controll\"\n placeholder=\"Enter your phone number\">\n <?php\n }", "public function init()\n {\n parent::init();\n $this->_msgCat = 'creditcard';\n $this->initI18N(__DIR__);\n\n $this->options['type'] = $this->type;\n $this->options['autocomplete'] = $this->autocomplete;\n $this->options['placeholder'] = ($this->placeholder === null)\n ? Yii::t('creditcard', 'CV code')\n : $this->placeholder;\n\n $this->registerAssets();\n echo Html::tag('div', $this->renderInput(), $this->containerOptions);\n }", "function ywccp_add_custom_style() {\r\n\r\n\t\t$css = \"\";\r\n\r\n\t\t// checkout columns\r\n\t\t$one_columns = get_option( 'ywccp-field-checkout-columns' ) == 'yes';\r\n\t\tif( $one_columns ) {\r\n\t\t\t$css .= \"#customer_details .col-1, #customer_details .col-2 { float: none; width:100%; margin-bottom: 10px; }\r\n\t\t#customer_details .col-1:after, #customer_details .col-2:after { content: ''; display: table; clear: both; }\";\r\n\t\t}\r\n\r\n\t\t$input_height\t\t = get_option( 'ywccp-field-input-height' );\r\n\t\t$color_border = get_option( 'ywccp-field-border-color' );\r\n\t\t$focus_color_border = get_option( 'ywccp-field-border-color-focus' );\r\n\t\t$success_color_border = get_option( 'ywccp-field-border-color-success' );\r\n\t\t$invalid_color_border = get_option( 'ywccp-field-border-color-error' );\r\n\t\t$invalid_color_message = get_option( 'ywccp-field-error-color' );\r\n\r\n\t\t$css .= \"\r\n\t.woocommerce form .form-row input.input-text,\r\n\t.woocommerce form .form-row .select2-container .select2-choice,\r\n\t.woocommerce form .form-row select { height: {$input_height}px; }\r\n\t.woocommerce form .form-row .select2-container .select2-choice,\r\n\t.woocommerce form .form-row input.input-text ,\r\n\t.woocommerce form .form-row select,\r\n\t.woocommerce form .form-row textarea { border-color: {$color_border}; }\r\n\t.woocommerce form .form-row .select2-container .select2-choice,\r\n\t.woocommerce form .form-row input.input-text :focus,\r\n\t.woocommerce form .form-row select:focus, \r\n\t.woocommerce form .form-row textarea:focus { border-color: {$focus_color_border}; }\r\n\t.woocommerce form .form-row.woocommerce-validated .select2-container .select2-choice, \r\n\t.woocommerce form .form-row.woocommerce-validated input.input-text , \r\n\t.woocommerce form .form-row.woocommerce-validated select,\r\n\t.woocommerce form .form-row.woocommerce-validated textarea { border-color: {$success_color_border}; }\r\n\t.woocommerce form .form-row.woocommerce-invalid .select2-container .select2-choice, \r\n\t.woocommerce form .form-row.woocommerce-invalid input.input-text , \r\n\t.woocommerce form .form-row.woocommerce-invalid select,\r\n\t.woocommerce form .form-row.woocommerce-invalid textarea { border-color: {$invalid_color_border}; }\r\n\t.woocommerce form .form-row.woocommerce-invalid label,\r\n\t.woocommerce form .form-row.woocommerce-invalid .ywccp_error { color: {$invalid_color_message}; }\";\r\n\r\n\t\treturn apply_filters( 'ywccp_custom_style_frontend', $css );\r\n\t}", "function getFormCC($confirmation)\n {\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_OWNER . '</div>',\n 'field' => '<span id=\"card-owner-field\"></span><span id=\"card-owner-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_NUMBER . '</div>',\n 'field' => '<span id=\"card-number-field\"></span><span id=\"card-number-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_EXPIRY . '</div>',\n 'field' => '<span class=\"paymill-expiry\"><span id=\"card-expiry-month-field\"></span>&nbsp;<span id=\"card-expiry-year-field\"></span></span><span id=\"card-expiry-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'title' => '<div class=\"paymill-label-field\">' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC . '<span class=\"tooltip\" title=\"' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC_TOOLTIP . '\">?</span></div>',\n 'field' => '<span id=\"card-cvc-field\" class=\"card-cvc-row\"></span><span id=\"card-cvc-error\" class=\"paymill-error\"></span>'\n )\n );\n\n array_push($confirmation['fields'], array(\n 'field' => '<form id=\"paymill_form\" action=\"' . xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '\" method=\"post\" style=\"display: none;\"></form>'\n )\n );\n \n return $confirmation;\n }", "public function gateway_cc_form()\n {\n // register the action to remove default CC form\n return;\n }", "public function ec_account_display_credit_card_images( ){\n\t\tif( get_option('ec_option_use_visa') || get_option('ec_option_use_delta') || get_option('ec_option_use_uke') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/visa.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/visa.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\n\t\t}// Visa Card\n\t\t\n\t\tif( get_option('ec_option_use_discover') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/discover.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/discover.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\n\t\t}// Discover\n\t\t\n\t\tif( get_option('ec_option_use_mastercard') || get_option('ec_option_use_mcdebit') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/mastercard.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/mastercard.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\n\t\t}// Mastercard\n\t\t\n\t\tif( get_option('ec_option_use_amex') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/american_express.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/american_express.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\n\t\t}// American Express\n\t\t\n\t\tif( get_option('ec_option_use_jcb') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/jcb.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/jcb.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\n\t\t}// JCB\n\t\t\n\t\tif( get_option('ec_option_use_diners') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/diners.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/diners.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\n\t\t}// Diners\n\t\t\n\t\tif( get_option('ec_option_use_maestro') || get_option('ec_option_use_laser') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/maestro.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/maestro.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\n\t\t}// Maestro\n\t\t\n\t}", "function show_form( $atts=null, $form=true ) {\n global $wpdb, $isPolitical, $currencySymbol, $eligibility;\n \n $check_security = $this->check_security();\n \n if($check_security!==true) {\n return false;\n exit();\n }\n \n extract( shortcode_atts( array(\n 'amounts' => null,\n 'amount_as_input' => null,\n 'source' => null,\n 'thanks_url' => null,\n 'custom_amt_off' => 'false',\n 'button' => 'Submit',\n 'default_state' => null\n ), $atts ) );\n if(isset($_GET['amounts']) && !empty($_GET['amounts'])) {\n $amounts = $_GET['amounts'];\n }\n \n if(isset($_GET['source'])) {\n $source = $_GET['source'];\n } else if(isset($_GET['refcode'])) {\n $source = $_GET['refcode'];\n }\n \n if($amounts) {\n $amounts = explode(',', $amounts);\n $this->custom_amt_options = array();\n \n foreach($amounts as $amount) {\n $ths_amt = round($amount, 0);\n $ths_amt = (string) $ths_amt;\n $this->custom_amt_options[$ths_amt*100] = '$'.$ths_amt;\n }\n $this->custom_amt_options['custom'] = '<label for=\"custom_dollar_amt\">Other:</label> $<input type=\"text\" %s class=\"amount custom_dollar_amt\" /> <small>('.strtoupper($currencySymbol).')</small>';\n }\n \n $form_fields = '';\n // Loop through and generate the elements\n \n if(isset($source) && !empty($source)) {\n $form_fields .= '<input type=\"hidden\" name=\"Source\" value=\"'.$source.'\" />';\n }\n \n if(isset($this->config_errors) && !empty($this->config_errors)) {\n $form_fields .= $this->config_errors;\n }\n foreach($this->fieldsets as $fieldset_name => $fields) {\n if($isPolitical!=='true' && $fieldset_name=='Employment') {\n continue;\n } else {\n if(isset($thanks_url)) {\n $form_fields .= '<input type=\"hidden\" value=\"'.$thanks_url.'\" id=\"thanks_url\" />';\n }\n $form_fields .= '<fieldset><legend>'.$fieldset_name.'</legend>';\n if(isset($fields['html_intro'])) {\n $form_fields .= $fields['html_intro'];\n unset($fields['html_intro']);\n }\n foreach($fields as $field_key => $field) {\n if(!isset($field['type'])) {\n var_dump($field);\n }\n switch($field['type']) {\n case 'text':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= 'name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"';\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= ' id=\"'.$field['id'].'\" value=\"\"';\n }\n if(!empty($field['label']) && (!isset($field['show_placeholder']) || $field['show_placeholder']=='true')) {\n $form_fields .= ' placeholder=\"'.$field['label'].'\"';\n }\n $form_fields .= ' />';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'file':\n $file = true;\n $form_fields .= '\n <div class=\"file';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true && $field['required']=='true') {\n $form_fields .= '<div class=\"errMsg\">You must provide a '.$field['label'].'.</div>';\n } else if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">There was a problem uploading your file.</div>';\n }\n \n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"file\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" />\n </div>\n ';\n break;\n case 'hidden':\n $form_fields .= '<input type=\"hidden\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n } else if(isset($field['value'])) {\n $form_fields .= $field['value'];\n }\n $form_fields .= '\" />';\n break;\n case 'password':\n $form_fields .= '\n <div class=\"password ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"password\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"/>\n </div>\n ';\n break;\n case 'textarea':\n $form_fields .= '\n <div class=\"textarea';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <textarea name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '</textarea>\n </div>\n ';\n break;\n case 'checkbox':\n if(isset($field['options']) && !empty($field['options'])) {\n $form_fields .= '<fieldset id=\"ngp_'.$field['slug'].'\" class=\"checkboxgroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error\">\n <div class=\"errMsg\">You must check at least one.</div>';\n } else {\n $form_fields .= '\">';\n }\n $form_fields .= '<legend>'.$field['label'];\n if($field['required']=='true') $form_fields .= '<span class=\"required\">*</span>';\n $form_fields .= '</legend>';\n $i = 0;\n foreach($field['options'] as $val) {\n $i++;\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" value=\"'.$val.'\" name=\"'.$field['slug'].'['.$i.']['.$val.']\" id=\"option_'.$i.'_'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"option_'.$i.'_'.$field['slug'].'\">'.$val.'</label></div>'.\"\\r\\n\";\n }\n $form_fields .= '</fieldset>';\n } else {\n $form_fields .= '<div id=\"ngp_'.$field['slug'].'\" class=\"checkbox\">';\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"'.$field['slug'].'\">'.$field['label'].'</label></div>'.\"\\r\\n\";\n $form_fields .= '</div>';\n }\n break;\n case 'radio':\n if(isset($field['slug'])) {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['slug'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n } else {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['id'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n }\n $form_fields .= '\"><legend>'.$field['label'];\n if($field['required']=='true') { $form_fields .= '<span class=\"required\">*</span>'; }\n $form_fields .= '</legend>';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n $i = 0;\n if($field['label']=='Amount' && isset($this->custom_amt_options)) {\n $the_options = $this->custom_amt_options;\n } else {\n $the_options = $field['options'];\n }\n \n if(isset($_GET['amt']) && empty($_POST)) {\n if(strpos($_GET['amt'], '.')===false) {\n $get_amt = $_GET['amt'];\n } else {\n $get_amt = $_GET['amt'];\n }\n \n if(array_key_exists($get_amt, $the_options)) {\n $amt = $get_amt;\n } else {\n $custom_amt = $_GET['amt'];\n }\n } else if(isset($_POST['custom_dollar_amt'])) {\n $custom_amt = $_POST['custom_dollar_amt'];\n } else if(isset($field['slug']) && isset($_POST[$field['slug']])) {\n $amt = $_POST[$field['slug']];\n }\n \n foreach($the_options as $val => $labe) {\n $i++;\n if($val=='custom' && $custom_amt_off=='false') {\n $replace = (isset($custom_amt)) ? 'value=\"'.$custom_amt.'\"' : '';\n $form_fields .= '<div class=\"radio custom-donation-amt\">'.sprintf($labe, $replace).'</div>'.\"\\r\\n\";\n } else {\n $form_fields .= '<div class=\"radio\"><input type=\"radio\" value=\"'.$val.'\"';\n if(isset($field['slug'])) {\n $form_fields .= ' name=\"'.$field['slug'].'\"';\n $form_fields .= ' id=\"'.$i.'_'.$field['slug'].'\" class=\"amount '.$field['slug'].'\"';\n } else {\n $form_fields .= ' id=\"'.$i.'_'.$field['id'].'\" class=\"amount '.$field['id'].'\"';\n }\n if(isset($amt) && $amt==$val) {\n $form_fields .= ' checked';\n }\n $form_fields .= '> <label for=\"'.$i.'_';\n if(isset($field['slug'])) {\n $form_fields .= $field['slug'];\n } else {\n $form_fields .= $field['id'];\n }\n $form_fields .= '\">'.$labe.'</label></div>'.\"\\r\\n\";\n }\n }\n $form_fields .= '</fieldset>';\n break;\n case 'select':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select id=\"'.$field['id'].'\">'.\"\\r\\n\";\n }\n $field_ref = (isset($field['slug'])) ? $field['slug'] : $field['id'];\n if($field_ref!='State' && $field_ref!='cardExpiryMonth' && $field_ref!='cardExpiryYear') {\n $form_fields .= '\n <option>Select an option...</option>\n ';\n }\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\"';\n if(isset($field['slug']) && isset($_POST[$field['slug']]) && $_POST[$field['slug']]==$key) {\n $form_fields .= ' selected=\"selected\"';\n } else if(!empty($default_state) && $default_state==$key) {\n $form_fields .= ' selected=\"selected\"';\n }\n $form_fields .= '>'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '</select>';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'multiselect':\n $form_fields .= '\n <div class=\"multiselect ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <select multiple name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\">'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '\n </select>\n </div>\n ';\n break;\n }\n }\n $form_fields .= '</fieldset>';\n }\n }\n \n $return = '';\n \n if(!empty($form_fields)) {\n $return .= '<div id=\"stripe-msgs\" style=\"display:none;\"></div><form name=\"stripe_payment\" class=\"stripe_payment_submission\" id=\"stripe-payment-form\" action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">';\n \n // if(function_exists('wp_nonce_field')) {\n // $return .= wp_nonce_field('stripe_nonce_field', 'stripe_add', true, false);\n // }\n \n $return .= $form_fields;\n \n $return .= '<div class=\"submit\">\n <input type=\"submit\" value=\"'.$button.'\" />\n </div>\n <div class=\"stripe-payment-form-row-progress\">\n <span class=\"message\"></span>\n </div>';\n if($isPolitical==='true') {\n $return .= str_replace('{{button}}', $button, $eligibility);\n }\n // $return .= '<p class=\"addtl-donation-footer-info\">'.str_replace(\"\\r\\n\", '<br />', str_replace('&lt;i&gt;', '<i>', str_replace('&lt;/i&gt;', '</i>', str_replace('&lt;u&gt;', '<u>', str_replace('&lt;/u&gt;', '</u>', str_replace('&lt;b&gt;', '<b>', str_replace('&lt;/b&gt;', '</b>', get_option('stripe_payments_footer_info')))))))).'</p>';\n $return .= '</form>';\n \n return $return;\n }\n }", "function give_donation_form_validate_cc() {\n\n\t$card_data = give_get_donation_cc_info();\n\n\t// Validate the card zip.\n\tif ( ! empty( $card_data['card_zip'] ) ) {\n\t\tif ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) {\n\t\t\tgive_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) );\n\t\t}\n\t}\n\n\t// Ensure no spaces.\n\tif ( ! empty( $card_data['card_number'] ) ) {\n\t\t$card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no \"+\" signs.\n\t\t$card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces.\n\t}\n\n\t// This should validate card numbers at some point too.\n\treturn $card_data;\n}", "public function payment_fields() {\n\t\t\t\t?>\n\t\t\t\t<div class=\"wc-gateway-havanao\">\n\t\t\t\t\t<p><?php _e( 'Please enter the mobile number you want to charge:' ); ?></p>\n\t\t\t\t\t<input type=\"text\" name=\"havanao_phone_number\" class=\"wc-gateway-havanao__phone-number\" />\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}", "public function addCreditCardElementAjax($form, FormStateInterface $form_state) {\n return $form['cc_wrapper']['cc_container'];\n }", "protected function secure_payment_fields() {\n\t\treturn array(\n\t\t\t'card-number-field' => array(\n\t\t\t\t'class' => 'card-number',\n\t\t\t\t'label' => esc_html__( 'Credit Card Number', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( '•••• •••• •••• ••••', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Number', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'card-expiry-field' => array(\n\t\t\t\t'class' => 'card-expiration',\n\t\t\t\t'label' => esc_html__( 'Credit Card Expiration Date', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( 'MM / YYYY', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Expiration Date', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'card-cvc-field' => array(\n\t\t\t\t'class' => 'card-cvv',\n\t\t\t\t'label' => esc_html__( 'Credit Card Security Code', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'placeholder' => esc_html__( '•••', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t'messages' => array(\n\t\t\t\t\t'validation' => esc_html__( 'Please enter a valid Credit Card Security Code', 'globalpayments-gateway-provider-for-woocommerce' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}", "function display($tpl = null) \n\t{\n\t\t$document = JFactory::getDocument();\n\n\t\t// Assign data to the view\n\t\t$this->msg = 'Payment form';\n \n\t\t// Display the view\n\t\tparent::display($tpl);\n\n\t\t//add custom js here\n\t\t//window.addEvent(\"domready\", function() {\n\t\t$document->addScriptDeclaration('\n\t\t\t$(document).ready(function() {\n\t\t\t $(\"input.ccNo\").payment(\"formatCardNumber\");\n\t\t\t \n\t\t\t $(\"#payment-submit\").click(function(){\n\n\t\t\t \tif ($(\"#payment-form\").parsley().isValid()) {\n\t\t\t\t \t$(this).val(\"Processing...\");\n\t\t\t\t \t$(this).attr(\"disabled\", \"disabled\");\n\t\t\t\t \t$(\"#payment-form\").submit();\n\t\t\t \t}\n\t\t\t \t\n\t\t\t });\n\t\t\n\t\t\t});\n\t\t');\n\n\t\t//add custom css here\n\t\t$style = '.payment-wrapper {\n\t\t\t\tpadding-bottom: 20px;\n\t\t\t}';\n\n\t\t$style .= '.payment-left {\n\t\t\t\tfloat: left;\n\t\t\t\tpadding-right: 10px;\n\t\t\t\tborder-right: 1px solid #ddd;\n\t\t\t}';\n\n\t\t$style .= '.payment-right {\n\t\t\t\tfloat: left;\n\t\t\t\tpadding-left: 25px\n\t\t\t}';\n\n\t\t$style .= '.clear {\n\t\t\t\tclear: both;\n\t\t\t}';\n\n\t\t$style .= '.payment-header {\n\t\t\twidth: 500px;\n\t\t\tborder-top: 1px solid #ccc;\n\t\t\tborder-left: 1px solid #ccc;\n\t\t\tborder-right: 1px solid #ccc;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: #e0d9d9;\n\t\t\tborder-top-left-radius: 4px;\n\t\t\tborder-top-right-radius: 4px;\n\t\t\tfont-size: 14px;\n\t\t\t}';\n\n\t\t$style .= '.payment-body {\n\t\t\twidth: 500px;\n\t\t\tborder: 1px solid #ccc;\n\t\t\tpadding: 10px;\n\t\t\t}';\n\n\t\t\n\t\t$style .= '#payment-form .form-group {\n\t\t\twidth: 100%;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .form-item {\n\t\t\tmargin: 0px 0px 5px 10px ;\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: top;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .form-item input {\n\t\t\twidth: 100%;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .form-item label {\n\t\t\tpadding-left: 5px;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .form-item .divider {\n\t\t\tfont-size: 24px;\n\t\t\tpadding-top: 10px;\n\t\t\tvertical-align: middle;\n\t\t\t}';\n\t\n\t\t//basic form styles\n\t\t$style .= '#payment-form select {\n\t\t\tpadding: 6px 6px;\n\t\t\tmargin: 4px 4px 0px 4px;\n\t\t\theight: 35px;\n\t\t\tfont-size: 14px;\n\t\t\tborder: 1px solid #cccccc;\n\t\t\tborder-radius: 4px;\n\t\t\t}';\n\n\t\t$style .= '#payment-form input {\n\t\t\tdisplay: block;\n\t\t\theight: 20px;\n\t\t\tpadding: 6px 0px 6px 6px;\n\t\t\tmargin: 4px 4px 0px 4px;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.428571429;\n\t\t\tvertical-align: middle;\n\t\t\tborder: 1px solid #cccccc;\n\t\t\tborder-radius: 4px;\n\t\t\t-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n\t\t\t box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n\t\t\t-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n\t\t\t transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n\t\t\t}';\n\n\t\t$style .= '#payment-form textarea {\n\t\t\twidth: 100%;\n\t\t\theight: 50px;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .submit {\n\t\t\twidth: 100%;\n\t\t\theight: 40px;\n\t\t\tfont-size: 14px;\n\t\t\tbackground-color: #EAD78C;\n\t\t\t}';\n\n\t\t$style .= '#payment-form .cc-image {\n\t\t\theight: 15px; \n\t\t\tpadding-left: 5px; \n\t\t\tvertical-align: middle;\n\t\t\t}';\n\n\t\t//form error\n\t\t$style .= 'input.parsley-error, select.parsley-error, textarea.parsley-error {\n\t\t\tcolor: #B94A48;\n\t\t\tbackground-color: #F2DEDE;\n\t\t\tborder: 1px solid #EED3D7;\n\t\t\t}';\n\n\t\t$style .= '.parsley-errors-list {\n\t\t\t\tmargin: 2px 0 3px;\n\t\t\t\tpadding: 0;\n\t\t\t\tlist-style-type: none;\n\t\t\t\tfont-size: 0.9em;\n\t\t\t\tline-height: 0.9em;\n\t\t\t\topacity: 0;\n\t\t\t\t-moz-opacity: 0;\n\t\t\t\t-webkit-opacity: 0;\n\n\t\t\t\ttransition: all .3s ease-in;\n\t\t\t\t-o-transition: all .3s ease-in;\n\t\t\t\t-moz-transition: all .3s ease-in;\n\t\t\t\t-webkit-transition: all .3s ease-in;\n\t\t\t}';\n\n\t\t$style .= '.parsley-errors-list.filled {\n\t\t\t\topacity: 1;\n\t\t\t}';\n\n\t\t$style .= '.parsley-errors-list {\n\t\t\t\tdisplay: none;\n\t\t\t}';\n\n\t\t//form success\n\t\t$style .= 'input.parsley-success, select.parsley-success, textarea.parsley-success {\n\t\t\t color: #468847;\n\t\t\t background-color: #DFF0D8;\n\t\t\t border: 1px solid #D6E9C6;\n\t\t\t}';\n\n\t\t$document->addStyleDeclaration( $style );\n\n\t}", "function sc_shortcode_form() {\r\n\tglobal $sc_url;\r\n\t$fields = get_option('sc_form');\r\n\t$settings = get_option('sc_settings');\r\n\r\n\t$form = '';\r\n\t$form .= '<div id=\"sc_form\">';\r\n\t$form .= '<div class=\"mess\"></div>';\r\n\t$form .= '<form method=\"post\" action=\"\" onsubmit=\"return scCheckForm2()\">';\r\n\t\r\n\tif( $fields!='' ): for($i=0; $i<count($fields); $i++):\r\n\t\t\r\n\t\tif( $fields[$i]['req']==1 ){ $mend = 'mendatory '; $ast = '* '; }\r\n\t\telse { $mend = ''; $ast = ''; }\r\n\t\t\r\n\t\tif( $fields[$i]['mail']==1 ) $mail = 'sc_mail';\r\n\t\telse $mail = '';\r\n\t\t\r\n\t\t$lbl = '<label class=\"'. $mend. $mail .'\" for=\"field_'. $i .'_sc\">'. $ast . $fields[$i]['label'] .'</label>';\r\n\t\t$hid = '<input name=\"field_name[]\" value=\"'. $fields[$i]['label'] .'\" type=\"hidden\" style=\"display:none;\" />';\r\n\t\t\r\n\t\tif( $fields[$i]['type']=='textbox' )\r\n\t\t\t$in = '<input class=\"drwr-txtInp-sc\" name=\"field_val[]\" id=\"field_'. $i .'_sc\" type=\"text\" />';\r\n\t\telse\r\n\t\t\t$in = '<textarea class=\"drwr-txtArea-sc\" rows=\"5\" cols=\"5\" name=\"field_val[]\" id=\"field_'. $i .'_sc\"></textarea>';\r\n\t\t\r\n\t\t$form .= \"\\n\\n<p>\".$hid;\r\n\t\t$form .= \"\\n\".$lbl;\r\n\t\t$form .= \"\\n\".$in.\"</p>\";\r\n\t\r\n\tendfor; endif;\r\n\t\r\n\t\r\n\t//add captcha code starts \r\n\tif( $settings['sc_captcha']==1 ){\r\n\t\t\r\n\t\t$form .= '<p><label>Security Code</label>';\r\n\t\t$form .= '<img src=\"'. $sc_url .'/includes/captcha/securimage_show.php?sid='. md5(uniqid(time())) .'\" alt=\"Security Code\" id=\"sc_image_sc\" style=\"float:left\" />';\r\n\t\t\r\n\t\t$form .= '<a href=\"#\" onclick=\"document.getElementById(\\'sc_image_sc\\').src = \\''. $sc_url .'/includes/captcha/securimage_show.php?sid=\\' + Math.random(); return false\"><img src=\"'. $sc_url .'/includes/captcha/images/refresh.png\" alt=\"Reload Image\" title=\"Reload Image\" style=\"float:left;padding-left:10px;\" /></a></p>';\r\n\t\t\r\n\t\t$form .= '<p><label for=\"sc_code_sc\" class=\"mendatory\">* Verify Code</label>';\r\n\t\t$form .= '<input name=\"sc_code\" id=\"sc_code_sc\" type=\"text\" style=\"text-align:center;\" /></p>';\r\n\t\r\n\t}\r\n\t//add captcha code ends\r\n\t\r\n\t\r\n\t\t$form .= '<p><label>*required fields</label><input value=\"Submit\" type=\"submit\" id=\"sc_submit_sc\" /></p>';\r\n\t$form .= '</form>';\r\n\t$form .= '</div>';\r\n\r\n\t$form .= '<div id=\"sc_thanku_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_thanku'] .'</div></div>';\r\n\t$form .= '<div id=\"sc_error_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_error'] .'</div></div>';\r\n\r\n\treturn $form;\r\n}", "function edd_stripe_manage_cards() {\n\t$enabled = edd_stripe_existing_cards_enabled();\n\tif ( ! $enabled ) {\n\t\treturn;\n\t}\n\n\t$stripe_customer_id = edds_get_stripe_customer_id( get_current_user_id() );\n\tif ( empty( $stripe_customer_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) {\n\t\tedd_set_error( 'edd_stripe_error_limit', __( 'Payment method management is currently unavailable.', 'edds' ) );\n\t\tedd_print_errors();\n\t\treturn;\n\t}\n\n\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\n\tedd_stripe_css( true );\n\tedd_stripe_js( true );\n\t$display = edd_get_option( 'stripe_billing_fields', 'full' );\n?>\n\t<div id=\"edd-stripe-manage-cards\">\n\t\t<fieldset>\n\t\t\t<legend><?php _e( 'Manage Payment Methods', 'edds' ); ?></legend>\n\t\t\t<input type=\"hidden\" id=\"stripe-update-card-user_id\" name=\"stripe-update-user-id\" value=\"<?php echo get_current_user_id(); ?>\" />\n\t\t\t<?php if ( ! empty( $existing_cards ) ) : ?>\n\t\t\t\t<?php foreach( $existing_cards as $card ) : ?>\n\t\t\t\t<?php $source = $card['source']; ?>\n\t\t\t\t<div id=\"<?php echo esc_attr( $source->id ); ?>_card_item\" class=\"edd-stripe-card-item\">\n\n\t\t\t\t\t<span class=\"card-details\">\n\t\t\t\t\t\t<span class=\"card-brand\"><?php echo $source->brand; ?></span>\n\t\t\t\t\t\t<span class=\"card-ending-label\"><?php _e( 'ending in', 'edds' ); ?></span>\n\t\t\t\t\t\t<span class=\"card-last-4\"><?php echo $source->last4; ?></span>\n\t\t\t\t\t\t<?php if ( $card['default'] ) { ?>\n\t\t\t\t\t\t\t<span class=\"default-card-sep\"><?php echo '&mdash; '; ?></span>\n\t\t\t\t\t\t\t<span class=\"card-is-default\"><?php _e( 'Default', 'edds'); ?></span>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"card-meta\">\n\t\t\t\t\t\t<span class=\"card-expiration\"><span class=\"card-expiration-label\"><?php _e( 'Expires', 'edds' ); ?>: </span><span class=\"card-expiration-date\"><?php echo $source->exp_month; ?>/<?php echo $source->exp_year; ?></span></span>\n\t\t\t\t\t\t<span class=\"card-address\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$address_fields = array( \n\t\t\t\t\t\t\t\t'line1' => isset( $source->address_line1 ) ? $source->address_line1 : '',\n\t\t\t\t\t\t\t\t'zip' => isset( $source->address_zip ) ? $source->address_zip : '',\n\t\t\t\t\t\t\t\t'country' => isset( $source->address_country ) ? $source->address_country : '',\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\techo esc_html( implode( ' ', $address_fields ) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span id=\"<?php echo esc_attr( $source->id ); ?>-card-actions\" class=\"card-actions\">\n\t\t\t\t\t\t<span class=\"card-update\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"edd-stripe-update-card\" data-source=\"<?php echo esc_attr( $source->id ); ?>\"><?php _e( 'Update', 'edds' ); ?></a>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<?php if ( ! $card['default'] ) : ?>\n\t\t\t\t\t\t |\n\t\t\t\t\t\t<span class=\"card-set-as-default\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"edd-stripe-default-card\" data-source=\"<?php echo esc_attr( $source->id ); ?>\"><?php _e( 'Set as Default', 'edds' ); ?></a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t$can_delete = apply_filters( 'edd_stripe_can_delete_card', true, $card, $existing_cards );\n\t\t\t\t\t\tif ( $can_delete ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t|\n\t\t\t\t\t\t<span class=\"card-delete\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"edd-stripe-delete-card delete\" data-source=\"<?php echo esc_attr( $source->id ); ?>\"><?php _e( 'Delete', 'edds' ); ?></a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<span style=\"display: none;\" class=\"edd-loading-ajax edd-loading\"></span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<form id=\"<?php echo esc_attr( $source->id ); ?>-update-form\" class=\"card-update-form\" data-source=\"<?php echo esc_attr( $source->id ); ?>\">\n\t\t\t\t\t\t<label><?php _e( 'Billing Details', 'edds' ); ?></label>\n\n\t\t\t\t\t\t<div class=\"card-address-fields\">\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--address1\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo EDD()->html->text( array(\n\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_line1_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t'value' => sanitize_text_field( isset( $source->address_line1 ) ? $source->address_line1 : '' ),\n\t\t\t\t\t\t\t\t'label' => esc_html__( 'Address Line 1', 'edds' ),\n\t\t\t\t\t\t\t\t'name' => 'address_line1',\n\t\t\t\t\t\t\t\t'class' => 'card-update-field address_line1 text edd-input',\n\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t'key' => 'address_line1',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--address2\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo EDD()->html->text( array(\n\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_line2_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t'value' => sanitize_text_field( isset( $source->address_line2 ) ? $source->address_line2 : '' ),\n\t\t\t\t\t\t\t\t'label' => esc_html__( 'Address Line 2', 'edds' ),\n\t\t\t\t\t\t\t\t'name' => 'address_line2',\n\t\t\t\t\t\t\t\t'class' => 'card-update-field address_line2 text edd-input',\n\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t'key' => 'address_line2',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--city\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo EDD()->html->text( array(\n\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_city_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t'value' => sanitize_text_field( isset( $source->address_city ) ? $source->address_city : '' ),\n\t\t\t\t\t\t\t\t'label' => esc_html__( 'City', 'edds' ),\n\t\t\t\t\t\t\t\t'name' => 'address_city',\n\t\t\t\t\t\t\t\t'class' => 'card-update-field address_city text edd-input',\n\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t'key' => 'address_city',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--zip\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo EDD()->html->text( array(\n\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_zip_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t'value' => sanitize_text_field( isset( $source->address_zip ) ? $source->address_zip : '' ),\n\t\t\t\t\t\t\t\t'label' => esc_html__( 'ZIP Code', 'edds' ),\n\t\t\t\t\t\t\t\t'name' => 'address_zip',\n\t\t\t\t\t\t\t\t'class' => 'card-update-field address_zip text edd-input',\n\t\t\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t\t\t\t'key' => 'address_zip',\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--country\">\n\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( sprintf( 'edds_address_country_%1$s', $source->id ) ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Country', 'edds' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$countries = array_filter( edd_get_country_list() );\n\t\t\t\t\t\t\t\t$country = isset( $source->address_country ) ? $source->address_country : edd_get_shop_country();\n\t\t\t\t\t\t\t\techo EDD()->html->select( array(\n\t\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_country_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t\t'name' => 'address_country',\n\t\t\t\t\t\t\t\t\t'label' => esc_html__( 'Country', 'edds' ),\n\t\t\t\t\t\t\t\t\t'options' => $countries,\n\t\t\t\t\t\t\t\t\t'selected' => $country,\n\t\t\t\t\t\t\t\t\t'class' => 'card-update-field address_country',\n\t\t\t\t\t\t\t\t\t'data' => array( 'key' => 'address_country' ),\n\t\t\t\t\t\t\t\t\t'show_option_all' => false,\n\t\t\t\t\t\t\t\t\t'show_option_none' => false,\n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t<p class=\"edds-card-address-field edds-card-address-field--state\">\n\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( sprintf( 'edds_address_state_%1$s', $source->id ) ); ?>\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'State', 'edds' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$selected_state = isset( $source->address_state ) ? $source->address_state : edd_get_shop_state();\n\t\t\t\t\t\t\t\t$states = edd_get_shop_states( $country );\n\t\t\t\t\t\t\t\techo EDD()->html->select( array(\n\t\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_address_state_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t\t'name' => 'address_state',\n\t\t\t\t\t\t\t\t\t'options' => $states,\n\t\t\t\t\t\t\t\t\t'selected' => $selected_state,\n\t\t\t\t\t\t\t\t\t'class' => 'card-update-field address_state card_state',\n\t\t\t\t\t\t\t\t\t'data' => array( 'key' => 'address_state' ),\n\t\t\t\t\t\t\t\t\t'show_option_all' => false,\n\t\t\t\t\t\t\t\t\t'show_option_none' => false,\n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p class=\"card-expiration-fields\">\n\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( sprintf( 'edds_card_exp_month_%1$s', $source->id ) ); ?>\" class=\"edd-label\">\n\t\t\t\t\t\t\t\t<?php _e( 'Expiration (MM/YY)', 'edds' ); ?>\n\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$months = array_combine( $r = range( 1, 12 ), $r );\n\t\t\t\t\t\t\t\techo EDD()->html->select( array(\n\t\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_card_exp_month_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t\t'name' => 'exp_month',\n\t\t\t\t\t\t\t\t\t'options' => $months,\n\t\t\t\t\t\t\t\t\t'selected' => $source->exp_month,\n\t\t\t\t\t\t\t\t\t'class' => 'card-expiry-month edd-select edd-select-small card-update-field exp_month',\n\t\t\t\t\t\t\t\t\t'data' => array( 'key' => 'exp_month' ),\n\t\t\t\t\t\t\t\t\t'show_option_all' => false,\n\t\t\t\t\t\t\t\t\t'show_option_none' => false,\n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<span class=\"exp-divider\"> / </span>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$years = array_combine( $r = range( date( 'Y' ), date( 'Y' ) + 30 ), $r );\n\t\t\t\t\t\t\t\techo EDD()->html->select( array(\n\t\t\t\t\t\t\t\t\t'id' => sprintf( 'edds_card_exp_year_%1$s', $source->id ),\n\t\t\t\t\t\t\t\t\t'name' => 'exp_year',\n\t\t\t\t\t\t\t\t\t'options' => $years,\n\t\t\t\t\t\t\t\t\t'selected' => $source->exp_year,\n\t\t\t\t\t\t\t\t\t'class' => 'card-expiry-year edd-select edd-select-small card-update-field exp_year',\n\t\t\t\t\t\t\t\t\t'data' => array( 'key' => 'exp_year' ),\n\t\t\t\t\t\t\t\t\t'show_option_all' => false,\n\t\t\t\t\t\t\t\t\t'show_option_none' => false,\n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tclass=\"edd-stripe-submit-update\"\n\t\t\t\t\t\t\t\tdata-loading=\"<?php echo esc_attr__( 'Please Wait…', 'edds' ); ?>\"\n\t\t\t\t\t\t\t\tdata-submit=\"<?php echo esc_attr__( 'Update Card', 'edds' ); ?>\"\n\t\t\t\t\t\t\t\tvalue=\"<?php echo esc_attr__( 'Update Card', 'edds' ); ?>\"\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<a href=\"#\" class=\"edd-stripe-cancel-update\" data-source=\"<?php echo esc_attr( $source->id ); ?>\"><?php _e( 'Cancel', 'edds' ); ?></a>\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"card_id\" data-key=\"id\" value=\"<?php echo $source->id; ?>\" />\n\t\t\t\t\t\t\t<?php wp_nonce_field( $source->id . '_update', 'card_update_nonce_' . $source->id, true ); ?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t<?php endif; ?>\n\t\t\t<form id=\"edd-stripe-add-new-card\">\n\t\t\t\t<div class=\"edd-stripe-add-new-card\" style=\"display: none;\">\n\t\t\t\t\t<label><?php _e( 'Add New Card', 'edds' ); ?></label>\n\t\t\t\t\t<fieldset id=\"edd_cc_card_info\" class=\"cc-card-info\">\n\t\t\t\t\t\t<legend><?php _e( 'Credit Card Details', 'easy-digital-downloads' ); ?></legend>\n\t\t\t\t\t\t<?php do_action( 'edd_stripe_new_card_form' ); ?>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<?php\n\t\t\t\t\tswitch( $display ) {\n\t\t\t\t\tcase 'full' :\n\t\t\t\t\t\tedd_default_cc_address_fields();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'zip_country' :\n\t\t\t\t\t\tedd_stripe_zip_and_country();\n\t\t\t\t\t\tadd_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' );\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"edd-stripe-add-card-errors\"></div>\n\t\t\t\t<div class=\"edd-stripe-add-card-actions\">\n\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tclass=\"edd-button edd-stripe-add-new\"\n\t\t\t\t\t\tdata-loading=\"<?php echo esc_attr__( 'Please Wait…', 'edds' ); ?>\"\n\t\t\t\t\t\tdata-submit=\"<?php echo esc_attr__( 'Add new card', 'edds' ); ?>\"\n\t\t\t\t\t\tvalue=\"<?php echo esc_attr__( 'Add new card', 'edds' ); ?>\"\n\t\t\t\t\t/>\n\t\t\t\t\t<a href=\"#\" id=\"edd-stripe-add-new-cancel\" style=\"display: none;\"><?php _e( 'Cancel', 'edds' ); ?></a>\n\t\t\t\t\t<?php wp_nonce_field( 'edd-stripe-add-card', 'edd-stripe-add-card-nonce', false, true ); ?>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</fieldset>\n\t</div>\n\t<?php\n}", "function init_form_fields() {\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'method_enabled' => array(\n 'title' => __( 'Allowed Payment Method', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Customize allowed payment method, separate payment method code with coma. e.g: bank_transfer,credit_card. <br>Leave it default if you are not sure.', 'midtrans-woocommerce' ),\n 'default' => 'credit_card'\n ),\n 'bin_number' => array(\n 'title' => __( 'Allowed CC BINs', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Allowed CC BINs', 'midtrans-woocommerce' ),\n 'description' => __( 'Fill with CC BIN numbers (or bank name) that you want to allow to use this payment button. </br> Separate BIN number with coma Example: 4,5,4811,bni,mandiri', 'midtrans-woocommerce' ),\n 'default' => ''\n ),\n 'promo_code' => array(\n 'title' => __( 'Promo Code', 'midtrans-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Promo Code that would be used for discount. Leave blank if you are not using promo code.', 'midtrans-woocommerce' ),\n 'default' => 'onlinepromomid'\n )\n ));\n }", "protected function form()\n\t{\n\t\t$form = new Form(new Card);\n\n\t\t$form->footer(function ($footer) {\n\t\t\t// 去掉重置按钮\n\t\t\t$footer->disableReset();\n\t\t\t// 去掉查看\n\t\t\t$footer->disableViewCheck();\n\t\t\t// 去掉继续编辑按钮\n\t\t\t$footer->disableEditingCheck();\n\t\t\t// 去掉继续创建按钮\n\t\t\t$footer->disableCreatingCheck();\n\t\t});\n\n\t\t$form -> text('card', __('卡号'));\n\t\t$form -> text('password', __('密码'));\n\t\t//$form ->switch('type', __('类型'));\n\t\t$form->select('type', __('类型'))->options([1 => '天卡', 2 => '周卡', 3 => '月卡', 4 => '季卡', 5 => '半年卡', 6 => '年卡']);\n\t\t$states = [\n\t\t\t'on' => ['value' => 1, 'text' => '已充值', 'color' => 'danger'],\n\t\t\t'off' => ['value' => 0, 'text' => '未充值', 'color' => 'success'],\n\t\t];\n\t\t$form ->switch('consume', __('是否已充值'))->states($states);\n\t\t$form -> text('key', __('被充值Key'));\n\t\t$form -> datetime('consumetime', __('充值时间'))->default(date('Y-m-d H:i:s'));\n $states1 = [\n 'on' => ['value' => 0, 'text' => '未封卡', 'color' => 'success'],\n 'off' => ['value' => 1, 'text' => '被封卡', 'color' => 'danger'],\n ];\n $form ->switch('beifeng', __('是否被封'))->states($states1);\n\n\t\treturn $form;\n\t}", "function wp_stripe_shortcode_legacy( $atts ){\n\n return wp_stripe_form();\n}", "public function build_payment_form($host_obj)\n\t\t{\n\t\t\t$host_obj->add_field('CREDITCARDTYPE', 'Credit Card Type')->renderAs(frm_dropdown)->comment('Please select a credit card type.', 'above')->validation()->fn('trim')->required();\n\t\t\t$host_obj->add_field('FIRSTNAME', 'First Name', 'left')->renderAs(frm_text)->comment('Cardholder first name', 'above')->validation()->fn('trim')->required('Please specify a cardholder first name');\n\t\t\t$host_obj->add_field('LASTNAME', 'Last Name', 'right')->renderAs(frm_text)->comment('Cardholder last name', 'above')->validation()->fn('trim')->required('Please specify a cardholder last name');\n\t\t\t$host_obj->add_field('ACCT', 'Credit Card Number', 'left')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify a credit card number')->regexp('/^[0-9]+$/', 'Credit card number can contain only digits.');\n\t\t\t$host_obj->add_field('CVV2', 'CVV2', 'right')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify Card Verification Number')->numeric();\n\n\t\t\t$host_obj->add_field('EXPDATE_MONTH', 'Expiration Month', 'left')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration month')->numeric();\n\t\t\t$host_obj->add_field('EXPDATE_YEAR', 'Expiration Year', 'right')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration year')->numeric();\n\n\t\t\t$host_obj->add_field('START_MONTH', 'Start Month', 'left')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\t\t\t$host_obj->add_field('START_YEAR', 'Start Year', 'right')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\n\t\t\t$host_obj->add_field('ISSUE', 'Issue Number')->renderAs(frm_text)->renderAs(frm_text)->validation()->fn('trim')->numeric();\n\t\t}", "public function init_panel() {\n\t\t\tif ( ! empty( $this->omise_customer_id ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$viewData['existingCards'] = $this->customerCard->get($this->omise_customer_id);\n\t\t\t\t\t$viewData['cardFormTheme'] = $this->omiseCardGateway->get_option('card_form_theme');\n\t\t\t\t\t$viewData['secure_form_enabled'] = (boolean)$this->omiseCardGateway->get_option('secure_form_enabled');\n\t\t\t\t\t$viewData['formDesign'] = Omise_Page_Card_From_Customization::get_instance()->get_design_setting();\n\t\t\t\t\t$viewData['cardIcons'] = $this->omiseCardGateway->get_card_icons();\n\t\t\t\t\t$this->register_omise_my_account_scripts();\n\n\t\t\t\t\tOmise_Util::render_view( 'templates/myaccount/my-card.php', $viewData );\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// nothing.\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<?php if ( $this->mode === 'SELECT' ): ?>\n\t\t\t<label for=\"factoring-menu\"></label>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Please select payment method:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<select name=\"factoring-menu\" id=\"factoring-menu\" class=\"required-entry\">\n\t\t\t\t<option selected value=\"FINANCING\"><?php echo __( 'Financing Invoice', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t\t<option value=\"CREDITACCOUNT\"><?php echo __( 'Part Payment', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t</select>\n\t\t\t<div class=\"clear\"></div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $this->checkout_field !== 'yes' ): ?>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Social Security Number:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<input type=\"text\" name=\"social-security-number\" id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t<?php endif; ?>\n\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function checkout_assets() {\n\t\tif ( is_checkout() ) {\n\t\t\twp_enqueue_script( 'wc-debit-card-form' );\n\t\t\twp_enqueue_script( 'woocommerce_ebanx_debit', plugins_url( 'assets/js/debit-card.js', WC_EBANX::DIR ), array( 'jquery-payment' ), WC_EBANX::get_plugin_version(), true );\n\t\t}\n\n\t\tparent::checkout_assets();\n\t}", "function init_form_fields() {\n /**\n * Build array of configurations that will be displayed on Admin Panel\n */\n parent::init_form_fields();\n WC_Midtrans_Utils::array_insert( $this->form_fields, 'enable_3d_secure', array(\n 'acquring_bank' => array(\n 'title' => __( 'Acquiring Bank', 'midtrans-woocommerce'),\n 'type' => 'text',\n 'label' => __( 'Acquiring Bank', 'midtrans-woocommerce' ),\n 'description' => __( 'You should leave it empty, it will be auto configured. </br> Alternatively may specify your card-payment acquiring bank for this payment option. </br> Options: BCA, BRI, DANAMON, MAYBANK, BNI, MANDIRI, CIMB, etc (Only choose 1 bank).' , 'midtrans-woocommerce' ),\n 'default' => ''\n )\n ));\n // Make this payment method enabled by default\n $this->form_fields['enabled']['default'] = 'yes';\n }", "function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function javascript_validation() {\r\n $js = ' if (payment_value == \"' . $this->code . '\") {' . \"\\n\" .\r\n $js .= ' var echeck_custname = document.checkout_payment.authorizenet_echeck_bank_accountholder.value;' . \"\\n\";\r\n $js .= ' var echeck_bank_aba = document.checkout_payment.authorizenet_echeck_bank_aba_code.value;' . \"\\n\";\r\n $js .= ' var echeck_bank_acctnum = document.checkout_payment.authorizenet_echeck_bank_acct_num.value;' . \"\\n\";\r\n $js .= ' var echeck_bank_name = document.checkout_payment.authorizenet_echeck_bank_name.value;' . \"\\n\";\r\n $js .= ' if (echeck_custname == \"\" || echeck_custname.length < ' . CC_OWNER_MIN_LENGTH . ') {' . \"\\n\" .\r\n ' error_message = error_message + \"' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_ACCT_OWNER . '\";' . \"\\n\" .\r\n ' error = 1;' . \"\\n\" .\r\n ' }' . \"\\n\" .\r\n ' if (echeck_bank_aba == \"\" || echeck_bank_aba.length < ' . 6 . ') {' . \"\\n\" .\r\n ' error_message = error_message + \"' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_ROUTING_CODE . '\";' . \"\\n\" .\r\n ' error = 1;' . \"\\n\" .\r\n ' }' . \"\\n\" .\r\n ' if (echeck_bank_acctnum == \"\" || echeck_bank_acctnum.length < ' . 6 . ') {' . \"\\n\" .\r\n ' error_message = error_message + \"' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_ACCT_NUMBER . '\";' . \"\\n\" .\r\n ' error = 1;' . \"\\n\" .\r\n ' }' . \"\\n\" .\r\n ' if (echeck_bank_name == \"\" || echeck_bank_name.length < ' . 6 . ') {' . \"\\n\" .\r\n ' error_message = error_message + \"' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_BANK_NAME . '\";' . \"\\n\" .\r\n ' error = 1;' . \"\\n\" .\r\n ' }' . \"\\n\";\r\n\r\n\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n //MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_CUST_TAX_ID\r\n //MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_DL_NUMBER\r\n //MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_JS_DL_DOB\r\n }\r\n\r\n\r\n $js .= ' }' . \"\\n\";\r\n\r\n return $js;\r\n }", "public function form_css(){\n\t\twp_register_style( 'lead_gen_plugin', plugin_dir_url( __FILE__ ) . 'css/style.css', false );\n\t\twp_enqueue_style( 'lead_gen_plugin' );\n\t}", "public function registerFormScripts() {\n $view = $this->getView();\n $view->registerJsFile($this->stripeJs, ['position' => \\yii\\web\\View::POS_HEAD]);\n $js = \"Stripe.setPublishableKey('\" . Yii::$app->stripe->getPublishableKey() . \"');\";\n $view->registerJs($js, \\yii\\web\\View::POS_BEGIN);\n //form scripts\n $view->registerJs($this->stripeResponseHandler, \\yii\\web\\View::POS_READY);\n $view->registerJs($this->stripeRequestHandler, \\yii\\web\\View::POS_READY);\n }", "public static function getCreditCardForm($order, $amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $data = null, $test_mode = false, $prefill = true)\n {\n $time = time();\n $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);\n $sim = new AuthorizeNetSIM_Form(\n array(\n 'x_amount' => $amount,\n 'x_fp_sequence' => $fp_sequence,\n 'x_fp_hash' => $fp,\n 'x_fp_timestamp' => $time,\n 'x_relay_response'=> \"TRUE\",\n 'x_relay_url' => $relay_response_url,\n 'x_login' => $api_login_id,\n 'x_order' => $order,\n //'x_test_request' => true,\n )\n );\n $hidden_fields = $sim->getHiddenFieldString();\n $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);\n $billing_address = (!empty($data['user'])) ? '<div class=\"row\"><label style=\"margin-left:30px; color:#ff8500\">BILLING ADDRESS</label><input type=\"checkbox\" style=\"margin-right:5px;\" id=\"billing\">Use my contact Address here</div>' : \"\"; //BILLING ADDRESS\n $exp_m = '';\n for($i = 1; $i<=12; $i++){\n $j = ($i < 10) ? \"0\".$i : $i;\n $exp_m .= \"<option value='{$j}'>{$j}</option>\";\n } \n\n $Y = date(\"Y\");\n $exp_y = '';\n for($i = $Y; $i < $Y+11; $i++){\n $val = substr($i, -2);\n $exp_y .= \"<option value='{$val}'>{$i}</option>\";\n }\n /*\n<div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <div class=\"date form_datetime b_date\" data-date=\"'.date(\"Y-m-d\").'\" data-date-format=\"mm/dd\" data-link-field=\"dtp_input1\">\n <input size=\"16\" type=\"text\" name=\"x_exp_date\" class=\"form-control1 form-control-bus date_input input-sm\" style=\"width:22%\" value=\"04/17\" readonly>\n <span class=\"add-on\" style=\"float:left;\"><i class=\"icon-th\"></i></span>\n <input type=\"hidden\" id=\"dtp_input1\" value=\"\" />\n </div>\n </div>\n */\n\n \n $form = '\n <div class=\"row payment\" style=\"width:100%;margin:0 auto;text-align:center\"><form method=\"post\" action=\"'.$post_url.'\">\n '.$hidden_fields.'\n <div class=\"row\" style=\"margin-left: -60px;\">\n <label>Card type</label>\n <select name=\"card_type\">\n <option value=\"Visa\">Visa</option>\n <option value=\"American Express\">American Express</option>\n <option value=\"Diners Club\">Diners Club</option>\n <option value=\"Discover\">Discover</option>\n <option value=\"MasterCard\">MasterCard</option>\n <option value=\"UATP Card\">UATP Card</option>\n </select>\n </div>\n <div class=\"row\">\n <label>Card Number</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" autocomplete=\"off\" size=\"25\" title=\"Card num\" data-toggle=\"popover\" data-content=\"Please enter your card number\" data-type=\"number\" name=\"x_card_num\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <select name=\"exp_m\" style=\"float:left\">'.$exp_m.'</select>\n <select name=\"exp_y\" style=\"float:left\">'.$exp_y.'</select>\n <input type=\"hidden\" name=\"x_exp_date\" value=\"\">\n </div>\n <div class=\"row\">\n <label style=\"margin-left: 20px;\">CCV</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" data-type=\"number\" autocomplete=\"off\" name=\"x_card_code\" value=\"\"></input>&nbsp;&nbsp;<a class=\"glyphicon glyphicon-question-sign\" data-toggle=\"modal\" data-target=\"#myModal\">\n</a>\n </div>\n <div class=\"row\">\n <label>First Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"first name\" name=\"x_first_name\" data-content=\"John\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Last Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"last name\" name=\"x_last_name\" data-content=\"Doe\" value=\"\"></input>\n </div>'.$billing_address.'\n <div class=\"row\">\n <label>Steet Address</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address\" name=\"x_address\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label></label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address2\" name=\"x_address2\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>City</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"city\" name=\"x_city\" data-content=\"Boston\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>State</label>\n <select class=\"text required form-control2 input-sm bfh-states\" id=\"state\" name=\"x_state\" data-country=\"country\"></select>\n </div>\n <div class=\"row\">\n <label>Zip Code</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"zip\" data-type=\"number\" name=\"x_zip\" data-content=\"02142\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Country</label>\n <select id=\"country\" name=\"x_country\" class=\"text required form-control2 input-sm bfh-countries\" data-country=\"US\"></select>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <label style=\"text-align:center; color:red; margin:0 auto\">amount: $'.$amount.'</label>\n </div>\n </div>\n <div class=\"row\" style=\"text-align:center\">\n<button type=\"button\" id=\"btn-pay\" class=\"noprint btn btn-primary \">Payment</button>\n </div>\n </form></div>';\n return $form;\n }", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function build_payment_form($host_obj)\n {\n $host_obj->add_field('CardName', 'Card Holder Name')->renderAs(frm_text)->\n comment('Cardholder Name', 'above')->validation()->fn('trim')->\n required('Please specify a cardholder name');\n \n $host_obj->add_field('CardNumber', 'Credit Card Number')->renderAs(frm_text)->\n validation()->fn('trim')->required('Please specify a credit card number')->\n regexp('/^[0-9]+$/', 'Credit card number can contain only digits.');\n \n $host_obj->add_field('StartMonth', 'Start Month', 'left')->renderAs(frm_text)->\n renderAs(frm_text)->validation()->fn('trim')->numeric();\n \n $host_obj->add_field('StartYear', 'Start Year', 'right')->renderAs(frm_text)->\n renderAs(frm_text)->validation()->fn('trim')->numeric();\n \n $host_obj->add_field('ExpMonth', 'Expiration Month', 'left')->renderAs(frm_text)->\n renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration month')->numeric();\n \n $host_obj->add_field('ExpYear', 'Expiration Year', 'right')->renderAs(frm_text)->\n renderAs(frm_text)->validation()->fn('trim')->required('Please specify card expiration year')->numeric();\n \n $host_obj->add_field('CV2', 'CV2', 'left')->renderAs(frm_text)->validation()->\n fn('trim')->required('Please specify Card Verification Number')->numeric();\n \n $host_obj->add_field('IssueNumber', 'Issue Number', 'right')->renderAs(frm_text)->validation()->\n fn('trim')->numeric();\n }", "function customHead(){?>\n\t\t\t<style type=\"text/css\">\n\t\t\t.half-container:not(.full){\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tvertical-align: top;\n\t\t\t\twidth: 49%;\n\t\t\t\tbox-sizing:border-box;\n\t\t\t\t-moz-box-sizing:border-box;\n\t\t\t\t-webkit-box-sizing:border-box;\n\t\t\t\tpadding: 0 10px 0 0;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t\tdiv.form-container input{\n\t\t\t\tborder: 2px solid #6A6A6A;\n\t\t\t\tfont-family: AurulentSansRegular;\n\t\t\t\tfont-size: 14px;\n\t\t\t\tpadding: 3px;\n\t\t\t}\n\t\t\tdiv.form-container label{\n\t\t\t\tcolor: #6A6A6A;\n\t\t\t\tfont-family: AurulentSansRegular;\n\t\t\t\tfont-size: 15px;\n\t\t\t\tfont-weight: normal;\n\t\t\t}\n\t\t\t</style>\n\t\t\t<style type=\"text/css\">\n\n\t\t\t/* General styles */\n\t\t\t/* body { margin: 0; padding: 0; font: 80%/1.5 Arial,Helvetica,sans-serif; color: #111; background-color: #FFF; } */\n\t\t\th2 { margin: 0px; padding: 10px; font-family: Georgia, \"Times New Roman\", Times, serif; font-size: 200%; font-weight: normal; color: #FFF; background-color: #CCC; border-bottom: #BBB 2px solid; }\n\t\t\tp#copyright { margin: 20px 10px; font-size: 90%; color: #999; }\n\n\t\t\t/* Form styles */\n\t\t\tdiv.form-container { margin: 10px; padding: 5px; background-color: #FFF; /* border: #EEE 1px solid; */ }\n\n\t\t\tp.legend { margin-bottom: 1em; }\n\t\t\tp.legend em { color: #C00; font-style: normal; }\n\n\t\t\tdiv.errors, div.form-container div.errors { margin: 0 0 10px 0; padding: 5px 10px; border: #FC6 2px solid; background-color: #FFC; }\n\t\t\tdiv.errors p { margin: 0; }\n\t\t\tdiv.errors p em { color: #C00; font-style: normal; font-weight: bold; }\n\n\t\t\tdiv.form-container form p { margin: 0; }\n\t\t\tdiv.form-container form p.note { margin-left: 170px; font-size: 90%; color: #333; }\n\t\t\tdiv.form-container form fieldset { margin: 10px 0; padding: 10px; border: #DDD 1px solid; }\n\t\t\tdiv.form-container form legend { font-weight: bold; color: #666; }\n\t\t\tdiv.form-container form fieldset div { padding: 0.25em 0; }\n\t\t\tdiv.form-container label { margin-right: 10px; padding-right: 10px; width: 100px; display: block; float: left; text-align: right; position: relative; }\n\t\t\tdiv.form-container label.error, \n\t\t\tdiv.form-container span.error { color: #C00; }\n\t\t\tdiv.form-container label em { position: absolute; right: 0; font-size: 120%; font-style: normal; color: #C00; }\n\t\t\tdiv.form-container input.error { border-color: #C00; background-color: #FEF; }\n\t\t\tdiv.form-container input:focus,\n\t\t\tdiv.form-container input.error:focus, \n\t\t\tdiv.form-container textarea:focus {\tbackground-color: #FFC; border-color: #FC6; }\n\t\t\tdiv.form-container div.controlset label, \n\t\t\tdiv.form-container div.controlset input { display: inline; float: none; }\n\t\t\tdiv.form-container div.controlset label.controlset { display: block; float: left; }\n\t\t\tdiv.form-container div.controlset div { margin-left: 170px; }\n\t\t\tdiv.form-container div.buttonrow { margin-left: 180px; }\n\t\t\t\n\t\t\tp.note { font-size: 12px; margin: 5px 0 0 170px; }\n\n\t\t</style>\n\t<?php\n\t}", "function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function display_card_form($name){\n?>\n<form action='../model/process.php' method='post'>\n<table border='0' width='100%' cellspacing='0'>\n <tr>\n <th colspan='2' bgcolor=\"#cccccc\">Credit Card Details</th>\n </tr>\n <tr>\n <td align='right'>Type:</td>\n <td>\n <select name='card_type'>\n <option value='VISA'>VISA</option>\n <option value='MasterCard'>MasterCard</option>\n <option value='American Express'>American Express</option>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Number:</td>\n <td>\n <input type='text' name='card_number' value='' maxlength='16' size='40'>\n </td>\n </tr>\n <tr>\n <td align='right'>AMEX code (if required):</td>\n <td>\n <input type='text' name='amex_code' value='' maxlength='4' size='4'>\n </td>\n </tr>\n <tr>\n <td align='right'>Expiry Date:</td>\n <td>Month\n <select name='card_month'>\n <option value='01'>01</option>\n <option value='02'>02</option>\n <option value='03'>03</option>\n <option value='04'>04</option>\n <option value='05'>05</option>\n <option value='06'>06</option>\n <option value='07'>07</option>\n <option value='08'>08</option>\n <option value='09'>09</option>\n <option value='10'>10</option>\n <option value='11'>11</option>\n <option value='12'>12</option>\n </select>\n Year\n <select name='card_year'>\n <?php\n for ($year=date('Y'); $year<date('Y')+10; $year++) {\n echo '<option value=\"' . $year . '\">' . $year . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <tr>\n <td align='right'>Name on Card:</td>\n <td>\n <input type='text' name='card_name' value='<?php echo $name; ?>'\n maxlength='40' size='40'>\n </td>\n </tr>\n <tr>\n <td colspan='2' align='center'>\n <p><strong>Please press <em>Purchase</em> to confirm your purchase, or\n <em>Continue Shopping</em> to add or remove items.</em></strong></p>\n <?php display_form_button('purchase', 'Purchase These Items'); ?>\n </td>\n </tr>\n </form>\n<?\n}", "public function payment_fields() {\n\t\t$message = $this->get_sandbox_form_message( $this->get_transaction_address( 'country' ) );\n\t\twc_get_template(\n\t\t\t'sandbox-checkout-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_sandbox_mode' => $this->is_sandbox_mode,\n\t\t\t\t'message' => $message,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\t$description = $this->get_description();\n\t\tif ( isset( $description ) ) {\n\t\t\techo wp_kses_post( wpautop( wptexturize( $description ) ) );\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'debit-card/payment-form.php',\n\t\t\tarray(\n\t\t\t\t'cart_total' => $this->get_order_total(),\n\t\t\t\t'id' => $this->id,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\tparent::checkout_rate_conversion( WC_EBANX_Constants::CURRENCY_CODE_MXN );\n\n\t\twc_get_template(\n\t\t\t'bacen-international-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_international' => $this->is_international(),\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\t}", "function give_show_purchase_form( $form_id, $args ) {\n\n\t$payment_mode = give_get_chosen_gateway( $form_id );\n\n\tif ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {\n\t\t$form_id = $_POST['give_form_id'];\n\t}\n\n\t/**\n\t * Fire before donation form render.\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_payment_fields_top', $form_id );\n\n\tif ( give_can_checkout() && isset( $form_id ) ) {\n\n\t\t/**\n\t\t * Fires while displaying donation form, before registration login.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_register_login', $form_id, $args );\n\n\t\t/**\n\t\t * Fire when register/login form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_register_login_fields', $form_id, $args );\n\n\t\t/**\n\t\t * Fire when credit card form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_cc_form', $form_id, $args );\n\n\t\t// Load the credit card form and allow gateways to load their own if they wish.\n\t\tif ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {\n\t\t\t/**\n\t\t\t * Fires while displaying donation form, credit card form fields for a given gateway.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( \"give_{$payment_mode}_cc_form\", $form_id, $args );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Fires while displaying donation form, credit card form fields.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( 'give_cc_form', $form_id, $args );\n\t\t}\n\n\t\t/**\n\t\t * Fire after credit card form fields render.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_after_cc_form', $form_id, $args );\n\n\t} else {\n\t\t/**\n\t\t * Fire if user can not donate.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_no_access', $form_id );\n\n\t}\n\n\t/**\n\t * Fire after donation form rendered.\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_payment_fields_bottom', $form_id, $args );\n}", "function um_add_form_honeypot_css() {\r\n\t?>\r\n\t\t<style type=\"text/css\">\r\n\t\t\t.<?php echo UM()->honeypot; ?>_name {\r\n\t\t\t\tdisplay: none !important;\r\n\t\t\t}\r\n\t\t</style>\r\n\t<?php\r\n}", "function wp_stripe_shortcode_legacy($atts) {\n\n\treturn wp_stripe_form();\n}", "public function testimonial_form()\n {\n /* require one simple php file that contains the form */\n /* Read but don't execute */\n ob_start ();\n /* Load the styles*/\n echo ( \"<link rel=\\\"stylesheet\\\" href=\\\"$this->plugin_url/assets/form.css\\\" type=\\\"text/css\\\" media=\\\"all\\\" /> \" );\n /* Load the contact form */\n require_once ( \"$this->plugin_path/templates/contact-form.php\");\n /* only enqueues the javascript file if I am using the form */\n echo ( \"<script src=\\\"$this->plugin_url/assets/form.js\\\"></script> \" );\n return ( ob_get_clean () );\n }", "function hgr_minimal_form($atts, $content = null ) {\n\t\t\twp_enqueue_script('hgr-vc-modernizr');\n\t\t\twp_enqueue_script('hgr-vc-classie');\n\t\t\twp_enqueue_script('hgr-vc-stepsform');\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t\tEmpty vars declaration\n\t\t\t*/\n\t\t\t$output = $form_size = $form_style = $form_size_class = $label_text_size = $label_text_color = $input_text_color = $next_icon_color = $confirmation_text = $confirmation_text_size = $confirmation_text_color = $steps_text_color = $form_input_color = $progress_bar_bgcolor = $email_form = $confirmation_text_style = $progress_bar_style = $steps_text_style = $next_icon_style = $label_text_style = $input_text_style = $form_input_style = $hgr_minimal_sendmail = $css = '';\n\t\t\t\n\t\t\t/*\n\t\t\t\tWordPress function to extract shortcodes attributes\n\t\t\t\tRefference: http://codex.wordpress.org/Function_Reference/shortcode_atts\n\t\t\t*/\n\t\t\textract(shortcode_atts(array(\n\t\t\t\t'form_size'\t\t\t\t\t\t=>\t'',\n\t\t\t\t'form_style'\t\t\t\t\t\t=>\t'',\n\t\t\t\t'label_text_size'\t\t\t\t=>\t'',\n\t\t\t\t'label_text_color'\t\t\t\t=>\t'',\n\t\t\t\t'input_text_color'\t\t\t\t=>\t'',\n\t\t\t\t'next_icon_color'\t\t\t\t=>\t'',\n\t\t\t\t'confirmation_text'\t\t\t\t=>\t'',\n\t\t\t\t'confirmation_text_size'\t\t=>\t'',\n\t\t\t\t'confirmation_text_color'\t\t=>\t'',\n\t\t\t\t'steps_text_color'\t\t\t\t=>\t'',\n\t\t\t\t'form_input_color'\t\t\t\t=>\t'',\n\t\t\t\t'progress_bar_bgcolor'\t\t\t=>\t'',\n\t\t\t\t'email_form'\t\t\t\t\t\t=>\t'',\n\t\t\t\t'css'\t\t\t\t\t\t\t=>\t'',\n\t\t\t), $atts));\n\t\t\t\n\t\t\t$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );\n\t\t\t\n\t\t\tswitch($form_size){\n\t\t\t\tcase 'large':\n\t\t\t\t\t$form_size_class = 'simform-large';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'medium':\n\t\t\t\t\t$form_size_class = 'simform-medium';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'small':\n\t\t\t\t\t$form_size_class = 'simform-small';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tswitch($form_style){\n\t\t\t\tcase 'standard':\n\t\t\t\t\t$confirmation_text_style = '';\n\t\t\t\t\t$progress_bar_style = '';\n\t\t\t\t\t$steps_text_style = '';\n\t\t\t\t\t$next_icon_style = '';\n\t\t\t\t\t$label_text_style = '';\n\t\t\t\t\t$input_text_style = '';\n\t\t\t\t\t$form_input_style = 'rgba(0,0,0,0.1)';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'advanced':\t\t\t\t\t\n\t\t\t\t\t$confirmation_text_style = 'style=\"'.($confirmation_text_size !== '' ? 'font-size:'.$confirmation_text_size.'px;' : '').''.($confirmation_text_color !== '' ? 'color:'.$confirmation_text_color.';' : '').'\"';\n\t\t\t\t\t$progress_bar_style = 'style=\"'.($progress_bar_bgcolor !== '' ? 'background:'.$progress_bar_bgcolor : '').'\"';\n\t\t\t\t\t$steps_text_style = 'style=\"'.($steps_text_color !== '' ? 'color:'.$steps_text_color : '').'\"';\n\t\t\t\t\t$next_icon_style = 'style=\"'.($next_icon_color !== '' ? 'color:'.$next_icon_color : '').'\"';\n\t\t\t\t\t$label_text_style = 'style=\"'.($label_text_size !== '' ? 'font-size:'.$label_text_size.'px;' : '').''.($label_text_color !== '' ? 'color:'.$label_text_color.';' : '').'\"';\n\t\t\t\t\t$input_text_style = 'style=\"'.($input_text_color !== '' ? 'color:'.$input_text_color : '').'\"';\n\t\t\t\t\t$form_input_style = ($form_input_color !== '' ? $form_input_color : 'rgba(0,0,0,0.1)');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$GLOBALS['hgr_label_style'] = $label_text_style;\n\t\t\t$GLOBALS['hgr_input_text_style'] = $input_text_style;\n\t\t\t$GLOBALS['hgr_minimal_sendmail'] = $email_form;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$output .= '<script>\n\t\t\t\tjQuery( document ).ready(function() {\n\t\t\t\t\t//Add form size class\n\t\t\t\t\tjQuery(\"#theForm\").addClass(\"'.$form_size_class.'\");\n\t\t\t\t\t\n\t\t\t\t\t//Add form background color\n\t\t\t\t\tjQuery(\"head\").append(\"<style>.hgr-minimal-form .simform ol:before{background:'.$form_input_style.';}</style>\");\n\t\t\t\t\t\n\t\t\t\t\tvar theForm = document.getElementById( \"theForm\" );\n\t\t\t\t\tnew stepsForm( theForm, {\n\t\t\t\t\t\tonSubmit : function( form ) {\n\t\t\t\t\t\t\tclassie.addClass( theForm.querySelector( \".simform-inner\" ), \"hide\" );\n\t\t\t\t\t\t\tvar messageEl = theForm.querySelector( \".final-message\" );\n\t\t\t\t\t\t\tmessageEl.innerHTML = \"'.$confirmation_text.'\";\n\t\t\t\t\t\t\tclassie.addClass( messageEl, \"show\" );\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// Submits the form\n\t\t\t\t\tstepsForm.prototype._submit = function() {\n\t\t\t\t\t\t// get all the inputs into an array.\n\t\t\t\t\t\tvar $inputs = jQuery(\"#theForm :input\");\n\n\t\t\t\t\t\tvar values = {};\n\t\t\t\t\t\t$inputs.each(function() {\n\t\t\t\t\t\t\tif( jQuery(this).val() != \"\" ) {\n\t\t\t\t\t\t\t\tvalues[jQuery(this).attr(\"data-question\")] = jQuery(this).val();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// send email\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: \"mail_before_submit\",\n\t\t\t\t\t\t\twhatever: values,\n\t\t\t\t\t\t\t_ajax_nonce: \"'.wp_create_nonce( \"my_email_ajax_nonce\" ).'\"\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tjQuery.post(\"'. get_bloginfo(\"url\").'/wp-admin/admin-ajax.php\", data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// show confirmation text\n\t\t\t\t\t\tthis.options.onSubmit( this.el );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t</script>';\n\t\t\t\n\t\t\t\t$output .= '<div class=\"hgr-minimal-form ' . esc_attr( $css_class ) . '\">';\n\t\t\t\t\t$output .= '<form id=\"theForm\" class=\"simform\" autocomplete=\"off\">';\n\t\t\t\t\t\t$output .= '<div class=\"simform-inner\">';\n\t\t\t\t\t\t\t$output .= '<ol class=\"questions\">';\n\t\t\t\t\t\t\t\t$output .= do_shortcode($content);\n\t\t\t\t\t\t\t$output .= '</ol><!-- /questions -->';\n\t\t\t\t\t\t\t$output .= '<button class=\"submit\" type=\"submit\">Send answers</button>';\n\t\t\t\t\t\t\t$output .= '<div class=\"controls\" '.$progress_bar_style.'>';\n\t\t\t\t\t\t\t\t$output .= '<button class=\"hgr-next-button\" '.$next_icon_style.'></button>';\n\t\t\t\t\t\t\t\t$output .= '<div class=\"progress\"></div>';\n\t\t\t\t\t\t\t\t$output .= '<span class=\"number\" '.$steps_text_style.'>';\n\t\t\t\t\t\t\t\t\t$output .= '<span class=\"number-current\"></span>';\n\t\t\t\t\t\t\t\t\t$output .= '<span class=\"number-total\"></span>';\n\t\t\t\t\t\t\t\t$output .= '</span>';\n\t\t\t\t\t\t\t\t$output .= '<span class=\"error-message\"></span>';\n\t\t\t\t\t\t\t$output .= '</div><!-- / controls -->';\n\t\t\t\t\t\t$output .= '</div><!-- /simform-inner -->';\n\t\t\t\t\t\t$output .= '<span class=\"final-message\" '.$confirmation_text_style.'></span>';\n\t\t\t\t\t$output .= '</form><!-- /simform -->';\n\t\t\t\t$output .= '</div>';\n\t\t\t\n\t\t\t/*\n\t\t\t\tReturn the output\n\t\t\t*/\n\t\t\treturn $output;\n\t\t}", "function validateCC($cc_num, $type) {\n if ($type == \"American\") {$pattern = \"/^([34|37]{2})([0-9]{13})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Dinners\") {$pattern = \"/^([30|36|38]{2})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Discover\") {$pattern = \"/^([6011]{4})([0-9]{12})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Master\") {$pattern = \"/^([51|52|53|54|55]{2})([0-9]{14})$/\";if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}} elseif ($type == \"Visa\") {$pattern = \"/^([4]{1})([0-9]{12,15})$/\"; if (preg_match($pattern, $cc_num)) {$verified = true;} else {$verified = false;}}\n\n if($verified == false) {\n //if validation fail, print a message\n echo \"Credit card invalid. Please make sure that you entered a valid credit card \";\n } \n}", "public function __construct() {\n\n $this->domain = 'imopay_credit_card_payment';\n\n $this->id = 'imopay_credit_card';\n $this->icon = apply_filters('woocommerce_imopay_credit_card_gateway_icon', '');\n $this->has_fields = false;\n $this->method_title = __( 'Imopay - Credit card', $this->domain );\n $this->method_description = __( 'Habilita o pagamento por cartão de crédito do Imopay.', $this->domain );\n\n // Load the settings.\n $this->init_form_fields();\n $this->init_settings();\n\n // Define user set variables\n $this->title = $this->get_option( 'title' );\n $this->description = $this->get_option( 'description' );\n $this->instructions = $this->get_option( 'instructions', $this->description );\n $this->order_status = $this->get_option( 'order_status', 'completed' );\n\n // Actions\n add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\n add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) );\n\n // Customer Emails\n add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );\n }", "function custom_form_shortcode() {\n ob_start();\n custom_form_callback();\n\twp_enqueue_script( 'form-script', plugin_dir_url( __FILE__ ) . '/form-validation.js', array('jquery'), '0.1', true );\n return ob_get_clean();\n}", "function show_my_text_on_checkout() {\n echo '<p>All credit card details are processed and stored securely via Stripe.</p>'; \n}", "function form() {\n\tglobal $cert_amt_tbl;\n\t\n\t$certificates_form = table_form_header('* indicates required field');\n\t$certificates_form .= table_form_field('Sort:','<input name=\"crtamt_sort\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->crtamt_sort.'\">');\n\t$certificates_form .= table_form_field('<span class=\"required\">*Discount Amount:</span>','<input name=\"discount_amount\" type=\"text\" size=\"5\" maxlength=\"15\" value=\"'.$cert_amt_tbl->discount_amount.'\">');\n\t$certificates_form .= table_form_field('Discount Cost:','<input name=\"cost\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->cost.'\">');\n\t$certificates_form .= table_form_field('Min Spend Amounts:','<input name=\"min_spend_amts\" type=\"text\" size=\"30\" value=\"'.$cert_amt_tbl->min_spend_amts.'\">');\n\t$certificates_form .= table_span_form_field('<center><input name=\"id\" type=\"hidden\" value=\"'.$cert_amt_tbl->id.'\"><input name=\"submit\" type=\"submit\" value=\"Submit\"></center>');\n\t\n return $certificates_form;\n }", "function __construct() {\n global $currencySymbol, $employment, $fullAddress;\n $this->api_key = get_option('ngp_api_key', '');\n $this->url_specified = get_option('ngp_secure_url', '');\n $this->support_phone = get_option('ngp_support_phone', '');\n \n $this->redirect_url = get_option('ngp_thanks_url', '/thank-you-for-your-contribution');\n \n $this->fieldsets = array(\n 'Personal Information' => array(\n array(\n 'type' => 'text',\n 'slug' => 'FullName',\n 'required' => 'true',\n 'label' => 'Name',\n ),\n array(\n 'type' => 'text',\n 'slug' => 'Email',\n 'required' => 'true',\n 'label' => 'Email Address'\n )\n ),\n 'Employment' => array(\n 'html_intro' => $employment,\n array(\n 'type' => 'text',\n 'slug' => 'Employer',\n 'required' => 'true',\n 'label' => 'Employer'\n ),\n array(\n 'type' => 'text',\n 'slug' => 'Occupation',\n 'required' => 'true',\n 'label' => 'Occupation'\n )\n ),\n 'Credit card' => array(\n 'html_intro' => '<p id=\"accepted-cards\" style=\"margin: 0pt 0pt -5px; background: url(/wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/credit-card-logos.png) no-repeat scroll 0% 0% transparent; text-indent: -900em; width: 211px; height: 34px;\">We accept Visa, Mastercard, American Express and Discover cards.</p>',\n array(\n 'type' => 'radio',\n 'id' => 'cardAmount',\n 'required' => 'true',\n 'label' => 'Amount',\n 'options' => array(\n '1000' => '$10',\n '2500' => '$25',\n '5000' => '$50',\n '10000' => '$100',\n '50000' => '$500',\n '100000' => '$1,000',\n '260000' => '$2,600',\n 'custom' => '<label for=\"custom_dollar_amt\">Other:</label> $<input type=\"text\" %s class=\"custom_dollar_amt\" /> <small>('.strtoupper($currencySymbol).')</small>'\n )\n ),\n array(\n 'type' => 'text',\n 'required' => 'true',\n 'id' => 'cardNumber',\n 'label' => 'Credit Card Number'\n ),\n array(\n 'type' => 'select',\n 'required' => 'true',\n 'label' => 'Expiration Date',\n 'id' => 'cardExpiryMonth',\n 'show_label' => 'true',\n 'show_pre_div' => 'true',\n 'show_post_div' => 'false',\n 'options' => array(\n '01' => '1 - January',\n '02' => '2 - February',\n '03' => '3 - March',\n '04' => '4 - April',\n '05' => '5 - May',\n '06' => '6 - June',\n '07' => '7 - July',\n '08' => '8 - August',\n '09' => '9 - September',\n '10' => '10 - October',\n '11' => '11 - November',\n '12' => '12 - December'\n )\n ),\n array(\n 'type' => 'select',\n 'required' => 'true',\n 'label' => 'Expiration Year',\n 'id' => 'cardExpiryYear',\n 'show_label' => 'false',\n 'show_placeholder' => 'false',\n 'show_pre_div' => 'false',\n 'options' => array()\n ),\n array(\n 'type' => 'text',\n 'required' => 'true',\n 'id' => 'cardCvc',\n 'label' => 'CVC code'\n ),\n )\n // array(\n // 'type' => 'checkbox',\n // 'slug' => 'RecurringContrib',\n // 'required' => 'true',\n // 'label' => 'Recurring Contribution?'\n // 'show_label' => 'false'\n // 'show_placeholder' => 'false'\n // )\n );\n \n if($fullAddress) {\n $this->fieldsets['Personal Information'][] = array(\n 'type' => 'text',\n 'slug' => 'Address1',\n 'required' => 'true',\n 'label' => 'Street Address'\n );\n $this->fieldsets['Personal Information'][] = array(\n 'type' => 'text',\n 'slug' => 'Address2',\n 'required' => 'false',\n 'label' => 'Street Address (Cont.)',\n 'show_label' => 'false'\n );\n $this->fieldsets['Personal Information'][] = array(\n 'type' => 'hidden',\n 'slug' => 'City',\n 'required' => 'true',\n 'label' => 'City'\n );\n $this->fieldsets['Personal Information'][] = array(\n 'type' => 'select',\n 'slug' => 'State',\n 'required' => 'true',\n 'label' => 'State',\n 'options' => array('AK'=>'AK','AL'=>'AL','AR'=>'AR','AZ'=>'AZ','CA'=>'CA','CO'=>'CO','CT'=>'CT','DC'=>'DC','DE'=>'DE','FL'=>'FL','GA'=>'GA','HI'=>'HI','IA'=>'IA','ID'=>'ID','IL'=>'IL','IN'=>'IN','KS'=>'KS','KY'=>'KY','LA'=>'LA','MA'=>'MA','MD'=>'MD','ME'=>'ME','MI'=>'MI','MN'=>'MN','MO'=>'MO','MS'=>'MS','MT'=>'MT','NC'=>'NC','ND'=>'ND','NE'=>'NE','NH'=>'NH','NJ'=>'NJ','NM'=>'NM','NV'=>'NV','NY'=>'NY','OH'=>'OH','OK'=>'OK','OR'=>'OR','PA'=>'PA','RI'=>'RI','SC'=>'SC','SD'=>'SD','TN'=>'TN','TX'=>'TX','UT'=>'UT','VA'=>'VA','VT'=>'VT','WA'=>'WA','WI'=>'WI','WV'=>'WV','WY'=>'WY')\n );\n\n }\n $this->fieldsets['Personal Information'][] = array(\n 'type' => 'text',\n 'slug' => 'Zip',\n 'required' => 'true',\n 'label' => 'Zip Code'\n );\n\n /*\n * Set the Year options for CC expiration to include this year\n * and 19 more years.\n */\n $y = (int)date('Y');\n $y_short = (int)date('y');\n while($y < (int)date('Y', strtotime('+19 years'))) {\n $this->fieldsets['Credit card'][3]['options'][$y_short] = $y;\n $y+=1;\n $y_short+=1;\n }\n }", "public function credits()\n {\n add_settings_field(\n 'credits',\n apply_filters($this->plugin_name . 'label-credits', esc_html__('Credits', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable credits at the bottom of your security.txt file.',\n 'id' => 'credits',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['credits']) ? $this->options['credits'] : false,\n ]\n );\n }", "function pc_content_init_form( $font=[], $color='', $background='', $border='' ) {\n\n $css = ['', ''];\n\n\tif ( isset($font['font-family']) && $font['font-family'] ) {\n\t\t$is_custom_font = get_aifonts_from_dir( $font['font-family'], true );\n\n\t\tif ( ! is_font_loaded( $font['font-family'] ) ) :\n\t\t\tif ( !$is_custom_font ) {\n\t\t\t\t$css[0] = \"</style><style>@import url('https://fonts.googleapis.com/css?family=\" . $font['font-family'] . \"');\";\n\t\t\t} else {\n\t\t\t\t$css[0] = \"</style>{$is_custom_font}<style>\";\n\t\t\t}\n\t\tendif;\n\n\t \t$css[1] .= \"font-family:'\" . $font['font-family'] . \"';\";\n\t}\n\n\t$css[1] .= isset($font['font-weight'])&&$font['font-weight'] ? \"font-weight:\" . $font['font-weight'] . \";\" : '';\n\t$css[1] .= isset($font['font_size'])&&$font['font_size'] ? \"font-size:\" . $font['font_size'] . \"px;\" : '';\n\t$css[1] .= isset($font['line_height'])&&$font['line_height'] ? \"line-height:\" . $font['line_height'] . \"px;\" : '';\n\t$css[1] .= isset($font['font_style'])&&$font['font_style'] ? \"font-style:\" . $font['font_style'] . \";\" : '';\n\t$css[1] .= isset($font['text_align'])&&$font['text_align'] ? \"text-align:\" . $font['text_align'] . \";\" : '';\n\t$css[1] .= isset($font['letter_spacing'])&&$font['letter_spacing'] ? \"letter-spacing:\" . $font['letter_spacing'] . \"px;\" : '';\n\n\t$css[1] .= $color ? 'color:' . $color . ';' : '';\n\t$css[1] .= $background ? 'background-color:' . $background . ';' : '';\n\t$css[1] .= $border ? 'border-color:' . $border . ';' : '';\n\n\treturn $css;\n}", "function responsive_popup_form()\n{\n\n $content = '';\n $content .= '<div class=\"form-container z-depth-5\">';\n $content .= '<div class=\"row\">';\n $content .= '<div id=\"closepopupbutton\">X</div>';\n $content .= '<form class=\"col s12\" id=\"reused_form\">';\n $content .= '<div class=\"row\">';\n $content .= '<h3 id=\"discount-heading3-text\">Vil du have 10% rabat på din næste ordre?</h3>';\n $content .= '<img src=\" '.plugins_url(\"responsive-popup-form/images/bgimage.jpg\").' \" alt=\"Zalando\" id=\"backgroundimg\" >';\n $content .= '</div>';\n $content .= '<div class=\"row\">';\n $content .= '<img src=\"https://mosaic02.ztat.net/nvg/z-header-fragment/zalando-logo/logo_default.svg\" alt=\"Zalandologo\" class=\"z-navicat-header_svgLogo\">';\n $content .= '</div>';\n $content .= '<div class=\"row\">';\n $content .= '<div class=\"input-field col s12\">';\n \n $content .= '<input id=\"name\" type=\"text\" name=\"name\" required class=\"validate\">';\n $content .= '<label for=\"name\">Name</label>';\n $content .= '</div>';\n $content .= '</div>';\n $content .= '<div class=\"row\">';\n $content .= '<div class=\"input-field col s12\">';\n $content .= '<input id=\"email\" type=\"email\" name=\"email\" required class=\"validate\">';\n $content .= '<label for=\"email\">Email</label>';\n $content .= '</div>';\n $content .= '</div>';\n $content .= '<div>';\n $content .= '<button class=\"waves-effect waves-light btn submitbtn\" type=\"submit\">Få 10% på dit næste køb</button>';\n $content .= '<p id=\"gdpr-text\">Se vores <a href=\"https://www.zalando.dk/zalando-databeskyttelse/\"> databeskyttelseserklæring</a> for information om, hvordan Zalando behandler dine data.</p>';\n $content .= '</div>';\n $content .= '</form>';\n $content .= '</div>';\n $content .= '</div>';\n \n return $content;\n \n}", "public function creditcardAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('creditcarddetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"creditcard\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t\r\n\t\t\t $auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\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$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t$creditcardDetailsform = new Default_Form_Creditcarddetails();\r\n\t\t\t\t\t\t$creditcardDetailsModel = new Default_Model_Creditcarddetails();\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $creditcardDetailsModel->getcreditcarddetailsRecord($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"user_id\",$data[0][\"user_id\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_type\",$data[0][\"card_type\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_number\",$data[0][\"card_number\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"nameoncard\",$data[0][\"nameoncard\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$expiry_date = sapp_Global::change_date($data[0][\"card_expiration\"],'view');\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault('card_expiration', $expiry_date);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_issuedby\",$data[0][\"card_issued_comp\"]);\r\n\t\t\t\t\t\t\t\t$creditcardDetailsform->setDefault(\"card_code\",$data[0][\"card_code\"]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$creditcardDetailsform->setAttrib('action',BASE_URL.'mydetails/creditcard/');\r\n\t\t\t\t\t\t\t$this->view->id=$id;\r\n\t\t\t\t\t\t\t$this->view->form = $creditcardDetailsform;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result = $this->save($creditcardDetailsform,$tabName);\t\r\n\t\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\t\r\n\t}", "function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}", "function CCValidationSolution($Number) {\r\n global $CardName, $CardNumber, $language;\r\n\r\n require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CCVAL_FUNCTION); \r\n\r\n\r\n// Get rid of spaces and non-numeric characters.\r\n $Number = OnlyNumericSolution($Number);\r\n\r\n// Do the first four digits fit within proper ranges? If so, who's the card issuer and how long should the number be?\r\n $NumberLeft = substr($Number, 0, 4);\r\n $NumberLength = strlen($Number);\r\n\r\n if ( ($NumberLeft >= 3000) && ($NumberLeft <= 3059) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3600) && ($NumberLeft <= 3699) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3800) && ($NumberLeft <= 3889) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3400) && ($NumberLeft <= 3499) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3700) && ($NumberLeft <= 3799) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3528) && ($NumberLeft <= 3589) ) {\r\n $CardName = 'JCB';\r\n $ShouldLength = 16;\r\n } elseif ( ($NumberLeft >= 3890) && ($NumberLeft <= 3899) ) {\r\n $CardName = 'Carte Blache';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 4000) && ($NumberLeft <= 4999) ) {\r\n $CardName = 'Visa';\r\n if ($NumberLength > 14) {\r\n $ShouldLength = 16;\r\n } elseif ($NumberLength < 14) {\r\n $ShouldLength = 13;\r\n }\r\n } elseif ( ($NumberLeft >= 5100) && ($NumberLeft <= 5599) ) {\r\n $CardName = 'MasterCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 5610) {\r\n $CardName = 'Australian BankCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 6011) {\r\n $CardName = 'Discover/Novus';\r\n $ShouldLength = 16;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, $NumberLeft);\r\n return $cc_val;\r\n }\r\n\r\n// Is the number the right length?\r\n if ($NumberLength <> $ShouldLength) {\r\n $Missing = $NumberLength - $ShouldLength;\r\n if ($Missing < 0) {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n }\r\n\r\n return $cc_val;\r\n }\r\n\r\n// Does the number pass the Mod 10 Algorithm Checksum?\r\n if (Mod10Solution($Number)) {\r\n $CardNumber = $Number;\r\n return true;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n return $cc_val;\r\n }\r\n }", "static function pmpro_checkout_after_form()\n\t\t{\n\t\t?>\n\t\t<script>\n\t\t\t<!--\n\t\t\t//choosing payment method\n\t\t\tjQuery('input[name=gateway]').click(function() {\n\t\t\t\tif(jQuery(this).val() == 'paypal')\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').hide();\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').show();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').show();\n\t\t\t\t\tjQuery('#pmpro_submit_span').show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_submit_span').hide();\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//select the radio button if the label is clicked on\n\t\t\tjQuery('a.pmpro_radio').click(function() {\n\t\t\t\tjQuery(this).prev().click();\n\t\t\t});\n\t\t\t-->\n\t\t</script>\n\t\t<?php\n\t\t}", "function commerce_oz_migs_2p_submit_form_validate($payment_method, $pane_form, $pane_values, $order, $form_parents = array()) {\n\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n\n // Validate the credit card fields.\n $settings = array(\n 'form_parents' => array_merge($form_parents, array('credit_card')),\n );\n\n if (!commerce_payment_credit_card_validate($pane_values['commweb_3p_head']['credit_card'], $settings)) {\n return FALSE;\n }\n}", "public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }", "protected function paymentForm($resume, $pricing) {\n \n if(Wpjb_Model_Company::current()) {\n $dName = Wpjb_Model_Company::current()->company_name;\n $dMail = wp_get_current_user()->user_email;\n } elseif(wp_get_current_user()) {\n $dName = wp_get_current_user()->display_name;\n $dMail = wp_get_current_user()->user_email;\n } else {\n $dName = \"\";\n $dMail = \"\";\n }\n\n $fullname = apply_filters(\"wpjb_candidate_name\", trim($resume->user->first_name.\" \".$resume->user->last_name), $resume->id);\n \n $this->view->pricing = $pricing;\n $this->view->gateways = Wpjb_Project::getInstance()->payment->getEnabled();\n $this->view->pricing_item = __(\"Resume Access\", \"wpjobboard\") . \" &quot;\" . $fullname . \"&quot;\";\n $this->view->defaults = new Daq_Helper_Html(\"span\", array(\n \"id\" => \"wpjb-checkout-defaults\",\n \"class\" => \"wpjb-none\",\n\n \"data-object_id\" => $resume->id,\n \"data-pricing_id\" => $pricing->id,\n \"data-fullname\" => $dName,\n \"data-email\" => $dMail,\n\n ), \" \");\n\n return $this->render(\"default\", \"payment\");\n }", "function payment_fields() {\n?>\n\t\t<?php if ($this->tran_mode=='sandbox') : ?><p><?php _e('TEST MODE/SANDBOX ENABLED', WC_Authorize_SIM::TEXT_DOMAIN); ?></p><?php endif; ?>\n\t\t<?php if ($this->description) : ?><p><?php echo wpautop(wptexturize($this->description)); ?></p><?php endif; ?>\n<?php\n\n\t}", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "function cyberchimps_customize( $wp_customize ) {\n class Cyberchimps_Form extends WP_Customize_Control {\n\n public function render_content() {\n\t\t\tswitch( $this->type ) {\n case 'textarea':\n ?>\n <label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n <textarea value=\"<?php echo esc_attr( $this->value() ); ?>\" <?php $this->link(); ?> style=\"width: 97%; height: 200px;\"></textarea>\n </label>\n <?php\n break;\n }\n }\n }\n\n class Cyberchimps_Typography_Size extends WP_Customize_Control {\n public $type = 'select';\n\n public function render_content() {\n ?>\n <label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n <select <?php $this->link(); ?>>\n <?php\n\t\t\t\t\tforeach( $this->choices as $value => $label ) {\n\t\t\t\t\t\techo '<option value=\"' . esc_attr( $label ) . 'px\"' . selected( $this->value(), $value, false ) . '>' . esc_attr( $label ) . 'px</option>';\n }\n ?>\n </select>\n </label>\n <?php\n }\n }\n\n\t/********** Class for background image option starts *************/\n class Cyberchimps_Background_Image extends WP_Customize_Control {\n public $type = 'radio';\n\n public function render_content() {\n ?>\n <style>\n .images-radio-subcontainer img {\n margin-top: 5px;\n padding: 2px;\n border: 5px solid #eee;\n }\n\n .images-radio-subcontainer img.of-radio-img-selected {\n border: 5px solid #5DA7F2;\n }\n\n .images-radio-subcontainer img:hover {\n cursor: pointer;\n border: 5px solid #5DA7F2;\n }\n #accordion-section-cyberchimps_header_section .customize-control-image img{ width: auto;}\n #accordion-section-cyberchimps_social_media .images-skin-subcontainer img{ height: auto;}\n </style>\n <script>\n\t\t\t\tjQuery(function ($) {\n\t\t\t\t\t$('.of-radio-img-img').click(function () {\n\t\t\t\t\t\t$(this).parent().parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected');\n\t\t\t\t\t\t$(this).addClass('of-radio-img-selected');\n\t\t\t\t\t});\n\t\t\t\t});\n </script>\n\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n <em>\n <small><?php _e( 'make sure you have removed the image above before selecting one of these', 'cyberchimps_core' ); ?></small>\n </em>\n <?php\n\t\t\tforeach( $this->choices as $value => $label ) :\n\n //if get theme mod background image has a value then we need to set cyberchimps bg to none\n\t\t\t\t$test_bg = $this->value();\n\t\t\t\t$test_bg = ( get_theme_mod( 'background_image' ) ) ? 'none' : $test_bg;\n\t\t\t\t$name = '_customize-radio-' . $this->id;\n $selected = ( $test_bg == $value ) ? 'of-radio-img-selected' : '';\n ?>\n <div class=\"images-radio-subcontainer\">\n <label>\n\t\t\t\t\t\t<input type=\"radio\" value=\"<?php echo esc_attr( $value ); ?>\" name=\"<?php echo esc_attr( $name ); ?>\" <?php $this->link();\n\t\t\t\t\t\tchecked( $test_bg, $value ); ?> style=\"display:none;\"/>\n <img src=\"<?php echo esc_html( $label ); ?>\" class=\"of-radio-img-img <?php echo esc_attr( $selected ); ?>\"/><br/>\n </label>\n </div>\n <?php\n endforeach;\n }\n }\n\n\t/********** Class for background image option ends *************/\n\n\t/********** Class for skin color selection option starts *************/\n class Cyberchimps_skin_selector extends WP_Customize_Control {\n public $type = 'radio';\n\n public function render_content() {\n ?>\n <style>\n .images-skin-subcontainer, .images-radio-subcontainer {\n display: inline-block;\n }\n\n #customize-control-cyberchimps_background em {\n display: block;\n }\n\n .images-skin-subcontainer img {\n margin-top: 5px;\n padding: 2px;\n border: 5px solid #eee;\n height: 80px;\n width: 80px;\n }\n\n .images-skin-subcontainer img.of-radio-img-selected {\n border: 5px solid #5DA7F2;\n }\n\n .images-skin-subcontainer img:hover {\n cursor: pointer;\n border: 5px solid #5DA7F2;\n }\n #accordion-section-cyberchimps_header_section .customize-control-image img{ width: auto;}\n #accordion-section-cyberchimps_social_media .images-skin-subcontainer img{ height: auto;}\n </style>\n <script>\n\t\t\t\tjQuery(function ($) {\n\t\t\t\t\t$('.of-radio-img-img').click(function () {\n\t\t\t\t\t\t$(this).parent().parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected');\n\t\t\t\t\t\t$(this).addClass('of-radio-img-selected');\n\t\t\t\t\t});\n\n // Script to show hide the Google Text Font input depending on the value of the Text select\n\t\t\t\t\tvar font = $('#customize-control-typography_face select').val();\n\t\t\t\t\tif (font != 'Google Fonts') {\n\t\t\t\t\t\t$('#customize-control-google_font_field').hide();\n }\n else {\n\t\t\t\t\t\t$('#customize-control-google_font_field').show();\n }\n\t\t\t\t\t$('#customize-control-typography_face select').change(function () {\n\t\t\t\t\t\tvar font_change = $(this).val();\n\t\t\t\t\t\tif (font_change != 'Google Fonts') {\n\t\t\t\t\t\t\t$('#customize-control-google_font_field').hide();\n }\n else {\n\t\t\t\t\t\t\t$('#customize-control-google_font_field').show();\n }\n\t\t\t\t\t});\n\n // Script to hide show the Google Heading Font input depending on value of the Heading select\n\t\t\t\t\tvar text = $('#customize-control-font_family_headings select').val();\n\t\t\t\t\tif (text != 'Google Fonts') {\n\t\t\t\t\t\t$('#customize-control-google_font_headings').hide();\n }\n else {\n\t\t\t\t\t\t$('#customize-control-google_font_headings').show();\n }\n\t\t\t\t\t$('#customize-control-font_family_headings select').change(function () {\n\t\t\t\t\t\tvar text_change = $(this).val();\n\t\t\t\t\t\tif (text_change != 'Google Fonts') {\n\t\t\t\t\t\t\t$('#customize-control-google_font_headings').hide();\n }\n else {\n\t\t\t\t\t\t\t$('#customize-control-google_font_headings').show();\n }\n\t\t\t\t\t});\n\n\t\t\t\t});\n </script> \n\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n <?php\n\t\t\tforeach( $this->choices as $value => $label ) :\n\n //if get theme mod background image has a value then we need to set cyberchimps bg to none\n $test_skin = $this->value();\n\t\t\t\t$name = '_customize-radio-' . $this->id;\n\t\t\t\t$selected = ( $test_skin == $value ) ? 'of-radio-img-selected' : '';\n ?>\n <div class=\"images-skin-subcontainer\">\n <label>\n\t\t\t\t\t\t<input type=\"radio\" value=\"<?php echo esc_attr( $value ); ?>\" name=\"<?php echo esc_attr( $name ); ?>\" <?php $this->link();\n\t\t\t\t\t\tchecked( $test_skin, $value ); ?> style=\"display:none;\"/>\n <img src=\"<?php echo esc_html( $label ); ?>\" class=\"of-radio-img-img <?php echo esc_attr( $selected ); ?>\"/>\n </label>\n </div>\n <?php\n endforeach;\n }\n }\n ?> \n <?php\n /* * ******** Class for skin color selection option ends ************ */\n $imagepath = get_template_directory_uri() . '/cyberchimps/lib/images/';\n\n /* --------------------------------------------------------------\n // MAIN HEADER SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_panel( 'header_id', array(\n 'priority' => 46,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Header', 'cyberchimps_core' ),\n 'description' => __( 'Several settings for Header', 'cyberchimps_core' ),\n ) );\n\n $wp_customize->add_section( 'cyberchimps_header_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Header Option', 'cyberchimps_core' ),\n 'panel' => 'header_id',\n ) );\n\n //custom logo url\n $wp_customize->add_setting( 'custom_logo_url', array(\n\t\t'default' => '',\t\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n\n $wp_customize->add_control( 'custom_logo_url', array(\n 'label' => __( 'Custom Logo URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_logo_url',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'custom_logo_url_link', array(\n \t'default' => '',\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n\n $wp_customize->add_control( 'custom_logo_url_link', array(\n 'label' => __( 'Enter Custom Logo URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_logo_url_link',\n 'type' => 'text'\n ) );\n\n //Disable logo\n $wp_customize->add_setting( 'custom_logo', array(\n \t'default' => apply_filters('cyberchimps_display_logo_option' , ''), \t\t\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'custom_logo', array(\n 'label' => __( 'Display Logo?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_logo',\n 'type' => 'checkbox'\n ) );\n\n // Add Logo image\n $wp_customize->add_setting( 'custom_logo_uploader', array(\n 'default' => apply_filters( 'cyberchimps_default_logo', $imagepath . '/achimps.png' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_logo_uploader', array(\n 'label' => __( 'Upload Logo Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_logo_uploader',\n 'type' => 'image',\n ) ) );\n\n//Add Disable favicon\n $wp_customize->add_setting( 'custom_favicon', array(\n \t'default' => '',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n\n $wp_customize->add_control( 'custom_favicon', array(\n 'label' => __( 'Display Favicon?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_favicon',\n 'type' => 'checkbox'\n ) );\n\n// Add favicon image\n $wp_customize->add_setting( 'favicon_uploader', array(\n \t'default' => '',\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'favicon_uploader', array(\n 'label' => __( 'Upload Favicon Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'favicon_uploader',\n 'type' => 'image',\n ) ) );\n\n//Add Disable Custom Apple touch icon\n $wp_customize->add_setting( 'custom_apple', array(\n \t'default' => '',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n\n $wp_customize->add_control( 'custom_apple', array(\n 'label' => __( 'Display Custom Apple touch icon?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'custom_apple',\n 'type' => 'checkbox'\n ) );\n\n// Add Custom Apple touch icon image\n $wp_customize->add_setting( 'apple_touch_uploader', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'apple_touch_uploader', array(\n 'label' => __( 'Upload Custom Apple touch icon', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'apple_touch_uploader',\n 'type' => 'image',\n ) ) );\n\n//Disable search bar\n $wp_customize->add_setting( 'searchbar', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n\n $wp_customize->add_control( 'searchbar', array(\n 'label' => __( 'Display Searchbar?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_header_section',\n 'settings' => 'searchbar',\n 'type' => 'checkbox'\n ) );\n\n /* --------------------------------------------------------------\n // SOCIAL MEDIA SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_section( 'cyberchimps_social_media', array(\n 'priority' => 15,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Social Option', 'cyberchimps_core' ),\n 'panel' => 'header_id',\n ) );\n\n //Select social Icon Style \n $social_choices = apply_filters( 'cyberchimps_social_icon_options', array(\n 'default' => $imagepath . 'social/thumbs/icons-default.png',\n 'legacy' => $imagepath . 'social/thumbs/icons-classic.png',\n 'round' => $imagepath . 'social/thumbs/icons-round.png'\n ) );\n if ( count( $social_choices ) > 1 ) {\n $wp_customize->add_setting( 'theme_backgrounds', array(\n 'default' => apply_filters( 'cyberchimps_social_icon_default', 'default' ),\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'theme_backgrounds', array(\n 'label' => __( 'Choose your icon style', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'theme_backgrounds',\n 'choices' => $social_choices,\n ) ) );\n }\n// Add Facebook Setting\n\n $wp_customize->add_setting( 'social_facebook', array(\n \t'default' => 'checked',\t\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_facebook', array(\n 'label' => __( 'Display Facebook?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_facebook',\n 'type' => 'checkbox'\n ) ) );\n\n $wp_customize->add_setting( 'facebook_url', array(\n \t'default' => 'http://www.facebook.com/',\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'facebook_url', array(\n 'label' => __( 'Facebook URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'facebook_url'\n ) ) );\n\n\n// Add Twitter Setting\n\n $wp_customize->add_setting( 'social_twitter', array(\n \t'default' => 'checked',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_twitter', array(\n 'label' => __( 'Display Twitter?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_twitter',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'twitter_url', array(\n \t'default' => 'http://www.twitter.com/',\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'twitter_url', array(\n 'label' => __( 'Twitter URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'twitter_url'\n ) ) );\n\n// Add Google+ Setting\n $wp_customize->add_setting( 'social_google', array(\n \t'default' => 'checked',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_google', array(\n 'label' => __( 'Display Google?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_google',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'google_url', array(\n \t'default' => 'http://www.google.com/',\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'google_url', array(\n 'label' => __( 'Google+ URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'google_url'\n ) ) );\n\n// Add LinkedIn Setting\n $wp_customize->add_setting( 'social_linkedin', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_linkedin', array(\n 'label' => __( 'Display LinkedIn?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_linkedin',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'linkedin_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'linkedin_url', array(\n 'label' => __( 'LinkedIn URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'linkedin_url'\n ) ) );\n\n// Add Youtube Setting\n $wp_customize->add_setting( 'social_youtube', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_youtube', array(\n 'label' => __( 'Display Youtube?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_youtube',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'youtube_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'youtube_url', array(\n 'label' => __( 'Youtube URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'youtube_url'\n ) ) );\n\n// Add Flickr Setting\n $wp_customize->add_setting( 'social_flickr', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_flickr', array(\n 'label' => __( 'Display Flickr?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_flickr',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'flickr_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'flickr_url', array(\n 'label' => __( 'Youtube URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'flickr_url'\n ) ) );\n\n// Add Pinterest Setting\n $wp_customize->add_setting( 'social_pinterest', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_pinterest', array(\n 'label' => __( 'Display Pinterest?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_pinterest',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'pinterest_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'pinterest_url', array(\n 'label' => __( 'Pinterest URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'pinterest_url'\n ) ) );\n\n // Add GoogleMap Setting\n $wp_customize->add_setting( 'social_googlemaps', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_googlemaps', array(\n 'label' => __( 'Display Google Maps?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_googlemaps',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'googlemaps_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'googlemaps_url', array(\n 'label' => __( 'Google Maps URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'googlemaps_url'\n ) ) );\n \n // Add Email Setting\n $wp_customize->add_setting( 'social_email', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_email', array(\n 'label' => __( 'Display Email?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_email',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'email_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'email_url', array(\n 'label' => __( 'Email Address', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'email_url'\n ) ) );\n\n// Add RSS Setting\n $wp_customize->add_setting( 'social_rss', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_rss', array(\n 'label' => __( 'Display RSS?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_rss',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'rss_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'rss_url', array(\n 'label' => __( 'RSS URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'rss_url'\n ) ) );\n \n// Add Instagram Setting\n $wp_customize->add_setting( 'social_instagram', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_instagram', array(\n 'label' => __( 'Display Instagram?', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'social_instagram',\n 'type' => 'checkbox'\n ) ) );\n $wp_customize->add_setting( 'instagram_url', array(\n 'sanitize_callback' => 'esc_url_raw',\n ) );\n $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'instagram_url', array(\n 'label' => __( 'Instagram URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_social_media',\n 'settings' => 'instagram_url'\n ) ) );\n\n /* --------------------------------------------------------------\n // BLOG SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_panel( 'blog_id', array(\n 'priority' => 56,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Blog', 'cyberchimps_core' ),\n 'description' => __( 'Several settings for Blog', 'cyberchimps_core' ),\n ) );\n\n $wp_customize->add_section( 'cyberchimps_blog_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Blog Option', 'cyberchimps_core' ),\n 'description' => __( 'Blog elements configuration', 'cyberchimps_core' ),\n 'panel' => 'blog_id',\n ) );\n\n $sidebar_choices = apply_filters( 'sidebar_layout_options', array(\n 'full_width' => $imagepath . '1col.png',\n 'right_sidebar' => $imagepath . '2cr.png'\n ) );\n if ( count( $sidebar_choices ) > 1 ) {\n $wp_customize->add_setting( 'sidebar_images', array(\n 'default' => 'right_sidebar',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'sidebar_images', array(\n 'label' => __( 'Select Page Layout', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'sidebar_images',\n 'choices' => $sidebar_choices,\n ) ) );\n }\n\n $wp_customize->add_setting( 'blog_title', array(\n 'default' => 0,\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n\n $wp_customize->add_control( 'blog_title', array(\n 'label' => __( 'Blog Title', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'blog_title',\n 'class' => 'blog_title_toggle',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'blog_title_text', array(\n 'default' => __( 'Blog', 'cyberchimps_core' ),\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'blog_title_text', array(\n 'label' => __( 'Blog Title Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'blog_title_text',\n 'type' => 'text'\n ) );\n\n\n //Disable Post Format Icons\n $wp_customize->add_setting( 'post_format_icons', array(\n \t'default' => 0,\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_format_icons', array(\n 'label' => __( 'Post Format Icons', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_format_icons',\n 'type' => 'checkbox'\n ) );\n\n //Post Excerpts\n $wp_customize->add_setting( 'post_excerpts', array(\n \t'default' => 0,\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_excerpts', array(\n 'label' => __( 'Post Excerpts', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_excerpts',\n 'type' => 'checkbox'\n ) );\n\n //Post Excerpts Read More Text\n $wp_customize->add_setting( 'blog_read_more_text', array(\n \t'default' => 'Read More ...',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'blog_read_more_text', array(\n 'label' => __( 'Read More Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'blog_read_more_text',\n 'type' => 'text'\n ) );\n\n //Post Excerpts Length\n $wp_customize->add_setting( 'blog_excerpt_length', array(\n \t'default' => '55',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'blog_excerpt_length', array(\n 'label' => __( 'Excerpt Length', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'blog_excerpt_length',\n 'type' => 'text'\n ) );\n\n //Disable Featured Images\n $wp_customize->add_setting( 'post_featured_images', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_featured_images', array(\n 'label' => __( 'Featured Images', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_featured_images',\n 'type' => 'checkbox'\n ) );\n\n //Disable Post Byline Author\n $wp_customize->add_setting( 'post_byline_author', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_byline_author', array(\n 'label' => __( 'Post Byline Author', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_byline_author',\n 'type' => 'checkbox'\n ) );\n\n //Disable Post Byline Categories\n $wp_customize->add_setting( 'post_byline_categories', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_byline_categories', array(\n 'label' => __( 'Post Byline Categories', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_byline_categories',\n 'type' => 'checkbox'\n ) );\n\n //Post Byline Date\n $wp_customize->add_setting( 'post_byline_date', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_byline_date', array(\n 'label' => __( 'Post Byline Date', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_byline_date',\n 'type' => 'checkbox'\n ) );\n\n //Post Byline Comments\n $wp_customize->add_setting( 'post_byline_comments', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_byline_comments', array(\n 'label' => __( 'Post Byline Comments', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_byline_comments',\n 'type' => 'checkbox'\n ) );\n\n //Post Byline Tags\n $wp_customize->add_setting( 'post_byline_tags', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'post_byline_tags', array(\n 'label' => __( 'Post Byline Tags', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blog_section',\n 'settings' => 'post_byline_tags',\n 'type' => 'checkbox'\n ) );\n\n //Choose to display Blog Slider on Blog page\n \n $wp_customize->add_setting('cyberchimps_display_slider', array(\n \t 'default' => '1',\n \t\t'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n \t));\n \n $wp_customize->add_control( new WP_Customize_Control(\n $wp_customize,\n 'cyberchimps_display_slider',\n array(\n \t\t'label' => __('Display Slider ?', 'cyberchimps_core'),\n \t\t'section' => 'cyberchimps_blog_section',\n \t\t'settings' => 'cyberchimps_display_slider',\n \t\t'type' => 'checkbox',\n \t\t)\n \t)\n );\n \n $theme_options_main = get_option('theme_mods_'.get_template());\n if(!isset($theme_options_main['cyberchimps_display_slider']))\n {\n \tset_theme_mod('cyberchimps_display_slider', '1');\n }\n if(!isset($theme_options_main['cyberchimps_display_portfolio']))\n {\n \tset_theme_mod('cyberchimps_display_portfolio', '1');\n }\n if(!isset($theme_options_main['cyberchimps_display_boxes']))\n {\n \tset_theme_mod('cyberchimps_display_boxes', '1');\n }\n \n //Choose to display Portfolio on Blog page\n $wp_customize->add_setting('cyberchimps_display_portfolio', array(\n 'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ));\n \n $wp_customize->add_control(new WP_Customize_Control($wp_customize,'cyberchimps_display_portfolio',\n \tarray(\n \t\t\t'label' => __('Display Portfolio ?', 'cyberchimps_core'),\n \t\t\t'section' => 'cyberchimps_blog_section',\n \t\t\t'settings' => 'cyberchimps_display_portfolio',\n \t\t\t'type' => 'checkbox',\n \t\t\t)\n )\n );\n \n //Choose to display Boxes on Blog page\n $wp_customize->add_setting('cyberchimps_display_boxes', array(\n 'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ));\n \n $wp_customize->add_control(\n \t\tnew WP_Customize_Control(\n \t\t$wp_customize,\n \t\t'cyberchimps_display_boxes',\n \t\tarray(\n \t\t \t'label' => __('Display Boxes ?', 'cyberchimps_core'),\n \t\t\t'section' => 'cyberchimps_blog_section',\n \t\t\t'settings' => 'cyberchimps_display_boxes',\n \t\t\t'type' => 'checkbox',\n \t\t\t)\n \t\t)\n \t);\n \n \n /* --------------------------------------------------------------\n // BLOG SLIDER SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_section( 'cyberchimps_blogslider_section', array(\n 'priority' => 15,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Blog Slider Lite', 'cyberchimps_core' ),\n 'description' => sprintf( __( 'Slider Lite limits you to a total of 3 images throughout your whole site. Upgrade to %1$s to be able to create more images. Categorize them and display each category on a different page.', 'cyberchimps_core' ), '<a href=\"' . apply_filters( 'cyberchimps_upgrade_link', esc_url_raw( 'http://cyberchimps.com' ) ) . '\" title=\"' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '\">' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '</a>' ),\n 'panel' => 'blog_id',\n ) );\n //Slider image 1\n $wp_customize->add_setting( 'image_one_slide', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_slider_lite_img1', '/images/branding/slide1.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_one_slide', array(\n 'label' => __( 'Upload Slider Image 1', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_one_slide',\n 'type' => 'image',\n ) ) );\n\n //Slider image 1 url \n $wp_customize->add_setting( 'image_one_slide_url', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'image_one_slide_url', array(\n 'label' => __( 'Slide 1 URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_one_slide_url',\n 'type' => 'text'\n ) );\n\n //Slider image 2\n $wp_customize->add_setting( 'image_two_slide', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_slider_lite_img2', '/elements/lib/images/slider/slide1.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_two_slide', array(\n 'label' => __( 'Upload Slider Image 2', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_two_slide',\n 'type' => 'image',\n ) ) );\n\n //Slider image 2 url \n $wp_customize->add_setting( 'image_two_slide_url', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'image_two_slide_url', array(\n 'label' => __( 'Slide 2 URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_two_slide_url',\n 'type' => 'text'\n ) );\n\n //Slider image 3\n $wp_customize->add_setting( 'image_three_slide', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_slider_lite_img3', '/elements/lib/images/slider/slide1.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_three_slide', array(\n 'label' => __( 'Upload Slider Image 3', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_three_slide',\n 'type' => 'image',\n ) ) );\n\n //Slider image 3 url \n $wp_customize->add_setting( 'image_three_slide_url', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'image_three_slide_url', array(\n 'label' => __( 'Slide 3 URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogslider_section',\n 'settings' => 'image_three_slide_url',\n 'type' => 'text'\n ) );\n\n /* --------------------------------------------------------------\n // BLOG PORTFOLIO SECTION\n -------------------------------------------------------------- */\n\n $wp_customize->add_section( 'cyberchimps_blogportfolio_section', array(\n 'priority' => 15,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Portfolio Lite', 'cyberchimps_core' ),\n 'description' => sprintf( __( 'Portfolio Lite limits you to a total of 4 items throughout your whole site. Upgrade to %1$s to be able to create as many portfolio items as you like. Categorize them and display each category on a different page.', 'cyberchimps_core' ), '<a href=\"' . apply_filters( 'cyberchimps_upgrade_link', esc_url_raw( 'http://cyberchimps.com' ) ) . '\" title=\"' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '\">' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '</a>' ),\n 'panel' => 'blog_id',\n ) );\n\n //Portfolio image 1\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_one', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_portfolio_lite_img1', '/cyberchimps/lib/images/portfolio.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_portfolio_lite_image_one', array(\n 'label' => __( 'First Portfolio Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_one',\n 'type' => 'image',\n ) ) );\n\n //Portfolio caption 1\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_one_caption', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_lite_image_one_caption', array(\n 'label' => __( 'First Portfolio Image Caption', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_caption1', 'CyberChimps' ),\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_one_caption',\n 'type' => 'text'\n ) );\n\n //Portfolio link checkbox 1\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_toggle_one', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_toggle_one', array(\n 'label' => __( 'Show First Porfolio Link', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_link_toggle_one',\n 'type' => 'checkbox'\n ) );\n\n //Portfolio link 1\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_url_one', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_url_one', array(\n 'label' => __( 'First Porfolio URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_url1', esc_url_raw( 'http://cyberchimps.com' ) ),\n 'settings' => 'cyberchimps_blog_portfolio_link_url_one',\n 'type' => 'text'\n ) );\n\n //Portfolio image 2\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_two', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_portfolio_lite_img2', '/cyberchimps/lib/images/portfolio.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_portfolio_lite_image_two', array(\n 'label' => __( 'Second Portfolio Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_two',\n 'type' => 'image',\n ) ) );\n\n //Portfolio caption 2\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_two_caption', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_lite_image_two_caption', array(\n 'label' => __( 'Second Portfolio Image Caption', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_caption2', 'CyberChimps' ),\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_two_caption',\n 'type' => 'text'\n ) );\n\n //Portfolio link checkbox 2\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_toggle_two', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_toggle_two', array(\n 'label' => __( 'Show Second Porfolio Link', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_link_toggle_two',\n 'type' => 'checkbox'\n ) );\n\n //Portfolio link 2\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_url_two', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_url_two', array(\n 'label' => __( 'Second Porfolio URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_url2', esc_url_raw( 'http://cyberchimps.com' ) ),\n 'settings' => 'cyberchimps_blog_portfolio_link_url_two',\n 'type' => 'text'\n ) );\n\n //Portfolio image 3\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_three', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_portfolio_lite_img3', '/cyberchimps/lib/images/portfolio.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_portfolio_lite_image_three', array(\n 'label' => __( 'Third Portfolio Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_three',\n 'type' => 'image',\n ) ) );\n\n //Portfolio caption 3\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_three_caption', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_lite_image_three_caption', array(\n 'label' => __( 'Third Portfolio Image Caption', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'defualt' => apply_filters( 'cyberchimps_portfolio_lite_caption3', 'CyberChimps' ),\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_three_caption',\n 'type' => 'text'\n ) );\n\n //Portfolio link checkbox 3\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_toggle_three', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_toggle_three', array(\n 'label' => __( 'Show Third Porfolio Link', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_link_toggle_three',\n 'type' => 'checkbox'\n ) );\n\n //Portfolio link 3\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_url_three', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_url_three', array(\n 'label' => __( 'Third Porfolio URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_url3', esc_url_raw( 'http://cyberchimps.com' ) ),\n 'settings' => 'cyberchimps_blog_portfolio_link_url_three',\n 'type' => 'text'\n ) );\n\n //Portfolio image 4\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_four', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_portfolio_lite_img1', '/cyberchimps/lib/images/portfolio.jpg' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_portfolio_lite_image_four', array(\n 'label' => __( 'Forth Portfolio Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_four',\n 'type' => 'image',\n ) ) );\n\n //Portfolio caption 4\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_lite_image_four_caption', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_lite_image_four_caption', array(\n 'label' => __( 'Forth Portfolio Image Caption', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'defualt' => apply_filters( 'cyberchimps_portfolio_lite_caption4', 'CyberChimps' ),\n 'settings' => 'cyberchimps_blog_portfolio_lite_image_four_caption',\n 'type' => 'text'\n ) );\n\n //Portfolio link checkbox 4\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_toggle_four', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_toggle_four', array(\n 'label' => __( 'Show Forth Porfolio Link', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'settings' => 'cyberchimps_blog_portfolio_link_toggle_four',\n 'type' => 'checkbox'\n ) );\n\n //Portfolio link 4\n $wp_customize->add_setting( 'cyberchimps_blog_portfolio_link_url_four', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_portfolio_link_url_four', array(\n 'label' => __( 'Forth Porfolio URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogportfolio_section',\n 'default' => apply_filters( 'cyberchimps_portfolio_lite_url4', 'http://cyberchimps.com' ),\n 'settings' => 'cyberchimps_blog_portfolio_link_url_four',\n 'type' => 'text'\n ) );\n\n /* --------------------------------------------------------------\n // BOXES LITE SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_section( 'cyberchimps_blogboxes_section', array(\n 'priority' => 15,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Boxes Lite', 'cyberchimps_core' ),\n 'description' => sprintf( __( 'Boxes Lite limits you to a total of 3 boxes throughout your whole site. Upgrade to %1$s to be able to create as many boxes as you like. Categorize them and display each category on a different page.', 'cyberchimps_core' ), '<a href=\"' . apply_filters( 'cyberchimps_upgrade_link', esc_url_raw( 'http://cyberchimps.com' ) ) . '\" title=\"' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '\">' . apply_filters( 'cyberchimps_upgrade_pro_title', __( 'Pro', 'cyberchimps_core' ) ) . '</a>' ),\n 'panel' => 'blog_id',\n ) );\n\n//Boxes image 1\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_one', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_boxes_lite_img1', '/elements/lib/images/boxes/slidericon.png' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_boxes_lite_image_one', array(\n 'label' => __( 'First Box Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_one',\n 'type' => 'image',\n ) ) );\n\n//URL of Box link 1\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_link_url_one', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_link_url_one', array(\n 'label' => __( 'First Link URL', 'cyberchimps_core' ),\n 'default' => apply_filters( 'cyberchimps_boxes_lite_url1', esc_url_raw( 'http://wordpress.org' ) ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'settings' => 'cyberchimps_blog_boxes_link_url_one',\n 'type' => 'text'\n ) );\n\n//Box text 1\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_one_text', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_textarea'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_lite_image_one_text', array(\n 'label' => __( 'First Box Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'default' => 'Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.\n Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_one_text',\n 'type' => 'textarea'\n ) );\n\n//Boxes image 2\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_two', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_boxes_lite_img2', '/elements/lib/images/boxes/blueprint.png' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_boxes_lite_image_two', array(\n 'label' => __( 'Second Box Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_two',\n 'type' => 'image',\n ) ) );\n\n//URL of Box link 2\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_link_url_two', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_link_url_two', array(\n 'label' => __( 'Second Link URL', 'cyberchimps_core' ),\n 'default' => apply_filters( 'cyberchimps_boxes_lite_url2', esc_url_raw( 'http://wordpress.org' ) ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'settings' => 'cyberchimps_blog_boxes_link_url_two',\n 'type' => 'text'\n ) );\n\n//Box text 2\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_two_text', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_textarea'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_lite_image_two_text', array(\n 'label' => __( 'Second Box Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'default' => 'Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.\n Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_two_text',\n 'type' => 'textarea'\n ) );\n\n//Boxes image 3\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_three', array(\n 'default' => get_template_directory_uri() . apply_filters( 'cyberchimps_boxes_lite_img3', '/elements/lib/images/boxes/docs.png' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_upload'\n ) );\n $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cyberchimps_blog_boxes_lite_image_three', array(\n 'label' => __( 'Third Box Image', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_three',\n 'type' => 'image',\n ) ) );\n\n//URL of Box link 3\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_link_url_three', array(\n 'sanitize_callback' => 'esc_url_raw'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_link_url_three', array(\n 'label' => __( 'Third Link URL', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'default' => apply_filters( 'cyberchimps_boxes_lite_url3', esc_url_raw( 'http://wordpress.org' ) ),\n 'settings' => 'cyberchimps_blog_boxes_link_url_three',\n 'type' => 'text'\n ) );\n\n//Box text 3\n $wp_customize->add_setting( 'cyberchimps_blog_boxes_lite_image_three_text', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_textarea'\n ) );\n $wp_customize->add_control( 'cyberchimps_blog_boxes_lite_image_three_text', array(\n 'label' => __( 'Third Box Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_blogboxes_section',\n 'default' => 'Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.\n Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.',\n 'settings' => 'cyberchimps_blog_boxes_lite_image_three_text',\n 'type' => 'textarea'\n ) );\n\n /* --------------------------------------------------------------\n // TEMPLATE SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_panel( 'template_id', array(\n 'priority' => 58,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Template', 'cyberchimps_core' ),\n 'description' => __( 'Several settings for Template', 'cyberchimps_core' )\n ) );\n\n /* * ******* Start Single Post Options ********** */\n $wp_customize->add_section( 'cyberchimps_template_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Single Post', 'cyberchimps_core' ),\n 'panel' => 'template_id'\n ) );\n\n if ( count( $sidebar_choices ) > 1 ) {\n $wp_customize->add_setting( 'single_post_sidebar_options', array(\n 'default' => 'right_sidebar',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'single_post_sidebar_options', array(\n 'label' => __( 'Sidebar Options', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_sidebar_options',\n 'choices' => $sidebar_choices,\n ) ) );\n }\n\n//Disable Post Title\n $wp_customize->add_setting( 'single_post_title', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_title', array(\n 'label' => __( 'Post Title', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_title',\n 'type' => 'checkbox'\n ) );\n\n//Disable Featured Images\n $wp_customize->add_setting( 'single_post_featured_images', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_featured_images', array(\n 'label' => __( 'Featured Images', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_featured_images',\n 'type' => 'checkbox'\n ) );\n\n//Disable Post Format Icons\n $wp_customize->add_setting( 'single_post_format_icons', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_format_icons', array(\n 'label' => __( 'Post Format Icons', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_format_icons',\n 'type' => 'checkbox'\n ) );\n\n//Disable Post Byline Author\n $wp_customize->add_setting( 'single_post_byline_author', array(\n 'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_byline_author', array(\n 'label' => __( 'Post Byline Author', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_byline_author',\n 'type' => 'checkbox'\n ) );\n\n//Disable Post Byline Categories\n $wp_customize->add_setting( 'single_post_byline_categories', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_byline_categories', array(\n 'label' => __( 'Post Byline Categories', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_byline_categories',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Date\n $wp_customize->add_setting( 'single_post_byline_date', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_byline_date', array(\n 'label' => __( 'Post Byline Date', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_byline_date',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Comments\n $wp_customize->add_setting( 'single_post_byline_comments', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_byline_comments', array(\n 'label' => __( 'Post Byline Comments', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_byline_comments',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Tags\n $wp_customize->add_setting( 'single_post_byline_tags', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'single_post_byline_tags', array(\n 'label' => __( 'Post Byline Tags', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_template_section',\n 'settings' => 'single_post_byline_tags',\n 'type' => 'checkbox'\n ) );\n\n /* * ******* End Single Post Options ********** */\n\n /* * ******* Start Archive template Options ********** */\n\n $wp_customize->add_section( 'cyberchimps_archive_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Archive', 'cyberchimps_core' ),\n 'panel' => 'template_id'\n ) );\n\n if ( count( $sidebar_choices ) > 1 ) {\n $wp_customize->add_setting( 'archive_sidebar_options', array(\n 'default' => 'right_sidebar',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'archive_sidebar_options', array(\n 'label' => __( 'Sidebar Options', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_sidebar_options',\n 'choices' => $sidebar_choices,\n ) ) );\n }\n\n//Post Format Icons\n $wp_customize->add_setting( 'archive_format_icons', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_format_icons', array(\n 'label' => __( 'Post Format Icons', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_format_icons',\n 'type' => 'checkbox'\n ) );\n\n//Post Excerpts\n $wp_customize->add_setting( 'archive_post_excerpts', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_post_excerpts', array(\n 'label' => __( 'Post Excerpts', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_excerpts',\n 'type' => 'checkbox'\n ) );\n\n//Disable Featured Images\n $wp_customize->add_setting( 'archive_featured_images', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_featured_images', array(\n 'label' => __( 'Featured Images', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_featured_images',\n 'type' => 'checkbox'\n ) );\n\n//Disable Post Byline Author\n $wp_customize->add_setting( 'archive_post_byline_author', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_post_byline_author', array(\n 'label' => __( 'Post Byline Author', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_byline_author',\n 'type' => 'checkbox'\n ) );\n\n//Disable Post Byline Categories\n $wp_customize->add_setting( 'archive_post_byline_categories', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_post_byline_categories', array(\n 'label' => __( 'Post Byline Categories', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_byline_categories',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Date\n $wp_customize->add_setting( 'archive_post_byline_date', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'rchive_post_byline_date', array(\n 'label' => __( 'Post Byline Date', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_byline_date',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Comments\n $wp_customize->add_setting( 'archive_post_byline_comments', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_post_byline_comments', array(\n 'label' => __( 'Post Byline Comments', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_byline_comments',\n 'type' => 'checkbox'\n ) );\n\n//Post Byline Tags\n $wp_customize->add_setting( 'archive_post_byline_tags', array(\n \t'default' => '1',\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'archive_post_byline_tags', array(\n 'label' => __( 'Post Byline Tags', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_archive_section',\n 'settings' => 'archive_post_byline_tags',\n 'type' => 'checkbox'\n ) );\n\n /* * ******* End Archive template Options ********** */\n\n /* * ******* Start Search template Options ********** */\n $wp_customize->add_section( 'cyberchimps_search_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( 'Search', 'cyberchimps_core' ),\n 'panel' => 'template_id'\n ) );\n\n if ( count( $sidebar_choices ) > 1 ) {\n $wp_customize->add_setting( 'search_sidebar_options', array(\n 'default' => 'right_sidebar',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'search_sidebar_options', array(\n 'label' => __( 'Sidebar Options', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_search_section',\n 'settings' => 'search_sidebar_options',\n 'choices' => $sidebar_choices,\n ) ) );\n }\n\n//Post Excerpts\n $wp_customize->add_setting( 'search_post_excerpts', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'search_post_excerpts', array(\n 'label' => __( 'Post Excerpts', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_search_section',\n 'default' => 55,\n 'settings' => 'search_post_excerpts',\n 'type' => 'checkbox'\n ) );\n\n//Post Excerpts Read More Text\n $wp_customize->add_setting( 'search_post_read_more', array(\n \t'default' => __( 'Read More...', 'cyberchimps_core' ),\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'search_post_read_more', array(\n 'label' => __( 'Read More Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_search_section',\n 'settings' => 'search_post_read_more',\n 'type' => 'text'\n ) );\n\n//Post Excerpts Length\n $wp_customize->add_setting( 'search_post_excerpt_length', array(\n \t'default' => '55',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'search_post_excerpt_length', array(\n 'label' => __( 'Excerpt Length', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_search_section',\n 'settings' => 'search_post_excerpt_length',\n 'type' => 'text'\n ) );\n\n /* * ******* End Search template Options ********** */\n\n /* * ******* Start 404 template Options ********** */\n\n $wp_customize->add_section( 'cyberchimps_error_section', array(\n 'priority' => 10,\n 'capability' => 'edit_theme_options',\n 'theme_supports' => '',\n 'title' => __( '404', 'cyberchimps_core' ),\n 'panel' => 'template_id'\n ) );\n\n if ( count( $sidebar_choices ) > 1 ) {\n $wp_customize->add_setting( 'error_sidebar_options', array(\n 'default' => 'right_sidebar',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'error_sidebar_options', array(\n 'label' => __( 'Sidebar Options', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_error_section',\n 'settings' => 'error_sidebar_options',\n 'choices' => $sidebar_choices,\n ) ) );\n }\n\n//Custom 404 Title\n $wp_customize->add_setting( 'error_custom_title', array(\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'error_custom_title', array(\n 'label' => __( 'Custom 404 Title', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_error_section',\n 'settings' => 'error_custom_title',\n 'type' => 'text'\n ) );\n\n//Custom 404 Content\n $wp_customize->add_setting( 'error_custom_content', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_textarea'\n ) );\n $wp_customize->add_control( 'error_custom_content', array(\n 'label' => __( 'Custom 404 Content', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_error_section',\n 'settings' => 'error_custom_content',\n 'type' => 'textarea'\n ) );\n\n /* * ******* End 404 template Options ********** */\n\n /* --------------------------------------------------------------\n // FOOTER SECTION\n -------------------------------------------------------------- */\n\n $wp_customize->add_section( 'cyberchimps_footer_section', array(\n 'title' => __( 'Footer', 'cyberchimps_core' ),\n 'priority' => 60,\n ) );\n\n $wp_customize->add_setting( 'footer_show_toggle', array(\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'footer_show_toggle', array(\n 'label' => __( 'Footer Widgets', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_footer_section',\n 'settings' => 'footer_show_toggle',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'footer_copyright_text', array(\n \t'default' => '© Wordpress',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n $wp_customize->add_control( 'footer_copyright_text', array(\n 'label' => __( 'Footer Copyright Text', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_footer_section',\n 'settings' => 'footer_copyright_text',\n 'type' => 'text'\n ) );\n\n\n /* --------------------------------------------------------------\n // LAYOUT SECTION\n -------------------------------------------------------------- */\n $wp_customize->add_section( 'cyberchimps_layout_section', array(\n 'title' => __( 'Layout', 'cyberchimps_core' ),\n 'priority' => 30,\n ) );\n\n $wp_customize->add_setting( 'responsive_design', array(\n \t'default' => apply_filters( 'responsive_design_default', 'checked' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'responsive_design', array(\n 'label' => __( 'Responsive Design', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_layout_section',\n 'settings' => 'responsive_design',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'responsive_videos', array(\n \t'default' => apply_filters( 'responsive_videos_default', 'checked' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'responsive_videos', array(\n 'label' => __( 'Responsive Videos', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_layout_section',\n 'settings' => 'responsive_videos',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'gallery_lightbox', array(\n \t'default' => apply_filters( 'gallery_lightbox_default', 'checked' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'gallery_lightbox', array(\n 'label' => __( 'Gallery Lightbox', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_layout_section',\n 'settings' => 'gallery_lightbox',\n 'type' => 'checkbox'\n ) );\n\n $wp_customize->add_setting( 'wide_sidebar', array(\n \t'default' => apply_filters( 'wide_sidebar_default', 'checked' ),\n 'sanitize_callback' => 'cyberchimps_sanitize_checkbox'\n ) );\n $wp_customize->add_control( 'wide_sidebar', array(\n 'label' => __( 'Wide Sidebar', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_layout_section',\n 'description' => __( 'Only works on layouts with 1 sidebar', 'cyberchimps_core' ),\n 'settings' => 'wide_sidebar',\n 'type' => 'checkbox'\n ) );\n\n// website width\n $wp_customize->add_setting( 'max_width', array(\n 'default' => apply_filters( 'max_width_default', '1020' ),\n 'sanitize_callback' => 'absint'\n ) );\n\n $wp_customize->add_control( 'max_width', array(\n 'label' => __( 'Max Width', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_layout_section',\n 'type' => 'text',\n 'settings' => 'max_width',\n ) );\n\n//Design\n\n $wp_customize->add_section( 'cyberchimps_design_section', array(\n 'title' => __( 'Design', 'cyberchimps_core' ),\n 'priority' => 35,\n ) );\n\n// theme skin\n// First check that there is more than one skin to show, otherwise hide the options as requested by WP\n $choices = apply_filters( 'cyberchimps_skin_color', array( 'default' => get_template_directory_uri() . '/inc/css/skins/images/default.png' ) );\n if ( count( $choices ) > 1 ) {\n $wp_customize->add_setting( 'cyberchimps_skin_color', array(\n 'default' => 'default',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_skin_selector( $wp_customize, 'skin_color', array(\n 'label' => __( 'Skin Color', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_design_section',\n 'settings' => 'cyberchimps_skin_color',\n 'choices' => $choices,\n ) ) );\n \n $theme_options_main = get_option('theme_mods_'.get_template());\n if(!isset($theme_options_main['cyberchimps_skin_color']))\n {\n \tset_theme_mod('cyberchimps_skin_color', 'default');\n }\n }\n\n// text color\n $wp_customize->add_setting( 'text_colorpicker', array(\n 'default' => '',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'text_colorpicker', array(\n 'label' => __( 'Text Color', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_design_section',\n 'settings' => 'text_colorpicker',\n ) ) );\n\n// link color\n $wp_customize->add_setting( 'link_colorpicker', array(\n 'default' => '',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_colorpicker', array(\n 'label' => __( 'Link Color', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_design_section',\n 'settings' => 'link_colorpicker',\n ) ) );\n\n// link hover color\n $wp_customize->add_setting( 'link_hover_colorpicker', array(\n 'default' => '',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_hover_colorpicker', array(\n 'label' => __( 'Link Hover Color', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_design_section',\n 'settings' => 'link_hover_colorpicker',\n ) ) );\n\n// new typography section\n $wp_customize->add_section( 'cyberchimps_typography_section', array(\n 'title' => __( 'Typography', 'cyberchimps_core' ),\n 'priority' => 40,\n ) );\n\n// typography sizes\n $wp_customize->add_setting( 'customize_options[typography_options][size]', array(\n 'default' => '14px',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_Typography_Size( $wp_customize, 'typography_size', array(\n 'label' => __( 'Typography Size', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'select',\n 'settings' => 'customize_options[typography_options][size]',\n 'choices' => apply_filters( 'cyberchimps_typography_sizes', '' )\n ) ) );\n\n// typography style\n $wp_customize->add_setting( 'customize_options[typography_options][style]', array(\n 'default' => 'normal',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'typography_style', array(\n 'label' => __( 'Typography Style', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'select',\n 'settings' => 'customize_options[typography_options][style]',\n 'choices' => apply_filters( 'cyberchimps_typography_styles', '' )\n ) );\n\n// typography face\n /* Default font faces */\n $faces = array(\n 'Arial, Helvetica, sans-serif' => 'Arial',\n 'Arial Black, Gadget, sans-serif' => 'Arial Black',\n 'Comic Sans MS, cursive' => 'Comic Sans MS',\n 'Courier New, monospace' => 'Courier New',\n 'Georgia, serif' => 'Georgia',\n '\"HelveticaNeue-Light\", \"Helvetica Neue Light\",\n\t\t\"Helvetica Neue\",Helvetica, Arial, \"Lucida Grande\",\n\t\tsans-serif' => 'Helvetica Neue',\n 'Impact, Charcoal, sans-serif' => 'Impact',\n 'Lucida Console, Monaco, monospace' => 'Lucida Console',\n 'Lucida Sans Unicode, Lucida Grande, sans-serif' => 'Lucida Sans Unicode',\n '\"Open Sans\", sans-serif' => 'Open Sans',\n 'Palatino Linotype, Book Antiqua, Palatino, serif' => 'Palatino Linotype',\n 'Tahoma, Geneva, sans-serif' => 'Tahoma',\n 'Times New Roman, Times, serif' => 'Times New Roman',\n 'Trebuchet MS, sans-serif' => 'Trebuchet MS',\n 'Verdana, Geneva, sans-serif' => 'Verdana',\n 'Symbol' => 'Symbol',\n 'Webdings' => 'Webdings',\n 'Wingdings, Zapf Dingbats' => 'Wingdings',\n 'MS Sans Serif, Geneva, sans-serif' => 'MS Sans Serif',\n 'MS Serif, New York, serif' => 'MS Serif',\n 'Google Fonts' => 'Google Fonts'\n );\n// Font family for text\n $wp_customize->add_setting( 'customize_options[typography_options][face]', array(\n 'default' => 'Arial Black, Gadget, sans-serif',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'typography_face', array(\n 'label' => __( 'Typography Face', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'select',\n 'settings' => 'customize_options[typography_options][face]',\n 'choices' => apply_filters( 'cyberchimps_typography_faces', $faces )\n ) );\n\n// Google Font family for text\n $wp_customize->add_setting( 'customize_options[google_font_field]', array(\n 'default' => 'Arial',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'google_font_field', array(\n 'label' => __( 'Enter Google font', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'text',\n 'settings' => 'customize_options[google_font_field]',\n ) );\n\n// Font family for headings\n $wp_customize->add_setting( 'customize_options[font_family_headings][face]', array(\n 'default' => 'Arial Black, Gadget, sans-serif',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'font_family_headings', array(\n 'label' => __( 'Font Family for headings', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'select',\n 'settings' => 'customize_options[font_family_headings][face]',\n 'choices' => apply_filters( 'cyberchimps_typography_faces', $faces )\n ) );\n\n// Google Font family for headings\n $wp_customize->add_setting( 'customize_options[google_font_headings]', array(\n 'default' => 'Arial',\n 'sanitize_callback' => 'cyberchimps_text_sanitization'\n ) );\n\n $wp_customize->add_control( 'google_font_headings', array(\n 'label' => __( 'Google font for headings', 'cyberchimps_core' ),\n 'section' => 'cyberchimps_typography_section',\n 'type' => 'text',\n 'settings' => 'customize_options[google_font_headings]',\n ) );\n\n// background image\n $wp_customize->add_setting( 'cyberchimps_background', array(\n 'default' => 'none',\n 'type' => 'theme_mod',\n 'sanitize_callback' => 'cyberchimps_file_sanitization'\n ) );\n\n $wp_customize->add_control( new Cyberchimps_Background_Image( $wp_customize, 'cyberchimps_background', array(\n 'label' => 'CyberChimps ' . __( 'Background Image', 'cyberchimps_core' ),\n 'section' => 'background_image',\n 'settings' => 'cyberchimps_background',\n 'choices' => apply_filters( 'cyberchimps_background_image', '' ),\n ) ) );\n}", "function payment_fields() {\n\t\t\tif ( $this->description ) echo wpautop( wptexturize( $this->description ) );\n\t\t\tdo_action( 'tgm_jigoshop_payment_fields' ); // allow for insertion of custom code if needed\n\t\t}", "public function payment_fields() {\n\t\t$message = $this->get_sandbox_form_message( $this->get_transaction_address( 'country' ) );\n\t\twc_get_template(\n\t\t\t'sandbox-checkout-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_sandbox_mode' => $this->is_sandbox_mode,\n\t\t\t\t'message' => $message,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\t$description = $this->get_description();\n\t\tif ( isset( $description ) ) {\n\t\t\techo wp_kses_post( wpautop( wptexturize( $description ) ) );\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'tef/payment-form.php',\n\t\t\tarray(\n\t\t\t\t'title' => $this->title,\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'id' => $this->id,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\tparent::checkout_rate_conversion( WC_EBANX_Constants::CURRENCY_CODE_BRL );\n\t}", "function _c_form($options)\n\t{\t \n\t\t\n\n\t\t\trequire_once(TEMPLATEPATH . '/template-helpers/contact_form.php');\n\t\t\t\n\t\t\t\n\t}", "function ig_es_add_captcha_option( $form_data ) {\n\n\tif ( ! ES()->is_premium_installed() ) {\n\n\t\t$utm_args = array(\n\t\t\t\"utm_medium\" => \"es_form_captcha\"\n\t\t);\n\n\t\t$pricing_url = ES_Common::get_utm_tracking_url( $utm_args );\n\n\t\t?>\n\n\t\t<div class=\"flex border-b border-gray-100 \">\n\t\t\t<div class=\"w-2/5 mr-16\">\n\t\t\t\t<div class=\"flex flex-row w-full\">\n\t\t\t\t\t<div class=\"flex w-2/4\">\n\t\t\t\t\t\t<div class=\"ml-4 mr-8 mr-4 pt-4 mb-2\">\n\t\t\t\t\t\t\t<label for=\"tag-link\"><span class=\"block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2\"><?php echo __( 'Enable Captcha' ); ?></span></label>\n\t\t\t\t\t\t\t<p class=\"italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-4\"><?php _e( 'Show a captcha to protect from bot signups.', 'email-subscribers' ); ?></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t<div class=\"ml-16 mb-4 mr-4 mt-12\">\n\t\t\t\t\t\t\t<label for=\"captcha\" class=\" inline-flex items-center cursor-pointer\">\n\t\t\t\t\t\t\t\t<span class=\"relative\">\n\t\t\t\t\t\t\t\t\t<span class=\"relative es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline \"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</label>\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\n\t\t\t<div class=\"w-3/6 mt-3.5 pr-4\">\n\t\t\t\t<div class=\"inline-flex rounded-md bg-teal-50 px-2 pt-1 w-full\">\n\t\t\t\t\t<div class=\"px-2 pt-2 pb-2\">\n\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t<div class=\"flex-shrink-0\">\n\t\t\t\t\t\t\t\t<svg class='h-5 w-5 text-teal-400' fill='currentColor' viewBox='0 0 20 20'>\n\t\t\t\t\t\t\t\t\t<path fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z' clip-rule='evenodd'/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"ml-3\">\n\t\t\t\t\t\t\t\t<h3 class=\"text-sm leading-5 font-medium text-blue-800\">\n\t\t\t\t\t\t\t\t\t<?php _e( sprintf(\"<a href='%s' target='_blank'>Upgrade to ES PRO</a>\", $pricing_url), 'email-subscribers' ); ?>\n\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t<div class=\"mt-2 text-sm leading-5 text-teal-700\">\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<?php _e( 'Secure your form and avoid spam signups with form Captcha', 'email-subscribers' ); ?>\n\n\t\t\t\t\t\t\t\t\t\t<?php if(ES_Common::can_show_coupon('PREMIUM10')) { _e( 'Get <b>10% flat discount</b> if you upgrade now!. <br /><br />Use coupon code <b>PREMIUM10</b>', 'email-subscribers' );}?>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\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<?php }\n}", "function cap_byline_activate() {\n /**\n * Create the Gravity Form contact form for bios\n */\n if ( function_exists('gform_notification') ) {\n $form = Array (\n 'labelPlacement' => 'top_label',\n 'useCurrentUserAsAuthor' => 1,\n 'title' => __('Contact Author', 'cap-byline'),\n 'description' => __('Fill out the form below to contact this author', 'cap-byline'),\n 'descriptionPlacement' => 'below',\n 'button' => Array ( 'type' => 'text', 'text' => __('Submit', 'cap-byline') ),\n 'fields' => Array (\n '0' => Array (\n 'id' => '1',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'name',\n 'label' => __('Name', 'cap-byline'),\n 'inputs' =>Array (\n '0' => Array ( 'id' => '1.3', 'label' => __('First', 'cap-byline') ),\n '1' => Array ( 'id' => '1.6', 'label' => __('Last', 'cap-byline') )\n ),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '1' => Array (\n 'id' => '2',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'email',\n 'label' => __('Email', 'cap-byline'),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '2' => Array (\n 'id' => '3',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'textarea',\n 'label' => __('Message', 'cap-byline'),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '3' => Array (\n 'allowsPrepopulate' => 1,\n 'id' => 4,\n 'size' => 'medium',\n 'type' => 'hidden',\n 'inputName' => 'author_contact_email',\n 'label' => __('To', 'cap-byline'),\n 'formId' => 2,\n 'pageNumber' => 1,\n 'descriptionPlacement' => 'below'\n )\n ),\n 'enableHoneypot' => '1',\n 'enableAnimation' => '1',\n 'id' => '2',\n 'notifications' => Array (\n '53a057ebea107' => Array (\n 'id' => '53a057ebea107',\n 'to' => '{admin_email}',\n 'name' => __('Admin Notification', 'cap-byline'),\n 'event' => 'form_submission',\n 'toType' => 'email',\n 'subject' => sprintf(__('You have received a message from %s', 'cap-byline'), get_bloginfo('name')),\n 'message' => '{all_fields}'\n ),\n ),\n 'confirmations' => Array (\n '53a057ebeadd6' => Array (\n 'id' => '53a057ebeadd6',\n 'isDefault' => '1',\n 'type' => 'message',\n 'name' => __('Default Confirmation', 'cap-byline'),\n 'message' => __('Thank you for contacting me.', 'cap-byline'),\n 'disableAutoformat' => null,\n 'pageId' => null,\n 'url' => null,\n 'queryString' => null,\n 'conditionalLogic' => Array ( ),\n )\n ),\n 'is_active' => '1',\n 'date_created' => '2014-06-17 15:17:18',\n 'is_trash' => '0',\n );\n $form_id = GFAPI::add_form($form);\n }\n}", "function give_get_donation_cc_info() {\n\n\t// Sanitize the values submitted with donation form.\n\t$post_data = give_clean( $_POST ); // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\t$cc_info = array();\n\t$cc_info['card_name'] = ! empty( $post_data['card_name'] ) ? $post_data['card_name'] : '';\n\t$cc_info['card_number'] = ! empty( $post_data['card_number'] ) ? $post_data['card_number'] : '';\n\t$cc_info['card_cvc'] = ! empty( $post_data['card_cvc'] ) ? $post_data['card_cvc'] : '';\n\t$cc_info['card_exp_month'] = ! empty( $post_data['card_exp_month'] ) ? $post_data['card_exp_month'] : '';\n\t$cc_info['card_exp_year'] = ! empty( $post_data['card_exp_year'] ) ? $post_data['card_exp_year'] : '';\n\t$cc_info['card_address'] = ! empty( $post_data['card_address'] ) ? $post_data['card_address'] : '';\n\t$cc_info['card_address_2'] = ! empty( $post_data['card_address_2'] ) ? $post_data['card_address_2'] : '';\n\t$cc_info['card_city'] = ! empty( $post_data['card_city'] ) ? $post_data['card_city'] : '';\n\t$cc_info['card_state'] = ! empty( $post_data['card_state'] ) ? $post_data['card_state'] : '';\n\t$cc_info['card_country'] = ! empty( $post_data['billing_country'] ) ? $post_data['billing_country'] : '';\n\t$cc_info['card_zip'] = ! empty( $post_data['card_zip'] ) ? $post_data['card_zip'] : '';\n\n\t// Return cc info.\n\treturn $cc_info;\n}", "public function run() {\n parent::run();\n $this->registerFormScripts();\n if ($this->applyJqueryPaymentFormat || $this->applyJqueryPaymentValidation) {\n $this->registerJqueryPaymentScripts();\n }\n }", "function checkout_js() {\n\t ?><script type=\"text/javascript\"> jQuery(document).ready( function() { jQuery(\"a#stripe_cancel\").click( function() { if ( confirm( \"<?php echo __('Please note that if you cancel your subscription you will not be immune to future price increases. The price of un-canceled subscriptions will never go up!\\n\\nAre you sure you really want to cancel your subscription?\\nThis action cannot be undone!', 'psts'); ?>\" ) ) return true; else return false; }); });</script><?php\n\t}", "public function getCSS()\n {\n ob_start();\n ?>\n div.webFormHelpBox {\n position: absolute;\n left: 320px;\n top: 330px;\n width: 200px;\n font-family: Arial, Verdana, sans-serif;\n font-size: 8pt;\n line-height: 8pt;\n font-weight: normal;\n background-color: #f7f7f7;\n border: 1px solid #cccccc;\n padding: 8px;\n visibility: hidden;\n }\n div.webFormErrorBox {\n position: absolute;\n left: 320px;\n top: 330px;\n width: 200px;\n font-family: Arial, Verdana, sans-serif;\n font-size: 8pt;\n line-height: 8pt;\n font-weight: normal;\n background-color: #fddbdb;\n border: 1px solid #9a1515;\n padding: 8px;\n visibility: hidden;\n color: #000000;\n }\n td.wfErrorText {\n font-family: Arial, Verdana, sans-serif;\n font-size: 12px;\n font-weight: normal;\n color: #000000;\n line-height: 14px;\n }\n div.webFormCaption {\n font-size: 8pt;\n color: #888888;\n line-height: 10pt;\n font-family: Arial, Verdana, sans-serif;\n text-align: left;\n width: 150px;\n padding: 2px;\n display: none;\n }\n span.webFormVerifyText {\n font-family: Arial, Verdana, sans-serif;\n font-size: 9pt;\n font-weight: normal;\n }\n input.webFormSaveButton {\n font-family: Arial, Verdana, sans-serif;\n font-size: 7pt;\n font-weight: bold;\n }\n div.webFormVerifyFieldContainer {\n padding: 1px;\n background-color: #f0f0f0;\n border: 1px solid #c0c0c0;\n }\n div.webFormVerifyFieldContainerBox {\n padding: 1px;\n background-color: #f0f0f0;\n border: 1px solid #c0c0c0;\n /*height: 63px;*/\n }\n a.webFormVerifyFieldLink {\n font-family: Arial, Verdana, sans-serif;\n font-size: 10pt;\n font-weight: normal;\n text-decoration: none;\n color: #000000;\n }\n input:hover {\n background-color: #f2f2f2;\n }\n textarea:hover {\n background-color: #f2f2f2;\n }\n\n /* Elements <input>-type items */\n <?php if ($this->_verifyForm) { ?>\n .webFormElementText {\n padding: 3px 0px 2px 18px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementTextBox {\n padding: 0px 0px 0px 0px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementSelect {\n\n }\n <?php } else { ?>\n .webFormElementText {\n padding: 3px 0px 2px 3px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementTextBox {\n padding: 0px 0px 0px 0px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementSelect {\n\n }\n <?php } ?>\n\n <?php\n $css = ob_get_contents();\n ob_end_clean();\n\n return $css;\n }", "public function getJavaScript()\n {\n ob_start();\n ?>\n webFormChangesMade = false;\n\n <?php\n foreach($this->_fields as $field)\n {\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n echo sprintf(\" var wf%sMonthError = false;\\n var wf%sYearError = false;\",\n $field['id'], $field['id']\n );\n }\n else\n {\n echo sprintf(\" var wf%sError = false;\\n\",\n $field['id']\n );\n }\n }\n ?>\n\n function webFormSubmit(form)\n {\n var errors = '';\n var tmperrors = '';\n <?php\n foreach($this->_fields as $field)\n {\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n ?>\n var <?php echo $field['id'] ?>Month = document.getElementById('<?php echo $field['id'] ?>Month');\n var <?php echo $field['id'] ?>Year = document.getElementById('<?php echo $field['id'] ?>Year');\n if (<?php echo $field['id'] ?>Month.value == 'nosel' || <?php echo $field['id'] ?>Year.value == 'nosel')\n errors += \":You must select an expiration date and year for your credit card\";\n <?php\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n ?>\n var <?php echo $field['id'] ?> = document.getElementById('<?php echo $field['id'] ?>');\n if (<?php echo $field['id'] ?>.value == 'nosel')\n errors += \":You must select a value for <?php echo addslashes($field['caption']) ?>\";\n <?php\n }\n else\n {\n ?>\n errors += webFormValidateField('<?php echo $field['id']; ?>', <?php echo ($field['required'] ? 'true' : 'false'); ?>);\n <?php\n }\n }\n ?>\n\n if (errors != '')\n {\n alert(\"Please correct the following problems with your entries:\\n\" + errors.replace(/:/g,\"\\n- \"));\n }\n else\n {\n eval('document.' + form + '.submit();');\n }\n }\n function webFormValidateField(id, required)\n {\n var obj = document.getElementById(id);\n var objCaption = document.getElementById(id + 'Caption');\n var retVal;\n\n if(obj)\n {\n if (obj.value == '' && required == false) return '';\n var str = obj.value;\n str = str.replace(/'/g,\"\\\\'\");\n str = str.replace(/\\r/g,\"\");\n str = str.replace(/\\n/g,\"\");\n eval( 'retVal = webFormValidate' + id + '(\\'' + str + '\\');' );\n\n if (retVal != '')\n {\n obj.style.backgroundColor = '#FFE8E8';\n if (objCaption) objCaption.innerHTML = retVal.substr(1);\n <?php\n if ($this->_verifyForm)\n {\n echo sprintf(\"webFormEditField('%s', true, %s);\", $field['id'], ($field['required'] ? 'true' : 'false'));\n }\n ?>\n }\n else\n {\n obj.style.backgroundColor= '#FFFFFF';\n if (objCaption) objCaption.innerHTML = '';\n }\n return retVal;\n }\n return '';\n }\n\n <?php\n if ($this->_verifyForm)\n {\n ?>\n function webFormFormatEditFields()\n {\n <?php\n // get the formatting right for display\n foreach ($this->_fields as $field)\n {\n switch ($field['type'])\n {\n case WFT_PHONE:\n ?>programs:/Utilities/\n var obj = document.getElementById('<?php echo $field['id'] ?>EditText');\n if (obj)\n {\n var str = obj.innerHTML;\n if (str.length == 10)\n obj.innerHTML = str.substring(0, 3) + '-' + str.substring(3, 6) + '-' + str.substring(6, 10);\n }\n <?php\n break;\n }\n }\n ?>\n }\n\n function webFormFieldHover(id, tf)\n {\n var editButton = document.getElementById(id + 'Edit');\n var editContainer = document.getElementById(id + 'Container');\n if (tf == true && editButton)\n {\n editButton.style.visibility = 'visible';\n editContainer.style.border = '1px dotted #333333';\n editContainer.style.backgroundColor = '#e0e0e0';\n }\n else if(editButton)\n {\n editButton.style.visibility = 'hidden';\n editContainer.style.border = '1px solid #c0c0c0';\n editContainer.style.backgroundColor = '#f0f0f0';\n }\n }\n\n function webFormCancelEditField(id, required)\n {\n var inputBox = document.getElementById(id);\n var inputBoxMonth = document.getElementById(id+'Month');\n var inputBoxYear = document.getElementById(id+'Year');\n var editText = document.getElementById(id + 'EditText');\n\n if (inputBox)\n {\n var oldText = editText.innerHTML;\n if (oldText.indexOf('(Empty)') != -1)\n inputBox.value = '';\n else\n inputBox.value = oldText;\n }\n else if(inputBoxMonth && inputBoxYear)\n {\n var expire = editText.innerHTML;\n var parts = expire.split('/');\n inputBoxMonth.value = parts[0];\n inputBoxYear.value = parts[1];\n }\n webFormEditField(id, false, false);\n }\n\n function webFormEditField(id, tf, required)\n {\n var editButton = document.getElementById(id + 'Edit');\n var editContainer = document.getElementById(id + 'Container');\n var editText = document.getElementById(id + 'EditText');\n var inputBox = document.getElementById(id);\n var saveButton = document.getElementById(id + 'Save');\n var cancelButton = document.getElementById(id + 'Cancel');\n\n var inputBoxMonth = document.getElementById(id+'Month');\n var inputBoxYear = document.getElementById(id+'Year');\n\n // for verify images\n if (!saveButton) return;\n\n if (tf == true)\n {\n showVal = \"\";\n hideVal = \"none\";\n saveButton.style.display = \"\";\n cancelButton.style.display = \"\";\n editButton.style.display = \"none\";\n editContainer.style.display = \"none\";\n editText.style.display = \"none\";\n if (inputBox)\n {\n inputBox.style.display = \"\";\n inputBox.focus();\n if (inputBox.type != 'select-one')\n inputBox.select();\n }\n if (inputBoxMonth && inputBoxYear)\n {\n inputBoxMonth.style.display = \"\";\n inputBoxMonth.focus();\n inputBoxYear.style.display = \"\";\n }\n }\n else\n {\n errors = webFormValidateField(id, required);\n if (errors == '')\n {\n saveButton.style.display = \"none\";\n cancelButton.style.display = \"none\";\n editButton.style.display = \"\";\n editContainer.style.display = \"\";\n editText.style.display = \"\";\n if (inputBox) inputBox.style.display = \"none\";\n if (inputBoxMonth && inputBoxYear)\n {\n inputBoxMonth.style.display = \"none\";\n inputBoxYear.style.display = \"none\";\n if (inputBoxMonth.value != '' && inputBoxYear.value != '')\n editText.innerHTML = inputBoxMonth.value + \"/\" + inputBoxYear.value;\n else\n editText.innerHTML = \"<span style=\\\"color: #999999;\\\">(Empty)</span>\";\n }\n else\n {\n var str;\n\n if (inputBox.type == 'select-one')\n {\n // <select> element\n str = inputBox.options[inputBox.selectedIndex].text;\n }\n else\n {\n str = inputBox.value;\n }\n\n if (str.length == 0)\n editText.innerHTML = \"<span style=\\\"color: #999999;\\\">(Empty)</span>\";\n else\n editText.innerHTML = str;\n }\n webFormChangesMade = true;\n }\n webFormFormatEditFields();\n }\n }\n <?php\n }\n ?>\n\n <?php\n foreach($this->_fields as $field)\n {\n ?>\n function webFormValidate<?php echo $field['id'] ?>(data)\n {\n <?php\n if ($field['required'])\n {\n ?>\n if (data == '')\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo (strlen($field['caption']) > 0 ? $field['caption'] : 'This field'); ?> is a required field';\n }\n <?php\n }\n if (!$field['required']) echo \"if (data.length > 0)\\n{\\n\";\n ?>\n if (data.length < <?php echo $field['length'][0]; ?> || data.length > <?php echo $field['length'][1]; ?>)\n {\n <?php\n if ($field['length'][0] == $field['length'][1])\n {\n ?>\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo (strlen($field['caption']) > 0 ? $field['caption'] : 'This field'); ?> must be <?php echo $field['length'][0] ?> characters in length';\n <?php\n }\n else\n {\n ?>\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo $field['caption']; ?> must be between <?php echo implode(' and ', $field['length']) ?> characters in length';\n <?php\n }\n ?>\n }\n <?php\n if (!$field['required'])\n {\n echo \"}\\n\";\n }\n if (strlen($field['regex_test']) > 0)\n {\n ?>\n var re = <?php echo $field['regex_test']; ?>;\n if (!data.match(re))\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo $field['regex_fail']; ?>';\n }\n <?php\n }\n if ($field['type'] == WFT_SELECT)\n {\n ?>\n if (data == 'nosel')\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':Please select a value for <?php echo $field['caption']; ?>';\n }\n <?php\n }\n ?>\n wf<?php echo $field['id']; ?>Error = false;\n return '';\n }\n <?php\n }\n\n ?>\n function webFormShowErrorBox(obj)\n {\n var xy = webFormFindPos(obj);\n var error = false;\n var errorMessage = '';\n var errorBox = document.getElementById('webFormErrorBox');\n\n if (document.getElementById(obj.name))\n {\n eval('error = wf' + obj.name + 'Error;');\n }\n\n if (error)\n {\n errorMessage = '<table><tr><td align=\"left\" valign=\"center\"><img src=\"<?php echo $this->_relPath; ?>images/wf_error.gif\" border=\"0\" align=\"left\" style=\"padding-right: 5px;\"/></td><td align=\"left\" valign=\"center\" class=\"wfErrorText\">' + document.getElementById(obj.name + 'Caption').innerHTML + \"</td></tr></table>\";\n errorBox.style.left = '' + (xy[0] + 140) + 'px';\n errorBox.style.top = '' + (xy[1] - 10) + 'px';\n errorBox.style.visibility = 'visible';\n errorBox.innerHTML = errorMessage;\n }\n }\n\n function webFormHideErrorBox()\n {\n var errorBox = document.getElementById('webFormErrorBox');\n if (errorBox)\n errorBox.style.visibility = 'hidden';\n }\n\n function webFormShowHelpBox(obj, title, desc, rules)\n {\n var xy = webFormFindPos(obj);\n var helpBox = document.getElementById('webFormHelpBox');\n var error = false;\n\n if (document.getElementById(obj.name))\n {\n eval('error = wf' + obj.name + 'Error;');\n }\n\n if (helpBox && obj && !error)\n {\n helpBox.style.left = '' + (xy[0] + 140) + 'px';\n helpBox.style.top = '' + (xy[1] - 30) + 'px';\n helpBox.style.visibility = 'visible';\n helpBox.innerHTML = '<b>' + title + '</b><br />' + desc + '<p><b>Rules:</b><br />' + rules;\n }\n }\n\n function webFormHideHelpBox()\n {\n var helpBox = document.getElementById('webFormHelpBox');\n if (helpBox)\n helpBox.style.visibility = 'hidden';\n }\n\n function webFormFindPos(obj)\n {\n \tvar curleft = curtop = 0;\n \tif (obj.offsetParent)\n \t{\n \t\tcurleft = obj.offsetLeft\n \t\tcurtop = obj.offsetTop\n \t\twhile (obj = obj.offsetParent)\n \t\t{\n \t\t\tcurleft += obj.offsetLeft\n \t\t\tcurtop += obj.offsetTop\n \t\t}\n \t}\n \treturn [curleft,curtop];\n }\n <?php\n\n $js = ob_get_contents();\n ob_end_clean();\n return $js;\n }", "function contact_fields() {\n\t\n?>\t<div class=\"contact-address two-fifths first\" >\n\n\t<?php\n\techo do_shortcode('[contact-card]');//}\n\t ?>\n\t\t\n\t\t</div> \n\t\t\n\t\t<div class=\"three-fifths\"> <?php\tif( get_field('contact_page_message') ): \n\t\t\t the_field('contact_page_message'); \n\t\tendif; \n\t\t\t\n\t\t\n\t\techo do_shortcode('[contact]' );?>\n\t\t\n\t\t</div><?php\n\t\n\t\t\n\t\t}", "public function render_form( $post ) {\n\n # get meta data\n $fields = get_post_meta( $post->ID, '_verifyGSC_field', true );\n\n # html input\n ?>\n <div class=\"verifyGSC\">\n <?php\n for($i = 0; $i < 4; $i++){\n ?>\n <div class=\"field\">\n <label for=\"verifyGSC_field_<?=$i+1?>\"> verifyGSC - Original Source <?=$i+1?></label>\n <input type=\"text\" name=\"verifyGSC_field[]\" id=\"verifyGSC_field_<?=$i+1?>\" value=\"<?php if ( is_array($fields) ) echo $fields[$i]; ?>\">\n </div>\n <?php\n }\n ?>\n <input type=\"hidden\" name=\"verifyGSC_nonce\" value=\"<?php echo wp_create_nonce(__FILE__); ?>\" />\n </div>\n <?php\n }", "public function payment_fields() {\n\n\t\tWC()->session->set( 'decred_amount', null );\n\n\t\ttry {\n\n\t\t\t$dcr_amount = $this->get_dcr_amount();\n\n\t\t\t// save amount now to retrieve it later when order created.\n\t\t\tWC()->session->set( 'decred_amount', $dcr_amount );\n\n\t\t\trequire __DIR__ . '/html-checkout.php';\n\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// TODO log $e.\n\t\t\tprintf(\n\t\t\t\t// translators: don't translate error message.\n\t\t\t\tesc_html__( 'There was an error while trying to get the DCR amount: \"%s\".', 'decred' ),\n\t\t\t\t$e->getMessage()\n\t\t\t);\n\t\t}\n\t}", "public function admin_options() {\n\t\t?>\n\t\t<h3><?php _e( 'Simplify Commerce by Mastercard', 'woocommerce' ); ?></h3>\n\n\t\t<?php if ( empty( $this->public_key ) ) : ?>\n\t\t\t<div class=\"simplify-commerce-banner updated\">\n\t\t\t\t<img src=\"<?php echo esc_attr( plugins_url( 'assets/images/logo.png', WC_SIMPLIFY_COMMERCE_FILE ) ); ?>\" />\n\t\t\t\t<p class=\"main\"><strong><?php _e( 'Getting started', 'woocommerce' ); ?></strong></p>\n\t\t\t\t<p><?php _e( 'Simplify Commerce is your merchant account and payment gateway all rolled into one. Choose Simplify Commerce as your WooCommerce payment gateway to get access to your money quickly with a powerful, secure payment engine backed by Mastercard.', 'woocommerce' ); ?></p>\n\n\t\t\t\t<p><a href=\"https://www.simplify.com/commerce/partners/woocommerce#/signup\" target=\"_blank\" class=\"button button-primary\"><?php _e( 'Sign up for Simplify Commerce', 'woocommerce' ); ?></a> <a href=\"https://www.simplify.com/commerce/partners/woocommerce#/\" target=\"_blank\" class=\"button\"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>\n\n\t\t\t</div>\n\t\t<?php else : ?>\n\t\t\t<p><?php _e( 'Simplify Commerce is your merchant account and payment gateway all rolled into one. Choose Simplify Commerce as your WooCommerce payment gateway to get access to your money quickly with a powerful, secure payment engine backed by Mastercard.', 'woocommerce' ); ?></p>\n\t\t<?php endif; ?>\n\n\t\t<?php $this->checks(); ?>\n\n\t\t<table class=\"form-table\">\n\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery( '#woocommerce_simplify_commerce_sandbox' ).on( 'change', function() {\n\t\t\t\t\tvar sandbox = jQuery( '#woocommerce_simplify_commerce_sandbox_public_key, #woocommerce_simplify_commerce_sandbox_private_key' ).closest( 'tr' ),\n\t\t\t\t\t\tproduction = jQuery( '#woocommerce_simplify_commerce_public_key, #woocommerce_simplify_commerce_private_key' ).closest( 'tr' );\n\n\t\t\t\t\tif ( jQuery( this ).is( ':checked' ) ) {\n\t\t\t\t\t\tsandbox.show();\n\t\t\t\t\t\tproduction.hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsandbox.hide();\n\t\t\t\t\t\tproduction.show();\n\t\t\t\t\t}\n\t\t\t\t}).change();\n\n\t\t\t\tjQuery( '#woocommerce_simplify_commerce_mode' ).on( 'change', function() {\n\t\t\t\t\tvar color = jQuery( '#woocommerce_simplify_commerce_modal_color' ).closest( 'tr' );\n\t\t\t\t\tvar supportedCardTypes = jQuery( '#woocommerce_simplify_commerce_supported_card_types' ).closest( 'tr' );\n\n\t\t\t\t\tif ( 'standard' === jQuery( this ).val() ) {\n\t\t\t\t\t\tcolor.hide();\n\t\t\t\t\t\tsupportedCardTypes.show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcolor.show();\n\t\t\t\t\t\tsupportedCardTypes.hide();\n\t\t\t\t\t}\n\t\t\t\t}).change();\n\t\t\t</script>\n\t\t</table>\n\t\t<?php\n\t}", "function wppb_register_your_version_content() {\r\n\r\n ?>\r\n <div class=\"wrap wppb-wrap\">\r\n <?php\r\n if ( PROFILE_BUILDER == 'Profile Builder Pro' ){\r\n wppb_serial_form('pro', 'Profile Builder Pro');\r\n }elseif ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ){\r\n wppb_serial_form('hobbyist', 'Profile Builder Hobbyist');\r\n }\r\n ?>\r\n\r\n </div>\r\n<?php\r\n}", "function css_coupons() {\r\n wp_enqueue_style( 'jquery-datepicker-css', $this->plugin_url . 'datepicker/css/ui-lightness/datepicker.css', false, $this->version);\r\n }", "public function _prePayment( $data )\n{\n\t$jinput = JFactory::getApplication()->input;\n\n\t// Prepare the payment form\n\t$vars->order_id = $data['order_id'];\n\t$vars->orderpayment_id = $data['orderpayment_id'];\n\t$vars->orderpayment_amount = $data['orderpayment_amount'];\n\t$vars->orderpayment_type = $this->_element;\n\n\t$vars->cardholder = $jinput->get(\"cardholder\");\n\t$vars->payment_mode = $jinput->get(\"payment_mode\");\n\n\t// Credit card\n\t$vars->cardnum = $jinput->get(\"cardnum\");\n\t$month = $jinput->get(\"month\");\n\t$year = $jinput->get(\"year\");\n\t$card_exp = $month . ' / ' . $year;\n\t$vars->cardexp = $card_exp;\n\n\t$vars->cardcvv = $jinput->get(\"cardcvv\");\n\t$vars->cardnum_last4 = substr($jinput->get(\"cardnum\"), -4);\n\n\t// Debit card\n\t$vars->accnum = $jinput->get(\"accnum\");\n\t$vars->accnum_last4 = substr($jinput->get(\"accnum\"), -4);\n\t$vars->banknum = $jinput->get(\"banknum\");\n\t$vars->country = $jinput->get(\"country\");\n\n\t// Token\n\t$vars->token12 = $jinput->get(\"token12\");\n\n\t// Lets check the values submitted\n\t$html = $this->_getLayout('prepayment', $vars);\n\n\treturn $html;\n}", "protected function customizeForm($form, $charges)\n {\n }", "function social_login_credit( $provider, $array ) {\n\t\tif ( ! UM()->options()->get( 'mycred_' . $provider ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( UM()->Social_Login_API()->is_connected( get_current_user_id(), $provider ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_enqueue_script( 'um_mycred' );\n\t\twp_enqueue_style( 'um_mycred' );\n\n\t\t$points = UM()->options()->get( 'mycred_' . $provider . '_points' ); ?>\n\n\t\t<div class=\"um-mycred-light\">\n\t\t\t<?php printf( __( 'Add %s points to your balance by connecting to this network.', 'twodayssss' ), $points ); ?>\n\t\t</div>\n\n\t\t<?php\n\t}", "function init_form_fields() {\n \n \t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'label' => __( 'Enable Authorize.Net SIM Payment Module', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'checkbox', \n\t\t\t\t'description' => '', \n\t\t\t\t'default' => 'no'\n\t\t\t), \n\t\t\t'title' => array(\n\t\t\t\t'title' => __( 'Title' ), \n\t\t\t\t'type' => 'text', \n\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => __( 'Authorize.net SIM', WC_Authorize_SIM::TEXT_DOMAIN ),\n\t\t\t\t'css' => \"width: 300px;\"\n\t\t\t), \n\t\t\t'description' => array(\n\t\t\t\t'title' => __( 'Description', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'textarea', \n\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => 'Pay with your credit card via Authorize.net.'\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'checkbox', \n\t\t\t\t'label' => __( 'Enable logging (<code>woocommerce/logs/authorize_sim.txt</code>)', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'testmode' => array(\n\t\t\t\t'title' => __( 'Test mode', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'label' => __( 'Test Mode allows you to submit test transactions to the payment gateway', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'checkbox', \n\t\t\t\t'description' => __( 'You may want to set to true if testing against production', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => 'no'\n\t\t\t), \n\t\t\t'login_id' => array(\n\t\t\t\t'title' => __( 'API Login ID', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'text', \n\t\t\t\t'description' => __( 'This is API Lgoin supplied by Authorize.', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => ''\n\t\t\t), \n\t\t\t'tran_key' => array(\n\t\t\t\t'title' => __( 'Transaction Key', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'text', \n\t\t\t\t'description' => __( 'This is Transaction Key supplied by Authorize.', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'md5_hash' => array(\n\t\t\t\t'title' => __( 'MD5 Hash', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'text', \n\t\t\t\t'description' => __( 'The MD5 hash value to verify transactions', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'type' => array(\n\t\t\t\t'title' => __( 'Sale Method', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'select', \n\t\t\t\t'description' => __( 'Select which sale method to use. Authorize Only will authorize the customers card for the purchase amount only. Authorize &amp; Capture will authorize the customer\\'s card and collect funds.', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'options' => array(\n\t\t\t\t\t'AUTH_CAPTURE'=>'Authorize &amp; Capture',\n\t\t\t\t\t'AUTH_ONLY'=>'Authorize Only'\n\t\t\t\t),\n\t\t\t\t'default' => 'AUTH_CAPTURE'\n\t\t\t),\n\t\t\t'tran_mode' => array(\n\t\t\t\t'title' => __( 'Transaction Mode', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'type' => 'select', \n\t\t\t\t'description' => __( 'Transaction mode used for processing orders', WC_Authorize_SIM::TEXT_DOMAIN ), \n\t\t\t\t'options' => array('live'=>'Live', 'sandbox'=>'Sandbox'),\n\t\t\t\t'default' => 'live'\n\t\t\t),\n\t\t\t\n\t\t);\n }", "public function payment_fields() {\n\t\t$user = wp_get_current_user();\n\t\t$display_tokenization = $this->supports( 'tokenization' ) && is_checkout();\n\t\t$total = WC()->cart->total;\n\n\t\tif ( $user->ID ) {\n\t\t\t$user_email = get_user_meta( $user->ID, 'billing_email', true );\n\t\t\t$user_email = $user_email ? $user_email : $user->user_email;\n\t\t} else {\n\t\t\t$user_email = '';\n\t\t}\n\n\t\techo '<div\n\t\t\tid=\"xendit-payment-data\"\n\t\t\tdata-description=\"\"\n\t\t\tdata-email=\"' . esc_attr( $user_email ) . '\"\n\t\t\tdata-amount=\"' . esc_attr( $this->get_xendit_amount( $total ) ) . '\"\n\t\t\tdata-name=\"' . esc_attr( $this->statement_descriptor ) . '\"\n\t\t\tdata-currency=\"' . esc_attr( strtolower( get_woocommerce_currency() ) ) . '\"\n\t\t\tdata-locale=\"' . esc_attr( 'en' ) . '\"\n\t\t\tdata-image=\"' . esc_attr( $this->xendit_checkout_image ) . '\"\n\t\t\tdata-allow-remember-me=\"' . esc_attr( $this->saved_cards ? 'true' : 'false' ) . '\">';\n\n\t\tif ( $this->description ) {\n\t\t\techo apply_filters( 'wc_xendit_description', wpautop( wp_kses_post( $this->description ) ) );\n\t\t}\n\n\t\tif ( $display_tokenization ) {\n\t\t\t$this->tokenization_script();\n\t\t}\n\n\t\t$this->form();\n\t\techo '</div>';\n\t}" ]
[ "0.7104053", "0.69539416", "0.6941965", "0.66292685", "0.6551258", "0.6393032", "0.62827414", "0.62681174", "0.6202283", "0.6201445", "0.6193256", "0.61111736", "0.6008074", "0.5996392", "0.59563255", "0.59236854", "0.5918118", "0.59148246", "0.5907073", "0.59058887", "0.5904126", "0.58486396", "0.58128625", "0.5811997", "0.5774342", "0.57497275", "0.5737876", "0.57366306", "0.5708297", "0.5699559", "0.5698916", "0.56901693", "0.5687036", "0.56824756", "0.56778556", "0.56582445", "0.56571835", "0.5639844", "0.5634651", "0.56050754", "0.55919236", "0.55789787", "0.5570735", "0.55655897", "0.5557205", "0.5553083", "0.5514079", "0.5511252", "0.5463107", "0.54485226", "0.54196244", "0.5416721", "0.54155743", "0.54094243", "0.5399569", "0.53848296", "0.5383841", "0.53795457", "0.5367478", "0.5346107", "0.5336814", "0.53359133", "0.53340334", "0.53047055", "0.53007084", "0.5290344", "0.5287754", "0.52805966", "0.52798754", "0.5277706", "0.52712244", "0.52633417", "0.52577865", "0.5254689", "0.52491254", "0.52464134", "0.5241603", "0.5237126", "0.52294993", "0.5226939", "0.5225184", "0.52251834", "0.52237", "0.5219415", "0.52176917", "0.5215536", "0.52100664", "0.52054846", "0.52005184", "0.52003616", "0.51946825", "0.51891416", "0.5187946", "0.51803035", "0.5176925", "0.5174609", "0.5173019", "0.5166415", "0.51639825", "0.51567906", "0.5154782" ]
0.0
-1
/ Fields validation, more in Step 5
public function validate_fields() { //... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function validate_fields() {\n\t\treturn true;\n\t}", "public function validation();", "public abstract function validation();", "protected function _validate() {\n\t}", "abstract public function validate();", "abstract public function validate();", "abstract protected function fieldValidation($submittedData);", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "private function validatePaymentFields(){\n }", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\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\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\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\t\n\t\t\t\t\t\tif(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\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\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function validateFields()\n {\n $errors = array();\n for ($x=0; $x < count($this->_fields); $x++)\n {\n $field = $this->_fields[$x];\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n // one or both fields left blank\n if (strlen(trim($this->getPostValue($field['id'] . 'Month'))) == 0 ||\n strlen(trim($this->getPostValue($field['id'] . 'Year'))) == 0)\n {\n if ($field['required'])\n $errors[] = 'You must select an card expiration month and year';\n $monthValue = $yearValue = -1;\n $value = '';\n }\n else\n {\n $monthValue = intval($this->getPostValue($field['id'] . 'Month'));\n $yearValue = intval($this->getPostValue($field['id'] . 'Year'));\n $curYear = intval(date('Y'));\n if ($yearValue < $curYear)\n $errors[] = 'The expiration year is in the past';\n if ($monthValue < 1 || $monthValue > 12)\n $errors[] = 'The expiration month is not valid';\n }\n }\n else if($field['required'] && !strlen(trim($this->getPostValue($field['id']))))\n {\n if (strlen($field['caption']) > 0)\n $errors[] = $field['caption'] . ' is a required field';\n else\n $errors[] = 'This field is required';\n $value = '';\n }\n else if($field['type'] == WFT_CURRENCY)\n {\n $value = trim($this->getPostValue($field['id']));\n $value = str_replace('$', '', $value);\n $cur = floatval($value);\n $value = strval($cur);\n }\n else if($field['type'] == WFT_ANTI_SPAM_IMAGE)\n {\n $antiSpamInput = $this->getPostValue($field['id']);\n $wordVerifyID = $this->getPostValue('wordVerifyID');\n $graphs = new Graphs();\n $wordVerifyText = $graphs->getVerificationImageText($wordVerifyID);\n if (strtoupper($antiSpamInput) != $wordVerifyText || $antiSpamInput == '')\n {\n $errors[] = 'The text you entered did not correspond with the text in the security image';\n $value = 0;\n }\n else\n {\n $value = 1;\n }\n $graphs->clearVerificationImageText($wordVerifyID);\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n $value = $this->getPostValue($field['id']);\n if (!strcmp($value, 'noset'))\n {\n $errors[] = $field['caption'] . ': You must select an option';\n }\n }\n else if($field['type'] == WFT_CC_NUMBER)\n {\n $value = '';\n // Clean credit card number input\n $cardNumber = preg_replace('/[^0-9]/', '', $this->getPostValue($field['id']));\n\n if ($field['required'] == false && !strlen($cardNumber))\n {\n $value = '';\n }\n else\n {\n // Guess the card type by using a pregex pattern matching algorithm\n $cardType = $this->getCreditCardTypeByNumber($cardNumber);\n if ($cardType == -1)\n $errors[] = 'The credit card number you entered is not a recognized Visa, MasterCard, American Express '\n . 'or Discover card.';\n else if (!$this->isCardNumberValid($cardType, $cardNumber))\n $errors[] = 'The credit card number you entered has not been recognized and may be invalid.';\n else\n {\n // Valid card number, now change all card type fields to match\n // the autodetected card type (visa, mastercard, etc.)\n $value = $cardNumber;\n $cardTypeName = $this->getCreditCardName($cardType);\n\n for ($y=0; $y < count($this->_fields); $y++)\n {\n if ($this->_fields[$y]['type'] == WFT_CC_TYPE)\n {\n $this->_fields[$y]['validatedDataOverride'] = $cardTypeName;\n $this->_fields[$y]['validatedData'] = $cardTypeName;\n }\n }\n }\n }\n }\n else\n {\n $value = trim($this->getPostValue($field['id']));\n\n if (!($field['required'] == false && !strlen($value)))\n {\n if (strlen($field['regex_test']) > 0)\n {\n if (!preg_match($field['regex_test'], $value))\n {\n $errors[] = $field['regex_fail'];\n }\n }\n if (strlen($value) < $field['length'][0] || strlen($value) > $field['length'][1])\n {\n if ($field['length'][0] == $field['length'][1])\n {\n if (strlen(trim($field['caption'])) > 0)\n $errors[] = sprintf(\"%s must be %d characters in length\",\n $field['caption'], $field['length'][0]);\n else\n $errors[] = sprintf(\"This field must be %d characters in length\",\n $field['length'][0]);\n }\n else\n $errors[] = sprintf(\"%s must be between %s characters in length\",\n $field['caption'], implode(' and ', $field['length']));\n }\n }\n $value = str_replace(array(\"\\r\",\"\\n\",\"\\t\",\"\\f\"), '', strip_tags($value));\n }\n\n // Set the validated (form returned) data\n switch($field['type'])\n {\n case WFT_CC_EXPIRATION:\n if ($monthValue != -1 && $yearValue != -1)\n $this->_fields[$x]['validatedData'] = sprintf('%d/%d', $monthValue, $yearValue);\n else\n $this->_fields[$x]['validatedData'] = '';\n break;\n default:\n if (isset($this->_fields[$x]['validatedDataOverride']) && strlen($this->_fields[$x]['validatedDataOverride']))\n $this->_fields[$x]['validatedData'] = $this->_fields[$x]['validatedDataOverride'];\n else\n $this->_fields[$x]['validatedData'] = $value;\n break;\n }\n }\n return $errors;\n }", "function check_fields() {\r\n \r\n $fail = false;\r\n\t\t$empty = true;\r\n\t\t\r\n // if first name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputFirstName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputFirstName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['firstNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n // if last name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputLastName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputLastName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['lastNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n \r\n // if phone number contains any non-digit or - characters, exit\r\n\t\tif($_POST[\"InputPhone\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputPhone\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[0-9-]*$/\")))) {\r\n\t\t\t\t$GLOBALS['phoneNumberNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n if(!$fail && !$empty) {\r\n change_info();\r\n }\r\n }", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "protected function prepareValidations() {}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public static function validate() {}", "protected function setupValidation()\n {\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function validate()\n\t{\n\t}", "protected function validate()\n {\n }", "public function validated();", "protected function localValidation()\n\t\t{\n\t\t}", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function validateFields($fieldRules)\n {\n global $errorFeedback;\n $errors = [];\n foreach($fieldRules as $field => $rules){\n $fieldErrors = [];\n $value = $_REQUEST[$field];\n\n $d = new Disinfect();\n $d->disinfect($value);\n\n foreach($rules as $rule){\n\n if($rule == 'required'){\n if(! isset($value) || trim($value) == '' ){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'its required'\n }\n }\n\n if($rule == 'number'){\n if($value != '' && ! preg_match('/^(\\d+)$/', $value)){\n $fieldErrors[] = $errorFeedback[$rule]; // 'its a number'\n }\n }\n\n if($rule == 'freeNickname'){\n $u = new UserModel();\n $nickexist = $u->getUsersByNickname($value);\n if (!$nickexist == false) {\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'nickname not free'\n }\n }\n\n if($rule == 'max15chars'){\n if($value != '' && strlen($value) > 15){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 15'\n }\n }\n\n if($rule == 'max35chars'){\n if($value != '' && strlen($value) > 35){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 35'\n }\n }\n\n if($rule == 'min5chars'){\n if($value != '' && strlen($value) < 5){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'min chars 5'\n }\n }\n\n if($rule == 'password'){ // not in use jet!\n\n if($value != '' && ! preg_match('/^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8,}$/', $value)){\n $fieldErrors[] = $this->errorFeedback[$rule];\n //'its a password with = 8 characters length oe more, 2 letters in Upper Case, 1 Special Character, 2 numerals, 3 letters in Lower Case'\n // TODO use the Password validation if you want you passwords really save (and annoy the users)\n }\n }\n }\n // Are there some errors?\n if(count($fieldErrors) != 0){\n $errors[$field] = $fieldErrors;\n }\n }\n return $errors;\n }", "function validateBizEditFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "abstract public function validateData();", "protected function preValidate() {}", "function form1()\r\n {\r\n global $f3;\r\n $isValid= true;\r\n if (!validString($f3->get('animal'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['animal']\", \"Please enter an animal \");\r\n }\r\n if (!validQty($f3->get('qty'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['qty']\", \"Please enter quantity\");\r\n }\r\n return $isValid;\r\n }", "function formErrorCheck( $fields ) {\n\t\n\t$array = get_option( 'resume_input_fields' );\n\n\tforeach ( $array as $item => $key) {\n\t\t\n\t\tswitch($item){\n\t\t\tcase 'fname':\n\t\t\t\t\t\tif ( !$fields['fname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'lname':\n\t\t\t\t\t\tif ( !$fields['lname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address':\n\t\t\t\t\t\tif ( !$fields['address'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address2':\n\t\t\t\t\t\tif ( !$fields['address2'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'city':\n\t\t\t\t\t\tif ( !$fields['city'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'state':\n\t\t\t\t\t\tif ( !$fields['state'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'zip':\n\t\t\t\t\t\tif ( !$fields['zip'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'pnumber':\n\t\t\t\t\t\tif ( ( !$fields['pnumber'] || !$fields['pnumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'snumber':\n\t\t\t\t\t\tif ( ( !$fields['snumber'] || !$fields['snumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t\t\tif ( !$fields['email'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'attachment':\n\t\t\t\t\t\tif ( !$fields['attachment'][0]['name'][0] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'cover':\n\t\t\t\t\t\tif ( !$fields['cover'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'resume':\n\t\t\t\t\t\tif ( !$fields['resume'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\t\n\treturn $error;\t\n}", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function validations() {\n $this->form_validation->set_rules('name', 'Name', 'trim|required|alpha');\n $this->form_validation->set_rules('age', 'Age', 'trim|required|is_natural_no_zero|max_length[2]');\n $this->form_validation->set_rules('dob', 'Date Of Birth', 'trim|required');\n $this->form_validation->set_rules('profession', 'Select Profession', 'trim|required');\n $this->form_validation->set_rules('locality', 'Locality', 'trim|required|alpha');\n $this->form_validation->set_rules('guests', 'No. of Guests', 'trim|required');\n $this->form_validation->set_rules('address', 'Address', 'trim|required');\n }", "function check_content(){\r\n if(!(strlen($_POST['first_name']) > 0 && strlen($_POST['last_name']) > 0 && strlen($_POST['email']) > 0 && strlen($_POST['headline']) > 0 && strlen($_POST['summary']) > 0)){\r\n\treturn 'All fields are required';\r\n }\r\n for($i = 1; $i<10 ; $i++ ){\r\n\tif(isset($_POST['year'.$i])){\r\n\t error_log('$_POST[year'.$i.']: '.$_POST['year'.$i]);\r\n\t if(strlen($_POST['year'.$i]) == 0){\r\n\t\treturn 'All fields are required';\r\n\t }\r\n\t if(!is_numeric($_POST['year'.$i])){\r\n\t\treturn 'Year must be a number';\r\n\t }\r\n\t}\r\n\tif(isset($_POST['desc'.$i]) && strlen($_POST['desc'.$i]) == 0){\r\n\t error_log('$_POST[desc'.$i.']: '.$_POST['desc'.$i]);\r\n\t return 'All fields are required';\r\n\t}\r\n\tif(isset($_POST['edu_year'.$i])){\r\n\t error_log('$_POST[edu_year'.$i.']: '.$_POST['edu_year'.$i]);\r\n\t if(strlen($_POST['edu_year'.$i]) == 0){\r\n\t\treturn 'All fields are required';\r\n\t }\r\n\t if(!is_numeric($_POST['edu_year'.$i])){\r\n\t\treturn 'Year must be a number';\r\n\t }\r\n\t}\r\n\tif(isset($_POST['edu_school'.$i]) && strlen($_POST['edu_school'.$i]) == 0){\r\n\t error_log('$_POST[edu_school'.$i.']: '.$_POST['edu_school'.$i]);\r\n\t return 'All fields are required';\r\n\t}\r\n }\r\n if(strpos($_POST['email'], '@') === false){\r\n\treturn 'Email address must contain @';\r\n }\r\n return true;\r\n}", "function validateData($fields, $vars) \n{ \n\t// array for storing error messages \n\tglobal $err_mess; \t\t\t\t\t\t// error message, make accessible outside function \n\t$err_msg = \"\"; \t\t\t\t\t\t\t// blank to begin with \n\t$fields_ok = true;\t\t\t\t\t\t// success/failure indicator - assume success \n\n\t// for each field name in validation information validate data \n\t// data according to rules for field \n\t// $fields[x] - attribute name \n\t// $fields[x+1] - validation code \n\t// $fields[x+2] - human name for error message \n\t// validation codes - correspond to array entry in function validateData \n\t// 1 - field required - primary key, \"new\" (new record) or numeric (existing record) \n\t// 2 - field required - foreign key, must be numeric, must be > 0 \n\t// 3 - field required - phone number, must be 10 digits long \n\t// 4 - field required - email address \n\t//\t 5 - field required - no validation required \n\t// code + 100 - field not required but same validation as code if field required \n\t\n\t// want to consider validation for all fields in record \n\tfor ($i=0; $i<count($fields); $i=$i+3) \n\t{\n\t\t// extract data value from $vars that corresponds \n\t\t// to field name in validation data \n\t\t$field_name = $fields[$i]; \t\t\t// field name \n\t\t$field_data = $vars[$field_name]; \t// data value from form \n\t\t$field_code = $fields[$i+1];\t\t// validation code \n\t\t$field_err = $fields[$i+2];\t\t\t// field name for error message \n\t\t\n\t\t// determine if validating primary key \n\t\tif ($field_code==1) { \n\t\t\t// primary key, required field, must be \"new\" or numeric \n\t\t\tif (strlen($field_data)==0) { \n\t\t\t\t// required field not entered \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// not blank so \n\t\t\t\t// check for \"new\" (new record) or numeric (update existing record) \n\t\t\t\tif ($field_data != \"new\") { \n\t\t\t\t\tif (is_numeric($field_data) == false) { \n\t\t\t\t\t\t// invalid primary key \n\t\t\t\t\t\t$err_mess .=$field_err .\" - invalid primary key \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\n\t\t// determine if validating foreign key \n\t\tif ($field_code==2 or $field_code==102) {\n\t\t\t// validation may be required on number \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==2 and is_numeric($field_data)==false) { \n\t\t\t\t// required foreign key and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not blank, must be number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// ensure value is > 0 \n\t\t\t\t\tif ($field_data <= 0) { \n\t\t\t\t\t\t// invalid foreign key \n\t\t\t\t\t\t$err_mess .=$field_err .\"-select \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine if validating phone number \n\t\tif ($field_code==3 or $field_code==103) { \n\t\t\t// validation may be required on phone number \n\t\t\tif ($field_code==3 and $field_data==\"\") { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\t// validate if not required field & data entered \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not a number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// check for correct length (must be 10 digits) \n\t\t\t\t\tif ($field_data!=\"\" and strlen($field_data)!=10) {\n\t\t\t\t\t\t// phone number length not 10 \n\t\t\t\t\t\t$err_mess .=$field_err .\"-must be 10 digits \"; \n\t\t\t\t\t\t$fields_ok = false; // indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\t\n\t\t// determine if validating email address \n\t\tif ($field_code==4 or $field_code==104) { \n\t\t\t// validation may be required on email address \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==4 and (!isEmail($field_data))) { \n\t\t\t\t// required field and invalid email address \n\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\") { \n\t\t\t\t\t// validate email address \n\t\t\t\t\tif (!isEmail($field_data)) { \n\t\t\t\t\t\t// invalid email address \n\t\t\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t// determine if no validation required (but could be required field) \n\t\tif ($field_code==5 or $field_code==105) { \n\t\t\t// considering field with no validation requirements \n\t\t\tif ($field_code==5 and strlen($field_data)==0) { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t}\n\t\t} \n\t} \n\n\t// all fields validated, return success/failure indicator \n\treturn $fields_ok; \t\n}", "public function validation()\n {\n\n }", "abstract public function runValidation();", "function validate_fields($part){\r\n\tif($part == 1){\r\n\t\t$error_msg = array();\r\n\t\t// check that name is not empty or larger than database can hold\r\n\t\tif (!isset($_POST['fullName'])){\r\n\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t} else if (isset($_POST['fullName'])){\r\n\t\t\t$name = trim($_POST['fullName']);\r\n\t\t\tif (empty($name)){\r\n\t\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t\t} else {\r\n\t\t\t\tif (strlen($name) > 128){\r\n\t\t\t\t\t$error_msg[] = \"First Name field cannot contain more than 128 characters.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that age is set and numeric \r\n\t\tif (!isset($_POST['age'])){\r\n\t\t\t$error_msg[] = \"Age field is blank.\";\r\n\t\t} else if (isset($_POST['age'])){\r\n\t\t\tif (!is_numeric($_POST['age'])) {\r\n\t\t\t\t$error_msg[] = \"Age: Please enter numbers only\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that dropdown option has been chosen \r\n\t\tif (!isset($_POST['student'])){\r\n\t\t\t$error_msg[] = \"Are you a student? Please choose one.\";\r\n\t\t} else if (isset($_POST['student'])){\r\n\t\t\t$age = $_POST['student'];\r\n\t\t\tif(!($age == \"F\" || $age == \"P\" || $age == \"N\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 2){\r\n\t\t$error_msg = array();\r\n\t\t// check that purchase method is chosen \r\n\t\tif (!isset($_POST['howPurchased'])){\r\n\t\t\t$error_msg[] = \"Please select method of purchase.\";\r\n\t\t} else if (isset($_POST['howPurchased'])){\r\n\t\t\t$purchased = $_POST['howPurchased']; \r\n\t\t\tif(!($purchased == \"Online\" || $purchased == \"By Phone\" || $purchased == \"Mobile App\" || $purchased == \"In Store\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate value for method of purchase. Please select one. \".$purchased;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// check that one or more products has been chosen\r\n\t\tif (!isset($_POST['purchases'])){\r\n\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t} else if (isset($_POST['purchases'])){\r\n\t\t\t$purchases = $_POST['purchases'];\r\n\t\t\tif(count($purchases) < 1){\r\n\t\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 3){\r\n\t\t$error_msg = array();\r\n\t\tfor($x = 0; $x < count($_SESSION['purchases']); $x++){\r\n\t\t\t// check that satisfaction is chosen \r\n\t\t\tif (!isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please select level of satisfaction\";\r\n\t\t\t} else if (isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$sat = $_POST['satisfaction'.$x];\r\n\t\t\t\tif(!is_numeric($sat) || $sat < 1 || $sat > 5){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate value for satisfaction.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// check that recommendation has been chosen\r\n\t\t\tif (!isset($_POST['recommend'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please choose recommendation option.\";\r\n\t\t\t} else if (isset($_POST['recommend'.$x])){\r\n\t\t\t\t$rec = $_POST['recommend'.$x];\r\n\t\t\t\tif(!($rec == \"Yes\" || $rec == \"Maybe\" || $rec == \"No\")){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n}", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function validate_user_form()\n {\n }", "function validateInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\tif(!matchRegex($nric,'/^[a-zA-Z0-9]*$/')) { return false; }\n\tif(!matchRegex($firstName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($lastName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($dob,'/^[0-9-]*$/')) { return false; }\n\tif(!matchRegex($address1,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($address2,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($poCode,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($homeNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($handphoneNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($email,'/^[a-zA-Z0-9@._-]*$/')) { return false; }\n\tif(!matchRegex($description,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\t\n\treturn true;\n}", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "protected function mainValidation()\n {\n $this->validator->add(\n 'title',\n new StringLength([\n 'max' => 50\n ])\n );\n\n $this->validator->add(\n 'description',\n new StringLength([\n 'max' => 200,\n 'allowEmpty' => true\n ])\n );\n }", "public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "public function validate() {\n\t\t$this->form_validation->set_rules('rfid', 'FRID', 'required');\t\t\n\t\t$this->form_validation->set_rules('person', \"Person\", 'required');\n\t\t$this->form_validation->set_rules('asset_id', \"Assets\", 'required'); \t\n\t\t$this->form_validation->set_rules('inform_mobile', \"Mobile No.\"); \t\n\t\t$this->form_validation->set_rules('inform_email', \"Email Id\"); \t\n\t\t$this->form_validation->set_rules('send_sms', \"Sms Alert\"); \t\n\t\t$this->form_validation->set_rules('send_email', \"Email Alert\"); \t\n\t\t$this->form_validation->set_rules('comments', \"Comments\"); \t\n\t\t$this->form_validation->set_rules('landmark_id', \"Landmark\"); \t\n\t\treturn parent::validate();\n\t}", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function validate()\n {\n }", "public function validate()\n {\n }", "static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }", "protected function areFieldChangeFunctionsValid() {}", "function validate() {\n//print \"Calling validate()\";\n\t\t// clear flags\n\t\t$this->fail_validate = 0;\n\t\t$this->fail_require = 0;\n\t\t\n\t\t$msgengine = new ooFormMessages;\n\t\t \n\t// for each of the fields by name, examine values\n\t// of params that exist for that name, if any\n\t\n\t// IMPORTANT change, what we really need to do now that we have a data structure representing the vlaues of form fields, is when a form is submitted, update the field values with the values from the CGI parameters.\n/*\n\nDEFAULTS --> form fields --> CGI PARAMS --> FIELD VALUES --> so that at this point, after submission, the params and field values are in sync, so that if you say $form->field() to the value, it is the same as the param just submitted.\n\nThis may be why FB uses two passes, one to redistribute the parameter values over the corresponding form fields. CGI PARAM -> FIELD VALUE\n\nThen it uses the field values to check against the regular expressions. I think I am still checking against the param and not updating the fields.\n\nWhere do I set the field value to the cgi value?\n\n*/\n\t\n\t// debug\n\t//print \"Fields to validate: \";\n\t//print_r( $this->fields_list );\n\t\n\t foreach ( $this->fields_list as $field_name ) {\n\t\t\n\t \t// debug\n\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t//print '<pre style=\"border: 1px solid #ccc; background: #eee\">';\n\t\t//print \"Processing Field\\n\";\n\t\t//print \"Field: \" . $field_name .\"<BR>\";\n\t\t//print \"Value: \" . $this->value($field_name) .\"<BR><br>\";\n\t\t//print \"Fields<br>\";\n\t\t//print_r( $this->fields );\n \t\t//print \"</pre>\";\n\t\t//}\n\t\t\n\t\t/* My first way of thinking is to validate the values of CGI parameters. I'm thinking of a firewall, that I want to get the values first and check them. But ooForm is the firewall. So it would not make any difference if all parameters were redistributed to field values now that we keep a data structure of field properties, one of which is the value.\n\t\tThe regexes could be run against the field values instead of the cgi parameter values.\n\t\t*/\n\t\t\n\t\t// get the generic dynamic value for this field\n\t\t// which is either the default stored in props or from cgi\n\t\t//$val = $this->value($fieldname);\n\t\t// look down to validate section for where this really gets used\n\t\t\n\t\t//if( $val == '' ) {\n\t\t// Note, required validation fails unless you check against cgi params, can't use value function becuase it may be sticky or default value, for required, we must check params to see what is being submitted and what is not, because value may be giving us the default value or the cgi value depending on sticky status.\n\n/**\n * If this field is empty, test for required status,\n * otheriwse check for validity.\n *\n * FIXME: I think this should use empty()\n */\n\n\t\tif( $this->params_list[$field_name] == '' ) {\n//\t\tif( empty( $this->params_list[$field_name] ) ) {\n\t\t\n\t\t\t\t//if( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t//print \"Param: \" . $field_name .\" is empty<BR>\";\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t// we know the field is empty, check if required\n\t\t\tif(\tin_array($field_name, $this->required_list) ) {\n\t\t\t\n\t\t\t\n\t\t\t\t// set flag\n\t\t\t\t$this->fail_require = 1;\n\t\t\t\n\t\t\t\t// if empty and on required list, field is invalid\n\t\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t\n\t\t\t\t// IMPORTANT: if the intention is to render the form again with fields filled in for correction and error messages beside the fields, then we must store the required errors, not just stop at the first one.\n\t\t\t\t// to prepare for that I will try setting the invalid flag in the stored fields array for this field\n\n\t\t\t\t$this->fields[$field_name][required] = 1;\n\t\t\t\n\t\t\t\t// set the error message for this field\n\t\t\t\n\t\t\t\t// move to messages config\n\t\t\t\t//$temp = \"<span>Please enter a value for the '$field_name' field.</span>\";\n\t\t\t\t//$this->fields[$field_name][error] = $temp\n\n\t\t\t\t//print \"Setting Error Message:\";\n\t\t\t\t//print $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\t\n\t\t\t\t$this->fields[$field_name][error] = $msgengine->message('field_required', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t// moreover, I suppose you don't need to use this as a flag, you don't need to store failed required status, if you know the field is required, then after validation, you can then check that each required field has a value and compute the intersection with falied validate fields. No flag needs to be set, so what am I doing here?\n\n\t\t\t\t// debug\n\t\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\t\t\tprint \"Parameter \" . $field_name .\" failed required.<BR>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\n\t\t/*\n\t\t * Validate Fields\n\t\t *\n\t\t */\n\t\t \n\t\t // Note: if a field is empty, we don't check it for validity, we only check non-empty fields for validity, we check empty fields to see if they are required, once that check is done, we don't have to check if valid.\n\t\t\n\t\t/* LOOK HERE! This is where we get the value to validate from the PAREMETER LIST instead of from the field value. This is legacy practice. It should get it from the field value and field values all \"redistributed\" prior to validation.\n\n\t\tStill does not answer where the value is being set.\n\t\t*/\n\t\t\n\t\t// now we get value at top before conditional\n\t\t//$val = $this->params_list[$field_name];\n\t\t\n\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\tprint \"Validating \" . $field_name .\"<BR>\";\n\t\tprint \"With Value: \" . $this->value($field_name) .\"<BR>\";\n\t\t}\n\t\t\n\t\t// get regex\n\t\tif( array_key_exists($this->validate_list[$field_name], $this->rules_list) \n\t\t\t&& preg_match('/_[a-zA-Z]+$/', $this->validate_list[$field_name])\n\t\t\t) {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using rule\";\n\t\t\t}\n\t\t $regex = $this->rules_list[$this->validate_list[$field_name]];\n\t\t } else {\n\t\t\tif( $this->debug == DEBUG_VERBOSE ) {\n\t\t\tprint \"Using user defined rule\";\n\t\t\t}\n\t\t $regex = $this->validate_list[$field_name];\n\t\t }\n\t\t\tif( $regex != '' && (! preg_match( $regex, $this->value($field_name))) )\n\t\t\t{\n\t\t\t// error validation\n\t\t\t$this->fail_validate = 1;\n\t\t\t\t\t\t\n\t\t\t// experimental code to set invalid flag for this field\n\t\t\t$this->fields[$field_name][invalid] = 1;\n\t\t\t// and error message\n\t\t\t//$this->fields[$field_name][error] = $this->messages_list[$field_name];\n// set through class\n\n/**\n * Validate message trumps required message.\n */\n \n// TEMP DISABLED\n$this->fields[$field_name][error] = $msgengine->message('field_invalid', $this->fields[$field_name][label]);\n\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t} // end foreach\n\t\n\t// debug\t\n\t//print \"Fail Validate: \". $this->fail_validate .\"<br>\";;\n\t//print \"Fail Require: \". $this->fail_require .\"<BR><br>\";;\n\t\t\n\t\t\n\tif( $this->fail_validate\n\t|| $this->fail_require ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\t\n\t\n}", "function validate_blog_form()\n {\n }", "function validateAll(){\n foreach($this->fields as $field){\n $val = $_POST[$field['id']];\n if($field['validate']){\n switch($field['type']){\n case \"email\":\n if(!filter_var($val, FILTER_VALIDATE_EMAIL)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n break;\n case \"number\":\n if(!is_numeric($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n if($this->fields[$field['id']]['min'] > $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n if($this->fields[$field['id']]['max'] < $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"password\":\n if($this->fields[$field['id']]['compare']){\n $compareWith = $this->fields[$field['id']]['compare'];\n if($val != $_POST[$compareWith]){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }else if(!$this->validatePassword($val) || !$this->validatePassword($_POST[$compareWith])){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }else{\n if(!$this->validatePassword($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n break;\n case \"date\":\n if(!$this->validateDate($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n $min = $this->fields[$field['id']]['min'];\n if($this->compareDates($min, $val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n $max = $this->fields[$field['id']]['max'];\n if($this->compareDates($val, $max)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"radio\":\n if(!$val){\n $this->fields[$field['id']]['error'] .= \" error\";\n }\n break;\n default:\n if(!$val){\n $this->fields[$field['id']]['class'] .= \" error\";\n }\n }\n }\n }\n return ($this->has_errors ? false : true);\n }", "public function validate() {\n }", "public function validate() {\n }", "public function validate() {\r\n $validator = new \\GUMP('fr');\r\n $validator->validation_rules(array(\r\n \"first_name\" => \"required||alpha\",\r\n \"last_name\" => \"required||alpha\",\r\n \"zip\" => \"integer||max_len,5|min_len,5\",\r\n \"phone1\" => 'regex,/^(?:(?:\\+\\d\\d?)[-\\s]?(?:\\(\\d\\)[-\\s]?\\d|\\d)(?:[-\\s]?\\d){8})|(?:[-\\s]?\\d){10}$/',\r\n \"user_email\" => \"required||valid_email\",\r\n \"cellphone\" => 'regex,/^(?:(?:\\+\\d\\d?)[-\\s]?(?:\\(\\d\\)[-\\s]?\\d|\\d)(?:[-\\s]?\\d){8})|(?:[-\\s]?\\d){10}$/',\r\n \"birth_date\" => \"date,d/m/Y\",\r\n \"vma\" => \"float\",\r\n \"sex\" => \"contains_list,F;M\",\r\n \"sport\" => \"contains_list,Course;Marche\"\r\n ));\r\n $validator->filter_rules(array(\r\n \"first_name\" => \"trim\",\r\n \"last_name\" => \"upper_case||trim\",\r\n \"addr1\" => \"trim\",\r\n \"addr2\" => \"trim\",\r\n \"city\" => \"trim\",\r\n \"zip\" => \"trim\",\r\n \"phone1\" => \"trim\",\r\n \"user_email\" => \"trim\",\r\n \"cellphone\" => \"trim\",\r\n \"birth_date\" => \"trim\",\r\n \"license_number\" => \"trim\",\r\n \"vma\" => \"trim\",\r\n \"sex\" => \"trim\",\r\n \"sport\" => \"trim\"\r\n ));\r\n $this->fields=$validator->sanitize($_POST, array(\r\n 'user_login',\r\n 'last_name',\r\n 'first_name',\r\n 'addr1',\r\n 'addr2',\r\n 'city',\r\n 'zip',\r\n 'phone1',\r\n 'user_email',\r\n 'cellphone',\r\n 'birth_date',\r\n 'license_number',\r\n 'vma',\r\n 'sex',\r\n 'allow_publishphoto',\r\n 'sport'\r\n ));\r\n // Use a modified version of Validator allowing an extra 'rules delimiter' parameter\r\n // This parameter prevents validation errors when for example a validation expression contains a '|'\r\n $data = $validator->run($this->fields, false, '||');\r\n if (false===$data) {\r\n $this->errors = $validator->get_errors_array();\r\n return false;\r\n }\r\n else {\r\n $this->fields = $data;\r\n }\r\n return true;\r\n }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "function checkFields( $args )\r\n {\r\n\t\treturn true;\r\n }", "abstract function validator();", "function validate_field($field)\n {\n }", "function reserv_validate(&$fields, &$errors) {\n // If not, make one\n if (!is_wp_error($errors)) $errors = new WP_Error;\n\n // Validate form data\n\n if (empty($fields['title'])){\n $errors->add('field', 'Required form field is missing');\n }\n if (strlen($fields['title']) < 4) {\n $errors->add('title_length', 'Username too short. At least 4 characters is required');\n }\n\n // If errors were produced, fail\n if (count($errors->get_error_messages()) > 0) {\n return false;\n }\n\n // Else, success!\n return true;\n}", "function validarFormulario()\n\t\t{\n\t\t}", "protected function performValidation()\n {\n // no required arguments\n }", "abstract public function valid();", "public function validateFields()\n {\n $invalidFields = [];\n if (empty($_POST[\"activity\"])) {\n array_push($invalidFields, \"activity\");\n }\n if (empty($_POST[\"country\"])) {\n array_push($invalidFields, \"country\");\n }\n if (empty($_POST[\"done\"]) && empty($_POST[\"not done\"])) {\n array_push($invalidFields, \"done\");\n }\n return $invalidFields;\n }", "abstract public function validate(array $data, array $fields);", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function getInputErrors();", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function check_validity() {\r\n\t\t$value = $this->get_posted_value();\r\n\r\n\t\t// required field check\r\n\t\t// 0, '0', and 0.0 need special handling since they're valid, but PHP considers them falsy values.\r\n\t\tif ( $this->props['required'] && ( empty( $value ) && ! in_array( $value, [ 0, '0', 0.0 ], true ) ) ) {\r\n\t\t\t// translators: Placeholder %s is the label for the required field.\r\n\t\t\tthrow new \\Exception( sprintf( _x( '%s is a required field.', 'Add listing form', 'my-listing' ), $this->props['label'] ) );\r\n\t\t}\r\n\r\n\t\t// if field isn't required, then no validation is needed for empty values\r\n\t\tif ( empty( $value ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, run validations\r\n\t\t$this->validate();\r\n\t}", "public function validateField()\n\t{\n\t\t$error = [];\n\t\t$error_flag = false;\n\n\t\tif ($this->commons->validateText($this->url->post('contact')['company'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['author'] = 'Item Rate!';\n\t\t}\n\n\t\tif ($error_flag) {\n\t\t\treturn $error;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function check() {\n $field = null;\n $this->_errors = [];\n $fields = $this->_getField();\n\n foreach ($this->_constraints as $constraints) {\n foreach ($fields as $value) {\n switch ($constraints['type']) {\n case self::EQUAL:\n if ($value != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::DIFFERENT:\n if ($value == $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MORETHAN:\n if ($value <= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LESSTHAN:\n if ($value >= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::BETWEEN:\n if ($value < $constraints['value'][0] || $value > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IN:\n if (!in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTIN:\n if (in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTH:\n if (strlen($value) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMIN:\n if (strlen($value) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMAX:\n if (strlen($value) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHIN:\n if (!in_array(strlen($value), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHBETWEEN:\n if (strlen($value) < $constraints['value'][0] || strlen($value) > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::REGEX:\n if (!preg_match($constraints['value'], $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::URL:\n if (!filter_var($value, FILTER_VALIDATE_URL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::INT:\n if (!filter_var($value, FILTER_VALIDATE_INT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::FLOAT:\n if (!filter_var($value, FILTER_VALIDATE_FLOAT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHA:\n if (!preg_match('#^([a-zA-Z]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHANUM:\n if (!preg_match('#^([a-zA-Z0-9]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHADASH:\n if (!preg_match('#^([a-zA-Z0-9_-]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IP:\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::SQL:\n /** @var $value \\Gcs\\Framework\\Core\\Orm\\Entity\\Entity */\n\n $sql = new Sql();\n $sql->query('query-form-validation', $constraints['value']['query']);\n $sql->vars('value', $value);\n\n if (count($constraints['value']['vars']) > 0) {\n $sql->vars($constraints['value']['vars']);\n }\n\n $data = $sql->fetch('query-form-validation', Sql::PARAM_FETCHCOLUMN);\n\n $querySuccess = true;\n\n switch ($constraints['value']['constraint']) {\n case '==':\n if ($data != $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '!=':\n if ($data == $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '>':\n if ($data <= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '<':\n if ($data >= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n }\n\n if (!$querySuccess) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::CUSTOM:\n /** @var object[] $constraints */\n if ($constraints['value']->filter() == false) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);\n }\n break;\n }\n }\n\n switch ($constraints['type']) {\n case self::COUNT:\n if (count($fields) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMIN:\n if (count($fields) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMAX:\n if (count($fields) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTIN:\n /** @var array $constraints */\n if (!in_array(count($fields), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::EXIST:\n if (count($fields) == 1 && $fields[0] == null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTEXIST:\n if (count($fields) == 1 && $fields[0] != null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n }\n }\n }", "public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "function validateFields($fields){\n\t\t$valid = [\n\t\t\t'isValid' => true,\n\t\t\t'invalidField' => ''\n\t\t];\n\t\t\n\t\tif(!isset($fields['articleName']) || empty($fields['articleName'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleName';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleAuthor']) || empty($fields['articleAuthor'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleAuthor';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleDate']) || empty($fields['articleDate'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleDate';\n\t\t}\n\t\t\n\t\tif(!isset($fields['articleCategory']) || empty($fields['articleCategory'])){\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleCategory';\n\t\t}\n\t\tif(!isset($fields['articleContent']) || empty($fields['articleContent'])){\n\t\t\n\t\t\t$valid['isValid'] = false;\n\t\t\t$valid['invalidField'] = 'articleContent';\n\t\t}\n\t\t\n\t\treturn $valid;\n\t}", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }" ]
[ "0.84424067", "0.778876", "0.75082946", "0.74390954", "0.73955894", "0.7171267", "0.7171267", "0.7154056", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.7139206", "0.71238744", "0.7110577", "0.7109706", "0.7079214", "0.70328337", "0.7028358", "0.7025195", "0.70162576", "0.70108294", "0.69918317", "0.6973808", "0.6967495", "0.69415396", "0.6909291", "0.6899395", "0.6877074", "0.68738705", "0.6849545", "0.6820738", "0.67637765", "0.675105", "0.6741247", "0.6734515", "0.67256504", "0.6721172", "0.6718951", "0.67124397", "0.6708863", "0.67026734", "0.66798085", "0.6657716", "0.66570073", "0.6638555", "0.6638043", "0.66316766", "0.663149", "0.6630586", "0.66250956", "0.66183597", "0.66031104", "0.65792036", "0.65687823", "0.65687823", "0.65613526", "0.655388", "0.65427417", "0.65420896", "0.6537259", "0.6536301", "0.6536301", "0.65332645", "0.6523549", "0.6521895", "0.6508556", "0.65057766", "0.6502006", "0.64943194", "0.6494125", "0.64890337", "0.64846015", "0.6482719", "0.6479168", "0.6478915", "0.64749956", "0.64713776", "0.64713776", "0.64713776", "0.64713776", "0.64713776", "0.64713776", "0.64713776", "0.64713776", "0.6465133", "0.6464784", "0.64498407", "0.6445862", "0.6444413", "0.6444293", "0.64418095", "0.6429537" ]
0.8348128
1
Save the chosen payment type as order meta data.
public function save_order_payment_type_meta_data( $order, $data ) { if ( $data['payment_method'] === $this->id && isset($_POST['payment_duration']) ) $order->update_meta_data('_payment_duration', esc_attr($_POST['payment_duration']) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function save_paypal_meta_data( $order, $posted ) {\n }", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "protected function save_order_meta_fields( $order, $request ) {\n\t\tparent::save_order_meta_fields( $order, $request );\n\n\t\tupdate_post_meta( $order->get_id(), '_cards_brand_name', $request->payment->payment_type_code );\n\t\tupdate_post_meta( $order->get_id(), '_masked_card_number', WC_EBANX_Request::read( 'ebanx_masked_card_number' ) );\n\t}", "protected function save_meta() {}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tupdate_post_meta( $order->get_id(), '_ebanx_tef_bank', sanitize_text_field( WC_EBANX_Request::read( 'tef' ) ) );\n\n\t\tparent::save_order_meta_fields( $order, $request );\n\t}", "function pp_rcp_store_payment_meta( $payment, $payment_data ) {\n\n\t// store meta\n\tif ( EDD()->session->get( 'came_from_rcp' ) ) {\n\t\tupdate_post_meta( $payment, '_edd_payment_from_rcp', true );\n\t}\n\n}", "private function _ratepayEvent($type, $order)\n {\n switch($type){\n case 'invoice':\n $invoice = $order->prepareInvoice();\n $invoice->register()->save();\n $order->setTotalInvoiced($order->getTotalInvoiced() + $invoice->getGrandTotal());\n $order->setBaseTotalInvoiced($order->getBaseTotalInvoiced() + $invoice->getBaseGrandTotal());\n $order->save();\n break;\n case 'creditmemo':\n $creditmemo = Mage::getModel('sales/service_order', $order)->prepareCreditmemo();\n $creditmemo->register()->save();\n $order->setTotalRefunded($order->getTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($order->getBaseTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($creditmemo->getGrandTotal());\n $order->save();\n break;\n case 'cancel':\n $order->cancel()->save();\n break;\n default:\n throw new Exception('Wrong operation!');\n }\n }", "public function saving(Order $Order)\n {\n //code...\n }", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_TOTAL_KEY, $this->total_reports );\n\t}", "function jtl_save_testimonial_order_meta($post_id, $post) {\n\tif ($post->post_type == 'testimonial') {\n\t\t// Check to see if order value exists\n\t\t$meta_value = get_post_meta($post_id, 'jlt_testimonial_order', true);\n\t\tif (!$meta_value || empty($meta_value)) {\n\t\t\tadd_post_meta($post_id, 'jlt_testimonial_order', 0, true);\n\t\t}\n\t}\n\t\n}", "public function saveType()\n {\n }", "public function save(\n\t $type = 'SYSTEM'\n\t )\n\t{\n\t}", "function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\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}", "public function saved(Order $Order)\n {\n //code...\n }", "protected function save_meta() {\n\t\t// save report meta details\n\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, $this->get_meta() );\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "public function save()\n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $blPresaveOrder = (bool) $oConfig->getConfigParam('blFCPOPresaveOrder');\n if ($blPresaveOrder === false || $this->isPayOnePaymentType() === false) {\n return parent::save();\n }\n\n if ($this->oxorder__oxshopid->value === false) {\n $oShop = $oConfig->getActiveShop();\n $this->oxorder__oxshopid = new oxField($oShop->getId());\n }\n\n if (( $blSave = oxBase::save())) {\n // saving order articles\n $oOrderArticles = $this->getOrderArticles();\n if ($oOrderArticles && count($oOrderArticles) > 0) {\n foreach ($oOrderArticles as $oOrderArticle) {\n $oOrderArticle->fcpoSetFinishingSave($this->_blFinishingSave);\n $oOrderArticle->save();\n }\n }\n }\n\n return $blSave;\n }", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function setPaymentType($payment_type){\n $this->payment_type = $payment_type;\n }", "protected function set_last_order_date( $date_type, $date = null ) {\n\n\t\t$last_order = $this->get_last_order( 'all' );\n\n\t\tif ( $last_order ) {\n\n\t\t\t$datetime = wcs_get_datetime_from( $date );\n\n\t\t\tswitch ( $date_type ) {\n\t\t\t\tcase 'date_paid' :\n\t\t\t\t\tupdate_post_meta( $last_order->id, '_paid_date', ! is_null( $date ) ? $datetime->date( 'Y-m-d H:i:s' ) : '' );\n\t\t\t\t\t// Preemptively set the UTC timestamp for WC 3.0+ also to avoid incorrect values when the site's timezone is changed between now and upgrading to WC 3.0\n\t\t\t\t\tupdate_post_meta( $last_order->id, '_date_paid', ! is_null( $date ) ? $datetime->getTimestamp() : '' );\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'date_completed' :\n\t\t\t\t\tupdate_post_meta( $last_order->id, '_completed_date', ! is_null( $date ) ? $datetime->date( 'Y-m-d H:i:s' ) : '' );\n\t\t\t\t\t// Preemptively set the UTC timestamp for WC 3.0+ also to avoid incorrect values when the site's timezone is changed between now and upgrading to WC 3.0\n\t\t\t\t\tupdate_post_meta( $last_order->id, '_date_completed', ! is_null( $date ) ? $datetime->getTimestamp() : '' );\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'date_modified' :\n\t\t\t\t\twp_update_post( array(\n\t\t\t\t\t\t'ID' => $last_order->id,\n\t\t\t\t\t\t'post_modified' => $datetime->date( 'Y-m-d H:i:s' ),\n\t\t\t\t\t\t'post_modified_gmt' => wcs_get_datetime_utc_string( $datetime ),\n\t\t\t\t\t) );\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'date_created' :\n\t\t\t\t\twp_update_post( array(\n\t\t\t\t\t\t'ID' => $last_order->id,\n\t\t\t\t\t\t'post_date' => $datetime->date( 'Y-m-d H:i:s' ),\n\t\t\t\t\t\t'post_date_gmt' => wcs_get_datetime_utc_string( $datetime ),\n\t\t\t\t\t) );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function saveSimpleOrder() {\n\t\t//negate action from $_POST\n\t\tunset( $_POST['action'] );\n\n\t\t//separate order related data and loopable meta data\n\t\t$data['order_title'] = isset($_POST['order_title']) ? $_POST['order_title'] : null;\n\t\t$data['order_slug'] = isset($_POST['order_slug']) ? $_POST['order_slug'] : null;\n\t\t$data['parent_order_id'] = isset($_POST['parent_order_id']) ? $_POST['parent_order_id'] : null;\n\t\t$data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : null;\n\t\tif(empty($data['order_id']) && !empty($_SESSION['order']['wp_order_id'])) {\n\t\t\t$data['order_id'] = $_SESSION['order']['wp_order_id'];\n\t\t}\n\n\t\t$data['order_status'] = isset($_POST['order_status']) ? $_POST['order_status'] : null;\n\n\t\t$metaData['seq_number'] = isset($_POST['seq_number']) ? $_POST['seq_number'] : null;\n\n\t\t//Time to unset these variables from $_POST to keep only loopable data in $_POST\n\t\tunset( $_POST['order_title'] );\n\t\tunset( $_POST['order_slug'] );\n\t\tunset( $_POST['parent_order_id'] );\n\t\tunset( $_POST['order_id'] );\n\t\tunset( $_POST['order_status'] );\n\t\tunset( $_POST['seq_number'] );\n\n\t\t//now $_POST will have only the parameters which are ready to be saved, make sure to use same names which are in advance custom fields\n\t\tlist( $order, $wpError ) = saveAnbOrderInWp( $data, $_POST, $metaData );\n\t\t$errors = $wpError->get_error_messages();\n\t\t$response = null;\n\t\tif ( count( $errors ) > 0 ) {\n\t\t\t//its an error so send response appropriatly\n\t\t\t$response['success'] = false;\n\t\t\t$response['errors'] = $errors;\n\t\t} elseif ( $order > 0 ) {\n\t\t\t$response['success'] = true;\n\t\t} else {\n\t\t\t$response['success'] = 'no-update';\n\t\t}\n\t\techo json_encode( $response );\n\t\twp_die();\n\t}", "public function actionSave($id=999, $type='html')\n {\n //$obj = $this->c->getOrderObj($order_id);\n //$data = $obj->houseContract->contracts[0]->getTemplate();\n $uid = 20;\n $savedName = $this->c->saveOrder($id);\n echo '['.$savedName.'] saved!';\n }", "protected function update_post_meta( &$order ) {\n\t\tglobal $wpdb;\n\n\t\t$edit_data = array(\n\t\t\t'order_key' => $order->get_order_key( 'edit' ),\n\t\t\t'customer_id' => $order->get_customer_id( 'edit' ),\n\t\t\t'payment_method' => $order->get_payment_method( 'edit' ),\n\t\t\t'payment_method_title' => $order->get_payment_method_title( 'edit' ),\n\t\t\t'transaction_id' => $order->get_transaction_id( 'edit' ),\n\t\t\t'customer_ip_address' => $order->get_customer_ip_address( 'edit' ),\n\t\t\t'customer_user_agent' => $order->get_customer_user_agent( 'edit' ),\n\t\t\t'created_via' => $order->get_created_via( 'edit' ),\n\t\t\t'date_completed' => $order->get_date_completed( 'edit' ),\n\t\t\t'date_paid' => $order->get_date_paid( 'edit' ),\n\t\t\t'cart_hash' => $order->get_cart_hash( 'edit' ),\n\n\t\t\t'billing_first_name' => $order->get_billing_first_name( 'edit' ),\n\t\t\t'billing_last_name' => $order->get_billing_last_name( 'edit' ),\n\t\t\t'billing_company' => $order->get_billing_company( 'edit' ),\n\t\t\t'billing_address_1' => $order->get_billing_address_1( 'edit' ),\n\t\t\t'billing_address_2' => $order->get_billing_address_2( 'edit' ),\n\t\t\t'billing_city' => $order->get_billing_city( 'edit' ),\n\t\t\t'billing_state' => $order->get_billing_state( 'edit' ),\n\t\t\t'billing_postcode' => $order->get_billing_postcode( 'edit' ),\n\t\t\t'billing_country' => $order->get_billing_country( 'edit' ),\n\n\t\t\t'billing_email' => $order->get_billing_email( 'edit' ),\n\t\t\t'billing_phone' => $order->get_billing_phone( 'edit' ),\n\n\t\t\t'shipping_first_name' => $order->get_shipping_first_name( 'edit' ),\n\t\t\t'shipping_last_name' => $order->get_shipping_last_name( 'edit' ),\n\t\t\t'shipping_company' => $order->get_shipping_company( 'edit' ),\n\t\t\t'shipping_address_1' => $order->get_shipping_address_1( 'edit' ),\n\t\t\t'shipping_address_2' => $order->get_shipping_address_2( 'edit' ),\n\t\t\t'shipping_city' => $order->get_shipping_city( 'edit' ),\n\t\t\t'shipping_state' => $order->get_shipping_state( 'edit' ),\n\t\t\t'shipping_postcode' => $order->get_shipping_postcode( 'edit' ),\n\t\t\t'shipping_country' => $order->get_shipping_country( 'edit' ),\n\n\t\t\t'discount_total' => $order->get_discount_total( 'edit' ),\n\t\t\t'discount_tax' => $order->get_discount_tax( 'edit' ),\n\t\t\t'shipping_total' => $order->get_shipping_total( 'edit' ),\n\t\t\t'shipping_tax' => $order->get_shipping_tax( 'edit' ),\n\t\t\t'cart_tax' => $order->get_total_tax( 'edit' ),\n\t\t\t'total' => $order->get_total( 'edit' ),\n\n\t\t\t'version' => $order->get_version( 'edit' ),\n\t\t\t'currency' => $order->get_currency( 'edit' ),\n\t\t\t'prices_include_tax' => $order->get_prices_include_tax( 'edit' ),\n\t\t);\n\n\t\t$changes = array();\n\n\t\tif ( $this->creating ) {\n\t\t\t$wpdb->insert(\n\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\tarray_merge( array(\n\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t), $edit_data )\n\t\t\t);\n\n\t\t\t// We are no longer creating the order, it is created.\n\t\t\t$this->creating = false;\n\t\t} else {\n\t\t\t$changes = array_intersect_key( $edit_data, $order->get_changes() );\n\n\t\t\tif ( ! empty( $changes ) ) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\t\t$changes,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$updated_props = array_keys( (array) $changes );\n\n\t\t// If customer changed, update any downloadable permissions.\n\t\tif ( in_array( 'customer_user', $updated_props ) || in_array( 'billing_email', $updated_props ) ) {\n\t\t\t$data_store = WC_Data_Store::load( 'customer-download' );\n\t\t\t$data_store->update_user_by_order_id( $order->get_id(), $order->get_customer_id(), $order->get_billing_email() );\n\t\t}\n\n\t\tdo_action( 'woocommerce_order_object_updated_props', $order, $updated_props );\n\t}", "public function form_order_type() {\n\t\tglobal $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t$data = array();\n\n\t\tif ( !isset( $_REQUEST['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual-form-builder-pro' !== $_REQUEST['page'] )\n\t\t\treturn;\n\n\t\tif ( isset( $_REQUEST['mode'] ) ) :\n\t\t\t$user_id = $current_user->ID;\n\n\t\t\t$type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t\t$meta_value = ( in_array( $_REQUEST['mode'], array( 'order', 'list' ) ) ) ? esc_html( $_REQUEST['mode'] ) : '';\n\t\t\tupdate_user_meta( $user_id, 'vfb-form-order-type', $meta_value );\n\n\t\tendif;\n\t}", "function vw_mobile_app_pro_posttype_ex_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n // Save designation\n if( isset( $_POST[ 'meta-designation' ] ) ) {\n update_post_meta( $post_id, 'meta-designation', esc_html($_POST[ 'meta-designation' ]) );\n }\n}", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_TOTAL_KEY, $this->total_reports );\n\t}", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "public function ___orderSaved(PadOrder $order) {\n }", "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "public function auctions_meta_save( $post_id ) { \n\n\t\t$product_type = empty( $_POST['product-type'] ) ? 'simple' : sanitize_title( stripslashes( $_POST[ 'product-type' ] ) );\n\t\t\n\t\tif ( $product_type == 'auction' ) {\n\n\t\t \tupdate_post_meta( $post_id, '_manage_stock', 'yes' );\n\t\t \tupdate_post_meta( $post_id, '_stock', '1' );\n\t\t \tupdate_post_meta( $post_id, '_backorders', 'no' );\n\t\t\tupdate_post_meta( $post_id, '_sold_individually', 'yes' );\n\n\t\t\tif ( isset($_POST['_auction_item_condition'])) \n\t\t\t\tupdate_post_meta( $post_id, '_auction_item_condition', stripslashes( $_POST['_auction_item_condition'] ) );\n\t\t\tif ( isset($_POST['_auction_type'])) \n\t\t\t\tupdate_post_meta( $post_id, '_auction_type', stripslashes( $_POST['_auction_type'] ) );\n\t\t\tif ( isset($_POST['_auction_proxy'])){\n\t\t\t\tupdate_post_meta( $post_id, '_auction_proxy', stripslashes( $_POST['_auction_proxy'] ) );\n\t\t\t} else {\n\t\t\t\tdelete_post_meta( $post_id, '_auction_proxy' );\t\n\t\t\t}\n\t\t\tif (isset($_POST['_auction_start_price']))\n\t\t\tupdate_post_meta( $post_id, '_auction_start_price', stripslashes( $_POST['_auction_start_price'] ) );\n\t\t\tif (isset($_POST['_auction_bid_increment']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_bid_increment', stripslashes( $_POST['_auction_bid_increment'] ) );\n\t\t\tif (isset($_POST['_auction_reserved_price']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_reserved_price', stripslashes( $_POST['_auction_reserved_price'] ) );\n\t\t\tif ( isset( $_POST['_buy_it_now_price'] ) ) { \n\t\t\t\tupdate_post_meta( $post_id, '_buy_it_now_price', stripslashes( $_POST['_buy_it_now_price'] ) );\n\t\t\t\tupdate_post_meta( $post_id, '_regular_price', stripslashes( $_POST['_buy_it_now_price'] ) );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['_regular_price'] ) ) { \n\t\t\t\tupdate_post_meta( $post_id, '_buy_it_now_price', stripslashes( $_POST['_regular_price'] ) );\n\t\t\t}\n\n\t\t\tif (isset($_POST['_auction_dates_from']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_dates_from', stripslashes( $_POST['_auction_dates_from'] ) );\n\t\t\tif (isset($_POST['_auction_dates_to']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_dates_to', stripslashes( $_POST['_auction_dates_to'] ) );\n\t \n\t if(isset($_POST['_relist_auction_dates_from']) && isset($_POST['_relist_auction_dates_to']) && !empty($_POST['_relist_auction_dates_from']) && !empty($_POST['_relist_auction_dates_to']) ){\n\t $this->do_relist($post_id, $_POST['_relist_auction_dates_from'], $_POST['_relist_auction_dates_to']);\n\t \n\t }\n\t if (isset($_POST['_auction_automatic_relist']))\n\t \tupdate_post_meta( $post_id, '_auction_automatic_relist', stripslashes( $_POST['_auction_automatic_relist'] ) );\n\t if (isset($_POST['_auction_relist_fail_time']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_fail_time', stripslashes( $_POST['_auction_relist_fail_time'] ) );\n\t\t\tif (isset($_POST['_auction_relist_not_paid_time']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_not_paid_time', stripslashes( $_POST['_auction_relist_not_paid_time'] ) );\n\t\t\tif (isset($_POST['_auction_relist_duration']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_duration', stripslashes( $_POST['_auction_relist_duration'] ) );\n\t \t}\n\n\t}", "function save_qr_meta( $post_data, $post_id, $meta_key, $form_settings ) {\n $type = $post_data['qr_code_type'];\n\n if( $type == '' && empty( $type ) ) {\n return;\n }\n\n $metadata = array(\n 'type' => $post_data['qr_code_type'],\n 'type_param' => $post_data['type_param']\n );\n\n update_post_meta( $post_id, $meta_key, $metadata );\n }", "public static function save( $name, $type ){\n if ( isset( $_REQUEST ) && isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'wprds_nonce_check' ) == 1 ) {\n $post_data = $_REQUEST[ self::$options_name ];\n $value = isset( $post_data[ $name ] ) ? $post_data[ $name ] : null;\n switch ( $type ) {\n case 'text':\n case 'password':\n update_option( $name, sanitize_text_field( $value ) );\n break;\n case 'textarea':\n update_option( $name, sanitize_textarea_field( $value ) );\n break;\n case 'multiselect':\n update_option( $name, $value );\n break;\n case 'select':\n update_option( $name, $value );\n break;\n case 'checkbox':\n $value = isset( $value ) ? true : false;\n update_option( $name, $value );\n break;\n }\n }\n }", "public function saving(Payment $payment)\n {\n if (company()) {\n $payment->company_id = company()->id;\n }\n }", "public function savePaymentAction()\n {\n parent::savePaymentAction();\n if ($this->_isActive()) {\n $result = Mage::helper('core')->jsonDecode(\n $this->getResponse()->getBody()\n );\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }", "public function getPaymenttype()\n {\n return $this->paymenttype;\n }", "private function writeOrder($order)\n {\n // get order profile assoc data that we can use in json encoder\n $orderAbstract = Mage::getModel('marketingsoftware/abstraction_order')->setOriginal($order);\n $orderProfile = Mage::getModel('marketingsoftware/copernica_profileorder')->setOrder($orderAbstract);\n $profileData = $orderProfile->toArray();\n\n // we will need order data so we can build a proper profile\n $orderSubprofile = Mage::getModel('marketingsoftware/copernica_Order_Subprofile')->setOrder($orderAbstract);\n $orderData = $orderSubprofile->toArray();\n\n // placeholder for items\n $items = array();\n\n // iterate over all item and get theirs data\n foreach ($order->getItemsCollection() as $item) {\n $items[] = $this->getItemData($item);\n }\n\n // assign items data to order data\n $orderData['items'] = $items;\n\n // set orders to progile\n $profileData['orders'] = array( $orderData );\n\n // write profile to data files\n Mage::helper('marketingsoftware/DataWriter')->storeProfile($profileData);\n }", "public function salesOrderSave($observer)\n {\n $order = $observer->getOrder();\n $quote = $observer->getQuote();\n \n $payment = $order->getPayment();\n \n if( !Mage::getStoreConfig('payment/'.$payment->getMethod().'/mc_active') ){\n return $this;\n }\n \n $data = new Varien_Object();\n \n if($payment->getCcType())\n $data->setCcType($payment->getCcType());\n if($payment->getCcOwner())\n $data->setCcOwner($payment->getCcOwner());\n if($payment->getCcLast4())\n $data->setCcLast4($payment->getCcLast4());\n if($payment->getCcNumber())\n $data->setCcNumber($payment->getCcNumber());\n if($payment->getCcParcelas())\n $data->setCcParcelas($payment->getCcParcelas());\n if($payment->getCcCid())\n $data->setCcCid($payment->getCcCid());\n if($payment->getCcExpMonth())\n $data->setCcExpMonth($payment->getCcExpMonth());\n if($payment->getCcExpYear())\n $data->setCcExpYear($payment->getCcExpYear());\n if($payment->getGwapBoletoType())\n $data->setGwapBoletoType($payment->getGwapBoletoType());\n \n /**\n * create braspag payment\n */\n $mGwap = Mage::getModel('gwap/order');\n $mGwap->setStatus(Indexa_Gwap_Model_Order::STATUS_CREATED);\n $mGwap->setCreatedAt(date('Y-m-d H:i:s'));\n $mGwap->setInfo(Mage::helper('core')->encrypt(serialize($data->toArray())));\n $mGwap->setType(Mage::getStoreConfig('payment/'.$payment->getMethod().'/mc_type'));\n\n $mGwap->setOrderId($order->getId());\n $mGwap->save();\n \n return $this;\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "protected function _storeCaptureMode()\n {\n $captureMode = Mage::getStoreConfig('afterpay/afterpay_capture/capture_mode', $this->_order->getStoreId());\n \n $this->_order->setAfterpayCaptureMode($captureMode)->save();\n }", "private function savePayment()\n {\n if (empty($this->randomKey))\n $this->randomKey = mt_rand();\n if (empty($this->createdDate))\n $this->createdDate = time();\n $pay = ['random_key' => $this->randomKey, 'created_date' => $this->createdDate];\n if (isset($this->paidDate)) $pay['paid_date'] = $this->paidDate;\n if (isset($this->paymentMethod)) $pay['payment_method'] = $this->paymentMethod;\n if (isset($this->paymentAmount)) $pay['payment_amount'] = $this->paymentAmount;\n if (isset($this->paymentRef)) $pay['payment_ref'] = $this->paymentRef;\n \n // If payId is set, updating an existing payment.\n if (!empty($this->payId) && $this->payId>0) {\n $pay['payid'] = $this->payId;\n SimpleConregPaymentStorage::update($pay);\n }\n else {\n $this->payId = SimpleConregPaymentStorage::insert($pay);\n }\n // Save Stripe session ID to payment_sessions table.\n if (!(empty($this->payId) || empty($this->sessionId))) $this->saveSession();\n return $this->payId;\n }", "function save_meta ( $post_id )\n\t{\n\n // Check if nonce is set.\n if ( ! isset( $_POST['metabox_lh_quote'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['metabox_lh_quote'], 'save_metabox_lh_quote' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // If the post key contains the quote_element add it to the array to save\n $quote_breakdown = array();\n foreach ($_POST as $KEY => $VALUE)\n {\n if(strpos($KEY, \"quote_element\") !== false){\n $quote_breakdown[$KEY] = $VALUE;\n }\n }\n\n update_post_meta( $post_id, 'quote_breakdown', $quote_breakdown );\n\n $quote_total = $_POST['quote_total'];\n update_post_meta( $post_id, 'quote_total', $quote_total );\n\n // Save the client ID\n $client_id = $_POST['client_id'];\n update_post_meta( $post_id, 'client_id', $client_id );\n\n // Update quote status\n $quote_status = $_POST['quote_status'];\n update_post_meta( $post_id, 'quote_status', $quote_status );\n\n // Update deposit status\n $deposit_status = $_POST['deposit_status'];\n // check current deposit status. If it's not paid and its being changed add to timeline\n $current_deposit_status = get_post_meta($post_id,'deposit_status',true);\n if($current_deposit_status<>\"paid\" && $deposit_status==\"paid\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Deposit Paid',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'deposit_status', $deposit_status );\n\n // Update materials status\n $materials_status = $_POST['materials_status'];\n // check current status and add to timeline if required\n $current_materials_status = get_post_meta($post_id,'materials_status',true);\n if($current_materials_status<>\"ordered\" && $materials_status==\"ordered\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Materials Ordered',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'materials_status', $materials_status );\n\n // Update accessories status\n $accessories_status = $_POST['accessories_status'];\n // check current status and add to timeline if required\n $current_accessories_status = get_post_meta($post_id,'accessories_status',true);\n if($current_accessories_status<>\"arrived\" && $accessories_status==\"arrived\")\n {\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Critical Accessories Arrived',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'accessories_status', $accessories_status );\n\n // Update invouce status\n $invoice_sent = $_POST['invoice_sent'];\n update_post_meta( $post_id, 'invoice_sent', $invoice_sent );\n\n // Update invouce paid\n $invoice_paid = $_POST['invoice_paid'];\n update_post_meta( $post_id, 'invoice_paid', $invoice_paid );\n\n // Add Project start Date\n $project_start_date = $_POST['project_start_date'];\n update_post_meta( $post_id, 'project_start_date', $project_start_date );\n\n // Finally see if there is a descret key - if not create one\n $secret = get_post_meta($post_id,'secret',true);\n\n if($secret==\"\")\n {\n $new_secret = lh_crm_utils::generate_secret();\n update_post_meta( $post_id, 'secret', $new_secret );\n }\n\n\t}", "public function setPaymentInfoToQuote()\n {\n $expercashCode = Mage::getModel('expercash/expercashmpf')->getCode();\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n\n if ($quote->isVirtual()) {\n $quote->getBillingAddress()->setPaymentMethod($expercashCode);\n } else {\n $quote->getShippingAddress()->setPaymentMethod($expercashCode);\n }\n\n // shipping totals may be affected by payment method\n if (!$quote->isVirtual() && $quote->getShippingAddress()) {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n }\n\n $payment = $quote->getPayment();\n $payment->importData(array('method' => $expercashCode));\n $quote->save();\n }", "function prosody_poem_type_save_meta_box_data ($post_id=null)\n{\n $post_id = (is_null($post_id)) ? get_post()->ID : $post_id;\n\n /*\n * We need to verify this came from our screen and with proper\n * authorization, because the save_post action can be triggered at other\n * times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['prosody_poem_type_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n $nonce = $_POST['prosody_poem_type_meta_box_nonce'];\n if ( ! wp_verify_nonce( $nonce, 'prosody_poem_type_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't\n // want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) &&\n 'prosody_poem' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, its safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['prosody_poem_type'] ) ) {\n return;\n }\n\n // Sanitize user input. In this case we don't so the transform will work.\n $my_data = sanitize_text_field( $_POST['prosody_poem_type'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'Type', $my_data );\n}", "public function store_order_complete_end($order)\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t$order_array = $order->toTagArray();\n\t\t//file_put_contents('./' . time() . '-order.json', json_encode($order_array));\n\n\t\t$order_record = array();\n\n\t\t// loop through all the static fields from the order map\n\t\tforeach($order_fields as $field=>$key)\n\t\t{\n\t\t\t$order_record[$field] = $order_array[$key];\n\t\t}\n\n\t\t// now we do some replacements for shipping, tax and payment based on the mappings\n\t\tif(!empty($shipping_methods[$order_record['shipping_carrier']]))\n\t\t{\n\t\t\t$order_record['shipping_carrier'] = $shipping_methods[$order_record['shipping_carrier']];\n\t\t}\t\n\n\t\tif(!empty($payment_methods[$order_record['order_payment_method']]))\n\t\t{\n\t\t\t$order_record['order_payment_method'] = $payment_methods[$order_record['order_payment_method']];\n\t\t}\t\n\n\t\tif(empty($order_record['order_tax_rate_name']))\n\t\t{\n\n\t\t\tif($order_record['shipping_state'] == 'MA')\n\t\t\t{\n\t\t\t\t$order_record['order_tax_rate_name'] = 'Non Taxable';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_record['order_tax_rate_name'] = 'Out of State';\n\t\t\t}\t\n\n\t\t}\n\n\n\t\tee()->sync_db->insert('orders', $order_record);\n\n\t\t// loop through the items in the order\n\t\tforeach($order_array['items'] as $item)\n\t\t{\n\t\t\t$item_record = array();\n\n\t\t\t// loop through the static fields from the item_map\n\t\t\tforeach($item_fields as $field=>$key)\n\t\t\t{\n\t\t\t\t$item_record[$field] = $item[$key];\n\t\t\t}\n\n\t\t\tee()->sync_db->insert('order_items', $item_record);\t\n\t\t}\t\t\t \n\t}", "public function save(Type $type) {\n $typeData = array(\n 'name_ET' => $type->getName()\n );\n\n if ($type->getNum()) {\n // The type has already been saved : update it\n $this->getDb()->update('eventtype', $typeData, array('num_ET' => $type->getNum()));\n } else {\n // The type has never been saved : insert it\n $this->getDb()->insert('eventtype', $typeData);\n // Get the id of the newly created type and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $type->setNum($id);\n }\n }", "public function savePaymentAction()\n {\n\t\tif( !Mage::helper('repay/checkout')->enabled() )\n\t\t\treturn parent::savePaymentAction();\n\t\t\n\t\t\n\t\tif ($this->_expireAjax()) {\n return;\n }\n try {\n if (!$this->getRequest()->isPost()) {\n $this->_ajaxRedirectResponse();\n return;\n }\n\n // set payment to quote\n $result = array();\n $data = $this->getRequest()->getPost('payment', array());\n $result = $this->getOnepage()->savePayment($data);\n if( !Mage::getSingleton('checkout/session')->getLastRealOrderId() ){\n\t\t\t\t$this->saveOrder();\n }\n\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());\n // get section and redirect data\n $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();\n if (empty($result['error']) && !$redirectUrl) {\n $this->loadLayout('checkout_onepage_review');\n $result['goto_section'] = 'review';\n $result['update_section'] = array(\n 'name' => 'review',\n 'html' => '<div class=\"order-tips\">'.Mage::Helper('repay/checkout')->getOrderCreateDesc($order).'</div>'.$this->_getReviewHtml()\n );\n }\n if ($redirectUrl) {\n $result['redirect'] = $redirectUrl;\n }\n\t\t\t\n } catch (Mage_Payment_Exception $e) {\n if ($e->getFields()) {\n $result['fields'] = $e->getFields();\n }\n $result['error'] = $e->getMessage();\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = $this->__('Unable to set Payment Method.');\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function getOrderType()\n {\n return $this->order_type;\n }", "function construction_realestate_posttype_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n}", "function set_generated_meta( $insert_id = 0, $meta_type = '' ) {\n\n\t// Handle our before.\n\tdo_action( Core\\HOOK_PREFIX . 'before_sourced_meta_generated', $insert_id, $meta_type );\n\n\t// Handle the meta type switch.\n\tswitch ( $meta_type ) {\n\n\t\t// Handle post meta.\n\t\tcase 'post' :\n\t\tcase 'posts' :\n\t\tcase 'attachment' :\n\t\tcase 'attachments' :\n\t\tcase 'product' :\n\t\tcase 'products' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle comment and review meta.\n\t\tcase 'comment' :\n\t\tcase 'comments' :\n\t\tcase 'review' :\n\t\tcase 'reviews' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle user and customer meta.\n\t\tcase 'user' :\n\t\tcase 'users' :\n\t\tcase 'customer' :\n\t\tcase 'customers' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n\t\t// End all case breaks.\n\t}\n\n\t// No other updates needed, so do the action.\n\tdo_action( Core\\HOOK_PREFIX . 'after_sourced_meta_generated', $insert_id, $meta_type );\n}", "private function saveOrder()\n {\n $this->paymentInterface->setMethod(self::PAYMENT_METHOD);\n $this->magentoOrderId = $this->quoteManagement->placeOrder($this->quoteId, $this->paymentInterface);\n /** @var \\Magento\\Sales\\Api\\Data\\OrderInterface magentoOrder */\n $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);\n\n if ($this->magentoOrderId == '') {\n throw new \\Exception(self::PMO_ERR_MSG);\n }\n }", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "public function save($type, $content, $sort_order) {\n\t\t// SQL\n\t\t$sql = \"INSERT INTO `$this->table` (`type`, `content`, `sort_order`, `date_created`) VALUES ('{$type}', '{$content}', '{$sort_order}', NOW())\";\n\t\t//echo $sql;\n\t\t// excecute SQL statement\n\t\t$result = mysqli_query ( $this->adapter, $sql );\n\t\t// die if SQL statement failed\n\t\tif (! $result) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn mysqli_insert_id ( $this->adapter );\n\t}", "function lb_subscription_set_payment_type($account, $subscription, $payment_type) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($entity, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n if ($account_subscription_data['payment_type'] != $payment_type) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_payment_type'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $payment_type,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }", "private function saveCoupon($coupon, $type)\n {\n if ($type == 'coupon') {\n if (isset($coupon['length'])) {\n unset($coupon['length']);\n }\n if (isset($coupon['prefix'])) {\n unset($coupon['prefix']);\n }\n if (isset($coupon['symbols'])) {\n unset($coupon['symbols']);\n }\n }\n $coupon['type'] = $type;\n return $this->coupon_model->save($coupon);\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "public function setOrderType($value)\n {\n $this->order_type = $value;\n $this->setSettingValue('retailcrm_order_type', $value);\n }", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function savePaymentAction()\n {\n if ($this->_expireAjax()) {\n return;\n }\n try {\n if (!$this->getRequest()->isPost()) {\n $this->_ajaxRedirectResponse();\n return;\n }\n\n // set payment to quote\n $result = array();\n $data = $this->getRequest()->getPost('payment', array());\n\n $paymentMethod = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($data['method']);\n if (null !== $paymentMethod) {\n $data['onlinepayment_action_mode'] = $paymentMethod->getActionMode();\n }\n\n if ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE) {\n $data['cc_number_enc'] = Mage::getModel('onlinepayment/method_creditcard')->buildRequestCreatePanalias($data);\n } elseif ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE) {\n Mage::getSingleton('checkout/session')->paymentData = $data;\n }\n $result = $this->getOnepage()->savePayment($data);\n\n // get section and redirect data\n $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();\n if (empty($result['error']) && !$redirectUrl) {\n $this->loadLayout('checkout_onepage_review');\n $result['goto_section'] = 'review';\n $result['update_section'] = array(\n 'name' => 'review',\n 'html' => $this->_getReviewHtml()\n );\n }\n if ($redirectUrl) {\n $result['redirect'] = $redirectUrl;\n }\n } catch (Mage_Payment_Exception $e) {\n if ($e->getFields()) {\n $result['fields'] = $e->getFields();\n }\n $result['error'] = $e->getMessage();\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = $this->__('Unable to set Payment Method.');\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "public function store()\n {\n\n try {\n\n $storeRequest = new OrderTypeStoreRequest();\n $validator = Validator::make(request()->all(), $storeRequest->rules());\n\n if ($validator->fails()) {\n\n return $this->sendBadRequest('Validation Error.', $validator->errors()->toArray());\n }\n\n $item = $this->orderTypeService->create(request()->all());\n\n return $this->sendResponse($item->toArray());\n\n } catch (Exception $exception) {\n\n return $this->sendError('Server Error.', $exception);\n\n }\n }", "public static function set_order_data( $order ) {\n\t\t$order->update_meta_data( '_billing_vat_number', self::$data['vat_number'] );\n\t\t$order->update_meta_data( '_vat_number_is_validated', ! is_null( self::$data['validation']['valid'] ) ? 'true' : 'false' );\n\t\t$order->update_meta_data( '_vat_number_is_valid', true === self::$data['validation']['valid'] ? 'true' : 'false' );\n\n\t\tif ( false !== self::get_ip_country() ) {\n\t\t\t$order->update_meta_data( '_customer_ip_country', self::get_ip_country() );\n\t\t\t$order->update_meta_data( '_customer_self_declared_country', ! empty( $_POST['location_confirmation'] ) ? 'true' : 'false' );\n\t\t}\n\t}", "public function store(IntentTypeRequest $request) {\n $type = $this->service()->repo()->create($request->all());\n return $this->created($type);\n }", "public static function store_eu_data( $payment_meta ) {\n global $edd_options;\n\n $payment_meta['country'] = isset( $_POST['edd_country'] ) ? sanitize_text_field( $_POST['edd_country'] ) : $payment_meta['user_info']['address']['country'];\n \n $payment_meta['edd_vatreg'] = isset( $_POST['edd_vatreg'] ) ? true : false;\n\n // Check if user is VAT Registered with a Valid number. If so, set the Tax to 0.\n if ( isset( $_POST['vat_number'] ) && !empty($_POST['vat_number']) && \"\" !== $_POST['vat_number'] ) {\n\n $payment_meta['vat_number'] = preg_replace( '/\\s+/', '', $_POST['vat_number']);\n\n $vatarray = taxedd_get_vat_details($payment_meta['vat_number']);\n\n if ( isset( $vatarray['billing_country_code'] ) ) {\n $payment_meta['vat_billing_country_code'] = $vatarray['billing_country_code'];\n } else {\n $payment_meta['vat_billing_country_code'] = $payment_meta['user_info']['address']['country'];\n }\n // But if the base country is equal to the VAT Country code, add the tax on.\n if ($edd_options['base_country'] == $payment_meta['vat_billing_country_code']) {\n $payment_meta['tax'] = self::calculate_tax( $payment_meta['vat_billing_country_code'] );\n }\n\n } else {\n $payment_meta['vat_number'] = \"\";\n $payment_meta['tax'] = self::calculate_tax( $payment_meta['user_info']['address']['country'] );\n }\n\n // Set self declaration flag if needed.\n if ( isset( $_POST['edd_self_declaration'] ) ) {\n\n $payment_meta['self_declaration'] = $_POST['edd_self_declaration'];\n\n }\n\n return $payment_meta;\n }", "private function saveType()\n\t{\n\t\t// Build config file\n\t\t$config = \"<?php \\n\\n\";\n\t\t$config.= \"// This config file is auto generated on boot.\\n\\n\";\n\t\t$config.= 'define(\"INSTANCE_TYPE\", \"'.$this->instanceType.'\");'.\"\\n\";\n\t\t$config.= 'define(\"INSTANCE_NAME\", \"'.$this->instanceName.'\");'.\"\\n\";\n\t\t$config.= 'define(\"BRANCH\", \"'.$this->branch.'\");'.\"\\n\";\n\n\t\t// If bootstrapping the development server\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$config.= 'define(\"DEV\", TRUE);'.\"\\n\";\n\t\t}\t\n\n\t\t// Write config file to config folder\n\t\tfile_put_contents(\"config/instance.config.php\", $config);\n\t}", "public function getOrderType()\n {\n return $this->orderType;\n }", "function _updateAfterPurchase($data, $type = null)\r\n\t{\r\n\t\t$this->_updateUserAfterPurchase($data, $type);\r\n\t\t// Updating Purchase [ITEM] Related 'AfterSave' Fields //\r\n\t\t$this->_updateItemAfterPurchase($data, $type);\r\n\t\t// Updating Purchase [ITEM] Related 'AfterSave' Counts //\r\n\t\t$this->ItemUser->_updateItemAfterPurchaseCount($data, $type);\r\n\t\t// Updating Purchase [MERCHANT] Related 'AfterSave' Counts //\r\n\t\t$this->_updateMerchantAfterPurchase($data, $type);\r\n\t}", "public function getOrderType();", "public function process_payment($payment_type, $data) {\r\n $payment_return = array(\r\n 'ACK' => false\r\n );\r\n if ($payment_type) {\r\n\r\n // check order id\r\n if (isset($data['order_id'])) $order = new mJobOrder($data['order_id']);\r\n else $order = new ET_NOPAYOrder();\r\n\r\n // call a visitor process order base on payment type\r\n $visitor = AE_Payment_Factory::createPaymentVisitor(strtoupper($payment_type), $order, $payment_type);\r\n $payment_return = $order->accept($visitor);\r\n\r\n $data['order'] = $order;\r\n $data['payment_type'] = $payment_type;\r\n\r\n /**\r\n * filter payment return\r\n * @param Array $payment_return\r\n * @param Array $data -order : Order data, payment_type ...\r\n * @since 1.0\r\n */\r\n $payment_return = apply_filters('ae_process_payment', $payment_return, $data);\r\n $payment_return['order'] = $data['order'];\r\n\r\n /**\r\n * do an action after payment\r\n * @param Array $payment_return\r\n * @param Array $data -order : Order data, payment_type ...\r\n * @since 1.0\r\n */\r\n do_action('mjob_process_payment_action', $payment_return, $data);\r\n }\r\n return $payment_return;\r\n }", "function wpcp_save_postdata($post_id)\n{\n if (array_key_exists('wpcp_providerplans', $_POST)) {\n\n $wpcp_provider = sanitize_text_field($_POST['wpcp_provider']);\n $wpcp_providerplans = sanitize_text_field($_POST['wpcp_providerplans']);\n\n update_post_meta(\n $post_id,\n WPCP_PROVIDER,\n $wpcp_provider\n );\n update_post_meta(\n $post_id,\n WPCP_PROVIDERPLANS,\n $wpcp_providerplans\n );\n }\n\n if (array_key_exists('wpcp_server_state', $_POST)) {\n\n $state = sanitize_text_field($_POST['wpcp_server_state']);\n\n if ($state == 'Active')\n $state = WPCP_ACTIVE;\n elseif ($state == 'Suspended')\n $state = WPCP_SUSPENDED;\n elseif ($state == 'Cancelled')\n $state = WPCP_CANCELLED;\n elseif ($state == 'Terminated')\n $state = WPCP_TERMINATED;\n\n update_post_meta(\n $post_id,\n WPCP_STATE,\n $state\n );\n }\n\n if (array_key_exists(WPCP_ORDER_PRICE, $_POST)) {\n\n $price = sanitize_text_field($_POST[WPCP_ORDER_PRICE]);\n\n update_post_meta(\n $post_id,\n WPCP_ORDER_PRICE,\n $price\n );\n }\n}", "public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }", "function get_payment_type()\n {\n // echeck - payment funded with e-check\n // instant - payment was funded with platnosci balance, credit card, or instant transfer\n return $this->platnosci_post_vars['payment_type'];\n }", "public function populate_from_meta( &$order, $save = true, $delete = false ) {\n\t\t$table_data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $table_data ) ) {\n\t\t\t$original_creating = $this->creating;\n\t\t\t$this->creating = true;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t$meta = get_post_meta( $order->get_id(), $meta_key, true );\n\n\t\t\tif ( empty( $table_data->$column ) && ! empty( $meta ) ) {\n\t\t\t\tswitch ( $column ) {\n\t\t\t\t\tcase 'prices_include_tax':\n\t\t\t\t\t\t$order->set_prices_include_tax( 'yes' === $meta );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$order->{\"set_{$column}\"}( $meta );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( true === $save ) {\n\t\t\t$this->update_post_meta( $order );\n\t\t}\n\n\t\tif ( true === $delete ) {\n\t\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t\tdelete_post_meta( $order->get_id(), $meta_key );\n\t\t\t}\n\t\t}\n\n\t\t$this->creating = $original_creating;\n\n\t\treturn $order;\n\t}", "public function save_items_order() {\n\t\n\t\t\tparse_str( $_REQUEST[ 'order' ], $order );\n\t\n\t\t\techo update_post_meta( intval( $_REQUEST[ 'gallery_id' ] ), 'items_order', $order );\n\t\n\t\t\texit;\n\t\t}", "public function afterPlaceOrder($order)\n {\n $this->aliExpressOrderRepository->create(['order' => $order]);\n }", "public function update_meta(Request $request)\n {\n $type = $request->input('type');\n $ret['msg'] = 'info';\n $ret['message'] = __('messages.nothing');\n $auth_id = auth()->id();\n $is_saved = false;\n\n $type_key = 'default'; $is_page_meta = false;\n if($type == 'tnx_page_meta' || $type == 'kyc_page_meta' || $type == 'user_page_meta') {\n $type_key = str_replace('_page_meta', '', $type);\n $is_page_meta = true;\n }\n\n if ($is_page_meta==true) {\n $meta_name = $this->meta_key_val($request->meta, 'key');\n $meta_val = $this->meta_key_val($request->meta, 'value');\n $ret['msg'] = 'error';\n $ret['message'] = __('messages.update.failed', ['what' => 'Options']);\n\n if($meta_name=='perpage') {\n $meta_by_name = $type_key.'_per_page';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='ordered') {\n $meta_by_name = $type_key.'_ordered';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='orderby') {\n $meta_by_name = $type_key.'_order_by';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } else {\n $meta_by_name = $type_key.'_'.$meta_name;\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n }\n if($is_saved) {\n $ret['msg'] = 'success';\n $ret['message'] = __('messages.update.success', ['what' => 'Options']);\n }\n }\n\n if ($request->ajax()) {\n return response()->json($ret);\n }\n return back()->with([$ret['msg'] => $ret['message']]);\n }", "public function getOrderType()\n {\n return 'purchase';\n }", "function meta_box_save_func_store($post_id){\n\n\t# Doing autosave then return.\n\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n\t\treturn;\n\n\t# If the nonce is not present there or we can not versify it.\n\tif ( !isset($_POST['product_nonce_name']) || !wp_verify_nonce($_POST['product_nonce_name'], 'product_nonce_action' ))\n\t\treturn;\n\n\t# Save Author Name \n\tif (isset($_POST['author_name']) && ($_POST['author_name'] != '') ) {\n\t \tupdate_post_meta($post_id, 'author_name', esc_html($_POST['author_name']));\n\t } \n\n\t# Save data Product name.\n\tif (isset($_POST['product_name']) && ($_POST['product_name'] != '')) {\n\t\tupdate_post_meta($post_id, 'product_name', esc_html($_POST['product_name']));\n\t}\n\n\t# Save data Product Description.\n\tif (isset($_POST['product_description']) && ($_POST['product_description'] != '')) {\n\t\tupdate_post_meta($post_id, 'product_description', esc_html($_POST['product_description']));\n\t}\n\n\n}", "public function saveAction()\n {\n $tab = '';\n \n \n $pPoOrderId = $this->getRequest()->getPost('po_order_id');\n \n //get input parametre from the webpage.\n $order = Mage::getModel('purchase/order')->load($pPoOrderId);\n\n $order->setPurchaseRep(Mage::getSingleton('admin/session')->getUser()->getUsername());\n \n if ($this->getRequest()->getPost('order_eta')){\n $order->setOrderEta($this->getRequest()->getPost('order_eta'));\n }else{\n $order->setOrderEta(null);\n }\n $order->setPaymentTerms($this->getRequest()->getPost('payment_term_id'));\n $order->setShippingMethod($this->getRequest()->getPost('shipping_method_id'));\n \n $order->setComments($this->getRequest()->getPost('comments'));\n $order->setStoreId($this->getRequest()->getPost('store_id'));\n \n $order->setShippingName($this->getRequest()->getPost('shipping_name'));\n $order->setShippingCompany($this->getRequest()->getPost('shipping_company'));\n $order->setShippingStreet1($this->getRequest()->getPost('shipping_street1'));\n $order->setShippingStreet2($this->getRequest()->getPost('shipping_street2'));\n $order->setShippingCity($this->getRequest()->getPost('shipping_city'));\n $order->setShippingState($this->getRequest()->getPost('shipping_state'));\n $order->setShippingZipcode($this->getRequest()->getPost('shipping_zipcode'));\n $order->setShippingCountry($this->getRequest()->getPost('shipping_country'));\n $order->setShippingTelephone1($this->getRequest()->getPost('shipping_telephone1'));\n $order->setShippingTelephone2($this->getRequest()->getPost('shipping_telephone2'));\n $order->setShippingFax($this->getRequest()->getPost('shipping_fax'));\n $order->setShippingEmail($this->getRequest()->getPost('shipping_email'));\n $order->setShippingType($this->getRequest()->getPost('shipping_type')); \n// $order->setShippingSalesOrderId(\"\"); \n if($this->getRequest()->getPost('po_shipping_type')==\"so\")\n $order->setShippingSalesOrderId($this->getRequest()->getPost('po_shipping_so_num')); \n else\n $order->setShippingSalesOrderId(\"\"); \n \n $order->save(); \n \n $purchaseOrderId = $order->getId();\n \n \n //Process information from \"review product\" tab page\n foreach ($order->getOrderItems() as $item)\n {\n\n $itemId = $item->getId();\n \n if ($this->getRequest()->getPost('delete_'.$itemId) == 1)\n {\n $vOldQty = $item->getProductQty();\n $vProductQty = 0;\n $item->delete();\n }\n else \n {\n $receivedQty =$item->getQtyReceipted(); \n $vOldQty = $item->getProductQty();\n $vProductQty = $this->getRequest()->getPost('product_qty_'.$itemId);\n\n if (!(($vProductQty < $receivedQty) || ($vOldQty < $receivedQty))){ \n $item->setPurchaseOrderId($purchaseOrderId);\n $item->setProductId($this->getRequest()->getPost('product_id_'.$itemId));\n $item->setProductName($this->getRequest()->getPost('product_name_'.$itemId));\n \n //$item->setpop_supplier_ref($this->getRequest()->getPost('pop_supplier_ref_'.$item->getId()));\n \n $item->setProductQty($vProductQty);\n $item->setProductPrice($this->getRequest()->getPost('product_price_'.$itemId));\n $item->setSubtotal($item->getProductQty() * $item->getProductPrice());\n $item->setTotal($item->getSubtotal() + $item->getTax() + $item->getAdjustFee());\n $item->save();\n\n $vendorProduct = Mage::getModel(\"purchase/vendorproduct\")\n ->loadByProductId($order->getVendorId() , $item->getProductId());\n $vendorProduct->setVendorSku($this->getRequest()->getPost('vendor_sku_'.$itemId))\n ->setUnitCost($item->getProductPrice())\n ->save();\n }else {\n Mage::getSingleton('adminhtml/session')->addWarning($this->__('not updated for %s: new qty[%s] less than received qty [%s]', $item->getProductName(), $vProductQty, $receivedQty)); \n $vProductQty = $vOldQty;\n } \n\n } \n //process update qty when order had been send to vendor\n if ((($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY) \n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED))\n && ($vOldQty != $vProductQty)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => $vOldQty,\n 'po_product_qty_new' => $vProductQty));\n\n } \n\n }\n\n\n \n //process information from \"Add product\" tab page, check if we have to add products\n if ($this->getRequest()->getPost('add_product') != '')\n {\n $productsToAdd = Mage::helper('purchase')->decodeInput($this->getRequest()->getPost('add_product'));\n foreach($productsToAdd as $key => $value)\n {\n //retrieves values\n $productId = $key;\n $qty = $value['qty'];\n if ($qty == '')\n $qty = 1;\n \n //add product\n $order->addItems($productId, $qty);\n \n //process update qty when order had been send to vendor\n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $productId, \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $qty));\n\n }\n \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Products added'));\n $tab = 'tab_products';\n $order->resetOrderItems();\n \n }\n \n $orderSubtotal = 0.0000;\n //$orderTotal = 0.0000;\n foreach ($order->getOrderItems() as $item)\n {\n $orderSubtotal += $item->getSubtotal();\n //$orderTotal += $item->getTotal();;\n //Update vendor_product's vendor sku, cost...etc,.\n Mage::dispatchEvent('purchase_order_update_vendor_product', array('po_order_item'=>$item));\n }\n $order->setSubtotal($orderSubtotal)\n ->setTotal($orderSubtotal + $order->getTax() + $order->getAdjustFee() + $order->getShippingPrice())\n ->save();\n \n //Process information from \"send to vendor\" tab page.\n $notifyFlag = $this->getRequest()->getPost('send_to_customer');\n if ($notifyFlag == 1)\n {\n $order->notifyVendor($this->getRequest()->getPost('email_comment'));\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Vendor notified'));\n\n //update Po_qty in stockitem.\n foreach ($order->getOrderItems() as $item)\n {\n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $order->getId(),\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $item->getProductQty()));\n }\n\n }\n \n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED) ){\n Mage::dispatchEvent('purchase_order_refresh_status', \n array('po_order' => $order)); \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Saved'));\n \n $this->_redirect('purchase/orders/edit/po_order_id/'.$order->getOrderId().'/tab/'.$tab);\n \n }", "public static function admin_order_add_custom_meta_data( $data, $wc_order )\n {\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva'));\n\n foreach ( $configs['method_params'] as $method_key => $method_values ) {\n if ( ! $method_values['is_shipping_method'] ) continue;\n if ( $order->omniva->method != $method_values['key'] ) continue;\n\n if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) {\n $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . \": \" . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n }\n\n if ($order->omniva->method) {\n $shipping_settings = OmnivaLt_Core::get_settings();\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $barcode = $order->omniva->barcodes[0];\n $country_code = $shipping_settings['shop_countrycode'];\n $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true);\n $data['omnivalt_barcode'] = $barcode;\n }\n\n return $data;\n }", "public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }", "public function store(AbstractMeta $meta)\n {\n }", "public function saveTrackingPayIn($params,$type = 'bill')\n {\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n switch($type)\n {\n case 'bill':\n default:\n $bill_details = unserialize($params[0]['params']); \n $acc = Mp3music_Api_Cart::getFinanceAccount($bill_details['user_id']); \n foreach ($bill_details['items'] as $item)\n {\n $t = $t_table->createRow();\n $t->transaction_date = $params[0]['date_bill'];\n $t->user_seller = $item['owner_id'] ;\n $t->user_buyer = $bill_details['user_id'];\n $t->item_id = $item['item_id'];\n $t->item_type = $item['type'];\n $t->amount = $item['amount']; \n $t->account_seller_id = $item['account_id']; \n $t->account_buyer_id = $acc['paymentaccount_id']; \n $t->transaction_status = $params[0]['bill_status'];\n $t->params = 'buy';\n $t->save();\n }\n break;\n }\n }", "private function _saveSettings($type)\n {\n $success = true;\n\n // Get all available settings for this type\n $availableSettings = craft()->amSearch_settings->getSettingsByType($type);\n\n // Save each available setting\n foreach ($availableSettings as $setting) {\n // Find new settings\n $newSettings = craft()->request->getPost($setting->handle, false);\n\n if ($newSettings !== false) {\n $setting->value = $newSettings;\n if(! craft()->amSearch_settings->saveSettings($setting)) {\n $success = false;\n }\n }\n }\n\n if ($success) {\n craft()->userSession->setNotice(Craft::t('Settings saved.'));\n }\n else {\n craft()->userSession->setError(Craft::t('Couldn’t save settings.'));\n }\n }", "protected function save_subscription_meta( $order_id, $customer_id ) {\n\t\tupdate_post_meta( $order_id, '_simplify_customer_id', wc_clean( $customer_id ) );\n\t}", "protected function _afterSave(Mage_Core_Model_Abstract $type)\n {\n $attributeSet = $type->getAttributeSet();\n $attributeSetName = $type->getName() . ' {' . $type->getIdentifier() .'}';\n\n if($attributeSet->getAttributeSetName() != $attributeSetName){\n $attributeSet->setAttributeSetName($attributeSetName);\n $attributeSet->save();\n }\n\n return parent::_afterSave($type);\n }", "protected function saveMeta($meta){\r\n\t//System::dump($meta);\r\n\t\r\n\tforeach($meta as $item){\r\n\t\t\r\n\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t}else{\r\n\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t}\r\n\t\t\r\n\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\r\n\t\t$metaEx = $this->metaRowExists((int)$item->row->name);\r\n\r\n\t\tif($this->id==0 || $metaEx==0){\r\n\t\t\t$id_connect = $this->id==0 ? (int)$this->lastInsert: (int)$this->id;\r\n\t\t\t$q = \"INSERT INTO \"._SQLPREFIX_.$this->metaDataTableName.\" (\".$this->metaConnectId.\", id_meta, \".(string)$item->row->attributes()->system_type.\"_value ) VALUES (\";\r\n\t\t\t$q .= \"'\".Db::escapeField($id_connect).\"', '\".(int)$item->row->name.\"'\".\", '\".Db::escapeField($value).\"')\";\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$id_connect = (int)$this->id;\r\n\t\t\t$q = \"UPDATE \"._SQLPREFIX_.$this->metaDataTableName.\" SET \";\r\n\t\t\t$q .= (string)$item->row->attributes()->system_type.\"_value = '\".Db::escapeField($value).\"' WHERE \".$this->metaConnectId.\" = '\".$id_connect.\"' AND id_meta = '\".(string)$item->row->name.\"'\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//echo $q.'<br />'; \r\n\t\tDb::query($q);\r\n\t}\r\n}", "protected function MetaAfterSave() {\n\t\t}", "public function getPaymentType()\n {\n switch ( $this->payment_type ) {\n case Contribution::PAYMENT_CASH:\n return 'cash';\n break;\n case Contribution::PAYMENT_CREDITCARD:\n return 'credit_card';\n break;\n case Contribution::PAYMENT_CHECK:\n return 'check';\n break;\n case Contribution::PAYMENT_TRANSFER:\n return 'transfer';\n break;\n case Contribution::PAYMENT_PAYPAL:\n return 'paypal';\n break;\n case Contribution::PAYMENT_OTHER:\n return 'other';\n break;\n default:\n Analog::log(\n __METHOD__ . ' Unknonw payment type ' . $this->payment_type,\n Analog::ERROR\n );\n throw new \\RuntimeException(\n 'Unknonw payment type ' . $this->payment_type\n );\n }\n\n }", "protected function save_source( $order, $source ) {\n\t\t$this->log('save_source called in Xendit with order ==> ' . print_r($order, true) . 'and source ==> ' . print_r($source, true));\n\n\t\t$order_id = version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->id : $order->get_id();\n\n\t\t// Store source in the order.\n\t\tif ( $source->source ) {\n\t\t\tversion_compare( WC_VERSION, '3.0.0', '<' ) ? update_post_meta( $order_id, '_xendit_card_id', $source->source ) : $order->update_meta_data( '_xendit_card_id', $source->source );\n\t\t}\n\n\t\tif ( is_callable( array( $order, 'save' ) ) ) {\n\t\t\t$order->save();\n\t\t}\n\t}", "public function store($newAddress, $type, $id, $meta)\n {\n if (is_array($newAddress)) {\n $newAddress = json_decode(json_encode($newAddress));\n }\n $address = new Address();\n $address->addressable_type = $type;\n $address->addressable_id = $id;\n $address->address_line_1 = $newAddress->address_line_1;\n $address->address_line_2 = $newAddress->address_line_2;\n $address->city = $newAddress->city;\n $address->state = $newAddress->state;\n $address->pincode = $newAddress->pincode;\n $address->meta = $meta;\n $address->save();\n }", "function getfaircoin_edd_store_custom_fields( $payment_meta ) {\r\n $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? sanitize_text_field( $_POST['edd_fairsaving'] ) : '0';\r\n $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? sanitize_text_field( $_POST['edd_fairaddress'] ) : '';\r\n return $payment_meta;\r\n}", "public function getOrdertype()\n {\n return $this->ordertype;\n }", "public function store(TypeRequest $request)\n {\n\n $createdType = $this->typeRepo->create($request->all());\n if ($createdType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully created!');\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 static function save_order(Model_Order $order, Model_Shopper $shopper, $shopper_branch=array(), $additional_data=array())\n {\n \n ////////// zaznam do db\n \n // cislo zalohove faktury\n\t$order->order_code_invoice = Service_Order::_create_new_invoice_code($order->order_payment_id); \n \n\t$order->order_date \t =date(\"Y-m-d H:i:s\");\n\t$order->order_delivery_date =null; // zatim nepouzivat\n\t$order->order_date_tax \t =null; // zatim nepouzivat\n\t$order->order_date_payment =null; // zatim nepouzivat\n \n $order->order_state_id\t =0; // novy stav se nastavi nakonci teto metody\n \n // veskere vypocty cen se provadi v metode \"generate_order_prices\", v tomto okamziku je ma jiz objekt \"$order\" nasetovane (vyvolano v kontroleru)\n // ...\n \n // definitivne vyridime slevovy kupon \n \n if($order->order_voucher_id)\n {\n Service_Voucher::use_voucher($order->order_voucher_id);\n }\n \n $order->order_shopper_id =$shopper->id;\n\t$order->order_shopper_branch =isset($shopper_branch[\"branch_id\"])?$shopper_branch[\"branch_id\"]:null;;\n\t$order->order_shopper_name =$shopper->nazev;\n\t$order->order_shopper_code =$shopper->kod;\n\t$order->order_shopper_email =$shopper->email;\n\t$order->order_shopper_phone =$shopper->telefon;\n\t$order->order_shopper_ic =$shopper->ic;\n\t$order->order_shopper_dic =$shopper->dic;\n\t$order->order_shopper_street =$shopper->ulice;\n\t$order->order_shopper_city =$shopper->mesto;\n\t$order->order_shopper_zip =$shopper->psc;\n $order->order_shopper_note =!empty($additional_data[\"shopper_note\"])?$additional_data[\"shopper_note\"]:\"\";\n $order->order_shopper_custommer_code =!empty($additional_data[\"customer_order_code\"])?$additional_data[\"customer_order_code\"]:\"\";\n $order->gift_box_code =!empty($additional_data[\"gift_box_code\"])?$additional_data[\"gift_box_code\"]:\"\";\n\n // nacteme data pro zvolenou pobocku\n $order->order_branch_name =isset($shopper_branch[\"nazev\"])?$shopper_branch[\"nazev\"]:null;\n\t$order->order_branch_code =isset($shopper_branch[\"kod\"])?$shopper_branch[\"kod\"]:null;\n\t$order->order_branch_street =isset($shopper_branch[\"ulice\"])?$shopper_branch[\"ulice\"]:null;\n\t$order->order_branch_city =isset($shopper_branch[\"mesto\"])?$shopper_branch[\"mesto\"]:null;\n\t$order->order_branch_zip =isset($shopper_branch[\"psc\"])?$shopper_branch[\"psc\"]:null;\n\t$order->order_branch_phone =isset($shopper_branch[\"telefon\"])?$shopper_branch[\"telefon\"]:null;\n\t$order->order_branch_email =isset($shopper_branch[\"email\"])?$shopper_branch[\"email\"]:null;\n\n $order->last_modified =date(\"Y-m-d H:i:s\");\n \n if($order->order_total_with_vat==0) die(\"chyba, objednávka neobsahuje žádné zboží!\");\n \n $order_id=$order->save()->id;\n \n \n // nyni vim id vlozeneho zaznamu - muzu doplnit kod objednavky shopper_id-order_id (000000-000000)\n $order->order_code = Service_Order::_create_new_order_code($shopper->kod, $order_id);\n $order->save();\n\n $cart_data=$order->get_cart()->get_cart_products(); // ziskam zbozi z kosiku pridruzeneho k objednavce\n \n foreach($cart_data as $item){\n // $key = product_id\n\n $order_item=orm::factory(\"order_item\");\n // naplneni order itemu\n $order_item->code =$item[\"code\"];\n $order_item->nazev =$item[\"nazev\"];\n //$order_item->varianta_popis =$item[\"varianta\"][\"barva_velikost\"];\n //$order_item->varianta_id =$item[\"varianta\"][\"id\"];\n $order_item->jednotka =$item[\"jednotka\"];\n $order_item->hmotnost =$item[\"hmotnost\"];\n $order_item->pocet_na_sklade =$item[\"pocet_na_sklade\"];\n $order_item->min_order_quantity =$item[\"min_order_quantity\"];\n $order_item->tax_code =$item[\"tax_code\"];\n $order_item->order_id =$order_id;\n $order_item->product_id =$item[\"id\"];\n $order_item->units =$item[\"mnozstvi\"];\n $order_item->price_without_tax =$item[\"cena_bez_dph\"];\n $order_item->price_with_tax =$item[\"cena_s_dph\"];\n $order_item->total_price_with_tax =$item[\"cena_celkem_s_dph\"];\n $order_item->item_change =null;\n $order_item->total_weight =$item[\"hmotnost\"] * $item[\"mnozstvi\"];\n\n $order_item->save();\n }\n \n // nastavim priznak objednavky - pri prvnim ulozeni nebudu posilat mail se zmenou stavu\n Service_Order::set_order_state($order, \"new\", false);\n \n return $order;\n }", "public function takePayment() {\r\n if ($this->payment instanceof PayPal) {\r\n $this->payment->payByPayPal();\r\n }elseif ($this->payment instanceof SagePay) {\r\n $this->payment->payBySagePay();\r\n } elseif ($this->payment instanceof WorldPay) {\r\n $this->payment->payByWorldPay();\r\n }\r\n }", "public function saveAction()\n {\n $field = '';\n $this->_initOrder();\n if (Mage::registry('current_order')->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId()) {\n $this->getResponse()->setBody('Error');\n exit;\n }\n\n /*\n * decide what form submitted: product field || order field\n * product fields have field names like: \"amProduct_%orderItemID%_%fieldID%\"\n */\n $productSubmit = strpos($this->getRequest()->getPost('field'), 'amProduct_') !== FALSE ? 1 : 0;\n // process product fields\n if ($productSubmit) {\n // extract all data from POST (stored value like \"xyz_orderItemID_FieldCode\"\n $itemData = explode('_', $this->getRequest()->getPost('field'), 3);\n $itemId = $itemData[1];\n $code = $itemData[2];\n\n // load product item data\n $fieldModel = Mage::getModel('amorderattach/field')->load($code, 'code');\n $field = Mage::getModel('amorderattach/order_products')->load($itemId, 'order_item_id');\n\n if ($fieldModel->getId()) {\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderItemId()) {\n $field->setOrderItemId($itemId);\n }\n\n $this->itemCode = $fieldModel->getItemCode($itemId);\n } else {\n die('Error on filed load: no such field found');\n }\n } else {\n $fieldModel = Mage::getModel('amorderattach/field')->load($this->getRequest()->getPost('field'), 'code');\n if ($fieldModel->getId()) {\n // load order item data\n $field = Mage::getModel('amorderattach/order_field')->load(Mage::registry('current_order')->getId(), 'order_id');\n $code = $this->getRequest()->getPost('field');\n $this->itemCode = $code;\n\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderId()) {\n $field->setOrderId(Mage::registry('current_order')->getId());\n }\n } else {\n die('Error on filed load: no such field found');\n }\n }\n\n if ('date' == $code) {\n if ($this->getRequest()->getPost('value')) {\n $data = $this->getRequest()->getPost();\n $valueToFilter = $this->_filterDates($data, array('value'));\n $itemValue = date('Y-m-d', strtotime($valueToFilter['value']));\n } else {\n $itemValue = null;\n }\n } else {\n $itemValue = $this->getRequest()->getPost('value');\n }\n // set data\n $this->itemValue = $itemValue;\n $field->setData($code, $itemValue);\n\n // save if customer can edit\n if ('edit' == $fieldModel->getCustomerVisibility()) {\n $field->save();\n } else {\n die('Error on field save: no privileges for action');\n }\n\n\n Mage::register('current_attachment_order_field', $field); // required for renderer\n $this->_sendResponse($fieldModel);\n }", "public function save()\n {\n Session::clear(\"Checkout.PostageID\");\n \n // Extend our save operation\n $this->extend(\"onBeforeSave\");\n\n // Save cart items\n Session::set(\n \"Checkout.ShoppingCart.Items\",\n serialize($this->items)\n );\n\n // Save cart discounts\n Session::set(\n \"Checkout.ShoppingCart.Discount\",\n serialize($this->discount)\n );\n\n // Update available postage\n if ($data = Session::get(\"Form.Form_PostageForm.data\")) {\n $country = $data[\"Country\"];\n $code = $data[\"ZipCode\"];\n $this->setAvailablePostage($country, $code);\n }\n }" ]
[ "0.68446", "0.6783925", "0.65708745", "0.6372279", "0.63717794", "0.62204", "0.59535474", "0.5928842", "0.59159106", "0.58887404", "0.5867555", "0.5857349", "0.58248395", "0.58171946", "0.57976013", "0.57749295", "0.576518", "0.57424295", "0.572545", "0.57175356", "0.56757087", "0.5668441", "0.5664208", "0.56570315", "0.563383", "0.5627589", "0.56229836", "0.5581654", "0.5567734", "0.551379", "0.55107486", "0.549923", "0.5489781", "0.5485043", "0.548299", "0.5481435", "0.5479788", "0.5464582", "0.5453152", "0.5450505", "0.54370165", "0.5409389", "0.54066575", "0.54063797", "0.54043925", "0.539684", "0.5387212", "0.5385084", "0.5379853", "0.53785485", "0.5369591", "0.53638417", "0.53551334", "0.5354619", "0.53494287", "0.53482413", "0.5347369", "0.5331182", "0.5331165", "0.5330939", "0.5330421", "0.52734846", "0.52710485", "0.5270988", "0.52661777", "0.52661675", "0.52543956", "0.5246797", "0.5236834", "0.5234779", "0.5233971", "0.52321196", "0.52315193", "0.52314156", "0.5225868", "0.5225755", "0.52125746", "0.5202901", "0.52026176", "0.5201858", "0.51965314", "0.5182053", "0.5173981", "0.51640874", "0.5159523", "0.515735", "0.5152061", "0.5151065", "0.5147127", "0.51461244", "0.5141458", "0.5133217", "0.5130373", "0.51279527", "0.5121414", "0.51156974", "0.51155305", "0.5112526", "0.5108472", "0.5106578" ]
0.7472435
0
Output for the order received page.
public function thankyou_page( $order_id ) { $order = wc_get_order( $order_id ); if ( $this->instructions ) { echo wpautop( wptexturize( $this->instructions ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public static function output()\n\t{\n\t\t$transaction_id = ( isset( $_GET['transaction'] ) ) ? $_GET['transaction'] : NULL;\n?>\n\t\t<div class=\"wrap\">\n<?php\n\t\tif( $transaction_id != NULL ):\n\t\t\t// Output client transactions details\n\t\t\tself::pxp_client_transaction_details( $transaction_id );\n\t\telse:\n\t\t\t// Output client transactions list.\n\t\t\tself::pxp_client_transactions_list();\n\t\tendif;\n?>\n\t\t</div>\n<?php\n\t}", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "public function printOut() {\n $this->_controller->getResponse()->printOut();\n }", "function output() {\n if (isset($this->status)) {\n $this->send_header(sprintf('HTTP/1.1 %d %s',\n $this->status, $this->reason),\n TRUE,\n $this->status);\n }\n\n foreach ($this->headers as $k => $v) {\n $this->send_header(\"$k: $v\");\n }\n\n echo $this->body;\n }", "function receipt_page( $order ) {\n\n\t\t\techo '<p>'. __( 'Thank you for your order, please click the button below to pay with eSewa.', 'esewa-payment-gateway-for-woocommerce' ) . '</p>';\n\t\t\techo $this->generate_esewa_form( $order );\n\n\t\t}", "public static function geoCart_process_orderDisplay()\n {\n //use to display some success/failure page, if that applies to this type of gateway.\n\n\n //build response for user\n $cart = geoCart::getInstance();\n $db = DataAccess::getInstance();\n $messages = $db->get_text(true, 180);\n\n $tpl = new geoTemplate('system', 'payment_gateways');\n $tpl->assign($cart->getCommonTemplateVars());\n $tpl->assign('page_title', $messages[3142]);\n $tpl->assign('page_desc', $messages[3143]);\n $tpl->assign('success_failure_message', $messages[3167]);\n $tpl->assign('my_account_url', $db->get_site_setting('classifieds_file_name') . '?a=4&amp;b=3');\n $tpl->assign('my_account_link', $messages[3169]);\n\n $invoice = $cart->order->getInvoice();\n if (is_object($invoice) && $invoice->getId()) {\n $tpl_vars['invoice_url'] = geoInvoice::getInvoiceLink($invoice->getId(), false, defined('IN_ADMIN'));\n }\n\n $html = $tpl->fetch('shared/transaction_approved.tpl');\n $cart->site->body .= $html;\n $cart->site->display_page();\n\n return $html;\n }", "public function readordersAction()\n {\n $this->getResponse()->setBody(self::getHelper()->readorders());\n\n }", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "public function output()\n {\n $data = $this->model->data;\n $message = $this->model->message;\n require_once $this->model->template;\n }", "private function generate()\n\t{\n\t\t$printer = require_once __DIR__ . '/Printer.php';\n\t\t$orders = $this->get_waiting_orders();\n\t\t\n\t\t$printer->setup($this);\n\n\t\t/*foreach ($orders as $order) {\n\t\t\t$printer->add($order);\n\t\t}*/\n\n\t\t$printer->output();\n\t}", "public function HandlePage()\n\t\t{\n\t\t\t$this->SetOrderData();\n\n\t\t\t$action = \"\";\n\t\t\tif(isset($_REQUEST['action'])) {\n\t\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t\t}\n\n\t\t\tswitch($action) {\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->FinishOrder();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function actionGetOut($order_id=999)\n {\n $obj = $this->c->getOrderObj($order_id);\n \n $ret = '';\n if ($obj) {\n foreach ($obj->houseContract->contracts as $contract)\n $ret .= $contract->getContractText();\n } else {\n echo 'no obj ';\n }\n $ret = iconv('utf-8', 'gbk', $ret);\n print_r($ret);\n echo 'job done!';\n }", "function receipt_page( $order ) {\n\t\terror_reporting(E_ERROR);\n\t\tini_set('display_errors', 1);\n\n\t\techo '<p>'.__( 'Спасибо за ваш заказ. Нажмите кнопку, для перехода к оплате через Твои Платежи.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_payu_form( $order );\n\n\t}", "function exchanger_order_info_shortcode() {\n ob_start();\n exchanger_order_info_function();\n return ob_get_clean();\n}", "public function createPage()\n {\n echo $this->output;\n }", "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 }", "protected function OnOutput()\n\t{\n\t\t$vars = array('title' => $this->title, 'content' => $this->content,'user' => $this->user,'scripts' => $this->scripts,'categories' => $this->categories);\n\t\t$page = $this->Template('view/tpl_main.php', $vars);\n\t\techo $page;\n\t}", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "public function send(){\n\t\t\n\t\texit($this->page->generate());\n\t}", "public function outputBody()\n {\n $body = implode('', $this->_body);\n echo $body;\n }", "public function printing_orders()\n {\n \t$arr_agent = [];\n\n $obj_agent = $this->AgentModel->where('status','=','1')->get();\n\n if($obj_agent)\n\n {\n\n $arr_agent = $obj_agent->toArray();\n\n\t\t}\n\n\t\t$this->arr_view_data['page_title'] = \"Manage \".$this->module_title;\n $this->arr_view_data['parent_module_icon'] = \"fa fa-home\";\n $this->arr_view_data['parent_module_title'] = \"Dashboard\";\n $this->arr_view_data['parent_module_url'] = url('/').'/admin/dashboard';\n $this->arr_view_data['module_icon'] = $this->module_icon;\n $this->arr_view_data['module_title'] = \"Manage \".$this->module_title;\n\t\t$this->arr_view_data['module_url_path'] = $this->module_url_path;\n\t\t$this->arr_view_data['admin_url_path'] = $this->admin_url_path;\n\t\t$this->arr_view_data['admin_panel_slug'] = $this->admin_panel_slug;\n\t\t$this->arr_view_data['arr_agent'] = $arr_agent;\n\t\t\n\t\treturn view($this->module_view_folder.'.printing_orders',$this->arr_view_data);\n }", "public function orderPrint()\n \t {\n\n\t\t$data['country']=$this->Inventory_stock_model->companyDetails();\n\t\t$data['orderdetails']=$this->Inventory_stock_model->getInventory();\n\t\t\n\t ob_start();\n\t $html=ob_get_clean();\n\t $html=utf8_encode($html);\n\t //$html=$this->load->view('report/list_vehicle','',TRUE);\n\t $html=$this->load->view('reports/inventory_print',$data,TRUE);\n\t require_once(APPPATH.'third_party/mpdf60/mpdf.php');\n\t \n\t $mpdf=new mPDF();\n\t $mpdf->allow_charset_conversion=true;\n\t $mpdf->charset_in='UTF-8';\n\t $mpdf->WriteHTML($html);\n\t $mpdf->output('meu-pdf','I');\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public static function geoCart_process_orderDisplay()\n {\n $cart = geoCart::getInstance();\n\n self::_successFailurePage(true, $cart->order->getStatus(), true, $cart->order->getInvoice());\n\n //send email to admin if he wants it\n if ($cart->db->get_site_setting('user_set_hold_email')) {\n //echo $item_sell_class->db->get_site_setting('user_set_hold_email').\" is the setting for hold email<br />\";\n //echo \"email should be sent for ad on hold<br />\";\n $subject = \"An order has been placed!!\";\n $message = \"Admin,\\n\\n\";\n $message .= \"An order has been placed and is on hold because a \" . self::gateway_name . \" type was chosen. See the unapproved orders section of the admin.\\n\\n\";\n $message .= \"Additional orders may be in the unapproved ads section that you were not sent an email. These will be failed auto pay attempts or if you are approving all ads.\\n\\n\";\n geoEmail::sendMail($cart->db->get_site_setting('site_email'), $subject, $message);\n }\n\n //gateway is last thing to be called, so it needs to be the one that clears the session...\n $cart->removeSession();\n }", "private function __print_receipt()\n {\n\t//Assuming range\n\t$ret = $this->__view_receipt();\n\t$receipthead = $this->__receipt_head_html();\n\t$receiptfoot = $this->__receipt_foot_html();\n\t\n\t$receipts = $receipthead. sprintf(\"\n\t<div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t\n\t\", $ret, $ret, $ret, $ret, $ret, $ret).$receiptfoot;\n\t\n\techo $receipts;\n }", "public function output($pgen,$brotherid) {\n\tglobal $qqs,$qqi,$qqu;\n\n\t$pm=new mod_prodmain;\n\t$pi=new mod_prodinfo;\n\t\n\t$idorder=False;\n\tif (($idorder=$pgen->getPageExtra()) == '') {\n\t\t$idorder=ec_prodorder::getUnshippedOrderId(False);\n\t}\n\tif ($idorder === False) {\n\t\techo '<p>No unfilled orders</p>';\n\t\treturn;\n\t}\n\tlist($cust,$order,$timestamp,$email,$via,$tracking,$name,$zip)=ec_prodorder::infoFromId($idorder);\n\t$shiptype=$cust->getPreferredShipping();\n\t$shipdesc=$order->getAllShippingOptions();\n\t$shipopts=$order->getShippingOptions($cust);\n\t\n\techo \"<div{$qqi->idcstr($this->longname)}>\";\n\n\t$form=$this->makeform();\n\n\n\techo \"<h2>\";\n\tif (False !== ($idnext=ec_prodorder::getUnshippedOrderId(True,$idorder)))\n\t\techo link::anchorHTML(\"orderdetail/$idnext\",'Previous unshipped order').\"[<<< prev]</a>&nbsp;&nbsp;&nbsp;\";\n\techo \"Order Number $idorder made on \".date('l jS \\of F Y h:i:s A',$timestamp);\n\tif (False !== ($idprev=ec_prodorder::getUnshippedOrderId(False,$idorder)))\n\t\techo '&nbsp;&nbsp;&nbsp;'.link::anchorHTML(\"orderdetail/$idprev\",'Next unshipped order').\"[next >>>]</a>\";\n\techo '</h2>';\n\t$instructions=nl2br(trim($order->getSpecialInstructions()));\n\tif (strlen($instructions)) {\n\t\techo \"<table><tr><th>Special Instructions</th></tr><tr><td>$instructions</td></tr></table><br />\";\n\t}\n\t\n\t$lines=$order->getOrderArray(False);\n\t$subtotal=0;\n\tforeach ($lines as $litem) {\n\t\t$subtotal += $litem[4];\n\t}\n\t$showsubtotal=sprintf('%1.2f',$subtotal/100);\n\n\t// patch for peach basket special\n\tif ($subtotal > 3500) {\n\t\t$newshipopts=array();\n\t\tforeach ($shipopts as $shiptype=>$cost)\n\t\t\t$newshipopts[$shiptype]=0;\n\t\t$shipopts=$newshipopts;\t\n\t}\n\t\t\n\t$tax=$order->calculateTax($cust);\n\t$showtax=sprintf('%1.2f',$tax/100);\n\t$showshipping=sprintf('%1.2f',$shipopts[$shiptype]/100);\n\t$showtotal=sprintf('%1.2f',($tax+$shipopts[$shiptype]+$subtotal)/100);\n\t\n\techo \"<table><tr><th>Email</th><th>Bill to</th><th>Payment</th><th style=\\\"text-align:right\\\">Totals</th></tr>\";\n\techo \"<tr><td>{$cust->getEmail()}</td><td>{$this->getShippingAddress($cust,0,$bGift)}</td><td>{$cust->getActiveCreditCard()->output3(False)}<br />CV: <span id=\\\"zcv\\\">{$order->getExtra('cv')}</span></td>\";\n\techo \"<td style=\\\"text-align:right\\\">Total Products: $showsubtotal<br />Tax: $showtax<br />Shipping: $showshipping<br />Total: $showtotal</td></tr>\";\n\techo \"</table><br />\";\n\n\techo '<table><tr><th>Qty</th><th>Item</th><th>Unit Price</th><th>Disc.</th><th>Amount</th></tr>';\n\tforeach ($lines as $litem) {\n\t\tlist($qty,$prodid,$baseprice,$discount,$subtotal)=$litem;\n\t\t$info=$pi->getProdInfo($prodid);\n\t\t$maininfo=$pm->getProductInfo($prodid);\n\t\t$title=$qqu->creolelite2html($info['title']);\n\t\t$upc=trim($maininfo['barcodes'][0]);\n\t\techo \"<tr><td>$qty</td><td>{$info['mfr']}: $title<br />UPC: <span id=\\\"za$prodid\\\">$upc</span> <input id=\\\"zb$prodid\\\" type=\\\"text\\\" size=\\\"20\\\" maxlength=\\\"20\\\" /> <span id=\\\"zc$prodid\\\">&nbsp;</span></td>\";\n\t\t$baseprice=sprintf('%1.2f',$baseprice/100);\n\t\t$discount=sprintf('%1.2f',$discount/100);\n\t\t$subtotal=sprintf('%1.2f',$subtotal/100);\n\t\techo \"<td style=\\\"text-align:right\\\">$baseprice</td><td style=\\\"text-align:right\\\">$discount</td><td style=\\\"text-align:right\\\">$subtotal</td></tr>\";\n\t}\n\techo '</table><br />';\n\n\techo '<table><tr><th>Shipping Address</th><th>Shipping Method</th><th>Shipping Status</th></tr>';\n\t$idaddr=$cust->useShippingAddress();\n\techo \"<tr><td>{$this->getShippingAddress($cust,$idaddr,$bGift)}\";\n\tif ($bGift && False !== ($giftmsg=$order->getExtra('giftnote'))) {\n\t\techo \"<br /><br /><h3>Gift Message:</h3>$giftmsg\";\n\t}\n\tif ($via == '(not shipped)')\n\t\t$via=ec_prodorder::getTrackingURL($shiptype);\n\techo \"</td><td>{$shipdesc[$shiptype]}</td><td>Shipped via:<br /><input type=\\\"text\\\" name=\\\"via\\\" value=\\\"$via\\\" size=\\\"60\\\" maxlength=\\\"60\\\" /><br />Tracking Number:<br /><input type=\\\"text\\\" name=\\\"tracking\\\" value=\\\"$tracking\\\" size=\\\"30\\\" maxlength=\\\"30\\\" /><br /><br /><input id='zsetship' name=\\\"ok\\\" type=\\\"button\\\" value=\\\"Set Shipping\\\" />\";\n\t\t\n\techo \"</div>\";\n\t\t\t\n\n}", "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 }", "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}", "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 wtsDisplayOrder($ar){\n $p = new XParam($ar, array());\n $orderoid = $p->get('orderoid');\n $r = $this->displayOrder($orderoid);\n return XShell::toScreen1('br', $r);\n }", "public function displayContent()\n\t{\n\t\t$id_order = (int)Tools::getValue('id_order');\n\t\t$order = PayPalOrder::getOrderById($id_order);\n\t\t$price = Tools::displayPrice($order['total_paid'], $this->context->currency);\n\t\t\n\t\t$this->context->smarty->assign(array(\n\t\t\t'order' => $order,\n\t\t\t'price' => $price\n\t\t));\n\n\t\techo $this->context->smarty->fetch(_PS_MODULE_DIR_.'/paypal/views/templates/front/order-confirmation.tpl');\n\t}", "public function main() {\n $this->content['html'] = '';\n\n if(empty($this->customer['id'])) {\n $this->response['error'][] = $this->locale['ERR_4002'];\n $this->response['logout'] = 1;\n return false;\n }\n\n $items = $this->orderModel->get($this->customer['id'], $this->language['id']);\n\n $orders = '';\n if($items) {\n $orders = $this->htmlOrders($items);\n }\n\n $this->template->set( $this->tplPath . 'main.html');\n\n $tplVars = [\n 'STR_INVOICE' => $this->locale['STR_INVOICE'], \n 'STR_ORDER_DATE' => $this->locale['STR_ORDER_DATE'], \n 'STR_PRICE' => $this->locale['STR_PRICE'], \n 'STR_DETAILS' => $this->locale['STR_DETAILS'], \n 'STR_STATUS' => $this->locale['STR_STATUS'], \n 'STR_ACTIONS' => $this->locale['STR_ACTIONS'], \n 'STR_MY_ORDERS' => $this->locale['STR_MY_ORDERS'], \n 'TXT_MY_ORDERS' => $this->locale['TXT_MY_ORDERS'], \n 'STR_MY_PROFILE' => $this->locale['STR_MY_PROFILE'], \n 'LINK_PROFILE' => $this->links['profile'],\n 'LINK_ORDERS' => $this->links['orders'],\n 'ITEMS' => $orders, \n 'HIDDEN' => $orders == '' ? ' hidden' : ''\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content['html'] = $this->template->parse();\n $this->response['status'] = $this->statusSuccess;\n }", "public function outputStatus()\n {\n if ($this->responseStatus instanceof ResponseStatus) {\n header(sprintf('HTTP/1.1 %d %s', $this->responseStatus->httpStatusCode, $this->responseStatus->httpStatusMessage));\n }\n echo $this->body;\n }", "public function sendResponseBody()\n\t{\n\t\t$layoutTemplate = $this->getLayoutTemplate();\n\n\t\t$layoutTemplate['document'] = $this;\n\t\t$layoutTemplate['title'] = $this->getTitle();\n\t\t$layoutTemplate['content'] = $this->getContent();\n\n\t\t$pageHtml = $layoutTemplate->getOutput();\n\n\t\techo $pageHtml;\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 }", "public function outputBody()\r\n\t{\r\n\t\t$this->header();\r\n\t\tparent::outputBody();\r\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 output() {\n\n if ( $this->field['enqueue_frontend'] ) {\n\n }\n \n }", "public function render()\n\t{\n\t\t$this->printer->render();\n\t}", "public function receipt()\n\t{\n\t\t\n\t\t$this->templateFileName = 'receipt.tpl';\n\t\t\n\t\tif (!isset($_REQUEST['orderID']))\n\t\t{\n\t\t\tthrow new \\Exception(\"Incorrect parameters\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t// Get the order data\n\t\t\t$order = $this->dbConnection->prepareRecord(\"SELECT o.order_id, DATE_FORMAT(o.order_timestamp, '%W, %M %D, %Y') AS order_timestamp, r.description AS order_status, subtotal, tax, shipping, total, user_id, shipping_address_id, billing_address_id, payment_id FROM b_order o INNER JOIN b_reference r ON o.order_status = r.data_value AND r.data_member = 'ORDER_STATUS' WHERE order_id = ?\", $_REQUEST['orderID']);\n\t\t\t\n\t\t\t// Make sure the order is for the current user\n\t\t\tif ($order['user_id'] != $this->session->userID)\n\t\t\t{\n\t\t\t\tthrow new \\Exception(\"The order is for another user.\");\n\t\t\t}\n\n\t\t\t// Get the order lines\n\t\t\t$order_items = $this->dbConnection->prepareRecordSet(\"SELECT oi.order_id, oi.item_id, oi.item_sequence, oi.quantity, oi.price, oi.extended_price, oi.line_status, i.item_name, i.item_description, i.image_url, i.thumb_url, i.price, i.isbn, i.author, i.category_id FROM b_order_item oi INNER JOIN b_item i ON oi.item_id = i.item_id WHERE oi.order_id = ? ORDER BY oi.item_sequence\", $_REQUEST['orderID'] );\n\t\t\t\n\t\t\t// Get the addresses\n\t\t\t$shipping_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['shipping_address_id']);\n\t\t\t$billing_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['billing_address_id']);\n\t\t\t$payment_method = $this->dbConnection->prepareRecord(\"SELECT payment_id, payment_type, credit_card_type, payment_name, RIGHT(account_number, 4) AS account_number_last_4, LPAD(RIGHT(account_number, 4), LENGTH(account_number), 'X') AS account_number, card_expiration_month, card_expiration_year, rp.description AS payment_type_description, rc.description AS credit_card_type_description FROM b_payment INNER JOIN b_reference rp ON rp.data_member = 'PAYMENT_TYPE' AND rp.data_value = payment_type LEFT OUTER JOIN b_reference rc ON rc.data_member = 'CREDIT_CARD_TYPE' AND rc.data_value = credit_card_type WHERE payment_id = ?\", $order['payment_id']);\n\t\t\t\n\t\t\t$this->set('order', $order);\n\t\t\t$this->set('order_items', $order_items);\n\t\t\t$this->set('shipping_address', $shipping_address);\n\t\t\t$this->set('billing_address', $billing_address);\n\t\t\t$this->set('payment_method', $payment_method);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function ajaxProcessPrintLabel()\n {\n $this->ajax = true;\n $id_order = (int)Tools::getValue('id_order');\n $order = new Order($id_order);\n\n if (!Validate::isLoadedObject($order)) {\n exit('Order not exists');\n }\n\n return $this->printLabel($id_order);\n }", "public function render()\n\t{\n\t\techo $this->export();\n\t}", "private function printTale()\n {\n if ($this->version == self::Turbo) {\n echo '</channel>' . PHP_EOL . '</rss>';\n } else if ($this->version == self::AMP || $this->version == self::Telegram) {\n echo '</body>' . PHP_EOL . '</html>';\n }\n\n }", "function theme_uc_product_content_show_order($node) {\n //dsm($node);\n \n $ret = '<div class=\"field\"><div class=\"field-label\">Invoice:</div>';\n $ret .= '<div class=\"field-items\">';\n $ret .= uc_order_load_invoice($node->order);\n $ret .= '</div></div>';\n \n return $ret;\n}", "public function print(){\n echo $this->output;\n }", "public function output() {}", "public function send()\n\t{\n\t\t$this->page->generatePage();\n\t\texit;\n\t}", "public function actionOrder($order_id=999)\n {\n \n $obj = $this->c->getOrderObj($order_id);\n //$data = $obj->houseContract->contracts[0]->getTemplate();\n if (!$obj->houseContract) {\n echo 'none houseContract obj!';\n }\n $arr = $obj->houseContract->contracts;\n foreach ($arr as $o) {\n $str = \"[tpl_id={$o->id}][tpl_name={$o->name}]===========>\\n\";\n $data = $o->getContractText();\n if (in_array(PHP_OS, array('windows', 'WINNT'))) {\n $str = iconv('utf-8', 'gbk', $str);\n $data = iconv('utf-8', 'gbk', $data);\n }\n echo $str;\n print_r($data);\n echo \"\\n\";\n }\n echo 'job done!';\n }", "public function woocommerce_order_review_end() {\n\t\t\techo '</div>';\n\t\t}", "public function printOut() {\n\t\t$html = new Html(\"\");\n\t\t$html->printTeamOut($this->challengeId, $this->challengeName, $this->challengeAmount);\n\t}", "final public function output(): void {\n\t\techo $this->html();\n\t}", "protected function _output($data) {}", "public function getResponseOutput() {\n // Empty, to be overridden\n }", "function debug_output() {\n\t\tglobal $ac_tos_response, $ac_status_response;\n\t\t$response = 'tos' == $_GET['ac_debug'] ? $ac_tos_response : $ac_status_response;\n\t\tif ( empty( $response ) ) {\n\t\t\t$response = 'No response from API :(';\n\t\t} else {\n\t\t\t$response = print_r( $response, 1 );\n\t\t}\n\n\t\t$tos = $this->get_option( 'tos' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$status = $this->get_option( 'wordads_approved' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$house = $this->get_option( 'wordads_house' ) ? 'Yes' : 'No';\n\n\t\t$type = $this->get_option( 'tos' ) && $this->get_option( 'wordads_approved' ) ?\n\t\t\t'updated' :\n\t\t\t'error';\n\n\t\techo <<<HTML\n\t\t<div class=\"notice $type is-dismissible\">\n\t\t\t<p>TOS: $tos | Status: $status | House: $house</p>\n\t\t\t<pre>$response</pre>\n\t\t</div>\nHTML;\n\t}", "public function output() {\n }", "public function render()\n {\n $myConfig = $this->getConfig();\n parent::render();\n\n $oOrder = oxNew(\"oxOrder\");\n $oCur = $myConfig->getActShopCurrencyObject();\n $oLang = oxRegistry::getLang();\n\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder->load($soxId);\n\n $this->_aViewData[\"edit\"] = $oOrder;\n $this->_aViewData[\"aProductVats\"] = $oOrder->getProductVats();\n $this->_aViewData[\"orderArticles\"] = $oOrder->getOrderArticles();\n $this->_aViewData[\"giftCard\"] = $oOrder->getGiftCard();\n $this->_aViewData[\"paymentType\"] = $this->_getPaymentType($oOrder);\n $this->_aViewData[\"deliveryType\"] = $oOrder->getDelSet();\n $sTsProtectsField = 'oxorder__oxtsprotectcosts';\n if ($oOrder->$sTsProtectsField->value) {\n $this->_aViewData[\"tsprotectcosts\"] = $oLang->formatCurrency($oOrder->$sTsProtectsField->value, $oCur);\n }\n }\n\n // orders today\n $dSum = $oOrder->getOrderSum(true);\n $this->_aViewData[\"ordersum\"] = $oLang->formatCurrency($dSum, $oCur);\n $this->_aViewData[\"ordercnt\"] = $oOrder->getOrderCnt(true);\n\n // ALL orders\n $dSum = $oOrder->getOrderSum();\n $this->_aViewData[\"ordertotalsum\"] = $oLang->formatCurrency($dSum, $oCur);\n $this->_aViewData[\"ordertotalcnt\"] = $oOrder->getOrderCnt();\n $this->_aViewData[\"afolder\"] = $myConfig->getConfigParam('aOrderfolder');\n $this->_aViewData[\"alangs\"] = $oLang->getLanguageNames();\n\n $this->_aViewData[\"currency\"] = $oCur;\n\n return \"order_overview.tpl\";\n }", "public function output() {\n\t\tswitch($this->output) {\n\t\t\tcase 'php':\n\t\t\tdefault:\n\t\t\t\t$this->_php_gen_feed();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'js':\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}", "public function loadMoreOrderAction() {\n $block = Mage::getBlockSingleton('webpos/orderlist');\n $this->getResponse()->setBody(json_encode($block->toHtml()));\n }", "function plgVmonShowOrderPrint ($order_number, $method_id) {\n\t\treturn $this->onShowOrderPrint ($order_number, $method_id);\n\t}", "public function actionDisplayOrder()\n\t{\n\t\t$order = $this->_input->filterSingle('order', XenForo_Input::ARRAY_SIMPLE);\n\t\t\n\t\t$this->_assertPostOnly();\n\t\t$this->_getFieldModel()->massUpdateDisplayOrder($order);\n\t\t\n\t\treturn $this->responseRedirect(\n\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\tXenForo_Link::buildAdminLink('smilies')\n\t\t);\n\t}", "public function output($pgen,$brotherid) {\n\tglobal $qqs,$qqi;\n\t\n\t$transaction=$this->transaction;\n\t\n\tswitch ($this->state) {\n\t\tcase 'collecting':\n\t\tcase '':\n\t\t\t$form=$this->makeForm();\n\t\t\tif ($transaction != 0) {\n\t\t\t\t$vals=$qqs->getTransactionData($transaction,\"vals\");\n\t\t\t\t$form->setValueArray($vals);\n\t\t\t\t$transactiondata=(string)$transaction;\n\t\t\t} else\n\t\t\t\t$transactiondata=0;\t\n\t\t\techo $form->getDumpStyleFormOutput('collecting',$transactiondata);\n\t\tbreak;\n\t\tcase 'confirming':\n\t\t\tif ($transaction == 0)\n\t\t\t\tthrow new exception(\"expected transaction not present\");\n\t\t\t// make certain that enough has been done that the email will make sense\n\t\t\t$vals=$qqs->getTransactionData($transaction,\"vals\");\n\t\t\textract($vals);\n\t\t\t// extremely rudimentary data filtering:\n\t\t\t$bForwardOK=(isset($name) && trim($name) != \"\" && ((isset($email) && trim($email) != \"\") || (isset($mail) && trim($mail) != \"\") || (isset($phone) && trim($phone) != \"\")));\n\t\t\t\n\t\t\t$message=$this->makemessage($vals);\n\t\t\t$form=$this->makeforwardbackform($bForwardOK);\n\t\t\t\n\t\t\techo $form->getOutputFormStart();\n\t\t\techo \"<h3{$qqi->cstr(\"proj_hcgemail\")}>Here is the message you will send:</h3>\";\n\t\t\techo \"<p{$qqi->cstr(\"proj_hcgemail\")}>\".nl2br($message).\"</p>\";\n\t\t\tif (!$bForwardOK)\n\t\t\t\techo \"<h4{$qqi->cstr(\"proj_hcgemail\")}>You must fill out your name and a way we can contact you before sending the message.</h4>\";\t\n\t\t\techo $form->getControl(\"back\")->output();\n\t\t\tif ($bForwardOK)\n\t\t\t\techo $form->getControl(\"send\")->output();\n\t\t\techo $form->getOutputFormEnd('confirming',$transaction);\n\t\tbreak;\n\t\tcase 'finished':\n\t\t\tif ($transaction == 0)\n\t\t\t\tthrow new exception(\"expected transaction not present\");\n\t\t\techo \"<div{$qqi->idcstr($this->longname.'_finished')}>\";\t\n\t\t\techo \"<h1>Thank you for your interest.</h1>\";\n\t\t\techo \"<p>We will be getting back to you shortly.</p>\";\n\t\t\techo \"<p>\".link::anchorHTML('Home',\"Back to home page\").'Continue Looking</a></p>';\n\t\t\techo \"</div>\";\t\n\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new exception(\"illegal state value in formtest: $state\");\n\t\tbreak;\n\t}\n}", "public function renderToOutput()\n {\n header( 'Content-Type: ' . $this->getMimeType() );\n $this->render( 'php://output' );\n }", "private function printContent()\n {\n $deserialized = $this->getContent();\n var_dump($deserialized);\n }", "public function getPage() {\n return $this->render('payment_info.phtml');\n }", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function reports_output() {\n\n\t\t\t// CHANGE THIS\n\t\t\techo 'This is where your new content section\\'s content goes.';\n\t\t}", "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 output()\n {\n // TODO: Implement output() method.\n }", "public static function outputPage() {\n\t\tself::phpSetup();\n\t\t// Set the session\n global $clsession;\n $clsession =new SessionV4;\n //--------------------------------------------------------------\n // Exit if the web is closed for maintenance except\n // when the user is the master\n if( self::ISCLOSED && $_SESSION['usr'] != 'master' )\n exit(pageMaintenance::show());\n # --------------------------------------------------------------\n \t# Show the parameters entered with the request\n self::see();\n\t\tif( self::SEEPHPINFO ) phpinfo();\n\t\t# --------------------------------------------------------------\n\t\t# Reset the session if requested\n\t\tif( isset($_POST['reset']) && $_POST['reset'] == 'XRESET')\n\t\t\t$clsession->logout(sessionV4::NOACT);\n # --------------------------------------------------------------\n\t\t# Open the main class of the system\n\t\trequire_once('main.php');\n $clmain=new main;\n $s=$clmain->execute();\n $shses=(singleton::SHOWSESSION ? $clsession->getSession() : '');\n\t\treturn $s.$shses;\n\t}", "public function display_account_order_details( ){\n\t\tif( $this->is_page_visible( \"order_details\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_order_details.php' );\n\t\t}\n\t}", "public function getOutput(){\n\t\t$aMenu = $this->mountBar();\n\t\t$aMenu->getOutput();\n\t}", "protected final function output ()\n\t{\n\t\tif ($this->isFailed() || !$this->isOutputSet())\n\t\t{\n\t\t\t$this->outputData();\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Description: File Download');\n\t\t\theader('Content-Type: ' . $this->outputContentType);\n\t\t\t$disposition = $this->attachResult ?\n\t\t\t\t\t'attachment; filename=' . $this->outputFileName :\n\t\t\t\t\t'inline';\n\t\t\theader('Content-Disposition: ' . $disposition);\n\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t\theader('Content-Length: ' . filesize($this->outputFile));\n\n\t\t\twhile (ob_get_level()) {\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t\tflush();\n\t\t\treadfile($this->outputFile);\n\t\t}\n\t}", "public function printContent() {\r\n $this->content .= $this->doc->endPage();\r\n echo $this->content;\r\n }", "public function invoiceDownloadAction(BaseOrder $order)\n {\n $fileName = str_replace(' ', '_', 'files/invoices/' . $order->getInvoiceReference()) . '.pdf';\n\n if (file_exists($fileName)) {\n unlink($fileName);\n }\n\n if (true) {\n $bill = $this->renderView(\n 'DyweeOrderBundle:Order:invoice.html.twig',\n [\n 'order' => $order\n ],\n true\n );\n\n $this->get('knp_snappy.pdf')->generateFromHtml(\n $bill,\n $fileName\n );\n //}\n\n //else{\n $response = new Response();\n\n // Set headers\n $response->headers->set('Cache-Control', 'private');\n $response->headers->set('Content-type', mime_content_type($fileName));\n $response->headers->set('Content-Disposition', 'attachment; filename=\"' . basename($fileName) . '\";');\n $response->headers->set('Content-length', filesize($fileName));\n\n // Send headers before outputting anything\n $response->sendHeaders();\n\n $response->setContent(readfile($fileName));\n /*return new Response(\n $this->get('knp_snappy.pdf')->getOutput($this->generateUrl('invoice_view', array('idOrder' => $idOrder), true)),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"LB1X '.$order->getInvoiceReference().'.pdf\"'\n )\n );\n }*/\n }\n }", "abstract function printOutput()", "public static function out()\n {\n $session = self::getSession();\n $content = '';\n if (isset($session->counts)) {\n $content .= \"<h6>Count results</h6>\\n\\n\";\n ksort($session->counts);\n foreach ($session->counts as $name => $count) {\n $content .= \"<b>$name</b> triggered $count times<br/>\\n\";\n }\n }\n if (isset($session->timings)) {\n $content .= \"<h6>Timer results</h6>\\n\\n\";\n ksort($session->timings);\n foreach ($session->timings as $name => $data) {\n if ($data['level']) {\n $content .= '<b>Unbalanced call for ' . $name . ':</b> function level remains at ' . $data['level'] . \"!<br/>\\n\";\n }\n $content .= '<b>' . $name . '</b> total time ' . $data['sum'] . ' in ' . $data['count'] . \" times<br/>\\n\";\n foreach ($data['times'] as $level => $times) {\n $content .= '&nbsp;&nbsp;&nbsp;&nbsp;at call level ' . $level . ' total time ' . $times['sum'] . ' in ' . $times['count'] . \" times<br/>\\n\";\n }\n }\n }\n if (isset($session->content)) {\n $content .= $session->content;\n }\n $session->unsetAll();\n if ($content) {\n $content = \"\\n<div class='zend_echo'>\\n\" . $content . \"\\n</div>\\n\";\n }\n\n return $content;\n }", "function lb_show_order_complete_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'order-complete',\n\t\t\t'order_complete' => lb_get_order_from_orders_table_by_id( esc_html( $_GET['order_id'] ) ),\n\t\t)\n\t);\n}", "public function HandlePage()\n\t{\n\t\tif(!gzte11(ISC_HUGEPRINT)) {\n\t\t\texit;\n\t\t}\n\n\t\t$this->SetVendorData();\n\n\t\tif($this->displaying == 'products') {\n\t\t\t$this->ShowVendorProducts();\n\t\t}\n\t\telse if($this->displaying == 'page') {\n\t\t\t$this->ShowVendorPage();\n\t\t}\n\t\telse if($this->displaying == 'profile') {\n\t\t\t$this->ShowVendorProfile();\n\t\t}\n\t\telse {\n\t\t\t$this->ShowVendors();\n\t\t}\n\t}", "public function print_cashdrawer()\n\t{\n\t\t$this->_json('');\n\t}", "public function index() {\n $this->show_order();\n }" ]
[ "0.68755394", "0.6675673", "0.65981567", "0.65277195", "0.6471173", "0.6371786", "0.6339118", "0.633703", "0.6127276", "0.6106125", "0.60883325", "0.6064364", "0.60423774", "0.60055333", "0.5986291", "0.5960736", "0.5955927", "0.5954413", "0.5947192", "0.5920202", "0.59131896", "0.5896863", "0.588397", "0.587225", "0.587225", "0.58707136", "0.5858979", "0.5836259", "0.58338434", "0.58247304", "0.58188725", "0.5815588", "0.5796273", "0.5792776", "0.5791178", "0.578275", "0.5782311", "0.5771264", "0.5770068", "0.5757557", "0.57569736", "0.57408214", "0.5717953", "0.5715089", "0.5699288", "0.5688434", "0.56859785", "0.5678798", "0.5673946", "0.56716937", "0.56682855", "0.56622857", "0.5648107", "0.56480175", "0.56438535", "0.56350183", "0.56346744", "0.5629292", "0.56279767", "0.56217206", "0.5610348", "0.56042165", "0.56023234", "0.55936193", "0.5590427", "0.55839646", "0.5574939", "0.5574939", "0.5574939", "0.5574939", "0.5574939", "0.5574522", "0.5573654", "0.5573654", "0.5573654", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5573245", "0.5570168", "0.5549468", "0.55492574", "0.553744", "0.5534483", "0.5533629", "0.5524682", "0.55104595", "0.5504216", "0.5504003", "0.54986525", "0.5497413", "0.54934704" ]
0.0
-1
Display the chosen payment type on the order edit pages (backend)
public function display_payment_type_order_edit_pages( $order ){ if( $this->id === $order->get_payment_method() && $order->get_meta('_payment_duration') ) { $options = $this->options; echo '<p><strong>'.__('Payment Duration').':</strong> ' . $options[$order->get_meta('_payment_duration')] . '</p>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentType(){\n return $this->payment_type;\n }", "public function setPaymentType($payment_type){\n $this->payment_type = $payment_type;\n }", "public function form_order_type() {\n\t\tglobal $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t$data = array();\n\n\t\tif ( !isset( $_REQUEST['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual-form-builder-pro' !== $_REQUEST['page'] )\n\t\t\treturn;\n\n\t\tif ( isset( $_REQUEST['mode'] ) ) :\n\t\t\t$user_id = $current_user->ID;\n\n\t\t\t$type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t\t$meta_value = ( in_array( $_REQUEST['mode'], array( 'order', 'list' ) ) ) ? esc_html( $_REQUEST['mode'] ) : '';\n\t\t\tupdate_user_meta( $user_id, 'vfb-form-order-type', $meta_value );\n\n\t\tendif;\n\t}", "public function getPaymenttype()\n {\n return $this->paymenttype;\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function edit(Payment $payment)\n {\n //\n }", "public function payment_fields() {\r\n\t\tif (!empty($this->description)) {\r\n\t\t\techo $this->add_next_line($this->description . '<br /><br />');\r\n\t\t}\r\n\t\techo __('Payment Method', 'ecpay') . ' : ';\r\n\t\techo $this->add_next_line('<select name=\"ecpay_choose_payment\">');\r\n\t\tforeach ($this->ecpay_payment_methods as $payment_method) {\r\n\t\t\techo $this->add_next_line(' <option value=\"' . $payment_method . '\">');\r\n\t\t\techo $this->add_next_line(' ' . $this->get_payment_desc($payment_method));\r\n\t\t\techo $this->add_next_line(' </option>');\r\n\t\t}\r\n\t\techo $this->add_next_line('</select>');\r\n\t}", "public function editShippingMethods($type)\n {\n if ($type === 'free')\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n elseif ($type === 'inner')\n $shippingMethod = Setting::where('key', 'local_label')->first();\n\n elseif ($type === 'outer')\n $shippingMethod = Setting::where('key', 'outer_label')->first();\n\n else\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n return view('dashboard.settings.shipping.edit',compact('shippingMethod')) ;\n }", "public function change_payment_mode() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $data['companies'] = $this->company->get_activeuser_companies_for_tenant($this->tenant_id);\n $data['page_title'] = 'Class Trainee Enrollment - Change Payment Mode';\n $data['main_content'] = 'classtrainee/change_payment_mode';\n $this->load->view('layout', $data);\n }", "public function displayPaymentSelection()\n\t{\n\t\t$content = $this->renderTemplate('Project/1_Website/Design/Applications/Commerce/Controllers/paymentInfo/paymentInfo.phtml');\n\t\tresponse::getInstance()->addContentToTree(array('APPLICATION_CONTENT'=>$content));\n\t}", "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 getPaymentsForm($type, $id) {\n\t\t\n\t\t$payments = array ();\n\t\t$banks = Banks::findAllActive ( \"classname\", true );\n\t\t\n\t\tif (! empty ( $banks )) {\n\t\t\tforeach ( $banks as $bank ) {\n\t\t\t\tif (! empty ( $bank ['classname'] ) && class_exists ( $bank ['classname'] )) {\n\t\t\t\t\tif (class_exists ( $bank ['classname'] )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$class = $bank ['classname'];\n\t\t\t\t\t\t$payment = new $class ( $id );\n\t\t\t\t\t\t$payment->setUrlOk ( $_SERVER ['HTTP_HOST'] . \"/orders/response/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t$payment->setUrlKo ( $_SERVER ['HTTP_HOST'] . \"/orders/response/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t$payment->setUrlCallback ( $_SERVER ['HTTP_HOST'] . \"/common/callback/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$payments [] = $payment->CreateForm ();\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->view->payments = $payments;\n\t\t\n\t\t// Path of the template\n\t\treturn $this->view->render ( 'partials/payments.phtml' );\n\t}", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function edit(PrizeType $prizeType)\n {\n //\n }", "public function getEdit($type)\n {\n // Title\n $title = Lang::get('admin/types/title.type_update');\n\n // Show the page\n return View::make('admin/types/edit', compact('type', 'title'));\n }", "public function index($type)\n {\n return view('manager.order',['type'=>$type]);\n }", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<?php if ( $this->mode === 'SELECT' ): ?>\n\t\t\t<label for=\"factoring-menu\"></label>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Please select payment method:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<select name=\"factoring-menu\" id=\"factoring-menu\" class=\"required-entry\">\n\t\t\t\t<option selected value=\"FINANCING\"><?php echo __( 'Financing Invoice', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t\t<option value=\"CREDITACCOUNT\"><?php echo __( 'Part Payment', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t</select>\n\t\t\t<div class=\"clear\"></div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $this->checkout_field !== 'yes' ): ?>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Social Security Number:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<input type=\"text\" name=\"social-security-number\" id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t<?php endif; ?>\n\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function editPaymentMethod(int $payment)\n {\n $payment_method = PaymentMethod::findOrFail($payment);\n return view('admin.delivery-and-payment-method', [\n 'delivery_and_payment_method' => $payment_method,\n 'type' => 'payment_method',\n 'action' => route('admin.payment_method.update',['payment' => $payment_method->id])\n ]);\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function formAction($type = 'payment', $customer_id = null)\n {\n $shortDomainKey = substr(Hanzo::getInstance()->get('core.domain_key'), -2);\n $order = OrdersPeer::getCurrent(false);\n\n if (null === $customer_id) {\n if ($order->getCustomersId()) {\n $customer_id = $order->getCustomersId();\n } else {\n $id = CustomersPeer::getCurrent()->getId();\n if ($id) {\n $customer_id = $id;\n }\n }\n }\n\n $countries = CountriesPeer::getAvailableDomainCountries(true);\n $deliveryMethodId = $order->getDeliveryMethod();\n\n if ($type == 'CURRENT-SHIPPING-ADDRESS') {\n $type = 'shipping';\n $form = '<div class=\"block\"><form action=\"\" method=\"post\" class=\"address\"></form></div>';\n\n if ('json' === $this->getFormat()) {\n return $this->json_response([\n 'status' => true,\n 'message' => '',\n 'data' => ['html' => $form],\n ]);\n }\n\n return $this->response($form);\n } elseif ('payment' == $type) {\n $address = AddressesQuery::create()\n ->filterByCustomersId($customer_id)\n ->filterByType($type)\n ->findOne();\n }\n\n // to enable address locator or not.\n // 12 = Bring (DK)\n // 15 = PostNord (DK)\n // 71 = hmmm ...\n // 30 = Bring (SE)\n // 31 = PostNord (SE)\n // 500 = Bring (FI)\n // 700 = Bring (NO)\n $enableLocator = (($type !== 'payment') && in_array($deliveryMethodId, [12, 15, 71, 30, 31, 500, 700]));\n\n if (empty($address)) {\n $address = new Addresses();\n $address->setType($type);\n $address->setCustomersId($customer_id);\n\n if ($order->getFirstName()) {\n $address->setFirstName($order->getFirstName());\n $address->setLastName($order->getLastName());\n }\n } elseif ('overnightbox' === $type) {\n $address->setFirstName($order->getFirstName());\n $address->setLastName($order->getLastName());\n }\n\n $builder = $this->createFormBuilder($address, [\n 'validation_groups' => 'shipping_bundle_'.$type\n ]);\n\n if (in_array($type, ['company_shipping', 'overnightbox'])) {\n $label = 'company.name';\n if ($type === 'overnightbox') {\n $label = 'overnightbox.label';\n }\n\n $builder->add('company_name', null, [\n 'label' => $label,\n 'required' => true,\n 'translation_domain' => 'account'\n ]);\n }\n\n if (in_array($shortDomainKey, ['DE'])) {\n $builder->add('title', 'choice', [\n 'choices' => [\n 'female' => 'title.female',\n 'male' => 'title.male',\n ],\n 'label' => 'title',\n 'required' => true,\n 'trim' => true,\n 'translation_domain' => 'account',\n ]);\n }\n\n $builder->add('first_name', null, [\n 'required' => true,\n 'translation_domain' => 'account'\n ]);\n\n $builder->add('last_name', null, [\n 'required' => true,\n 'translation_domain' => 'account'\n ]);\n\n if ($type === 'payment') {\n $builder->add('phone', null, [\n 'required' => true,\n 'translation_domain' => 'account'\n ]);\n }\n\n $builder->add('address_line_1', null, [\n 'translation_domain' => 'account',\n 'max_length' => 35\n ]);\n\n $attr = [];\n if (in_array($shortDomainKey, ['AT', 'CH', 'DE', 'DK', 'FI', 'NL', 'NO', 'SE'])) {\n $attr = ['class' => 'auto-city'];\n }\n\n $builder->add('postal_code', null, [\n 'required' => true,\n 'translation_domain' => 'account',\n 'attr' => $attr,\n ]);\n\n $builder->add('city', null, [\n 'required' => true,\n 'translation_domain' => 'account',\n 'read_only' => (count($attr) ? true : false),\n 'attr' => ['class' => 'js-auto-city-'.$type]\n ]);\n\n if ('overnightbox' === $type || $enableLocator) {\n list($countryId, $countryName) = each($countries);\n\n $address->setCountriesId($countryId);\n $address->setCountry($countryName);\n\n $builder->add('countries_id', 'hidden', ['data' => $countryId]);\n $builder->add('external_address_id', 'hidden', ['data' => $address->getExternalAddressId()]);\n } else {\n if (count($countries) > 1) {\n $builder->add('countries_id', 'choice', [\n 'empty_value' => 'choose.country',\n 'choices' => $countries,\n 'required' => true,\n 'translation_domain' => 'account'\n ]);\n } else {\n list($countryId, $countryName) = each($countries);\n\n $address->setCountriesId($countryId);\n $address->setCountry($countryName);\n\n $builder->add('countries_id', 'hidden', ['data' => $countryId]);\n $builder->add('country', null, [\n 'read_only' => true,\n 'translation_domain' => 'account'\n ]);\n }\n }\n\n // if the locator is enables, set all elements to read-only to prevent customers from editing the found address.\n if ($enableLocator) {\n foreach ($builder->all() as $element) {\n $element->setDisabled(true);\n }\n }\n\n $builder->add('customers_id', 'hidden', ['data' => $customer_id]);\n\n $form = $builder->getForm();\n\n $baseType = 'is-shipping';\n if ('payment' === $type) {\n $baseType = 'is-payment';\n }\n\n $response = $this->render('ShippingBundle:Address:form.html.twig', [\n 'type' => $type,\n 'base_type' => $baseType,\n 'enable_locator' => $enableLocator,\n 'method_id' => $deliveryMethodId,\n 'form' => $form->createView(),\n ]);\n\n\n if ('json' === $this->getFormat()) {\n $html = $response->getContent();\n\n return $this->json_response([\n 'status' => true,\n 'message' => '',\n 'data' => ['html' => $html],\n ]);\n }\n\n return $response;\n }", "public function render()\n {\n parent::render();\n\n $this->_aViewData[\"sOxid\"] = $this->getEditObjectId();\n if ($this->isNewPayPalOrder()) {\n $this->_aViewData['oOrder'] = $this->getEditObject();\n } else {\n $this->_aViewData['sMessage'] = $this->isPayPalOrder() ? oxRegistry::getLang()->translateString(\"OEPAYPAL_ONLY_FOR_NEW_PAYPAL_PAYMENT\") :\n oxRegistry::getLang()->translateString(\"OEPAYPAL_ONLY_FOR_PAYPAL_PAYMENT\");\n }\n\n return \"order_paypal.tpl\";\n }", "public function actionGetMetaView($type)\n {\n\n switch($type){\n case 'essential-oil':\n $model = new ProductMetaOil();\n return $this->renderAjax('_form_essential_oil', [\n 'model' => $model\n ]);\n break;\n case 'mask':\n $model = new ProductMetaOil();\n return $this->renderAjax('_form_mask', [\n 'model' => $model\n ]);\n break;\n case 'soap':\n $model = new ProductMetaOil();\n return $this->renderAjax('_form_soap', [\n 'model' => $model\n ]);\n break;\n }\n\n\n\n }", "public function edit(Order $order)\n {\n // return view('backend.order.detail');\n }", "function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function edit(Payment $payment)\r\n { \r\n $form=[\r\n \"value\" => \"update\",\r\n \"name\" => \"Edit Payment\",\r\n \"submit\" => \"Save\"\r\n ];\r\n\r\n $clients_list = Client::all(); \r\n\r\n return view('payment/form',compact('form','clients_list','payment'));\r\n }", "public function hookDisplayPayment()\n\t{\n\t\tif (!$this->active)\n\t\t\treturn;\n $titlel = Configuration::get(\n 'WIPEI_TITLEL',\n $this->context->language->id\n );\n $descl = Configuration::get(\n 'WIPEI_DESCL',\n $this->context->language->id\n );\n\t\t$this->smarty->assign(array(\n\t\t\t//'nombre' => Configuration::get($this->getPrefijo('PREFIJO_CONFIG').'_FRONTEND_NAME'),//nombre que se muestra al momento de elegir los metodos de pago\n 'this_path' => $this->_path,\n 'titlel' => $titlel,\n 'descl' => $descl,\n\t\t\t'this_path_ejemplo' => $this->_path,\n\t\t\t'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/',\n\t\t\t'module_path' => strtolower(__PS_BASE_URI__.'modules/'.$this->name.'/views/img/logo.png'),\n\n\t\t));\n\t\treturn $this->display(__FILE__, 'payment.tpl');//asigno el template que quiero usar\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(order $order)\n {\n //\n }", "function get_payment_type()\n {\n // echeck - payment funded with e-check\n // instant - payment was funded with platnosci balance, credit card, or instant transfer\n return $this->platnosci_post_vars['payment_type'];\n }", "public function getPaymentType(): string\n {\n $paymentMethod = $this->getPaymentMethod();\n $paymentTypes = [\n 'regular_checkout' => __('Regular'),\n 'express_checkout' => __('Express'),\n ];\n\n return (string) ($paymentTypes[$paymentMethod] ?? '');\n }", "public function getPaymentType()\n {\n switch ( $this->payment_type ) {\n case Contribution::PAYMENT_CASH:\n return 'cash';\n break;\n case Contribution::PAYMENT_CREDITCARD:\n return 'credit_card';\n break;\n case Contribution::PAYMENT_CHECK:\n return 'check';\n break;\n case Contribution::PAYMENT_TRANSFER:\n return 'transfer';\n break;\n case Contribution::PAYMENT_PAYPAL:\n return 'paypal';\n break;\n case Contribution::PAYMENT_OTHER:\n return 'other';\n break;\n default:\n Analog::log(\n __METHOD__ . ' Unknonw payment type ' . $this->payment_type,\n Analog::ERROR\n );\n throw new \\RuntimeException(\n 'Unknonw payment type ' . $this->payment_type\n );\n }\n\n }", "public function edit(Type $type)\n {\n //\n return view('type', compact('type'));\n }", "public function edit(PaymentConfirmation $payment)\n {\n //\n }", "public function edit(PaymentMethod $paymentMethod)\n {\n //\n }", "function receipt_page( $order ) {\n\t\terror_reporting(E_ERROR);\n\t\tini_set('display_errors', 1);\n\n\t\techo '<p>'.__( 'Спасибо за ваш заказ. Нажмите кнопку, для перехода к оплате через Твои Платежи.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_payu_form( $order );\n\n\t}", "public function edit(ProductProductType $productProductType)\n {\n //\n }", "public function payment_fields() {\n echo '<p><strong>Pay securely using your credit card</strong> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/visa.svg\" alt=\"Visa\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/mastercard.svg\" alt=\"Mastercard\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/discover.svg\" alt=\"Discover\" class=\"card-img\" width=\"32\"> <img src=\"' . plugins_url() . '/woocommerce-pay-fabric/images/amex.svg\" alt=\"Amex\" class=\"card-img\" width=\"32\"></p>';\n // Trying render payment form\n // Call orginal payment the Woocommerce\n $this->form();\n }", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public function get_payment_type() {\n\n\t\treturn 'credit_card' === $this->get_request()->get_order()->payment->type ? 'credit-card' : 'echeck';\n\t}", "public function edit(Order $order){\n\n }", "public function setPaymenttype($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->paymenttype !== $v) {\n $this->paymenttype = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_PAYMENTTYPE] = true;\n }\n\n return $this;\n }", "public function getPaymentTypeAttribute() {\n return $this->payment_type()->first()->makeHidden(['id', 'updated_at', 'created_at']);\n }", "public function edit($id)\n\t{\n\t\t$cont = new RestController();\n $orderType = $cont->getRequest('OrderTypes('.$id.')?$expand=Type');\n if($orderType instanceof View)\n {\n return $orderType;\n }\n\n $types = ProductTypesController::getProductTypesList();\n\n\n return view('orderTypes.edit',compact('orderType','types'));\n\t}", "function field_data_type_view(){\r\n\t\tglobal $current_user;\r\n\t\t$current_user = wp_get_current_user();\r\n\t\tif( !current_user_can( 'manage_options', $current_user->ID ) ){\r\n\t\t\twp_die( __( 'You do not have permissions to activate this plugin, sorry, check with site administrator to resolve this issue please!', 'user-registration-aide' ) );\r\n\t\t}else{\r\n\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t?>\r\n\t\t\t<table class=\"style\">\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"3\"><?php _e( 'Change Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"2\"><?php _e( 'Field Title: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t\t<th><?php _e( 'Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\t\t\t\t$nfc = new INPUT_NEW_FIELDS_MODEL();\r\n\t\t\t\t$input = $nfc->input_options_array();\r\n\t\t\t\t$ura_fields = $field->get_all_fields();\r\n\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( $ura_fields as $objects ){\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"2\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\techo '<label for=\"'.$objects->meta_key.'\">'. _e( $objects->field_name, 'user-registration-aide').'</label>';\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select class=\"fieldOrder\" name=\"<?php echo $objects->meta_key.'_data_type'; ?>\" title=\"<?php _e( 'Select the field type to change to', 'user-registration-aide' );?>\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\tforeach( $input as $key => $title ){\r\n\t\t\t\t\t\t\t\t\tif( $objects->data_type == $key ){\r\n\t\t\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$selected = null;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo \"<option value=\\\"$key\\\" $selected >$title</option>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"3\">\r\n\t\t\t\t\t\t<p class=\"deleteFields\">\r\n\t\t\t\t\t\t<?php _e( 'No new fields currently exist, you have to add new fields on the main page before you can change the order!', 'user-registration-aide' ); ?>\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\"3\">\r\n\t\t\t\t\t<div class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"change_field_type\" value=\"<?php _e( 'Change Field Type', 'user-registration-aide' );?>\" /></div>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "function kato_policy_print_type(){\n\tif(function_exists('the_field')){\n\t\t$type = get_field('type');\n\t\t$field = get_field_object('type');\n\t\t$label = $field['choices'][ $type ];\n\t\tprint '<li class=\"meta-type type-' . $type . '\">';\n\t\tprint $label;\n\t\tprint '</li>';\n\t}\n}", "function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id) {\n\n\tif (!$this->selectedThisByMethodId($payment_method_id)) {\n\t return null; // Another method was selected, do nothing\n\t}\n\n\t$db = JFactory::getDBO();\n\t$q = 'SELECT * FROM `' . $this->_tablename . '` '\n\t\t. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;\n\t$db->setQuery($q);\n\tif (!($paymentTable = $db->loadObject())) {\n\t // JError::raiseWarning(500, $db->getErrorMsg());\n\t return '';\n\t}\n\t$this->getPaymentCurrency($paymentTable);\n\t$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`=\"' . $paymentTable->payment_currency . '\" ';\n\t$db = &JFactory::getDBO();\n\t$db->setQuery($q);\n\t$currency_code_3 = $db->loadResult();\n\t$html = '<table class=\"adminlist\">' . \"\\n\";\n\t$html .=$this->getHtmlHeaderBE();\n\t$html .= $this->getHtmlRowBE('COMMBANK_PAYMENT_NAME', $paymentTable->payment_name);\n\t//$html .= $this->getHtmlRowBE('COMMBANK_PAYMENT_TOTAL_CURRENCY', $paymentTable->payment_order_total.' '.$currency_code_3);\n\t$code = \"commbank_response_\";\n\tforeach ($paymentTable as $key => $value) {\n\t if (substr($key, 0, strlen($code)) == $code) {\n\t\t$html .= $this->getHtmlRowBE($key, $value);\n\t }\n\t}\n\t$html .= '</table>' . \"\\n\";\n\treturn $html;\n }", "public function ShowPaymentForm($provider)\n\t{\n\t\t$GLOBALS['PaymentFormContent'] = $provider->ShowPaymentForm();\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('checkout_payment');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\texit;\n\t}", "private function get_payment_method($payment_type) {\r\n\t\t$info_pieces = explode('_', $payment_type);\r\n\t\t\r\n\t\treturn $info_pieces[0];\r\n\t}", "public function getPaymentType()\n {\n\n return 'IPAY';\n }", "function showEditAccountPage($type, $user_id) {\n $active_tab = Utils::reqParam('active_tab', 'account_tab');\n\n $notifications_div = Utils::reqParam('selected', 'email');\n $publisher_div = Utils::reqParam('selected_pub_div', 'post');\n\n $user_account_data = User::getEmptyEditAccountData();\n $user_account_data = User::fillInEditAccountData($user_account_data);\n\n $password_data = User::getEmptyPasswordData();\n\n $seo_attributes = array('title' => '',\n 'keywords' => 'General Account Settings',\n 'description' => 'ShareBloc is a community of like-minded professionals who share, curate and discuss business content that matters.');\n $smarty_params = array(\n 'notifications' => Notification::$notifications,\n 'notify_weekly' => Utils::userData('notify_weekly'),\n 'notify_post_responded' => Utils::userData('notify_post_responded'),\n 'notify_comment_responded' => Utils::userData('notify_comment_responded'),\n 'notify_product_update' => Utils::userData('notify_product_update'),\n 'notify_daily' => Utils::userData('notify_daily'),\n 'notify_suggestion' => Utils::userData('notify_suggestion'),\n 'active_tab' => $active_tab,\n 'account_data' => $user_account_data,\n 'password_data' => $password_data,\n 'seo' => $seo_attributes,\n 'edit_type' => $type,\n 'init_image_upload' => true,\n 'notifications_div' => $notifications_div,\n 'publisher_div' => $publisher_div,\n 'categories_structure' => Utils::getCategoriesStructure(),\n 'autopost_allowed' => Utils::userData('f_auto_allowed'),\n );\n\n if (!isset($_SESSION['user_info']['my_url'])) {\n Log::$logger->error('Maybe not logged in user. Email: ' . $_SESSION['user_info']['email']);\n }\n\n Utils::$smarty->assign($smarty_params);\n Utils::$smarty->display('pages/user_edit.tpl');\n exit();\n}", "public function payment_fields() {\n\t\t\tif (true === $this->description) {\n\t\t\t\techo esc_html($this->description);\n\t\t\t}\n\n\t\t}", "public function display_account_payment_methods( ){\n\t\tif( $this->is_page_visible( \"payment_methods\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' );\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' ) )\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' );\n\t\t}\n\t}", "public function hookDisplayPayment()\n {\n if (!$this->active)\n {\n\t\t\treturn;\n }\n\n return $this->display(__FILE__, 'payment.tpl');\n }", "public function show(Type $type)\n {\n //\n }" ]
[ "0.68799037", "0.67747474", "0.6664609", "0.6485299", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.63783735", "0.6312605", "0.627827", "0.62674177", "0.6159791", "0.61376035", "0.61376035", "0.61376035", "0.6136659", "0.6104696", "0.6104696", "0.6104696", "0.6104696", "0.6104696", "0.6104696", "0.6104696", "0.6104696", "0.6085118", "0.60605145", "0.6044555", "0.60360104", "0.60211563", "0.6001198", "0.5992096", "0.596604", "0.59576756", "0.595701", "0.5942947", "0.59346545", "0.5905611", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5869002", "0.5863999", "0.58634347", "0.58472556", "0.5820034", "0.5815577", "0.57963943", "0.578971", "0.5780771", "0.5763273", "0.5760907", "0.57563907", "0.574521", "0.57389456", "0.5730329", "0.57223713", "0.5720522", "0.5703855", "0.57038015", "0.5697324", "0.56852996", "0.567558", "0.567543", "0.56735504", "0.566226", "0.5653765", "0.5653005", "0.56493", "0.5646195" ]
0.7405207
0
Display the chosen payment type on order totals table
public function display_payment_duration_order_item_totals( $total_rows, $order, $tax_display ){ if( is_a( $order, 'WC_Order' ) && $order->get_meta('_payment_duration') ) { $new_rows = []; // Initializing $options = $this->options; // Loop through order total lines foreach( $total_rows as $total_key => $total_values ) { $new_rows[$total_key] = $total_values; if( $total_key === 'payment_method' ) { $new_rows['payment_type'] = [ 'label' => __("Payment Duration", $this->domain) . ':', 'value' => $options[$order->get_meta('_payment_duration')], ]; } } $total_rows = $new_rows; } return $total_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_payment_type_order_edit_pages( $order ){\n if( $this->id === $order->get_payment_method() && $order->get_meta('_payment_duration') ) {\n $options = $this->options;\n echo '<p><strong>'.__('Payment Duration').':</strong> ' . $options[$order->get_meta('_payment_duration')] . '</p>';\n }\n }", "public function view_total_payment()\n\t{\n\t\t$data['main_content']='total_payment';\n\t\t$this->load->view('page', $data);\n\t}", "public function getPaymentType(){\n return $this->payment_type;\n }", "function display_bank_header(&$order)\n{\n\tglobal $Ajax, $Refs;\n\t$payment = $order->trans_type == ST_BANKPAYMENT;\n\n\t$customer_error = false;\n\tdiv_start('pmt_header');\n\n\tstart_outer_table(TABLESTYLE2, \"width=90%\"); // outer table\n\n\ttable_section(1);\n\t\n date_row(_(\"Date:\"), 'date_', '', true, 0, 0, 0, null, true);\n\n\tref_row(_(\"Reference:\"), 'ref', '');\n\n\ttable_section(2, \"33%\");\n\n\tif (!isset($_POST['PayType']))\n\t{\n\t\tif (isset($_GET['PayType']))\n\t\t\t$_POST['PayType'] = $_GET['PayType'];\n\t\telse\n\t\t\t$_POST['PayType'] = \"\";\n\t}\n\tif (!isset($_POST['person_id']))\n\t{\n\t\tif (isset($_GET['PayPerson']))\n\t\t\t$_POST['person_id'] = $_GET['PayPerson'];\n\t\telse\n\t\t\t$_POST['person_id'] = \"\";\n\t}\n\tif (isset($_POST['_PayType_update'])) {\n\t\t$_POST['person_id'] = '';\n\t\t$Ajax->activate('pmt_header');\n\t\t$Ajax->activate('code_id');\n\t\t$Ajax->activate('pagehelp');\n\t\t$Ajax->activate('editors');\n\t\t$Ajax->activate('footer');\n\t}\n payment_person_types_list_row( $payment ? _(\"Pay To:\"):_(\"From:\"),\n\t\t 'PayType', $_POST['PayType'], true);\n switch ($_POST['PayType'])\n {\n\t\tcase PT_MISC :\n \t\ttext_row_ex($payment ?_(\"To the Order of:\"):_(\"Name:\"),\n\t\t\t\t 'person_id', 40, 50);\n \t\tbreak;\n\t\t//case PT_WORKORDER :\n \t//\tworkorders_list_row(_(\"Work Order:\"), 'person_id', null);\n \t//\tbreak;\n\t\tcase PT_SUPPLIER :\n \t\tsupplier_list_row(_(\"Supplier:\"), 'person_id', null, false, true, false, true);\n \t\tbreak;\n\t\tcase PT_CUSTOMER :\n \t\tcustomer_list_row(_(\"Customer:\"), 'person_id', null, false, true, false, true);\n\n \tif (db_customer_has_branches($_POST['person_id']))\n \t{\n \t\tcustomer_branches_list_row(_(\"Branch:\"), $_POST['person_id'], \n\t\t\t\t\t'PersonDetailID', null, false, true, true, true);\n \t}\n \telse\n \t{\n\t\t\t\t$_POST['PersonDetailID'] = ANY_NUMERIC;\n \t\thidden('PersonDetailID');\n \t}\n \t$trans = get_customer_habit($_POST['person_id']); // take care of customers on hold\n \tif ($trans['dissallow_invoices'] != 0)\n \t{\n \t\tif ($payment)\n \t\t{\n \t\t\t$customer_error = true;\n\t\t\t\t\tdisplay_error(_(\"This customer account is on hold.\"));\n \t\t}\n \t\telse\t\t\t\n\t\t\t\t\tdisplay_warning(_(\"This customer account is on hold.\"));\n \t}\t\t\n \t\tbreak;\n\n\t\tcase PT_QUICKENTRY :\n\t\t\tquick_entries_list_row(_(\"Type\").\":\", 'person_id', null, ($payment ? QE_PAYMENT : QE_DEPOSIT), true);\n\t\t\t$qid = get_quick_entry(get_post('person_id'));\n\t\t\tif (list_updated('person_id')) {\n\t\t\t\tunset($_POST['totamount']); // enable default\n\t\t\t\t$Ajax->activate('footer');\n\t\t\t\t$Ajax->activate('totamount');\n\t\t\t}\n\t\t\tamount_row($qid['base_desc'].\":\", 'totamount', price_format($qid['base_amount']),\n\t\t\t\t null, \"&nbsp;&nbsp;\".submit('go', _(\"Go\"), false, false, true));\n\t\t\tbreak;\t\n\t\t//case payment_person_types::Project() :\n \t//\tdimensions_list_row(_(\"Dimension:\"), 'person_id', $_POST['person_id'], false, null, true);\n \t//\tbreak;\n }\n\n\ttable_section(3, \"33%\");\n\n\tif (!$order->order_id && !get_post('bank_account'))\n\t{\n\t\tif ($_POST['PayType'] == PT_CUSTOMER)\n\t\t\t$_POST['bank_account'] = get_default_customer_bank_account($_POST['person_id']);\n\t\telseif ($_POST['PayType'] == PT_SUPPLIER)\t\n\t\t\t$_POST['bank_account'] = get_default_supplier_bank_account($_POST['person_id']);\n\t\telse\n\t\t\tunset($_POST['bank_account']);\n\t}\t\t\n \n bank_accounts_list_row( $payment ? _(\"From:\") : _(\"Into:\"), 'bank_account', null, true);\n if ($payment)\n\t\tbank_balance_row($_POST['bank_account']);\n\n\t$bank_currency = get_bank_account_currency($_POST['bank_account']);\n\n\texchange_rate_display(get_company_currency(), $bank_currency, $_POST['date_']);\n\n\tend_outer_table(1); // outer table\n\n\tdiv_end();\n\tif ($customer_error)\n\t{\n\t\tend_form();\n\t\tend_page();\n\t\texit;\n\t}\n}", "public function payment_fields() {\r\n\t\tif (!empty($this->description)) {\r\n\t\t\techo $this->add_next_line($this->description . '<br /><br />');\r\n\t\t}\r\n\t\techo __('Payment Method', 'ecpay') . ' : ';\r\n\t\techo $this->add_next_line('<select name=\"ecpay_choose_payment\">');\r\n\t\tforeach ($this->ecpay_payment_methods as $payment_method) {\r\n\t\t\techo $this->add_next_line(' <option value=\"' . $payment_method . '\">');\r\n\t\t\techo $this->add_next_line(' ' . $this->get_payment_desc($payment_method));\r\n\t\t\techo $this->add_next_line(' </option>');\r\n\t\t}\r\n\t\techo $this->add_next_line('</select>');\r\n\t}", "public function getTotalFormatted( catalogTotalType $type ) : string;", "function action_woocommerce_order_items_table( $order ) {\n\t\t// make action magic happen here... \n\t\t$data = get_post_meta( $order->id, '_metatest_data', true );\n\t\techo '<tr>\n\t\t\t\t<th scope=\"row\"><span class=\"np_forudpdate\">Накладная (Новая почта):</span></th>\n\t\t\t\t\t<td>' . $data . '</td>\n\t\t\t\t</tr>';\n\t}", "public function fetch_order_payment_method(Request $request) {\n $data['orders'] = Order::where('payment_method', $request->method)->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['sum_price'] = Order::where('payment_method', $request->method)->sum('subtotal_price');\n $data['sum_delivery'] = Order::where('payment_method', $request->method)->sum('delivery_cost');\n $data['sum_total'] = Order::where('payment_method', $request->method)->sum('total_price');\n $data['method'] = $request->method;\n\n return view('admin.orders' , ['data' => $data]);\n }", "public function index($type)\n {\n return view('manager.order',['type'=>$type]);\n }", "public function getPaymenttype()\n {\n return $this->paymenttype;\n }", "public function displayOrdersTable(){\n\n global $currency;\n $orders = $this->getAllOrders();\n if ($orders != false) {\n echo '<table class=\"table table-striped table-hover\">\n <thead>\n <tr>\n <th data-sort=\"string\">Order ID</th>\n <th data-sort=\"string\">Username</th>\n <th data-sort=\"string\">Order Date</th>\n <th data-sort=\"string\">Order Status</th>\n <th data-sort=\"int\">Order Total</th>\n <th data-sort=\"string\">Payment Method</th>\n <th>Options</th>\n </tr>\n </thead>\n <tbody>';\n\n for ($i = 0; $i < count($orders); $i++) {\n /*\n if ($orders[$i][\"product_visibility\"] == 2) {\n $visibility = \"In Stock\";\n } elseif ($orders[$i][\"product_visibility\"] == 1) {\n $visibility = \"Out of Stock\";\n } else {\n $visibility = \"Hidden\";\n }\n */\n\n\n if ($orders[$i]['order_user'] != null) {\n $orderUser = $this->getUserDataFromID($orders[$i]['order_user']);\n $orderUser = \"<td data-sort-value='\" . $orders[$i]['order_user'] . \"'> <img src='\" . $this->getAvatar($orderUser->user_email) . \"'>\" . $orderUser->user_name . \"</td>\n \";\n } else {\n $orderUser = \"<td>null</td>\";\n }\n\n echo \"\n <tr>\n <td>\" . $orders[$i]['order_braintree_id'] . \"</td>\n \" . $orderUser . \"\n <td>\" . $orders[$i]['order_date'] . \"</td>\n <td>\" . $orders[$i]['order_status'] . \"</td>\n <td data-sort-value='\" . $orders[$i]['order_grand_total'] . \"'>\" . $currency . number_format($orders[$i]['order_grand_total'], 2) . \"</td>\n <td>\" . $orders[$i]['order_payment_type'] . \"</td>\n <!-- Button trigger modal -->\n <td>\n\n <input type='hidden' name='process' value='loginAsUser'>\n <input type='hidden' name='user_id' value='\" . $orders[$i]['order_id'] . \"'>\n <div class='btn-group' role='group' aria-label='...'>\n <a type='button' class='btn btn-default' href='\" . $this->url(\"orders\", array(\"product\" => $orders[$i]['order_braintree_id'])) . \"'><i class='btl bt-search'></i> View Order</a>\n </div>\n </td>\n </tr>\";\n }\n\n echo \"\n\n </tbody>\n </table>\";\n\n } else {\n $this->callbackMessage(\"<b>Error loading orders</b> There was an issue relating to the orders database, please check your database settings are correct and working\", \"danger\");\n }\n\n\n }", "public function setPaymentType($payment_type){\n $this->payment_type = $payment_type;\n }", "public function payment(){\n $transactions = Transaction::where('status_id', 3)\n ->orWhere('status_id', 4)\n ->orderByDesc('created_on')->get();\n\n return View('admin.show-payments', compact('transactions'));\n }", "public function displayPaymentSelection()\n\t{\n\t\t$content = $this->renderTemplate('Project/1_Website/Design/Applications/Commerce/Controllers/paymentInfo/paymentInfo.phtml');\n\t\tresponse::getInstance()->addContentToTree(array('APPLICATION_CONTENT'=>$content));\n\t}", "static function displayTotal($a_amount)\n\t{\n\t\techo \"<tr>\\n\";\n\t\techo \"<td></td>\\n\";\n\t\techo \"<td class='exTableTotal'>Total:</td>\\n\";\n\t\techo '<td class=\"exTotal\">$' . $a_amount . \"</td>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "private function _ratepayEvent($type, $order)\n {\n switch($type){\n case 'invoice':\n $invoice = $order->prepareInvoice();\n $invoice->register()->save();\n $order->setTotalInvoiced($order->getTotalInvoiced() + $invoice->getGrandTotal());\n $order->setBaseTotalInvoiced($order->getBaseTotalInvoiced() + $invoice->getBaseGrandTotal());\n $order->save();\n break;\n case 'creditmemo':\n $creditmemo = Mage::getModel('sales/service_order', $order)->prepareCreditmemo();\n $creditmemo->register()->save();\n $order->setTotalRefunded($order->getTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($order->getBaseTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($creditmemo->getGrandTotal());\n $order->save();\n break;\n case 'cancel':\n $order->cancel()->save();\n break;\n default:\n throw new Exception('Wrong operation!');\n }\n }", "function store_order_paid(Order $order)\n {\n if ($order->order_owing < 0) {\n return '<span class=\"store_order_paid_over\">'.lang('store.overpaid').'</span>';\n } elseif ($order->order_owing == 0) {\n return '<span class=\"store_order_paid_yes\">'.lang('yes').'</span>';\n } elseif ($order->order_paid > 0) {\n return store_currency($order->order_paid);\n } else {\n return lang('no');\n }\n }", "public function getPaymentAmountType()\n {\n return $this->_fields['PaymentAmountType']['FieldValue'];\n }", "public function view_total_student_payment()\n\t{\n\t\t$pay_month=$this->input->post('pay_month');\n\t\t$result=$this->Payment_model->view_total_payment($pay_month);\n\t\tif($result):\n\t\t\tif($result[0]->total_payment>0):\n ?>\n\t\t\t<div class=\"text-center\">\n\t\t\t <h3 class=\"p-5 bg-primary d-inline-block text-white \"><?= $result[0]->total_payment; ?> Tk</h3>\n\t\t\t</div>\n <?php\n\t\t\telse:\n\t\t\t\t?>\n\t\t\t\t\t<h6 class=\"text-center text-danger\">00 Tk </h6>\n\t\t\t\t<?php\n\t\t\t\tendif;\n else:\n\t\t\t?>\n\t\t\t<h6 class=\"text-center text-danger\">00 Tk </h6>\n <?php\n endif;\n\t}", "public function view_order_report(){\n\t\t$data['order_table'] = $this->db->query('select * from order_table')->result();\n\t\t$this->load->view('admin/view_order_report',$data);\n\t}", "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public function view_all_payment()\n\t{\n\t\t$data['main_content']='view_payment';\n\t\t$data['allbatch']=$this->Batch_model->view_all_running_batch();\n\t\t$data['all_payment']=$this->Payment_model->view_all_payment();\n\t\t$this->load->view('page', $data);\n\t}", "public function payment_fields() {\n\t\tparent::payment_fields();\n\t\t?>\n\t\t<?php if ( $this->mode === 'SELECT' ): ?>\n\t\t\t<label for=\"factoring-menu\"></label>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Please select payment method:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<select name=\"factoring-menu\" id=\"factoring-menu\" class=\"required-entry\">\n\t\t\t\t<option selected value=\"FINANCING\"><?php echo __( 'Financing Invoice', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t\t<option value=\"CREDITACCOUNT\"><?php echo __( 'Part Payment', 'woocommerce-gateway-payex-payment' ); ?></option>\n\t\t\t</select>\n\t\t\t<div class=\"clear\"></div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $this->checkout_field !== 'yes' ): ?>\n\t\t\t<label for=\"social-security-number\"><?php echo __( 'Social Security Number:', 'woocommerce-gateway-payex-payment' ); ?></label>\n\t\t\t<input type=\"text\" name=\"social-security-number\" id=\"social-security-number\" value=\"\" autocomplete=\"off\">\n\t\t<?php endif; ?>\n\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function display_order_paid()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'Successful payment list';\n\t\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\t\tif ($rep_code != '') {\n\t\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t\t} else {\n\t\t\t\t$condition = '';\n\t\t\t}\n\t\t\t$this->data['orderList'] = $this->order_model->view_order_details('Paid', $condition, $rep_code);\n\t\t\t$this->load->view('admin/order/display_orders', $this->data);\n\t\t}\n\t}", "public function display_custom_payment_heading() {\n\n\t\t\tob_start();\n\t\t\t?>\n\t\t\t<div class=\"ast-payment-option-heading\">\n\t\t\t\t<h3 id=\"ast-payment_options_heading\"><?php esc_html_e( 'Payment', 'astra-addon' ); ?></h3>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\techo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}", "public function display_account_payment_methods( ){\n\t\tif( $this->is_page_visible( \"payment_methods\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' );\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' ) )\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' );\n\t\t}\n\t}", "public function payment_fields(){\n if ( $description = $this->get_description() ) {\n echo wpautop( wptexturize( $description ) );\n }\n\n echo '<style>#payment_duration_field label.radio { display:inline-block;margin: .1em 2em 0 .05em !important;}</style>';\n\n $option_keys = array_keys($this->options);\n\n woocommerce_form_field( 'payment_duration', array(\n 'type' => 'radio',\n 'class' => array('payment_duration form-row-wide'),\n //'label' => __('Payment Information', $this->domain),\n 'options' => $this->options,\n ), reset( $option_keys ) );\n }", "public function paid(){\n \n $result = $this->pay->paid();\n \n $result['usertypeid'] = $this->main->get('usertypeid');\n $result['usertype'] = $this->main->get('usertype');\n $result['amount2word'] = convert_number_to_words((double)$result['amt']);\n\n $page_name = 'paid';\n \n $data['result'] = $result;\n \n //build view page for successfull Payment \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n \n }", "function pnh_getreceiptttl_valuebytypecash($type=0,$cash_type=false)\r\n\t{\r\n\t\tif($type==0)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 and is_submitted=0 and r.payment_mode=? ORDER BY instrument_date DESC\",$cash_type)->row_array();\r\n\t\tif($type==1 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) <= curdate() and is_submitted=0 and r.payment_mode=? and r.is_active=1 ORDER BY instrument_date asc\",$cash_type)->row_array();\r\n\t\tif($type==2 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) > curdate() and is_submitted=0 and r.payment_mode=? ORDER BY instrument_date asc\",$cash_type)->row_array();\r\n\t\tif($type==3)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,DATE_FORMAT(r.activated_on,'%d/%m/%Y')as activated_on,f.franchise_name,a.name AS admin,d.username AS activated_by FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by LEFT OUTER JOIN king_admin d ON d.id=r.activated_by WHERE r.status=1 AND r.is_active=1 and is_submitted=1 and r.payment_mode=? ORDER BY date(from_unixtime(activated_on)) DESC\",$cash_type)->row_array();\r\n\t\tif($type==4)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,b.bank_name AS submit_bankname,s.name AS submittedby,a.name AS admin,f.franchise_name,d.remarks AS submittedremarks,date(d.submitted_on) AS submitted_on FROM `pnh_m_deposited_receipts`d JOIN `pnh_t_receipt_info` r ON r.receipt_id=d.receipt_id JOIN `pnh_m_bank_info` b ON b.id=d.bank_id JOIN king_admin s ON s.id=d.submitted_by JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id left outer join king_admin a on a.id=r.created_by WHERE r.is_submitted=1 AND r.status=0 and r.is_active=1 and r.payment_mode=? order by d.submitted_on desc\",$cash_type)->row_array();\r\n\t\tif($type==5)\r\n\t\t{\r\n\t\t\t$sql = \"SELECT r.*,f.franchise_name,a.name AS admin,d.username AS activated_by ,c.cancel_reason,c.cancelled_on,sum(receipt_amount) as total \r\n\t\t\t\t\t\tFROM pnh_t_receipt_info r \r\n\t\t\t\t\t\tJOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id \r\n\t\t\t\t\t\tleft JOIN `pnh_m_deposited_receipts`c ON c.receipt_id=r.receipt_id\r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin a ON a.id=r.created_by \r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin d ON d.id=r.activated_by \r\n\t\t\t\t\t\tWHERE r.status in (2,3) AND r.is_active=1 AND r.is_active=1 \r\n\t\t\t\t\t\tand r.payment_mode=? \r\n\t\t\t\t\t\tORDER BY cancelled_on DESC\";\r\n\t\t\t$total_value=$this->db->query($sql,$cash_type)->row_array();\r\n\t\t}\t\r\n\t\treturn $total_value;\r\n\t}", "function receipt_page( $order ) {\n\t\terror_reporting(E_ERROR);\n\t\tini_set('display_errors', 1);\n\n\t\techo '<p>'.__( 'Спасибо за ваш заказ. Нажмите кнопку, для перехода к оплате через Твои Платежи.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_payu_form( $order );\n\n\t}", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "public function paymentReport($payments, $type, $limit = 7)\n {\n $paymentTotal = null;\n switch ($type) {\n case 1:\n $paymentTotal = $this->getPaymentTotal($payments->get());\n break;\n case 2:\n $total = array();\n $periods = CarbonPeriod::create(Carbon::now()->subdays($limit), Carbon::now());\n if (isset($periods)) {\n foreach ($periods as $period) {\n $period_payments = $payments->whereDate('created_at', $period)->get();\n $total[$period->toFormattedDateString()] = $this->getPaymentTotal($period_payments);\n }\n $paymentTotal = $total;\n break;\n }\n case 3:\n $total = array();\n $payment_ids = $payments->pluck('id')->toArray();\n $year = isset($payment_ids) ? (count($payment_ids) > 0 ? Payment::find($payment_ids[0])->created_at->year : Carbon::now()->year) : Carbon::now()->year;\n foreach (range(1, 12) as $month) {\n $total[Carbon::create($year, $month, 1)->format('F')] = $this->getPaymentTotal(Payment::whereIn('id', $payment_ids)->whereMonth('created_at', $month)->get());\n }\n $paymentTotal = $total;\n break;\n case 4:\n $current_year = Carbon::now()->year;\n $payment_ids = $payments->pluck('id')->toArray();\n foreach (range(($current_year - $limit), ($current_year + $limit)) as $year) {\n $year_payments = Payment::whereIn('id', $payment_ids)->whereYear('created_at', $year)->get();\n $total[$year] = $this->getPaymentTotal($year_payments);\n }\n $paymentTotal = $total;\n break;\n default:\n $paymentTotal = $this->getPaymentTotal($payments->get());\n break;\n }\n return $paymentTotal;\n }", "function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id) {\n\n\tif (!$this->selectedThisByMethodId($payment_method_id)) {\n\t return null; // Another method was selected, do nothing\n\t}\n\n\t$db = JFactory::getDBO();\n\t$q = 'SELECT * FROM `' . $this->_tablename . '` '\n\t\t. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;\n\t$db->setQuery($q);\n\tif (!($paymentTable = $db->loadObject())) {\n\t // JError::raiseWarning(500, $db->getErrorMsg());\n\t return '';\n\t}\n\t$this->getPaymentCurrency($paymentTable);\n\t$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`=\"' . $paymentTable->payment_currency . '\" ';\n\t$db = &JFactory::getDBO();\n\t$db->setQuery($q);\n\t$currency_code_3 = $db->loadResult();\n\t$html = '<table class=\"adminlist\">' . \"\\n\";\n\t$html .=$this->getHtmlHeaderBE();\n\t$html .= $this->getHtmlRowBE('COMMBANK_PAYMENT_NAME', $paymentTable->payment_name);\n\t//$html .= $this->getHtmlRowBE('COMMBANK_PAYMENT_TOTAL_CURRENCY', $paymentTable->payment_order_total.' '.$currency_code_3);\n\t$code = \"commbank_response_\";\n\tforeach ($paymentTable as $key => $value) {\n\t if (substr($key, 0, strlen($code)) == $code) {\n\t\t$html .= $this->getHtmlRowBE($key, $value);\n\t }\n\t}\n\t$html .= '</table>' . \"\\n\";\n\treturn $html;\n }", "public function getPaymentsForm($type, $id) {\n\t\t\n\t\t$payments = array ();\n\t\t$banks = Banks::findAllActive ( \"classname\", true );\n\t\t\n\t\tif (! empty ( $banks )) {\n\t\t\tforeach ( $banks as $bank ) {\n\t\t\t\tif (! empty ( $bank ['classname'] ) && class_exists ( $bank ['classname'] )) {\n\t\t\t\t\tif (class_exists ( $bank ['classname'] )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$class = $bank ['classname'];\n\t\t\t\t\t\t$payment = new $class ( $id );\n\t\t\t\t\t\t$payment->setUrlOk ( $_SERVER ['HTTP_HOST'] . \"/orders/response/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t$payment->setUrlKo ( $_SERVER ['HTTP_HOST'] . \"/orders/response/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t$payment->setUrlCallback ( $_SERVER ['HTTP_HOST'] . \"/common/callback/gateway/\" . md5 ( $bank ['classname'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$payments [] = $payment->CreateForm ();\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->view->payments = $payments;\n\t\t\n\t\t// Path of the template\n\t\treturn $this->view->render ( 'partials/payments.phtml' );\n\t}", "function cb_order_meta_general( $order ) {\n\tif ($order->get_payment_method() == 'coinbase') {\n\t\t?>\n\n\t\t<br class=\"clear\"/>\n\t\t<h3>Coinbase Commerce Data</h3>\n\t\t<div class=\"\">\n\t\t\t<p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p>\n\t\t</div>\n\n\t\t<?php\n\t}\n}", "public function returnPaymentType($start_date,$end_date){\n\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t$select = $mcoCash->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_cash\"), array('type','amount' => new Zend_Db_Expr('SUM(amount)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'full_composition' => new Zend_Db_Expr('CAST(SUM(value*amount) as DECIMAL(11,3))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'liquid_composition' => new Zend_Db_Expr('(SUM(CASE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE CAST((value*amount)-((value*amount)*0.0037) as DECIMAL(11,2)) END))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'cbtu_transfer' => new Zend_Db_Expr('SUM(CASE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE 0 END)')))\n\t\t->joinInner(array('m' => 'mco'), 'm.id=mc.mco_id')\n\t\t->where('date_operation >= ?', Application_Model_General::dateToUs($start_date))\n\t\t->where('date_operation <= ?', Application_Model_General::dateToUs($end_date))\n\t\t->where('status=1')\n\t\t->group('type');\n\t\treturn $mcoCash->fetchAll($select);\n\t}", "protected function setTotalAmount($value, $type)\n\t{\n\t\t$this->setNumbersFont(10);\n\t\tif ($type == TypeEnum::A){\n\t\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t\t$this->_getPdf()->pages[$i]->drawText($this->asMonospacedNumber($value,11), 498, 86, 'UTF-8');\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t\t$this->_getPdf()->pages[$i]->drawText($this->asMonospacedNumber($value,11), 498, 89, 'UTF-8');\n\t\t\t}\t\t\t\t\n\t\t}\n\t}", "public function form_order_type() {\n\t\tglobal $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t$data = array();\n\n\t\tif ( !isset( $_REQUEST['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual-form-builder-pro' !== $_REQUEST['page'] )\n\t\t\treturn;\n\n\t\tif ( isset( $_REQUEST['mode'] ) ) :\n\t\t\t$user_id = $current_user->ID;\n\n\t\t\t$type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t\t$meta_value = ( in_array( $_REQUEST['mode'], array( 'order', 'list' ) ) ) ? esc_html( $_REQUEST['mode'] ) : '';\n\t\t\tupdate_user_meta( $user_id, 'vfb-form-order-type', $meta_value );\n\n\t\tendif;\n\t}", "function fees_details($conn){\n $cash=\"SELECT * FROM get_fees_payment_history\";\n $cash=$conn->query($cash);\n while ($c=$cash->fetch_assoc()){\n\n if ($c['payTypeID']==1){\n $payType=\"Cash\";\n }elseif ($c['payTypeID']==2){\n $payType=\"Bank\";\n }\n\n echo \"\n <tr>\n <td >{$c['payDate']}</td>\n <td>{$c['studentID']}</td>\n <td>{$c['payTypeID']}</td>\n <td>{$c['fees_amount']}</td>\n <td>Both</td>\n </tr>\";\n }\n}", "static function generateTotalHTML($a_amount)\n\t{\n\t\techo \"<tr class='inTableRow'>\\n\";\n//\t\techo \"<th class='inTableColTaskID'>Task ID</th>\\n\";\n\t\techo \"<th class='inTableColTaskName'></th>\\n\";\n\t\techo \"<th></th>\\n\";\n\t\techo \"<th class='chTableColAmount inTableTotal'>Total:</th>\\n\";\n\t\techo \"<th class='inTotal'>$a_amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function action_account_summary() {\n $package = Model::factory('package');\n $paid_amount = $package->total_paid_amount(); \n $this->template->title = CLOUD_SITENAME . ' | Account'; \n $this->template->page_title = __('account_info');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_summary\")\n ->bind('paid_amount', $paid_amount);\n }", "public function memberAdminMemberListAmountPaidByTypeSummary($eid, &$content)\n {\n $types = SimpleConregOptions::memberTypes($eid);\n $headers = [\n t('Member Type'),\n t('Amount Paid'),\n t('Number of members'),\n t('Total Paid'),\n ];\n $rows = [\n '#type' => 'table',\n '#header' => $headers,\n '#empty' => t('No entries available.'),\n ];\n $total = 0;\n $total_amount = 0;\n foreach ($entries = SimpleConregStorage::adminMemberAmountPaidByTypeSummaryLoad($eid) as $entry) {\n // Replace type code with description.\n if (isset($types->types[$entry['member_type']]))\n $entry['member_type'] = (isset($types->types[$entry['member_type']]) ? $types->types[$entry['member_type']]->name : $entry['member_type']);\n // Calculate total received at that rate.\n $total_paid = $entry['member_price'] * $entry['num'];\n $entry['total_paid'] = number_format($total_paid, 2);\n // Sanitize each entry.\n $rows[] = [\n ['#markup' => isset($types->types[$entry['member_type']]) ? $types->types[$entry['member_type']]->name : $entry['member_type']],\n ['#markup' => $entry['member_price']],\n ['#markup' => $entry['num']],\n ['#markup' => number_format($total_paid, 2)],\n ];\n\n // Add to totals.\n $total += $entry['num'];\n $total_amount += $total_paid;\n }\n //Add a row for the total.\n $rows['total'] = [\n ['#markup' => t(\"Total\"), '#wrapper_attributes' => ['class' => ['table-total']]],\n ['#markup' => '', '#wrapper_attributes' => ['class' => ['table-total']]],\n ['#markup' => $total, '#wrapper_attributes' => ['class' => ['table-total']]],\n ['#markup' => number_format($total_amount, 2), '#wrapper_attributes' => ['class' => ['table-total']]],\n ];\n $content['type_amount_paid_summary'] = $rows;\n\n return $content;\n }", "public function getOrderType();", "public function prepareSummaryRecord($type = 'overall')\r\r\n {\r\r\n $payments = [];\r\r\n if ($type == 'online') {\r\r\n $payments['all'] = $this->getRecordsCount('online');\r\r\n $payments['success'] = $this->getRecordsCount('online', 'success');\r\r\n $payments['cancelled'] = $this->getRecordsCount('online', 'cancelled');\r\r\n $payments['pending'] = $this->getRecordsCount('online', 'pending');\r\r\n } else if ($type == 'offline') {\r\r\n $payments['all'] = $this->getRecordsCount('offline');\r\r\n $payments['success'] = $this->getRecordsCount('offline', 'success');\r\r\n $payments['cancelled'] = $this->getRecordsCount('offline', 'cancelled');\r\r\n $payments['pending'] = $this->getRecordsCount('offline', 'pending');\r\r\n }\r\r\n return $payments;\r\r\n }", "public static function checkout_order_payment_plan() {\n\n check_ajax_referer( 'sumo-pp-checkout-order-payment-plan' , 'security' ) ;\n\n if ( 'yes' === $_POST[ 'enabled' ] ) {\n $payment_type = wc_clean( $_POST[ 'payment_type' ] ) ;\n $deposited_amount = null ;\n $chosen_payment_plan = null ;\n\n switch ( $payment_type ) {\n case 'pay-in-deposit':\n if ( isset( $_POST[ 'deposited_amount' ] ) ) {\n $deposited_amount = $_POST[ 'deposited_amount' ] ;\n }\n break ;\n case 'payment-plans':\n if ( isset( $_POST[ 'chosen_payment_plan' ] ) ) {\n $chosen_payment_plan = $_POST[ 'chosen_payment_plan' ] ;\n }\n break ;\n }\n\n if ( ! is_null( $deposited_amount ) || ! is_null( $chosen_payment_plan ) ) {\n WC()->session->__unset( _sumo_pp()->prefix . 'order_payment_plan_props' ) ;\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , SUMO_PP_Order_Payment_Plan::set_order_props( $deposited_amount , $chosen_payment_plan ) ) ;\n } else {\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , array () ) ;\n }\n } else {\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , array () ) ;\n }\n die() ;\n }", "function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Shipping Method').':</strong> ' . get_post_meta( $order->id, 'shippingMethod', true ) . '</p>';\n }", "function pnh_getreceiptttl_valuebytype($type=0)\r\n\t{\r\n\t\tif($type==0)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,f.franchise_name,a.name AS admin,sum(receipt_amount) as total FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 and is_submitted=0 \")->row_array();\r\n\t\tif($type==1 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,f.franchise_name,a.name AS admin,sum(receipt_amount) as total FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) <= curdate()and is_submitted=0 ORDER BY instrument_date asc\")->row_array();\r\n\t\tif($type==2 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,f.franchise_name,a.name AS admin,sum(receipt_amount) as total FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) > curdate()and is_submitted=0 ORDER BY instrument_date asc\")->row_array();\r\n\t\tif($type==3)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,DATE_FORMAT(r.activated_on,'%d/%m/%Y')as activated_on,f.franchise_name,a.name AS admin,d.username AS activated_by,sum(receipt_amount) as total FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by LEFT OUTER JOIN king_admin d ON d.id=r.activated_by WHERE r.status=1 AND r.is_active=1 and (is_submitted=1 or r.activated_on!=0) and r.is_active=1 ORDER BY activated_on desc\")->row_array();\r\n\t\tif($type==4)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,b.bank_name AS submit_bankname,s.name AS submittedby,a.name AS admin,f.franchise_name,d.remarks AS submittedremarks,d.submitted_on,sum(receipt_amount) as total,r.created_on FROM pnh_t_receipt_info r LEFT JOIN `pnh_m_deposited_receipts`d ON d.receipt_id=r.receipt_id LEFT JOIN `pnh_m_bank_info` b ON b.id=d.bank_id LEFT JOIN king_admin s ON s.id=d.submitted_by JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id left outer join king_admin a on a.id=r.created_by WHERE r.is_submitted=1 AND r.status=0 and r.is_active=1 order by d.submitted_on desc\")->row_array();\r\n\t\tif($type==5)\r\n\t\t{\r\n\t\t\t$sql = \"SELECT r.*,f.franchise_name,a.name AS admin,d.username AS activated_by ,c.cancel_reason,c.cancelled_on,sum(receipt_amount) as total \r\n\t\t\t\t\t\tFROM pnh_t_receipt_info r \r\n\t\t\t\t\t\tJOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id \r\n\t\t\t\t\t\tleft JOIN `pnh_m_deposited_receipts`c ON c.receipt_id=r.receipt_id\r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin a ON a.id=r.created_by \r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin d ON d.id=r.activated_by \r\n\t\t\t\t\t\tWHERE r.status in (2,3) AND r.is_active=1 AND r.is_active=1 \r\n\t\t\t\t\t\tORDER BY cancelled_on DESC\";\r\n\t\t\t$total_value=$this->db->query($sql,$tid)->row_array();\r\n\t\t}\t\r\n\t\treturn $total_value;\r\n\t}", "public function shippingMethods($type){\n\n if ($type === 'free')\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n\n elseif ($type === 'inner')\n $shippingMethod = Setting::where('key', 'local_label')->first();\n\n elseif ($type === 'outer')\n $shippingMethod = Setting::where('key', 'outer_label')->first();\n else\n $shippingMethod = Setting::where('key', 'free_shipping_label')->first();\n\n\n return view('admin.settings.shippings.shipping', compact('shippingMethod'));\n\n }", "public function profit_dollar_widget() {\n\t$this->load->model('widget_model');\n\t$widget_data = $this->widget_model->profit_dollar_widget();\n\n\t//send data array to build a formatted table\n\t$this->load->model('display_tabular_data');\n\t$widget_table = $this->display_tabular_data->build_table($widget_data, false, WIDGET_TABLE_CLASS);\n\n\techo $widget_table;\n }", "function wv_commission_table_heading_list($type = \"thead\") {\n $output = \"\";\n\n //verify the header and footer of the table list\n $type = ($type == \"thead\") ? \"thead\" : \"tfoot\";\n\n $output .=\"<$type>\";\n $output .=\" <tr>\n <th>#OrderId</th>\n <th>Order Date</th>\n <th>ProductName</th>\n <th>Vendor</th>\n <th>Commission</th>\n <th>Status</th>\n <th>Commission Date</th>\n </tr>\";\n\n $output .=\"</$type>\";\n return $output;\n }", "public function payment_fields() {\n\t\t$user = wp_get_current_user();\n\t\t$display_tokenization = $this->supports( 'tokenization' ) && is_checkout();\n\t\t$total = WC()->cart->total;\n\n\t\tif ( $user->ID ) {\n\t\t\t$user_email = get_user_meta( $user->ID, 'billing_email', true );\n\t\t\t$user_email = $user_email ? $user_email : $user->user_email;\n\t\t} else {\n\t\t\t$user_email = '';\n\t\t}\n\n\t\techo '<div\n\t\t\tid=\"xendit-payment-data\"\n\t\t\tdata-description=\"\"\n\t\t\tdata-email=\"' . esc_attr( $user_email ) . '\"\n\t\t\tdata-amount=\"' . esc_attr( $this->get_xendit_amount( $total ) ) . '\"\n\t\t\tdata-name=\"' . esc_attr( $this->statement_descriptor ) . '\"\n\t\t\tdata-currency=\"' . esc_attr( strtolower( get_woocommerce_currency() ) ) . '\"\n\t\t\tdata-locale=\"' . esc_attr( 'en' ) . '\"\n\t\t\tdata-image=\"' . esc_attr( $this->xendit_checkout_image ) . '\"\n\t\t\tdata-allow-remember-me=\"' . esc_attr( $this->saved_cards ? 'true' : 'false' ) . '\">';\n\n\t\tif ( $this->description ) {\n\t\t\techo apply_filters( 'wc_xendit_description', wpautop( wp_kses_post( $this->description ) ) );\n\t\t}\n\n\t\tif ( $display_tokenization ) {\n\t\t\t$this->tokenization_script();\n\t\t}\n\n\t\t$this->form();\n\t\techo '</div>';\n\t}", "function uc_op_products_customer_table($order) {\n $table = array(\n '#type' => 'tapir_table',\n '#attributes' => array('class' => array('order-pane-table')),\n );\n\n $table['#columns']['qty'] = array(\n 'cell' => array(\n 'data' => theme('uc_qty_label'),\n 'class' => array('qty'),\n ),\n 'weight' => 0,\n );\n $table['#columns']['product'] = array(\n 'cell' => array(\n 'data' => t('Product'),\n 'class' => array('product'),\n ),\n 'weight' => 1,\n );\n $table['#columns']['model'] = array(\n 'cell' => array(\n 'data' => t('SKU'),\n 'class' => array('sku'),\n ),\n 'weight' => 2,\n );\n if (user_access('administer products')) {\n $table['#columns']['cost'] = array(\n 'cell' => array(\n 'data' => t('Cost'),\n 'class' => array('cost'),\n ),\n 'weight' => 3,\n );\n }\n $table['#columns']['price'] = array(\n 'cell' => array(\n 'data' => t('Price'),\n 'class' => array('price'),\n ),\n 'weight' => 4,\n );\n $table['#columns']['total'] = array(\n 'cell' => array(\n 'data' => t('Total'),\n 'class' => array('total'),\n ),\n 'weight' => 5,\n );\n\n $table['#columns']['vat_rate'] = array(\n 'cell' => array(\n 'data' => t('VAT rate'),\n 'class' => array('vat-rate'),\n ),\n 'weight' => 6,\n );\n\n if (!empty($order->products)) {\n $build = uc_order_product_view_multiple($order->products);\n $table['#rows'] = $build['uc_order_product'];\n }\n else {\n $table['#rows'][]['product'] = array(\n '#markup' => t('This order contains no products.'),\n '#cell_attributes' => array('colspan' => 'full'),\n );\n }\n\n return $table;\n}", "function uc_op_products_view_table($order) {\n $table = array(\n '#type' => 'tapir_table',\n '#attributes' => array('class' => array('order-pane-table')),\n );\n\n $table['#columns']['qty'] = array(\n 'cell' => array(\n 'data' => theme('uc_qty_label'),\n 'class' => array('qty'),\n ),\n 'weight' => 3,\n );\n $table['#columns']['product'] = array(\n 'cell' => array(\n 'data' => t('Product'),\n 'class' => array('product'),\n ),\n 'weight' => 2,\n );\n $table['#columns']['model'] = array(\n 'cell' => array(\n 'data' => t('SKU'),\n 'class' => array('sku'),\n ),\n 'weight' => 1,\n );\n if (user_access('administer products')) {\n $table['#columns']['cost'] = array(\n 'cell' => array(\n 'data' => t('Cost'),\n 'class' => array('cost'),\n ),\n 'weight' => 4,\n );\n }\n $table['#columns']['price'] = array(\n 'cell' => array(\n 'data' => t('Price'),\n 'class' => array('price'),\n ),\n 'weight' => 4,\n );\n $table['#columns']['total'] = array(\n 'cell' => array(\n 'data' => t('Total'),\n 'class' => array('total'),\n ),\n 'weight' => 5\n );\n\n $table['#columns']['vat_rate'] = array(\n 'cell' => array(\n 'data' => t('VAT rate'),\n 'class' => array('vat-rate'),\n ),\n 'weight' => 6,\n );\n\n if (!empty($order->products)) {\n $build = uc_order_product_view_multiple($order->products);\n $table['#rows'] = $build['uc_order_product'];\n }\n else {\n $table['#rows'][]['product'] = array(\n '#markup' => t('This order contains no products.'),\n '#cell_attributes' => array('colspan' => 'full'),\n );\n }\n return $table;\n}", "public function purchase_return_table($purchase_return_no)\n {\n $details = $this->MPurchase_return_details->get_by_purchase_return_no($purchase_return_no);\n\n $msg = '\n <table id=\"data_table\" class=\"table table-bordered table-striped responsive\">\n <thead>\n <tr>\n <th class=\"left\">Item Code</th>\n <th class=\"left\">Item Name</th>\n <th class=\"center\">Quantity</th>\n <th class=\"center\">Unit Price</th>\n <th class=\"center\">Total Price</th>\n <th class=\"span3 center\">Action</th>\n </tr>\n </thead>';\n $msg .= '<tbody>';\n $qty = 0;\n $price = 0;\n if (count($details) > 0)\n {\n foreach ($details as $list)\n {\n $msg .= '\n <tr>\n <td>' . $list['item_code'] . '</td>\n <td>' . $list['item_name'] . '</td>\n <td class=\"center\">' . $list['quantity'] . '</td>\n <td class=\"right\">' . number_format($list['purchase_price'], 2) . '</td>\n <td class=\"right\">' . number_format($list['quantity'] * $list['purchase_price'], 2) . '</td>\n <td class=\"center\">\n <input type=\"hidden\" value=\"' . $list['id'] . '\" /><span class=\"btn btn-danger purchase_return_item_delete\"><i class=\"icon-trash icon-white\"></i>Delete</span>\n </td>\n </tr>';\n $qty += $list['quantity'];\n $price += $list['quantity'] * $list['purchase_price'];\n }\n }\n $msg .= '</tbody>\n <tfoot>\n <tr>\n <th class=\"left\" colspan=\"6\">Order Totals</th>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp</td>\n <td class=\"center\">' . $qty . '</td>\n <td></td>\n <td class=\"right\">' . number_format($price, 2) . '</td><td></td>\n </tr>\n <tr>\n <td colspan=\"4\" class=\"right\"> Total Paid Amount</td>\n <td class=\"right\"><input type=\"text\" name=\"paid_amount\" id=\"paid_amount\"></td>\n <td></td>\n </tr>\n </tfoot>\n </table>';\n\n return $msg;\n }", "public function render()\n {\n $myConfig = $this->getConfig();\n parent::render();\n\n $oOrder = oxNew(\"oxOrder\");\n $oCur = $myConfig->getActShopCurrencyObject();\n $oLang = oxRegistry::getLang();\n\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder->load($soxId);\n\n $this->_aViewData[\"edit\"] = $oOrder;\n $this->_aViewData[\"aProductVats\"] = $oOrder->getProductVats();\n $this->_aViewData[\"orderArticles\"] = $oOrder->getOrderArticles();\n $this->_aViewData[\"giftCard\"] = $oOrder->getGiftCard();\n $this->_aViewData[\"paymentType\"] = $this->_getPaymentType($oOrder);\n $this->_aViewData[\"deliveryType\"] = $oOrder->getDelSet();\n $sTsProtectsField = 'oxorder__oxtsprotectcosts';\n if ($oOrder->$sTsProtectsField->value) {\n $this->_aViewData[\"tsprotectcosts\"] = $oLang->formatCurrency($oOrder->$sTsProtectsField->value, $oCur);\n }\n }\n\n // orders today\n $dSum = $oOrder->getOrderSum(true);\n $this->_aViewData[\"ordersum\"] = $oLang->formatCurrency($dSum, $oCur);\n $this->_aViewData[\"ordercnt\"] = $oOrder->getOrderCnt(true);\n\n // ALL orders\n $dSum = $oOrder->getOrderSum();\n $this->_aViewData[\"ordertotalsum\"] = $oLang->formatCurrency($dSum, $oCur);\n $this->_aViewData[\"ordertotalcnt\"] = $oOrder->getOrderCnt();\n $this->_aViewData[\"afolder\"] = $myConfig->getConfigParam('aOrderfolder');\n $this->_aViewData[\"alangs\"] = $oLang->getLanguageNames();\n\n $this->_aViewData[\"currency\"] = $oCur;\n\n return \"order_overview.tpl\";\n }", "public function payment_type()\n {\n return $this->belongsTo('App\\PaymentType');\n }", "function payment_fields() {\n if ($this->description) echo wpautop(wptexturize($this->description));\n ?>\n <ol class=\"my-list\">\n <li>Entrez votre numéro MTN Mobile Money dans le champ de formulaire ci-dessous</li>\n <li>Vous recevrez un message vous demandant de composer *126# et d'entrer votre code PIN</li>\n <li>Composez *126# et entrez votre code PIN pour confirmer votre paiement</li>\n <li>Si le paiement est effectué, votre commande sera automatiquement validé</li>\n </ol>\n\n <label for=\"\">Entrez votre numéro MTN Mobile Money</label>\n\n <input type=\"text\" name=\"gt_user_momo_number\" value=\"\"\n style=\"background-color: #fff; border-radius: 0px; color: #222;\"required class=\"form-controll\"\n placeholder=\"Enter your phone number\">\n <?php\n }", "function totalSale()\r\n {\r\n //$strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function show(Payment $payment)\n {\n //\n }", "public function orders_datatable()\n\t\t{\n\t\t\t\n\t\t\t$list = $this->Orders->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $order) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t//$row[] = '<input type=\"checkbox\" name=\"cb[]\" id=\"cb\" onclick=\"enableButton(this)\" value=\"'.$order->id.'\">';\n\t\t\t\t\n\t\t\t\t$url = 'admin/order_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$order->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:40%; margin-right:40%;\"><a data-toggle=\"modal\" href=\"#\" data-target=\"#viewOrderModal\" class=\"link\" onclick=\"viewOrder('.$order->id.',\\''.$url.'\\');\" title=\"View\">'.$order->reference.'</a></div>';\n\t\t\t\t\n\t\t\t\t$row[] = '$'.number_format($order->total_price, 0);\n\t\t\t\t$row[] = $order->num_of_items;\n\t\t\t\t\n\t\t\t\t$user_array = $this->Users->get_user($order->customer_email);\n\t\t\t\t\t\n\t\t\t\t$fullname = '';\n\t\t\t\tif($user_array){\n\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row[] = $fullname .' ('.$order->customer_email.')';\n\t\t\t\t\n\t\t\t\t//GET PAYMENT STATUS FROM TRANSACTION DB\n\t\t\t\t$transaction_array = $this->Transactions->get_transaction($order->reference);\n\t\t\t\t$payment_status = '';\n\t\t\t\tif($transaction_array){\n\t\t\t\t\tforeach($transaction_array as $transaction){\n\t\t\t\t\t\t$payment_status = $transaction->status;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($payment_status == '1'){\n\t\t\t\t\t$payment_status = '<span class=\"badge bg-green\">Paid</span>';\n\t\t\t\t}else{\n\t\t\t\t\t$payment_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t}\n\t\t\t\t$row[] = $payment_status;\n\t\t\t\t\n\t\t\t\t//GET SHIPPING STATUS FROM DB\n\t\t\t\t$shipping_array = $this->Shipping->get_shipping($order->reference);\n\t\t\t\t$shipping_status = '';\n\t\t\t\tif($shipping_array){\n\t\t\t\t\tforeach($shipping_array as $shipping){\n\t\t\t\t\t\t$shipping_status = $shipping->status;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($shipping_status == '1'){\n\t\t\t\t\t$shipping_status = '<span class=\"badge bg-green\">Shipped</span>';\n\t\t\t\t}else{\n\t\t\t\t\t$shipping_status = '<span class=\"badge bg-yellow\">Pending</span>';\n\t\t\t\t}\n\t\t\t\t$row[] = $shipping_status;\n\t\t\t\t\n\t\t\t\t$row[] = date(\"F j, Y\", strtotime($order->order_date));\n\t\t\t\t\n\t\t\t\t$row[] = date(\"F j, Y, g:i a\", strtotime($order->last_updated));\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-info btn-xs\" onclick=\"editOrder('.$order->id.',\\''.$url.'\\');\" title=\"Edit\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></a>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//$row[] = $type->details;\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Orders->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Orders->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function payment_fields() {\n\t\t$message = $this->get_sandbox_form_message( $this->get_transaction_address( 'country' ) );\n\t\twc_get_template(\n\t\t\t'sandbox-checkout-alert.php',\n\t\t\tarray(\n\t\t\t\t'is_sandbox_mode' => $this->is_sandbox_mode,\n\t\t\t\t'message' => $message,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\t$description = $this->get_description();\n\t\tif ( isset( $description ) ) {\n\t\t\techo wp_kses_post( wpautop( wptexturize( $description ) ) );\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'tef/payment-form.php',\n\t\t\tarray(\n\t\t\t\t'title' => $this->title,\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'id' => $this->id,\n\t\t\t),\n\t\t\t'woocommerce/ebanx/',\n\t\t\tWC_EBANX::get_templates_path()\n\t\t);\n\n\t\tparent::checkout_rate_conversion( WC_EBANX_Constants::CURRENCY_CODE_BRL );\n\t}", "public function getPaymentData($orden){\n\n $query = $this->db->query(\"SELECT numeroOrden,SUM((compra.cantidad*productos.precio))AS costoProducto,SUM(compra.costoEnvio)AS costoEnvio, SUM((compra.cantidad*productos.precio))+SUM(compra.costoEnvio) AS subtotal FROM compra INNER JOIN productos ON compra.producto = productos.id_producto where numeroOrden='\".$orden.\"' GROUP BY numeroOrden\");\n\n return $query->row();\n\n }", "public function hookDisplayPayment()\n {\n if (!$this->active)\n {\n\t\t\treturn;\n }\n\n return $this->display(__FILE__, 'payment.tpl');\n }", "function rsm_sc_payment_types() {\n\n\tob_start();\n\trsm_get_template( 'rsm-payment-types.php' );\n\treturn ob_get_clean();\n\n}", "function data_table($show_type, $thead, $col_head_arr, $data_arr) {\r\n // Validate arguments\r\n if(gettype($thead) !== 'string'\r\n || gettype($col_head_arr) !== 'array'\r\n || gettype($data_arr) !== \"array\"\r\n ) {return false;}\r\n $colhead = $col_head_arr;\r\n $table = \"<table class='today-reports-table'><thead><td colspan='\"\r\n . count($colhead) . \"'>{$thead}</td></thead><tbody><tr>\";\r\n // Set column header of table\r\n for($i = 0; $i < count($colhead); $i++) {\r\n $table .= \"<td>{$colhead[$i]}</td>\";\r\n }\r\n $total_amount = 0;\r\n if($show_type === \"num\") {\r\n for($i = 0; $i < count($data_arr); $i++) {\r\n $table .= \"</tr><tr>\";\r\n for($j = 0; $j < count($data_arr[$i]); $j++) {\r\n $value = $data_arr[$i][$j];\r\n if(count($data_arr[$i]) - $j === 1) {\r\n $total_amount += $value;\r\n $value = number_format($value, 2);\r\n } else {\r\n $value = ucfirst($value);\r\n }\r\n $table .= \"<td>{$value}</td>\";\r\n }\r\n $table .= \"</tr>\";\r\n }\r\n } else if($show_type === \"assoc\") {\r\n for($i = 0; $i < count($data_arr); $i++) {\r\n foreach ($data_arr[$i] as $k => $v) {\r\n $key = ucfirst($k);\r\n $value = number_format($v, 2);\r\n $total_amount += $v;\r\n $table .= \"<tr><td>{$key}</td><td>{$value}</td></tr>\";\r\n }\r\n }\r\n } else {return false;}\r\n $table .= \"<tr><td>Total</td><td colspan='\" . (count($colhead) - 1)\r\n . \"'>\" . number_format($total_amount, 2) . \"</td></tr>\";\r\n $table .= \"</tbody></table>\";\r\n return $table;\r\n }", "public function getPaymentType()\n {\n\n return 'IPAY';\n }", "function grandTotal($param1 = '', $param2 = '', $param3 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect(base_url(), 'refresh');\r\n $page_data['page_name'] = 'grandTotal';\r\n $page_data['page_title'] = get_phrase('Grand Total');\r\n $this->db->order_by('creation_timestamp', 'desc');\r\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\r\n $this->load->view('index', $page_data);\r\n }", "public function getOrderType()\n {\n return $this->order_type;\n }", "function wc_bocpay_display_order_meta_for_admin( $order ){\n $trade_no = get_post_meta( $order->id, 'Bocpay Trade No.', true );\n if( !empty($trade_no ) ){\n echo '<p><strong>交通银行交易流水号:</strong><br />' .$trade_no. '</p>';\n }\n }", "public function getPaymentType(): string\n {\n $paymentMethod = $this->getPaymentMethod();\n $paymentTypes = [\n 'regular_checkout' => __('Regular'),\n 'express_checkout' => __('Express'),\n ];\n\n return (string) ($paymentTypes[$paymentMethod] ?? '');\n }", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "public function getOrderType()\n {\n return 'purchase';\n }", "public function displayPaymentReturn()\n\t{\n\t\tif (Validate::isUnsignedId($this->id_order) && Validate::isUnsignedId($this->id_module))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$order = new Order($this->id_order);\n\t\t\t$currency = new Currency($order->id_currency);\n\n\t\t\tif (Validate::isLoadedObject($order))\n\t\t\t{\n\t\t\t\t$params['total_to_pay'] = $order->getOrdersTotalPaid();\n\t\t\t\t$params['currency'] = $currency->sign;\n\t\t\t\t$params['objOrder'] = $order;\n\t\t\t\t$params['currencyObj'] = $currency;\n\n\n\t\t\t\t$context = Context::getContext();\n\t\t\t\t$this->riloggaCustomer($context->customer);\n\n\t\t\t\treturn Hook::exec('displayPaymentReturn', $params, $this->id_module);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function checkout_payment_data($invoice_id) {\r\n\t//$invoice_id = get_post_meta($payment_id, '_payment_invoice', true);\r\n\t$args = array(\r\n\t\t'post_type' => 'sa_payment',\r\n\t\t'post_status' => 'any',\r\n\t\t'posts_per_page' => -1,\r\n\t\t'meta_query' => array(\r\n\t\t\tarray(\r\n\t\t\t\t'key' => '_payment_invoice',\r\n\t\t\t\t'value' => $invoice_id,\r\n\t\t\t\t'compare' => '=',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\t$payment_id = 0;\r\n\t$query = new WP_Query($args);\r\n\tif($query->have_posts()){\r\n\t\tglobal $post;\r\n\t\twhile($query->have_posts()){\r\n\t\t\t$query->the_post();\r\n\t\t\t$payment_id = $post->ID;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//$payment_id = $item->ID;\r\n\tif( $payment_id > 0 ) {\r\n\t\t$payment = SI_Payment::get_instance( $payment_id );\r\n\t\t$method = $payment->get_payment_method();\r\n\t\t$data = $payment->get_data();\r\n\t\t$detail = '';\r\n\t\tif ( is_array( $data ) ) {\r\n\t\t\t//print_r($data);\r\n\t\t\tforeach ( $data as $key => $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$value = sprintf( '<pre id=\"payment_detail_%s\" style=\"width=\"500px\"; white-space:pre-wrap; text-align: left; font: normal normal 11px/1.4 menlo, monaco, monospaced; padding: 5px;\">%s</pre>', $payment_id, print_r( $value, true ) );\r\n\t\t\t\t}\r\n\t\t\t\tif ( is_string( $value ) ) {\r\n\t\t\t\t\tif( $key == 'date' ) {\r\n\t\t\t\t\t\t$detail .= '<dl>\r\n\t\t\t\t\t\t\t<dt><b>'.ucfirst(str_replace( '_', ' ', $key )).'</b></dt>\r\n\t\t\t\t\t\t\t<dd>'.date(\"Y-m-d\", $value).'</dd>\r\n\t\t\t\t\t\t</dl>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$detail .= '<dl>\r\n\t\t\t\t\t\t\t<dt><b>'.ucfirst(str_replace( '_', ' ', $key )).'</b></dt>\r\n\t\t\t\t\t\t\t<dd>'.$value.'</dd>\r\n\t\t\t\t\t\t</dl>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t$output = '<div id=\"total_detail_info\">';\r\n\t\tif($method == 'Credit (NMI)') {\r\n\t\t\t$output .= '<p>Online Payment</p>';\r\n\t\t} elseif($method == 'Admin Payment') {\r\n\t\t\t$output .= '<div class=\"admin-payment-details\">'.esc_html($detail).'</div>';\r\n\t\t}\r\n\t\t$output .= '</div>';\r\n\t\r\n\t\treturn $output;\r\n\t}\r\n}", "public function get_orderreport_data($options) {\n // Get Cost - Blue and Orange plates\n $this->db->select('oa.*, c.color, i.item_name, i.item_num, o.customer_name, o.order_num, o.profit, o.profit_perc');\n $this->db->select('(oa.price+oa.extracost) as priceea');\n $this->db->select('(oa.extracost)*(oa.shipped+oa.kepted+oa.misprint) as extraitem');\n $this->db->select('(oa.price+oa.extracost)*(oa.shipped+oa.kepted+oa.misprint) as costitem');\n $this->db->select('(oa.shipped+oa.kepted+oa.misprint) as totalitem');\n $this->db->select('(oa.orangeplate+oa.blueplate+oa.beigeplate) as totalplates');\n $this->db->select('(oa.orangeplate*oa.orangeplate_price+oa.blueplate*oa.blueplate_price+oa.beigeplate*oa.beigeplate_price) as platescost');\n $this->db->select('oa.printshop_total as totalitemcost');\n $this->db->select('(oa.price+oa.extracost)*oa.misprint as misprintcost');\n $this->db->select('date_format(from_unixtime(oa.printshop_date),\\'%Y%m%d\\') as sortdatefld',FALSE);\n $this->db->from('ts_order_amounts oa');\n $this->db->join('ts_printshop_colors c', 'c.printshop_color_id=oa.printshop_color_id');\n $this->db->join('ts_printshop_items i','i.printshop_item_id=c.printshop_item_id');\n $this->db->join('ts_orders o','o.order_id=oa.order_id');\n $this->db->where('oa.printshop',1);\n if (isset($options['search'])) {\n $this->db->like('upper(concat(o.order_num, o.customer_name, i.item_num, i.item_name))', $options['search']);\n }\n if (isset($options['report_year'])) {\n $start=strtotime($options['report_year'].'-01-01');\n $year_finish=intval($options['report_year']+1);\n $finish=strtotime($year_finish.'-01-01');\n $this->db->where('oa.printshop_date >= ', $start);\n $this->db->where('oa.printshop_date < ', $finish);\n }\n if (isset($options['limit'])) {\n if (isset($options['offset'])) {\n $this->db->limit($options['limit'], $options['offset']);\n } else {\n $this->db->limit($options['limit']);\n }\n }\n if (isset($options['brand']) && $options['brand']!=='ALL') {\n if ($options['brand']=='SR') {\n $this->db->where('o.brand', $options['brand']);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->order_by(\"sortdatefld desc, oa.update_date desc\");\n\n $res=$this->db->get()->result_array();\n if (isset($options['export']) && $options['export']==1) {\n return $res;\n }\n\n // Calc start index\n $startidx=$options['totals']-$options['offset'];\n $data=array();\n foreach ($res as $row) {\n $misprint_proc=($row['shipped']==0 ? 0 : $row['misprint']/$row['shipped']*100);\n $data[]=array(\n 'printshop_income_id'=>$row['amount_id'],\n 'numpp'=>$startidx,\n 'order_date'=>date('j-M', $row['printshop_date']),\n 'order_num'=>$row['order_num'],\n 'customer'=>$row['customer_name'],\n 'item_name'=>$row['item_num'].' '.str_replace('Stress Balls', '', $row['item_name']),\n 'color'=>$row['color'],\n 'shipped'=>$row['shipped'],\n 'kepted'=>$row['kepted'],\n 'misprint'=>$row['misprint'],\n 'misprint_proc'=>round($misprint_proc,0).'%',\n 'total_qty'=>$row['totalitem'],\n 'price'=>$row['price'],\n 'extracost'=>$row['extracost'],\n 'totalea'=>round($row['priceea'],3),\n 'extraitem'=>round($row['extraitem'],2),\n 'costitem'=>round($row['costitem'],2),\n 'oranplate'=>$row['orangeplate'],\n 'blueplate'=>$row['blueplate'],\n 'beigeplate' => $row['beigeplate'],\n 'totalplates'=>$row['totalplates'],\n 'platescost'=>$row['platescost'],\n 'itemstotalcost'=>$row['totalitemcost'],\n 'misprintcost'=>$row['misprintcost'],\n 'orderclass'=>($row['printshop_type']=='M' ? 'manualinput' : 'systeminput'),\n 'order_id'=>$row['order_id'],\n );\n $startidx--;\n }\n return $data;\n }", "public static function order_meta_box_payment_actions( $order ) {\n\t\t$order = wc_get_order( $order );\n \t\t$payment_id = $order->get_meta( '_payex_payment_id' );\n\t\tif ( empty( $payment_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get Payment Gateway\n\t\t$gateway = self::get_payment_method( $order );\n\t\tif ( ! $gateway ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fetch payment info\n\t\ttry {\n\t\t\t/** @var \\WC_Gateway_Swedbank_Pay_Checkout $gateway */\n\t\t\t$result = $gateway->core->fetchPaymentInfo( $payment_id );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// Request failed\n\t\t\treturn;\n\t\t}\n\n\t\twc_get_template(\n\t\t\t'admin/payment-actions.php',\n\t\t\tarray(\n\t\t\t\t'gateway' => $gateway,\n\t\t\t\t'order' => $order,\n\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t'payment_id' => $payment_id,\n\t\t\t\t'info' => $result,\n\t\t\t),\n\t\t\t'',\n\t\t\tdirname( __FILE__ ) . '/../templates/'\n\t\t);\n\t}", "function getTotalsForDisplay()\n {\n $amount = $this->getSource()->formatPriceTxt($this->getAmount());\n\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix() . $amount;\n }\n\n $title = __($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = ['amount' => $amount, 'label' => $label, 'font_size' => $fontSize];\n return [$total];\n }", "public function hookDisplayPayment()\n\t{\n\t\tif (!$this->active)\n\t\t\treturn;\n $titlel = Configuration::get(\n 'WIPEI_TITLEL',\n $this->context->language->id\n );\n $descl = Configuration::get(\n 'WIPEI_DESCL',\n $this->context->language->id\n );\n\t\t$this->smarty->assign(array(\n\t\t\t//'nombre' => Configuration::get($this->getPrefijo('PREFIJO_CONFIG').'_FRONTEND_NAME'),//nombre que se muestra al momento de elegir los metodos de pago\n 'this_path' => $this->_path,\n 'titlel' => $titlel,\n 'descl' => $descl,\n\t\t\t'this_path_ejemplo' => $this->_path,\n\t\t\t'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/',\n\t\t\t'module_path' => strtolower(__PS_BASE_URI__.'modules/'.$this->name.'/views/img/logo.png'),\n\n\t\t));\n\t\treturn $this->display(__FILE__, 'payment.tpl');//asigno el template que quiero usar\n }", "function showTransactionResult()\r\n{\r\n global $config;\r\n $items_subtotal = 0; //init\r\n $extras_subtotal = 0; //init\r\n \r\n /*\r\n echo '<pre>';\r\n var_dump($_POST);\r\n echo'</pre>';\r\n */\r\n \r\n //start ITEMS ordered table\r\n //date format May 13, 2018, 1:16 am\r\n $html = '\r\n\r\n <h2>\r\n <span>Order Details</span>\r\n </h2>\r\n\r\n <p style=\"margin-left:1rem; margin-top:0;\">Order Date: ' . date(\"F j, Y, g:i a\") . '</p>\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Items Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Item Name</th>\r\n <th>Qty</th>\r\n <th>Price</th>\r\n <th>Item Total</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of ITEMS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n //check $key is an item or a topping\r\n if (substr($key,0,5) == 'item_') {\r\n \r\n //get qty, cast as int\r\n $quantity = (int)$value;\r\n \r\n //check if there is an order for this item\r\n if ($quantity > 0) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n //get price, cast as float\r\n $price = (float)$config->items[$key_id - 1]->Price;\r\n \r\n //get name\r\n $name = $config->items[$key_id - 1]->Name;\r\n \r\n //calculate total for this item\r\n $item_total = $quantity * $price;\r\n \r\n //add to over items subtotal\r\n $items_subtotal += $item_total;\r\n \r\n //money format\r\n $price_output = money_format('%.2n', $price);\r\n $item_total_output = money_format('%.2n', $item_total);\r\n \r\n $html .= '\r\n <tr>\r\n <td>' . $name . '</td>\r\n <td>' . $quantity . '</td>\r\n <td>' . $price_output . '</td>\r\n <td>' . $item_total_output . '</td>\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $items_subtotal_output = money_format('%.2n', $items_subtotal);\r\n \r\n //finish ITEMS table\r\n $html .= '\r\n <tr class=\"tabletotal\">\r\n <td colspan=3 class=\"tabletotaltitle\">Items Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n '; \r\n \r\n //start EXTRAS ordered table\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <th>Extra</th>\r\n\r\n <th>Qty</th>\r\n\r\n <th>Price</th>\r\n </tr>\r\n ';\r\n \r\n //this foreach block generates the table rows of EXTRAS ordered\r\n foreach ($_POST as $key => $value) \r\n {\r\n if (substr($key,0,7) == 'extras_') {\r\n \r\n foreach ($value as $extra_key => $extra) {\r\n \r\n //seperate string with _ as the delimiter\r\n $key_array = explode('_',$key);\r\n \r\n //cast item number as an integer\r\n $key_id = (int)$key_array[1];\r\n \r\n $associated_item_key = 'item_' . $key_id;\r\n \r\n $quantity_of_extra = $_POST[$associated_item_key];\r\n \r\n $extra_subtotal = $quantity_of_extra * 0.25; //calculates subtotal of each particular extra\r\n \r\n $extras_subtotal += $extra_subtotal; //adds to overall subtotal of all extras\r\n \r\n $extra_subtotal_output = money_format('%.2n', $extra_subtotal);\r\n\r\n //add row to EXTRAS table\r\n $extras_html .= '\r\n <tr>\r\n <td>' . $extra . '</td>\r\n\r\n <td>' . $quantity_of_extra . '</td>\r\n <td>' . $extra_subtotal_output . '</td>\r\n\r\n </tr>\r\n ';\r\n }\r\n }\r\n }\r\n \r\n //money format\r\n $extras_subtotal_output = money_format('%.2n', $extras_subtotal);\r\n \r\n //finish EXTRAS table\r\n $extras_html .='\r\n <tr class=\"tabletotal\">\r\n\r\n <td colspan=\"2\" class=\"tabletotaltitle\">Extras Subtotal: </td>\r\n\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n \r\n if ($extras_subtotal == 0) {\r\n $extras_html = '\r\n <h3>Extras Ordered:</h3>\r\n <p>No extras were ordered.</p>\r\n </div>\r\n ';\r\n }\r\n \r\n $html .= $extras_html;\r\n \r\n //calculate tax & totals\r\n $order_subtotal = $items_subtotal + $extras_subtotal;\r\n $tax = $order_subtotal * .101; //10.1%\r\n $grand_total = $order_subtotal + $tax;\r\n \r\n //money format\r\n $order_subtotal = money_format('%.2n', $order_subtotal);\r\n $tax = money_format('%.2n', $tax);\r\n $grand_total = money_format('%.2n', $grand_total);\r\n\r\n //display order summary\r\n $html .= '\r\n <div class=\"menuitem\">\r\n <h3 style=\"margin-top:0;\">Order Summary:</h3>\r\n <table style=\"width:100%\">\r\n <tr>\r\n <td>Item(s) Subtotal: </td>\r\n <td>' . $items_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Extra(s) Subtotal: </td>\r\n <td>' . $extras_subtotal_output . '</td>\r\n </tr>\r\n <tr>\r\n <td>Order Subtotal: </td>\r\n <td>' . $order_subtotal . '</td>\r\n </tr>\r\n <tr>\r\n <td>Tax: </td>\r\n <td>' . $tax . '</td>\r\n </tr>\r\n <tr class=\"tabletotal\">\r\n <td>Grand Total: </td>\r\n <td>' . $grand_total . '</td>\r\n </tr>\r\n </table>\r\n </div>\r\n ';\r\n\r\n\r\n return $html;\r\n}", "public function getPaymentType()\n {\n switch ( $this->payment_type ) {\n case Contribution::PAYMENT_CASH:\n return 'cash';\n break;\n case Contribution::PAYMENT_CREDITCARD:\n return 'credit_card';\n break;\n case Contribution::PAYMENT_CHECK:\n return 'check';\n break;\n case Contribution::PAYMENT_TRANSFER:\n return 'transfer';\n break;\n case Contribution::PAYMENT_PAYPAL:\n return 'paypal';\n break;\n case Contribution::PAYMENT_OTHER:\n return 'other';\n break;\n default:\n Analog::log(\n __METHOD__ . ' Unknonw payment type ' . $this->payment_type,\n Analog::ERROR\n );\n throw new \\RuntimeException(\n 'Unknonw payment type ' . $this->payment_type\n );\n }\n\n }", "public function render()\n {\n parent::render();\n\n $this->_aViewData[\"sOxid\"] = $this->getEditObjectId();\n if ($this->isNewPayPalOrder()) {\n $this->_aViewData['oOrder'] = $this->getEditObject();\n } else {\n $this->_aViewData['sMessage'] = $this->isPayPalOrder() ? oxRegistry::getLang()->translateString(\"OEPAYPAL_ONLY_FOR_NEW_PAYPAL_PAYMENT\") :\n oxRegistry::getLang()->translateString(\"OEPAYPAL_ONLY_FOR_PAYPAL_PAYMENT\");\n }\n\n return \"order_paypal.tpl\";\n }", "public function purchase_table($purchase_no)\n {\n $details = $this->MPurchase_details->get_by_purchase_no($purchase_no);\n\n $msg = '\n <table id=\"data_table\" class=\"table table-bordered table-striped responsive\">\n <thead>\n <tr>\n <th class=\"left\">Item Code</th>\n <th class=\"left\">Item Name</th>\n <th class=\"center\">Quantity</th>\n <th class=\"center\">Unit Price</th>\n <th class=\"center\">Total Price</th>\n <th class=\"span3 center\">Action</th>\n </tr>\n </thead>';\n $msg .= '<tbody>';\n $qty = 0;\n $price = 0;\n if (count($details) > 0)\n {\n foreach ($details as $list)\n {\n $msg .= '\n <tr>\n <td>' . $list['item_code'] . '</td>\n <td>' . $list['item_name'] . '</td>\n <td class=\"center\">' . $list['quantity'] . '</td>\n <td class=\"right\">' . number_format($list['purchase_price'], 2) . '</td>\n <td class=\"right\">' . number_format($list['quantity'] * $list['purchase_price'], 2) . '</td>\n <td class=\"center\">\n <input type=\"hidden\" value=\"' . $list['id'] . '\" /><span class=\"btn btn-danger purchase_item_delete\"><i class=\"icon-trash icon-white\"></i>Delete</span>\n </td>\n </tr>';\n $qty += $list['quantity'];\n $price += $list['quantity'] * $list['purchase_price'];\n }\n }\n $msg .= '</tbody>\n <tfoot>\n <tr>\n <th class=\"left\" colspan=\"6\">Order Totals</th>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp</td>\n <td class=\"center\">' . $qty . '</td>\n <td></td>\n <td class=\"right\">' . number_format($price, 2) . '</td><td></td>\n </tr>\n <tr>\n <td colspan=\"4\" class=\"right\"> Total Paid Amount</td>\n <td class=\"right\"><input type=\"text\" name=\"paid_amount\" id=\"paid_amount\" value=\"'.$price.'\"></td>\n <td></td>\n </tr>\n </tfoot>\n </table>';\n\n return $msg;\n }", "public function process($order_id, $amount, $currency_id, payment_option $payment_option, $order_type_id, array $products) {\n\t$urlPre = ('http' . (($_SERVER ['SERVER_PORT'] == 80) ? '' : 's') . '://');\n\t$country = new country($payment_option->address->country_id);\n\t$splitName = explode(' ', trim(preg_replace('/[^A-Z\\ ]/i', '', $payment_option->name)));\n\tif (1 < count($splitName)) {\n\t $lName = array_pop($splitName);\n\t $fName = implode(' ', $splitName);\n\t} else {\n\t $fName = $payment_option->name;\n\t $lName = $payment_option->name;\n\t}\n\n\t$param = array();\n\tforeach ($products as $product_id => $quantity) {\n\t if (0 < (int) $quantity) {\n\t\t$param ['product_list'] [] = $product_id;\n\t }\n\t}\n\t$sql = 'SELECT `product_id`,\n\t\t\t`name`,\n\t\t\t`sku`,\n\t\t\t`wholesale_price`,\n\t\t\t`retail_price`\n\t\tFROM `products`\n\t\tWHERE `product_id` IN (#product_list);';\n\t$resultSet = Agel_Db_Table::getDefaultAdapter()->query(Agel_Db_Table::prepareInClause($sql, $param), $param);\n\t$product_list = array();\n\twhile (false !== ($row = $resultSet->fetch())) {\n\t $product_list [] = array(\n\t\t'productId' => $row ['product_id'],\n\t\t'name' => $row ['name'],\n\t\t'sku' => $row ['sku'],\n\t\t'quantity' => $products [$row ['product_id']],\n\t\t'wholesalePrice' => $row ['wholesale_price'],\n\t\t'retailPrice' => $row ['retail_price']);\n\t}\n\n\t$payment = new Agel_Payment_Container_Worldpay ();\n\t$payment->set(array(\n\t 'name' => $payment_option->name,\n\t 'account' => $payment_option->account,\n\t 'amount' => $amount,\n\t 'currencyId' => $currency_id,\n\t 'orderId' => $order_id,\n\t 'orderTypeId' => $payment_option->order_type_id,\n\t 'creditCardTypeId' => $payment_option->credit_card_type_id,\n\t 'cvv' => $payment_option->cvv,\n\t 'expMonth' => str_pad($payment_option->expiration_month, 2, '0', STR_PAD_LEFT),\n\t 'expYear' => $payment_option->expiration_year ,\n\t 'countryId' => $payment_option->address->country_id,\n\t 'firstName' => $fName,\n\t 'lastName' => $lName,\n\t 'street' => ($payment_option->address->line1 . ' ' . $payment_option->address->line2),\n\t 'postalCode' => $payment_option->address->zip,\n\t 'city' => $payment_option->address->city,\n\t 'state' => states::get_state_name_by_id($payment_option->address->state_id),\n\t 'countryCode' => $country->iso_code,\n\t 'telephoneNumber' => $payment_option->phone_number,\n\t 'email' => $payment_option->email,\n\t 'distributorId' => (isset($_SESSION['user']['distributor_id']) ? $_SESSION['user']['distributor_id'] : 4 ),\n\t 'products' => $product_list));\n\n\t$this->gateway->chargeAccount($payment);\n \n if ($this->gateway->getTransactionStatus() == 'pending') {\n\t throw new Agel_Payment_Gateway_GatewayException('Unable to ');\n\t}\n\n\treturn $this->getStatusAsBool();\n }", "public function getOrdertype()\n {\n return $this->ordertype;\n }", "function render_table_header_footer($orderBy, $order) {\n?>\n\t\t<tr>\n<?php\n\t\t\t$this->render_th('title', 'Title', $orderBy, $order); \n\t\t\t$this->render_th('date', 'Date', $orderBy, $order); \n\t\t\t$this->render_th('facilitators', 'Facilitators', $orderBy, $order); \n\t\t\t$this->render_th('categories', 'Categories', $orderBy, $order); \n?>\n\t\t</tr>\n<?php\n\t}", "function pnh_getreceiptttl_valuebytypebank ($type=4,$bid=false)\r\n\t{\r\n\t\tif($type==4)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,b.bank_name AS submit_bankname,s.name AS submittedby,a.name AS admin,f.franchise_name,d.remarks AS submittedremarks,d.submitted_on FROM `pnh_m_deposited_receipts`d JOIN `pnh_t_receipt_info` r ON r.receipt_id=d.receipt_id JOIN `pnh_m_bank_info` b ON b.id=d.bank_id JOIN king_admin s ON s.id=d.submitted_by JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id left outer join king_admin a on a.id=r.created_by WHERE r.is_submitted=1 AND 1 AND r.status=0 and b.id=? order by d.submitted_on desc\",$bid)->row_array();\r\n\t\treturn $total_value;\r\n\t}", "public function index() {\r\n\t \r\n\t $payment = $this->get_info();\r\n\r\n $data = array(\r\n \t'amount' => $payment['Order']['total'],\t\r\n \t'pay_to_email' => Configure::read('moneybookers.email'),\r\n \t'language' => $this->get_language(array ('EN', 'DE', 'ES', 'FR', 'IT', 'PL')),\r\n \t'currency' => $this->get_currency(array ('AUD', 'GBP', 'BGN', 'CAD', 'CZK', 'DKK', 'EEK', 'EUR', 'HKD', 'HUF', 'ISK', 'INR', 'ILS', 'JPY', 'LVL', 'MYR', 'NZD', 'NOK', 'PLN', 'ROL', 'SGD', 'SKK', 'SIT', 'ZAR', 'KRW', 'SEK', 'CHF', 'TWD', 'THB', 'USD')),\r\n \t'detail1_description' => __('Products', true),\r\n \t'detail1_text' => $payment['Order']['products'],\r\n \t'firstname' => $payment['Customer']['firstname'],\r\n \t'lastname' => $payment['Customer']['lastname'],\r\n \t'address' => $payment['Customer']['address'],\r\n \t'phone' => $payment['Customer']['phone'],\r\n \t'city' => $payment['Customer']['city'],\r\n \t'postal_code' => $payment['Customer']['postcode'],\r\n \t'pay_from_email' => $payment['Customer']['email'],\r\n \t'return_url' => $payment['Store']['success_url'],\r\n \t'cancel_url' => $payment['Store']['cancel_url'],\r\n \t'form_action' => 'https://www.moneybookers.com/app/payment.pl',\r\n );\r\n\r\n $this->set(compact('data'));\r\n\t}", "public function payments_datatable()\n\t\t{\n\t\t\t$list = $this->Payments->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t$last_login = '';\n\t\t\tforeach ($list as $payment) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$payment->id.'\"><label for=\"cb\"></label></div><div style=\"margin-left: 40%; margin-right: 40%;\">'.$payment->reference.'</div>';\n\t\t\t\t\n\t\t\t\t$row[] = '$'.number_format($payment->total_amount, 2);\n\t\t\t\t$row[] = ucwords($payment->payment_method);\n\t\t\t\t\n\t\t\t\t$user_array = $this->Users->get_user($payment->customer_email);\n\t\t\t\t\t\n\t\t\t\t$fullname = '';\n\t\t\t\tif($user_array){\n\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row[] = ucwords($fullname);\n\t\t\t\t//$row[] = date(\"F j, Y\", strtotime($portfolio->date_added));\n\t\t\t\t\n\t\t\t\t$model = 'payments';\n\t\t\t\t\n\t\t\t\t//prepare buttons\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editPaymentModal\" class=\"btn btn-primary btn-xs\" id=\"'.$payment->id.'\" title=\"Edit '.ucwords($payment->payment_method).'\" onclick=\"editPayment('.$payment->id.')\"><i class=\"fa fa-edit\"></i> Edit</a>\n\t\t\t\t';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Payments->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Payments->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id) {\r\n\r\n\t\tif (!$this->selectedThisByMethodId($payment_method_id)) {\r\n\t\t\treturn null; // Another method was selected, do nothing\r\n\t\t}\r\n\r\n\t\tif (!($paymentTable = $this->_getHellaspayInternalData($virtuemart_order_id) )) {\r\n\t\t\t// JError::raiseWarning(500, $db->getErrorMsg());\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t$this->getPaymentCurrency($paymentTable);\r\n\t\t$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`=\"' . $paymentTable->payment_currency . '\" ';\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$db->setQuery($q);\r\n\t\t$currency_code_3 = $db->loadResult();\r\n\t\t$html = '<table class=\"adminlist table\">' . \"\\n\";\r\n\t\t$html .=$this->getHtmlHeaderBE();\r\n\t\t$html .= $this->getHtmlRowBE('HELLASPAY_PAYMENT_NAME', $paymentTable->payment_name);\r\n\t\t//$html .= $this->getHtmlRowBE('PAYPAL_PAYMENT_TOTAL_CURRENCY', $paymentTable->payment_order_total.' '.$currency_code_3);\r\n\t\t$code = \"hellaspay_response_\";\r\n\t\tforeach ($paymentTable as $key => $value) {\r\n\t\t\tif (substr($key, 0, strlen($code)) == $code) {\r\n\t\t\t\t$html .= $this->getHtmlRowBE($key, $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$html .= '</table>' . \"\\n\";\r\n\t\treturn $html;\r\n\t}", "function theme_uc_product_content_show_order($node) {\n //dsm($node);\n \n $ret = '<div class=\"field\"><div class=\"field-label\">Invoice:</div>';\n $ret .= '<div class=\"field-items\">';\n $ret .= uc_order_load_invoice($node->order);\n $ret .= '</div></div>';\n \n return $ret;\n}", "function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) {\r\n $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none';\r\n $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0';\r\n ?>\r\n <div class=\"column-container\">\r\n <div class=\"column\">\r\n <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairsaving\" value=\"<?php esc_attr_e( $fairsaving ); ?>\" class=\"small-text\" />\r\n <p class=\"description\"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n <div class=\"column\">\r\n <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairaddress\" value=\"<?php esc_attr_e( $fairaddress ); ?>\" class=\"medium-text\" />\r\n <p class=\"description\"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n}", "public function column_payment( $request ) {\n\t\t$edit_post_link = add_query_arg( array( 'post' => $request->ID, 'action' => 'edit' ), admin_url( 'post.php' ) );\n\t\t$actions = array(\n\t\t\t'view-all' => sprintf( '<a href=\"%s\" target=\"_blank\">View All</a>', esc_url( admin_url( 'edit.php?post_type=wcp_payment_request' ) ) ),\n\t\t);\n\n\t\treturn sprintf( '<a href=\"%s\" class=\"row-title\" target=\"_blank\">%s</a>%s',\n\t\t\tesc_url( $edit_post_link ),\n\t\t\tesc_html( $request->post_title ),\n\t\t\t$this->row_actions( $actions )\n\t\t);\n\t}" ]
[ "0.67308384", "0.6375974", "0.6283193", "0.61426497", "0.6135261", "0.6049579", "0.60129523", "0.5979317", "0.5935143", "0.5902969", "0.588934", "0.5866886", "0.58155274", "0.58105475", "0.58013725", "0.5800767", "0.5781863", "0.5768579", "0.5765623", "0.5751702", "0.5674109", "0.56701064", "0.56371474", "0.5615404", "0.560114", "0.55917645", "0.5583946", "0.5582132", "0.55785143", "0.55690336", "0.5552262", "0.5541469", "0.5534909", "0.55317944", "0.5531065", "0.5529599", "0.55157334", "0.55126715", "0.55011255", "0.54925287", "0.5488958", "0.54830986", "0.5466956", "0.54609686", "0.54594827", "0.5456144", "0.5453626", "0.5446311", "0.54385334", "0.543582", "0.5434026", "0.5424672", "0.5415677", "0.54125446", "0.5403163", "0.5397643", "0.5383059", "0.53723246", "0.53714556", "0.53714556", "0.53714556", "0.53714556", "0.53714556", "0.53714556", "0.53714556", "0.53714556", "0.53552026", "0.5349705", "0.5348543", "0.5346302", "0.5344208", "0.5338965", "0.5335808", "0.5335284", "0.53214014", "0.5316827", "0.53159803", "0.531598", "0.53145397", "0.53114283", "0.5307412", "0.5295733", "0.52912074", "0.52901745", "0.52841896", "0.52813", "0.5280291", "0.52756375", "0.52755636", "0.5268351", "0.52607995", "0.5248679", "0.52477926", "0.5247764", "0.5247094", "0.52443117", "0.5244023", "0.52412236", "0.5237372", "0.5233085" ]
0.5739603
20
Add content to the WC emails.
public function email_instructions( $order, $sent_to_admin, $plain_text = false ) { if ( $this->instructions && ! $sent_to_admin && $this->id === $order->get_payment_method() && $order->has_status( $this->order_status ) ) { echo wpautop( wptexturize( $this->instructions ) ) . PHP_EOL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add($content) {\n $this->body .= (string)$content;\n }", "function addContent($content)\n {\n $this->content .= $content;\n }", "function content() {\n echo \"<div class='container'>{$this->params['body']}\n <p style='background-color: #95a5a6; padding: 10px; text-align: center; margin-top: 10px; border-top-left-radius: 2px; border-top-right-radius: 2px;'><a href='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/unsubscribe/{$this->params['email']}/{$this->params['emailId']}' style='font-family: Arial; color: #333;'>Click here to unsubscribe from our updates</a></p>\n </div>\";\n }", "function addContent($content) {\n\t\t$this->_items[] = array('content', $content);\n\t}", "public function get_additional_content()\n {\n\n return apply_filters('subscriptio_email_additional_content_' . $this->id, $this->format_string($this->get_option('additional_content', '')), $this->object);\n }", "public function addContent($content);", "public function addContent($message)\n {\n }", "function addContent($content)\n {\n $this->page .= $content;\n }", "public function appendContent($content);", "public function get_content_html() {\n\n\t\treturn wc_get_template_html( $this->template_html, [\n\t\t\t'order' => $this->object,\n\t\t\t'email_heading' => $this->get_heading(),\n\t\t\t'sent_to_admin' => false,\n\t\t\t'plain_text' => false,\n\t\t\t'email' => $this,\n\t\t], '', $this->template_base );\n\n\t}", "public static function attachBody($content)\n {\n $attachBody = self::getValue('attachBody');\n $attachBody = is_array($attachBody) ? $attachBody : array();\n // Register new page\n $attachBody[] = $content;\n // Update pages\n self::setValue('attachBody', $attachBody);\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function addContent( string $content );", "public function appendContent ($content) {\r\n\t\t$this->content .= (string)$content;\r\n\t}", "private function emailTemplate($data) {\n $body = array_reduce($data, function($prevInput, $curInput) {\n return $prevInput . '<p style=\"font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:2px;\">' . $curInput['name'] . ': ' . $curInput['value'] . '</p>' . PHP_EOL;\n });\n\n $email = '<!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>New Online Donation</title>\n <style type=\"text/css\">\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important; }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important; }\n table[class=body] .content {\n padding: 0 !important; }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important; }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; }\n table[class=body] .btn table {\n width: 100% !important; }\n table[class=body] .btn a {\n width: 100% !important; }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; }}\n @media all {\n .ExternalClass {\n width: 100%; }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; }\n .btn-primary table td:hover {\n background-color: #34495e !important; }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; } }\n </style>\n </head>\n <body class=\"\" style=\"background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background-color:#f6f6f6;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;display:block;max-width:960px;padding:10px;width:100%;Margin:0 auto !important;\">\n <div class=\"content\" style=\"box-sizing:border-box;display:block;Margin:0 auto;max-width:100%;padding:10px;\">\n <span class=\"preheader\" style=\"color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0;\">New Form Submission</span>\n <table class=\"main\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background:#fff;border-radius:3px;width:100%;\">\n <tr>\n <td class=\"wrapper\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">\n <p style=\"font-family:sans-serif;font-size:24px;font-weight:normal;margin:0;Margin-bottom:24px;\">Here are the details:</p>\n ' . $body . '\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n </td>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>';\n \n return $email;\n }", "protected function _addCustomHeaders() {\n // FIXME ExternalDesc is not into the mail..\n //$this->addHeader(\"X-Clab-SmartRelay-External\", $this->_templateId);\n //$this->addHeader(\"X-Clab-SmartRelay-ExternalDesc\", $this->_templateCode);\n\n $this->addHeader(\"X-Clab-SmartRelay-DeliveryId\", sprintf(\"%u\", $this->_crc16($this->_templateCode)));\n $this->addHeader(\"X-Clab-SmartRelay-DeliveryLabel\", $this->_templateCode);\n // Mage::log(\"Template code is: \". $this->_templateCode, null, null, true);\n }", "public function get_content_html() {\n\t\tob_start();\n\t\twc_get_template(\n\t\t\t$this->template_html,\n\t\t\tarray(\n\t\t\t\t'order' => $this->object,\n\t\t\t\t'email_heading' => $this->get_heading(),\n\t\t\t\t'voucher_count' => $this->object['voucher_count'],\n\t\t\t\t'message' => $this->message,\n\t\t\t\t'recipient_name' => $this->recipient_name,\n\t\t\t),\n\t\t\t'',\n\t\t\t$this->template_base\n\t\t);\n\t\treturn ob_get_clean();\n\t}", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "private function addEmailText(){\n\t\t$element = 'body';\n\t\t$opts = array('label'=>'emailMessage','required'=>true,'validators' => array( array('stringLength', false, array(1, 1000) )\t));\n\t\t$this->addElement('textarea',$element,$opts);\n\t\t$this->getElement($element)->setAttribs(array('rows'=>20,'cols'=>30));\n\t\t//$prefix = array();\n\t\t//$decorator = array('DivForm');\n\t\t//$this->addCustomDecorator($prefix,$decorator,$element);\n\t\t$this->applyDecorator($element,false);\n\t\t$this->addToGroup($element);\n\t}", "function getContent () {\r\n\r\n\tglobal $p, $message, $notifications;\r\n\r\n\t$templateContent = new nwTemplate(TEMPLATE_ADD_EDIT);\r\n\r\n\t// assign messages\r\n\tif (!empty($message)) $templateContent->assign('MESSAGE', $message);\r\n\r\n\r\n\t// assign labels\r\n\t$templateContent->assign('ADD_EDIT_OVERVIEW_LINK', ADD_EDIT_OVERVIEW_LINK);\r\n\t$templateContent->assign('HEADING_HOSTS_AND_SERVICES', ADD_EDIT_HEADING_HOSTS_AND_SERVICES);\r\n $templateContent->assign('ADD_EDIT_HEADING_NOTIFICATION_NAME', ADD_EDIT_HEADING_NOTIFICATION_NAME);\r\n\t$templateContent->assign('ADD_EDIT_HEADING_TIME', ADD_EDIT_HEADING_TIME);\r\n\t$templateContent->assign('ADD_EDIT_HEADING_OWNER', ADD_EDIT_HEADING_OWNER);\r\n\t$templateContent->assign('ADD_EDIT_OWNER', ADD_EDIT_OWNER);\r\n $templateContent->assign('ADD_EDIT_INCLUDE_RECIPIENTS', ADD_EDIT_INCLUDE_RECIPIENTS);\r\n $templateContent->assign('ADD_EDIT_EXCLUDE_RECIPIENTS', ADD_EDIT_EXCLUDE_RECIPIENTS);\r\n $templateContent->assign('ADD_EDIT_INCLUDE_SERVICEGROUPS', ADD_EDIT_INCLUDE_SERVICEGROUPS);\r\n $templateContent->assign('ADD_EDIT_EXCLUDE_SERVICEGROUPS', ADD_EDIT_EXCLUDE_SERVICEGROUPS);\r\n\t$templateContent->assign('ADD_EDIT_INCLUDE_HOSTGROUPS', ADD_EDIT_INCLUDE_HOSTGROUPS);\r\n\t$templateContent->assign('ADD_EDIT_EXCLUDE_HOSTGROUPS', ADD_EDIT_EXCLUDE_HOSTGROUPS);\r\n\t$templateContent->assign('ADD_EDIT_INCLUDE_HOSTS', ADD_EDIT_INCLUDE_HOSTS);\r\n\t$templateContent->assign('ADD_EDIT_EXCLUDE_HOSTS', ADD_EDIT_EXCLUDE_HOSTS);\r\n\t$templateContent->assign('ADD_EDIT_INCLUDE_SERVICES', ADD_EDIT_INCLUDE_SERVICES);\r\n\t$templateContent->assign('ADD_EDIT_EXCLUDE_SERVICES', ADD_EDIT_EXCLUDE_SERVICES);\r\n $templateContent->assign('ADD_EDIT_NOTIFICATION_NAME', ADD_EDIT_NOTIFICATION_NAME);\r\n $templateContent->assign('ADD_EDIT_NOTIFICATION_DESC', ADD_EDIT_NOTIFICATION_DESC);\r\n\t$templateContent->assign('ADD_EDIT_TIMEZONE', ADD_EDIT_TIMEZONE);\r\n $templateContent->assign('ADD_EDIT_TIMEFRAME', ADD_EDIT_TIMEFRAME);\r\n\t$templateContent->assign('ADD_EDIT_SUBMIT', ADD_EDIT_SUBMIT);\r\n\r\n\t// assign style to preview\r\n\tif ($notifications['preview_scroll']) {\r\n\r\n\t\t// init\r\n\t\t$style = null;\r\n\r\n\t\t// set width of preview window\r\n\t\tif (isset($notifications['preview_width'])) {\r\n\t\t\tif ($notifications['preview_width'] > 0) {\r\n\t\t\t\t$width = $notifications['preview_width'];\r\n\t\t\t} else {\r\n\t\t\t\t$width = 250;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$style .= 'width:' . $width . 'px;';\r\n\r\n\t\t// set max height\r\n\t\tif (isset($notifications['preview_max_height'])) {\r\n\t\t\tif ($notifications['preview_max_height'] > 0) {\r\n\t\t\t\t$style .= 'max-height:' . $notifications['preview_max_height'] . 'px;';\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t// assign style\r\n\t\t$templateContent->assign('STYLE_HS_PREVIEW', ' style=\"overflow:auto;' . $style . '\"');\r\n\r\n\t}\r\n\r\n\r\n\t// get info and assign defaults\r\n\t$id = (!isset($_GET['id'])) ? ((isset($_POST['id'])) ? $_POST['id'] : null) : $_GET['id'];\r\n\t$timezone_id = null;\r\n\t$timeframe_id = null;\r\n\t$notify_users = null;\r\n\t$notify_groups = null;\r\n\t$notify_by = null;\r\n\t$owner = null;\r\n\t$dbResult = null;\r\n\r\n\tif (!empty($id)) {\r\n\r\n\t\t$id_safe = prepareDBValue($id);\r\n\r\n\t\t$templateContent->assign('ID', $id);\r\n\r\n\t\t$dbResult = queryDB('select * from notifications where id=\\'' . $id_safe . '\\'');\r\n\r\n\t\t$templateContent->assign('ACTION', 'update');\r\n\t\t$templateContent->assign('HEADING', ADD_EDIT_HEADING_EDIT);\r\n\r\n\t\t$templateContent->assign('INCLUDE_RECIPIENTS', $dbResult[0]['recipients_include']);\r\n\t\t$templateContent->assign('EXCLUDE_RECIPIENTS', $dbResult[0]['recipients_exclude']);\r\n\r\n $templateContent->assign('INCLUDE_SERVICEGROUPS', $dbResult[0]['servicegroups_include']);\r\n $templateContent->assign('EXCLUDE_SERVICEGROUPS', $dbResult[0]['servicegroups_exclude']);\r\n\r\n\t\t$templateContent->assign('INCLUDE_HOSTGROUPS', $dbResult[0]['hostgroups_include']);\r\n\t\t$templateContent->assign('EXCLUDE_HOSTGROUPS', $dbResult[0]['hostgroups_exclude']);\r\n\r\n\t\t$templateContent->assign('INCLUDE_HOSTS', $dbResult[0]['hosts_include']);\r\n\t\t$templateContent->assign('EXCLUDE_HOSTS', $dbResult[0]['hosts_exclude']);\r\n\r\n\t\t$templateContent->assign('INCLUDE_SERVICES', $dbResult[0]['services_include']);\r\n\t\t$templateContent->assign('EXCLUDE_SERVICES', $dbResult[0]['services_exclude']);\r\n\r\n $templateContent->assign('NOTIFICATION_NAME', $dbResult[0]['notification_name']);\r\n $templateContent->assign('NOTIFICATION_DESCRIPTION', $dbResult[0]['notification_description']);\r\n\r\n\t\t// get notification users\r\n\t\t$dbSub = queryDB('select c.username from contacts c\r\n\t\t\t\t\t\t\tleft join notifications_to_contacts nc on nc.contact_id=c.id\r\n\t\t\t\t\t\t\twhere nc.notification_id=\\'' . $id_safe . '\\'\r\n\t\t\t\t\t\t\torder by c.username');\r\n\t\tif (is_array($dbSub)) {\r\n\t\t\tforeach($dbSub as $subRow) {\r\n\t\t\t\t$notify_users[] = $subRow['username'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// get notification groups\r\n\t\t$query = 'select cg.id from contactgroups cg\r\n\t\t\t\t\tleft join notifications_to_contactgroups ncg on cg.id=ncg.contactgroup_id\r\n\t\t\t\t\twhere ncg.notification_id=\\'' . $id_safe . '\\'';\r\n\t\t$dbSub = queryDB($query);\r\n\t\tif (is_array($dbSub)) {\r\n\t\t\tforeach($dbSub as $subRow) {\r\n\t\t\t\t$notify_groups[] = $subRow['id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// get notification methods\r\n\t\t$dbSub = queryDB('select method_id from notifications_to_methods where notification_id=\\'' . $id_safe . '\\'');\r\n\t\tif (is_array($dbSub)) {\r\n\t\t\tforeach($dbSub as $subRow) {\r\n\t\t\t\t$notify_by[] = $subRow['method_id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\t$templateContent->assign('ACTION', 'add_new');\r\n\t\t$templateContent->assign('HEADING', ADD_EDIT_HEADING_NEW);\r\n\r\n\t}\r\n\r\n\t\t$timezone_id = $dbResult[0]['timezone_id'];\r\n\t\tif (!isset($timezone_id)) $timezone_id = getServerTimeZone();\r\n $templateContent->assign('TIMEFRAME_SELECT', htmlSelect('timeframe', getTimeFrames(), $dbResult[0]['timeframe_id']));\r\n $templateContent->assign('TIMEZONE_SELECT', htmlSelect('timezone', getTimeZone(), $timezone_id));\r\n\r\n\tif (empty($id) && !empty($_SESSION['user'])) {\r\n\t\t$templateContent->assign('OWNER_SELECT', $_SESSION['user'] . htmlInput('owner', 'hidden', $_SESSION['user']));\r\n\t} else {\r\n\t\t$templateContent->assign('OWNER_SELECT', htmlSelect('owner', getContacts(), $dbResult[0]['username']));\r\n\t}\r\n\r\n\t// BEGIN - assign content for contacts and methods\r\n\t// init\r\n\t$action = $p['action'];\r\n\t$content = '';\r\n\r\n\r\n\t$count = 1;\r\n\tif (!empty($id)) {\r\n\t\t// get escalations\r\n\t\t$query = sprintf(\r\n\t\t\t'select id,notify_after_tries\r\n\t\t\t\tfrom escalations_contacts\r\n\t\t\t\twhere notification_id=\\'%s\\'\r\n\t\t\t\torder by notify_after_tries asc',\r\n\t\t\t\t$id_safe\r\n\t\t);\r\n\t\t$escalations = queryDB($query);\r\n\r\n\r\n\t\t// get counter for loop\r\n\t\t$count = count($escalations) + 1;\r\n\t\tif ($action == 'add_escalation') $count++;\r\n\t}\r\n\t$last = $count - 1;\r\n\r\n\r\n\t// assign content\r\n\tfor ($x = 0; $x < $count; $x++) {\r\n\r\n\t\t$templateSubContent = new nwTemplate(TEMPLATE_ADD_EDIT_CONTACTS_METHODS);\r\n\r\n\t\t$formArray = ($action != 'add') ? \"[$x]\" : null;\r\n\r\n\r\n\t\t// init\r\n\t\tif ($x) {\r\n\t\t\t$notify_users = array();\r\n\t\t\t$notify_groups = array();\r\n\t\t\t$notify_by = array();\r\n\t\t\t$dbResult = array();\r\n\t\t}\r\n\t\r\n\t\t// assign 'let notifier handle'\r\n\t\tif (!$x) {\r\n\t\t\t$templateSubSubContent = new nwTemplate(TEMPLATE_ADD_EDIT_LET_NOTIFIER_HANDLE);\r\n\t\t $templateSubContentTypes = new nwTemplate(TEMPLATE_ADD_EDIT_TYPES);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_PROBLEM', NOTIFY_PROBLEM);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_RECOVERY', NOTIFY_RECOVERY);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_SPECIAL', NOTIFY_SPECIAL);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_OK', NOTIFY_OK);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_WARNING', NOTIFY_WARNING);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_CRITICAL', NOTIFY_CRITICAL);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_UNKNOWN', NOTIFY_UNKNOWN);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_UP', NOTIFY_UP);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_UNREACHABLE', NOTIFY_UNREACHABLE);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_DOWN', NOTIFY_DOWN);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_FLAPPING_START', NOTIFY_FLAPPING_START);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_FLAPPING_STOP', NOTIFY_FLAPPING_STOP);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_FLAPPING_DISABLED', NOTIFY_FLAPPING_DISABLED);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_DOWNTIME_START', NOTIFY_DOWNTIME_START);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_DOWNTIME_END', NOTIFY_DOWNTIME_END);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_DOWNTIME_CANCELLED', NOTIFY_DOWNTIME_CANCELLED);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_ACKNOWLEDGEMENT', NOTIFY_ACKNOWLEDGEMENT);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_CUSTOM', NOTIFY_CUSTOM);\r\n\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_ADVANCED', NOTIFY_ADVANCED);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_WARNING_TO_CRITICAL', NOTIFY_WARNING_TO_CRITICAL);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_WARNING_TO_UNKNOWN', NOTIFY_WARNING_TO_UNKNOWN);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_CRITICAL_TO_WARNING', NOTIFY_CRITICAL_TO_WARNING);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_CRITICAL_TO_UNKNOWN', NOTIFY_CRITICAL_TO_UNKNOWN);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_UNKNOWN_TO_CRITICAL', NOTIFY_UNKNOWN_TO_CRITICAL);\r\n\t\t\t$templateSubContentTypes->assign('NOTIFY_UNKNOWN_TO_WARNING', NOTIFY_UNKNOWN_TO_WARNING);\r\n\r\n\t\t\t$templateSubSubContent->assign('ADD_EDIT_LET_NOTIFIER_HANDLE', ADD_EDIT_LET_NOTIFIER_HANDLE);\r\n\t\t\t$templateSubContentTypes->assign('ADD_EDIT_NOTIFY_ON_TABLE', ADD_EDIT_NOTIFY_ON_TABLE);\r\n\t\t\t// $templateSubSubContent->assign('ADD_EDIT_RELOOP_DELAY', ADD_EDIT_RELOOP_DELAY);\r\n\t\t\t$templateSubSubContent->assign('ADD_EDIT_ROLLOVER', ADD_EDIT_ROLLOVER);\r\n\t\t\t$templateSubSubContent->assign('CHECKED_LET_NOTIFIER_HANDLE', ($dbResult[0]['let_notifier_handle']==1)?' checked=\"checked\" ':'');\r\n\t\t\t$templateSubSubContent->assign('CHECKED_ROLLOVER', ($dbResult[0]['rollover']==1)?' checked=\"checked\" ':'');\r\n\t\t\t// $templateSubSubContent->assign('RELOOP_DELAY', $dbResult[0]['reloop_delay']);\r\n\t\t\t$templateSubContent->assign('LET_NOTIFIER_HANDLE', $templateSubSubContent->getHTML());\r\n\t\t}\r\n\r\n\r\n\t\t// get escalation data\r\n\t\tif ($x && (($x != $last && $action == 'add_escalation') || $action != 'add_escalation')) {\r\n\r\n\t\t\t// get db result from escalations\r\n\t\t\t$dbResult[$x] = $escalations[$x-1];\r\n\r\n\t\t\t// get contacts\r\n\t\t\t$query = sprintf(\r\n\t\t\t\t'select distinct c.username from contacts c\r\n\t\t\t\t\tleft join escalations_contacts_to_contacts ecc on ecc.contacts_id=c.id\r\n\t\t\t\t\tleft join escalations_contacts ec on ec.id=ecc.escalation_contacts_id\r\n\t\t\t\t\twhere ec.id=\\'%s\\'',\r\n\t\t\t\t\t$dbResult[$x]['id']\r\n\t\t\t);\r\n\t\t\t$dbResult_tmp = queryDB($query);\r\n\r\n\t\t\t$notify_users = array();\r\n\t\t\tforeach($dbResult_tmp as $row) {\r\n\t\t\t\t$notify_users[] = $row['username'];\r\n\t\t\t}\r\n\r\n\t\t\t// get contact groups\r\n\t\t\t$query = sprintf(\r\n\t\t\t\t'select distinct eccg.contactgroup_id from escalations_contacts_to_contactgroups eccg\r\n\t\t\t\t\tleft join escalations_contacts ec on ec.id=eccg.escalation_contacts_id\r\n\t\t\t\t\twhere ec.id=\\'%s\\'',\r\n\t\t\t\t\t$dbResult[$x]['id']\r\n\t\t\t);\r\n\t\t\t$dbResult_tmp = queryDB($query);\r\n\r\n\t\t\t$notify_groups = array();\r\n\t\t\tforeach($dbResult_tmp as $row) {\r\n\t\t\t\t$notify_groups[] = $row['contactgroup_id'];\r\n\t\t\t}\r\n\r\n\t\t\t// get notification methods\r\n\t\t\t$query = sprintf(\r\n\t\t\t\t'select distinct ecm.method_id from escalations_contacts_to_methods ecm\r\n\t\t\t\t\tleft join escalations_contacts ec on ec.id=ecm.escalation_contacts_id\r\n\t\t\t\t\twhere ec.id=\\'%s\\'',\r\n\t\t\t\t\t$dbResult[$x]['id']\r\n\t\t\t);\r\n\t\t\t$dbResult_tmp = queryDB($query);\r\n\r\n\t\t\t$notify_by = array();\r\n\t\t\tforeach($dbResult_tmp as $row) {\r\n\t\t\t\t$notify_by[] = $row['method_id'];\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t\tif ($x && $action != 'add' && !($x == $last && $action == 'add_escalation')) {\r\n\r\n\t\t\t$button = htmlInput(\r\n\t\t\t\t'remove_escalation' . $formArray,\r\n\t\t\t\t'submit', ADD_EDIT_BUTTON_REMOVE_ESCALATION,\r\n\t\t\t\t'onclick=\"if(confirm(\\'' . ADD_EDIT_CONFIRM_REMOVE_ESCALATION . '\\')){setValue(\\'eid\\',\\'' . $dbResult[$x]['id'] . '\\');setValue(\\'action\\',\\'remove_escalation\\');}else{return false;}\"'\r\n\t\t\t);\r\n\r\n\t\t\t$templateSubContent->assign('BUTTON_REMOVE_ESCALATION', $button);\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$templateSubContent->assign('BUTTON_REMOVE_ESCALATION', '&nbsp;');\r\n\r\n\t\t}\r\n\r\n\r\n\t\tif ($x == $last && $action != 'add' && $action != 'add_escalation') {\r\n\r\n\t\t\t$button = '&nbsp;';\r\n\t\t\t$button .= htmlInput(\r\n\t\t\t\t'add_escalation',\r\n\t\t\t\t'submit', ADD_EDIT_BUTTON_ADD_ESCALATION,\r\n\t\t\t\t'onclick=\"if(confirm(\\'' . ADD_EDIT_CONFIRM_ADD_ESCALATION . '\\')){setValue(\\'action\\',\\'add_escalation\\');}else{return false;}\"'\r\n\t\t\t);\r\n\r\n\t\t\t$templateSubContent->assign('BUTTON_ADD_ESCALATION', $button);\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$templateSubContent->assign('BUTTON_ADD_ESCALATION', '&nbsp;');\r\n\r\n\t\t}\r\n\r\n\r\n\t\t$templateSubContent->assign('ESCALATION_COUNT', $x);\r\n\r\n\t\t$templateSubContent->assign('ADD_EDIT_NOTIFY_AFTER_TRIES', ADD_EDIT_NOTIFY_AFTER_TRIES);\r\n\t\t$templateSubContent->assign('NOTIFY_AFTER_TRIES', $dbResult[$x]['notify_after_tries']);\r\n\t\t$templateSubContent->assign('ADD_EDIT_NUM_NOTIFICATIONS', ADD_EDIT_NUM_NOTIFICATIONS);\r\n\t\t$templateSubContent->assign('ADD_EDIT_HEADING_CONTACTS_METHODS', ADD_EDIT_HEADING_CONTACTS_METHODS);\r\n\t\t$templateSubContent->assign('ADD_EDIT_NOTIFY_USERS', ADD_EDIT_NOTIFY_USERS);\r\n\t\t$templateSubContent->assign('ADD_EDIT_NOTIFY_GROUPS', ADD_EDIT_NOTIFY_GROUPS);\r\n\t\t$templateSubContent->assign('ADD_EDIT_NOTIFY_BY', ADD_EDIT_NOTIFY_BY);\r\n if (!$x) {\r\n $templateSubContent->assign('ADD_EDIT_NOTIFY_ON', ADD_EDIT_NOTIFY_ON);\r\n }\r\n\r\n $templateSubContent->assign('NOTIFY_USERS_SELECT', htmlSelect('notify_users' . $formArray . '[]', getContacts(), $notify_users, 'size=\"5\" multiple=\"multiple\"'));\r\n\t\t$templateSubContent->assign('NOTIFY_GROUPS_SELECT', htmlSelect('notify_groups' . $formArray . '[]', getContactGroups(), $notify_groups, 'size=\"5\" multiple=\"multiple\"'));\r\n\r\n\t\t$templateSubContent->assign('NOTIFY_BY_SELECT', htmlSelect('notify_by' . $formArray . '[]', getNotificationMethods(), $notify_by, 'size=\"5\" multiple=\"multiple\"'));\r\n\r\n if (!$x) {\r\n // only show the check boxes for the base rule, not notifications\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_OK', ($dbResult[$x]['on_ok']==1) ? ' checked=\"checked\"' : '' );\r\n\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_WARNING', (($dbResult[$x]['on_warning'] & 1) == 1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_CRITICAL_TO_WARNING', (($dbResult[$x]['on_warning'] & 8) == 8) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_UNKNOWN_TO_WARNING', (($dbResult[$x]['on_warning'] & 16) == 16) ? ' checked=\"checked\"' : '' );\r\n\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_CRITICAL', (($dbResult[$x]['on_critical'] & 1) == 1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_WARNING_TO_CRITICAL', (($dbResult[$x]['on_critical'] & 4) == 4) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_UNKNOWN_TO_CRITICAL', (($dbResult[$x]['on_critical'] & 16) == 16) ? ' checked=\"checked\"' : '' );\r\n\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_UNKNOWN', (($dbResult[$x]['on_unknown'] & 1) == 1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_WARNING_TO_UNKNOWN', (($dbResult[$x]['on_unknown'] & 4) == 4) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_CRITICAL_TO_UNKNOWN', (($dbResult[$x]['on_unknown'] & 8) == 8) ? ' checked=\"checked\"' : '' );\r\n\r\n\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_HOST_UP', ($dbResult[$x]['on_host_up']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_HOST_DOWN', ($dbResult[$x]['on_host_down']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_HOST_UNREACHABLE', ($dbResult[$x]['on_host_unreachable']==1) ? ' checked=\"checked\"' : '' );\r\n\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_PROBLEM', ($dbResult[$x]['on_type_problem']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_RECOVERY', ($dbResult[$x]['on_type_recovery']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_FLAPPINGSTART', ($dbResult[$x]['on_type_flappingstart']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_FLAPPINGSTOP', ($dbResult[$x]['on_type_flappingstop']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_FLAPPINGDISABLED', ($dbResult[$x]['on_type_flappingdisabled']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_DOWNTIMESTART', ($dbResult[$x]['on_type_downtimestart']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_DOWNTIMEEND', ($dbResult[$x]['on_type_downtimeend']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_DOWNTIMECANCELLED', ($dbResult[$x]['on_type_downtimecancelled']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_ACKNOWLEDGEMENT', ($dbResult[$x]['on_type_acknowledgement']==1) ? ' checked=\"checked\"' : '' );\r\n $templateSubContentTypes->assign('CHECKED_NOTIFY_TYPE_CUSTOM', ($dbResult[$x]['on_type_custom']==1)?' checked=\"checked\" ':'');\r\n $templateSubContentTypes->assign('ARRAY_ITEM', $formArray);\r\n $templateSubContent->assign('NOTIFY_ON_TABLE', $templateSubContentTypes->getHTML());\r\n }\r\n\r\n\t\t$templateSubContent->assign('ARRAY_ITEM', $formArray);\r\n\r\n\t\t$content .= $templateSubContent->getHTML();\r\n\r\n\t}\r\n\r\n\t$templateContent->assign('CONTACTS_METHODS', $content);\r\n\t// END - assign content for contacts and methods\r\n\r\n\r\n\t// BEGIN - generate content for asynchronous-preview call\r\n\tif ($notifications['host_service_preview']) {\r\n\r\n $templateContent->assign('ONCHANGE_RECIPIENTS_INCLUDE', ' onkeyup=\"update_preview(\\'r\\',\\'i\\');\"');\r\n $templateContent->assign('ONCHANGE_RECIPIENTS_EXCLUDE', ' onkeyup=\"update_preview(\\'r\\',\\'e\\');\"');\r\n\r\n $templateContent->assign('ONCHANGE_SERVICEGROUPS_INCLUDE', ' onkeyup=\"update_preview(\\'sg\\',\\'i\\');\"');\r\n $templateContent->assign('ONCHANGE_SERVICEGROUPS_EXCLUDE', ' onkeyup=\"update_preview(\\'sg\\',\\'e\\');\"');\r\n\r\n\t\t$templateContent->assign('ONCHANGE_HOSTGROUPS_INCLUDE', ' onkeyup=\"update_preview(\\'hg\\',\\'i\\');\"');\r\n\t\t$templateContent->assign('ONCHANGE_HOSTGROUPS_EXCLUDE', ' onkeyup=\"update_preview(\\'hg\\',\\'e\\');\"');\r\n\r\n\t\t$templateContent->assign('ONCHANGE_HOSTS_INCLUDE', ' onkeyup=\"update_preview(\\'h\\',\\'i\\');\"');\r\n\t\t$templateContent->assign('ONCHANGE_HOSTS_EXCLUDE', ' onkeyup=\"update_preview(\\'h\\',\\'e\\');\"');\r\n\r\n\t\t$templateContent->assign('ONCHANGE_SERVICES_INCLUDE', ' onkeyup=\"update_preview(\\'s\\',\\'i\\');\"');\r\n\t\t$templateContent->assign('ONCHANGE_SERVICES_EXCLUDE', ' onkeyup=\"update_preview(\\'s\\',\\'e\\');\"');\r\n\r\n\t}\r\n\t// END - generate content for asynchronous-preview call\r\n\t\r\n\r\n\treturn $templateContent->getHTML();\r\n\r\n}", "function add_to_file_contents($content) {\n\t\t$this->contents .= $content;\n\t}", "public function test_generateContent()\n {\n $message = new Message();\n $message->content = '<p>Hello</p>';\n\n $builder = new EmailBuilder();\n $builder->setNotificationMessage($message);\n\n $html = $builder->generateEmailBody();\n self::assertStringContainsString('<p>Hello</p>', $html);\n }", "public function setBody($content) {\n\n\t\t// auto-detect html\n\t\tif (stripos($content, '<html') !== false) {\n\t\t\t$this->_mail->IsHTML(true);\n\t\t}\n\n\t\t// set body\n\t\t$this->_mail->setBody($content);\n\t}", "function sendHTMLMail($content,$recipient,$dummy,$fromEmail,$fromName,$replyTo='',$recepientsCopy='',$recepientsBcc='')\t{\n\t\tif (trim($recipient) && trim($content))\t{\n\t\t\t$cls=t3lib_div::makeInstanceClassName('t3lib_htmlmail');\n\t\t\tif (class_exists($cls))\t{\t// If htmlmail lib is included, then generate a nice HTML-email\n\t\t\t\t$parts = spliti('<title>|</title>',$content,3);\n\t\t\t\t$subject = trim($parts[1]) ? trim($parts[1]) : 'TYPO3 FE Admin message';\n\n\t\t\t\t$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');\n\t\t\t\t$Typo3_htmlmail->start();\n\t\t\t\t$Typo3_htmlmail->useBase64();\n\n\t\t\t\t$Typo3_htmlmail->subject = $subject;\n\t\t\t\t$Typo3_htmlmail->from_email = $fromEmail;\n\t\t\t\t$Typo3_htmlmail->from_name = $fromName;\n\t\t\t\t$Typo3_htmlmail->replyto_email = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->replyto_name = $replyTo ? '' : $fromName;\n\t\t\t\t//modif by CMD - add return path information\n\t\t\t\t$Typo3_htmlmail->returnPath = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->organisation = '';\n\t\t\t\t$Typo3_htmlmail->priority = 3;\n\n\t\t\t\t\t// HTML\n\t\t\t\t$Typo3_htmlmail->theParts['html']['content'] = $content;\t// Fetches the content of the page\n\t\t\t\t$Typo3_htmlmail->theParts['html']['path'] = '';\n\t\t\t\t$Typo3_htmlmail->extractMediaLinks();\n\t\t\t\t$Typo3_htmlmail->extractHyperLinks();\n\t\t\t\t$Typo3_htmlmail->fetchHTMLMedia();\n\t\t\t\t$Typo3_htmlmail->substMediaNamesInHTML(0);\t// 0 = relative\n\t\t\t\t$Typo3_htmlmail->substHREFsInHTML();\n\t\t\t\t$Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($Typo3_htmlmail->theParts['html']['content']));\n\n\t\t\t\t\t// PLAIN\n\t\t\t\t$Typo3_htmlmail->addPlain('');\n\n\t\t\t\t\t// SET Headers and Content\n\t\t\t\t$Typo3_htmlmail->setHeaders();\n\t\t\t\t$Typo3_htmlmail->setContent();\n\t\t\t\t$Typo3_htmlmail->setRecipient($recipient);\n\t\t\t\t$Typo3_htmlmail->recipient_copy=$recepientsCopy;\n\t\t\t\t$Typo3_htmlmail->recipient_blindcopy=$recepientsBcc;\n\t\t//\t\tdebug($Typo3_htmlmail->theParts);\n\t\t\t\t$Typo3_htmlmail->sendtheMail();\n\t\t\t} else {\n\t\t\t\tdebug('SYSTEM ERROR: No HTML-mail library loaded. Set \"page.config.incT3Lib_htmlmail = 1\" is your TypoScript template.');\n\t\t\t}\n\t\t}\n\t}", "function cjpopups_email($emaildata, $content_above = null, $content_below = null, $attachments = null, $service = 'wp-mail'){\n\t$to = $emaildata['to'];\n\t$from_name = stripcslashes(html_entity_decode($emaildata['from_name'], ENT_QUOTES));\n\t$from = $emaildata['from_email'];\n\t$subject = stripcslashes(html_entity_decode($emaildata['subject'], ENT_QUOTES));\n\t$content = $emaildata['message'];\n\n\t$msg = $content_above;\n\t$msg .= $content;\n\t$msg .= $content_below;\n\t$message = $msg;\n\n\tif($service == 'wp-mail'){\n\t\t$headers[] = \"From: {$from_name} <{$from}>\";\n\t\t$headers[] = \"Reply-To: {$from}\";\n\t\t$headers[] = \"Return-Path: {$from}\";\n\t\t$headers[] = \"MIME-Version: 1.0\";\n\t\tadd_filter( 'wp_mail_content_type', 'cjpopups_set_html_content_type_for_email');\n\t\twp_mail($to, $subject, $message, $headers, $attachments);\n\t\tremove_filter( 'wp_mail_content_type', 'cjpopups_set_html_content_type_for_email');\n\t}else{\n\t\t$headers = \"From: {$from_name} <{$from}>\" . \"\\r\\n\\\\\";\n\t\t$headers .= \"Reply-To: {$from}\\r\\n\";\n\t\t$headers .= \"Return-Path: {$from}\\r\\n\";\n\t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$headers .= \"Content-Type: text/html; charset=utf-8\\r\\n\";\n\t\treturn mail($to, $subject, $message, $headers);\n\t}\n}", "public function append($content)\n {\n $this->content .= $content;\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public function sendContent()\n {\n echo $this->content;\n }", "function AddContent(Content $content)\n {\n $this->contents[] = $content;\n }", "function mfwp_add_content($content) {\r\n\t// récupération de la valeur déclarée en global\r\n\tglobal $mfwp_options;\r\n\r\n\t// Deux conditions: templating et case à cocher pour unable (fichier admin-page.php)\r\n\tif(is_singular() && $mfwp_options[\"enable\"] == true ) {\r\n\t\t// affichage des contenus avec un nettoyage au dernier moment\r\n\t\t$extra_content = sprintf('<p class=\"twitter-message %s\">%s <a href=\"%s\" target=\"_blank\">%s</a> %s<br>%s</p>', $mfwp_options[\"theme\"], __('Follow', 'my-first-wordpress-plugin'), esc_url($mfwp_options[\"twitter_url\"]), esc_html($mfwp_options[\"twitter_name\"]), __('on Twitter:', 'my-first-wordpress-plugin'), wp_kses_post($mfwp_options[\"twitter_bio\"]) );\r\n\t\t$content .= $extra_content;\r\n\t}\r\n\t// dans un filtre le contenu est toujours retourné\r\n\treturn $content;\r\n}", "function generateNewsletterHtml($intereses, $posts, $lang) {\n $files = scandir(\"./templates/\");\n foreach ($files as $file) {\n $file_parts = pathinfo($file);\n if($file_parts['extension'] == 'html') {\n $template[$file_parts['filename']] = file_get_contents (\"./templates/\".$file);\n }\n }\n \n //Noticias ------------------\n $news = '';\n foreach ($_REQUEST['data'] as $item ) {\n if($item['post_id'] >= 0 && $item['format'] != '') {\n $temp = $template['new_'.$item['format']];\n //https://help.activecampaign.com/hc/en-us/articles/220358207-How-to-use-Conditional-Content-in-emails\n if (isset($item['intereses']) && count($item['intereses']) > 0) {\n $temp = \"<!-- %IF in_array('\".implode($item['intereses'], \"', \\$SLASHED_TAGS) || in_array('\").\"', \\$SLASHED_TAGS)% -->\\n\\n\".$temp.\"\\n\\n<!-- %/IF% -->\";\n }\n $temp = str_replace(\"[text]\", ( isset($item['texto_especial']) && $item['texto_especial'] != '' ? strip_tags($item['texto_especial']) : strip_tags($posts[$item['post_id']]->excerpt->rendered)), str_replace(\"[link]\", $posts[$item['post_id']]->link, str_replace(\"[title]\", $posts[$item['post_id']]->title->rendered, $temp)));\n $cat = json_decode(file_get_contents(DOMAIN_WP.\"/wp-json/wp/v2/categories/\". $posts[$item['post_id']]->categories[0]));\n $temp = str_replace(\"[category]\", $cat->name, $temp);\n if($item['imagen'] != '') {\n $temp = str_replace(\"[image]\", $item['imagen'], $temp);\n } else {\n $current_image = json_decode(file_get_contents(DOMAIN_WP.\"/wp-json/wp/v2/media/\". $posts[$item['post_id']]->featured_media));\n if($current_image->media_details->sizes->medium_large) $temp = str_replace(\"[image]\", $current_image->media_details->sizes->medium_large->source_url, $temp);\n else $temp = str_replace(\"[image]\", $current_image->media_details->sizes->full->source_url, $temp);\n }\n } else $temp = \"\";\n $news .= $temp;\n }\n\n //Ayudas -------------\n $helps = '';\n if(is_array($_REQUEST['help']) && count($_REQUEST['help']) > 0) {\n $max = ceil(count($_REQUEST['help'])/3) * 3;\n for($i = 1; $i <= $max; $i++) {\n $key = $i-1;\n $item = $_REQUEST['help'][$key];\n if($item['title'] != '') {\n $helps .= replaceTags ($item, $template['help']);\n } else {\n $helps .= \"<td width='33%'></td>\";\n }\n if (($i%3) == 0 && $i < $max) {\n $helps .= \"</tr><tr>\"; \n }\n }\n }\n\n //Banners ------------------\n $banners = '';\n if(is_array($_REQUEST['banner']) && count($_REQUEST['banner']) > 0) {\n foreach($_REQUEST['banner'] as $item) {\n $banners .= replaceTags ($item, $template['banner']); \n }\n }\n\n //Generamos la plantilla\n $newsletter = str_replace(\"[BANNERS]\", $banners, str_replace(\"[YEAR]\", $_REQUEST['ano'], str_replace(\"[HELPS]\", $helps, str_replace(\"[NEWS]\", $news, $template['mail_'.$lang]))));\n\n if(is_array($_REQUEST['help']) && count($_REQUEST['help']) > 0) $newsletter = str_replace(\"[END_IF_HELPS]\", \"\", str_replace(\"[IF_HELPS]\", \"\", $newsletter));\n else $newsletter = str_replace(\"[END_IF_HELPS]\", \" -->\", str_replace(\"[IF_HELPS]\", \"<!-- \", $newsletter));\n\n file_put_contents(\"temp.html\", $newsletter);\n return;\n}", "public function arMarkupEmailListOnSend() {\n // Invoke javascript:markArListItemSent(updatedString) so that the button in the listing window has the new commId.\n $markArListItemSentText = \"\";\n foreach ($this->referencedWorks as $referencedWork) {\n $markArListItemSentText .= 'markArListItemSent(\"' . $referencedWork['arEmailWidgetId'] \n . '\", arEmailSentWidgetMarkupJS(' . $referencedWork['workId'] . ', ' . $this->commId() . ', ' . $this->recipientId() . ', \"' . $referencedWork['arEmailWidgetId'] . '\"));';\n }\n $script = \"<script type='text/javascript'>eval('\" . $markArListItemSentText . \"');</script>\\r\\n\";\n self::$debugger->bechoTrace('arMarkupEmailListOnSend script','', -1);\n echo $script;\n }", "public function extObjContent()\n {\n if ($this->extObj === null) {\n $flashMessage = GeneralUtility::makeInstance(\n FlashMessage::class,\n $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang.xlf:no_modules_registered'),\n $this->getLanguageService()->getLL('title'),\n FlashMessage::ERROR\n );\n /** @var $flashMessageService \\TYPO3\\CMS\\Core\\Messaging\\FlashMessageService */\n $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);\n /** @var $defaultFlashMessageQueue \\TYPO3\\CMS\\Core\\Messaging\\FlashMessageQueue */\n $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();\n $defaultFlashMessageQueue->enqueue($flashMessage);\n } else {\n $this->extObj->pObj = $this;\n if (is_callable([$this->extObj, 'main'])) {\n $this->content .= $this->extObj->main();\n }\n }\n }", "protected function addMessage($content) {\n if ($this->file === null) {\n if (!file_exists($this->config->getValue('log', 'path', './'))) {\n mkdir($this->config->getValue('log', 'path', './'), 0755, true);\n }\n $path = $this->config->getValue('log', 'path', './').$this->section.'.log';\n $this->file = fopen($path, 'a');\n }\n fwrite($this->file, $content.\"\\n\");\n }", "public function append($content)\n\t{\n\t\t$this->content .= $content;\n\t}", "function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "function sending_activation_email($data, &$content) {\n\t\t// Create content\n\t\t$site_name = isset($this->settings['site_name'])?$this->settings['site_name']:$this->ci->config->item('DX_website_name');\n\t\t$content = sprintf(\n\t\t\t\t$this->ci->lang->line('auth_activate_content'), \n\t\t\t\t$site_name, \n\t\t\t\t$data['activate_url'],\n\t\t\t\t$this->ci->config->item('DX_email_activation_expire') / 60 / 60,\n\t\t\t\t$data['username'], \n\t\t\t\t$data['email'],\n\t\t\t\t$data['password'],\n\t\t\t\t$site_name\n\t\t\t);\n\t}", "function caldol_add_to_content_end($content){\n\t$content .= '<p>Leadership Counts!</p>';\n\treturn $content;\n}", "public function add_content($content) {\n if (!is_string($content)) { return false; }\n $this->_content .= $content;\n return true;\n }", "protected function setContent() {}", "final public function addContent($content){\n\t\t$this->content.=$content;\n\t\treturn $this;\n\t}", "function content() {\n echo \"\n <form action='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/add' method='post'>\n <input name='token' type='hidden' value='{$this->params['token']}'>\n <label for='username'>Name</label>\n <input name='name' placeholder='Name' id='name' type='text' required>\n <label for='description'>Description</label>\n <input name='description' placeholder='Description (Optional)' id='description' type='text'>\n <input type='submit' value='Create List'>\n </form>\n \";\n }", "public function addMetaFields()\n {\n // Get some help :-)\n $helper = Metabox::get('lbwp-nl');\n\n // Metabox for settings\n $boxId = 'newsletter-settings';\n $helper->addMetabox($boxId, 'Einstellungen');\n $helper->addInputText('mailSubject', $boxId, 'Betreff', array('required' => true));\n $helper->addInputText('mailSender', $boxId, 'E-Mail Absender', array('required' => true));\n $helper->addInputText('mailSenderName', $boxId, 'Absender-Name', array('required' => true));\n\n // Template selection\n $boxId = 'newsletter-template';\n $helper->addMetabox($boxId, 'Newsletter Design');\n $helper->addField(\n 'templateId',\n $boxId,\n array(),\n array($this, 'displayNewsletterTemplates'),\n array($this, 'saveNewsletterTemplate')\n );\n\n // Metabox for post assignation\n $boxId = 'newsletter-items';\n $helper->addMetabox($boxId, 'Beiträge auswählen');\n $helper->addAssignPostsField('newsletterItems', $boxId, $this->sourceTypes);\n\n // Info box because we schedule sendings at xx:31 with cron\n $boxId = 'newsletter-sendinfo';\n $helper->addMetabox($boxId, 'Versand Information', 'side');\n\n $helper->addField(\n 'sendInfo',\n $boxId,\n array(),\n array($this, 'displaySendInfo'),\n '__return_false'\n );\n\n $boxId = 'newsletter-sendtest';\n $helper->addMetabox($boxId, 'Test-Versand', 'side');\n // Box to mail the current newsletter as a test to an email\n $helper->addField(\n 'sendTest',\n $boxId,\n array(),\n array($this, 'displayTestForm'),\n '__return_false'\n );\n }", "function tpl_add_content()\n\t{\n\t\treturn true;\n\t}", "public function setBodyContent($data)\n\t{\n\t\t$this->_pageData['data']['content'] = $data;\n\t}", "public function initContent()\n\t{\n\t\tparent::initContent();\n\n\t\t$this->context->smarty->assign(array(\n\t\t\t'is_guest' => $this->context->customer->is_guest,\n\t\t\t'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),\n\t\t\t'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()\n\t\t));\n\n\t\tif ($this->context->customer->is_guest)\n\t\t{\n\t\t\t$this->context->smarty->assign(array(\n\t\t\t\t'id_order' => $this->id_order,\n\t\t\t\t'reference_order' => $this->reference,\n\t\t\t\t'id_order_formatted' => sprintf('#%06d', $this->id_order),\n\t\t\t\t'email' => $this->context->customer->email\n\t\t\t));\n\t\t\t/* If guest we clear the cookie for security reason */\n\t\t\t$this->context->customer->mylogout();\n\t\t}\n\n\t\t$this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');\n\t}", "public function get_content_plain() {\n\t\tob_start();\n\t\twc_get_template($this->template_plain, [\n\t\t\t'email_heading'\t=> $this->get_heading(),\n\t\t\t'sent_to_admin'\t=> true,\n\t\t\t'plain_text'\t=> true,\n\t\t\t'email'\t\t\t=> $this,\n\t\t\t'subscribers'\t=> $this->subscribers,\n\t\t], '', $this->template_base);\n\t\treturn ob_get_clean();\n\t}", "function setBody($content)\n\t{\n\t\t/*\n\t\t * Filter the Body\n\t\t * TODO: Check for XSS\n\t\t */\n\t\t$this->Body = JMailHelper::cleanText( $content );\n\t}", "function wrapBody($body=\"\"){\n if( $body != \"\" ){\n $this->Body = $body;\n }\n $this->Body = SITE_EMAILHEADER.$this->Body.\"\\n\\n\".SITE_EMAILFOOTER;\n }", "function offerEmail() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\t$this->set('advertiserList',$this->common->getAdvertiserProfileAll());\n\t}", "function addElement($script){\n if(!$this->host->messages)\n $this->host->messages = $script;\n else\n $this->host->messages .= $script;\n }", "public function initUpdateReceiptContent()\n {\n }", "function get_send_invoice_mail_content(){\n $mail_content = get_field('manual_invoice_to_member_mail', 'option');\n return apply_filters( 'replace_paces_site_url', $mail_content['content'] );\n}", "public function sendContent();", "public function configMail() {\n add_filter('wp_mail_content_type', function($type) {return 'text/html';});\n add_filter('wp_mail_from_name', function() {return 'Portfolio Site';});\n add_filter('wp_mail_from', function() {return 'wordpress@' . $_SERVER['HTTP_HOST'];});\n }", "public function set_content() {\n\t\tif ( SiteHealthFilter::is_debug_mode() ) {\n\t\t\t// Show default content, see url above\n\t\t\tswitch ( $this->slug ) {\n\t\t\t\tcase 'tools':\n\t\t\t\t\tWC_Admin_Status::status_tools();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'logs':\n\t\t\t\t\tWC_Admin_Status::status_logs();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tWC_Admin_Status::status_report();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$file = dirname( __FILE__ ) . '/html/' . $this->slug . '.php';\n\t\tif ( file_exists( $file ) ) {\n\t\t\tinclude_once $file;\n\t\t}\n\t}", "public function new_customer_email($edata) {\n\t\t\t\t$template = $this->shortcode_variables(\"customerregisteradmin\");\n\t\t\t\t$details = email_template_detail(\"customerregisteradmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregisteradmin\");\n\t\t\t\t$values = array($edata['name'], $edata['email'], $edata['address'], $edata['phone']);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"supplierregisteradmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($this->adminemail);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "protected function addContent()\n {\n $this->content .= $this->parse($this->template);\n return $this;\n }", "public function add_content() {\n $data['title'] = translate('add') . \" \" . translate('content_management');\n $this->load->view('admin/master/add_update_content', $data);\n }", "public function initContent() {\n\n parent::initContent();\n\n $this->context->smarty->assign(\n [\n 'errors' => $this->errors,\n 'nbdaysreturn' => (int) Configuration::get('EPH_ORDER_RETURN_NB_DAYS'),\n ]\n );\n $this->setTemplate(_EPH_THEME_DIR_ . 'order-return.tpl');\n }", "public function add_welcome_email() {\n $post_exists = post_exists( '[{{{site.name}}}] Welcome!' );\n \n if ( $post_exists != 0 && get_post_status( $post_exists ) == 'publish' )\n return;\n \n // Create post object\n $my_post = array(\n 'post_title' => __( '[{{{site.name}}}] Welcome!', 'buddypress-welcome-email' ),\n 'post_content' => __( 'Welcome to [{{{site.name}}}]!', 'buddypress-welcome-email' ), // HTML email content.\n 'post_excerpt' => __( 'Welcome to [{{{site.name}}}]!', 'buddypress-welcome-email' ), // Plain text email content.\n 'post_status' => 'publish',\n 'post_type' => bp_get_email_post_type() // this is the post type for emails\n );\n \n // Insert the email post into the database\n $post_id = wp_insert_post( $my_post );\n \n if ( $post_id ) {\n // add our email to the taxonomy term 'activation_completed'\n // Email is a custom post type, therefore use wp_set_object_terms\n \n $tt_ids = wp_set_object_terms( $post_id, 'activation_completed', bp_get_email_tax_type() );\n foreach ( $tt_ids as $tt_id ) {\n $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() );\n wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array(\n 'description' => 'Recipient has successfully activated an account.',\n ) );\n }\n }\n }", "public function send()\n\t{\n\t\trequire_once XOOPS_ROOT_PATH.'/header.php';\n\t\t$this->sendContent();\n\t\trequire_once XOOPS_ROOT_PATH.'/footer.php';\n\t\treturn $this;\n\t}", "function bodyContent($type_suffix)\n\t{\n\t\t$temp_layout = $this->controller->layout; // store the current controller layout\n\t\n\t\tif ($type_suffix == 'html')\n\t\t\t $this->controller->layout = '..'.DS.'email';\n\t\telse\n\t\t\t $this->controller->layout = '';\n\t\n\t\t$mail = $this->controller->render($this->templateLocation('_'.strtolower($type_suffix)));\n\t\t// render() automatically adds to the controller->output, we'll remove it\n\t\t$this->controller->output = str_replace($mail, '', $this->controller->output);\n\t\n\t\t$this->controller->layout = $temp_layout; // restore the controller layout\n\t\treturn $mail;\n\t}", "public function get_content_plain() {\n\t\tob_start();\n\t\twc_get_template(\n\t\t\t$this->template_plain,\n\t\t\tarray(\n\t\t\t\t'order' => $this->object,\n\t\t\t\t'email_heading' => $this->get_heading(),\n\t\t\t\t'voucher_count' => $this->object['voucher_count'],\n\t\t\t\t'message' => $this->message,\n\t\t\t\t'recipient_name' => $this->recipient_name,\n\t\t\t),\n\t\t\t'',\n\t\t\t$this->template_base\n\t\t);\n\t\treturn ob_get_clean();\n\t}", "public function add($content);", "function dt_sc_email($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'title' => '',\n\t\t\t\t'description' =>'',\n\t\t\t\t'icon' => '',\n\t\t\t\t'emailid' => ''\n\t\t), $attrs ) );\n\n\t\t$out = '<div class=\"dt-sc-contact-info\">';\n\t\t$out .= \"<i class='fa {$icon}'></i>\";\n\t\t$out .= \"<span>{$title}</span>\";\n\t\t$out .= ( !empty($emailid) ) ? \"<a href='mailto:$emailid'>{$emailid}</a>\" : \"\";\n\t\t$out .= \"<span class='details'>{$description}</span>\";\n\t\t$out .= '</div>';\n\t\treturn $out;\n\t }", "function sending_account_email($data, &$content)\n\t{\n\t\t// Load helper\n\t\t$this->ci->load->helper('url');\n\t\t\n\t\t// Create content\t\n\t\t$content = sprintf($this->ci->lang->line('auth_account_content'), \n\t\t\t$this->ci->config->item('DX_website_name'), \n\t\t\t$data['username'], \n\t\t\t$data['email'], \n\t\t\t$data['password'], \n\t\t\tsite_url($this->ci->config->item('DX_login_uri')),\n\t\t\t$this->ci->config->item('DX_website_name'));\n\t}", "function mme_send_mail(){\n\tglobal $woocommerce;\n $items = $woocommerce->cart->get_cart();\n //print_r( $items );\n $msg = \"Description\\n\";\n $msg .= \"------------------------------------------------------------\\n\";\n $msg .= \"Name\\t\\tQuantity\\tAmount\\tNetamount\\n\";\n $msg .= \"------------------------------------------------------------\\n\";\n foreach( $items as $item ) {\n $_product = $item[ 'data' ]->post;\n $msg .= $_product->post_title.\"\\t\\t\".$item['quantity'];\n $price = get_post_meta( $item['product_id'] , '_price', true );\n $msg .= \"\\t\\t\".$price;\n $msg .= \"\\t\\t\".$item['line_total'];\n $msg .=\"\\n\";\n }\n $totalamount = floatval( preg_replace( '#[^\\d.]#', '', $woocommerce->cart->get_cart_total() ) );\n $msg .= \"\\n------------------------------------------------------------\\n\";\n $msg .= \"Total amount\\t:\".$totalamount;\n $to = explode( ',', get_option( 'custom_emails' ) );\n $subject = \"Acknowledgement\";\n wp_mail( $to, $subject, $msg );\n}", "function sendMailForWishlistProductPromotion($promoId, $productIdPromotion, $con) {\n if (in_array('all', $productIdPromotion)) {\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email, tu.username FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id\";\n } else {\n $pids = implode(',', $productIdPromotion);\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id WHERE tw.product_id IN ($pids)\";\n }\n $rs = exec_query($qq, $con);\n if (mysqli_num_rows($rs)) {\n $emails = array();\n while ($row = mysqli_fetch_object($rs)) {\n $emails[] = $row->email;\n }\n\n /* fetch promotion details */\n $rsPromo = exec_query(\"SELECT * FROM tbl_promotion WHERE promo_id = '$promoId'\", $con);\n $promotion = mysqli_fetch_object($rsPromo);\n if ($promotion->percent_or_amount == 'percent') {\n $detail = \"FLAT $promotion->promo_value % OFF !!!\";\n } elseif ($promotion->percent_or_amount == 'amount') {\n $detail = \"SAVE $ $promotion->promo_value !!!\";\n }\n\n\n /* fetch emaiul template */\n $rsEmail = exec_query(\"SELECT * FROM tbl_email_template WHERE type = 'promotion'\", $con);\n $rowEmail = mysqli_fetch_object($rsEmail);\n $content = $rowEmail->content;\n\n $contentHTML = html_entity_decode($content);\n $contentHTML = str_replace('{jhm :', '', $contentHTML); // replace all '{jhm : '\n $arraySearch = array(' promotion_title}', ' promotion_detail}'); // isko replace krna h\n $arrayReplace = array($promotion->title, $detail); // isse replace krna h\n $content = str_replace($arraySearch, $arrayReplace, $contentHTML); // yha milega sb\n // now send mail\n sendMail('New Promotion!!! Check it out on ' . siteName, $content, $emails, $con);\n }\n}", "protected function setHtmlContent() {}", "public function add_customer_email_note( WC_Order $order, bool $sent_to_admin, bool $plain_text, WC_Email $email ) {\n\t\tif ( $sent_to_admin ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $plain_text ) {\n\t\t\techo wp_kses_post( get_option( 'customer_email_plaintext_content', 'option' ) );\n\t\t} else {\n\t\t\techo wp_kses_post( get_option( 'customer_email_formatted_content', 'option' ) );\n\t\t}\n\t}", "public function addFooterContent($content);", "public function add_email_template()\n {\n \n\t\t$this->arr_view_data['page_title'] = \"Manage \".$this->module_title;\n $this->arr_view_data['parent_module_icon'] = \"fa fa-home\";\n $this->arr_view_data['parent_module_title'] = \"Dashboard\";\n $this->arr_view_data['parent_module_url'] = url('/').'/admin/dashboard';\n $this->arr_view_data['module_icon'] = $this->module_icon;\n $this->arr_view_data['module_title'] = \"Manage \".$this->module_title;\n\t\t$this->arr_view_data['module_url_path'] = $this->module_url_path;\n\t\t$this->arr_view_data['admin_url_path'] = $this->admin_url_path;\n\t\t$this->arr_view_data['admin_panel_slug'] = $this->admin_panel_slug;\n\t\t\n\t\treturn view($this->module_view_folder.'.add',$this->arr_view_data);\n }", "public function getContent(): MailingContent\n {\n return new MailingContent();\n }", "public function sendContent()\r\n {\r\n if (sfConfig::get('sf_logging_enabled'))\r\n {\r\n $this->getContext()->getLogger()->info('{sfResponse} send content ('.strlen($this->content).' o)');\r\n }\r\n\r\n echo $this->content;\r\n }", "private function _getContent()\n {\n return '{*Sailthru zephyr code is used for full functionality*}\n <div id=\"main\">\n <table width=\"700\">\n <tr>\n <td>\n <h2><p>Hello {profile.vars.name}</p></h2>\n <p>Did you forget the following items in your cart?</p>\n <table>\n <thead>\n <tr>\n <td colspan=\"2\">\n <div><span style=\"display:block;text-align:center;color:white;font-size:13px;font-weight:bold;padding:15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{profile.purchase_incomplete.items[0].vars.checkout_url}\">Re-Order Now!</a></span></div>\n </td>\n </tr>\n </thead>\n <tbody>\n {sum = 0}\n {foreach profile.purchase_incomplete.items as i}\n <table width=\"650\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin:0 0 20px 0;background:#fff;border:1px solid #e5e5e5\">\n <tbody>\n <tr>\n <td style=\"padding:20px\"><a href=\"{i.url}\"><img width=\"180\" height=\"135\" border=\"0\" alt=\"{i.title}\" src=\"{i.vars.image_url}\"></a></td>\n <td width=\"420\" valign=\"top\" style=\"padding:20px 10px 20px 0\">\n <div style=\"padding:5px 0;color:#333;font-size:18px;font-weight:bold;line-height:21px\">{i.title}</div>\n <div style=\"padding:0 0 5px 0;color:#999;line-height:21px;margin:0px\">{i.vars.currency}{i.price/100}</div>\n <div style=\"color:#999;font-weight:bold;line-height:21px;margin:0px\">{i.description}</div>\n <div><span style=\"display:block;text-align:center;width:120px;border-left:1px solid #b43e2e;border-right:1px solid #b43e2e;color:white;font-size:13px;font-weight:bold;padding:0 15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{i.url}\">Buy Now</a></span></div>\n </td>\n </tr>\n </tbody>\n </table>\n {/foreach}\n <tr>\n <td align=\"left\" valign=\"top\" style=\"padding:3px 9px\" colspan=\"2\"></td>\n <td align=\"right\" valign=\"top\" style=\"padding:3px 9px\"></td>\n </tr>\n </tbody>\n <tfoot>\n </tfoot>\n </table>\n <p><small>If you believe this has been sent to you in error, please safely <a href=\"{optout_confirm_url}\">unsubscribe</a>.</small></p>\n {beacon}\n </td>\n </tr>\n </table>\n </div>';\n }", "function setBodyHtml($content)\n {\n $htmlPart = new MimePart();\n\n $htmlPart->setContent($content)\n ->setType(Mime::TYPE_HTML)\n ->setCharset($this->zendMessage->getEncoding())\n ->setDisposition(Mime::DISPOSITION_INLINE)\n ->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE);\n\n $this->parts[] = $htmlPart;\n\n return $this;\n }", "public function initContent()\n {\n parent::initContent();\n\n $this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer));\n $this->setTemplate(_PS_THEME_DIR_.'order-slip.tpl');\n }", "public function add(mySeoContent $content)\n {\n $this->_contents[] = $content;\n }", "private static function inject_styles( $content ) {\n\t\tif ( class_exists( 'Emogrifier' ) ) {\n\t\t\ttry {\n\t\t\t\t$emogrifier = new Emogrifier( $content, self::get_styles() );\n\t\t\t\t$content = $emogrifier->emogrify();\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\ttrigger_error( 'Unable to inject styles into email notification: ' . $e->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}", "static function jitm_woocommerce_services_msg( $content ) {\n\t\tif ( ! function_exists( 'wc_get_base_location' ) ) {\n\t\t\treturn $content;\n\t\t}\n\n\t\t$base_location = wc_get_base_location();\n\n\t\tswitch ( $base_location['country'] ) {\n\t\t\tcase 'US':\n\t\t\t\t$content->message = esc_html__( 'New free service: Show USPS shipping rates on your store! Added bonus: print shipping labels without leaving WooCommerce.', 'jetpack' );\n\t\t\t\tbreak;\n\t\t\tcase 'CA':\n\t\t\t\t$content->message = esc_html__( 'New free service: Show Canada Post shipping rates on your store!', 'jetpack' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$content->message = '';\n\t\t}\n\n\t\treturn $content;\n\t}", "function sendMail($recipient, $admin, $data,$content='', $adminContent='',$dataContent='')\t{\n\t\tif ($this->conf['debug'] && !$recipient) echo 'No recepient for email';\n\t\tif ($this->conf['debug']) echo \"<br> Emails : $recipient, $admin, $data : <br/>User : $content=,<br/>Admin : $adminContent,<br/>Data : $dataContent\";\n\t\t//dataEmail\n\t\tif ($data && $dataContent && $dataContent!='NOMAIL')\t{\n\t\t\t$cc=$this->conf['emails']['data']['cc'];\n\t\t\t$bcc=$this->conf['emails']['data']['bcc'];;\n\t\t\tif (!$this->isHTMLContent($dataContent))\t{\n\t\t\t\t$admMail = $this->cObj->sendNotifyEmail($dataContent,\n\t\t\t\t\t\t\t\t\t$data,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($dataContent,\n\t\t\t\t\t\t\t\t\t$data,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t$cc,\n\t\t\t\t\t\t\t\t\t$bcc\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Admin mail:\n\t\tif ($admin && $adminContent && $adminContent!='NOMAIL')\t{\n\t\t\t$cc=$this->conf['emails']['admin']['cc'];\n\t\t\t$bcc=$this->conf['emails']['admin']['bcc'];;\n\t\t\tif (!$this->isHTMLContent($adminContent))\t{\n\t\t\t\t$admMail = $this->cObj->sendNotifyEmail($adminContent,\n\t\t\t\t\t\t\t\t\t$admin,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($adminContent,\n\t\t\t\t\t\t\t\t\t$admin,\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t$cc,\n\t\t\t\t\t\t\t\t\t$bcc\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t//user mail:\n\t\tif ($recipient && $content!='NOMAIL') {\n\t\t\t$cc=$this->conf['emails']['user']['cc'];\n\t\t\t$bcc=$this->conf['emails']['user']['bcc'];\n\t\t\tif (!$this->isHTMLContent($content))\t{\n\t\t\t\t$this->cObj->sendNotifyEmail($content,\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t'',\t\t\t// ($admMail ? '' : $admin), \t\t// If the special administration mail was not found and send, the regular is...\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$admin\n\t\t\t\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->sendHTMLMail($content,\n\t\t\t\t\t\t\t\t\t$recipient,\n\t\t\t\t\t\t\t\t\t'',\t\t\t// ($admMail ? '' : $admin), \t\t// If the special administration mail was not found and send, the regular is...\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['from'],\n\t\t\t\t\t\t\t\t\t$this->conf['email.']['fromName'],\n\t\t\t\t\t\t\t\t\t$admin\n\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "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 getContent()\n {\n// echo $this->registerHook('actionProductUpdate');\n $errors = array();\n $this->addBackOfficeMedia();\n /*\n * loop to fetch all language with default language in an array\n */\n $languages = Language::getLanguages(false);\n /*\n * Function to submit the configuration setting values,\n * first by validating the form data and then save into the DB\n */\n if (Tools::isSubmit('kbConfigSubmit')) {\n $db_data = Tools::jsonDecode(Configuration::get('KB_PUSH_NOTIFICATION'), true);\n $config_form = Tools::getValue('kbpushnotification');\n $welcome_form = Tools::getValue('kbwelcomenotify');\n $kbproductsignup_form = Tools::getValue('kbproductsignup');\n foreach ($languages as $lang) {\n $welcome_form['action_message'][$lang['id_lang']] = trim(Tools::getValue('kbwelcomenotify_action_message_'.$lang['id_lang']));\n $welcome_form['action_btn_text'][$lang['id_lang']] = trim(Tools::getValue('kbwelcomenotify_action_btn_text_'.$lang['id_lang']));\n $welcome_form['action_cancel_text'][$lang['id_lang']] = trim(Tools::getValue('kbwelcomenotify_action_cancel_text_'.$lang['id_lang']));\n $kbproductsignup_form['kbsignup_price_heading'][$lang['id_lang']] = trim(Tools::getValue('kbsignup_price_heading_'.$lang['id_lang']));\n $kbproductsignup_form['kbsignup_price_message'][$lang['id_lang']] = trim(Tools::getValue('kbsignup_price_message_'.$lang['id_lang']));\n $kbproductsignup_form['kbsignup_stock_heading'][$lang['id_lang']] = trim(Tools::getValue('kbsignup_stock_heading_'.$lang['id_lang']));\n $kbproductsignup_form['kbsignup_stock_message'][$lang['id_lang']] = trim(Tools::getValue('kbsignup_stock_message_'.$lang['id_lang']));\n $kbproductsignup_form['kbsignup_button_text'][$lang['id_lang']] = trim(Tools::getValue('kbsignup_button_text_'.$lang['id_lang']));\n }\n $welcome_form['logo_path'] = _PS_MODULE_DIR_ . $this->name . '/views/img/welcome_default.jpg';\n $welcome_form['logo'] = $this->getModuleDirUrl() . $this->name . '/views/img/welcome_default.jpg';\n $is_img_upload = false;\n if (!empty($_FILES)) {\n if ($_FILES['kb_welcome_logo']['error'] == 0 && $_FILES['kb_welcome_logo']['name'] != '' && $_FILES['kb_welcome_logo']['size'] > 0) {\n $file_extension = pathinfo($_FILES['kb_welcome_logo']['name'], PATHINFO_EXTENSION);\n $path = _PS_MODULE_DIR_ . $this->name . '/views/img/kb_welcome_logo.' . $file_extension;\n $mask = _PS_MODULE_DIR_ . $this->name . '/views/img/kb_welcome_logo.*';\n $matches = glob($mask);\n if (count($matches) > 0) {\n array_map('unlink', $matches);\n }\n $upload = move_uploaded_file(\n $_FILES['kb_welcome_logo']['tmp_name'],\n $path\n );\n chmod($path, 0777);\n if ($upload) {\n $is_img_upload = true;\n $welcome_form['logo_path'] = $path;\n $welcome_form['logo'] = $this->getModuleDirUrl() . $this->name . '/views/img/kb_welcome_logo.' . $file_extension;\n }\n }\n }\n if (!$is_img_upload) {\n if (!empty($db_data) && isset($db_data['welcome_setting'])) {\n $welcome_form['logo_path'] = $db_data['welcome_setting']['logo_path'];\n $welcome_form['logo'] = $db_data['welcome_setting']['logo'];\n }\n }\n $data = array(\n 'module_config' => $config_form,\n 'welcome_setting' => $welcome_form,\n 'product_signup_setting' => $kbproductsignup_form,\n );\n Configuration::updateValue('KB_PUSH_NOTIFICATION', Tools::jsonEncode($data));\n $this->context->cookie->__set('kb_redirect_success', $this->l('Configuration successfully updated.'));\n Tools::redirectAdmin(AdminController::$currentIndex . '&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules'));\n }\n \n $output = '';\n if (isset($this->context->cookie->kb_redirect_success)) {\n $output .= $this->displayConfirmation($this->context->cookie->kb_redirect_success);\n unset($this->context->cookie->kb_redirect_success);\n }\n \n $this->available_tabs_lang = array(\n 'ModuleConfiguration' => $this->l('Configuration'),\n 'ProductUpdateSignUp' => $this->l('Product Sign Up Box'),\n 'WelcomeNotificationSettings' => $this->l('Welcome Notification Settings'),\n );\n \n $this->available_tabs = array(\n array('ModuleConfiguration', 'icon-wrench'),\n array('ProductUpdateSignUp', 'icon-sign-in'),\n array('WelcomeNotificationSettings', 'icon-bell'),\n );\n \n $this->tab_display = 'ModuleConfiguration';\n $module_tabs = array();\n foreach ($this->available_tabs as $tab) {\n $module_tabs[$tab[0]] = array(\n 'id' => $tab[0],\n 'selected' => (Tools::strtolower($tab[0]) == Tools::strtolower($this->tab_display) ||\n (isset($this->tab_display_module) && 'module' . $this->tab_display_module == Tools::strtolower($tab[0]))),\n 'name' => $this->available_tabs_lang[$tab[0]],\n 'href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'),\n 'icon' => $tab[1],\n );\n }\n\n /*\n * Fetch configuration settings from the Database and convert them into array\n */\n $this->kb_push_notify = Tools::jsonDecode(Configuration::get('KB_PUSH_NOTIFICATION'), true);\n /*\n * Persistence the configuration setting form data\n */\n \n $config_form_data = '';\n $welcome_form_data = '';\n $product_sign_form_data = '';\n if (!empty($this->kb_push_notify) && isset($this->kb_push_notify['module_config'])) {\n $config_form_data = $this->kb_push_notify['module_config'];\n }\n if (!empty($this->kb_push_notify) && isset($this->kb_push_notify['welcome_setting'])) {\n $welcome_form_data = $this->kb_push_notify['welcome_setting'];\n }\n if (!empty($this->kb_push_notify) && isset($this->kb_push_notify['product_signup_setting'])) {\n $product_sign_form_data = $this->kb_push_notify['product_signup_setting'];\n }\n \n $config_field_value = array(\n 'kbpushnotification[enable]' => (!empty($config_form_data)) ? $config_form_data['enable'] : 0,\n 'kbpushnotification[enable_order_status]' => (!empty($config_form_data)) ? $config_form_data['enable_order_status'] : 0,\n 'kbpushnotification[enable_abandoned_cart]' => (!empty($config_form_data)) ? $config_form_data['enable_abandoned_cart'] : 0,\n 'kbpushnotification[enable_product_price_alert]' => (!empty($config_form_data)) ? $config_form_data['enable_product_price_alert'] : 0,\n 'kbpushnotification[enable_product_stock_alert]' => (!empty($config_form_data)) ? $config_form_data['enable_product_stock_alert'] : 0,\n );\n $welcome_config_value = array(\n 'kbwelcomenotify[enable]' => (!empty($welcome_form_data)) ? $welcome_form_data['enable']:0,\n 'kbwelcomenotify[display_logo]' => (!empty($welcome_form_data)) ? $welcome_form_data['display_logo']:0,\n );\n \n $signup_config_value = array(\n 'kbproductsignup[enable]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['enable'] : 0,\n 'kbproductsignup[heading_bk_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['heading_bk_color'] : '#f08080',\n 'kbproductsignup[heading_font_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['heading_font_color'] : '#ffffff',\n 'kbproductsignup[content_bk_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['content_bk_color'] : '#ffffff',\n 'kbproductsignup[content_font_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['content_font_color'] : '#000000',\n 'kbproductsignup[button_bk_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['button_bk_color'] : '#fd8222',\n 'kbproductsignup[block_border_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['block_border_color'] : '#f08080',\n 'kbproductsignup[button_font_color]' => (!empty($product_sign_form_data)) ? $product_sign_form_data['button_font_color'] : '#ffffff',\n );\n \n foreach ($languages as $k => $language) {\n $languages[$k]['is_default'] = ((int) ($language['id_lang'] == $this->context->language->id));\n $welcome_config_value['kbwelcomenotify_action_message'][$language['id_lang']] = (!empty($welcome_form_data) && isset($welcome_form_data['action_message'][$language['id_lang']])) ? $welcome_form_data['action_message'][$language['id_lang']] : $this->l('We\\'d like to show you notifications for the latest news and updates. ');\n $welcome_config_value['kbwelcomenotify_action_btn_text'][$language['id_lang']] = (!empty($welcome_form_data) && isset($welcome_form_data['action_btn_text'][$language['id_lang']])) ? $welcome_form_data['action_btn_text'][$language['id_lang']] : $this->l('Approve');\n $welcome_config_value['kbwelcomenotify_action_cancel_text'][$language['id_lang']] = (!empty($welcome_form_data) && isset($welcome_form_data['action_cancel_text'][$language['id_lang']])) ? $welcome_form_data['action_cancel_text'][$language['id_lang']] : $this->l('No Thanks');\n $signup_config_value['kbsignup_price_heading'][$language['id_lang']] = (!empty($product_sign_form_data) && isset($product_sign_form_data['kbsignup_price_heading'][$language['id_lang']])) ? $product_sign_form_data['kbsignup_price_heading'][$language['id_lang']] : $this->l('Subscribe for Price Alert');\n $signup_config_value['kbsignup_price_message'][$language['id_lang']] = (!empty($product_sign_form_data) && isset($product_sign_form_data['kbsignup_price_message'][$language['id_lang']])) ? $product_sign_form_data['kbsignup_price_message'][$language['id_lang']] : $this->l('Subscribe for Price Alert');\n $signup_config_value['kbsignup_stock_heading'][$language['id_lang']] = (!empty($product_sign_form_data) && isset($product_sign_form_data['kbsignup_stock_heading'][$language['id_lang']])) ? $product_sign_form_data['kbsignup_stock_heading'][$language['id_lang']] : $this->l('Subscribe for Back In Stock Alert');\n $signup_config_value['kbsignup_stock_message'][$language['id_lang']] = (!empty($product_sign_form_data) && isset($product_sign_form_data['kbsignup_stock_message'][$language['id_lang']])) ? $product_sign_form_data['kbsignup_stock_message'][$language['id_lang']] : $this->l('Subscribe for Back In Stock Alert');\n $signup_config_value['kbsignup_button_text'][$language['id_lang']] = (!empty($product_sign_form_data) && isset($product_sign_form_data['kbsignup_button_text'][$language['id_lang']])) ? $product_sign_form_data['kbsignup_button_text'][$language['id_lang']] : $this->l('Sign Up');\n }\n\n $this->fields_form = $this->getConfigurationForm();\n $this->fields_form1 = $this->getProductSignupForm();\n $this->fields_form2 = $this->getWelcomeNotificationForm();\n \n $action = AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules');\n \n /*\n * Create helper form for configuration setting form\n */\n $form = $this->getform(\n $this->fields_form,\n $languages,\n $this->l('Configuration'),\n false,\n $config_field_value,\n 'module_config',\n $action\n );\n $form1 = $this->getform(\n $this->fields_form1,\n $languages,\n $this->l('Product Signup Setting'),\n false,\n $signup_config_value,\n 'product_signup_setting',\n $action\n );\n $form2 = $this->getform(\n $this->fields_form2,\n $languages,\n $this->l('Welcome Notification Setting'),\n false,\n $welcome_config_value,\n 'welcome_notification_setting',\n $action\n );\n \n $this->context->smarty->assign('module_tabs', $module_tabs);\n $this->context->smarty->assign('form', $form);\n $this->context->smarty->assign('form1', $form1);\n $this->context->smarty->assign('form2', $form2);\n $this->context->smarty->assign('firstCall', false);\n $this->context->smarty->assign(\n 'ajax_action',\n 'index.php?controller=AdminModules&token=' . Tools::getAdminTokenLite('AdminModules') . '&configure=' . $this->name\n );\n \n $tpl = 'form_custom.tpl';\n $helper = new Helper();\n $helper->module = $this;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG')\n ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;\n $helper->override_folder = 'helpers/';\n $helper->base_folder = 'form/';\n $helper->setTpl($tpl);\n $tpl = $helper->generate();\n \n $this->context->smarty->assign('is_shortcodes', true);\n $velovalidation = $this->context->smarty->fetch(_PS_MODULE_DIR_ . $this->name.'/views/templates/admin/velovalidation.tpl');\n $output = $output . $tpl;\n return $velovalidation.$output;\n }", "function do_form_additional_emails($s_id) {\n\t# Dim some Vars:\n\t\tglobal $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\n\t# Build common td start tag / col strings (reduce text)\n\t\t$_td_str_left\t= '<td class=\"TP1SML_NL\">'.$_nl;\n\t\t$_td_str_ctr\t= '<td class=\"TP1SML_NC\">'.$_nl;\n\n\t# Build table row beginning and ending\n\t\t$_cstart = '<b>'.$_LANG['_ADMIN']['l_Email_Address_Additional'].$_sp.'</b><br>'.$_nl;\n\t\t$_cstart .= '<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_First_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Last_Name'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_left.$_LANG['_ADMIN']['l_Email_Address'].'</td>'.$_nl;\n\t\t$_cstart .= $_td_str_ctr.$_LANG['_CCFG']['Actions'].'</td></tr>'.$_nl;\n\n\t\t$_cend = '</table>'.$_nl;\n\n\t# Set Query for select (additional emails).\n\t\t$query = 'SELECT *';\n\t\t$query .= ' FROM '.$_DBCFG['suppliers_contacts'];\n\t\t$query .= ' WHERE contacts_s_id='.$s_id;\n\t\t$query .= ' ORDER BY contacts_email ASC';\n\n\t# Do select and return check\n\t\tIF (is_numeric($s_id)) {\n\t\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\t\t}\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_SAVE_S']);\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\n\t\t\t# Display the \"edit/delete data\" form for this row\n\t\t\t\t$_out .= '<form method=\"POST\" action=\"admin.php\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_update\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"contacts_id\" value=\"'.$row['contacts_id'].'\">'.$_nl;\n\t\t\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t\t\t$_out .= '<tr>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_fname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_first']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_lname\" size=\"15\" value=\"'.htmlspecialchars($row['contacts_name_last']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"ae_email\" size=\"35\" value=\"'.htmlspecialchars($row['contacts_email']).'\"></td>'.$_nl;\n\t\t\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\n\t\t\t# Display \"update\" button\n\t\t\t\t$_out .= '<input type=\"image\" src=\"'.$button.$_nl;\n\n\t\t\t# Display \"Delete\" button\n\t\t\t\t$_out .= '&nbsp;<a href=\"admin.php?cp=suppliers&op=ae_mail_delete&stage=0&s_id='.$s_id.'&contacts_id='.$row['contacts_id'].'\">'.$_TCFG['_IMG_DEL_S'].'</a>'.$_nl;\n\n\t\t\t# End row\n\t\t\t\t$_out .= '</td></tr></form>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t# Display form for adding a new entry\n\t\t$button = str_replace('<img src=\"', '', $_TCFG['_IMG_ADD_S']);\n\t\t$_out .= '<form method=\"POST\" action=\"'.$_SERVER['PHP_SELF'].'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"s_id\" value=\"'.$s_id.'\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"stage\" value=\"\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"cp\" value=\"suppliers\">'.$_nl;\n\t\t$_out .= '<input type=\"hidden\" name=\"op\" value=\"ae_mail_add\">'.$_nl;\n\t\t$_out .= '<tr>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_fname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_lname\" size=\"15\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'<input class=\"PSML_NL\" type=\"text\" name=\"new_ae_email\" size=\"35\" value=\"\"></td>'.$_nl;\n\t\t$_out .= $_td_str_left.'&nbsp;&nbsp;&nbsp;'.$_nl;\n\t\t$_out .= '<input type=\"image\" src=\"'.$button.'</td></tr></form>'.$_nl;\n\n\t# Build return string\n\t\t$returning = $_cstart.$_out.$_cend;\n\n\t# Return the form\n\t\treturn $returning;\n}", "public static function smtp_inner () \n { \n $html = null;\n\n $top = __( 'SMTP Send : Message', 'default-message' );\n $inner = self::smtp_inner_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'smtp', $top, $inner, $bottom );\n\n return $html;\n }", "public function send_content() {\n Event::factory('response.pre_send_content')->notify_all();\n Event::factory('response.post_send_content')->notify_all();\n return $this;\n }", "public function mrMarkupEmailListOnSend() {\n // Invoke javascript:markMrListItemSent(updatedString) so that the button in the listing window has the new commId.\n $markMrListItemSentText = 'markMrListItemSent(\"' . $this->mrEmailWidgetId() \n . '\", mrEmailSentWidgetMarkupJS(' . $this->commId() . ', ' . $this->recipientId() . ', \"' . $this->mrEmailWidgetId() . '\"))';\n $script = \"<script type='text/javascript'>eval('\" . $markMrListItemSentText . \"');</script>\\r\\n\";\n self::$debugger->becho('mrMarkupEmailListOnSend script', $script, 0);\n echo $script;\n }", "function send_preview_ajax() {\r\n\r\n require_once( $this->plugin_dir . \"email-newsletter-files/phpmailer/class.phpmailer.php\" );\r\n\r\n $mail = new PHPMailer();\r\n\r\n $mail->CharSet = 'UTF-8';\r\n\r\n //Set Sending Method\r\n switch( $this->settings['outbound_type'] ) {\r\n case 'smtp':\r\n $mail->IsSMTP();\r\n $mail->Host = $this->settings['smtp_host'];\r\n $mail->SMTPAuth = ( strlen( $this->settings['smtp_user'] ) > 0 );\r\n if( $mail->SMTPAuth ){\r\n $mail->Username = $this->settings['smtp_user'];\r\n $mail->Password = $this->settings['smtp_pass'];\r\n }\r\n break;\r\n\r\n case 'mail':\r\n $mail->IsMail();\r\n break;\r\n\r\n case 'sendmail':\r\n $mail->IsSendmail();\r\n break;\r\n }\r\n\r\n //open template file\r\n $filename = $this->plugin_dir . \"email-newsletter-files/templates/\" . $_REQUEST['template'] . \"/template.html\";\r\n $handle = fopen( $filename, \"r\" );\r\n $contents = fread( $handle, filesize( $filename ) );\r\n fclose( $handle );\r\n\r\n //Replace content of template\r\n $content = base64_decode( str_replace( \"-\", \"+\", $_REQUEST['content'] ) );\r\n $contact_info = base64_decode( str_replace( \"-\", \"+\", $_REQUEST['contact_info'] ) );\r\n\r\n $contents = str_replace( \"{EMAIL_BODY}\", $content, $contents );\r\n $contents = str_replace( \"{EMAIL_SUBJECT}\", stripslashes ( $_REQUEST['subject'] ), $contents );\r\n $contents = str_replace( \"{FROM_NAME}\", stripslashes ( $_REQUEST['from_name'] ), $contents );\r\n $contents = str_replace( \"{FROM_EMAIL}\", $_REQUEST['from_email'], $contents );\r\n $contents = str_replace( \"{CONTACT_INFO}\", $contact_info, $contents );\r\n $contents = str_replace( \"images/\", $this->plugin_url . \"email-newsletter-files/templates/\" . $_REQUEST['template'] . \"/images/\", $contents );\r\n\r\n $mail->From = $_REQUEST['from_email'];\r\n $mail->FromName = stripslashes ( $_REQUEST['from_name'] );\r\n $mail->Subject = stripslashes ( $_REQUEST[\"subject\"] );\r\n\r\n $mail->MsgHTML( $contents );\r\n\r\n $mail->AddAddress( $_REQUEST[\"preview_email\"] );\r\n\r\n if( $this->settings['bounce_email'] ) {\r\n $mail->Sender = $this->settings['bounce_email'];\r\n }\r\n\r\n if( ! $mail->Send() )\r\n die( \"Mailer Error: \" . $mail->ErrorInfo );\r\n else\r\n die( \"Test Email was sent\" );\r\n }", "function setContent($c) {\n\t\t$this->set(\"content\",$c);\n\t}", "function pmpro_send_html( $phpmailer ) {\n\t\n\t//to check if we should wpautop later\n\t$original_body = $phpmailer->Body;\n\t\n\t// Set the original plain text message\n\t$phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);\n\t// Clean < and > around text links in WP 3.1\n\t$phpmailer->Body = preg_replace('#<(https?://[^*]+)>#', '$1', $phpmailer->Body);\t\n\t\n\t// If there is no HTML, run through wpautop\t\n\tif($phpmailer->Body == strip_tags($phpmailer->Body))\n\t\t$phpmailer->Body = wpautop($phpmailer->Body);\n\t\n\t// Convert line breaks & make links clickable\n\t$phpmailer->Body = make_clickable ($phpmailer->Body);\n\t\t\n\t// Get header for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_stylesheet_directory() . \"/email_header.html\");\n\telseif(file_exists(get_template_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_template_directory() . \"/email_header.html\");\n\telse\n\t\t$header = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($header) && $header == strip_tags($header))\n\t\t$header = wpautop($header);\n\t\n\t// Get footer for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_stylesheet_directory() . \"/email_footer.html\");\n\telseif(file_exists(get_template_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_template_directory() . \"/email_footer.html\");\n\telse\n\t\t$footer = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($footer) && $footer == strip_tags($footer))\n\t\t$footer = wpautop($footer);\n\t\n\t// Add header/footer to the email\n\tif(!empty($header))\n\t\t$phpmailer->Body = $header . \"\\n\" . $phpmailer->Body;\n\tif(!empty($footer))\n\t\t$phpmailer->Body = $phpmailer->Body . \"\\n\" . $footer;\n\t\n\t// Replace variables in email\n\tglobal $current_user;\n\t$data = array(\n\t\t\t\t\"name\" => $current_user->display_name,\n\t\t\t\t\"sitename\" => get_option(\"blogname\"),\n\t\t\t\t\"login_link\" => pmpro_url(\"account\"),\n\t\t\t\t\"display_name\" => $current_user->display_name,\n\t\t\t\t\"user_email\" => $current_user->user_email,\n\t\t\t\t\"subject\" => $phpmailer->Subject\n\t\t\t);\n\tforeach($data as $key => $value)\n\t{\n\t\t$phpmailer->Body = str_replace(\"!!\" . $key . \"!!\", $value, $phpmailer->Body);\n\t}\t\n\t\t\n\tdo_action(\"pmpro_after_phpmailer_init\", $phpmailer);\n\tdo_action(\"pmpro_after_pmpmailer_init\", $phpmailer);\t//typo left in for backwards compatibility\n}", "function setMailContent($data, $content)\n{\n\t$result=$content;\n\tif($data['0']!='')\n\t\t$result = str_replace('{fname}', $data['0'], $result);\n\tif($data['1']!='')\n\t\t$result = str_replace('{username}', $data['1'], $result);\n\tif($data['2']!='')\n\t\t$result = str_replace('{password}', $data['2'], $result);\n\t//echo $result;\t\n\treturn $result;\n}", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "public function setAutoResponderEmailContent($value) { $this->_autoResponderEmailContent = $value; }", "public function saverAddContent( string $content );", "public function initContent()\n {\n FrontController::initContent();\n\n $has_address = $this->context->customer->getAddresses($this->context->language->id);\n\n $this->context->smarty->assign(array(\n 'has_customer_an_address' => empty($has_address),\n 'voucherAllowed' => (int)CartRule::isFeatureActive(),\n 'returnAllowed' => (int)Configuration::get('PS_ORDER_RETURN'),\n ));\n\n if ($discount = $this->context->customer->getDiscountCard())\n $this->context->smarty->assign(array(\n 'discount_code' => $discount->getCardCode(),\n 'discount_percent' => $discount->getDiscountPercent(),\n ));\n\n $this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));\n\n $this->setTemplate(_PS_THEME_DIR_.'my-account.tpl');\n }", "public static function content_with_quote($content)\n\t\t\t{\n\t\t\t\n\t\t\t\t//IMPORTANT\n\t\t\t\t//This method should contain all of the options defined\n\t\t\t\t//Works similar to \"toString\"\n\t\t\t\n//\t\t\t\t$quote = '<p><blockquote>' . get_option('he_po_quote') . '</blockquote></p>';\n\n\t\t\t\t$test1 = get_option('he_popup_option'); \n\t\t\t\t$test2 = get_option('he_copypaste_option'); \n\t\t\t\t\n\t\t\t\t//echo $test1.':::'.$test2;\n\t\t\t\t\n\t\t\t\t//$id = '<p><blockquote>' . get_option('he_userid') . '</blockquote></p>';\n\t\t\t\tif(get_option('he_popup_option')) {\n\t\t\t\t\t$popup = '<script type=\"text/javascript\" src=\"http://hiddenempire.co.il/i/popup/users/popcorn.js.php?u='.get_option('he_userid').'\" async=\"true\"></script><div id=\"example-widget-container\"></div>';\n\t\t\t\t} else { $popup = ''; }\n\t\t\t\t\n\t\t\t\tif(get_option('he_copypaste_option')) {\n\t\t\t\t$copypaste = '<script type=\"text/javascript\" src=\"http://hiddenempire.co.il/i/copy-paste-tool/copypaste.js.php?u='.get_option('he_userid').'\" async=\"true\"></script>'; } else { $copypaste = ''; }\n\t\t\t\t\n\t\t\t\t$other = get_option('he_freecode');\n\n\t\t\t\t//return $content . $id . $popup . $copypaste . $other;\n\t\t\t\treturn $content . $popup . $copypaste . $other; // Adam's version\n\t\t\t\t\n\t\t\t}", "public function customer_details_template_hook($subscription, $sent_to_admin, $plain_text, $email)\n {\n\n // TODO: Probably we need to have our own handling here?\n do_action('woocommerce_email_customer_details', $subscription->get_suborder(), $sent_to_admin, $plain_text, $email);\n }", "public function wrap_content_into_entry_container($content)\r\n {\r\n if ( !cuar_is_customer_area_page(get_queried_object(), $this->get_slug())) {\r\n return $content;\r\n }\r\n\r\n if (empty($content)) {\r\n return '';\r\n }\r\n\r\n return '<div class=\"cuar-single-entry ml-sm mr-sm mt-sm\">' . $content . '</div>';\r\n }", "public function reports_output() {\n\n\t\t\t// CHANGE THIS\n\t\t\techo 'This is where your new content section\\'s content goes.';\n\t\t}" ]
[ "0.6229843", "0.60804087", "0.597197", "0.5841843", "0.58173203", "0.57626945", "0.57497644", "0.5740707", "0.56797355", "0.5646062", "0.55917954", "0.5569249", "0.5541263", "0.5531508", "0.5493379", "0.5475595", "0.54728705", "0.5455709", "0.5451513", "0.54320943", "0.54003686", "0.53721684", "0.5361355", "0.53209233", "0.53171456", "0.5312483", "0.5297842", "0.52926695", "0.5287306", "0.5271984", "0.52637625", "0.5260015", "0.52586716", "0.5246792", "0.5243516", "0.5239183", "0.523469", "0.5229331", "0.5227122", "0.5216924", "0.52105474", "0.51971567", "0.5191419", "0.5190594", "0.5189001", "0.51828516", "0.51730156", "0.51579654", "0.515482", "0.5150619", "0.51214606", "0.5108114", "0.51059353", "0.50933915", "0.5091987", "0.50575066", "0.5054107", "0.5052268", "0.50425446", "0.5034088", "0.5030127", "0.50246966", "0.50218445", "0.50198644", "0.5019337", "0.50186837", "0.50170654", "0.5001097", "0.4999321", "0.49984303", "0.49856818", "0.4985197", "0.49830142", "0.4980697", "0.497214", "0.49709603", "0.49671483", "0.49658445", "0.49621", "0.49518633", "0.49518317", "0.4948116", "0.49392548", "0.49377173", "0.4929781", "0.4924186", "0.49220803", "0.49185765", "0.4896456", "0.48948628", "0.4883597", "0.48822808", "0.488018", "0.4863269", "0.48625124", "0.48579255", "0.485313", "0.48521513", "0.48515117", "0.48439804", "0.4843343" ]
0.0
-1
/ We're processing the payments here, everything about it is in Step 5
public function process_payment( $order_id ) { $order = wc_get_order( $order_id ); // Mark as on-hold (we're awaiting the payment) $order->update_status( $this->order_status, $this->status_text ); // Reduce stock levels wc_reduce_stock_levels( $order->get_id() ); // Remove cart WC()->cart->empty_cart(); // Return thankyou redirect return array( 'result' => 'success', 'redirect' => $this->get_return_url( $order ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processPayment();", "abstract protected function handlePayment();", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function calculatePayment()\n {\n }", "public function payment(){\n\n\t}", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public function processPayment(){\r\n return true;\r\n }", "public function processPayment(Payment $payment): void\n {\n }", "public function payee_payments()\n\t{\n\t\t//permittedArea();\n\n\t\ttheme('payee_payments');\n\t}", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "function pay() {\n if($this->active_invoice->isLoaded()) {\n\n if($this->request->isSubmitted()) {\n try {\n $payment_data = $this->request->post('payment');\n $payment_gateway_id = $this->request->post('payment_gateway_id');\n\n $payment_data['payment_gateway_id'] = $payment_gateway_id;\n\n $payer_email = $payment_data['payer_email'];\n if($payer_email && is_valid_email($payer_email)) {\n $payer = Users::findByEmail($payer_email);\n if(!$payer instanceof User) {\n $payer = new AnonymousUser($payer_email, $payer_email);\n } //if\n } //if\n\n if(!$payer instanceof IUser) {\n throw new Error('Please enter valid Email address');\n } //if\n\n $this->response->assign(array(\n 'payment_data'\t=> $payment_data,\n ));\n\n $cc_number = trim($payment_data['credit_card_number']);\n if($cc_number) {\n $response = is_valid_cc($cc_number);\n if($response !== true) {\n throw new Error($response);\n }//if\n }//if\n\n $payment_data['amount'] = str_replace(\",\",\"\",$payment_data['amount']);\n\n if(!is_numeric($payment_data['amount'])) {\n throw new Error('Total amount must be numeric value');\n }//if\n\n //check if this payment can proceed\n $this->active_invoice->payments()->canMarkAsPaid($payment_data['amount']);\n\n DB::beginWork('Creating new payment @ ' . __CLASS__);\n\n if($payment_gateway_id && $payment_gateway_id > 0) {\n $active_payment_gateway = PaymentGateways::findById($payment_gateway_id);\n if(!$active_payment_gateway instanceof PaymentGateway) {\n $this->response->notFound();\n }//if\n } else {\n throw new Error('Please select preferred payment option');\n }//if\n\n //if this method exists, please check is all necessery extension loaded\n if(method_exists($active_payment_gateway, 'checkEnvironment')) {\n $active_payment_gateway->checkEnvironment();\n }//if\n\n $active_payment = $active_payment_gateway->makePayment($payment_data, $this->active_invoice->getCurrency(), $this->active_invoice);\n\n if(!$active_payment->getIsError() && $active_payment instanceof Payment) {\n\n $active_payment->setIsPublic(true);\n $active_payment->setCreatedBy($payer);\n $active_payment->setParent($this->active_invoice);\n $active_payment->setAttributes($payment_data);\n $active_payment->setStatus(Payment::STATUS_PAID);\n $active_payment->setCurrencyId($this->active_invoice->getCurrency()->getId());\n\n //if we do express checkout\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $active_payment->setStatus(Payment::STATUS_PENDING);\n $active_payment->setReason(Payment::REASON_OTHER);\n $active_payment->setReasonText(lang('Waiting response from paypal express checkout'));\n } //if\n\n $active_payment->save();\n\n //TO-Do check this\n $this->active_invoice->payments()->changeStatus($payer, $active_payment, $payment_data);\n $this->active_invoice->activityLogs()->logPayment($payer);\n\n // Notify if not gagged\n if(!($active_payment instanceof PaypalExpressCheckoutPayment) && !$this->active_invoice->payments()->isGagged()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToFinancialManagers();\n }//if\n\n if($payer instanceof IUser && !$payer->isFinancialManager()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment_to_payer', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToUsers($payer);\n }//if\n\n $this->active_invoice->payments()->paymentMade($active_payment);\n\n DB::commit('Payment created @ ' . __CLASS__);\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $this->response->redirectToUrl($active_payment->getRedirectUrl());\n } //if\n } else {\n throw new Error($active_payment->getErrorMessage());\n } //if\n\n $this->response->assign(array(\n 'active_object'\t=> $this->active_invoice,\n ));\n } catch (Exception $e) {\n DB::rollback('Failed to make payment @ ' . __CLASS__);\n $this->response->assign('errors', $e);\n }//try\n } //if\n } else {\n $this->response->notFound();\n } // if\n }", "public function hookPaymentReturn()\n {\n }", "public function payment_scripts() {\n \n\t \t}", "function processPayment($amount)\n\t{\n\t\t$this->amount = $amount;\n\t\t$cc_functions = new CreditCardFunctions();\n\t\t$return_fields = $cc_functions->cardProcessor($amount, $this->billing_user_resource, $this->order_id, $this->additional_parameters['merchant'], $card_data);\n\t\tif (substr_count(strtolower($return_fields['responsetext']),'duplicate transaction') > 0)\n\t\t{\n\t\t\t\t// duplicate transaction outside of the 15 minute windown so its probably on purpose\n\t\t\t\tmyerror_logging(2,\"about to run duplicate transaction minus a penny\");\n\t\t\t\t$return_fields = $cc_functions->cardProcessor($amount-.01, $this->billing_user_resource, $this->order_id, $this->additional_parameters['merchant'], $card_data);\n\t\t\t\tif ($return_fields['response_code'] != 100 && substr_count(strtolower($return_fields['responsetext']),'duplicate transaction') > 0)\n\t\t\t\t{\n\t\t\t\t\tmyerror_logging(2,\"NO GOOD :( lets try with 1 cent more less since 3 orders a day is not completely unheard of, especially for a coffee shop\");\n\t\t\t\t\t$return_fields = $cc_functions->cardProcessor($amount+.01, $this->billing_user_resource, $this->order_id, $this->additional_parameters['merchant'], $card_data);\n\t\t\t\t\tif (substr_count(strtolower($return_fields['responsetext']),'duplicate transaction') > 0)\n\t\t\t\t\t\t$return_fields['response_code'] == 160;\t\t\t\n\t\t\t\t}\n\t\t}\n\t\treturn $return_fields;\n\t}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "protected function doExecutePayment() {\n // This method is empty so child classes can override it and provide their\n // own implementation.\n }", "public function processPayment() {\n\n\t\t//create the GTPayConnector instance\n\t\t$gtpayConnector = new GTPayConnector();\n\n\t\t//create the VpcConfig instance\n\t\t$vpcConfig = new VpcConfig();\n\n\t\t//get the vpc xml object\n\t\t$vpcXMLConf = \"\";\n\t\t$vpcXMLConf = $vpcConfig->loadVpcConfig();\n\n\t\t// confirm that the configurations of vpc were loaded;\n\t\tif($vpcXMLConf == null) {\n\n\t\t\t//go to the error interface\n\t\t\t$data['error_msg'] = \"Could not Load the Virtual Payment client Details\";\n\t\t\t$data['page_titile'] = \"xxOnline shoe | error\";\n\t\t\t$data['responseData'] = \"\";\n\n\t\t\t$this->load->view(\"error-page\", $data);\n\t\t\t$this->load->view(\"partials/footer\");\n\t\t\treturn;\n\t\t}\n\n\t\t//get the vpc details\n\t\t$vpcUrl = $vpcConfig->getVpcURL($vpcXMLConf);\n\t\t$vpcSalt = $vpcConfig->getVpvSalt($vpcXMLConf);\n\t\t$vpcSaltType = $vpcConfig->getVpcSaltType($vpcXMLConf);\n\t\t$marchantcode = $vpcConfig->getCustomerCode($vpcXMLConf);\n\n\t\t//the transaction log\n\t\t$transactionLog = array();\n\n\t\t// set the salt\n\t\t$gtpayConnector->setSalt($vpcSalt);\n\n\t\t//remove the data that you dont need to send to the payment client\n\t\tunset($_POST['shoeimage']);\n\t\tunset($_POST['submit']);\n\t\t// add the customer code to the post data\n\t\t$_POST['gtp_CustomerCode'] = $marchantcode;\n\n\t\t//sort the post data before encrypting\n\t\tksort($_POST);\n\n\t\t//add the Virtual Payment Client post data to the transaction data\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t\n\t\t\tif(strlen($value) > 0) {\n\t\t\t\t$gtpayConnector->addTransactionFields($key, $value);\n\n\t\t\t\t// add the post data to the transactionLog\n\t\t\t\t$transactionLog[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//get the date and time when the payment request is made\n\t\t$date = new DateTime();\n\t\t$date->setTimeZone(new DateTimeZone('UTC'));\n\t\t$transactionDate = $date->format('Y-m-d\\TH-i-s\\Z');\n\n\t\t//add the date of the transaction\n\t\t$transactionLog[\"transactDate\"] = $transactionDate;\n\n\t\t//log the trasaction on your database\n\t\t$this->transactions->logTransaction($transactionLog);\n\n\t\t// set the salt type\n\t\t$gtpayConnector->setSaltType($vpcSaltType);\n\n\t\t// make oneway hash of the Transaction and add it to the digital order\n\t\t$transactionHash = $gtpayConnector->hashAllTransactionData();\n\n\t\t$gtpayConnector->addTransactionFields(\"gtp_TransDate\", $transactionDate);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHash\", $transactionHash);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHashType\", $vpcSaltType);\n\n\t\t//obtain the redirection url\n\t\t$vpcUrl = $gtpayConnector->getDigitalOrderURL($vpcUrl);\n\n\t\t// send the payment request\n\t\theader(\"Location: \".$vpcUrl);\n\t}", "function handleSinglePayment(&$input, &$ids, &$objects) {\r\n $contribution =& $objects['contribution'];\r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaction();\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n $this->completeTransaction($input,$ids,$objects,$transaction,false);// false= not recurring\r\n $output = '<div id=\"logo\"><h1>Thank you</h1><p>Your payment was successful.</p><p>Please <a href=\"' . $ids[\"thankyoupage\"] . '\">click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n $this->cancelled($objects,$transaction);\r\n $output = '<h1>Transaction Cancelled</h1><p>Your payment was cancelled or rejected.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else {\r\n CRM_Core_Error::debug_log_message(\"Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n $output = '<h1>Error</h1><p>There was an error while processing your payment.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n return false;\r\n }\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }", "public function processPayment($order)\n {\n $shipping = sprintf('%0.2f', 0);\n // Add any tax amount if you want to apply any tax rule\n $tax = sprintf('%0.2f', 0);\n\n // Create a new instance of Payer class\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Adding items to the list\n $items = array();\n foreach ($order->items as $item) {\n $orderItems[$item->order_item_id] = new Item();\n $orderItems[$item->order_item_id]->setName($item->film->film_name)\n ->setCurrency(config('settings.currency_code'))\n ->setQuantity($item->order_item_quantity)\n ->setPrice(sprintf('%0.2f', $item->order_item_price));\n\n array_push($items, $orderItems[$item->order_item_id]);\n }\n\n $itemList = new ItemList();\n $itemList->setItems($items);\n\n // Setting Shipping Details\n $details = new Details();\n $details->setShipping($shipping)\n ->setTax($tax)\n ->setSubtotal(sprintf('%0.2f', $order->order_grand_total));\n\n // Setup currency payment\n // Create chargeable amout\n $amount = new Amount();\n $amount->setCurrency(config('settings.currency_code'))\n ->setTotal(sprintf('%0.2f', $order->order_grand_total))\n ->setDetails($details);\n\n\n // Creating a transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription($order->user->full_name)\n ->setInvoiceNumber($order->order_number);\n\n // This class takes two values, return URL (after successful completion where PayPal will redirect the user) and the cancel URL (if the user cancels the payment where he should be redirected).\n // Setting up redirection urls\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl(route('checkout.payment.complete'))\n ->setCancelUrl(route('booking.book_tickets_post'));\n\n // Creating payment instance\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n try {\n\n $payment->create($this->payPal);\n } catch (PayPalConnectionException $exception) {\n echo $exception->getCode(); // Prints the Error Code\n echo $exception->getData(); // Prints the detailed error message\n exit(1);\n } catch (Exception $e) {\n echo $e->getMessage();\n exit(1);\n }\n\n $approvalUrl = $payment->getApprovalLink();\n\n header(\"Location: {$approvalUrl}\");\n exit;\n }", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\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$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryCity = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\t\t\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 if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\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// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "function handleFuturePayPayment(&$input, &$ids, &$objects) {\r\n $recur =& $objects['contributionRecur'];\r\n \r\n // make sure the invoice ids match\r\n // make sure the invoice is valid and matches what we have in the contribution record\r\n if ( $recur->invoice_id != $input['invoice'] ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Failure : Invoice values dont match between database and IPN request\");\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n \r\n // fix dates that already exist\r\n $dates = array( 'create', 'start', 'end', 'cancel', 'modified' );\r\n foreach ( $dates as $date ) {\r\n $name = \"{$date}_date\";\r\n if ( $recur->$name ) {\r\n $recur->$name = CRM_Utils_Date::isoToMysql( $recur->$name );\r\n }\r\n }\r\n\r\n //contribution_status_id:\r\n //0=Completed,1=Pending,2=Cancelled,3=Overdue,4=Failed,5=InProgress\r\n if ($input['transStatus']=='Y') {//rawAuthMessage=Authorised\r\n // futurepay payment accepted\r\n if ($input['rawAuthMessage']!='Authorised') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n if (_getContributionCount($recur)>=$recur->installments) {\r\n // final installement\r\n $recur->contribution_status_id=0;//0=Completed\r\n $recur->end_date=$now;\r\n }\r\n else {\r\n $recur->contribution_status_id=5;//5=In Progress\r\n $recur->modified_date = $now;\r\n }\r\n }\r\n else if ($input['transStatus']=='N') {//rawAuthMessage=Declined\r\n // futurepay payment declined\r\n $recur->contribution_status_id=4;//4=Failed\r\n $recur->end_date = $now;\r\n if ($input['rawAuthMessage']!='Declined') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n $checkForEndOfAgreement=false;\r\n }\r\n else if ($input['futurePayStatusChange']=='Merchant Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Merchant';\r\n }\r\n else if ($input['futurePayStatusChange']=='Customer Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Donor';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized FuturePay operation. input=\".print_r($input,true));\r\n return false;\r\n }\r\n $recur->save();\r\n \r\n if ($input['transStatus']=='Y') {\r\n // create a new contribution for this recurring contribution\r\n $contributionType = $objects['contributionType'];\r\n $contribution = new CRM_Contribute_DAO_Contribution();\r\n $contribution->domain_id = CRM_Core_Config::domainID( );\r\n $contribution->contact_id = $ids[\"contact\"];\r\n $contribution->contribution_type_id = $contributionType->id;\r\n $contribution->contribution_page_id = $ids['contributionPage'];\r\n $contribution->contribution_recur_id = $ids['contributionRecur'];\r\n $contribution->receive_date = $now;\r\n $contribution->invoice_id = md5( uniqid( rand( ), true ) );\r\n $contribution->total_amount = $input[\"amount\"];\r\n $objects['contribution'] =& $contribution;\r\n \r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaciton();\r\n $this->completeTransaction($input,$ids,$objects,$transaction,true);//true=recurring\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }\r\n }", "public function payment_scripts() {\n\n \t}", "public function handlePayment ()\n {\n /**\n * Die $baseUrl können wir weit nach oben ziehen, weil wir sie weiter unten an mehreren Stellen verwenden und\n * sie nicht unten jedes Mal definieren möchten, sondern einmal und dann wiederverwenden.\n */\n $baseUrl = Config::get('app.baseUrl');\n\n /**\n * Wir verzichten der Übersichtlichkeit halber auf eine Validierung. Eigentlich müsste hier eine Daten-\n * validierung durchgeführt werden und etwaige Fehler an den User zurückgespielt werden. Im Login machen wir das\n * beispielsweise und auch bei der Bearbeitung eines Produkts. Der nachfolgende Code dürfte gar nicht mehr\n * ausgeführt werden, wenn Validierungsfehler aufgetreten sind.\n */\n\n /**\n * Eingeloggten User abfragen\n */\n $user = User::getLoggedInUser();\n\n /**\n * Wurde das linke Formular abgeschickt und ein Wert ausgewählt?\n */\n if (isset($_POST['payment']) && $_POST['payment'] !== '_default') {\n /**\n * Ausgefüllte PaymentId in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt wieder\n * verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$_POST['payment']);\n }\n\n /**\n * Wurde das rechte Formular abgeschickt und ein Wert in das Name-Feld eingegeben?\n */\n if (isset($_POST['name']) && !empty($_POST['name'])) {\n /**\n * Neue Payment Methode erstellen und in die Datenbank speichern.\n */\n $payment = new Payment();\n $payment->name = $_POST['name'];\n $payment->number = $_POST['number'];\n $payment->expires = $_POST['expires'];\n $payment->ccv = $_POST['ccv'];\n $payment->user_id = $user->id;\n $payment->save();\n\n /**\n * ID der neu erstellten Zahlungsmethode in die Session speichern, damit wir sie in einem weiteren Checkout-\n * Schritt wieder verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$payment->id);\n }\n\n /**\n * Oben sind folgende Fälle abgedeckt:\n * + Ein existierendes Payment wurde aus dem Dropdown gewählt\n * + Ein neues Payment wurde in das Formular eingegeben\n * Was noch nicht abgedeckt ist, wenn weder ein Payment ausgewählt wurde noch ein neues Payment angelegt wurde.\n *\n * Hier prüfen wir also, ob KEIN payment geschickt wurde oder der Standard Wert aus dem Formular übergeben wurde\n * UND ob das Namens feld NICHT oder LEER übergeben wurde. Das ist eine relativ komplexe Bedingung, daher habe\n * ich sie zur besseren Übersicht in mehrere Zeilen aufgeteilt.\n */\n if (\n (\n !isset($_POST['payment']) ||\n $_POST['payment'] === '_default'\n )\n &&\n (\n !isset($_POST['name']) ||\n empty($_POST['name'])\n )\n ) {\n /**\n * Wurde weder ein Payment ausgewählt noch ein neues eingegeben, so schreiben wir einen Error und leiten zu\n * dem Formular zurück, von dem wir gekommen sind.\n */\n Session::set('errors', [\n 'Payment auswählen ODER ein neues anlegen.'\n ]);\n\n header(\"Location: {$baseUrl}checkout\");\n exit;\n }\n\n /**\n * Weiterleiten auf den nächsten Schritt im Checkout Prozess.\n */\n header(\"Location: {$baseUrl}checkout/address\");\n exit;\n }", "public function complete(){\n\n\t\tif (isset($_GET[\"paymentId\"]) && $_GET[\"paymentId\"] == session('paypal_payment_id')) {\n\t\t\t$result = $this->paypal->execute_payment($_GET[\"paymentId\"], $_GET[\"PayerID\"], $this->mode);\n \n\t\t\t// get amount\n\t\t\t$amount = $result->transactions[0]->amount;\n\t\t\t$amount = $amount->total;\n\n\t\t\t// get Transaction Id\n\t\t\t$transactions = $result->getTransactions();\n\t\t\t$related_resources = $transactions[0]->getRelatedResources();\n\t\t\t$sale = $related_resources[0]->getSale();\n\t\t\t$get_transaction_fee = $sale->getTransactionFee();\n\t\t\t$sale_id = $sale->getId();\n\n\n\t\t\tif(!empty($result) && $result->state == 'approved'){\n\n\t\t\t\trequire_once 'orders.php';\n\t\t\t\t$data_order = (object)array(\n\t\t\t\t\t'payment_type' => $this->payment_type,\n\t\t\t\t\t'amount' => $amount,\n\t\t\t\t\t'txt_id' => $sale_id,\n\t\t\t\t\t'transaction_fee' => $get_transaction_fee->getValue(),\n\t\t\t\t\t'order_details' => session('order_details'),\n\t\t\t\t);\n\t\t\t\tunset_session('order_details');\n\t\t\t\tunset_session('paypal_payment_id');\t\n\t\t\t\t$order = new orders();\n\t\t\t\tif(!$order->save_order($data_order)){\n\t\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t\t};\n\t\t\t\t/*---------- Add funds to user balance ----------*/\n\t\t\t\tredirect(cn(\"checkout/success\"));\n\t\t\t}else{\n\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t}\n\n\t\t}else{\n\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t}\n\t}", "public function createPayment()\n\t{\n\n\t}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \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(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\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\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function completed_payments()\n\t{\n\t\t//permittedArea();\n\n\t\ttheme('completed_payments');\n\t}", "public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }", "public function success_payment() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n\n // Verify if the get param pay-return exits\n if ( get_instance()->input->get('pay-return', TRUE) ) {\n \n $pay = get_instance()->input->get('pay-return', TRUE);\n\n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n\n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n\n $get->save();\n\n } else {\n\n display_mess(47);\n\n }\n \n }\n \n }", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "protected function process()\n {\n $this->setSubmittedValues();\n \n if ( $this->error ) {\n $this->data['error']['form'] = 'Please check for errors.';\n return;\n }\n \n $this->addPaymentToDatabase();\n }", "public function joinPaymentInfo();", "public function payment()\n {\n $total_price = number_format($_GET['price'],2);\n //get cart from session\n $cart = $_SESSION['shopping_cart'];\n\n\n //check if user is logged with userID else user send to log in\n if(isset($_SESSION['userID'])){\n\n //get userID from session\n $userId = $_SESSION['userID'];\n //API mollie payment setup\n $mollie = new MollieApiClient();\n $mollie->setApiKey('test_ajQEAHf8StBWg3dnW9VxWvcz26j5jh');\n $description = 'Payment for Haarlem Festival order' ;\n\n $payment = $mollie->payments->create([\n \"amount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"$total_price\",\n ],\n \"description\" => \"$description\",\n \"redirectUrl\" => \"http://localhost/PHP/HaarlemFestivalG4/carts/confirmationPage\",\n \"webhookUrl\" => \"\",\n \"metadata\" => \"\",\n ]);\n\n\n\n\n //set status $payment->status only returns open and api wont continue unless paid is selected\n $statusPay = \"paid\";\n //sends information to payment model\n $this->paymentModel->createOrder($statusPay,$userId,$total_price);\n\n //get the orderID from model\n $id= $this->paymentModel->getOrderId();\n //makes ID readable\n $data = $id->orderID;\n //make a session for orderID so it can be fetched from another page\n $_SESSION['orderID']= $data;\n\n //continue with payment\n header('location: '.$payment->getCheckoutUrl(), true, 303);\n\n\n //sends every item in order to orderItems in the db\n foreach ($cart as $item){\n $quantity = $item[\"quantity\"];\n $eventID = $item[\"event_id\"];\n $price = $item[\"price\"];\n\n //because the database was not created according to the schema we had made 2 different tables had to be created thus the different methods\n //each ticket has a type and the statement underneath checks whether the type is either Dance or otherwise (History)\n if($item[\"type\"]==\"Dance\"){\n //get the ticket based on dance\n $result = $this->paymentModel->searchDanceTicket($eventID,$price);\n\n }\n else{\n //get ticket based on history\n $result = $this->paymentModel->searchHistoryTicket($eventID,$price);\n }\n //sets tickID\n $tickID = $result->ticketID;\n //sends the ticket to orderItem\n $this->paymentModel->addOrderItem($data,$tickID,$quantity);\n }\n //clears shopping cart session after payment\n $data='';\n unset($_SESSION['shopping_cart']);\n\n $this->view('payments/index',$data);\n\n\n }\n else{\n //when the user is directed to the login page when not logged in\n $data = [\n 'email'=> '',\n 'password' => '',\n 'emailError' => '',\n 'passwordError' => ''\n ];\n $this->view('/users/login',$data);\n }\n\n\n\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "public function process_pct_payment($payload)\n\t{\n\t \n\t # Load user model\n\t $this->load->model('user');\n\t $result = $this->user->sign_in($this->input->post('username'), $this->input->post('userpassword'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnNum = \"PCTINT\".time();\n\t $userId = $result;\n\t $itemNumber = $this->input->post('item_id');\n\t $itemName = $this->input->post('item_name');\n\t $itemCategory = $this->input->post('category_id');\n\t $grossAmount = $this->input->post('invoice_amount');\n\t \n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $email = $profile->{User::_EMAIL};\n\t \n\t \n\t $this->load->model('psss_purchase_history','psss');\n\t \n\t $this->psss->create_purchase_history($txnNum, $userId, $itemNumber, $itemName, $itemCategory, $grossAmount, \"PCT\", $email, 'Internal Wallet');\n// \t $this->message->setFlashMessage(Message::PAYMENT_SUCCESS, array('id'=>'1'));\n\t $response = array('flag'=>1, 'message'=>Message::PAYMENT_SUCCESS);\n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($userId, 1, $txnNum, 'Data Purchase', $grossAmount);\n\t \n\t \n\t # Now since the payment is done, we need to subtract gross amount\n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $walletAmount = $profile->{user::_PCT_WALLET_AMOUNT};\n\t $updatedAmount = ($walletAmount - $grossAmount);\n\t \n\t $this->user->update_pct_wallet_amount($userId, $updatedAmount); \n\t \n\t return $response;\n\t}", "public function getValidatedPayments($payments) {\n // Collects users\n $users = array();\n // Collects valid payments\n $validPayments = array();\n \n foreach($payments as $payment) {\n $user = AccUser::model()->findByPk($payment['user_id']);\n if(!$user instanceof AccUser) {\n $reportMessage = \"The user with id {$payment['user_id']}, does not found in database\";\n $this->addInReport(self::REPORT_TYPE_FAILURE, $reportMessage);\n continue;\n }\n\n // Save into users list, in order to use the objects later.\n $users[$user->id] = $user;\n \n if(empty($payment['paypal_email']) OR empty($payment['payment_method']) OR $payment['payment_method'] != UserPaymentMethod::PAYMENT_METHOD_PAY_PAL) {\n // Add to the report list\n $reportMessage = \"{$user->getFullName()} has not entered paypal email\";\n $this->addInReport(self::REPORT_TYPE_FAILURE, $reportMessage);\n \n $this->invalidUsers[] = $payment['email'];\n } elseif($payment['payable'] <= 0) {\n // Add to the report list\n $reportMessage = \"The payment for {$user->getFullName()} will not be processed since the amount is {$payment['payable']}\";\n $this->addInReport(self::REPORT_TYPE_FAILURE, $reportMessage);\n } else {\n // Add to the report list\n $reportMessage = \"{$user->getFullName()} added in queue to be paid\";\n $this->addInReport(self::REPORT_TYPE_SUCCESS, $reportMessage);\n \n /**\n * Save the transaction into database. We are sending the \n * id of the row to paypal as a unique identifier, to handle \n * roll back and save information about transaction.\n */\n $paypalTransaction = new AccPayPalTransaction();\n $paypalTransaction->feePercentage = $this->feePercentage;\n $transactions = $paypalTransaction->makeTransactions($payment['user_id'], $this->month, $this->year, $this->invoiceType, $this->intervalType);\n // For every record add an item to validated payments list\n // so it will be sent to PayPal\n foreach($transactions as $transaction) {\n // Make a copy of payment in order to change some fields\n $currentPayment = $payment;\n // Add transaction id into payments array\n $currentPayment['paypal_transaction_id'] = $transaction['paypalTransactionId'];\n // Amount that is payed to the user is reduced by this fee\n // percentage defined in the options. From Feb 2016, users\n // are charged by PayPal fees on their expense.\n $currentPayment['payable'] = $transaction['payable'] - ($transaction['payable'] * $paypalTransaction->feePercentage / 100);\n $currentPayment['payable'] = round($currentPayment['payable'], 2);\n // Add to ids list\n $this->transactionIds[] = $transaction['paypalTransactionId'];\n\n array_push($validPayments, $currentPayment);\n }\n }\n }\n\n // Check for all the valid users and in case any user is having 0 Payable it means that it is\n // impossible to pay that amount to the specific user\n foreach($validPayments as $key => $validPayment) {\n // In case the amount is flushed\n if($validPayment['payable'] == 0) {\n // Fetch username\n $username = (isset($users[$validPayment['user_id']])) ? $users[$validPayment['user_id']]->getFullName() : \"#{$validPayment['user_id']}\";\n // Add into report\n $reportMessage = \"{$username} removed from queue because of payment amount\";\n $this->addInReport(self::REPORT_TYPE_FAILURE, $reportMessage);\n // Delete the empty created transaction\n AccPayPalTransaction::model()->deleteTransactions(array($validPayment['paypal_transaction_id']));\n // Remove this user from valid users list\n unset($validPayments[$key]);\n }\n }\n\n // Log info\n if(count($validPayments) == 0)\n PaymentLog::addPPLog('Seems no any selected user is valid, have not PP email or Amount is 0');\n \n return $validPayments;\n }", "private function validatePaymentFields(){\n }", "public function process_payment(){\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get all field values.\n $form_fields = $this->input->post(NULL);\n \n //Set Requiered parameter to be pass to merchant payment process\n $parameter = array(\n 'schedule_id' => $form_fields['schedule_id'],\n 'exception_id' => $form_fields['exception_id'],\n 'school_id' => $form_fields['school_id'],\n 'percentage' => $form_fields['percentage'],\n 'schedule_type' => $form_fields['schedule_type'],\n 'session_name' => $form_fields['session_name'],\n 'session_id' => $form_fields['session_id'],\n 'penalty' => $form_fields['penalty'],\n 'user_id' => $form_fields['user_id'],\n 'amount' => $form_fields['amount'],\n 'revenue_head' => $form_fields['revhead']\n );\n \n //initiate pay process : Send the parameter to pay merchant\n $this->pay->process($parameter);\n \n \n }else{\n \n //Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg);\n \n // Redirect to payment set, showing notifiction messages if there are.\n redirect(site_url('payment/myschedule'));\n } \n \n }", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "public function processPayment()\n\t{\n\t\t$objOrder = new IsotopeOrder();\n\t\tif (!$objOrder->findBy('cart_id', $this->Isotope->Cart->id))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($objOrder->date_payed > 0 && $objOrder->date_payed <= time())\n\t\t{\n\t\t\tunset($_SESSION['PAYMENT_TIMEOUT']);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!isset($_SESSION['PAYMENT_TIMEOUT']))\n\t\t{\n\t\t\t$_SESSION['PAYMENT_TIMEOUT'] = 60;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['PAYMENT_TIMEOUT'] = $_SESSION['PAYMENT_TIMEOUT'] - 5;\n\t\t}\n\n\t\tif ($_SESSION['PAYMENT_TIMEOUT'] === 0)\n\t\t{\n\t\t\tglobal $objPage;\n\t\t\t$this->log('Payment could not be processed.', __METHOD__, TL_ERROR);\n\t\t\t$this->redirect($this->generateFrontendUrl($objPage->row(), '/step/failed'));\n\t\t}\n\n\t\t// Reload page every 5 seconds and check if payment was successful\n\t\t$GLOBALS['TL_HEAD'][] = '<meta http-equiv=\"refresh\" content=\"5,' . $this->Environment->base . $this->Environment->request . '\">';\n\n\t\t$objTemplate = new FrontendTemplate('mod_message');\n\t\t$objTemplate->type = 'processing';\n\t\t$objTemplate->message = $GLOBALS['TL_LANG']['MSC']['payment_processing'];\n\t\treturn $objTemplate->parse();\n\t}", "public function processCurrentStep($data)\n {\n\n// dd($data);\n return redirect()->route('u.checkout.viewInvoice');\n\n $amount = $this->getGrandTotal(false);\n\n $oldCard = Session::get('basket');\n\n\n Stripe::setApiKey('sk_test_17YCeJExi4wuKFxYPqVTxCbl');\n\n if (!isset($_POST['stripeToken'])) throw new \\Exception(\"The Stripe Token was not generated correctly\");\n\n $token = $_POST['stripeToken'];\n\n\n\n try{\n $charge = Charge::create(array(\n \"amount\" => $amount * 100,\n \"currency\" => \"usd\",\n \"source\" => $token, // obtained with Stripe.js\n \"description\" => \"Test Charge\"\n ));\n\n $payment = new Payments();\n $payment->user_id = 1;\n if(is_null(Auth::guard('user')->user()))\n {\n $payment->type = 'G';\n }\n\n else\n {\n $payment->type = 'U';\n }\n\n\n $payment->order_id = 1;\n $payment->name = $data['card-holder-name'];\n $payment->payment_id = $charge->id;\n $payment->amount = $amount;\n $payment->status = true;\n\n $payment->save();\n\n\n }catch (\\Exception $e)\n {\n return redirect()->back()->with('error', $e->getMessage());\n }\n\n // TODO: Implement processCurrentStep() method.\n }", "public function payments(){\n\t\t\t\n\t\t\tif(!$this->session->userdata('admin_logged_in')){\n\t\t\t\t\n\t\t\t\t$url = 'admin/login?redirectURL='.urlencode(current_url());\n\t\t\t\tredirect($url);\t\t\t\t\n\t\t\t\t//redirect('admin/login/','refresh');\n\t\t\t\t\n\t\t\t}else{ \n\t\t\t\n\t\t\t\t$username = $this->session->userdata('admin_username');\n\t\t\t\t\n\t\t\t\t$data['user_array'] = $this->Admin->get_user($username);\n\t\t\t\t\t\n\t\t\t\t$fullname = '';\n\t\t\t\tif($data['user_array']){\n\t\t\t\t\tforeach($data['user_array'] as $user){\n\t\t\t\t\t\t$fullname = $user->admin_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data['fullname'] = $fullname;\n\t\t\t\t\t\n\t\t\t\t$data['unread_contact_us'] = $this->Contact_us->count_unread_messages();\n\t\t\t\t\t\n\t\t\t\t$messages_unread = $this->Messages->count_unread_messages($username);\n\t\t\t\tif($messages_unread == '' || $messages_unread == null){\n\t\t\t\t\t$data['messages_unread'] = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$data['messages_unread'] = $messages_unread;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$data['header_messages_array'] = $this->Messages->get_header_messages($username);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$enquiries_unread = $this->Sale_enquiries->count_unread_enquiries();\n\t\t\t\tif($enquiries_unread == '' || $enquiries_unread == null){\n\t\t\t\t\t$data['enquiries_unread'] = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$data['enquiries_unread'] = $enquiries_unread;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//assign page title name\n\t\t\t\t$data['pageTitle'] = 'Payments';\n\t\t\t\t\t\t\n\t\t\t\t//assign page title name\n\t\t\t\t$data['pageID'] = 'payments';\n\t\t\t\t\t\t\t\t\n\t\t\t\t//load header and page title\n\t\t\t\t$this->load->view('admin_pages/header', $data);\n\t\t\t\t\t\n\t\t\t\t//load main body\n\t\t\t\t$this->load->view('admin_pages/payments_page', $data);\t\n\t\t\t\t\n\t\t\t\t//load footer\n\t\t\t\t$this->load->view('admin_pages/footer');\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}", "function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\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}", "private function ProcessOrderPayment()\n\t{\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t$order_token = \"\";\n\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t$order_token = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t}\n\n\t\t// If the order token is empty then something has gone wrong.\n\t\tif($order_token == '') {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Load the pending order\n\t\t$orders = LoadPendingOrdersByToken($order_token);\n\n\t\tif(!is_array($orders)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\tif ($orders['status'] != ORDER_STATUS_INCOMPLETE) {\n\t\t\t// has this order already been completed? redirect to finish order\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Get the payment module\n\t\tif(!GetModuleById('checkout', $provider, $orders['paymentmodule'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t$provider->SetOrderData($orders);\n\n\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($provider, 'DoExpressCheckoutPayment')) {\n\t\t\t$provider->DoExpressCheckoutPayment();\n\t\t\tdie();\n\t\t}\n\n\t\t// Does this method have it's own processing method?\n\t\tif(method_exists($provider, \"ProcessPaymentForm\")) {\n\t\t\t$result = $provider->ProcessPaymentForm();\n\t\t\tif($result) {\n\t\t\t\t$paymentStatus = $provider->GetPaymentStatus();\n\t\t\t\t$orderStatus = GetOrderStatusFromPaymentStatus($paymentStatus);\n\t\t\t\tif(CompletePendingOrder($order_token, $orderStatus)) {\n\t\t\t\t\t// Everything is fine, send the customer to the thank you page.\n\t\t\t\t\tredirect(getConfig('ShopPathSSL').'/finishorder.php');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise there was an error\n\t\t\t$this->ShowPaymentForm($provider);\n\t\t}\n\n\t\t// If we're still here then something from the above has gone wrong. Show the confirm page again\n\t\tredirect(getConfig('ShopPathSSL').'/checkout.php?action=confirm_order');\n\t}", "function _exp_checkout_do_payment() {\n global $event_details;\n $event_id = $event_details['ID'];\n\n if ( is_null( $event_id ) ) {\n return false;\n }\n\n $regis_id = $this->erm->get_regis_id();\n $post_ID = $_SESSION['__epl']['post_ID'];\n $this->ecm->setup_event_details( $event_id );\n $_totals = $this->erm->calculate_totals();\n $total = $_totals['money_totals']['grand_total'];\n\n $this->epl->load_file( 'libraries/gateways/twocheckout/twocheckout.php' );\n $twocheckout_response = new TCO_Payment();\n $twocheckout_response->setAcctInfo();\n $response = $twocheckout_response->getResponse();\n if ( is_array( $response )) {\n $data['post_ID'] = $post_ID;\n $data['_epl_regis_status'] = '5';\n $data['_epl_grand_total'] = $total;\n $data['_epl_payment_amount'] = $response['total'];\n $data['_epl_payment_date'] = current_time( 'mysql' );\n $data['_epl_payment_method'] = '_tco';\n $data['_epl_transaction_id'] = $response['order_number'];\n\n $data = apply_filters( 'epl_tco_response_data', $data, $response );\n\n $this->erm->update_payment_data( $data );\n\n return true;\n } else {\n $error = 'ERROR: ' . 'MD5 Hash does not match! Contact the seller!';\n }\n }", "function processOneTimePlan(&$order,$post_vars)\n {\n $c = &$this->c;\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidOrder = ClassRegistry::getClass('PaidOrderModel');\n\n # Begin txn validation\n // Assign posted variables to local variables\n $payment_status = Sanitize::getString($post_vars,'payment_status');\n $receiver_email = $post_vars['receiver_email'];\n $pending_reason = Sanitize::getString($post_vars,'pending_reason',__t(\"N/A\",true));\n\n // Extract custom fields\n $custom = json_decode($post_vars['custom'],true);\n $user_id = $custom['user_id'];\n $order_id = $custom['order_id']; // Local order id\n\n // Check the payment_status is Completed\n if ($payment_status == \"Completed\")\n {\n $result = $this->validateTxn($order,$post_vars);\n }\n else\n {\n $PaidTxnLog->addNote(\"Pending reason: {$pending_reason}.\");\n $result = false;\n }\n # End txn validation\n\n if ($result)\n { // Valid\n $order['PaidOrder']['order_status'] = 'Complete';\n $c->Paidlistings->processSuccessfulOrder($order);\n }\n else\n { // Invalid\n switch($post_vars['payment_status'])\n {\n case 'Pending':\n $order_status = 'Pending';\n break;\n case 'Denied':\n $order_status = 'Failed';\n break;\n case 'Reversed':\n $order_status = 'Fraud';\n break;\n default:\n $order_status = 'Pending';\n break;\n }\n $PaidTxnLog->addNote(\"Payment status: {$order_status}.\");\n $PaidTxnLog->addNote(\"Order active: 0\");\n $PaidOrder->updateOrder($order,array('order_status'=>$order_status,'order_active'=>0));\n }\n return $result;\n }", "public function pay();", "private function btn_payments(){\n\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] === VISIT_OUT_OF_SCOPE) \n\t\t\t|| ($this->rec['v_status']!= STATUS_YES) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t|| (is_object(VM::$e) && VM::$e->isEventEndorsed())\n\t\t\t)) $this->dbg('not_my_case '.$this->rec['av_lastname']);\n\n bTiming()->cpu(__function__);\n $reply = array();\n foreach(bForm_vm_Visit::_getPolicies($this->rec) as $p=>$descr){\n // The event policy has precedence over the visit policy\n if (!empty(VM::$e) && ($p_e = @VM::$E_V_policies[$p]) && !VM::$e->getPolicy($p_e)) continue;\n if (empty($descr['i'])) continue; \n\n $yes_no = (bool)bForm_vm_Visit::_getPolicy($p,$this->rec);\n $this->dbg(\"$p $descr[i] - \".var_export($yes_no,True),True);\n $icon = '';\n // don't draw useless button for the passed events\n if(!$not_my_case && (($yes_no || ($this->rec['v_end'] > time()-30*86400)))){\n\t$already_paid = Null;\n\tswitch($p){\n\t \n\tcase VM_V_provideOffice:\n\t if (myOrg()->eaMembers()->isMember($this->rec['av_id'])){\n\t $av = loader::getInstance_new('bForm_Avatar_vm',$this->rec['av_id'],array('fatal','nocache'));\n\t if ($av->isE(True) && $av->get_staffOffice()) break;\n\t }\n\t $already_paid = '';\n\t $hasRightTo = 'assign_offices';\n\t $paid = 'provided';\n\t break;\n\n\tcase VM_E_provideLunches:\n\tcase VM_E_conferenceDinner:\n\t if ($already_paid === Null){\n\t $already_paid = '';\n\t b_debug::var_dump($descr['i'],'already_paid===Null');\n\t }\n\t break;\n\n\tcase VM_V_payPerdiem:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipP(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tcase VM_V_payTrip:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipT(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tdefault:\n\t}\n\t \n\tif ($already_paid !== Null){\n\t // Show either a click-able button or just an icon\n\t $img = @$descr['i'] . ($yes_no ? '_on' : '_off');\n\t $icon = (!$already_paid && VM::hasRightTo($hasRightTo,$this->rec)\n\t\t ? bIcons()->getButton(array('class'=>'form-submit',\n\t\t\t\t\t 'i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' : ' not').\" to be $paid, click to change\",\n\t\t\t\t\t 'l'=>b_url::same(\"?resetcache_once=1&toggle_once=$p&v_id=\".$this->rec['v_id'],$this->anchor())))\n\t\t : bIcons()->get (array('i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' :' not').\" $paid\")));\n\t}\n }else{\n\t$this->dbg('too old visit '.$this->rec['av_lastname']);\n }\n $reply[] = $icon;\n }\n bTiming()->cpu();\n return $reply;\n }", "function process($handler)\n {\n $c = &$this->c;\n // Instantiate models\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidOrder = ClassRegistry::getClass('PaidOrderModel');\n\n $posts = '';\n $res = '';\n $this->handler = $handler;\n $post_vars = Sanitize::getVar($c->params,'form',array());\n\n if(empty($post_vars)) return;\n\n isset($post_vars['merchant_return_link']) and Configure::write('PaidListings.email',true); // Don't send email on return to site because it's already triggered via IPN post - This is a Paypal thing\n\n // Verify if this is really a Paypal post\n $req = 'cmd=_notify-validate';\n\n foreach($post_vars AS $key => $value)\n {\n if(!in_array($key,array('CONTEXT','myAllTextSubmitID','cmd','form_charset')))\n {\n if (@get_magic_quotes_gpc()) {\n $value = stripslashes($value);\n }\n $req .= \"&$key=\".urlencode($value);\n $posts .= \"$key => $value\\r\\n\"; // Used in file log\n }\n }\n\n // post back to PayPal system to validate\n if ($post_vars['test_ipn'] == 1) {\n $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n } else {\n $url = 'https://www.paypal.com/cgi-bin/webscr';\n }\n\n $ch = curl_init(); // Starts the curl handler\n curl_setopt($ch, CURLOPT_URL,$url); // Sets the paypal address for curl\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1); // Set curl to send data using post\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Returns result to a variable instead of echoing\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req); // Add the request parameters to the post\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5); // Sets a time limit for curl in seconds (do not set too low)\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Enabling certificate verification makes the curl call fail on some servers\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n $res = curl_exec($ch); // run the curl process (and return the result to $result\n curl_close($ch);\n\n // Extract custom fields\n $custom = json_decode($post_vars['custom'],true);\n $order_id = $custom['order_id']; // Local transaction id\n $order = $PaidOrder->findRow(array(\n 'conditions'=>array('PaidOrder.order_id = ' . $order_id)\n ));\n\n if (!preg_match(\"/VERIFIED/\", $res)) {\n // if (strcmp (trim($res), \"VERIFIED\") == 0) {\n\n $PaidTxnLog->addNote(\"Payment status: INVALID return.\");\n\n $PaidOrder->updateOrder($order,array('order_status'=>'Failed'));\n\n $PaidTxnLog->save($order,$post_vars,Sanitize::getString($post_vars,'txn_id'));\n\n die();\n }\n\n $order['txn_id'] = Sanitize::getString($post_vars,'txn_id'); // Make txn_id available in other methods where only the order is passed as a parameter\n\n switch(Sanitize::getString($post_vars,'txn_type'))\n {\n case 'web_accept':\n\n $success = $this->processOneTimePlan($order,$post_vars);\n\n break;\n\n case 'subscr_signup':\n case 'subscr_payment':\n case 'subscr_cancel':\n case 'subscr_failed':\n case 'recurring_payment_suspended_due_to_max_failed_payment':\n\n $success = $this->processSubscriptionPlan($order,$post_vars);\n\n break;\n default:\n\n $success = false;\n\n break;\n }\n\n if(!isset($post_vars['txn_type']))\n {\n switch($post_vars['reason_code'])\n {\n case 'chargeback':\n $PaidOrder->updateOrder($order,array('order_status'=>'Fraud'));\n $c->Paidlistings->processFailedOrder($order);\n break;\n }\n $PaidTxnLog->addNote(\"Reason code: {$post_vars['reason_code']}.\");\n }\n\n $PaidTxnLog->save($order, $post_vars, Sanitize::getString($post_vars,'txn_id'), $success);\n\n return $order;\n }", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function execute()\n {\n $request = $this->getRequest()->getParams();\n $responseContent = [\n 'success' => false,\n 'redirect_url' => 'checkout/#payment',\n 'parameters' => []\n ];\n\n if(empty($request['cf_id']) === false) {\n $resultRedirect = $this->resultRedirectFactory->create();\n $orderIncrementId = $request['cf_id'];\n $order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);\n $validateOrder = $this->checkRedirectOrderStatus($orderIncrementId, $order);\n if ($validateOrder['status'] == \"SUCCESS\") {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($validateOrder['transaction_id'], $order);\n }\n $this->messageManager->addSuccess(__('Your payment was successful'));\n $resultRedirect->setPath('checkout/onepage/success');\n return $resultRedirect;\n\n } else if ($validateOrder['status'] == \"CANCELLED\") {\n $this->messageManager->addWarning(__('Your payment was cancel'));\n $this->checkoutSession->restoreQuote();\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else if ($validateOrder['status'] == \"FAILED\") {\n $this->messageManager->addErrorMessage(__('Your payment was failed'));\n $order->cancel()->save();\n $resultRedirect->setPath('checkout/onepage/failure');\n return $resultRedirect;\n } else if($validateOrder['status'] == \"PENDING\"){\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addWarning(__('Your payment is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else{\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addErrorMessage(__('There is an error. Payment status is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n }\n } else {\n $order = $this->checkoutSession->getLastRealOrder();\n $code = 400;\n \n $transactionId = $request['additional_data']['cf_transaction_id'];\n \n if(empty($transactionId) === false && $request['additional_data']['cf_order_status'] === 'PAID')\n {\n $orderId = $order->getIncrementId();\n $validateOrder = $this->validateSignature($request, $order);\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($transactionId, $order);\n }\n\n $responseContent = [\n 'success' => true,\n 'redirect_url' => 'checkout/onepage/success/',\n 'order_id' => $orderId,\n ];\n\n $code = 200;\n } else {\n $responseContent['message'] = $validateOrder['errorMsg'];\n }\n\n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n } else {\n $responseContent['message'] = \"Cashfree Payment details missing.\";\n }\n }\n\n //update/disable the quote\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $quote = $objectManager->get('Magento\\Quote\\Model\\Quote')->load($order->getQuoteId());\n $quote->setIsActive(true)->save();\n $this->checkoutSession->setFirstTimeChk('0');\n \n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n }", "function pay($args) {\n global $_lib, $_SETUP;\n #make the actual payment file and configuration\n\n $this->head();\n \n #print_r($this->iteratorH);\n $file .= $this->format('BETFOR00', new stdClass());\n foreach($this->iteratorH as $InvoiceO) {\n\n ########################################################################################\n #Error checking\n #MŒ sjekke at det er et positivt bel¿p\n if($InvoiceO->RemittanceAmount < 0) {\n $_lib['message']->Add(\"Bel&oslash;p m&aring; v&aelig;re st&oslash;rre enn null - Faktura: $InvoiceO->InvoiceNumber\");\n continue;\n }\n\n if(!$InvoiceO->SupplierBankAccount) { #Sjekke lengde og modulus pŒ kontonummer ogsŒ\n $_lib['message']->Add(\"Mottakerkonto mangler p&aring; faktura: $InvoiceO->InvoiceNumber\");\n continue;\n }\n\n ########################################################################################\n $this->transaction->NumTransactions++; #Only count BETFOR21\n $this->transaction->TotalAmount += $InvoiceO->RemittanceAmount;\n $this->transaction->ID = $InvoiceO->ID;\n $this->transaction->RemittanceSequence++;\n $this->transaction->RemittanceSequence = $this->transaction->RemittanceSequence;\n $InvoiceO->CustomerNumber = ''; #We do not have the customer number here, or??????? Just hardcode blank since not required.\n\n #MŒ sjekke at DueDate er i dag eller senere - ellers mŒ den resettes.\n if($InvoiceO->DueDate < $this->transaction->Date) $InvoiceO->DueDate = $this->transaction->Date; #Remittance pay date????\n \n if($InvoiceO->KID) { #KID - denne skal aldri slŒ til - til Œ begynne med.\n #print \"**** KID: $InvoiceO->InvoiceNumber<br>\\n\";\n $InvoiceO->SupplierMessage1 = '';\n $InvoiceO->SupplierMessage2 = '';\n $InvoiceO->SupplierMessage3 = '';\n\n $InvoiceO->CustomerNumber = '';\n $InvoiceO->InvoiceNumber = '';\n $InvoiceO->InvoiceDate = '';\n\n } elseif($InvoiceO->InvoiceNumber) { #Strukturert - Fakturanummer er minimum. fakturadato og kundenummer er ekstra\n #print \"**** Strukturert: $InvoiceO->InvoiceNumber<br>\\n\";\n\n $InvoiceO->SupplierMessage1 = '';\n $InvoiceO->SupplierMessage2 = '';\n $InvoiceO->SupplierMessage3 = '';\n\n #KID\n $InvoiceO->KID = '';\n\n } else { #Ustrukturert\n #print \"**** Ustrukturert: $InvoiceO->InvoiceNumber<br>\\n\";\n\n $InvoiceO->SupplierMessage1 = 'Faktura: ' . $InvoiceO->InvoiceNumber;\n $InvoiceO->SupplierMessage2 = 'Kunde: ' . $this->transaction->CustomerName;\n $InvoiceO->SupplierMessage3 = ''; \n\n #KID\n $InvoiceO->KID = '';\n \n #Strukturert\n $InvoiceO->CustomerNumber = '';\n $InvoiceO->InvoiceNumber = '';\n $InvoiceO->InvoiceDate = '';\n }\n \n $file .= $this->format('BETFOR21', $InvoiceO); #Overf¿rsel - til samme leverand¿r\n\n $this->transaction->RemittanceSequence++;\n $this->transaction->RemittanceSequence = $this->transaction->RemittanceSequence;\n \n $file .= $this->format('BETFOR23', $InvoiceO); #Faktura - fra leverand¿r\n #Set remitteringsdato, person, batch og sekvens nummer i invoicein id.\n $this->updatestatus();\n }\n\n $this->transaction->RemittanceSequence++;\n $this->transaction->RemittanceSequence = $this->transaction->RemittanceSequence;\n\n $file .= $this->format('BETFOR99', new stdClass());\n\n return $file;\n }", "function _prePayment( $data )\r\n {\r\n // prepare the payment form\r\n \r\n $app = JFactory::getApplication();\r\n $session = JFactory::getSession();\r\n \r\n// Gather Order Ids, amount, and variables \r\n\r\n $order_id = $data['order_id'];\r\n $orderpayment_id = $data['orderpayment_id'];\r\n $amount = $data['orderpayment_amount'];\r\n \r\n $merchant_id = $this->params->get(\"merchant_id\");\r\n $test_mode = $this->params->get(\"sandbox\");\r\n $xmlCollection = $this->params->get(\"xmlcollection\");\r\n\r\n// Check Test Mode has been enabled by the Merchant\r\nif ($test_mode == 1){\r\n\t$test_transaction = \"100\";\r\n}else{\r\n\t$test_transaction = \"\";\r\n}\r\n \r\n\t\tF0FTable::addIncludePath ( JPATH_ADMINISTRATOR . '/components/com_j2store/tables' );\r\n\t\t$order = F0FTable::getInstance ( 'OrderInfo', 'J2StoreTable' );\r\n\t\r\n// Get Product Details from the Shopping Cart\r\n\t\t$cart = F0FTable::getInstance('Cart', 'J2StoreTable')->getClone();\r\n\t\t\r\n\t\t\t\t$cartitem_model = F0FModel::getTmpInstance('Cartitems', 'J2StoreModel');\r\n\t\t\t\t$cartitem_model->setState('filter_cart', $data['orderpayment_id']);\r\n\t\t\t\t$items = $cartitem_model->getList();\r\n\t\t\t\t\r\n$products = array_unique($items, SORT_REGULAR);\r\n$xmlcollect = \"<items>\";\r\nforeach($products as &$item) {\r\n\t\r\n\t$description = \"Product ID: \" . $item->product_id . \", Product Name: \" . $item->sku . \", Product Quantity: \" . number_format($item->product_qty,0) . \", Product Price: \". number_format($item->price,2);\r\n\t$xmlcollect .= \"<item><id>\".$item->product_id.\"</id><name>\".$item->sku.\"</name><description>\".$item->sku.\"</description><quantity>\".number_format($item->product_qty,0).\"</quantity><price>\".number_format($item->price,2).\"</price></item>\";\r\n}\r\n$xmlcollect .= \"</items>\";\r\n\r\n// Check XML collection has been enabled by the Merchant\r\nif ($xmlCollection ==1){\r\n\r\n$description = \"Order created for: \" . $order_id;\r\n\r\n}else{\r\n\r\n$xmlcollect = \"\";\r\n\r\n}\r\n\r\n// Billing Address Details\r\n$billing_fullname = $order->billing_first_name . \", \" . $order->billing_last_name;\r\n$billing_address = $order->billing_address_1 . \", \" . $order->billing_address_2;\r\n$billing_city = $order->billing_city;\r\n$billing_postcode = $order->billing_zip;\r\n\r\n$delivery_fullname = $order->shipping_first_name . \", \" . $order->shipping_last_name;\r\n$delivery_address = $order->shipping_address_1 . \", \" . $order->shipping_address_2;\r\n$delivery_city = $order->shipping_city;\r\n$delivery_postcode = $order->shipping_zip;\r\n\r\n// Phone Number\r\n$customer_phone_number = $order->billing_phone_1;\r\n\r\n// Email Address\r\n$email_address = str_replace(\"{\",\"\",$order->all_billing);\r\n$email_address = str_replace(\"}\",\"\",$email_address);\r\n$email_address = str_replace(\":\",\"\",$email_address);\r\n$email_address = str_replace(\",\",\"\",$email_address);\r\n$email_address = str_replace('\"','',$email_address);\r\n$email_address = str_replace(\"emaillabelJ2STORE_EMAILvalue\",'',$email_address);\r\n\r\n$callback_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$success_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$cancel_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=carts&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n\r\n$html = \"<form action=\\\"https://secure.nochex.com/default.aspx\\\" method=\\\"post\\\" name=\\\"nochexForm\\\">\r\n <input type=\\\"hidden\\\" name=\\\"order_id\\\" value=\\\"\".$order_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"merchant_id\\\" value=\\\"\".$merchant_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"amount\\\" value=\\\"\".$amount.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"description\\\" value=\\\"\".$description.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"xml_item_collection\\\" value=\\\"\".$xmlcollect.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_fullname\\\" value=\\\"\".$billing_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_address\\\" value=\\\"\".$billing_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_city\\\" value=\\\"\".$billing_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_postcode\\\" value=\\\"\".$billing_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_fullname\\\" value=\\\"\".$delivery_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_address\\\" value=\\\"\".$delivery_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_city\\\" value=\\\"\".$delivery_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_postcode\\\" value=\\\"\".$delivery_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"customer_phone_number\\\" value=\\\"\".$customer_phone_number.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"email_address\\\" value=\\\"\".$email_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"callback_url\\\" value=\\\"\".$callback_url.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"test_success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"cancel_url\\\" value=\\\"\". $cancel_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"test_transaction\\\" value=\\\"\" .$test_transaction.\"\\\"> \r\n <input type=\\\"submit\\\" class=\\\"j2store_cart_button btn btn-primary\\\" value=\\\"Make a Payment\\\" /> \r\n</form>\";\r\n\r\n return $html;\r\n }", "public function action_payments() {\n $package = Model::factory('package');\n $postvalue = $errors = array();\n $postvalue = $this->request->post();\n $payment_gateway_id= isset($postvalue['payment_gateway_type'])?$postvalue['payment_gateway_type']:0;\n \n $payment_settings = $package->get_payment_details($payment_gateway_id);\n $paypal_payment_settings=$package->get_paypal_payment_details();\n //echo \"<pre>\"; print_r($payment_settings); exit;\n $this->template->meta_description = CLOUD_SITENAME . \" | Payments \";\n $this->template->meta_keywords = CLOUD_SITENAME . \" | Payments \";\n $this->template->title = CLOUD_SITENAME . \" | \" . __('Payments');\n $this->template->page_title = __('Payments');\n \n if (class_exists('Paymentgateway')) { \n $payment_gateway_list = Paymentgateway::payment_auth_credentials_view();\n \n } else {\n trigger_error(\"Unable to load class: Paymentgateway\", E_USER_WARNING);\n }\n \n $form_top_fields= isset($payment_gateway_list[1])?$payment_gateway_list[1]:[];\n $form_fields= isset($payment_gateway_list[2])?$payment_gateway_list[2]:[];\n $form_live_fields= isset($payment_gateway_list[3])?$payment_gateway_list[3]:[];\n $form_bottom_fields= isset($payment_gateway_list[4])?$payment_gateway_list[4]:[];\n\n $this->template->content = View::factory(\"admin/package_plan/payments\")\n ->bind('payment_settings', $payment_settings)\n ->bind('paypal_payment_settings',$paypal_payment_settings)\n ->bind('form_top_fields', $form_top_fields)\n ->bind('form_fields', $form_fields)\n ->bind('form_live_fields', $form_live_fields)\n ->bind('form_bottom_fields', $form_bottom_fields)\n ->bind('payment_gateway_list',$payment_gateway_list[0])\n ->bind('postvalue', $postvalue)\n ->bind('errors', $errors);\n }", "public function processPayment(){\n\t\t\t\t// See your keys here https://dashboard.stripe.com/account/apikeys\n\t\t\t\tStripe::setApiKey(\"sk_live_NharL7KTJBPcvdVrbQIXr3MS\");\n\n\t\t\t\t// Get the credit card details submitted by the form\n\t\t\t\t$token = Input::get('stripeToken');\n\n\t\t// Create the charge on Stripe's servers - this will charge the user's card\n\t\ttry {\n\t\t\tif(Shipping::where('cart_id', Session::get('cart_id'))->pluck('payment_status') == 'Paid'){\n\t\t\t\treturn Redirect::route('alreadyPaid');\n\t\t\t}\n\t\t$charge = Charge::create(array(\n\t\t \"amount\" => Input::get('data-description'), // amount in cents, again\n\t\t \"currency\" => \"usd\",\n\t\t \"source\" => $token,\n\t\t \"description\" => Session::get('cart_id'))\n\t\t);\n\t} catch(\\Stripe\\Error\\Card $e) {\n\t // The card has been declined\n\t}\n\t\t\t$cart_id = Session::get('cart_id');\n\t\t\t$markPaid = Shipping::where('cart_id', Session::get('cart_id'))->first();\n\t\t\t$markPaid->payment_status = 'Paid';\n\t\t\t$markPaid->shipped_status = 'Not Shipped';\n\t\t\t$markPaid->save();\n\n\t\t\t//inventorytime\n\t\t\t// foreach(Cart::where('customer_id', $cart_id)->get() as $purgeCarts)\n\t\t\t// {\t\n\t\t\t// \t$inventory = Inventory::where('product_id', $purgeCarts->item)->pluck($purgeCarts->size);\n\t\t\t// \t$newsize = $inventory - $purgeCarts->quantity;\n\t\t\t// \tDB::table('inventories')->where('product_id', $purgeCarts->item)->update(array($purgeCarts->size => $newsize));\n\t\t\t// }\n\n\t\t\t\n\t\t\tMail::send('emails.Newsale', array('cart' => $cart_id, 'customer' => Shipping::where('cart_id', $cart_id)->first()), function($message){\n\t\t\t\t$checkoutAmt = Session::get('checkoutAmt');\n\t\t\t\t$message->to(Shipping::where('cart_id', Session::get('cart_id'))->pluck('email'))->subject(\"Your Eternally Nocturnal Order\");\n\t\t\t});\n\t\t\tMail::send('emails.Newsaleadmin', array('cart' => $cart_id, 'customer' => Shipping::where('cart_id', $cart_id)->first()), function($message){\n\t\t\t\t$checkoutAmt = Session::get('checkoutAmt');\n\t\t\t\t$message->to('[email protected]')->subject(\"NEW SALE $\".substr($checkoutAmt,0,-2).\".\".substr($checkoutAmt,-2));\n\t\t\t});\n\n\t\t\tSale::create(array('customer_id' => $markPaid->email, 'cart_id' => Session::get('cart_id')));\n\n\t\t\tSession::forget('cart_id');\n\t\t\tSession::forget('checkoutAmt');\n\t\t\treturn Redirect::route('transSuccess');\n\t\t}", "public function submitPayment()\n {\n return array('error'=>0, 'transactionReference'=>'');\n \n }", "public function processPayment()\n {\n $paymentMethod = $this\n ->methodFactory\n ->create();\n\n /**\n * At this point, order must be created given a card, and placed in\n * PaymentBridge.\n *\n * So, $this->paymentBridge->getOrder() must return an object\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderLoad(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Order exists right here.\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderCreated(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid done.\n *\n * Paid process has ended (No matters result)\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderDone(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid successfully.\n *\n * Paid process has ended successfully\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderSuccess(\n $this->paymentBridge,\n $paymentMethod\n );\n\n return $this;\n }", "public function add_payments() {\n\n global $redis;\n\n $user_id = $this->params['user_id'];\n $associate_id = !empty($this->params['associate_id']) ? $this->params['associate_id'] : 0;\n $payment_account_id = $this->params['payment_account_id'];\n $paypal_username = $this->params['paypal_username'];\n $account_dbobj = $this->params['account_dbobj'];\n\n // validate paypal username\n $paypal = new PaypalAccount($account_dbobj);\n $paypal->findOne(\"username='\".$account_dbobj->escape($paypal_username).\"'\");\n if($paypal->getId() === 0) {\n if(!$paypal->setUsername($paypal_username)) {\n $this->errnos[INVALID_PAYPAL_ACCOUNT] = 1;\n $this->status = 1;\n return;\n }\n }\n $paypal->save();\n\n $payment_account = new PaymentAccount($account_dbobj);\n if(!empty($payment_account_id)) {\n $payment_account->findOne('id='.$payment_account_id);\n }\n $payment_account->setPaypalAccountId($paypal->getId());\n $payment_account->save();\n\n $user = new User($account_dbobj);\n $user->findOne('id='.$user_id);\n BaseMapper::saveAssociation($user, $payment_account, $account_dbobj);\n\n if(!empty($associate_id) && $is_active_associate = AssociatesMapper::is_active_associate($associate_id, $account_dbobj)) {\n $associate = new Associate($account_dbobj);\n $associate->findOne('id='.$associate_id);\n $associate->setStatus(ACTIVATED);\n $associate->save();\n $redis->set(\"associate::$associate_id:status\", $associate->getStatus());\n }\n\n $this->response['paypal_account_id'] = $paypal->getId();\n $this->response['paypal_username'] = $paypal->getUsername();\n\n $this->status = 0;\n\n // warm up cache\n $redis->set(\"user:$user_id:payment_account_id\", $payment_account->getId());\n $redis->set(\"payment_account:{$payment_account->getId()}:paypal_account_id\",$paypal->getId());\n $paypal_account_id = $paypal->getId();\n $redis->set(\"paypal_account:$paypal_account_id:username\", $paypal->getUsername());\n $redis->set(\"paypal_account:$paypal_account_id:status\", $paypal->getStatus());\n $redis->set(\"paypal_account:$paypal_account_id:created\", $paypal->getCreated());\n $redis->set(\"paypal_account:$paypal_account_id:updated\", $paypal->getUpdated());\n\n\n }", "public function payments() {\n \n PageContext::$response->activeLeftMenu = 'Settings';\n $this->view->setLayout(\"home\");\n\n $epaypal=($this->post('p_paypal')=='on') ? 'Y' : 'N';\n $sandbox=($this->post('p_sandbox')=='on') ? 'Y' : 'N';\n\n $e_auth=($this->post('e_auth')=='on') ? 'Y' : 'N';\n $a_test=($this->post('a_test')=='on') ? 'Y' : 'N';\n\n $error = NULL;\n\n // Paypal Settings\n if($this->isPost()) {\n\n $arrUpdate = array(\"value\"=>addslashes($epaypal));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypal'\");\n\n $arrUpdate = array(\"value\"=>addslashes($sandbox));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypalsandbox'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_tocken')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalidentitytoken'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalemail'\");\n \n $arrUpdate = array(\"value\"=>addslashes($e_auth));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_enable'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_logid')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_loginid'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_tkey')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_transkey'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_email'\");\n\n $arrUpdate = array(\"value\"=>addslashes($a_test));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_test_mode'\");\n\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('currency')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='admin_currency'\");\n\n // Success Message\n // $this->view->message = (empty($error)) ? \"Changes Saved Successfully\" : $error;\n PageContext::$response->success_message = \"Changes Saved Successfully\" ;\n PageContext::addPostAction('successmessage');\n\n\n } // End isPost\n\n $this->view->authEnable = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_enable'\");\n\n $this->view->authLoginId = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_loginid'\");\n\n $this->view->authtransKey = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_transkey'\");\n\n $this->view->authEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_email'\");\n\n $this->view->authTestMode = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_test_mode'\");\n\n\n //**************** PAYPAL\n\n\n $this->view->enablePaypal = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypal'\");\n\n $this->view->enableSandBox = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypalsandbox'\");\n\n $this->view->paypalTocken = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalidentitytoken'\");\n\n $this->view->paypalEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalemail'\");\n\n $this->view->currency = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='admin_currency'\");\n\n }", "function _prePayment( $data )\n {\n\t\t// prepare the payment form\n $vars = new JObject();\n \n $vars->ssl_merchant_id = $this->params->get('ssl_merchant_id', '');\n $vars->ssl_user_id = $this->params->get('ssl_user_id', '');\n $vars->ssl_pin = $this->params->get('ssl_pin', '');\n $vars->test_mode = $this->params->get('test_mode', '0');\n\t\t$vars->merchant_demo_mode = $this->params->get('merchant_demo_mode', '0');\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n \n\t\t$vars->ssl_customer_code = JFactory::getUser()->id;\n $vars->ssl_invoice_number = $data['orderpayment_id'];\n $vars->ssl_description = JText::_('Order Number: ').$data['order_id'];\n \n // Billing Info\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->address_1 = $data['orderinfo']->billing_address_1;\n $vars->address_2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip \t\t= $data['orderinfo']->billing_postal_code;\n \n $vars->amount = @$data['order_total'];\n\n\t\tif ($vars->merchant_demo_mode == 1)\n\t\t{\n\t\t\t$vars->payment_url = \"https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars->payment_url = \"https://www.myvirtualmerchant.com/VirtualMerchant/process.do\";\n\t\t}\n\n\t\tif ( $vars->inline_creditcard_form == 0)\n\t\t{\n\t\t\t$vars->receipt_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->failed_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$html = $this->_getLayout('prepayment', $vars);\n\t\t}\n\t\telseif ( $vars->inline_creditcard_form == 1)\n\t\t{\n\t\t\t$vars->action_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->order_id\t = $data['order_id'];\n\t\t\t$html = $this->_getLayout('paymentcreditcard', $vars);\n\t\t}\n\n return $html;\n }", "function public_payment_info() {\n if (!$this->request->isAsyncCall()) {\n $this->response->badRequest();\n } // if\n if ($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n }", "public function payAction()\n\t{\n\t\t$paylanedirectdebit = Mage::getSingleton(\"paylanedirectdebit/standard\");\n\t\t$data = $paylanedirectdebit->getPaymentData();\n\t\t\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\t\t\n\t\techo \"Your payment is being processed...\";\n\t\t\n\t\t// connect to PayLane Direct System\t\t\n\t\t$paylane_client = new PayLaneClient();\n\t\t\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanedirectdebit/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanedirectdebit/direct_password');\n\t\t\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$result = $paylane_client->multiSale($data);\n\t\tif ($result == false)\n\t\t{\n\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->ERROR))\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment($result->ERROR->error_description, true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t \treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->OK))\n\t\t{\n\t\t\t$paylanedirectdebit->setPendingStatus($result->OK->id_sale);\n\t\n\t \tsession_write_close(); \n\t \t$this->_redirect('checkout/onepage/success');\n\t \treturn;\n\t\t}\n\t}", "public function postProcess() {\n \n $this->_verifyPaymentOptionAvailability();\n $this->_validateCart();\n $this->_generatePagSeguroRequestData();\n $additional_infos = $this->_validateOrder();\n $this->_setAdditionalRequestData($additional_infos);\n $this->_setNotificationUrl();\n $this->_performPagSeguroRequest();\n \n }", "function updateInvoicingPayments() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='invoicing'\")) {\n try {\n $invoices_table = TABLE_PREFIX . 'invoices';\n $invoice_payments_table = TABLE_PREFIX . 'invoice_payments';\n $payments_table = TABLE_PREFIX . 'payments';\n\n DB::beginWork('Moving payments @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, currency_id FROM $invoices_table\");\n if($rows) {\n $currencies_map = array();\n\n foreach($rows as $row) {\n $currencies_map[(integer) $row['id']] = (integer) $row['currency_id'];\n } // foreach\n } else {\n $currencies_map = null;\n } // if\n\n if(is_foreachable($currencies_map)) {\n $rows = DB::execute(\"SELECT * FROM $invoice_payments_table ORDER BY created_on\");\n if($rows) {\n foreach($rows as $row) {\n $currency_id = isset($currencies_map[$row['invoice_id']]) ? (integer) $currencies_map[$row['invoice_id']] : 0;\n\n DB::execute(\"INSERT INTO $payments_table (type, parent_type, parent_id, amount, currency_id, gateway_type, comment, status, created_by_id, created_by_name, created_by_email, created_on, paid_on) VALUES ('CustomPayment', 'Invoice', ?, ?, ?, 'CustomPaymentGateway', ?, 'Paid', ?, ?, ?, ?, ?)\", $row['invoice_id'], $row['amount'], $currency_id, $row['comment'], $row['created_by_id'], $row['created_by_name'], $row['created_by_email'], $row['created_on'], $row['created_on']);\n } // foreach\n } // if\n } // if\n\n DB::commit('Payments moved @ ' . __CLASS__);\n\n DB::execute(\"DROP TABLE $invoice_payments_table\");\n } catch(Exception $e) {\n DB::rollback('Failed to move payments @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function checkout_payment_data($invoice_id) {\r\n\t//$invoice_id = get_post_meta($payment_id, '_payment_invoice', true);\r\n\t$args = array(\r\n\t\t'post_type' => 'sa_payment',\r\n\t\t'post_status' => 'any',\r\n\t\t'posts_per_page' => -1,\r\n\t\t'meta_query' => array(\r\n\t\t\tarray(\r\n\t\t\t\t'key' => '_payment_invoice',\r\n\t\t\t\t'value' => $invoice_id,\r\n\t\t\t\t'compare' => '=',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\t$payment_id = 0;\r\n\t$query = new WP_Query($args);\r\n\tif($query->have_posts()){\r\n\t\tglobal $post;\r\n\t\twhile($query->have_posts()){\r\n\t\t\t$query->the_post();\r\n\t\t\t$payment_id = $post->ID;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//$payment_id = $item->ID;\r\n\tif( $payment_id > 0 ) {\r\n\t\t$payment = SI_Payment::get_instance( $payment_id );\r\n\t\t$method = $payment->get_payment_method();\r\n\t\t$data = $payment->get_data();\r\n\t\t$detail = '';\r\n\t\tif ( is_array( $data ) ) {\r\n\t\t\t//print_r($data);\r\n\t\t\tforeach ( $data as $key => $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$value = sprintf( '<pre id=\"payment_detail_%s\" style=\"width=\"500px\"; white-space:pre-wrap; text-align: left; font: normal normal 11px/1.4 menlo, monaco, monospaced; padding: 5px;\">%s</pre>', $payment_id, print_r( $value, true ) );\r\n\t\t\t\t}\r\n\t\t\t\tif ( is_string( $value ) ) {\r\n\t\t\t\t\tif( $key == 'date' ) {\r\n\t\t\t\t\t\t$detail .= '<dl>\r\n\t\t\t\t\t\t\t<dt><b>'.ucfirst(str_replace( '_', ' ', $key )).'</b></dt>\r\n\t\t\t\t\t\t\t<dd>'.date(\"Y-m-d\", $value).'</dd>\r\n\t\t\t\t\t\t</dl>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$detail .= '<dl>\r\n\t\t\t\t\t\t\t<dt><b>'.ucfirst(str_replace( '_', ' ', $key )).'</b></dt>\r\n\t\t\t\t\t\t\t<dd>'.$value.'</dd>\r\n\t\t\t\t\t\t</dl>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t$output = '<div id=\"total_detail_info\">';\r\n\t\tif($method == 'Credit (NMI)') {\r\n\t\t\t$output .= '<p>Online Payment</p>';\r\n\t\t} elseif($method == 'Admin Payment') {\r\n\t\t\t$output .= '<div class=\"admin-payment-details\">'.esc_html($detail).'</div>';\r\n\t\t}\r\n\t\t$output .= '</div>';\r\n\t\r\n\t\treturn $output;\r\n\t}\r\n}", "private function parsePaymentBody($paymentResponse){\n $this->paymentBody = json_decode($paymentResponse->getBody()->getContents());\n \n $this->paypal_id = $this->paymentBody->id;\n //get the paypal process links from the response\n foreach ($this->paymentBody->links as $link){\n //this is the link for the payer top approve the payment\n if ($link->rel == \"approval_url\"){\n $this->approval_url = $link->href;\n }\n if ($link->rel == \"execute\"){\n $this->execute_url = $link->href;\n }\n if ($link->rel == \"self\"){\n $this->self_url = $link->href;\n }\n\n }\n if (isset($this->paymentBody->payer->payer_info->payer_id)){\n $this->payer_id = $this->paymentBody->payer->payer_info->payer_id;\n }\n \n }", "function massageFacsPaymentData(){\r\n\t$accountsSkipped = 0; //this is a flag for accounts that don't have a principal\r\n\t$accountsProcessed = 0; //this is a flag to track the records we have processed on the file\r\n\t$dp = 0;\r\n\t$dpTotal = 0; //flag to track total amount collected(?)\r\n\t$totalAccountsNotListed = 0; //number of accounts not listed\r\n\t$detailRecordNum = 0;\r\n\t$paidAgencyPrinc = 0; //this is the amount the collection agency has collected\r\n\t$totalPaidClient = 0;\r\n\t$totalPaidAgency = 0;\r\n\t$totalDueAgency = 0;\r\n\t$totalPayments = 0;\r\n\t$maxlines = count($this->exportData); \r\n\t$date = date(\"Ymd\");\r\n\t$paymentFileName = \"/home/nobody/Y9650/GuarPmt_EFS_\".$date.\".txt\";\r\n\t$exportDataReplace = \"\"; //this is a string we will use to build the text for the export file\r\n\t\r\n\tforeach($this->exportData['accountData'] as $k=>$v){\r\n\t\t$this->addDecimalForPaymentFile($k, $this->exportData['accountData'][$k]['AppliedPrincipal'], 'AppliedPrincipal');\r\n\t\tif($this->exportData['accountData'][$k]['DueAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['DueAgency'], 'DueAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['PaidAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['PaidAgency'], 'PaidAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['Balance'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['Balance'], 'Balance'); }\t\r\n\r\n\t\t$vals = explode(\"_\", $this->exportData['accountData'][$k]['ReferenceNumber']);\r\n\t\t$this->exportData['accountData'][$k]['ReceivableGroupID']\t=\t$vals[0];\r\n\t\t$this->exportData['accountData'][$k]['BillingPeriodSequence']\t=\t$vals[1];\r\n\t\t$this->exportData['accountData'][$k]['ResponsibleParty']\t\t=\ttrim($vals[2]);\r\n\t\t$this->exportData['accountData'][$k]['ClientDebtorNumber'] = $this->exportData[$k]['ReceivableGroupID'];\r\n\t}\r\n}", "public function payout()\n\t{\n\t}", "public function process_payment() {\n\n\t\t$this->get_handler()->log( 'Processing payment' );\n\n\t\tcheck_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_apple_pay_process_payment', 'nonce' );\n\n\t\t$response = stripslashes( SV_WC_Helper::get_post( 'payment' ) );\n\n\t\t$this->get_handler()->store_payment_response( $response );\n\n\t\ttry {\n\n\t\t\t$result = $this->get_handler()->process_payment();\n\n\t\t\twp_send_json_success( $result );\n\n\t\t} catch ( \\Exception $e ) {\n\n\t\t\t$this->get_handler()->log( 'Payment failed. ' . $e->getMessage() );\n\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'code' => $e->getCode(),\n\t\t\t) );\n\t\t}\n\t}", "public function processInvoice($invoice, $payment)\n {\n // The invoice must be saved before continuing.\n $invoice->save();\n parent::processInvoice($invoice, $payment);\n try {\n $this->_api->doCapture($invoice, $payment);\n } catch (Exception $e) {\n // settlement must be allowed to fail\n // set invoice status as OPEN to trigger a retry and notify admin\n $invoice->setIsPaid(false);\n\n\t $retry = $invoice->getDeliveryStatus();\n $retryN = $retry + 1;\n $invoice->setDeliveryStatus($retryN);\n $invoice->save();\n\n $errorMessage = $this->_helper->__(self::SETTLEMENT_FAILED_MESSAGE);\n $this->getSession()->addNotice($errorMessage);\n $this->_logger->logException($e, $this->_context->getMetaData(__CLASS__, [], $e));\n\n\t $paymentsEmailA = explode(',', Mage::getStoreConfig('radial_core/payments/payments_email'));\n if( !empty($paymentsEmailA) )\n {\n foreach( $paymentsEmailA as $paymentsEmail )\n {\n $paymentsName = Mage::app()->getStore()->getName() . ' - ' . 'Payments Admin';\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('custom_email_template2');\n\n //Create an array of variables to assign to template\n $emailTemplateVariables = array();\n $emailTemplateVariables['myvar1'] = gmdate(\"Y-m-d\\TH:i:s\\Z\");\n $emailTemplateVariables['myvar2'] = $e->getMessage();\n $emailTemplateVariables['myvar3'] = $e->getTraceAsString();\n $emailTemplateVariables['myvar4'] = htmlspecialchars($cleanedResponseXml);\n\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n //Sending E-Mail to Payments Admin Email.\n $mail = Mage::getModel('core/email')\n ->setToName($paymentsName)\n ->setToEmail($paymentsEmail)\n ->setBody($processedTemplate)\n ->setSubject('Payments - Settlement - Exception Report From: '. __CLASS__ . ' on ' . gmdate(\"Y-m-d\\TH:i:s\\Z\") . ' UTC')\n ->setFromEmail(Mage::getStoreConfig('trans_email/ident_general/email'))\n ->setFromName($paymentsName)\n ->setType('html');\n try {\n //Confimation E-Mail Send\n $mail->send();\n }\n catch(Exception $error)\n {\n $logMessage = sprintf('[%s] Error Sending Email: %s', __CLASS__, $error->getMessage());\n Mage::log($logMessage, Zend_Log::ERR);\n }\n }\n }\n }\n return $this;\n }", "public function testPaymentProcessing()\n {\n $mock = Mollie::fakePayments();\n\n $mock->shouldReceive(\"create\")->once()->with(Mockery::on(function ($arg) {\n $formattedAmount = number_format($this->payment->getTotalAmount(), 2, '.', '');\n return $arg[\"amount\"][\"currency\"] == \"EUR\"\n && $arg[\"amount\"][\"value\"] == $formattedAmount\n && $arg[\"description\"] == $this->payment->getDescription()\n && $arg[\"metadata\"] == $this->payment->getMetadata()\n && $arg[\"webhookUrl\"] == url('iDeal-webhook')\n && $arg[\"redirectUrl\"] == url('iDeal-response/test/42')\n && $arg[\"method\"] == \\Mollie\\Api\\Types\\PaymentMethod::IDEAL;\n }))->andReturns(new class\n {\n function getCheckoutUrl()\n {\n return \"testUrl\";\n }\n });\n\n Mollie::process($this->payment);\n }", "public function postProcess()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['action'])) {\n if ($aps_params['action'] == 'checkout') {\n $this->postApsPayment();\n } elseif ($aps_params['action'] == 'offline_response') {\n $this->responseOffline();\n } elseif ($aps_params['action'] == 'responseOnline') {\n $this->responseOnline();\n } elseif ($aps_params['action'] == 'merchantPageResponse') {\n $this->merchantPageResponse();\n } elseif ($aps_params['action'] == 'merchantPageCancel') {\n $this->merchantPageCancel();\n } elseif ($aps_params['action'] == 'getInstallmentPlans') {\n $this->getInstallmentPlans();\n } elseif ($aps_params['action'] == 'valu_customer_verify') {\n $this->valuCustomerVerify();\n } elseif ($aps_params['action'] == 'valu_generate_otp') {\n $this->valuGenerateOtp();\n } elseif ($aps_params['action'] == 'valu_otp_verify') {\n $this->valuOtpVerify();\n } elseif ($aps_params['action'] == 'validate_apple_url') {\n $this->validateAppleUrl();\n } elseif ($aps_params['action'] == 'send_apple_payment_aps') {\n $this->sendApplePaymentToAps();\n } elseif ($aps_params['action'] == 'create_cart_order') {\n $this->createCartOrder();\n } elseif ($aps_params['action'] == 'get_apple_pay_cart_data') {\n $this->getApplePayCartValues();\n } elseif ($aps_params['action'] == 'validate_apple_pay_shipping_address') {\n $this->validateApplePayShippingAddress();\n } elseif ($aps_params['action'] == 'displayError') {\n $this->displayError();\n }\n }\n }", "function _postPayment($data)\n {\n $vars = new JObject();\n //\n $order_id = $data['order_id'];\n JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_k2store/tables');\n $orderpayment = JTable::getInstance('Orders', 'Table');\n @$orderpayment->load(array('order_id' => $order_id));\n //\n try {\n if (!$orderpayment)\n throw new Exception('order_not_found');\n\n if ($data['Status'] != 'OK')\n throw new Exception('cancel_return', 1); // 1 == payment failed exception\n\n $MerchantID = $this->params->get('merchant_id');\n $Amount = $this->zarinpalAmount($orderpayment->get('orderpayment_amount'));\n $Authority = $data['Authority'];\n\n $verifyContext = compact('MerchantID', 'Amount', 'Authority');\n $verify = $this->zarinpalRequest('verification', $verifyContext);\n\n if (!$verify)\n throw new Exception('connection_error');\n\n $status = $verify->Status;\n if ($status != 100)\n throw new Exception('status_' . $status);\n\n // status == 100\n $RefID = $verify->RefID;\n\n $orderpayment->transaction_id = $RefID;\n $orderpayment->order_state = JText::_('K2STORE_CONFIRMED'); // CONFIRMED\n $orderpayment->order_state_id = 1; // CONFIRMED\n $orderpayment->transaction_status = 'Completed';\n\n $vars->RefID = $RefID;\n $vars->orderID = $order_id;\n $vars->id = $orderpayment->id;\n if ($orderpayment->save()) {\n JLoader::register('K2StoreHelperCart', JPATH_SITE . '/components/com_k2store/helpers/cart.php');\n // remove items from cart\n K2StoreHelperCart::removeOrderItems($order_id);\n\n // let us inform the user that the payment is successful\n require_once(JPATH_SITE . '/components/com_k2store/helpers/orders.php');\n try{\n @K2StoreOrdersHelper::sendUserEmail(\n $orderpayment->user_id,\n $orderpayment->order_id,\n $orderpayment->transaction_status,\n $orderpayment->order_state,\n $orderpayment->order_state_id\n );\n } catch (Exception $e) {\n // do nothing\n // prevent phpMailer exception\n }\n }\n } catch (Exception $e) {\n $orderpayment->order_state = JText::_('K2STORE_PENDING'); // PENDING\n $orderpayment->order_state_id = 4; // PENDING\n if ($e->getCode() == 1) { // 1 => trnsaction canceled\n $orderpayment->order_state = JText::_('K2STORE_FAILED'); // FAILED\n $orderpayment->order_state_id = 3; //FAILED\n }\n $orderpayment->transaction_status = 'Denied';\n $orderpayment->save();\n $vars->error = $this->zarinpalTranslate($e->getMessage());\n }\n\n $html = $this->_getLayout('postpayment', $vars);\n return $html;\n }", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "public function payment(){\r\n \r\n echo \"class ExtendedPaymentSelf : <br />\";\r\n\r\n $firstPayment = ($this->RegistrationFee) + ($this->ProgramTuition / 2);\r\n\r\n echo \"The first payment: \" . $firstPayment . \"$ <br />\";\r\n //$myDate = new DateClass();\r\n\r\n echo \" date: \" . $this->StartDate . \"<br />\";\r\n\r\n \r\n $secondPayment = $this->ProgramTuition / 2;\r\n\r\n echo \"The second payment : \" . $secondPayment . \"<br />\";\r\n echo \" date: SixMonthsLater\";\r\n echo \"<hr/>\";\r\n\r\n\t\t\r\n }", "function process_payment( $order_id )\n {\n\n //cuando hace click en proceder al pago, luego de elegir seguripago\n //finalizar-comprar/ 1\n\n $order = new WC_Order( $order_id );\n\n return array\n (\n 'result' => 'success',\n 'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('pay'))))\n );\n }", "public function payment_fields() {\n \n\t\t\n \n\t\t}", "function process_payment($order_number, $order_total, &$d) {\n return true;\n }", "public function creditCardPayment()\n {\n }", "public function poll() { //validate request from interkassa\n\t\t$this->wrlog(\"====================START=========================\");\n\t\t$this->wrlog(\"Payment for order: \".getRequest(\"ik_pm_no\").\" Time: \".date(\"Y-m-d H:i:s\"));\n\t\t$buffer = outputBuffer::current();\n\t\t$buffer->clear();\n\t\t$buffer->contentType(\"text/plain\");\n\t\t$this->wrlog($_REQUEST);\n\t\tif (!$this->checkIP()) {\n\t\t\t$this->order->setOrderStatus('canceled');\n\t\t\t$buffer->push(\"failed\");\n\t\t\t$this->wrlog(\"Invalid IP reply address\");\n\t\t}\n\t\telseif($this->hash_validation()) {\n\t\t\t$status = getRequest(\"ik_inv_st\");\n\t\t\tswitch($status) {\n\t\t\t\tcase interkassaPayment::STATUS_FAIL : {\t//fail order\n\t\t\t\t\t$this->order->setPaymentStatus('declined');\n\t\t\t\t\t$this->order->setOrderStatus('canceled');\n\t\t\t\t\t$buffer->push(\"failed\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase interkassaPayment::STATUS_SUCCESS : { //success order, create payment\n\t\t\t\t\t$this->order->setPaymentStatus('accepted');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"OK\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase interkassaPayment::STATUS_PENDING : { //pedning payment, wait for payment\n\t\t\t\t\t$this->order->setPaymentStatus('initialized');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"waitAccept\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->order->setPaymentStatus('initialized');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"waitAccept\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\t$buffer->push(\"failed\");\n\t\t}\n\t\t$this->wrlog(\"=====================END=========================\");\n\t\t$buffer->end();\n\t}", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $execution->setPayerId($payerId);\n \n $transaction = new Transaction();\n $amount = new Amount();\n\n $details = new Details();\n $details->setShipping(0)\n ->setTax(0)\n ->setSubtotal(Cart::subtotal());\n\n $amount->setCurrency('BRL');\n $amount->setTotal(Cart::total());\n $amount->setDetails($details);\n\n $transaction->setAmount($amount);\n\n $execution->addTransaction($transaction);\n\n try{\n // Execute payment\n $result = $payment->execute($execution, $this->_apiContext);\n \n try{\n\n $payment = Payment::get($paymentId, $this->_apiContext);\n }catch(Exception $ex){\n\n die($ex);\n }\n }catch(PayPalConnectionException $ex){\n\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n }catch(Exception $ex){\n\n die($ex);\n }\n\n Session::flash('status', 'Pagamento realizado');\n Session::put('token-paypal', $_GET['token']);\n return redirect('/paypal/transaction/complete');\n }", "public function paymentAction() {\n\n $br = new bookingRecord();\n\n // check the session is still around\n if ($br->expired()) {\n $this->redirect($this->url('booking/expired'));\n }\n\n // resave session just to bump its time\n $br->save();\n\n // Get the purchase record\n $purchase = $this->bm->getPurchase($br);\n\n // work out final fare\n $fares = \\ORM::forTable('fares')->findOne(1);\n\n // Line up Sagepay class\n $sagepay = new sagepayserverlib();\n $sagepay->setController($this);\n $sagepay->setPurchase($purchase);\n $sagepay->setFare($this->bm->calculateFares($br));\n\n // anything submitted?\n if ($data = $this->getRequest()) {\n\n // Anything other than 'next' jumps back\n if (empty($data['next'])) {\n $this->redirect($this->Url('booking/contact'));\n }\n\n // If we get here we can process SagePay stuff\n // Register payment with Sagepay\n $sr = $sagepay->register();\n\n // If false is returned then it went wrong\n if ($sr === false) {\n $this->View('booking_fail', array(\n 'status' => 'N/A',\n 'diagnostic' => $sagepay->getError(),\n ));\n }\n\n // check status of registration from SagePay\n $status = $sr['Status'];\n if (($status != 'OK') && ($status != 'OK REPEATED')) {\n $this->View('booking_fail', array(\n 'status' => $status,\n 'diagnostic' => $sr['StatusDetail'],\n ));\n }\n\n // update purchase\n $purchase->securitykey = $sr['SecurityKey'];\n $purchase->regstatus = $status;\n $purchase->VPSTxId = $sr['VPSTxId'];\n $purchase->save();\n\n // redirect to Sage\n $url = $sr['NextURL'];\n header(\"Location: $url\");\n die;\n }\n }", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "function index() {\n if (empty($_GET['action']))\n $_GET['action'] = 'process';\n// echo \"<pre>\";\n// var_dump($_REQUEST);\n// echo \"<pre>\";\n switch ($_GET['action']) {\n case 'process': // Process and order...\n // There should be no output at this point. To process the POST data,\n // the submit_paypal_post() function will output all the HTML tags which\n // contains a FORM which is submited instantaneously using the BODY onload\n // attribute. In other words, don't echo or printf anything when you're\n // going to be calling the submit_paypal_post() function.\n // This is where you would have your form validation and all that jazz.\n // You would take your POST vars and load them into the class like below,\n // only using the POST values instead of constant string expressions.\n // For example, after ensureing all the POST variables from your custom\n // order form are valid, you might have:\n //\n // $this->paypal->add_field('first_name', $_POST['first_name']);\n // $this->paypal->add_field('last_name', $_POST['last_name']);\n// echo \"<pre>\";\n// var_dump($_SESSION);\n// echo \"<pre>\";\n if (!$this->session->userdata('is_logged_in')) {\n $type = $this->session->userdata('type');\n redirect('http://www.streamact.com/', 'refresh');\n }\n try {\n $description = $_POST['description'];\n $payment = $_POST['payment'];\n $type_payment = $_POST['type_payment'];\n $rand = rand(1000, 9999);\n $id = date(\"Ymd\") . date(\"His\") . rand(1000, 9999) . $rand;\n// echo \"<pre>\";\n// var_dump($_POST);\n// echo \"<pre>\";\n //$key = \"track_\".md5(date(\"Y-m-d:\").rand());\n\n $this->paypal->add_field('business', '[email protected]');\n// $this->paypal->add_field('return', 'http://www.streamact.com/panel/user_purchase');\n $this->paypal->add_field('return', 'http://www.streamact.com/panel/paypal/success');\n $this->paypal->add_field('cancel_return', 'http://www.streamact.com/panel/store');\n $this->paypal->add_field('notify_url', 'http://www.streamact.com/panel/paypal/ipn');\n $this->paypal->add_field('item_name', $description);\n $this->paypal->add_field('amount', $payment);\n $this->paypal->add_field('key', $key);\n $this->paypal->add_field('item_number', $id);\n\n\n $paypal_transaction = new stream\\stream_paypal_transactions();\n $paypal_transaction->type_payment = $type_payment;\n $paypal_transaction->amount = $payment;\n $paypal_transaction->id_producto = $_POST['id'];\n $paypal_transaction->notes = isset($_POST['notes']) ? $_POST['notes'] : 0;\n $paypal_transaction->id_seguimiento = $id;\n $paypal_transaction->id_usuario = $_SESSION['user_id'];\n $paypal_transaction->type_user = ($_SESSION['type'] == \"User\") ? \"2\" : $_SESSION['type'] == \"Artist\" ? \"1\" : \"0\";\n $paypal_transaction->type_payment = $_POST['type_payment'];\n $paypal_transaction->fecha_hora = date(\"Y-m-d H:i:s\");\n \n\n $this->stream->persist($paypal_transaction);\n $this->stream->flush();\n // submit the fields to paypal\n $this->paypal->submit_paypal_post();\n } catch (Exception $exc) {\n echo \"<pre>\";\n echo $exc->getTraceAsString();\n echo \"<pre>\";\n }\n\n// $paypal_transaction->ipn_track_id=$myPost[''];\n // $this->paypal->dump_fields(); // for debugging, output a table of all the fields\n break;\n }\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function success_payment(){\n\n\t\tif ( !empty( $_GET['paymentId'] ) && !empty( $_GET['PayerID'] ) ) {\n\n\t\t\ttry{\n\t\t\t\t$result = $this->paypal->execute_payment( $_GET['paymentId'], $_GET['PayerID'] );\n\t\t\t\t$result = json_decode($result, true);\n\t\t\t\t$paidAmount = $result['transactions'][0]['amount']['total'];\n\t\t\t\t\n\t\t\t\tif ($this->advertiser_model->check_exist($paymentId) == FALSE)\n\t\t\t\t{\n\t\t\t\t\t$user=$this->advertiser_model->get_advertiser_by_id($_SESSION['id']);\n\t\t\t\t\t$previous_bal = $user['account_bal'];\n\t\t\t\t\t$new_bal = $paidAmount+$previous_bal;\n\t\t\t\t\t$this->advertiser_model->credit_balance(array('account_bal' =>$new_bal ));\n\t\t\t\t\t$this->advertiser_model->insert_to_payment_record(array('method'=>'paypal',\n\t\t\t\t\t'payment_type'=>'deposit','amount'=> $paidAmount,'user_type'=>'advertiser','user_id' => $_SESSION['id'],\n\t\t\t\t\t'time'=>time(), 'txn_id'=>$_GET['paymentId'], 'payer_id'=>$_GET['PayerID'], 'payment_token'=>$_GET['token']));\n\n\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-green'>Payment Successfully Processed</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. The transaction already exist.</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. Error is: \" . $e->getMessage() . \"</span>\";\n\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t}\n\n\t\t}\n\n\t\treturn;\n\n\t}", "public function postProcess()\n {\n $grandTotal = 0;\n //CRM_Utils_System::flushCache();\n $values = $this->controller->exportValues();\n $grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE);\n $maxLimit = $grantThresholds['Maximum number of checks per pdf file'];\n $programID = implode(',',$values['grant_program']);\n\n // Get payment status ID\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'name' => 'grant_payment_status',\n );\n $result = civicrm_api('OptionGroup', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"grant_payment_status\" option group. Please refer to extension installation instructions.'));\n }\n $optionID = $result['values'][0]['id'];\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Printed',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"Printed\" grant payment status option. Please refer to extension installation instructions.'));\n }\n $paidStatus[] = $result['values'][0]['value'];\n\n // Reprinted payment status\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Reprinted',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if (!empty($result['values'])) {\n $paidStatus[] = $result['values'][0]['value'];\n }\n\n $paid = implode(',', $paidStatus); // payment status to include\n $minAmount = $values['t4a_min_payment'];\n\n // Get dates\n if ($values['start_date']['d'] != '' && $values['start_date']['M'] != '' && $values['start_date']['Y'] != '' &&\n $values['end_date']['d'] != '' && $values['end_date']['M'] != '' && $values['end_date']['Y'] != '') {\n $startDate = $values['start_date']['Y'] . '-' . $values['start_date']['M'] . '-' . $values['start_date']['d'];\n $endDate = $values['end_date']['Y'] . '-' . $values['end_date']['M'] . '-' . $values['end_date']['d'];\n }\n\n $select = \"select * from \";\n $count = \"select count(1) from \";\n $query = \"(select a.contact_id as id, a.currency, sum(a.amount) as total_amount from\n (select distinct p.id, p.contact_id, p.currency, p.payment_created_date, p.amount from civicrm_payment p\n inner join civicrm_entity_payment ep on p.id = ep.payment_id and ep.entity_table = 'civicrm_grant'\n inner join civicrm_grant g on ep.entity_id = g.id\n where g.grant_program_id in ($programID) and p.payment_status_id in ($paid) \";\n\n if (isset($startDate)) {\n $query .= \"and p.payment_date >= '\" . $startDate . \"' and p.payment_date <= '\" . $endDate . \"' \";\n }\n\n // Filter by contact\n if (isset($values['t4a_contact_id']) && $values['t4a_contact_id'] != '') {\n $query .= \"AND p.contact_id in (\" . $values['t4a_contact_id'] . ') ';\n }\n\n $query .= \") a\n group by a.contact_id) b\n WHERE b.total_amount > $minAmount\";\n\n $daoCount = CRM_Grant_DAO_Grant::singleValueQuery($count . $query); // Surely there's a better way of doing this?\n\n if ($daoCount > 0) {\n for ($i=0; $i<$daoCount; $i=$i+$maxLimit) {\n $dao = CRM_Grant_DAO_Grant::executeQuery($select . $query.\" LIMIT $i, $maxLimit\");\n $grantPayment = $payment_details = $amountsTotal = $details = array();\n while($dao->fetch()) {\n if (isset($amountsTotal[$dao->id])) {\n $amountsTotal[$dao->id] += $dao->total_amount;\n }\n else {\n $amountsTotal[$dao->id] = $dao->total_amount;\n }\n\n // Aggregate payments per contact id\n if (!empty($details[$dao->id]['total_amount'])) {\n $details[$dao->id]['total_amount'] += $dao->total_amount;\n } else {\n $details[$dao->id]['total_amount'] = $dao->total_amount;\n }\n $details[$dao->id]['currency'] = $dao->currency;\n\n }\n $totalAmount = 0;\n foreach ($details as $id => $value) {\n $grantPayment[$id]['contact_id'] = $id;\n $grantPayment[$id]['t4a_year'] = $values['t4a_year'];\n $grantPayment[$id]['first_name'] = $this->getFirstName($id);\n $grantPayment[$id]['last_name'] = $this->getLastName($id);\n $grantPayment[$id]['payable_to_address'] =\n CRM_Utils_Array::value('address', CRM_Grant_BAO_GrantProgram::getAddress($id, NULL, true));\n $grantPayment[$id]['amount'] = $details[$id]['total_amount'];\n $grantPayment[$id]['payer'] = wordwrap($values['t4a_payer'], 20, '<br />');\n $grantPayment[$id]['box'] = $values['t4a_box'];\n\n // Get contact's SIN\n $sinID = CRM_T4Ageneration_Form_GenerateXML::returnCustomFieldID();\n $params = array('entityID' => $id, 'custom_' . $sinID => 1);\n $sinResult = CRM_Core_BAO_CustomValueTable::getValues($params);\n // Insert spaces in SIN\n $sinArray = str_split($sinResult['custom_' . $sinID], 3);\n $grantPayment[$id]['sin'] = implode(' ', $sinArray);\n\n $totalAmount += $details[$id]['total_amount'];\n }\n\n $grandTotal += $totalAmount;\n $downloadNamePDF = check_plain('T4');\n $downloadNamePDF .= '_'.date('Ymdhis');\n $this->assign('grantPayment', $grantPayment);\n $downloadNamePDF .= '.pdf';\n $fileName = CRM_Utils_File::makeFileName($downloadNamePDF);\n $files[] = $fileName = $this->makePDF($fileName, $grantPayment, 'Grant Payment T4');\n }\n $config = CRM_Core_Config::singleton();\n\n $fileDAO = new CRM_Core_DAO_File();\n $fileDAO->uri = $fileName;\n $fileDAO->mime_type = 'application/zip';\n $fileDAO->upload_date = date('Ymdhis');\n $fileDAO->save();\n $grantPaymentFile = $fileDAO->id;\n\n $entityFileDAO = new CRM_Core_DAO_EntityFile();\n $entityFileDAO->entity_table = 'civicrm_contact';\n $entityFileDAO->entity_id = $_SESSION[ 'CiviCRM' ][ 'userID' ];\n $entityFileDAO->file_id = $grantPaymentFile;\n $entityFileDAO->save();\n\n //make Zip\n $zipFile = check_plain('T4').'_'.date('Ymdhis').'.zip';\n foreach($files as $file) {\n $source[] = $config->customFileUploadDir.$file;\n }\n $exportFormat = new CRM_Financial_BAO_ExportFormat_CSV();\n $zip = $exportFormat->createZip($source, $config->customFileUploadDir.$zipFile);\n\n foreach($source as $sourceFile) {\n unlink($sourceFile);\n }\n\n CRM_Core_Session::setStatus(ts('T4s have been generated.'), NULL, 'no-popup');\n\n $directory = strstr($config->customFileUploadDir, 'sites');\n global $base_url;\n $filePath = $base_url . '/' . $directory . $zipFile;\n $this->assign('download', $filePath);\n\n // Redirect to XML file generation. Maybe redirecting back to the grant search page would be best,\n // but we'd need a way to trigger the download ideally without overloading any templates\n CRM_Utils_System::redirect(CRM_Utils_System::url( 'civicrm/grant/t4adownload', 'reset=1&download='.$zipFile));\n } else {\n CRM_Core_Session::setStatus(ts('No payments exist for the given time period, program and contacts.'), NULL, 'no-popup');\n }\n\n parent::postProcess();\n }", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "public function Payment(){\r\n \r\n echo \"class QuarterlyInt : <br />\";\r\n\r\n $tuitionCycle = (($this->ProgramTuition / 100)*25);\r\n\t\t$firstPayment = $tuitionCycle; \r\n \r\n\t\techo \"First payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: \" . $this->StartDate . \"<br /><br />\";\r\n \t\r\n\t\t\r\n\t\t$secondPayment = $tuitionCycle;\r\n\r\n\t\techo \"Second payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: Three Months Later $ <br /><br />\";\r\n\t\r\n\r\n\t\t$thirdPayDate = $tuitionCycle; \r\n\r\n\t\techo \"Third payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: six Months Later $ <br /><br />\";\r\n\r\n\r\n\t\t$forthPayDate = $tuitionCycle;\r\n\r\n\t\techo \"Forth payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: nine Months Later \";\r\n\r\n\t\t\techo \"<hr/>\";\r\n }", "function _postPayment( $data )\n {\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n\t\t\n\t\tif ($vars->inline_creditcard_form == 1) \n\t\t{\n\t\t\t$data = $this->_getInlinePaymentResponse($data);\n\t\t\t$result = $data['ssl_result'];\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// Process the payment\n\t\t\t$result = JFactory::getApplication()->input->getString('ssl_result');\n\t\t}\n\n $vars = new JObject();\n\n switch ($result)\n {\n case \"0\":\n \t$errors = $this->_process( $data );\n\n \t// No errors\n \tif($errors == '')\n \t{\n\t $vars->message = JText::_('VIRTUALMERCHANT PAYMENT OK');\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n \t// Errors\n \telse\n \t{\n \t\t$vars->message = $errors;\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n break;\n default:\n case \"1\":\n $vars->message = JText::_('VIRTUALMERCHANT PAYMENT FAILED').': '.$data['ssl_result_message'];\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n break;\n }\n\n return $html;\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function _postPayment( $data )\n {\n // Process the payment\n $vars = new JObject();\n\n $app =JFactory::getApplication();\n $paction = JRequest::getVar( 'paction' );\n\n switch ($paction)\n {\n case \"display_message\":\n $session = JFactory::getSession();\n $session->set('j2store_cart', array());\n $vars->message = JText::_($this->params->get('onafterpayment', ''));\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n\n break;\n case \"success_payment\":\n \n // Check User loged in\n $user = JFactory::getUser();\n if($user->id > 0){\n $jinput = JFactory::getApplication()->input;\n include(\"lib/nusoap.php\");\n $url = $this->_getPaysbuyUrl(true);\n $client = new nusoap_client($url, true);\n\n // Get this post from Paysbuy\n $inv = $jinput->post->get('apCode', 0);\n $params = array(\n \"psbID\"=>$this->params->get('psbid',''),\n \"biz\"=>$this->params->get('username',''),\n \"secureCode\"=>$this->params->get('secureCode',''),\n \"invoice\"=>$inv,\n \"flag\"=>\"\"\n );\n\n $result = $client->call(\n 'getTransactionByInvoiceCheckPost',\n array('parameters' => $params),\n 'http://tempuri.org/',\n 'http://tempuri.org/getTransactionByInvoiceCheckPost',\n false,\n true\n );\n\n $result = $result[\"getTransactionByInvoiceCheckPostResult\"];\n $info = $result[\"getTransactionByInvoiceReturn\"];\n\n JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_j2store/tables');\n $tOrder = JTable::getInstance('Orders', 'Table');\n $tOrder->load($inv);\n $order_id = intval($tOrder->id);\n\n // Check $inv from Paysbuy and owner orderinfo\n if($info['result']===\"00\" && !is_null($tOrder->id) && $tOrder->user_id==$user->id){\n \n // Update Status from Paysbuy\n $tOrder->order_state = \"Confirmed\";\n $tOrder->order_state_id = 1;\n $tOrder->store();\n }\n\n }\n\n break;\n \n default:\n $vars->message = JText::_( 'J2STORE_SAGEPAY_MESSAGE_INVALID_ACTION' );\n $html = $this->_getLayout('message', $vars);\n break;\n }\n\n return $html;\n }", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function paymentAction()\n {\n\n $this->initUnipagosPaymentStep();\n $this->loadLayout(); \n $this->getLayout()->getBlock(\"head\")->setTitle($this->__(\"Unipagos Payment\"));\n $this->renderLayout(); \n }", "public function payments()\n {\n $users = User::where([['total_paid', '<', '110'],['active','1']])->get();\n foreach ($users as $user){\n Mail::to($user->email)->cc(['[email protected]','[email protected]'])->send(new OutStandingPayment($user));\n }\n\n }", "function storeallpayment(){\n // $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n // $from = \"[email protected]\";\n // $to = \"[email protected]\";\n // // $to = \"[email protected]\";\n // $subject = 'Price Inquiry';\n // $message = $body;\n // $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n\n // mail($to,$subject,$message,$headers);\n\t$piece= implode(\",,,,\",$_SESSION['sale']);\n\t\t$products= implode(\",,,,\",$_SESSION['productDetail']['addtocart']);\n\t\t$userId = $_SESSION['userId'];\n\t\t// print_r($userId);die;\n\t\t$last_id = $this->db->query(\"SELECT ID FROM dbo.order_detail ORDER BY ID DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY\")->row();\n\t\t// print_r();die;\n\t\t$new_id = $last_id->ID +1;\n\t\tif(empty($userId) || $userId == 0){\n\t\t\t$userId = 0;\n\t\t\t$_SESSION['userId'] = 0;\n\t\t}\n\n\t$newstring = substr($_SESSION['payment']['cardnumber'], -4);\n\t$data = array(\n\t\t// \"ID\" =>$new_id,\n\t\t'guest_userid'=>$new_id,\n\t\t\"order_date\"=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\"ListID\"=>$products,\n\t\t\t\t\t\"UserId\"=>$userId,\n\t\t\t\t\t\"piece\"=>$piece,\n\t\t\t\t\t\"shippingfirstname\"=>$_SESSION['shipping']['firstname'],\n\t\t\t\t\t\"shippinglastname\"=>$_SESSION['shipping']['lastname'],\n\t\t\t\t\t\"shippingcompanyname\"=>$_SESSION['shipping']['companyname'],\n\t\t\t\t\t\"shippingareacode\"=>$_SESSION['shipping']['areacode'],\n\t\t\t\t\t\"shippingprimaryphone\"=>$_SESSION['shipping']['primaryphone'],\n\t\t\t\t\t\"shippingstreetadress\"=>$_SESSION['shipping']['streetadress'],\n\t\t\t\t\t\"shippingstate\"=>$_SESSION['shipping']['state'],\n\t\t\t\t\t\"shippingcity\"=>$_SESSION['shipping']['city'],\n\t\t\t\t\t\"shippingzipcode\"=>$_SESSION['shipping']['zipcode'],\n\t\t\t\t\t\"shippinghome\"=>$_SESSION['shipping']['home'],\n\t\t\t\t\t\"transactionId\"=>$_SESSION['shipping']['transactionId'],\n\t\t\t\t\t\"billingfirstname\"=>$_SESSION['payment']['firstname'],\n\t\t\t\t\t\"billinglastnames\"=>$_SESSION['payment']['lastnames'],\n\t\t\t\t\t\"billingareacodes\"=>$_SESSION['payment']['areacodes'],\n\t\t\t\t\t\"billingprimaryphone\"=>$_SESSION['payment']['primaryphone'],\n\t\t\t\t\t\"billingemail\"=>$_SESSION['payment']['email'],\n\t\t\t\t\t\"billingcompanys\"=>$_SESSION['payment']['companys'],\n\t\t\t\t\t\"billingstreetadd\"=>$_SESSION['payment']['streetadd'],\n\t\t\t\t\t\"billingsuite\"=>$_SESSION['payment']['suite'],\n\t\t\t\t\t\"billingstates\"=>$_SESSION['payment']['states'],\n\t\t\t\t\t\"billingcity\"=>$_SESSION['payment']['city'],\n\t\t\t\t\t\"billingzipcode\"=>$_SESSION['payment']['zipcode'],\n\t\t\t\t\t\"billingallpayment\"=>$_SESSION['payment']['allpayment'],\n\t\t\t\t\t\"paymenttype\"=>$_SESSION['payment']['paymenttype'],\n\t\t\t\t\t\"cardtype\"=>$_SESSION['payment']['cardtype'],\n\t\t\t\t\t\"cardholder\"=>$_SESSION['payment']['cardholder'],\n\t\t\t\t\t\"cardnumber\"=>$newstring,\n\t\t\t\t\t\"cardcvv\"=>$_SESSION['payment']['cardcvv'],\n\t\t\t\t\t\"cardmonth\"=>$_SESSION['payment']['cardmonth'],\n\t\t\t\t\t\"cardyear\"=>$_SESSION['payment']['cardyear'],\n\t\t\t\t\t\"allshipcharge\"=>$_SESSION['payment']['allshipcharge'],\n\t\t\t\t\t\"allmainpayment\"=>$_SESSION['payment']['allmainpayment'],\n\t\t\t);\n\t\tif(isset($_SESSION['shipping']['buisness'])){\n\t\t\t$data['buisness'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$data['buisness'] = 0;\n\t\t}\n\n\t\t$this->db->insert(\"dbo.order_detail\",$data);\n\t\t$_SESSION['insert_id'] = $this->db->insert_id();\n\t\t\t $order = $this->orderall();\n\n\t$body = \"<p>Thank you for placing your order with Global Fitness!</p>\n <p style=''>This email is to confirm your recent order.</p>\n <p> Date \".date('m/d/Y').\"</p>\n <p> Order Number : \".$order[0]->ID.\" </p>\n \";\n\n if($_SESSION['shipping']['home']!=2)\n {\n\t $body.=\"<p><b>Shipping address</b></p>\n\t\t <p>\".$_SESSION['shipping']['firstname'].\" \".$_SESSION['shipping']['lastname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['areacode'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['shipping']['companyname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['state'].\", \".$_SESSION['shipping']['city'].\" \".$_SESSION['shipping']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n }\n\n $body.=\"<p><b>Billing address</b></p>\n \t\t\t <p>\".$_SESSION['payment']['firstname'].\" \".$_SESSION['payment']['lastnames'].\"</p>\n \t\t\t <p>\".$_SESSION['payment']['areacodes'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['payment']['companys'].\"</p>\n\t\t <p>\".$_SESSION['payment']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['payment']['states'].\", \".$_SESSION['payment']['city'].\" \".$_SESSION['payment']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n\n\n\n\n\n for($i=0; $i<$_SESSION['productDetail']['count'];$i++){\n\t $product = $this->Site_model->productdetail($_SESSION['productDetail']['addtocart'][$i]);\n\t\tforeach($product as $live){\n\t\t\t$thisPrice = preg_replace('/[^A-Za-z0-9\\-(.)]/', '', $live->Price);\n\n\t\t\t $body.=\"<p style=''>\".$_SESSION['sale'][$i].\"x \".$live->ProductName.\" for $\".$thisPrice.\" each</p>\";\n\t\t}\n }\n\n\n\n\t$body.=\"<p style=''>Subtotal : $\".$_SESSION['payment']['allmainpayment'].\" USD</p>\n\n <p style=''>Shipping : $\".$_SESSION['payment']['allshipcharge'].\" USD</p>\";\n\n if($_SESSION['shipping']['home']==\"0\"){\n\t\t\t$body.=\"<p style=''>$300 USD White Glove Delivery</p>\";\n\t\t}\n\n $body.=\"<p style=''>Total : $\".$_SESSION['payment']['allpayment'].\" USD</p>\n <p> Please allow 1 - 2 business days to process through our warehouse. Please note that most U.S. orders ship within 3-7 business days from receipt unless contacted by our staff otherwise. </p><p><a href='\".base_url('site/orderall?orderID=').base64_encode($_SESSION['insert_id']).\"'>View Your Order Here.</a></p>\" ;\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n if (isset($_SESSION['email'])) {\n \t# code...\n \t$to = $_SESSION['email'];\n }else{\n \t$to = $_SESSION['payment']['email'];\n }\n // $cc =\"[email protected]\";\n $subject = 'Global Fitness Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n //$headers .= 'Bcc: '.$cc.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n $to = \"[email protected]\";\n //$to =\"[email protected]\";\n $subject = 'Online Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\t\tunset($_SESSION['productDetail']);\n\t\tunset($_SESSION['sale']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t}" ]
[ "0.8109606", "0.75880474", "0.7244233", "0.7184708", "0.6881219", "0.6792774", "0.67690235", "0.67690235", "0.6684103", "0.65736663", "0.65589476", "0.65438706", "0.65329164", "0.6502036", "0.6493395", "0.648789", "0.64863414", "0.6442757", "0.64399236", "0.6438517", "0.6432704", "0.6428248", "0.642562", "0.6414817", "0.64146715", "0.6406745", "0.6401999", "0.63882744", "0.6384624", "0.63827294", "0.63798535", "0.63683337", "0.6365482", "0.6346414", "0.6338152", "0.6317878", "0.6316539", "0.63092697", "0.63090056", "0.63084704", "0.629457", "0.6281742", "0.6281244", "0.6279915", "0.62793833", "0.62579197", "0.623414", "0.6212583", "0.62041444", "0.6202957", "0.6199083", "0.61915004", "0.61909753", "0.61849374", "0.6183904", "0.617669", "0.6173209", "0.6165202", "0.6162259", "0.6154279", "0.6152596", "0.6152433", "0.6144469", "0.6133303", "0.6131741", "0.6120954", "0.6118994", "0.6118455", "0.61157656", "0.6110246", "0.61082685", "0.61038303", "0.6100841", "0.60839075", "0.6080721", "0.6076637", "0.6076251", "0.60727465", "0.60717106", "0.6069113", "0.6068817", "0.60681754", "0.60653645", "0.6062544", "0.6062119", "0.60587794", "0.6057592", "0.6054376", "0.6053564", "0.6052407", "0.6050708", "0.6049849", "0.6044065", "0.60321844", "0.60294574", "0.60275054", "0.6023583", "0.60215974", "0.6020801", "0.6017362", "0.60108095" ]
0.0
-1
Return the object revision
public function getRevision() { return $this->systemProperties->getRevision(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRevision();", "public function getRevision() ;", "public function getRevision() {}", "public function getRevision()\n {\n return $this->revision;\n }", "public function getRevision()\n {\n return $this->result[\"revision\"];\n }", "public function getRevision()\n {\n return $this->_rev;\n }", "public function getRevision() {\n return $this->revision;\n }", "public function getRevision()\n {\n return $this->sys->getRevision();\n }", "public function getRevision()\n {\n return $this->getResolved()->getRevision();\n }", "public function getRevisioned() ;", "public function getRev() : string;", "protected function getGitRevision() {}", "public function getRev()\n {\n return $this->data['fields']['rev'];\n }", "public function getRevisionId() {\n return $this->revisionId;\n }", "public function getRevisionID()\n {\n return $this->revisionid;\n }", "public function getLastRevision();", "public function getRevisionNumber()\n {\n return $this->revision_number;\n }", "function getFileRevision() {\n\t\treturn $this->getData('fileRevision');\n\t}", "public static function getCurrentRevision() {\n $settings = self::getSettings();\n return $settings->headrevision;\n }", "public function getRevisionDate()\n {\n return $this->revisionDate;\n }", "public function getRevdate()\n {\n return $this->revdate;\n }", "public function getRevisionTime()\n {\n return $this->revisionTime;\n }", "public function getRevision($round = true) {}", "function acf_get_post_latest_revision($post_id)\n{\n}", "function wp_get_post_revision(&$post, $output = \\OBJECT, $filter = 'raw')\n {\n }", "function _wp_get_post_revision_version($revision)\n {\n }", "public function getRevisionCreationTime();", "public function getRevisionCreationTime();", "public function getRevisionCreationTime();", "public function getRevisionCreationTime();", "public function getRevisionCreationTime();", "public function getRevisionData()\n {\n return $this->getData();\n }", "protected function getUllrightCurrentRevision()\n {\n // TODO: implement setting somehow in the upgrade/refresh procedure\n $path = sfConfig::get('sf_data_dir') .\n DIRECTORY_SEPARATOR .\n 'ullright_svn_revision.txt';\n \n if (file_exists($path))\n {\n return file_get_contents($path);\n } \n else\n {\n $command = 'svn info plugins/ullCorePlugin';\n $output = reset($this->getFilesystem()->execute($command));\n preg_match('#Revision: ([\\d]+)#', $output, $matches);\n \n return $matches[1];\n }\n }", "function generate_revision($post) {\n $revision = BlogRevision::_generateWith($post);\n return $revision;\n}", "function testRevisionHistory() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My First Revision\");\r\n\t\t$oid = $obj->save();\r\n\r\n\t\t$revid = $dbh->GetValue($dbh->Query(\"select id from object_revisions where object_id='$oid' and object_type_id='\".$obj->object_type_id.\"'\"));\r\n\t\t$this->assertTrue($revid > 0 && $revid !=null);\r\n\t\t//$this->assertEquals($dbh->GetValue($dbh->Query(\"select field_value from object_recurrence where id='\".$rp->id.\"'\")), 0);\r\n\t}", "public function getCurrentRevisionId(): int\n {\n $resp = $this->apiGet(\"replicate\");\n \n if ($resp->getStatusCode() !== 200) {\n throw new WeblingAPIException(\"Get request to Webling failed with status code {$resp->getStatusCode()}\");\n }\n \n return $resp->getData()['revision'];\n }", "function getLatestRev() {\n\t\t$rev = $this->LatestRevPacked;\n\t\tif(!$rev && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$rev = $this->LatestRevPacked;\n\t\t}\n\t\treturn $rev;\n\t}", "public function getRevisionDelta() {\n $currentRevision = $this->owner->getRevision();\n\n if ($currentRevision == null)\n return null;\n\n $currentRevision = $this->owner->getRevision()->Revision;\n\n $publishedRevision = ItemEnvironment::find()->where([\n \"DocumentId\" => $this->owner->getDocumentId()->getId(),\n \"Status\" => Yii::$app->getModule(\"environment\")->getLiveEnvironment(),\n ])->orderBy(\"Revision DESC\")->one();\n\n if ($publishedRevision)\n return $currentRevision - $publishedRevision->Revision;\n\n return 0;\n }", "public function isRevisionable();", "public function getRevisions()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('revisions');\n }", "function get_revision_stamp($obj)\n{\n\tif($obj->session->userdata('editsessionid')){\n\t\t$revisionstamp = $obj->session->userdata('editsessionid');\n\t}\n\telse\n\t{\n\t\t$revisionstamp = strtotime('now');\n\t\t$obj->session->set_userdata('editsessionid', $revisionstamp);\n\t}\n\treturn $revisionstamp;\n}", "public function getRevisions(): array;", "public function getRevisionUser();", "public function getRevisionUser();", "public function getRevisionUser();", "public function getRevisionUser();", "public function getRevisionUser();", "function acf_get_post_latest_revision( $post_id ) {\n\n\t// vars\n\t$revisions = wp_get_post_revisions( $post_id );\n\n\t// shift off and return first revision (will return null if no revisions)\n\t$revision = array_shift( $revisions );\n\n\t// return\n\treturn $revision;\n\n}", "public function getSpecFileRevision()\n {\n $value = $this->get(self::SPEC_FILE_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function getSpecFileRevision()\n {\n $value = $this->get(self::SPEC_FILE_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function showRevision($id)\n {\n }", "public static function getDevelopmentRevision()\n {\n $branch = '';\n $rev = 0;\n $date = '';\n \n try {\n // try to find the .git dir\n $dir = realpath(dirname(dirname(dirname(__FILE__)))) . '/.git';\n if (file_exists($dir)) {\n $HEAD = trim(str_replace('ref: ', '', @file_get_contents(\"$dir/HEAD\")));\n $explodedHead = explode('/', $HEAD);\n \n $branch = array_pop($explodedHead);\n $rev = trim(@file_get_contents(\"$dir/$HEAD\"));\n \n $hashes = str_split($rev, 2);\n \n $objPath = \"$dir/objects\";\n while (count($hashes) != 0) {\n $objPath .= '/' . array_shift($hashes);\n $objFile = \"$objPath/\" . implode('', $hashes);\n if (@file_exists($objFile)) {\n $date = date_create('@' . filemtime($objFile))->format('Y-m-d H:i:s');\n break;\n }\n }\n }\n $revision = \"$branch: $rev ($date)\";\n } catch (\\Exception $e) {\n $revision = 'not resolvable';\n }\n \n return $revision;\n }", "public static function getCurrent() {\n global $CFG;\n\n if ($data = file_get_contents(\"$CFG->dirroot/mod/amvonetroom/revision\"))\n return new amvonetroom_Version($data);\n else\n return new amvonetroom_Version(0);\n }", "public function\r\n get_revision_number()\r\n {\r\n #$cmd = self::get_svn_program() . ' info ' . $this->get_name();\r\n #$info = shell_exec($cmd);\r\n $info = $this->get_svn_info();\r\n \r\n foreach (explode(\"\\n\", $info) as $info_line) {\r\n if (preg_match('/^Revision: (\\d+)/', $info_line, $matches)) {\r\n return $matches[1];\r\n }\r\n }\r\n \r\n return 0;\r\n }", "public function getRevisions(): array\n {\n return $this->revs;\n }", "public function currentVersion()\n {\n return $this->versions()->orderBy(Version::CREATED_AT, 'DESC')->first();\n }", "public function revisionable()\n\t{\n\t\treturn $this->morphTo();\n\t}", "public function getVersion() {\n $logRepo = \\Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\LogEntry');\n return $logRepo->getLatestLog($this);\n }", "public function getRevision()\n {\n @trigger_error('revision is deprecated.', E_USER_DEPRECATED);\n return $this->revision;\n }", "public function getValidatorRevision()\n {\n $value = $this->get(self::VALIDATOR_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function getValidatorRevision()\n {\n $value = $this->get(self::VALIDATOR_REVISION);\n return $value === null ? (integer)$value : $value;\n }", "public function getLastVersionId()\n {\n return $this->createQueryBuilder('v')\n ->select('MAX(v.id)')\n ->getQuery()\n ->getSingleScalarResult();\n }", "protected function getUllrightHeadRevision()\n {\n $command = 'svn info http://bigfish.ull.at/svn/ullright/trunk';\n $output = reset($this->getFilesystem()->execute($command));\n preg_match('#Revision: ([\\d]+)#', $output, $matches);\n \n return $matches[1];\n }", "function get_latest_revision_id() {\n\t$safe_css = get_safe_css_post();\n\t$latest_revision = wp_get_post_revisions( $safe_css->ID, array( 'posts_per_page' => 1 ) );\n\n\tif ( empty( $latest_revision ) ) {\n\t\t$latest_revision = $safe_css;\n\t} else {\n\t\t$latest_revision = array_shift( $latest_revision );\n\t}\n\n\treturn $latest_revision->ID;\n}", "public function get_content_object_edition()\n {\n return array_search($this->id, DataManager::get_version_ids($this)) + 1;\n }", "public function getEntryRevisions()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('entryRevisions');\n }", "public static function latest($obj) {\n\t\treturn DB::table(Version::getVersionsTable())->where('object_id', '=', $obj->attributes['id'])->where('object_table', '=', strtolower(get_class($obj)))->order_by('created_at', 'desc')->first();\n\t}", "public function getRevision(): ?string {\n $val = $this->getBackingStore()->get('revision');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'revision'\");\n }", "public static function getHeadRevision() {\n $settings = self::getSettings();\n if(!self::$_hasHeadRevisionIncremented) {\n if(self::newRevisionsAllowed()) {\n $settings->headrevision++;\n self::$_hasHeadRevisionIncremented = true;\n $settings->save();\n }\n }\n return $settings->headrevision;\n }", "public function getRevision(int $revision_id): NodeRevisionInterface;", "public function getConfiguration(): Revision\n {\n return $this->config;\n }", "public function getLastRevisionId()\n {\n $this->pull();\n $result = $this->execute('log', array('-n1'), array());\n foreach($result as $line)\n {\n if ('commit' == substr($line, 0, 6))\n {\n $parts = explode(' ', $line);\n return (string)$parts[1];\n }\n }\n }", "function wp_get_post_revisions_url($post = 0)\n {\n }", "public function getVersionReference()\n {\n return $this->version;\n }", "public function getRevision(RepositoryEntry $repository, $branch);", "private static function getRevisionObject($model) {\n $reflect = new \\ReflectionClass($model);\n $modelRevision = $reflect->getShortName() . 'Revision';\n return new $modelRevision;\n }", "public function current()\n {\n return current($this->revs);\n }", "public function setRevision($value) {}", "function getLastchangeAuthor() {\n\t\treturn $this->get(\"lastchangeauthor\");\n\t}", "function wp_is_post_revision($post)\n {\n }", "function &getRevision($fileId, $revision, $fileStage = null, $submissionId = null) {\n\t\tif (!($fileId && $revision)) {\n\t\t\t$nullVar = null;\n\t\t\treturn $nullVar;\n\t\t}\n\t\t$revisions =& $this->_getInternally($submissionId, $fileStage, $fileId, $revision);\n\t\treturn $this->_checkAndReturnRevision($revisions);\n\t}", "public function getRevisionLabel(): string\n {\n return Craft::t('app', 'Revision {num}', [\n 'num' => $this->revisionNum,\n ]);\n }", "function getNewVersion($meta, $object);", "public function getVersion() {\r\n return $this->versione;\r\n }", "function OPS_get_post($id) {\r\n\tglobal $wpdb;\r\n\t$post = $wpdb->get_results(\"SELECT * FROM $wpdb->posts WHERE ID=$id\");\r\n\tif ($post->post_type == \"revision\"){\r\n\t\t$id = $post->post_parent;\r\n\t\t$post = $wpdb->get_results(\"SELECT * FROM $wpdb->posts WHERE ID=$id\");\r\n\t}\r\n\treturn $post[0];\r\n}", "public function getRevisionData($revision);", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public static function getJsRevision()\n {\n return 3;\n }", "public function getVersionId()\n {\n return $this->version_id;\n }", "public function getVersionId()\n {\n return $this->version_id;\n }", "function module_get_schema_revision ($module) {\n $esc_module = mysql_real_escape_string($module);\n $sql = \"SELECT `revision` FROM `module` WHERE `name`='$esc_module'\";\n $res = mysql_query($sql);\n if (!$res) { die(mysql_error()); }\n if (mysql_num_rows($res) === 0) {\n return 0;\n }\n $row = mysql_fetch_assoc($res);\n return $row['revision'];\n}", "public function getVersionID()\n {\n return $this->versionID;\n }", "function &getRepoEntry() {\n\t\treturn $this->repoObj;\n\t}", "function wp_ajax_get_revision_diffs()\n {\n }", "public function getVersion(){\n\t\treturn $this->version;\n\t}", "protected function getGitRevision()\n {\n chdir(PATH_site);\n $revision = trim(CommandUtility::exec('git describe'));\n chdir(PATH_typo3);\n return [\n htmlspecialchars('Site Version'),\n htmlspecialchars($revision),\n 'sysinfo-git',\n ];\n }", "public function get_version(){\n return $this->_version;\n }", "function getVersion ()\n {\n return $this->_version;\n }", "public function getDataRevision() {\n return (int)trim(str_replace('$', ' ', substr($this->tree->getDataRevision(), 6)));\n }", "public function getVersionId() {\n\t\treturn $this->versionId;\n\t}" ]
[ "0.85407716", "0.8487537", "0.84517837", "0.8120847", "0.8057016", "0.8056336", "0.801407", "0.7826149", "0.78019327", "0.7786097", "0.75995934", "0.7575436", "0.7567505", "0.7550486", "0.7513471", "0.7289781", "0.72660744", "0.72371894", "0.7084122", "0.69881266", "0.69565403", "0.68785983", "0.68563175", "0.68534845", "0.6750287", "0.67464405", "0.67397", "0.67397", "0.67397", "0.67397", "0.67397", "0.67347574", "0.6711209", "0.6637082", "0.6527137", "0.64768803", "0.6458336", "0.6445052", "0.64412326", "0.6396394", "0.63770664", "0.63369447", "0.63358754", "0.63358754", "0.63358754", "0.63358754", "0.63358754", "0.6294228", "0.62759835", "0.62759835", "0.62577695", "0.6243964", "0.62407994", "0.6221223", "0.62005806", "0.6177384", "0.6136261", "0.6115153", "0.6105576", "0.60188746", "0.60188746", "0.6015357", "0.60095453", "0.60038453", "0.6003643", "0.6002262", "0.60002255", "0.5995112", "0.5989659", "0.59880716", "0.59550875", "0.59300303", "0.59252095", "0.5916265", "0.59054387", "0.5903592", "0.58793855", "0.5847274", "0.5830865", "0.58159506", "0.5811186", "0.57692516", "0.5767422", "0.57609874", "0.5756157", "0.574562", "0.5722402", "0.5721031", "0.5707643", "0.5707643", "0.57056737", "0.5702546", "0.56953055", "0.56929666", "0.5690419", "0.56880635", "0.5676336", "0.56725043", "0.5655419", "0.5655195" ]
0.74740654
15
Return the object ID
public function getId() { return $this->systemProperties->getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObjectID();", "protected function get_object_id() {\n\t\t$id = rgget( 'id' );\n\t\t$id = absint( $id );\n\t\treturn $id; // example in the case of form id\n\t}", "public function objId()\n {\n return $this->objId;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "public function getObjectID()\n {\n return $this->_objectID;\n }", "abstract public function objId();", "function getId( $Object );", "public function getObjectIdent();", "function runkit_object_id($obj) : int {\n}", "public function getObjectIdentifier();", "public function getObjectId() {\n\t\t\treturn SERIA_Meta::getNamedObjectId($this);\n\t\t}", "public function getObjectId() {}", "public function getObjectId() {}", "public function getObjectId();", "public function getObjectIdent() {}", "public function getObjectIdent() {}", "public function getIdentifier($obj)\n {\n return $obj->id;\n }", "function id()\n {\n \n //Object ID pool.\n static $object_ids = [];\n \n //Get the object hash.\n $hash = spl_object_hash($this->object);\n \n //Find the object ID in out pool?\n if(array_key_exists($hash, $object_ids)){\n $id = $object_ids[$hash];\n }\n \n //Create the object ID.\n else{\n $object_ids[$hash] = $id = (count($object_ids) + 1);\n }\n \n //Return the object ID.\n return new NumberWrapper($id);\n\n }", "public function getObjectId(): int\n {\n return \\spl_object_id($this);\n }", "function get_object_id(object $object, bool $with_name = true): string\n{\n return Objects::getId($object, $with_name);\n}", "function spl_object_id(object $object): int {}", "public function getObjectID()\n {\n $targetObjectID = '00000000-0000-0000-0000-000000000000';\n if($this->_targetResource != null)\n {\n $targetObjectID = $this->_targetResource->getObjectID();\n }\n\n return $this->_sourceResource->getObjectID() . \"_\" . $this->_sourceProperty . \"_\" . $targetObjectID;\n }", "public function getID();", "public function getID();", "public function getID();", "public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }", "public function getObjectIdentifier($object);", "public function get_id();", "public function get_id();", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "public function id()\n {\n if (!is_null($this->id) && $this->id) {\n return $this->id;\n } else {\n throw new \\Exception('No object ID was supplied for this query');\n }\n }", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "public function getId()\n {\n return $this->__get(\"id\");\n }", "public function getId()\n {\n return $this->__get(\"id\");\n }", "public function getId()\n {\n return $this->__get(\"id\");\n }", "function getID() {\n\t\treturn $this->id;\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "private function GetID()\n\t\t{\n\t\t\treturn $this->id;\n\t\t}", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "function spl_object_id($obj) : int {\n}", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function GetID() {\n return $this->id;\n }", "public function get_id() {\n\t\treturn $this->_id;\n\t}", "public function getID()\n {\n return $this->id;\n }", "public function getID()\n {\n return $this->id;\n }", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "function get_id()\n {\n return $this->id;\n }", "public function getObjectUid()\n {\n return $this->objectUid;\n }", "function get_id() {\n return $this->id;\n }", "public function getID() {\n \n return $this->id;\n }", "public function id() {\n return $this->entity->id();\n }", "public function get_id()\n {\n return $this->_id;\n }", "public function get_id()\n\t{\n\t\treturn $this->_id;\n\t}", "protected function getID() {\n return $this->id;\n }", "function getID() {\n\t\treturn $this->iId;\n\t}", "function getID() {\n\t\treturn $this->iId;\n\t}", "public function getID() {\n\t\treturn $this->id;\n\t}", "public function getID() {\n\t\treturn $this->id;\n\t}", "public function getID() {\n\t\treturn $this->id;\n\t}", "public function getID() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "public function getIdentifierByObject($object) {\n\t\treturn $this->persistenceSession->getIdentifierByObject($object);\n\t}", "function get_id()\r\n {\r\n return $this->id;\r\n }", "public function getID() {\n return $this->id;\n }", "public function getID() {\n return $this->id;\n }", "public function getID() {\n return $this->id;\n }", "public function getID() {\n return $this->id;\n }", "public function getID() {\n return $this->id;\n }", "public function id()\n\t{\n\t\t// @todo: _id should not be hard-coded (mongo-specific)\n\t\treturn $this->get('_id');\n\t}", "public function getID() {\n\t\treturn $this->_id;\n\t}", "public function get_id() {\n\t\t\treturn $this->id;\n\t\t}", "public function getID() \n \t{\n \t\treturn $this->_id;\n \t}", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public function getID()\n\t{\n\t\treturn $this->id;\n\t}", "public function getID()\n\t{\n\t\treturn $this->id;\n\t}", "public function getID()\n\t{\n\t\treturn $this->id;\n\t}", "function getID() {\n return $this->id;\n }", "function getID() {\n return $this->id;\n }" ]
[ "0.9077525", "0.8713674", "0.86303836", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8324616", "0.8281188", "0.82773954", "0.81616855", "0.8142013", "0.8140925", "0.8082416", "0.80633837", "0.80633837", "0.80618125", "0.7988959", "0.7988959", "0.79832864", "0.7918548", "0.7896798", "0.7863101", "0.7851058", "0.78322405", "0.7791628", "0.7791628", "0.7791628", "0.7772502", "0.7755963", "0.7747547", "0.7747547", "0.765411", "0.7645977", "0.76443034", "0.76436853", "0.762048", "0.7593776", "0.7593776", "0.7593776", "0.7590878", "0.75896513", "0.75747025", "0.7569383", "0.7551217", "0.7551217", "0.7551217", "0.7551217", "0.75449073", "0.75449073", "0.75449073", "0.75407", "0.75317335", "0.75317335", "0.75317335", "0.7531076", "0.75232446", "0.75180984", "0.75180984", "0.75175244", "0.75175244", "0.75175244", "0.751518", "0.75124145", "0.75091904", "0.75090307", "0.75079143", "0.75024486", "0.7492563", "0.74924487", "0.7482832", "0.7482832", "0.7479848", "0.7479848", "0.7479848", "0.7479848", "0.7479829", "0.7479829", "0.74760276", "0.74642456", "0.74583817", "0.74583817", "0.74583817", "0.74583817", "0.74583817", "0.74539137", "0.7447626", "0.74475986", "0.74453765", "0.74410564", "0.74385697", "0.74385697", "0.74385697", "0.74355596", "0.74355596" ]
0.0
-1
Return the object type
public function getObjectType() { return $this->systemProperties->getObjectType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_object_type()\n {\n }", "public function objType()\n {\n return $this->objType;\n }", "abstract public function objType();", "function getObjtype() {\n return $this->objtype;\n }", "public function getObjType()\r\n {\r\n return $this->objType;\r\n }", "public function getTypeObject()\n {\n return $this->typeObject;\n }", "public function get_type();", "public function getObjectType();", "public function getObjectType();", "static private function getType($object) {\n return get_class($object);\n }", "function getType() ;", "function getType() ;", "function getType() ;", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public abstract function getType();", "abstract protected function getType();", "protected abstract function getType();", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "public function getType() {}", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "public function type();", "public function type();", "public function type();", "public function type();", "private function get_type() {\n\n\t}", "public function getObjectIdentifier()\n {\n return $this->type;\n }", "public function get_object_type($rule)\n {\n }", "public function getObjectType() : string;" ]
[ "0.8844136", "0.8574877", "0.8493648", "0.8449328", "0.84193265", "0.8323623", "0.80815536", "0.8007992", "0.8007992", "0.7961018", "0.77765286", "0.7775925", "0.77748483", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.77738297", "0.7756104", "0.7735007", "0.7693579", "0.7692963", "0.7692963", "0.7692766", "0.76922965", "0.76592946", "0.7647958", "0.7643626", "0.76420254", "0.76420254", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.7641704", "0.76416093", "0.76416093", "0.76416093", "0.7622138", "0.7622138", "0.7622138", "0.7622138", "0.7622138", "0.7622138", "0.7616487", "0.7616487", "0.7616487", "0.7616487", "0.7616487", "0.7615502", "0.7615502", "0.7615502", "0.7615502", "0.7594324", "0.75753", "0.75587434", "0.75583047" ]
0.0
-1
Return the creation date & time
public function getCreated() { return $this->systemProperties->getCreated(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "function getCreationTime() ;", "public function getCreationTime()\n {\n return $this->creation_time;\n }", "public function getCreationTime(){\n\t\treturn $this->creationTime;\n\t}", "public function getCreationTime(){\r\n\t\treturn $this->creationTime;\r\n\t}", "public function getCreatetime()\n {\n return $this->createTime;\n }", "public function getCreatetime()\n {\n return $this->createtime;\n }", "public function getCreationDate();", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function getCreationTimestamp()\n {\n return isset($this->creation_timestamp) ? $this->creation_timestamp : '';\n }", "public function getCreationDate()\n {\n return $this->created;\n }", "public function created() {\n\t\treturn gmdate( 'Y-m-d\\TH:i:s\\Z' );\n\t}", "public function getCreatedTime()\n\t{\n\t\treturn $this->createdTime; \n\n\t}", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getCreateTime()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate() {\n\t\treturn $this->creationDate;\n\t}", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function getCreationDate() {\n return $this->creationDate;\n }", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "public function getCreationDate() \r\n { \r\n return $this->_creationDate; \r\n }", "public function getCreationDate() {\n\n return $this->u_creationdate;\n\n }", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getDateCreated();", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "function created() {\n return date('Y-m-d H:i:s');\n }", "function get_timecreated() {\n return $this->timecreated;\n }", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function getCreationDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->creationDate;\r\n\t}", "public function getDateCreated() {\n return Yii::app()->dateFormatter->format(\"HH:mm\",$this->createTime).\" \".Yii::app()->dateFormatter->format(Yii::app()->locale->dateFormat,$this->createTime);\n }", "public function get_date_created();", "public function getCreatedTime(): string;", "public function getTimeCreated()\n {\n return $this->timeCreated;\n }", "public function getCreated() {\n\n $createdDateTime = \\DateTime::createFromFormat('Y-m-d H:i:s', $this->created);\n return $createdDateTime;\n\n }", "public function getCreationDatetime()\n {\n return $this->getValue('nb_icontact_prospect_creation_datetime');\n }", "public function get_creation_date()\n {\n return $this->get_default_property(self::PROPERTY_CREATION_DATE);\n }", "public function getCreatedDate() {\n return $this->get('created_date', 'user');\n }", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getCreateTime()\n {\n return isset($this->create_time) ? $this->create_time : null;\n }" ]
[ "0.83884203", "0.8289198", "0.8266523", "0.8264676", "0.8262398", "0.8243884", "0.8221706", "0.82093894", "0.8193499", "0.81924367", "0.81549925", "0.81517893", "0.8142879", "0.8083068", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8082286", "0.8036563", "0.8036563", "0.79921365", "0.797565", "0.7963798", "0.7963798", "0.7963798", "0.7963798", "0.7963798", "0.79530305", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7946621", "0.7938985", "0.7938985", "0.7927902", "0.7927853", "0.78771174", "0.7865311", "0.7860152", "0.7846796", "0.78264374", "0.7823857", "0.7823857", "0.7823857", "0.7805243", "0.77816725", "0.7770959", "0.77608705", "0.77499604", "0.77122146", "0.7704453", "0.76972175", "0.7689501", "0.76652", "0.7605144", "0.7576819", "0.75692457", "0.7558671" ]
0.0
-1
Return the modification date & time
public function getModified() { return $this->systemProperties->getModified(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }", "function getModificationTime() ;", "public function getModificationTime()\n {\n return $this->fileStructure->mtime;\n }", "public function get_date_modified();", "public function getModificationTime() {}", "public function getModificationTime() {}", "public function getModificationTime();", "public function getModificationDate()\n {\n return $this->modificationDate;\n }", "public function getModificationDate() {\n return $this->modificationDate;\n }", "function get_timemodified() {\n return $this->timemodified;\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 }", "public function getModifiedTime()\n\t{\n\t\treturn $this->modifiedTime; \n\n\t}", "public function mtime();", "public function get_modification_date()\n {\n return $this->get_default_property(self::PROPERTY_MODIFICATION_DATE);\n }", "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 }", "public function getLastModifiedTime();", "public function getModifyDate()\n {\n return $this->modifyDate;\n }", "public function getDateModification()\n {\n return $this->dateModification;\n }", "function get_date_mod(){\n\treturn date (\"F d Y H:i:s.\", filemtime(lastModifiedInFolder(ABSPATH . 'wp-content/')));\n}", "public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function last_modified() {\n\t\treturn $this->timestamp;\n\t}", "public function getModifiedDate()\n\t{\n\t\treturn $this->_mdate;\n\t}", "public function getMTime() {\n\t\treturn filemtime($this->getPath());\n\t}", "function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}", "public function getDateModified();", "public function getModificationTime($path);", "public function getModifiedDate() : \\DateTime {\n return $this->modifiedDate;\n }", "public function getDateModified()\n {\n return $this->_DateModified;\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function getModDate();", "public function getModifiedAt()\n {\n return $this->modifiedAt;\n }", "private function getTargetModificationTime() {\n if (!isset($this->targetModificationTime)) {\n $this->targetModificationTime = (int) @filemtime($this->target);\n }\n return $this->targetModificationTime;\n }", "public function getLastModified()\n {\n return filemtime($this->getFileName());\n }", "public function getLastModified()\n {\n return ($this->item['mtime'] ? $this->item['mtime'] : ($this->item['ctime'] ? $this->item['ctime'] : time()));\n }", "public function getDateModified()\n {\n return $this->dateModified;\n }", "public function getLastModified(){\n return $this->lastModified;\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 lastModification( ) {\n\n\t\treturn file_exists( $this->_path )\n\t\t\t? filemtime( $this->_path )\n\t\t\t: 0;\n\t}", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}", "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 getModifiedAt()\n {\n return $this->getProperty(self::MODIFIED_AT);\n }", "public function modificationTime($path);", "public function getModeratorUpdatedDate();", "public static function getLastModified() {}", "public function getModifed(): DateTime\n {\n $DateTime = new DateTime();\n $DateTime->createFromFormat('U', filemtime($this->filePath));\n return $DateTime;\n }", "public function getLastModified() {\n\t\treturn filemtime($this->filename);\n\t}", "public function getLastModify()\n\t{\n\t\treturn $this->last_modify;\n\t}", "public function modificationTime($path) {\n return filemtime($path);\n }", "public function getModifiedStamp();", "function getLastModifiedDate() {\n\t\treturn $this->data_array['last_modified_date'];\n\t}", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getModDate() \r\n { \r\n return $this->_modDate; \r\n }", "public function lastModificationTime($path);", "public function getLastModified()\n {\n return $this->lastModified;\n }", "public function getLastModified()\n {\n return $this->_lastModified;\n }", "public function getLastModificationDate()\n {\n return new \\DateTimeImmutable($this->getData('last_modification_date', 0), 'Europe/Moscow');\n }", "public function getModate()\n {\n return $this->modate;\n }", "public function getLast_modified() {\n\t\treturn $this->last_modified;\n\t}", "public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}", "public function getModifiedOn(): \\DateTime\n {\n return $this->modifiedOn;\n }", "public function getModificationDate($asString = true) {}", "public function getLastModified()\n\t{\n\t\treturn $this->last_modified;\n\t}", "function stampModified() {\n\t\treturn $this->setLastModified(Core::getCurrentDate());\n\t}", "public function getModTime(): int;", "public function lastModified();", "public function lastModified();", "public function getDateModified(): DateTime\n {\n return $this->dateModified;\n }", "public function getAccessTime()\n {\n return $this->fileStructure->atime;\n }", "function the_modified_time($format = '')\n {\n }", "public function getLastModifiedAudit();", "public function lastModifiedTime(): int\n {\n if (isset($this->lastModifiedTime)) {\n return $this->lastModifiedTime;\n }\n return FileSystem::lastModifiedTime($this->path);\n }", "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 getLastModifiedAt();", "public function getLastModifiedAt();", "public function getUpdatedTime() {\r\n return $this->updated_time;\r\n }", "function get_the_modified_time($format = '', $post = \\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}", "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 }", "function getLastModifiedTime(){\n /*$output = dbcCmd(\"getLastModifiedTime\\n\");\n \n //Error Check\n if($output[\"stdout\"] == \"failed\\n\"){\n return str_replace(\"\\n\",\"\",$output[\"stdout\"]);\n }\n \n $rtn = array(\"lastModifiedTime\"=>str_replace(\"\\n\",\"\",$output[\"stdout\"]));\n return json_encode($rtn);*/\n return;\n}", "function lastModified()\n {\n if(!empty($this->list)) {\n return strtotime($this->list->modified);\n }\n return null;\n }", "public function getEditDate() { return $this->tstamp; }", "public function getModifiedAt();", "public function getModifiedAt();", "public function filetime() {\n return $this->info['filetime'];\n }", "function http_send_last_modified($timestamp = null) {}", "public function getLastModified(): int;", "function getCreationTime() ;", "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 getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }" ]
[ "0.849844", "0.845162", "0.84374785", "0.83548266", "0.8239957", "0.8238228", "0.81192154", "0.805624", "0.80394304", "0.798782", "0.7941283", "0.7883261", "0.7797572", "0.7759776", "0.76660717", "0.76601624", "0.7656909", "0.763595", "0.75878227", "0.75389063", "0.74670887", "0.74583656", "0.7430833", "0.7391324", "0.7373994", "0.73600423", "0.7349012", "0.7329912", "0.73214763", "0.73156667", "0.73156667", "0.73156667", "0.7315221", "0.7315149", "0.73083615", "0.72981024", "0.7292067", "0.72850394", "0.7284374", "0.7282843", "0.72769636", "0.7245911", "0.7245911", "0.7245911", "0.7245911", "0.7245911", "0.72387075", "0.72145677", "0.7214487", "0.72061825", "0.7190504", "0.71867007", "0.71837604", "0.71819603", "0.71668684", "0.7165947", "0.7165823", "0.7163368", "0.7141428", "0.7136384", "0.7136384", "0.7136384", "0.7136384", "0.7123015", "0.71167433", "0.7106178", "0.7095461", "0.70780325", "0.7063458", "0.70599467", "0.7019408", "0.70015395", "0.69928", "0.6974845", "0.6969752", "0.69679856", "0.69436944", "0.69436944", "0.6938774", "0.69285023", "0.6884128", "0.68826926", "0.68680394", "0.6863735", "0.6844568", "0.6844568", "0.67413485", "0.6733364", "0.67329746", "0.6707633", "0.66989434", "0.6687962", "0.6686274", "0.66483176", "0.66483176", "0.6645757", "0.6600808", "0.65967417", "0.6586566", "0.65851176", "0.6561167" ]
0.0
-1
Return the publication date & time
public function getPublished() { return $this->systemProperties->getPublished(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublishTime()\n {\n return $this->publish_time;\n }", "public function getPublishTime() {\n return $this->publish_time;\n }", "public function getPublicationDate()\n {\n return $this->publicationDate;\n }", "public function getPubDate()\n {\n return $this->_pubDate;\n }", "public static function getPubDate()\n {\n return self::$pubDate;\n }", "public function _getDatePublish()\n {\n return $this->_getArticleDataVal('pubDate');\n }", "public function getPublish_date() {\n return $this->publish_date;\n }", "public function getPublicationDate()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('publish_date', $this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t//return DateTime::createFromFormat('M j, Y', $this->data['publish_date']);\n\t\t\treturn $this->data['publish_date'];\n\t\t}", "function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}", "function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}", "public function getDatePubli()\r\n {\r\n return $this->datePubli;\r\n }", "public function getDatePublished() {\n\t\treturn date(\"d/m/Y\", strtotime($this->datePublished));\n\t}", "function getDatePublish($format = null) {\n\t\tif ($format == 'human') {\n\t\t\treturn polarbear_time2str($this->datePublish);\n\t\t} else if ($format) {\n\t\t\treturn strftime($format, $this->datePublish);\n\t\t} else {\n\t\t\treturn $this->datePublish;\n\t\t}\n\t}", "public function getPublishedTime()\n {\n $this->initialRequest();\n if (isset($this->item['snippet']['publishedAt'])) {\n return date('Y-m-d H:i:s', strtotime($this->item['snippet']['publishedAt']));\n }\n else {\n $this->onApiBadInterpretation(\"snippet.publishedAt not found\");\n }\n }", "public function getPublishedAt()\n {\n return $this->published_at;\n }", "private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }", "public function getDatePublished() {\n\t\t\treturn $this->date_published;\n\t\t}", "public function getPublishedAt()\n {\n return $this->publishedAt;\n }", "public function getPublishedAt()\n {\n return $this->publishedAt;\n }", "public function getPublishedAt()\n {\n return $this->_publishedAt;\n }", "public function getHumanReadablePublicationDates()\n {\n return $this->getPublicationInfo('c');\n }", "private function getPublishedDate(): string\n {\n if ($this->context->get('is_term')) {\n return '';\n }\n\n if (!$this->context->get('date')) {\n return '';\n }\n\n return $this->formatIso8601($this->augmented($this->context->get('date')), false);\n }", "public function getPublishDateAttribute()\n {\n return $this->content->publish_date;\n }", "function getDatePublished()\n {\n $datePublished = $this->get('schema:datePublished');\n return $datePublished;\n }", "function the_time() {\n\tglobal $discussion;\n\treturn $discussion['time'];\n}", "public function getPublishDateFrom();", "public function timeSincePublished()\n\t{\n\t\treturn $this->created_at->diffForHumans();\n\t}", "public function timeSincePublished()\n {\n return$this->created_at->diffForHumans();\n }", "function article_time() {\n if($created = Registry::prop('article', 'created_at')) {\n return $created->getTimestamp();\n }\n}", "public function pubDate(): ?string\n {\n if (null !== $this->pubDate) {\n return $this->pubDate->format('D d M Y H:i:s O');\n }\n\n return null;\n }", "public function getPublishTimeAttribute()\n { \n return Carbon::createFromTimeStamp(\n strtotime($this->created_at)\n )->diffForHumans();\n }", "public function getPublishDateTo();", "function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}", "public function getDatePublished(): DateTime\n {\n return $this->datePublished;\n }", "public function getDocTime()\n {\n return $this->doc_time;\n }", "public function published()\n {\n if ($this->published === null) {\n return;\n }\n\n if ($this->published->ts === null) {\n return;\n }\n\n $date = new DateTimeImmutable();\n\n return $date->setTimestamp($this->published->ts);\n }", "public function time() {\n\n\t\t\t$date = $this->date();\n\t\t\t$output = '<time class=\"post-date\" datetime=\"'.$date['datetime'].'\" title=\"'.$date['posted'].'\">'.$date['date'].'</time>'.\"\\n\";\n\n\t\t\treturn $output;\n\t\t}", "public function getAuthoringTime() {\n return $this->authoringTime;\n }", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "protected function getCreated($format = 'Y-m-d') {\r\n\t\treturn ($this->newsItem->getDatetime()->format($format));\r\n\t}", "function timeSincePublish($pub_date){\r\n\t\t\t$now_date = date('U');\r\n\t\t\t$since_date = $now_date - $pub_date;\r\n\t\t\t$since_hours = floor($since_date / 60 / 60);\r\n\t\t\t$since_days = floor($since_hours / 24);\r\n\t\t\r\n\t\t\t?><span style=\"display:none;\"><?php echo $pub_date; ?></span><?php\r\n\t\t\r\n\t\t\tif($since_hours<1 && $since_days<1){\r\n\t\t\t?><em>recently</em><?php\r\n\t\t\t}elseif($since_hours>=1 && $since_days<1){\r\n\t\t\t?><em><?=$since_hours?> hour<?= ($since_hours>1 ? 's':''); ?> ago</em><?php\r\n\t\t\t}elseif($since_hours>1 && $since_days>=1){\r\n\t\t\t?><em><?= ($since_days==1 ? 'yesterday':$since_days.' days ago'); ?></em><?php\r\n\t\t\t}\r\n\t\t}", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getPublishedDateTime()\n {\n if (array_key_exists(\"publishedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"publishedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"publishedDateTime\"])) {\n return $this->_propDict[\"publishedDateTime\"];\n } else {\n $this->_propDict[\"publishedDateTime\"] = new \\DateTime($this->_propDict[\"publishedDateTime\"]);\n return $this->_propDict[\"publishedDateTime\"];\n }\n }\n return null;\n }", "public function publishedString() \n {\n $time = time() - strtotime($this->publish_date);\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 foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'') . ' ago';\n }\n }", "public function getReleaseTime();", "public function created() {\n\t\treturn gmdate( 'Y-m-d\\TH:i:s\\Z' );\n\t}", "public function get_date_created();", "function created() {\n return date('Y-m-d H:i:s');\n }", "function get_timecreated() {\n return $this->timecreated;\n }", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "public function getPresentationTimestamp() {}", "public function getRelease_date()\n {\n return $this->release_date;\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "function getCreationTime() ;", "function genesisawesome_post_data_stamp() {\n\n\tif ( get_post_type() == 'post' )\n\t\tprintf( '<div class=\"ga-date published\" title=\"%s\"><span class=\"datenum\">%s</span><span class=\"monthname\">%s</span></div>', get_the_date('c'), get_the_date( 'd' ), get_the_date( 'M' ) );\n\n}", "public function getDateAndTime() {\n\t\t$dateAndTime = $this->date.$this->time;\n\t\treturn date(\"g:iA, l jS F Y\", strtotime($dateAndTime));\n\t}", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "public function firstPublished(): DateTimeInterface;", "public function getReleaseDate()\n {\n return $this->release_date;\n }", "public function getReleaseDate()\n {\n return $this->releaseDate;\n }", "function get_published_date($meta_object,$time){\n $date2 = \"\";\n \n for($i=0;$i<$meta_object->length;$i++){\n $meta = $meta_object->item($i);\n if($meta->getAttribute('property')==\"article:published_time\"){\n $date = $meta->getAttribute('content');\n if(!empty($date)){\n $date1 = date_create($date);\n $date2 = date_format($date1,\"Y-m-d H:i:s\");\n return $date2;\n break;\n }\n }\n }\n if(empty($date2)){\n $date = get_webpage_date($meta_object,$time);\n return $date;\n }\n}", "public function dateSend()\n {\n if ($this->time) {\n return $this->time->format('m/d/Y');\n }\n }", "public function lastPublished(): DateTimeInterface;", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function getTimeCreated()\n {\n return $this->timeCreated;\n }", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function getEntry_time()\n {\n return $this->entry_time;\n }", "function get_date() {\n\t\treturn $this->get_data( 'comment_date' );\n\t}", "function action_date_title()\n{\n\treturn time();\n}", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "function getCreatedTime() {\n\t\tif (is_null($this->created_time)) {\n\t\t\t$this->created_time = new \\MongoDate();\n\t\t}\n\t\treturn $this->created_time;\n\t}", "public function getCreationDate() \r\n { \r\n return $this->_creationDate; \r\n }", "function v1_get_pubdate($object) {\n\t\n\t// XML functions\n\trequire_once \"php/funcs/xml_funcs.php\";\n\t\n\t// Global list of general publish dates\n\tglobal $gen_pubdates;\n\t\n\t$pubdate=xml_get_att($object, \"PUBDATE\");\n\t\n\t// Store pubdate in list\n\tarray_unshift($gen_pubdates, $pubdate);\n\t\n}", "function timeStamp(){\n\t\techo date(\"is\");\n\t}", "public function getPublishDate() : ?DateTime\n {\n $rtn = $this->data['publish_date'];\n\n if (!empty($rtn)) {\n $rtn = new DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getDateCreated();", "function wp_get_media_creation_timestamp($metadata)\n {\n }", "public function getCreationTime()\n {\n return $this->creation_time;\n }", "public function getPublishedAt()\n {\n if ($this->status == PageStatus::PUBLISHED && $this->publishedAt === null) {\n $this->setPublishedAt($this->getCreatedAt());\n }\n\n return $this->publishedAt;\n }", "public function getArticlePublish() {\n return $this->article_publish;\n }", "public function getCreatetime()\n {\n return $this->createtime;\n }", "public function publishedAt()\n {\n $publishedAt = array_get($this->data, 'published_at', null);\n\n if ($publishedAt === null) {\n return trans('gzero-core::common.unknown');\n }\n\n return $publishedAt;\n }", "private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }", "protected function getDate() {\n\t\treturn date('Y-m-d h:i:s');\n\t}", "function bootstrap_posted_on() {\n\tprintf(get_the_date());\n}", "public function getCreationTime(){\n\t\treturn $this->creationTime;\n\t}", "function circle_posted_time() {\n\t\t$time_string = '<time class=\"entry-date published updated text-uppercase date-published\" datetime=\"%1$s\" data-waypoint=\"waypointEffect\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published text-uppercase date-published\" datetime=\"%1$s\">%2$s</time><time class=\"published updated text-uppercase date-published\" datetime=\"%3$s\" data-waypoint=\"waypointEffect\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf( $time_string,\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\tesc_attr( get_the_modified_date( 'c' ) ),\n\t\t\tesc_html( get_the_modified_date() )\n\t\t);\n\n\t\techo '<span class=\"posted-on\"><a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a></span>'; // WPCS: XSS OK.\n\t}", "public function getDateCreated() {\r\n return $this->_date_created;\r\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public static function getDate() {\r\n\t\treturn date('Y-m-d H:i:s');\r\n\t}", "public function date() {\n return $this->begin;\n }", "function getDateNotified() {\n\t\treturn $this->getData('dateNotified');\n\t}", "public function getCreationTime(){\r\n\t\treturn $this->creationTime;\r\n\t}", "public function getCreationDate();", "public function getCreationDate()\n {\n return $this->creationDate;\n }" ]
[ "0.805476", "0.7970763", "0.78521216", "0.7841469", "0.7803298", "0.76753676", "0.764663", "0.7439755", "0.74007183", "0.74007183", "0.7370848", "0.7213208", "0.716644", "0.714308", "0.7089042", "0.7078624", "0.70270544", "0.7007398", "0.7007398", "0.6992985", "0.69673026", "0.69647473", "0.69456947", "0.68785185", "0.6870877", "0.681459", "0.67919767", "0.678204", "0.67417276", "0.6671472", "0.6635446", "0.6630262", "0.6629481", "0.6602266", "0.6447776", "0.6419835", "0.6418944", "0.64079183", "0.6392942", "0.6390544", "0.6383337", "0.63822466", "0.63768524", "0.63752383", "0.63456154", "0.63443196", "0.6337666", "0.6313844", "0.63110316", "0.62909514", "0.6284302", "0.62810534", "0.62810534", "0.6274448", "0.62629294", "0.62490326", "0.6241267", "0.62362415", "0.61954504", "0.6179378", "0.6177315", "0.6166629", "0.61648816", "0.616123", "0.6146849", "0.61451364", "0.6128459", "0.6124684", "0.61243814", "0.6117796", "0.6110403", "0.6084245", "0.6083191", "0.6083191", "0.6083191", "0.60804", "0.6066265", "0.6064708", "0.6061704", "0.60615796", "0.6060286", "0.6053871", "0.6031838", "0.6031573", "0.60209453", "0.6017805", "0.6016028", "0.6006885", "0.6002182", "0.599963", "0.5995185", "0.5993875", "0.59904766", "0.5987859", "0.5987859", "0.5986175", "0.5973783", "0.5970621", "0.5966029", "0.5958277", "0.59569407" ]
0.0
-1
Return the deletion date & time
public function getDeleted() { return $this->systemProperties->getDeleted(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDeleteTime()\n {\n return $this->delete_time;\n }", "public function getDeleteTime()\n {\n return $this->delete_time;\n }", "public function getDeleteTime()\n {\n return $this->delete_time;\n }", "public function getDelete_date(){\n return $this->delete_date;\n }", "public function getTimeDeleted()\n {\n return $this->TIME_DELETED;\n }", "public function getDeletedDate() {\n return $this->deletedDate;\n }", "public function getDeletedAt()\n {\n return $this->deleted_at;\n }", "public function getDeletedAt()\n {\n return $this->deleted;\n }", "protected static function deleted_at(): mixed\n\t{\n\t\treturn self::$query->deleted_at;\n\t}", "public function deleteAt() : ?DateTime\n {\n return $this->returnDateField('deleted');\n }", "public function getDeleteDaysAfterLastModification();", "public function getOnDelete(): string;", "public function addDeleted()\n {\n try {\n $date = new DateTime();\n $this->deleted_at = $date->format('Y-m-d H:i:s');\n $this->deleted_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function getDateRemoved()\n {\n return $this->__get(self::FIELD_DATE_REMOVED);\n }", "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function getDeletedAtAttribute($value)\n {\n return date('j/n/Y g:i A', strtotime($value));\n }", "public function getRemovalTime(): ?string;", "public function getRemovalTime(): ?string;", "public function getDeleteDaysAfterLastModification()\n {\n return $this->deleteDaysAfterLastModification;\n }", "public function getDeleteDaysAfterCreation()\n {\n return $this->deleteDaysAfterCreation;\n }", "public function getDeletedAt(): ?DateTime\n {\n return $this->deletedAt;\n }", "public function getDeletedAt(): ?\\DateTime\n {\n return $this->deleted_at;\n }", "protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function delete() {\n\t\t$deleted = delete_metadata_by_mid( 'user', $this->get_id() );\n\n\t\tforeach ( get_user_meta( $this->get_user()->ID, self::META_KEY ) as $entry ) {\n\t\t\tif ( ! isset( $entry['created_at'] ) || $entry['created_at'] + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt() ) {\n\t\t\t\tdelete_user_meta( $this->get_user()->ID, self::META_KEY, $entry );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->data['log'] ) ) {\n\t\t\tITSEC_Log::add_process_stop( $this->data['log'] );\n\t\t}\n\n\t\treturn $deleted;\n\t}", "public function getDeletedAttribute($field)\n {\n if (auth()->check() && is_string($zone = config('laraboard.user.timezone'))) {\n $timezone = config('app.timezone');\n\n if (($pieces = explode('.', $zone)) > 1) {\n $timezone = auth()->user()->{$pieces[0]}->{$pieces[1]};\n } else {\n $timezone = auth()->user()->{$zone};\n }\n\n return Carbon::parse($this->attributes['deleted_at'])->timezone($timezone)->format('F j, Y g:ia T');\n }\n\n return Carbon::parse($this->attributes['deleted_at'])->format('F j, Y g:ia T');\n }", "function getModificationTime() ;", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "protected static function deleteTs()\n {\n Builder::macro(__FUNCTION__, function ($withBy = false) {\n $values = [\n \"deleted_at\" => \\Carbon\\Carbon::now()\n ];\n // deleted_by\n if ($withBy) {\n $values[\"deleted_by\"] = auth()->user()->id;\n }\n\n return Builder::update($values);\n });\n }", "public function getDeletedAt() : ?int ;", "function deleteExpiredLog() {\n\n\t\t$refObj = new REF();\n\t\t//get evt_del from refObj, use alm_del for now\n\t\t$event_del = $refObj->ref['evt_del'];\n\t\tif($event_del == 0){\n\t\t\t$event_del = $refObj->default['evt_del'];\n\t\t\tif($event_del == 0)\n\t\t\t\t$event_del = 180;\n\t\t}\n\n\t\t//convert value into seconds\n\t\t$event_del_in_sec = $event_del * 86400;\n\t\t\n\t\t$current_timestamp = time();\n\t\t\n\t\t$expired_timestamp = $current_timestamp - $event_del_in_sec;\n\t\t\n\t\t$expired_date = date('Y-m-d', $expired_timestamp);\n\n\t\t$eventObj = new EVENTLOG(\"\",\"\",\"\",\"\");\n\t\t$eventObj->deleteExpiredLog($expired_date);\n\n\t\treturn;\n\t}", "protected function deleteExpired() {\n\t\t$result = $this->db->query('SELECT id FROM image WHERE delete_time < '.time());\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$this->delete($entry[0]);\n\t\t\t}\n\t\t}\n\t}", "public function getDeleted();", "public function getDeleted()\n {\n return $this->deleted;\n }", "public function getDeleteTitle()\n {\n return sprintf($this->_('Delete %s'), $this->getTopic(1));\n }", "public function getDeleted()\n {\n return $this->Deleted;\n }", "public function get_deleted() {\n return $this->deleted;\n }", "public function getModificationTime();", "public function getModificationTime() {}", "public function getModificationTime() {}", "private function GetDeleted()\n\t\t{\n\t\t\treturn $this->deleted;\n\t\t}", "function deleteTimestamp($CheckID){\n\tglobal $vc;\n\tif(!empty($CheckID)&&is_numeric($CheckID)){\n\t\t$res=mysqli_query($vc,\"DELETE FROM Checkin WHERE CheckID=$CheckID;\");\n\t\treturn $res!=false;\n\t}else return false;\n}", "public function getDCreatedAt()\r\n {\r\n return $this->dCreatedAt;\r\n }", "public function getdeleted()\n {\n return $this->deleted;\n }", "public function getDeleted() {\n\t\treturn $this->deleted;\n\t}", "public function getDeleted() {\n\t\treturn $this->deleted;\n\t}", "function _update_blog_date_on_post_delete($post_id)\n {\n }", "function before_delete_log($primary_key)\n {\n $query = $this->db->get_where('sites', array('id' => $primary_key))->row();\n\n $format = 'DATE_RFC822';\n $time = time();\n $date = standard_date($format, $time);\n\n $data = array(\n 'action' => 'delete',\n 'user' => $this->session->userdata('username'),\n 'section' => 'Sitios',\n 'fk_section' => $query->id,\n 'description' => 'Se ha eliminado el sitio \"' . $query->name . '\" con URL \"' . $query->url . '\"',\n 'date' => $date\n );\n $this->db->insert('user_log', $data);\n }", "public function getCreatedTime() {\n // Fail due to double delete\n assert(!$this->hasBeenDeleted);\n \n // Fail due to unset 'created-time' field\n assert(isset($this->parentDbFieldTable[self::CREATED_KEY]));\n \n return $this->parentDbFieldTable[self::CREATED_KEY]->getValue();\n }", "public function getDistriCreateTime()\n {\n return $this->distri_create_time;\n }", "public function get_delete()\n {\n $del = $this->alias;\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n return \"delete $del $from $join $where $group $order $limit\";\n }", "public function hasDeletedAt() : bool;", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function getDateCreated();", "public function getCreatetime()\n {\n return $this->createtime;\n }", "protected function getDeleteAfterFunction()\n {\n \n }", "public function getDateDebut();", "public function isDeleted();", "public function isDeleted();", "public function onAfterDelete();", "function getCreationTime() ;", "function created() {\n return date('Y-m-d H:i:s');\n }", "public function getPurgeError()\n {\n $days = $this->config->getConfig(JobConfig::XML_PATH_PURGE_ERROR);\n $days = !empty((int) $days) ? (int) $days : JobConfig::DEFAULT_PURGE_ERROR;\n\n return date('Y-m-d H:i:s', strtotime(' -' . $days . ' day'));\n }", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function isDeleted() {}", "public function setDeleteTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->delete_time = $var;\n\n return $this;\n }", "public function setDeleteTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->delete_time = $var;\n\n return $this;\n }", "public function setDeleteTime($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->delete_time = $var;\n\n return $this;\n }", "public function isDeleted() {}", "public function getPurgeExecuted()\n {\n $days = $this->config->getConfig(JobConfig::XML_PATH_PURGE_EXECUTED);\n $days = !empty((int) $days) ? (int) $days : JobConfig::DEFAULT_PURGE_EXECUTED;\n\n return date('Y-m-d H:i:s', strtotime(' -' . $days . ' day'));\n }", "public function deleted() {\n // TODO Implement this\n }", "public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}", "public function getDeletedBy() {\n return $this->deletedBy;\n }", "public function getCreatetime()\n {\n return $this->createTime;\n }", "public function userDeleted();", "public function getDeletedAtAttribute($value)\n {\n if (is_null($value))\n return null;\n else\n return Carbon::parse($value)->setTimezone(config('constants.default-timezone'))->format('Y-m-d H:i:s');\n }", "public function trackDeletion()\n {\n\n return static::$trackDeletion;\n\n }", "public function Delete()\n\t\t{\n\t\t\t$this->deleted = new DateTime();\n\t\t\t$this->deletedby = User::GetCurrentUser();\n\t\t\t\n\t\t\t$connection = DatabaseConnection::GetConnection(\"default\");\n\t\t\treturn DatabaseAccess::Delete($this);\n\t\t}", "public function getClearingTime()\n {\n return $this->clearing_time;\n }", "public function getLastUploadDatetime()\n {\n return $this->getValue('nb_domain_zone_last_upload_datetime');\n }", "public function get_date_modified();", "protected function add_deleted($row)\n {\n if($this->timestamps === TRUE || is_array($this->timestamps))\n {\n if(is_object($row) && !isset($row->{$this->_deleted_at_field}))\n {\n $row->{$this->_deleted_at_field} = date('Y-m-d H:i:s');\n }\n elseif(!isset($row[$this->_deleted_at_field]))\n {\n $row[$this->_deleted_at_field] = date('Y-m-d H:i:s');\n }\n }\n return $row;\n }", "public function lastLogoutTime();", "public function afterDelete()\n\t{\n\t\t$userActionLog = new UserActionHistory();\n\t\treturn $userActionLog->saveActionLog($this->tableName(), $this->id, true, true);\n\t}", "protected function dt(){\n return date('Y-m-d\\TH:i:s');\n }", "public function deleted(ShowTime $showTime)\n {\n Log::createDeleteLog($this->table, $showTime->id);\n }", "public static function ADMIN_AREA_DELETE_AREA_STOP_DATE(){\n\t $SQL_String = \"UPDATE area_stop SET _keep=0 AND @user=:user WHERE asno=:asno AND _keep=1\";\n\t return $SQL_String;\n\t}", "public function getDefaultDeletedAt() : ?int;", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function created() {\n\t\treturn gmdate( 'Y-m-d\\TH:i:s\\Z' );\n\t}", "function deleteExpiredCfgLog() {\r\n\r\n\t\t\t$refObj = new REF();\r\n\t\r\n\t\t\t//get cfg_del from refObj\r\n\t\t\t$cfg_del = $refObj->ref['cfg_del'];\r\n\t\t\tif($cfg_del == 0){\r\n\t\t\t\t$cfg_del = $refObj->default['cfg_del'];\r\n\t\t\t\tif($cfg_del == 0)\r\n\t\t\t\t\t$cfg_del = 180;\r\n\t\t\t}\r\n\r\n\t\t\t//convert value into seconds\r\n\t\t\t$cfg_del_in_sec = $cfg_del * 86400;\r\n\t\t\t\r\n\t\t\t$current_timestamp = time();\r\n\t\t\t\r\n\t\t\t$expired_timestamp = $current_timestamp - $cfg_del_in_sec;\r\n\t\t\t\r\n\t\t\t$expired_date = date('Y-m-d', $expired_timestamp);\r\n\t\r\n\t\t\t// print_r(\"CFG DEL = $cfg_del\");\r\n\t\t\t// print_r(\"CFG DEL IN SEC = $cfg_del_in_sec\");\r\n\t\t\t// print_r(\"CURRENT TIME STAMP = $current_timestamp\");\r\n\t\t\t// print_r(\"EXPIRED TIMESTAMP = $expired_timestamp\");\r\n\t\t\t// print_r(\"EXPIRED DATE = $expired_date\");\r\n\t\r\n\t\t\t$cfglogObj = new CFGLOG();\r\n\t\t\t$cfglogObj->deleteExpiredLog($expired_date);\r\n\t\t\treturn;\r\n\t\t}", "public function getDeletedByColumn()\n {\n return Track::DELETED_BY;\n }", "public function onBeforeDelete();", "function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}", "function before_delete_log($primary_key)\n {\n $query = $this->db->get_where('languages', array('id' => $primary_key))->row();\n\n $format = 'DATE_RFC822';\n $time = time();\n $date = standard_date($format, $time);\n\n $data = array(\n 'action' => 'delete',\n 'user' => $this->session->userdata('username'),\n 'section' => 'Idiomas',\n 'fk_section' => $query->id,\n 'description' => 'Se ha eliminado el idioma \"' . $query->language . '\" de abreviatura \"' . $query->acronym . '\"',\n 'date' => $date\n );\n $this->db->insert('user_log', $data);\n }", "function get_timecreated() {\n return $this->timecreated;\n }", "public function getDateCreated() {\n return Yii::app()->dateFormatter->format(\"HH:mm\",$this->createTime).\" \".Yii::app()->dateFormatter->format(Yii::app()->locale->dateFormat,$this->createTime);\n }", "public function delete($data)\n {\n $id=$data->input('id');\n $employee = Employee::find($id);\n $employee-> delete_flag = true; \n $employee-> deleted_at = date('Y-m-d H:i:s');;\n $employee->save();\n\n }", "function wp_scheduled_delete()\n {\n }" ]
[ "0.85383135", "0.85383135", "0.85383135", "0.7963248", "0.7698223", "0.7535596", "0.7359889", "0.72161144", "0.6876759", "0.668349", "0.6652759", "0.6524627", "0.6486851", "0.6458928", "0.6369093", "0.6318907", "0.63048434", "0.63048434", "0.6228657", "0.62255156", "0.6187217", "0.6150898", "0.6125343", "0.6106216", "0.6079012", "0.6006821", "0.6005694", "0.59647846", "0.5926634", "0.59204954", "0.58880126", "0.5857008", "0.5846918", "0.5845319", "0.58402765", "0.58175606", "0.57926154", "0.57717395", "0.577039", "0.5769723", "0.575503", "0.5749493", "0.5747493", "0.57474715", "0.57474715", "0.573342", "0.57300675", "0.57178384", "0.5717092", "0.57126343", "0.570849", "0.57072645", "0.57046694", "0.56893426", "0.5675985", "0.56624544", "0.56540984", "0.56540984", "0.5653503", "0.56524813", "0.5643909", "0.56377053", "0.5632031", "0.5620825", "0.56204766", "0.5618794", "0.56184804", "0.56184804", "0.56184804", "0.561779", "0.56083804", "0.5607615", "0.5603361", "0.56007147", "0.55995554", "0.55801076", "0.5576839", "0.557529", "0.5571199", "0.5565899", "0.5562279", "0.5558009", "0.5553545", "0.5551104", "0.5528996", "0.55254185", "0.552088", "0.5502194", "0.54956275", "0.54951966", "0.548991", "0.548747", "0.54794633", "0.54767215", "0.5474974", "0.54722685", "0.54689574", "0.5459436", "0.54495484", "0.54462963" ]
0.5691583
53
Set the system properties collection
protected function setSystemProperties(SystemProperties $systemProperties, $overwrite = false) { $this->systemProperties = $systemProperties; $systemPropsState = spl_object_hash($this->systemProperties); // If the system property collection state has changed if (!$overwrite && !empty($this->collectionStates[SystemProperties::COLLECTION]) && ($systemPropsState !== $this->collectionStates[SystemProperties::COLLECTION]) ) { // Flag this object as mutated $this->setModifiedState(); } $this->collectionStates[SystemProperties::COLLECTION] = $systemPropsState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveAllSystemProperties()\n {\n $endpoint = self::$endpoint . '/properties';\n return self::sendRequest(Method::GET, $endpoint);\n }", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "public function setProperties(array $properties)\n\t{\n\t\t$this->sessions = $properties;\n\t}", "public function setSystem($system)\n {\n $this->system = $system;\n }", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "private function setServices(&$properties, $thisUrl, $collection) {\r\n \r\n if (!isset($properties['services'])) {\r\n $properties['services'] = array();\r\n }\r\n \r\n /*\r\n * Visualize\r\n */\r\n if (isset($properties['wms'])) {\r\n $this->setVisualizeService($properties, $collection);\r\n }\r\n \r\n /*\r\n * Download\r\n */\r\n if (isset($properties['resource'])) {\r\n $this->setDownloadService($properties, $thisUrl, $collection);\r\n }\r\n \r\n }", "function set_property(){\n }", "public function testGetSetSystemConfiguration()\n {\n $systemConfiguration = $this->service->getSystemConfiguration();\n $this->service->setSystemConfiguration($systemConfiguration);\n $this->assertSame($systemConfiguration, $this->service->getSystemConfiguration());\n }", "public function setRegistry()\n {\n $reg = controllers\\Registry::getInstance();\n foreach ($this->config as $key => $value)\n {\n $reg->setResource($key, $value, true);\n }\n\n\n }", "public function setProperties($properties)\n {\n\n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function setEnvironment();", "public function setSysconfigValue(&$object, $property, $value) {\n $current = [];\n $reflection = new ReflectionObject($object);\n $confs = $reflection->getProperty('__sys_conf_values__');\n $confs->setAccessible(true);\n $current = $confs->getValue($object);\n $current[$property] = $value;\n $confs->setValue($object, $current);\n return true;\n }", "private function api_set_properties( $properties ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// identify user first\n\t\t$this->set_named_identity( null );\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t// record the properties\n\t\t$this->get_api()->set( $properties );\n\t}", "function setToolSettings() {\n /*reserved for future use*/\n }", "public function set_props($args)\n {\n }", "function setPrivileges() {\n $this->Session->write('Privilege.User.id', $this->Session->read('Auth.User.id'));\n foreach(Configure::read('Privilege') as $entity => $privileges) {\n foreach($privileges as $key => $privilege) {\n $key = \"Club.\".Configure::read('Club.id').\".Privilege.$entity.$key\";\n $this->Session->write($key, $this->isAuthorized($privilege));\n }\n }\n }", "public function testOrgApacheSlingCaconfigImplOverrideSystemPropertyConfigurationOve()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.caconfig.impl.override.SystemPropertyConfigurationOverrideProvider';\n\n $crawler = $client->request('POST', $path);\n }", "public function __set($name, $value) {\n // almacenamos los valores atribuidos\n // el array properties\n $this->properties[$name] = $value;\n }", "public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}", "public function setProperties(array $properties);", "public function __construct()\n {\n $this->envKeys = new StringCollection();\n }", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "function site_properties()\n{\n\tglobal $mdb2;\n\n\t$query = \"\n\t\tSELECT *\n\t\tFROM iShark_Configs\n\t\";\n\t$result = $mdb2->query($query);\n\twhile ($row = $result->fetchRow(MDB2_FETCHMODE_ORDERED)) {\n\t\tforeach ($result->getColumnNames($result) as $colname => $key) {\n\t\t\t$_SESSION['site_'.$colname] = $row[$key];\n\t\t}\n\t}\n\t//a session erteket beallitjuk 0-ra, hogy ne kerdezze le ujra a tablat\n\tunset($_SESSION['is_siteprop_update']);\n\t$_SESSION['is_siteprop_update'] = 0;\n}", "public function setAutonomousSystem($val)\n {\n $this->_propDict[\"autonomousSystem\"] = $val;\n return $this;\n }", "protected function setAppSettings()\n {\n // set the application time zone\n date_default_timezone_set($this->config->get('app.timezone','UTC'));\n\n // set the application character encoding\n mb_internal_encoding($this->config->get('app.encoding','UTF-8'));\n }", "public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}", "public function setAll($array) {\n // this is a kind of bad because sesData is just a property with no protected or private config\n\n foreach($array as $k=>$v){\n if( stristr($k,self::SESSIONNAMESPACE)!==false ){\n $k = str_replace(self::SESSIONNAMESPACE, '', $k);\n $this->storeObject($v, $k);\n }\n }\n\n\t}", "abstract protected function propertySet($name, $value);", "public function setup()\n {\n \t// rtConfig::set('your-key', $your_value);\n }", "private function settingEnvironmentVariables()\r\n {\r\n \t$this->Queue->engineOut(\"Q install directory located at \" . getcwd());\r\n \t$this->Queue->engineOut(\"Q Engine Service starting\");\r\n \t$this->Queue->engineOut(\"Timezone set to $this->tz\");\r\n\r\n putenv(\"VL_ENGINE_SERVICE_PID=$this->pid\");\r\n putenv(\"VL_ENGINE_VERBOSE=\".$this->engineProperties['engineVerbose']);\r\n putenv(\"VL_SESSION_KEY=$this->sessionKey\");\r\n\r\n $this->Queue->engineOut(\"Engine session key: $this->sessionKey\");\r\n $this->Queue->engineOut(\"System configured for \".$this->engineProperties['engineCount'].\" concurrent engine processes.\");\r\n $this->Queue->engineOut(\"Job scan interval configured for \".$this->engineProperties['engineTickSec'].\" seconds.\");\r\n }", "function setProperty($name, $value) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n base_module_options::writeOption($this->moduleGuid, $name, $value);\n }", "public function setp($property, $value){\n //not working static fn if(property_exists('Config_allsites', $property)){\n if(property_exists($this, $property)){\n $this->$property = $value;\n }\n return $this;\n }", "function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }", "public function setSettings() {\n $args = array(\n array(\n 'option_group' => 'pm_plugin_settings',\n 'option_name' => 'pm_plugin',\n 'callback' => array($this->callbacks_mgr, 'checkboxSanitize'),\n )\n );\n $this->settings->setSettings($args);\n }", "public function __set( $name, $value )\n {\n\t\t\tif( property_exists( \"UserSVC\", $name ) )\n\t\t\t\t$this->$name = $value;\n }", "public static function setProperties(array $config)\r\n {\r\n foreach ($config as $k => $v) {\r\n $property = '_' . $k;\r\n self::$$property = $v;\r\n }\r\n }", "public function __construct()\n {\n $items = getenv();\n $this->set($items);\n }", "public function setSystem($value)\n {\n return $this->set(self::system, $value);\n }", "public function setSystem($params, $context)\n {\n $this->validateMethodContext($context, ['role' => OMV_ROLE_ADMINISTRATOR]);\n // Validate the parameters of the RPC service method.\n $this->validateMethodParams($params, 'rpc.wol.setsystem');\n // Prepare the configuration object.\n $object = new \\OMV\\Config\\ConfigObject('conf.service.wol.system');\n $object->setAssoc($params);\n // Set the configuration object.\n $isNew = $object->isNew();\n $db = \\OMV\\Config\\Database::getInstance();\n if (TRUE === $isNew) {\n // Check uniqueness - mac, ip\n $db->assertIsUnique($object, 'mac');\n $db->assertIsUnique($object, 'ip');\n }\n $db->set($object);\n // Return the configuration object.\n return $object->getAssoc();\n }", "private function setProperties($array)\n\t{\t\n\t\tif(is_array($array)){\n\t\t\tforeach($array as $key => $value)\n\t\t\t\t$this->$key = $value;\n\t\t}\n\t}", "private function setDefaults()\n {\n $defaults = config('sevDeskApi.defaults.'.lcfirst($this->objectName));\n\n foreach($defaults as $attribute => $defaultValue)\n {\n if (!isset($this->$attribute))\n $this->$attribute = $defaultValue;\n }\n }", "function setAdmin() {\n\t\t$this->_extension_high = \"\";\n\t\t$this->_extension_low = \"\";\n\t\t$this->_deptname = \"\";\n\t\t$this->_sections = array(\"*\");\n\t}", "public function propertySet($varname, $value)\n {\n $value = base64_encode($value);\n $this->run(\"property_set -i {id} -n \\${$varname} -- {$value}\");\n }", "public function setProperties(array $properties) \n\t{\n\t\tforeach ($properties as $name => $value) {\n\t\t\t$this->set($name, $value);\n\t\t}\n\t}", "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.ldap.setsettings\");\n\t\t// Prepare the configuration object.\n\t\t$object = new \\OMV\\Config\\ConfigObject(\"conf.service.ldap\");\n\t\t$object->setAssoc($params);\n\t\t// Set the configuration object.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$db->set($object);\n\t\t// Return the configuration object.\n\t\treturn $object->getAssoc();\n\t}", "public function flushProperties()\n\t{\n\t\t$this->properties = array();\n\t}", "protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }", "public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }", "public function setEnvironment($environmentVars);", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "public function __set($name, $value){\r\n echo \"You are trying to direct set property \".$name.\" to value \".$value.\" and thats not possible use set\".$name.\"(\\$value) method.\";\r\n echo \"<br/> At line \".__LINE__.\" in file \".__FILE__;\r\n }", "private function _getSettings()\n {\n $properties = $this->_class->getProperties();\n foreach ($properties as $property) {\n $prop = new Property($property);\n $prop->fillSettings($this->_reflect);\n }\n if (empty($this->_reflect->listField)) {\n $keys = array_keys($this->_reflect->fields);\n $this->_reflect->listField = array_shift($keys);\n }\n $this->_reflect->fieldNames = array_keys($this->_reflect->fields);\n }", "public function set_properties( $args ) {\n\n\t\t// Reset default property values\n\t\t$reset = array(\n\t\t\t'debug_mode' => false,\n\t\t\t'parant_plugin_slug' => '',\n\t\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/wordpress-plugins.php',\n\t\t);\n\n\t\t// Define properties\n\t\tforeach ( $reset as $name => $default ) {\n\n\t\t\tif ( array_key_exists( $name, $args ) ) {\n\t\t\t\t// If set, use defined values\n\t\t\t\t$this->{$name} = $args[$name];\n\t\t\t} else {\n\t\t\t\t// If not set, use default values\n\t\t\t\t$this->{$name} = $default;\n\t\t\t}\n\n\t\t}\n\n\t}", "function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}", "public function setTicketSystem(?string $value): void {\n $this->getBackingStore()->set('ticketSystem', $value);\n }", "public function reset()\n {\n $this->values[self::_SYSTEM_SETTING_ITEM] = array();\n }", "public function setProperty($key, $value);", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}", "public function setProperties(array $properties)\n {\n $this->properties = $properties;\n }", "public function __set($name, $value)\r\n\t{\r\n\t\t$this->Properties[$name] = $value;\r\n\t}", "public function setSettingsAttribute( $settings ){\n\n \t$base = self::$base_settings;\n $result = array();\n\n \tforeach ($base as $key => $value) { //for each key in the base\n $result[$key] = $settings; //$base[$key]['value'];\n \t\tif ( isset($settings[$key]) ){\n \t\t\t$result[$key] = $settings[$key];\n \t\t}\n \t}\n\n \t\t$this->attributes['settings'] = json_encode($result);\n }", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "protected function setUsers()\n {\n $this->users = new Users;\n $this->users->read();\n \n $this->data['users'] = $this->users;\n }", "function wp_set_all_user_settings($user_settings)\n {\n }", "public function setProperties(array $properties): void\n {\n $this->properties = $properties;\n }", "function setValues($array){\r\n\t\tforeach($array as $key => $val)\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t}", "public function setProperties(array $data)\n {\n $this->properties = $data;\n }", "protected function setEnvironmentOptions():void\n {\n //Checks env status and sets cache and debug attributes for instance of Twig Environment\n if($this->env == self::PRODUCTION_ENV)\n {\n $twigEnvironmentOptions = [\n 'cache' => $GLOBALS['cacheDirectory'],\n 'debug' => false,\n 'charset' => $GLOBALS['charset']\n ];\n }\n\n else\n {\n $twigEnvironmentOptions = [\n 'cache' => false,\n 'debug' => true,\n 'charset' => $GLOBALS['charset']\n ];\n }\n\n $this->environmentOptions = $twigEnvironmentOptions;\n }", "public function setProperties($properties)\r\n {\r\n if (!empty($properties)) {\r\n foreach ($properties as $key => $val) {\r\n $this->$key = $val;\r\n }\r\n }\r\n }", "public function system_preference($method='system_list')\n {\n System_helper::system_preference($method);\n }", "function setProperties($properties) {\n\t\t$properties = ( array ) $properties; //cast to an array\n\n\t\tif (is_array ( $properties )) {\n\t\t\tforeach ( $properties as $k => $v ) {\n\t\t\t\t$this->$k = $v;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }", "public function __set($property, $value) {}", "function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }", "private function setOptions()\n {\n $this->clientId = $this->config['stravaSettings']['clientId'];\n $this->clientSecret = $this->config['stravaSettings']['clientSecret'];\n $this->redirectUri = $this->config['stravaSettings']['redirectUri'];\n $this->aprovalPrompt = $this->config['stravaSettings']['approval_prompt'];\n $this->scopes = $this->config['stravaSettings']['scopes'];\n }", "function setSystemConfig() {\n global $_ARRLANG, $_CONFIG, $arrLanguages, $language;\n\n $userLangId = \"\";\n foreach ($arrLanguages as $langId => $arrLanguage) {\n if ($language == $arrLanguage['lang']) {\n $userLangId = $langId;\n break;\n }\n }\n\n $statusMsg = \"\";\n\n $objDb = $this->_getDbObject($statusMsg);\n if ($objDb === false) {\n return $statusMsg;\n } else {\n // deactivate all languages\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"languages`\n SET `frontend` = '0', `backend` = '0', `is_default` = 'false'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_DEACTIVATE_UNUSED_LANGUAGES'].\"<br />\";\n }\n \n // activate german and set it to default\n $query = '\n UPDATE `'.$_SESSION['installer']['config']['dbTablePrefix'].'languages`\n SET `frontend` = 1, backend = 1, `is_default` = \"true\"\n WHERE `lang` = \"de\"\n ';\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_ACTIVATE_DEFAULT_LANGUAGE'].\"<br />\";\n }\n\n // activate english\n $query = 'UPDATE `'.$_SESSION['installer']['config']['dbTablePrefix'].'languages`\n SET `frontend` = \"1\", `backend` = \"1\" WHERE `lang` = \"en\"';\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_ACTIVATE_CURRENT_LANGUAGE'].\"<br />\";\n }\n\n // set admin email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `setname` = 'coreAdminEmail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n\n // set admin name\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminName'].\"'\n WHERE `setname` = 'coreAdminName'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_NAME'].\"<br />\";\n }\n\n if (($arrTables = $objDb->MetaTables('TABLES')) === false) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_GATHER_ALL_DATABASE_TABLES'].\"<br />\";\n return $statusMsg;\n }\n\n // set access emails\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"access_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `key` = 'notification_address'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"access_user_mail`\n SET `sender_mail` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_ADMIN_EMAIL'].\"<br />\";\n }\n\n // set newsletter emails\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings\", $arrTables)) {\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `setname` = 'sender_mail' OR `setname` = 'reply_mail' OR `setname` = 'test_mail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_NEWSLETTER_EMAILS'].\"<br />\";\n }\n\n // set newsletter name\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_newsletter_settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['adminName'].\"'\n WHERE `setname` = 'sender_name'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_NEWSLETTER_SENDER'].\"<br />\";\n }\n }\n\n // set contact email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['contactEmail'].\"'\n WHERE `setname` = 'contactFormEmail'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_contact_form`\n SET `mails` = '\".$_SESSION['installer']['sysConfig']['contactEmail'].\"'\n WHERE `id` = 1\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n\n // set domain url\n if (preg_match('#^https?://#', $_SESSION['installer']['sysConfig']['domainURL'])) {\n $statusMsg .= $_ARRLANG['TXT_SET_VALID_DOMAIN_URL'];\n } else {\n if (substr($_SESSION['installer']['sysConfig']['domainURL'], -1) == '/') {\n $_SESSION['installer']['sysConfig']['domainURL'] = substr($_SESSION['installer']['sysConfig']['domainURL'], 0, -1);\n }\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['domainURL'].\"'\n WHERE `setname` = 'domainUrl'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_DOMAIN_URL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_config\", $arrTables)) {\n // set shop email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_config`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\n WHERE `name` = 'email' OR `name` = 'confirmation_emails' OR `name` = 'paypal_account_email'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_mail_content\", $arrTables)) {\n // set shop email\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_shop_mail_content`\n SET `from_mail` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n if (in_array($_SESSION['installer']['config']['dbTablePrefix'].'module_egov_products', $arrTables)) {\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_egov_products`\n SET `product_target_email` = '\".$_SESSION['installer']['sysConfig']['adminEmail'].\"'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_CONTACT_EMAIL'].\"<br />\";\n }\n }\n\n $_SESSION['installer']['sysConfig']['iid'] = $this->updateCheck();\n\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$_SESSION['installer']['sysConfig']['iid'].\"'\n WHERE `setname` = 'installationId'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_INSTALLATIONID'].\"<br />\";\n }\n\n $arrTimezones = timezone_identifiers_list();\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"settings`\n SET `setvalue` = '\".$arrTimezones[$_SESSION['installer']['config']['timezone']].\"'\n WHERE `setname` = 'timezone'\";\n if (!@$objDb->Execute($query) || (!isset($_SESSION['installer']['config']['timezone']) && !isset($arrTimezones[$_SESSION['installer']['config']['timezone']]))) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_TIMEZONE'].\"<br />\";\n }\n\n /*\n // set rss title\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_news_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['rssTitle'].\"'\n WHERE `name` = 'news_feed_title'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_RSS_TITLE'].\"<br />\";\n }\n\n // set rss description\n $query = \"UPDATE `\".$_SESSION['installer']['config']['dbTablePrefix'].\"module_news_settings`\n SET `value` = '\".$_SESSION['installer']['sysConfig']['rssDescription'].\"'\n WHERE `name` = 'news_feed_description'\";\n if (!@$objDb->Execute($query)) {\n $statusMsg .= $_ARRLANG['TXT_COULD_NOT_SET_RSS_DESCRIPTION'].\"<br />\";\n }\n */\n }\n\n if (isset($_SESSION['installer']['config']['cachingByDefault']) && $_SESSION['installer']['config']['cachingByDefault']) {\n // configure caching\n $this->configureCaching();\n }\n\n if (empty($statusMsg)) {\n return $this->_createSettingsFile();\n } else {\n return $statusMsg;\n }\n }", "function cbstdsys_init(){\n\tregister_setting( 'cbstdsys_plugin_options', 'cbstdsys_options', 'cbstdsys_validate_options' );\n}", "public function init_settings()\n {\n /** @noinspection PhpUndefinedClassInspection */\n parent::init_settings();\n\n $sharedOptions = get_option(SharedPersistor::OPTION_NAME, []) ?: [];\n $this->settings = array_merge($this->settings, $sharedOptions);\n }", "function setDbcoll($collection){\n $this->collection = $collection;\n $this->dbdotcoll = $this->mdb.'.'.$this->collection;\n }", "public function setup()\n {\n $_SESSION = array();\n $_SESSION['security'] = array(\n 'user-agent' => md5(empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']),\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'start' => time()\n );\n $_SESSION['stores'] = array();\n }", "public static function setEnvironnement()\n\t{\n\t\tUz_Autoloader::init(array(static::$framework_namespace=>$framework_path, static::$application_namespace=>static::$application_path),static::$framework_namespace,array());\n\t\t//On construit la session\n\t\tUz_Service_HTTP_Session::build();\n\t\t//On recupere la requete dans cet objet\n\t\tUz_Service_HTTP_Request::build();\n\t\tUz_Controller_Dispatcher::init(static::$application_namespace);\n\t\tUz_Mapper_Generic::init(static::configureDb());\n\t\t\n\t}", "public function set_plugin_properties() {\n $this->plugin\t= get_plugin_data( SALESFORCE__PLUGIN_FILE );\n $this->basename = plugin_basename( SALESFORCE__PLUGIN_FILE );\n $this->active\t= is_plugin_active( $this->basename );\n }", "private function config_OSF_PermissionsManagementTool()\n {\n // Get package info\n $configPath = \"{$this->permissions_management_tool_folder}\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n // OSF Web Service paths\n $this->setIni(\"config\", \"osfWebServicesFolder\", \"\\\"{$this->osf_web_services_folder}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"config\", \"osfWebServicesEndpointsUrl\", \"\\\"http://{$this->osf_web_services_domain}/ws/\\\"\",\n \"{$configPath}/pmt.ini\");\n // OSF Web Service credentials\n $this->setIni(\"credentials\", \"application-id\", \"\\\"{$this->application_id}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"api-key\", \"\\\"{$this->api_key}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"user\", \"\\\"http://{$this->osf_web_services_domain}/wsf/users/admin\\\"\",\n \"{$configPath}/pmt.ini\");\n }", "protected function _setSystem()\n { $dirs = array(\n // symlink solar\n \"/source/solar/script/solar\",\n // symlink vendor\n \"/source/{$this->_vendor}/script/{$this->_vendor}\",\n // copy solar\n \"/script/solar\",\n // copy vendor\n \"/script/{$this->_vendor}\",\n );\n\n $this->_system = false;\n $file = __FILE__;\n foreach ($dirs as $dir) {\n // make comparison windows-friendly\n $dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);\n $len = -1 * strlen($dir);\n if (substr($file, $len) == $dir) {\n $this->_system = substr($file, 0, $len);\n break;\n }\n }\n }", "function __set($name,$value) {\n\t\t$this->object[$name]=$value;\n\t}", "private function js_set_properties( $properties = array() ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t$properties = json_encode( $properties );\n\n\t\techo '<script type=\"text/javascript\">' . \"_kmq.push(['set', {$properties}]);\" . \"</script>\";\n\t}", "private function set_properties($properties=array()){\n\n if ((!isset($properties)) || (!is_array($properties))){\n $properties=$this->$properties;\n return $properties;\n }\n else\n {\n $this->$properties=$properties; //set object properties\n }\n\n }", "public function set($config){\n\t\t$this->configValues = $config;\n\t}", "public function setSettings($params, $context)\n\t{\n\t\tglobal $xmlConfig;\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, array(\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, '{\n\t\t\t \"type\":\"object\",\n\t\t\t \"properties\":{\n\t\t\t\t \"enable\":{\"type\":\"boolean\"},\n\t\t\t\t \"basedn\":{\"type\":\"string\"},\n \"rootbindcn\":{\"type\":\"string\"},\n \"rootbindpw\":{\"type\":\"string\"},\n \"usersuffix\":{\"type\":\"string\"},\n \"groupsuffix\":{\"type\":\"string\"}\n\t\t\t }\n\t\t }');\n\t\t// Prepare the configuration object.\n\t\t$object = array(\n\t\t\t\"enable\" => array_boolval($params, 'enable'),\n\t\t\t\"basedn\" => trim($params['basedn']),\n \"rootbindcn\" => trim($params['rootbindcn']),\n \"rootbindpw\" => trim($params['rootbindpw']),\n \"usersuffix\" => trim($params['usersuffix']),\n \"groupsuffix\" => $params['groupsuffix'],\n\t\t);\n \n //We need to set the ldap client to use the new ldap server information\n //if the ldap server is enabled\n if($object['enable']){ \n $xpath = \"//services/ldap\";\n $ldapclientObject = $xmlConfig->get($xpath);\n $ldapclientObject['enable'] = 1; //if server is enabled, client should connect to it\n $ldapclientObject['host'] = \"localhost\";\n $ldapclientObject['base'] = $object['basedn'];\n $ldapclientObject['rootbinddn'] = $object['rootbindcn'].\",\".$object['basedn'];\n $ldapclientObject['rootbindpw'] = $object['rootbindpw'];\n $ldapclientObject['usersuffix'] = $object['usersuffix'];\n $ldapclientObject['groupsuffix'] = $object['groupsuffix'];\n if (FALSE === $xmlConfig->replace($xpath, $ldapclientObject)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n }\n \n // Update the configuration file. If it fails it throws an exception.\n $xpath = \"//services/ldapserver\";\n if (FALSE === $xmlConfig->replace($xpath, $object)) {\n throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED);\n }\n \n\t\t// Notify configuration changes.\n\t\t//\n\t\t// This will notify event listeners such as the service module\n\t\t// to perform certain tasks. The most common one is to mark the\n\t\t// service as dirty.\n $dispatcher = &OMVNotifyDispatcher::getInstance();\n $dispatcher->notify(OMV_NOTIFY_MODIFY,\n \"org.openmediavault.services.ldapserver\", $object);\n\n\t\treturn $object;\n\t}", "public function setOptions($options)\n {\n $this->options = [\n 'config_dir' => null,\n 'cache_dir' => null,\n 'debug' => false,\n 'cache_class' => 'WebspaceCollectionCache',\n 'base_class' => 'WebspaceCollection',\n ];\n\n // overwrite the default values with the given options\n $this->options = \\array_merge($this->options, $options);\n }", "function setSyncProdDesc()\n {\n }", "public function setReadOnly()\n {\n $this->_allowModifications = false;\n foreach ($this->_data as $key => $value) {\n if ($value instanceof Zend_Config) {\n $value->setReadOnly();\n }\n }\n }", "function set_user_setting($name, $value)\n {\n }", "public function system_init() {\n }", "public function setProviders()\n {\n $services = $this->container['services']??null;\n\n if (is_array($services)) {\n foreach ($services as $service) {\n $service::register($this->container);\n $service::boot($this->container);\n }\n }\n }", "public function __set($name, $value) { \n $this->setAzureProperty($name, $value, null);\n }", "function setProperty($key ='', $value ='') {\r\r\n \r\r\n return ( array_key_exists($key, $this->_timezone) ? ($this->_timezone[$key] = $value) : false );\r\r\n }" ]
[ "0.59989345", "0.5547257", "0.55258924", "0.55180657", "0.54616874", "0.5418773", "0.53943336", "0.53902966", "0.53091383", "0.5307521", "0.53021973", "0.5284867", "0.5284645", "0.5283715", "0.5276692", "0.52700996", "0.5268349", "0.52508044", "0.5238927", "0.51487905", "0.51454276", "0.51110893", "0.5096199", "0.50519085", "0.5049569", "0.5043348", "0.503215", "0.50319725", "0.50318193", "0.50267076", "0.50216633", "0.5014775", "0.49900168", "0.498909", "0.49777472", "0.4973251", "0.49728277", "0.49716654", "0.49681163", "0.49676275", "0.49619222", "0.4954063", "0.4951091", "0.4947825", "0.49321368", "0.49225575", "0.49120545", "0.48880318", "0.48878795", "0.48818138", "0.4878349", "0.48717168", "0.4870185", "0.48505697", "0.48497254", "0.48473954", "0.48390374", "0.48295283", "0.4827552", "0.4814019", "0.4813117", "0.48102674", "0.48032042", "0.48011446", "0.48011446", "0.47993112", "0.47951636", "0.4789834", "0.47880483", "0.47858408", "0.47836363", "0.47828767", "0.47735548", "0.47712955", "0.4771253", "0.47685876", "0.47631723", "0.4762941", "0.47619256", "0.47209725", "0.47185475", "0.47178578", "0.47165117", "0.47130895", "0.4707166", "0.47005966", "0.4697003", "0.46957034", "0.4690065", "0.46898592", "0.4686421", "0.46859622", "0.46826658", "0.46722502", "0.46705458", "0.466503", "0.46638507", "0.4663034", "0.46616718", "0.46591732" ]
0.6809005
0
Set the object state to modified
abstract protected function setModifiedState();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }", "function modified() { $this->_modified=1; }", "function modified() { $this->_modified=1; }", "function resetModified() { $this->_modified = 0; }", "function resetModified() { $this->_modified = 0; }", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "public function setChanged()\n {\n\n $this->_changed = true;\n\n }", "public function touch()\n {\n $this->_factory->markAsModified($this);\n }", "public static function __set_state($data);", "abstract public function setState() ;", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "public function testSetState()\n\t{\n\t\t$state = $this->getMockForAbstractClass('PNEngineState', array($this->object));\n\n\t\t$this->object->setState($state);\n\n\t\t$this->assertEquals($state, TestReflection::getValue($this->object, 'state'));\n\t}", "function setState($newState){\n $this->state = $newState;\n }", "private function changed()\n {\n $this->isDirty = true;\n }", "abstract public function change();", "protected function resetCleanState()\n {\n $this->isModified = false;\n }", "public function setModified($value) {}", "public function setObject(object $object): void;", "public function modify();", "public function setDirtyState($dirtyState) {}", "public function setModified($modified);", "public function update( &$object );", "public function markUnchanged();", "function setObject($object);", "public function setState($state){\r\n $this->$state = $state;\r\n }", "public function setAsModified($name = NULL);", "public final function setImmutable()\n {\n $this->isImmutable = true;\n }", "function OzState() {$this->reset();}", "public static function __set_state(array $properties);", "public function clearChangedState()\n {\n\n $this->_changed = false;\n\n }", "function set_obj(&$obj)\n{\n\t$this->_obj = $obj;\n}", "public function setChanged($changed = true) { $this->changed = $changed; }", "public function resetDirty()\n {\n $this->dirty = false;\n $this->dirtyOne = false;\n $this->dirtyMany = false;\n }", "function setModified( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Modified = ( $value );\n }", "private function reset_state() {\n\n\t\t\tglobal $ld_qs_api_vars;\n\t\t\t/**\n\t\t\t * Reset the state only if we have some data in memory upfront\n\t\t\t * because embed will be called only when there is valid data\n\t\t\t * available in memory.\n\t\t\t */\n\t\t\tif ( ! empty( $this->stat_refs ) ) {\n\t\t\t\t$GLOBALS['ld_qs_api_vars'] = $ld_qs_api_vars ? $ld_qs_api_vars : array();\n\t\t\t\t$object_vars = get_object_vars( $this );\n\t\t\t\t$GLOBALS['ld_qs_api_vars'][] = $object_vars;\n\n\t\t\t\tforeach ( $object_vars as $property => $var ) {\n\n\t\t\t\t\tswitch ( gettype( $var ) ) {\n\n\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t$this->$property = 0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t\t$this->$property = '';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t\t$this->$property = array();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->$property = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function _isDirty() ;", "public function markAsSwapped()\n {\n // Clear LOADED state bit\n $this->_state |= self::LOADED;\n }", "public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}", "static function setDirty($a_obj_id)\n\t{\n\t\tglobal $ilDB;\n\t\n\t\t$ilDB->manipulate(\"UPDATE ut_lp_marks SET \".\n\t\t\t\" status_dirty = \".$ilDB->quote(1, \"integer\").\n\t\t\t\" WHERE obj_id = \".$ilDB->quote($a_obj_id, \"integer\")\n\t\t\t);\n\t}", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "public function setState($state){\n $this->state=$state;\n }", "public function testSetHeaterState()\n {\n }", "public function setModifierObject($object)\n {\n $this->m_modifierObject = $object;\n }", "public function setState($value) {\n\t\tself::$_state = $value;\n\t}", "public function __wakeup()\n\t{\n\t $this->boolTrain = FALSE;\n\t}", "public function __wakeup() {\n $this->current = 0;\n }", "final public function __clone()\n {\n $this->aliased = false;\n }", "abstract public function set();", "protected function _resetModifiedAttributesFlags() {\n\t\t$this->_modifiedAttributes = array();\n\t}", "public function update($object): void;", "public function __clone()\n {\n $this->reset(TRUE);\n }", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public function setState($state)\r\n {\r\n $this->_state = $state;\r\n }", "public function setModifiedAt()\n {\n $this->modifiedAt = new \\DateTime();\n }", "private function restore_state() {\n\t\t\tglobal $ld_qs_api_vars;\n\n\t\t\tif ( is_array( $ld_qs_api_vars ) && count( $ld_qs_api_vars ) ) {\n\t\t\t\t$recent_state = array_pop( $ld_qs_api_vars );\n\n\t\t\t\tforeach ( $recent_state as $property => $val ) {\n\t\t\t\t\t$this->$property = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function updatedStateEmployee(){\n $this->clearTime();\n }", "public function update_object ($obj)\n {\n parent::update_object ($obj);\n $this->access_id = $obj->id;\n }", "public function update_object ($obj)\n {\n parent::update_object ($obj);\n $this->access_id = $obj->id;\n }", "public function replace() {\r\n//primary use is update the status when 'falling through' the state gate\r\n//instead of returning to the executive\r\n\t$clone = clone($this);\r\n\t$_SESSION[\"STATE\"][$this->thread][$this->position] = serialize($clone);\r\n}", "function setStatusModified( $timestamp )\n {\n $this->StatusModified = $timestamp;\n }", "public function setState($state) {\n\t\t$this->state = $state;\n\t}", "function setModified($inModified = true) {\n\t\tif ( $inModified !== $this->_Modified ) {\n\t\t\t$this->_Modified = $inModified;\n\t\t}\n\t\treturn $this;\n\t}", "public function setDirtyState(int $dirtyState);", "public function testSet()\n {\n $object = new \\Webaholicson\\Minimvc\\Core\\Object(['test' => true]);\n $this->assertTrue($object->get('test'));\n $this->assertSame($object, $object->set('test', false));\n $this->assertFalse($object->get('test'));\n $object->set(['node' => ['test' => false]]);\n $this->assertContains(false , $object->get('node'));\n }", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "private function setObject($object) {\n $this->object = $object;\n }", "public function _isDirty() {}", "public function setState($s) {\n\t\t$this->state=!!$s;\n\t\tself::save();\n\t\treturn $this;\n\t}", "public static function reassign() {\n\n\t\t}", "public static function __set_state(array $array): static;", "function setImmutable($immutable) {\n $this->immutable = $immutable;\n }", "protected function _store_to_object ($obj)\n {\n parent::_store_to_object ($obj);\n \n switch ($this->value_for ('state'))\n {\n case Testing:\n $obj->test (Defer_database_update);\n break;\n case Shipped:\n $obj->ship (Defer_database_update);\n break;\n case Locked:\n $obj->lock (Defer_database_update);\n break;\n }\n }", "public function __clone()\n {\n $this->_objectTag = clone $this->_objectTag;\n }", "public function setObject($object) {\n $this->object = $object;\n }", "public function updateState($state);", "public abstract function update($object);", "public function setState($state) {}", "protected function _changed()\n {\n // Clean up caches\n $this->_subClasses = array();\n $this->_notSubClasses = array();\n }", "function __set($name,$value) {\n\t\t$this->object[$name]=$value;\n\t}", "public function cleanState()\n {\n $this->state = array();\n $this->saveState();\n }", "public function clearModified()\n\t{\n\t\t$this->_modified = array();\n\t}", "public function setObject(object $object): self;", "public function mutate();", "public function mutate();", "public function __clone()\n\t{\n\t\t$this->resetState($this->getPivot());\n\t}", "protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }", "public static function __set_state(array $array)\r\n {\r\n return parent::__set_state($array);\r\n }", "public function setState($state);", "public function operationChangeState($context)\n {\n $this->operationInterface($context);\n $this->ChangeState($context,new ConcreteStateA());\n }", "public function __wakeup() {\n if (!$this->isDependant) {\n $this->isDependant = false;\n }\n }", "public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}", "public function applyState(StateContract $state): void\n {\n $this->state = $state->toArray();\n }", "public function setActive() {}", "protected function setState($state)\n {\n if (! $this->hasState($state)) {\n throw new SMException(sprintf(\n 'Cannot set the state to \"%s\" to object \"%s\" with graph %s because it is not pre-defined.',\n $state,\n get_class($this->object),\n $this->config['graph']\n ));\n }\n\n $accessor = new PropertyAccessor();\n $accessor->setValue($this->object, $this->config['property_path'], $state);\n }", "public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}", "protected function resetProperties() {}", "public static function __set_state(array $_array,$_className = __CLASS__)\n {\n return parent::__set_state($_array,$_className);\n }" ]
[ "0.70076203", "0.6840151", "0.67913073", "0.6617337", "0.6614024", "0.6614024", "0.66109526", "0.66109526", "0.660026", "0.6573943", "0.65436834", "0.6500791", "0.62912333", "0.62900126", "0.6235461", "0.62232673", "0.62158406", "0.6174296", "0.6171379", "0.6151638", "0.6104029", "0.60646087", "0.60380626", "0.6032861", "0.6030201", "0.6020967", "0.5991558", "0.59312373", "0.5891814", "0.5872416", "0.58603096", "0.58577496", "0.58514446", "0.58244103", "0.5822991", "0.5799187", "0.57989097", "0.579481", "0.5772822", "0.5750976", "0.5744106", "0.57285154", "0.5712182", "0.5696521", "0.5688053", "0.5678854", "0.5673224", "0.5668042", "0.5664679", "0.56591946", "0.56529355", "0.5646296", "0.56443", "0.5639755", "0.56396794", "0.56314784", "0.5628566", "0.5620039", "0.5607673", "0.56043565", "0.56043565", "0.5587148", "0.5571479", "0.5561677", "0.5551571", "0.5551042", "0.55507016", "0.5546975", "0.55367875", "0.5527488", "0.5505167", "0.5504556", "0.5501448", "0.5498471", "0.5478136", "0.54776686", "0.54707724", "0.5469783", "0.54637164", "0.54545534", "0.54403967", "0.54382193", "0.5428663", "0.54174334", "0.54155767", "0.5399736", "0.5399736", "0.5399694", "0.53985804", "0.5387857", "0.53864396", "0.53808177", "0.5378491", "0.5374816", "0.534942", "0.53490686", "0.53438526", "0.5339508", "0.53344154", "0.5333731" ]
0.7643002
0
Insert new user info
public function add($user){ $this->builder->insert($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function insertUser($data) {\n\t\t\n\t\t\n\t}", "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "function register_user($new) {\n \n $this->db->insert('users', $new);\n }", "public function insert_user($data)\n\t{\n\n\t\t/**\n\t\t * Insert all the form information in the user table\n\t\t */\n\t\t$this->db->insert(\"users\", $data);\n\n\t}", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "public function insertUser($params) {\n\n\t}", "public function insertUser($userinfo){\n\t\t$nowtime = NOWTIME;\n\t\t$nickname = isset($userinfo->nickname) ? $userinfo->nickname : '';\n\t\t$sex = isset($userinfo->sex) ? $userinfo->sex : '';\n\t\t$city = isset($userinfo->city) ? $userinfo->city : '';\n\t\t$province = isset($userinfo->province) ? $userinfo->province : '';\n\t\t$country = isset($userinfo->country) ? $userinfo->country : '';\n\t\t$headimgurl = isset($userinfo->headimgurl) ? $userinfo->headimgurl : '';\n $sql = \"INSERT INTO `user` SET `openid` = ?, `nickname` = ?, `sex` = ?, `city` = ?, `province` = ?, `country` = ?, `headimgurl` = ?, `created` = ?, `updated` = ?\";\n $res = $this->connect()->prepare($sql);\n $res->bind_param(\"sssssssss\", $userinfo->openid, $nickname, $sex, $city, $province, $country, $headimgurl, $nowtime, $nowtime);\n\t\tif($res->execute()) \n\t\t\treturn $this->findUserByOpenid($userinfo->openid);\n\t\telse \n\t\t\treturn FALSE;\n\t}", "public function user_insert($data = array())\n\t{\n\t\t// Hashed password should not get logged\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_insert', $data);\n\t}", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "public function m_insert_supervisor_user(){\n $this->FirstName = $_POST['FirstName'];\n $this->LastName = $_POST['LastName'];\n $this->EmailPN = $_POST['EmailPN'];\n $this->Password = password_hash($_POST['Password'], PASSWORD_DEFAULT);\n //insert value to users table\n $this->db->insert('users', $this);\n }", "public function insert_user_details($data)\n\t{\n\t\t\t\n\t\t$this->db->insert('ag_users', $data);\n\t\n\t}", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "function insert_users_info($data = array()) {\n $data += array(\n \"created_on\" => $this->current_dts,\n );\n return $this->create_data($data);\n }", "function insertPersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//setting user full name\n\t\t\t$name = $userData['f_name'].\" \".$userData['l_name'];\n\t\t\t//profile creation date\n\t\t\t$profile_creation_date = $this->getCurrentDate();\n\t\t\t//last updation date\n\t\t\t$last_updation_date = $this->getCurrentDate();\n\t\t\t//column name for insertion\n\t\t\t$column_name = array(\"user_id\",\"name\",\"gender\",\"dob\",\"contact_no\",\"addr_line1\",\"addr_line2\",\"pincode\",\"city\",\"state\",\"country\",\"profile_creation_date\",\"last_upgradation_date\");\n\t\t\t//column value for insertion\n\t\t\t$column_value = array($user_id,$name,$userData['gender'],$userData['dob'],$userData['contact'],$userData['add1'],$userData['add2'],$userData['pin'],$userData['city'],$userData['state'],$userData['country'],$profile_creation_date,$last_updation_date);\n\t\t\t//insert the values to user info table\n\t\t\t$insert = $this->manageContent->insertValue(\"user_info\",$column_name,$column_value);\n\t\t\treturn $insert;\n\t\t}", "function addUser($data)\n { \n $this->query(\"INSERT INTO `{$this->userTable}` (`{$this->tbFields1['first_name']}`, `{$this->tbFields1['last_name']}`, `{$this->tbFields1['gender']}`, `{$this->tbFields1['dob']}`, `{$this->tbFields1['telephone']}`, `{$this->tbFields1['fax']}`, `{$this->tbFields1['email']}`, `{$this->tbFields1['newsletter_flag']}`, `{$this->tbFields1['password']}`, `{$this->tbFields1['date_created']}`) VALUES ('\".$data[$this->dataFields['first_name']].\"', '\".$data[$this->dataFields['last_name']].\"', '\".$data[$this->dataFields['gender']].\"', '\".$data[$this->dataFields['dob']].\"', '\".$data[$this->dataFields['telephone']].\"', '\".$data[$this->dataFields['fax']].\"', '\".$data[$this->dataFields['email']].\"', '\".$data[$this->dataFields['newsletter_flag']].\"', '\".$data[$this->dataFields['password']].\"', CURRENT_TIMESTAMP)\"); \n \n $data[$this->dataFields['customer_id']] = mysql_insert_id($this->dbConn);\n \n if($data[$this->dataFields['address']] != \"\"){\n $this->addAddress($data);\n }\n \n }", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "function newUser($data){\n\t\t$this->db->insert('usuarios', array(\n\t\t\t\t\t\t\t\t\t\t\t'rol' \t\t=> $data['rol'],\n\t\t\t\t\t\t\t\t\t\t\t'nombre' \t=> $data['nombre'],\n\t\t\t\t\t\t\t\t\t\t\t'empresa' \t=> $data['empresa'],\n\t\t\t\t\t\t\t\t\t\t\t'direccion' => $data['direccion'],\n\t\t\t\t\t\t\t\t\t\t\t'tel' \t\t=> $data['tel'],\n\t\t\t\t\t\t\t\t\t\t\t'cif' \t\t=> $data['cif'],\n\t\t\t\t\t\t\t\t\t\t\t'mail' \t\t=> $data['mail'],\n\t\t\t\t\t\t\t\t\t\t\t'password' \t=> $data['password']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t}", "public function creer(){ /*** Cree un utilisateur par insertion d'un tuple dans la table UserTab ***/\r\n \r\n \r\n // $this -> setInscrit(1);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n\t\t\t\r\n }", "private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE USERS SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", FIRST_NAME = \"%s\", LAST_NAME = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive,\n $this->id);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO USERS (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, FIRST_NAME, LAST_NAME, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %d)',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function insert()\n { if (!is_null($this->id))\n trigger_error(\"User::insert(): Attempt to insert a User object that already has its ID property set (to $this->id).\", E_USER_ERROR); \n // Insert the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"INSERT INTO users ( user_name, user_password_hash, user_email, orcid, orcid_code, orcid_access_token ) VALUES ( :user_name , :user_password_hash , :user_email, :orcid, :orcid_code, :orcid_access_token)\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n\t$st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR); \n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR); \n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR); \n $st->execute();\n $this->id = $conn->lastInsertId();\n $conn = null;\n return $this->id;\n }", "function registerUser($data){\n\t\t\tprint($this->db->insert('users', $data));\n\t\t}", "public function addUser(){}", "public function addUser($input) {\n $sql = \"INSERT INTO \n usertable (username, password, type, email, firstname, lastname) \n VALUES (:username, :password, :type, :email, :firstname, :lastname)\";\n\n $stmt = $this->db_connect->prepare($sql);\n $stmt->bindParam(':username', $input->getUserName(), PDO::PARAM_STR);\n $stmt->bindParam(':password', $input->getUserPassword(), PDO::PARAM_STR);\n $stmt->bindParam(':type', $input->getUserType(), PDO::PARAM_STR);\n $stmt->bindParam(':email', $input->getUserEmail(), PDO::PARAM_STR);\n $stmt->bindParam(':firstname', $input->getFirstname(), PDO::PARAM_STR);\n $stmt->bindParam(':lastname', $input->getLastname(), PDO::PARAM_STR);\n\n $stmt->execute();\n// echo 'User Registered.';\n\n $username = $input->getUserName();\n $sql = \"SELECT * FROM usertable WHERE username = '$username'\";\n foreach (parent::$this->db_connect->query($sql) as $row) {\n $custController = new profile_controller();\n $custController->newProfile($row['userid']);\n }\n }", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "public function createNewUserInfo($payload){\n $fieldArray = array();\n $valueArray = array();\n $weight = 0;\n $height = 0;\n $UID = User::getID($payload['username']);\n array_push($fieldArray, \"UID\");\n array_push($valueArray, $UID);\n foreach ($payload as $key => $value) {\n if($key !== \"username\"){\n array_push($fieldArray, $key);\n array_push($valueArray, $value);\n }\n if($key == \"Weight\"){\n $weight = $payload[$key];\n }\n if($key == \"Height\"){\n $height = $payload[$key];\n }\n }\n User::insert($fieldArray, $valueArray);\n User::setTable(\"usertable\");\n User::update([\"NewUser\"], [0], $UID);\n\n User::setTable(\"userdata\");\n $BMI = round(703 * ($weight) / ($height**2), 1);\n User::update([\"BMI\"], [$BMI], \"'\".base64_encode($payload[\"username\"]).\"'\");\n return true;\n }", "function insertUser($data){\n\t\t$this->db->insert('user',$data);\n\t\treturn;\n\t}", "public function register($user_info)\n {\n return $this->db->insert('users', $user_info);\n }", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "function insert($Username = \"\", $Password, $Fname, $Lname, $Phone, $Email, $Type, $LabID) {\n \n if((!$Username) OR (!$Password) OR (!$Email) OR (!$Type)) {\n echo \"Missing info...insert aborted\";\n exit;\n } else {\n $Password = encrypt_pwd($Password);\n $SQL = \"INSERT INTO User \".\n \"VALUES(0,'$Username', '$Password', '$Fname', '$Lname', '$Phone', '$Email', '', '1','$Type','$LabID')\";\n mysqli_query($this->db_link, $SQL); \n // get new user information\n $SQL = \"select * from User where Username='\".$Username.\"'\";\n list($this->ID,\n $this->Username,\n $this->Password,\n $this->Fname,\n $this->Lname,\n $this->Phone,\n $this->Email,\n $this->LastLogin,\n $this->Type,\n $this->LabID,) = mysqli_fetch_array(mysqli_query($this->db_link, $SQL));\n }\n }", "public function insert_new_user($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $password = md5($password);\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->orWhere(\"phone_number = '$phone_number'\")->All();\n if($count[0]['count']==0)\n {\n $query = Yii::$app->db;\n $result = $query->createCommand()->insert('core_users', [\n \"user_name\"=>$user_name,\n \"email\"=>$email,\n \"password\"=>$password,\n \"phone_number\"=>$phone_number,\n //\"phone_prefix\"=>'91',\n \"user_status\"=>'1',\n \"company_name\"=>$company_name,\n \"designation\"=>$designation,\n \"company_email\"=>$company_email,\n \"company_address\"=>$address,\n \"user_type\"=>1\n ])->execute();\n \n \n $subject=\"Big Equipments India | User Registration\";\n //get message to send to user\n $message = Mail_settings::get_registration_message();\n //send email to user\n Mail_settings::send_email_notification($email,$subject,$message);\n \n if($result)\n {\n return true;\n }\n return false;\n }\n return false;\n \n }", "function addNewUser($userInfo)\n {\n $this->db->trans_start();\n $this->db->insert('users', $userInfo);\n \n $insert_id = $this->db->insert_id();\n \n $this->db->trans_complete();\n \n return $insert_id;\n }", "function addNewUser($userInfo)\n {\n $this->db->trans_start();\n $this->db->insert('tbl_users', $userInfo);\n \n $insert_id = $this->db->insert_id();\n \n $this->db->trans_complete();\n \n return $insert_id;\n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "function insert_user($user_data) {\r\n\t\t// insert values into user and return true on success\r\n\t\treturn $this->db->insert('user', $user_data);\r\n\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function registerNewUser($userid, $username, $profile_image_url) {\n $stmt = $this->db->query(\"INSERT INTO users (userid, username, profile_image_url) VALUES ('$userid', '$username', '$profile_image_url')\");\n $stmt->execute();\n }", "public function add($info)\n\t{\n\t\t$salt = date('Y-m-d H:i:s');\n\t\t\n\t\t$md5Pwd = md5($info['password'].$salt);\t\t\n\t\t\n\t\t$query = sprintf(\"INSERT INTO users (fname,lname,email,salt,password)\n\t\t\t\t\t\t\tVALUES ('%s', '%s', '%s', '%s', '%s')\",\n\t\t\t\t\t\t\tmysql_real_escape_string($info['fname']),\n\t\t\t\t\t\t\tmysql_real_escape_string($info['lname']),\n\t\t\t\t\t\t\tmysql_real_escape_string($info['email']),\n\t\t\t\t\t\t\tmysql_real_escape_string($salt),\n\t\t\t\t\t\t\tmysql_real_escape_string($md5Pwd));\n\t\t\n\t\tmysql_query($query);\n\t\t\n\t\treturn true;\n\t}", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "public function insertUser($data){\t\t\n\t\t$query = \"INSERT INTO final_usuario VALUES ('','\".$data[\"user\"].\"'\n\t\t\t,'\".$data[\"name\"].\"','\".$data[\"pwd\"].\"','\".$data[\"email\"].\"')\";\n\t\treturn $this->con->action($query);\n\t}", "public function insert()\n {\n $db = Base::getConnection();\n\n if (self::isAValidUser() || self::isVisitor()) {\n throw new \\InvalidArgumentException();\n }\n\n $stmt = $db->prepare(\"INSERT INTO users(username, password, email) VALUES(:name, :pass, :email);\");\n $stmt->bindParam(\":name\", $this->username, PDO::PARAM_STR);\n $stmt->bindParam(\":pass\", $this->password, PDO::PARAM_STR);\n $stmt->bindParam(\":email\", $this->email, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $this->id = $db->LastInsertID('users');\n $stmt->closeCursor();\n }", "function insertAdminUser() {\n // Insert Admin info;\n $userController = new UserController;\n $this->db->exec(\n \"INSERT INTO users (username, password) VALUES (?, ?)\",\n [\n 1 => $this->formValues['adminUsername'],\n 2 => $userController->cryptPassword($this->formValues['adminPassword_1']),\n ]\n );\n }", "function insertNewUser() {\n\ttry {\n\t\t// Open DB connection\n\t\t$DBH = openDBConnection();\n\t\t$DBH->beginTransaction();\n\t\t\n\t\t// Prepare salt and hash\n\t\t$salt = makeSalt();\n\t\t$hash = computeHash($_REQUEST['newPW2'], $salt);\t\t\n\t\t\n\t\t// Insert user info into DB\n\t\t$stmt = $DBH->prepare(\"insert into Users values (?, ?, ?)\");\n\t\t$stmt->bindValue(1, $_REQUEST['newLogin']);\n\t\t$stmt->bindValue(2, $hash);\n\t\t$stmt->bindValue(3, $_REQUEST['newName']);\n\t\t$stmt->execute();\n\t\t\n\t\t// Make this new user a client\n\t\t$stmt2 = $DBH->prepare(\"insert into Roles values (?, ?)\");\n\t\t$stmt2->bindValue(1, \"client\");\n\t\t$stmt2->bindValue(2, $_REQUEST['newLogin']);\n\t\t$stmt2->execute();\n\t\t\n\t\t$DBH->commit();\n\t\treturn true;\n\t}\n\tcatch (PDOException $e) {\n\t\t$DBH->rollBack();\n\t\treturn false;\n\t}\n}", "public static function insert($input) {\n\n\t\t// Note that Server Side validation is not being done here\n\t\t// and should be implemented by you\n\n\n\t\t// Prepare SQL Values\n\t\t$sql_values = [\n\t\t\t'first_name' => $input['first-name'],\n\t\t\t'last_name' => $input['last-name'],\n\t\t\t'user_name' => $input['username'],\n\t\t\t'email' => $input['email'],\n\t\t\t'password' => $input['password'],\n\t\t\t'dob' => $input['dob']\n\t\t];\n\n\t\t// Ensure values are encompased with quote marks\n\t\t$sql_values = db::array_in_quotes($sql_values);\n\n\t\t// Insert\n\t\t$results = db::insert('user', $sql_values);\n\t\t\n\t\t// Get Recent Insert ID\n\t\t$user_id = $results->insert_id;\n\n\t\t// Return a new instance of this user as an object\n\t\treturn new User($user_id);\n\n\t}", "public function insertUser($fname, $lname = null, $role_id = null, $phone = null, $email=null, $pwd=null, $salt=null, $status=null){\n try{\n $query = \"INSERT INTO users (fname, lname, phone, role_id, email, password, salt, created_at, status)\n VALUES(?,?,?,?,?,?,?, now(), ?)\";\n $stmt = $this -> getConnection($query);\n if($stmt){\n $stmt -> bind_param('ssssssss', $fname, $lname, $phone, $role_id, $email, $pwd, $salt, $status);\n $stmt -> execute();\n $stmt -> close();\n }else{\n echo 'Statement not prepared.';\n }\n\n if(true){\n echo 'New record created successfully.';\n }\n }catch(Exception $e){\n die('User insertion error: ' . $e -> getMessage());\n }\n }", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "public static function addUser($userData) {\n $db = DB::getInstance();\n $columns = \"admin, date_created, first_name, last_name, lump, password, username\";\n $placeholders = \":admin, :date_created, :first_name, :last_name, :lump, :password, :username\";\n $sorted = $userData;\n uksort($sorted, function ($val1, $val2) {\n return strncmp($val1, $val2, 2);\n });\n $mssg = \"\";\n\n // Insert form data into database\n try {\n $statement = $db->prepare(\"INSERT INTO `users` ($columns) VALUES ($placeholders)\");\n $statement->execute($sorted);\n // Grab the id of the newly inserted record and pass it back to client\n $mssg = $db->lastInsertId();\n }\n catch (Exception $e) {\n $db->rollBack();\n $mssg = $e->getMessage();\n }\n return $mssg;\n }", "function addUser($user)\n {\n $connection = Doctrine_Manager::connection();\n $query = \"INSERT INTO constant_contact (username, access_token, created_at) VALUES ('\".$user['username'].\"', '\".$user['access_token'].\"', '\".date('Y-m-d H:i:s').\"')\";\n $statement = $connection->execute($query);\n }", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }", "protected function insertAuth0User($userInfo, $uid) {\n\n db_insert('auth0_user')->fields(array(\n 'auth0_id' => $userInfo['user_id'],\n 'drupal_id' => $uid,\n 'auth0_object' => json_encode($userInfo)\n ))->execute();\n\n }", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "public function insertUserDetails(){\n $query=\"INSERT INTO account (user_id,email,password,user_type,login_permission) VALUES ('$this->user_id','$this->email','$this->hashed_password','$this->user_type','$this->login_permission')\";\n $result=$this->connection->query($query);\n if($result){\n if($this->user_type=='div'){\n $query=\"INSERT INTO div_user (user_id,div_id,name,contact_no,designation,nic) VALUES ('$this->user_id','$this->office_id','$this->name','$this->contact_no','$this->designation','$this->nic')\";\n $result=$this->connection->query($query);\n return $result;\n }\n else{\n $query=\"INSERT INTO dis_user (user_id,name,contact_no,designation,nic) VALUES ('$this->user_id','$this->name','$this->contact_no','$this->designation','$this->nic')\";\n $result=$this->connection->query($query);\n return $result;\n }\n }\n else\n return $result;\n }", "function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}", "function register_user_details($id, $name, $surname)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Prepare the statement using mysqli\n // to take care of any potential SQL injections.\n $stmt = mysqli_prepare($link, \"\n INSERT INTO tbl_user_details\n (user_id, name, surname)\n VALUES\n (?, ?, ?)\n \");\n\n // 3. Bind the parameters so we don't have to do the work ourselves.\n // the sequence means: string string double integer double\n mysqli_stmt_bind_param($stmt, 'iss', $id, $name, $surname);\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_affected_rows($stmt);\n }", "function insert(){\n\t\t$username = $this->input->post('inpLogin');\n\t\t$password = $this->input->post('inpPass');\n\t\t$fullname = $this->input->post('inpFulln');\n\t\t$access = $this->input->post('optionsrad');\n\t\t$obj_level = $this->input->post('inpLev');\n\t\t$data = array(\n\t\t\t'username' => $username,\n\t\t\t'password' => MD5($password),\n\t\t\t'fullname' => $fullname,\n\t\t\t'access' => $access,\n\t\t\t'obj_level' => $obj_level\n\t\t);\n\t\t$this->db->insert('sys_user',$data); \n\t}", "public function addUser($data) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t\n\t\tforeach ($data as $key=>$val) {\n\t\t\tif ($key != 'password') {\n\t\t\t\t$values[$key] = $db->sqlify($val);\n\t\t\t} else {\n\t\t\t\t$values[$key] = $db->sqlify(crypt($val)); \n\t\t\t}\n\t\t}\n\t\t$values['date_created'] = $db->sqlify(date('Y-m-d H:i:s')); \n\t\t\n\t\t$check = false;\n\t\tif (!empty($data['email'])) {\n\t\t\t$check = $this->getUserByEmail($data['email']);\n\t\t} elseif (!empty($data['twitter_id'])) {\n\t\t\t$check = $this->getUserByTwitterId($data['twitter_id']);\n\t\t}\n\t\t\n\t\tif (!$check) {\n\t\t\t$db->insert('users', $values);\n\t\t\t$db->doCommit();\n\t\t}\n\t}", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }", "function addUser ($username, $prenom, $nom, $hashMdp, $role, $statut)\n{\n $db = connect();\n\n $query = $db->prepare('INSERT INTO users (username, prenom, nom, password, role, statut) VALUES (?, ?, ?, ?, ?, ?)');\n $query->execute(array($username, $prenom, $nom, $hashMdp, $role, $statut));\n $query->closeCursor();\n}", "function insert_entry($username,$email,$password_hash,$auth_identifier)\n\t{\n\t\t$data = array(\n\t\t\t'username' => $username,\n\t\t\t'email' => $email,\n\t\t\t'password_hash' => $password_hash,\n\t\t\t'activation_id' => $auth_identifier\n\t\t\t);\n\t\t$this->db->insert('pending_users',$data);\n\t}", "public function registerUser()\n {\n $sql = \"INSERT INTO user (username, password, email, firstname, lastname, address, date_of_birth, id_role)\n VALUES (\\\"\" . $this->getUsername().\"\\\", \\\"\" . $this->getPassword().\"\\\", \\\"\" . $this->getEmail().\"\\\",\\\"\" . $this->getFirstname().\"\\\", \\\"\" . $this->getLastname().\"\\\", \\\"\" . $this->getAddress().\"\\\", \\\"\" . $this->getDateOfBirth().\"\\\", \\\"\" . $this->getIdRole().\"\\\")\";\n $result = mysqli_query($this->_connection, $sql);\n if (!$result) {\n print \"Error: \" . $result . \"<br>\" . mysqli_error($this->_connection);\n } else {\n print \"erfolg\";\n\n }\n }", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "function addUser(){\n $data= array(\n 'title'=>$this->security->xss_clean($this->input->post('title')),\n 'fname'=>$this->security->xss_clean($this->input->post('fname')),\n 'lname'=>$this->security->xss_clean($this->input->post('lname')),\n 'gender'=>$this->security->xss_clean($this->input->post('gender')),\n 'email'=>$this->security->xss_clean($this->input->post('email')),\n 'password'=>$this->security->xss_clean(md5($this->input->post('password'))),\n 'mobile'=>$this->security->xss_clean($this->input->post('mobile')),\n 'work_phone'=>$this->security->xss_clean($this->input->post('work_phone')),\n 'address'=>$this->security->xss_clean($this->input->post('address')),\n 'type'=>$this->security->xss_clean($this->input->post('type'))\n );\n \n $this->db->insert('user', $data);\n }", "private function insertNewUser($array_User){\r\n\t\tglobal $TABLEAFILIADOS;\r\n\t\t$variables=get_class_vars(\"tAfiliados\");\r\n\t\t$querysql=\"INSERT INTO `$TABLEAFILIADOS` (\";\r\n\t\tforeach ($variables as $field){\r\n\t\t\t$querysql.=\"`$field`, \";\r\n\t\t}\r\n\t\t$querysql=substr($querysql,0,-2);\r\n\t\t$querysql.=\") VALUES ( \";\r\n\t\tforeach ($variables as $field){\r\n\t\t\t$querysql.=\"'$array_User[$field]', \";\r\n\t\t}\r\n\t\t$querysql=substr($querysql,0,-2);\r\n\t\t$querysql.=\");\";\r\n\t\tmysql_query($querysql) or die(\"Fallo al ejecutar el INSERT.<br/>\". mysql_error());\r\n\t\t$this->writeLogNewUser($array_User);\r\n\t}", "function createNewUser($F_Name, $L_Name, $Email, $DOB, $cell_number, $Address, $City, $State, $Zip, $Country)\n{\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\n \"INSERT INTO \" . $db_table_prefix . \" student_info(\n\t\tF_Name,\n L_Name,\n Email,\n DOB,\n Cell_number,\n Address,\n City,\n State,\n Zip,\n Country\n\t\t)\n\t\tVALUES (\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?\n\t\t)\"\n );\n $stmt->bind_param(\"ssssssssss\", $F_Name, $L_Name, $Email,$DOB, $cell_number, $Address, $City, $State, $Zip, $Country);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n\n}", "public function create($data){\n \n $this->db->insert('users', array(\n 'user_login' => $data['login'], \n 'user_password' => Hash::create(HASH_ALGO, $data['password'], HASH_PASSWORD_KEY), \n 'user_nicename' => $data['nicename'],\n 'user_email' => $data['email'],\n 'user_role' => $data['role']\n\n \n ));\n }", "public function addUser(){\n\t}", "function addUserToDatabase($user, $post)\n {\n $connect = new Config();\n $text = new TextFunctions();\n $validateF = new ValidateFunctions();\n $newDate = '0000-00-00 00:00:00';\n $curDate = date(\"Y-m-d H:i:s\");\n $email = $validateF->sanitize($post['user_email']);\n $pass = $text->password_encryption($validateF->sanitize($post['user_password']));\n $curDate = date(\"Y-m-d H:i:s\");\n $sql = 'INSERT INTO user_db(user_info, user_email, user_password ,join_date,last_login) VALUES (:info,:email,:password,:cur_date,:last_login)';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':info', $user, \\PDO::PARAM_STR, 200);\n $query->bindParam(':email', $email, \\PDO::PARAM_STR);\n $query->bindParam(':password', $pass, \\PDO::PARAM_STR);\n $query->bindParam(':cur_date', $curDate, \\PDO::PARAM_STR);\n $query->bindParam(':last_login', $newDate, \\PDO::PARAM_STR);\n $query->execute();\n }", "static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}", "public function add_user ($first,$last,$phone,$email,$username,$password,$type) {\r\n $stmt = $this->DB->prepare(\"INSERT INTO users values(NULL, :username, :firstname, :lastname, :phone, :email, :password, now(),'$type')\");\r\n $stmt->bindParam( 'username', $username );\r\n $stmt->bindParam( 'firstname', $first );\r\n $stmt->bindParam( 'lastname', $last );\r\n $stmt->bindParam( 'phone', $phone );\r\n $stmt->bindParam( 'email', $email );\r\n\t $stmt->bindParam( 'password', $password );\r\n $stmt->execute();\r\n }", "function addUser($userInfo){\n $this->db->trans_start();\n $this->db->insert('Users', $userInfo);\n\n $insert_id = $this->db->insert_id();\n\n $this->db->trans_complete();\n\n return $insert_id;\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}", "public function insertUserProfile(array $userData)\n {\n\n $sql = \"INSERT INTO user_profile (last_name, first_name, address, quote, city, age) VALUES (:last_name, :first_name, :address, :quote, :city, :age)\";\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($userData);\n }", "public function addNewUser($user)\n {\n $conn = $this->MySQL->getConn();\n $sql = \"INSERT INTO `\".DB::TBL_USERS.\"` \".\n \"SET `fio`=?,`login`=?,`loginHash`=?,`phone`=?,\n `email`=?, `emailHash`=?,`pass`=?,`photo`=?\";\n $st = $conn->prepare($sql);\n $st->execute([\n $user->fio, $user->login, $user->loginHash, $user->phone,\n $user->email, $user->emailHash, $user->pass, $user->photo\n ]);\n $user->id = $conn->lastInsertId();\n }", "public function createNewUser($postData)\n\t{\n\t\t$query = \"INSERT INTO users (first_name, last_name, email, password, user_level, created_at, updated_at) VALUES (?, ?, ?, ?, ?, NOW(), NOW())\";\n\t\t$result = $this->db->query( $query, array($postData['first_name'], $postData['last_name'], $postData['email'], $postData['password'], 'normal' ));\n\t\treturn $result;\n\t}", "public function createUser( UserDataInf $user )\n {\n \n $userName = $user->getName();\n \n if( $this->userExists( $userName ) )\n {\n $this->protocol->info( \"Systemuser {$userName} allready exists.\" ); \n return;\n }\n \n $sqlPerson = <<<SQL\nINSERT INTO core_person\n( firstname, lastname )\nVALUES\n( '{$user->getFirstname()}', '{$user->getLastname()}' );\nSQL;\n\n $idPerson = $this->db->insert( $sqlPerson );\n $passwd = Password::passwordHash( $user->getPasswd() );\n \n $sqlUser = <<<SQL\nINSERT INTO wbfsys_role_user\n( \n name, \n id_person, \n inactive, \n non_cert_login,\n profile,\n level,\n password\n)\nVALUES\n( \n '{$userName}', \n {$idPerson}, \n FALSE, \n TRUE, \n '{$user->getProfile()}', \n '{$user->getLevel()}',\n '{$passwd}'\n);\nSQL;\n\n $idUser = $this->db->insert( $sqlUser );\n \n }", "public function createUser($array){\n $this->_dbTable->insert($array);\n }", "public function insertUserData($userData)\n {\n $this->db->query(\"SELECT * FROM picture WHERE SourcePath LIKE 'resources/profilePictures/default%'\");\n $defaultPictureID = $this->db->fetchArray()['PictureID'];\n\n $this->db->query(\n \"INSERT INTO user \n (FirstName, LastName, Username, Email, Usertype, Password, SessionID, FK_PictureID)\n VALUES (?, ?, ?, ?, 'user', ?, ?, ?)\",\n $userData['FirstName'],\n $userData['LastName'],\n $userData['Username'],\n $userData['Email'],\n password_hash($userData['Password'], PASSWORD_DEFAULT),\n session_id() . time(),\n $defaultPictureID\n );\n\n return $this->db->lastInsertID();\n }", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "function post_new_user(){\n\t\tglobal $conn;\n\t\t$data \t\t= json_decode(file_get_contents('php://input'));\n\t\t$username \t= htmlspecialchars($data->username);\n\t\t$email \t\t= htmlspecialchars($data->email);\n\t\t$password \t= htmlspecialchars($data->password);\n\t\t\n\t\t$password_hash = password_hash($password, PASSWORD_DEFAULT);\n\t\t\n\t\t//check if username is already taken\n\t\t\n\t\tif($sql = $conn->prepare(\"SELECT * FROM members where member_name = ?\")){\n\t\t\t\t\t\n\t\t\t$sql->bind_param('s', $username);\n\t\t\t$sql->execute();\n\t\t\t$result = get_result_fill($sql);\n\t\t\t$username_count = count(array_shift($result));\n\n\t\t\tif($username_count > 0 )\n\t\t\t{\n\t\t\t\t//we already have that user name taken. \n\t\t\t\techo \"taken\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif($sql = $conn->prepare(\"INSERT INTO members (member_id, member_name, member_email, member_password) VALUES (null, ?, ?, ?)\")){\n\t\t\t\t\t$sql->bind_param('sss', $username, $email, $password_hash);\n\t\t\t\t\tif($sql->execute()){\n\t\t\t\t\t\t//create a new table for this user and copy and paste the default suggestions\n\t\t\t\t\t\tcreate_new_member_table($username);\n\t\t\t\t\t\techo create_jwt($username);\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"Error\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\techo \"fail\";\n\t\t}\n\n\t\t\n\t\t\n\t}", "function addUser ($user) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"INSERT INTO user (_user_FirstName, _user_Email, _user_Password) VALUES (?, ?, ?)\";\n $query = $conn->prepare($sql);\n $query->execute(array($user->_user_FirstName, $user->_user_Email, $user->_user_Password));\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n }", "public function add()\n {\n $storedPassword = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\n $data = [];\n $data['username'] = $_POST[\"username\"];\n $data['password'] = $storedPassword;\n $data['email'] = $_POST['email'];\n $data['profile_picture'] = $_FILES['profile']['tmp_name'];\n $data['mime'] = $_FILES['profile']['type'];\n $data['phone_num'] = $_POST['phone-number'];\n\n if ($this->model('User')->addNewUser($data) > 0) {\n $this->redirect(BASE_URL . \"/home/index/{$data['username']}\");\n }\n }", "private function insertUserDetails($un,$fn,$ln,$e1,$pw1)\n {\n $encryptedpw = md5($pw1);\n $profilePic = \"assets/img/profile-pics/profile_pic.jpg\";\n $date = date(\"Y-m-d\");\n \n $result = mysqli_query($this -> con,\"INSERT INTO users VALUES('','$un','$fn','$ln','$e1','$encryptedpw','$date','$profilePic')\");//Must have single quote on every parameter\n \n return $result;\n }", "protected function add_new_user($name, $email, $avatar, $bio, $password, $sexe) {\r\n\r\n $activation_key = '';\r\n\r\n // Generate Email Activation Key\r\n for ($i = 0; $i < 6; $i++) {\r\n $activation_key = $activation_key . rand(0, 9);\r\n }\r\n\r\n // Connect To DB\r\n $connection = DB::connect();\r\n // Insert New User Data Into Users Table\r\n $stmt = \"INSERT INTO users\r\n (`name`, `email`, `avatar`, `bio`, `password`, `sexe`, `theme`, `account_type`, `activation_key`)\r\n VALUES\r\n ('$name', '$email', '$avatar', '$bio', '$password', '$sexe', 'light', 'user', '$activation_key')\";\r\n\r\n if ($connection->query($stmt) === false) {\r\n echo '<script>alert(\"لا نستطيع إضافة مستخدم جديد الآن، يمكنك الإتصال بفريق الدعم أو المحاولة لاحقا\")</script>';\r\n return;\r\n }\r\n\r\n // Get User ID\r\n $stmt = \"SELECT id FROM users WHERE `email` = '$email'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Create New Session User Variable\r\n $_SESSION['user_id'] = $result->fetch_assoc()['id'];\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function insertUser($data){\n \n return $this->db->insert('user',$data);\n \n }", "function user_register($user_info)\n {\n }", "function insert_family_user($familyID, $userID, $position, $name, $admin )\n\t{\n\t\t$insert_stmt = sprintf(\"INSERT INTO family_user\n\t\t\t\t(family_userUserID, family_userFamilyID, family_userPosition, family_userName, family_userAdminFlag)\n\t\t\t\tVALUES ('%s', '%s', '%s', '%s', %s)\",\n\t\t\t\t$familyID, $userID, $position, $name, $admin);\n\t\tvar_dump($insert_stmt);\n\t\t$results = $this->db->query($insert_stmt);\n\t\t\n\t\t\n\t\tif($results!=false)\n\t\t{\n\t\t\t$this->response->setResponse(true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response->setResponse(false,\"\",\"Failed to update any information to family_user\");\n\t\t}\n\t\treturn $this->response;\n\t}", "function new_user(Utilisateur $user) {\n $query = $this->dbh->prepare(\"INSERT INTO users (pseudo, password, email, reg_date) \" .\n \"VALUES (:pseudo, :password, :email, :reg_date);\");\n $query->bindValue(':pseudo', $user->getNom());\n $query->bindValue(':password', $user->getPassword());\n $query->bindValue(':email', $user->getEmail());\n $query->bindValue(':reg_date', 'NOW()');\n $query->execute();\n return TRUE;\n }", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.8218397", "0.7679022", "0.7328596", "0.72870135", "0.72731704", "0.72598064", "0.72368807", "0.7182992", "0.71550405", "0.7122911", "0.7068758", "0.70646167", "0.7017082", "0.6995018", "0.6989052", "0.6968148", "0.69653296", "0.6962806", "0.69616574", "0.69383615", "0.69342256", "0.6888201", "0.6849619", "0.68295187", "0.68232137", "0.6817402", "0.68123144", "0.68092984", "0.68045294", "0.6803344", "0.6791358", "0.67730606", "0.6759082", "0.6747828", "0.67420435", "0.672853", "0.67247874", "0.67243445", "0.6721183", "0.668939", "0.6688932", "0.6671449", "0.6657934", "0.6650171", "0.6639161", "0.6639054", "0.66324556", "0.66288185", "0.6626525", "0.6604481", "0.6603217", "0.6599761", "0.6584086", "0.65789396", "0.6578391", "0.6570368", "0.6565341", "0.65589106", "0.6555443", "0.6550909", "0.6539871", "0.65249574", "0.6519371", "0.6501922", "0.65009266", "0.65005803", "0.6497674", "0.6492435", "0.64873475", "0.6485957", "0.6485789", "0.64787686", "0.6473717", "0.64595705", "0.64521104", "0.6451168", "0.6440398", "0.64395994", "0.6439529", "0.6437999", "0.64361584", "0.643014", "0.64282864", "0.64278185", "0.6427081", "0.6422337", "0.6417298", "0.64149666", "0.6413715", "0.641302", "0.6411231", "0.6405577", "0.64003015", "0.64003015", "0.64003015", "0.64003015", "0.63995224", "0.6393727", "0.6393223", "0.6388717", "0.63791245" ]
0.0
-1
SELECT FROM users WHERE username = $username AND password = $password
public function login(string $username , string $password){ $builder->select('*'); $builder->where('username',$username); $builder->where('password',$password); //return $builder->get()->getRowArray(); $num_results = $this->db->count_all_results(); if ($num_results == 0){ echo "Invalid User Name or Password"; }else{ $data['datatable'] = 'users/datatable'; echo view('app/layout',$data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserRowByUsernamePass($username, $password) {\n //mysql object\n $mysql = new my_mysql();\n $query = \"SELECT * FROM user_logging WHERE username='$username' AND pass=PASSWORD('$password');\";\n $res = $mysql->readQuery($query);\n if (!$res) {\n die($mysql->connect_error);\n }else {\n return $res->fetch_assoc();\n }\n}", "public function checkUserPassword()\r\n{\r\n $query_string = \"SELECT userid, username, password \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"userid = :userid AND \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "function auth_user($username,$password){\n\t\t$query=$this->db->query(\"SELECT * FROM user_table WHERE user_name='$username' AND user_password=MD5('$password') LIMIT 1\");\n\t\treturn $query;\n\t}", "function login_user($username, $password)\n\t{\n\t\t$sql = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM users\n\t\t\t\tWHERE username = '$username' AND password = MD5(CONCAT('$password', salt))\n\t\t\t\";\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\treturn $dbdata->fetchObject();\n\t}", "function auth_user($username,$password){\n $query=$this->db->query(\"SELECT * FROM t_user WHERE username='$username' AND password= md5('$password') LIMIT 1\");\n return $query;\n }", "function get_one_user($username, $password){\n global $db;\n $query = \"SELECT * FROM users \n WHERE userName = :username AND \n password = :password\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username);\n $statement->bindValue(':password', $password);\n $statement->execute();\n $user = $statement->fetch();\n $statement->closeCursor();\n return $user; \n }", "public function getUser($username, $password) {\n $conn = $this->getConnection();\n $pass = md5($password . getenv('SALT'));\n return $conn->query(\"SELECT * FROM User WHERE Username = '$username' AND Password = '$pass'\");\n }", "function getUser() {\n $stmt = prepareQuery(\"\n SELECT\n `password`,\n `userID`,\n `role`\n FROM\n `user`\n WHERE\n `username` LIKE :username OR \n `email` LIKE :username\n \");\n\n $stmt->bindValue(\":username\", test_input($_POST[\"user\"]));\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n}", "function getUser($username,$password){\n $str_query = \"Select * from users where username='$username' AND password='$password'\";\n return $this->query ($str_query);\n }", "function check_user_existence($username, $password) \n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE user_name = '$username' AND password = '$password'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function getCustomerByUserAndPass($username, $password) {\n $query = \"SELECT * FROM `customers` WHERE `username`='$username' AND `password`='\". md5($password). \"'\";\n $result = Database::selectQuery($query);\n if(count($result) == 1) {\n return true;\n } else {\n return false;\n }\n }", "function getPassword($username) {\n\t$username = dbEscape($username);\n\treturn(dbFirstResult(\"SELECT password FROM users WHERE username='$username'\"));\n}", "public function loginByUserAndPassword($username, $password) {\r\n $result = mysql_query(\"select * from tbl_users where username = '\".$username.\"' and password = '\".md5($password).\"'\") or die(mysql_error());\r\n // check for result \r\n $no_of_rows = mysql_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n $result = mysql_fetch_array($result);\r\n return $result;\r\n } else {\r\n // user not found\r\n return false;\r\n }\r\n }", "function selectByEmailAndPassword($email, $password) {\n $connection = openDb();\n $email = escape($email, $connection);\n $password = escape($password, $connection);\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users WHERE EMAIL = ? AND PASSWORD = ? AND DATE_APPROVED IS NOT NULL\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"ss\",$email,$password);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function authenticate($username, $password)\n\t{\n\t\t$sql = \"SELECT username, password FROM users where username='$username'\";\n\t\t$hashpasswd = sha1($password);\n\t\t\n\t\t//Validate Against Database\n\t\t$link = mysqli_connect(\"localhost\", \"dev_user\", \"d3vUser\", \"dev_user\");\n\t\t\n\t\t/* check connection */\n\t\tif (mysqli_connect_errno()) {\n\t\t\techo \"Connect failed to database\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($result = mysqli_query($link, $sql)) {\t\t\t\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t\tif ($row['password'] == $hashpasswd)return true;\n\t\t}\n\t\treturn false;\n\t\t\n\t\tmysqli_free_result($result);\n\t\tmysqli_close($link);\n\t\t\n\t}", "public function getUserByUsernameAndPassword($username,$password){\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM users WHERE username = ?\");\n\t\t$stmt->bind_param(\"s\",$username);\n\t\tif($stmt->execute()){\n\t\t\t$user = $stmt->get_result()->fetch_assoc();\n\t\t\t$stmt->close();\n\n\t\t\t//verifying user password\n\t\t\t$salt = $user['salt'];\n\t\t\t$encrypted_password = $user['encrypted_password'];\n\t\t\t$hash = $this->checkhashSSHA($salt,$password);\n\n\t\t\t//check for password equality \n\t\t\tif($encrypted_password == $hash){\n\t\t\t\treturn $user;\n\t\t\t}\n\n\t\t}\n\n\t\telse{\n\t\t\treturn NULL;\n\t\t}\n\t}", "function login_customer($email,$password) {\n global $db;\n // $password = sha1($email.$password);\n $query = 'SELECT customerID, email, firstName, lastName\n FROM customers\n WHERE email = :email\n AND password = :password';\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email);\n $statement->bindValue(':password', $password);\n $statement->execute();\n $user = $statement->fetch();\n $statement->closeCursor();\n return $user;\n\n}", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "function login($username,$password){\r\n\t$password =\tmd5($password);\r\n\t$sql = \"SELECT * FROM users WHERE `UserName`='$username' AND `PassWord`='$password' \";\r\n\t$row=mysql_query($sql);\r\n\t$data=mysql_fetch_array($row);\r\n\treturn $data;\r\n}", "function adminLogin($username, $password){\r\n \r\n $query = 'SELECT pass FROM users WHERE username = '.$username; \r\n \r\n $results = mysqli_query( $dbc , $query );\r\n \r\n $row = mysqli_fetch_array( $results , MYSQLI_ASSOC );\r\n \r\n return password_verify($password, $row['pass']);\r\n }", "function validateLogin($user,$pass,$database)\n{\n $sql_query = 'SELECT * FROM USER WHERE user_id = \"'.$user.'\" AND password = \"'.$pass.'\"';\n return mysql_query($sql_query,$database);\n}", "function CheckCreds($email, $password)\n{\n global $db;\n $query = \"SELECT email FROM users WHERE email=:email AND password=SHA2(:password, 256);\";\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email);\n\t$statement->bindValue(':password', $password);\n $statement->execute();\n $results = $statement->fetchColumn();\n $statement->closeCursor();\n\treturn $results;\n}", "public function login($username, $password) {\n $query = \"SELECT * FROM users WHERE username='\".$username.\"' AND password='\".$password.\"' AND status > 0 LIMIT 1\";\n $data = $this->select($query); \n return $data;\n }", "public function login($username, $password)\n\t{\n $password = md5($username . $password); // THIS IS NOT SECURE. DO NOT USE IN PRODUCTION.\n $sql = 'SELECT * FROM user WHERE username = ? AND password = ? LIMIT 1';\n $user = $this->db->execute($sql, [$username, $password]);\n if(count($user) > 0) {\n return $this->db->fetchOne($sql, [$username, $password]); \n }\n\t}", "public static function checkCredentials($username, $password)\n {\n // could not be found in the database\n $userID = 0;\n $digest = '';\n \n try\n {\n $dbh = DatabaseHelpers::getDatabaseConnection();\n \n // Build a prepared statement that looks for a row containing the given\n // username/password pair\n $stmt = $dbh->prepare('SELECT UserID, Password FROM Users WHERE ' .\n 'Username=:username ' .\n 'LIMIT 1');\n \n $stmt->bindParam(':username', $username, PDO::PARAM_STR);\n \n $success = $stmt->execute();\n \n // If results were returned from executing the MySQL command, we\n // have found the user\n if ($success)\n {\n // Ensure provided password matches stored hash\n $userData = $stmt->fetch();\n $digest = $userData['Password'];\n if (crypt ($password, $digest) == $digest)\n {\n $userID = $userData['UserID'];\n }\n }\n \n $dbh = null;\n }\n catch (PDOException $e)\n {\n $userID = 0;\n $digest = '';\n }\n \n return array ($userID, $username, $digest);\n }", "function auth_admin($username,$password){\n\t\t$query=$this->db->query(\"SELECT * FROM admin_table WHERE username='$username' AND admin_password=MD5('$password') LIMIT 1\");\n\t\treturn $query;\n\t}", "function login($username, $password)\n {\n $this -> db -> select('id, username, password');\n $this -> db -> from('admin');\n $this -> db -> where('username = ' . \"'\" . $username . \"'\");\n $this -> db -> where('password = ' . \"'\" . MD5($password) . \"'\");\n $this -> db -> limit(1);\n\n $query = $this -> db -> get();\n\n if($query -> num_rows() == 1)\n {\n return $query->result();\n }\n else\n {\n return false;\n }\n }", "function login($username){\n\tglobal $conn;\n\n\t$query = \"SELECT * FROM tb_users WHERE \n\tusername = '$username'\n\t\";\n\treturn query($query);\n}", "public function login($username, $password) {\n $statement = self::$db -> prepare(\"SELECT user_id, username, password FROM users WHERE username = ?\");\n $statement -> bind_param(\"s\", $username);\n $statement -> execute();\n $result = $statement -> get_result() -> fetch_assoc();\n\n var_dump($result);\n// check if password is correct\n if (password_verify($password, $result['password'])){\n return true;\n }\n\n return false;\n }", "function auth_dosen($username,$password){\n\t\t$query=$this->db->query(\"SELECT * FROM member_dosen WHERE nip='$username' AND password=MD5('$password') LIMIT 1\");\n\t\treturn $query;\n\t}", "function authenticate($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user['id'];\n }\n }\n return false;\n }", "function authenticate($username, $password) \n{ \n $boolAuthenticated = false;\n \n $sqlQuery = \"SELECT * from tbl_users WHERE \";\n $sqlQuery .= \"username = '\" . $username . \"'\";\n $sqlQuery .= \" AND \";\n $sqlQuery .= \"password = '\" .$password . \"'\";\n \n $result = mysql_query($sqlQuery);\n \n if (!$result)\n {\n \t//die(\"Error: \" . $sqlQuery . mysql_error());\n $boolAuthenticated = false;\n } \n \n if (mysql_num_rows($result)==1) \n {\n $boolAuthenticated = true;\n }\n else\n {\n \t//same user there more than once?\n $boolAuthenticated = false;\n }\n \n return $boolAuthenticated;\n}", "function auth($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return true;\n }\n}", "function mysql_authenticate($username, $password)\n{\n $encrypted_old = md5($password);\n $row = dbFetchRow(\"SELECT `username`, `password` FROM `users` WHERE `username`= ?\", array($username));\n if ($row['username'] && $row['username'] == $username)\n {\n // Migrate from old, unhashed password\n if ($row['password'] == $encrypted_old)\n {\n $row = dbFetchRow(\"DESCRIBE `users` `password`\");\n if ($row['Type'] == 'varchar(34)')\n {\n mysql_auth_change_password($username, $password);\n }\n return 1;\n }\n if ($row['password'] == crypt($password, $row['password']))\n {\n return 1;\n }\n }\n\n session_logout();\n return 0;\n}", "function loginAttempt($username, $password)\n{\n global $connectingDB;\n $sql = \"SELECT * FROM users WHERE username=:username AND password=:password LIMIT 1\";\n $stmt = $connectingDB->prepare($sql);\n $stmt->bind_param('ss', $username, $password);\n //$stmt->bind_param(':Password');\n $stmt->execute();\n $result = $stmt->store_result();\n if ($result == 1) {\n return $foundAccount = $stmt->fetch();\n } else {\n return null;\n }\n}", "function auth_admin($username,$password){\n $query=$this->db->query(\"SELECT * FROM t_adminpii WHERE username='$username' AND password=md5('$password') LIMIT 1\");\n return $query;\n }", "function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function getUser($email, $password = '')\n{\n $resource = dbConnect();\n $query = \"SELECT id, name, email, phone FROM users WHERE email = '$email'\";\n if (!empty($password)) {\n $query .= \" AND password = '$password'\";\n }\n $query = mysqli_query($resource, $query);\n\n return mysqli_fetch_row($query);\n}", "private function getLoggedIn($username,$password){\r\n\t\t\t$result = $this->myDatabase->prepare(\"SELECT username,password FROM users WHERE username LIKE $username\");\r\n\t\t\t$result->bind_Param('s', $testResult);\r\n\t\t\t$result->execute();\r\n\t\t\t$result = $result->get_result();\r\n\t\t\tif($result){\r\n\t\t\t\tif($result->num_rows > 0){\r\n\t\t\t\t\t$logIn = array();\r\n\t\t\t\t\tfor ($i=0; $i < $result->num_rows; $i++) { \r\n\t\t\t\t\t\t$row = $result->fetch_assoc();\r\n\t\t\t\t\t\tarray_push($LogIn, $row);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$dbLoginUsername = $logIn[0];\r\n\t\t\t\t\t$dbLoginPassword = $logIn[1];\r\n\t\t\t\t\tif ($dbLoginUsername == $username & $dbLoginPassword == $password){\r\n\t\t\t\t\t\techo \"you loggin in\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//username, password not right\r\n \t\t\techo \"you didn't login, username or password incorrect\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//If the SQL failed\r\n \t$this->statuscode = 400;\r\n \techo 'If the SQL failed';\r\n\t\t\t}\t\r\n\t\t}", "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}", "public static function authenticate($username=\"\", $password=\"\") {\r\r\n\t\tglobal $database;\r\r\n\t\t$username = $database->escaped_value($username);\r\r\n\t\t$password = $database->escaped_value($password);\r\r\n\t\r\r\n\t\t$sql = \"SELECT * FROM \".self::$table_name.\" WHERE ((emp_email = '{$username}' or emp_uname ='{$username}') AND emp_pword = '\".crypt($password,'$2a$07$usesomesillystringforsalt$').\"')\";\r\r\n\t\t\r\r\n\t\t$result_array = self::find_by_sql($sql);\r\r\n\t\t\treturn !empty($result_array) ? array_shift($result_array) : false;\r\r\n\t}", "function authenticate($username, $pass) {\n global $db;\n\n $query = \"SELECT id, pass FROM user WHERE username=:username\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username); \n $statement->execute();\n $hash = $statement->fetchAll();\n $statement->closeCursor();\n if(count($hash) > 0) {\n // correct pass\n if(password_verify($pass, $hash[0]['pass'])) {\n return $hash[0]['id'];\n }\n }\n return -1;\n}", "public function findByCredentials($username, $password){\n $db = database::getInstance();\n if($db === null){\n header('Location: /500');\n die;\n }\n\n try{\n $password = hash('sha512', $password); //Hash the password\n\n $stmt = $db->connection->prepare('SELECT id FROM '.static::$table.' WHERE username = :username AND password = :password LIMIT 1;');\n $stmt->bindParam('username', $username);\n $stmt->bindParam('password', $password);\n $stmt->execute();\n\n if($stmt->rowCount()==1){\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->load($row['id']); //Load the found object\n return true;\n } else {\n return false;\n }\n }catch (PDOException $e){\n database::logAndDestroy($e);\n }\n }", "function check_user_account($username, $password){\n\t\t $this->db->select('*');\n\t\t $this->db->from('pengguna');\n\t\t $this->db->where('username', $username);\n\t\t $this->db->where('password', $password);\n\n\t\t return $this->db->get();\n\t }", "function login($username, $password) {\n $user_id = user_id_from_username($username);\n\n $username = sanitize($username);\n $password = md5($password);\n\n return (mysql_result(mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `password` = '$password'\"), 0) == 1) ? $user_id : false;\n}", "function is_valid($username, $password) \n{\n global $conn;\n \n $sql = \"SELECT * FROM Users WHERE ((Username ='$username') and (Password = '$password'))\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) // check the number of selected rows\n return true;\n else\n return false;\n}", "function checkUserData($dbh, $user)\n{\n $query = \"SELECT username, password \n FROM users \n WHERE username = :username\";\n $stmt = $dbh->prepare($query);\n $stmt->execute(array('username' => $user));\n $row = $stmt->fetch();\n return $row;\n}", "public function getByUsernamePass()\n {\n $sth = $this->db->prepare(\"SELECT id FROM \" . static::tableName() . \" WHERE\n\t\t\t\tusername = :username AND password = MD5(:password)\");\n $sth->execute(array(\n ':username' => $this->username,\n ':password' => $this->password\n ));\n $data = $sth->fetch();\n return $data;\n }", "function user_login($username, $password)\n\t{\n\t\t$sha1_pswrd = sha1($password);\n\t\t\n\t\t//assigns the sql query to a variable\n\t\t$str = \"Select uid from tbl_user where u_username = ? and u_password = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, array($username, $sha1_pswrd));\n\t\t\n\t\t//Checks whether exactly one result is returned\n\t\tif($res -> num_rows() == 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function AuthUsers($username) {\r\n //Can user login?\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $huser=hash(\"SHA256\",strip_tags($username));\r\n $result=$connection->query(\"select * from users where aduser='$huser'\") or die(mysqli_error($connection));\r\n if($result->num_rows>0) return 1; \r\n else return 0;\r\n}", "function login($username) {\n $conn = database::getDB();\n $pass;\n $sql = \"SELECT password FROM admin WHERE email = '\" . $username . \"'\";\n $result = $conn->query($sql);\n while ($row = $result->fetch_assoc()) {\n $pass = $row['password'];\n }\n return $pass;\n }", "function login($username=NULL, $password=NULL)\n {\n if ($username && $password)\n {\n $sql = \"\n SELECT\n id,\n username,\n password,\n salt,\n first_name,\n last_name,\n email,\n language,\n is_admin,\n status,\n created,\n updated\n FROM {$this->_db}\n WHERE (username = \" . $this->db->escape($username) . \"\n OR email = \" . $this->db->escape($username) . \")\n AND status = '1'\n AND deleted = '0'\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n $results = $query->row_array();\n $salted_password = hash('sha512', $password . $results['salt']);\n\n if ($results['password'] == $salted_password)\n {\n unset($results['password']);\n unset($results['salt']);\n\n return $results;\n }\n }\n }\n\n return FALSE;\n }", "function mysql_auth_user_id($username)\n{\n return dbFetchCell(\"SELECT `user_id` FROM `users` WHERE `username` = ?\", array($username));\n}", "function auth_mahasiswa($username,$password){\n\t\t$query=$this->db->query(\"SELECT * FROM member WHERE nim='$username' AND password=MD5('$password') LIMIT 1\");\n\t\treturn $query;\n\t}", "public function authenticate($username, $password){\n\t\t$verify_user_password_query = \"SELECT * from appuser WHERE username = $1 AND password = $2;\";\n\n\t\t$if_verified = pg_prepare($this->con, \"my_query1\", $verify_user_password_query);\n \t$if_verified = pg_execute($this->con, \"my_query1\", array($username,$password));\n \treturn $if_verified;\n\t}", "function authUser($username, $password) {\n try {\n $connString = \"mysql:host=localhost;dbname=knovak18\";\n $user = \"knovak18\";\n $pass = \"web2\";\n\n $pdo = new PDO($connString,$user,$pass);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"select * from rruser where Username=\\\"\" . $username . \"\\\"\";\n $result = $pdo->query($sql);\n\n while ($row = $result->fetch()) {\n if($row['Password'] == $password) {\n return true;\n } else {\n return false;\n }\n }\n $pdo = null;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n}", "public function checkCredentials($username, $password)\r\n {\r\n // could not be found in the database\r\n $userID = 0;\r\n $digest = 'choir';\r\n\r\n\t\tif ($username == 'viennapres') $userID = 1;\r\n \r\n return array ($userID, $username, $digest);\r\n }", "function auth($data){\n\t\t$sql=\"SELECT * \n\t\t\tFROM admin_users\n\t\t\tWHERE username='\".$data['username'].\"'\n\t\t\tAND password='\".$data['password'].\"'\n\t\t\tAND status=1\";\n\t\t$query=$this->db->query($sql);\n\t\t\n\t\treturn $query;\n\t}", "function getByUser($username) {\n $db = get_db();\n $sql = 'SELECT id, username, password\n FROM users\n WHERE username = :username';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':username', $username, PDO::PARAM_STR);\n $stmt->execute();\n $userData = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $userData;\n}", "function login ($username, $password) {\n \n # Open a connection to the database\n $conn = connect_to_database ();\n \n # Filter the inputs\n $username = mysqli_escape_string ($conn, $username);\n \n # Prepare the query\n $query = \"\n SELECT *\n FROM users\n WHERE\n user_username = '{$username}'\n \";\n \n $result = mysqli_query ($conn, $query);\n if (!$result) return FALSE;\n \n if (mysqli_num_rows ($result) == 0)\n return FALSE;\n \n # Disconnect from the database\n disconnect_from_database ($conn);\n \n # Associative array\n $result = mysqli_fetch_assoc ($result);\n \n if (!password_verify ($password, $result['user_password']))\n return FALSE;\n \n return $result;\n \n }", "public function getUserByUsername($username){\n $row = $this->db->run(\"SELECT id, password, secret, status, enabled FROM users WHERE username =? \", [$username])->fetch();\n return $row;\n }", "function authenticate_v2($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user;\n }\n }\n return false;\n }", "function LoginCheck($username, $password) //check if user is login\n{\n global $connect;\n $query = \"SELECT * FROM User WHERE Username = :username AND Password = :password\";\n try {\n $statement = $connect->prepare($query);\n $statement->bindValue(':username', $username, PDO::PARAM_STR);\n $statement->bindValue(':password', $password, PDO::PARAM_STR);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n $result = $statement->fetch();\n return $result;\n } else return false;\n } catch (PDOException $e) {\n }\n}", "function getUser($username, $password)\n{\n global $connection;\n\n $sql = \"SELECT * FROM tbl_users WHERE username='$username' AND password = '$password'\";\n $result = mysqli_query($connection, $sql);\n $user = mysqli_fetch_assoc($result);\n\n return $user; // return user\n}", "public function checkCredentials( $username, $password ){\n $mysqli = $this->connect();\n\n //real_escape_string to prevent sql injection\n $username = $mysqli->real_escape_string( $username );\n $password = $mysqli->real_escape_string( $password );\n\n //hashing the 'password' value\n $password = hash( 'sha512', $password );\n\n $query = 'SELECT * FROM tbl_users \n\t\t\t\t\t WHERE email = \"'. $username .'\" \n\t\t\t\t\t\tAND password = \"'. $password .'\"';\n $result = $mysqli->query($query);\n\n //if I get a result it means the credentials are right.\n if( $result->num_rows === 1 ){\n $this->message = $result;\n $this->username = $username;\n $this->status = True;\n }else{\n $this->status = False;\n }\n }", "function query_login($user, $pass){\n\t$conn = connect();\n\t$sql = \"select * from users u join persons p on u.person_id=p.person_id where user_name='\".$user.\"' and password='\".$pass.\"'\";\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\treturn FALSE;\n\t} else{\n\n\t\t//Fetches all \n\t\t$row = oci_fetch_assoc($statement);\n\t\tif (!$row){ //No results, user/pass pair invalid\n\t\t\t$ret['valid'] = FALSE;\n\t\t\t$ret['info'] = NULL;\n\t\t} else{\n\t\t\t$ret['valid'] = TRUE;\n\t\t\t$ret['info'] = $row;\n\t\t}\n\t} \n\n\toci_free_statement($statement);\n\toci_close($conn);\n\n\treturn $ret;\n}", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "function valid_credentials($user, $pass){\n\n $user = mysqli_real_escape_string($user, $_POST['username']);\n $pass = sha1($pass);\n\n $total = mysql_query(\"SELECT COUNT('user_id') FROM 'users' WHERE 'user_name' = '{$user}' AND 'user_password' = '{$pass}'\");\n\n return (mysql_result($total, 0) == '1') ? true : false;\n\n}", "function userAuthentication($name, $password)\n{\n global $db;\n $query = getAllUsers(); //Query for getting all users from the database\n $existingUsers = db_select($db, $query); //Array of all the users in the database\n //check if username exists and if password is matching\n foreach ($existingUsers as $value) {\n if ($value['username'] == $name) {\n //if input password matching with database password\n if (password_verify($password, $value['password'])) {\n //Create a new session (login user)\n $_SESSION['userId'] = $name;\n return true;\n } else {\n //password is not valid\n return false;\n }\n }\n }\n //username is not existing in the database\n return false;\n}", "public function checkuser($username , $password){\r\n $query = 'SELECT * FROM user_tbl WHERE username = ? AND password = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$username,$password]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n foreach ($users as $user){\r\n $this->set_session($user->name , $user->id);\r\n }\r\n }else{\r\n header(\"Location:login.php?errorlogin\");\r\n }\r\n }", "public function search($query=array()) {\r\n\t\tif (isset($query['password'])) {\r\n\t\t\t$query['password'] = md5($query['password']);\r\n\t\t}\r\n\t\treturn $this->db\r\n\t\t\t->where($query)\r\n\t\t\t->get($this->user_table)\r\n\t\t\t->result();\r\n\t}", "public function login($username, $password){\n\t\t\n\t\t$sql = \"\n\t\t\tSELECT \n\t\t\t\taccount.id as account_id,\t\t\t\t \n\t\t\t\taccount.password as password\n\t\t\tFROM account\t\t\t\n\t\t\tWHERE username = :username\n\t\t\";\n\t\t/*echo $sql;\n\t\t//prepare\n\t\t$stmt = $this->db->prepare($sql);\n\t\t//execute\n\t\t$stmt->execute(['username'=>$username]);\n\t\t//feth the executed code this should only return an associative array because we are using :FETCH_ASSOC.\n\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC); */\n\n\t\t\t$result = $this->executeQuery('select', $sql, ['username'=>$username]);\n\t\t\tprint_r($result);\n\n\n\t\t//CHECK IF $result is an array\n\t\tif(is_array($result)){\n\t\t\t\n\t\t\tif(count($result) > 0){\n\t\t\t\t\n\t\t\t\t$hashed_password = $result['password'];\n\t\t\t\tvar_dump( password_verify($password, $hashed_password));\n\n\t\t\t\t// verify if user exists and that given password is the same as the hashed password.\n\t\t\t\tif($username && password_verify($password, $hashed_password)){\n\t\t\t\t\t\n\t\t\t\t\t//start the session\n\t\t\t\t\tsession_start();\n\n\t\t\t\t\t//store the userdata in session variable\n\t\t\t\t\t$_SESSION['account_id'] = $result['account_id'];\n\t\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t\t$_SESSION['loggedin'] = true;\n\n\t\t\t\t\t//after the user will be logged in this page will show \n\t\t\t\t\theader(\"location: welcome.php\");\t\t\t\t\t\t\n\t\t\t\t\texit;\n\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn \"Incorrect username and/or password. Please change your input and try again.\";\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t// no matching user found in db. Make sure not to tell the user directly.\n\t\t\treturn \"Failed to login. Please try again\";\n\t\t}\n\t}", "function retrieveUser($username) {\r\n // Database connection\r\n $db = dbConnect();\r\n\r\n $sql = 'SELECT * FROM User WHERE username=:username';\r\n $sth = $db->prepare($sql);\r\n $sth->execute(array(':username' => $username));\r\n\r\n return $sth->fetch();\r\n}", "function loginSession($pass, $email) {\n include 'pdo.inc'; // create new pdo\n\n // create query to get data for relevant user email and hashed password\n $query = $pdo->prepare(\"SELECT * FROM members WHERE userEmail = :email AND userPass = SHA2(CONCAT(:pass,'4b3403665fea6'), 0)\");\n $query->bindValue(':email', $email);\n $query->bindValue(':pass', $pass);\n try {\n $query->execute();\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n return $query->rowCount() > 0; // return whether the user has been found\n}", "function log_in_a_user($user_email, $user_password){\n global $db;\n $user_password = md5($user_password);\n $sql = \"SELECT * FROM user WHERE user_email = '$user_email' AND user_password = '$user_password';\";\n $result = $db->query($sql)->fetch();\n return $result;\n \n}", "function mysql_auth_user_list()\n{\n return dbFetchRows(\"SELECT * FROM `users`\");\n}", "function authenticate($username, $pwd) {\n global $mysqli;\n return userExists($username) && passwordMatch($username, $pwd);\n}", "public function cekUser($username, $password)\n {\n $result = $this->db->query(\"SELECT * FROM tb_user WHERE username='$username' AND password = MD5('$password') \")->result_array();\n return $result;\n }", "public function login($username,$password) {\n\t\t$result = FALSE;\n\t\t$counter = 0;\n\t\t\n\t\t// sql statement with binding paramenter\n\t\t$sql = 'SELECT id FROM '.$this->tableName.' WHERE username = ? AND password = ?';\n\t\t$stmt = $this -> db -> prepare($sql);\n\t\t$stmt -> bind_param('ss',$username,$password);\n\t\t$stmt -> execute();\n\n\t\t// fetch the sql result\n\t\twhile ($stmt -> fetch()) {\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\tif ($counter != 0){\n\t\t\t$result = TRUE;\n\t\t}\n\n\t\t// close connection\n\t\t$stmt -> close();\n\n\t\t//resturn result\n\t\treturn $result;\n\t}", "function checkUser($userName, $password){\n\t\n\tglobal $usersTable;\n\tglobal $db;\n\t$selectQuery=\"select password from $usersTable where userName = '\" . $userName . \"'\";\n\t$resultSet = mysqli_query($db, $selectQuery) or die(mysqli_error($db));\n\t$row = mysqli_fetch_assoc($resultSet);\n\t\n\tif($password == $row[\"password\"]){\n\t\treturn true;\n\t}\n\t\t\t\n\treturn false;\n}", "public function user_login($username,$password){\n $sqlQuery= \"select * from Sidhus_Login_credentials where (mobileno='\".$username.\"' or emailId ='\".$username.\"') and (password='\".$password.\"')\";\n $result=$this->con->query($sqlQuery);\n $this->con->close();\n return $result;\n }", "public static function login($username, $password) {\n\t\t$conn = new mysqli ( $GLOBALS ['dbservername'], $GLOBALS ['dbusername'], $GLOBALS ['dbpassword'], $GLOBALS ['dbname'] );\n\t\t$sql = \"SELECT * FROM user WHERE username='$username'and password='$password'\";\n\t\techo $sql;\n\t\tif (empty ( $conn->query ( $sql ) ) === TRUE) {\n\t\t\techo \"No such user login fail\";\n\t\t\treturn false;\n\t\t} else {\n\t\t\techo \"login successful\";\n\t\t\treturn true;\n\t\t}\n\t\t$conn->close ();\n\t}", "public static function check_credentials($email_or_username, $password)\n {\n\n\n $password = Security::encrypt($password);\n\n $email_or_username = e($email_or_username);\n\n\n $sql = \"SELECT\n id, user_type\n FROM\n users\n WHERE\n password = '{$password}'\n AND(\n email = '{$email_or_username}'\n OR\n username = '{$email_or_username}')\n AND\n deleted = 0\n LIMIT\n 1\";\n\n\n return DB::query($sql);\n\n\n }", "public function findByCredentials($login, $password){\n $sql = sprintf(\"SELECT * FROM `%s` WHERE `login`='%s' AND `password`='%s'\", $this->tableName, $login, md5($password));\n\n return $this->dbo->setQuery($sql)->getResult($this);\n }", "function user_login($username, $password) {\n $db = connectDB();\n $stmt = $db->prepare('\n SELECT\n user_id,\n password_hash\n FROM\n users\n WHERE\n username = :username\n LIMIT\n 1\n ;\n ');\n $stmt->execute([':username' => $username]);\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if (empty($rows)) {\n return \"No such user.\";\n }\n $password_hash = $rows[0]['password_hash'];\n if (!password_verify($password, $password_hash)) {\n return \"Incorrect password.\";\n }\n $_SESSION['logged_in'] = TRUE;\n $_SESSION['user_id'] = $rows[0]['user_id'];\n $_SESSION['username'] = $username;\n return TRUE;\n}", "function confirmUser($user,$pass){\n\tmysql_query(\"SELECT * from users WHERE uid='$user' AND pass='$pass'\");\n}", "function getUserData($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id, username, email, firstname, lastname, level FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return $urow;\n }\n}", "static public function find_by_username($userName, $password) {\n\t$sql = \"SELECT * FROM \" . static::$table_name;\n\t$sql .= \" WHERE userName='\" . self::$database->escape_string($userName) . \"' AND password='\" . self::$database->escape_string($password) . \"'\";\n\t$obj_array = static::find_by_sql($sql);\n\tif(!empty($obj_array)){\n\t\treturn array_shift($obj_array);\n\n\t} else {\n\t\treturn false;\n\t}\n}", "public function log_in_check($conn,$select_columns,$table,$user_column,$password_column,$username,$password){\r\n\r\n $query=\"SELECT \" .$select_columns.\" FROM \" .$table.\" WHERE \".$user_column.\" =:e AND \" .$password_column.\" =:p \";\r\n $get=$conn->prepare($query);\r\n $get->bindParam(\":e\",$username);\r\n $get->bindParam(\":p\",$password);\r\n $get->execute();\r\n $data = $get->fetchAll(PDO::FETCH_ASSOC); \r\n return $data; \r\n }", "public function getUser($username)\r\n {\r\n\r\n $stmt = $this->connection()->prepare(\"SELECT * FROM users WHERE username=? OR email=?\");\r\n \r\n $stmt->execute([$username,$username]);\r\n if($stmt->rowCount())\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function verify_username($db, $username, $password) {\n $query = \"SELECT password, uuid, username FROM users WHERE username=? LIMIT 1\";\n if ($statement = $db->prepare($query)) {\n $statement->bind_param(\"s\", $username);\n $statement->execute();\n $statement->store_result();\n if($statement->num_rows > 0) {\n $statement->bind_result($hash, $uuid, $username);\n $statement->fetch();\n if (password_verify($password, $hash)) {\n $_SESSION[\"uuid\"] = $uuid;\n $_SESSION[\"username\"] = $username;\n header('Location: ../../home');\n return false;\n } else {\n return true;\n }\n $statement->close();\n }\n return true;\n } else {\n //Dump the database error, probably not a good idea but for development its okay\n echo var_dump($db->error);\n }\n}", "function getCredentialsAreValid($username, $password) {\r\n global $db;\r\n\r\n //phpAlert(\"building query string\");\r\n // Query String\r\n $query = \"SELECT * FROM system_user WHERE system_user_name = '$username';\";\r\n\r\n //phpAlert(\"query string is: \" . $query);\r\n \r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n //phpAlert(\"Account exists, verifying password\");\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['system_user_password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function f_get_seg_usuario_password(\n\t\t\t\t$txt_login,\n\t\t\t\t$txt_password\t\t\n\t\t){\n\t\t\tglobal $db;\n\t\t\t$query =\"\n\t\t\tselect \t*\n\t\t\tfrom\tseg_usuario\n\t\t\twhere\ttxt_password\t=\tpassword(SHA('$txt_password'))\n\t\t\tand\t\ttxt_login\t\t=\t'$txt_login'\";\n\t\t\t$row = $db->consultar_registro($query);\t\n\t\t\treturn $row;\n\t\t}", "public function authenticate() {\n\t\t \n\t\t$db = db_connect();\n $query= \"SELECT * FROM users WHERE username=:username AND password=:password\";\n $statement=$db->prepare($query);\n $statement->execute(array(\n 'username' => $_POST['username'],'password' => $_POST['password']\n ));\n $count=$statement->rowCount();\n if($count>0){\n $_SESSION['username']=$_POST['username'];\n $_SESSION['is authenticated']= true;\n\t\t}\n }", "function DBUserLogin($Username, $Password){\n $sql = \"SELECT Password FROM Users WHERE Username = ?\";\n $param_type_array = array(\"s\");\n $param_array = array($Username);\n $return = GenericSQL($sql, $param_type_array, $param_array, SQL_SELECT);\n \n if($return === FAILURE){\n return FAILURE;\n }else{\n $decoded_json = json_decode($return);\n $returned_password = $decoded_json;\n\n if($decoded_json !== NULL && hash_equals($decoded_json[0]->Password, crypt($Password, $decoded_json[0]->Password))){\n return SUCCESS;\n }else{\n return LOGIN_FAILED;\n }\n }\n}", "function checkIfValidUserAndPasswordWithHttpBasicAuth()\n{\n $con = getMySqliConnection();\n\n $myusername = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_USER']);\n $mypassword = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_PW']);\n //encrypt password\n $mypassword = md5($mypassword);\n\n $sql = \"\";\n $sql .= \"SELECT * \";\n $sql .= \"FROM members \";\n $sql .= \"WHERE username = '$myusername' \";\n $sql .= \" AND PASSWORD = '$mypassword' \";\n $sql .= \" AND active = 1 \";\n\n $result = mysqli_query($con,$sql);\n\n if ($result != FALSE) {\n $count = mysqli_num_rows($result);\n }\n mysqli_close($con);\n // Mysql_num_row is counting table row\n\n\n // If result matched $myusername and $mypassword, table row must be 1 row\n\n if ($count == 1) {\n return true;\n }\n else\n {\n return false;\n }\n}", "function login_user($username, $password)\n{\n global $db_link;\n\t$hashed_password = sha1 ($password);\n $select_query = 'SELECT user_id, username, email FROM '.TBL_USERS.'\n WHERE `username`=\"'.addslashes($username).'\"\n AND `password`=\"'.addslashes($hashed_password).'\"';\n\n $result = mysql_query($select_query);\n if(mysql_num_rows($result) == 0)\n {\n return 'Invalid login credentials';\n }\n\n $row = mysql_fetch_assoc($result);\n\n // Save the user's data into the 'user' key of our session data\n $_SESSION['user'] = $row;\n return $row;\n}", "protected function checkCredentials ($username,$password) {\n\t\t$sql = \"SELECT user_name,user_password FROM users\n\t\t\t\tWHERE user_name = ? AND user_password = MD5(?)\";\n\t\t$data = [$username,$password];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$statement = $this->setStatement($sql,$data);\n\t\t\tif ( $statement->rowCount() > 0 ) {\n\t\t\t\t$out = true;\n\t\t\t} else {\n\t\t\t\t$out = false;\n\t}\n\t\treturn $out;\n\t}", "function getPasswordForUser($username) {\n\t\t$error = 0;\n\t\t$dbhandle = new SQLite3(\"./users.db\");\n\n\t\t$stm = \"SELECT password from users where username = \\\"$username\\\"\";\n\n\t\t$res = $dbhandle->query($stm);\n\t\t$e = $dbhandle->lastErrorMsg();\n\t\tif (!$res) die(\"Cannot execute statemen $e t. $stm\" . $e);\n\n\t\twhile($row = $res->fetchArray(SQLITE3_NUM)) {\n\t\t\treturn $row[0];\n\t\t} \n\t\treturn \"\";\n\t}", "function login() {\n $username = Slim::getInstance()->request()->post('username');\n $password = Slim::getInstance()->request()->post('password');\n\n try {\n $db = getConnection();\n\n\t$sql = \"SELECT userId FROM users WHERE username=:username\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->bindParam(\"username\", $username);\n\t$stmt->execute();\n\t$username_test = $stmt->fetchObject();\n\tif(empty($username_test)) {\n\t\techo \"error_username_doesnt_exists\";\n\t\treturn;\n\t}\n\n\t$sql = \"SELECT password FROM users WHERE username=:username\";\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"username\", $username);\n $stmt->execute();\n $storedPassword = $stmt->fetchObject()->password;\n\n if(empty($storedPassword)) {\n echo \"null\";\n } else if(strcmp($password, $storedPassword) == 0) {\n\t\t $query = \"SELECT userId FROM users WHERE username=:username\";\n\t\t $stmt2 = $db->prepare($query);\n\t\t $stmt2->bindParam(\"username\", $username);\n\t\t $stmt2->execute();\n \t echo '{\"Username\": \"' . $username . '\", \"ID\": ' . $stmt2->fetchObject()->userId . '}'; \n } else {\n\t\techo \"null\";\n\t}\n\n $db = null;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n }\n}", "function checkLogginData($username, $password, $connection) {\n $q = mysqli_query($connection, 'SELECT user_name, user_password, user_id\nFROM users \nWHERE user_name = \"' . $username . '\" AND user_password = \"' . $password . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка с базата данни!!!';\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n $row = $q->fetch_assoc();\n $_SESSION['username'] = $row['user_name'];\n $_SESSION['user_id'] = $row['user_id'];\n return true;\n }\n }\n}" ]
[ "0.7676361", "0.75273454", "0.74291456", "0.7352666", "0.7316991", "0.7304728", "0.7238823", "0.72100663", "0.7201302", "0.714333", "0.7124845", "0.7103535", "0.7060701", "0.70584565", "0.70290756", "0.70230603", "0.698808", "0.69865906", "0.69721097", "0.6931977", "0.692959", "0.6900959", "0.68963754", "0.68865234", "0.68809515", "0.6879528", "0.68688285", "0.6868389", "0.68663", "0.68599224", "0.6857996", "0.6857518", "0.68473643", "0.6847054", "0.68465596", "0.6844881", "0.683491", "0.68335664", "0.6833006", "0.6832792", "0.682494", "0.6821224", "0.6820136", "0.6814815", "0.681201", "0.6809773", "0.68046844", "0.6802261", "0.680014", "0.6795715", "0.67952925", "0.67921335", "0.6777044", "0.6768524", "0.6750626", "0.67399836", "0.6729208", "0.6727427", "0.67231995", "0.672191", "0.6719414", "0.671267", "0.6707345", "0.6688135", "0.6656958", "0.6655544", "0.6651494", "0.66497046", "0.6641467", "0.6641022", "0.6622655", "0.6622614", "0.6619518", "0.6606015", "0.66048026", "0.6586925", "0.6580869", "0.65781385", "0.6572949", "0.6572649", "0.65717465", "0.6564796", "0.65620047", "0.6559574", "0.65577507", "0.6549181", "0.65487194", "0.6545715", "0.653578", "0.651705", "0.65129894", "0.65035486", "0.65000844", "0.6497133", "0.6491839", "0.6491604", "0.64866185", "0.64863104", "0.6483731", "0.64809185", "0.64699197" ]
0.0
-1
Get CB Product ID
public function getCbProductId($magentoProductId) { $productMapper = $this->_productMapperFactory->create(); $this->_productMapperResource->load( $productMapper, $magentoProductId, 'magento_product_id' ); return $productMapper->getId() ? $productMapper->getCbProductId() : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductID()\n {\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductid() {\n\t\treturn $this->productid;\n\t}", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}", "public function getProductID()\n {\n if ($product = $this->Product()) {\n return $product->ID;\n }\n return 0;\n }", "function getProdId($product){\r\n require '../../model/dbconnect.php';\r\n $prod = $db->quote($product);\r\n $rows_prod = $db->query(\"SELECT id FROM product WHERE name = $prod\");\r\n if ($rows_prod) {\r\n foreach($rows_prod as $row)\r\n return $row['id'];\r\n }\r\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function getId()\n {\n return $this->idProduct;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getId_product()\n {\n return $this->id_product;\n }", "public function get_product_id() {\n return $this->product_id;\n }", "public function getProdId()\n {\n return $this->prod_id;\n }", "protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }", "public function getProductId(): string\n {\n return $this->productId;\n }", "function product_id($product_id=null)\n {\n if (isset($product_id)) $this->product_id = $product_id;\n return $this->product_id;\n }", "function getProductuuid()\n {\n return $this->product_uuid;\n }", "public function getProductId()\n {\n return $this->product_id;\n }", "public function getProductId()\n {\n return $this->product_id;\n }", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "public function getProductId(){\n return $this->product_id;\n }", "public function getProductuuid(){\n return $this->productuuid;\n }", "function getProductId($product_name)\n\t{\n\t\tglobal $log;\n $log->info(\"in getProductId \".$product_name);\n\t\tglobal $adb;\n\t\tif($product_name != '')\n\t\t{\n\t\t\t$sql = \"select productid from ec_products where productname='\".$product_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$productid = $adb->query_result($result,0,\"productid\");\n\t\t}\n\t\treturn $productid;\n\t}", "public function getProductId() {\n\t\treturn($this->productId);\n\t}", "public function getProductId()\n {\n $value = $this->get(self::product_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getProductReferenceID()\n {\n return $this->productReferenceID;\n }", "public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}", "function getId_Producto(){\r\n\t\treturn $this->nId_Producto;\r\n\t}", "function get_product_id( $dsn, $product_name ) {\n\t$db =& MDB2::factory($dsn);\n\t\n\tif (DB::isError($db)) {\n\t\tdie ($db->getMessage());\n\t}\n\n\t$sql = \"SELECT id FROM products WHERE name = '\" . $product_name . \"'\";\n\n\treturn $db->queryOne($sql);\n\n}", "function getProductCode()\n {\n return $this->productCode;\n }", "public function getProductsId()\n {\n return $this->productsId;\n }", "public function get_productId(): int\n {\n // $res is a int;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductId();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTID_INVALID;\n }\n }\n $res = $this->_productId;\n return $res;\n }", "protected function getProductLoadId()\n {\n $product = $this->locator->getProduct();\n if (method_exists($product, 'getData')) {\n return $product->getData($this->getProductLinkField());\n }\n }", "public function getId(){\n return $this->__get('catalog_id');\n }", "public function getProductId() {\n return $this->item->getProductId();\n }", "public function getPrimaryKey()\n {\n return $this->getProdId();\n }", "public function getProductId() : int\n {\n return (int)$this->getProduct()->getId();\n }", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "public function getProductId(): string;", "public function getProductId()\n {\n $productIdAttribute = $this->helper->getProductIdConfig();\n\n return $this->getAttribute($productIdAttribute);\n }", "function get_product_by_id($product_id) {\r\n try {\r\n $params[0] = array(\"name\" => \":prod_id\", \"value\" => &$product_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_product_by_id(:prod_id)\", $params);\r\n } catch (Exception $ex) {\r\n echo \">>\" . ex;\r\n }\r\n }", "public function getProductIdFieldName() {\n return 'products_id';\n }", "public function getId() : string\n {\n return $this->get('id', 'products');\n }", "public function getProductDetailId()\n {\n return $this->product_detail_id;\n }", "public function getProductOptionId();", "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getProductId()\n {\n $product = Mage::registry('current_product');\n if ($product) {\n return $product->getId();\n }\n return false;\n }", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "public function getProductId(): int;", "private function getProductIdentifierField()\n {\n if (!$this->productEntityIdentifierField) {\n $this->productEntityIdentifierField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getIdentifierField();\n }\n return $this->productEntityIdentifierField;\n }", "public function getButtonId($productId)\n {\n return 'nbn-button-' . $productId;\n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "public function getDefaultProductID() {\n return self::$defaultProductID;\n }", "public function getVendorId() {}", "public function getId() : int\n {\n return $this->getValue('nb_commerce_product_category_id');\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "function get_baskets_products_id($p_products_id, $p_combis_id)\n\t{\n\t\t# sample: 1{2}6{1}3x56\n\t\t$t_output_id = $p_products_id . $this->v_id_seperator . $p_combis_id;\n\t\t\n\t\t$t_output_id = strip_tags($t_output_id);\n\t\treturn $t_output_id;\n\t}", "public function getProductNum()\n {\n $value = $this->get(self::product_num);\n return $value === null ? (integer)$value : $value;\n }", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getProducts_prid() {\n\t\treturn $this->products_prid;\n\t}", "public function get_product_id() : array {\n\t\tif ( ! empty( $this->product_id ) ) {\n\t\t\treturn [ 'ID' => $this->product_id ];\n\t\t}\n\n\t\tpreg_match( '/runParams\\.productId=\"(.*?)\";/s', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn [ 'ID' => '' ];\n\t\t}\n\n\t\t$this->product_id = $matches[1];\n\n\t\treturn [ 'ID' => $matches[1] ];\n\t}", "public function getModelIdentifier()\n {\n return Cart::getIdentifierByClassName('ProductsIdentifier');\n }", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function getProductFnacId()\n {\n return $this->product_fnac_id;\n }", "public function getProductID($productCode){\n\t\t$select = $this->_db->select()\n\t\t->from($this->_name,array('*'))\n\t\t->where('code_product LIKE ?',$productCode);\n\t\t$result = $this->getAdapter()->fetchAll($select);\n\t\t\n\t\tif(!$result){return false;}\n\t\t\n\t\treturn $result[0]['id_product'];\t\n\t\t\n\t}", "public function getProductID($name){\n try{\n $sql = \"Select * from product where product_name = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$name]);\n\n $result = $stm->fetch();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProduct');\n $result = 2;\n }\n\n return $result->id_product;\n }", "public function getProductId(): ?string\n {\n return isset($this->ProductId) ? $this->ProductId : null;\n }", "public function getProductId(): ?string\n {\n return isset($this->ProductId) ? $this->ProductId : null;\n }", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "public function getProduitid()\n {\n return $this->produitid;\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getPrimaryProductId()\n {\n return $this->primary_product_id;\n }", "public function retrieve_product_batchid()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$batch_id = $this->input->post('batch_id');\n\t\t$product_info = $CI->Invoices->get_total_product_batch($batch_id);\n\t\techo json_encode($product_info);\n\t}", "public function getFieldId()\n {\n \treturn 'product_vendor';\n }", "function wcs_get_order_items_product_id( $item_id ) {\n\tglobal $wpdb;\n\n\t$product_id = $wpdb->get_var( $wpdb->prepare(\n\t\t\"SELECT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta\n\t\t WHERE order_item_id = %d\n\t\t AND meta_key = '_product_id'\",\n\t\t$item_id\n\t) );\n\n\treturn $product_id;\n}", "public function getProductId($item, $product) \n {\n\t$productId = null;\n\tif ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {\n\t //try getting from selected simple product first\n\t $simpleProduct = Mage::helper('temando/v2')->getSelectedSimpleFromConfigurable($product, $item);\n\t $productId = $simpleProduct->getEntityId();\n\t}\n\t\n\tif(!$productId) {\n\t $productId = $item->getProductId();\n\t}\n\t\n\treturn $productId;\n }", "public function getIdProduto()\n\t\t{\n\t\t\treturn $this -> idproduto;\n\t\t}", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "function wcs_get_canonical_product_id( $item_or_product ) {\n\n\tif ( is_a( $item_or_product, 'WC_Product' ) ) {\n\t\t$product_id = $item_or_product->get_id(); // WC_Product::get_id(), introduced in WC 2.5+, will return the variation ID by default\n\t} elseif ( is_a( $item_or_product, 'WC_Order_Item' ) ) { // order line item in WC 3.0+\n\t\t$product_id = ( $item_or_product->get_variation_id() ) ? $item_or_product->get_variation_id() : $item_or_product->get_product_id();\n\t} else { // order line item in WC < 3.0\n\t\t$product_id = ( ! empty( $item_or_product['variation_id'] ) ) ? $item_or_product['variation_id'] : $item_or_product['product_id'];\n\t}\n\n\treturn $product_id;\n}", "public function getCommerceId() : int\n {\n return $this->getValue('nb_commerce_id');\n }", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function getDocumentProductCod()\n {\n return (string) $this->document_product_cod;\n }", "function get_product_id_by_cat($cat_id) \n {\n global $db;\n $query = \"SELECT productID FROM tblproduct WHERE catID = '$cat_id'\";\n $result = $db -> query($query);\n return $result;\n }", "public function getProductById(int $id);", "public function getId_produto()\n {\n return $this->id_produto;\n }", "public function getProduct($_ID)\n {\n $return = $this->getUnique(\"products\", $_ID);\n return $return;\n }", "function find_product($globillnet_id) {\n\n global $db;\n\n $product_id = null;\n $products = $db->get_products_list();\n\n foreach ($products as $product) {\n if (isset($product['globillnet_id']) && $product['globillnet_id']==$globillnet_id) {\n $product_id = $product['product_id'];\n break;\n }\n }\n\n $result = ( $product_id ) ? $product_id : false ;\n\n return $result;\n }" ]
[ "0.8022957", "0.785412", "0.785412", "0.785412", "0.7822302", "0.76422435", "0.75846136", "0.75568646", "0.75454575", "0.75327927", "0.75327927", "0.75327927", "0.74992794", "0.7483724", "0.7481031", "0.7454113", "0.7406468", "0.7388701", "0.72725374", "0.7237655", "0.72124404", "0.71978337", "0.7191679", "0.7163434", "0.7163434", "0.7089944", "0.70865214", "0.7072205", "0.7062223", "0.70121217", "0.6986553", "0.69632167", "0.69593346", "0.69520885", "0.694593", "0.69308937", "0.68843347", "0.68733954", "0.68620646", "0.6831081", "0.6823864", "0.6823537", "0.6815765", "0.680857", "0.68027574", "0.68018603", "0.6772102", "0.6753057", "0.67480534", "0.67425203", "0.6738742", "0.67294395", "0.67092764", "0.67092764", "0.66618717", "0.6631771", "0.66276073", "0.66210717", "0.65953", "0.6584273", "0.6555642", "0.65394646", "0.6513773", "0.6500908", "0.648344", "0.6467724", "0.64665085", "0.6441638", "0.6441638", "0.6427218", "0.6420179", "0.64148563", "0.64119846", "0.63523144", "0.6350089", "0.6329883", "0.63274467", "0.6316242", "0.6316242", "0.6310305", "0.6300438", "0.6299072", "0.62973046", "0.6297027", "0.62921005", "0.62908214", "0.6289084", "0.6284469", "0.6282546", "0.6281103", "0.6256476", "0.6254656", "0.6245387", "0.6227891", "0.62260437", "0.622183", "0.6212515", "0.6206204", "0.61833686", "0.6155347" ]
0.6422121
70
List is sorted by title
public function getCbProducts() { $model = KenedoModel::getModel('ConfigboxModelAdminProducts'); return $model->getRecords( array(), array(), array(array('propertyName' => 'title', 'direction', 'ASC')) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSortByTitle()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setTitle('B');\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setTitle('A');\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setTitle('C');\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_MANUFACTURE);\n\n $this->assertEquals($item2, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item3, $sorted[2]);\n }", "function _titlesort($a,$b){\n $ta = $this->_meta($a,'title');\n $tb = $this->_meta($b,'title');\n return strcmp($ta,$tb);\n }", "static function order_content_objects_by_title($objects)\r\n {\r\n usort($objects, array(get_class(), 'by_title'));\r\n }", "public function sort();", "function wp_list_sort($input_list, $orderby = array(), $order = 'ASC', $preserve_keys = \\false)\n {\n }", "public function getXXXOrdering()\n\t{\n\t\treturn array('title_asc', 'title_desc');\n\t}", "public function sort() {\n sort($this->items, SORT_STRING);\n }", "public function asort() {}", "public function getSortBy();", "function by_title($a, $b) {\r\n\treturn ($a[1] == $b[1]) ? strcmp($a[0], $b[0]) : ($a[1] > $b[1]);\r\n}", "public function allRecordsByTitle(){\n\t $news = collect(DB::table('news')->get());\n\t return $news->sortBy('title');\n }", "public abstract function create_list($title);", "public function getTitlesList() {\n return $this->_get(2);\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 usort_posts_by_title($postA, $postB) {\n return strcmp(strtolower($postA->post_title), strtolower($postB->post_title));\n}", "public function getSorting();", "private function _sort_by_title($a, $b)\n {\n $t_a = $t_b = \"ZZZZ\";\n\n if($a['omdb'] && array_key_exists(\"Title\", $a['omdb']))\n {\n $t_a = $a['omdb']['Title'];\n }\n\n if($b['omdb'] && array_key_exists(\"Title\", $b['omdb']))\n {\n $t_b = $b['omdb']['Title'];\n }\n\n if($this->sorting_order == \"az\")\n {\n return strnatcmp($t_a, $t_b);\n }\n\n return strnatcmp($t_b, $t_a);\n }", "function SortNameList ( ) { return $this->_SortNameList; }", "public function getDataForTitleSortAlgo()\n {\n return array(\n array('Le titre test', 'titre test, Le', 'fr'),\n array('The title test', 'title test, The', 'en'),\n array('The title test', 'title test, The', false),\n );\n }", "function sortByItem($channel) \n{\n foreach ($channel['item'] as $item) {\n\n // Make an array of an object\n $arrayOfItems = (array) $item;\n\n // Push title properties into new array.\n $arr[] = $arrayOfItems['title'];\n\n // Make comparison, sort if true\n usort($arr, 'compare');\n }\n\n $json = json_encode($arr, JSON_PRETTY_PRINT);\n return $json;\n}", "function logSorter_sort($list) {\n uasort($list, 'logSorter_cmpFiles');\n return $list;\n}", "public function titleList($page = NULL) {\n\t\tglobal $db;\n\t\t\n\t\t$qry = \"SELECT title FROM $this->table\";\n\t\t\n\t\tif (! empty ( $page )) {\n\t\t\t$qry .= \" WHERE page = '$page'\";\n\t\t}\n\t\t\n\t\tif ($this->orderby) {\n\t\t\t$qry .= \" ORDER BY $this->orderby\";\n\t\t}\n\t\t\n\t\t// echo $qry;\n\t\tif ($result = $db->query ( $qry )) {\n\t\t\twhile ( $row = $result->fetch_assoc () ) {\n\t\t\t\t$data [] = $row ['title'];\n\t\t\t}\n\t\t} \n\n\t\telse {\n\t\t\techo \"Fehler in titleList! \" . $db->error;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "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}", "function adleex_resource_list_column_sort($cols) {\nglobal $current_screen;\n\t\n\tif ($current_screen->post_type!='resource') return $cols;\n\n\t$order = array(\n 'post_title' => true, );\n\tforeach($order\tas $k => $v) $cols[$k]=true;\n\treturn $cols;\n}", "public function orderTitle()\n\t{\n\t\t$this->addOrderBy(['article.title'=>SORT_ASC]);\n\t\treturn $this;\n\t}", "function sortZyxRelNew($a, $b)\n{\n\tif($a['title'] == $b['title']) \n\t{ \n\t\tif($a['relevance'] == $b['relevance']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n\t}\n\treturn ($a['title'] < $b['title']) ? 1 : -1;\n}", "function shows_alphabetical( $orderby )\n{\n if( !is_admin() && is_post_type_archive( \"shows\" ) ){\n // alphabetical order by post title\n return \"post_title ASC\";\n }\n else return $orderby;\n}", "public function asort()\n {\n }", "private function getChildList(){\n\t\tif ($this->_childList == null) {\n\t\t\t$this->_childList = $this->getStructureNode()->getChildren();\n\t\t\t$this->_childList = $this->_childList->sort(array(\n\t\t\t\tnew SortRule($this->_childList->exprMember('title'))));\n\t\t}\n\t\treturn $this->_childList;\n\t}", "public function sort_list()\r\n {\r\n return view( $this->_skin .'.web.help_sort');\r\n }", "abstract public function prepareSort();", "public function multiLoadTitles() {\n\t\t$table = self::table;\n\t\t\n\t\t$query = <<<SQL\nSELECT `id`, `course`, `number`, `title` FROM `%s{$table}` ORDER BY `title` ASC\nSQL;\n\n\t\treturn $this->clean($this->getUsingQuery($query));\n\t}", "public function order();", "public function getTitleList()\n {\n return $this->getAllExternal('res.partner.title');\n }", "public function natsort()\n {\n }", "public function sortLists () {\n\t\tuasort($this->layerList, array(\"WmsLayer\", \"compareNames\"));\n\t}", "protected function sortForListing($contents)\n {\n usort($contents, function ($a, $b) {\n // Sort by type\n $c = strcmp($a['type'], $b['type']);\n if ($c !== 0) {\n return $c;\n }\n\n // Sort by name\n return strcmp($a['filename'], $b['filename']);\n });\n\n return $contents;\n }", "protected function orderList()\n {\n return ksort($this->callbackList, \\SORT_REGULAR);\n }", "public function testSortNamesList(): void\n {\n $result = $this->sorter->sortList(self::UNSORTED_NAMES_LIST);\n self::assertSame(\n // Don't tab the names list;\n // Good practice for unit test doesn't transform the expected result in any way.\n <<<SORTED\nMarin Alvarez\nAdonis Julius Archer\nBeau Tristan Bentley\nHunter Uriah Mathew Clarke\nLeo Gardner\nVaughn Lewis\nLondon Lindsey\nMikayla Lopez\nJanet Parsons\nFrankie Conner Ritter\nShelby Nathan Yoder\nSORTED,\n $result\n );\n }", "function sortAbcRelNew($a, $b)\n{\n\tif($a['title'] == $b['title']) \n\t{ \n\t\tif($a['relevance'] == $b['relevance']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n\t}\n\treturn ($a['title'] > $b['title']) ? 1 : -1;\n}", "function getPageNames()\n{\n $all = array_merge(getSinglepageNames(), getMultipageNames());\n uasort($all,'cmpByName');\n return $all;\n}", "private function getStatusTitles()\n {\n $statuses = $this->getSortedStatuses();\n // get all of their titles\n $titles = array_map(function($s) {\n return $s->getTitle();\n }, $statuses);\n // remove duplications\n return array_unique($titles);\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 static function sortables()\n {\n return ['id', 'module_name'];\n }", "public function sortResults(array $results, $order = 'ASC');", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "public function titleQuery() {\n $titles = [];\n\n $results = $this->database->query('SELECT cr.vid, cr.nid, cr.title FROM {catalog_item_revision} cr WHERE cr.vid IN ( :vids[] )', [':vids[]' => $this->value])->fetchAllAssoc('vid', PDO::FETCH_ASSOC);\n $nids = [];\n foreach ($results as $result) {\n $nids[] = $result['nid'];\n }\n\n $catalog_items = $this->catalog_itemStorage->loadMultiple(array_unique($nids));\n\n foreach ($results as $result) {\n $catalog_items[$result['nid']]->set('title', $result['title']);\n $titles[] = $catalog_items[$result['nid']]->label();\n }\n\n return $titles;\n }", "public static function sort_all($a, $b){\n if($a->type == \"book\" && $b->type == \"book\"){\n if (!empty($a->series)){\n if (!empty($b->series)){\n return (strtolower($a->series) == strtolower($b->series)) ? ($a->volume > $b->volume) : strtolower($a->series) > strtolower($b->series);\n }else{\n return (strtolower($a->series) == strtolower($b->title)) ? ($a->volume > $b->volume) : strtolower($a->series) > strtolower($b->title);\n }\n }else{\n if (!empty($b->series)){\n return (strtolower($a->title) == strtolower($b->series)) ? ($a->volume > $b->volume) : strtolower($a->title) > strtolower($b->series);\n }else{\n return (strtolower($a->title) == strtolower($b->title)) ? ($a->volume > $b->volume) : strtolower($a->title) > strtolower($b->title);\n }\n }\n }else if ($a->type == \"movie\" && $b->type == \"movie\"){\n return (strtolower($a->title) == strtolower($b->title)) ? ($a->season > $b->season) : strtolower($a->title) > strtolower($b->title);\n }else{\n return strtolower($a->title) > strtolower($b->title);\n }\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}", "public function testSorting()\r\n\t{\r\n\t\t$this->assertAttributeCount( 0, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// add dummy data\r\n\t\t$this->dummyData( true );\r\n\r\n\t\t// check count\r\n\t\t$this->assertEquals( 5, $this->list->count() );\r\n\r\n\t\t// check number items in priority table\r\n\t\t$this->assertAttributeCount( 5, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// force a sort\r\n\t\t$this->assertNull( $this->list->rewind() );\r\n\r\n\t\t// check priority sorting toggle, should be off\r\n\t\t$this->assertAttributeEquals( false, 'priority_resort', $this->list );\r\n\t}", "function sortRelZyxNew($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['title'] == $b['title']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['title'] < $b['title']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "public function getTitle()\n\t{\n\t\treturn 'Sort Data';\n\t}", "function sortWords($list) {\n\t\t$len = count($list);\n\t\tfor ($i = 0; $i < $len-1; $i++) \n\t\t\tfor ($j = $i+1; $j < $len; $j++) \n\t\t\t\tif (strnatcasecmp($list[$i], $list[$j]) > 0) {\n\t\t\t\t\t$temp = $list[$i];\n\t\t\t\t\t$list[$i] = $list[$j];\n\t\t\t\t\t$list[$j] = $temp;\n\t\t\t\t}\n\t\treturn $list;\n\t}", "function listTitles($parameter)\n\t\t{\n\t\t\t$parameter = decodeAscii($parameter);\n\t\t\t$tabParameter = split(\" id:\", $parameter);\n\t\t\t//suppression du premier élement qui correspond à la requette\n\t\t\tarray_shift($tabParameter);\n\n\n\t\t\tforeach ($tabParameter as $key => $value) \n\t\t\t{\n\t\t\t\t//$titleId = substr($tabParameter[$key], 0,strpos($tabParameter[$key], ' '));\n\t\t\t\t$titleId = substr($value, 0, strpos($value, \" \"));\n\t\t\t\t//echo \"contenu de id $id \\n\";\n\t\t\t\t//$artwork = get_string_between($tabParameter[$key],\"track_id:\",\" title\");\n\t\t\t\t//echo \"contenu de artwork $artwork \\n\";\n\t\t\t\t$title = get_string_between($value,\"title:\",\" genre:\");\n\t\t\t\t//echo \"contenu de title $title \\n\";\n\t\t\t\t$artist = get_string_between($value,\" artist:\",\" album:\");\n\n\t\t\techo \"<ul id=\\\"$title|$titleId\\\">\";\n\t\t\techo \"<li class=\\\"genre\\\" id=\\\"$title|$titleId\\\">Titre:$title Artist:$artist</li>\";\n\t\t\techo \"<img class=\\\"button\\\" id=\\\"buttonAddTitle\\\" src=\\\"1_music/view/images/player/plus.png\\\">\";\n\t\t\techo \"</ul>\";\n\n\n\t\t\t}\n\n\n\n\t\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}", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "function tpps_details_tags_sort() {\n $output = \"\";\n\n $query = db_select('tpps_tag', 't')\n ->fields('t')\n ->orderBy('static', 'DESC')\n ->orderBy('tpps_tag_id')\n ->execute();\n $tags = array();\n while (($result = $query->fetchObject())) {\n $tags[$result->tpps_tag_id] = array(\n 'id' => $result->tpps_tag_id,\n 'name' => $result->name,\n 'color' => $result->color,\n 'static' => $result->static,\n );\n }\n\n $output .= tpps_show_tags($tags);\n\n return \"<label for=\\\"tpps-tags-filter\\\">Sort by tags:</label><div id=\\\"tpps-tags-filter\\\">\" . $output . \"</div>\";\n}", "public function &getOrderBy();", "public function testSortNamesListWithDuplicateSurnames(): void\n {\n $result = $this->sorter->sortList(\n <<<LIST\nJanet Parsons\nVaughn Lewis\nWaughn Lewis\nAdonis Julius Archer\nShelby Nathan Yoder\nShelby Mathan Yoder\nMarin Alvarez\nLondon Lindsey\nBeau Tristan Bentley\nLeo Gardner\nHunter Uriah Mathew Clarke\nHunter Uriah Nathew Clarke\nMikayla Lopez\nFrankie Conner Ritter\nLIST\n );\n self::assertSame(\n // Don't tab the names list;\n // Good practice for unit test doesn't transform the expected result in any way.\n <<<SORTED\nMarin Alvarez\nAdonis Julius Archer\nBeau Tristan Bentley\nHunter Uriah Mathew Clarke\nHunter Uriah Nathew Clarke\nLeo Gardner\nVaughn Lewis\nWaughn Lewis\nLondon Lindsey\nMikayla Lopez\nJanet Parsons\nFrankie Conner Ritter\nShelby Mathan Yoder\nShelby Nathan Yoder\nSORTED,\n $result\n );\n }", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "public function sortPapers(){\r\n\t\t// Either manualSort or sortByAuthorName\r\n\t\t$this->sortByAuthorName();\r\n\t}", "public function sortOptions() {\n $options = array();\n\n foreach($this->options as $key => $option) {\n $optionTitle = $option['optionTitle'];\n $options[$optionTitle] = $option;\n }\n\n ksort($options);\n reset($options);\n\n $this->options = $options;\n }", "public function titleQuery() {\n $titles = [];\n\n $groupContent = $this->groupContentStorage->loadMultiple($this->value);\n foreach ($groupContent as $content) {\n $titles[] = $content->label();\n }\n return $titles;\n }", "protected function sortDataArray() {}", "public function sortStrategy();", "function titlesSlice($index = 0)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($index)) {\n $app->getLog()->warn('titlesSlice: invalid page id ' . $index);\n $app->halt(400, \"Bad parameter\");\n }\n\n $filter = getFilter();\n $search = $app->request()->get('search');\n if (isset($search)) {\n $search = trim($search);\n }\n $sort = $app->request()->get('sort');\n\n if (isset($sort) && $sort == 'byReverseDate') {\n switch ($globalSettings[TITLE_TIME_SORT]) {\n case TITLE_TIME_SORT_TIMESTAMP:\n $tl = $app->calibre->timestampOrderedTitlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search);\n break;\n case TITLE_TIME_SORT_PUBDATE:\n $tl = $app->calibre->pubdateOrderedTitlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search);\n break;\n case TITLE_TIME_SORT_LASTMODIFIED:\n $tl = $app->calibre->lastmodifiedOrderedTitlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search);\n break;\n default:\n $app->getLog()->error('titlesSlice: invalid sort order ' . $globalSettings[TITLE_TIME_SORT]);\n $tl = $app->calibre->timestampOrderedTitlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search);\n break;\n }\n } else {\n $tl = $app->calibre->titlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search);\n }\n\n $books = array_map('checkThumbnail', $tl['entries']);\n $app->render('titles.html', [\n 'page' => mkPage(getMessageString('titles'), 2, 1),\n 'url' => 'titleslist',\n 'books' => $books,\n 'curpage' => $tl['page'],\n 'pages' => $tl['pages'],\n 'search' => $search,\n 'sort' => $sort]);\n}", "function getSort(){ return 301; }", "function sort(Phlickr_Framework_IPhotoList $photolist) {\n foreach ($photolist->getPhotos() as $photo) {\n $id = $photo->getId();\n $keys[$id] = $this->_strategy->stringFromPhoto($photo);\n $photos[$id] = $photo;\n }\n\n if ($this->isInReverse()) {\n arsort($keys);\n } else {\n asort($keys);\n }\n\n $ret = array();\n foreach($keys as $id => $key) {\n $ret[] = $photos[$id];\n }\n return $ret;\n }", "function _wp_object_name_sort_cb($a, $b)\n {\n }", "static function by_title($content_object_1, $content_object_2)\r\n {\r\n return strcasecmp($content_object_1->get_title(), $content_object_2->get_title());\r\n }", "public function testSortListCategories()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\");\n //Test list user Desc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayAsc[$i - 1]);\n }\n //Test list user Desc\n $browser->click(\"#category-sort-name a\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayDesc[$i - 1]);\n }\n });\n }", "private static function sortByAsc($a, $b)\n {\n return strcmp($a->comment_date, $b->comment_date);\n }", "function _usort_terms_by_ID($a, $b)\n {\n }", "public static function getTitles( )\n {\n // get array with data. Through DAO this will be a bit of quicker.\n $query = 'SELECT id, title FROM ' . static::tableName();\n $records = Yii::app()\n ->db\n ->createCommand( $query )\n ->queryAll();\n\n // prepare result array\n $data = array();\n foreach( $records as $record ) {\n $data[ $record[ 'id' ] ] = $record[ 'title' ];\n }\n\n return $data;\n }", "function FieldTitleList ( ) { return $this->_FieldTitleList; }", "public function sortLists () {\n\t\tforeach ($this->layerList as $layer) {\n\t\t\t$layer->sortLists();\n\t\t}\n\t\tuasort($this->layerList, array(\"WmtsLayer\", \"compareNames\"));\n\t}", "public function getTitlesForVacancy() {\n return $this->descriptions->map(function($entity){\n return $entity->getVacancyTitle(); \n });\n }", "protected function _asSorted($shellList) {\n\t\t$grouped = array();\n\t\tforeach ($shellList as $shell => $types) {\n\t\t\tforeach ($types as $type) {\n\t\t\t\t$type = Inflector::camelize($type);\n\t\t\t\tif (empty($grouped[$type])) {\n\t\t\t\t\t$grouped[$type] = array();\n\t\t\t\t}\n\t\t\t\t$grouped[$type][] = $shell;\n\t\t\t}\n\t\t}\n\t\tif (!empty($grouped['App'])) {\n\t\t\tsort($grouped['App'], SORT_STRING);\n\t\t\t$this->out('[ App ]');\n\t\t\t$this->out(' ' . implode(', ', $grouped['App']), 2);\n\t\t\tunset($grouped['App']);\n\t\t}\n\t\tforeach ($grouped as $section => $shells) {\n\t\t\tif ($section == 'CORE') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsort($shells, SORT_STRING);\n\t\t\t$this->out('[ ' . $section . ' ]');\n\t\t\t$this->out(' ' . implode(', ', $shells), 2);\n\t\t}\n\t\tif (!empty($grouped['CORE'])) {\n\t\t\tsort($grouped['CORE'], SORT_STRING);\n\t\t\t$this->out('[ Core ]');\n\t\t\t$this->out(' ' . implode(', ', $grouped['CORE']), 2);\n\t\t}\n\t\t$this->out();\n\t}", "function get_title_list() {\n return get_string('list_pagetitle', 'block_php_report');\n }", "function sortRelAbcNew($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['title'] == $b['title']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['title'] > $b['title']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "public static function sort_items($a, $b)\n {\n }", "public function providerSortBy() {\n return array(\n array('name','ASC','item-01'),\n array('name','DESC','item-39'),\n array('color,name','ASC','item-03'),\n );\n }", "public function sort_posts() {\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t#icon-reorder-posts {\n\t\t\tdisplay: none;\n\t\t\tbackground:url(<?php echo $this->icon; ?>) no-repeat;\n\t\t}\n\t\t</style>\n\t\t<div class=\"wrap\">\n\t\t\t<?php screen_icon( 'reorder-posts' ); ?>\n\t\t\t<h2>\n\t\t\t\t<?php echo $this->heading; ?><br>\n\t\t\t\t<span style=\"font-size:13px\">Trascina per determinare l'ordine manuale di visualizzazione degli elementi.</span>\n\t\t\t\t<img src=\"<?php echo admin_url( 'images/loading.gif' ); ?>\" id=\"loading-animation\" />\n\t\t\t</h2>\n\t\t\t<div id=\"reorder-error\"></div>\n\t\t\t<?php echo $this->initial; ?>\n\t\t\t<div id=\"list\">\n\t\t\t<input class=\"search\" placeholder=\"Search\" />\n\t\t\t<div id=\"message-order\" class=\"updated\" style=\"display:none;\">\n\t <p><h3>ATTENZIONE</h3>Il sistema di <b>ordinamento</b> è disabilitato nella lista filtrata. Rimuovere i criteri di ricerca per riabilitare il sistema.</p>\n\t </div>\n\t\t\t<ul id=\"post-list\" class=\"list\">\n\t\t<?php\n\t\tif ( is_post_type_hierarchical( $this->post_type ) ) {\n\t\t\t$pages = get_pages( array(\n\t\t\t\t'sort_column' => 'menu_order',\n\t\t\t\t'post_type' => $this->post_type,\n\t\t\t ) );\n\t\t\t //Get hiearchy of children/parents\n\t\t\t $top_level_pages = array();\n\t\t\t $children_pages = array();\n\t\t\t foreach( $pages as $page ) {\n\t\t\t\tif ( $page->post_parent == 0 ) {\n\t\t\t\t\t//Parent page\n\t\t\t\t\t$top_level_pages[] = $page;\n\t\t\t\t} else {\n\t\t\t\t\t$children_pages[ $page->post_parent ][] = $page;\n\t\t\t\t}\n\t\t\t } //end foreach\n\n\t\t\t foreach( $top_level_pages as $page ) {\n\t\t\t\t$page_id = $page->ID;\n\t\t\t\tif ( isset( $children_pages[ $page_id ] ) && !empty( $children_pages[ $page_id ] ) ) {\n\t\t\t\t\t//If page has children, output page and its children\n\t\t\t\t\t$this->output_row_hierarchical( $page, $children_pages[ $page_id ], $children_pages );\n\t\t\t\t} else {\n\t\t\t\t\t$this->output_row( $page );\n\t\t\t\t}\n\t\t\t }\n\t\t} else {\n\t\t\t//Output non hierarchical posts\n\t\t\t$post_query = new WP_Query(\n\t\t\t\tarray(\n\t\t\t\t\t'post_type' => $this->post_type,\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'orderby' => 'menu_order',\n \t\t\t'suppress_filters' => false,\n\t\t\t\t\t'order' => $this->order,\n\t\t\t\t\t'post_status' => $this->post_status,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$posts = $post_query->get_posts();\n\t\t\tif ( !$posts ) return;\n\t\t\tforeach( $posts as $post ) {\n\t\t\t\t$this->output_row( $post );\n\t\t\t} //end foreach\n\t\t}\n\t\t?>\n\t\t</ul>\n\t\t</div>\n\t\t<?php\n\t\techo $this->final;\n\t\t?>\n\t\t</div><!-- .wrap -->\n\t\t<?php\n\t}", "function sortRecipesAlphabetical($recipes)\n{\n\t$count = count($recipes);\n\t$indexes = array();\n\t\n\t//set default index ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\t$indexes[$i] = $i;\n\t}\n\t\n\t//sort indexes based on recipe name alphabetical ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\tfor ($j = 0; ($j < $count) && ($j != $i); $j++)\n\t\t{\n\t\t\t$index1 = $indexes[$i];\n\t\t\t$index2 = $indexes[$j];\n\t\t\t\n\t\t\tif (strcmp($recipes[$index1][\"name\"], $recipes[$index2][\"name\"]) < 0)\n\t\t\t{\n\t\t\t\t$indexes[$i] = $index2;\n\t\t\t\t$indexes[$j] = $index1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $indexes;\n}", "private function sort()\r\n\t{\r\n\t\t// sort menu\r\n\t\t$menuOrder = array();\r\n\t\t$menuOrderNames = array();\r\n\t\tforeach ($this->items as $key => $row)\r\n\t\t{\r\n\t\t\t$menuOrder[$key] = !is_null($row->order) ? $row->order : 9999;\r\n\t\t\t$menuOrderNames[$key] = $key;\r\n\t\t}\r\n\t\tarray_multisort($menuOrder, SORT_ASC, $menuOrderNames, SORT_ASC, $this->items);\r\n\t}", "public function sort_posts_by_post_title( $a, $b ) {\n \n return strcmp( \n wp_strip_all_tags( $a->post_title ),\n wp_strip_all_tags( $b->post_title )\n );\n\n }", "function sort_results ($unsorted)\n{\n // Add a key to all objects in the array that allows for sensible\n // sorting of numeric substrings.\n foreach ($unsorted as $res) {\n $res->key = preg_replace_callback (\n '|\\d+|',\n function ($match) {\n return 'zz' . strval (strlen ($match[0])) . $match[0];\n },\n $res->meta_value\n );\n }\n\n // Sort the array according to key.\n usort (\n $unsorted,\n function ($res1, $res2) {\n return strcoll ($res1->key, $res2->key);\n }\n );\n\n return array_map (\n function ($s) {\n return $s->meta_value;\n },\n $unsorted\n );\n}", "public function getTitles(): array\n {\n return $this->titles;\n\t}", "public function findAll()\n {\n return $this->getRepository()->findBy(array(), array('title' => 'ASC'));\n }", "public function testSortNamesListWithDuplicateSurnamesGivenNames(): void\n {\n $result = $this->sorter->sortList(\n <<<LIST\nJanet Parsons\nVaughn Lewis\nVaugho Lewis\nAdonis Julius Archer\nShelby Nathan Yoder\nThelby Nathan Yoder\nMarin Alvarez\nLondon Lindsey\nBeau Tristan Bentley\nLeo Gardner\nHunter Uriah Mathew Clarke\nHunter Triah Mathew Clarke\nMikayla Lopez\nFrankie Conner Ritter\nLIST\n );\n self::assertSame(\n // Don't tab the names list;\n // Good practice for unit test doesn't transform the expected result in any way.\n <<<SORTED\nMarin Alvarez\nAdonis Julius Archer\nBeau Tristan Bentley\nHunter Triah Mathew Clarke\nHunter Uriah Mathew Clarke\nLeo Gardner\nVaughn Lewis\nVaugho Lewis\nLondon Lindsey\nMikayla Lopez\nJanet Parsons\nFrankie Conner Ritter\nShelby Nathan Yoder\nThelby Nathan Yoder\nSORTED,\n $result\n );\n }", "public function getElementSortOrder();", "public function sortBy(string $key);", "public function findAll() {\n return $this->findBy(array(), array('title' => 'ASC'));\n }", "public function getSortMenu();", "function getTitle() ;", "private function sortPostFeedElements()\n {\n foreach($this->post as $key=>$value) {\n if (is_array($value) && strpos($key, 'UNL_MediaHub_Feed') !== false) {\n usort($value, array($this,'comparePostFeedElements'));\n $this->post[$key] = $value;\n }\n }\n }", "private function getJobTitleList() {\n $jobTitleList = $this->getJobTitleService()->getJobTitleList();\n $list = array(\"\" => __('All'));\n foreach ($jobTitleList as $jobTitle) {\n $list[$jobTitle->getId()] = $jobTitle->getJobTitleName();\n }\n return $list;\n }", "function title_query() {\n $titles = array();\n\n $result = db_query(\"SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)\", array(':fids' => $this->value));\n foreach ($result as $term) {\n $titles[] = check_plain($term->title);\n }\n return $titles;\n }", "public function testSortNamesListWithOneGivenName(): void\n {\n $result = $this->sorter->sortList(\n <<<LIST\nJanet Parsons\nVaughn Lewis\nWaughn Lewis\nJulius Archer\nNathan Yoder\nMathan Yoder\nMarin Alvarez\nLondon Lindsey\nTristan Bentley\nLeo Gardner\nMathew Clarke\nNathew Clarke\nMikayla Lopez\nConner Ritter\nLIST\n );\n self::assertSame(\n // Don't tab the names list;\n // Good practice for unit test doesn't transform the expected result in any way.\n <<<SORTED\nMarin Alvarez\nJulius Archer\nTristan Bentley\nMathew Clarke\nNathew Clarke\nLeo Gardner\nVaughn Lewis\nWaughn Lewis\nLondon Lindsey\nMikayla Lopez\nJanet Parsons\nConner Ritter\nMathan Yoder\nNathan Yoder\nSORTED,\n $result\n );\n }" ]
[ "0.69300795", "0.67497057", "0.67357314", "0.6601203", "0.65837765", "0.6483468", "0.64322656", "0.6370522", "0.6324118", "0.6277263", "0.6254934", "0.61863834", "0.6178413", "0.61716735", "0.61616683", "0.6117028", "0.6077277", "0.60718495", "0.6035423", "0.598601", "0.59727013", "0.5960198", "0.59483904", "0.59415877", "0.5902936", "0.58789563", "0.5860734", "0.5857313", "0.58501947", "0.58312327", "0.5828044", "0.5824195", "0.58226216", "0.58174807", "0.576129", "0.57557684", "0.5739166", "0.5739034", "0.5727255", "0.5708258", "0.57081306", "0.56962276", "0.5695144", "0.56875837", "0.5685616", "0.568211", "0.568211", "0.568211", "0.5660346", "0.56470364", "0.5644081", "0.5640016", "0.5632298", "0.5629597", "0.56231546", "0.56230056", "0.5601622", "0.55861163", "0.55787235", "0.55722", "0.5568828", "0.55651075", "0.5561663", "0.5558802", "0.5549099", "0.5544069", "0.55361664", "0.55214334", "0.5520702", "0.5492385", "0.5486765", "0.5486153", "0.54640716", "0.545856", "0.5448908", "0.5446633", "0.54449534", "0.5434838", "0.54341096", "0.542896", "0.5427677", "0.5424968", "0.54190695", "0.54094464", "0.54082733", "0.54011536", "0.5398011", "0.5392102", "0.5390035", "0.53886145", "0.5386575", "0.53833836", "0.5380865", "0.5376502", "0.53570527", "0.5346765", "0.5345514", "0.53402835", "0.5324629", "0.5320758", "0.53191346" ]
0.0
-1
die("Custom Remove Country == venezula_init_function");
function venezula_init_function(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function displayRestrictedCountryPage()\n {\n }", "protected function displayRestrictedCountryPage()\n {\n }", "protected function displayRestrictedCountryPage()\n {\n }", "public function actionAddCountryCode()\n {\n Loads::addCountryCode();\n }", "function tsapress_remove_localization_script() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('l10n');\n\t}\n}", "function deactivated_plugins_notice()\n {\n }", "function my_init()\n{\n\tglobal $restricted_countries;\n\t\n\t//Only allow for the countries in the $restricted_countries array\n\t$restricted_countries = array(\n\t\t\t\t\t\t\t1 => array('AU'),\n\t\t\t\t\t\t\t2 => array('AU'),\n\t);\n}", "function remove_footer_admin () {\n echo \"Ethermore\";\n}", "function HTX_danger_zone() {\n // JS files\n wp_enqueue_script( 'DangerZoneJS', \"/wp-content/plugins/wp-htxlan/code/JS/DangerZone.js\");\n }", "protected function displayRestrictedCountryPage()\n {\n return;\n }", "function uninstall(){\n\n }", "function spcode_deactivate() {\n // Do nothing\n}", "function start_plugin_hookup() {\r\n\r\n\tglobal $pagenow;\r\n\r\n\t// anonymous function in a variable\r\n\t$removeme = function() { echo '<div class=\"error\">It\\'s easy to remove me!!</div>'; };\r\n\r\n\tadd_action(\r\n\t\t'admin_notices',\r\n\t\t$removeme,\r\n\t\t10,\r\n\t\t0\r\n\t);\r\n\r\n\tif ( 'index.php' == $pagenow ) {\r\n\r\n\t\tremove_action(\r\n\t\t\t'admin_notices',\r\n\t\t\t_wp_filter_build_unique_id(\r\n\t\t\t\t'admin_notices',\r\n\t\t\t\t$removeme,\r\n\t\t\t\tfalse\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}\r\n\r\n}", "function sobrapaev() {\n\t if (!is_admin()) {\n\t wp_enqueue_script('sobrapaev', WP_PLUGIN_URL . '/sobrapaev/' . 'sobrapaev.js', false, '1.41');\n\t }\n\t}", "function checkCountry($country, $X_langArray) {\n\tglobal $errorField, $countryDAO;\n\t\n\t//country vuoto\n\tif ( !isset($country) || $country == '' ) {\n\t\t$errorField .= \"&countryErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_COUNTRY_EMPTY_ERR']);\n\t}\n\telse if (strlen($country) > 50 ) {\n\t\t$errorField .= \"&countryErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_COUNTRY_LENGTH_ERR']);\n\t}\n}", "function site_admin_notice()\n {\n }", "public function admin_country_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n\t\t\t\tif ($this->lang->line('admin_settings_currency_setting') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_settings_currency_setting')); \n\t\t else $this->data['heading'] = 'Currency Settings';\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/country_settings', $this->data);\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "function shutdown() {\n // Safety for themes not using wp_footer\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function wp_head(){\n \tpluginValidaciones();\n logueado();\n }", "function acf_disable_local()\n{\n}", "public static function es_deactivation() {\n\t}", "function shutdown() {\n \n // If we rendered an SLPLUS shortcode...\n //\n if (defined('SLPLUS_SHORTCODE_RENDERED') && SLPLUS_SHORTCODE_RENDERED) {\n \n // Register Load JavaScript\n //\n //wp_enqueue_script('slplus_functions');\n wp_enqueue_script('google_maps'); \n //wp_enqueue_script('slplus_map');\n\t\t\t\twp_enqueue_script('csl_script');\n \n // if (get_option(SLPLUS_PREFIX.'_email_form')==1) {\n // wp_enqueue_script('slplus_emailform');\n // }\n \n // Enqueue the style sheet\n //\n setup_stylesheet_for_slplus(); \n \n // Force our scripts to load for badly behaved themes\n //\n wp_print_footer_scripts();\n\t\t\t\t/*\n?> \n <script type='text/javascript'>\n jQuery(window).load(function() {\n allScripts=document.getElementsByTagName('script');\n \n // Check our scripts were enqueued\n //\n if (allScripts.length-1 < 4) {\n alert('<?php echo __('SLPLUS: The theme or a plugin is preventing trailing JavaScript from loading.',SLPLUS_PREFIX); ?>');\n \n // Check the Google Maps was loaded\n //\n } else if (typeof GLatLng == 'undefined' ) { \n alert('<?php echo __('SLPLUS: Google Map Interface did not load.\\n\\nCheck your Google API key and make sure you have API V2 enabled.',SLPLUS_PREFIX); ?>');\n \n // Yup, set our sl_load to prepopulate map data\n //\n } else if (document.getElementById(\"map\")){\n setTimeout(\"sl_load()\",1000);\n \n }\n }\n ); \n </script>\n<?php */\n } \n\t\t}", "abstract public function country();", "public function AggiornaPrezzi(){\n\t}", "function wpfifc_remove_option() {\r\n\r\n\t\treturn;\r\n\t}", "function on_deactivation ()\n{\n}", "function on_deactivation ()\n{\n}", "public function requestCountry();", "public function wp_die_handler()\n {\n }", "function bc_affiliation_uninstall() {\n}", "function shutdown()\r\n{\r\n // here we can do any last operations\r\n // before the script is complete.\r\n global $engine; // deklarasi dua kali karena berada didalam function yang berbedda\r\n global $go;\r\n global $template;\r\n\r\nif(isset($_GET['bersihkan_log']))\r\n\t{\r\n\t\tif(file_exists(ini_get('error_log')))\r\n\t\t{\r\n\t\t //hapus log error\r\n\t\t if (!unlink(ini_get('error_log')))\r\n\t\t {\r\n\t\t // (\"log sdh cleaar\");\r\n\t\t }\r\n\t\t}\r\n\t}\r\n}", "function my_function_admin_bar(){ return false; }", "function ajax_genmapper_user_country_selected() {\n\t\n\t$choosed_country = isset($_POST['choosed_country']) ? $_POST['choosed_country'] : '';\n\t\n\tif ( $choosed_country )\n\t{\n\t\t\t$meta=get_user_meta(get_current_user_id(), 'genmapper_country_code', true);\n\t\t\tif ( $meta == '' || (is_array($meta) && count($meta)==0 ) )\n\t\t\t{\n\t\t \tupdate_user_meta(get_current_user_id(), 'genmapper_country_code',$choosed_country);\n\t\t\t\techo 'country_set';\n\t\t\t}\n\n\t}\n\telse\n\t{\n\t\t\n\t}\n\t\n\twp_die();\n}", "function network_admin_notices()\n {\n }", "function admin_notices()\n {\n }", "function deleteCountry()\n {\n \n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n \n }\n else\n {\n $id = $this->input->post('id');\n $data = array('deleted'=>1,'updated_by'=>$this->vendorId, 'update_time'=>date('Y-m-d H:i:s'));\n \n $result = $this->country_model->deleteCountry($id, $data);\n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "function hello_world_remove() {\ndelete_option('ernaehrungsnews_anzahl');\ndelete_option('ernaehrungsnews_trimmer');\ndelete_option('ernaehrungsnews_kategorieId');\n\n}", "function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}", "public function accueil()\n {\n }", "public function plugin_deactive_hook(){\r\n delete_transient( 'woolentor_template_info' );\r\n delete_metadata( 'user', null, 'woolentor_dismissed_lic_notice', null, true );\r\n }", "public function _post_filter()\n {\n }", "function wp_deregister_script($handle)\n {\n }", "function polizeipresse_admin_notice() {\r\n\tglobal $pagenow;\r\n if ($pagenow == 'plugins.php') {\r\n\t\t$api_key = polizeipresse_get_option(POLIZEIPRESSE_API_KEY);\r\n\r\n\t\t$office_id_count = 0;\r\n\t\tfor($office = 0; $office < POLIZEIPRESSE_MAX_OFFICE_COUNT; $office++) {\r\n\t\t\t$office_id = polizeipresse_get_option(POLIZEIPRESSE_OFFICE_ID . $office);\r\n\t\t\tif (!empty($office_id)) {\r\n\t\t\t\t$office_id_count++;;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($api_key) || ($office_id_count == 0)) {\r\n\t\t\tprint ('<div id=\"message\" class=\"error\">' . __('Polizeipresse plugin: Please enter API key select police office', 'Polizeipresse') . '</div>');\r\n\t\t}\r\n }\r\n}", "function deactivation_func() {\r\n\r\n delete_option( 'wpc_run_activated_functions' );\r\n }", "function deactivation_hook() {\n\n\t}", "function bc_location_uninstall() {\n}", "function astrizstudios_pro_block_options_uninstal()\r\n{\r\n\tif(!current_user_can('activate_plugins'))\t{ return; }\r\n\r\n\tcheck_admin_referer('bulk-plugins');\r\n\r\n\tif(!defined('WP_UNINSTALL_PLUGIN'))\t\t\t{ return; }\r\n\r\n\tif(__FILE__ != WP_UNINSTALL_PLUGIN)\t\t\t{ return; }\r\n\r\n\trequire_once('profanity-blocker-options.php');\r\n\t\r\n\tforeach($options as $option)\t\t\t\t{ delete_option($option); }\r\n\r\n\treturn 'DEACTIVATED!';\r\n}", "function virustotalscan_deactivate()\r\n{\r\n global $db;\r\n // se sterg setarile din baza de date\r\n $db->query(\"DELETE FROM \".TABLE_PREFIX.\"settinggroups WHERE name = 'virustotalscan_group'\");\r\n \t$db->query(\"DELETE FROM \".TABLE_PREFIX.\"settings WHERE name LIKE 'virustotalscan_setting_%'\");\r\n // se actualizeaza toate setarile\r\n\trebuild_settings();\r\n // daca tabela \"virustotalscan_log\" exista in baza de date atunci se sterge!\r\n\tif ($db->table_exists('virustotalscan_log'))\r\n $db->drop_table('virustotalscan_log');\r\n // se sterge din baza de date stil-urile adaugate\r\n $db->delete_query('templates', 'title = \"virustotalscan_url_css\"'); \r\n}", "function localize_script() {\n\n wp_localize_script( 'media-library-taxonomy-filter', 'MediaLibraryTaxonomyFilterOptions', array(\n 'terms' => get_terms(\n 'media_content_category', array( 'hide_empty' => false ) ),\n ) );\n }", "function detect_plugin_deactivation( $plugin, $network_activation )\n{\n // do stuff\n\t $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );\n\t if($plugin_data['Name'] == \"Landing Page Booster\")\n\t {\n\t\tdo_action( 'remove_license','' );\n\t }\n}", "function saleforce_scripts_plug() {\n if (is_admin()) {\n wp_register_script('backcallscc', plugins_url('js/cussaleforce.js', __FILE__), array('jquery'));\n \n wp_enqueue_script('backcallscc');\n \n $file_for_jav = admin_url('admin-ajax.php');\n $tran_arr = array('jaxfile' => $file_for_jav);\n wp_localize_script('backcallscc', 'fromphp', $tran_arr);\n }\n}", "public function plugin_deactivate() {\r\n\r\n\t}", "public function destroy(Country $country)\n {\n //\n }", "function wp_customize_support_script()\n {\n }", "function delete_site_option($option)\n {\n }", "function my_pmprorh_init()\n{\n//don't break if Register Helper is not loaded\n\tif(!function_exists( 'pmprorh_add_registration_field' )) {\n\t\treturn false;\n\t}\nglobal $pmpro_countries;\n$countries = array_merge(array(\"\" => \"Choose One\"), $pmpro_countries);\n\t//define the fields\n $fields = array();\n $fields[] = new PMProRH_Field(\n \t\"bcountry\",\n \t\"select\",\n \tarray(\n\t\t\"label\"=>\"Country\",\n\t\t\"required\" => true,\n\t\t\"profile\" => true,\t\t// show in user profile\n\t\t\"options\"=> $countries\n\t\t));\n\n\t//add the fields into a new checkout_boxes are of the checkout page\n\tforeach($fields as $field)\n\t\tpmprorh_add_registration_field(\n\t\t\t'checkout_boxes',\t\t// location on checkout page\n\t\t\t$field\t\t// PMProRH_Field object\n\t\t);\n\t//that's it. see the PMPro Register Helper readme for more information and examples.\n}", "function fuzzloc_unload() {\n\n\tunregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\tunregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tunregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\n\tlogger(\"removed fuzzloc\");\n}", "public static function uninstall(){\n }", "function affichageErreur()\n\t{\n\t}", "function uninstall() {\n\t}", "function _wpsc_fix_latvia_currency() {\n\t$country = new WPSC_Country( array(\n\t\t'isocode' => 'LV',\n\t\t'currency' => __( 'Euro', 'wpsc' ),\n\t\t'symbol' => __( '€', 'wpsc' ),\n\t\t'symbol_html' => __( '&#8364;', 'wpsc' ),\n\t\t'code' => __( 'EUR', 'wpsc' )\n\t) );\n\n}", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function init()\n\t{\n\t\t$sandbox = e107::pref('anteup', 'anteup_sandbox');\n\t\tif(vartrue($sandbox))\n\t\t{\n\t\t\te107::getMessage()->addWarning(LAN_ANTEUP_SANDBOX_ON);\n\t\t}\n\t}", "public function init()\n\t{\n\t\t$sandbox = e107::pref('anteup', 'anteup_sandbox');\n\t\tif(vartrue($sandbox))\n\t\t{\n\t\t\te107::getMessage()->addWarning(LAN_ANTEUP_SANDBOX_ON);\n\t\t}\n\t}", "function genmapper_user_country_is_set()\n{\n\tif ( !is_user_logged_in() || is_admin() || is_super_admin() )\n\t{\n\t\treturn;\n\t}\n\t$meta=get_user_meta(get_current_user_id(), 'genmapper_country_code', true);\n\t\n\tif ( ! $meta || (is_array($meta) && count($meta)==0 ) )\n\t{\n\t?>\n\t<div id=\"genmapoverlay\">\n\t\t<div id=\"genmapoverlay-country-selector\">You must set your country before continue the browsing.\n\t\t\t<form method=\"post\"><?php genmapper_country_select(null,true) ?></form>\n\t\t</div>\n\t</div>\n\t<style>\n\t#genmapoverlay {\n position: fixed; /* Sit on top of the page content */\n display: block; /* Hidden by default */\n width: 100%; /* Full width (cover the whole page) */\n height: 100%; /* Full height (cover the whole page) */\n top: 0; \n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5); /* Black background with opacity */\n z-index: 2; /* Specify a stack order in case you're using a different order for other elements */\n cursor: pointer; /* Add a pointer on hover */\n\t}\n\t#genmapoverlay-country-selector\n\t{text-align: center; color:white;font-size:32px; background-color: red; position: absolute;top:33px; margin-left: 30%;margin-right: 30%; margin-top: 20%;}\t\n\n\n\t</style>\n\t<script>\n\t\tvar $ = window.jQuery;\n\t\t$('#genmapoverlay-country-selector select').change( function() {\n\t\t\t$.post( GenMapperBase.ajaxurl , {\n\t\t\t\t'action' : 'genmapper_user_country_selected',\n\t\t\t\t///'nodes': JSON.stringify( nodes )\n\t\t\t\t'choosed_country': $(this).val()\n\t\t\t}).done(function(data) { \n\t\t\t\tconsole.log('response', data );\n\t\t\t\tif ( data == 'country_set' ) {\n\t\t\t\t\t$('#genmapoverlay').hide();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\n\t</script>\n\t<?php\t\n\t}\n}", "function spcode_activate() {\n // Do nothing\n}", "function on_uninstall ()\n{\n}", "function on_uninstall ()\n{\n}", "function wbf_projet_localisations_supprimer_callback($form, &$form_state){\r\n if ($form_state['loc_nums'] > 1) {\r\n $form_state['loc_nums']--;\r\n }\r\n $form_state['rebuild'] = TRUE;\r\n}", "function crowdx_uninstall(){\r\n\r\n }", "function timezonecalculator_init() {\r\n\r\n\t/*\r\n\tTimeZoneCalculator Constants\r\n\t*/\r\n\r\n\tDEFINE ('TIMEZONECALCULATOR_PLUGINURL', plugins_url('', __FILE__) . '/');\r\n\r\n\tDEFINE ('TIMEZONECALCULATOR_CURRENTGMDATE', gmdate('U'));\r\n\r\n\t/* check for ajax-refresh-call */\r\n\r\n\tif (isset($_POST['timezonecalculator-refresh'])) {\r\n\t\tgetTimeZonesTime();\r\n\t\texit;\r\n\t}\r\n\r\n\tif(get_option('timezones_Use_Ajax_Refresh')=='1') {\r\n\t\twp_enqueue_script('prototype');\r\n\t}\r\n\r\n}", "function cao_vip_page() {\r\n}", "function _delete_option_fresh_site()\n {\n }", "function KemiSitemap_notice(){\n echo '<div class=\"notice notice-warning\"><p>' . __( 'Please deactivate Kemi Sitemap before activting Kemi Sitemap.', 'KemiSitemap' ) . '</p></div>';\n\n if( isset( $_GET['activate'] ) ) {\n unset( $_GET['activate'] );\n }\n }", "function changyan_deactivate()\n{\n}", "public function setCountryModel()\n {\n\n $layout = Mage::app()->getLayout();\n\n $layout->getBlock('js')->append($layout\n ->createBlock('adminhtml/template')\n ->setTemplate('gls/system/shipping/gls_applicable_country.phtml'));\n }", "function polizeipresse_admin_init() {\r\n\twp_enqueue_script('jquery');\r\n\twp_enqueue_script('jquery-validate', plugin_dir_url(__FILE__) . 'js/jquery.validate.min.js', array ('jquery'), '1.8.1', true);\r\n\twp_enqueue_script('jquery-ui-core');\r\n\twp_enqueue_script('jquery-ui-tabs');\r\n\r\n\twp_enqueue_script('jquery-ui-dialog');\r\n\twp_enqueue_style ('wp-jquery-ui-dialog');\r\n\r\n\twp_enqueue_style ('polizeipresse-admin.css', plugin_dir_url(__FILE__) . 'css/admin.css');\r\n\twp_enqueue_script('polizeipresse-admin.js', plugin_dir_url(__FILE__) . 'js/admin.js', null, null, true);\r\n\t$locData = array ('error_no_result' => __('No result from server.', 'Polizeipresse'),\r\n\t 'error_unknown' => __('An error occurred', 'Polizeipresse'),\r\n\t 'validation_required_api_key' => __('Please enter API key', 'Polizeipresse'),\r\n\t 'validation_required_office' => __('Please select police office', 'Polizeipresse')\r\n\t );\r\n\twp_localize_script('polizeipresse-admin.js', 'polizeipresse', $locData );\r\n}", "function agst_pmpro_after_checkout()\n{\n\tif(isset($_SESSION['taxregion']))\n\t\tunset($_SESSION['taxregion']);\n}", "function set_country_vat_registration_code($iso) {\n $code = $this->db->query_field('SELECT vat_registration FROM countries WHERE iso_code = UPPER(:iso);', array('iso' => $iso));\n return !empty($code) ? $code : false;\n }", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('theme.component_controller_admincp_add_clean')) ? eval($sPlugin) : false);\n\t}", "function cleanup() {\n\n\t\t// reset language\n\t\tif ( Language::is_multilingual() ) {\n\t\t\tLanguage::set_original();\n\t\t}\n\n\t\tremove_filter( 'woocommerce_get_tax_location', [ $this, 'filter_tax_location' ] );\n\n\t\t$this->is_setup = false;\n\t}", "function listCountryOptions()\n{\n $countries = array(\"Afghanistan\", \"Albania\", \"Algeria\", \"American Samoa\", \"Andorra\", \"Angola\", \"Anguilla\", \"Antarctica\", \"Antigua and Barbuda\", \"Argentina\", \"Armenia\", \"Aruba\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Bahamas\", \"Bahrain\", \"Bangladesh\", \"Barbados\", \"Belarus\", \"Belgium\", \"Belize\", \"Benin\", \"Bermuda\", \"Bhutan\", \"Bolivia\", \"Bosnia and Herzegowina\", \"Botswana\", \"Bouvet Island\", \"Brazil\", \"British Indian Ocean Territory\", \"Brunei Darussalam\", \"Bulgaria\", \"Burkina Faso\", \"Burundi\", \"Cambodia\", \"Cameroon\", \"Canada\", \"Cape Verde\", \"Cayman Islands\", \"Central African Republic\", \"Chad\", \"Chile\", \"China\", \"Christmas Island\", \"Cocos (Keeling) Islands\", \"Colombia\", \"Comoros\", \"Congo\", \"Congo, the Democratic Republic of the\", \"Cook Islands\", \"Costa Rica\", \"Cote d'Ivoire\", \"Croatia (Hrvatska)\", \"Cuba\", \"Cyprus\", \"Czech Republic\", \"Denmark\", \"Djibouti\", \"Dominica\", \"Dominican Republic\", \"East Timor\", \"Ecuador\", \"Egypt\", \"El Salvador\", \"Equatorial Guinea\", \"Eritrea\", \"Estonia\", \"Ethiopia\", \"Falkland Islands (Malvinas)\", \"Faroe Islands\", \"Fiji\", \"Finland\", \"France\", \"France Metropolitan\", \"French Guiana\", \"French Polynesia\", \"French Southern Territories\", \"Gabon\", \"Gambia\", \"Georgia\", \"Germany\", \"Ghana\", \"Gibraltar\", \"Greece\", \"Greenland\", \"Grenada\", \"Guadeloupe\", \"Guam\", \"Guatemala\", \"Guinea\", \"Guinea-Bissau\", \"Guyana\", \"Haiti\", \"Heard and Mc Donald Islands\", \"Holy See (Vatican City State)\", \"Honduras\", \"Hong Kong\", \"Hungary\", \"Iceland\", \"India\", \"Indonesia\", \"Iran (Islamic Republic of)\", \"Iraq\", \"Ireland\", \"Israel\", \"Italy\", \"Jamaica\", \"Japan\", \"Jordan\", \"Kazakhstan\", \"Kenya\", \"Kiribati\", \"Korea, Democratic People's Republic of\", \"Korea, Republic of\", \"Kuwait\", \"Kyrgyzstan\", \"Lao, People's Democratic Republic\", \"Latvia\", \"Lebanon\", \"Lesotho\", \"Liberia\", \"Libyan Arab Jamahiriya\", \"Liechtenstein\", \"Lithuania\", \"Luxembourg\", \"Macau\", \"Macedonia, The Former Yugoslav Republic of\", \"Madagascar\", \"Malawi\", \"Malaysia\", \"Maldives\", \"Mali\", \"Malta\", \"Marshall Islands\", \"Martinique\", \"Mauritania\", \"Mauritius\", \"Mayotte\", \"Mexico\", \"Micronesia, Federated States of\", \"Moldova, Republic of\", \"Monaco\", \"Mongolia\", \"Montserrat\", \"Morocco\", \"Mozambique\", \"Myanmar\", \"Namibia\", \"Nauru\", \"Nepal\", \"Netherlands\", \"Netherlands Antilles\", \"New Caledonia\", \"New Zealand\", \"Nicaragua\", \"Niger\", \"Nigeria\", \"Niue\", \"Norfolk Island\", \"Northern Mariana Islands\", \"Norway\", \"Oman\", \"Pakistan\", \"Palau\", \"Panama\", \"Papua New Guinea\", \"Paraguay\", \"Peru\", \"Philippines\", \"Pitcairn\", \"Poland\", \"Portugal\", \"Puerto Rico\", \"Qatar\", \"Reunion\", \"Romania\", \"Russian Federation\", \"Rwanda\", \"Saint Kitts and Nevis\", \"Saint Lucia\", \"Saint Vincent and the Grenadines\", \"Samoa\", \"San Marino\", \"Sao Tome and Principe\", \"Saudi Arabia\", \"Senegal\", \"Seychelles\", \"Sierra Leone\", \"Singapore\", \"Slovakia (Slovak Republic)\", \"Slovenia\", \"Solomon Islands\", \"Somalia\", \"South Africa\", \"South Georgia and the South Sandwich Islands\", \"Spain\", \"Sri Lanka\", \"St. Helena\", \"St. Pierre and Miquelon\", \"Sudan\", \"Suriname\", \"Svalbard and Jan Mayen Islands\", \"Swaziland\", \"Sweden\", \"Switzerland\", \"Syrian Arab Republic\", \"Taiwan, Province of China\", \"Tajikistan\", \"Tanzania, United Republic of\", \"Thailand\", \"Togo\", \"Tokelau\", \"Tonga\", \"Trinidad and Tobago\", \"Tunisia\", \"Turkey\", \"Turkmenistan\", \"Turks and Caicos Islands\", \"Tuvalu\", \"Uganda\", \"Ukraine\", \"United Arab Emirates\", \"United Kingdom\", \"United States\", \"United States Minor Outlying Islands\", \"Uruguay\", \"Uzbekistan\", \"Vanuatu\", \"Venezuela\", \"Vietnam\", \"Virgin Islands (British)\", \"Virgin Islands (U.S.)\", \"Wallis and Futuna Islands\", \"Western Sahara\", \"Yemen\", \"Yugoslavia\", \"Zambia\", \"Zimbabwe\");\n foreach($countries as $country)\n {\n echo \"<option class='option' value='$country'>$country</option>\";\n }\n}", "function removeLanguage($cid, $option, $client = 'admin'){\n\tjosSpoofCheck();\n\t$client_id = $client == 'admin' ? 1 : 0;\n\n\t$cur_language = LCore::getCfg('lang');\n\n\tif($cur_language == $cid){\n\t\tmosErrorAlert(_YOU_CANNOT_DELETE_LANG_FILE);\n\t}\n\n\tmosRedirect('index2.php?option=com_installer&element=language&client=' . $client . '&task=remove&cid[]=' . $cid . '&' . josSpoofValue() . '=1');\n\n}", "function die_fatal_error($error)\n{\n\t\t\n\tdefine(\"e_IMAGE\",\"e107_images/\");\n\tdefine(\"e_JS\",\"e107_web/js/\");\n\tdefine(\"e_THEME\", \"e107_themes/\");\n\tdefine(\"e_LANGUAGEDIR\", \"e107_languages/\");\n\t\n\tinclude(e_LANGUAGEDIR.\"English/English.php\");\n\tinclude(e_LANGUAGEDIR.\"English/lan_installer.php\");\n\t\n\t$var = array();\n\t$var[\"installation_heading\"] \t= LANINS_001;\n\t$var[\"stage_pre\"] \t\t\t\t= LANINS_002;\n\t$var[\"stage_num\"] \t\t\t\t= LANINS_003;\n\t$var[\"stage_title\"] \t\t\t= LAN_ERROR;\n\t$var[\"percent\"] \t\t\t\t= 10;\n\t$var[\"bartype\"] \t\t\t\t= 'danger';\n\t$var['stage_content']\t\t\t= \"<div class='alert alert-error alert-block'>\".$error.\"</div>\";\n\t$var['debug_info'] \t\t\t\t= '';\n\t\n\t$template = template_data();\n\t\n\tforeach($var as $k=>$val)\n\t{\n\t\t$template = str_replace(\"{\".$k.\"}\", $val, $template);\t\n\t\t\n\t}\n\techo $template;\n\texit;\t\t\n}", "function acf_reset_local()\n{\n}", "function truc() {\n}", "function remove_footer_admin () {\n echo '&copy; - Aleksandr Gryshko Theme';\n}", "function checkGeoSite($countryName, $X_langArray) {\n\tglobal $errorField;\n\t\n\tif ($countryName == '') {\n\t\t$errorField .= \"&cityErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_ADDRS_NOT_FOUND']);\n\t}\n}", "public function acfedu_plugin_deactivation() {\n\t\t\t // nothing yet\n // @TODO: delete any settings\n\t\t\t}", "function publisher_inject_location_after_uva() {\n\n\t\t\tglobal $wp_query, $publisher_inject_location_uva_compatibility;\n\n\t\t\t$wp_query->is_404 = $publisher_inject_location_uva_compatibility['is_404'];\n\t\t\t$wp_query->is_search = $publisher_inject_location_uva_compatibility['is_search'];\n\n\t\t\tunset( $publisher_inject_location_uva_compatibility );\n\t\t}", "function wp_load_translations_early()\n {\n }", "function wp_just_in_time_script_localization()\n {\n }", "function dprv_activation_error($plugin_name)\r\n\t{\r\n\t\tif (strpos($plugin_name, \"CopyrightProof\") !== false)\r\n\t\t{\r\n\t\t\t$dprv_last_error = trim(ob_get_contents());\r\n\t\t\tif ($dprv_last_error != \"\")\r\n\t\t\t{\r\n\t\t\t\t$dprv_last_error = \"Error on activation: \" . $dprv_last_error;\r\n\t\t\t\tdprv_record_event($dprv_last_error);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function sfe_language_section_callback() {\n\n\t}", "function xt_admin_notice_installing() {\n ?>\n\n <div class=\"error fade\">\n <p><?php\n printf('<strong>需要到新淘客WordPress插件平台激活初始化您的网站</strong>. <br>\n\t <ul>\n\t <li>1.注册并登录<a href=\"%1s\" target=\"_blank\">新淘客WordPress插件平台</a>(已注册的会员可直接登录),添加网站</li>\n\t <li>2.验证并添加该网站(<a href=\"' . admin_url('admin.php?page=xt_menu_sys&xt-action=tool') . '\">填写验证代码</a>)</li>', XT_API_URL)\n ?></p>\n </div>\n\n <?php\n}", "function adstrue_vendor_add_provice() {\n return build_form_province();\n}", "function wpt_uninstall(){\n //Nothing to say for this version\n}", "function wp_recovery_mode_nag()\n {\n }", "function au_load_frontpage() {\n\n}", "function removeWPLoginErrors() {\r\n return 'Something is wrong!';\r\n}" ]
[ "0.6114212", "0.6114212", "0.6114212", "0.584069", "0.5806897", "0.5806791", "0.5795465", "0.5783643", "0.57611406", "0.5761126", "0.55850184", "0.55345434", "0.552714", "0.5523529", "0.55215096", "0.55082226", "0.5495427", "0.54827684", "0.54710037", "0.54659474", "0.54507476", "0.54507303", "0.54466534", "0.5411766", "0.541014", "0.54032516", "0.54032516", "0.5395453", "0.5395249", "0.53930783", "0.5379732", "0.5365392", "0.53630614", "0.5361341", "0.53604627", "0.53511184", "0.5347268", "0.53379846", "0.53200513", "0.5317022", "0.5309135", "0.5302509", "0.5301892", "0.52995354", "0.5299395", "0.529838", "0.5295183", "0.52945656", "0.52879727", "0.5284042", "0.527198", "0.52711076", "0.52709967", "0.52702695", "0.5268814", "0.52667874", "0.5266048", "0.5264848", "0.5257334", "0.5257296", "0.5254578", "0.5251309", "0.5246197", "0.5246197", "0.52405995", "0.5237564", "0.5236757", "0.5236757", "0.52312076", "0.5225527", "0.5209833", "0.52072144", "0.5199511", "0.51969856", "0.5196661", "0.51940495", "0.5187511", "0.51862335", "0.5176657", "0.517493", "0.51733404", "0.51699406", "0.51644003", "0.5161174", "0.5158791", "0.5157777", "0.5155199", "0.51532227", "0.5152738", "0.51466244", "0.51463515", "0.51373196", "0.51312476", "0.51307803", "0.5128461", "0.512317", "0.5121224", "0.5119636", "0.5116562", "0.5116131" ]
0.6150253
0
Retourne le temps actuel de la machine
private function _getMicroTime (){ return microtime(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function time() {\n return $this->info['total_time'];\n }", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "public function get_time() {\r\n\t\t\t$date = $this->get_date( 'U' );\r\n\t\t\treturn is_numeric( $date ) ? $date : time(); //time wrong? use now\r\n\t\t}", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "public function getTime(): float\n {\n return $this->time;\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "private function getCurrentTime()\n {\n return microtime(true);\n }", "public static function getStartTime(): float\n {\n return self::$startTimer;\n }", "public function GetSystemTime() {\r\n return $this->_client->doGetSystemTime(\r\n self::COUNTRY_CODE, $this->_config['allegro_key']\r\n );\r\n }", "protected function getTime()\n {\n return time();\n }", "public function getTime()\n {\n return time();\n }", "private function getCurrentTime() {\n return microtime( true );\n }", "public function getTime()\n\t{\n\t\tif(is_null($this->_time)){\n\t\t\t$this->loadData();\n\t\t}\n\t\treturn $this->_time;\n\t}", "public function runtime ()\n {\n return time() - $this->_start_time;\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function getTime() {\n return $this->time;\n }", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function getTime()\n {\n return $this->values[\"time\"];\n }", "public function getTime()\n {\n return $this->time;\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public function getTime() {\n\t\treturn $this->_time;\n\t}", "function now(): float\n{\n return (float) \\hrtime(true) / 1_000_000_000;\n}", "protected function getTime()\n {\n return microtime(true);\n }", "public function wallTime(){\n\n return self::$oCRNRSTN_ENV->wallTime();\n\n }", "public function getTotalTime()\n {\n return 0; //@todo\n }", "public static function get_times()\n { \n $timer = &self::$timer;\n return $timer->get_times();\n }", "function getCurrentTime()\n\t\t{\n\t\t\t$time = date('h:i:s a');\n\t\t\treturn $time;\n\t\t}", "public function getTempUnit() {\n return $this->cTempUnit;\n }", "protected function getTime() {\n return microtime(true);\n }", "public static function getCurrentTime()\n {\n return time();\n }", "public function getTime(): int {\n return $this->time;\n }", "protected function startTime()\n {\n return microtime(true);\n }", "function getSystemTime()\n{\n $time = @gettimeofday();\n $resultTime = $time['sec'] * 1000;\n $resultTime += floor($time['usec'] / 1000);\n return $resultTime;\n}", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['commands'] as $command) {\n $time += $command['executionMS'];\n }\n\n return $time;\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "private function getCurrentTemp() {\n $statement = $this->db->prepare('SELECT * FROM \"temperature\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC)['amount'];\n }", "public function get_time() {\n return $this->_time;\n }", "public function getTime()\n {\n $value = $this->get(self::TIME);\n return $value === null ? (double)$value : $value;\n }", "public function getEliteResetTime()\n {\n return $this->get(self::_ELITE_RESET_TIME);\n }", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "public function getTotalTime(){\n return $this->totalTime;\n }", "public function getTemperature();", "public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}", "public static function getTimeToRun();", "protected function getStepTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->latsStepTime;\n $this->latsStepTime = $currentTime;\n\n return $result;\n }", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function getUserIdleSeconds()\n {\n try\n {\n $luats = $this->getInstanceUserActionTimestamp();\n $now = time();\n $diff = $now - $luats;\n return $diff;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "public function getTime()\n {\n return $this->get(self::TIME);\n }", "function getTime(){\n\t\t$mtime = microtime();//print(\"\\n time : \" . $mtime);\n\t\t$mtime = explode(' ', $mtime);\n\t\t$mtime = $mtime[1] + $mtime[0];\n\t\treturn $mtime;\n\t}", "public static function __getTime()\n\t{\n\t\treturn time() + self::$__timeOffset;\n\t}", "public function getSessionTime(){\n return $this->_session->get('time');\n }", "public function getStartTime() {\n\t\t$gentime = explode(' ',microtime());\n\t\t$gentime = $gentime[1] + $gentime[0];\n\t\treturn $gentime;\n\t}", "public function getTiming()\n {\n return $this->timing;\n }", "public function starttime() {\n return $this->info['starttransfer_time'];\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function getElapsedTime();", "function get_cpu_speed() {\n\treturn get_single_sysctl(\"hw.clockrate\");\n}", "static public function get_time() {\n // By Zach Buller ([email protected])\n $time1 = \\microtime();\n \\settype($time1, 'string'); //convert to string to keep trailing zeroes\n $time2 = explode(\" \", $time1);\n $sub_secs = \\preg_replace('/0./', '', $time2[0], 1);\n $time3 = ($time2[1].$sub_secs)/100;\n return $time3;\n }", "protected function getStepTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->latsStepTime;\n \n $this->latsStepTime = $currentTime;\n \n return $result;\n }", "public static function timestamp(){\n $timestamp = time();\n return $timestamp;\n }", "public function getTime()\n {\n return $this->platformSupportsNanoseconds()\n ? hrtime(true)\n : microtime(true);\n }", "public function getTimestamp()\n {\n return time();\n }", "public static function timestamp() {\n return time(); \n }", "public function getMontacargasT()\n {\n\n return $this->montacargas_t;\n }", "public function getTskWorkTime()\n {\n return $this->tsk_work_time;\n }", "function getStartMicrotime();", "protected static function _time()\n\t{\n\t\treturn time();\n\t}", "public function lookuptime() {\n return $this->info['namelookup_time'];\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "public function GetCurrentTime(){\n\t\treturn date('y-m-d H:i:s', time());\n\t}", "function getsystime() {\n\n return date('Y-m-d H:i:s');\n\n}", "public function getTime()\n {\n $value = $this->get(self::TIME);\n return $value === null ? (integer)$value : $value;\n }", "public function calculateTimeMachine()\n {\n $days = array();\n for ($i=1; $i < 31; $i++) {\n $date = date('c', strtotime(\"-$i days\"));\n array_push($days, strtotime($date));\n }\n return $days;\n }", "public static function getWallTime(): float\n {\n self::start('getWallTime()');\n self::end('getWallTime()');\n $time = self::$_events[count(self::$_events) - 1]['wtime'] +\n self::_timeToStopwatch();\n\n return round($time, 3);\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "public function currentTime();", "public function get_starttime()\n {\n }", "function getTempo()\r\n {\r\n return $this->getData(DATE_FORMAT_UNIXTIME);\r\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function getRawTime(): float\n {\n return $this->endTime - $this->startTime;\n }", "function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}", "public static function getCurrentDateAndTimeOnCurrentComputer() {\n\t\treturn date ( 'Y-m-d H:i:s');\n\t}", "function process_time(){\n $time = number_format( microtime(true) - LIM_START_MICROTIME, 6);\n return($time);\n}", "public function getTotalTime()\n {\n $value = $this->get(self::TOTAL_TIME);\n return $value === null ? (integer)$value : $value;\n }", "public function pretransfertime() {\n return $this->info['pretransfer_time'];\n }" ]
[ "0.69072545", "0.6825759", "0.6698773", "0.6651592", "0.6526651", "0.65247583", "0.6484304", "0.6480462", "0.64451873", "0.6435941", "0.6435566", "0.6430083", "0.63721883", "0.6371592", "0.6359804", "0.635713", "0.63466597", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.6343901", "0.63346314", "0.63305265", "0.6329665", "0.6327895", "0.632752", "0.6324171", "0.63196224", "0.6319058", "0.63163465", "0.6314797", "0.6310367", "0.62859136", "0.628438", "0.6260593", "0.6252602", "0.62392384", "0.62322", "0.6231407", "0.6228764", "0.6227131", "0.6206737", "0.6205335", "0.6204013", "0.6200066", "0.61964804", "0.6195282", "0.6167679", "0.6162392", "0.6161419", "0.61500174", "0.61499363", "0.6145778", "0.61445695", "0.6139395", "0.61311746", "0.61307144", "0.61299795", "0.6128724", "0.6124414", "0.6118427", "0.61154103", "0.6112978", "0.61111253", "0.6105137", "0.6103346", "0.60888886", "0.6086977", "0.6082253", "0.6081559", "0.6072989", "0.6071982", "0.60659385", "0.6064871", "0.6064871", "0.6064049", "0.6061809", "0.605948", "0.6056191", "0.6054832", "0.6053427", "0.60532635", "0.6047892", "0.6043963", "0.6034063", "0.60336655", "0.6028863", "0.6023445", "0.60220313", "0.60180634", "0.6009333", "0.599342", "0.59920305", "0.5983354" ]
0.0
-1
/ The functions file is a special file that WordPress will automatically execute. It holds things like our menus, our widgets, etc. Even our own functions we want to share throughout our theme. Small utility function to shorten bloginfo('stylesheet_directory')
function sd () { bloginfo('stylesheet_directory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_stylesheet_directory()\n {\n }", "function child_shortcode() {\nreturn get_bloginfo('stylesheet_directory');\n}", "function get_stylesheet_directory_uri()\n {\n }", "function wpstartup_theme_stylesheet(){\n $globalstyle = plugins_url().'/wp-startup/templates/basic/global.css';\n echo '<link rel=\"stylesheet\" id=\"wp-startup-theme-style\" href=\"'.$globalstyle.'\" type=\"text/css\" media=\"all\" />';\n // theme default element positioning javascript\n echo '<script type=\"text/javascript\" src=\"'.plugins_url().'/wp-startup/templates/basic/elements.js\"></script>';\n\n // theme custom styling\n $stylesheet = plugins_url().'/wp-startup/templates/basic/style.css';\n echo '<link rel=\"stylesheet\" id=\"wp-startup-theme-style\" href=\"'.$stylesheet.'\" type=\"text/css\" media=\"all\" />';\n\n}", "function wpfme_adminCSS() {\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('template_directory').'/wp-admin.css\"/>';\n}", "function wp_custom_admin() { \n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'. get_stylesheet_directory_uri() .'/assets/css/wp-admin.css\" />'; \n}", "function wp_get_theme($stylesheet = '', $theme_root = '')\n {\n }", "function add_stylesheet() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . \n plugins_url('dc-admin.css', __FILE__) . '\">';\n}", "function tn_uas_adminstyle() {\n ?>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo plugin_dir_url( __FILE__ ) ?>includes/style.css\">\n <?php\n}", "function custom_login() { \necho '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('stylesheet_directory').'/css/custom-login.css\" />'; \n}", "function get_theme_root($stylesheet_or_template = '')\n {\n }", "function wmt_theme_style () {\n\twp_enqueue_style( 'normalize_css', get_template_directory_uri() . '/css/normalize.css' );\n\twp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'flexslider_css', get_template_directory_uri() . '/css/flexslider.css' );\n\twp_enqueue_style( 'font_awesome_css', get_template_directory_uri() . '/css/font-awesome.css' );\n\twp_enqueue_style( 'style_css', get_template_directory_uri() . '/css/estilos.css' );\n}", "function custom_login_css()\n{\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . get_stylesheet_directory_uri() . '/admin/login/login-styles.css\" />';\n}", "function wp_custom_login() { \n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'. get_stylesheet_directory_uri() .'/assets/css/wp-admin.css\" />'; \n}", "function css()\n{\n\t$cssbegin = '<link rel=\"stylesheet\" href=\"';\n\t$cssend = '\">';\n//\tif (current_user_can('administrator')) $csspath = '/css/';\n\t$csspath = '/css/'; //$csspath='/css/';\n\t$name = substr(basename(get_page_template()), 0, -4) . '.css';\n\t$filename = get_stylesheet_directory() . $csspath . $name;\n\tif (file_exists($filename)) return $cssbegin . get_template_directory_uri() . $csspath . $name . '?v=' . filemtime($filename) . $cssend;\n\telse { //create new file if no exists\n\t\t$fp = fopen($filename, \"w\");\n\t\tfwrite($fp, 'This is new file, add your styles @media(min-width:992px){} @media(max-width:991px) and (min-width:601px){} @media(max-width:600px){}');\n\t\tfclose($fp);\n\t\treturn $cssbegin . get_template_directory_uri() . $csspath . $name . $cssend;\n\t}\n}", "function city_admin_css() {\n\t$template_url = get_bloginfo('template_url');\n\techo '<link rel=\"stylesheet\" href=\"'.$template_url.'/css/admin-style.css\" />';\n}", "public function get_stylesheet_directory()\n {\n }", "function templ_add_my_stylesheet()\r\n{\r\n\r\n /* Respects SSL, Style.css is relative to the current file */\r\n\twp_enqueue_script('jquery');\r\n\t\r\n\t$tmpl_is_allow_url_fopen = tmpl_is_allow_url_fopen();\r\n\t\r\n\t/* Tevolution Plug-in Style Sheet File In Desktop view only */\t\r\n\tif (function_exists('tmpl_wp_is_mobile') && !tmpl_wp_is_mobile()) {\r\n\t\r\n\t\t/* if \"allow_url_fopen\" is enabled then apply minifiled css otherwise includse seperately */\r\n\t\tif(!$tmpl_is_allow_url_fopen){\r\n\t\t\twp_enqueue_style('tevolution_style',TEMPL_PLUGIN_URL.'style.css','',false);\r\n\t\t}else{\r\n\t\t\twp_enqueue_style('tevolution_style',TEMPL_PLUGIN_URL.'css.minifier.php','',false);\r\n\t\t}\r\n\t}\r\n\tif(function_exists('theme_get_settings')){\r\n\t\tif(theme_get_settings('supreme_archive_display_excerpt')){\r\n\t\t\tif(function_exists('tevolution_excerpt_length')){\r\n\t\t\t\tadd_filter('excerpt_length', 'tevolution_excerpt_length');\r\n\t\t\t}\r\n\t\t\tif(function_exists('new_excerpt_more')){\r\n\t\t\t\tadd_filter('excerpt_more', 'new_excerpt_more');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function my_admin_head() {\n echo '<link href=\"'.get_stylesheet_directory_uri().'/user-admin.css\" rel=\"stylesheet\" type=\"text/css\">';\n }", "function get_stylesheet_uri()\n {\n }", "function files()\n{\n wp_enqueue_style( 'style', get_template_directory_uri().'/css/style.css', false, '1.0', 'all' );\n}", "function wp_get_custom_css($stylesheet = '')\n {\n }", "function your_namespace()\n{\n wp_register_style('namespace', plugins_url('inc/style.css', __FILE__));\n wp_enqueue_style('namespace');\n}", "protected function getThemeDir()\n\t{\n\t\treturn Stringify::formatPath(get_stylesheet_directory());\n\t}", "function custom_files()\n{\n wp_enqueue_style(\"custom_css\", get_stylesheet_uri());\n}", "function custom_login() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('template_directory').'/css/custom-login.css\" />';\n}", "function wp_customize_url($stylesheet = '')\n {\n }", "function fsnat_settings_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-custom-css.php');\n}", "function rt_theme_styles(){\n\t/**\n\t priemrio o nome\n\t segundo o diretorio\n\t*/\n\twp_enqueue_style('bootstrap-css', get_template_directory_uri() . '/vendor/bootstrap/css/bootstrap.min.css?ver=1');\n\twp_enqueue_style('clean-blog', get_template_directory_uri() . '/css/clean-blog.css?ver=1');\n\twp_enqueue_style('font-awesome', get_template_directory_uri() . '/vendor/font-awesome/css/font-awesome.min.css');\n\n\t// FONTES\n\twp_enqueue_style('google-font-lora', 'https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic');\n\twp_enqueue_style('google-font-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800');\n\n\t// SCRIPTS\n\n\twp_enqueue_script('theme-jquery', get_template_directory_uri() . '/vendor/jquery/jquery.min.js');\n\twp_enqueue_script('theme-js', get_template_directory_uri() . '/vendor/jquery/jquery.js', array('jquery'), '', true);\n\t\n\twp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/vendor/bootstrap/js/bootstrap.bundle.min.js');\n\twp_enqueue_script('clean-blog-js', get_template_directory_uri() . '/js/clean-blog.min.js');\n\t\n}", "protected function getThemeUrl()\n\t{\n\t\treturn get_stylesheet_directory_uri();\n\t}", "function frame_theme_url($path = '')\n{\n return trailingslashit(get_stylesheet_directory_uri()).$path;\n}", "function charity_create_stylesheet() {\n $content = \"\\t\";\n $content .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\";\n $content .= get_bloginfo('stylesheet_url');\n $content .= \"\\\" />\";\n $content .= \"\\n\\n\";\n echo apply_filters('charity_create_stylesheet', $content);\n}", "function kcsite_add_admin_stylesheet() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_template_directory_uri().'/css/admin/admin-custom.css?2\">';\n}", "function wpfme_loginCSS() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('template_directory').'/wp-login.css\"/>';\n}", "function get_theme_file_path($file = '')\n {\n }", "function wp_styles()\n {\n }", "function wp_using_themes()\n {\n }", "function get_theme_directory_name() {\n $url = get_template_directory_uri();\n $url = str_replace( '/', '', str_replace( get_theme_root_uri(), '', $url ) );\n\n return $url;\n}", "function startwordpress_scripts() {\n wp_enqueue_style( 'blog', get_template_directory_uri() . '/style.css' );\n }", "function childtheme_create_stylesheet($content) {\r\n $content .= \"\\t\";\r\n $content .= \"\r\n <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\";\r\n //$content .= get_bloginfo('stylesheet_directory') . '/';\r\n $content .= 'http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css';\r\n $content .= \"\\\" />\";\r\n $content .= \"\\n\\n\";\r\n return $content;\r\n}", "function WPThemeDevPrac_resources(){\n\n\twp_enqueue_style('style', get_stylesheet_uri());\n\n}", "public function get_stylesheet_directory_uri()\n {\n }", "function get_stylesheet($mode = 'bydir') {\n\t\t\t$upload_dir = themify_upload_dir();\n\t\t\t$before=$mode==='bydir'?$upload_dir['basedir']:$upload_dir['baseurl'];\n\t\t\t$stylesheet = \"$before/themify-customizer-\".THEMIFY_VERSION.'-'.Themify_Enqueue_Assets::$themeVersion.'.css';\n\t\t\t/**\n\t\t\t * Filters the return URL or directory path including the file name.\n\t\t\t *\n\t\t\t * @since 2.2.5\n\t\t\t *\n\t\t\t * @param string $stylesheet Path or URL for the global styling stylesheet.\n\t\t\t * @param string $mode What was being retrieved, 'bydir' or 'byurl'.\n\t\t\t */\n\t\t\treturn apply_filters('themify_customizer_stylesheet', $stylesheet, $mode);\n\t\t}", "function AstronomeetLogin()\n{\necho '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . get_bloginfo('stylesheet_directory') . '/login/custom-login-style.css\" />';\n}", "function cpt_webtonio_head(){\t\n\techo \"<link type='text/css' rel='stylesheet' href='\" . get_bloginfo(\"template_url\") . \"/css/cpt-admin.css\".\"' />\";\n\n}", "function theme_styles()\r\n{\r\n\t// Example of loading a jQuery slideshow plugin just on the homepage\r\n\t// wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' );\r\n\r\n\t// Load all of the styles that need to appear on all pages\r\n\twp_enqueue_style('pure', get_template_directory_uri() . '/resources/css/pure-min.css');\r\n\twp_enqueue_style('grids-responsive', get_template_directory_uri() . '/resources/css/grids-responsive-min.css');\r\n\twp_enqueue_style('blog', get_template_directory_uri() . '/resources/css/blog.css');\r\n\twp_enqueue_style('main', get_stylesheet_uri());\r\n\r\n\t// Conditionally load the FlexSlider CSS on the homepage\r\n\t// if(is_page('home')) {\r\n\t// \twp_enqueue_style('flexslider');\r\n\t// }\r\n}", "function _preview_theme_stylesheet_filter()\n {\n }", "function my_custom_login() {\r\r\necho '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . get_bloginfo('stylesheet_directory') . '/login/custom-login-styles.css\" />';\r\r\n}", "function autoupdatecss( $post_id ) {\n\tif ( wp_is_post_revision( $post_id ) )\n\t\treturn;\n\n\t$directory = wp_upload_dir();\n $location = get_template_directory_uri().'/assets/css/gateley.css.php';\n$theme = wp_get_theme( $stylesheet, $theme_root ); \n$themename = $theme['Name']; \n$themename = strtolower($themename);\n$themename = str_replace(' ', '-', $themename);\n\n\n$myfile = fopen(get_template_directory().\"/assets/css/\".$themename.'-'.get_current_blog_id().\".css\", \"w\") or die(\"Unable to open file!\");\n$txt = '/* DO NOT EDIT - THIS IS A STATIC FILE - TO MAKE EDITS USE THIS FILE: /assets/css/gateley.css.php */\n';\n$minifiedtxt = file_get_contents($location);\n$txt .= $minifiedtxt;\nfwrite($myfile, $txt);\nfclose($myfile);\n\n}", "function wplastfm_css() {\r\n $relpath = '/'.dirname(plugin_basename(__FILE__)).'/wplastfm.css';\r\n if (file_exists(WP_PLUGIN_DIR.$relpath)) {\r\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.WP_PLUGIN_URL.$relpath.'\" />'.\"\\n\";\r\n }\r\n }", "function daf_styles() {\n wp_enqueue_style('daf_styles', get_stylesheet_uri());\n}", "function TemaCurso_resources(){\r\n wp_enqueue_style('style', get_stylesheet_uri());\r\n}", "function my_styles_files() {\n\twp_enqueue_style( 'montserrat-css', 'https://fonts.googleapis.com/css?family=Montserrat:400,700', false );\n\twp_enqueue_style( 'roboto-css', 'https://fonts.googleapis.com/css?family=Roboto:400,300,500,700', false );\n\twp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/assets/css/bootstrap.css', false );\n\twp_enqueue_style( 'animate-css', get_template_directory_uri() . '/assets/css/animate.css', false );\n\twp_enqueue_style( 'jquery-ui-css', get_template_directory_uri() . '/assets/css/jquery-ui.css', false );\n\twp_enqueue_style( 'simple-line-icons-css', get_template_directory_uri() . '/assets/css/simple-line-icons.css', false );\n\twp_enqueue_style( 'font-awesome-css', get_template_directory_uri() . '/assets/css/font-awesome.min.css', false );\n\twp_enqueue_style( 'icon-font-css', get_template_directory_uri() . '/assets/css/icon-font.css', false );\n\twp_enqueue_style( 'auction-css', get_template_directory_uri() . '/assets/css/auction.css', false );\n\twp_enqueue_style( 'rs-plugin-css', get_template_directory_uri() . '/assets/rs-plugin/css/settings.css', false );\n\twp_enqueue_style( 'fancybox-css', get_template_directory_uri() . '/assets/js/jquery/fancybox/jquery.fancybox.css', false );\n\tif ( is_child_theme() ) {\n\t\twp_enqueue_style( 'parent-css', trailingslashit( get_template_directory_uri() ) . 'style.css', false );\n\t}\n\twp_enqueue_style( 'theme-css', get_stylesheet_uri(), false );\n}", "function <%= functionPrefix %>_admin_styles() {\n\n\twp_register_style( 'admin-style', get_template_directory_uri() . '/assets/dist/css/admin.css', array(), null );\n\twp_enqueue_style( 'admin-style' );\n\n}", "function purpleBlog_resources() {\n\n\t/*-- stylesheets ---*/\n\twp_enqueue_style( 'style', get_stylesheet_uri() );\n\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'bootstrap_theme', get_template_directory_uri() . '/css/bootstrap-theme.css' );\n}", "function theme_styles(){\n\n\t\twp_enqueue_style( 'icons', get_template_directory_uri() . '/css/icons.data.png.css');\n\t\twp_enqueue_style( 'icon1', get_template_directory_uri() . '/css/icons.data.svg.css');\n\t\twp_enqueue_style( 'icon2', get_template_directory_uri() . '/css/icons.fallback.css');\n\t\twp_enqueue_style( 'normalize', get_template_directory_uri() . '/css/normalize.css');\n\t\twp_enqueue_style( 'google', 'http://fonts.googleapis.com/css?family=Cabin');\n\t\twp_enqueue_style( 'google', 'http://fonts.googleapis.com/css?family=PT+Sans');\n\t\twp_enqueue_style( 'main', get_template_directory_uri() . '/style.css');\n\n\n}", "function pfk_login_css() {\n\t/* i couldn't get wp_enqueue_style to work :( */\n\techo '<link rel=\"stylesheet\" href=\"' . get_stylesheet_directory_uri() . '/library/css/login.css\">';\n}", "function tac_css_enqueuer() {\n\twp_register_style( 'tac_main', get_stylesheet_directory_uri() . '/style.css' );\n\twp_enqueue_style( 'tac_main' );\n}", "function change_theme_root_dir(){\r\n\t$new_root = dirname( __FILE__ ) . '/templates/';\r\n\tregister_theme_directory( $new_root );\r\n\treturn $new_root;\r\n}", "function dfd_themes_scripts() {\n\t\tglobal $dfd_native;\n\t\t/*\n\t\t * Css styles\n\t\t */\n\t\twp_register_style('dfd_site_style', get_template_directory_uri() . '/assets/css/app.css', false, null);\n\t\t\n\t\twp_register_style('dfd_mobile_responsive', get_template_directory_uri() . '/assets/css/mobile-responsive.css', false, null);\n\t\t\n\t\twp_enqueue_style('dfd_site_style');\n\t\t\n\t\t/**\n\t\t * Check if WooCommerce is active\n\t\t * */\n\t\tif (class_exists('WooCommerce')) {\n\t\t\t$woocommerce_css_file = get_template_directory_uri() . '/assets/css/woocommerce.css';\n\t\t\t\n\t\t\twp_register_style('dfd_wocommerce_style', $woocommerce_css_file, false, null);\n\t\t\twp_enqueue_style('dfd_wocommerce_style');\n\t\t}\n\t\t\n\t\t/**\n\t\t * mobile responsive\n\t\t */\n\t\tif (!isset($dfd_native['mobile_responsive']) || $dfd_native['mobile_responsive'] != '0') {\n\t\t\twp_enqueue_style('dfd_mobile_responsive');\n\t\t}\n\t\t\n\t\tif(class_exists('ReduxFramework') && isset(ReduxFramework::$_upload_url) && isset(ReduxFramework::$_upload_dir) && file_exists(ReduxFramework::$_upload_dir . 'options.css') && isset($dfd_native['enqueue_styles_file']) && $dfd_native['enqueue_styles_file'] == 'on') {\n\t\t\twp_enqueue_style('dfd_theme_options', ReduxFramework::$_upload_url . 'options.css', false, null);\n\t\t}\n\t\t\n\t\tif(!class_exists('Dfd_Theme_extensions')) {\n\t\t\t$font_url = add_query_arg( 'family', urlencode( 'Open Sans:300,300italic,400,400italic,600,600italic,700italic,700&subset=latin,latin-ext' ), \"//fonts.googleapis.com/css\" );\n\t\t\twp_enqueue_style('dfd_defalt_fonts', $font_url, false, null);\n\t\t\twp_enqueue_style('dfd_default_icons', get_template_directory_uri() . '/assets/fonts/dfd_icon_set.css', false, null);\n\t\t}\n\t\t\n\t\twp_enqueue_style( 'main-style', get_stylesheet_uri(), false, null );\n\t\t\n\t\tif(function_exists('dfd_custom_page_style')){\n\t\t\tdfd_custom_page_style();\n\t\t}\n\t\t\n\t\t/* RTL support */\n\t\tif(is_rtl()) {\n\t\t\twp_enqueue_style('dfd_rtl', get_template_directory_uri() . '/assets/css/rtl.css', false, null);\n\t\t}\n\t\t\n\t\t/*\n\t\t * JS register\n\t\t */\n\t\t\n\t\t$google_api_key = 'AIzaSyCEc0PM7rpun59m20yBBtRsl62I6eEsKl4';\n\t\tif(isset($dfd_native['custom_google_api_key']) && !empty($dfd_native['custom_google_api_key'])) {\n\t\t\t$google_api_key = $dfd_native['custom_google_api_key'];\n\t\t}\n\t\t\n\t\twp_register_script('gmaps', '//maps.googleapis.com/maps/api/js?key='.$google_api_key, array('jquery'), null, false, true);\n\t\t\n\t\twp_register_script('gmap3', get_template_directory_uri() . '/assets/js/gmap3.min.js', array('jquery'), null, true, true);\n\t\twp_register_script('dfd_gmap', get_template_directory_uri() . '/assets/js/dfd_gmap.js', array('jquery'), null, true, true);\n\t\t\n\t\twp_register_script('dfd_woocommerce_scripts', get_template_directory_uri() . '/assets/js/woocommerce.js', array('jquery'), null, true);\n\n\t\t// Video Player\n\t\twp_register_script('dfd_zencdn_video_js', get_template_directory_uri() . '/assets/js/video-js.js', array('jquery'), null);\n\t\t\n\t\t// Facebook Widget\n\t\twp_register_script('dfd_facebook_widget_script', get_template_directory_uri().'/assets/js/widget-facebook.js', array('jquery'), null, true);\n\n\t\t// keyframe\n\t\t\n\t\t// ajax pagination\n\t\twp_register_script('ajax-pagination', get_template_directory_uri().'/assets/js/ajax-pagination.js', array('jquery'), null, true);\n\t\twp_register_script('dfd-lazy-load', get_template_directory_uri().'/assets/js/ajax-lazy-load.js', array('jquery'), null, true);\n\t\t\n\t\t//slick slider\n\t\t\n\t\twp_register_script('dfd-particleground', get_template_directory_uri().'/assets/js/jquery.particleground.min.js', array('jquery'), null, true);\n\t\twp_register_script('dfd-particleground-old', get_template_directory_uri().'/assets/js/jquery.particleground.old.min.js', array('jquery'), null, true);\n\t\t\n\t\twp_register_script('dfd-canvas-bg-first', get_template_directory_uri().'/assets/js/dfd_canvas_bg_style_1.js', array('jquery'), null, true);\n\t\t\n\t\twp_register_script('dfd-canvas-bg-third', get_template_directory_uri().'/assets/js/dfd_canvas_bg_style_3.js', array('jquery'), null, true);\n\t\t\n\t\twp_register_script('dfd-jparallax', get_template_directory_uri().'/assets/js/jquery.parallax.js', array('jquery'), null, false);\n\t\t\n//\t\twp_register_script('dfd-sly', get_template_directory_uri().'/assets/js/sly.min.js', array('jquery'), null, false);\n\t\t\n//\t\twp_register_script('dfd-jpcqarallax', get_template_directory_uri().'/assets/js/jquery.parallax.js', array('jquery'), null, false);\n\t\t\n\t\t/*\n\t\t * JS enquene\n\t\t */\n\t\tif(!isset($dfd_native['dev_mode']) || $dfd_native['dev_mode'] != 'on' || !defined('DFD_DEBUG_MODE') || !DFD_DEBUG_MODE) {\n\t\t\tif (strcmp(DfdMetaBoxSettings::compared('site_preloader_enabled', 'off'),'1')===0) {\n\t\t\t\twp_register_script('dfd_queryloader2', get_template_directory_uri() . '/assets/js/jquery.queryloader2.min.js', array('jquery'), '2', false, true);\n\t\t\t\twp_enqueue_script('dfd_queryloader2');\n\t\t\t}\n\t\t\twp_register_script('dfd_js_plugins', get_template_directory_uri() . '/assets/js/plugins.min.js', array('jquery'), null, true);\n\t\t\twp_localize_script('dfd_js_plugins', 'ajax_var', array(\n\t\t\t\t'url' => admin_url('admin-ajax.php'),\n\t\t\t\t'nonce' => wp_create_nonce('ajax-nonce')\n\t\t\t));\n\t\t\twp_enqueue_script('dfd_js_plugins');\n\t\t\t\n\t\t\twp_register_script('dfd.onepagescroll', get_template_directory_uri().'/assets/js/jquery.fullPage.min.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-multislider', get_template_directory_uri().'/assets/js/jquery.multiscroll.min.js', array('jquery'), null, true);\n\t\t\t\n\t\t} else {\n\t\t\twp_register_script('dfd_foundation', get_template_directory_uri() . '/assets/js/foundation.js', array('jquery'), null, true);\n\t\t\twp_register_script('keyframes', get_template_directory_uri().'/assets/js/jquery.keyframes.min.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd_effects', get_template_directory_uri() . '/assets/js/animation.js', array('jquery'), null, true);\n\t\t\twp_register_script('mmenu', get_template_directory_uri().'/assets/js/jquery.sidr.js', array('jquery'), null, true);\n\t\t\twp_register_script('slick', get_template_directory_uri().'/assets/js/jquery.slick.min.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd_scrollTo', get_template_directory_uri().'/assets/js/jquery.scrollTo.js', array('jquery'), null, true);\n\t\t\twp_register_script('jquery.easing', get_template_directory_uri().'/assets/js/jquery.easing.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-folio-hover', get_template_directory_uri().'/assets/js/jquery.hoverdir.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-chaffle', get_template_directory_uri().'/assets/js/jquery.chaffle.js', array('jquery'), null, true);\n\t\t\twp_register_script('prettyphoto', get_template_directory_uri() . '/assets/js/jquery.prettyPhoto.js', array('jquery'), null, true, true);\n\t\t\twp_register_script('custom-share', get_template_directory_uri() . '/assets/js/share.js', array('jquery'), null, true);\n\t\t\twp_register_script('vertical_js', get_template_directory_uri() . '/assets/js/vertical.js', array('jquery'), null, true);\n\t\t\twp_register_script('dropkick', get_template_directory_uri() . '/assets/js/jquery.dropkick-min.js', array('jquery'), null, true);\n\t\t\twp_register_script('isotope', get_template_directory_uri() . '/assets/js/jquery.isotope.min.js', array('jquery'), null, true);\n\t\t\twp_register_script('justified', get_template_directory_uri() . '/assets/js/justifiedGallery.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-3d-hover', get_template_directory_uri() . '/assets/js/jquery.hover3d.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-sticky-kit', get_template_directory_uri() . '/assets/js/sticky-kit.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-tween-max', get_template_directory_uri().'/assets/js/TweenMax.min.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-mousestop', get_template_directory_uri().'/assets/js/mousestop.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-images-loaded', get_template_directory_uri().'/assets/js/imagesloaded.pkgd.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-fancy-text', get_template_directory_uri().'/assets/js/fancy-text.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-svg-loaded', get_template_directory_uri().'/assets/js/svgLoader.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-hotspot', get_template_directory_uri().'/assets/js/jquery.hotspot.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd-multislider', get_template_directory_uri().'/assets/js/jquery.multiscroll.js', array('jquery'), null, true);\n\t\t\twp_register_script('dfd_main', get_template_directory_uri() . '/assets/js/app.js', array('jquery'), null, true);\n\t\t\twp_localize_script('dfd_main', 'ajax_var', array(\n\t\t\t\t'url' => admin_url('admin-ajax.php'),\n\t\t\t\t'nonce' => wp_create_nonce('ajax-nonce')\n\t\t\t));\n\t\t\t\n\t\t\twp_register_script('smooth-scroll', get_template_directory_uri() . '/assets/js/jquery.smoothscroll.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('dfd_slide_parallax', get_template_directory_uri() . '/assets/js/jquery.slide_parallax.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('dfd-typed', get_template_directory_uri().'/assets/js/typed.js', array('jquery'), null, false);\n\t\t\t\n\t\t\twp_register_script('dfd-swiper', get_template_directory_uri().'/assets/js/swiper.js', array('jquery'), null, false);\n\t\t\t\n\t\t\twp_register_script('dfd.onepagescroll', get_template_directory_uri().'/assets/js/jquery.fullPage.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('js-audio', get_template_directory_uri().'/assets/js/audioplayer.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('mega_menu', get_template_directory_uri().'/assets/js/jquery.mega-menu.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('mega_menu_run', get_template_directory_uri().'/assets/js/jquery.mega-menu.run.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_register_script('countdown-js',get_template_directory_uri().'/assets/js/jquery.countdown.min.js',array('jquery'));\n\t\t\t\n\t\t\twp_register_script( 'odometer-js', get_template_directory_uri() . '/assets/js/odometer.min.js', array( 'jquery' ), false, true );\n\t\t\t\n\t\t\twp_register_script( 'piechart-js', get_template_directory_uri() . '/assets/js/circle-progress.js', array( 'jquery' ), false, true );\n\t\t\t\n\t\t\tif (strcmp(DfdMetaBoxSettings::compared('site_preloader_enabled', 'off'),'1')===0) {\n\t\t\t\twp_register_script('dfd_queryloader2', get_template_directory_uri() . '/assets/js/jquery.queryloader2.js', array('jquery'), '2', false, true);\n\t\t\t\twp_enqueue_script('dfd_queryloader2');\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_script('dfd_foundation');\n\t\t\twp_enqueue_script('keyframes');\n\t\t\twp_enqueue_script('dfd-chaffle');\n\t\t\twp_enqueue_script('js-audio');\n\n\t\t\twp_enqueue_script('dfd_effects');\n\t\t\twp_enqueue_script('isotope');\n\t\t\twp_enqueue_script('justified');\n\t\t\twp_enqueue_script('dfd-3d-hover');\n\t\t\twp_enqueue_script('dfd-sticky-kit');\n\t\t\twp_enqueue_script('dfd-tween-max');\n\t\t\twp_enqueue_script('dfd-mousestop');\n\t\t\twp_enqueue_script('dfd-images-loaded');\n\t\t\twp_enqueue_script('dfd-svg-loaded');\n\n\t\t\twp_enqueue_script('slick');\n\t\t\twp_enqueue_script('dfd_scrollTo');\n\t\t\twp_enqueue_script('jquery.easing');\n\t\t\twp_enqueue_script('custom-share');\n\t\t\twp_enqueue_script('vertical_js');\n\t\t\twp_enqueue_script('dropkick');\n\t\t\twp_enqueue_script('prettyphoto');\n\n\t\t\twp_enqueue_script('dfd-swiper');\n\n\t\t\twp_enqueue_script('mmenu');\n\n\t\t\twp_enqueue_script('dfd-folio-hover');\n\n\t\t\twp_enqueue_script('dfd-panr', get_template_directory_uri().'/assets/js/jquery.panr.js', array('jquery'), null, true);\n\t\t\t\n\t\t\twp_enqueue_script('mega_menu');\n\t\t\t\n\t\t\twp_enqueue_script('mega_menu_run');\n\t\t\n\t\t\twp_enqueue_script('smooth-scroll');\n\t\t\t\n\t\t\twp_enqueue_script('countdown-js');\n\t\t\twp_enqueue_script( 'odometer-js');\n\t\t\twp_enqueue_script( 'piechart-js' );\n\t\t\t\n\t\t\twp_enqueue_script('dfd_main');\n\t\t}\n\t\t\n\t\tif (class_exists('WooCommerce')) {\n\t\t\twp_enqueue_script('dfd_woocommerce_scripts');\n\t\t}\n\t\t\n\t\t# Load script/styles for page templates\n\t\tif (is_page()) {\n\t\t\t$curr_page_template = basename(get_page_template());\n\n\t\t\tif($curr_page_template == 'tmp-one-page-scroll.php') {\n\t\t\t\twp_enqueue_script('dfd.onepagescroll');\n\t\t\t}\n\n\t\t\tif($curr_page_template == 'tmp-side-by-side.php') {\n\t\t\t\twp_enqueue_script('dfd-multislider');\n\t\t\t}\n\t\t}\n\t\tif(function_exists('dfd_print_head_js')){\n\t\t\tdfd_print_head_js();\n\t\t}\n\t}", "function get_template_directory_uri()\n {\n }", "function hejtiger_theme_styles() {\n\n\twp_enqueue_style('style.css', get_stylesheet_uri() );\n}", "function enqueue_my_styles() {\n\t $magnific = THEME_DIR . '/css/magnific-popup.css';\n\t $rtlres \t= THEME_DIR . '/css/rtl-responsive.css';\n\n\t $fonts \t\t\t\t= THEME_DIR . '/fonts/stylesheet.css';\n\n\t $font_awesome = THEME_DIR . '/css/font-awesome.min.css';\n\t $swiper \t= THEME_DIR . '/css/swiper.min.css';\n\t $mainStyle = THEME_DIR . '/css/style.css';\n\t $rtl \t\t\t\t= THEME_DIR . '/css/rtl.css';\n\t $responsive \t\t= THEME_DIR . '/css/responsive.css';\n\t $rtlresponsive \t\t= THEME_DIR . '/css/rtl-responsive.css';\n\n\t $fancyboxcss \t\t= THEME_DIR . '/js/fancybox/jquery.fancybox.css';\n\t $calendar \t\t\t= THEME_DIR . '/css/fullcalendar.min.css';\n\t $calendar_print \t= THEME_DIR . '/css/fullcalendar.print.css';\n\t\t$joined_style = THEME_DIR . '/style.css';\n\t\t$accessiblity_style = THEME_DIR . '/css/accessibility.css';\n\n\t wp_enqueue_style( 'swiper', $swiper, array(), 'v1', 'all' );\n\t wp_enqueue_style( 'fancyboxcss', $fancyboxcss, array(), 'v1', 'all' );\n\n\t \twp_enqueue_style( 'calendar', $calendar, array(), 'v1', 'all' );\n\t wp_enqueue_style( 'calendar_print', $calendar_print, array(), 'v1', 'all' );\n\n\n\n\t\tif( is_rtl() ) {\n\t\t\twp_enqueue_style( 'rtl', $rtl, array(), 'v1', 'all' );\n\t\t\twp_enqueue_style( 'rtlresponsive', $rtlresponsive, array(), 'v1', 'all' );\n\t\t} else {\n\t\t\twp_enqueue_style( 'mainStyle', $mainStyle, array(), 'v1', 'all' );\n\t\t\twp_enqueue_style( 'responsive', $responsive, array(), 'v1', 'all' );\n\t\t}\n\n\t\twp_enqueue_style( 'style', $joined_style, array(), 'v1', 'all' );\n\t\twp_enqueue_style( 'accessiblity', $accessiblity_style, array(), NULL, 'all' );\n\t}", "function add_my_stylesheet() {\n}", "function wpfme_loginCSS() {\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('template_directory').'/css/wp-login.css\"/>';\n}", "function my_admin_theme_style() {\nwp_enqueue_style('my-admin-theme', plugins_url('wp-admin.css', __FILE__));}", "public function theme_css() {\n\t\t\n\t\t// Get global object\n\t\tglobal $wpex_theme;\n\n\t\t// Font Awesome\n\t\twp_deregister_style( 'font-awesome' );\n\t\twp_deregister_style( 'fontawesome' );\n\t\twp_enqueue_style( 'wpex-font-awesome', WPEX_CSS_DIR_URI .'font-awesome.min.css', false, '4.3.0' );\n\n\t\t// Register hover-css\n\t\twp_register_style( 'wpex-hover-animations', WPEX_CSS_DIR_URI .'hover-css.min.css', false, '2.0.1' );\n\n\t\t// Main Style.css File\n\t\twp_enqueue_style( 'wpex-style', get_stylesheet_uri(), false, WPEX_THEME_VERSION );\n\n\t\t// Load RTL.css first\n\t\tif ( is_RTL() ) {\n\t\t\twp_enqueue_style( 'wpex-rtl', WPEX_CSS_DIR_URI .'rtl.css', array( 'wpex-style' ), false );\n\t\t}\n\n\t\t// Visual Composer CSS\n\t\tif ( WPEX_VC_ACTIVE ) {\n\t\t\twp_enqueue_style( 'wpex-visual-composer', WPEX_CSS_DIR_URI .'wpex-visual-composer.css', array( 'js_composer_front' ), '2.0.1' );\n\t\t\twp_enqueue_style( 'wpex-visual-composer-extend', WPEX_CSS_DIR_URI .'wpex-visual-composer-extend.css', '', '2.0.0' );\n\t\t}\n\n\t\t// BBPress CSS\n\t\tif ( WPEX_BBPRESS_ACTIVE && is_bbpress() ) {\n\t\t\twp_enqueue_style( 'wpex-bbpress', WPEX_CSS_DIR_URI .'wpex-bbpress.css', array( 'bbp-default' ), '2.0.0' );\n\t\t}\n\n\t\t// Ligthbox skin\n\t\tif ( ! empty( $wpex_theme->lightbox_skin ) ) {\n\t\t\twp_enqueue_style( 'wpex-ilightbox-'. $wpex_theme->lightbox_skin .'-skin', wpex_ilightbox_stylesheet( $wpex_theme->lightbox_skin ), array( 'wpex-style' ) );\n\t\t}\n\n\t}", "function admin_style() {\n wp_enqueue_style( 'adminCSS', get_template_directory_uri() . '/css/admin-style.css' );\n}", "function wpstandard_files() {\n\n $parent_style = 'twentynineteen-style'; // This is 'twentynineteen-style' for the Twenty nineteen theme.\n \n wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );\n \n wp_enqueue_style( 'child-style',\n get_stylesheet_directory_uri() . '/style.css',\n array( $parent_style ),\n wp_get_theme()->get('Version') \n );\n \n \n wp_enqueue_script('main-chealeyv2-js', get_theme_file_uri('/js/scripts-bundled.js'), NULL, microtime(), true);\n wp_enqueue_style('custom-google-fonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,400,400i,700,700i');\n wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');\n wp_enqueue_style( 'dashicons' );\n\n wp_enqueue_style('chealeyv2_main_styles', get_stylesheet_uri(), NULL, microtime());\n\n wp_localize_script('main-chealeyv2-js', 'chealeyv2Data', array(\n 'root_url' => get_site_url(),\n 'nonce' => wp_create_nonce('wp_rest')\n ));\n}", "function get_stylesheet()\n {\n }", "function pnq_get_theme_slug() {\n\t$theme_name = pnq_get_theme_name();\n\t$theme_slug = pnq_str_to_slug( $theme_name );\n\t\n\t// apply filter 'pnq_theme_slug'\n\t$theme_slug = pnq_theme_slug( $theme_slug );\n\t\n\treturn $theme_slug;\t\n}", "function _wsjs( $f ) {\r\n\t$theme_dir = get_bloginfo('stylesheet_directory');\r\n\t$f = ltrim( $f, '/' );\r\n\t$u = $theme_dir . '/' . $f;\r\n\t$p = dirname( __FILE__ ) . '/' . $f;\r\n\tif ( file_exists( $p ) ) {\r\n\t\treturn $u . '?' . filemtime( $p );\r\n\t}\r\n\treturn '';\r\n}", "function custom_login_css() { \n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'. plugin_dir_url( __FILE__ ) .'css/login-styles.css\" />'; \n}", "function themeslug_enqueue_style() {\n\twp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css', false ); \n\twp_enqueue_style( 'foundation_css', get_template_directory_uri() . '/css/foundation.min.style.css', false ); \n}", "function cm_my_custom_login() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . get_bloginfo('stylesheet_directory') . '/login/custom-login-styles.css\" />';\n}", "function reverie_css_style()\n{\t\n\t// normalize stylesheet\n\t// wp_register_style( 'reverie-normalize-stylesheet', get_template_directory_uri() . '/css/normalize.css', array(), '' );\n\t\n\t// foundation stylesheet\n\twp_register_style( 'reverie-foundation-stylesheet', get_template_directory_uri() . '/css/foundation.css', array(), '' );\t\n\t\n\t// Register the main style under root directory\n\twp_register_style( 'reverie-stylesheet', get_stylesheet_directory_uri() . '/style.css', array(), '', 'all' );\n\t\n\twp_enqueue_style( 'reverie-normalize-stylesheet' );\n\twp_enqueue_style( 'reverie-foundation-stylesheet' );\n\twp_enqueue_style( 'reverie-stylesheet' );\n\t\n}", "function elzero_style() {\n wp_enqueue_style('font-awesome-style' , get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(),'4.7.0');\n wp_enqueue_style('bootstrap-style' , get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(),'4.0.0-alpha.6');\n wp_enqueue_style('my-style' , get_template_directory_uri() . '/assets/css/style.min.css', array(),'1.0.0');\n}", "function fn_adt_admin_css_content()\n{\n\t//$adt_css_file_name=ADT_PLUGIN_DIR_PATH.'assets/css/adt_custom_css.css';//ADT_PLUGIN_DIR_PATH\n\t//$adt_css_folder_path=ADT_PLUGIN_DIR_PATH.'assets/css/';//ADT_PLUGIN_DIR_PATH\n\n\t//refrence http://www.webdesignerdepot.com/2012/08/wordpress-filesystem-api-the-right-way-to-operate-with-local-files/\n\n\t$form_url = 'admin.php?page='.PLUGIN_ADMIN_PAGE_SLUG.'&tab=css';\n\t$output = $error = '';\n\n\t/**\n\t * write submitted text into file (if any)\n\t * or read the text from file - if there is no submission\n\t **/\n\tif(isset($_POST['txt_adt_css']))//new submission\n\t{\n\n\t if(false === ($output = fn_adt_css_write($form_url)))\n\t {\n\t return; //we are displaying credentials form - no need for further processing\n\n\t }\n\t elseif(is_wp_error($output))\n\t {\n\t $error = $output->get_error_message();\n\t $output = '';\n\t }\n\n\t} else {//read from file\n\n\t if(false === ($output = fn_adt_css_read($form_url))){\n\t return; //we are displaying credentials form no need for further processing\n\n\t } elseif(is_wp_error($output)) {\n\t $error = $output->get_error_message();\n\t $output = '';\n\t }\n\t}\n\n\t$output = $output; //escaping for printing\n\n\t$str_error='';\n\tif($error)\n\t{\n\t\t$str_error='<div class=\"error below-h2\">'.$error.'</div>';\n\t}\n\n\t$str_return='\n\t\t<div class=\"postbox\">\n\t\t <h3 class=\"hndle\"><span>Custom Adore Datatables CSS (Global)</span></h3>\n\t\t <div class=\"inside\">\n\t\t <p class=\"alternate\">Write your custom CSS here. This CSS will be loaded on every page/post where Adore Datatable instance exists.</p>\n\t\t '.$str_error.'\n\t\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t\t'.wp_nonce_field('adt_css_save_nonce').'\n\t\t\t\t\t<fieldset class=\"form-table\">\n\t\t\t\t\t <label for=\"txt_adt_css\">Write your custom CSS Below</label><br>\n\t\t\t\t\t <textarea id=\"txt_adt_css\" name=\"txt_adt_css\" rows=\"8\" class=\"large-text\">'.$output.'</textarea>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<input type=\"submit\" value=\"Save CSS\" class=\"button button-primary\" id=\"cmd_adt_css_submit\" name=\"cmd_adt_css_submit\">\n\t\t\t\t</form>\n\t\t </div>\n\t\t</div>\n\t';\n\treturn $str_return;\n}", "function cssuni($name)\n{\n\t$cssbegin = '<link rel=\"stylesheet\" href=\"';\n\t$cssend = '\">';\n//\tif (current_user_can('administrator')) $csspath = '/css/';\n\t$csspath = '/css/'; //$csspath='/css/';\n\t$filename = get_stylesheet_directory() . $csspath . $name;\n\tif (file_exists($filename)) return $cssbegin . get_template_directory_uri() . $csspath . $name . '?v=' . filemtime($filename) . $cssend;\n\treturn $cssbegin . get_template_directory_uri() . $csspath . $name . $cssend;\n}", "function add_css() {\n // È possibile aggiungere un file css presente nella cartella del tema\n wp_register_style('normalize', get_template_directory_uri() . '/vendor/normalize/normalize.css', array(), null, 'all');\n wp_enqueue_style('normalize');\n wp_register_style('main', get_template_directory_uri() . '/css/main.css', array('normalize'), null, 'all');\n wp_enqueue_style('main');\n\n // È possibile anche aggiungere un url remoto (es. Google Fonts)\n // wp_register_style('webfont', 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,500,600,700,800,900', array(), null, 'all');\n // wp_enqueue_style('webfont');\n\n // Inoltre è possibile aggiungere un css solo se una determinata condizione è vera\n // In questo esempio aggiungiamo il file home.css solo se ci troviamo sulla pagina di home\n // if(is_home()) {\n // wp_register_style('home', get_template_directory_uri() . '/css/home.css', array(), null, 'all');\n // wp_enqueue_style('home');\n // }\n}", "function login_style_wp_head() {\n\t// This is ornery, but needs to be to support WordPress *and* WPMU.\n\t$blf = dirname(__FILE__);\n\tif(is_file(\"$blf/login-style.css\")) {\n\t\t$css = trailingslashit(get_option('siteurl')) . trailingslashit(substr($blf, strpos($blf, 'wp-content'))) . 'login-style.css';\n\t\techo '<link rel=\"stylesheet\" href=\"'.$css.'\" type=\"text/css\" media=\"screen\" />';\n\t}\n}", "function wp_get_custom_css_post($stylesheet = '')\n {\n }", "function adventure_inline_css() {\r\n \r\n //Favicon\r\n if ( get_theme_mod('favicon_setting') != '' ) {\r\n echo '<!-- Favicon Image -->' . \"\\n\";\r\n echo '<link rel=\"shortcut icon\" href=\"' . get_theme_mod('favicon_setting') . '\" />' . \"\\n\\n\";}\r\n\t\t\r\n\t\t// Convert Content from Hex to RGB\r\n\t\tif ( get_theme_mod('backgroundcolor_setting') != '#b4b09d' ) {\r\n\t\t\t$hex = str_replace(\"#\", \"\", get_theme_mod('backgroundcolor_setting'));\r\n\t\t\tif(strlen($hex) == 3) {\r\n\t\t\t\t$r = hexdec(substr($hex,0,1).substr($hex,0,1));\r\n\t\t\t\t$g = hexdec(substr($hex,1,1).substr($hex,1,1));\r\n\t\t\t\t$b = hexdec(substr($hex,2,1).substr($hex,2,1)); }\r\n\t\t\telse {\r\n\t\t\t\t$r = hexdec(substr($hex,0,2));\r\n\t\t\t\t$g = hexdec(substr($hex,2,2));\r\n\t\t\t\t$b = hexdec(substr($hex,4,2)); } }\r\n\r\n\t\t// Convert Sidebar from Hex to RGB\r\n\t\tif ( ( get_theme_mod('sidebarcolor_setting') != '#000000' ) ) {\r\n\t\t$hexs = str_replace(\"#\", \"\", get_theme_mod('sidebarcolor_setting'));\r\n\r\n\t\tif(strlen($hexs) == 3) {\r\n\t\t\t$rs = hexdec(substr($hexs,0,1).substr($hexs,0,1));\r\n\t\t\t$gs = hexdec(substr($hexs,1,1).substr($hexs,1,1));\r\n\t\t\t$bs = hexdec(substr($hexs,2,1).substr($hexs,2,1)); }\r\n\t\telse {\r\n\t\t\t$rs = hexdec(substr($hexs,0,2));\r\n\t\t\t$gs = hexdec(substr($hexs,2,2));\r\n\t\t\t$bs = hexdec(substr($hexs,4,2)); } }\r\n\t\t\r\n if ( ( get_theme_mod('titlefontstyle_setting') != 'Default') || (get_theme_mod('taglinefontstyle_setting') != 'Default') || (get_theme_mod('bodyfontstyle_setting') != 'Default') || (get_theme_mod('headerfontstyle_setting') != 'Default')) {\r\n echo '<!-- Custom Font Styles -->' . \"\\n\";\r\n if (get_theme_mod('titlefontstyle_setting') != 'Default') {echo \"<link href='https://fonts.googleapis.com/css?family=\" . get_theme_mod('titlefontstyle_setting') . \"' rel='stylesheet' type='text/css'>\" . \"\\n\"; }\r\n if (get_theme_mod('taglinefontstyle_setting') != 'Default') {\techo \"<link href='https://fonts.googleapis.com/css?family=\" . get_theme_mod('taglinefontstyle_setting') . \"' rel='stylesheet' type='text/css'>\" . \"\\n\"; }\r\n if (get_theme_mod('bodyfontstyle_setting') != 'Default') {\techo \"<link href='https://fonts.googleapis.com/css?family=\" . get_theme_mod('bodyfontstyle_setting') . \"' rel='stylesheet' type='text/css'>\" . \"\\n\"; }\r\n if (get_theme_mod('headerfontstyle_setting') != 'Default') {\techo \"<link href='https://fonts.googleapis.com/css?family=\" . get_theme_mod('headerfontstyle_setting') . \"' rel='stylesheet' type='text/css'>\" . \"\\n\"; }\r\n echo '<!-- End Custom Fonts -->' . \"\\n\\n\";}\r\n\r\n\t\techo '<!-- Custom CSS Styles -->' . \"\\n\";\r\n echo '<style type=\"text/css\" media=\"screen\">' . \"\\n\";\r\n if (is_page() || is_single()) $featured_background = get_post_meta( get_queried_object_ID(), 'featured-background', true ); if (!empty($featured_background)) echo ' body, body.custom-background {background-image:url(' . $featured_background . '); background-size:cover;}' . \"\\n\";\r\n\t\tif ( get_theme_mod('backgroundsize_setting') != 'auto' ) echo '\tbody, body.custom-background {background-size:' . get_theme_mod('backgroundsize_setting') . ';}' . \"\\n\";\r\n\t\tif ( get_theme_mod('backgroundcolor_setting') != '#b4b09d' ) echo '\t.contents {background: rgba(' . $r . ',' . $g . ', ' . $b . ', ' . get_theme_mod('contentbackground_setting') . ');}' . \"\\n\";\r\n if ( get_theme_mod('backgroundcolor_setting') != '#b4b09d' ) echo ' @media only screen and (max-width:55em) { .contents {background: rgba(' . $r . ',' . $g . ', ' . $b . ', .95 );} }' . \"\\n\";\r\n\t\tif ( ( get_theme_mod('sidebarcolor_setting') != '#000000' ) || ( get_theme_mod('sidebarbackground_setting') != '.50' ) ) echo '\taside {background: rgba(' . $rs . ',' . $gs . ', ' . $bs . ', ' . get_theme_mod('sidebarbackground_setting') . ');}' . \"\\n\";\r\n\t\tif ( get_theme_mod('titlecolor_setting') != '#eee2d6' ) echo '\t.header h1 a {color:' . get_theme_mod('titlecolor_setting') . ';}' . \"\\n\";\r\n\t\tif ( get_theme_mod('taglinecolor_setting') != '#066ba0' ) echo '\t.header h1 i {color:' . get_theme_mod('taglinecolor_setting') . ';}' . \"\\n\";\r\n\t\tif ( get_theme_mod('title_size_setting') != '4.0' ) echo '\t.header h1 {font-size:' . get_theme_mod('title_size_setting') . 'em;}' . \"\\n\"; \r\n\t\tif ( get_theme_mod('tagline_rotation_setting') != '-1.00' ) echo '\t.header h1 i {-moz-transform:rotate(' . get_theme_mod('tagline_rotation_setting') . 'deg); transform:rotate(' . get_theme_mod('tagline_rotation_setting') . 'deg);}' . \"\\n\";\r\n\t\tif ( (get_theme_mod('bannerimage_setting') != 'purple.png') && (get_theme_mod('bannerimage_setting') != '') ) echo '\t.header {background: bottom url(' . get_template_directory_uri() . '/images/' . get_theme_mod('bannerimage_setting') . ');}'. \"\\n\";\r\n\t\tif ( get_theme_mod('headerspacing_setting') != '18' ) echo '\t.spacing {height:' . get_theme_mod('headerspacing_setting') . 'em;}'. \"\\n\";\r\n\t\tif ( get_theme_mod('menu_setting') == 'notitle' ) { echo '\t.header {position: fixed;margin-top:0px;}' . \"\\n\" . '\t.admin-bar .header {margin-top:28px;}' . \"\\n\" . '.header h1:first-child, .header h1:first-child i, .header img:first-child {display: none;}' . \"\\n\"; }\r\n\t\tif ( get_theme_mod('menu_setting') == 'bottom' ) { echo '\t.header {position: fixed; bottom:0; top:auto;}' . \"\\n\" . '\t.header h1:first-child, .header h1:first-child i, .header img:first-child {display: none;}' . \"\\n\" . '.header li ul {bottom:2.78em; top:auto;}' . \"\\n\";}\r\n if ( get_theme_mod('border_setting') == 'hidden' ) { echo '\t.contents {border:none; box-shadow:0 0 3px #111;}' . \"\\n\";}\r\n if ( (get_theme_mod('border_setting') != '3px') && (get_theme_mod('border_setting') != 'hidden') ) { echo '\t.contents {border-width:' . get_theme_mod('border_setting') . ';}' . \"\\n\";}\r\n if ( get_theme_mod('bordercolor_setting') != '#4a4646') { echo '\t.contents {border-color:' . get_theme_mod('bordercolor_setting') . ';}' . \"\\n\";}\r\n if ( get_theme_mod('content_bg_setting') != '') { echo ' .contents {background-image:url(' . get_theme_mod('content_bg_setting') . ');}' . \"\\n\";}\r\n \r\n\t\t\r\n\t\tif ( get_theme_mod('titlefontstyle_setting') != 'Default' ) {\r\n\t\t\t$q = get_theme_mod('titlefontstyle_setting');\r\n\t\t\t$q = preg_replace('/[^a-zA-Z0-9]+/', ' ', $q);\r\n\t\t \techo\t\"\t.header h1 {font-family: '\" . $q . \"';}\" . \"\\n\"; }\r\n\r\n\t\tif ( get_theme_mod('taglinefontstyle_setting') != 'Default') {\r\n\t\t\t$x = get_theme_mod('taglinefontstyle_setting');\r\n\t\t\t$x = preg_replace('/[^a-zA-Z0-9]+/', ' ', $x);\r\n\t\t\techo\t\"\t.header h1 i {font-family: '\" . $x . \"';}\" . \"\\n\"; }\r\n\r\n\r\n if ( get_theme_mod('bodyfontstyle_setting') != 'Default' ) {\r\n $xs = get_theme_mod('bodyfontstyle_setting');\r\n $xs = preg_replace('/[^a-zA-Z0-9]+/', ' ', $xs);\r\n echo\t\"\tbody {font-family: '\" . $xs . \"';}\" . \"\\n\"; }\r\n \r\n if ( get_theme_mod('headerfontstyle_setting') != 'Default' ) {\r\n $xd = get_theme_mod('headerfontstyle_setting');\r\n $xd = preg_replace('/[^a-zA-Z0-9]+/', ' ', $xd);\r\n echo\t\"\t.contents h1, .contents h2, .contents h3, .contents h4, .contents h5, .contents h6, aside h1, aside h2, aside h3, aside h4, aside h5, aside h6 {font-family: '\" . $xd . \"';}\" . \"\\n\"; }\r\n \r\n if ( get_theme_mod('linkcolor_setting') != '#0b6492' ) echo '\ta {color:' . get_theme_mod('linkcolor_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('linkcolorhover_setting') != '#FFFFFF' ) echo '\ta:hover {color:' . get_theme_mod('linkcolorhover_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('link_text_shadow_setting') != '' ) echo '\t.contents a {text-shadow:.1em .1em 0 ' . get_theme_mod('link_text_shadow_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('fontcolor_setting') != '#000000' ) echo '\tbody {color:' . get_theme_mod('fontcolor_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('navcolor_setting') != '#CCCCCC' ) echo '\t.header li a {color:' . get_theme_mod('navcolor_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('navcolorhover_setting') != '#0b6492' ) echo '\t.header li a:hover {color:' . get_theme_mod('navcolorhover_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('dropcolor_setting') != '#BBBBBB' ) echo '\t.header li ul li a {color:' . get_theme_mod('dropcolor_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('dropcolorhover_setting') != '#0b6492' ) echo '\t.header li ul li a:hover {color:' . get_theme_mod('dropcolorhover_setting') . ';}' . \"\\n\";\r\n if ( get_theme_mod('fontsizeadjust_setting') != '1' ) echo '\t.contents, aside {font-size:' . get_theme_mod('fontsizeadjust_setting') . 'em;}' . \"\\n\";\r\n if ( get_theme_mod('removefooter_setting') != 'visible' ) echo '\tfooter {visibility:' . get_theme_mod('removefooter_setting') . ';}' . \"\\n\";;\r\n if ( get_theme_mod('header_image_width_setting') != '20' ) {\r\n $header_margin_percentage = (100 - get_theme_mod('header_image_width_setting')) / 2;\r\n echo '\t.header li.website_logo {margin:0 ' . $header_margin_percentage . '%; width:' . get_theme_mod('header_image_width_setting') . '%;}' . \"\\n\";}\r\n if ( get_theme_mod('custombanner_setting') != '') echo '\t.header {background: bottom url(' . get_theme_mod('custombanner_setting') . ');}' . \"\\n\";\r\n\r\n\t\techo '</style>' . \"\\n\";\r\n\t\techo '<!-- End Custom CSS -->' . \"\\n\";\r\n\t\techo \"\\n\"; }", "function cbusds_styles()\n{\n\n wp_register_style('w3css', get_template_directory_uri() . '/css/w3.css', array(), '', 'all');\n wp_enqueue_style('w3css'); // Enqueue it!\n\n wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all');\n wp_enqueue_style('normalize'); // Enqueue it!\n\n wp_register_style('cbusdscss', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');\n wp_enqueue_style('cbusdscss'); // Enqueue it!\n}", "function thememount_login_stylesheet() {\n wp_enqueue_style( 'howes-login-style', get_template_directory_uri() . '/style-login'.TM_MIN.'.css' );\n}", "function wprssmi_header() {\n\twp_enqueue_style( 'wprssmi_styles', plugins_url( 'css/styles.css', dirname( __FILE__ ) ) );\n\n}", "function vacatures_single_style_scripts() {\n //wp_enqueue_style( 'vacatures-single-page-template-theme-style' );\n wp_enqueue_style('vacatures-single-page-template-theme-style',content_url( 'templates/assets/css/vacatures-single-page-template-theme-style.css' , __FILE__ ) );\n}", "function womendevs_enqueue_style() {\n \n // Bootstrap CSS\n wp_enqueue_style( 'bootstrap', '//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' , false ); \n\n // Google Font\n wp_enqueue_style( 'googlefont', '//fonts.googleapis.com/css?family=Roboto' , false ); \n \n // Font Awesome\n wp_enqueue_style( 'fontawesome', '//use.fontawesome.com/releases/v5.8.1/css/all.css' , false );\n\n // Ma feuille CSS\n wp_enqueue_style( 'core', get_stylesheet_uri() , false ); \n}", "function add_style()\r\n{\r\n wp_enqueue_style(\r\n 'bootstrap'\r\n , get_template_directory_uri().'/css/bootstrap.min.css'\r\n );\r\n wp_enqueue_style(\r\n 'fontawesome'\r\n , get_template_directory_uri().'/css/font-awesome.min.css'\r\n );\r\n wp_enqueue_style(\r\n 'main'\r\n , get_template_directory_uri().'/css/main.css'\r\n ); \r\n\r\n}", "function admin_style() {\r\n wp_enqueue_style('admin-styles', get_template_directory_uri().'/css/admin.css');\r\n}", "function theme_name_scripts() {\r\n //wp_enqueue_style( 'fonts', '//cloud.webtype.com/css/1b7cfdf0-9828-4ed8-b99b-ccab8b975185.css');\r\n\twp_enqueue_style( 'fonts', '//fast.fonts.net/cssapi/e64835e4-ce1a-486d-8414-bc9d3ec7ae11.css');\r\n\twp_enqueue_style( 'main-style', get_stylesheet_uri(), array(), strval(filemtime(get_template_directory().\"/style.css\")) );\r\n\twp_enqueue_script( 'main-script', get_template_directory_uri() . '/script.js', array('jquery'), '1.0.0', true );\r\n\twp_enqueue_script( 'touchswipe', get_template_directory_uri() . '/inc/jquery.touchSwipe.min.js', array('jquery'), '1.0.0', true );\r\n}", "function theme_doc()\n{\n\tinclude(\"admin/admin-shortcodes.php\");\n}", "function front_end_styles()\n{\n\twp_register_style( 'front-end-normalize', get_template_directory_uri() . '/css/reset.css', array(), null, 'all' );\n wp_register_style( 'front-end-styles', get_template_directory_uri() . '/css/styles.css', array(), null, 'all' );\n wp_register_style( 'front-end-plugins', get_template_directory_uri() . '/css/plugins.css', array(), null, 'all' );\n wp_register_style( 'front-end-media-queries', get_template_directory_uri() . '/css/media-queries.css', array(), null, 'all' );\n \n \n wp_enqueue_style( 'front-end-normalize' );\n wp_enqueue_style( 'front-end-styles' );\n wp_enqueue_style( 'front-end-plugins' );\n wp_enqueue_style( 'front-end-media-queries' );\n}", "function get_theme_dir()\n{\n $theme = Theme::GetTheme();\n return !is_null($theme) ? $theme->GetDirectory() : '';\n}", "function site_styles() {\n wp_enqueue_style('my-styles', get_stylesheet_directory_uri() .'/style.css' . \"?date=\" . date(\"His\")); // adding a version - to ensure that cache is busted\n}", "function re_add_my_stylesheet() {\n // Respects SSL, Style.css is relative to the current file\n wp_enqueue_style( 'variations', get_stylesheet_directory_uri() . '/assets/css/variations.css' );\n wp_enqueue_style( 'base', get_stylesheet_directory_uri() . '/assets/css/base.css' );\n wp_enqueue_style( 'flexslider', get_stylesheet_directory_uri() . '/assets/css/flexslider.css' );\n \n /* Themes */\n\n // wp_enqueue_style( 'westwaters', get_stylesheet_directory_uri() . '/westwaters/custom.css' ); \n wp_enqueue_style( 'jumplife', get_stylesheet_directory_uri() . '/jumplife/custom.css' );\n\n /* END Themes */\n\n wp_enqueue_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css');\n //wp_enqueue_script('smooth-scrolling', get_stylesheet_directory_uri() . '/assets/js/smooth-scrolling.js');\n wp_enqueue_script('flex-slider', get_stylesheet_directory_uri() . '/assets/js/jquery.flexslider-min.js');\n\n}", "function basestation_theme_styles() {\n\n $basestation = wp_get_theme();\n\n wp_enqueue_style( 'foundation', basestation_locate_template_uri( 'css/foundation.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'offcanvas', basestation_locate_template_uri( 'css/offcanvas.css' ), array( 'foundation' ), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'custom', basestation_locate_template_uri( 'custom/custom.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'basestation-glyphs', basestation_locate_template_uri( 'css/entypo-glyphs.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'basestation-style', get_stylesheet_uri(), array( 'foundation' ), $basestation['Version'], 'all' );\n}", "function register_css_styles() {\n\tif (!is_admin()) {\n\t\tglobal $wp_styles;\n\t\t\n\t\t\n\t\t$cmsms_option = cmsms_get_global_options();\n\t\t\n\t\t\n\t\twp_register_style('theme-style', get_stylesheet_uri(), array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-fonts', get_template_directory_uri() . '/css/fonts.php', array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-adapt', get_template_directory_uri() . '/css/adaptive.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-retina', get_template_directory_uri() . '/css/retina.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jackbox', get_template_directory_uri() . '/css/jackbox.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('fontello', get_template_directory_uri() . '/css/fonts/css/fontello.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jPlayer', get_template_directory_uri() . '/css/jquery.jPlayer.css', array(), '2.1.0', 'screen');\n\t\twp_register_style('isotope', get_template_directory_uri() . '/css/jquery.isotope.css', array(), '1.5.19', 'screen');\n\t\twp_register_script('respond', get_template_directory_uri() . '/js/respond.min.js', array(), '1.1.0', false);\n\t\t\n\t\twp_enqueue_style('theme-style');\n\t\twp_enqueue_style('theme-fonts');\n\t\twp_enqueue_style('fontello');\n\t\t\n\t\tif ($cmsms_option[CMSMS_SHORTNAME . '_responsive']) {\n\t\t\twp_enqueue_style('theme-adapt');\n\t\t}\n\t\t\n\t\tif ($cmsms_option[CMSMS_SHORTNAME . '_retina']) {\n\t\t\twp_enqueue_style('theme-retina');\n\t\t}\n\t\n\t\t\n\t\twp_enqueue_style('jackbox');\n\t\twp_enqueue_style('jPlayer');\n\t\twp_enqueue_style('isotope');\n\t\t\n\t\twp_register_style('jackbox-ie8', get_template_directory_uri() . '/css/jackbox-ie8.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jackbox-ie9', get_template_directory_uri() . '/css/jackbox-ie9.css', array(), '1.0.0', 'screen');\n\t\t\n\t\twp_enqueue_style('theme-ie', get_template_directory_uri() . '/css/ie.css', array(), '1.0.0', 'screen');\n\t\twp_enqueue_style('theme-ieCss3', get_template_directory_uri() . '/css/ieCss3.php', array(), '1.0.0', 'screen');\n\t\t\n\t\t$wp_styles->add_data('jackbox-ie8', 'conditional', 'lt IE 9');\n\t\t$wp_styles->add_data('jackbox-ie9', 'conditional', 'gt IE 8');\n\t\t\n\t\t$wp_styles->add_data('theme-ie', 'conditional', 'lt IE 9');\n\t\t$wp_styles->add_data('theme-ieCss3', 'conditional', 'lt IE 9');\n\t}\n}", "function gavern_file($path) {\n\t\tif(is_child_theme()) {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_stylesheet_directory();\n\t\t\t} else {\n\t\t\t\tif(is_file(get_stylesheet_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path))) {\n\t\t\t\t\treturn get_stylesheet_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t\t} else {\n\t\t\t\t\treturn get_template_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_template_directory();\n\t\t\t} else {\n\t\t\t\treturn get_template_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t}\n\t\t}\n\t}", "function theme_styles() {\r\n\twp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');\r\n\twp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css');\r\n}" ]
[ "0.7406836", "0.7297175", "0.71755993", "0.70051926", "0.6897553", "0.6865237", "0.6816931", "0.67709196", "0.6681117", "0.66797787", "0.66583145", "0.6658298", "0.6632814", "0.66017556", "0.65994304", "0.6567605", "0.65631187", "0.65322125", "0.6531439", "0.6530844", "0.6525084", "0.65154505", "0.64994353", "0.6491292", "0.6478723", "0.6462656", "0.64563155", "0.64531237", "0.6450841", "0.64404905", "0.6435459", "0.6434393", "0.6425722", "0.64005786", "0.63960016", "0.6395981", "0.63847834", "0.63742", "0.63689965", "0.63560236", "0.633632", "0.6335744", "0.6331285", "0.631267", "0.6309128", "0.62972265", "0.62886554", "0.62866825", "0.62835073", "0.62689763", "0.6263043", "0.62562275", "0.625555", "0.6236215", "0.6227234", "0.6190107", "0.6175328", "0.61715657", "0.6170309", "0.6163623", "0.61623776", "0.61621284", "0.616128", "0.61519766", "0.6151907", "0.61484206", "0.6147883", "0.6140355", "0.6134656", "0.61276335", "0.611502", "0.6104455", "0.60994244", "0.60848004", "0.6077141", "0.6073278", "0.6070225", "0.6065368", "0.6061486", "0.6056889", "0.6046073", "0.6045634", "0.6045241", "0.6044725", "0.60429674", "0.6035448", "0.6033298", "0.6029315", "0.60242736", "0.6023367", "0.60225576", "0.60203665", "0.6016568", "0.60142636", "0.6012768", "0.60072374", "0.60068166", "0.6003722", "0.6002361", "0.60012007" ]
0.809549
0
Get path to home directory.
public function getHome(): string { if (null === $this->home) { $this->home = getenv('HOME'); } return $this->home; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHomeDir()\n {\n return $this->homeDir;\n }", "private function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "public static function getHomeDirectory(): string\n {\n // For UNIX support\n if (getenv('HOME')) {\n return self::canonicalize(getenv('HOME'));\n }\n\n // For >= Windows8 support\n if (getenv('HOMEDRIVE') && getenv('HOMEPATH')) {\n return self::canonicalize(getenv('HOMEDRIVE').getenv('HOMEPATH'));\n }\n\n throw new RuntimeException(\"Cannot find the home directory path: Your environment or operating system isn't supported.\");\n }", "private static function home()\n {\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive.$homePath : null;\n }", "public static function getHomeDir()\n {\n $home = getenv('HOME');\n if (!empty($home)) {\n // home should never end with a trailing slash.\n $home = rtrim($home, '/');\n } elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n // home on windows\n $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];\n // If HOMEPATH is a root directory the path can end with a slash. Make sure\n // that doesn't happen.\n $home = rtrim($home, '\\\\/');\n }\n return empty($home) ? null : $home;\n }", "public function getUserHomeFolder()\n\t{\n\t\t// Get home folder if available (Unix)\n\t\tif (!empty($_SERVER['HOME'])) {\n\t\t\treturn $_SERVER['HOME'];\n\t\t\t// Else use the home drive (Windows)\n\t\t} elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n\t\t\treturn $_SERVER['HOMEDRIVE'].$_SERVER['HOMEPATH'];\n\t\t} else {\n\t\t\tthrow new Exception('Cannot determine user home directory.');\n\t\t}\n\t}", "protected function getHomeDirectory()\n {\n $home = getenv('HOME');\n if (!$home && ($userProfile = getenv('USERPROFILE'))) {\n $home = $userProfile;\n }\n if (!$home || !is_dir($home)) {\n return null;\n }\n\n return $home;\n }", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "public function getHomeFolder()\n\t{\n\t\t$rootDirectory = $this->getOption('remote.root_directory');\n\t\t$rootDirectory = Str::finish($rootDirectory, '/');\n\t\t$appDirectory = $this->getOption('remote.app_directory') ?: $this->getApplicationName();\n\n\t\treturn $rootDirectory.$appDirectory;\n\t}", "public function getHome()\n {\n return (string) $this->file->get(self::SETTING_HOME);\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n if (($homeDrive = getenv('HOMEDRIVE')) && ($homePath = getenv('HOMEPATH'))) {\n return $homeDrive . $homePath;\n }\n\n throw new BadMethodCallException('Cannot establish the home directory');\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n if (($homeDrive = getenv('HOMEDRIVE')) && ($homePath = getenv('HOMEPATH'))) {\n return $homeDrive . $homePath;\n }\n\n throw new BadMethodCallException('Cannot establish the home directory');\n }", "public function getHome() {\n $home = null;\n\n if (!empty(getenv('HOME'))) {\n // Try the environmental variables.\n $home = getenv('HOME');\n } else if (!empty($_SERVER['HOME'])) {\n // If not in the environment variables, check the superglobal $_SERVER as\n // a last resort.\n $home = $_SERVER['HOME'];\n } else if(!empty(getenv('HOMEDRIVE')) && !empty(getenv('HOMEPATH'))) {\n // If the 'HOME' environmental variable wasn't found, we may be on\n // Windows.\n $home = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n } else if(!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];\n }\n\n if ($home === null) {\n throw new UnexpectedValueException('Could not locate home directory.');\n }\n\n return rtrim($home, '\\\\/');\n }", "function get_home_path()\n {\n }", "private static function findUserHome()\n {\n if (false !== ($home = getenv('HOME'))) {\n return $home;\n }\n\n if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) {\n return $home;\n }\n\n if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {\n $info = posix_getpwuid(posix_getuid());\n\n return $info['dir'];\n }\n\n throw new \\RuntimeException('Could not determine user directory');\n }", "function expandHomeDirectory($path) {\r\n\t$homeDirectory = getenv ( 'HOME' );\r\n\tif (empty ( $homeDirectory )) {\r\n\t\t$homeDirectory = getenv ( \"HOMEDRIVE\" ) . getenv ( \"HOMEPATH\" );\r\n\t}\r\n\treturn str_replace ( '~', realpath ( $homeDirectory ), $path );\r\n}", "protected static function getHomeDir()\r\n {\r\n $home = getenv( 'SLICER_HOME' );\r\n\r\n if ( !$home )\r\n {\r\n if ( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) )\r\n {\r\n if ( !getenv( 'APPDATA' ) )\r\n {\r\n throw new RuntimeException( 'The APPDATA or SLICER_HOME environment variables must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = strstr( getenv( 'APPDATA' ), '\\\\', '/' ) . '/Slicer';\r\n }\r\n else\r\n {\r\n if ( !getenv( 'HOME' ) )\r\n {\r\n throw new RuntimeException( 'The HOME or SLICER_HOME environment variable must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = rtrim( getenv( 'HOME' ), '/' ) . '/.slicer';\r\n }\r\n }\r\n\r\n return $home;\r\n }", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path)\n{\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "private\tfunction expandHomeDirectory($path) {\n\t $homeDirectory = getenv('HOME');\n\t if (empty($homeDirectory)) {\n\t $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n\t }\n\t return str_replace('~', realpath($homeDirectory), $path);\n\t}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "static function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "function expandHomeDirectory($path)\n {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "function drush_server_home() {\n $home = NULL;\n // $_SERVER['HOME'] isn't set on windows and generates a Notice.\n if (!empty($_SERVER['HOME'])) {\n $home = $_SERVER['HOME'];\n }\n elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n // home on windows\n $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];\n }\n return $home;\n }", "public static function getUserHome()\n {\n if (null === self::$home) {\n self::$home = self::findUserHome();\n }\n\n return self::$home;\n }", "public static function home(string $path = '') : ?string\n {\n if ( ! PROJECT_PATHS_HOME) {\n return null;\n }\n\n return PROJECT_PATHS_HOME . DS . ltrim($path, DS);\n }", "protected function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "public function getHomeDirectory() {\n\t\t// kontrola, jestli je home nacten\n\t\tif (!is_object($this->_home)) {\n\t\t\t// nacteni home\n\t\t\t$this->_home = LibMultimedia_Item_Directory::load($this->_home);\n\t\t}\n\t\t\n\t\treturn $this->_home;\n\t}", "protected static function expandHomeDirectory($path)\n {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "public static function getHome()\n {\n if ($custom = getenv('PHPBREW_HOME')) {\n if (!file_exists($custom)) {\n mkdir($custom, 0755, true);\n }\n\n return $custom;\n }\n if ($home = getenv('HOME')) {\n $path = $home . DIRECTORY_SEPARATOR . '.phpbrew';\n if (!file_exists($path)) {\n mkdir($path, 0755, true);\n }\n\n return $path;\n }\n throw new Exception('Environment variable PHPBREW_HOME or HOME is required');\n }", "public function getHomeDomain()\n {\n $result = parse_url($this->url);\n return $result['scheme'] . \"://\" . $result['host'];\n }", "public function getAbsoluteDir()\n {\n return $this->getMachine()->getHome() . '/' . $this->getDir() . '/';\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 getWorkDir(): string\n {\n return $this->getPwd();\n }", "public function getRemoteHomePath() {\n return @$this->attributes['remote_home_path'];\n }", "public static function getDataDir()\n {\n return self::getDir('getDataHome');\n }", "private function getHomeDir()\n\t{\n\t\t// are we in default_www or library?\n\t\t$posDefWWW = strpos($this->workingDir, 'default_www');\n\t\t$posDefLib = strpos($this->workingDir, 'library');\n\n\t\t// we're not in one of forks working dirs\n\t\tif(empty($posDefWWW) && empty($posDefLib))\n\t\t{\n\t\t\t// is there a library path and default_www path available?\n\t\t\tif(!is_dir($this->workingDir . '/default_www') && !is_dir($this->workingDir . '/library'))\n\t\t\t{\n\t\t\t\techo \"This is not a valid Fork NG path. Please initiate in your home folder of your project. \\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// create working paths\n\t\t\t$this->frontendPath = $this->workingDir . '/default_www/frontend/';\n\t\t\t$this->backendPath = $this->workingDir . '/default_www/backend/';\n\t\t\t$this->libraryPath = $this->workingDir . '/library/';\n\t\t\t$this->basePath = $this->workingDir . '/';\n\t\t}\n\t\t// we're in one\n\t\telse\n\t\t{\n\t\t\t// where to split on\n\t\t\t$splitChar = (!empty($posDefWWW)) ? 'default_www' : 'library';\n\n\t\t\t// split the directory to go into default_www\n\t\t\t$workingDir = explode($splitChar, $this->workingDir);\n\t\t\t$workingDir = $workingDir[0];\n\n\t\t\t// create paths\n\t\t\t$this->frontendPath = $workingDir . 'default_www/frontend/';\n\t\t\t$this->backendPath = $workingDir . 'default_www/backend/';\n\t\t\t$this->libraryPath = $workingDir . 'library/';\n\t\t\t$this->basePath = $workingDir;\n\t\t}\n\n\t\t// read the version\n\t\t$oVersion = fopen($this->basePath . 'VERSION.md', 'r');\n\t\t$rVersion = fread($oVersion, filesize($this->basePath . 'VERSION.md'));\n\t\t$rVersion = (int) str_replace('.', '', $rVersion);\n\n\t\t// check if the frontend and backend exist (old fork doesn't have this)\n\t\tif(!is_dir($this->frontendPath) || !is_dir($this->backendPath) || $rVersion < 200)\n\t\t{\n\t\t\techo\"This is an older version of Fork. The Fork tool only works with V2+.\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// create real cli path\n\t\t$this->cliPath = substr($this->cliPath, 0, -6);\n\n\t\t// set paths for overall use\n\t\tdefine('CLIPATH', $this->cliPath);\n\t\tdefine('FRONTENDPATH', $this->frontendPath);\n\t\tdefine('BACKENDPATH', $this->backendPath);\n\t}", "public function pwd(): string\n\t{\n\t\treturn $this->currentDirectory;\n\t}", "public function getHomeDirectory(string $user): string\n {\n $this->executor->execute('getent', ['passwd', $user], __DIR__, []);\n\n $info = explode(':', trim($this->output->getBuffer()));\n\n return $info[count($info)-2];\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 }", "public static function getConfigDir()\n {\n return self::getDir('getConfigHome');\n }", "function get_wp_home_path()\n {\n // Ensure get_home_path is available\n if ( ! function_exists( 'get_home_path' ) )\n require_once( ABSPATH . 'wp-admin/includes/file.php' );\n return apply_filters(\n 'home_path',\n function_exists( 'get_home_path' )\n ? apply_filters( 'get_home_path', get_home_path() )\n : preg_replace(\n apply_filters( 'wpmvc_home_path_regex_rule', '/wp-content[\\s\\S]+/' ),\n apply_filters( 'wpmvc_home_path_regex_replacement', '' ),\n __DIR__\n )\n );\n }", "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 }", "public function getCurrentDirectory();", "public function getCurrentDirectory();", "public function getHome() {\n\t\tif (! defined('__HOME__')) {\n\t\t\tdefine('__HOME__', 'index.php?Action=view');\n\t\t}\t\n\t\treturn __HOME__;\n\t}", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "private static function tmpDir(){\n return HOMEPATH . TMP;\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 }", "protected function define_home_dir_constant()\n\t{\n\t\tif (!defined('HOME_DIR'))\n\t\t{\n\t\t\t$home = explode(DIRECTORY_SEPARATOR, __DIR__);\n\t\t\t$home = DIRECTORY_SEPARATOR.$home[1].DIRECTORY_SEPARATOR.$home[2];\n\t\t\tdefine('HOME_DIR', $home, true);\n\t\t}\n\t}", "function ajan_core_get_site_path() {\n\tglobal $current_site;\n\n\tif ( is_multisite() )\n\t\t$site_path = $current_site->path;\n\telse {\n\t\t$site_path = (array) explode( '/', home_url() );\n\n\t\tif ( count( $site_path ) < 2 )\n\t\t\t$site_path = '/';\n\t\telse {\n\t\t\t// Unset the first three segments (http(s)://domain.com part)\n\t\t\tunset( $site_path[0] );\n\t\t\tunset( $site_path[1] );\n\t\t\tunset( $site_path[2] );\n\n\t\t\tif ( !count( $site_path ) )\n\t\t\t\t$site_path = '/';\n\t\t\telse\n\t\t\t\t$site_path = '/' . implode( '/', $site_path ) . '/';\n\t\t}\n\t}\n\n\treturn apply_filters( 'ajan_core_get_site_path', $site_path );\n}", "public function getRootDir();", "public function loginPath()\n\t{\n\t\treturn property_exists($this, 'loginPath') ? $this->loginPath : '/';\n\t}", "protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "protected function getDefaultDirectory()\n {\n // Default to ~/.platformsh/.session, but if it's not writable, fall\n // back to the temporary directory.\n $home = $this->getHomeDirectory();\n if ($home !== null) {\n $default = rtrim($home, '/') . '/.platformsh/.session';\n if ($this->canWrite($default)) {\n return $default;\n }\n }\n $temp = sys_get_temp_dir() . '/.platformsh-client/.session';\n if ($this->canWrite($temp)) {\n return $temp;\n }\n\n throw new \\RuntimeException('Unable to find a writable session storage directory');\n }", "public static function getCacheDir()\n {\n return self::getDir('getCacheHome');\n }", "function dirPath() { return (\"../\"); }", "public function dir() {\n\t\treturn dirname($this->_path) . '/';\n\t}", "public function getAppBaseDirName(){\n return $this->getSite()->getParent()->getAppDir(true);\n }", "function setHomeDir($path)\r\n\t{\r\n\t\t$this->pathHomeDir = $path;\r\n\t}", "public function getcwd(): string;", "public function getRootDirectory();", "public static function getHostPath() {\r\n $t = explode('/', $_SERVER['SCRIPT_NAME']);\r\n array_pop($t);\r\n self::$hostPath = implode('/', $t) . '/';\r\n return self::$hostPath;\r\n }", "public function getChrootDir()\n {\n return $this->chrootDir;\n }", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function getHomeDomainWithoutScheme()\n {\n return preg_replace('#^https?://#', '', rtrim($this->getHomeDomain(), '/'));\n }", "public function get_website_folder_from_url()\r\n {\r\n $url = parse_url(get_home_url());\r\n return sanitize_title_with_dashes($url['host']);\r\n }", "function getHomeFolderID() {\n \t$iUnitId = $this->getUnitId();\n\n if (empty($iUnitId)) {\n return false;\n }\n\n $oUnit =& Unit::get($iUnitId);\n return $oUnit->getFolderId();\n }", "public function getHomeUrl()\n {\n return $this->homeUrl;\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 }", "public function getRootPath(): string\n {\n return $this->rootPath;\n }", "function dirPath() {return (\"../../../../\"); }", "public function getHomeUrl()\n {\n return url('');\n }", "function dirPath () { return (\"../../\"); }", "protected function get_default_root_path(): string {\n return dirname($this->nowqsPath, 4) . DIRECTORY_SEPARATOR;\n }", "public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "public static function getSxCmdDir()\n {\n if (isset($_SERVER['HOME'])) {\n return $_SERVER['HOME'] . DIRECTORY_SEPARATOR . '.sxcmd' . DIRECTORY_SEPARATOR;\n } elseif (isset($_SERVER['LOCALAPPDATA'])) {\n return\n $_SERVER['LOCALAPPDATA'] . DIRECTORY_SEPARATOR .\n 'mplx' . DIRECTORY_SEPARATOR .\n 'sxcmd' . DIRECTORY_SEPARATOR;\n } else {\n return '.' . DIRECTORY_SEPARATOR;\n }\n }", "public function getHomeUrl()\n {\n return $this->url;\n }", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "public function getCurrentDirectory()\n {\n return $this->currentDirectory;\n }", "public function getCoreDir()\n {\n if(!Config::has('MAIN/core_path'))\n {\n Config::set('MAIN/core_path', $this->guessCoreDir());\n }\n\n return Config::get('MAIN/core_path');\n }", "function tempdir()\n\t{\n\t\tif(is_writable(sys_get_temp_dir())) {\n\t\t\treturn sys_get_temp_dir();\n\t\t}\n\t\telse if(is_writable(Site::get_dir('user'))) {\n\t\t\tif(is_dir(Site::get_dir('user') . \"/hpm_tmp\")) {\n\t\t\t\treturn Site::get_dir('user') . \"/hpm_tmp\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmkdir(Site::get_dir('user') . \"/hpm_tmp\", 0755, true);\n\t\t\t\tif(is_dir(Site::get_dir('user') . \"/hpm_tmp\")) {\n\t\t\t\t\treturn Site::get_dir('user') . \"/hpm_tmp\";\n\t\t\t\t}\n\t\t\t\telse return false;\n\t\t\t}\n\t\t}\n\t\telse return false;\n\t}", "public function getDefaultInstallDirectory() {\n return $this->getConfig(\"default_install_directory\");\n }", "private static function get_root_path(): ?string {\n\t\t// Try up to 3 levels\n\t\t$wp_dir = '/' . trim( ABSPATH, '/' );\n\t\t$try_dirs = [\n\t\t\t$wp_dir,\n\t\t\tdirname( $wp_dir ),\n\t\t\tdirname( $wp_dir, 2 ),\n\t\t];\n\t\tforeach ( $try_dirs as $dir ) {\n\t\t\t$git_dir = \"{$dir}/.git\";\n\t\t\tif ( file_exists( $git_dir ) && is_dir( $git_dir ) ) {\n\t\t\t\treturn $dir;\n\t\t\t}\n\t\t\t$dir = null;\n\t\t}\n\n\t\treturn null;\n\t}", "public function get_path_hashed()\n\t\t{\n\t\t\treturn $this->get_path_hashed_dir().'/'.$this->get_path_hashed_name();\n\t\t}", "public function getHomePage() : string {\n return $this->configVars['site']['home-page'];\n }", "public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }", "public function home()\n {\n return $this->homeManager->getHome();\n }", "public static function get_directory(): string {\n return Simply_Static\\Options::instance()->get('local_dir') ?: '';\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "function _cwd()\n\t{\n\t\treturn @ftp_pwd($this->connection);\n\t}" ]
[ "0.8269688", "0.82472193", "0.82454246", "0.82454246", "0.8176658", "0.81389064", "0.80968463", "0.7867739", "0.78312653", "0.7783374", "0.7781867", "0.7780288", "0.77713096", "0.7634533", "0.7634533", "0.7596149", "0.7558425", "0.75460607", "0.7483214", "0.74436176", "0.72701484", "0.7256153", "0.7232291", "0.7232291", "0.7232291", "0.7225484", "0.72245777", "0.72245777", "0.71945083", "0.7176973", "0.71572286", "0.71094394", "0.6953039", "0.6939086", "0.68860567", "0.6866906", "0.68461055", "0.6671067", "0.6629116", "0.6601564", "0.654558", "0.64904207", "0.6445038", "0.6430445", "0.6426757", "0.6416624", "0.63837004", "0.6370535", "0.6364809", "0.6352998", "0.6296514", "0.6296514", "0.6292729", "0.62888515", "0.62825394", "0.62328124", "0.6232423", "0.6150594", "0.6090023", "0.6057526", "0.6048865", "0.6033801", "0.60310024", "0.602394", "0.60229063", "0.6004255", "0.6001164", "0.5984036", "0.59726906", "0.59690595", "0.596333", "0.59624755", "0.5961172", "0.59523755", "0.5925838", "0.58961743", "0.5895382", "0.5877696", "0.5877132", "0.5874279", "0.5859969", "0.58518696", "0.58494323", "0.5849124", "0.58390504", "0.58313924", "0.58297247", "0.5820022", "0.5819598", "0.5815882", "0.5812541", "0.5810422", "0.5799625", "0.5799015", "0.5797403", "0.5794513", "0.5791845", "0.57879865", "0.57795787", "0.5770942" ]
0.7917441
7
Set path to home directory.
public function setHome(string $home): void { $this->home = $home; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHomeDir($path)\r\n\t{\r\n\t\t$this->pathHomeDir = $path;\r\n\t}", "private\tfunction expandHomeDirectory($path) {\n\t $homeDirectory = getenv('HOME');\n\t if (empty($homeDirectory)) {\n\t $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n\t }\n\t return str_replace('~', realpath($homeDirectory), $path);\n\t}", "function expandHomeDirectory($path) {\r\n\t$homeDirectory = getenv ( 'HOME' );\r\n\tif (empty ( $homeDirectory )) {\r\n\t\t$homeDirectory = getenv ( \"HOMEDRIVE\" ) . getenv ( \"HOMEPATH\" );\r\n\t}\r\n\treturn str_replace ( '~', realpath ( $homeDirectory ), $path );\r\n}", "static function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "function expandHomeDirectory($path)\n{\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "private function setPath()\n {\n $path = getenv('PATH') . ':/usr/local/bin';\n $_SERVER['PATH'] = $path;\n\n }", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n}", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "function expandHomeDirectory($path)\n {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "protected function changePath()\n {\n chdir(base_path());\n }", "protected function expandHomeDirectory($path) {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\");\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "protected static function expandHomeDirectory($path)\n {\n $homeDirectory = getenv('HOME');\n if (empty($homeDirectory)) {\n $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\n }\n return str_replace('~', realpath($homeDirectory), $path);\n }", "public function setCoreHome($value){\n $this->coreHome = $value;\n }", "public function getHomeDir()\n {\n return $this->homeDir;\n }", "protected function setInitialRootPath() {}", "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 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}", "public function set_path() {\n\t\t\t\n\t\t\t// pick up the path types\n\t\t\t$path_types = include_once(CONFIGPATH . 'path-types.php' );\n\n\t\t\t// get the base path for the deploy type\n\t\t\t$base_path = $path_types[ $this->repo[ 'type' ] ];\n\n\t\t\t// check if it is a valid path\n\t\t\t$this->is_path_valid( $base_path );\n\n\t\t\t// append the repositories name to get the final deploy path\n\t\t\t$this->repo[ 'path' ] = $base_path . '/' . $this->repo[ 'name' ];\n\t\t}", "public function setPath( $path ) {\n\t\t$this->seedPath = rtrim( $path, '/' ) . '/';\n\t}", "function set_path($path) \n {\n $this->path = \"/\" . trim($path, \"/\");\n }", "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 function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "protected function setPath( string $path ) : void\n {\n $this->path = DIGITAL_BASE_PATH.$path;\n }", "public function setPath($path = '');", "function get_home_path()\n {\n }", "protected function define_home_dir_constant()\n\t{\n\t\tif (!defined('HOME_DIR'))\n\t\t{\n\t\t\t$home = explode(DIRECTORY_SEPARATOR, __DIR__);\n\t\t\t$home = DIRECTORY_SEPARATOR.$home[1].DIRECTORY_SEPARATOR.$home[2];\n\t\t\tdefine('HOME_DIR', $home, true);\n\t\t}\n\t}", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "function setCwd($cwd);", "public function getUserHomeFolder()\n\t{\n\t\t// Get home folder if available (Unix)\n\t\tif (!empty($_SERVER['HOME'])) {\n\t\t\treturn $_SERVER['HOME'];\n\t\t\t// Else use the home drive (Windows)\n\t\t} elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n\t\t\treturn $_SERVER['HOMEDRIVE'].$_SERVER['HOMEPATH'];\n\t\t} else {\n\t\t\tthrow new Exception('Cannot determine user home directory.');\n\t\t}\n\t}", "public function setRootPath($path);", "function set_root ($root)\n {\n $this->mPath = realpath($root) . '/';\n }", "public static function set_path($path) {\n\t\tstatic::$path = $path;\n\t}", "public static function setPath($path)\n\t{\n\t\tself::$path = $path;\n\t}", "public function getHomeFolder()\n\t{\n\t\t$rootDirectory = $this->getOption('remote.root_directory');\n\t\t$rootDirectory = Str::finish($rootDirectory, '/');\n\t\t$appDirectory = $this->getOption('remote.app_directory') ?: $this->getApplicationName();\n\n\t\treturn $rootDirectory.$appDirectory;\n\t}", "public function setPath($path)\n\t{\n\t\t/* This must be created here to prevent the directory from\n\t\t * becoming automatically converted to an absolute path. */\n\t\t$this->path = new PhingFile($path);\n\t}", "public function setPath($path)\n {\n if ($path == self::AUTO_DETECT) $path = $this->findSendmail();\n $this->path = $path;\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n if (($homeDrive = getenv('HOMEDRIVE')) && ($homePath = getenv('HOMEPATH'))) {\n return $homeDrive . $homePath;\n }\n\n throw new BadMethodCallException('Cannot establish the home directory');\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n if (($homeDrive = getenv('HOMEDRIVE')) && ($homePath = getenv('HOMEPATH'))) {\n return $homeDrive . $homePath;\n }\n\n throw new BadMethodCallException('Cannot establish the home directory');\n }", "public function getHome()\n {\n return (string) $this->file->get(self::SETTING_HOME);\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "private static function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "private function getHomeDir()\n\t{\n\t\t// are we in default_www or library?\n\t\t$posDefWWW = strpos($this->workingDir, 'default_www');\n\t\t$posDefLib = strpos($this->workingDir, 'library');\n\n\t\t// we're not in one of forks working dirs\n\t\tif(empty($posDefWWW) && empty($posDefLib))\n\t\t{\n\t\t\t// is there a library path and default_www path available?\n\t\t\tif(!is_dir($this->workingDir . '/default_www') && !is_dir($this->workingDir . '/library'))\n\t\t\t{\n\t\t\t\techo \"This is not a valid Fork NG path. Please initiate in your home folder of your project. \\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// create working paths\n\t\t\t$this->frontendPath = $this->workingDir . '/default_www/frontend/';\n\t\t\t$this->backendPath = $this->workingDir . '/default_www/backend/';\n\t\t\t$this->libraryPath = $this->workingDir . '/library/';\n\t\t\t$this->basePath = $this->workingDir . '/';\n\t\t}\n\t\t// we're in one\n\t\telse\n\t\t{\n\t\t\t// where to split on\n\t\t\t$splitChar = (!empty($posDefWWW)) ? 'default_www' : 'library';\n\n\t\t\t// split the directory to go into default_www\n\t\t\t$workingDir = explode($splitChar, $this->workingDir);\n\t\t\t$workingDir = $workingDir[0];\n\n\t\t\t// create paths\n\t\t\t$this->frontendPath = $workingDir . 'default_www/frontend/';\n\t\t\t$this->backendPath = $workingDir . 'default_www/backend/';\n\t\t\t$this->libraryPath = $workingDir . 'library/';\n\t\t\t$this->basePath = $workingDir;\n\t\t}\n\n\t\t// read the version\n\t\t$oVersion = fopen($this->basePath . 'VERSION.md', 'r');\n\t\t$rVersion = fread($oVersion, filesize($this->basePath . 'VERSION.md'));\n\t\t$rVersion = (int) str_replace('.', '', $rVersion);\n\n\t\t// check if the frontend and backend exist (old fork doesn't have this)\n\t\tif(!is_dir($this->frontendPath) || !is_dir($this->backendPath) || $rVersion < 200)\n\t\t{\n\t\t\techo\"This is an older version of Fork. The Fork tool only works with V2+.\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// create real cli path\n\t\t$this->cliPath = substr($this->cliPath, 0, -6);\n\n\t\t// set paths for overall use\n\t\tdefine('CLIPATH', $this->cliPath);\n\t\tdefine('FRONTENDPATH', $this->frontendPath);\n\t\tdefine('BACKENDPATH', $this->backendPath);\n\t}", "public function setPath( $path );", "function setPath($path)\n {\n $this->path = trim($path);\n }", "public function setHome($var)\n {\n GPBUtil::checkString($var, True);\n $this->home = $var;\n\n return $this;\n }", "function setPath($path) {\n if (substr($path,-1)!=\"/\") $path.=\"/\";\n //if (!file_exists($path)) echo \"<div>Path $path not found</div>\";\n $this->mat = $path;\n return true;\n }", "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}", "public static function setupHome($home)\n {\n if (empty($home)) {\n throw new \\InvalidArgumentException('Empty home directory encountered.');\n }\n\n if (false === getenv('COMPOSER')) {\n putenv('COMPOSER=' . $home . DIRECTORY_SEPARATOR . 'composer.json');\n }\n chdir($home);\n\n // Ensure at least one of the environment variables is available.\n if (!getenv('COMPOSER_HOME') && !getenv('HOME')) {\n putenv('COMPOSER_HOME=' . $home);\n }\n }", "private function getHomeDir()\n {\n // On Linux/Unix-like systems, use the HOME environment variable\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;\n }", "protected static function getHomeDir()\r\n {\r\n $home = getenv( 'SLICER_HOME' );\r\n\r\n if ( !$home )\r\n {\r\n if ( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) )\r\n {\r\n if ( !getenv( 'APPDATA' ) )\r\n {\r\n throw new RuntimeException( 'The APPDATA or SLICER_HOME environment variables must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = strstr( getenv( 'APPDATA' ), '\\\\', '/' ) . '/Slicer';\r\n }\r\n else\r\n {\r\n if ( !getenv( 'HOME' ) )\r\n {\r\n throw new RuntimeException( 'The HOME or SLICER_HOME environment variable must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = rtrim( getenv( 'HOME' ), '/' ) . '/.slicer';\r\n }\r\n }\r\n\r\n return $home;\r\n }", "public function SetPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function set_path($path) {\n $this->path = $path;\n }", "private static function home()\n {\n if ($homeDir = getenv('HOME')) {\n return $homeDir;\n }\n\n // Get the HOMEDRIVE and HOMEPATH values for Windows hosts\n $homeDrive = getenv('HOMEDRIVE');\n $homePath = getenv('HOMEPATH');\n\n return ($homeDrive && $homePath) ? $homeDrive.$homePath : null;\n }", "public function setPath( $path )\n {\n $this->path = us($path);\n }", "public function & SetAppDir ($appDir);", "public static function setPath($path)\n {\n static::$pathTop = $path;\n }", "public function setWorkingDirectory($path);", "public function set( $path ) {\n\t\t$this->path = $path;\n\n\t\t$path_info = pathinfo( $this->path );\n\n\t\t$this->file = $path_info['basename'];\n\t\t$this->extension = $path_info['extension'] == 'jpg' ? 'jpeg' : $path_info['extension'];\n\t\t$this->filename = $path_info['filename'];\n\n\t\t$this->server = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];\n\n\t\t$this->url = $this->server.str_replace( $this->base_dir, '', $this->path );\n\t}", "protected function setInitialRelativePath() {}", "public function set_base_path( $path ) {\n\t\t$this->base_path = $path;\n\t}", "public function setMageRoot($value) {\n if (preg_match('/^\\/\\w*/i', $value)) {\n $mage_root = $value;\n } else {\n $mage_root = getcwd() . self::$_DS . $value;\n }\n\n $this->_mage_root = $mage_root;\n }", "public function setPath( $val ) { $this->__set('path', $val); }", "function set_dir($my_path ){\r\n\r\n $this->icons_dir = $my_path[0];\r\n $this->icons_url = $my_path[1];\r\n $this->is_dir_exist = $this->wpdev_mk_dir($this->icons_dir);\r\n\r\n }", "public function setPath($path='/')\n\t{\n\t\t$this->cookiePath = $path;\n\t\treturn $this;\n\t}", "protected function setPath()\n {\n $this->path = self::PATH_SKIN\n . LC_DS . $this->skin\n . ($this->locale && $this->locale != 'en' ? '_' . $this->locale : '')\n . LC_DS;\n }", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setContentDirectoryPath($path)\n {\n if ($path[strlen($path) - 1] !== '/')\n $path .= '/';\n $this->contentDirectoryPath = $path;\n }", "public function setPath($path) {\n if (self::isFolderReadable($path) && self::isInfoFileReadable($path)) {\n $this->path = $path;\n $this->mtime = filemtime($path);\n $this->foldername = getFolderNameFromPath($this->path);\n $this->safename = getUrlSafeString(getFolderNameFromPath($this->path));\n\n if ($this->mtime > self::$latestUpdate) {\n self::$latestUpdate = $this->mtime;\n }\n\n $this->parseInfoFile();\n $this->scanFiles();\n }\n }", "public function setPath($path)\n\t{\n\t\t\n\t\t$this->__path = (string)$path;\n\n\t}", "function path_dir ($path) {\r\n\t$path = PATH_PROGRAM.$path.'/';\r\n\tmk_dir($path);\r\n\treturn $path;\r\n}", "public function getHome(): string\n {\n if (null === $this->home) {\n $this->home = getenv('HOME');\n }\n\n return $this->home;\n }", "protected function setPath ($p) {\n\t\t$path = realpath($p);\n\t\tif (!$path) throw new Spd_IOException('No target path: [' . $p . ']');\n\t\tif (!is_dir($path)) throw new Spd_IOException('Target path not dir: ' . var_export($p,1));\n\t\t$this->path = $path;\n\t}", "public function setPath(?string $value): void {\n $this->getBackingStore()->set('path', $value);\n }", "function set($path, $value)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$pointer = end($path);\n\t\t\t$tmp = $value;\n\t\t\twhile($pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\t$tmp = array($pointer=>$tmp);\n\t\t\t\t\t$pointer = prev($path);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->settings = array_merge_recursive_overwrite($this->settings, $tmp);\n\t\t\t$this->saveSettings();\n\t\t}", "function setPath($path) {\r\n\t\tif($this->configured) {\r\n\t\t\treturn 'Configuration is frozen';\r\n\t\t}\r\n\t\t$URLDecodedPath = '';\r\n\t\t$URLDecodedPath = urldecode($path);\r\n\t\t$this->path = $URLDecodedPath;\r\n\t}", "public function setPath($path)\r\n\t{\r\n\t\t$this->path=$path;\r\n\t}", "public function setPath( $path )\n\t{\n\t\t$this->path = $path;\n\t\t$this->modified = true;\n\t}", "public static function setPath($path)\n {\n }", "private static function findUserHome()\n {\n if (false !== ($home = getenv('HOME'))) {\n return $home;\n }\n\n if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) {\n return $home;\n }\n\n if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {\n $info = posix_getpwuid(posix_getuid());\n\n return $info['dir'];\n }\n\n throw new \\RuntimeException('Could not determine user directory');\n }", "public function getHomeDirectory() {\n\t\t// kontrola, jestli je home nacten\n\t\tif (!is_object($this->_home)) {\n\t\t\t// nacteni home\n\t\t\t$this->_home = LibMultimedia_Item_Directory::load($this->_home);\n\t\t}\n\t\t\n\t\treturn $this->_home;\n\t}", "public function setPath($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function setCookiePath($path, $preceding) {\n\t\t$cookiePath = $path;\n\t\t$this->_cookieFile = tempnam($cookiePath, $preceding);\n\t}", "function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }", "public function setPath($path){ }", "protected function setUpInstancePath() {\n\t\t$this->instancePath = BEHAT_ROOT;\n\t}", "function set_path($path, $value) {\n\t$GLOBALS['laravel_paths'][$path] = $value;\n}", "public static function getHomeDir()\n {\n $home = getenv('HOME');\n if (!empty($home)) {\n // home should never end with a trailing slash.\n $home = rtrim($home, '/');\n } elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {\n // home on windows\n $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];\n // If HOMEPATH is a root directory the path can end with a slash. Make sure\n // that doesn't happen.\n $home = rtrim($home, '\\\\/');\n }\n return empty($home) ? null : $home;\n }", "protected function chrootify($path) {\n if ($this->base_dir === $this->manifest['chroot_base_dir']) {\n return $path;\n } else {\n return str_replace($this->base_dir, $this->manifest['chroot_base_dir'], $path);\n }\n }", "public function changeWorkingDirectory($path);", "public static function getHome()\n {\n if ($custom = getenv('PHPBREW_HOME')) {\n if (!file_exists($custom)) {\n mkdir($custom, 0755, true);\n }\n\n return $custom;\n }\n if ($home = getenv('HOME')) {\n $path = $home . DIRECTORY_SEPARATOR . '.phpbrew';\n if (!file_exists($path)) {\n mkdir($path, 0755, true);\n }\n\n return $path;\n }\n throw new Exception('Environment variable PHPBREW_HOME or HOME is required');\n }", "function set_path($path, $value)\n{\n\t$GLOBALS['laravel_paths'][$path] = $value;\n}", "public function setCacheDirectoryPath($path)\n {\n if ($path[strlen($path) - 1] !== '/')\n $path .= '/';\n $this->cacheDirectoryPath = $path;\n }" ]
[ "0.84578717", "0.70373255", "0.686513", "0.6699088", "0.6694386", "0.66760343", "0.66541326", "0.664476", "0.664476", "0.664476", "0.6630491", "0.6630491", "0.6599978", "0.659706", "0.6555835", "0.6456686", "0.63614833", "0.63116413", "0.62460643", "0.6212512", "0.6155931", "0.6132738", "0.6106492", "0.60880476", "0.60414845", "0.60037297", "0.59729105", "0.5967174", "0.5863972", "0.58582884", "0.5857577", "0.5853462", "0.5835905", "0.58118683", "0.5714847", "0.5708599", "0.5690071", "0.5668455", "0.5663456", "0.5652493", "0.56354165", "0.56092834", "0.56092834", "0.56079173", "0.5605884", "0.5605884", "0.56007385", "0.5597", "0.5592702", "0.5576242", "0.55741376", "0.5572867", "0.55588067", "0.5551476", "0.55484974", "0.5537", "0.55363387", "0.55352813", "0.5532982", "0.552823", "0.55094093", "0.5504341", "0.5501508", "0.54997206", "0.5496642", "0.549063", "0.54885507", "0.5480525", "0.5465032", "0.54618233", "0.546145", "0.546145", "0.546145", "0.546145", "0.54563165", "0.5439164", "0.5435208", "0.5431073", "0.54216474", "0.54192793", "0.54083264", "0.54054505", "0.54005545", "0.5396645", "0.53962344", "0.53911483", "0.53808254", "0.5379932", "0.53762215", "0.53724223", "0.53708494", "0.53586215", "0.53573537", "0.5356369", "0.53524274", "0.5350277", "0.5341375", "0.53348094", "0.5333317", "0.5323177" ]
0.63451487
17
Construct a round model
public function __construct() { parent::__construct('rounds', 'gems__rounds', 'gro', true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _createRound()\n\t{\n\t\t$ut = $this->_ut;\n\t\t$dt = $this->_dt;\n\n\t\t$round['rund_id'] = -1;\n\t\t$round['rund_name'] = kform::getInput('roundName');\n\t\t$round['rund_stamp'] = kform::getInput('roundStamp');\n\t\t$round['rund_type'] = kform::getInput('roundType');\n\t\t$round['rund_entries'] = kform::getInput('roundEntries');\n\t\t$round['rund_drawId'] = kform::getInput('drawId');\n\t\t$round['rund_rge'] = kform::getInput('rundFinalPlace');\n\t\t$round['rund_group'] = kform::getInput('group');\n\t\t$round['rund_qual'] = 1;\n\n\t\t$tie['tie_nbms'] = 0;\n\t\t$tie['tie_nbws'] = 0;\n\t\t$tie['tie_nbmd'] = 0;\n\t\t$tie['tie_nbwd'] = 0;\n\t\t$tie['tie_nbxd'] = 0;\n\t\t$tie['tie_nbas'] = 0;\n\t\t$tie['tie_nbad'] = 0;\n\t\t$disci = kform::getInput('drawDisci');\n\t\tswitch ($disci)\n\t\t{\n\t\t\tcase WBS_MS :\n\t\t\t\t$tie['tie_nbms'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_LS :\n\t\t\t\t$tie['tie_nbws'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_MD :\n\t\t\t\t$tie['tie_nbmd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_LD :\n\t\t\t\t$tie['tie_nbwd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_MX :\n\t\t\t\t$tie['tie_nbxd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_AS :\n\t\t\t\t$tie['tie_nbas'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_AD :\n\t\t\t\t$tie['tie_nbad'] = 1;\n\t\t\t\tbreak;\n\t\t}\n\n\t\trequire_once \"utils/utround.php\";\n\t\t$utr = new utround();\n\t\t$roundId = $utr->updateRound($round, $tie);\n\n\t\t$page = new utPage('none');\n\t\t//$page->close();\n\t\texit();\n\t}", "public function CreateRound() {\n\t\tarray_push($this->rounds, array());\n\t}", "public function generateRounds()\n\t{\n\t\t// count the required number of rounds in the brackets\n\t\t// 6; 4, 2+2, 2\t\t\t\t4 and 2 byes\n\t\t// 9; 6, 3+1, 2+2, 2\t\t6 and 3 byes\n\t\t// 11; 8, 4+2, 3+1, 2\t\t8 and 3 byes\n\t\t// 8; 4, 2\t\t\t\t\t4 and 0 byes\n\t\t// 7; 6, 3+1, 2\t\t\t\t6 and 1 bye\n\t\t// 5: 4, 2, 1+1\t\t\t\t4 and 1 bye\n\t\t// 14: 12, 6+2, 4, 2\t\t12 and 2 byes\n\t\t// 33: 32, 16, 8, 4, 2, 1+1\t32 and 1 bye\n\n\t\t// create transaction, preventing issues when mallfunctioning\n\t\tDB::beginTransaction();\n\n\n\t\t// the teams of this cup\n\t\t$teams = $this -> cup -> teams;\n\t\t// number of matches per round\n\t\t$matchesPerRound = ceil($teams->count()/2);\n\n\t\t$finalsReached = false;\n\t\t$roundNo = 1;\n\n\t\twhile($finalsReached == false)\n\t\t{\n\t\t\t// instantiate new round\n\t\t\t$round = new Round;\n\n\t\t\t// round no\n\t\t\t$round -> round_no = $roundNo;\n\t\t\t// round planning\n\t\t\tif(!isset($lastPlanned))\n\t\t\t\t$round -> planned_at = $this->calculateNextPossibleTime(isset($lastPlanned) ? $lastPlanned : $this -> cup -> starts_at);\n\n\t\t\t// save round to cup\n\t\t\t$this->cup->rounds()->save($round);\n\n\t\t\t$loop = $matchesPerRound;\n\n\t\t\tfor($i = 1; $i <= $loop; $i++)\n\t\t\t{\n\t\t\t\t// create match instance\n\t\t\t\t$match = new Match;\n\t\t\t\t// plan them for the round planned date\n\t\t\t\t//$match -> planned_at = $round -> planned_at;\n\t\t\t\t// save and link to round\n\t\t\t\t$round->matches()->save($match);\n\n\t\t\t\t// only create match label opponents for first round\n\t\t\t\tif($teams->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t// pick 2 random contestants\n\t\t\t\t\t// todo allow more than 2 teams\n\t\t\t\t\t// todo other way of picking random teams\n\t\t\t\t\t$opponents = new Collection($teams->random(2));\n\t\t\t\t\t// remove these competitors from teams\n\t\t\t\t\t$teams = $teams -> except($opponents->lists('id'));\n\n\t\t\t\t\t// add each opponent to match\n\t\t\t\t\tforeach($opponents as $opponent)\n\t\t\t\t\t{\n\t\t\t\t\t\t// create competitor for match\n\t\t\t\t\t\t$competitor = new Competitor;\n\t\t\t\t\t\t// link to cup team\n\t\t\t\t\t\t$competitor->participant_team_id = $opponent->id;\n\t\t\t\t\t\t// save to match\n\t\t\t\t\t\t$match->competitors()->save($competitor);\n\t\t\t\t\t}\n\t\t\t\t\t// bye; auto-win\n\t\t\t\t\tif($match->competitors->count() == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$match->winner_id = $competitor->id;\n\t\t\t\t\t\t$match->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// force stopping loop if we have finished generating all matches\n\t\t\tif($matchesPerRound == 1)\n\t\t\t\t$finalsReached = true;\n\n\t\t\t// reduces number of required matches of the next round\n\t\t\t$matchesPerRound = ceil($matchesPerRound/2);\n\n\t\t\t// when planning also adds 10 minutes, let's assume 90 minutes per round\n\t\t\t// todo define delay based on game\n\t\t\tif($round->planned_at)\n\t\t\t\t$lastPlanned = $round->planned_at->addMinutes(90);\n\n\t\t\t// increment round number with 1\n\t\t\t$roundNo++;\n\n\t\t}\n\n\t\t// support losing brackets, depending on type->elimination_after\n\t\t// seed starts in round two, for all teams that failed in the first round\n\t\t// todo FIX\n\t\tif($this->cup->type->elimination_after > 0)\n\t\t{\n\n\t\t\tfor($i = 1; $i <= $this->cup->type->elimination_after; $i++)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\t// now commit everything to database\n\t\tDB::commit();\n\n\t\treturn $this -> cup -> rounds;\n\t}", "protected function createRateModel()\n {\n $class = '\\\\'.ltrim($this->rateModel, '\\\\');\n $model = new $class();\n return $model;\n }", "public function setRound(Round $round) : Result\n {\n $this->round = $round;\n return $this;\n }", "public function setRounds($rounds)\n {\n $this->rounds = (int) $rounds;\n\n return $this;\n }", "function __construct($radius, $height){}", "public function __construct( $radius )\n {\n parent::__construct( $radius );\n }", "public function nextRound() {\n $this->round++;\n }", "function roundtable_init() {\n\t}", "public function round($precision= 0) {\n return new self(round($this->wrapped, $precision));\n }", "public static function setRounds($rounds)\n {\n }", "public function buildModel() {}", "public function show(Round $round)\n {\n\n }", "public function constructNotSquare(){\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "private function createModel()\n\t{\n\t\treturn new Image();\t\t\n\t}", "protected function planNextRound()\n\t{\n\t\tthrow new \\Exception('Obsolete');\n\t\t$round = new Round();\n\n\t\t$round -> planned_at = $this->calculateNextPossibleTime();\n\n\t\t$this -> cup -> rounds() -> save($round);\n\n\t\treturn $round;\n\t}", "public function __construct(){\n parent::__construct(); // paima parent constructoriu\n $this->radiusX = 50;\n $this->radiusY = 100;\n }", "function _publiRound()\r\n\t{\n\t\t$roundIds = kform::getInput(\"rowsDraws\", array());\n\t\t$status = kform::getInput(\"status\");\n\t\t$publiSchedu = kform::getInput(\"publiSchedu\", false);\r\n\r\n\t\t// Modifie la visibilite d'un round\n\t\trequire_once \"utils/utpubli.php\";\n\t\t$utp = new utpubli();\n\t\tforeach($roundIds as $roundId) $utp->publiRound($roundId, $status, $publiSchedu);\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit();\r\n\t}", "public function round() {\n $this->authorize('admin-itd');\n\n $round = Round::find(1);\n $difference = strtotime($round->time_end) - strtotime(date(\"Y-m-d H:i:s\"));\n $secret_weapon = SecretWeapon::find(1);\n\n return view('admin.round', [\n 'round'=> $round,\n 'times'=> $difference,\n 'weapon' => $secret_weapon\n ]);\n }", "public function __construct() {\n parent::__construct();\n\n $this -> radiusX;\n $this -> radiusY;\n\n\t}", "function stkey_round($roundid) { return 'st-r'.$roundid; }", "public function getRound()\n {\n return $this->getAttribute('rx');\n }", "public function generate_scorecard($id, $size, $round, $round_date);", "function resetRound() {\n\t// execute this function at end of game\n\twriteGamestate([\n\t\t\"player1\" => [],\n\t\t\"player2\" => [],\n\t\t\"round\" => 0,\n\t]);\n}", "public function round($precision= 0) {\n if (FALSE === strpos($this->num, '.')) return new self($this->num);\n \n $a= '0.'.str_repeat('0', $precision).'5';\n return new self(FALSE === strpos($this->num, '.') \n ? $this->num \n : ('-' === $this->num{0} ? bcsub($this->num, $a, $precision) : bcadd($this->num, $a, $precision))\n );\n }", "public function test_precision_default_rounding() : void\n {\n $obj = SubsetSum::create(25.15, array(5.01243,10.143514,7,3,20));\n \n $expected = array(\n array(3, 5.01, 7, 10.14)\n );\n \n $this->assertEquals($expected, $obj->getMatches());\n }", "public function destroy(Round $round)\n {\n //\n }", "public function floor() : self\n {\n return $this->map('floor');\n }", "function make($model, $overrides = [], $times = 1)\n{\n return new PendingModel('make', $model, $overrides, $times);\n}", "public function createRound(Player $player)\n {\n $round = new Round();\n $round->number = (int)$this->getRoundsCount() + 1;\n $round->status = 'starting';\n\n $round->player()->associate($player);\n\n return $this->rounds()->save($round);\n }", "function __construct () {\n\n $this -> ruedas = 8;\n $this -> color = \"gris\";\n $this -> motor = 1600;\n\n }", "public static function genCriteria($model, CDbCriteria $criteria)\r\n {\r\n\r\n if($model->floor_min || $model->floor_max) {\r\n if ($model->floor_min) {\r\n $criteria->addCondition('floor >= :floorMin');\r\n $criteria->params[':floorMin'] = $model->floor_min;\r\n }\r\n if ($model->floor_max) {\r\n $criteria->addCondition('floor <= :floorMax');\r\n $criteria->params[':floorMax'] = $model->floor_max;\r\n }\r\n }\r\n\r\n if($model->square_min || $model->square_max) {\r\n if ($model->square_min) {\r\n $criteria->addCondition('square >= :squareMin');\r\n $criteria->params[':squareMin'] = $model->square_min;\r\n }\r\n if ($model->square_max) {\r\n $criteria->addCondition('square <= :squareMax');\r\n $criteria->params[':squareMax'] = $model->square_max;\r\n }\r\n }\r\n\r\n if($model->ot){\r\n $criteria->join = 'INNER JOIN {{users}} AS u ON u.id = t.owner_id';\r\n if($model->ot == User::TYPE_PRIVATE_PERSON){\r\n $ownerTypes = array(\r\n User::TYPE_PRIVATE_PERSON,\r\n User::TYPE_ADMIN\r\n );\r\n }\r\n if($model->ot == User::TYPE_AGENCY){\r\n $ownerTypes = array(\r\n User::TYPE_AGENT,\r\n User::TYPE_AGENCY\r\n );\r\n }\r\n if (isset($ownerTypes) && $ownerTypes)\r\n $criteria->compare('u.type', $ownerTypes);\r\n }\r\n\r\n if (issetModule('metroStations')) {\r\n $selectedMetroStations = $model->metroSrc;\r\n\r\n if(isset($selectedMetroStations[0]) && $selectedMetroStations[0] == 0){\r\n $selectedMetroStations = array();\r\n }\r\n\r\n if (!empty($selectedMetroStations)) {\r\n if (is_array($selectedMetroStations))\r\n $selectedMetroStations = array_map(\"intval\", $selectedMetroStations);\r\n else\r\n $selectedMetroStations = (int) $selectedMetroStations;\r\n\r\n if ($selectedMetroStations) {\r\n if (!is_array($selectedMetroStations))\r\n $selectedMetroStations = array($selectedMetroStations);\r\n\r\n $sqlMetro = 'SELECT DISTINCT apartment_id FROM {{apartment_metro_stations}} WHERE metro_id IN ('.implode(',', $selectedMetroStations).')';\r\n $criteria->addCondition('(t.id IN('.$sqlMetro.'))');\r\n }\r\n }\r\n }\r\n\r\n $useSeasonalPrices = issetModule('seasonalprices');\r\n\r\n if($model->price_min || $model->price_max) {\r\n\r\n if(issetModule('currency')){\r\n $model->price_min = floor(Currency::convertToDefault($model->price_min));\r\n $model->price_max = ceil(Currency::convertToDefault($model->price_max));\r\n }\r\n else {\r\n $model->price_min = (int) $model->price_min;\r\n $model->price_max = (int) $model->price_max;\r\n }\r\n\r\n if($model->price_min && $model->price_max){\r\n if ($useSeasonalPrices) {\r\n // for non rent items\r\n $or = '\r\n\t\t\t\t(\r\n\t\t\t\t\tt.price_type NOT IN('.Apartment::PRICE_PER_HOUR.', '.Apartment::PRICE_PER_DAY.', '.Apartment::PRICE_PER_WEEK.', '.Apartment::PRICE_PER_MONTH.')\r\n\t\t\t\t\tAND t.price >= :priceMin AND t.price <= :priceMax\r\n\t\t\t\t)';\r\n\r\n $criteria->addCondition(\r\n '\r\n\t\t\t\t\t(t.id IN(SELECT apartment_id FROM {{seasonal_prices}} WHERE price >= '.$model->price_min.' AND price <= '.$model->price_max.')\r\n\t\t\t\t\tOR (is_price_poa = 1)\r\n\t\t\t\t\tOR '.$or.'\r\n\t\t\t\t\t)\r\n\t\t\t\t\t'\r\n );\r\n unset($or);\r\n }\r\n else {\r\n $criteria->addCondition('(price >= :priceMin AND price <= :priceMax) OR (is_price_poa = 1)');\r\n }\r\n\r\n $criteria->params[':priceMin'] = $model->price_min;\r\n $criteria->params[':priceMax'] = $model->price_max;\r\n\r\n }elseif($model->price_min){\r\n if ($useSeasonalPrices) {\r\n // for non rent items\r\n $or = '\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tt.price_type NOT IN('.Apartment::PRICE_PER_HOUR.', '.Apartment::PRICE_PER_DAY.', '.Apartment::PRICE_PER_WEEK.', '.Apartment::PRICE_PER_MONTH.')\r\n\t\t\t\t\t\tAND t.price >= :priceMin\r\n\t\t\t\t\t)';\r\n\r\n $criteria->addCondition(\r\n '\r\n\t\t\t\t\t(t.id IN (SELECT apartment_id FROM {{seasonal_prices}} WHERE price >= :priceMin)\r\n\t\t\t\t\tOR (is_price_poa = 1)\r\n\t\t\t\t\tOR '.$or.'\r\n\t\t\t\t\t)\r\n\t\t\t\t\t'\r\n );\r\n unset($or);\r\n }\r\n else {\r\n $criteria->addCondition('price >= :priceMin OR is_price_poa = 1');\r\n }\r\n $criteria->params[':priceMin'] = $model->price_min;\r\n }elseif($model->price_max){\r\n if ($useSeasonalPrices) {\r\n // for non rent items\r\n $or = '\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tt.price_type NOT IN('.Apartment::PRICE_PER_HOUR.', '.Apartment::PRICE_PER_DAY.', '.Apartment::PRICE_PER_WEEK.', '.Apartment::PRICE_PER_MONTH.')\r\n\t\t\t\t\t\tAND t.price <= :priceMax\r\n\t\t\t\t\t)';\r\n\r\n $criteria->addCondition(\r\n '\r\n\t\t\t\t\t(t.id IN (SELECT apartment_id FROM {{seasonal_prices}} WHERE price <= :priceMax)\r\n\t\t\t\t\tOR (is_price_poa = 1)\r\n\t\t\t\t\tOR '.$or.'\r\n\t\t\t\t\t)\r\n\t\t\t\t\t'\r\n );\r\n unset($or);\r\n }\r\n else {\r\n $criteria->addCondition('price <= :priceMax OR is_price_poa = 1');\r\n }\r\n $criteria->params[':priceMax'] = $model->price_max;\r\n }\r\n }\r\n\r\n if($model->apType){\r\n if ($useSeasonalPrices &&\r\n in_array($model->apType, array(\r\n Apartment::PRICE_PER_HOUR,\r\n Apartment::PRICE_PER_DAY,\r\n Apartment::PRICE_PER_WEEK,\r\n Apartment::PRICE_PER_MONTH)\r\n )) {\r\n\r\n $criteria->addCondition('(t.id IN(SELECT DISTINCT(apartment_id) FROM {{seasonal_prices}} WHERE price_type = '.$model->apType.'))');\r\n }\r\n else {\r\n $criteria->addCondition('t.price_type = :apType');\r\n $criteria->params[':apType'] = $model->apType;\r\n }\r\n }\r\n\r\n //booking\r\n if($model->bStart){\r\n $dateStart = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($model->bStart, Booking::getYiiDateFormat()));\r\n if($model->bEnd){\r\n $dateEnd = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($model->bEnd, Booking::getYiiDateFormat()));\r\n }else{\r\n $dateEnd = $dateStart;\r\n }\r\n\r\n if($dateStart && $dateEnd){\r\n $criteria->addCondition('t.id NOT IN (\r\n SELECT DISTINCT b.apartment_id\r\n FROM {{booking_calendar}} AS b\r\n WHERE b.date_start BETWEEN :b_start AND :b_end\r\n OR :b_start BETWEEN b.date_start AND b.date_end\r\n )');\r\n $criteria->params['b_start'] = $dateStart;\r\n $criteria->params['b_end'] = $dateEnd;\r\n }\r\n }\r\n\r\n //with photo\r\n if($model->wp){\r\n $criteria->addCondition('count_img > 0');\r\n }\r\n\r\n if($model->photo){\r\n if($model->photo == 1){\r\n $criteria->addCondition('count_img > 0');\r\n } elseif($model->photo == 2) {\r\n $criteria->addCondition('count_img = 0');\r\n }\r\n }\r\n\r\n //$doTermSearch = Yii::app()->request->getParam('do-term-search');\r\n $term = $model->term;\r\n if ($term /*&& $doTermSearch */) {\r\n $term = utf8_substr($term, 0, 50);\r\n $term = cleanPostData($term);\r\n\r\n if ($term && utf8_strlen($term) >= param('minLengthSearch', 4)) {\r\n Yii::app()->controller->term = $term;\r\n\r\n $words = explode(' ', $term);\r\n foreach($words as $key=>$value){\r\n if(mb_strlen($value, \"UTF-8\") < param('minLengthSearch', 4) ){\r\n unset($words[$key]);\r\n }\r\n }\r\n\r\n if (count($words) > 1) {\r\n $cleanWords = array();\r\n foreach($words as $word){\r\n if(utf8_strlen($word) >= param('minLengthSearch', 4)){\r\n $cleanWords[] = $word;\r\n }\r\n }\r\n\r\n $searchString = '+'.implode('* +', $cleanWords).'* '; # https://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html\r\n\r\n $sql = 'SELECT id\r\n\t\t\t\t\tFROM {{apartment}}\r\n\t\t\t\t\tWHERE MATCH\r\n\t\t\t\t\t\t(title_'.Yii::app()->language.', description_'.Yii::app()->language.', description_near_'.Yii::app()->language.', address_'.Yii::app()->language.')\r\n\t\t\t\t\t\tAGAINST (\"'.$searchString.'\" IN BOOLEAN MODE)';\r\n }\r\n else {\r\n $sql = 'SELECT id\r\n\t\t\t\t\tFROM {{apartment}}\r\n\t\t\t\t\tWHERE MATCH\r\n\t\t\t\t\t\t(title_'.Yii::app()->language.', description_'.Yii::app()->language.', description_near_'.Yii::app()->language.', address_'.Yii::app()->language.')\r\n\t\t\t\t\t\tAGAINST (\"*'.$term.'*\" IN BOOLEAN MODE)';\r\n }\r\n\r\n $criteria->addCondition('(t.id IN('.$sql.'))');\r\n }\r\n }\r\n\r\n\r\n if(issetModule('formeditor')){\r\n $newFieldsAll = FormDesigner::getNewFields();\r\n $apps = $appsLike = array();\r\n foreach($newFieldsAll as $field){\r\n if($field->type == FormDesigner::TYPE_MULTY) {\r\n $value = Yii::app()->request->getParam($field->field);\r\n if(!$value || !is_array($value))\r\n continue;\r\n\r\n $fieldString = $field->field;\r\n Yii::app()->controller->newFields[$fieldString] = $value;\r\n foreach($value as $val) {\r\n if ($field->compare_type == FormDesigner::COMPARE_LIKE) {\r\n $appsLike[] = CHtml::listData(Reference::model()->findAllByAttributes(array('reference_value_id'=>$val), array('select'=>'apartment_id')), 'apartment_id', 'apartment_id');\r\n }\r\n else {\r\n $apps[] = CHtml::listData(Reference::model()->findAllByAttributes(array('reference_value_id'=>$val), array('select'=>'apartment_id')), 'apartment_id', 'apartment_id');\r\n }\r\n }\r\n\r\n if($appsLike) {\r\n $appsLike = (count($appsLike) > 1) ? call_user_func_array('array_merge', $appsLike) : $appsLike[0];\r\n $criteria->addInCondition('t.id', $appsLike);\r\n }\r\n }\r\n else {\r\n $value = CHtml::encode(Yii::app()->request->getParam($field->field));\r\n if(!$value){\r\n continue;\r\n }\r\n $fieldString = $field->field;\r\n\r\n Yii::app()->controller->newFields[$fieldString] = $value;\r\n\r\n switch($field->compare_type){\r\n case FormDesigner::COMPARE_EQUAL:\r\n $criteria->compare($fieldString, $value);\r\n break;\r\n\r\n case FormDesigner::COMPARE_LIKE:\r\n $criteria->compare($fieldString, $value, true);\r\n break;\r\n\r\n case FormDesigner::COMPARE_FROM:\r\n $value = intval($value);\r\n $criteria->compare($fieldString, \">={$value}\");\r\n break;\r\n\r\n case FormDesigner::COMPARE_TO:\r\n $value = intval($value);\r\n $criteria->compare($fieldString, \"<={$value}\");\r\n break;\r\n }\r\n }\r\n }\r\n if($apps) {\r\n $apps = (count($apps) > 1) ? call_user_func_array('array_intersect', $apps) : $apps[0];\r\n $criteria->addInCondition('t.id', $apps);\r\n }\r\n }\r\n\r\n if($model->rooms) {\r\n if($model->rooms == 4) {\r\n $criteria->addCondition('num_of_rooms >= :rooms');\r\n } else {\r\n $criteria->addCondition('num_of_rooms = :rooms');\r\n }\r\n $criteria->params[':rooms'] = (int) $model->rooms;\r\n }\r\n\r\n return $criteria;\r\n }", "public function get_rounding()\n {\n return $this->rounding;\n }", "abstract protected function modelFactory();", "public function floor(): self;", "public function getRoundNum() {\n\t\treturn $this->roundNum;\n\t}", "public function __construct(Coin $model)\n\t{\n\t\t$this->model = $model;\n\t}", "public function __construct()\n {\n // Metres, Centimetres, Millimetres, Yards, Foot, Inches\n $conversions = array(\n 'Weight' => array(\n 'base' => 'kg',\n 'conv' => array(\n 'g' => 1000,\n 'mg' => 1000000,\n 't' => 0.001,\n 'oz' => 35.274,\n 'lb' => 2.2046,\n )\n ),\n 'Distance' => array(\n 'base' => 'km',\n 'conv' => array(\n 'm' => 1000,\n 'cm' => 100000,\n 'mm' => 1000000,\n 'in' => 39370,\n 'ft' => 3280.8,\n 'yd' => 1093.6\n )\n )\n );\n\n foreach ($conversions as $val) {\n $this->addConversion($val['base'], $val['conv']);\n }\n }", "public function __construct($currentPlayer, int $roundSum = 0)\n {\n $this->currentPlayer = $currentPlayer;\n $this->roundSum = $roundSum;\n }", "public function testOzToLb() {\n $this->assertEquals(0.25, $this->unitLb->fromBase($this->unitOz->toBase(4)));\n }", "protected function getModel()\n {\n return new ScaleStation;\n }", "public function __construct(?int $rounds = null)\n {\n $this->rounds = $rounds ?? $this->rounds;\n }", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "public function set_rounding($rounding)\n {\n $this->rounding = $rounding;\n }", "public abstract function make();", "public function __construct(\\App\\NumbersModel $model)\n {\n parent::__construct();\n $this->numbers = $model->all();\n }", "public function model();", "public function model();", "protected function createModel()\n {\n $groupby['period_1'] = new \\Zend_Db_Expr(\"YEAR($this->dateFrom)\");\n\n $date = new \\MUtil_Date();\n\n switch ($this->dateType) {\n case 'D':\n $keyCount = 1;\n $groupby['period_1'] = new \\Zend_Db_Expr(\"CONVERT($this->dateFrom, DATE)\");\n\n $date->setTime(0);\n $date->addDay($this->dateFactor - $this->dateRange);\n\n $start = $date->getIso();\n for ($i = -$this->dateRange; $i <= $this->dateRange; $i++) {\n if (0 == $i) {\n $this->dateCurrentStart = clone $date;\n $this->dateCurrentEnd = clone $date;\n $this->dateCurrentEnd->setTimeToDayEnd();\n }\n\n $values = array();\n $values['period_1'] = $date->get('yyyy-MM-dd');\n $values['range'] = $i;\n $requiredRows[$i] = $values;\n $date->addDay(1);\n }\n $date->subSecond(1);\n $end = $date->getIso();\n break;\n\n case 'W':\n $keyCount = 2;\n\n // Use MONDAY as start of week\n $groupby['period_1'] = new \\Zend_Db_Expr(\"substr(YEARWEEK(gto_valid_from, 3),1,4)\");\n //$groupby['period_1'] = new \\Zend_Db_Expr(\"YEAR($this->dateFrom) - CASE WHEN WEEK($this->dateFrom, 1) = 0 THEN 1 ELSE 0 END\");\n $groupby['period_2'] = new \\Zend_Db_Expr(\"WEEK($this->dateFrom, 3)\");\n\n $date->setWeekday(1);\n $date->setTime(0);\n $date->addWeek($this->dateFactor - $this->dateRange);\n\n $start = $date->getIso();\n for ($i = -$this->dateRange; $i <= $this->dateRange; $i++) {\n if (0 == $i) {\n $this->dateCurrentStart = clone $date;\n $this->dateCurrentEnd = clone $date;\n $this->dateCurrentEnd->addWeek(1)->subSecond(1);\n }\n\n $values = array();\n $values['period_1'] = $date->get(\\Zend_Date::YEAR);\n $values['period_2'] = (int) $date->get(\\Zend_Date::WEEK); // Use constant but drop leading zero\n // When monday is in the previous year, add one to the year\n if ($date->get(\\Zend_Date::DAY_OF_YEAR)>14 && $date->get(\\Zend_Date::WEEK) == 1) {\n $values['period_1'] = $values['period_1'] + 1;\n }\n $values['range'] = $i;\n $requiredRows[$i] = $values;\n $date->addWeek(1);\n }\n $date->subSecond(1);\n $end = $date->getIso();\n break;\n\n case 'M':\n $keyCount = 2;\n $groupby['period_2'] = new \\Zend_Db_Expr(\"MONTH($this->dateFrom)\");\n\n $date->setDay(1);\n $date->setTime(0);\n $date->addMonth($this->dateFactor - $this->dateRange);\n\n $start = $date->getIso();\n for ($i = -$this->dateRange; $i <= $this->dateRange; $i++) {\n if (0 == $i) {\n $this->dateCurrentStart = clone $date;\n $this->dateCurrentEnd = clone $date;\n $this->dateCurrentEnd->addMonth(1)->subSecond(1);\n }\n\n $values = array();\n $values['period_1'] = $date->get(\\Zend_Date::YEAR);\n $values['period_2'] = $date->get(\\Zend_Date::MONTH);\n $values['range'] = $i;\n $requiredRows[$i] = $values;\n $date->addMonth(1);\n }\n $date->subSecond(1);\n $end = $date->getIso();\n break;\n\n case 'Y':\n $keyCount = 1;\n $date->setDay(1);\n $date->setMonth(1);\n $date->setTime(0);\n $date->addYear($this->dateFactor - $this->dateRange);\n $start = $date->getIso();\n for ($i = -$this->dateRange; $i <= $this->dateRange; $i++) {\n if (0 == $i) {\n $this->dateCurrentStart = clone $date;\n $this->dateCurrentEnd = clone $date;\n $this->dateCurrentEnd->addYear(1)->subSecond(1);\n }\n\n $values = array();\n $values['period_1'] = $date->get(\\Zend_Date::YEAR);\n $values['range'] = $i;\n $requiredRows[$i] = $values;\n $date->addYear(1);\n }\n $date->subSecond(1);\n $end = $date->getIso();\n break;\n\n default:\n throw new \\Gems_Exception_Coding('Incorrect date_type value: ' . $this->dateType);\n }\n $where = \"$this->dateFrom BETWEEN '$start' AND '$end'\";\n\n for ($i = -$this->dateRange; $i <= $this->dateRange; $i++) {\n $requiredRows[$i]['date_factor'] = $this->dateFactor + $i;\n $requiredRows[$i]['df_link'] = null;\n $requiredRows[$i]['df_label'] = null;\n }\n if ($this->dateRange > 0) {\n $requiredRows[-$this->dateRange]['df_link'] = $this->dateFactor - ($this->dateRange * 2);\n $requiredRows[-$this->dateRange]['df_label'] = $this->_('<<');\n $requiredRows[ $this->dateRange]['df_link'] = $this->dateFactor + ($this->dateRange * 2);\n $requiredRows[ $this->dateRange]['df_label'] = $this->_('>>');\n if ($this->dateRange > 1) {\n $i = intval($this->dateRange / 2);\n $requiredRows[-$i]['df_link'] = $this->dateFactor - 1;\n $requiredRows[-$i]['df_label'] = $this->_('<');\n $requiredRows[ $i]['df_link'] = $this->dateFactor + 1;\n $requiredRows[ $i]['df_label'] = $this->_('>');\n }\n $requiredRows[ 0]['df_link'] = $this->dateFactor ? '0' : null;\n $requiredRows[ 0]['df_label'] = $this->_('Now!');\n }\n\n if ($this->dateFactor) {\n $today = new \\MUtil_Date();\n $this->dateFactorChanges['D'] = $this->dateCurrentStart->diffDays($today);\n $this->dateFactorChanges['W'] = $this->dateCurrentStart->diffWeeks($today);\n $this->dateFactorChanges['M'] = $this->dateCurrentStart->diffMonths($today);\n $this->dateFactorChanges['Y'] = $this->dateCurrentStart->diffYears($today);\n } else {\n $this->dateFactorChanges = array_fill_keys(array('D', 'W', 'M', 'Y'), 0);\n }\n // \\MUtil_Echo::track($requiredRows);\n // \\MUtil_Echo::rs($start, $end, $where);\n\n $select = new \\Zend_Db_Select($this->db);\n $select->from($this->dataTableName, $groupby + $this->getDbFields());\n $select->where($where);\n $select->group($groupby);\n $select->order($groupby);\n\n $this->processSelect($select);\n\n // \\MUtil_Echo::r((string) $select);\n\n $model = new \\MUtil_Model_SelectModel($select, $this->dataTableName);\n\n $this->processModel($model);\n \n // Display by column cannot use formatFunction as it is a simple repeater\n // $model->set('duration_avg', 'formatFunction', $this->util->getLocalized()->formatNumber);\n\n $transformer = new \\MUtil_Model_Transform_RequiredRowsTransformer();\n $transformer->setDefaultRow($this->getDefaultRow());\n $transformer->setRequiredRows($requiredRows);\n $transformer->setKeyItemCount($keyCount);\n $model->addTransformer($transformer);\n\n return $model;\n }", "public function toPound(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 2204.62262;\n\n return $this;\n }", "public function getArea()\n{\n return 2* 3.14*$this->radius*($this->radius + $this->height);\n}", "public function toOunce(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 35273.9619;\n\n return $this;\n }", "public function __construct($rawModel)\n {\n $this->model = new \\EasyRdf_Graph();\n $this->model->parse($rawModel);\n }", "public function make();", "function RoundedRect($x, $y, $w, $h, $r, $style = '', $angle = '1234')\n {\n $k = $this->k;\n $hp = $this->h;\n if($style=='F')\n $op='f';\n elseif($style=='FD' or $style=='DF')\n $op='B';\n else\n $op='S';\n $MyArc = 4/3 * (sqrt(2) - 1);\n $this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k ));\n\n $xc = $x+$w-$r;\n $yc = $y+$r;\n $this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k ));\n if (strpos($angle, '2')===false)\n $this->_out(sprintf('%.2f %.2f l', ($x+$w)*$k,($hp-$y)*$k ));\n else\n $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc);\n\n $xc = $x+$w-$r;\n $yc = $y+$h-$r;\n $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k));\n if (strpos($angle, '3')===false)\n $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-($y+$h))*$k));\n else\n $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r);\n\n $xc = $x+$r;\n $yc = $y+$h-$r;\n $this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k));\n if (strpos($angle, '4')===false)\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-($y+$h))*$k));\n else\n $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc);\n\n $xc = $x+$r ;\n $yc = $y+$r;\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k ));\n if (strpos($angle, '1')===false)\n {\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$y)*$k ));\n $this->_out(sprintf('%.2f %.2f l',($x+$r)*$k,($hp-$y)*$k ));\n }\n else\n $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r);\n $this->_out($op);\n }", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "public function __construct($width, $height, $radius)\r\n {\r\n $this->setWidth($width);\r\n $this->setHeight($height);\r\n $this->setRadius($radius);\r\n }", "public function createModel()\n {\n }", "private function setNewRounds($rounds, $activity)\n {\n $result = true;\n if (count($rounds) > 0) {\n foreach ($rounds as $item) {\n $round = $this->roundRepository->createRound();\n $round->setDistance($item->distance);\n $round->setElapsedTime($item->elapsed_time);\n $round->setElevationDifference($item->elevation_difference);\n $round->setMovingTime($item->moving_time);\n $round->setSplit($item->split);\n $round->setAverageSpeed($item->average_speed);\n $round->setAverageHeartrate($item->average_heartrate);\n $round->setPaceZone($item->pace_zone);\n $round->setActivity($activity);\n $round->setDateCreated(new \\DateTime());\n $round->setCreatedBy(null);\n $result = $this->roundRepository->storeRound($round);\n if ($result == false) {\n break;\n }\n }\n }\n return $result;\n }", "public function continue(Request $request, Round $round)\n {\n // Set user\n $user = User::where('api_token', $request->input('api_token'))->firstOrFail();\n\n // Set results\n $availablePoints = 5 * count($round->answers);\n $goodAnswers = $round->answers->where('approved', true);\n if (count($goodAnswers)) {\n $individualPoints = ceil($availablePoints / count($goodAnswers));\n }\n $usersReputation = $round->game->users_reputation;\n foreach ($goodAnswers as $answer) {\n $answer->user->reputation += $individualPoints;\n $answer->user->save();\n $usersReputation[$answer->user->id] += $individualPoints;\n }\n $round->game->users_reputation = $usersReputation;\n $round->game->save();\n\n // Find the next round\n $newRound = Round::where([\n 'game_id' => $round->game->id,\n 'done' => false\n ])->first();\n\n // Broadcast next state\n if ($newRound) {\n $round->game->state = 'round';\n $round->game->active_round_id = $newRound->id;\n broadcast(new ChangeState($round->game, $user, 'round', 3, $newRound));\n } else {\n $round->game->state = 'results';\n broadcast(new ChangeState($round->game, $user, 'results', 5, $round));\n }\n $round->game->save();\n\n return response()->json(['message' => 'OK'], 200);\n }", "function getRoundingCost (&$labor, $numStacks) {\n\tif ($_POST[\"round\"] == \"round\"){\n\t\t$roundingLabor = HOUR*.0833;\n\t\t$roundingLabor += (($numStacks * .004152)*HOUR);\n\t\n\t}\n\telse {\n\t\t$roundingLabor = 0;\n\t}\n$labor += $roundingLabor;\n}", "function beginRound() {\n\n\t\t$this->console_text('Begin Round');\n\t\t$this->releaseEvent('onBeginRound', null);\n\t}", "function _displayFormNewRound($aInfos=null)\n\t{\n\t\t$utd =& $this->_utd;\n\t\t$ut =& $this->_ut;\n\n\t\t$utpage = new utPage('draws');\n\t\t$utpage->_page->addAction('onload', array('changeDrawType'));\n\t\t$utpage->_page->addJavaFile('draws/draws.js');\n\t\t$content =& $utpage->getPage();\n\t\t$form =& $content->addForm('fdraws', 'draws', DRAW_ROUND_CREATE);\n\t\t$form->setTitle('tNewRound');\n\n\t\t// Display warning if exist\n\t\tif (isset($aInfos['errMsg'])) $form->addWng($aInfos['errMsg']);\n\n\t\tif (empty($aInfos))\n\t\t{\n\t\t\tlist($group, $drawId, $drawDisci) = explode(';', kform::getData());\n\t\t\t$infos['rund_drawId'] = $drawId;\n\t\t\t$infos['rund_group'] = $group;\n\t\t\t$infos['rund_name'] = '';\n\t\t\t$infos['rund_stamp'] = '';\n\t\t\t$infos['rund_entries'] = 0;\n\t\t\t$infos['rund_rge'] = 0;\n\t\t}\n\t\telse $infos = $aInfos;\n\t\t\t\n\t\t// Initialize the field\n\t\t$form->addHide(\"drawId\", $infos['rund_drawId']);\n\t\t$form->addHide(\"group\", $infos['rund_group']);\n\t\t$form->addHide(\"roundType\", WBS_ROUND_CONSOL);\n\t\t$form->addHide('drawDisci', $drawDisci);\n\t\t$form->addEdit('roundName', $infos['rund_name'], 20);\n\t\t$form->addEdit('roundStamp', $infos['rund_stamp'], 20);\n\t\t$form->addEdit('roundEntries', $infos['rund_entries'], 3);\n\t\t$kedit =& $form->addEdit('rundFinalPlace', $infos['rund_rge'], 3);\n\t\t$kedit->setMaxLength(3);\n\t\t$elts=array('roundName', 'roundStamp', 'roundEntries', 'rundFinalPlace');\n\t\t$form->addBlock('blkGroup', $elts);\n\n\t\t$form->addDiv('break', 'blkNewPage');\n\t\t$form->addBtn('btnRegister', KAF_SUBMIT);\n\t\t$form->addBtn('btnCancel');\n\t\t$elts=array('btnRegister', 'btnCancel');\n\t\t$form->addBlock('blkBtn', $elts);\n\n\t\t//Display the form\n\t\t$utpage->display();\n\t\texit;\n\t}", "public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}", "public function definition()\n {\n $coordinates = [\n [\n 'x' => $this->faker->numberBetween($min = 20, $max = 620),\n 'y' => $this->faker->numberBetween($min = 20, $max = 460)\n ], [\n 'x' => $this->faker->numberBetween($min = 20, $max = 620),\n 'y' => $this->faker->numberBetween($min = 20, $max = 460)\n ], [\n 'x' => $this->faker->numberBetween($min = 20, $max = 620),\n 'y' => $this->faker->numberBetween($min = 20, $max = 460)\n ], [\n 'x' => $this->faker->numberBetween($min = 20, $max = 620),\n 'y' => $this->faker->numberBetween($min = 20, $max = 460)\n ]\n ];\n\n return [\n 'size' => $this->faker->numberBetween($min = 15, $max = 40),\n 'price_square_foot' => $this->faker->numberBetween($min = 1, $max = 5) * 1000,\n 'name' => 'Room',\n 'coordinates' => json_encode($coordinates)\n ];\n }", "protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }", "protected function model()\n {\n $model = new $this->className;\n foreach ($this->conditions as $cond) {\n if (is_array($cond)) {\n if (count($cond) === 3) {\n // Convert to whereIn()\n if ($cond[1] === 'in') {\n $model = $model->whereIn($cond[0], $cond[2]);\n }\n // Typical 3 params where()\n else {\n $model = $model->where($cond[0], $cond[1], $cond[2]);\n }\n }\n elseif (count($cond) === 2) {\n // Typical 2 params where()\n $model = $model->where($cond[0], $cond[1]);\n }\n else {\n throw new \\Exception('Invalid number of parameters.');\n }\n }\n }\n $this->model = $model;\n return $this->model;\n }", "function roundRect($x1, $y1, $x2, $y2, $w, $h)\r\n {\r\n $cx = $w/2;\r\n $cy = $h/2;\r\n $rw = $x2 - $x1 + 1;\r\n $rh = $y2 - $y1 + 1;\r\n $wp = $this->_pen->Width;\r\n // draw shape\r\n $this->forceBrush();\r\n echo \"$this->_canvas.fillRect($x1 + $cx, $y1, $rw - $w, $rh);\\n\";\r\n echo \"$this->_canvas.fillRect($x1, $y1 + $cy, $rw, $rh - $h);\\n\";\r\n // draw border\r\n $this->forcePen();\r\n echo \"$this->_canvas.drawLine($x1 + $cx, $y1, $x2 - $cx, $y1);\\n\";\r\n echo \"$this->_canvas.drawLine($x1 + $cx, $y2, $x2 - $cx, $y2);\\n\";\r\n echo \"$this->_canvas.drawLine($x1, $y1 + $cy, $x1, $y2 - $cy);\\n\";\r\n echo \"$this->_canvas.drawLine($x2, $y1 + $cy, $x2, $y2 - $cy);\\n\";\r\n\r\n $this->forcePen();\r\n echo \"$this->_canvas.fillArc($x1, $y1, $w, $h, 90, 180);\\n\";\r\n echo \"$this->_canvas.fillArc($x2 - $w + $wp, $y1, $w, $h + $wp, 0, 90);\\n\";\r\n echo \"$this->_canvas.fillArc($x1, $y2 - $h + $wp, $w, $h, 180, 270);\\n\";\r\n echo \"$this->_canvas.fillArc($x2 - $w + $wp, $y2 - $h + $wp, $w, $h, 270, 360);\\n\";\r\n\r\n $this->forceBrush();\r\n echo \"$this->_canvas.fillArc($x1 + $wp, $y1 + $wp, $w - $wp, $h - $wp, 90, 180);\\n\";\r\n echo \"$this->_canvas.fillArc($x2 - $w + $wp, $y1 + $wp, $w - $wp, $h - $wp, 0, 90);\\n\";\r\n echo \"$this->_canvas.fillArc($x1 + $wp, $y2 - $h, $w, $h, 180, 270);\\n\";\r\n echo \"$this->_canvas.fillArc($x2 - $w, $y2 - $h, $w, $h, 270, 360);\\n\";\r\n\r\n\r\n //echo \"$this->_canvas.drawArc($x2 - $r * 2, $y1, $r * 2, $r * 2, 270, 360);\\n\";\r\n //echo \"$this->_canvas.drawArc($x1, $y2 - $r * 2, $r * 2, $r * 2, 90, 180);\\n\";\r\n //echo \"$this->_canvas.drawArc($x2 - $r * 2, $y2 - $r * 2, $r * 2, $r * 2, 360, 90);\\n\";\r\n }", "private function getPayrollModel()\n\t{\n\t\treturn $this->payrollModel = new PayrollModel();\n\t}", "public function createSMS($pool,$roundId) {\n\t\t$round=Round::getRoundById($roundId);\n\t\t\n\t\tFB::log('SMS in RoundRobin for roundId '.$roundId.' and rank '.$round->rank);\n\t\t\n//\t\tif ($round->rank > 1) {\n//\t\t\t$previousRound=Round::getRoundByRank($round->pool_id, $round->rank-1);\n//\t\t} else {\n//\t\t\t$previousRound=false;\n//\t\t\t$standings=false;\n//\t\t}\n\t\t\n\t\t// go through all matches of $round\n\t\tforeach($round->Matches as $match) {\n\t\t\tif ($match->home_team_id !== null) {\n\t\t\t\t$this->createSMSForTeam($round, $match->HomeTeam, $match->AwayTeam, $match);\n\t\t\t}\n\t\t\tif ($match->away_team_id !== null) {\n\t\t\t\t$this->createSMSForTeam($round, $match->AwayTeam, $match->HomeTeam, $match);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "protected abstract function model();", "public function setRoundingMode(int $roundingMode): CalculatorInterface;", "function newReviewRound($args, &$request) {\n\t\treturn $this->_initiateEditorDecision($args, $request, 'NewReviewRoundForm');\n\t}", "public function make()\n {\n $orderState = new OrderState();\n $orderState->setProcessed(true);\n $orderState->setShipped(false);\n\n $orderItem1 = new LineItem();\n $orderItem1->setName('someItemName1');\n $orderItem1->setDescription('item description');\n $orderItem1->setQuantity(1);\n $orderItem1->setSku('AS1210000');\n $orderItem1->setSalePrice('90.00');\n $orderItem1->setTotalPrice('100.00');\n\n $orderItem2 = new LineItem();\n $orderItem2->setName('someItemName2');\n $orderItem2->setDescription('item description');\n $orderItem2->setQuantity(1);\n $orderItem2->setSku('AS3420000');\n $orderItem2->setSalePrice('40.00');\n $orderItem2->setTotalPrice('50.00');\n\n $order = new Order();\n $order->setGrandTotal('160.00');\n $order->setOrderDate(Carbon::parse('2017-05-12T00:00:00.000Z'));\n $order->setTaxAmount('15.00');\n $order->setCurrency('AUD');\n $order->setCustomerOrderId('ORDER-123456789');\n\n $order->setLineItems(collect([$orderItem1,$orderItem2]));\n $order->setStates($orderState);\n\n return $order;\n }", "protected function getRoundsInfo()\r\n {\r\n\r\n $rounds = array();\r\n\r\n for ($r = 1, $n = count($this->bracket[1])*2; $n > 1; $r++, $n /= 2) {\r\n switch ($n)\r\n {\r\n case 16: $name = 'Round of 16'; break;\r\n case 8: $name = 'Quarter-finals'; break;\r\n case 4: $name = 'Semi-finals'; break;\r\n case 2: $name = 'Final'; break;\r\n default: $name = \"Round $r\"; break;\r\n }\r\n\r\n array_push($rounds, array($name, $n));\r\n }\r\n\r\n // Bump up all array indicies so that they fit round numbers.\r\n array_unshift($rounds, array()); // Temporary placeholder.\r\n unset($rounds[0]);\r\n\r\n // If play-in round exists, we add it now.\r\n if (!empty($this->bracket[0]))\r\n array_unshift($rounds, array('Play-in round', count($this->bracket[0])*2));\r\n\r\n return $rounds;\r\n }", "abstract protected function newModel(): Model;", "public function toGram(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 1000000;\n\n return $this;\n }", "public function roundCorners($width, $height)\n {\n $this->saveIfRequired('round_corners_canvas');\n\n //creates the mask for rounded corners\n $mask = new ImageMagick();\n $mask->addConvertOption('size', \"{$this->getWidth()}x{$this->getHeight()}\")\n ->addConvertOption('draw', \"'roundRectangle 0,0 {$this->getWidth()},{$this->getHeight()} {$width},{$height}'\");\n $mask->addFilter('draw', 'xc:none');\n $mask->setWidth($this->getWidth())->setHeight($this->getHeight());\n $this->setTmpPaths($mask, 'mask');\n $mask->save($mask->getOutputPath());\n $mask->imagePath = $mask->getOutputPath();\n $this->tmpFiles[] = $mask->getOutputPath();\n\n //create the temp file with rounded corners\n $this\n ->addConvertOption('matte', $mask->getOutputPath())\n ->addConvertOption('compose', 'DstIn')\n ->addConvertOption('composite')\n ->addConvertOption('alpha', 'set')\n ;\n $this->setForceAlpha(true);\n\n //image has to be saved before next actions\n $this->saveIfRequired('round_corners');\n\n return $this;\n }", "protected function createModel()\n {\n return new LeafModel();\n }", "function variant_round($variant, $decimals) {}", "public function save($round){\n if($round->isPersistent()){\n //update\n $q = \"UPDATE round\n set round.number = ?,\n league_id = ?\n WHERE round_id = ?;\";\n\n //create prepared statement from query\n $stmt = $this->dbConnection->prepare($q);\n //bind parameters to prepared statement\n $roundNum = $round->getNumber();\n $leagueId = $round->getLeague()->getId();\n $roundId = $round->getId();\n $stmt->bindParam(1, $roundNum, \\PDO::PARAM_INT);\n $stmt->bindParam(2, $leagueId, \\PDO::PARAM_INT);\n $stmt->bindParam(3, $roundId, \\PDO::PARAM_INT);\n if($stmt->execute()){\n echo 'round created successfully';\n }\n else{\n throw new RDException('Error creating round' . print_r($stmt->errorInfo()));\n }\n }\n else{\n //insert\n //create Query\n $q = \"INSERT INTO round (round.number, league_id) VALUES(?, ?);\";\n //create prepared statement from query\n $stmt = $this->dbConnection->prepare($q);\n //bind parameters to prepared statement\n $roundNum = $round->getNumber();\n $leagueId = $round->getLeague()->getId();\n $stmt->bindParam(1, $roundNum, \\PDO::PARAM_INT);\n $stmt->bindParam(2, $leagueId, \\PDO::PARAM_INT);\n\n if($stmt->execute()){\n $round->setId($this->dbConnection->lastInsertId());\n echo 'round created successfully';\n }\n else{\n throw new RDException('error creating round');\n }\n }\n }", "public function getRound() :? Round\n {\n return $this->round;\n }", "public function formattedSolutions($round = null) {\n if ($round == null) {\n $round = $this->currentRound();\n }\n $solutionData = $this->getSolutions($round);\n $roundSolutions = [];\n for ($i=0; $i < $this->maxFloor(); $i++) { \n $tmpFloor = [\n 'floorn' => $i + 1,\n 'isCollapsed' => false,\n 'solutions' => []\n ];\n foreach ($solutionData as $sk => $sv) {\n if ($sv->floor == ($i+1)){\n $tmpSolution = [\n 'sid' => intval($sv->sid),\n 'karma' => $sv->karma,\n 'karmaMulti' => $sv->karmamultiplier,\n 'maxrank' => $sv->maxrank,\n 'maxevol' => $sv->maxevol,\n 'gamespeed' => $sv->gamespeed,\n 'note' => $sv->note,\n 'luck' => $sv->luck,\n 'units' => []\n ];\n for ($u=0; $u < 12; $u++) { \n if(!$sv->{'unit_id_'.($u+1)}){\n break;\n }\n $tmpSolution['units'][] = [\n 'unitId' => $sv->{'unit_id_'.($u+1)},\n 'rank' => $sv->{'unit_rank_'.($u+1)},\n 'trans' => $sv->{'unit_trans_'.($u+1)}\n ];\n }\n\n $tmpFloor['solutions'][] = $tmpSolution;\n }\n }\n\n $roundSolutions[$i] = $tmpFloor;\n }\n return $roundSolutions;\n }", "protected function modelInstance()\n {\n return new Cover;\n }", "function roundRect($sx, $sy, $ex, $ey)\r\n {\r\n\r\n\t\t $r2d = \"(Math.PI/180)\";\r\n\r\n $r = ($this->Width > $this->Height) ? (($this->Height-20)*0.15) : (($this->Width-20)*0.15);\r\n\r\n $resp = \"\";\r\n \t\t$resp .= $this->_getJavascriptVar() . \".beginPath();\\n\";\r\n\t\t $resp .= $this->_getJavascriptVar() . \".moveTo($sx + $r, $sy);\\n\";\r\n\t\t $resp .= $this->_getJavascriptVar() . \".lineTo($ex - $r,$sy);\\n\";\r\n\t \t $resp .= $this->_getJavascriptVar() . \".arc($ex - $r,$sy + $r, $r, $r2d*270, $r2d*360,false);\\n\";\r\n \t\t\t$resp .= $this->_getJavascriptVar() . \".lineTo($ex, $ey - $r); \\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($ex - $r,$ey -$r,$r,$r2d*0,$r2d*90,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".lineTo($sx+$r,$ey); \\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($sx+$r,$ey-$r,$r,$r2d*90,$r2d*180,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".lineTo($sx,$sy + $r);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($sx + $r,$sy + $r,$r,$r2d*180,$r2d*270,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".closePath();\\n\";\r\n\r\n $resp .= $this->forceBrush();\r\n $resp .= $this->_getJavascriptVar() . \".fill();\\n\";\r\n\r\n $resp .= $this->forcePen();\r\n\r\n // paint\r\n $resp .= $this->_getJavascriptVar() . \".stroke(); \\n\";\r\n\r\n\r\n return $resp;\r\n\t }", "public function __CONSTRUCT(){\n $this->model = new Estadobien();\n }", "public function getName()\n {\n return 'round_type';\n }", "public function getRadius();", "private function getCalculatedAreaModel(): \\model\\RectangleArea\r\n {\r\n return $this->area->getAreaModel();\r\n }", "public function __construct() {\n $this->porcentajesCursoModel = $this->model('PorcentajesCursoModel');\n $this->tipoModuloModel = $this->model('TipoModuloModel');\n $this->cursoModel = $this->model('CursoModel');\n }", "public static function model()\n {\n return new self;\n }", "public function __construct() {\n $round = apc_fetch('game_round');\n if ($round === false) {\n $this->start_round();\n }\n\n $board = apc_fetch('game_board');\n if ($board === false) {\n $board = $this->__reload_board($round);\n }\n \n $this->_BOARD = $board;\n $this->_ROUND = $round;\n }", "function create($whole, $num, $denom) {\n if ($denom == 0) { $denom = 1; }\n // negative?\n if ((($whole < 0) xor ($denom < 0)) xor ($num < 0)) {\n // yes make the numerator negative\n $this->num = -1 * (abs($whole) * abs($denom) + abs($num));\n } else {\n $this->num = (abs($whole) * abs($denom) + abs($num));\n }\n // denom always positive\n $this->denom = abs($denom);\n }" ]
[ "0.6848297", "0.6537166", "0.59762955", "0.5613513", "0.54168355", "0.53107864", "0.52688974", "0.49823445", "0.49732658", "0.49675724", "0.49190596", "0.4909747", "0.48959652", "0.48936403", "0.4843986", "0.4843251", "0.48216793", "0.4818231", "0.47821364", "0.47406992", "0.4739196", "0.47108078", "0.46850753", "0.46321848", "0.4603719", "0.45800903", "0.45654058", "0.45573375", "0.4544012", "0.45373556", "0.45304435", "0.45250973", "0.45241645", "0.44843692", "0.44779283", "0.44670588", "0.44616738", "0.44535756", "0.4447426", "0.4446513", "0.4441006", "0.4428448", "0.44197035", "0.4412899", "0.4412899", "0.4412899", "0.4412899", "0.44059545", "0.44049144", "0.43990284", "0.43914056", "0.43914056", "0.43860272", "0.43846598", "0.43845442", "0.43841404", "0.4365959", "0.43600088", "0.43598202", "0.4353805", "0.4353805", "0.4353805", "0.4353805", "0.433099", "0.43270308", "0.43205544", "0.43089893", "0.43019277", "0.42991742", "0.4283849", "0.42830876", "0.42829105", "0.4280532", "0.4279871", "0.4274694", "0.42743996", "0.4262235", "0.42620194", "0.4261187", "0.42585772", "0.4257773", "0.42527145", "0.42433333", "0.4242692", "0.42419603", "0.42418012", "0.4235805", "0.423511", "0.42334905", "0.4229662", "0.4226816", "0.42183572", "0.42092004", "0.4203521", "0.41941795", "0.41906118", "0.41899675", "0.41823632", "0.41819987", "0.4170651" ]
0.52544
7
Delete items from the model
public function delete($filter = true, array $saveTables = null) { $this->trackUsage(); $rows = $this->load($filter); if ($rows) { foreach ($rows as $row) { if (isset($row['gro_id_round'])) { $roundId = $row['gro_id_round']; if ($this->isDeleteable($roundId)) { $this->db->delete('gems__rounds', $this->db->quoteInto('gro_id_round = ?', $roundId)); // Delete the round before anyone starts using it $this->db->delete('gems__tokens', $this->db->quoteInto('gto_id_round = ?', $roundId)); } else { $values['gro_id_round'] = $roundId; $values['gro_active'] = 0; $this->save($values); } $this->addChanged(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n {\n extract(Yii::$app->request->post());\n $this->findModel($list, $item)->delete();\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function item_delete($id)\n{\n $product_items = ProductItem::where('product_id','=',$id)->get();\n\n foreach ($product_items as $key => $productitem) {\n\n $productItem = ProductItem::find($productitem->id);\n $productItem->delete();\n }\n\n}", "public function delete(){\n foreach ( $this->playeractiveitems as $playeractiveitem ){\n $playeractiveitem->delete();\n }\n parent::delete();\n }", "public function delete($model);", "public function deleting($model)\n\t{\n\t}", "public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}", "public function deleteAll()\n {\n return $this->model::query()->delete();\n }", "public function delete(Model $model);", "public function delete(Model $model);", "public function actionDelete()\n {\n $selection = Yii::$app->request->post('selection');\n\n if( !empty($selection) ){\n $ids = array_values($selection);\n $models = Tikets::find()->where(['IN', 'id', $ids])->all();\n foreach( $models as $model ){\n $model->delete();\n }\n }\n\n return $this->redirect(Yii::$app->request->referrer);\n }", "public function clearModels();", "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 multiDelete()\n {\n if(is_array(request()->item)){\n foreach (request()->item as $id) {\n $tradmark = Tradmark::findOrfail($id);\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n }else{\n $tradmark = Tradmark::findOrfail(request('item'));\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n session()->flash('success', trans('admin.deleted_successfully'));\n return redirect(route('admin.tradmarks.index'));\n }", "public function multi_destroy()\n {\n\n if (is_array(request('item'))) {\n Admin::destroy(request('item'));\n } else {\n Admin::find(request('item'))->delete();\n }\n session()->flash('success', 'The records have been deleted successfully');\n return redirect(aurl('news'));\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function actionDelete()\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 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 productFeature_delete($id)\n{\n $product_items = ProductAttribute::where('product_id','=',$id)->get();\n\n foreach ($product_items as $key => $productitem) {\n\n $productItem = ProductAttribute::find($productitem->id);\n $productItem->delete();\n }\n\n}", "public function delete() \n {\n $model = $this->model;\n $input = Input::all(); \n \n $arrayIdDelete = $input[$model::getPrimaryKey()];\n \n $result = array();\n foreach ($arrayIdDelete as $id) {\n $singleResult = $this->deleteSingleObject($id);\n $result[] = $singleResult;\n }\n \n return $jsend = JSend\\JSendResponse::success($result);\n }", "public abstract function deleteModel(\\MPF\\Db\\Model $model);", "public function actionDeleteAll() {\n SupItemsSync::model()->deleteAll();\n\n $this->redirect(array('index'));\n }", "public function deleteItem($item);", "protected function deleteUnusedItems(){\n $items=Item::where('serial_number','')->get();\n foreach($items as $item){\n $item->delete();\n }\n }", "public static function massdelete($items) {\r\n\t\t$retval = Doctrine_Query::create ()->delete ()->from ( 'Wiki w' )->whereIn ( 'w.wiki_id', $items )->execute ();\r\n\t\treturn $retval;\r\n\t}", "public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }", "public function delete()\n {\n $items = Input::get('items');\n\n if ( ! $items && ! count($items)) return 0;\n\n return $this->deleter->delete($items);\n }", "public function deleteItems($id)\n {\n $modelAttributesItems = Attributes_Items::find($id);\n if (isset($modelAttributesItems)) {\n $modelAttributesItems->delete();\n }\n }", "public function delete()\n {\n $items = (new Item)->readList('id_feed = ?', [$this->id]);\n foreach ($items as $item) { /** @var Item $item */\n $item->delete();\n }\n\n return parent::delete();\n }", "protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }", "public function delete()\n\t{\n\t\tif ( !is_array( $this->_id ) )\n\t\t\tthrow new \\RuntimeException( 'item does not exist (anymore)' );\n\n\n\t\t/*\n\t\t * wrap deletion of item and its tight relations in a transaction\n\t\t */\n\n\t\t$item = $this;\n\t\t$set = static::set();\n\t\t$relations = static::$relations;\n\t\t$class = get_called_class();\n\n\t\tif ( !$this->_source->transaction()->wrap( function( connection $connection ) use ( $item, $set, $relations, $class )\n\t\t{\n\t\t\t// cache information on item to delete\n\t\t\t$idValues = array_values( $item->id() );\n\t\t\t$record = count( $relations ) ? $item->load() : array();\n\n\n\t\t\t/*\n\t\t\t * step 1) actually delete current item\n\t\t\t */\n\n\t\t\t$qSet = $connection->qualifyDatasetName( $set );\n\t\t\tif ( $connection->test( sprintf( 'DELETE FROM %s WHERE %s', $qSet, $item->filter() ), $idValues ) === false )\n\t\t\t\tthrow new datasource_exception( $connection, 'failed to delete requested model instance' );\n\n\n\t\t\t/*\n\t\t\t * step 2) update all related items\n\t\t\t */\n\n\t\t\t// on deleting item relations have to be updated\n\t\t\t// - always null references on current item to be deleted\n\t\t\tforeach ( $relations as $relationName => $relationSpec ) {\n\t\t\t\t// detect if relation is \"tight\"\n\t\t\t\t$isTightlyBound = in_array( 'tight', (array) @$relationSpec['options'] ) ||\n\t\t\t\t @$relationSpec['options']['tight'];\n\n\t\t\t\t// get first reference in relation\n\t\t\t\t/** @var model_relation $relation */\n\t\t\t\t$relation = call_user_func( array( $class, \"relation\" ), $relationName );\n\t\t\t\t$firstNode = $relation->nodeAtIndex( 0 );\n\t\t\t\t$secondNode = $relation->nodeAtIndex( 1 );\n\t\t\t\t$secondNodeSet = $secondNode->getName( true );\n\n\t\t\t\t// prepare collection of information on second node\n\t\t\t\t$onSecond = array(\n\t\t\t\t\t'null' => array(),\n\t\t\t\t 'filter' => array(\n\t\t\t\t\t 'properties' => array(),\n\t\t\t\t 'values' => array(),\n\t\t\t\t )\n\t\t\t\t);\n\n\t\t\t\t// extract reusable code to prepare filter for selecting record\n\t\t\t\t// of second node actually related to deleted item\n\t\t\t\t$getFilter = function() use ( &$onSecond, $connection, $firstNode, $secondNode, $record ) {\n\t\t\t\t\t// retrieve _qualified and quoted_ names of predecessor's properties\n\t\t\t\t\t$onSecond['filter']['properties'] = $secondNode->getPredecessorNames( $connection );\n\t\t\t\t\tforeach ( $firstNode->getSuccessorNames() as $property )\n\t\t\t\t\t\t$onSecond['filter']['values'][] = @$record[$property];\n\t\t\t\t};\n\n\t\t\t\t// inspect type of relationship between first and second node of\n\t\t\t\t// current relation\n\t\t\t\tif ( $secondNode->canBindOnPredecessor() ) {\n\t\t\t\t\t// second node in relation is referencing first one\n\t\t\t\t\t// -> there are items of second node's model referring to\n\t\t\t\t\t// item removed above\n\n\t\t\t\t\t// -> find records of all those items ...\n\t\t\t\t\t$getFilter();\n\n\t\t\t\t\t// ... at least for nulling their references on deleted item\n\t\t\t\t\t$onSecond['null'] = $onSecond['filter']['properties'];\n\t\t\t\t} else {\n\t\t\t\t\t// first node in relation is referencing second one\n\t\t\t\t\t// -> deleted item was referencing item of second node's model\n\t\t\t\t\t// -> there is basically no need to update any foreign\n\t\t\t\t\t// references on deleted item\n\n\t\t\t\t\tif ( $isTightlyBound )\n\t\t\t\t\t\t// relation is marked as \"tight\"\n\t\t\t\t\t\t// -> need to delete item referenced by deleted item\n\t\t\t\t\t\t$getFilter();\n\t\t\t\t}\n\n\n\t\t\t\t// convert filtering properties of second node into set of assignments\n\t\t\t\t$filter = array_map( function( $name ) { return \"$name=?\"; }, $onSecond['filter']['properties'] );\n\n\t\t\t\tif ( $isTightlyBound ) {\n\t\t\t\t\t// in tight relation immediately related elements are\n\t\t\t\t\t// deleted as well\n\n\t\t\t\t\t$secondModel = $secondNode->getModel();\n\n\t\t\t\t\tif ( $secondModel->isVirtual() ) {\n\t\t\t\t\t\t// second model is virtual, only\n\t\t\t\t\t\t// -> it's okay to simply delete matching records in datasource\n\t\t\t\t\t\t$qSet = $connection->qualifyDatasetName( $secondNodeSet );\n\t\t\t\t\t\t$term = implode( ' AND ', $filter );\n\n\t\t\t\t\t\tif ( !$connection->test( \"DELETE FROM $qSet WHERE $term\", $onSecond['filter']['values'] ) )\n\t\t\t\t\t\t\tthrow new datasource_exception( $connection, 'failed to delete instances of tightly related items in relation ' . $relationName );\n\n\t\t\t\t\t\t// TODO: add support for tightly bound relation in opposite reference of this virtual node\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// query data source for IDs of all tightly related items\n\t\t\t\t\t\t$query = $connection->createQuery( $secondNodeSet );\n\n\t\t\t\t\t\t// - select related items using properties involved in relation\n\t\t\t\t\t\tforeach ( $onSecond['filter']['properties'] as $index => $name )\n\t\t\t\t\t\t\t$query->addFilter( \"$name=?\", true, $onSecond['filter']['values'][$index] );\n\n\t\t\t\t\t\t// - fetch all properties used to identify items\n\t\t\t\t\t\t$ids = $secondModel->getIdProperties();\n\t\t\t\t\t\tforeach ( $ids as $index => $name )\n\t\t\t\t\t\t\t$query->addProperty( $connection->quoteName( $name ), \"i$index\" );\n\n\t\t\t\t\t\t// iterate over all matches for deleting every one\n\t\t\t\t\t\t$matches = $query->execute();\n\t\t\t\t\t\t$iCount = count( $ids );\n\n\t\t\t\t\t\twhile ( $match = $matches->row() ) {\n\t\t\t\t\t\t\t// extract properly sorted ID from matching record\n\t\t\t\t\t\t\t$id = array();\n\t\t\t\t\t\t\tfor ( $i = 0; $i < $iCount; $i++ )\n\t\t\t\t\t\t\t\t$id[$ids[$i]] = $match[\"i$i\"];\n\n\t\t\t\t\t\t\t// select item of model and delete it\n\t\t\t\t\t\t\t$secondModel\n\t\t\t\t\t\t\t\t->selectInstance( $connection, $id )\n\t\t\t\t\t\t\t\t->delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ( count( $onSecond['null'] ) ) {\n\t\t\t\t\t// need to null foreign references on deleted item\n\t\t\t\t\t$values = array_merge(\n\t\t\t\t\t\t\t\t\tarray_pad( array(), count( $onSecond['filter']['values'] ), null ),\n\t\t\t\t\t\t\t\t\t$onSecond['filter']['values']\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t$qSet = $connection->qualifyDatasetName( $secondNodeSet );\n\t\t\t\t\t$matching = implode( ' AND ', $filter );\n\t\t\t\t\t$setting = implode( ',', $filter );\n\n\t\t\t\t\tif ( !$connection->test( \"UPDATE $qSet SET $setting WHERE $matching\", $values ) )\n\t\t\t\t\t\tthrow new datasource_exception( $connection, 'failed to null references on deleted item in relation ' . $relationName );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} ) )\n\t\t\tthrow new datasource_exception( $this->_source, 'failed to completely delete item and its tightly bound relations' );\n\n\n\t\t// drop that item now ...\n\t\t$this->_id = null;\n\t}", "public function delete(Identifiable $model);", "abstract public function delete($item);", "public function actionDeleteList()\n {\n $ids = Yii::$app->request->post('ids');\n $success = false;\n\n if (!empty($ids)) {\n foreach ($ids as $id) {\n $model = $this->findModel($id);\n $success = $model->delete();\n }\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return [\n 'success' => $success,\n ];\n }", "public function clearItems();", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function actionDeleteList()\n {\n $ids = Yii::$app->request->post('ids');\n $success = false;\n if (!empty($ids)) {\n foreach ($ids as $id) {\n $model = $this->findModel($id);\n $success = $model->delete();\n }\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n\n return [\n 'success' => $success,\n ];\n }", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\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 destroy()\n {\n $this->items = array();\n }", "public function removeAll()\n {\n return $this->getModel()->whereRaw('1=1')->delete();\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function Delete($item)\n {\n $item->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 deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "public function deleteByModel(Model $model): bool;", "public function actionDelete($order_id, $item_id, $shipping_id)\n{\n$this->findModel($order_id, $item_id, $shipping_id)->delete();\n\nreturn $this->redirect(['index']);\n}", "public function index_onDelete()\n {\n if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {\n\n foreach ($checkedIds as $id) {\n if (!$obj = MyModel::find($id)) continue;\n $obj->delete();\n }\n\n Flash::success(\"Successfully deleted\");\n }\n else {\n Flash::error(\"An error occurred when trying to delete the selected item\");\n }\n\n return $this->listRefresh();\n\n }", "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 }", "public function delete(){\n\t\t\t\n\t\t/* set method */\n\t\t$this->request_method = 'delete';\n\t\t\t\t\n\t\t/* check for id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 14, 'No model id in request, cant delete' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* parse the data from backbone */\n\t\t$this->parse_model_request();\n\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* access the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\t\t\n\t\t \t\t\t \t\n\t\t/* delete from database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('delete_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 15, 'no user privileges to delete the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t$result = wp_delete_post($this->id);\n\t\t\t\t\n\t\t\t\t/* error checking while delete */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 16, 'deleting the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* success, the id of the deleted post was returned */\n\t\t\t\t$deleted_id = $result->ID;\n\t\t\t\t\n\t\t\t\t/* setup a clean response */\n\t\t\t\t$this->parse_model_response($deleted_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t/* @TODO better permission handling */\n\t\t\t\t\t$comment_in_db = get_comment( $this->id );\n\t\t\t\t\t$comment_author = $comment_in_db->user_id;\n\t\t\t\tif ( $this->properties->access == \"loggedin\" && $comment_author != $this->current_user->ID ) {\n\t\t\t\t\t$this->set_error( 17, 'This comment can only be deleted by the comment author :' . $comment_author );\n\t\t\t\t\treturn;\t\n\t\t\t\t}\n\t\t\t\t$result = wp_delete_comment($this->id);\n\t\t\t\t\n\t\t\t\t/* true is returned on success delete */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 17, 'deleting the comment failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* setup a clean response */\t\n\t\t\t\t$this->parse_model_response($result);\t\n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\t\n\t\t\tbreak;\n\t\t}\t\n do_action('bb-wp-api_after_upd', $updated_id, $this->properties, $this );\n\n\t}", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t $id=$_POST['id'];\n\t foreach($id as $ids)\n\t {\n\t\t$model=$this->loadModel($ids);\n\t\t$model->recordstatus=0;\n\t\t$model->save();\n\t }\n\t echo CJSON::encode(array(\n\t\t\t 'status'=>'success',\n\t\t\t 'div'=>'Data deleted'\n\t\t\t ));\n\t Yii::app()->end();\n\t}", "public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n $model->unsearchable();\n }", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function deleteItems(Collection $collection): Collection;", "public function deleting()\n {\n # code...\n }", "public function deleteProcuct($productModel) {\n\n }", "public function delete(Model $model)\n {\n }", "public function delete()\n {\n $content = $this->get();\n\n foreach ($content as $key=>$value)\n {\n $this->set($key, null);\n }\n\n return $this->save();\n }", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function remove(...$items);", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$id=$_POST['id'];\n\t\tforeach($id as $ids)\n\t\t{\n\t\t $model=$this->loadModel($ids);\n\t\t $model->recordstatus=0;\n\t\t $model->save();\n\t\t}\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "public function destroy()\n {\n try {\n $medSupID = array();\n foreach (Input::all() as $key) {\n $medSupID = $key;\n }\n\n UsedMedSupply::whereIn('medSupplyUsedID', $medSupID)->update(['isDeleted' => 1]);\n\n\n } catch (Exception $e) {\n\n }\n }", "public function delete($id){\n $issueStock = IssueStock::find($id)->delete();\n $issueStockItem = IssueStockItem::where('issue_stocks_id', '=', $id)->get(); \n foreach ($issueStockItem as $p) {\n $item = Item::find($p->item_id);\n $item->stock = $item->stock + $p->quantity;\n $item->save(); \n $deleteItem = Stock::where(\"type_id\",\"=\",$id)\n ->where(\"type\",\"=\", 4)\n ->where(\"item_id\",\"=\", $p->item_id)\n ->delete(); \n //$p->delete();\n }\n IssueStockItem::where('issue_stocks_id', '=', $id)->delete();\n $response[\"status\"] =\"success\";\n // $response[\"message\"] =trans(\"validation.success_delete\",[\"attribute\" => trans('glob.issue') ]);\n // $response[\"data\"] = $issueStock;\n return Response($response,200);\n }", "public function massDeleteAction()\n {\n $kstitemIds = $this->getRequest()->getParam('kstitem');\n if (!is_array($kstitemIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Please select items to delete.')\n );\n } else {\n try {\n foreach ($kstitemIds as $kstitemId) {\n $kstitem = Mage::getModel('bs_kst/kstitem');\n $kstitem->setId($kstitemId)->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_kst')->__('Total of %d items were successfully deleted.', count($kstitemIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was an error deleting items.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function deletion($data, Model $model)\n { \n $this->table = $model->table;\n\n foreach($data as $record) {\n $this->unsetQuery();\n $this->delete('message_id = ?', [$record]);\n }\n }", "public function deleting($model)\n\t{\n\t\t$errors\t\t\t\t\t= new MessageBag();\n\n\t\t//1. delete child\n\t\tforeach ($model->calendars as $key => $value) \n\t\t{\n if(!$value->delete())\n {\n \t$errors->add('Calendar', $value->getError());\n }\n\t\t}\n\n\n\t\t//2. delete chart\n\t\tforeach ($model->follows as $key => $value) \n\t\t{\n if(!$value->delete())\n {\n \t$errors->add('Calendar', $value->getError());\n }\n\t\t}\n\n\t\t//3. delete schedule\n\t\tforeach ($model->schedules as $key => $value) \n\t\t{\n if(!$value->delete())\n {\n \t$errors->add('Calendar', $value->getError());\n }\n\t\t}\n if($errors->count())\n {\n\t\t\t$model['errors'] \t\t= $errors;\n\n \treturn false;\n }\n\n return true;\n\t}", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function actionDelete()\n {\n $id = $_POST['id_was_23a'];\n $jml = $_POST['jml'];\n $pecah = explode(',',$id);\n for ($i=0; $i < $jml; $i++) { \n $this->findModel($pecah[$i])->delete();\n }\n\n return $this->redirect(['index']);\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 }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n \n $pks = explode(',', $request->post('pks')); \n \n foreach ($pks as $key) \n {\n \n $model=$this->findModel($key);\n $model->delete();\n } \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'true']; \n }\n else\n {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['accion_centralizada_variables/index']);\n }\n \n }", "public function postRemoveItems()\n\t{\n\t\tif (!$this->request->ajax()) { return $this->ajaxErrorResponse(); }\n\n\t\t$ids = explode(',', $this->request->input('types'));\n\t\t$ids = count($ids) && $ids[0] != '' ? $ids : [];\n\t\t$items = $this->item_model->whereIn('typeID', $ids)->get();\n\n\t\ttry {\n\t\t\tif ($items->count() == 0) {\n\t\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\t\ttrans('buyback.messages.remove_items_nothing', $items->count()));\n\t\t\t}\n\n\t\t\t$items->each(function ($item) { $item->delete(); });\n\n\t\t\treturn $this->ajaxSuccessResponse(\n\t\t\t\ttrans_choice('buyback.messages.remove_items_success', $items->count() == 1 ? 1 : 2));\n\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\ttrans_choice('buyback.messages.remove_items_failure', $items->count() == 1 ? 1 : 2));\n\t\t}\n\t}", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public function afterDelete()\n {\n foreach (static::find()->where(['parent_id' => $this->id])->all() as $item) {\n $item->delete();\n }\n }", "public function actionBulkTrash() {\n\n if (Yii::$app->request->post('selection')) {\n\n $where = ['id' => Yii::$app->request->post('selection', [])];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_TRASH, 'deleted_at' => time()], $where);\n }\n }", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = $request->post('pks'); // Array or selected records primary keys\n foreach (AcEspUej::findAll(json_decode($pks)) as $model) {\n $model->delete();\n }\n \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>true]; \n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('classes.index');\n }\n }", "public function destroy(Items $items)\n {\n //\n }", "public function actionDelete()\n {\n //Yii::$app->controller->enableCsrfValidation = false;\n //print_r($_POST);\n if($_POST['selection_all']==1){\n DipaMaster::deleteAll();\n return $this->redirect(['index']);\n } else {\n foreach ($_POST['selection'] as $key => $value) {\n $this->findModel($value)->delete();\n }\n return $this->redirect(['index']);\n }\n // $this->findModel($id)->delete();\n\n // return $this->redirect(['index']);\n }", "public function bulk_destroy(Request $request)\n {\n $banners = Banners::find($request->ids);\n\n foreach ($banners as $item) {\n //languages\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $banners_trans = BannersTrans::where('lang', '=', $language)->where('tid', '=', $item->id)->first();\n\n if($banners_trans) {\n $banners_trans->delete();\n }\n }\n $check_banners_trans = BannersTrans::where('tid', '=', $item->id)->first();\n if(!$check_banners_trans){\n $item->delete();\n }\n }\n // end languages\n }\n \n Flash::success(trans('backend.deleted_successfully'));\n $Currentlanguage = Lang::getLocale();\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function delete(Request $request)\n {\n\t\tif($request->items){\n\t\t\t// remove submission data\n\t\t\t$expenses = Expenses::whereIn('id', $request->items)->delete(); \n\t\t\treturn 'Expense successfully deleted!';\n\t\t} else {\n\t\t\treturn \"no data selected\";\n\t\t}\n\t}", "public function del() {\n\t\t\tif (!empty($this->params['form']['items'])) {\n\t\t\t\t/* Convert string with ids to array */\n\t\t\t\t$allIds = explode(',', $this->params['form']['items']);\n\t\t\t\t$allIds = Sanitize::clean($allIds);\n\t\t\t\t\n\t\t\t\t/* Remove menu item(s) from tree */\n\t\t\t\t/* @todo Check if this could be done with a single method call/db request instead */\n\t\t\t\tforeach ($allIds AS $id) {\n\t\t\t\t\t$this->MyMenu->removefromtree($id, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Get list of menu items */\n\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function delete(Model $parent);", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Article::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public static function deleteDoorIds($items, $model) {\r\n\t\t$deleteDoorIds = array();\r\n \tforeach($items as $item) {\r\n \t\tarray_push($deleteDoorIds, (string)$item->door_id);\r\n \t}\r\n \t$deleteDoorIds = array_unique($deleteDoorIds);\r\n \t$model->deleteEntries(array(new Data_Column('DOOR_ID', $deleteDoorIds)));\r\n \t\t\t\r\n\t}", "public function delete(){\n\t\t$this->feedbacks_model->delete();\n\t}", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Language::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('posts.index');\n }\n }", "function delete()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// always call parent delete function first!!\n\t\tif (!parent::delete())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// delete all items\n\t\t$med_items = $this->getItemsArray();\n\t\tforeach ($med_items as $item)\n\t\t{\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem($item[\"id\"]);\n\t\t\t$news_item->delete();\n\t\t}\n\t\t\n\t\t$this->deleteOrder();\n\n\t\t// delete record of table il_media_cast_data\n\t\t$query = \"DELETE FROM il_media_cast_data\".\n\t\t\t\" WHERE id = \".$ilDB->quote($this->getId(), \"integer\");\n\t\t$ilDB->manipulate($query);\n\t\t\n\t\treturn true;\n\t}" ]
[ "0.7637804", "0.73928213", "0.7222594", "0.7117589", "0.7092785", "0.7018035", "0.7011803", "0.6981773", "0.6917967", "0.6917967", "0.686056", "0.6848821", "0.6845507", "0.683415", "0.6825909", "0.6817571", "0.6813478", "0.6810214", "0.6800028", "0.67936003", "0.67847633", "0.674244", "0.670741", "0.6703324", "0.66955286", "0.66788954", "0.667188", "0.6645577", "0.6633406", "0.6622094", "0.66127175", "0.65874237", "0.65817213", "0.65816915", "0.6574799", "0.6566675", "0.6566549", "0.6548956", "0.65414363", "0.6540416", "0.65401566", "0.65353894", "0.6524132", "0.65164614", "0.6512831", "0.65105075", "0.65057355", "0.6501332", "0.6496537", "0.64962035", "0.6473228", "0.6472985", "0.64654076", "0.646431", "0.6460333", "0.64594346", "0.64562047", "0.64529526", "0.6451116", "0.64486146", "0.6443741", "0.6438861", "0.6438821", "0.6438745", "0.6429751", "0.6429751", "0.64286596", "0.6421527", "0.6421331", "0.6420293", "0.6416465", "0.6412096", "0.64094853", "0.6404752", "0.6402746", "0.64016515", "0.63945735", "0.63841563", "0.6382047", "0.638035", "0.6377422", "0.6374525", "0.6361799", "0.6360156", "0.6359189", "0.63570106", "0.6351128", "0.63482755", "0.633069", "0.6318876", "0.6311322", "0.6310043", "0.63097835", "0.6305787", "0.6298095", "0.6294233", "0.6289722", "0.62886596", "0.628752", "0.6285119", "0.62843454" ]
0.0
-1
Get the number of times a round is used in other rounds
public function getRefCount($roundId) { if (! $roundId) { return 0; } $sql = "SELECT COUNT(*) FROM gems__rounds WHERE gro_id_round != ? AND ( (gro_valid_after_id = ? AND gro_valid_after_source IN ('tok', 'ans')) OR (gro_valid_for_id = ? AND gro_valid_for_source IN ('tok', 'ans')) )"; return $this->db->fetchOne($sql, [$roundId, $roundId, $roundId]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRoundsCount()\n {\n return $this->rounds()->count();\n }", "public function getRounds() : int\n {\n return $this->rounds;\n }", "public function nextRound() {\n $this->round++;\n }", "public function count()\n {\n return $this->timesRepeat * count($this->test);\n }", "public static function getCountResult($cardChoosen, $cardRound) {\n $result = 0; \n foreach($cardRound as $card) { \n $result += $cardChoosen->compareWith($card);\n }\n \n return $result;\n }", "protected function cost()\n {\n return $this->rounds;\n }", "public function countGame() {\r\n\t\t$sql = new Sql();\r\n\t\t$result = $sql->Select(\"SELECT COUNT(*) as count FROM jogo\");\r\n\t\tif(count($result) > 0) {\r\n\t\t\t\r\n\t\t\t$count = ($result[0]['count']) / 16;\r\n\t\t\treturn ceil($count);\r\n\t\t}\r\n\t}", "public function getRoundNum() {\n\t\treturn $this->roundNum;\n\t}", "public function rank() {\n $eps = pow(2.0, -52.0);\n $tol = max($this->m, $this->n) * $this->s[0] * $eps;\n $r = 0;\n for ($i = 0; $i < count($this->s); ++$i) {\n if ($this->s[$i] > $tol) {\n ++$r;\n }\n }\n return $r;\n }", "public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function rechargePerRound() {\r\n\t\tif ($this->isReactor()) {\r\n\t\t\treturn ($this->amount() * $this->recharge());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "function get_n_time_slots()\n{\n global $morningstarts, $morningstarts_minutes, $eveningends, $eveningends_minutes;\n global $resolution;\n \n $start_first = (($morningstarts * 60) + $morningstarts_minutes) * 60; // seconds\n $end_last = ((($eveningends * 60) + $eveningends_minutes) * 60) + $resolution; // seconds\n $end_last = $end_last % SECONDS_PER_DAY;\n if (day_past_midnight())\n {\n $end_last += SECONDS_PER_DAY;\n }\n $n_slots = ($end_last - $start_first)/$resolution;\n\n return $n_slots;\n}", "private function getTotalFrequentRenterPoints() {\n $result = 0;\n\n foreach ($this->rentals as $rental){\n $result += $rental->getFrequentRenterPoints();\n }\n return $result;\n }", "public function playRounds($rounds){\n $resultOne = 0;\n $resultTwo = 0;\n\n for($x = 1; $x <= $rounds; $x++){\n $playerOne = rand(1,3);\n $playerTwo = rand(1,3);\n\n $finalResult = $this->checkForWinner($playerOne,$playerTwo);\n if($finalResult == 3){\n $resultOne++;\n }elseif($finalResult == 1){\n $resultTwo++;\n }else{\n $x--;\n echo \"You have Draw -> New Game\\n\";\n }\n\n }\n $this->winner($resultOne,$resultTwo);\n\n }", "public function totalComputerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = false AND r.tie = false')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "public function getRoundSum()\n {\n return $this->roundSum;\n }", "function calculateRemainingAmmount($n){\n global $P, $N, $c, $r;\n $REM = (pow((1 + $r), $n) * $P) - ((pow((1+$r), $n)-1) / $r) * $c;\n return round($REM, 2);\n}", "public function getExpectedPaymentsCount()\n {\n $ret = 0;\n if ($this->first_total > 0)\n $ret++;\n if ($this->second_total > 0)\n $ret += $this->rebill_times;\n return $ret;\n }", "function getRoundingCost (&$labor, $numStacks) {\n\tif ($_POST[\"round\"] == \"round\"){\n\t\t$roundingLabor = HOUR*.0833;\n\t\t$roundingLabor += (($numStacks * .004152)*HOUR);\n\t\n\t}\n\telse {\n\t\t$roundingLabor = 0;\n\t}\n$labor += $roundingLabor;\n}", "public function getNumberPlayedMatches()\n {\n return $this->played;\n }", "function calcAmountOfRewards()\n {\n $payoutPercentage = getPayoutPercentage();\n $totalBetCount = getAmountOfBets();\n\n return floor($payoutPercentage * $totalBetCount);\n }", "function getRoundsCount($project_id)\n\t{\n\t $option = JRequest::getCmd('option');\n\t\t$app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(TRUE, $app->getUserState( \"com_sportsmanagement.cfg_which_database\", FALSE ) );\n $query = $db->getQuery(true);\n\t // Select some fields\n $query->select('count(*) AS count');\n // From the table\n\t\t$query->from('#__sportsmanagement_round');\n $query->where('project_id = '.$project_id); \n\n\t\t$db->setQuery($query);\n\t\treturn $db->loadResult();\n\t}", "public function generateRounds()\n\t{\n\t\t// count the required number of rounds in the brackets\n\t\t// 6; 4, 2+2, 2\t\t\t\t4 and 2 byes\n\t\t// 9; 6, 3+1, 2+2, 2\t\t6 and 3 byes\n\t\t// 11; 8, 4+2, 3+1, 2\t\t8 and 3 byes\n\t\t// 8; 4, 2\t\t\t\t\t4 and 0 byes\n\t\t// 7; 6, 3+1, 2\t\t\t\t6 and 1 bye\n\t\t// 5: 4, 2, 1+1\t\t\t\t4 and 1 bye\n\t\t// 14: 12, 6+2, 4, 2\t\t12 and 2 byes\n\t\t// 33: 32, 16, 8, 4, 2, 1+1\t32 and 1 bye\n\n\t\t// create transaction, preventing issues when mallfunctioning\n\t\tDB::beginTransaction();\n\n\n\t\t// the teams of this cup\n\t\t$teams = $this -> cup -> teams;\n\t\t// number of matches per round\n\t\t$matchesPerRound = ceil($teams->count()/2);\n\n\t\t$finalsReached = false;\n\t\t$roundNo = 1;\n\n\t\twhile($finalsReached == false)\n\t\t{\n\t\t\t// instantiate new round\n\t\t\t$round = new Round;\n\n\t\t\t// round no\n\t\t\t$round -> round_no = $roundNo;\n\t\t\t// round planning\n\t\t\tif(!isset($lastPlanned))\n\t\t\t\t$round -> planned_at = $this->calculateNextPossibleTime(isset($lastPlanned) ? $lastPlanned : $this -> cup -> starts_at);\n\n\t\t\t// save round to cup\n\t\t\t$this->cup->rounds()->save($round);\n\n\t\t\t$loop = $matchesPerRound;\n\n\t\t\tfor($i = 1; $i <= $loop; $i++)\n\t\t\t{\n\t\t\t\t// create match instance\n\t\t\t\t$match = new Match;\n\t\t\t\t// plan them for the round planned date\n\t\t\t\t//$match -> planned_at = $round -> planned_at;\n\t\t\t\t// save and link to round\n\t\t\t\t$round->matches()->save($match);\n\n\t\t\t\t// only create match label opponents for first round\n\t\t\t\tif($teams->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t// pick 2 random contestants\n\t\t\t\t\t// todo allow more than 2 teams\n\t\t\t\t\t// todo other way of picking random teams\n\t\t\t\t\t$opponents = new Collection($teams->random(2));\n\t\t\t\t\t// remove these competitors from teams\n\t\t\t\t\t$teams = $teams -> except($opponents->lists('id'));\n\n\t\t\t\t\t// add each opponent to match\n\t\t\t\t\tforeach($opponents as $opponent)\n\t\t\t\t\t{\n\t\t\t\t\t\t// create competitor for match\n\t\t\t\t\t\t$competitor = new Competitor;\n\t\t\t\t\t\t// link to cup team\n\t\t\t\t\t\t$competitor->participant_team_id = $opponent->id;\n\t\t\t\t\t\t// save to match\n\t\t\t\t\t\t$match->competitors()->save($competitor);\n\t\t\t\t\t}\n\t\t\t\t\t// bye; auto-win\n\t\t\t\t\tif($match->competitors->count() == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$match->winner_id = $competitor->id;\n\t\t\t\t\t\t$match->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// force stopping loop if we have finished generating all matches\n\t\t\tif($matchesPerRound == 1)\n\t\t\t\t$finalsReached = true;\n\n\t\t\t// reduces number of required matches of the next round\n\t\t\t$matchesPerRound = ceil($matchesPerRound/2);\n\n\t\t\t// when planning also adds 10 minutes, let's assume 90 minutes per round\n\t\t\t// todo define delay based on game\n\t\t\tif($round->planned_at)\n\t\t\t\t$lastPlanned = $round->planned_at->addMinutes(90);\n\n\t\t\t// increment round number with 1\n\t\t\t$roundNo++;\n\n\t\t}\n\n\t\t// support losing brackets, depending on type->elimination_after\n\t\t// seed starts in round two, for all teams that failed in the first round\n\t\t// todo FIX\n\t\tif($this->cup->type->elimination_after > 0)\n\t\t{\n\n\t\t\tfor($i = 1; $i <= $this->cup->type->elimination_after; $i++)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\t// now commit everything to database\n\t\tDB::commit();\n\n\t\treturn $this -> cup -> rounds;\n\t}", "public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}", "public function getCount()\n {\n return $this->sideCount * $this->sideCount;\n }", "function countWin($userID)\n {\n $MC = $this->countMCWin($userID);\n $YN = $this->countYNWin($userID);\n return ($MC + $YN);\n }", "function getNumberOfIterations();", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "function countD($n)\n{\n\t$count = 0;\n\twhile ($n != 0)\n\t{\n\t\t$n = round($n / 10);\n\t\t++$count;\n\t}\n\treturn $count;\n}", "public function count(): int\n {\n return count($this->intervals);\n }", "public function is_round_a(){\n\t\t$trading_clock = $this->query_trading_clock();\n\t\treturn $trading_clock[\"rnd.a\"];\n\t}", "private function adjust_rounds($data) {\n $z = array();\n $m = 0;\n $t = $data[0];\n foreach ($data as $x)\n if (@++$z[$x] > $m) {\n $m = $z[$x];\n $t = $x;\n }\n $this->rounds *= self::SAMPLE_TIME / $t;\n $this->rounds = (int) ($this->rounds + 1);\n }", "public function drainPerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDrain = $this->amount() * $this->drain();\r\n\t\t\treturn ($fullDrain / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "function sockMerchant($n, $ar) {\n $grouping = array_count_values($ar);\n $count = 0;\n foreach ($grouping as $value){\n $tmp = $value/2; \n $count +=floor($tmp);\n }\n return $count;\n}", "public function roll()\n {\n $res = $this->dice->roll();\n if ($res == 1) {\n $this->dice->reset();\n $this->gamerounds[] = 0;\n }\n $this->roundsum = array_sum($this->dice->rolls());\n\n if (array_sum($this->gamerounds) + $this->roundsum >= 100) {\n $this->gamerounds[] = $this->roundsum;\n echo \"<script>alert('$this->name won')</script>\";\n $res = 100;\n }\n\n return $res;\n }", "public function calculateTotalLunch()\n\t{\n\t\t$result = 0;\n\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->lunch)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $result;\n\t}", "public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }", "public function testcountBells6()\n {\n $startTime = '10:00';\n $endTime = '10:00';\n $expected = 166;\n $actual = $this->clock->countBells($startTime, $endTime);\n $this->assertEquals($expected, $actual);\n }", "public function count() {\n\t\treturn count($this->_permutations) * $this->test->count();\n\t}", "public function getNumberOfRuns() {\n return (float) $this->profile->userTotals->totalRuns;\n }", "public function calculateTotalBreakfast()\n\t{\n\t\t$result = 0;\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->breakfast)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getTotalScore()\n {\n $score = 0;\n for ($i = 1; $i <= 3; $i++) {\n $score += $this->getBaseScoreForShot($i) * $this->getMultiplierForShot($i);\n }\n\n return $score;\n }", "function getOverallOrderRemain(){\n\t\t$t=0;\n\t\t$a = Order::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('payment', 'verified')->count();\n\t\t$r=intVal($sl);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "public function getStartCount($roundId)\n {\n if (! $roundId) {\n return 0;\n }\n\n $sql = \"SELECT COUNT(*) FROM gems__tokens WHERE gto_id_round = ? AND gto_start_time IS NOT NULL\";\n return $this->db->fetchOne($sql, $roundId);\n }", "public static function calculateNumRounds($numTeams) {\n return intval(log($numTeams, 2));\n }", "public function getTestsSum(): int\n {\n return count($this->tests);\n }", "function interceptions() {\n\t\t$interceptions_calc = $this->_interceptions/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\t$interceptions_calc *= 25;\n\t\tif (2.375 - $interceptions_calc < 0) {\n\t\t\t$interceptions_calc = 0;\n\t\t} else {\n\t\t\t$interceptions_calc = 2.375 - $interceptions_calc;\n\t\t}\n\t\treturn $interceptions_calc;\n\t}", "function chanceToWin($lastWin)\n{\n $rough = (int) ((time() - $lastWin) / 60);\n $chance = 0;\n if ($rough > 120) {\n if ($rough > 180) {\n $rough = rand(120, 180);\n }\n $rough = $rough - 120;\n $chance = (int) ($rough * 100) / 60;\n }\n return $chance;\n}", "function calculateMissed(){\n\t\treturn count(self::$groundTruth) - count(self::$rating);\n\t}", "protected function getRoundsInfo()\r\n {\r\n\r\n $rounds = array();\r\n\r\n for ($r = 1, $n = count($this->bracket[1])*2; $n > 1; $r++, $n /= 2) {\r\n switch ($n)\r\n {\r\n case 16: $name = 'Round of 16'; break;\r\n case 8: $name = 'Quarter-finals'; break;\r\n case 4: $name = 'Semi-finals'; break;\r\n case 2: $name = 'Final'; break;\r\n default: $name = \"Round $r\"; break;\r\n }\r\n\r\n array_push($rounds, array($name, $n));\r\n }\r\n\r\n // Bump up all array indicies so that they fit round numbers.\r\n array_unshift($rounds, array()); // Temporary placeholder.\r\n unset($rounds[0]);\r\n\r\n // If play-in round exists, we add it now.\r\n if (!empty($this->bracket[0]))\r\n array_unshift($rounds, array('Play-in round', count($this->bracket[0])*2));\r\n\r\n return $rounds;\r\n }", "public function getCorrectNumericAnswersCount($question_id, $round_id){\n global $ilAccess, $ilUser, $tpl, $ilTabs;\n\n $correct_answers_count = 0;\n // get all answers that belong to a certain round (only their user_sting)\n $answers = $this->object->getAnswers($round_id);\n\n // get the choice of the numeric answer and read out the correct number and the tolerance range\n // both are necessary to count the correct answers\n // there is only one choice for a numeric question\n $choices\t= $this->object->getChoices($question_id);\n // extract the variables from the text-field\n $numeric_values\t\t= (explode(';',$choices[0]['text']));\n $correct_number\t\t= $numeric_values[3];\n $tolerance_range\t= $numeric_values[4];\n\n foreach ($answers as $answer){\n // filter the answers\n if($answer['choice_id'] == $choices[0]['choice_id']) {\n // check the answers\n if($answer['value'] == $correct_number ||\n (isset($tolerance_range) &&\n (($correct_number-$tolerance_range) <= $answer['value']) &&\n ($answer['value'] <= ($correct_number+$tolerance_range)))) {\n // exact aligmnent or in the tolerance range\n $correct_answers_count++;\n }\n }\n }\n return $correct_answers_count;\n }", "public function getTimesToCharge()\n\t{\n\t\t$intTimesToCharge = @($this->minCharge / $this->recursionCharge);\n\t\ttry\n\t\t{\n\t\t\tFlex::assert($intTimesToCharge !== false, 'Recurring_Charge::getTimesToCharge() caused a divide-by-zero error', print_r($this->toArray(), true), \"Recurring_Charge::getTimesToCharge() -- Division by Zero\");\n\t\t}\n\t\tcatch (Exception_Assertion $oException)\n\t\t{\n\t\t\t// Do nothing -- we just want to report it\n\t\t}\n\t\t\n\t\t$intTimesToCharge\t= round($intTimesToCharge);\n\t\tif (($intTimesToCharge * $this->recursionCharge) < ($this->minCharge - $this->getMinChargeMarginOfError()))\n\t\t{\n\t\t\t// We must add one more time to charge to meet the minimum charge (this could possibly be a partial charge, if the recurring charge isn't continuable)\n\t\t\t$intTimesToCharge = $intTimesToCharge + 1;\n\t\t}\n\t\t\n\t\treturn $intTimesToCharge;\n\t}", "public function frequentRenterPoints() : int\n {\n return $this->frequentRenterPoints;\n }", "public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }", "public function count() {\n $total = 0;\n \n foreach($this as $x) {\n // See: http://bits.stephan-brumme.com/countBits.html for an explanation\n $x = $x - (($x >> 1) & 0x55555555);\n $x = ($x & 0x33333333) + (($x >> 2) & 0x33333333);\n $x = $x + ($x >> 4);\n $x &= 0xF0F0F0F;\n\n $total += (x * 0x01010101) >> 24; \n }\n \n return $total;\n }", "function last_aggregate_roundid() {\n $agg_classes = aggregate_classes();\n if (count($agg_classes) == 0) {\n return false;\n }\n if (count($agg_classes) > 1) {\n // We decline to pick a roundid that establishes overall results\n return 0;\n }\n return read_single_value('SELECT R2.roundid AS roundid'\n .' FROM (SELECT classid, MAX(round) AS max_round'\n .' FROM Rounds'\n .' WHERE classid = :classid'\n .' AND NOT EXISTS('\n .' SELECT 1 FROM RegistrationInfo'\n .' WHERE RegistrationInfo.classid = Rounds.classid)'\n .' GROUP BY classid) AS R1'\n .' INNER JOIN Rounds AS R2'\n .' ON R1.classid = R2.classid'\n .' AND R1.max_round = R2.round',\n array(':classid' => $agg_classes[0]));\n}", "public function getMaxRounds() {\n\t\treturn $this->maxRounds;\n\t}", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "public function getCorrectAnswersCount($question_id, $round_id){\n global $ilAccess, $ilUser, $tpl, $ilTabs;\n\n $correct_answers_count = 0;\n // get all answers that belong to a certain round (only their user_sting)\n $answers = $this->object->getDistinctAnswers($round_id);\n\n foreach ($answers as $answer){\n \t$fault_choices = 0;\n\n // these are the choices together with their answers correlating to a certain question and a certain answer\n $choices_of_question_answer = $this->object->getChoicesOfQuestionAnswer($question_id, $answer['user_string']);\n $part_answer_correct_count=0;\n $part_answer_correct_selected_count=0;\n foreach ($choices_of_question_answer as $element){\n \tif ($element['correct_value'] == 1 ){\n \t\t$part_answer_correct_count++;\n \t}\n \t\n\t\t if ($element['correct_value'] == 1 && $element['value'] == 1 ){\n\t\t \t$part_answer_correct_selected_count++;\n\t\t }\n\n\t\t if ($element['correct_value'] == 0 && $element['value'] == 1 ){\n\t\t \t$fault_choices++;\n\t\t }\n }\n\n if ($part_answer_correct_count==$part_answer_correct_selected_count && $fault_choices==0){\n \t$correct_answers_count++;\n }\n// if ($choice['correct_value'] == 1 && $choice['value'] == 1){\n// $correct_answers_count++;\n// }\n }\n \n\n return $correct_answers_count;\n }", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "function getExtensionFactory($game_id, $round_number, $company_id, $factory_number){\r\n\t\t\t$result = 0;\r\n\t\t\t$capacity=new Model_DbTable_Decisions_Pr_Capacity();\r\n\t\t\t$extension_factory=$capacity->getExtensionWasCreated($game_id, $company_id, $factory_number);\r\n\t\t\tfor ($round = 2; $round < $round_number; $round++) {\r\n\t\t\t\t$result+=$extension_factory['factory_number_'.$factory_number]['capacity_'.$round];\r\n\t\t\t\t// $round_created=$extension_factory['factory_number_'.$factory_number]['round_number_created_'.$round];\r\n\t\t\t\t// //var_dump($round_created);\r\n\t\t\t\t// if($round_number>$round_created){\r\n\t\t\t\t\t// $extension[$round]=$extension_factory['factory_number_'.$factory_number]['capacity_'.$round];\r\n\t\t\t\t\t// //var_dump($extension);\r\n\t\t\t\t// }\r\n\t\t\t\t// else {\r\n\t\t\t\t\t// $extension[$round]=0;\r\n\t\t\t\t// }\r\n\t\t\t\t// $result+=$extension[$round];\r\n\t\t\t\t// if($result==null){\r\n\t\t\t\t\t// $result=0;\r\n\t\t\t\t// }\r\n\t\t\t}\r\n\t\t\treturn $result;\t\t\r\n\t\t}", "public function getAllInBetSize(): float\n\t{\n\t\t//No more betting\n\t\tif(!$this->streetsLeft)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t//Get the minimum SPR\n\t\t$minSPR = min(\n\t\t\t$this->getSPRForPlayer(0),\n\t\t\t$this->getSPRForPlayer(1)\n\t\t);\n\n\t\t//Get the number of players\n\t\t$numPlayers = count($this->players);\n\n\t\treturn (pow(($numPlayers * $minSPR + 1), 0.33) - 1) / $numPlayers;\n\t}", "public function repeatCount() {\n if ($this->_m_repeatCount !== null)\n return $this->_m_repeatCount;\n $this->_m_repeatCount = ($this->repeatCountM1() + 1);\n return $this->_m_repeatCount;\n }", "protected function getIterationsCount()\n {\n return count($this->readerGroups->getGroup('source_documents'));\n }", "public function isRoundCompleted();", "public function getWinPoints() : int {\n\t\treturn $this->winPoints;\n\t}", "public function get_total_number_of_units(){\n return $this->unit_count;\n }", "private function getTries() {\n\t\tif( !isset($this->num_tries) ){\n\t\t\tif( !isset($_SESSION['levelTries']) ){\n\t\t\t\t$_SESSION['levelTries'] = array();\n\t\t\t}\n\t\t\tif( isset($_SESSION['levelTries'][$this->level_id]) ){\n\t\t\t\t$this->num_tries = $_SESSION['levelTries'][$this->level_id];\n\t\t\t} else {\n\t\t\t\t$this->num_tries = 0;\n\t\t\t\t$_SESSION['levelTries'][$this->level_id] = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->num_tries;\n\t}", "function getTotal($hand) {\n\t$total = 0;\n\tforeach ($hand as $card => $value) {\n\t\t$total += getCardValue($value['card']);\n\t\tif ($total > 21 && cardIsAce($value['card'])) {\n\t\t\t$total = $total - 10;\n\t\t}\n\t}\n\treturn $total;\n}", "public function countGame()\n {\n }", "public function testcountBells4()\n {\n $startTime = '23:00';\n $endTime = '1:00';\n $expected = 24;\n $actual = $this->clock->countBells($startTime, $endTime);\n $this->assertEquals($expected, $actual);\n }", "public static function getApproxMaxTour()\n\t{\n\t\t$playersCount = Yii::app()->db->createCommand()\n\t\t\t->select('count(*)')\n\t\t\t->from(Player::tableName())\n\t\t\t->queryScalar();\n\t\t$tourCount=ceil(log($playersCount,2)) + ceil(log(Yii::app()->params['accuracyCount'],2));\n\t\treturn (int)$tourCount;\n\t}", "function rate_race_counts(&$next_heat, $n_prev_heats, &$appearances) {\n $nlanes = count($next_heat);\n $ncars = count($appearances);\n $new_appearances = $appearances; // Copies $appearances\n foreach ($next_heat as $car) {\n ++$new_appearances[$car];\n }\n\n $dev = 0;\n // For any car, $target tells how many appearances we'd expect after\n // $next_heat.\n $target = (($n_prev_heats + 1) * $nlanes) / $ncars;\n foreach ($new_appearances as $app) {\n $dev += ($app - $target) * ($app - $target);\n }\n return $dev * RACE_COUNT_WEIGHT;\n}", "public function getRacesCount()\n {\n return count($this->pos_abs);\n }", "public function getTotalFromRule() {\n\t\treturn $this->getScoreFromRuleInternal($this->registration->competition->rule, true);\n\t}", "function getPoints() :int{\n switch ($this->getNumber()){\n case 5: return 5; // queen of spades\n case 28: return 2; // jacks of clubs\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n return 1; // all hearts\n default: return 0; // rest of cards\n }\n }", "public function getWinPercent()\n {\n $total = array_sum($this->performance);\n\n if ($total == 0) {\n return 0;\n }\n\n return ($this->wins / $total) * 100;\n }", "public function getWinPercent()\n {\n $total = array_sum($this->performance);\n\n if ($total == 0) {\n return 0;\n }\n\n return ($this->wins / $total) * 100;\n }", "public function getVipGiftsDrawCount()\n {\n return $this->count(self::_VIP_GIFTS_DRAW);\n }", "function getSurfersNum($mode = 'total') {\n if (!in_array($mode, array('total', 'valid', 'online'))) {\n $mode = 'total';\n }\n $condition = '';\n if ($mode == 'valid') {\n $condition = \" WHERE surfer_valid = 1\";\n } elseif ($mode == 'online') {\n $condition = sprintf(\n \" WHERE surfer_status = 1 AND surfer_lastaction > %d\", time() - 1800\n );\n }\n $sql = \"SELECT COUNT(*)\n FROM %s\".$condition;\n $sqlParams = array($this->tableSurfer);\n $surfersNum = 0;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($num = $res->fetchField()) {\n $surfersNum = $num;\n }\n }\n return $surfersNum;\n }", "function recruterPaysans($nb){\r\n $recrut = 0;\r\n for($x=0;$x<$nb;$x++){\r\n if($this->ors >= COUT_PAYSANS_ORS AND $this->bois >= COUT_PAYSANS_BOIS){\r\n $this->ors-=COUT_PAYSANS_ORS;\r\n $this->bois-=COUT_PAYSANS_BOIS;\r\n $recrut++;\r\n }\r\n }\r\n $this->save();\r\n $stat=new Stat();\r\n $stat->load($this->id);\r\n $stat->calculHab();\r\n $stat->save();\r\n return $recrut;\r\n }", "function count_best($collectionArray)\n{\n\t$countingArray = array();\n\n\tforeach($collectionArray as $value) {\n\t\t$key = $value->get_room() . \": \" . $value->get_position();\n\t\tif (array_key_exists($key, $countingArray)) {\n\t\t\tif ($value->get_difference() < 10) {\n\t\t\t\t$countingArray[$key] = $countingArray[$key] + 1;\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t$countingArray[$key] = $countingArray[$key] + 0;\n\t\t\t\t}\n\t\t\t}\n\t\telse {\n\t\t\tif ($value->get_difference() < 10) {\n\t\t\t\t$countingArray[$key] = 1;\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t$countingArray[$key] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\treturn $countingArray;\n\n}", "function getOverallRemain(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl));\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "function roundUpToAny($n,$x=6) {\n return round(($n+$x/2)/$x)*$x;\n}", "function getGameProgression()\n {\n // With the mini game number we divide the game in 3 thirds (0-33,\n // 33-66, 66-100%), and looking at the player discs we can further\n // divide each third: each disc on an agentarea counts as a 1/9th\n // solved case; each disc on a locslot as a 1/3rd solve case. We\n // average that over the player count, and thus get the in-minigame\n // progress.\n $base = (self::getGameStateValue(\"minigame\") - 1) * (100 / $this->constants['MINIGAMES']);\n $base = max(0, $base);\n $discs_on_agentarea = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'agentarea_%'));\n $discs_on_locslot = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'locslot_%'));\n $perc_cases_solved = 0;\n $perc_cases_solved += $discs_on_agentarea * (1/9);\n $perc_cases_solved += $discs_on_locslot * (1/3);\n $minigame_progress = $perc_cases_solved / self::getPlayersNumber();\n $progress = $base + ($minigame_progress * 33);\n return floor($progress);\n }", "function get_times_run_for_guest( $guest ) {\n\t\t$query = new Log_Query();\n\t\t$query->where_workflow( $this->get_id() );\n\t\t$query->where_guest( $guest->get_email() );\n\t\treturn $query->get_count();\n\t}", "public function getRound()\n {\n return $this->getAttribute('rx');\n }", "public function count()\n {\n $counts = array();\n foreach($this->lists as $list) {\n $counts[] = count($list);\n }\n return array_reduce($counts, function($a, $b) { return $a * $b; }, 1);\n }", "function rate_consecutive(&$prev_heat, &$next_heat) {\n $result = 0;\n for ($lane = 0; $lane < count($next_heat); ++$lane) {\n for ($prev_lane = 0; $prev_lane < count($prev_heat); ++$prev_lane) {\n if ($prev_heat[$prev_lane] == $next_heat[$lane]) {\n $result += CONSECUTIVE_WEIGHT;\n if ($lane == $prev_lane) {\n $result += REPEAT_WEIGHT;\n }\n }\n }\n }\n return $result;\n}", "public function getSkipRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->skipped / $this->getTestsSum()) * 100, 0);\n }", "public function countStones()\n {\n $stoneCount = 0;\n foreach ($this->board as $x => $row) {\n /** @var array $row */\n foreach ($row as $y => $stone) {\n if (self::STONE === $stone) {\n $stoneCount++;\n }\n }\n }\n\n return $stoneCount;\n }", "function getWinRatio($player, $matches) {\n\t$matchesPlayed = 0;\n\t$matchesWon = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['ChallengerID'] == $player || $value['DefenderID'] == $player) {\n\t\t\t$matchesPlayed++;\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$matchesWon++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $matchesWon / $matchesPlayed;\n}", "public function totalScore($scorePulls);", "public function getSumNbConvertedCarts()\n {\n $nbFlaged = Mage::getModel('abandonment/orderflag')->getResource()\n ->getSumNbConvertedCarts($this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod());\n return $nbFlaged;\n }", "public function getStepsCountAttribute()\n {\n $result = MultipleRoomsStepStatus::find($this->attributes['multiple_room_id']);\n\n return 5 - (@$result->basics + @$result->description + @$result->location + @$result->photos + @$result->pricing + @$result->calendar);\n }", "public function getInGame() : int {\n\t\treturn $this->generator->getInGame();\n\t}", "public function execute()\n {\n $sumCurious = 0;\n for ($i = 3; $i < self::UPPER_BOUND; $i++) {\n if ($this->isCurious($i)) {\n $sumCurious += $i;\n echo $i.\" is curious!\\n\";\n } \n }\n return $sumCurious;\n }", "public function getTotalRoomCharge()\n\t{\n\t\t$pickedRooms = $this->getPickedRooms();\n\n\t\t$price = $pickedRooms[1] * $this->s_rate + $pickedRooms[2] * $this->sd_rate + $pickedRooms[3] * $this->t_rate + $pickedRooms[4] * $this->q_rate;\n\n\t\treturn $price;\n\t}", "public function totalTimesPlayerPlayed(int $choice)\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.playerChoice = :choice')\n ->setParameter('choice', $choice)\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }" ]
[ "0.69859296", "0.6832713", "0.6290563", "0.62336093", "0.6154462", "0.6125598", "0.61233985", "0.58767897", "0.5854384", "0.5829975", "0.57314694", "0.5667032", "0.56670153", "0.5655716", "0.562926", "0.56138855", "0.5608129", "0.5594794", "0.5591536", "0.5590438", "0.5586971", "0.5583396", "0.55547357", "0.5551634", "0.5548869", "0.5547972", "0.5547717", "0.5541572", "0.553235", "0.55297214", "0.551343", "0.54705876", "0.54619896", "0.5454152", "0.54433334", "0.54419595", "0.5434728", "0.54295665", "0.5428013", "0.54058987", "0.53989834", "0.539242", "0.5343217", "0.5330441", "0.5323171", "0.53056115", "0.52894354", "0.52889746", "0.52709633", "0.52600604", "0.5251923", "0.5231732", "0.5231333", "0.5227409", "0.5215158", "0.5213206", "0.52121055", "0.52089", "0.5202647", "0.5197308", "0.5191195", "0.5190903", "0.51867634", "0.5172993", "0.5169059", "0.5164734", "0.51612645", "0.5160107", "0.51560485", "0.515369", "0.5150629", "0.5150598", "0.5149065", "0.5148201", "0.51428795", "0.51400644", "0.5128633", "0.51163006", "0.51163006", "0.5114574", "0.50922936", "0.5090133", "0.5085507", "0.50844646", "0.5083863", "0.50738126", "0.50697124", "0.50605905", "0.50562805", "0.50546753", "0.5054439", "0.50505024", "0.5045232", "0.50439", "0.50354224", "0.5027075", "0.50242716", "0.50239676", "0.5019005", "0.501374" ]
0.55869013
21
Get the number of times someone started answering this round.
public function getStartCount($roundId) { if (! $roundId) { return 0; } $sql = "SELECT COUNT(*) FROM gems__tokens WHERE gto_id_round = ? AND gto_start_time IS NOT NULL"; return $this->db->fetchOne($sql, $roundId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRoundsCount()\n {\n return $this->rounds()->count();\n }", "public function count()\n {\n return $this->timesRepeat * count($this->test);\n }", "public function getRounds() : int\n {\n return $this->rounds;\n }", "public function getAnswerCount();", "public function getNbFirstReminderSent()\n {\n return Mage::getModel('abandonment/stats')->getResource()\n ->getTotalFirstReminderSent($this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod());\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function getNumberPlayedMatches()\n {\n return $this->played;\n }", "public function getCurrentQuestionCount();", "public function calculateTotalLunch()\n\t{\n\t\t$result = 0;\n\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->lunch)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $result;\n\t}", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "public function getTimePerQuestion()\n {\n return $this->timePerQuestion;\n }", "public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "public function getNumberOfRuns() {\n return (float) $this->profile->userTotals->totalRuns;\n }", "public function frequentRenterPoints() : int\n {\n return $this->frequentRenterPoints;\n }", "public function getTotalSumNbReminderSent()\n {\n $nbSent = Mage::getModel('abandonment/stats')->getResource()\n ->getSumReminderSent();\n return $nbSent;\n }", "public function countGame() {\r\n\t\t$sql = new Sql();\r\n\t\t$result = $sql->Select(\"SELECT COUNT(*) as count FROM jogo\");\r\n\t\tif(count($result) > 0) {\r\n\t\t\t\r\n\t\t\t$count = ($result[0]['count']) / 16;\r\n\t\t\treturn ceil($count);\r\n\t\t}\r\n\t}", "public function totalComputerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = false AND r.tie = false')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "public function attempts()\n {\n return $this->sportevent ? $this->sportevent->attempts() : 1;\n }", "public function getCurrentCount(): int\n {\n return count($this->getResults());\n }", "public function getSumNbReminderSent()\n {\n $nbSent = Mage::getModel('abandonment/stats')->getResource()\n ->getSumReminderSent($this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod());\n return $nbSent;\n }", "function pointsScored($quiz)\n\t{\n\t $fetch = $this->DB->database_select('points', array('points_obtained'), array('uid' => session_get('uid'), 'qid' => $quiz), 1);\n\t return ($fetch != false) ? $fetch['points_obtained'] : 0;\n\t}", "public function getCalls()\n {\n $calls = count($this->_totalTime);\n if ($this->_start !== null) {\n $calls++;\n }\n\n return $calls;\n }", "function get_number_of_sessions()\n {\n\t\treturn count($this->sessions);\n\t}", "public function totalTimesPlayerPlayed(int $choice)\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.playerChoice = :choice')\n ->setParameter('choice', $choice)\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "public function count(): int\n {\n return count($this->intervals);\n }", "public function getCount()\n {\n return count($this->kids);\n }", "public function count()\n {\n return count($this->steps);\n }", "function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}", "function countWin($userID)\n {\n $MC = $this->countMCWin($userID);\n $YN = $this->countYNWin($userID);\n return ($MC + $YN);\n }", "public static function myWonCount()\n {\n $query = new Query;\n return $query->select(['id'])->from('contest_proposal')->where(['user_won'=>'1', 'user_id' => \\Yii::$app->user->getId()])->count();\n }", "public function count(): int {\n\t\treturn $this->reduce(0, function ($count, $_) {\n\t\t\treturn $count + 1;\n\t\t});\n\t}", "public function startTime(): int\n {\n return $this->startTime;\n }", "public function getSelfHeroesCount()\n {\n return $this->count(self::_SELF_HEROES);\n }", "public function getSelfHeroesCount()\n {\n return $this->count(self::_SELF_HEROES);\n }", "public function attempts(): int\n {\n return $this->attempts;\n }", "public function getTalksCount()\n {\n return $this->count(self::TALKS);\n }", "public function getCount()\n {\n return $this->count++;\n }", "public function getProcessingAttemptsCounter() : int\n\t{\n\t\treturn $this->processingAttemptsCounter;\n\t}", "private function getTotalFrequentRenterPoints() {\n $result = 0;\n\n foreach ($this->rentals as $rental){\n $result += $rental->getFrequentRenterPoints();\n }\n return $result;\n }", "function _getNrOfParticipants($survey_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($survey_id)\n\t\t);\n\t\treturn $result->numRows();\n\t}", "public function increment()\n {\n $this->record->attempts++;\n\n return $this->record->attempts;\n }", "public function totalTimesComputerPlayed(int $choice)\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.computerChoice = :choice')\n ->setParameter('choice', $choice)\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "static function getNumberTimers() {\n return static::$number_timers;\n }", "function get_times_run_for_guest( $guest ) {\n\t\t$query = new Log_Query();\n\t\t$query->where_workflow( $this->get_id() );\n\t\t$query->where_guest( $guest->get_email() );\n\t\treturn $query->get_count();\n\t}", "function getStartPlayerNo($minigame)\n {\n return (($minigame - 1) % self::getPlayersNumber()) + 1;\n }", "public function countTotalPlayers()\n {\n $sql = \"SELECT count(*) FROM `users`\";\n $result = $this->pdo->prepare($sql);\n $result->execute();\n // store the number of rows in a variable\n $number_of_rows = $result->fetchColumn(); \n return $number_of_rows;\n }", "public function getWinPoints() : int {\n\t\treturn $this->winPoints;\n\t}", "public function getRun()\n {\n return array_sum($this->_totalTime);\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "public function getInGame() : int {\n\t\treturn $this->generator->getInGame();\n\t}", "public function countGame()\n {\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function getNbSecondReminderSent()\n {\n return Mage::getModel('abandonment/stats')->getResource()\n ->getTotalSecondReminderSent($this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod());\n }", "public function count()\r\n {\r\n\t\tif ( null === $this->totalResults )\r\n\t\t{\r\n\t\t\t$this->warmUp();\r\n\t\t}\r\n\r\n\t\treturn $this->totalResults;\r\n\t}", "public function getBehelpedTimes()\n {\n $value = $this->get(self::BEHELPED_TIMES);\n return $value === null ? (integer)$value : $value;\n }", "public function getStepsCountAttribute()\n {\n $result = MultipleRoomsStepStatus::find($this->attributes['multiple_room_id']);\n\n return 5 - (@$result->basics + @$result->description + @$result->location + @$result->photos + @$result->pricing + @$result->calendar);\n }", "static public function getPlayerCount() {\n\t\treturn (int)self::$playercount;\n\t}", "public function getUsableIn(): int\n {\n $usableIn = $this->getNotBefore() - time();\n return $usableIn > 0 ? $usableIn : 0;\n }", "public function getCallCount()\n {\n return count($this->data['calls']);\n }", "public function repeatCount() {\n if ($this->_m_repeatCount !== null)\n return $this->_m_repeatCount;\n $this->_m_repeatCount = ($this->repeatCountM1() + 1);\n return $this->_m_repeatCount;\n }", "private function getTries() {\n\t\tif( !isset($this->num_tries) ){\n\t\t\tif( !isset($_SESSION['levelTries']) ){\n\t\t\t\t$_SESSION['levelTries'] = array();\n\t\t\t}\n\t\t\tif( isset($_SESSION['levelTries'][$this->level_id]) ){\n\t\t\t\t$this->num_tries = $_SESSION['levelTries'][$this->level_id];\n\t\t\t} else {\n\t\t\t\t$this->num_tries = 0;\n\t\t\t\t$_SESSION['levelTries'][$this->level_id] = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->num_tries;\n\t}", "public function count()\n {\n return ++$this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function count()\n {\n return ++$this->count;\n }", "public function getAmountOfTicketsLabel()\n {\n return Ticket::find()->creator($this->id)->count();\n }", "public function attempts()\n {\n if (array_key_exists('Attributes', $this->job)) {\n return (int) $this->job['Attributes']['ApproximateReceiveCount'];\n }\n\n return (int) $this->job['attributes']['ApproximateReceiveCount'];\n }", "public function getNumber_hits()\n {\n return $this->number_hits;\n }", "public function getAttemptsCount()\n {\n if (array_key_exists(\"attemptsCount\", $this->_propDict)) {\n return $this->_propDict[\"attemptsCount\"];\n } else {\n return null;\n }\n }", "public function sentCount();", "public function getAnswerTime();", "public function getFinishedCount()\n {\n return count(array_filter($this->pos_abs));\n }", "protected function cost()\n {\n return $this->rounds;\n }", "public function count()\n {\n return $this->backgroundCheck\n ->count();\n }", "public function signCount(): int\n {\n return $this->signCount;\n }", "function getAnswerCount()\n\t{\n\t\treturn count($this->answers);\n\t}", "public function GetNumberOfResults()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = 0;\n \n if (!$this->_my_root && $this->_search_results instanceof c_comdef_meetings) {\n $ret = $this->_search_results->GetNumMeetings();\n } elseif ($this->_my_root instanceof c_comdef_meeting_search_manager) {\n $ret = $this->_my_root->GetNumberOfResults();\n }\n \n return $ret;\n }", "public function getTotalScore()\n {\n $score = 0;\n for ($i = 1; $i <= 3; $i++) {\n $score += $this->getBaseScoreForShot($i) * $this->getMultiplierForShot($i);\n }\n\n return $score;\n }", "public static function getBeginningTurnTime(){\n\t\treturn $_SESSION['beginningTurnTime'];\n\t}", "public function count() {\n\t\t\treturn (int)$this->count;\n\t\t}", "public function totalResults()\n {\n\t\treturn (int) $this->totalResultsReturned;\n }", "public function count(): int\n {\n return $this->_count;\n }", "private function getRecordCounter()\n {\n $recordCounter = DentalLog::where('clinicType', '=', 'D')->count();\n $recordCounter++;\n\n return $recordCounter;\n }", "public function countResponses() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select(['id'])->count('*', 'num_ids')->from('posts_'.$this->board)->where('thread', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$num_responses = $stmt->fetchColumn(1);\n\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\t\n\t\treturn $num_responses;\n\t}", "public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }", "public function getTimeSpent()\n {\n return $this->timeSpent;\n }", "public function count()\n {\n // TODO: Implement count() method.\n return ++$this->count;\n }", "public function increment() {\n $this->countAnswered++;\n }", "function getNumberOfIterations();", "public function getSeatCount()\r\n {\r\n return $this->getPassengerCount();\r\n }", "public function getUserCount()\n {\n return $this->userCount;\n }", "public function attempts()\n {\n return (int) ($this->job->getAttributes()['ApproximateReceiveCount'] ?? 0);\n }", "function GetSubmissionsCount () {\n return @mysql_result (@mysql_query (\"SELECT COUNT(*) AS `num` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"'\", $this->ka_db), 0, \"num\");\n }", "public function currentStartCount(){\n\t\t$multiplier = $this->paged- 1;\n\t\treturn $multiplier * $this->posts_per_page;\n\t}", "public function getInvocationAttemptStarted()\n {\n return $this->readOneof(51);\n }", "public function getHeroCount()\n {\n return $this->count(self::_HERO);\n }", "public function getHeroCount()\n {\n return $this->count(self::_HERO);\n }", "public function getPointsCount()\n {\n return $this->count(self::_POINTS);\n }", "public function getPointsCount()\n {\n return $this->count(self::_POINTS);\n }", "public function count()\n {\n return $this->count;\n }" ]
[ "0.6572491", "0.6490636", "0.6267818", "0.62086135", "0.6124255", "0.6093631", "0.6088629", "0.60658365", "0.6034169", "0.60109115", "0.59809315", "0.59750104", "0.5968928", "0.59269613", "0.5921873", "0.5874608", "0.58624524", "0.58596146", "0.585799", "0.58430415", "0.5839595", "0.5808181", "0.5804665", "0.57804555", "0.5757104", "0.568579", "0.5685315", "0.5674231", "0.56726843", "0.56637436", "0.5661219", "0.5655935", "0.5643561", "0.5643561", "0.5641474", "0.56356907", "0.56325674", "0.56262046", "0.5622026", "0.56160605", "0.5610553", "0.5609949", "0.558509", "0.557265", "0.5564188", "0.5559146", "0.55500746", "0.5543103", "0.5543057", "0.5540849", "0.5522083", "0.55198485", "0.55125076", "0.5512269", "0.55109656", "0.5504955", "0.5504661", "0.5499554", "0.5488379", "0.5482437", "0.54727334", "0.5472699", "0.5472699", "0.5472699", "0.5472699", "0.5461795", "0.5451206", "0.5437881", "0.54286176", "0.5425239", "0.5421373", "0.5419827", "0.5416534", "0.5416032", "0.5413561", "0.54135436", "0.5411802", "0.540729", "0.5403743", "0.53996795", "0.5398876", "0.5396629", "0.53949904", "0.53940123", "0.53931546", "0.53905314", "0.53854424", "0.53825074", "0.53787977", "0.53751403", "0.53714055", "0.5371279", "0.5366178", "0.5362479", "0.53614306", "0.5359756", "0.5359756", "0.5358294", "0.5358294", "0.5353955" ]
0.62104297
3
Can this round be deleted as is?
public function isDeleteable($roundId) { if (! $roundId) { return true; } return ! ($this->getRefCount($roundId) + $this->getStartCount($roundId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _deleteRound()\r\n\t{\r\n\t\t$utr = new utRound();\r\n\t\t$roundId = kform::getInput(\"roundId\");\n\t\t$utr->delRound($roundId);\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit;\n\t}", "public function destroy(Round $round)\n {\n //\n }", "function delete() ;", "function delete() ;", "function roshine_delete_instance($id) {\n global $DB;\n $roshine = $DB->get_record('roshine', array('id' => $id), '*', MUST_EXIST);\n roshine_delete_all_grades($roshine);\n if (! $roshine = $DB->get_record('roshine', array('id' => $id))) {\n return false;\n }\n roshine_delete_all_checks($id);\n $DB->delete_records('roshine_attempts', array('roshineid' => $id));\n $DB->delete_records('roshine', array('id' => $roshine->id));\n return true;\n}", "public function delete() {\n\t\t$canvas = $this->original->getCanvas();\n\t\timagefilledrectangle($this->original->getImage(), $this->x, $this->y, $this->x+$this->getWidth()-1, $this->y+$this->getHeight()-1, imagecolorallocate($this->original->getImage(), $canvas['r'], $canvas['g'], $canvas['b']));\n\t}", "abstract public function isUndeleting();", "abstract public function isUndeleting();", "abstract function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "function delete() {\n }", "function delete()\n {\n }", "abstract protected function delete ();", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function delete()\n {\n }", "public function delete() : bool;", "public function delete() : bool;", "function delete()\r\n {\r\n\r\n }", "public function del(): bool {}", "function delete() {\n\n }", "function delete() \n {\n \n }", "public abstract function delete();", "public static function delete() {\r\n\t\t\r\n\t}", "public static function delete() {\n\n\n\t\t}", "public function deleteArmure()\n {\n $delete = $this->_bdd->prepare(\"DELETE FROM `armure` WHERE `id_armure` = ?\");\n $delete->execute(array($this->_idArmure));\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();", "abstract public function shouldIDelete();", "public function delete(): bool;", "function beforeDelete(){\r\n\t\t$photo = $this->findById($this->id);\r\n\t\tunlink($this->dir . $photo['Photo']['small']);\r\n\t\tunlink($this->dir . $photo['Photo']['large']);\r\n\t\treturn true;\r\n\t}", "protected function _delete()\n\t{\n\t}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function delete(): void;", "public function deleting()\n {\n # code...\n }", "protected function delete() {\n\t}", "public function remove() {}", "public function remove() {}", "public function forceDelete();", "abstract public function mass_remove();", "public function delete(){ return false; }", "public function delete(){ return false; }", "public function delete(){ return false; }", "public function delete(){ return false; }", "public final function delete() {\n }", "public static function delete(){\r\n }", "public function deleted(Credit $credit)\n {\n\n }", "public function delete()\r\n\t{\r\n\t}", "public function delete(): int;", "public function delete()\n\t{\n\t}", "public function delete() {\r\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `layer_points` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "public function delete()\n {\n \n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function canBeRemoved() {}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function delete()\n {\n \n }", "public function DELETE() {\n #\n }", "public function deleted() {\n // TODO Implement this\n }", "public function delete()\n {\n return;\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "protected function _delete()\n {\n return parent::_delete();\n }", "#[@test]\n public function deleteCallsDestructor() {\n $hash= $this->destroyable->hashCode();\n delete($this->destroyable);\n $this->assertNull($this->destroyable);\n $this->assertEquals(1, $this->destroyed[$hash]);\n }", "public function delete(): void\n {\n }", "public function delete_instance() {\r\n global $DB;\r\n// Will throw exception on failure. \r\n if (!$assignmentid = $this->assignment->get_instance()->id) {\r\n return false;\r\n }\r\n // moodle does not allow cascading of db deletes os have to delete in parts\r\n $DB->delete_records('codehandin_submission', array('assignmentid' => $assignmentid)); // delete the submission\r\n\r\n $checkpoint_select = \"SELECT name FROM {codehandin_checkpoint} WHERE assignmentid = ?\";\r\n $DB->delete_records_select('codehandin_test', \"id IN ($checkpoint_select)\", array($assignmentid));\r\n //$DB->delete_records('codehandin_test', array('checkpointid' => $this->assignment->get_instance()->id));\r\n $DB->delete_records('codehandin_checkpoint', array('assignmentid' => $assignmentid)); // delete the checkpoints\r\n $DB->delete_records('codehandin', array('id' => $assignmentid)); // delete the codehandin\r\n // $DB->delete_records('assignsubmission_file', array('assignment' => $assignmentid));\r\n return true;\r\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }" ]
[ "0.7122488", "0.65640885", "0.64989895", "0.64989895", "0.62908757", "0.6279225", "0.6264606", "0.6264606", "0.6188615", "0.6174071", "0.6174071", "0.6174071", "0.6174071", "0.6167102", "0.61457527", "0.6100151", "0.6097273", "0.6096901", "0.6096901", "0.6096886", "0.60887784", "0.6070039", "0.6070039", "0.60278577", "0.6026866", "0.6014163", "0.6009996", "0.60055935", "0.59939516", "0.5972374", "0.5964486", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5957865", "0.5950644", "0.5947119", "0.5913006", "0.59087175", "0.58610296", "0.58610296", "0.58610296", "0.58610296", "0.5857719", "0.5857719", "0.5857719", "0.5849347", "0.58492744", "0.5847403", "0.5823506", "0.5823423", "0.58221984", "0.5812029", "0.58010924", "0.58010924", "0.58010924", "0.58010924", "0.57851106", "0.5772133", "0.5767267", "0.57441694", "0.57432216", "0.5717477", "0.5701568", "0.5690937", "0.5665778", "0.56494975", "0.56493086", "0.5626856", "0.5624465", "0.56179893", "0.5597109", "0.559452", "0.55852264", "0.55830806", "0.55805016", "0.5578681", "0.5578035", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5572487", "0.5567339" ]
0.589786
50
Get array of validation rules for user creation
public static function getRules() { return self::$rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationCreateRules(): array\n {\n }", "public function createRules()\n {\n return [\n 'name' => 'sometimes|required|min:3|regex:/^([0-9a-zA-ZñÑáéíóúÁÉÍÓÚ_-])+((\\s*)+([0-9a-zA-ZñÑáéíóúÁÉÍÓÚ_-]*)*)+$/|max:40',\n 'lastname' => 'sometimes|required|regex:/^([0-9a-zA-ZñÑáéíóúÁÉÍÓÚ_-])+((\\s*)+([0-9a-zA-ZñÑáéíóúÁÉÍÓÚ_-]*)*)+$/|min:3|max:40',\n 'username' => 'required|string|max:40|min:6|unique:users,username',\n 'email' => 'required|unique:users,email',\n 'password' => 'required|min:6',\n 'type' => 'required|in:admin,coordinador,docente,secretaria',\n ];\n }", "public function rules()\n {\n $user = User::findOrFail($this->route('id'));\n\n return [\n 'name' => ['required', 'max:191'],\n 'email' => ['required', 'email', 'max:191', \"unique:users,email,{$user->id}\"],\n 'phone' => ['nullable', new Integer, 'digits_between:10,11'],\n 'role' => ['required', 'integer', 'min:1', 'exists:roles,id'],\n ];\n }", "private function validationRules()\n {\n return [\n 'newPassword' => [\n new PasswordRule($this->newPasswordConfirmation),\n ],\n 'currentPassword' => [\n 'required',\n new PasswordCheckRule($this->user),\n ],\n ];\n }", "public function rules()\n {\n // Get user id from route\n $id = $this->route('user');\n\n return [\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users,email,'.$id,\n 'role' => 'required',\n ];\n }", "public function rules()\n {\n $userId = $this->input('userID');\n $email_validation = 'required|email|unique:users,email';\n if (isset($userId))\n $email_validation = 'required|email|unique:users,email,' . $userId;\n\n return [\n 'user.email' => $email_validation,\n 'user.name' => 'required|min:3',\n 'phone' => 'required|min:3',\n 'address' => 'required|min:3',\n 'city' => 'required',\n 'state' => 'required',\n 'zipcode' => 'required',\n ];\n }", "protected function createValidation()\n {\n return [\n 'user_id' => ['required'],\n 'todo_name' => ['required', 'string'],\n 'todo_description' => ['required', 'string']\n ];\n }", "public function rules()\n {\n $new_user = $this->route()->getName() != \"admin-users.update\";\n\n return [\n 'name' => 'required|max:50|min:2',\n 'email' => 'required' . ($new_user ? '|unique:users' : ''),\n 'password' => ($new_user ? 'required|' : '') . 'min:2'\n ];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules() {\n $method = strtolower($this->method()) . 'Rules';\n if (method_exists($this, $method)) {\n return $this->{$method}();\n }\n\n return [\n 'email' => 'required|email|max:255|min:2|unique:users',\n 'name' => 'required|max:255|min:2',\n ];\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function rules()\n {\n $this->setModel(User::class);\n $rules = parent::rules();\n $is_two_factor_auth_enabled = \\TwoFactorAuth::isActive();\n\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191',\n 'last_name' => 'required|max:191',\n 'roles' => 'required',\n 'picture' => 'mimes:jpg,jpeg,png|max:' . maxUploadFileSize(),\n ]\n );\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email',\n 'password' => 'required|confirmed|max:191|min:6'\n ]\n );\n }\n\n if ($this->isUpdate()) {\n $user = $this->route('user');\n\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email,' . $user->id,\n 'password' => 'nullable|confirmed|max:191|min:6'\n ]\n );\n if ($is_two_factor_auth_enabled) {\n $rules = array_merge($rules, TwoFactorAuth::registrationValidation($this->all()));\n }\n }\n return $rules;\n }", "public function rules()\n {\n /** @var \\App\\User */\n $user = $this->route('user');\n\n return [\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'username' => 'required|string|max:255|unique:users,username,' . $user->id,\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n 'password' => 'required|string|min:6|confirmed',\n ];\n }", "public function rules()\n {\n \t$user = auth()->user();\n \t\n return [\n \t\t'name'\t\t=> [ 'required', 'max:255', Rule::unique('users')->ignore($user->id) ],\n \t\t'username'\t=> [ 'required', 'max:255', Rule::unique('users')->ignore($user->id) ],\n \t\t'email'\t\t=> [ 'required_with:reminder', 'nullable', 'email', Rule::unique('users')->ignore($user->id) ],\n \t\t'reminder'\t=> [ 'nullable' ],\n \t];\n }", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules(): array\n {\n $rules = User::$standard_rules;\n $rules['email'][] = Rule::unique((new User)->getTable())->ignore(auth()->id());\n\n return $rules;\n }", "public function rules()\n {\n if(Auth::id() == config('user.guest_user_id')) {\n return [\n 'self_introduction' => 'required|string|max:200',\n 'wakeup_time' => 'required|date_format:H:i',\n ];\n } else {\n return [\n 'name' => 'required|string|max:12|unique:users,name,'.Auth::user()->name.',name',\n 'profile_image' => 'file|image|max:2048',\n 'self_introduction' => 'required|string|max:200',\n 'wakeup_time' => 'required|date_format:H:i',\n ];\n }\n }", "public function rules()\n {\n $called_function = Route::getCurrentRoute()->getActionMethod();\n\n $rules = array();\n\n if($called_function == 'store')\n {\n $rules = [\n 'username' => 'required|unique:users,username',\n 'password' => 'required',\n 'role' => 'required',\n ];\n }\n\n if($called_function == 'update')\n {\n $rules = [\n 'username' => 'required',\n 'role' => 'required',\n ];\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function getValidationRules() : array;", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = [];\n $rules['name'] = ['string', 'max_db_string'];\n $rules['email'] = ['email', 'max_db_string'];\n if ($this->exists) $rules['email'][] = Rule::unique(self::class)->ignore($this);\n else $rules['email'][] = Rule::unique(self::class);\n $rules['password'] = ['string', 'min:8', 'max_db_string'];\n return $rules;\n }", "protected function rules(): array\n {\n return array_merge(\n $this->extraFieldsRules(User::getModel()),\n $this->nameRules(),\n $this->emailRules(),\n );\n }", "public function rules()\n {\n $role = $this->route('user')->getRoleName();\n\n $rules = [\n 'first_name' => 'required|string',\n 'last_name' => 'required|string',\n 'status' => ['required', Rule::in([User::STATUS_ACTIVE, User::STATUS_INACTIVE])],\n ];\n\n if ($role === Role::ROLE_COMPANY_ADMIN) {\n $rules['company_id'] = 'required|integer|exists:companies,id,deleted_at,NULL';\n }\n\n\n return $rules;\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "protected function validationRules() : array\n {\n return [];\n }", "public function rules()\n {\n $name = $this->route('user') ? \",{$this->route('user')->name},name\" : '';\n $email = $this->route('user') ? \",{$this->route('user')->email},email\" : '';\n $passRequired = $this->route('user') ? '|nullable' : '|required';\n\n return [\n 'name' => 'required|string|max:255|unique:users,name'.$name,\n 'email' => 'string|email|max:255|unique:users,email'.$email,\n 'password' => 'string|min:6'.$passRequired,\n 'description' => 'string|nullable',\n 'roles' => 'array',\n 'group_id' => 'integer|nullable',\n 'account_id' => 'integer|nullable',\n ];\n }", "public function rules(): array\n {\n return [\n 'email' => [\n 'bail',\n 'email',\n 'max:255',\n Rule::unique('users')->ignore($this->end_user->user_id),\n ],\n 'password' => ['bail', 'string', 'min:1', 'max:255'],\n 'country' => ['bail', 'string', 'max:255'],\n 'birth_year' => [\n 'bail',\n 'integer',\n Rule::min(Date::today()->year - Config::get('connecting_voices.age_requirement.max')),\n Rule::max(Date::today()->year - Config::get('connecting_voices.age_requirement.min')),\n ],\n 'gender' => ['bail', 'string', 'max:255'],\n 'ethnicity' => ['bail', 'string', 'max:255'],\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'username' => ['required', 'alpha_num', 'min:3', 'max:30', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'email' => ['required', 'email', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'password' => ['required', 'min:5', 'max:20', 'confirmed'],\n ];\n\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $rules['password'] = ['sometimes', 'min:5', 'max:20', 'confirmed'];\n }\n\n return $rules;\n }", "final public function rules(): array\n {\n return [\n 'name' => 'required|string|max:255',\n 'email' => 'required|email:rfc,dns|unique:users',\n 'cpf' => 'required|string|unique:users|max:15',\n 'password' => 'required|string|max:100',\n 'gender' => ['required', 'string', 'max:2', Rule::in('M', 'F', '')],\n 'phone' => 'required|string|max:255|unique:users',\n ];\n }", "public function rules()\n {\n $this->sanitize();\n\n return [\n 'name' => 'required|max:255',\n 'address' => 'max:150',\n 'email' => ['required', 'email', 'max:255', Rule::unique('users')],\n 'username' => ['required', 'max:20', Rule::unique('users')],\n 'password' => 'required|min:2|confirmed',\n 'role_id' => 'required'\n ];\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function storeValidations()\n {\n return [\n 'username' => 'required|unique:users|max:18|alpha_num',\n 'name' => 'required|max:50',\n 'email' => 'required|email|unique:users|max:100',\n 'status' => 'required|integer',\n 'roles' => 'nullable|array',\n ];\n }", "public function rules()\n\t{\n\t\t$rules = [\n\t\t\t'first_name' => 'bail|required',\n\t\t\t'last_name' => 'bail|required',\n\t\t\t'email' => [\n\t\t\t\t'bail',\n\t\t\t\t'required',\n\t\t\t\t'email',\n\t\t\t\tRule::unique('users')->ignore($this->user()->id),\n\t\t\t],\n\t\t\t'birthday' => 'bail|nullable|date',\n\t\t\t'address' => 'bail|nullable',\n\t\t];\n\n\t\tif( $this->password ){\n\t\t\t$rules['password'] = 'bail|required|confirmed';\n\t\t}\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n return [\n 'username' => ['required', 'string', 'min:6', 'max:255', 'unique:users'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'roles' => ['required'],\n 'first_name' => ['required', 'string', 'max:255'],\n 'last_name' => ['required', 'string', 'max:255'],\n 'address' => ['required', 'string', 'max:255'],\n 'contact_number' => ['required', 'regex:/^(01)[0-46-9]*[0-9]{7,8}$/'],\n 'password' => $this->passwordRules()\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'birth' => 'required|date_format:d.m.Y',\n 'sex' => 'required|string',\n ];\n\n switch ($this->user_type) {\n case 'student':\n return [\n 'entry' => 'required|date_format:d.m.Y',\n 'grade' => 'integer|required|min:1|max:11',\n 'parallel' => 'required|size:1|string',\n 'user_id' => 'required|integer|exists:users,id|unique:pupils,user_id|unique:workers,user_id',\n ] + $rules;\n\n case 'teacher':\n return [\n\n 'employment_date' => 'required|date_format:d.m.Y',\n 'layoff_date' => 'required|date_format:d.m.Y',\n 'user_id' => 'required|integer|exists:users,id|unique:workers,user_id|unique:pupils,user_id',\n ] + $rules;\n }\n }", "public function rules()\n {\n $user = $this->route('user');\n return [\n 'name'=>'required',\n 'role'=>'required',\n 'phone'=>'required',\n 'class'=>'required',\n 'coin'=>'required',\n 'user_name'=>'required|min:5|max:255|unique:Users,user_name,'.$user->id,\n 'email'=>'required|unique:Users,email,'.$user->id,\n 'password'=>'required|min:6|max:255',\n 'password_confirmation'=>'required|max:255|same:password',\n 'status'=>'required',\n 'local'=>'required',\n 'code'=>'required',\n ];\n }", "public function rules()\n {\n return Usuario::$createRules;\n }", "public function rules(): array\n {\n return [\n 'name' => [\n 'required',\n 'string',\n 'min:3',\n 'max:255',\n Rule::unique('users', 'name')->ignore($this->route('user') ? $this->route('user')->id : null)\n ],\n 'email' => [\n 'required',\n 'email',\n 'max:255',\n Rule::unique('users', 'email')->ignore($this->route('user') ? $this->route('user')->id : null)\n ],\n 'roles' => 'array',\n 'roles.*' => 'array',\n 'roles.*.*' => 'exists:roles,name',\n ];\n }", "abstract public function getValidationRules(): array;", "public function rules()\n\t{\n\t\t// Get current model id if exists\n\t\t// TODO: replace getting id from model to accurate method\n\t\t$user_id = isset($this->users->id) ? $this->users->id : '';\n\n\t\treturn [\n\t\t\t'name' => ['required', 'min:3'],\n\t\t\t'email' => ['required', 'email', \"unique:users,email,{$user_id}\"],\n\t\t\t'role_id' => ['required', 'numeric'],\n\t\t];\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'email' => 'required|email',\n ];\n\n if($this->register_using == UserAccountProvider::SSO_PROVIDER){\n $rules = array_merge($rules, [\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|same:password|min:8',\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n $data = array();\n\n $data['username'] = 'required';\n $data['password'] = 'required';\n $data['password_confirmation'] = 'required';\n $data['email'] = 'required|email|unique:users,email';\n $data['firstname'] = 'required';\n $data['lastname'] = 'required';\n\n $data['status'] = 'required';\n\n\n return $data;\n }", "public static function validateUser()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "abstract protected function getValidationRules();", "public function rules()\n {\n return [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'phone' => 'required',\n 'email' => ['required', Rule::unique('users')->ignore($this->user_id)],\n 'area_id' => 'required|int',\n 'region_id' => 'required|int',\n 'school_id' => 'required|int',\n 'language_id' => 'required|int',\n 'class_id' => 'required|int',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules(){\n $user_id = Auth::user()->id;\n return [\n 'first_name' => 'required|string',\n 'last_name' => 'required|string',\n 'slug' => ['required', 'string', 'max:64', 'min:6', Rule::unique('users')->ignore($user_id)],\n 'gender' => 'required|numeric',\n 'profile' => 'image',\n 'msc' => 'required|string|max:16',\n 'fields' => 'required|string|min:5',\n 'start_year' => 'required|numeric',\n 'email' => 'nullable|email',\n ];\n }", "protected function validateCreating()\r\n {\r\n $rules = config('taki.validator.create', []);\r\n\r\n if (config('taki.username.required') && !array_get($rules, config('taki.field.username'))) {\r\n $rules[config('taki.field.username')] = config('taki.username.validator', 'required');\r\n }\r\n\r\n return $rules;\r\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n /** @var User $user */\n $user = $this->findFromUrl('user');\n\n return [\n 'person' => 'nullable|finds:person',\n 'name' => [\n 'sometimes',\n 'required',\n 'string',\n 'max:255',\n Rule::unique('users')->ignore($user->id)\n ],\n 'email' => [\n 'sometimes',\n 'required',\n 'email',\n 'max:255',\n Rule::unique('users')->ignore($user->id)\n ],\n 'password' => 'sometimes|required|string|min:8',\n ];\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n /*$custom = \\DB::table('custom_fields')->select('id', 'name', 'required')->get()->toArray();\n $customRules = [];\n\n foreach ($custom as $item) {\n $customRules['custom_fields_data.'.$item->name.'_'.$item->id] = ($item->required == 'yes') ? 'required' : '';\n }*/\n\n $mainRules = [\n 'email' => 'required|email|unique:users',\n 'password' => 'required',\n 'name' => 'required'\n ];\n\n return $mainRules;\n }", "public function getCreateRules()\n {\n return [];\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function rules()\n {\n $user = $this->route('id');\n\n return [\n 'name' => 'required|string|max:255|regex:/^[ a-zA-ZÀ-ÿ\\u00f1\\u00d1]*$/',\n 'surname' => 'required|string|max:255|regex:/^[ a-zA-ZÀ-ÿ\\u00f1\\u00d1]*$/',\n 'gender' => 'required|string|max:1',\n 'address' => 'required|string|max:255',\n 'city' => 'required|string|max:255',\n 'between_streets' => 'nullable|string|max:255',\n 'phone' => 'nullable|numeric|digits_between:8,15',\n 'cel' => 'required|numeric|digits_between:8,15',\n 'school' => 'required|string|max:255',\n 'grade' => 'required|numeric|between:2,7|regex:/^[0-9]*$/',\n 'dni' => ['digits:8', 'regex:/^[0-9]*$/', Rule::unique('users')->ignore($user)],\n 'email' => ['email', 'max:255', Rule::unique('users')->ignore($user)],\n 'birthdate' => 'required|date|date_format:Y-m-d',\n ];\n }", "public function rules()\n {\n $rules = [];\n\n // $rules['first_name'] = [ 'required' ];\n // if(\\Request::get('id') != NULL) {\n // if(\\Request::get('password') != '') {\n // $rules['password'] = [ 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'same:password' ];\n // }\n // } else {\n // $rules['password'] = [ 'required', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'required', 'same:password' ];\n // }\n // $rules['email'] = [ 'required', \n // 'email', \n // Rule::unique('users')->where(function ($query) {\n // $query = $query->where('id', '!=', \\Request::get('id'));\n // return $query;\n // }) \n // ];\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|max:10|min:10',\n 'email' => 'required',\n 'birth' => 'required',\n 'address' => 'required',\n 'username' => 'required|min:6|max:24|unique:users,username,NULL,id,deleted_at,NULL',\n 'password' => 'required|min:6|confirmed'\n ];\n\n return $rules;\n }", "public function rules(): array\n {\n return [\n 'user_id' => 'required|integer|exists:users,id',\n 'locale' => [\n 'required',\n 'string',\n Rule::in(config('lang-detector.languages')),\n ],\n ];\n }", "public function rules()\n {\n return [\n 'last_name' => 'required',\n 'first_name' => 'required',\n 'email' => [\n 'email',\n Rule::unique('users', 'email')->where(function ($query) {\n return $query->where('organization_id', $this->route('organization')->id);\n })->ignore($this->user)\n ],\n 'coherence_organization_user' => new CheckOrganizationDomain($this->route('organization')->id, $this->route('user')->id),\n 'role_id' => 'required|in:EMPLOYEE,ADMIN',\n 'user_state_id' => 'required|exists:user_states,id'\n ];\n }", "protected function rules(): array\n {\n return [\n 'name' => ['required', 'string'],\n 'email' => [\n 'required',\n 'email:rfc,dns',\n 'unique:users,email'\n ],\n 'role' => [\n 'required',\n 'exists:roles,name'\n ],\n 'password' => [\n 'required',\n 'confirmed',\n 'min:8',\n 'regex:/[a-z]/', // must contain at least one lowercase letter\n 'regex:/[A-Z]/', // must contain at least one uppercase letter\n 'regex:/[0-9]/', // must contain at least one digit\n 'regex:/[@$!%*#?&]/' // must contain at least one caracter Especial\n ],\n\n ];\n }", "public function rules()\n {\n if($this->get('userid')){\n return [\n 'usertype' => 'required',\n 'email' => 'required|email|unique:users,email,'.$this->get('userid'),\n 'password' => 'confirmed',\n 'name' => 'required'\n \n ];\n }else{\n return [\n 'usertype' => 'required',\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required',\n 'name' => 'required'\n ];\n }\n }", "public function validationRules()\n {\n return [];\n }", "public function rules(): array\n {\n return [\n 'name' => ['string', 'max:255'],\n 'email' => ['email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],\n ];\n }", "public function profileRules()\n {\n return [\n [['username', 'password', 'email'], 'required', 'on' => self::SCENARIO_CREATE],\n\n ['username', 'match', 'pattern' => '/^[A-Za-z][A-Za-z0-9\\-\\.\\ ]+$/i',\n 'message' => Yii::t($this->tcModule, 'Only latin letters, digits, hyphen, points and blanks begin with letter')\n ],\n ['username', 'string', 'min' => $this->minUsernameLength, 'max' => $this->maxUsernameLength],\n\n ['password', 'string', 'min' => $this->minPasswordLength, 'max' => $this->maxPasswordLength],\n\n ['email', 'string', 'max' => 255],\n ['email', 'email'],\n ];\n }", "private function storeRules()\n {\n return [\n 'data.type' => 'required|in:events',\n 'data.attributes.name' => 'required|max:50|min:5',\n 'data.attributes.description' => 'required|max:255',\n 'data.attributes.date' => 'required|date',\n 'data.relationships.users' => 'required_with:data.relationships',\n 'data.relationships.users.data.*.type' => 'required_with:data.relationships|in:users',\n 'data.relationships.users.data.*.id' => 'required_with:data.relationships|numeric'\n ];\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'user_type' => 'required|string',\n ];\n if ($this->method() == 'PUT') {\n $rules['email'] = 'required|string|email|max:255|unique:users,email,' . $this->route()->parameter('user');\n $rules['password'] = 'sometimes|string|' .config('rules.password');\n } else {\n $rules['email'] = 'required|string|email|max:255|unique:users';\n $rules['password'] = 'required|string|' .config('rules.password');\n }\n\n return $rules;\n }", "public function rules() {\n $rules = [\n 'name' => 'required|string|min:1|max:255',\n 'email' => ['required'],\n 'password' => 'required|string|min:1|max:255|required_with:password2|same:password2',\n 'password2' => 'required|string|min:1|max:255',\n ];\n \n if ($this->route()->getAction()['as'] == 'users.user.store')\n array_push($rules['email'], 'unique:users');\n\n return $rules;\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "protected function validationRules() : array\n {\n return [\n 'email' => 'required',\n 'status' => 'reqired | in: 0,1,2,3' \n ];\n }", "public function rules()\n {\n $user = $this->user();\n return [\n 'full_name' => 'max:255',\n 'email' => 'email|unique:users,email,' . $user->id,\n ];\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules(): array\n {\n return [\n 'country_id' => ['required', 'integer', Rule::exists(Country::class, 'id')],\n 'first_name' => 'required|string|min:1|max:100',\n 'last_name' => 'required|string|min:1|max:100',\n 'hourly_rate' => 'required|numeric',\n 'language_id' => ['required', 'integer', Rule::exists(Language::class, 'id')],\n 'language_grade_id' => ['required', 'integer', Rule::exists(LanguageGrade::class, 'id')],\n 'subject_taught_id' => ['required', 'integer', Rule::exists(Specialty::class, 'id')],\n ];\n }", "public function rules()\n {\n return [\n 'name' => '',\n 'email' => 'email',\n 'given_name' => '',\n 'family_name' => '',\n 'birthday' => 'date',\n 'gender' => 'in:'.implode(',', User::GENDERS),\n ];\n }", "public function rules()\n {\n // dd($this->all());\n return [\n 'name' => 'required|max:100',\n 'password' => 'required|min:8|max:100',\n 'email' =>\"required|email|unique:users,email\",\n 'address' => 'required',\n 'role' => 'required|in:'.implode(',', config('common.user.role')),\n 'gender' => 'required|in:'.implode(',', config('common.user.role')),\n \n ];\n }", "public function rules()\n {\n return [\n\n 'name' => ['required', Rule::unique('users', 'name')->ignore($this->dataId)],\n 'email' => ['required', Rule::unique('users', 'email')->ignore($this->dataId)],\n 'username' => ['required', Rule::unique('users', 'username')->ignore($this->dataId)],\n 'password' => ['required', Rule::unique('users', 'password')->ignore($this->dataId)],\n 'level' => ['required'],\n\n ];\n }", "public function getValidationRules(): array\n {\n if ($this->validatorForEach) {\n return [\n new ParameterValidationRule(Validator::callback(function ($value) {\n $items = UnpackCSV::un($value, $this->separator);\n return Validator::each($this->validatorForEach->getValidator())->validate($items);\n }), $this->validatorForEach->getDescription())\n ];\n } else {\n return [];\n }\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "private function getRules()\n {\n return array(\n 'name' => new Pattern\\Name,\n 'height' => new Pattern\\Height,\n 'lat' => array(\n 'required' => true,\n 'rules' => array('Latitude')\n ),\n 'lng' => array(\n 'required' => true,\n 'rules' => array('Longitude')\n ),\n 'api_key' => array(\n 'required' => true,\n 'rules' => array(\n 'NotEmpty' => array(\n 'message' => 'Google API key can not be empty'\n )\n )\n ),\n 'style' => array(\n 'required' => false,\n 'rules' => array('Json')\n )\n );\n }", "public function rules(): array\n {\n return [\n 'email' => ['required', 'max:60', 'min:6', 'email', 'unique:users,email'],\n 'name' => ['required', 'string', 'max:60', 'min:2'],\n 'password' => ['required', 'min:6'],\n 'password_confirmation' => ['required', 'same:password'],\n 'terms' => ['accepted'],\n ];\n }", "public function rules()\n {\n return [\n 'name' => ['required', 'string', 'max:255', new UserName],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],\n 'password' => ['required', 'string', 'min:8'],\n 'password_confirm' => ['required', 'string', 'same:password'],\n ];\n }", "public function rules()\n {\n\n $users = config('auth.providers.users.model', \\App\\Models\\User::class);\n\n return [\n 'email' => \"required|email|unique:{$users},email\",\n 'password' => 'required',\n 'name' => 'required',\n ];\n\n }", "public function rules()\n {\n $rules = [\n 'name' => ['nullable', 'min:3', 'string', 'max:100'],\n 'email' => ['sometimes', 'email:rfc', 'min:8'],\n 'current_password' => ['sometimes', 'nullable', 'min:8', new MatchOldPassword],\n 'new_password' => ['sometimes', 'nullable', 'min:8'],\n 'confirm_new_password' => ['sometimes', 'same:new_password']\n ];\n\n return $rules;\n }", "public function getRules()\n {\n // Set the validation rules.\n $rules = [\n 'party_id' => 'integer|required|exists:pgsql.core.parties,id',\n 'bank_id' => 'integer|required|exists:pgsql.core.banks,id',\n 'currency_id' => 'integer|required|exists:pgsql.core.currencies,id',\n 'first_name' => 'string|required|max:50',\n 'last_name' => 'string|required|max:50',\n 'last_name' => 'string|nullable|max:255',\n 'type' => 'string|nullable|in:savings,current',\n 'class' => 'string|nullable|in:personal,business',\n ];\n\n // Add the account number check if it's a new record.\n if (!$this->exists) {\n $rules['account_number'] = 'string|required|max:100|unique:pgsql.core.bank_accounts,account_number,NULL,id,bank_id,' . $this->bank_id;\n }\n\n return $rules;\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $rules = array();\n $rules['user_id'] = ['required'] ;\n $rules['value'] = ['required','numeric'] ;\n $rules['date'] = ['required',new GiftCartRule()] ;\n\n return $rules;\n }", "public function rules(): array\n {\n\n return [\n 'name' => 'string|max:30',\n 'last_name' => 'nullable|alpha|max:50',\n 'email' => 'email|unique:users,email,' . $this->user,\n 'password' => 'nullable|min:6|confirmed',\n ];\n\n }", "public function rules()\n {\n $user = $this->user();\n\n return [\n 'oldEmail' => [\n 'required',\n 'email',\n function ($attribute, $value, $fail) use ($user) {\n if ($value !== $user->email) {\n $fail('Поле Старый email не совпадает.');\n }\n },\n ],\n 'newEmail' => [\n 'required',\n 'email',\n function ($attribute, $value, $fail) use ($user) {\n if ($value === $user->email) {\n $fail('Поле Новый email совпадает со старым значением.');\n }\n },\n 'min:8',\n 'unique:users,email',\n ],\n 'newEmailConfirmation' => ['required', 'email', 'same:newEmail'],\n ];\n }", "public function rules(): array\n {\n return [\n 'id' => 'required|integer',\n 'name' => 'required|string',\n 'surname' => 'required|string',\n 'email' => 'required|email',\n 'country' => 'required|string|in:'.implode(',', CountryCode::names()),\n 'createAt' => 'required|date_format:Y-m-d',\n 'activateAt' => 'required|date_format:Y-m-d',\n 'chargerId' => 'required|integer',\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|min:3|max:30|regex:/^\\S*$/|unique:'.config('core.acl.users_table').',username,NULL,id,deleted_at,NULL',\n 'firstname' => 'required|max:20',\n 'lastname' => 'required|max:20',\n 'email' => 'required|email|unique:'.config('core.acl.users_table').',email,NULL,id,deleted_at,NULL',\n 'department' => 'required|exists:'.config('core.acl.departments_table').',name',\n 'role' => 'required|exists:'.config('core.acl.roles_table').',name',\n 'emp_id' => 'required|unique:'. config('core.acl.users_table').',emp_id,NULL,id,deleted_at,NULL',\n ];\n }", "public function rules()\n {\n $userid = $this->route('user');\n $id = $userid ? $userid : \"NULL\";\n return [\n 'name' => \"required|max:255,$id\",\n 'email' => \"required|max:255|unique:users,email,$id\",\n 'roles' => \"required|array\",\n 'roles.*' => 'exists:roles,id',\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'email' => 'required|unique:users,email,' . $this->id,\n 'password' => 'between:5,30',\n 'password_confirmation' => 'required_with:password|same:password',\n 'status' => 'required|in:' . implode(',', config('protecms.users.status')),\n 'type' => 'required|in:' . implode(',', config('protecms.users.type'))\n ];\n }", "protected function validationRules(): array\n {\n return [\n 'publicId' => 'required',\n 'paymentType' => 'required|numeric|between:1,8',\n 'payments' => 'required'\n ];\n }" ]
[ "0.7948727", "0.7761068", "0.77152175", "0.769027", "0.7687657", "0.7672366", "0.7622043", "0.7593619", "0.7588799", "0.75867254", "0.75812423", "0.7579031", "0.75735277", "0.75734174", "0.75645924", "0.75628144", "0.7544675", "0.7525245", "0.7519711", "0.74977756", "0.7474989", "0.74574715", "0.7452807", "0.74352545", "0.7419116", "0.7410345", "0.7409225", "0.73853475", "0.73826367", "0.7381773", "0.73794556", "0.7377772", "0.7374645", "0.7372834", "0.73727834", "0.7371766", "0.7368389", "0.73680687", "0.7365229", "0.7358262", "0.7355856", "0.73556715", "0.73544216", "0.7354374", "0.73432595", "0.7339598", "0.7334725", "0.73220634", "0.7314499", "0.73121905", "0.73107606", "0.7309267", "0.73079604", "0.7304063", "0.72927517", "0.7291936", "0.72913116", "0.7286993", "0.7275858", "0.7272778", "0.7271721", "0.7270538", "0.7269028", "0.7266404", "0.7251594", "0.7241599", "0.7231636", "0.72258365", "0.72243536", "0.72231185", "0.7220918", "0.7215325", "0.7213758", "0.7211383", "0.7208577", "0.7204892", "0.71996117", "0.7195277", "0.7194783", "0.7187365", "0.718612", "0.71802557", "0.717544", "0.71704227", "0.71702427", "0.71644175", "0.71616393", "0.71611834", "0.7160685", "0.71598285", "0.7158125", "0.7156642", "0.71542364", "0.71531594", "0.7151754", "0.7151276", "0.7148908", "0.7144257", "0.71426374", "0.7140709", "0.7140027" ]
0.0
-1
Get array of validation rules for user update
public static function getUpdateRules($id) { $_rules = self::$rules; $_rules['email'] = 'email|required|unique:users,email,'.(int)$id; return $_rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationRulesUpdate(): array;", "public function getValidationUpdateRules(): array\n {\n }", "public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}", "public function getUpdateRules()\n {\n return [\n \"id\" => \"required\"\n ];\n }", "protected function updateValidations()\n {\n switch (Input::get('form')) {\n\n case 'user-basic':\n $rules = [\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'description' => 'nullable|max:1200',\n ];\n break;\n case 'user-update':\n $rules = [\n 'username' => 'required|max:18|alpha_num',\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'email' => 'required|email|max:100',\n 'status' => 'required|integer',\n 'description' => 'nullable|max:1200',\n 'roles' => 'nullable|array',\n ];\n break;\n case 'password-update':\n $rules = [\n 'old_password' => 'required|alpha_dash|max:18',\n 'password' => 'required|alpha_dash|confirmed|different:old_password|max:18',\n 'password_confirmation' => 'required|alpha_dash|max:18',\n ];\n break;\n case 'avatar-update':\n $rules = [\n 'avatar' => 'required|image|max:1024',\n ];\n break;\n default:\n $rules = [];\n }\n return $rules;\n }", "private function updateRules()\n {\n return [\n 'data.type' => 'required|in:events',\n 'data.attributes.name' => 'max:30|min:5',\n 'data.attributes.description' => 'min:1|max:255',\n 'data.attributes.date' => 'date',\n 'data.relationships.users' => 'required_with:data.relationships',\n 'data.relationships.users.data.*.type' => 'required_with:data.relationships|in:users',\n 'data.relationships.users.data.*.id' => 'required_with:data.relationships|numeric'\n ];\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function updateRules(): array\n {\n return [\n 'Universidad' => 'required|string|min:2|max:20',\n 'carrera' => 'required|string|min:2|max:50',\n ];\n }", "public function rules()\n {\n $new_user = $this->route()->getName() != \"admin-users.update\";\n\n return [\n 'name' => 'required|max:50|min:2',\n 'email' => 'required' . ($new_user ? '|unique:users' : ''),\n 'password' => ($new_user ? 'required|' : '') . 'min:2'\n ];\n }", "public function rules()\n {\n $this->setModel(User::class);\n $rules = parent::rules();\n $is_two_factor_auth_enabled = \\TwoFactorAuth::isActive();\n\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191',\n 'last_name' => 'required|max:191',\n 'roles' => 'required',\n 'picture' => 'mimes:jpg,jpeg,png|max:' . maxUploadFileSize(),\n ]\n );\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email',\n 'password' => 'required|confirmed|max:191|min:6'\n ]\n );\n }\n\n if ($this->isUpdate()) {\n $user = $this->route('user');\n\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email,' . $user->id,\n 'password' => 'nullable|confirmed|max:191|min:6'\n ]\n );\n if ($is_two_factor_auth_enabled) {\n $rules = array_merge($rules, TwoFactorAuth::registrationValidation($this->all()));\n }\n }\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required|min:6|confirmed',\n ];\n\n $method = $this->method();\n $route = $this->route(static::$PARAM_ID);\n if ($route) {\n $user_id = $route->id;\n switch ($method) {\n case 'PUT':\n $rules['email'] = \"{$rules['email']},$user_id\";\n break;\n case 'PATCH': {\n $rules['name'] = 'sometimes|max:255';\n $rules['email'] = \"{$rules['email']},$user_id\";\n $rules['password'] = 'sometimes|min:6|confirmed';\n break;\n }\n default: {\n break;\n }\n }\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n if ($this->input(\"_method\") == \"PUT\")\n return [\n \"first_name\" => \"required|min:5\",\n \"last_name\" => \"required|min:5\",\n \"update_email\" => \"required|email|sometimes:unique:users\",\n \"password\" => \"sometimes|required|min:8\",\n \"password_verify\" => \"sometimes|required|same:password\"\n ];\n\n return [\n \"first_name\" => \"required|min:4\",\n \"last_name\" => \"required|min:4\",\n \"email\" => \"required|email|unique:users\",\n \"password\" => \"sometimes|required|min:8\",\n \"password_verify\" => \"sometimes|required|same:password\"\n ];\n\n }", "public function getValidationRules()\n {\n return [];\n }", "public function rules()\n {\n $called_function = Route::getCurrentRoute()->getActionMethod();\n\n $rules = array();\n\n if($called_function == 'store')\n {\n $rules = [\n 'username' => 'required|unique:users,username',\n 'password' => 'required',\n 'role' => 'required',\n ];\n }\n\n if($called_function == 'update')\n {\n $rules = [\n 'username' => 'required',\n 'role' => 'required',\n ];\n }\n\n return $rules;\n }", "public function validationUpdate()\n\t{\n\t\t$validationUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$validationUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t);\n\t\t}\n\t\treturn $validationUpdate;\n\t}", "public function rules(): array\n {\n $rules = [\n 'name' => 'required|unique:hr_roles,name,NULL,name,deleted_at,NULL|max:10',\n 'staff' => 'array',\n 'brand' => 'array',\n 'department' => 'array',\n ];\n if ($this->getMethod() === 'PATCH') {\n $rules = array_merge($rules, [\n 'name' => [\n 'required',\n unique_validator('hr_roles'),\n ],\n ]);\n }\n\n return $rules;\n }", "public function rules(): array\n {\n\n switch($this->method()) {\n // CREATE\n case 'POST':\n {\n return [\n 'email' => 'required|string|email|max:255',\n 'display_name' => 'required',\n 'username' => 'required',\n 'mobile' => 'required',\n 'address' => 'required'\n ];\n }\n // UPDATE\n case 'PUT':\n case 'PATCH':\n {\n\n $rules = [\n 'email' => 'required|string|email|max:255|unique:users,id'.$this->id,\n 'password' => 'confirmed',\n 'display_name' => 'required',\n 'username' => 'required',\n 'mobile' => 'required',\n 'address' => 'required',\n 'upload_id_proof' => 'file'\n ];\n\n if($this->input('role_id') == '2') {\n $rules = [\n 'id_proof' => 'required'\n ];\n }\n\n if($this->input('role_id') == '3') {\n $rules = [\n 'nursing_home_series' => 'required'\n ];\n }\n\n return $rules;\n\n }\n case 'GET':\n case 'DELETE':\n default:\n {\n return [];\n };\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'user_type' => 'required|string',\n ];\n if ($this->method() == 'PUT') {\n $rules['email'] = 'required|string|email|max:255|unique:users,email,' . $this->route()->parameter('user');\n $rules['password'] = 'sometimes|string|' .config('rules.password');\n } else {\n $rules['email'] = 'required|string|email|max:255|unique:users';\n $rules['password'] = 'required|string|' .config('rules.password');\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'email' => 'required|unique:users',\n 'password' => 'required|min:8',\n ];\n\n if ($this->method() === 'PUT') {\n $rules['email'] = 'required|unique:users,id,'.$this->id;\n $rules['password'] = 'min:8';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function getValidationRules() : array;", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'PUT':\n $rules = [\n 'email'=> 'required|unique:users,id,:id\\'',\n 'password'=>'required|min:3',\n 'name'=>'required',\n\n ];\n break;\n\n default:\n $rules = [\n 'email'=> 'required|unique:users',\n 'password'=>'required|min:3',\n 'name'=>'required',\n ];\n break;\n }\n\n return $rules;\n }", "public function rules()\n {\n $user = $this->user();\n\n return [\n 'oldEmail' => [\n 'required',\n 'email',\n function ($attribute, $value, $fail) use ($user) {\n if ($value !== $user->email) {\n $fail('Поле Старый email не совпадает.');\n }\n },\n ],\n 'newEmail' => [\n 'required',\n 'email',\n function ($attribute, $value, $fail) use ($user) {\n if ($value === $user->email) {\n $fail('Поле Новый email совпадает со старым значением.');\n }\n },\n 'min:8',\n 'unique:users,email',\n ],\n 'newEmailConfirmation' => ['required', 'email', 'same:newEmail'],\n ];\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'username' => ['required', 'alpha_num', 'min:3', 'max:30', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'email' => ['required', 'email', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'password' => ['required', 'min:5', 'max:20', 'confirmed'],\n ];\n\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $rules['password'] = ['sometimes', 'min:5', 'max:20', 'confirmed'];\n }\n\n return $rules;\n }", "public function rules()\n {\n switch ($this->method())\n {\n case 'POST':\n return [\n 'username' => 'required|unique:admins',\n 'nickname' => 'required|unique:admins',\n 'password' => 'required|between:6,20',\n 'repass' => 'required|same:password',\n 'role' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|unique:admins,username,' . $this->route('admin')->id,\n 'nickname' => 'required|unique:admins,nickname,' . $this->route('admin')->id,\n 'role' => 'required',\n ];\n case 'PATCH':\n return [\n 'oldpass' => 'required',\n 'newpass' => 'required|between:6,20',\n 'repass' => 'required|same:newpass',\n ];\n default:\n return [];\n }\n }", "protected function updateRules(): array\n {\n return [];\n }", "public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "private function validationRules()\n {\n return [\n 'newPassword' => [\n new PasswordRule($this->newPasswordConfirmation),\n ],\n 'currentPassword' => [\n 'required',\n new PasswordCheckRule($this->user),\n ],\n ];\n }", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "protected function rules(): array\n {\n return array_merge(\n $this->extraFieldsRules(User::getModel()),\n $this->nameRules(),\n $this->emailRules(),\n );\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $request = Request::all();\n switch ($this->method()) {\n case 'POST': //create\n if (Request::has('id')) { //更新\n return [\n 'title' => 'bail|required|string|max:30',\n 'api' => 'nullable|unique:auth_rules,api,' . $request['id'] . '|string|max:200',\n 'pid' => 'required|array',\n ];\n } else {\n return [\n 'title' => 'bail|required|string|max:30',\n 'api' => 'nullable|unique:auth_rules|string|max:200',\n 'pid' => 'required|array',\n ];\n }\n case 'GET':\n default:\n {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'update':\n $user = $this->route('user');\n return [\n 'full_name' => 'nullable|string',\n 'birth_at' => 'nullable|date',\n 'country_code' => 'nullable|exists:currencies,country_code',\n 'email' => [\n 'nullable',\n 'email',\n Rule::unique('user_info')->where(function ($query) {\n return $query->where('is_agent', false);\n })->ignore($user->id, 'user_id'),\n ],\n 'phone' => [\n 'nullable',\n 'integer',\n Rule::unique('user_info')->where(function ($query) {\n return $query->where('is_agent', false);\n })->ignore($user->id, 'user_id'),\n ],\n 'gender' => 'nullable|string|in:male,female',\n 'risk_group_id' => 'nullable|exists:risk_groups,id',\n 'payment_group_id' => 'nullable|exists:payment_groups,id',\n 'vip_id' => 'nullable|exists:vips,id',\n 'reward_id' => 'nullable|exists:rewards,id',\n 'language' => 'nullable|exists:languages,code'\n ];\n break;\n case 'resetPassword':\n return [\n 'type' => 'required|in:manual,auto',\n 'new_password' => 'required_if:type,manual|nullable|string',\n ];\n break;\n case 'updateStatus':\n return [\n 'status' => 'required|integer|in:' . implode(',', array_keys(User::$statuses)),\n 'remark' => 'required|string'\n ];\n break;\n case 'updateRiskGroup':\n return [\n 'risk_group_id' => 'required|exists:risk_groups,id',\n 'remark' => 'required|string|max:1024',\n ];\n break;\n case 'updatePaymentGroup':\n return [\n 'payment_group_id' => 'required|exists:payment_groups,id',\n 'remark' => 'required|string|max:1024',\n ];\n break;\n case 'updateGameWalletStatus':\n return [\n 'status' => 'required|boolean',\n ];\n break;\n case 'updateReward':\n return [\n 'reward_id' => 'required|exists:rewards,id',\n 'remark' => 'required|string|max:1024',\n ];\n break;\n case 'resetSecurityQuestion':\n return [\n 'remark' => 'required|string|max:1024',\n ];\n break;\n case 'showUserByName':\n return [\n 'user_name' => 'required|exists:users,name',\n ];\n break;\n case 'claimVerifyPrize':\n return [\n 'platform_code' => 'required|exists:game_platforms,code',\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n return array_merge(config('roles.validation_rules.update'), [\n 'name' => 'required|string|max:20|unique:roles,name,'.$this->route('role')->id\n ]);\n }", "public function rules()\r\n {\r\n \r\n $validation = [\r\n \"name\" => \"required|min:4|max:50\",\r\n \"email\" => \"required|email|unique:users,email\",\r\n \"password\" =>\r\n 'required|confirmed|min:8',\r\n \"phone\" => 'required|min:10|numeric',\r\n \"qualification\" => \"required\",\r\n \"blood_group\" => \"required\",\r\n\r\n ];\r\n\r\n if ($this->isMethod(\"put\")) {\r\n $validation = [\r\n \"name\" => \"required|alpha_num|min:4|max:50\",\r\n \"password\" =>\r\n 'nullable|confirmed|min:8',\r\n 'phone' => 'required|min:10|numeric', \r\n \"qualification\" => \"required\",\r\n \"blood_group\" => \"required\", \r\n ];\r\n }\r\n\r\n return $validation;\r\n }", "public function rules()\n {\n return [\n 'name_update' => 'required',\n 'phone_update' => [\n 'required',\n Rule::unique('users','phone')->ignore(Auth::user()->id),\n ],\n 'address_update' => 'required',\n 'issue_number_update' => [\n 'required',\n Rule::unique('users','issue_number')->ignore(Auth::user()->id),\n ],\n ];\n }", "protected function validationRules() : array\n {\n return [];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function getPivotUpdateRules() : array\n {\n return $this->getFields()\n ->mapWithKeys(function (Field $field) {\n return [$field->getName() => $field->getUpdateRules()];\n })\n ->toArray();\n }", "protected function validationRules() : array\n {\n return [\n 'email' => 'required',\n 'status' => 'reqired | in: 0,1,2,3' \n ];\n }", "abstract public function getValidationRules(): array;", "public function rules()\n {\n\n if (Input::get('user-type') == 'user'){\n\n if (!empty(Input::get('idEdit'))){\n $rules = [\n 'username' => 'required|unique:user,username',\n 'user-type' => 'required|in:user,admin',\n ];\n }else{\n $rules = [\n 'username' => 'required|unique:user,username',\n 'password' => 'required|min:5|max:16',\n 'user-type' => 'required|in:user,admin',\n ];\n }\n\n }else{\n if(!empty(Input::get('idEdit'))){\n $rules = [\n 'username' => 'required|unique:admin,username',\n 'user-type' => 'required|in:user,admin',\n ];\n }else{\n $rules = [\n 'username' => 'required|unique:admin,username',\n 'password' => 'required|min:5|max:16',\n 'user-type' => 'required|in:user,admin',\n ];\n }\n\n }\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case \"POST\":\n return [\n 'name' => 'required',\n 'password' => 'required',\n 'phone' => 'unique:users'\n ];\n break;\n case \"PATCH\":\n return [\n 'password' => 'required',\n 'comfirmPassword' => 'required|same:password',\n ];\n break;\n }\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function getValidationRules(): array\n {\n if ($this->validatorForEach) {\n return [\n new ParameterValidationRule(Validator::callback(function ($value) {\n $items = UnpackCSV::un($value, $this->separator);\n return Validator::each($this->validatorForEach->getValidator())->validate($items);\n }), $this->validatorForEach->getDescription())\n ];\n } else {\n return [];\n }\n }", "public function rules(): array\n {\n return [\n 'oldPassword' => ['required', 'string'],\n 'newPassword' => [\n 'required',\n 'string',\n 'min:8',\n new ContainsNumeral(),\n new ContainsLowercase(),\n new ContainsUppercase(),\n ],\n ];\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "abstract protected function getValidationRules();", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n // Get user id from route\n $id = $this->route('user');\n\n return [\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users,email,'.$id,\n 'role' => 'required',\n ];\n }", "public function rules() {\n//\t\trequired_with:password_confirmation|\n\n\n\t\t$rules = [\n\t\t\t//\n\t\t\t\"name\" => 'required',\n\n\t\t\t'password' => 'min:6|required|same:password_confirmation',\n\t\t\t'password_confirmation' => 'min:6',\n\t\t\t\"email\" => 'required|email|unique:admins',\n\n\t\t];\n\t\tif ($this->isMethod('put')) {\n\n\t\t\tunset($rules['email']);\n\t\t}\n\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n $userId = $this->input('userID');\n $email_validation = 'required|email|unique:users,email';\n if (isset($userId))\n $email_validation = 'required|email|unique:users,email,' . $userId;\n\n return [\n 'user.email' => $email_validation,\n 'user.name' => 'required|min:3',\n 'phone' => 'required|min:3',\n 'address' => 'required|min:3',\n 'city' => 'required',\n 'state' => 'required',\n 'zipcode' => 'required',\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules(): array\n {\n $rules = [];\n switch ($this->getPathInfo()){\n case '/user_friend_apply/store':\n $rules['chat_no'] = 'required|exists:users';\n break;\n case '/user_friend_apply/handle':\n $rules['id'] = 'required|exists:user_friend_applies';\n $rules['status'] = 'required|in:'.UserFriendApply::STATUS_REFUSE.','.UserFriendApply::STATUS_PASS;\n break;\n }\n return $rules;\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules(): array\n {\n $rules = User::$standard_rules;\n $rules['email'][] = Rule::unique((new User)->getTable())->ignore(auth()->id());\n\n return $rules;\n }", "public function rules() {\n $method = strtolower($this->method()) . 'Rules';\n if (method_exists($this, $method)) {\n return $this->{$method}();\n }\n\n return [\n 'email' => 'required|email|max:255|min:2|unique:users',\n 'name' => 'required|max:255|min:2',\n ];\n }", "public function rules()\n {\n $actionMethod = $this->route()->getActionMethod();\n\n if ( $actionMethod == 'store') return [\n 'item.email' => 'required|email|max:50',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num|max:50',\n 'item.last_name' => 'required|alpha_num|max:50',\n 'item.password' => 'required|between:3,50',\n 'password_confirm' => 'same:item.password'\n ];\n\n if( $actionMethod == 'update' ) return [\n 'item.email' => 'required|email',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num',\n 'item.last_name' => 'required|alpha_num',\n 'password_confirm' => 'same:item.password'\n ];\n\n return [];\n }", "public function rules(): array\n {\n return [\n 'user_id' => 'required|integer|exists:users,id',\n 'locale' => [\n 'required',\n 'string',\n Rule::in(config('lang-detector.languages')),\n ],\n ];\n }", "public function rules()\n {\n $id = $this->route('id');\n if (!empty($id)) {\n // 新增\n return [\n 'name' => 'required|unique:www_user,name,' . $id,\n 'nick_name' => 'required|unique:www_user,nick_name,' . $id,\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'telephone' => 'required|phone_number',\n // 'role_id' => 'required|numeric|min:1',\n ];\n } else {\n //更新\n return [\n 'name' => 'required|unique:www_user',\n 'nick_name' => 'required|unique:www_user',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'telephone' => 'required|phone_number',\n // 'role_id' => 'required|numeric|min:1',\n ];\n }\n\n }", "public function rules()\n\t{\n\t\t// Get current model id if exists\n\t\t// TODO: replace getting id from model to accurate method\n\t\t$user_id = isset($this->users->id) ? $this->users->id : '';\n\n\t\treturn [\n\t\t\t'name' => ['required', 'min:3'],\n\t\t\t'email' => ['required', 'email', \"unique:users,email,{$user_id}\"],\n\t\t\t'role_id' => ['required', 'numeric'],\n\t\t];\n\t}", "public function rules()\n {\n switch ($this->method()) {\n // Hander Post \n case 'POST':\n return [\n 'name'=>'required',\n 'email'=>'required|email|unique:user,email',\n 'password'=>'required',\n 'Ag_password'=>'same:password',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'image'=>'image|mimes:jpeg,png,gif|max:7000',\n 'birth_day'=>'date|before:today'\n ];\n break;\n // Hander Put \n case 'PUT':\n return [\n 'email'=>'required|email|unique:user,email,'.$this->id,\n 'name'=>'required',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'birth_day'=>'date|before:today',\n 'repPassword'=>'same:newPassword',\n 'oldPassword'=> new checkPasswordUpdate()\n ];\n break;\n }\n }", "protected function updateValidation()\n {\n return [\n 'todo_name' => ['required', 'string'],\n 'todo_description' => ['required', 'string']\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n 'avatar' => 'nullable|string',\n 'role_id' => [\n 'required',\n 'numeric',\n Rule::exists(config('permission.table_names.roles'), 'id')\n ]\n ];\n break;\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|string',\n 'email' => [\n 'required',\n 'email',\n Rule::unique('users')->ignore($this->segment(2)),\n ],\n 'password' => 'nullable|string|min:6|confirmed',\n 'avatar' => 'nullable|string',\n 'role_id' => [\n 'required',\n 'numeric',\n Rule::exists(config('permission.table_names.roles'), 'id')\n ]\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n $user = User::findOrFail($this->route('id'));\n\n return [\n 'name' => ['required', 'max:191'],\n 'email' => ['required', 'email', 'max:191', \"unique:users,email,{$user->id}\"],\n 'phone' => ['nullable', new Integer, 'digits_between:10,11'],\n 'role' => ['required', 'integer', 'min:1', 'exists:roles,id'],\n ];\n }", "public function rules()\r\n {\r\n switch ($this->method()) {\r\n case 'PUT':\r\n case 'PATCH':\r\n {\r\n return [\r\n 'post_code' =>['required'],\r\n 'building_name_no' => ['required',],\r\n 'street' => ['required',],\r\n 'town' => ['required',],\r\n 'first_name' => 'required',\r\n 'last_name' => 'required|regex:/^[a-zA-Z]+$/u|max:255',\r\n 'email' => 'required|email|unique:users',\r\n 'password' => ['required',],\r\n 'phone_number' => 'required',\r\n\r\n ];\r\n }\r\n default:\r\n break;\r\n }\r\n }", "protected function validationRules(): array\n {\n return [\n 'publicId' => 'required',\n 'paymentType' => 'required|numeric|between:1,8',\n 'payments' => 'required'\n ];\n }", "public function rules()\n {\n if ($this->isMethod('POST')) {\n return [\n 'email' => 'required|email|max:255|unique:users',\n 'current_password' => 'required|min:6',\n 'password' => 'required|confirmed|different:current_password|min:6',\n 'password_confirmation' => 'required|different:current_password|min:6|same:password'\n ];\n }\n return [];\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n\t{\n\t\treturn Answer::updateValidation($this);\n\t}", "public function rules() {\n $user = Auth::guard('client')->user();\n $rules = array(\n 'name' => \"required\",\n 'username' => \"required|unique:users,username,\" . $user->id,\n 'phone' => 'required|unique:users,phone,' . $user->id,\n 'email' => 'required|email|unique:users,email,' . $user->id,\n 'confirm_password' => 'same:password',\n );\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return array();\n }\n case 'POST': {\n\n return $rules;\n }\n case 'PUT': {\n return array(\n );\n }\n\n case 'PATCH': {\n //dd($this->id);\n return array(\n );\n }\n }\n }", "public function rules()\n {\n $rules = [\n 'email' => 'required|email|min:3|max:60|unique:usuarios,email',\n 'senha' => 'required|min:3|max:60',\n 'perfil_id' => 'required|integer',\n 'ativo' => 'required|boolean'\n ];\n\n if($this->method() == 'PATCH' || $this->method() == 'PUT'){\n $rules['email'] .= ',' . $this->id;\n\n if($this->senha === NULL) {\n unset($rules['senha']);\n }\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n $rules[ 'color' ] = 'required';\n $rules[ 'number' ] = 'required';\n $rules[ 'transmission' ] = 'required|numeric|gt:0';\n $rules[ 'model' ] = 'required|numeric|gt:0';\n $rules[ 'rent_price_per_day' ] = 'required';\n $rules[ 'year' ] = 'required';\n\n $data = $this->validationData();\n \n $method = $this->method();//POST || PUT\n\n //update -> PUT \n if ( $method === \"PUT\" )\n {\n if ( isset( $data[ 'fileuploader-list-file' ] ) && !empty( $data[ 'fileuploader-list-file' ] ) )\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n }\n } else\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n $rules[ 'fileuploader-list-file' ] = 'required';\n }\n\n return $rules;\n }", "public static function validationRulesNew()\n {\n return [\n 'name' => 'required|unique:faucets,name|min:5',\n 'url' => 'required|unique:faucets,url',\n 'interval_minutes' => 'required|integer',\n 'min_payout' => 'required|numeric',\n 'max_payout' => 'required|numeric',\n 'faucet_payment_processors[]' => 'each:exists,faucet_payment_processors, id',\n 'has_ref_program' => 'required|boolean',\n 'ref_payout_percent' => 'required|numeric|min:0',\n 'comments' => 'string',\n 'is_paused' => 'required|boolean',\n 'meta_title' => 'string|max:70',\n 'meta_description' => 'string|max:160',\n 'meta_keywords' => 'string|max:255'\n ];\n }", "public function rules(): array\n {\n $this->session()->flash('previous-route', 'change-password');\n\n return [\n 'old_password' => 'required',\n 'new_password' => 'required|confirmed|min:6',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "final public function rules(): array\n {\n return [\n 'name' => 'required|string|max:255',\n 'email' => 'required|email:rfc,dns|unique:users',\n 'cpf' => 'required|string|unique:users|max:15',\n 'password' => 'required|string|max:100',\n 'gender' => ['required', 'string', 'max:2', Rule::in('M', 'F', '')],\n 'phone' => 'required|string|max:255|unique:users',\n ];\n }", "public function rules()\n {\n $validate = [\n 'current_password' => [\n 'required',\n new MatchOldPassword\n ],\n 'new_password' => [\n 'required',\n 'min:6'\n ],\n 're_new_password' => [\n 'required',\n 'same:new_password'\n ],\n ];\n\n return $validate;\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules()\n { \n switch ($this->method()) {\n case 'POST': {\n return [\n 'name' => 'required|string|max:255',\n 'email' => 'string|email|max:255|unique:users',\n 'phone' => 'max:10',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'email' => 'sometimes:string|sometimes:email|max:255|unique:users,email,'.$this->user()->id,\n 'phone' => 'max:10|unique:users,phone,'.$this->user()->id,\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'desc' => 'max:255',\n 'color' => 'max:7',\n 'user_id' => 'numeric',\n 'users' => function ($attribute, $values, $parameters) {\n if($values == null) {\n return true;\n }\n if(! is_array($values)) {\n return false;\n }\n \n foreach($values as $v) {\n if(! is_numeric($v)) {\n return false;\n }\n }\n \n return true;\n },\n ];\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function validation_rules() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn $class::_object()->validates;\r\n }", "public function rules()\n {\n return [\n 'current_password' => ['required', new MatchOldPassword],\n 'new_password' => User::PASSWORD_RULES,\n 'new_confirm_password' => ['same:new_password'],\n ];\n }", "public function rules()\n {\n $rules = Prestacion::$updateRules;\n\n $rules['nombre'] = [\n 'string',\n Rule::unique('prestaciones')->ignore($this->prestacion),\n 'min:1',\n 'max:50'\n ];\n\n return $rules;\n }", "public function updateRules()\n {\n return [\n 'coordinates' => [\n Rule::requiredIf(fn() => request()->has('photo')),\n new Coordinate()\n ],\n ];\n }", "public function getValidationCreateRules(): array\n {\n }", "protected function validationRules() : array\n {\n return [\n 'paymentType' => 'required|in:2,4',\n 'publicId' => 'required',\n 'payments' => 'required'\n ];\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function rules()\n {\n return [\n 'userId' => 'required',\n 'fName' => 'required',\n 'lName' => 'required',\n 'email' => 'required|email|unique:users,email,'.$this->request->get('userId').'|max:255',\n 'password' => 'required|confirmed',\n 'mobile'=> 'required',\n 'address'=> 'required',\n 'zipCode'=> 'required',\n 'notificationSettings'=> 'required',\n ];\n }", "public function rulesUpdateMember()\n {\n\n return UserRule::rulesUpdateMember();\n }" ]
[ "0.8164922", "0.80660534", "0.8027275", "0.7848168", "0.76230127", "0.7619991", "0.7541504", "0.7518182", "0.7433294", "0.74296415", "0.7389195", "0.7309279", "0.7296824", "0.72919214", "0.72801805", "0.7195218", "0.7195099", "0.7185468", "0.716711", "0.7161601", "0.7116141", "0.7113908", "0.7107647", "0.70856386", "0.7080908", "0.7077229", "0.7075956", "0.7068429", "0.70662457", "0.7057743", "0.70432466", "0.7037138", "0.703617", "0.7033717", "0.70256346", "0.7010505", "0.70094085", "0.69946766", "0.69759476", "0.6964153", "0.6959812", "0.6958533", "0.6956736", "0.6947128", "0.69420886", "0.6928457", "0.69274807", "0.6917577", "0.6915192", "0.69116586", "0.6905504", "0.69038707", "0.69034666", "0.6897972", "0.68921393", "0.68915844", "0.6880602", "0.6879297", "0.68715364", "0.6866595", "0.6865823", "0.686301", "0.68587047", "0.68582684", "0.68538237", "0.68352854", "0.6834616", "0.682966", "0.6824579", "0.68220663", "0.68075055", "0.6794832", "0.6786262", "0.6785263", "0.67735714", "0.6772756", "0.6769576", "0.6762093", "0.6759351", "0.6756937", "0.6747688", "0.67453015", "0.6743506", "0.6740793", "0.6740365", "0.67400885", "0.673821", "0.673576", "0.67334396", "0.67316145", "0.6728742", "0.6726533", "0.67239726", "0.6715489", "0.6712395", "0.6707621", "0.67076033", "0.66924417", "0.668853", "0.6681332" ]
0.7335479
11
Password mutator Automatically encrypt password whenever user is created/updated
public function setPasswordAttribute($password) { $this->attributes['password'] = bcrypt($password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = encrypt($password);\n }", "public function setPasswordAttribute($old){\n $this->attributes['password'] = bcrypt($old);\n }", "public function setPassword($newPassword);", "protected function changePassword() {}", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n \n }", "public function setPassword(){\n\t}", "public function setPassword($value);", "public function setPasswordAttribute($value) {\n \t$this->attributes['password'] = Hash::make($value);\n\t}", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function setPasswordAttribute( $value ) {\n $this->attributes['password'] = Hash::make( $value );\n }", "public function setPassword($newPassword){\n\t}", "public function password()\n {\n }", "function update_password()\n {\n }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = bcrypt($value);\n }", "public function setPasswordAttribute($value)\n {\n \n $this->attributes['password'] = bcrypt($value);\n \n }", "public function testUpdatePasswordNotGiven(): void { }", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "public function getPassword() {}", "protected function password()\n {\n return 'password';\n }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = \\Hash::make($value);\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n }", "public function usePassword($password)\n {\n // CODE...\n }", "public function setPasswordAttribute($q){\n if(!empty($q)){\n $this->attributes['password']=bcrypt($q);\n }\n }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }", "public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = bcrypt($value);\n }", "public function setPasswordField($password = true) {}", "function twe_encrypt_password($plain) {\n\n $password=md5($plain);\n\n return $password;\n\n }", "public function savePasswordToUser($user, $password);", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }", "public function olvidoPassword(){\n\t}", "function encrypt_password(&$data) {\n $data['password'] = md5($data['password']);\n}", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "protected function beforeSave() {\n\t\tif (!empty($this->newPassword))\n\t\t\t$this->password = UtilHelper::encryptPwd($this->newPassword, $this->salt);\n\t\treturn true;\n\t}", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function changeUserPassword($uid,$newPassword);", "public function beforeSave() {\n if ($this->isNewRecord) {\n if (isset($this->passwordSave, $this->repeatPassword) && ($this->passwordSave === $this->repeatPassword)) {\n $this->password = $this->hash($this->passwordSave);\n }\n $this->password_expiry_date = new CDbExpression(\"DATE_ADD(NOW(), INTERVAL \" . self::PASSWORD_EXPIRY . \" DAY) \");\n } else\n if (isset($this->passwordSave) && isset($this->repeatPassword) && ($this->passwordSave === $this->repeatPassword)) {\n //if it's not a new password, save the password only if it not empty and the two passwords match\n $this->password = $this->hash($this->passwordSave);\n $this->password_expiry_date = new CDbExpression(\"DATE_ADD(NOW(), INTERVAL \" . self::PASSWORD_EXPIRY . \" DAY) \");\n }\n $this->password_strategy = $this->encrypt_text(strtolower($this->email));\n if (!in_array(Lookup::item('AccessRole', $this->default_role), Lookup::items('AccessRole'))) {\n $this->default_role = 'member';\n }\n $this->roles = $this->roles_encrypt();\n return parent::beforeSave();\n }", "function save() {\r\n if(strlen($this->password) != 40) {\r\n $this->password = sha1($this->password);\r\n }\r\n // Call the parent save() method.\r\n return parent::save();\r\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = md5(config('hellion.salt') . $value);\n }", "public function setPasswordAttribute($password) {\n $this->attributes['password'] = Hash::make($password);\n }", "public function setPasswordAttribute($value) {\n if (\\Hash::needsRehash($value))\n $this->attributes['password'] = bcrypt($value);\n else\n $this->attributes['password'] = $value;\n }", "protected function encodePasswords(LifecycleEventArgs $args)\r\n {\r\n $entity = $args->getObject();\r\n\r\n if ($this->isEnabledEntity($entity)) {\r\n $entity->setPassword($this->encoder->encode($entity->getPassword()));\r\n $entity->setSalt($this->encoder->getIv());\r\n }\r\n }", "public function updatePassword(UserInterface $user);", "public function getPassword(): string;", "public function password() {\n return Hash::make('MonsterRXBOCS');\n }", "protected function setPasswordAttribute($value) \n { \n $this->attributes['password'] = \\Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "public function setPasswordAttribute($pass)\n {\n $this->attributes['password'] = bcrypt($pass);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = Hash::make($password);\n }", "public function setPassword($userid, $password);", "public function setPasswordAttribute( $value )\n {\n $this->attributes[ 'password' ] = Hash::make( $value );\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }", "protected function getConfiguredPassword() {}", "public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = Hash::make($password);\n\t}", "public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = Hash::make($password);\n\t}", "public function setPassword(string $password): void\n {\n }", "public function testUpdatePasswordOnlyUpperCase(): void { }", "public function setPasswordAttribute(string $value): void\n {\n $this->attributes[self::PASSWORD] = \\bcrypt($value);\n }", "public function getAuthPassword()\n {\n \treturn $this->getGuarded('password');\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function action()\n {\n $user = $this->user();\n $data = $this->validated();\n \n $user->forceFill([\n 'password' => Hash::make($data['password']),\n ])->save();\n }", "private function encryptPassword($password) {\r\n \r\n \r\n return $password;\r\n }", "function password($password)\n {\n // Generate a random 22 character salt.\n $salt_alphabet = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n $salt_alphabet_length = strlen($salt_alphabet);\n $salt = '';\n for($i = 0; $i < 22; $i++) {\n $salt .= $salt_alphabet[mt_rand(0, $salt_alphabet_length - 1)];\n }\n // BCrypt the password with salt.\n $pwhash = crypt($password, '$2a$10$' . $salt);\n\n if ($this->password != $pwhash)\n $this->update['password'] = $pwhash;\n\n $this->password = $pwhash;\n\n return true;\n }", "public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = \\Hash::make($password);\n\t}", "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name'=>'required|max:120',\n 'email'=>'required|email|unique:users',\n 'password'=>'required|min:6|confirmed'\n ]);\n\n\n $user = User::create([\n 'name' => $request['name'],\n 'email' => $request['email'],\n 'password' => bcrypt($request['password']), //<==encrypt here\n ]);\n\n\n\n \n\n \n\n return redirect()->route('users.index')\n ->with('flash_message',\n 'User successfully added.');\n }", "function encryptPassword()\n\t{\n\t\t$userPassword = $_POST['userPassword'];\n\n\t $key = pack('H*', \"bcb04b7e103a05afe34763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3\");\n\t $key_size = strlen($key);\n\n\t $plaintext = $userPassword;\n\n\t $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\t $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n\t $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);\n\t $ciphertext = $iv . $ciphertext;\n\n\t $userPassword = base64_encode($ciphertext);\n\n\t return $userPassword;\n\t}", "public function setPassword(string $password): self;" ]
[ "0.78122973", "0.72350854", "0.7233653", "0.72311366", "0.7216509", "0.71811795", "0.7111733", "0.707928", "0.7040386", "0.69755876", "0.6962576", "0.68949205", "0.6893743", "0.6878337", "0.6853345", "0.6853345", "0.68355036", "0.6824331", "0.681691", "0.67968774", "0.67921996", "0.6780632", "0.67794174", "0.67733383", "0.67570317", "0.67570317", "0.67570317", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.67566335", "0.6756077", "0.6753882", "0.67462254", "0.6743243", "0.6743243", "0.67274743", "0.67055655", "0.6681071", "0.6665839", "0.66590226", "0.66590226", "0.66590226", "0.66513467", "0.664674", "0.66430825", "0.66430825", "0.66430825", "0.66430825", "0.66430825", "0.66430825", "0.66430825", "0.6639476", "0.6637992", "0.6637992", "0.6637992", "0.6637992", "0.6637992", "0.6637992", "0.6615546", "0.6603472", "0.65967464", "0.6593738", "0.65907496", "0.6590422", "0.6585139", "0.6583373", "0.6581629", "0.6560104", "0.6557512", "0.6554199", "0.65533173", "0.6544612", "0.65416914", "0.65227544", "0.6515178", "0.6515178", "0.6507878", "0.64988244", "0.6492463", "0.6492463", "0.6491509", "0.64605397", "0.64594764", "0.6448923", "0.64455724", "0.6444951", "0.64328074", "0.6427637", "0.6417887", "0.6414865", "0.6405133", "0.64020014", "0.64013076", "0.6400519" ]
0.67966485
20
If board is empty always stars with center position, else random position
protected function getStandardMove($player) : Move { $possibleMoves = $this->board->getPossibleMoves(); return (count($possibleMoves) == Board::BOARD_SIZE) ? MoveFactory::create($player, 4) : MoveFactory::create($player, $possibleMoves[array_rand($possibleMoves, 1)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function randomPos() {\n $this->columna=rand(0,3);\n $this->fila=rand(0,3);\n }", "public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "function sloodle_random_position_in_zone($size)\n {\n // Construct the half-size array\n $halfsize = array('x'=>($size['x'] / 2.0) - 2.0, 'y'=>($size['y'] / 2.0) - 2.0, 'z'=>($size['z'] / 2.0) - 2.0);\n \n $pos = array();\n $pos['x'] = mt_rand(0.0, $size['x'] - 4.0) - $halfsize['x'];\n $pos['y'] = mt_rand(0.0, $size['y'] - 4.0) - $halfsize['y'];\n $pos['z'] = mt_rand(0.0, $size['z'] - 4.0) - $halfsize['z'];\n return $pos;\n }", "function eat() {\n while($this->map[$this->row - 1][$this->column] == '-' or\n $this->map[$this->row][$this->column + 1] == '-' or\n $this->map[$this->row + 1][$this->column] == '-' or\n $this->map[$this->row][$this->column - 1] == '-') {\n \n $step = rand(UP, LEFT);\n switch ($step) {\n case UP:\n if($this->map[$this->row - 1][$this->column] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->row -= 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case RIGHT:\n if($this->map[$this->row][$this->column + 1] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->column += 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case DOWN:\n if($this->map[$this->row + 1][$this->column] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->row += 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case LEFT:\n if($this->map[$this->row][$this->column - 1] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->column -= 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n }\n }\n }", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "public function __construct()\n {\n for ($x = -self::BOARD_SIZE; $x <= self::BOARD_SIZE; $x++) {\n for ($y = -self::BOARD_SIZE; $y <= self::BOARD_SIZE; $y++) {\n if (abs($x) >= self::SIDE_SIZE && abs($y) >= self::SIDE_SIZE) {\n continue;\n }\n $this->board[$x][$y] = self::STONE;\n }\n }\n\n $this->board[0][0] = self::EMPTY_SLOT;\n }", "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n $player_board = str_split($this->board); \r\n return '<td style=\"text-align:center;' . ($token != $player_board[$which] ? ' background-color: #FFA500;' : '' ) . '\"><div style=\"padding: 1em;\">' . $token . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n }\r\n $this->newposition = $this->position; \r\n $this->newposition[$which] = 'x'; \r\n $move = implode($this->newposition); \r\n $link = '?size=' . $this->grid_size . '&board=' . $move . ($this->debug ? '&debug' : ''); \r\n return '<td style=\"text-align:center;\"><a href = \"' . $link . '\" style = \"text-decoration: none;\"><div style=\"padding: 1em;\">-' . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></a></td>';\r\n }", "public function testSquareOriginPoint()\n {\n $point = $this->grid100x100->pointToGridIndex(1, 1);\n $this->assertEquals(0, $point);\n }", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "function pick_move() {\n for ($cell = 0; $cell < 8; $cell++) {\n\n //if this the cell is a dash put an X in it\n if ($this->position[$cell] == '-') {\n\n //place X in the following cell\n $this->position[$cell] = 'x';\n break;\n }\n }\n }", "protected static function generatePositionToGround ()\n {\n $dataTree = Tree::getByUser()->getDataByTree();\n\n $treeCroneCenterPosX = $dataTree['crownCenterPosX'];\n\n $treeHalfWidth = $dataTree['halfCrownWidth'];\n\n $posX = rand(-$treeHalfWidth, $treeHalfWidth);\n\n return [\n 'y' => 0,\n 'x' => (int) ($treeCroneCenterPosX + $posX),\n ];\n }", "function prepareships(){\n\t\tglobal $Ships, $Gridsize, $LightBlue, $Black, $Gold, $black_amount, $gold_amount;\n\t\tfor ($y=1; $y<=$Gridsize; $y++){\n\t\t\tfor ($x=1; $x<=$Gridsize; $x++){\n\t\t\t\t$Ships[$x][$y]=$LightBlue;\n\t\t\t} # x loop\n\t\t} # y loop\n\t\t\n\t\t//Ship coordinates #1\n\t\t$y = rand(1, $Gridsize-2);\n\t\t$temp_y = $y;\n\t\tfor ($x = 1; $x<=rand(1, 5); $x++)\n\t\t\t$Ships[$x][$y]=$Gold;\n\t\t\n\t\t//Ship coordinates #2\n\t\t$done = 0;\n\t\twhile($done != 1){\n\t\t\t$y = rand(1, $Gridsize-2);\n\t\t\tif($temp_y != $y && $temp_y != $y+1 && $temp_y != $y-1){\n\t\t\t\tfor ($x = 1; $x<=rand(1, 5); $x++)\n\t\t\t\t\t$Ships[$x][$y]=$Black;\n\t\t\t\t$done = 1;\n\t\t\t}\n\t\t}\n\t}", "public function move(){\r\n\t\t\tif( empty($lastShot) ){\r\n\t\t\t\t$lastShot = new Play( $initialRow, $initialRow );\r\n\t\t\t\treturn $lastShot;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//if it is not empty, and is on the last cell\r\n\t\t\t\t//go to the first column of next row\r\n\t\t\t\tif( $lastShot.getX() == 10 ){\r\n\t\t\t\t\t$lastShot.setX( $initialRow );\r\n\t\t\t\t\t$lastShot.setY( $lastShot.getY() + 1 );\r\n\t\t\t\t}\r\n\t\t\t\t//if it is not in the last cell, then move 1 cell to the right.\r\n\t\t\t\telse{\r\n\t\t\t\t\t$lastShot.setX( $lastShot.getX() + 1 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private function _resetBoard()\n {\n $this->curPos = 0;\n $this->curRow = 0;\n $this->_createBoard();\n }", "function isCellEmpty($xPos, $yPos){\r\n\t\t\tif($this->board[$xPos][$yPos] != 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "function getRating()\n{\n $actualRating = rand(0,50) / 10;\n\n $starFull = $actualRating;\n \n $starPartial = 0;\n\n if (is_float($starFull))\n {\n\n $starPartial = 1;\n\n $starFull = (int)$starFull;\n\n }\n\n $star_empty = 5 - $starFull - $starPartial;\n\n $ratingDisplay = '';\n\n for($i = 0; $i < $starFull; $i++) {\n $ratingDisplay .= 'Full Star ';\n }\n\n if ($starPartial)\n {\n $ratingDisplay .= 'Partial Star ';\n }\n\n for($i = 0; $i < $star_empty; $i++) {\n $ratingDisplay .= 'Empty Star ';\n }\n\n echo $ratingDisplay . ' (' . $actualRating . \")\";\n}", "private function getMovePosition(Board $board)\r\n {\r\n $position = null;\r\n\r\n// todo\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && $board->getPieceAtPosition($i, 1)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 1)== self::PIECE)\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && $board->getPieceAtPosition(1, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(1, $j)== self::PIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n if($board->getPieceAtPosition(1, 1)==self::PIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::PIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::PIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::PIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::PIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n\r\n# 2. Or place a piece that prevents the player from winning. \r\n if(is_null($position))\r\n {\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && ($board->getPieceAtPosition($i, 1)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 1)== self::BADPIECE))\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && ($board->getPieceAtPosition(1, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(1, $j))== self::BADPIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n\r\n if($board->getPieceAtPosition(1, 1)==self::BADPIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::BADPIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::BADPIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::BADPIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::BADPIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n }\r\n\r\n if(is_null($position))\r\n {\r\n $blankpositions=$board->getBlankPositions();\r\n $numberpositions = count($board->getBlankPositions());\r\n $chooseposition = rand(1,$numberpositions);\r\n $position = $blankpositions[$chooseposition - 1];\r\n }\r\n\r\n return $position;\r\n }", "public function generator($a){\n $countr = 0;\n while($countr < 70)//random spread 50 holes on the wall\n {\n $random = range(0, 49);\n shuffle($random);\n $x = $random[0];\n $y = $random[1];\n if($x != 0&&$x != 49&&$y != 0&&$y != 49){\n $a[$y][$x] = 0;\n $countr++; \n }\n }\n \n $statistic = []; \n for($i = 0;$i <= 49;$i ++)\n {\n for($j = 0;$j <= 49;$j ++)\n {\n if($a[$i][$j] == 0){\n $cell = [$i,$j];\n $statistic[] = $cell;\n }\n }\n }\n \n for($i = 0;$i < count($statistic);$i ++)//make a holes spread like 'cross' pattern from 4 direction, which reach end or another road stop push down the wall\n {\n $tcell = $statistic[$i];\n $curri = $tcell[0];\n $currj = $tcell[1];\n \n //dig to up\n $curri--;\n while($curri >= 0){\n if($a[$curri][$currj] == 0)\n break;\n if($a[$curri][$currj - 1] == 0 || $a[$curri][$currj + 1] == 0){//left or right,\n $a[$curri][$currj] = 0;\n break;\n }\n $a[$curri][$currj] = 0;\n $curri--;\n }\n \n $curri = $tcell[0];\n $currj = $tcell[1];\n \n //dig to down\n $curri++;\n while($curri <= 49){\n if($a[$curri][$currj] == 0)\n break;\n if($a[$curri][$currj - 1] == 0 || $a[$curri][$currj + 1] == 0){\n $a[$curri][$currj] = 0;\n break;\n }\n $a[$curri][$currj] = 0; \n $curri++;\n }\n \n $curri = $tcell[0];\n $currj = $tcell[1];\n \n //dig to left\n $currj--;\n while($currj >= 0){\n if($a[$curri][$currj] == 0)\n break;\n if($a[$curri - 1][$currj] == 0 || $a[$curri + 1][$currj] == 0){\n $a[$curri][$currj] = 0;\n break;\n }\n $a[$curri][$currj] = 0; \n $currj--;\n }\n \n $curri = $tcell[0];\n $currj = $tcell[1];\n \n //dig to right\n $currj++;\n while($currj <= 49){\n if($a[$curri][$currj] == 0)\n break;\n if($a[$curri - 1][$currj] == 0 || $a[$curri + 1][$currj] == 0){\n $a[$curri][$currj] = 0;\n break;\n }\n $a[$curri][$currj] = 0;\n $currj++;\n }\n }\n return $a;\n }", "function place($column, $player){\n for($row = $this->height-1; $row >= 0; $row--){\n if($this->places[$column][$row] == 0){\n $this->places[$column][$row] = $player;\n return $row;\n }\n }\n return -1;\n }", "public function testTallOriginPoint()\n {\n $point = $this->grid50x100->pointToGridIndex(1, 1);\n $this->assertEquals(0, $point);\n }", "function allot()\n{\n\t$dist = rand(5,10);\n\t$dir = rand(0,7);\n\t\n\t$conn = connect();\n\t$query=\"SELECT row_tail,col_tail FROM map_res WHERE faction=\".$_SESSION[\"faction\"].\";\";\n\t$op = mysqli_query($conn,$query);\n\tif (mysqli_num_rows($op) != 1)\n\t{\n\t\t$x = \"\";\n\t\t$y = \"\";\n\t\t\n\t\tif ($_SESSION[\"faction\"] === \"1\")\n\t\t{\n\t\t\t$x = 25;\n\t\t\t$y = 50;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$x = 75;\n\t\t\t$y = 50;\n\t\t}\n\t\t\n\t\t$query=\"INSERT INTO map_res (faction,row_tail,col_tail) VALUES (\".$_SESSION[\"faction\"].\",\".$x.\",\".$y.\");\";\n\t\t$op=mysqli_query($conn,$query);\n\t\t//alert($query);\n\t\t$res[\"row\"] = $x;\n\t\t$res[\"col\"] = $y;\n\t\t//alert(var_dump($res));\n\t\treturn($res);\n\t}\n\t$op = mysqli_fetch_assoc($op);\n\t\n\tswitch($dir)\n\t{\n\t\tcase 0: //up\n\t\t\t$res_row = $op[\"row_tail\"] - $dist;\n\t\t\t$res_col = $op[\"col_tail\"];\n\t\tbreak;\n\t\t\n\t\tcase 1: //up-right\n\t\t\t$res_row = $op[\"row_tail\"] - floor($dist/1.4142);\n\t\t\t$res_col = $op[\"col_tail\"] + floor($dist/1.4142);\n\t\tbreak;\n\t\t\n\t\tcase 2: //right\n\t\t\t$res_row = $op[\"row_tail\"];\n\t\t\t$res_col = $op[\"col_tail\"] + floor($dist/1.4142);\n\t\tbreak;\n\t\t\n\t\tcase 3: //down-right\n\t\t\t$res_row = $op[\"row_tail\"] + floor($dist/1.4142);\n\t\t\t$res_col = $op[\"col_tail\"] + floor($dist/1.4142);\n\t\tbreak;\n\t\t\n\t\tcase 4: //down\n\t\t\t$res_row = $op[\"row_tail\"] + $dist;\n\t\t\t$res_col = $op[\"col_tail\"];\n\t\tbreak;\n\t\t\n\t\tcase 5: //down-left\n\t\t\t$res_row = $op[\"row_tail\"] + floor($dist/1.4142);\n\t\t\t$res_col = $op[\"col_tail\"] - floor($dist/1.4142);\n\t\tbreak;\n\t\t\n\t\tcase 6: //left\n\t\t\t$res_row = $op[\"row_tail\"];\n\t\t\t$res_col = $op[\"col_tail\"] - floor($dist/1.4142);\n\t\tbreak;\n\t\t\n\t\tcase 7: //up-left\n\t\t\t\n\t\t\t$res_row = $op[\"row_tail\"] + floor($dist/1.4142);\n\t\t\t$res_col = $op[\"col_tail\"] - floor($dist/1.4142);\n\t\tbreak;\n\t}\n\t\n\t$res=array();\n\t\n\tif ($res_row > 99 || $res_row < 0 || $res_col > 99 || $res_col < 0 || getSlot($res_row,$res_col)[\"occupied\"] !== \"0\" || getSlot($res_row,$res_col)[\"special\"] === \"3\" || getSlot($res_row,$res_col)[\"special\"] === \"4\")\n\t{\n\t\t//alert(\"$res_row , $res_col\");\n\t\treturn(false);\n\t}\n\telse\n\t{\n\t\t$res[\"row\"] = $res_row;\n\t\t$res[\"col\"] = $res_col;\n\t\t//alert(var_dump($res));\n\t\treturn($res);\n\t}\n\t\n\t//return($res);\n}", "public function getInitialPosition();", "function getInitialBoard() {\n $board=array();\n $boardindex=array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\");\n\n foreach($boardindex as $i) {\n $board[$i]=array(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\");\n }\n\n $board['A'][1]=\"WR\";\n $board['B'][1]=\"WN\";\n $board['C'][1]=\"WB\";\n $board['D'][1]=\"WQ\";\n $board['E'][1]=\"WK\";\n $board['F'][1]=\"WB\";\n $board['G'][1]=\"WN\";\n $board['H'][1]=\"WR\";\n\n $board['A'][2]=\"WP\";\n $board['B'][2]=\"WP\";\n $board['C'][2]=\"WP\";\n $board['D'][2]=\"WP\";\n $board['E'][2]=\"WP\";\n $board['F'][2]=\"WP\";\n $board['G'][2]=\"WP\";\n $board['H'][2]=\"WP\";\n\n $board['A'][7]=\"BP\";\n $board['B'][7]=\"BP\";\n $board['C'][7]=\"BP\";\n $board['D'][7]=\"BP\";\n $board['E'][7]=\"BP\";\n $board['F'][7]=\"BP\";\n $board['G'][7]=\"BP\";\n $board['H'][7]=\"BP\";\n\n $board['A'][8]=\"BR\";\n $board['B'][8]=\"BN\";\n $board['C'][8]=\"BB\";\n $board['D'][8]=\"BQ\";\n $board['E'][8]=\"BK\";\n $board['F'][8]=\"BB\";\n $board['G'][8]=\"BN\";\n $board['H'][8]=\"BR\";\n\n return $board;\n }", "private function isFilled(): bool {\n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n if($this->board[$row][$col] == 0 || $this->board[$row][$col] > 9 || $this->board[$row][$col] < 1) {\n return false;\n }\n }\n }\n return true;\n }", "public static function getRandomMove()\n {\n return array_rand(Game::$moves);\n }", "function mustDrawAStarInO($i, $j, $nrLin, $nrCol) {\r\n if ($i == 1 && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($i == $nrLin && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($j == 1 && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n if ($j == $nrCol && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "private function randomEmptyRoom() {\n while(true) {\n $ndx = rand(1, count($this->rooms));\n $room = $this->getRoom($ndx);\n if($room->isEmpty()) {\n return $room;\n }\n }\n }", "public function findEmptySlots()\n {\n $emptySlots = [];\n foreach ($this->board as $x => $row) {\n /** @var array $row */\n foreach ($row as $y => $stone) {\n if (self::EMPTY_SLOT === $stone) {\n $emptySlots[] = new Coordinate($x, $y);\n }\n }\n }\n\n return $emptySlots;\n }", "public function position();", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "function randomDeployment(){\r\n\t\t\t$this->ships = array( self::AIRCRAFT => Ship::withNameAndSize(\"Aircraft Carrier\",5),\r\n\t\t\t\t\t\t\t\t self::BATTLESHIP => Ship::withNameAndSize(\"Battleship\",4),\r\n\t\t\t\t\t\t\t\t self::FRIGATE => Ship::withNameAndSize(\"Frigate\",3),\r\n\t\t\t\t\t\t\t\t self::SUBMARINE => Ship::withNameAndSize(\"Submarine\",3),\r\n\t\t\t\t\t\t\t\t self::MINESWEEPER => Ship::withNameAndSize(\"Minesweeper\",2) );\r\n\t\t\t\t\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\t$result = false;\r\n\t\t\t\twhile( !$result ){\r\n\t\t\t\t\t$direction = rand(0,1);\r\n\t\t\t\t\tif($direction){\r\n\t\t\t\t\t\t$offset = self::COLUMNS - ($ship->getSize() - 1);\r\n\t\t\t\t\t\t$xPos = rand(1, $offset);\r\n\t\t\t\t\t\t$yPos = rand(1, intval(self::ROWS) );\r\n\t\t\t\t\t\t$result = $this->placeShip($xPos, $yPos, $direction, $xPos + ($ship->getSize() - 1), $shipNumber);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$offset = self::ROWS - ($ship->getSize() - 1);\r\n\t\t\t\t\t\t$xPos = rand(1, intval(self::COLUMNS) );\r\n\t\t\t\t\t\t$yPos = rand(1, $offset);\r\n\t\t\t\t\t\t$result = $this->placeShip($xPos, $yPos, $direction, $yPos + ($ship->getSize() - 1), $shipNumber);\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t//echo \"Ship: \" . $shipSize . \", x: \" . $yPos . \", y: \" . $xPos . \", direction: \" . (($direction == true)? \"horizontal, \": \"vertical, \") . \" result: \" .( $result ) . PHP_EOL ;\r\n\t\t\t\t}\r\n\t\t\t\t$ship->setPositionAndDirection($xPos, $yPos, $direction);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//print_r($this->ships);\r\n\t\t}", "private function _createBoard()\n {\n $board = array();\n for($nr = 1; $nr <= $this->numSlots; $nr++){\n $board[] = array_fill(0, $nr, 0);\n }\n\n $this->board = $board;\n }", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "private function generateImgStarfield() {\r\n $img_starfield = $config[ConfigurationKey::prefix_img_starfield];\r\n $img_starfield = rand(0, $config[ConfigurationKey::number_img_starfield]);\r\n return $img_starfield;\r\n }", "private function makeMachineMove(){\n\t\t$spaces = $this->getAvaibleSpaces();\n\t $space = $spaces[rand()%count($spaces)];\n\t\t$this->gato[$space[0]][$space[1]] = $this->jugador2;\n\t\treturn $space[0].\":\".$space[1];\n\t}", "protected static function generatePositionToCrown ()\n {\n $dataTree = Tree::getByUser()->getDataByTree();\n\n $treeCroneCenterPosX = $dataTree['crownCenterPosX'];\n $treeCroneCenterPosY = $dataTree['crownCenterPosY'];\n\n $treeHalfWidth = $dataTree['halfCrownWidth'];\n $treeHalfHeight = $dataTree['halfCrownHeight'];\n\n\n $posX = rand(-$treeHalfWidth, $treeHalfWidth);\n $posY = rand(-$treeHalfHeight, $treeHalfHeight);\n\n // Check the coordinates located inside the oval (crown) (x^2/a^2 + y^2/b^2) == 1 for ellipse\n $ovalVerification = (($posX * $posX) / ($treeHalfWidth * $treeHalfWidth)) + (($posY * $posY) / ($treeHalfHeight * $treeHalfHeight));\n\n if($ovalVerification > 1){\n // If they are beyond the oval (crown),\n // I place them on the surface of the oval (crown),\n // keeping the angle from the center\n $reductionRatio = sqrt($ovalVerification);\n $posX /= $reductionRatio;\n $posY /= $reductionRatio;\n }\n\n return [\n 'x' => (int) ($treeCroneCenterPosX + $posX),\n 'y' => (int) ($treeCroneCenterPosY + $posY),\n ];\n }", "protected function createEmpty(Game $game, $row, $col)\n {\n }", "private function isKingInMate(int $color): bool\n {\n $board = $this->getBoard();\n $flattenBoard = array_merge(...$this->getBoard());\n $coords = $this->getKingCoords($color);\n\n for ($row = 0; $row <= 2; ++$row) {\n for ($col = 0; $col <= 2; ++$col) {\n $x = $coords[0] + (1 - $row);\n $y = $coords[1] + (1 - $col);\n if (\n ($x > 7 || $x < 0) ||\n ($y > 7 || $y < 0) ||\n ($y === $coords[1] && $x === $coords[0]) ||\n !$this->isReachable($coords, [$x, $y])\n ) {\n continue;\n }\n\n $this->board[$y][$x] = $this->board[$coords[1]][$coords[0]];\n $this->board[$coords[1]][$coords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n $this->board = $board;\n\n foreach ($flattenBoard as $piece) {\n if (!($piece instanceof Piece) || $piece instanceof King) {\n continue;\n }\n if ($piece->getColor() !== $color) {\n continue;\n }\n\n $pieceCoords = $piece->getCoords();\n for ($y = 0; $y < 8; ++$y) {\n for ($x = 0; $x < 8; ++$x) {\n $this->board = $board;\n $move = $piece->checkMove($x, $y, $board, $this->getMoveNumber());\n if (!$move || !$this->isReachable($pieceCoords, [$x, $y])) {\n continue;\n }\n $this->board[$y][$x] = $this->board[$pieceCoords[1]][$pieceCoords[0]];\n $this->board[$pieceCoords[1]][$pieceCoords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n }\n return true;\n }", "protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}", "public function fillRandomly(int $width, int $height): void\n {\n for ($x = 0; $x < $height; $x++)\n {\n for ($y = 0; $y < $width; $y++)\n {\n $this->cells[$x][$y] = mt_rand(0, 1) == 1 ? CellFactory::getAliveCell() : CellFactory::getDeadCell();\n }\n }\n }", "public function getBlankPositions()\r\n {\r\n// example\r\n $blanks = [\r\n [0, 0],\r\n [0, 1],\r\n [0, 2],\r\n ];\r\n\r\n// todo...\r\n\r\n for($i=0;$i<self::ROWS;$i++)\r\n\t{\r\n\t\tfor($j=0;$j<self::COLUMNS;$j++)\r\n\t\t{\r\n\t\t\tif($this->pieces[$i][$j] == '')\r\n\t\t\t{\r\n\t\t\t\t array_push($blanks, [$i,$j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n return $blanks;\r\n }", "public function constructNotSquare(){\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "private function generateAsteroids()\r\n {\r\n // find out how many asteroids are in the local area\r\n $asteroidCount = 0;\r\n foreach ($this->asteroids as $asteroidId => $asteroid) {\r\n if ($asteroid->getX() > $this->spaceShip->getX() - $this->asteroidPreloadRange &&\r\n $asteroid->getY() > $this->spaceShip->getY() - $this->asteroidPreloadRange &&\r\n $asteroid->getZ() > $this->spaceShip->getZ() - $this->asteroidPreloadRange &&\r\n $asteroid->getX() < $this->spaceShip->getX() + $this->asteroidPreloadRange &&\r\n $asteroid->getY() < $this->spaceShip->getY() + $this->asteroidPreloadRange &&\r\n $asteroid->getZ() < $this->spaceShip->getZ() + $this->asteroidPreloadRange) {\r\n $asteroidCount++;\r\n }\r\n // if any asteroid is now so far from the ship that it can't have an effect then destroy it...\r\n if (abs($asteroid->getX() - $this->spaceShip->getX()) > $this->asteroidUnloadRange ||\r\n abs($asteroid->getY() - $this->spaceShip->getY()) > $this->asteroidUnloadRange ||\r\n abs($asteroid->getZ() - $this->spaceShip->getZ()) > $this->asteroidUnloadRange) {\r\n unset($this->asteroids[$asteroidId]);\r\n } \r\n }\r\n // how many were we expecting?\r\n $expectedAsteroidCount = pow(((2 * $this->asteroidPreloadRange) + 1), 3) / $this->asteroidDensity;\r\n if ($asteroidCount < $expectedAsteroidCount) {\r\n // keep adding asteroids...\r\n do {\r\n // randomly choose where to place the new asteroid, if the location is too near to the ships current location then regenerate the asteroid spawn point\r\n do {\r\n $xRand = rand(-$this->asteroidPreloadRange, $this->asteroidPreloadRange) + $this->spaceShip->getX();\r\n $yRand = rand(-$this->asteroidPreloadRange, $this->asteroidPreloadRange) + $this->spaceShip->getY();\r\n $zRand = rand(-$this->asteroidPreloadRange, $this->asteroidPreloadRange) + $this->spaceShip->getZ();\r\n $dxRand = rand(-Asteroid::$maxComponentVelocity, Asteroid::$maxComponentVelocity);\r\n $dyRand = rand(-Asteroid::$maxComponentVelocity, Asteroid::$maxComponentVelocity);\r\n $dzRand = rand(-Asteroid::$maxComponentVelocity, Asteroid::$maxComponentVelocity);\r\n } while ( // check the location we just chose, if its too close to the ship then go round the loop again\r\n (abs($xRand - $this->spaceShip->getX()) < $this->asteroidScanningRange &&\r\n abs($yRand - $this->spaceShip->getY()) < $this->asteroidScanningRange &&\r\n abs($zRand - $this->spaceShip->getZ()) < $this->asteroidScanningRange)\r\n // also the asteroid must have some velocity...\r\n || abs($dxRand) + abs($dyRand) + abs($dzRand) == 0\r\n );\r\n // make the new asteroid\r\n $this->asteroids[] = new Asteroid($xRand, $yRand, $zRand, $dxRand, $dyRand, $dzRand);\r\n $asteroidCount++;\r\n } while ($asteroidCount < $expectedAsteroidCount); // keep adding asteroids until there are the number we were expecting\r\n }\r\n }", "function randomPattern($x, $y = NULL, $density = 60)\n{\n if ($y === NULL) {\n $y = $x;\n }\n $p = '';\n for ($row=1; $row<=$y; $row++) {\n for ($col=1; $col<=$x; $col++) {\n if (rand(1,100) <= $density) {\n $p .= 'X';\n } else {\n $p .= ' ';\n }\n }\n $p .= \"\\n\";\n }\n \n return $p;\n}", "final private function initCells(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\tif (@$this->contents[$i]->contents[$j] and\n\t\t\t\t\t@!$this->markspan[$i][$j] and\n\t\t\t\t\tcount(@$this->contents[$i]->contents[$j]->contents) == 0)\n\t\t\t$this->cellContent($i,$j,'&nbsp;');\n\n\t}", "function rand() {\n\n $next = $this->find('first', array('order'=>'position DESC'));\n\n $rand = rand(1, $next['Ringsite']['position']);\n\n $next = $this->find('first', array('conditions'=>array('position'=>$rand)));\n\n return $next;\n }", "public function generatePossibleMoves(){\r\n\t\t\t$this->possibleMoves = array();\r\n\t\t\t// Iterates through all the possible moves\r\n\t\t\tfor ($currCol = 0; $currCol < 10; $currCol++){\r\n\t\t\t\tfor ($currRow = 0; $currRow < 10; $currRow++){\r\n\t\t\t\t\t$this->possibleMoves[($currRow * 10) + $currCol] = new Shot($currRow+1, $currCol+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "private function cover_zeros(){\n\t\t$this->numLines = 0;\n\t\t$this->lines = array();\n\t\t\n\t\t\n\t\t\n\t\tforeach ($this->clonedGrid as $row => $cols)\n\t\t{\n\t\t\tforeach ( $cols as $col => $value){\n\t\t\t\t$this->lines[$row][$col] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($this->clonedGrid as $row => $cols)\n\t\t{\n\t\t\tforeach ( $cols as $col => $value){\n\t\t\t\t\n\t\t\t\tif($value == 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->strike_nieghbors($row, $col, $this->max_vh($row, $col));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function get_placement() {\n\t\treturn intval($this->settings['row']);\n\t}", "private function generateCoordinates()\n {\n $this->mapDiagonal();\n $this->mapVertical();\n $this->mapHorizontal();\n\n $this->disabledCells = array_unique($this->disabledCells);\n sort($this->disabledCells);\n }", "function part1() {\n $this->fabric = array_fill($this->minY, $this->spanY,\n array_fill($this->minX, $this->spanX, 0)\n );\n // Fill fabric with smaller areas:\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n\n while ($w > 0) {\n while ($h > 0) {\n// echo \"($x,$y)\\n\";\n // Place area id in empty cell:\n if ($this->fabric[$y][$x] === 0) {\n $this->fabric[$y][$x] = $id;\n }\n // Place '@' where areas overlap:\n else if ($this->fabric[$y][$x] !== '@' && $this->fabric[$y][$x] !== 0) {\n $this->fabric[$y][$x] = '@';\n }\n $y++;\n $h--;\n }\n $y = $a['y'];\n $h = $a['h'];\n $x++;\n $w--;\n }\n }\n //$this->printGrid($fabric);\n $charCounts = $this->charCounter('@', $this->fabric);\n echo \"Overlap: $charCounts\\n\";\n }", "protected function tempPosition()\n {\n $this->{$this->getPositionColumn()} = static::$insanePosition;\n $this->save();\n }", "private function getCell(int $x, int $y): ?Piece\n {\n return $this->board[$y][$x];\n }", "protected function getBoardStart(): int\n {\n $height = $this->board->height();\n\n if ($this->getPlayer()->doesMoveUpwards()) {\n return array_shift($height);\n } else {\n return array_pop($height);\n }\n }", "protected function calculateSpritePositions() {}", "static function square_exists_and_not_occupied_by_friendly_piece(\n ChessSquare $starting_square,\n int $x_delta,\n int $y_delta,\n $color_to_move,\n ChessBoard $board\n ): ?ChessSquare {\n $rank = $starting_square->rank + $x_delta;\n $file = $starting_square->file + $y_delta;\n \n $ending_square = self::try_to_make_square_using_rank_and_file_num($rank, $file);\n \n // Ending square is off the board\n if ( ! $ending_square ) {\n return null;\n }\n \n // Ending square contains a friendly piece\n if ( $board->board[$rank][$file] ) {\n if ( $board->board[$rank][$file]->color == $color_to_move ) {\n return null;\n }\n }\n \n return $ending_square;\n }", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "function getPosition() ;", "public static function init() {\n for ($x = 0; $x < SIZE; $x++) {\n self::$rows[$x] = $x;\n }\n for ($i = 0; $i < SIZE; $i++) {\n self::$cols[$i] = true;\n }\n for ($j = 0; $j < 2 * SIZE; $j++) {\n self::$duongcheo1Marked[$j] = true;\n }\n for ($k = -SIZE; $k < SIZE; $k++) {\n self::$duongcheo2Marked[$k] = true;\n }\n }", "public function moveCell($cellToMove){\n // same row\n $cells = $_SESSION['GameView::cellNumbers'];\n $empty = 0;\n for ($i=0;$i<16;$i++){\n if ($_SESSION['GameView::cellNumbers'][$i] == 0){\n \n $empty = $i;\n }\n } \n \n $sameRow = false;\n $sameColumn = false;\n $neighbour = false;\n if (floor($cellToMove / 4) == floor($empty / 4)){\n $sameRow = true;\n if (($cellToMove + 1 == $empty) || ($empty + 1 == $cellToMove)){\n $neighbour = true;\n }\n }\n \n // check if directly above or below\n if ((($cellToMove + 4) == $empty) || (($empty + 4) == $cellToMove)){\n $neighbour = true;\n }\n \n if ($neighbour){\n // switch place\n $_SESSION['GameView::moves'] += 1;\n $temp = $cells[$cellToMove];\n $_SESSION['GameView::cellNumbers'][$cellToMove] = 0;\n $_SESSION['GameView::cellNumbers'][$empty] = $temp;\n\n }\n \n return $neighbour;\n \n }", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\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 $moves;\n\t}", "private function getSpacing()\n {\n if ($this->fixedSpacing) {\n return $this->spacing;\n } else {\n return rand($this->minSpacing, $this->maxSpacing);\n }\n }", "public function placePiece(Board $board)\r\n {\r\n// todo...\r\n list($y, $x) = $this->getMovePosition($board);\r\n\r\n $board->addPiece($y, $x, self::PIECE);\r\n\r\n }", "private function findRectangleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble &&\n\t\t\t\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t$this->board[2][0]->hasMarble &&\n\t\t\t\t$this->board[2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\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\tif($this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('left', 1, 0);\n\t\t\t\t\t$moves[2][] = array('left', 3, 1);\n\t\t\t\t\t$moves[2][] = array('left', 2, 1);\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('right', 1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('right', 1, -2);\n\t\t\t\t\t$moves[3][] = array('left', 3, 1);\n\t\t\t\t\t$moves[3][] = array('left', 2, 1);\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('left', 1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('right', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 3, -1);\n\t\t\t\t\t$moves[4][] = array('right', 2, -1);\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('left', 1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('left', 1, 2);\n\t\t\t\t\t$moves[5][] = array('right', 3, -1);\n\t\t\t\t\t$moves[5][] = array('right', 2, -1);\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('right', 1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble &&\n\t\t\t\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t$this->board[-2][0]->hasMarble &&\n\t\t\t\t$this->board[-2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[-1][0]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('up', -3, -1);\n\t\t\t\t\t$moves[6][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('up', -3, 1);\n\t\t\t\t\t$moves[7][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[8] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('left', -1, 0);\n\t\t\t\t\t$moves[8][] = array('left', -3, 1);\n\t\t\t\t\t$moves[8][] = array('left', -2, 1);\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('right', -1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[9] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('right', -1, -2);\n\t\t\t\t\t$moves[9][] = array('left', -3, 1);\n\t\t\t\t\t$moves[9][] = array('left', -2, 1);\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('left', -1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[10] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('right', -1, 0);\n\t\t\t\t\t$moves[10][] = array('right', -3, -1);\n\t\t\t\t\t$moves[10][] = array('right', -2, -1);\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('left', -1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[11] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('left', -1, 2);\n\t\t\t\t\t$moves[11][] = array('right', -3, -1);\n\t\t\t\t\t$moves[11][] = array('right', -2, -1);\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('right', -1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-2]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[12] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[12][] = array('right', 0, -3);\n\t\t\t\t\t$moves[12][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -2);\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$moves[12][] = array('right', 1, -2);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[13] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[13][] = array('right', 0, -3);\n\t\t\t\t\t$moves[13][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -2);\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$moves[13][] = array('right', -1, -2);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[14] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('up', 0, -1);\n\t\t\t\t\t$moves[14][] = array('up', -1, -3);\n\t\t\t\t\t$moves[14][] = array('up', -1, -2);\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('down', 2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[15] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('down', 2, -1);\n\t\t\t\t\t$moves[15][] = array('up', -1, -3);\n\t\t\t\t\t$moves[15][] = array('up', -1, -2);\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('up', 0, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && !$this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[16] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 0, -1);\n\t\t\t\t\t$moves[16][] = array('down', 1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 1, -2);\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('up', -2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && $this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[17] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('up', -2, -1);\n\t\t\t\t\t$moves[17][] = array('down', 1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 1, -2);\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[1][2]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[0][2]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble &&\n\t\t\t\t$this->board[-1][2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[18] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[18][] = array('left', 0, 3);\n\t\t\t\t\t$moves[18][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 2);\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$moves[18][] = array('left', 1, 2);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\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\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[19] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[19][] = array('left', 0, 3);\n\t\t\t\t\t$moves[19][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 2);\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$moves[19][] = array('left', -1, 2);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\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\tif($this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[20] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('up', 0, 1);\n\t\t\t\t\t$moves[20][] = array('up', -1, 3);\n\t\t\t\t\t$moves[20][] = array('up', -1, 2);\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('down', 2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[21] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('down', 2, 1);\n\t\t\t\t\t$moves[21][] = array('up', -1, 3);\n\t\t\t\t\t$moves[21][] = array('up', -1, 2);\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('up', 0, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[22] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 0, 1);\n\t\t\t\t\t$moves[22][] = array('down', 1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 1, 2);\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('up', -2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[23] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('up', -2, 1);\n\t\t\t\t\t$moves[23][] = array('down', 1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 1, 2);\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 0, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\treturn $moves;\n\t}", "public function getPos();", "public function getPos();", "function printBoard(){\r\n\t\t\tfor ($i = 1; $i <= self::ROWS; $i++){\r\n\t\t\t\tfor ($j = 1; $j <= self::ROWS; $j++){\r\n\t\t\t\t\techo $this->board[$i][$j] . \" \";\r\n\t\t\t\t}\r\n\t\t\t\techo PHP_EOL;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo PHP_EOL;\r\n\t\t\t\t\r\n\t\t}", "abstract protected function move($board);", "function getPosition() {\n\t\t}", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function setUp()\n {\n //For this example, the max score MUST be exactly 15\n $this->_maxScore = 15;\n\n $this->_board = [\n [8 => \"\", 1 => \"\", 6 => \"\"],\n [3 => \"\", 5 => \"\", 7 => \"\"],\n [4 => \"\", 9 => \"\", 2 => \"\"]\n ];\n\n /**\n * Winning conditions, based on Magic Square Theory\n */\n $this->_winningConditions = [\n [8, 1, 6],\n [3, 5, 7],\n [4, 9, 2],\n [8, 3, 4],\n [1, 6, 9],\n [6, 7, 2],\n [8, 5, 2],\n [6, 5, 4]\n ];\n\n\n }", "public function solve()\n {\n foreach ($this->grid->getGrid() as $cell)\n {\n $pencilMarks = $cell->getPencilMarks();\n if ($cell->isEmpty() && sizeof($pencilMarks) == 1)\n {\n $cell->setValue($pencilMarks[0]);\n $this->markMove($cell);\n }\n }\n }", "public function generateSeatForUnsquareRows(){\n $unsquaredBlks = $this->getUnsquaredBlocks();\n /** @var Block $blk */\n foreach ($unsquaredBlks as $blk){\n $blk->removeSeats();\n $blk->generateSeats();\n }\n }", "function pawn($original_position, $new_position){\n\t\t//if($vector == 1 move ahead\n\t\t//X movement\n\t\t//Y movement\n\t\t//E2 to E4\n\t\t//E minus the E\n\t\t//4 minus 2\n\t\n\t}", "function displaySymbol($randomValue, $pos){\n \n \n switch($randomValue){\n case 0: $symbol = \"seven\";\n break;\n case 1: $symbol = \"cherry\";\n break;\n case 2: $symbol = \"lemon\";\n break;\n case 3: $symbol = \"grapes\";\n \n }\n \n echo \"<img id = 'reel$pos' src = 'img/$symbol.png' alt = '$symbol' title ='\".ucfirst($symbol). \"' width = '70' >\";\n }", "private function findSimpleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->moveDestinations as $direction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->canMoveTo($direction, $i, $j))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$moves[] = array(array($direction, $i, $j));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "public function testWideOriginPoint()\n {\n $point = $this->grid100x50->pointToGridIndex(1, 1);\n $this->assertEquals(0, $point);\n }", "public function setInitialGridPosition($position)\n {\n if ($this->getPositionInstance() !== null) {\n throw new IntialGridPositionCanOnlyBeSetOnceException(\"initial startValue can only be set once\");\n }\n $this->setPositionInstance($position[0], $position[1]);\n $this->getGrid()->placeItemOnGrid($this, $this->getCurrentPosition());\n return true;\n\n }", "function my_magic_cards_grid_setup() {\r\n\r\n\r\n}", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function getTileTopLeft(): XY\n {\n return $this->tileTopLeft;\n }", "protected function getPoints()\n\t{\n\t\treturn rand($this->points - 1, $this->points + 1);\n\t}", "private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }", "public function getPosition() {}", "public function getPosition() {}", "function printN()\r\n{\r\n for($i=0;$i<8;$i++){\r\n for($j=0;$j<6;$j++){\r\n if($j==0 || $j==5||$i==$j+1){\r\n echo \"*\";\r\n } else {\r\n echo \" \";\r\n }\r\n }\r\n echo \"\\n\";\r\n }\r\n echo \"\\n\";\r\n}", "protected function getPosition(Board $board, $type)\n {\n $free = $board->getFreeCell();\n\n return $free[0];\n }", "private function populate() {\n if ($this->isPopulated()) {\n return;\n }\n //compute the midpoint and use it to select the starting indexes\n $midpoint = floor($this->dimension / self::TOTAL_DIMENSIONS);\n \n //initialize indexes to the center of the matrix\n $row = $midpoint;\n $column = $midpoint;\n \n //starting direction for the spiral is right\n $direction = $this->initial_direction;\n \n //initialize the starting value at the center of the matrix\n $value = $this->initial_value;\n $this->set($row, $column, $value);\n \n while(!$this->invalid($row, $column)) {\n $value = $this->compute($row, $column);\n $this->set($row, $column, $value);\n \n //get next direction, row, and column for the next value\n $direction = $this->getNextDirection($direction, $row, $column);\n $row = $this->getNextRow($direction, $row);\n $column = $this->getNextColumn($direction, $column);\n }\n $this->setPopulated();\n }", "private function _getNewPos(int $curRow, int $curPos)\n {\n $aPosDirections = array($curPos, $curPos+1);\n $newPosKey = array_rand($aPosDirections);\n $newPos = $aPosDirections[$newPosKey];\n\n if($curRow == 0) {\n return $curPos;\n }else{\n return $newPos;\n }\n }", "public function randomMemberNOZero();", "private function move() {\n if ($this->facing === 'N') {\n $this->y++;\n } else if ($this->facing === 'E') {\n $this->x++;\n } else if ($this->facing === 'S') {\n $this->y--;\n } else if ($this->facing === 'W') {\n $this->x--;\n }\n \n // Check if we are still on the planet.\n if (($this->x < 0 || $this->x > $this->maxX) || ($this->y < 0 || $this->y > $this->maxY)) {\n // Out of safe planet boundaries.\n $this->crash = true;\n }\n }", "public function renderGameSetup(){\n $cells = $_SESSION['GameView::cellNumbers'];\n for ($ind=1;$ind<100;$ind++)\n {\n $cell1 = mt_rand(0,14);\n $cell2 = mt_rand(0,14);\n\n $temp = $cells[$cell1];\n $cells[$cell1] = $cells[$cell2];\n $cells[$cell2] = $temp;\n } \n return $cells;\n }" ]
[ "0.6807012", "0.6332468", "0.6327304", "0.6028362", "0.58834106", "0.5838774", "0.5755929", "0.5677716", "0.55795795", "0.55647016", "0.5538724", "0.5534853", "0.5519929", "0.55084825", "0.54879636", "0.54752654", "0.5428012", "0.5420906", "0.5418502", "0.54119855", "0.5338879", "0.5324206", "0.52878", "0.5283723", "0.5252809", "0.5200403", "0.5199484", "0.51751274", "0.5149834", "0.51317906", "0.50661695", "0.50487274", "0.5023075", "0.5018082", "0.5016064", "0.50080836", "0.5003932", "0.49677706", "0.49465692", "0.49257556", "0.49151152", "0.4900432", "0.4883912", "0.48821285", "0.48785302", "0.48751608", "0.48715374", "0.48595735", "0.48521137", "0.48402897", "0.48308784", "0.48272693", "0.48136038", "0.48089835", "0.47661102", "0.47651228", "0.47621307", "0.47596326", "0.4758092", "0.47502452", "0.47436157", "0.47436157", "0.47436157", "0.47436157", "0.47436157", "0.47383228", "0.47346443", "0.47312263", "0.47197372", "0.47050485", "0.47044218", "0.46998367", "0.46919766", "0.46919766", "0.46774277", "0.46750787", "0.46749115", "0.4672329", "0.46714363", "0.46571746", "0.46453753", "0.4642667", "0.46336734", "0.46322492", "0.46307826", "0.46137276", "0.46100163", "0.46065408", "0.4600624", "0.45748752", "0.45709744", "0.45673186", "0.45672932", "0.45672932", "0.45665607", "0.45607993", "0.4555821", "0.45507064", "0.4547668", "0.4530896", "0.4515337" ]
0.0
-1
return encoded image as string
public static function uploadImage($formname, $query, $params) { $image = base64_encode(file_get_contents($_FILES[$formname]['tmp_name'])); //create stream $options = array('http'=>array( 'method'=>"POST", 'header'=>"Authorization: Bearer 8f071a0c68940eb80440a1315f56c5d0b5657ca2\n". "Content-Type: application/x-www-form-urlencoded", 'content'=>$image )); $context = stream_context_create($options); $imgurURL = "https://api.imgur.com/3/image"; //check if size of image is less then 10mb if ($_FILES[$formname]['size'] > 10240000) { die('Image size too big, must be 10mb or less!'); } //open img file ussing HTTP headers set when creating stream $response = file_get_contents($imgurURL, false, $context); //return json object $response = json_decode($response); //get the url link to image from JSON as associative array $preparams = array($formname=>$response->data->link); //prepare arameters to match how parameters appear in the query $params = $preparams + $params; DB::query($query, $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function base64()\n {\n ob_start();\n\n imagepng($this->image);\n\n $string = ob_get_contents();\n\n ob_end_clean();\n\n return 'data:image/png;base64,'.base64_encode($string);\n }", "public function toEncodedURI() : string {\n\t\t\tif ($this->uri === null) {\n\t\t\t\t$this->uri = 'data:image/png;base64,' . urlencode(base64_encode($this->render()));\n\t\t\t}\n\t\t\treturn $this->uri;\n\t\t}", "public function getAsString() {\n\t\t$image = $this->getImage();\n\t\t$string = $image->toString();\n\n\t\tif ($string === false) {\n\t\t\t$this->handleError($image);\n\t\t} else {\n\t\t\treturn $string;\n\t\t}\n\t}", "protected function dumpImage():string{\n\t\tob_start();\n\n\t\ttry{\n\n\t\t\tswitch($this->options->outputType){\n\t\t\t\tcase QROutputInterface::GDIMAGE_GIF:\n\t\t\t\t\timagegif($this->image);\n\t\t\t\t\tbreak;\n\t\t\t\tcase QROutputInterface::GDIMAGE_JPG:\n\t\t\t\t\timagejpeg($this->image, null, max(0, min(100, $this->options->jpegQuality)));\n\t\t\t\t\tbreak;\n\t\t\t\t// silently default to png output\n\t\t\t\tcase QROutputInterface::GDIMAGE_PNG:\n\t\t\t\tdefault:\n\t\t\t\t\timagepng($this->image, null, max(-1, min(9, $this->options->pngCompression)));\n\t\t\t}\n\n\t\t}\n\t\t// not going to cover edge cases\n\t\t// @codeCoverageIgnoreStart\n\t\tcatch(Throwable $e){\n\t\t\tthrow new QRCodeOutputException($e->getMessage());\n\t\t}\n\t\t// @codeCoverageIgnoreEnd\n\n\t\t$imageData = ob_get_contents();\n\t\timagedestroy($this->image);\n\n\t\tob_end_clean();\n\n\t\treturn $imageData;\n\t}", "function encodeImage($path)\n{\n\t$type = pathinfo($path, PATHINFO_EXTENSION);\n\t$data = @file_get_contents($path);\n\t$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);\n\n\treturn $base64;\n}", "public function getEncoded();", "public static function base64Encode($imagefile){\n if( !($str = file_get_contents( $imagefile ))){\n return NULL;\n }\n $strEncoded = base64_encode($str);\n return $strEncoded;\n }", "public function getBase64Content(): string;", "function base64_encode_image ($filename=string,$filetype=string) {\n\t\tif ($filename) {\n\t\t\t$imgbinary = fread(fopen($filename, \"r\"), filesize($filename));\n\t\t\treturn base64_encode($imgbinary);\n\t\t}\n\t}", "public function getFileImage(): string\n {\n return (string) $this->fileImage;\n }", "public function getImage() : string\n {\n return $this->image;\n }", "public function getImage()\n\t{\n\t\treturn $this->generator->render($this->generateCode(), $this->params);\n\t}", "function output($im) {\r\n\t\t//capture output buffer\r\n\t\tob_start();\r\n\t\t\timagejpeg($im);\r\n\t\t\t$output = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\t//echo encoded image\r\n\t\techo base64_encode($output);\r\n\t\treturn;\r\n\t}", "public function base64encode($meu_captcha){\n\t\t\t$img = @file_get_contents( $meu_captcha );\n\n\t\t\t$img_64 = base64_encode( $img ); //codifica a imagem para a base64\n\t\t\t$img_64 = urlencode($img_64); // codifica a imagem para ser passada via url\n\n\t\t\treturn $img_64;\n\t\t}", "public function generateImageString($params = null)\n {\n $this->setDefineHeader(false)\n ->parseParams($params)\n ->prepareSourceImageData()\n ->validateSourceImagePath()\n ->parseSourceImageData()\n ->calculateRatio()\n ->prepareThumbData()\n ->calculateFactorHeight()\n ->calculateFactorWidth()\n ->calculateDestinationImageDimensions()\n ->calculateDestinationStartPoints();\n\n ob_start();\n $this->generateThumbnail();\n $imageString = ob_get_clean();\n ob_end_clean();\n\n $sourceImageType = pathinfo($this->getSourceFilePathName(), PATHINFO_EXTENSION);\n return 'data:image/'.$sourceImageType.';base64,'.base64_encode($imageString);\n }", "function base64_encode($data)\n{\n}", "function readyToSave($image) {\n return addslashes(file_get_contents($image['tmp_name'])); \n }", "function writeimage( $imagepath ) {\r\n global $CFG;\r\n\r\n if (empty($imagepath)) {\r\n return '';\r\n }\r\n\r\n $courseid = $this->course->id;\r\n if (!$binary = file_get_contents( \"{$CFG->dataroot}/$courseid/$imagepath\" )) {\r\n return '';\r\n }\r\n\r\n $content = \" <image_base64>\\n\".addslashes(base64_encode( $binary )).\"\\n\".\r\n \"\\n </image_base64>\\n\";\r\n return $content;\r\n }", "function getImage($id){\n\trequire_once __DIR__ . '/database_handler.php';\n\t$db = new database_handler();\n\t//$id = $_POST['id'];\n\t$imageQuery = \"SELECT image from IMAGE where id = '$id'\";\n\t$imageString=\"\";\n\tif(!$imageStmt = $db->con->prepare($imageQuery)){\n\t\t\techo \"Prepare failed: (\" . $db->con->errno . \")\" . $db->con->error;\n\t\t}\n\t\t$imageStmt->execute();\n\t\t$imageStmt->bind_result($imageString);\n\t\t$imageStmt->fetch();\n\t\t$imageStmt->close();\n\t\t$imageString = base64_encode($imageString);\n\t\treturn $imageString;\n}", "public function encodeImage()\r\n {\r\n if (!(($_FILES[\"file-select\"][\"type\"] == \"image/gif\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/jpeg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/jpg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/pjpeg\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/x-png\")\r\n || ($_FILES[\"file-select\"][\"type\"] == \"image/png\")))\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = lang('miiicloud-files-file_type_error');\r\n echo json_encode($data);\r\n return;\r\n }\r\n $size = $_FILES[\"file-select\"][\"size\"] / 1024;\r\n if ($_FILES[\"file-select\"][\"error\"] > 0)\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = $_FILES[\"file-select\"][\"error\"];\r\n }\r\n else if (intval($size)> 100000000)\r\n {\r\n $data['status'] = 'fail';\r\n $data['msg'] = lang('miiicloud-files-image_too_large');\r\n }\r\n else\r\n {\r\n $content = file_get_contents($_FILES[\"file-select\"][\"tmp_name\"]);\r\n $base64 = 'data:' . $_FILES[\"file-select\"][\"type\"] . ';base64,' . base64_encode($content);\r\n $data['status'] = 'ok';\r\n $data['type'] = $_FILES[\"file-select\"][\"type\"];\r\n $data['name'] = $_FILES[\"file-select\"][\"name\"];\r\n $data['base64'] = $base64;\r\n $data['size'] = $size;\r\n }\r\n echo json_encode($data);\r\n }", "abstract public function encode();", "public function getImageResource()\n {\n return imagecreatefromstring($this->getRaw());\n }", "public function getIconData()\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ3SURBVDjLpZNtSNNRFIcNKunF1rZWBMJqKaSiX9RP1dClsjldA42slW0q5oxZiuHrlqllLayoaJa2jbm1Lc3QUZpKFmmaTMsaRp+kMgjBheSmTL2//kqMBJlFHx44XM7vOfdyuH4A/P6HFQ9zo7cpa/mM6RvCrVDzaVDy6C5JJKv6rwSnIhlFd0R0Up/GwF2KWyl01CTSkM/dQoQRzAurCjRCGnRUUE2FaoSL0HExiYVzsQwcj6RNrSqo4W5Gh6Yc4+1qDDTkIy+GhYK4nTgdz0H2PrrHUJzs71NQn86enPn+CVN9GnzruoYR63mMPbkC59gQzDl7pt7rc9f7FNyUhPY6Bx9gwt4E9zszhWWpdg6ZcS8j3O7zCTuEpnXB+3MNZkUUZu0NmHE8XsL91oSWwiiEc3MeseLrN6woYCWa/Zl8ozyQ3w3Hl2lYy0SwlCUvsVi/Gv2JwITnYPDun2Hy6jYuEzAF1jUBCVYpO6kXo+NuGMeBAgcgfwNkvgBOPgUqXgKvP7rBFvRhE1crp8Vq1noFYSlacVyqGk0D86gbART9BDk9BFnPCNJbCY5aCFL1Cyhtp0RWAp74MsKSrkq9guHyvfMTtmLc1togpZoyqYmyNoITzVTYRJCiXYBIQ3CwFqi83o3JDhX6C0M8XsGIMoQ4OyuRlq1DdZcLkmbgGDX1iIEKNxAcbgTEOqC4ZRaJ6Ub86K7CYFEo8Qo+GBQlQyXBczLZpbloaQ9k1NUz/kD2myBBKxRZpa5hVcQslalatoUxizxAVVrN3CW21bFj9F858Q9dnIRmDyeuybM71uxmH9BNBB1q6zybV7H9s1Ue4PM3/gu/AEbfqfWy2twsAAAAAElFTkSuQmCC';\n }", "public function getIconData()\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ3SURBVDjLpZNtSNNRFIcNKunF1rZWBMJqKaSiX9RP1dClsjldA42slW0q5oxZiuHrlqllLayoaJa2jbm1Lc3QUZpKFmmaTMsaRp+kMgjBheSmTL2//kqMBJlFHx44XM7vOfdyuH4A/P6HFQ9zo7cpa/mM6RvCrVDzaVDy6C5JJKv6rwSnIhlFd0R0Up/GwF2KWyl01CTSkM/dQoQRzAurCjRCGnRUUE2FaoSL0HExiYVzsQwcj6RNrSqo4W5Gh6Yc4+1qDDTkIy+GhYK4nTgdz0H2PrrHUJzs71NQn86enPn+CVN9GnzruoYR63mMPbkC59gQzDl7pt7rc9f7FNyUhPY6Bx9gwt4E9zszhWWpdg6ZcS8j3O7zCTuEpnXB+3MNZkUUZu0NmHE8XsL91oSWwiiEc3MeseLrN6woYCWa/Zl8ozyQ3w3Hl2lYy0SwlCUvsVi/Gv2JwITnYPDun2Hy6jYuEzAF1jUBCVYpO6kXo+NuGMeBAgcgfwNkvgBOPgUqXgKvP7rBFvRhE1crp8Vq1noFYSlacVyqGk0D86gbART9BDk9BFnPCNJbCY5aCFL1Cyhtp0RWAp74MsKSrkq9guHyvfMTtmLc1togpZoyqYmyNoITzVTYRJCiXYBIQ3CwFqi83o3JDhX6C0M8XsGIMoQ4OyuRlq1DdZcLkmbgGDX1iIEKNxAcbgTEOqC4ZRaJ6Ub86K7CYFEo8Qo+GBQlQyXBczLZpbloaQ9k1NUz/kD2myBBKxRZpa5hVcQslalatoUxizxAVVrN3CW21bFj9F858Q9dnIRmDyeuybM71uxmH9BNBB1q6zybV7H9s1Ue4PM3/gu/AEbfqfWy2twsAAAAAElFTkSuQmCC';\n }", "public function getBase64(): string;", "function base64Encode($plain) {\n\n // Initialise output variable\n\n $output = \"\";\n\n \n\n // Do encoding\n\n $output = base64_encode($plain);\n\n \n\n // Return the result\n\n return $output;\n\n}", "public function base64EncodeImage($strPrefix = false)\r\n\t\t {\r\n\t\t\t$strSourcePath = $this->objParent->target_path;\r\n\t\t\t$strReturn = false;\r\n\t\t\tif (file_exists($strSourcePath))\r\n\t\t\t{\r\n\t\t\t\t$strImageBinay = fread(fopen($strSourcePath, \"r\"), filesize($strSourcePath));\r\n \t\t\t$strReturn = ((bool) $strPrefix ? 'data:image/' . $this->getImageExtension() . ';base64,' : '') . base64_encode($strImageBinay);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ($strReturn);\r\n\t\t }", "public function getImage()\n {\n if($this->img)\n {\n ob_start();\n if(!imagejpeg($this->img, null, $this->quality))\n {\n ob_end_flush();\n throw new QR_CodeImageException('Could not create a jpeg out of the image buffer!');\n }\n $out = ob_get_clean();\n return $out;\n }\n throw new QR_CodeImageException('No image data available!');\n }", "public function toJpeg()\n {\n return $this->filter('conv', ['f' => 'jpg']);\n }", "public function encodeBlob( $b ) {\n\t\treturn $b;\n\t}", "public function getImageAttribute(): string\n {\n $gettyImage = new GettyImage($this->getty_image, 0);\n\n return $gettyImage->outputImage();\n }", "public function getBase64Image( Request $request ) {\n\t\t$this->validate( $request, [\n\t\t\t'image_data' => 'required'\n\t\t] );\n\t\t$image = str_replace( '_', '/', $request->image_data );\n\n\t\techo str_replace( '-', '+', $image );\n\t\texit;\n\t}", "function base64_to_jpeg($base64_string, $output_file) {\r\n $ifp = fopen($output_file, \"wb\");\r\n fwrite($ifp, base64_decode($base64_string));\r\n fclose($ifp);\r\n return $output_file;\r\n}", "public function imageToASCII($image){\n $image = 'image.jpg'; \n // Supports http if allow_url_fopen is enabled \n $image = file_get_contents($image); \n $img = imagecreatefromstring($image); \n\n $width = imagesx($img); \n $height = imagesy($img); \n\n for($h=0;$h<$height;$h++){ \n for($w=0;$w<=$width;$w++){ \n $rgb = imagecolorat($img, $w, $h); \n $a = ($rgb >> 24) & 0xFF; \n $r = ($rgb >> 16) & 0xFF; \n $g = ($rgb >> 8) & 0xFF; \n $b = $rgb & 0xFF; \n $a = abs(($a / 127) - 1); \n if($w == $width){ \n echo '<br>'; \n }else{ \n echo '<span style=\"color:rgba('.$r.','.$g.','.$b.','.$a.');\">#</span>'; \n } \n } \n } \n }", "function string2image($string) {\n\t\t$converted = imagecreatefromstring($string);\n\t\tob_start();\n\t\timagepng($converted);\n\t\t$contents = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn \"<img src='data:image/png;base64,\".base64_encode($contents).\"' />\";\n\t\timagedestroy($converted);\n\t}", "function base64_to_jpeg($base64_string, $output_file) {\r\n $ifp = fopen( $output_file, 'wb' ); \r\n\r\n // split the string on commas\r\n // $data[ 0 ] == \"data:image/png;base64\"\r\n // $data[ 1 ] == <actual base64 string>\r\n $data = explode( ',', $base64_string );\r\n\r\n // we could add validation here with ensuring count( $data ) > 1\r\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\r\n\r\n // clean up the file resource\r\n fclose( $ifp ); \r\n\r\n return $output_file; \r\n}", "function Base64Encode( $str )\n{ \n return substr(chunk_split(base64_encode( $str ),64,\"\\n\"),0,-1).\"\\n\";\n}", "private static function encode($string)\n {\n return base64_encode($string);\n }", "function enc($data)\n {\n return base64_encode($data);\n }", "public function base64_encode_image($filename = string, $filetype = string)\n {\n if ($filename) {\n $imgbinary = fread(fopen($filename, \"r\"), filesize($filename));\n \n return 'data:image/png;base64,' . base64_encode($imgbinary);\n }\n }", "public function getImage() : ?string\n {\n return $this->image;\n }", "public function base64_encode_image ($filename, $filetype) {\n\n if (is_file($filename) || (is_string($filename) && (strlen($filename) > 0))) {\n\n $imgbinary = fread(fopen($filename, \"r\"), $this->find_filesize($filename));\n\n return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary);\n\n }else{\n\n if(!is_file($filename)){\n\n error_log(__LINE__.'base64_encode_image() NOT IS_FILE!!');\n\n }\n\n if(!is_string($filename) && (strlen($filename) > 0)){\n\n error_log(__LINE__.'base64_encode_image() NOT IS_STRING!!');\n\n }\n\n }\n\n }", "function base64Encode($plain) {\n // Initialise output variable\n $output = \"\";\n \n // Do encoding\n $output = base64_encode($plain);\n \n // Return the result\n return $output;\n}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function base64_to_jpeg( $base64_string, $output_file ) {\r\n $ifp = fopen( $output_file, \"wb\" ); \r\n fwrite( $ifp, base64_decode( $base64_string) ); \r\n fclose( $ifp ); \r\n return( $output_file ); \r\n }", "public function testImageInfoIsEncodedCorrectlyWithMimeType()\n {\n // The model must be used here or any `'` in the blob must be escaped.\n $imageBlob = file_get_contents(\"/var/www/html/tests/fixtures/image.png\");\n Entry::create(1, 1, '2020-01-01', 'content', $imageBlob);\n\n Session::getInstance()->setUser(User::login(\"someuser\", \"password\"));\n $entries = Entry::getEntriesForCurrentUser();\n $formatted = $entries[0]->getEncodedImage();\n\n $this->assertEquals($formatted, \"data:image/png;base64,\" . base64_encode($imageBlob));\n }", "function base64_to_jpeg($base64_string, $output_file) {\n \n\t// apre in lettura il file\n $ifp = fopen( $output_file, 'wb' ); \n\n // divide il contenuto della stringa per eliminare il tag\n $data = explode( ',', $base64_string );\n\n // scrive nel file\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // chiude il file\n fclose( $ifp ); \n\n\t// restituisce il file\n return $output_file; \n}", "public function getFileFondimage(): string\n {\n return (string) $this->fileFondimage;\n }", "public function handle($imageData)\n\t{\n\t\t$image = Image::make($imageData);\n\t\t$image->fit(50, 50);\n\t\treturn (string) $image->encode();\n\t}", "public static function generateBase64($path = null) {\n\n if(isset($path)) {\n\n $img = Image::make(public_path('storage/'.$path));\n\n $data = (string) $img->encode('data-url', 60);\n\n return $data;\n\n } else {\n throw new ImageUploaderException(\n \"Path is empty\"\n );\n }\n\n }", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "function base64_to_jpeg($base64_string, $output_file) {\n $ifp = fopen( $output_file, 'wb' ); \n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode( ',', $base64_string );\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite( $ifp, base64_decode( $data[ 1 ] ) );\n\n // clean up the file resource\n fclose( $ifp ); \n\n return $output_file; \n}", "public function __toString ()\r\n\t{\r\n\t\tif ($this->type != self::IMAGESHOW_TYPE) {\r\n\t\t\t// TODO: add a byte (or bit) somewhere to force redownload\r\n\t\t\t$binary = pack('cccV', $this->type, $this->duration, 0,\r\n\t\t\t$this->media_id);\r\n\t\t\tif ($this->type == self::IMAGE_TYPE ||\r\n\t\t\t $this->type == self::VIDEO_TYPE ||\r\n\t\t\t $this->type == self::POWERPOINT_TYPE) {\r\n\t\t\t\t// 11 for the item/type headers and 5 for the extension\r\n\t\t\t\t$binary .= pack('Va5', 11 + 5,\r\n\t\t\t\tpathinfo($this->filename, PATHINFO_EXTENSION));\r\n\t\t\t}\r\n\t\t\treturn $binary;\r\n\t\t}\r\n\t}", "function returnImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n\n $fd = fopen($image, \"r\");\n $content = fread( $fd, filesize($image) );\n fclose($fd);\n return $content;\n }", "public function encode(string $string): string\n {\n return base64_encode($string);\n }", "public function image_url_to_base64(string $url): string\n {\n $client = new GuzzleHttp\\Client();\n $response = $client->get($url);\n \n return base64_encode($response->getBody());\n }", "public function assemble() {\n $image_check = $this->_checkImage();\n // Image check is bad so we pass control back to the old OsC image wrapper\n if ( 'abort' == $image_check ) {\n return false;\n }\n // If we have to only we generate a thumb .. this is very resource intensive\n if ( 'no_thumb_required' !== $image_check ) {\n $this->_generateThumbnail();\n }\n $this->_build();\n return (string)$this; \n }", "public function build()\n {\n if ($this->_inline) {\n $encoded_image = base64_encode(file_get_contents($this->_attributes['src']));\n $mime_type = image_type_to_mime_type($this->_image_type);\n $this->_attributes['src'] = \"data:{$mime_type};base64,{$encoded_image}\";\n\n if (isset($this->_attributes['async'])) {\n unset($this->_attributes['async']);\n }\n }\n\n $attributes = join(' ', $this->_makeAttributesArr());\n if (!empty($attributes)) {\n $attributes = ' ' . $attributes;\n }\n return \"<img{$attributes}>\";\n }", "public function render(): string\n {\n $image_attributes = '';\n foreach ($this->attributes as $attribute => $value) {\n if (\n is_string($attribute) &&\n is_string($value) &&\n in_array($attribute, Settings::ignoredCustomAttributes()) === false\n ) {\n $image_attributes .= \"{$attribute}=\\\"{$value}\\\" \";\n }\n }\n return \"<img src=\\\"{$this->insert}\\\" {$image_attributes}/>\";\n }", "function generateQRImageTag( $identifier){\n\n ob_start();\n QRCode::png($identifier,false,'L',9,2);\n $imageString = base64_encode(ob_get_clean());\n return '<img src =\"data:image/png;base64,'.$imageString.'\"/>';\n }", "function base64_to_jpeg($base64_string, $output_file)\n{\n $ifp = fopen($output_file, 'wb');\n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode(',', $base64_string);\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite($ifp, base64_decode($data[1]));\n\n // clean up the file resource\n fclose($ifp);\n\n return $output_file;\n}", "public function __toString()\n {\n return \"This is an instance of Mysidia Image class.\";\n }", "function get_court_pic($img)\n{\n\tdefine('UPLOAD_DIR', 'CourtPics/');\n\t$img \t= str_replace('data:image/png;base64,', '', $img);\n\t$img \t= str_replace(' ', '+', $img);\n\t$data \t= base64_decode($img);\n $file \t= UPLOAD_DIR . uniqid() . '.jpg';\n $success = file_put_contents($file, $data);\n \n\treturn $success ? $file : 'some problem occured';\n}", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "public function __toString(){\r\n\t\t$data = serialize($this->_data);\r\n\t\t// Obfuscate the data with base64 encoding\r\n\t\t$data = base64_encode($data);\r\n\t\treturn $data;\r\n\t}", "function encode_base64($sData){\n $sBase64 = base64_encode($sData);\n return strtr($sBase64, '+/', '-_'); \n }", "public function getStringForBinary() {\n @trigger_error('getStringForBinary() is deprecated in 8.x-2.3, will be removed in 8.x-3.0. Use ::toString() instead. See https://www.drupal.org/project/imagemagick/issues/2925780.', E_USER_DEPRECATED);\n return $this->toString(self::POST_SOURCE);\n }", "public function base64_to_jpeg($base64_string) {\n\t\t $src = 'data:image/jpg;base64,'.$base64_string;\n\t\t return $src;\n\t\t}", "private function getImg()\n\t{\n\t\t$buffer = '&nbsp;';\n\t\t\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn $buffer;\n\t\t\n\t\t$buffer = '<img src=\"../../thumbs/'.$this->aImg['sFilename'].'\" />';\t\t\n\t\t\n\t\treturn $buffer;\n\t}", "public function getImageUrl()\n {\n return (string)$this->_getImageHelper()->init($this, 'image')->resize(265);\n }", "function image2string($file_name) {\n\t \n\t //load the native CI Image_lib\n\t\t$this->CI->load->library('image_lib');\n\t\t\n\t\t//change the 'upload' to your own image storage folder's name\n\t\t//and place it on root folder (beside application and system)\n\t\t$image_lib['source_image'] = getcwd().'/uploads/'.$file_name;\n\t\t\n //let the maintain_ratio TRUE if you don't want the image get stretched\n\t\t$image_lib['maintain_ratio'] = TRUE;\n\t\t\n\t\t//set the width or height of the image to you likings\n\t\tif ($upload_data['image_width'] > $upload_data['image_height']) {\n\t\t\n\t\t //for landscape\n\t\t\t$image_lib['width'] = 400;\n\t\t\t$image_lib['height'] = 300;\n\t\t} else {\n\t\t\n\t\t //for portrait\n\t\t\t$image_lib['width'] = 300;\n\t\t\t$image_lib['height'] = 400;\n\t\t}\n\t\t$this->CI->image_lib->initialize($image_lib);\n\t\t$this->CI->image_lib->resize();\n\n //load file helper so we can read the images contents\n\t\t$this->CI->load->helper('file');\n\t\t\n\t\t//set the function to return the image string\n\t\treturn read_file(base_url().'uploads/'.$upload_data['file_name']);\n\t\t\n //in case you no longer need the image file, just delete it with unlink\n\t\tunlink(getcwd().'/uploads/'.$upload_data['file_name']);\n\t\t\n\t}", "public function getImageQuery()\n {\n $command = '';\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $command .= $effect->__toString() . '&';\n }\n }\n\n $command .= 'Quality;' . $this->quality . '&';\n\n // Support for named default image.\n if ($this->fallbackImg)\n {\n $command .= 'FallbackImg;' . $this->fallbackImg . '&';\n }\n\n // Podpora pro možnost definovat cílový formát ukládaného obrázku.\n if ($this->saveAs)\n {\n $command .= $this->saveAs === EPictureFormat::WEBP\n ? 'WebP&'\n : \"SaveAs;$this->saveAs&\";\n }\n\n // Podpora pro progresivní uložení obrázku.\n if($this->progressive)\n {\n $command .= 'Progressive&';\n }\n\n return substr($command, 0, strlen($command) - 1);\n }", "function base64_to_jpeg( $inputfile, $outputfile ) { \n $ifp = fopen( $inputfile, \"rb\" ); \n $imageData = fread( $ifp, filesize( $inputfile ) ); \n fclose( $ifp ); \n /* encode & write data (binary) */ \n $ifp = fopen( $outputfile, \"wb\" ); \n fwrite( $ifp, base64_decode( $imageData ) ); \n fclose( $ifp ); \n /* return output filename */ \n return( $outputfile ); \n }", "function base64_to_jpeg($base64_string, $output_file)\n {\n $ifp = fopen($output_file, 'wb');\n\n // split the string on commas\n // $data[ 0 ] == \"data:image/png;base64\"\n // $data[ 1 ] == <actual base64 string>\n $data = explode(',', $base64_string);\n\n // we could add validation here with ensuring count( $data ) > 1\n fwrite($ifp, base64_decode($data[1]));\n\n // clean up the file resource\n fclose($ifp);\n return $output_file;\n }", "function _get_ico_data() {\n\t\tif ( ! is_array( $this->_images ) || empty( $this->_images ) )\n\t\t\treturn false;\n\t\t\n\t\t\n\t\t$data = pack( 'vvv', 0, 1, count( $this->_images ) );\n\t\t$pixel_data = '';\n\t\t\n\t\t$icon_dir_entry_size = 16;\n\t\t\n\t\t$offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) );\n\t\t\n\t\tforeach ( $this->_images as $image ) {\n\t\t\t$data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset );\n\t\t\t$pixel_data .= $image['data'];\n\t\t\t\n\t\t\t$offset += $image['size'];\n\t\t}\n\t\t\n\t\t$data .= $pixel_data;\n\t\tunset( $pixel_data );\n\t\t\n\t\t\n\t\treturn $data;\n\t}", "function encode(String $data)\n\t{\n\n\t\treturn base64_encode($data) ?? false;\n\n\t}", "public function getEncoding()\n {\n if (!isset($this->encoding)) {\n $encoding = ps_get_parameter($this->document->resource, 'imageencoding', $this->id);\n $this->encoding = $encoding === 'hex' ? self::ENCODING_HEX : self::ENCODING_85;\n }\n\n return $this->encoding;\n }", "abstract public static function encode($data): string;", "function EncodeBase64( $string )\n\t{\n\t\treturn base64_encode( $string );\n\t}", "public function toPng()\n {\n return $this->filter('conv', ['f' => 'png']);\n }", "public function getImageAttribute(): string\n {\n $gettyImage = new GettyImage($this->getty_image, 1);\n\n if ($this->getty_image == \"\") {\n return '<div class=\"noImage\"><i class=\"fa fa-user\"></i></div>';\n }\n else {\n return $gettyImage->outputImage();\n }\n }", "final public function getImage() {\n\t\t\tif(strlen($this->text) === 0)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$data = $this->getTCPDFBarcode()->getBarcodeArray();\n\t\t\tif($data === false)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$image = new Image($data['maxw'], $data['maxh']);\n\t\t\t\n\t\t\t$x = 0;\n\t\t\tforeach($data['bcode'] as $bar) {\n\t\t\t\tfor($i = 0; $i < $bar['w']; ++$i) {\n\t\t\t\t\tfor($y = 0; $y < $bar['h']; ++$y)\n\t\t\t\t\t\t$image->setPixel($x + $i, $bar['p'] + $y, (int)$bar['t']);\n\t\t\t\t}\n\t\t\t\t$x += $bar['w'];\n\t\t\t}\n\t\t\t\n\t\t\treturn $image;\n\t\t}", "public static function makeFromEncoded($image) {\n define (\"MAX_SIZE\",\"5000\");\n\n if (startsWith($image, \"data:image/png;base64,\")) {\n $image = str_replace('data:image/png;base64,', '', $image);\n } else if (startsWith($image, \"data:image/jpeg;base64,\")) {\n $image = str_replace('data:image/jpeg;base64,', '', $image);\n } else {\n if (startsWith($image, \"data:image/\")) {\n echo \"Unsupported filetype [\".substr($image, 11, 4).\"]. Please use JPG or PNG\";\n } else {\n echo \"Unsupported filetype [UNKNOWN]. Please use JPG or PNG\";\n }\n return null;\n }\n\n $image = str_replace(' ', '+', $image);\n\n if (!$image) {\n echo \"I have no idea why... But this didn't work...\";\n return null;\n }\n\n $uploadedfile = base64_decode($image);\n if (!$uploadedfile) {\n echo \"Sorry. We could not process this photo. [ERROR CODE 2]\";\n return null;\n }\n return $uploadedfile;\n }", "function base64_to_jpeg($base64_string, $output_file) {\n\t $ifp = fopen($output_file, \"wb\");\n\n\t $data = explode(',', $base64_string);\n\n\t fwrite($ifp, base64_decode($data[1]));\n\t fclose($ifp);\n\n\t return $output_file;\n\t}", "public function getImage() {\n //return the value image\n return $this->AdvertImage;\n }", "public function encode($data);", "public function encode($data);", "public function encode($data);", "private static function gdImgToBase64($gdImg, $format = 'jpeg')\n\t{\n\t\t$data = null;\n\t\t\n\t\t// known ext?\n\t if (self::getExtension($format) !== null) {\n\t ob_start();\n\t\n\t if ($format == 'jpeg' ) {\n\t imagejpeg($gdImg, null, 99);\n\t } elseif ($format == 'png') {\n\t imagepng($gdImg);\n\t } elseif ($format == 'gif') {\n\t imagegif($gdImg);\n\t } else {\n\t throw new \\InvalidArgumentException('Invalid image format: ' . $format);\n\t }\n\t\n\t $data = ob_get_contents();\n\n\t ob_end_clean();\n\t }\n\t\n\t return $data;\n\t}", "function base64_png_img_tag($base64_png) {\n $tag = \"<img style='display:block;' id='base64image' \" . \n \"src='data:image/png;base64, \" . $base64_png . \"' />\";\n return $tag;\n}", "public function encode()\n {\n }", "public function getImage()\n {\n if (is_null($this->captcha)) {\n \\BDC_HttpHelper::BadRequest('captcha');\n }\n\n // identifier of the particular Captcha object instance\n $instanceId = $this->getInstanceId();\n if (is_null($instanceId)) {\n \\BDC_HttpHelper::BadRequest('instance');\n }\n\n // response headers\n \\BDC_HttpHelper::DisallowCache();\n\n // response MIME type & headers\n $mimeType = $this->captcha->CaptchaBase->ImageMimeType;\n header(\"Content-Type: {$mimeType}\");\n\n // we don't support content chunking, since image files\n // are regenerated randomly on each request\n header('Accept-Ranges: none');\n\n // image generation\n $rawImage = $this->captcha->CaptchaBase->GetImage($instanceId);\n $this->captcha->CaptchaBase->SaveCodeCollection();\n\n $length = strlen($rawImage);\n header(\"Content-Length: {$length}\");\n return $rawImage;\n }", "function getEncodedString($type, $file) {\n\treturn 'data:audio/' . $type . ';base64,' . base64_encode(file_get_contents($file));\n}", "public function serialize()\n {\n $data = parent::serialize();\n $crypt = $this->getCrypt();\n $data = $crypt->encrypt($data);\n $data = base64_encode($data);\n return ($data);\n }", "public function getImageName();", "public function getEncoder();", "public function getEncoder();" ]
[ "0.753947", "0.71419525", "0.7137143", "0.6902758", "0.6886801", "0.6709782", "0.6605621", "0.66046065", "0.65861344", "0.6503917", "0.6462494", "0.64574516", "0.6378609", "0.62408894", "0.6157885", "0.61287796", "0.6127807", "0.6124351", "0.6118434", "0.6097813", "0.6088528", "0.6063171", "0.60573274", "0.60573274", "0.6034234", "0.60275537", "0.59915537", "0.5972909", "0.5959743", "0.5951423", "0.59480554", "0.5939387", "0.5938249", "0.5907962", "0.5895036", "0.58648556", "0.58620167", "0.5852325", "0.58461994", "0.58187073", "0.5807696", "0.5794879", "0.5790277", "0.57829607", "0.5780279", "0.5767896", "0.5766448", "0.576561", "0.5751412", "0.5740207", "0.57387155", "0.57387155", "0.57387155", "0.5737372", "0.5730005", "0.5728024", "0.57258564", "0.5724217", "0.57199603", "0.57161313", "0.5681964", "0.56748885", "0.56713194", "0.5668248", "0.56586206", "0.56586206", "0.56586206", "0.56586206", "0.56532514", "0.5644937", "0.56383806", "0.5630805", "0.5622802", "0.561933", "0.5612806", "0.5600422", "0.55986977", "0.5590203", "0.55808", "0.55802995", "0.5579817", "0.5576657", "0.5570174", "0.55675435", "0.55664426", "0.55458534", "0.5544578", "0.55427754", "0.5528553", "0.55271626", "0.55271626", "0.55271626", "0.5526303", "0.5523202", "0.55194545", "0.5495691", "0.54947144", "0.5491002", "0.5490404", "0.54866123", "0.54866123" ]
0.0
-1
Test for a valid login.
public function login($email, $password) { $sql =<<<SQL SELECT * from $this->tableName where email=? SQL; $pdo = $this->pdo(); $statement = $pdo->prepare($sql); $statement->execute(array($email)); if ($statement->rowCount() === 0) { return null; } // Test salted password $row = $statement->fetch(\PDO::FETCH_ASSOC); $hash = $row['password']; $salt = $row['salt']; if ($hash !== hash("sha256", $password . $salt)) { return null; } return new User($row); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLoginValid(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => 'Wrong'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertTrue($validLogin);\r\n\t\t}", "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public function _check_login()\n {\n\n }", "protected function checkLogin()\n {\n if (LOCATION == 'Live') {\n $this->markTestSkipped('Cannot run in Live environment');\n return;\n }\n $this->loginPage->open()\n ->navigateToContactUsViaSideButton()\n ->open()\n ->verifyPageIsLoaded()\n ->checkPageTitle('log in to My Account')\n ->enterUserId($this->userData['standard']['uid'])\n ->enterUserPassword($this->userData['standard']['pwd'])\n ->clickButton();\n }", "public function loginCheck()\n\t{\n\t}", "public function testLoginUsername(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => 'thisisit'\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginname(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => '',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }", "public function testValidLogin()\n {\n Admin::create([\n 'first_name' => 'First',\n 'last_name' => 'Last',\n 'email' => '[email protected]',\n 'password' => 'pass',\n ]);\n\n // Confirm not initially logged in\n $this->assertFalse(Auth::check());\n\n // Log in the user\n $response = $this->post('admin', [\n 'email' => '[email protected]',\n 'password' => 'pass',\n ]);\n\n // The response redirects back to the login page. A middleware will\n // then redirect to the first page of the admin\n $response->assertRedirect('admin');\n\n // Check that we're logged in now\n $this->assertTrue(Auth::check());\n $this->assertEquals('[email protected]', Auth::user()->email);\n }", "public function validateLogin()\n {\n $result = false;\n if (strlen($this->login) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function test_valid_user_login()\n {\n Session::start();\n $response = $this->call('POST', '/login', [\n 'email' => '[email protected]',\n 'password' => 'password',\n '_token' => csrf_token()\n ]);\n $response->assertStatus(302);\n $response->assertRedirect('/home');\n }", "function validate_login($username, $password){\n if (empty($this->username) or empty($this->password)){\n // User has not set its credentials\n print 'Error user has not set user and password.';\n return False;\n }\n if (empty($username) or empty($password)){\n // Empty username or password\n print 'Cannot ser username or password as null.';\n return False;\n }\n if ($username == $this->username and $password == $this->password){\n print 'Username and password are correct.';\n return True;\n }\n }", "private function compare_with_login()\n {\n }", "public function isLogin();", "function is_login()\n {\n }", "public function testDoLogin()\n {\n $mockUser = new User(\"[email protected]\", \"Some User\", \"asdf\", \"student\");\n $mockUser->insert();\n\n // Invalid email\n $this->assertFalse(User::doLogin(\"nonexistant\", \"lol\"));\n\n // Invalid password\n $this->assertFalse(User::doLogin(\"[email protected]\", \"lol\"));\n\n // Valid everything\n $this->assertTrue(User::doLogin(\"[email protected]\", \"asdf\"));\n }", "function testLoginFail()\r\n {\r\n \t$this->User = new User();\r\n \t//check with wrong email and wrong pass\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid password but wrong email\r\n\t\t$this->assertFalse( $this->User->login('wrongemail', 'password') );\r\n\t\t\r\n\t\t//check with valid email but wrong pass\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', 'wrongpass') );\r\n\t\t\r\n\t\t//check with valid email but no password\r\n\t\t$this->assertFalse( $this->User->login('[email protected]', '') );\r\n\t\t\r\n\t\t//check with empty user-data\r\n\t\t$this->assertFalse( $this->User->login('', '') );\r\n\t}", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function tests_if_user_can_login()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Sign in')\n\n ->seePageIs('/backend')\n ->see('Welcome to SocietyCMS');\n }", "function doLogin($username,$password)\n{\n // check password\n return true;\n //return false if not valid\n}", "public function isValidLogin($email, $password);", "function is_login ()\r\n {\r\n if (($this->get_login()) && ($this->get_id() != USER_ID_RESET_VALUE) && ($this->get_name() != USER_NAME_RESET_VALUE) && ($this->get_name() != \"\"))\r\n return TRUE;\r\n return FALSE;\r\n }", "public function validate_login() {\n\t\t$userid=$_POST['user_id'];\n\t\t$password=$_POST['password'];\n\t\t$compid=$_POST['company_id'];\n\t\t\n\n\t\t$sql=\"SELECT u.id, u.user_name FROM users u, hmz_cust_info ci where ci.id=u.cust_id\n\t\t\tand u.user_id='$userid' and u.password='$password' and ci.cust_id='$compid';\";\n\t\t$result=$this->runQuery(\"getAll\",$sql);\n\t\tif(count($result)>0) {\n\t\t\t$_SESSION['user_id']=$result[0];\n\t\t\t$_SESSION['user_name']=$result[1];\n\t\t\theader('location: ?a=P&b=dashboard');\n\t\t}\n\t\telse\n\t\t\theader('location: ?a=login&b=f');\n\n\t}", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function testLoginValidationLog() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'aaaaa', 'password' => ''])\n ->see('Please enter a valid password.');\n }", "protected function isUserAllowedToLogin() {}", "public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "public function testValidUserLogin()\n {\n $this->withoutExceptionHandling();\n\n //Create test user from factory\n User::factory(1)->create();\n\n $credentials = [\n \"email\" => \"[email protected]\",\n \"password\" => \"1234\",\n ];\n\n $response = $this->post(route(\"login.attempt\"),$credentials);\n\n $response->assertRedirect(route(\"account.dashboard\"));\n }", "public function test_login4()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('12345678','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }", "public function testCanLogIn() {\n $this->session->visit($this->baseUrl);\n $page = $this->session->getPage();\n\n // log in\n $form = $page->find('css', '#login');\n $form->fillField('username', 'testuser');\n $form->fillField('password', 'testpassword');\n\n $this->assertInstanceOf(NodeElement::Class, $form, 'Unable to locate login form');\n\n $form->submit();\n\n // check if we're logged in (should contain a h1)\n $this->assertInstanceOf(\n NodeElement::Class,\n $page->find('css', 'h1'),\n 'page should have a h1 when logged in (is the test user in the db?)'\n );\n\n // reload page\n $this->session->visit($this->baseUrl);\n $page = $this->session->getPage();\n\n // Check that we are still logged in\n $this->assertInstanceOf(\n NodeElement::Class,\n $page->find('css', 'h1'),\n 'Logged out after reload'\n );\n\n }", "public function testLoginCorrect()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login')\n ->assertSee('Password')\n ->type('username', 'peinfant')\n ->type('password', 'pablo1')\n ->press('Login')\n ->assertPathIs('/admin/index')\n ->assertSee('Welcome')\n ->clickLink('Logout');\n\n $browser->assertSee('Login')\n ->assertSee('Password');\n });\n }", "public function login()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public static function verifyLogin():bool\n\t{\n\n\t\tif (\n\t\t\t!isset($_SESSION[User::SESSION])\n\t\t\t||\n\t\t\t!$_SESSION[User::SESSION]\n\t\t\t||\n\t\t\t!(int)$_SESSION[User::SESSION]['iduser'] > 0\n\t\t)\n\t\t{\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t} \n\n\t}", "function testLoginSuccess()\r\n\t{\r\n \t$state = $this->User->login('[email protected]', 'password');\r\n\t\t$this->assertTrue($state);\r\n\t}", "public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLogin()\n\t{\n\t\t// Set up parameters.\n\t\t$user = array(\n\t\t\t'email' => '[email protected]', \n\t\t\t'password' => 'Welkom01'\n\t\t);\n\n\t\t// Check if this user can login.\n\t\t$this->assertTrue(Auth::attempt($user));\n\t}", "public function testLoginWithoutUserName() : void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userFake[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserName' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserName' );\n $this->assertCount(2, $res, 'testLoginWithoutUserName' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserName' );\n }", "public function testFakeLogin()\n {\n Auth::attempt(['email'=>'[email protected]','password'=>'fake123']);\n $this->assertNotTrue(Auth::check());\n }", "public function isLoginRequired()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function validateLogin() {\n $email = valOr($_REQUEST,'email','');\n $password = valOr($_REQUEST,'pwd','');\n\n $stmt = $this->hcatServer->dbh->prepare(\"select * from hcat.user where email=:email\");\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n $_SESSION['email']='';\n $_SESSION['uid']=0;\n\n $message = '';\n if (sizeof($rows)==1) {\n $hash = $rows[0]['pwdhash'];\n if ( password_verify ( $password , $hash )) {\n $_SESSION['email']=$email;\n $_SESSION['uid']=$rows[0]['uid'];\n $this->hcatServer->setLogin();\n\n } else {\n $message = 'Bad password';\n }\n\n } else {\n $message = 'Bad email';\n }\n\n\n $_SESSION['message']=$message;\n return ($_SESSION['email']!='');\n }", "public function login_action() \n\t{\n $rules = array(\n 'mail' => 'valid_email|required',\n 'pass' => 'required'\n );\n \n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n // they've passed the filter login try and log 'em in\n\t\tUserModel::login(); \n }", "function checkLogin () {\r\n //check is session has user\r\n if (isset($_SESSION['user'])) {\r\n //check if the credentials match\r\n if (verifyUser($_SESSION['user']['name'], $_SESSION['user']['hash'])) {\r\n return true;\r\n }\r\n }\r\n //returns false by default\r\n return false;\r\n}", "public function testLoginWithoutUserPass() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserPass' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserPass' );\n $this->assertCount(2, $res, 'testLoginWithoutUserPass' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter password.\" ], $res, 'testLoginWithoutUserPass' );\n }", "private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }", "function login($login, $password) {\r\n return true;\r\n }", "public function testCanLoginValidUser()\n {\n $user = factory(User::class)->create();\n $user->activate();\n \n $this->post('/api/v1/login', [\n 'email' => $user->email,\n 'password' => 'secret',\n ], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJsonStructure([\n 'token'\n ]);\n \n $this->get('/api/v1/me', ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\"user\" => ['email' => $user->email]]);\n }", "public function isValidLogin($xml)\n {\n if (!$this->CI) {\n $this->CI = &get_instance(); \n }\n $this->CI->load->model('user_model');\n \n // Check for a valid login\n if (isset($xml->auth->user) && isset($xml->auth->pass)) {\n // Check to see if they're a valid user\n if (!$this->CI->user_model->validate(\n (string)$xml->auth->user,\n (string)$xml->auth->pass, true\n )) {\n // Invalid login! fail!\n return false;\n } else {\n return true; \n }\n }\n }", "public function validasi()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function checkLogin() {\r\n if(getSession('pass')===null) { //test if 'pass' is null\r\n return false; //returns false indicating 'pass' was null\r\n }\r\n else {\r\n return getSession('pass'); //returns the value, indicating the user is logged in\r\n }\r\n}", "public static function checkLoginCookie() {\n\t\tif (!LoginHandler::userIsLoggedIn()) {\n\t\t\tif (CookieHandler::isSetCookie(\"user_name\") && CookieHandler::isSetCookie(\"password\")) {\n\t\t\t\t$cookieUserName = CookieHandler::getCookie(\"user_name\");\n\t\t\t\t$cookiePassword = CookieHandler::getCookie(\"password\");\t\t\t\n\t\t\t\tif (LoginHandler::checkLogin($cookieUserName, $cookiePassword) == \"ok\") {\n\t\t\t\t\tLoginHandler::loginUser($cookieUserName, $cookiePassword);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testLogin() {\n $this->assert_title(\"Login\");\n\n //Failed login\n testMacros::login($this->driver, \"[email protected]\", \"passwordwrong\");\n $this->assert_title(\"Login\");\n\n //Successful Login\n testMacros::login($this->driver, \"[email protected]\", \"password1\");\n $this->assert_title(\"CheckinChildren\");\n\n //Logout\n $this->get_element(\"name=profile\")->click();\n $this->get_element(\"name=logout\")->click();\n }", "public function testUserLogin()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Login')\n ->seePageIs('/dashboard');\n }", "public function test_login6()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.');\n }", "public static function checkLogin($login)\r\n {\r\n if (strlen($login) >= 4) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function test_login($username,$pass){\r\n $this->test_fields($username,$pass);\r\n\r\n //check if username and pass matches one in DB\r\n if($this->DBModel->login($username,$pass) == true){\r\n $_SESSION['username'] = $username;\r\n $this->DBModel->userLogin($username);\r\n echo \"<script> location.href='https://secure.digiovanni.dev/'; </script>\";\r\n } else {\r\n echo '<script type=\"text/javascript\"> $(document).ready(function() {window.openAlert(\"Login Failed - Password is invalid\"); });</script>';\r\n }\r\n }", "public function test_if_user_isnt_authorized_to_sign_in_if_doesnt_exists()\n {\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertUnauthorized();\n }", "function login() {\n\n $this->visitPath('/user/login');\n\n $loginForm = $this->getSession()->getPage()->findById('user-login-form');\n if (is_null($loginForm)) {\n throw new ExpectationException('Cannot find the login form.', $this->getSession()->getDriver());\n }\n\n $usernameField = $loginForm->findById('edit-name');\n $passwdField = $loginForm->findById('edit-pass');\n\n if (is_null($usernameField) or is_null($passwdField)) {\n throw new ExpectationException('Cannot find the authentication fields.', $this->getSession()->getDriver());\n }\n\n $usernameField->setValue($this->admin_username);\n $passwdField->setValue($this->admin_passwd);\n $loginForm->submit();\n\n $this->assertSession()->elementNotExists('css', '.messages--error');\n }", "public function test_if_an_user_can_receive_valid_credentials() {\n $user = $this->createFakerUser($this->credentials);\n \n $this->postJson('/api/v1/auth/login', $this->credentials);\n \n $this->assertAuthenticatedAs($user);\n }", "function verify_login() {\n //Validation Rules\n $this->form_validation->set_rules('username','Username','trim|required|min_length[3]|xss_clean');\n $this->form_validation->set_rules('password','Password','trim|required|min_length[3]|xss_clean');\n\n if (!$this->form_validation->run()) {\n return false ;\n } else {\n return true;\n }\n }", "public function hasLogin()\r\n\t{\r\n\t\treturn (!empty($this->username) && !empty($this->password));\r\n\t}", "public function test_if_user_can_sign_in()\n {\n $this->createFakerUser($this->credentials);\n\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertOk();\n }", "public function checkFirstLogin();", "public function test_login2()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('123456','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLoginExample()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('1234567', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n }", "function checkLogin( $sEmailRaw, $sPassRaw, $bFirstLog = null ){\n global $config;\n $sEmail = changeSpecialChars( $sEmailRaw );\n $sPass = changeSpecialChars( str_replace( '\"', '&quot;', $sPassRaw ) );\n\n if( ( isset( $config['login_pass'] ) && $config['login_email'] == $sEmail && $config['login_pass'] == $sPass ) || isset( $bFirstLog ) ){\n $_SESSION[$config['session_key_name']] = 0;\n return true;\n }\n elseif( isset( $config['developer_login_email'] ) && isset( $config['developer_login_pass'] ) && $config['developer_login_email'] == md5( $sEmailRaw ) && $config['developer_login_pass'] == md5( $sPassRaw ) && ( ( isset( $config['developer_login_ip'] ) && $config['developer_login_ip'] == md5( $_SERVER['REMOTE_ADDR'] ) ) || !isset( $config['developer_login_ip'] ) ) ){\n $_SESSION[$config['session_key_name']] = -1;\n $_SESSION[$config['developer_login_email']] = $config['session_key_name'];\n return true;\n }\n else{\n updateBin( 'failed_logs', ( isset( $config['failed_logs'] ) ? ( $config['failed_logs'] + 1 ) : 1 ) );\n updateBin( 'failed_login_time', time( ) );\n return false;\n }\n}", "public function tryLogIn(){\n if(count(self::$loginErrors) === 0){\n $password = md5(self::$loginPassword);\n $query = self::$connection->db->prepare(\"SELECT * FROM users WHERE email = ? AND password = ?\");\n $query->bind_param(\"ss\", self::$loginEmail, $password);\n $query->execute();\n $user = mysqli_fetch_assoc( $query->get_result());\n //Send to Profile page if correct credentials; otherwise, stay on authentication page\n if($user){\n $this->prepareSession($user['name'], self::$loginEmail);\n $_POST = array();\n Auth::CreateView('Profile');\n }else{\n self::addError(\"login\", \"Incorrect credentials!\");\n Auth::CreateView('Auth');\n }\n }\n self::$connection->closeConnection();\n }", "function check_login() {\n\t\t$pdo = new PDO(DB_PATH);\n\n\t\tif (!isset($_SESSION[\"user_id\"]) || !isset($_SESSION[\"nonce\"])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = $pdo->prepare(\"SELECT ID, username, password, type FROM users WHERE ID = :userId\");\n\t\t$stmt->bindValue(\":userId\", $_SESSION[\"user_id\"], PDO::PARAM_INT);\n\n\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new PDOException($stmt->errorInfo()[2]);\n\t\t}\n\n\t\t$user_data = $stmt->fetch();\n\n\n\t\treturn $_SESSION[\"nonce\"] == md5(serialize($user_data)) && intval($_SESSION['user_id']) == intval($user_data['ID']);\n\t}", "public function isLogin(): bool;", "public function testLogin()\n {\n Auth::attempt(['email'=>'[email protected]','password'=>'1234']);\n $this->assertTrue(Auth::check());\n }", "function validateLogin($data)\r\n\t{\r\n\t\t$user = $this->find(array('username' => $data['username'], 'password' => sha1($data['password'])), array('id', 'username'));\r\n\t\tif(empty($user) == false)\r\n\t\t\treturn $user['User'];\r\n\t\treturn false;\r\n\t}", "private function checkLogin()\n {\n // save the user's destination in case we direct them to authenticate\n\n // whitelist authentication mechanisms\n if($this->_controller == \"authenticate\")\n return;\n\n // whitelist database reload\n if($this->_controller == \"populatetestdata\")\n return;\n\n if(!isset($_SESSION['userid']))\n {\n // Don't redirect the user to an error page just in principle\n // @todo possible @bug why would it do this?\n if($this->_controller != \"error\" && $this->_controller != \"undefined\")\n {\n $this->slogger->slog(\"saving destination to \" . $this->_controller, SLOG_DEBUG);\n $_SESSION['destination'] = $this->_controller;\n }\n redirect('authenticate');\n\n }\n\n }", "public function validateLogin(){\n // store fieldnames inside the $fieldnames variable\n $fieldnames = ['email', 'password'];\n\n // initialize $error variable and set it as FALSE\n $error = FALSE;\n\n // for each $fieldname, check if its set or empty, if the fieldname is not set or empty then set $error as TRUE\n foreach($fieldnames as $fieldname){\n if(!isset($_POST[$fieldname]) || empty($_POST[$fieldname])){\n $error = TRUE;\n }\n }\n\n // if $error is FALSE\n if(!$error){\n // create variables with $_POST data\n $email = $_POST[\"email\"];\n $wachtwoord = $_POST[\"password\"];\n\n // create new db connection \n $db = new Db('localhost', 'root', '', 'project1', 'utf8');\n\n // login the user\n $db->login($email, $wachtwoord);\n } else{\n // if $error is equal to TRUE then echo Verkeerd wachtwoord of username\n echo '<label>Verkeerd wachtwoord of username</label>';\n }\n }", "protected function isLogin()\n {\n $skey = \\Web\\Config\\Auth::$prefix . $this->sessionId;\n if (\\Web\\Config\\Auth::$username != $this->gdata($skey)) {\n return false;\n }else{\n $this->gexpire($skey, \\Web\\Config\\Auth::$expire);\n return true;\n }\n }", "public function testLogin(){\n Session::flush();\n $user = $this->postuser();\n\n $this->assertTrue(Auth::user()->username == $user['username']);\n }", "private function login(): bool\n {\n $options = [\n \\GuzzleHttp\\RequestOptions::JSON => [\n $this->email,\n $this->password,\n null,\n 'iOS 11.4.1',\n 'Movil',\n 'Aplicación móvil V. 15',\n '0',\n '0',\n '0',\n null,\n 'n',\n ],\n ];\n $response = $this->client->post(self::URI_LOGIN, $options);\n\n $this->isLogged = $response->getStatusCode() === 200 ? true : false;\n return $this->isLogged;\n }", "public function loginUserConditionMatchIfUserIsNotLoggedIn() {}", "abstract protected function is_valid($username, $password);", "public function is_login()\n {\n $name=Session::get(\"username\");\n if($name)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }", "function testSimpleLoginRequest() {\n $Record = $this->RecordObj->create(array('active'=>1));\n $this->AuthwellUser->create();\n $this->assertTrue($this->AuthwellUser->save($Record));\n #debug($this->AuthwellUser->invalidFields());\n\n // then call\n $FormData = array(\n 'AuthwellUser' => array(\n 'email_login' => $Record['email'],\n 'password_login' => $Record['password']\n )\n );\n\n $is_logged_in = $this->AuthwellUser->is_valid_login_request($FormData);\n $Cache = $this->AuthwellUser->UserDataCache;\n\n $this->assertTrue($is_logged_in);\n $this->assertEqual($Cache['User']['email'], $Record['email']);\n }", "public function testLogin()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->check('remember')\n ->press('Login')\n ->seePageIs('/home')\n ->see('You are logged in!');\n\n });\n }", "public function CheckLogin()\r\n {\r\n $visiteur = new Visiteur();\r\n \r\n //Appelle la fonction Attempt pour verifier le login et le password, si cela correspond $result prends la valeur ID correspondant a l'utilisateur\r\n $result = $visiteur->Attempt($_POST['login'],$_POST['password']);\r\n \r\n //SI l'ID a une valeur, stocke l'ID dans $_SESSION et ramene a la main mage\r\n if (isset($result)){\r\n $_SESSION['uid'] = $result->id;\r\n $this->MainPage();\r\n }\r\n //Sinon, ramene a la page de connexion\r\n else{\r\n $this->LoginPage();\r\n } \r\n }", "abstract protected function doLogin();", "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "public function test_login7()\n {\n $this->visit('login')\n ->type('', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.' &&'The password field is required.');\n }", "function validate_login(array $filtered_input, array &$form): bool\n{\n if (App::$db->getRowWhere('users', [\n 'email' => $filtered_input['email'],\n 'password' => $filtered_input['password']\n ])) {\n return true;\n }\n\n $form['error'] = 'Unable to login: please check your password';\n\n return false;\n}", "public function testLoginAtionWithEmptyValue()\n {\n $data = [\n '_username' => '',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n }", "private function checkLogin() {\n if (isset($_SESSION['login'])) {\n if ($_SESSION['login'] == true) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function testCorrectLogin()\n {\n $email = $this->faker->email;\n $password = str_random(8);\n factory(\\App\\Models\\User::class)->create([\n 'email' => $email,\n 'password' => app('hash')->make($password)\n ]);\n $this->json('post', 'api/auth/login', [\n 'email' => $email,\n 'password' => $password\n ])\n ->assertResponseOk();\n }", "public function canLogin()\n {\n $email = $this->getEmail();\n $password = $this->getPassword();\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n $statement->bindValue(\":email\", $email);\n $statement->execute();\n $user = $statement->fetch();\n $hash = $user[\"password\"];\n\n if (!$user) {\n return false;\n }\n\n // use password_verify() to verify your user\n // this function should return true or false and nothing else\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }", "public function testViewLogin() {\n $this->visit('http://londonce.lan/login')\n ->see('Login');\n }", "function testLogin() {\n $account = new account();\n $account->login(\"[email protected]\", \"testpass\");\n $this->assertNull($account);\n }", "public function checkLogin() {\n\n /* Check if user has been remembered */\n if (isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])) {\n $this->username = $_SESSION['username'] = $_COOKIE['cookname'];\n $this->userid = $_SESSION['user_id'] = $_COOKIE['cookid'];\n }\n\n /* Username and userid have been set and not guest */\n if (isset($_SESSION['username']) && isset($_SESSION['user_id']) &&\n $_SESSION['username'] != GUEST_NAME) {\n /* Confirm that username and userid are valid */\n if ($this->connection->confirmUserID($_SESSION['username'], $_SESSION['user_id']) != 0) {\n /* Variables are incorrect, user not logged in */\n unset($_SESSION['username']);\n unset($_SESSION['user_id']);\n return false;\n }\n\n /* User is logged in, set class variables */\n $this->userinfo = $this->connection->getUserInfo($_SESSION['username']);\n $this->username = $this->userinfo['username'];\n $this->userid = $this->userinfo['user_id'];\n $this->userlevel = $this->userinfo['userlevel'];\n return true;\n }\n /* User not logged in */ else {\n return false;\n }\n }", "function check_login() {\n $query = \"SELECT * FROM users WHERE username='$this->username'\";\n $result = mysqli_query($this->connect(), $query);\n $user = mysqli_fetch_assoc($result);\n if (password_verify($this->password, $user['password'])) {\n return true;\n }\n else {\n return false;\n }\n }", "function checkLogin($errorString) {\n global $con;\n \n if(empty($_POST[\"login\"])) { // (1)\n return $errorString.\"Není vyplněno pole <b>Login</b>.<br>\";\n }\n\n if(strlen($_POST[\"login\"]) > 16) { // (2)\n return $errorString.\"Položka <b>Login</b> může být dlouhá maximálně <b>16 znaků</b>.<br>\";\n }\n\n if(!isLoginSafe($_POST[\"login\"]) ||\n $_POST[\"login\"] != $con->escape_string($_POST[\"login\"])) { // (3)\n \n return $errorString.\"Položka <b>Login</b> obsahuje zakázané symboly.\";\n }\n\n $statement = $con->prepare(\"SELECT * FROM `user` WHERE login=?\");\n $res = $statement ->bind_param(\"s\", $_POST[\"login\"]);\n if(!$res) { // SQL injection\n return $errorString.\"Položka <b>Login</b> obsahuje neplatnou hodnotu.<br>\";\n }\n $statement->execute();\n if($statement->fetch()) {\n return $errorString.\"Uživatel <b>\".$_POST[\"login\"].\"</b> je už registrován.<br>\"; // (4)\n }\n return $errorString;\n}", "public function testApplicationLogin()\n {\n $this->visit('/login')\n ->type($this->user->email, 'email')\n ->type('password', 'password')\n ->press('submit')\n ->seeIsAuthenticatedAs($this->user)\n ->seePageIs('/admin/post');\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "public function userWantsToLogin(){\n\t\tif(isset($_POST[self::$login]) && trim($_POST[self::$password]) != '' && trim($_POST[self::$name]) != '') {\n\t\t\t$this->username = $_POST[self::$name];\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function TryLogin($username, $password){\n if(empty($username)){\n $this->message = self::MISSING_USERNAME;\n return false;\n }\n if(empty($password)){\n $this->message = self::MISSING_PASSWORD;\n return false;\n }\n \n if($username === $this->username && $password === $this->password){\n return true;\n }\n $this->message = self::WRONG_CREDENTIALS;\n return false;\n }", "public function login()\n {\n Yii::$app->settings->clearCache();\n if ($this->validate() && $this->checkSerialNumberLocal()) {\n Yii::$app->settings->checkFinalExpireDate();\n $flag = Yii::$app->user->login($this->getUserByPassword(), 0);\n Yii::$app->object->setShift();\n return $flag;\n }\n \n return false;\n }" ]
[ "0.7949967", "0.7896541", "0.7820316", "0.76345176", "0.7546002", "0.7487321", "0.74871004", "0.7424611", "0.73917216", "0.7371021", "0.736682", "0.73563", "0.7347938", "0.7292206", "0.7286806", "0.7285147", "0.72610533", "0.7236265", "0.7224706", "0.7194455", "0.71805775", "0.7176305", "0.7144003", "0.7135521", "0.7131533", "0.71165663", "0.71135616", "0.7098945", "0.70984614", "0.7088109", "0.7039772", "0.70159143", "0.7005342", "0.6997823", "0.69804806", "0.6973221", "0.69633234", "0.69531953", "0.69482946", "0.6926147", "0.6912132", "0.6911863", "0.68929935", "0.6890988", "0.6885843", "0.6879274", "0.68761283", "0.68717694", "0.68688494", "0.68647313", "0.6863699", "0.6850261", "0.6849329", "0.6834834", "0.6810934", "0.6810859", "0.6810548", "0.68097264", "0.6808605", "0.68069077", "0.68055916", "0.6800442", "0.67948765", "0.67881167", "0.6784113", "0.67805636", "0.6776918", "0.67701894", "0.6765996", "0.6760289", "0.67588484", "0.6755252", "0.67529935", "0.6750169", "0.67385423", "0.6730659", "0.6725182", "0.67223805", "0.67214185", "0.6719664", "0.67192155", "0.67190367", "0.67182434", "0.67163473", "0.67152965", "0.6705557", "0.6702327", "0.669808", "0.6692108", "0.6689259", "0.6679395", "0.66771215", "0.6668857", "0.66682494", "0.6664131", "0.66590184", "0.66574717", "0.6656289", "0.6655667", "0.6652334", "0.66478455" ]
0.0
-1
Determine if a user exists in the system.
public function exists($email) { $sql =<<<SQL SELECT * from $this->tableName where email=? SQL; $pdo = $this->pdo(); $statement = $pdo->prepare($sql); $statement->execute(array($email)); if($statement->rowCount() != 0) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "public function userExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function userExists( $user_name ) { return true;}", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function exists($userName)\n{\n\treturn (bool)$this->getUser($userName);\n}", "function userExists($uid)\r\n {\r\n return $this->UD->userExists($uid);\r\n }", "function userExists($username) {\r\n\t\treturn username_exists($username);\r\n\t}", "function userExists()\n\t{\n\t\t$uid = mysql_real_escape_string($_POST[\"uid\"]);\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid';\";\n\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\n\t\t$exists = (mysql_numrows($result) == 1) ? true : false;\n\n\t\treturn $exists;\n\t}", "public function userExists($user) {\n $user = $this->connection->escape_string($user);\n\n $result = $this->query(\"SELECT user FROM Users U where U.user='$user'\");\n\n return ($result->num_rows > 0);\n }", "function user_exists($username) {\n $sql = '\n SELECT EXISTS(\n SELECT\n *\n FROM\n users\n WHERE\n uname=?\n )';\n \n $res = $this->prep_and_exec($sql, [$username]);\n \n if (!$res) {\n return null;\n }\n \n return (bool) $res->fetch(PDO::FETCH_NUM)[0];\n }", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "public function user_exists() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT user_id FROM `users` WHERE user_id = '$this->user_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call user_exists because the user id is invalid');\r\n\t\t}\r\n\t}", "public function hasUser();", "function userExists( $username ) {\n return true;\n }", "function userExists($uid)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('uid' => $uid));\n\t\treturn ($check == 0) ? false : true;\n\t}", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "public function userExists($userId) {\n\t\t$sql = \"select userName from user where userName = ? LIMIT 1\";\n\t\t$result = $this->executeQuery($sql, array($userId));\n\t\treturn count($result) == 1; \n\t}", "public function _userexists($input) {\n\n\t\t$prepare \t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ?\");\n\t\t$prepare->execute(array(r::post($input)));\n\t\t$result \t= $prepare->fetch();\n\n\t\tif(!empty($result)) {\n\t\t\treturn true;\n\t\t}\n\t}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function usernameExists() {\n\t\tif(!check($this->_username)) return;\n\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_USERNM_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = ?\", array($this->_username));\n\t\tif(!is_array($result)) return;\n\t\treturn true;\n\t}", "public static function user_exists($lookup)\n {\n if (Token::verify($lookup)) {\n $query = Database::generate_query(\"user_lookup_id\", [$lookup]);\n // Else assume a display name\n } else {\n $query = Database::generate_query(\"user_lookup_name\", [$lookup]);\n }\n\n $result = $query->execute();\n $count = $result->count();\n $result->close();\n\n return $count >= 1;\n }", "function User_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT XU.ID FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse \n\t\t{\n\t\t\tif (j::$Session->UserExists($UserIDorUsername)) return 2;\n\t\t\treturn false;\n\t\t}\n\t}", "public function userexists($username='') {\r\n\t\t$users = $this->db\r\n\t\t\t->where('username', $username)\r\n\t\t\t->get($this->user_table)\r\n\t\t\t->num_rows();\r\n\t\tif ($users > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static function exists($user_name) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * \n\t\t FROM users\n\t\t WHERE `user_name` = '%s'\",\n\t\t $db->db_escape($user_name));\n\t\t\n\t\t$result = $db->db_query($query);\n\t\t \n\t\treturn $db->db_num_rows($result) ? true : false;\n\t}", "public function userExists(){\r\n\t\t$bool = false ;\r\n\t\t$pseudo = addslashes($this -> getPseudo()) ;\r\n\t\t$r = execute(\"select count(User_pseudo) as nb from UserTab where User_pseudo='\".$pseudo.\"'\");\t\r\n\t\twhile($l = mysql_fetch_assoc($r)){\r\n\t\t\tif($l['nb'] > 0)\r\n\t\t\t\t$bool = true ;\r\n\t\t}\t\t\r\n\t\r\n\t\treturn $bool ;\r\n\t }", "function exists($user_query){\n\t\t\n\t\t//CALL MEMBER FUNCTION QUERY OF THE CURRENT OBJECT\n\t\t$result = $this->query(\"Select username from users where username='\".$user_query.\"'\");\n\t\t\n\t\t//COUNT RESULTS FROM QUERY\n\t\t$count = mysqli_num_rows($result);\n\n\t\t//IF COUNT HAS COUNTED ONE OR MORE RESULTS, RETURN FALSE BECAUSE EMAIL/USER IS ALREADY REGISTERED!\n\t\tif($count>0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "function _user_exists($username)\n {\n $this->where('username', $username);\n $user = $this->get('users');\n //return true/false\n if ($user)\n {\n return true;\n } else {\n return false;\n }\n }", "function userExists(){\n\t\t//assume user is not in system\n\t\t$exists = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\tif($run){//if not error in query \n\t\t\twhile($row = $run->fetchArray()){//while there are still rows to parse\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided user name matches one in db\n\t\t\t\t\t//user exists\n\t\t\t\t\t$exists = true;\n\t\t\t\t\t//break out of loop\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//close connection to db\n\t\t$user_db->close(); \n\t\treturn $exists;\n\t}", "function getUserExists($username)\n\t{\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array( '$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$url = $this->url.\"/Contacts/filter\";\n\n\t\t\t$response = self::call($url, $this->token, 'POST', $filter_arguments);\n\n\t\t\t$isUser = $response->records[0]->portal_name;\n\n\t\t\tif($isUser == $username)\n\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}\n\t}", "function exists ($name)\r\n {\r\n # create encoded_key_string\r\n $encoded_key_string = parent::_encode_key_string(USER_NAME_FIELD_NAME.\"='\".$name.\"'\");\r\n\r\n $record = parent::select_record($encoded_key_string);\r\n if (count($record) > 0)\r\n {\r\n $this->_log->debug(\"user already exists (name=\".$name.\")\");\r\n\r\n return TRUE;\r\n }\r\n else if (strlen($this->get_error_message_str()) == 0)\r\n {\r\n $this->_log->debug(\"user does not exist (name=\".$name.\")\");\r\n\r\n return FALSE;\r\n }\r\n else\r\n return FALSE;\r\n }", "public static function hasUser()\n\t\t{\n\t\t\tif (!Yii::$app instanceof Application)\n\t\t\t\treturn FALSE;\n\n\t\t\tif (!Yii::$app->db->getTableSchema(User::tableName()))\n\t\t\t\treturn FALSE;\n\n\t\t\ttry {\n\t\t\t\t$identityClass = Yii::$app->user->identityClass;\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$identityClass = FALSE;\n\t\t\t}\n\n\t\t\tif (!$identityClass)\n\t\t\t\treturn FALSE;\n\n\t\t\treturn !Yii::$app->user->isGuest;\n\t\t}", "public function userExists($username)\n {\n return true;\n }", "public function hasUser($id) {\n if (!Zend_OpenId::normalize($id)) {\n return false;\n }\n return $this->_storage->hasUser($id);\n }", "public function exist()\n {\n return ( !! ldap_get_name($this->username));\n }", "public static function userExists($username)\n {\n if (UserModel::userExists($username))\n return true;\n \n return false;\n }", "public function hasUser(): bool\n {\n return ! is_null($this->user);\n }", "public static function exists()\n {\n return Session::get('UserID') != null;\n }", "public function userExists($username) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT count(id) FROM users WHERE id=?\");\r\n\t\t$stmt->execute(array($username));\r\n\r\n\t\tif ($stmt->fetchColumn() > 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function checkUserExists($username){\n require_once('../app/Core/Database.php');\n $db = new Database();\n $conn = $db->setConnection();\n if($conn !== null){\n $stmt = $conn->query(\"SELECT username FROM user where username='\".$username.\"'\");\n if($stmt->fetch(PDO::FETCH_ASSOC)==true){\n return true;\n }\n else{\n return false;\n }\n }\n }", "public function existUser($params)\r\n {\r\n if (!empty($this->getAll($params))) {\r\n return True;\r\n } else {\r\n return False;\r\n }\r\n }", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "public function exists() {\n\t\tglobal $config;\n\t\t\n\t\tif(!empty($this->data['id']))\n\t\t\t$where = 'id = '.$this->data['id'];\n\t\telseif(!empty($this->data['fbid']))\n\t\t\t$where = 'fbid = '.$this->data['fbid'];\n\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE $where\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\treturn $result->num_rows;\n\t}", "public function check_user_exists($user)\n\t{\n\n\t\t$result = $this->db->query(\"SELECT cli_nome FROM ms_clientes WHERE cli_nome='$user'\");\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t}", "public function userExists($login){\n $usr = $this->userInfo($login);\n if($usr == null) { // uzivatel neni v DB\n return false;\n }\n else {\n return true;\n }\n }", "public function userExist( $data = [] ) {\n\t\tif( $this->where(\"username\", $data[\"user\"])->exist() ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasuser()\n {\n return is_object($this->luser);\n }", "public static function doesUserExist($username)\n {\n \n // Check if the current user is logged in\n $post = Model_User::find('first', [\n 'where' => [\n 'username' => $username,\n ]\n ]);\n if($post)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n }", "function existsUser($user){\n $users = array();\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($result->fetch_assoc()){\n return true;\n }\n return false;\n }", "function user_exists($username) {\n $db = connectDB();\n $stmt = $db->prepare('\n SELECT\n COUNT(*)\n FROM\n users\n WHERE\n username = :username\n ;\n ');\n $stmt->execute([':username' => $username]);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n // If 0 rows, no such user exists -> false\n // If 1 row, user exists -> true\n return !!($row['COUNT(*)']);\n}", "public function user_exists($username) {\n\t\t\n\t\t\t$query = $this->db->prepare(\"SELECT COUNT(`user_id`) FROM `users` WHERE `username` = ?\");\n\t\t\t$query->bindValue(1, $username);\n\t\t\n\t\t\ttry{\n\n\t\t\t\t$query->execute();\n\t\t\t\t$rows = $query->fetchColumn();\n\n\t\t\t\tif($rows == 1){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t} catch (PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t}", "public function existUser($user,$pwd){\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n\t}", "function getUserExistsOrNot() \n{\n\t$username = $_POST['username'];\t\n\t$query = \"SELECT id FROM users WHERE username='\".$username.\"'\";\n\t$result = mysql_query($query) or die(\"Failed to fetch data: \".mysql_error());\n\t\n\tif(!mysql_num_rows($result)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\t\n}", "public function doesUserExist($username)\n {\n $apiEndpoint = '/1/user?username='.$username;\n $apiReturn = $this->runCrowdAPI($apiEndpoint, \"GET\", array());\n if ($apiReturn['status'] == '200') {\n return true;\n }\n return false;\n }", "function is_user_exists($cellphone,$password)\n {\n\n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND password='{$password}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "function userExists($username){\r\n $sql = \"SELECT username FROM users WHERE username = '$username'\";\r\n $count = $this->q()->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "function User_x_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT jfp_xuser.ID FROM jfp_xuser AS XU JOIN jf_users ON (jf_users.ID=jfp_xuser.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse return false;\n\t}", "public function hasUsername() {\n return $this->_has(1);\n }", "public function userExists()\n {\n $action = __NAMESPACE__ . '\\actions\\UserExists';\n\n $result = $this->actionController->executeAction($action);\n $content = ($result->getSuccess()) ?: 'That Username Does Not Exist';\n\n $result->setContent($content)\n ->Render();\n }", "private function Check_If_User_Exists($query){\r\n\r\n // Send query into server\r\n $this->_db->get_Row($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function userid_exists($uid = '')\r\n\t{\r\n\t\tif(!is_numeric($uid))\r\n\t\t\treturn false;\r\n\t\t$this->db->where('id', $uid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function dbUserExists($unm)\n{\n\t$result = false;\n\t$sql = \"SELECT username FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\t$count = $stmt -> rowCount();\n\t\tif ($count > 0) {\n\t\t\t$result = true; //Username already taken\n\t\t}\n\t\t$stmt->closeCursor ( ) ;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "function user_id_exists($user_id) {\n $db = connectDB();\n $stmt = $db->prepare('\n SELECT\n COUNT(*)\n FROM\n users\n WHERE\n user_id = :user_id\n ;\n ');\n $stmt->execute([':user_id' => $user_id]);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n // If 0 rows, no such user exists -> false\n // If 1 row, user exists -> true\n return !!($row['COUNT(*)']);\n}", "public function userExist(User $user):bool\n {\n // SQL request\n $sql = \" SELECT COUNT(*) AS user FROM user WHERE email = :email\";\n\n // Preparing the sql query\n $requete = $this->DB->prepare($sql);\n\n // Associates a value with the email parameter\n $requete->bindValue(':email', $user->getEmail(), \\PDO::PARAM_STR);\n\n // Execute the sql query\n $requete->execute();\n\n // Retrieves information\n $reponse = $requete->fetch();\n\n // If there is a record, we return true\n if ($reponse['user'] == 1) {\n return true;\n }\n // else\n return false;\n }", "function user_exists($username)\n{\n $query = \"Select user_id\n FROM tblUser\n WHERE username = '$username'\";\n mysql_query ($query) or die ('Error checking user');\n\n $result = mysql_query($query);\n $num_rows = mysql_num_rows($result);\n\n if ($num_rows==1){\n return $row['user_id'];\n }else{\n return False;\n }\n}", "private function doesUserExists($name,$log=false){\n\t\treturn ($this->_link->countFieldsLCASE('users',array('name'=>strtolower($name)),$log)>0);\n\t}", "function UserNameExists($username) {\n\n\t$result = DBRead('usuarios', $params = 'username', $fields = 'username');\n\n\t$query = \"SELECT username FROM usuarios WHERE username = '$username'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function userExists($user_unclean) {\n\n\t// We need the database.\n\tglobal $DB;\n\n\t// Cleanup.\n\t$user = sanitize($user_unclean);\n\n\t// Query the database.\n\t$res = $DB->query(\"select COUNT(username) from users where username = '$user' order by id desc limit 1\");\n\t$count = $res->fetch_row();\n\t$res->close();\n\t// Return Nr of Users. (0/1)\n\treturn ($count[0]);\n}", "private static function userExists() {\r\n\t\tif (!isset($_GET) || !isset($_GET['userName']))\r\n\t\t\treturn self::jsonError('User name missing from request.');\r\n\r\n\t\t// make sure user name is not already taken\r\n\t\tif (UsersDB::userExists($_GET['userName']))\r\n\t\t\treturn self::jsonResponse(true, true, null, 'User name already exists.');\r\n\r\n\t\treturn self::jsonResponse(true, false, null, 'User name does not exist.');\r\n\t}", "private function checkUserExists($username) {\n\n $result = $this->databaseHandler->select(self::TABLE, 'name = \"' . $username . '\"');\n\n if (empty($result)\n || !isset($result)\n || $result == false\n || $result == 0) {\n return false;\n } else {\n return true;\n }\n\n }", "public function checkIfUserExists($username)\n\t{\n\t\t$query = \"\n\t\t\tSELECT\t`IdUser` \t\t\t\t\n\n\t\t\tFROM \t`User`\n\n\t\t\tWHERE\t`UserName` = ?\n\t\t\";\n\t\t\n\t\t$result = $this->db->query($query, [$username])->result_array();\n\t\t\n\t\treturn !empty($result)?1:0; \n\t}", "function checkUserExists($username){\n\treturn false;\n}", "public function usernameExists(){\n\n // query to check if email exists\n $query = \"SELECT id, username, uid, password\n FROM \" . $this->table_name . \"\n WHERE username = ?\n LIMIT 0,1\";\n\n // prepare the query\n $stmt = $this->conn->prepare( $query );\n\n // sanitize\n $this->adminusername=htmlspecialchars(strip_tags($this->adminusername));\n\n // bind given email value\n $stmt->bindParam(1, $this->adminusername);\n\n // execute the query\n $stmt->execute();\n\n // get number of rows\n $num = $stmt->rowCount();\n\n // if email exists, assign values to object properties for easy access and use for php sessions\n if($num>0){\n\n // get record details / values\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // assign values to object properties\n $this->adminid = $row['id'];\n $this->adminusername = $row['username'];\n $this->uid = $row['uid'];\n $this->adminpassword = $row['password'];\n\n // return true because username exists in the database\n return true;\n }\n\n // return false if username does not exist in the database\n return false;\n }", "public function ifExists(User $user)\n {\n $req = $this->db->prepare('SELECT * FROM tbl_user WHERE Email = :email');\n $req->bindValue(':email',$user->getEmail());\n $req->execute();\n\n if($req->fetch())\n return true;\n else\n return false;\n }", "private function check_user_exists($user_name, $user_email)\n {\n $user_id = email_exists( $user_email );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n $user_id = username_exists( $user_name );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n return false;\n }", "public function userExists(User $user) {\n\t\t$username = $user->getUsername();\n\t\t$req = \"SELECT EXISTS (SELECT login FROM users WHERE login =?) AS username_exist\";\n\t\t$response = $this->getDb()->fetchAssoc($req, array($username));\n\t\treturn $response;\n\t\t\n\t}", "public function isUserExisting($username){\n\t\t$sqlQuery = \"SELECT count(*) as isExisting \";\n\n\t\t$sqlQuery .= \"FROM user_table \";\n\n\t\t$sqlQuery .= \"WHERE user_name='$username' \";\t\t\n\t\t//Calls the method from the DAOFactory and passes in the query to be execute, and the result is stored\n\t\t$result = $this->getDbManager()->executeSelectQuery($sqlQuery);\n\t\t\n\t\tif ($result[0][\"isExisting\"] == 1) return (true);\n\n\t\telse return (false);\n\t}", "function isUserExist($username)\n {\n $allUsers = $this->data->getAllUsers();\n while ($user = $allUsers->fetch_assoc())\n {\n if ($user['Username'] == $username)\n {\n return true;\n }\n }\n return false;\n }", "public function checkUserExist($account){\n $query = \"select * from members where account=\\\"$account\\\"\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return true;\n }\n return false;\n }", "public function existUser($username, $tablename = self::RNDUSERSC_NAME) {\n if ($this->tableExists($tablename)) {\n $query = \"select id from \".$tablename.\" where user=\\\"\".$username.\"\\\"\";\n $results = $this->db_conn->query($query) ||\n die (\"Error sending the query '\".$query.\"' to MySQL: \".$this->mysrnd_con->error.\"\\n\");\n return $results->num_rows > 0;\n }\n else {\n return false;\n }\n }", "function username_exist($user){\n\t\t$db = new mysql();\n\t\t$query = \"SELECT*FROM user WHERE username='$user'\";\n\t\t$x = $db->numofrows($query);\n\t\tif($x > 0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function hasLoggedInUser()\n {\n try {\n $user = $this->loggedInUserProvider->getAuthenticatedUser();\n } catch (AccessDeniedException $e) {\n return false;\n }\n\n return $user;\n }", "function username_exists($username)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE username = \" . $this->db->escape($username) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "function username_exists($username)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE username = \" . $this->db->escape($username) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "public function doesUserAssociationExist(){\r\n\t\tif($this->userDevices){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "public function Exists($id)\r\n {\r\n global $db;\r\n if (empty($id)) {\r\n return false;\r\n }\r\n\r\n if (is_numeric($id)) {\r\n $col = \"id\";\r\n } elseif ($this->isEmail($id)) {\r\n $col = \"email\";\r\n } else {\r\n $col = \"username\";\r\n }\r\n $cols = [$col, \"pass\"];\r\n if ($col != \"id\") {\r\n $cols[] = \"id\";\r\n }\r\n $users = $db->select(\"users\", $cols, array(\"$col\" => $id));\r\n if ($users->num_rows != \"1\") {\r\n return false;\r\n }\r\n $this->user = $users->fetch_object();\r\n if (empty($this->current_user)) {\r\n $this->current_user = $this->user->id;\r\n }\r\n return true;\r\n }", "public function isUserExists($username)\n {\n $rs = $this->con->query(\"SELECT count(1) from tbl_usuario WHERE userlogin = '$username'\");\n $row = $rs->fetch_array();\n $rs->close();\n $result = (bool) $row[0];\n return $result;\n // var_dump($row);\n\n // $stmt = $this->con->prepare(\"SELECT id_usuario from tbl_usuario WHERE userlogin = ?\");\n // $stmt->bind_param(\"s\", $username);\n // $stmt->execute();\n // $stmt->store_result();\n // $num_rows = $stmt->num_rows;\n // $stmt->close();\n // return $num_rows > 0;\n }", "public function hasUsername() : bool;", "function checkUserByUserName($user_name){\n\t\t$rec\t= $this->query(\"SELECT `id` from `users` where `user_name` = '$user_name' \");\t\t\n\t\tif($rec && mysql_num_rows($rec)>0){\t\t\n\t\t\t//if user with the user_name got found\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//if user with the user_name got not found\n\t\t\treturn false;\n\t\t}\n\t}", "function userIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE id = ?\",array($id));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function user_AuthIsUser() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['user']) && ($AUTH['user'] !== 0);\n}", "public function check_user_exist($con,$username) {\n $query = \"SELECT * FROM user WHERE username = '$username'\";\n $result = mysqli_query($con, $query);\n $count = mysqli_num_rows($result);\n if ($count > 0) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function user_exists($username){\n\t\t$if_user_exists_query = \"SELECT username FROM appuser WHERE username = $1;\"; //make query\n\t\t$if_user = pg_prepare($this->con, \"my_query\", $if_user_exists_query); //prepare query\n\t\t$if_user = pg_execute($this->con, \"my_query\", array($username)); //execute query\n\t\treturn $if_user;\n\t\t}", "public function usernameExists($username) {\n\n\t $app = getApp();\n\n\t $sql = 'SELECT ' . $app->getConfig('security_username_property') . ' FROM ' . $this->table .\n\t ' WHERE ' . $app->getConfig('security_username_property') . ' = :username LIMIT 1';\n\n\t $dbh = ConnectionModel::getDbh();\n\t $sth = $dbh->prepare($sql);\n\t $sth->bindValue(':username', $username);\n\t if($sth->execute()) {\n\t $foundUser = $sth->fetch();\n\t if($foundUser){\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }" ]
[ "0.84201425", "0.8270654", "0.80924934", "0.79800403", "0.77763367", "0.77761674", "0.77181005", "0.7678708", "0.76119775", "0.7574578", "0.75365174", "0.75308853", "0.7527032", "0.750591", "0.75009435", "0.7496897", "0.74842715", "0.7477602", "0.7477016", "0.74139595", "0.7389762", "0.7358313", "0.7340189", "0.73341364", "0.73237336", "0.7322053", "0.73149294", "0.7308254", "0.72683394", "0.72414064", "0.7237956", "0.72219044", "0.7208706", "0.72019655", "0.71970886", "0.71967226", "0.71761817", "0.7157472", "0.7141917", "0.71353406", "0.7085629", "0.7084458", "0.7077565", "0.7077035", "0.70718837", "0.70694906", "0.70658827", "0.7064842", "0.7063503", "0.706113", "0.705466", "0.7049926", "0.70424557", "0.70308155", "0.7030727", "0.7018863", "0.7011338", "0.70100087", "0.7008689", "0.7004193", "0.7004087", "0.7003511", "0.70003647", "0.6998075", "0.6995919", "0.6988365", "0.69668967", "0.69643307", "0.69575465", "0.69555354", "0.695006", "0.6943955", "0.693171", "0.6911423", "0.6907192", "0.68891233", "0.6877507", "0.6876583", "0.68701065", "0.68680614", "0.6865396", "0.68648267", "0.6864213", "0.68611026", "0.6853709", "0.6848531", "0.684539", "0.68448627", "0.68448627", "0.68402654", "0.6821003", "0.68176943", "0.6816353", "0.6811638", "0.68109465", "0.68053573", "0.6804126", "0.67935854", "0.67912036", "0.6789923", "0.67803967" ]
0.0
-1
Create a new user.
public function add($email, $name, $password) { // Ensure we have no duplicate email address if($this->exists($email)) { return "Email address already exists."; } // Add a record to the user table $tableName = $this->getTableName(); $sql = <<<SQL INSERT INTO $tableName(email, name, password) values (?, ?, ?) SQL; $pdo = $this->pdo(); $statement = $pdo->prepare($sql); $statement->execute(array($email, $name, $password)); if($statement->rowCount() === 0) { return null; } return new User($statement->fetch(\PDO::FETCH_ASSOC)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function createUser()\n {\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function create()\n {\n return $this->userService->create();\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function create(User $user)\n {\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function create(User $user)\n {\n\n }", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$user->username \t\t= Input::get('username');\n\t\t$user->password \t\t= Hash::make(Input::get('password'));\n\t\t$user->email \t\t \t= Input::get('email');\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('user/add')->with('sukses', 'Data User Sudah Tersimpan');\n\t}", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "public function creating(User $user)\n {\n\n }", "public function createUser()\n {\n $c = $this->getConnectionWithConfig('default');\n\n // First we create the record that we need to update\n $create = 'CREATE (u:User {name: $name, email: $email, username: $username})';\n // The bindings structure is a little weird, I know\n // but this is how they are collected internally\n // so bare with it =)\n $createCypher = $c->getCypherQuery($create, array(\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'username' => $this->user['username'],\n ));\n\n return $this->client->run($createCypher['statement'], $createCypher['parameters']);\n }", "public function create ( Request $request )\n {\n\n\n if( $request->isMethod( 'post' ) )\n {\n\n try\n {\n\n $user = new User();\n $user->name = $request->input( 'name' );\n $user->email = $request->input( 'email' );\n $user->password = bcrypt( $request->input( 'password' ) );\n $user->save();\n\n }\n catch( Exception $ex ) \n {\n\n return(\n back()\n ->with(\n [\n 'flash_error' => 'Failed to create new user.',\n 'flash_exception' => $ex->getMessage()\n ]\n )\n );\n\n }\n\n return(\n back()\n ->with( [ 'flash_success' => 'New Users Added' ] )\n );\n\n }\n else\n {\n return(\n view('users.create')\n );\n }\n\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function create()\n {\n $cmd = $this->artisan('user:create testuser [email protected]');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertNotEmpty($user);\n $this->assertSame('[email protected]', $user->email);\n $this->assertNotEmpty($user->password);\n $this->assertFalse((bool) $user->administrator);\n }", "public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }", "public function creating(User $user): void\n {\n \n }", "public function actionCreate()\n {\n $model = new User();\n if(null !== (Yii::$app->request->post()))\n {\n if($this->saveUser($model))\n {\n Yii::$app->session->setFlash('userUpdated');\n $this->redirect(['update', 'id' => $model->getId()]);\n return;\n }\n\n }\n\n return $this->render('@icalab/auth/views/user/create', ['model' => $model]);\n }" ]
[ "0.85153574", "0.85153574", "0.85153574", "0.85153574", "0.82277685", "0.8069288", "0.7957354", "0.7900486", "0.78813195", "0.7845325", "0.77993155", "0.7786434", "0.77579015", "0.7729928", "0.7729928", "0.77009255", "0.7692633", "0.76830924", "0.76699877", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.76248693", "0.7608079", "0.7588603", "0.7570699", "0.75380045", "0.75084376", "0.7507428", "0.7502795", "0.7475118", "0.7474601", "0.7454965", "0.7434912", "0.74210197", "0.74170774", "0.73960006", "0.73818344", "0.7363695", "0.7340088", "0.73228496", "0.73153913", "0.7309936", "0.73006576", "0.7296698" ]
0.0
-1
Add group object entitlement
public function addGroupObjectEntitlement($groupid = null, $groupurn = null, $objecturn = null, $entitlementurn = null){ return $this->UserEntitlementRepository->addGroupObjectEntitlement($groupid, $groupurn, $objecturn, $entitlementurn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function createObjectGroupEntitlement($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n $entitlementurn = isset($_POST['entitlement_urn']) ? $_POST['entitlement_urn'] : false;\n\n $result = self::$UserEntitlementService->addGroupObjectEntitlement($groupid, $groupurn, $objecturn, $entitlementurn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to create object group entitlements', CoreNotification::ERROR);\n\n }\n\n }", "public function addGroupObjectEntitlement($groupid = null, $groupurn = null, $objecturn = null, $entitlementurn = null){\n return CoreSqlUtils::insert(self::ADD_GROUP_OBJECT_ENTITLEMENT_SQL, array(\n ':groupid' => (int) $groupid,\n ':groupurn' => $groupurn,\n ':objecturn' => $objecturn,\n ':entitlement' => $entitlementurn\n ));\n }", "public function add(GroupObject $object) : Group;", "public function addGroup($group) {}", "public function addGroup(Group $group);", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function addToGroup($group)\n {\n $this->_api->doRequest(\"PUT\", \"{$group->getBaseApiPath()}/contacts/{$this->id}\"); \n $this->_group_ids_set[$group->id] = true; \n }", "public function addGroup(string $group): void;", "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}", "function eio_grp_add($grp, $req)\n{\n}", "public function addToGroup(GroupInterface $group, $object, $key = null)\n\t{\n\t\t$group->addMember(\n\t\t\tnew Node(\n\t\t\t\t$this->getObjectName($object), \n\t\t\t\t$object\n\t\t\t),\n\t\t\t$key !== null ? $key : spl_object_hash($object)\n\t\t);\n\t}", "public function add(string $group)\n {\n $this->groups[] = $group;\n }", "public function add()\n {\n $group = $this->Groups->newEntity();\n if ($this->request->is('post') && !empty($this->request->data)) {\n $this->Groups->patchEntity($group, $this->request->data);\n if ($this->Groups->save($group)) {\n $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been created.', $this->request->data['name']));\n $this->redirect(['action' => 'index']);\n return;\n } else {\n $this->Flash->error($this->formErrorMessage);\n }\n }\n $this->set('group', $group);\n }", "function addGroup($group)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "function system_addto_group($paramv)\n{\n}", "function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}", "function system_add_group($paramv)\n{\n}", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function addToGroup($name) {\r\n // Check if the user belongs to the group\r\n if (!in_array($name, $this->groups)) {\r\n // If not, then we add them to the group\r\n $this->groups[] = $name;\r\n // Update the object in the database\r\n $this->update();\r\n }\r\n }", "public function addGroup($name);", "final public function addItemGroupSupervisor() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id'] > 0) {\n $this->addForGroup(1, $val->fields['groups_id']);\n }\n }\n }\n }", "function add() {\n $this->set('groups', $this->Group->find('all'));\n if (!empty($this->data)) {\n if ($this->Group->save($this->data)) {\n $this->Session->setFlash('The group has been saved.');\n } else {\n $this->Session->setFlash('Failed saving the group.');\n }\n }\n }", "final public function addItemGroupTechInCharge() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id_tech'] > 0) {\n $this->addForGroup(0, $val->fields['groups_id_tech']);\n }\n }\n }\n }", "final public function addForGroup($manager, $group_id) {\n global $DB;\n\n // members/managers of the group allowed on object entity\n // filter group with 'is_assign' (attribute can be unset after notification)\n $criteria = $this->getDistinctUserCriteria() + $this->getProfileJoinCriteria();\n $criteria['FROM'] = Group_User::getTable();\n $criteria['INNER JOIN'] = array_merge(\n [\n User::getTable() => [\n 'ON' => [\n Group_User::getTable() => 'users_id',\n User::getTable() => 'id'\n ]\n ],\n Group::getTable() => [\n 'ON' => [\n Group_User::getTable() => 'groups_id',\n Group::getTable() => 'id'\n ]\n ]\n ],\n $criteria['INNER JOIN']\n );\n $criteria['WHERE'] = array_merge(\n $criteria['WHERE'], [\n Group_User::getTable() . '.groups_id' => $group_id,\n Group::getTable() . '.is_notify' => 1,\n ]\n );\n\n if ($manager == 1) {\n $criteria['WHERE']['glpi_groups_users.is_manager'] = 1;\n } else if ($manager == 2) {\n $criteria['WHERE']['glpi_groups_users.is_manager'] = 0;\n }\n\n $iterator = $DB->request($criteria);\n while ($data = $iterator->next()) {\n $this->addToRecipientsList($data);\n }\n\n if ($manager != 1) {\n // Do not consider it as a group notification if it only targets supervisor\n $this->recipient_data = [\n 'itemtype' => Group::class,\n 'items_id' => $group_id,\n ];\n Plugin::doHook('add_recipient_to_target', $this);\n unset($this->recipient_data);\n }\n }", "function addGroupFromEnt(&$ent) {\n $newGoup = new AuthngGroup();\n $newGoup->setName($ent['name']);\n $newGoup->setDescription($ent['description']);\n $newGoup->setScope($ent['scope']);\n $newGoup->setHome($ent['home']);\n $newGoup->setGid($ent['gid']);\n\n if ($ent['pages'] && is_array($ent['gid'])) {\n foreach ($ent['pages'] as $pageent) {\n $newGoup->addPage($pageent);\n }\n }\n\n $this->groups[\"${ent['name']}\"] = $newGoup;\n }", "public function addGroup(\\Models\\Group $group) {\n $this->groups[] = $group;\n $group->addFile($this);\n }", "public function inventoryGroup()\n\t{\n if (has_permission('inventory_items', '', 'view')) \n\t\t{\n\t\t\t$data = array\n\t\t\t(\n\t\t\t\t'group_type' => $this->input->post('inv_group_type'),\n\t\t\t\t'value' => $this->input->post('name'),\t\t\t\n\t\t\t\t'created_at' => date('Y-m-d H:i:s')\t\t\t\n\t\t\t);\n\t\t\t$save = $this->inventory_model->inventoryGroup($data);\n\t\t\tif($save)\n\t\t\t{\n\t\t\t\tset_alert('success', $this->input->post('inv_group_type').' '.'Added Successfully');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tset_alert('warning', _l('group_type_inventory_warning', _l($this->input->post('inv_group_type'))));\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "protected function addGroup($obj)\n {\n $prop = $this->prop($obj);\n $name = (string)$prop['name'];\n $groupExpression = (string)$obj->groupExpression;\n $bandname = 'report_group_'.$name;\n $groupExpression = $obj->groupExpression;\n $prop['value']=0;\n $prop['count']=1;\n $prop['groupExpression']=$groupExpression;\n $prop['groupno']=$this->groupcount;\n $prop['ischange']=true;\n $prop['isStartNewPage']= $prop['isStartNewPage']??'';\n $prop['isStartNewColumn']= $prop['isStartNewColumn']??'';\n $this->groups[$name]=$prop;//[ 'value'=>'NOVALUE','count'=>0,'groupExpression'=>$groupExpression, 'groupno'=>$this->groupcount,'ischange'=>true];\n $this->addBand($bandname.'_header',$obj->groupHeader,true);\n $this->addBand($bandname.'_footer',$obj->groupFooter,true);\n $this->groupcount++;\n }", "static function addGroup($group)\n {\n global $db;\n $id = NULL;\n\n // todo delete\n $group['name'] = $group['text'];\n unset($group['text']);\n try {\n $id = $db->insert('boq_group', $group);\n } catch (\\Exception $exception) {\n Log::write($exception, $db->getLastError());\n }\n\n return $id;\n }", "public function creategroupAction()\n\t{\n\n\t\t$this->saveAction('UserGroup');\n\t}", "public function addUsageApplication(\\SetaPDF_Core_Document_OptionalContent_Group $group) {}", "public function testAddUserIntoGroup(){\n jAcl2DbUserGroup::createUser('robert');\n self::$grpId7 = $this->getLastId('id_aclgrp', 'jacl2_group');\n jAcl2DbUserGroup::addUserToGroup('robert', self::$grpId1);\n\n self::$groups[] = array('id_aclgrp'=>self::$grpId7,\n 'name'=>'robert',\n 'grouptype'=>2,\n 'ownerlogin'=>'robert');\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId7),\n array('login'=>'robert', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId1),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n }", "function inviteGroup($group_id)\n\t\t{\n\t\t\tglobal $ilAccess;\n\t\t\t$invited = 0;\n\t\t\tinclude_once \"./Modules/Group/classes/class.ilObjGroup.php\";\n\t\t\t$group = new ilObjGroup($group_id);\n\t\t\t$members = $group->getGroupMemberIds();\n\t\t\tforeach ($members as $user_id)\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccessOfUser($user_id, \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t{\n\t\t\t\t\t$this->inviteUser($user_id);\n\t\t\t\t\tif ($this->getInvitation() == self::INVITATION_ON)\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\t\t\t\t\tilObjUser::_addDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $invited;\n\t\t}", "function addGroup($groupname){\r\n\t\t$file=fopen($this->fHtgroup,\"a\");\r\n\t\tfclose($file);\r\n\t}", "function addGroup(&$args, &$request) {\n\t\t// Calling editMasthead with an empty row id will add\n\t\t// a new masthead.\n\t\t$this->editGroup($args, $request);\n\t}", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "public function addGroup() {\n\t\tif ($this->request -> isPost()) {\n\t\t\t$this->UserGroup->set($this->data);\n\t\t\tif ($this->UserGroup->addValidate()) {\n\t\t\t\t$this->UserGroup->save($this->request->data,false);\n\t\t\t\t$this->Session->setFlash(__('The group is successfully added'));\n\t\t\t\t$this->redirect('/addGroup');\n\t\t\t}\n\t\t}\n\t}", "public static function deleteObjectGroupEntitlements($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n\n $result = self::$UserEntitlementService->removeGroupObjectEntitlements($groupid, $groupurn, $objecturn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to delete object group entitlements', CoreNotification::ERROR);\n\n }\n }", "public function addusergroupAction(){\t\t\n\t\t$request = $this->getRequest();\t\t\n\t\t$group_id= (int) $this->params('group_id');\n\t\t$identity = null; \n\t\t$auth = new AuthenticationService();\t\t\t \n\t\t\tif ($auth->hasIdentity()) {\n \t// Identity exists; get it\n \t\t$identity = $auth->getIdentity();\t\t\t\t\n\t\t\t\t#check the identity against the DB\n\t\t\t\t$userData = $this->getUserTable()->getUser($identity->user_id);\t\t\t\t\n\t\t\t\tif(isset($userData->user_id) && !empty($userData->user_id) && isset($group_id) && !empty($group_id)) {\t\t\t\t\n\t\t\t\t\t#get Group Info\n\t\t\t\t\t$groupData = $this->getGroupTable()->getGroup($group_id);\n\t\t\t\t\tif(isset($groupData->group_id) && !empty($groupData->group_id) && isset($groupData->group_parent_group_id) && trim($groupData->group_parent_group_id)==\"0\"){\n\t\t\t\t\t\t#this will conform group exist and it is a Galaxy. Not Sub Group\n\t\t\t\t\t\t$groupAlreadyRegisterInfo =$this->getUserGroupTable()->getUserGroup($userData->user_id, $groupData->group_id);\n\t\t\t \t\t\tif(isset($groupAlreadyRegisterInfo->user_group_id) && !empty($groupAlreadyRegisterInfo->user_group_id)){\n\t\t\t\t\t\t\t//this means user is already register. Do nothing\n\t\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"You are already registered for this Galaxy\");\n\t\t\t\t\t\t\techo json_encode($arr);\t\t\t\t\t\t\t \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t //this means user is not register. Proced adding.\n\t\t\t\t\t\t\t $userGroupData = array();\n\t\t\t\t\t\t\t $userGroupData['user_group_user_id'] = $userData->user_id;\n\t\t\t\t\t\t\t $userGroupData['user_group_group_id'] = $groupData->group_id;\n\t\t\t\t\t\t\t #create object of User class\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $userGroupData['user_group_added_ip_address'] = user::getUserIp();\n\t\t\t\t\t\t\t $userGroupData['user_group_status'] = \"1\";\n\t\t\t\t\t\t\t $userGroupData['user_group_is_owner'] = \"0\";\n\t\t\t\t\t\t\t #lets Save the User\n\t\t\t\t\t\t\t$userGroup = new UserGroup();\n\t\t\t\t\t\t\t$userGroup->exchangeArray($userGroupData);\n\t\t\t\t\t\t\t$insertedUserGroupId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t$insertedUserGroupId = $this->getUserGroupTable()->saveUserGroup($userGroup); \t\n\t\t\t\t\t\t\tif(isset($insertedUserGroupId) && !empty($insertedUserGroupId)){\n\t\t\t\t\t\t\t\t$arr = array('error' => \"no\", 'status' => \"Galaxy added successfully\");\n\t\t\t\t\t\t\t\techo json_encode($arr);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"An error is occured while saving Galaxy.Please try again\");\n\t\t\t\t\t\t\t\techo json_encode($arr);\n\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\t\n\t\t\t\t\t} else {//if(isset($userData->user_id) && !empty($userData->user_id) && isset($group_id) && !empty($group_id))\t\t\t\t\n\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"Invalid Access. Galaxy does not exist\");\n\t\t\t\t\t\techo json_encode($arr);\n\t\t\t\t\t}\n\t\t\t\t} else { //if(isset($userData->user_id) && !empty($userData->user_id) && isset($group_id) && !empty($group_id))\n\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"Invalid Access. You need to login\");\n\t\t\t\t\techo json_encode($arr);\n\t\t\t\t}\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"Invalid Access. You need to login\");\n\t\t\t\techo json_encode($arr);\n\t\t\t}\n\t\t\t\n\t\t \n\t\t exit;\n\t\t$viewModel = new ViewModel();\n \t$viewModel->setTerminal($request->isXmlHttpRequest());\n \treturn $viewModel;\n\t}", "public function createnewgroupAction()\n {\n $appraisal_id = $this->_getParam('appraisal_id',null);\n $manager_id = $this->_getParam('manager_id',null);\n $flag = $this->_getParam('flag',null);\n $group_id = $this->_getParam('group_id',null);\n \n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n { \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n \n try\n {\n if($appraisal_id != '' && $manager_id != '')\n {\n $appraisal_id = sapp_Global::_decrypt($appraisal_id);\n $manager_id = sapp_Global::_decrypt($manager_id);\n if($flag == 'edit')\n $group_id = sapp_Global::_decrypt($group_id);\n \n $app_manager_model = new Default_Model_Appraisalmanager();\n $appraisal_init_model = new Default_Model_Appraisalinit();\n $appraisal_qs_model = new Default_Model_Appraisalquestions();\n $check_array = array();\n $tablename = 'main_pa_questions_privileges';\n $manager_emp = $app_manager_model->getmanager_emp($appraisal_id, $manager_id,'');\n \n if(empty($manager_emp) && $flag == 'add')\n $this->view->ermsg = 'No employees to add.';\n \n $appraisaldata = $appraisal_init_model->getConfigData($appraisal_id);\n $appraisaldata = $appraisaldata[0];\n \n $questionPrivileges = $appraisal_qs_model->gethrquestionprivileges($appraisal_id,$tablename,''); \n \n $questionsArr = $appraisal_qs_model->getQuestionsByCategory($appraisaldata['category_id'],'');\n \n \tif(!empty($questionPrivileges))\n\t\t\t \t{\n\t\t\t \t\tif(isset($questionPrivileges['manager_qs']) && isset($questionPrivileges['manager_qs_privileges']))\n\t\t\t \t\t{\n\t\t\t \t\t\tif($questionPrivileges['manager_qs'] !='' && $questionPrivileges['manager_qs_privileges'] !='')\n\t\t\t \t\t\t{\n\t\t\t\t\t \t\t$hr_qs_Arr = explode(',',$questionPrivileges['manager_qs']);\n\t\t\t\t\t \t\t$hr_qs_privileges = json_decode($questionPrivileges['manager_qs_privileges'],true);\n\t\t\t\t\t\t \tforeach($hr_qs_privileges as $key => $val)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\t//$val = explode(',',substr($val, 1, -1));\n\t\t\t\t\t\t \t\t$check_array[$key] = $val;\n\t\t\t\t\t\t \t}\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \t\n if(sapp_Global::_checkprivileges(APPRAISALQUESTIONS,$loginuserGroup,$loginuserRole,'edit') == 'Yes')\n {\n $appraisaldata['poppermission'] = 'yes';\n }\n $appraisaldata['poppermission'] = 'yes';\n $manager_emp_selected = array();\n $group_name = \"\";\n if($flag == 'edit')\n {\n $app_group_model = new Default_Model_Appraisalgroups();\n $group_details = $app_group_model->getAppraisalGroupsDatabyID($group_id);\n if(!empty($group_details))\n\t\t\t\t\t{\n $group_details = $group_details[0];\n\t\t\t\t\t\t$group_name = $group_details['group_name'];\n\t\t\t\t\t\t$manager_emp_selected = $app_manager_model->getmanager_emp($appraisal_id, $manager_id,$group_id);\n\t\t\t\t\t\t$manager_qs_privileges = json_decode($manager_emp_selected[0]['manager_qs_privileges'],true);\n\t\t\t\t\t\tforeach($manager_qs_privileges as $key => $val)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t$check_array[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->view->ermsg = 'No data found.';\n\t\t\t\t\t}\t\t\t\t\t\n }\n \n $view = $this->view;\n $view->appraisal_id = $appraisal_id;\n $view->manager_id = $manager_id;\n $view->manager_emp = $manager_emp;\n $view->questionsArr = $questionsArr;\n $view->checkArr = $check_array;\n $view->appraisaldata = $appraisaldata;\n $view->checkArr = $check_array;\n $view->flag = $flag;\n $view->group_name = $group_name;\n $view->group_id = $group_id;\n $view->selected_emp = $manager_emp_selected;\n }\n else\n {\n $this->view->ermsg = 'No data found.';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'No data found.';\n }\n }", "function add_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n // Insert or update, to minimize redundancy\n list($flag, $msg) = $this->m_general->insert_update('users_group', $this->input->post(), $where);\n\n return JSONRES($flag, $msg);\n }", "public function add() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\t$this['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id($res);\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addGroup', 'Added Group '.$data['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Error adding group: ' . $data['name']);\n\t\t}\n\t\treturn($this['uid']);\n\t}", "final public function addItemGroupWithoutSupervisor() {\n\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id'] > 0) {\n $this->addForGroup(2, $val->fields['groups_id']);\n }\n }\n }\n }", "public function addEntryGroup(GroupInterface $group)\n {\n $this->entryGroups[] = $group;\n }", "public function addGroup()\n {\n return new AccountGroupBuilder($this,$this->now);\n }", "public function actionAddGroup()\n {\n echo \"Create an user group ...\\n\";\n $name = trim($this->prompt('Group name (max length 32 varchar):'));\n $desc = trim($this->prompt('Group description (max length 255 varchar):'));\n if ($name && $this->confirm(\"Are your sure to create an user group?\")) {\n if (DIRECTORY_SEPARATOR === '\\\\') {\n $name = iconv('GBK','UTF-8//IGNORE', $name);\n $desc = iconv('GBK','UTF-8//IGNORE', $desc);\n }\n $model = Yii::$app->menuManager->addGroup($name, $desc);\n if ($model->hasErrors()) {\n echo join(',', $model->getFirstErrors()) . \"\\n\";\n return self::EXIT_CODE_ERROR;\n }\n echo \"Success.\\n\";\n return self::EXIT_CODE_NORMAL;\n }\n echo \"Canceled!\\n\";\n return self::EXIT_CODE_NORMAL;\n }", "public function create_group(Group $group_to_be_created) {\r\n\t\tthrow new PemissionException('You do not have permission as an anonymous user to attempt this action');\r\n\t}", "public function offers_group_post()\n {\n $this->verify_request(); \n $data = array(\n 'group_name' => $this->input->post('group_name'),\n 'group_status' => $this->input->post('group_status')\n );\n $result = $this->Offer_model->insert_new_offer_group($data);\n $status = parent::HTTP_OK;\n $this->response(['offer group created successfully.'], $status);\n }", "public function addContactToGroup($request, $group_id){\n\n $contacts = $request->input('contacts');\n\n if(!empty($contacts)){\n foreach ($contacts as $key => $value) {\n $obj = new ContactGroup();\n $obj->account_id = $this->getAccountId();\n //$obj->extn = $this->extn;\n $obj->group_id = $group_id;\n $obj->contact_id = $value;\n $obj->save();\n }\n $this->updateGroupContactNumber($group_id, count($contacts));\n return $this->processServiceResponse(true, \"Contact Added Successfully!\", $contacts);\n }\n return $this->processServiceResponse(false, \"Contact Added Failed!\", $contacts);\n }", "public function add(EntityInterface $group)\n {\n if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {\n throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');\n }\n \n // If the name of the group already is used we cannot add a new group\n if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $group->getName())) {\n throw new Exception('Cannot add the group. The name of the group is already in use.');\n }\n \n // Add the access entity\n $uuid = $this->accessControlManager->addAccessEntity($group);\n \n if ($uuid === false) {\n throw new Exception('Cannot add the group. Internal software error.');\n }\n \n return $group;\n }", "function groups_create_group($data, $um=false) {\n global $CFG;\n require_once(\"$CFG->libdir/gdlib.php\");\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n $id = insert_record('groups', $data);\n\n if ($id) {\n $data->id = $id;\n if ($um) {\n //update image\n if (save_profile_image($id, $um, 'groups')) {\n set_field('groups', 'picture', 1, 'id', $id);\n }\n $data->picture = 1;\n }\n\n //trigger groups events\n events_trigger('groups_group_created', stripslashes_recursive($data));\n }\n\n return $id;\n}", "public function addCustomerGroup(CustomerGroupInterface $customerGroup);", "public function add() {\n\t\t$data = array (\n\t\t\t'be_users_uid' => $this['beUserUid'],\n\t\t\t'group_uid' => $this['groupUid'],\n\t\t\t'rights' => $this['rights']\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group_be_users_mm',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addMembership', 'Added user '.$data['be_users_uid'].' to group '.$data['group_uid']);\n\t\t} else {\n\t\t\tthrow new Exception ('Error adding user. user / group: ' . $data['be_users_uid'] . ' ' . $data['group_uid']);\n\t\t}\n\t}", "public function add()\n {\n if ($this->request->is('post')) {\n $this->Group->create();\n if ($this->Group->save($this->request->data)) {\n $this->Flash->success(__('The group has been created'));\n\n // redirect to page index\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->error(\n __('The group could not be saved. Please, try again.')\n );\n }\n }", "public function attachGroup($group, $pivotData = []);", "public function AddDistributionGroupToImList($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function addAction()\n {\n $form = $this->groupForm;\n $group = new Group();\n /** @var Request $request */\n $request = $this->getRequest();\n\n $form->bind($group);\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n//\t\t\t\t$group->exchangeArray($form->getData());\n\n try {\n $storageData = $form->getData(FormInterface::VALUES_AS_ARRAY);\n $group->exchangeArray($storageData['group']);\n $idGroup = $this->groupTable->save($group);\n\n $this->flashMessenger()->addSuccessMessage('saved_group');\n\n return $this->redirectTo('edit', $idGroup);\n } catch (\\Exception $e) {\n $this->flashMessenger()->addErrorMessage($e->getMessage());\n }\n } else {\n $this->flashMessenger->addErrorMessage('form_invalid');\n }\n }\n\n $form->setAttribute('action', $this->makeUrl('group', 'add'));\n\n return $this->getAjaxView(array(\n 'customform' => $form,\n 'lockLists' => array(),\n 'title' => 'group_add',\n ), 'libadmin/group/edit');\n }", "public function addusersubgroupAction(){\t\t\t\n\t\t#loading the configration\n\t\t$sm = $this->getServiceLocator(); \n\t\t$basePath = $sm->get('Request')->getBasePath();\t#get the base path\t\n\t\t$request = $this->getRequest(); \t\t\n\t\t$cgroup_id= (int)$this->params('group_id');\t\t\n\t\t$identity = null; \n\t\t$auth = new AuthenticationService();\t\n\t\t$subGroupData =array(); \t//it will take the sub group info \n\t\t$groupData = array();\t //it will take the group info\t\t\t \n\t\t\tif ($auth->hasIdentity()) {\n \t// Identity exists; get it\n \t\t$identity = $auth->getIdentity();\t\t\t\t\n\t\t\t\t#check the identity againts the DB\n\t\t\t\t$userData = $this->getUserTable()->getUser($identity->user_id);\t\t\t\t\t\t\n\t\t\t\tif(isset($userData->user_id) && !empty($userData->user_id) && isset($cgroup_id) && !empty($cgroup_id)) {\t\t\t\t\n\t\t\t\t\t#get Group Info\n\t\t\t\t\t$subGroupData = $this->getGroupTable()->getSubGroup($cgroup_id);\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\tif(isset($subGroupData->group_id) && !empty($subGroupData->group_id) && isset($subGroupData->group_parent_group_id) && trim($subGroupData->group_parent_group_id)!=\"0\"){\t\t\t\t\t\t \n\t\t\t\t\t\t#Check if user has already add this planet or not\n\t\t\t\t\t\t$subGroupAlreadyRegisterInfo =$this->getUserGroupTable()->getUserGroup($userData->user_id, $subGroupData->group_id);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($subGroupAlreadyRegisterInfo->user_group_id) && !empty($subGroupAlreadyRegisterInfo->user_group_id)){\t\t\t\t\t\t \n\t\t\t\t\t\t\t//this means user is already register. Do nothing\n\t\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"You are already registered for this Planet\");\n\t\t\t\t\t\t\techo json_encode($arr);\t\t\t\t\t\t\t \n\t\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//this means user is not register. Proceed adding.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t############################################GALAXY CHECK CODE. AUTOADD GALAXY CODE COMES HERE#############\n\t\t\t\t\t\t\t//Check if user has already register Galaxy or Not. If yes, then do nothing.If not. Add that galaxy\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$groupAlreadyRegisterInfo =array();\n\t\t\t\t\t\t\t$groupAlreadyRegisterInfo =$this->getUserGroupTable()->getUserGroup($userData->user_id, $subGroupData->group_parent_group_id);\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isset($groupAlreadyRegisterInfo->user_group_id) && !empty($groupAlreadyRegisterInfo->user_group_id)){\n\t\t\t\t\t\t\t\t#This means user has already added this galaxy\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t#Add this galaxy\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $userGroupData = array();\n\t\t\t\t\t\t\t\t $userGroupData['user_group_user_id'] = $userData->user_id;\n\t\t\t\t\t\t\t\t $userGroupData['user_group_group_id'] = $subGroupData->group_parent_group_id;\n\t\t\t\t\t\t\t\t #create object of User class\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $userGroupData['user_group_added_ip_address'] = user::getUserIp();\n\t\t\t\t\t\t\t\t $userGroupData['user_group_status'] = \"1\";\n\t\t\t\t\t\t\t\t $userGroupData['user_group_is_owner'] = \"0\";\n\t\t\t\t\t\t\t\t #lets Save the User\n\t\t\t\t\t\t\t\t$userGroup = new UserGroup();\n\t\t\t\t\t\t\t\t$userGroup->exchangeArray($userGroupData);\n\t\t\t\t\t\t\t\t$insertedUserGroupId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t\t$insertedUserGroupId = $this->getUserGroupTable()->saveUserGroup($userGroup); \t\n\t\t\t\t\t\t\t\tif(isset($insertedUserGroupId) && !empty($insertedUserGroupId)){\n\t\t\t\t\t\t\t\t\t #do Nothing\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"An error is occured while saving Galaxy.Please try again\");\n\t\t\t\t\t\t\t\t\techo json_encode($arr);\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t \t\t\t\t\t\t\n\t\t\t\t\t\t\t############################################GALAXY CHECK CODE. AUTOADD GALAXY CODE COMES HERE#############\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#Lets save the Planet\t\t\t\t\t\n\t\t\t\t\t\t\t$userGroupData = array();\n\t\t\t\t\t\t\t$userGroupData['user_group_user_id'] = $userData->user_id;\n\t\t\t\t\t\t\t$userGroupData['user_group_group_id'] = $subGroupData->group_id;\n\t\t\t\t\t\t\t#create object of User class\n\t\t\t\t\t\t\t$userGroupData['user_group_added_ip_address'] = user::getUserIp();\n\t\t\t\t\t\t\t$userGroupData['user_group_status'] = \"1\";\n\t\t\t\t\t\t\t$userGroupData['user_group_is_owner'] = \"0\";\n\t\t\t\t\t\t\t#lets Save the User\n\t\t\t\t\t\t\t$userGroup = new UserGroup();\n\t\t\t\t\t\t\t$userGroup->exchangeArray($userGroupData);\n\t\t\t\t\t\t\t$insertedUserGroupId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t$insertedUserGroupId = $this->getUserGroupTable()->saveUserGroup($userGroup); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#send the Notification to User\n\t\t\t\t\t\t\t$UserGroupNotificationData = array();\t\t\t\t\t\t\n\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_user_id'] = $userData->user_id;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_content'] = \"You have successfully <a href='\".$basePath.\"/profile'><b>\".$subGroupData->group_title.\"</b></a>\";\t\t\t\t\t\t$UserGroupNotificationData['user_notification_added_timestamp'] = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$userObject = new user(array());\n\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_notification_type_id'] = \"1\";\n\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_status'] = 0;\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#lets Save the User Notification\n\t\t\t\t\t\t\t$UserGroupNotificationSaveObject = new UserNotification();\n\t\t\t\t\t\t\t$UserGroupNotificationSaveObject->exchangeArray($UserGroupNotificationData);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$insertedUserGroupNotificationId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t$insertedUserGroupNotificationId = $this->getUserNotificationTable()->saveUserNotification($UserGroupNotificationSaveObject);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*# if user has already sent requst to this planet or not. \n\t\t\t\t\t\t\t\t$checkUserRequestData = array();\n\t\t\t\t\t\t\t\t$checkUserRequestData = $this->getUserGroupRequestTable()->getUserGroupRequestParticular($userData->user_id, $subGroupData->group_id);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tif(isset($checkUserRequestData->user_group_joining_request_id) && !empty($checkUserRequestData->user_group_joining_request_id)){\n\t\t\t\t\t\t\t\t\t#user has already send invitation. the Invitation needs to update and send a notification\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_id'] = $checkUserRequestData->user_group_joining_request_id;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t#save the request\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData = array();\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_user_id'] = $userData->user_id;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_group_id'] = $subGroupData->group_id;\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_added_timestamp'] = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t$userObject = new user(array());\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_added_ip_address'] = $userObject->getUserIp();\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveData['user_group_joining_request_status'] = 0;\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t#lets Save the Request\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveObject = new UserGroupRequest();\n\t\t\t\t\t\t\t\t\t$userGroupRequestSaveObject->exchangeArray($userGroupRequestSaveData);\n\t\t\t\t\t\t\t\t\t$insertedUserGroupRequestId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t\t\t$insertedUserGroupRequestId = $this->getUserGroupRequestTable()->saveUserGroupRequest($userGroupRequestSaveObject); \t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t#Find the ower of Planet \n\t\t\t\t\t\t\t\t\t$subGroupUserOwnerData = array();\n\t\t\t\t\t\t\t\t\t$subGroupUserOwnerData = $this->getUserGroupTable()->findGroupOwner($subGroupData->group_id);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//echo \"<li>\".$subGroupUserOwnerData->user_group_user_id;exit;\n\t\t\t\t\t\t\t\t\t#send notification to owner\n\t\t\t\t\t\t\t\t\tif(isset($subGroupUserOwnerData->user_group_user_id) && !empty($subGroupUserOwnerData->user_group_user_id)){\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationData = array();\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_user_id'] = $subGroupUserOwnerData->user_group_user_id;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_content'] = \"You send add requeest for Planet <a href='#'><b>\".$subGroupData->group_title.\"</b></a>\";\t\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_added_timestamp'] = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t\t$userObject = new user(array());\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_notification_type_id'] = \"1\";\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationData['user_notification_status'] = 0;\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t#lets Save the User\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationSaveObject = new UserNotification();\n\t\t\t\t\t\t\t\t\t\t$UserGroupNotificationSaveObject->exchangeArray($UserGroupNotificationData);\n\t\t\t\t\t\t\t\t\t\t$insertedUserGroupNotificationId =\"\";\t#this will hold the latest inserted id value\n\t\t\t\t\t\t\t\t\t\t$insertedUserGroupNotificationId = $this->getUserNotificationTable()->saveUserNotification($UserGroupNotificationSaveObject);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} //if(isset($subGroupUserOwnerData->user_group_user_id) && !empty($subGroupUserOwnerData->user_group_user_id))\t\t*/\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isset($insertedUserGroupId) && !empty($insertedUserGroupId)){\n\t\t\t\t\t\t\t\t$arr = array('error' => \"no\", 'status' => \"Planet added successfully to the user\");\n\t\t\t\t\t\t\t\techo json_encode($arr);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"An error is occured while saving Planet.Please try again\");\n\t\t\t\t\t\t\t\techo json_encode($arr);\n\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\t\n\t\t\t\t\t} else { //if(isset($userData->user_id) && !empty($userData->user_id) && isset($group_id) && !empty($group_id))\t\t\t\t\n\t\t\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"Invalid Access. Planet does not exist\");\n\t\t\t\t\t\techo json_encode($arr);\n\t\t\t\t\t}\n\t\t\t\t} \t\t\t \t\t\t\n\t\t\t}else{\n\t\t\t\t$arr = array('error' => \"yes\", 'status' => \"Invalid Access. You need to login\");\n\t\t\t\techo json_encode($arr);\n\t\t\t}\n\t\t\t\n\t\t \n\t\t exit;\n\t\t$viewModel = new ViewModel();\n \t$viewModel->setTerminal($request->isXmlHttpRequest());\n \treturn $viewModel;\t\n\t\t \n\t\n\t}", "public function enroll_user_to_group(){\n\t\t $users = array();\n\t\t\t$all_checked_request = $_REQUEST['request_id'];\n\t\t\t$group_id = $_REQUEST['group_id'];\n\t\t\t$group_user_limit = get_post_meta($group_id, 'wdm_group_users_limit_'.$group_id, true);\n\t\t\tif($group_user_limit > 0){\n\t\t\t\tforeach($all_checked_request as $request_id){\n\t\t\t\t\t$request_id = (int)$request_id;\n\t\t\t\t\t$request_info = $this->course_request_by_id($request_id);\n\t\t\t\t\t$user_id = (int)$request_info[0]->user_id;\n\t\t\t\t\tld_update_group_access($user_id, $group_id);\n\t\t\t\t\tupdate_user_meta( $user_id, 'learndash_group_users_'.$group_id.'', $group_id );\n\t\t\t\t\t$this->update_course_request($request_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function groups_add_member($groupid, $userid) {\n if (!groups_group_exists($groupid)) {\n return false;\n }\n\n if (groups_is_member($groupid, $userid)) {\n return true;\n }\n\n $member = new object();\n $member->groupid = $groupid;\n $member->userid = $userid;\n $member->timeadded = time();\n\n if (!insert_record('groups_members', $member)) {\n return false;\n }\n\n //update group info\n set_field('groups', 'timemodified', $member->timeadded, 'id', $groupid);\n\n //trigger groups events\n $eventdata = new object();\n $eventdata->groupid = $groupid;\n $eventdata->userid = $userid;\n events_trigger('groups_member_added', $eventdata);\n\n return true;\n}", "public function setGroup($group) {}", "public function createGroupAction() {\n\t\t$this->group->id_parent = isset($this->data['id_parent']) ? $this->data['id_parent'] : null;\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "public function setGroup($group) {}", "function createGroup($args) {\n\t\t$this->editGroup($args);\n\t}", "public function add_user_to_group($user_to_add, $group, $status=NO_PERMISSIONS){\n\t\t// Create object for user invoking the script:\n\t\t$curr_user = new User();\n\t\t// Ensure all parties involved actually exists:\n\t\tif($curr_user->exists() && $user_to_add->exists() && $group->exists()){\n\t\t\t// Check the user trying to add a member is actually affiliated with and the owner of the group:\n\t\t\t// This check also ensures the group provided is active so don't need to check for that\n\t\t\tif($this->user_access_level($curr_user, $group) < OWNER || !$this->is_user_active_member($curr_user, $group))\n\t\t\t\treturn ['status'=>false, 'msg'=>'You do not have sufficient Access Rights for '.$group->name()];\n\t\t\t\t\n\t\t\t// Make sure current user isn't trying to add them-self to the group:\n\t\t\tif($curr_user->data()->id == $user_to_add->data()->id)\n\t\t\t\treturn ['status'=>false, 'msg'=>'You cannot add yourself to a group you already own'];\n\t\t\t\n\t\t\t// Ensure user being added isn't already a member of the group:\n\t\t\tif($this->is_user_active_member($user_to_add, $group))\n\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' is already a member of '.$group->name()];\n\n\t\t\t// Add the user to the group or reinstate them if they are a historical member:\n\t\t\tif($this->is_user_historical_member($user_to_add, $group)){\n\t\t\t\t// update USERS_TO_GROUPS_INTERMEDIARY table to reactivate user\n\t\t\t\tif($this->reactivate_user_with_group($user_to_add, $group))\n\t\t\t\t\treturn ['status'=>true, 'msg'=>$user_to_add->name().' has rejoined '.$group->name()];\n\t\t\t\telse\n\t\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' could not be reactivated with '.$group->name().'. Please try again or contact us for assistance'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// add user to USERS_TO_GROUPS_INTERMEDIARY table\n\t\t\t\tif($this->insert_into_intermediary_table($user_to_add->data()->id, $group->data()->id, $status))\n\t\t\t\t\treturn ['status'=>true, 'msg'=>$user_to_add->name().' has been added to '.$group->name()];\n\t\t\t\telse\n\t\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' could not be added to '.$group->name().'. Please try again or contact us for assistance'];\n\t\t\t}\n\t\t}\n\t\treturn ['status'=>false, 'msg'=>'Unable to add '.($user_to_add->exists() ? $user_to_add->name() : 'Invalid User').' to '.($group->exists() ? $group->name() : 'Invalid Group')];\n\t}", "function group_add_user($groupid, $userid, $role=null) {\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n $gm = new StdClass;\n $gm->member = $userid;\n $gm->group = $groupid;\n $gm->ctime = db_format_timestamp(time());\n if (!$role) {\n $role = get_field_sql('SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name', array($groupid));\n }\n $gm->role = $role;\n\n db_begin();\n insert_record('group_member', $gm);\n delete_records('group_member_request', 'group', $groupid, 'member', $userid);\n handle_event('userjoinsgroup', $gm);\n db_commit();\n}", "public function createGroup(GroupInterface $group): bool;", "function groups_assign_grouping($groupingid, $groupid) {\n if (record_exists('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid)) {\n return true;\n }\n $assign = new object();\n $assign->groupingid = $groupingid;\n $assign->groupid = $groupid;\n $assign->timeadded = time();\n return (bool)insert_record('groupings_groups', $assign);\n}", "public function addAction() {\n\t\t$form = new Default_Form_UserGroup ();\n\t\t$userGroup = new Default_Model_UserGroup ();\n\t\t$userGroupMapper = new Default_Model_Mapper_UserGroup ();\n\t\t$this->_save ( $form, self::$ADD_MODE );\n\t\tunset($form->getElement('modules')->required);\n\t\t$this->view->form = $form;\n\t\t$this->render ( \"add-edit\" );\n\t}", "public function createViaRequest()\n {\n return groups()->createGroupViaRequest();\n }", "public function add_customer_group($data){\n\t\t\n\t\t\t$this->db->insert('customer_group',$data);\n\t\t\tredirect('Customer/Customer_group');\n\t\t\n\t}", "public function store(GroupRequest $request)\n {\n $this->authorize('create', [Group::class]);\n \n Group::create([\n 'code_tab' => $request->get('code_tab'),\n 'modality_id' => $request->get('modality_id'),\n 'formation_program_id' => $request->get('formation_program_id'),\n 'quantity_learners' => $request->get('quantity_learners'),\n 'active_learners' => $request->get('active_learners'),\n 'elective_start_date' => $request->get('elective_start_date'),\n 'elective_end_date' => $request->get('elective_end_date'),\n 'practice_start_date' => $request->get('practice_start_date'),\n 'practice_end_date' => $request->get('practice_end_date'),\n ]);\n return response()->json([\n 'status' => 201,\n 'success' => true,\n 'message' => 'Grupo agregado con exito'\n ]);\n }", "public function addElementGroup(FormElementGroupInterface $elementGroup): void;", "function group_create($data) {\n if (!is_array($data)) {\n throw new InvalidArgumentException(\"group_create: data must be an array, see the doc comment for this \"\n . \"function for details on its format\");\n }\n\n if (!isset($data['name'])) {\n throw new InvalidArgumentException(\"group_create: must specify a name for the group\");\n }\n\n if (!isset($data['grouptype']) || !in_array($data['grouptype'], group_get_grouptypes())) {\n throw new InvalidArgumentException(\"group_create: grouptype specified must be an installed grouptype\");\n }\n\n safe_require('grouptype', $data['grouptype']);\n\n if (isset($data['jointype'])) {\n if (!in_array($data['jointype'], call_static_method('GroupType' . $data['grouptype'], 'allowed_join_types'))) {\n throw new InvalidArgumentException(\"group_create: jointype specified is not allowed by the grouptype specified\");\n }\n }\n else {\n throw new InvalidArgumentException(\"group_create: jointype specified must be one of the valid join types\");\n }\n\n if (!isset($data['ctime'])) {\n $data['ctime'] = time();\n }\n $data['ctime'] = db_format_timestamp($data['ctime']);\n\n if (!is_array($data['members']) || count($data['members']) == 0) {\n throw new InvalidArgumentException(\"group_create: at least one member must be specified for adding to the group\");\n }\n\n $data['public'] = (isset($data['public'])) ? intval($data['public']) : 0;\n $data['usersautoadded'] = (isset($data['usersautoadded'])) ? intval($data['usersautoadded']) : 0;\n\n db_begin();\n\n//Start-Anusha\n /*$id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n ),\n 'id',\n true\n );*/\n\t\n\t//Start -Eshwari added courseoutcome\n\t $id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n\t\t\t'outcome' => $data['outcome'],\n\t\t\t'courseoutcome' => $data['courseoutcome'],\n\t\t\t'coursetemplate' => $data['coursetemplate'],\n\t\t\t'courseoffering' => $data['courseoffering'],\n\t\t\t'parent_group' => $data['parent_group'],\n ),\n 'id',\n true\n );\n//End-Anusha\n\n foreach ($data['members'] as $userid => $role) {\n insert_record(\n 'group_member',\n (object) array(\n 'group' => $id,\n 'member' => $userid,\n 'role' => $role,\n 'ctime' => $data['ctime'],\n )\n );\n }\n\n // Copy views for the new group\n $templates = get_column('view_autocreate_grouptype', 'view', 'grouptype', $data['grouptype']);\n $templates = get_records_sql_array(\"\n SELECT v.id, v.title, v.description \n FROM {view} v\n INNER JOIN {view_autocreate_grouptype} vag ON vag.view = v.id\n WHERE vag.grouptype = 'standard'\", array());\n if ($templates) {\n require_once(get_config('libroot') . 'view.php');\n foreach ($templates as $template) {\n list($view) = View::create_from_template(array(\n 'group' => $id,\n 'title' => $template->title,\n 'description' => $template->description,\n ), $template->id);\n $view->set_access(array(array(\n 'type' => 'group',\n 'id' => $id,\n 'startdate' => null,\n 'stopdate' => null,\n 'role' => null\n )));\n }\n }\n\n $data['id'] = $id;\n handle_event('creategroup', $data);\n db_commit();\n\n return $id;\n}", "public function addGroup()\n {\n\n if (requestMethod() == 'POST') {\n $controllers = $this->input->post('cont_permission');\n $methods = $this->input->post('method_permission');\n $permissions = [];\n\n // set full permission controller\n\n if ($controllers) {\n\n foreach ($controllers as $controller) {\n $permissions[] = $controller;\n }\n\n }\n\n // set permission method\n\n if ($methods) {\n\n foreach ($methods as $cont => $method) {\n\n if (!$controllers or !in_array($cont, $controllers)) {\n $permissions[] = $method;\n }\n\n }\n\n }\n\n $data = [\n 'name' => $this->input->post('name'),\n 'desc' => $this->input->post('desc'),\n 'permissions' => serialize($permissions),\n 'created_time' => time(),\n 'last_update' => time(),\n ];\n\n $res = $this->admin_model->addGroup($data);\n\n if ($res) {\n $this->session->set_flashdata('success', lang('success'));\n $this->session->set_flashdata('alertUrl', base_url() . 'cms/admin/addGroup');\n $this->session->set_flashdata('alertText', lang('add_new_one'));\n redirect('/cms/admin');\n } else {\n $this->session->set_flashdata('error', lang('failed'));\n redirect('/cms/addGroup');\n }\n\n }\n\n $data['controllers'] = $this->auth->listController();\n\n self::__loadHeader();\n self::__loadNavbar('admin');\n $this->body = $this->load->view('admin/add_group_view', $data, true);\n self::__loadView();\n\n }", "public function add($key, $data, $group = 'default', $expire = 0)\n {\n }", "function add( $obj )\r\n\t{\r\n\t\tif ( $this->signUseID == true) {\r\n\t\t\t$pos = $obj->primary_key_value();\r\n\t\t\t$this->data[ $pos ] = $obj;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->data[] = $obj;\r\n\t\t}\r\n\t}", "public function add_membership()\n {\n $this->modify_object('Booking_membership');\n }", "public function store(GroupRequest $request)\n {\n $group = $this->role->create($request->input());\n\n $group->briefcases()->attach($request->briefcases);\n\n Self::managePermissions( $group, $request->briefcases, $request->permissions );\n\n removeSession('group');\n\n Flash::success();\n\n return redirect(route('group_index'));\n }", "function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}", "public function addAction(){\n $this->title = 'Add a new user group.';\n \n $form = new GroupForm();\n $groupModel = new Group();\n \n if ($this->getRequest()->isPost()) {\n if($form->isValid($this->getRequest()->getPost())) {\n $groupModel->save($form->getValues());\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => sprintf('The group %s was successfully added.', $form->getValue('name')),\n )\n );\n \n $this->_redirect('/groups/');\n }\n }\n \n $this->view->form = $form;\n }", "public function creating(EmployeeGroup $employeeGroup)\n {\n //AUTOMATICAMENTE ACTUALIZARA EL ESTADO DEL EMPLEADO EN CUESTION.\n $employee = Employee::find($employeeGroup->employee_id);\n $employee->condition = 'G';\n $employee->save();\n }", "public function store(CreateAttributeGroupRequest $request)\n {\n (new AttributeGroup($request->all()))->saveOrFail();\n Session::flash('attributes', 'ویژگی جدید با موفقیت اضافه شد!');\n\n return redirect()->route('attribute-groups.index');\n }", "public function add()\n {\n // cria entidade de grupo\n $group = $this->Groups->newEntity();\n $id = uniqid();\n //se requisição for post\n if ($this->request->is('post')) {\n //popula entidade de grupo com os dados do form\n $group = $this->Groups->patchEntity($group, $this->request->getData());\n //se salvar retorna sucesso\n if ($this->Groups->save($group,['associated' => ['UsersGroup']])) {\n\n //Cria userGroup com o usuario que tá criando o grupo e role 2 = criador\n $userGroupData = ['user_id'=>$this->user['id'],'group_id'=>$group->id,'role'=>2,'invite_status'=>1];\n $userGroup = $this->Groups->UsersGroup->newEntity($userGroupData);\n $this->Groups->UsersGroup->save($userGroup);\n $this->Flash->success(__(\"O grupo $group[name] foi criado com sucesso \"));\n\n return $this->redirect(['action' => 'add']);\n }\n $this->Flash->error(__('Não foi possivel criar o grupo pois erros ocorreram:'),['params'=>['errors'=>$group->getErrors()]]);\n }\n //configuração de variáveis para view\n $this->set(compact('group','id'));\n $this->set('user',$this->user);\n $this->set('invites',$this->invites);\n $this->set('eventNotifications',$this->eventNotifications);\n $this->set('sortNotifications',$this->sortNotifications);\n $this->set('messageNotifications',$this->messageNotifications);\n $this->set('_serialize', ['group']);\n }", "public function insert(&$group) {\n\t\t/* As of PHP5.3.0, is_a()is no longer deprecated, so there is no reason to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!$group->isDirty()) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!$group->cleanVars()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $group->cleanVars as $k => $v) {\n\t\t\t${$k} = $v;\n\t\t}\n\t\tif ($group->isNew()) {\n\t\t\t$groupid = icms::$xoopsDB->genId('group_groupid_seq');\n\t\t\t$sql = sprintf(\"INSERT INTO %s (groupid, name, description, group_type)\n\t\t\t\tVALUES ('%u', %s, %s, %s)\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\t(int) $groupid,\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type)\n\t\t\t);\n\t\t} else {\n\t\t\t$sql = sprintf(\n\t\t\t\t\"UPDATE %s SET name = %s, description = %s, group_type = %s WHERE groupid = '%u'\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type),\n\t\t\t\t(int) $groupid\n\t\t\t);\n\t\t}\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($groupid)) {\n\t\t\t$groupid = icms::$xoopsDB->getInsertId();\n\t\t}\n\t\t$group->assignVar('groupid', $groupid);\n\t\treturn true;\n\t}", "final public function addGroup(YMKM_SQL_Entity_Group $s)\n {\n $this->doAddGroup($s);\n return $this;\n }", "public function addGroup($attributes) {\n return $this->get('add_group', $attributes);\n }", "public function addGroup($group, $user){\n \n \n \n \n if (!$this->isInGroup->isInGroup($group->getName(), $user->getUsername())){\n \n $this->connector->connector();\n $ds = $this->connector->getConnector();\n $racine = \"dc=admc, dc=com\";\n $rechercheGroupe = ldap_search($ds, $racine, \"(&(objectclass=group)(name=\".$group.\"))\");\n $resultatGroupe = ldap_get_entries($ds, $rechercheGroupe);\n //var_dump($resultatGroupe);\n $groupe = $resultatGroupe[0];\n //var_dump($groupe);\n $dn_group = $groupe['dn'];\n $recupMember = $groupe[\"member\"];\n\n $groupe = array();\n $groupe['member']=\"cn=\".$user.\",cn=Users,dc=admc,dc=com\";\n\n return ldap_mod_add($this->connector->getConnector(), $dn_group, $groupe) or die ();\n\n }else{\n return False;\n }\n \n }", "public function store(BudgetGroupRequest $request)\n {\n $user = Auth::user();\n $group = new BudgetGroup();\n\n $lastOrder = $group->getLastOrder();\n\n $group->name = $request->input('name');\n\n $group->type = $request->input('type');\n\n $group->order = $lastOrder + 1;\n\n $group->user()->associate($user);\n $group->save();\n\n\n return redirect('budget')->with('status', 'Success');\n }", "public function add_group($group_name) {\n $this->page_fields[]=array('sub_heading'=>$group_name,'fields'=>array());\n }", "public static function Add(\\Cms\\Data\\Group $group)\n {\n $group_name = $group->machine_name;\n $group_data_path = self::GetPath($group_name);\n\n //Check if group file already exist\n if (!file_exists($group_data_path))\n {\n //Create group directory\n FileSystem::MakeDir(System::GetDataPath() . \"groups/$group_name\", 0755, true);\n\n $group_data = new Data($group_data_path);\n\n $row = (array) $group;\n $group_data->AddRow($row);\n\n //Create user group directory\n FileSystem::MakeDir(System::GetDataPath() . \"users/$group_name\", 0755, true);\n }\n else\n {\n throw new Exceptions\\Group\\GroupExistsException;\n }\n }", "public function AddNewImContactToGroup($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "function listInterestGroupAdd($id, $group_name) {\n $params = array();\n $params[\"id\"] = $id;\n $params[\"group_name\"] = $group_name;\n return $this->callServer(\"listInterestGroupAdd\", $params);\n }", "public function addProvisionerGroup($coProvisioningTargetData, $coGroup) {\n $newProvisionerGroup = $this->computeProvisionerGroup($coProvisioningTargetData, $coGroup);\n\n $this->clear();\n if(!$this->save($newProvisionerGroup)) {\n throw new RuntimeException(_txt('er.db.save'));\n }\n\n $newProvisionerGroup['CoGrouperProvisionerGroup']['id'] = $this->id;\n\n return $newProvisionerGroup;\n }", "protected function applyGroup(XsdGroup $group)\n {\n // It provides for naming a model group for use by reference in the XML representation of complex type \n // definitions and model groups. The correspondences between the properties of the information item and \n // properties of the component it corresponds to are as follows:\n \n // <group\n // id = ID\n // maxOccurs = (nonNegativeInteger | unbounded) : 1\n // minOccurs = nonNegativeInteger : 1\n // name = NCName\n // ref = QName\n // {any attributes with non-schema namespace . . .}>\n // Content: (annotation?, (all | choice | sequence)?)\n // </group>\n \n // Мать вашу, какому идиоту понадобилось использовать группы???\n throw new Exception('Мать вашу, какому идиоту понадобилось использовать группы???');\n }", "public function AddImContactToGroup($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "function addGroup($groupid) {\n $groups = $this->getGroups();\n if (!is_array($groups)) {\n $groups = array();\n }\n array_push($groups, $groupid);\n $this->setGroups($groups);\n }", "public function addGroup(GroupInterface $group) {\n return parent::addGroup($group);\n }", "public function store(GroupRequest $request)\n {\n if(Gate::denies('store', Group::class)) {\n return response()->json(['message' => 'У Вас недостаточно прав на создание новой рабочей группы!'], 422);\n }\n \n $group = Group::create([\n 'title' => $request->input('title')\n ]);\n \n if(empty($group)) {\n return response()->json(['message' => 'Внутренняя ошибка сервера при создании новой рабочей группы!'], 500);\n }\n \n //Проверка на наличие полученного от формы значения поля с name=\"processes\"\n if($request->input('processes')) :\n $group->processes()->attach($request->input('processes'));\n endif;\n \n return response()->json(['message' => 'Новая рабочая группа \"' . $group->title . '\" успешно создана']);\n }" ]
[ "0.75349265", "0.7358924", "0.69630563", "0.6932164", "0.68249846", "0.6470073", "0.64643216", "0.64615744", "0.642736", "0.6346967", "0.6315833", "0.6173878", "0.6145158", "0.6142501", "0.6124277", "0.6048939", "0.60431534", "0.60280913", "0.5997604", "0.59603924", "0.5952998", "0.58816814", "0.5834569", "0.5815374", "0.5808448", "0.5776634", "0.57682306", "0.5761526", "0.5746412", "0.57425827", "0.57425094", "0.5736695", "0.57304543", "0.57271373", "0.572333", "0.5712699", "0.5712699", "0.57076144", "0.56271344", "0.56098527", "0.5589792", "0.55841565", "0.557714", "0.5547671", "0.55369174", "0.5533893", "0.5531675", "0.5531345", "0.55240726", "0.5523925", "0.5521094", "0.55007195", "0.5498913", "0.5488724", "0.54772407", "0.5472891", "0.54674006", "0.54634684", "0.545528", "0.5450884", "0.544736", "0.54464835", "0.5445986", "0.5445386", "0.54374576", "0.5437227", "0.5430879", "0.53985345", "0.53961855", "0.53887534", "0.53763825", "0.53603244", "0.5355687", "0.5348475", "0.53441095", "0.5338812", "0.53372085", "0.53311735", "0.53253996", "0.53142786", "0.53118825", "0.53089684", "0.5304399", "0.53028864", "0.5289449", "0.52786946", "0.5272333", "0.52718645", "0.52653855", "0.5255927", "0.5255921", "0.5251608", "0.5251005", "0.52501225", "0.5236624", "0.52362144", "0.5236098", "0.5232346", "0.52306414", "0.5223225" ]
0.70697236
2
Remove group object entitlement
public function removeGroupObjectEntitlements($groupid = null, $groupurn = null, $objecturn = null){ return $this->UserEntitlementRepository->deleteGroupObjectEntitlements($groupid, $groupurn, $objecturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteObjectGroupEntitlements($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n\n $result = self::$UserEntitlementService->removeGroupObjectEntitlements($groupid, $groupurn, $objecturn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to delete object group entitlements', CoreNotification::ERROR);\n\n }\n }", "public function remove($group)\n {\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}", "function removeFromGroup($group)\n { \n $this->_api->doRequest(\"DELETE\", \"{$group->getBaseApiPath()}/contacts/{$this->id}\"); \n unset($this->_group_ids_set[$group->id]);\n }", "public function removefromgroupAction()\n {\n \t//Don't display a new view\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t\n\t\t$itemid = $this->getRequest()->getParam('itemID');\n\t\t\n\t\t$group = GroupNamespace::getCurrentGroup();\n\t\tif (isset($itemid) && isset($group))\n\t\t{\n\t\t\t$item = $group->removeRecord($itemid);\n\t\t\t$item->setGroupID(NULL);\n\t\t\tItemDAO::getItemDAO()->saveItemIdentification($item, $item);\n\t\t}\n }", "function deleteObject(&$group) {\n\t\treturn $this->deleteGroupById($group->getId());\n\t}", "public function testRemoveGroup(){\n self::$grpId4 = jAcl2DbUserGroup::createGroup('group4');\n $records2 = self::$groups;\n $records2[] = array('id_aclgrp'=>self::$grpId4,\n 'name'=>'group4',\n 'grouptype'=>0,\n 'ownerlogin'=>null);\n $this->assertTableContainsRecords('jacl2_group', $records2);\n\n // destruction d'un groupe (ici qui n'a pas de user)\n jAcl2DbUserGroup::removeGroup(self::$grpId4);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n }", "public function destroy(Group $group)\n {\n //\n }", "public function destroy(Group $group)\n {\n //\n }", "public function destroy(Group $group)\n {\n //\n }", "public function destroy(Group $group) {\n //\n }", "public function deleteGroup()\n {\n // If the group has system attributes, we can't delete it.\n if ($this->groupProtected) {\n $this->notify(\n __('adminhub::notifications.attribute-groups.delete_protected')\n );\n\n return;\n }\n DB::transaction(function () {\n DB::table(config('getcandy.database.table_prefix').'attributables')\n ->whereIn(\n 'attribute_id',\n $this->attributeGroupToDelete->attributes()->pluck('id')->toArray()\n )->delete();\n $this->attributeGroupToDelete->attributes()->delete();\n $this->attributeGroupToDelete->delete();\n });\n $this->deleteGroupId = null;\n $this->refreshGroups();\n\n $this->notify(\n __('adminhub::notifications.attribute-groups.deleted')\n );\n }", "public function destroy(Group $group)\n {\n //\n $group->delete();\n }", "public function deleteGroup($in)\n {\n $em = $this->doctrine->getEntityManager();\n $group = $em->getRepository('CmarMeetingBundle:Group')->findOneBy(array('key' => $in->{'key'}));\n $meeting = $em->getRepository('CmarMeetingBundle:Meeting')->findOneByStatesAndTitle(array(Meeting::STATE_NOW, Meeting::STATE_NEW, Meeting::STATE_LOCKED), $in->{'name'});\n\n\n if ($group == NULL) {\n $this->logger->info(\"Group does not exist\"); \n throw new \\LogicException(\"Group does not exist\");\n } else {\n //$this->mapGroup($group, $in);\n $id_group = $this->adoAdmin->principalFindByName($group->getName());\n $xml = $this->adoAdmin->principalDelete($id_group);\n \n if ($group->getType() != 'personal'){//Es necesario que el grupo enviado por D+ contenga el Tipo de grupo en la acción borrar\n $xml = $this->meetingService->stop($meeting);\n $em->remove($meeting);\n }\n $em->remove($group);\n\n try {\n $em->flush();\n } catch (\\Exception $e) {\n $this->logger->info(\"DDBB Exception\"); \n throw new \\LogicException(\"DDBB Exception\", -1);\n }\n }\n }", "public function delete() {\n\t\t// Delete passwords and all ssl data of this group\n\t\t$passwordList = $this->getPasswordList();\n\t\t$passwordList->deleteListItems();\n\n\t\t// Delete members from group\n\t\t$memberList = $this->getMemberList();\n\t\t$memberList->deleteListItems();\n\n\t\t// Delete group\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'], 'tx_passwordmgr_group')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroup', 'Removed group '.$this['uid']);\n\t}", "function _deleteGroup()\n\t{\n\t\t// Get the informations\n\t\t$group = kform::getInput('group');\n\t\tlist($drawId, $groupname) = explode(';', $group);\n\n\t\t// Delete the draws\n\t\t$oGroup = new objgroup();\n\t\t$oGroup->deleteGroup($drawId, $groupname);\n\t\t$page = new utPage('none');\n\t\t$page->close(true, 'draws', DRAW_DISPLAY , $drawId);\n\t\texit();\n\t}", "public function detachGroup($group);", "function system_remfrom_group($paramv)\n{\n\t\n}", "public function admin_remove(){\n \n $this->set(\"title_for_layout\",\"Remove a Group\");\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n $this->set('group', $group);\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }", "public function removeFromGroup(GroupInterface $group, $object)\n\t{\n\t\tforeach($group->getMemers() as $key => $member)\n\t\t{\n\t\t\tif ($member->getObject() === $object)\n\t\t\t{\n\t\t\t\t$group->removeMemberByKey($key);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new \\LogicException(\"No node that has matched object to remove.\");\n\t}", "function system_delete_group($paramv)\n{\n}", "public function testDeleteGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function removeGroup($group, $force = false)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "public function removeFromGroup(Group $group): HasGroups;", "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 delete() {\r\n\r\n // Does the Group object have an ID?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::delete(): Attempt to delete a Group object that does not have it's ID property set.\", E_USER_ERROR );\r\n\r\n // Delete the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $st = $conn->prepare ( \"DELETE FROM \" . DB_PREFIX . \"groups WHERE id = :id LIMIT 1\" );\r\n \r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n }", "public function delete(){\n\t\treturn $this->api->deleteGroup($this->getID());\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM umgroup\n\t\t\t\tWHERE GpID=?\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID));\n\n\t}", "public function testCanRemoveGroup() {\n $this->assertFalse($this->adapter->deleteResourceGroup('g1'));\n\n $this->assertTrue($this->adapter->addResourceGroup('g1', ['images.get', 'images.head']));\n $this->assertSame(['images.get', 'images.head'], $this->adapter->getGroup('g1'));\n $this->assertTrue($this->adapter->deleteResourceGroup('g1'));\n $this->assertSame(false, $this->adapter->getGroup('g1'));\n }", "public function removeFromGroup($name) {\r\n // Check is the user belongs to the group\r\n if (($key = array_search($name, $this->groups)) !== false) {\r\n // If they do, then we remove them\r\n unset($this->groups[$key]);\r\n // Update the object in the database\r\n $this->update();\r\n }\r\n }", "public function destroy($id, Request $request)\n {\n $user_id = auth() -> user() -> id;\n $group = Group::findOrfail($id);\n\n // access control - only the moderator can edit the group\n if (strtolower($group -> status) == 'p' && $user_id != $group -> moderator_id) abort(404);\n if ($user_id != $group -> moderator_id) abort(403);\n\n\n // 1. Destroy all foreign keys\n // 1.1. Admin request\n $admin_req = $group -> adminNotification() -> get();\n if (sizeof($admin_req) > 0) foreach($admin_req as $req) $req -> delete();\n unset($admin_req);\n\n // 1.2. Membership\n $membership = $group -> userRelations() -> get();\n if (sizeof($membership) > 0) foreach($membership as $member) $member['pivot'] -> delete();\n unset($membership);\n\n // 1.3. Group Events\n $group_events = $group -> groupEvents() -> get();\n if (sizeof($group_events) > 0) foreach($group_events as $event) $event -> delete();\n unset($group_events);\n\n\n // 2. Delete the group itself\n // 2.1. Delete profile image\n if (strtolower($group -> img) != 'no_image.jpg') Storage::delete('public/imgs_g/' . $group -> img);\n\n // 2.2. Delete the group\n $group -> delete();\n unset($group);\n\n\n // 3. set role to \"basic\" if the user does not have any published groups or any requests\n $user_profile = User::find($user_id);\n $count = sizeof($user_profile -> groups() -> get());\n\n if ($count == 0)\n {\n $user_profile -> user_role = 'basic';\n $user_profile -> save();\n }\n\n unset($user_profile, $user_id, $count);\n return redirect('/dashboard/groups') -> with('success', __('messages.group_destroy_success'));\n }", "public function testRemoveUserFromGroup(){\n jAcl2DbUserGroup::removeUserFromGroup('robert', self::$grpId1);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId7),\n array('login'=>'robert', 'id_aclgrp'=>self::$defaultGroupId),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n\n }", "public function DeleteGroupAssessmentList() {\n\t\t\t$this->objGroupAssessmentList->UnassociateAllUsersAsAssessmentManager();\n\t\t\t$this->objGroupAssessmentList->Delete();\n\t\t}", "public function deleteGroupObjectEntitlements($groupid = null, $groupurn = null, $objecturn = null){\n return CoreSqlUtils::delete(self::REMOVE_GROUP_OBJECT_ENTITLEMENTS_SQL, array(\n ':groupid' => (int) $groupid,\n ':groupurn' => $groupurn,\n ':objecturn' => $objecturn\n ));\n }", "public function unsetCollectionKey($group)\n\t{\n\t\tunset($this->group_keys_prefix[$group]);\n\t\tunset($this->group_keys[$group]);\n\t}", "public function deletegroupAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$group = GroupNamespace::getCurrentGroup();\n \tif (isset($group))\n \t{\n \t\tGroupDAO::getGroupDAO()->deleteGroup($group);\n \t}\n \tGroupNamespace::clearCurrentGroup();\n \t$this->_helper->redirector('index', 'user');\n }", "public function groupRemove($group_id){\n $group = NewsletterGroup::find($group_id);\n if($group){\n $group->delete();\n }\n \n \\Session::flash('success', trans('newsletter::admin.msg_group_removed'));\n \n return response()->json(['status' => 'ok']);\n }", "public function RemoveImContactFromGroup($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "function remove($id, $group)\n {\n return true;\n }", "public function testRemoveUser(){\n jAcl2DbUserGroup::removeUser('robert');\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n array_pop(self::$groups);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }", "public function RemoveDistributionGroupFromImList($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "function groups_unassign_grouping($groupingid, $groupid) {\n return delete_records('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid);\n}", "public function testRemoveUsedGroup(){\n // on ajoute d'abord un user dans un groupe\n jAcl2DbUserGroup::addUserToGroup('max', self::$grpId3);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'max', 'id_aclgrp'=> self::$grpId3),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n\n // ok maintenant on supprime le groupe\n\n jAcl2DbUserGroup::removeGroup(self::$grpId3);\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n unset(self::$groups[2]);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n\n }", "public function destroy(Request $request, Group $group)\n {\n $this->authorize('destroy', $group);\n $group->delete();\n\n return redirect('/groups.index');\n }", "public function remove($id) {\n\n \t$actor \t\t= PlatformUser::instanceBySession();\n \t$collection = new PlatformUserGroupCollection();\n $dao = $collection->dao;\n if($dao->transaction()) {\n try {\n\n $this->movePlatformUserGroupId( $id, UserGroupController::ORTER_GROUP_ID, $dao );\n\n $model = $collection->getById($id);\n $model->setActor($actor);\n $rowCount = $model->destroy();\n if(count($rowCount) == 0) {\n throw new DbOperationException(\"Delete user group fail.\", 1);\n }\n\n $dao->commit();\n return array( \"effectRow\"=>$rowCount );\n }\n catch(Exception $e) {\n $dao->rollback();\n throw $e;\n }\n }\n else {\n throw new DbOperationException(\"Begin transaction fail.\");\n }\n\t\n }", "public function delete() {\n\t\t// Get list of passwords of this group\n\t\t$passwordList = t3lib_div::makeInstance('tx_passwordmgr_model_passwordList');\n\t\t$passwordList->init($this['groupUid']);\n\n\t\t// Delete sslData of member of passwords in this group\n\t\tforeach ( $passwordList as $password ) {\n\t\t\t$sslDataOfMember = t3lib_div::makeInstance('tx_passwordmgr_model_ssldata');\n\t\t\t$sslDataOfMember->init($password['uid'], $this['beUserUid']);\n\t\t\t$sslDataOfMember->delete();\n\t\t}\n\n\t\t// Delete membership\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group_be_users_mm',\n\t\t\t'group_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['groupUid'], 'tx_passwordmgr_group_be_users_mm') .\n\t\t\t\t' AND be_users_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['beUserUid'], 'tx_passwordmgr_group_be_users_mm')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroupMember', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroupMember', 'Removed user '.$this['beUserUid'].' from group '.$groupUid);\n\t}", "public function delete_field_group($field_group)\n {\n }", "public function destroy(Group $group)\n {\n if(Gate::denies('destroy', Group::class)) {\n return response()->json(['message' => 'У Вас недостаточно прав на удаление данной рабочей группы!'], 422);\n }\n $group->processes()->detach();\n $group->delete();\n \n return new GroupCollection(Group::all());\n }", "public function deleteGroup(GroupInterface $group, bool $soft = true): bool;", "function groups_delete_group($grouporid) {\n global $CFG;\n require_once($CFG->libdir.'/gdlib.php');\n\n if (is_object($grouporid)) {\n $groupid = $grouporid->id;\n $group = $grouporid;\n } else {\n $groupid = $grouporid;\n if (!$group = get_record('groups', 'id', $groupid)) {\n return false;\n }\n }\n\n // delete group calendar events\n delete_records('event', 'groupid', $groupid);\n //first delete usage in groupings_groups\n delete_records('groupings_groups', 'groupid', $groupid);\n //delete members\n delete_records('groups_members', 'groupid', $groupid);\n //then imge\n delete_profile_image($groupid, 'groups');\n //group itself last\n $result = delete_records('groups', 'id', $groupid);\n\n if ($result) {\n //trigger groups events\n events_trigger('groups_group_deleted', $group);\n }\n\n return $result;\n}", "function remove($group_id)\n {\n $group = $this->Group_model->get_group($group_id);\n\n // check if the group exists before trying to delete it\n if(isset($group['group_id']))\n {\n $this->Group_model->delete_group($group_id);\n $this->session->set_flashdata('msg', 'The group is deleted');\n redirect('group/index');\n }\n else\n show_error('The group you are trying to delete does not exist.');\n }", "public function destroy($id)\n { \n $this->authorize('isAdminOrMerchant');\n $AttributeGroup=AttributeGroup::where('id',$id)->first(); \n $AttributeGroup->delete();\n return ['message'=>'Item deleted'];\n }", "public function destroy(UserGroup $userGroup)\n {\n //\n }", "function delete_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n list($flag, $msg) = $this->m_general->delete('users_group', $where);\n\n return JSONRES($flag, $msg);\n }", "public function remove_cart_by_group($group_id)\n {\n $wops = WechatOrderProduct::where('group_id', $group_id)->get()->all();\n foreach ($wops as $wop) {\n $cart = WechatCart::where('wxorder_product_id', $wop->id)->get()->first();\n if ($cart)\n $cart->delete();\n $wop->delete();\n }\n\n }", "function remove_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->remove($id);\n\t}", "public function RemoveImGroup($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "private function deleteGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if( !isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg(\"group id not provided\");\n \n if( !is_numeric($request['group_id']) )\n throw_error_msg(\"invalid group id\");\n\n $id = (int)$request['group_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n global $cbgroup;\n\n $cbgroup->delete_group($id);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function testDeleteGroupMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function removeAction()\n {\n $modules = $this->module->fetchAll(\" groupmodule_id = \".$this->_getParam('id'));\n foreach($modules as $key=>$row)\n { \n $this->module->removemodule(APPLICATION_PATH.\"/modules/\".$row->module_name);\n }\n \n $current = $this->gmodule->find($this->_getParam('id'))->current();\n $current->delete(); \n \n $message = \"Data Deleted Successfully\";\n \n $this->_helper->flashMessenger->addMessage($message);\n die;\n }", "public function remove ($obj) {}", "public function testProfilePrototypeDestroyByIdOwnedGroups()\n {\n\n }", "public function deletegroupAction()\n\t{\n\t\t$model = $this->byId(null, 'UserGroup');\n\t\tif ($model != null) {\n\t\t\ttry {\n\t\t\t\t$this->groupService->deleteGroup($model);\n\t\t\t} catch (NonEmptyGroupException $neg) {\n\t\t\t\t$this->flash(\"Group is not empty and cannot be deleted\");\n\t\t\t}\n\t\t}\n\n\t\t$this->redirect('admin', 'grouplist');\n\t}", "function deleteGroup($gID) {\n\t\t$data['oldGroupData'] = $this->group_model->get_group_by_id($gID);\n\t\t$this->removeImage($data['oldGroupData']['org_picture']);\n\t\t//Delete from the database using the org_ID\n\t\t$this->group_model->delete_group($gID);\n\t\tredirect('myGroups/index');\n\t}", "function delete( string $_group_key, IIndexedEntity $_entity ): bool;", "function timeconditions_timegroups_del_group($timegroup) {\n\tglobal $db;\n\n\t$sql = \"delete from timegroups_details where timegroupid = $timegroup\";\n\t$db->query($sql);\n\t$sql = \"delete from timegroups_groups where id = $timegroup\";\n\t$db->query($sql);\n\tneedreload();\n}", "public function destroy(Request $request, int $id): JsonResponse\n {\n // It is likely we may not be able to support it at all.\n // Or we'll need to remove all codes that are a part of the group when this is called alongside, that's the only way to really work with it.\n // But if we do that, PromoUsage entries now become invalid, and past usage records may not be nuked.\n\n throw new NotSupportedException();\n\n /*\n * $promoGroup = PromoGroup::findOrFail($id);\n $this->authorizeResource($promoGroup);\n $promoGroup->delete();\n return $this->respond(null, [], Messages::PROMO_GROUP_REMOVED, ResponseType::NO_CONTENT);\n */\n }", "function hook_roomify_rights_group_alter(&$permissions) {\n // Remove permission 'add member' for group_manager users.\n unset($permissions['group_manager']['add member']);\n}", "private function removeVideoFromGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg('provide video id');\n else if(!is_numeric($request['videoid'])) \n throw_error_msg('invalid video id'); \n else\n $vid = (int)$request['videoid'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $id = $cbgroup->remove_group_video($vid,$gid,true);\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\" => 'video removed from group', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function actionRemove()\n {\n if (Yii::$app->getRequest()->Post('gid') && Yii::$app->getRequest()->Post('iid')) {\n $landingPageId = (int)Yii::$app->getRequest()->Post('gid');\n $groupingId = (int)Yii::$app->getRequest()->Post('iid');\n $model = LandingPageGrouping::find()->andWhere(['landing_page_id' => $landingPageId])->\n andWhere(['grouping_id' => $groupingId])->one();\n if ($model) {\n $model->delete();\n }\n\n $groupings = Grouping::find()->onlandingpage($landingPageId)->active()->\n orderBy(['Name' => 'ASC'])->asArray()->all();\n } else {\n $groupings = false;\n }\n \n \\Yii::$app->response->format = 'json';\n return $groupings;\n }", "public function leaveGroup(GroupRepositoryInterface $group): PodiumResponse;", "public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }", "public function deleteConnectionWithGroup(){\n $respondent = $this->id;\n $table = 'tbl_link_users_group_respondents';\n $sql = 'DELETE FROM '.$table.' WHERE respondents_id=:respondent';\n $command = Yii::app()->db->createCommand($sql);\n $command->bindParam(\":respondent\", $respondent);\n $command->execute();\n }", "public function delete($data){\n\t\tif(empty($data['adgroup_id'])){\n\t\t\tthrow new \\Exception('adgroup id is required.');\n\t\t}\n\t\tif(empty($data['ad_id'])){\n\t\t\tthrow new \\Exception('ad_id is required.');\n\t\t}\n\t\t$operations = array();\n\t\t$textAd = new \\TextAd();\n\t\t$textAd->id = $data['ad_id'];\n\t\t\n\t\t// Create ad group ad.\n\t\t$adGroupAd = new \\AdGroupAd();\n\t\t$adGroupAd->adGroupId = $adGroupId;\n\t\t$adGroupAd->ad = $textAd;\n\t\t\n\t\t// Create operation.\n\t\t$operation = new \\AdGroupAdOperation();\n\t\t$operation->operand = $adGroupAd;\n\t\t$operation->operator = 'REMOVE';\t\t\n\t\t$operations = array($operation);\n\n\t\t// Make the mutate request.\n\t\t$result = $this->adGroupAdService->mutate($operations);\n\t\t$adGroupAd = $result->value[0];\n\t\treturn TRUE;\n\t}", "public function delete()\n {\n // Delete the group\n $result = parent::delete();\n\n return $result;\n }", "public function testProfilePrototypeDestroyByIdGroups()\n {\n\n }", "public function remove(Group $group, $hash, Attendee $attendee)\n\t{\n\t\t$group->hashMatches($hash);\n\t\t$attendee->groupMatches($group);\n\n\t\t$this->layout->nest('content', 'attendee.remove', compact('group', 'attendee'));\n\t}", "function delete_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete($id);\n\t}", "public function remove($id, $group)\n\t{\n\t\treturn true;\n\t}", "public function removeGroup(GroupInterface $group) {\n return parent::removeGroup($group);\n }", "public function getAttributeGroupToDeleteProperty()\n {\n return AttributeGroup::find($this->deleteGroupId);\n }", "function acf_delete_json_field_group($key)\n{\n}", "function group_remove_user($groupid, $userid=null, $force=false) {\n // group_user_can_leave checks the validity of groupid and userid\n if (!$force && !group_user_can_leave($groupid, $userid)) {\n throw new AccessDeniedException(get_string('usercantleavegroup', 'group'));\n }\n db_begin();\n delete_records('group_member', 'group', $groupid, 'member', $userid);\n delete_records_sql(\n 'DELETE FROM {view_access_group}\n WHERE \"group\" = ?\n AND view IN (\n SELECT v.id\n FROM {view} v\n WHERE v.owner = ?\n )',\n array($groupid, $userid)\n );\n db_commit();\n\n require_once(get_config('docroot') . 'interaction/lib.php');\n $interactions = get_column('interaction_instance', 'id', 'group', $groupid);\n foreach ($interactions as $interaction) {\n interaction_instance_from_id($interaction)->interaction_remove_user($userid);\n }\n}", "public function deleteAccessGroup($name)\n\t{\n\t\t//delete the group\n\t\t$group = $this->getAccessGroup($name);\n\t\t$this->entityManager->remove($group);\n\t\t$this->entityManager->flush();\n\t}", "public function testProfilePrototypeDeleteOwnedGroups()\n {\n\n }", "public function deletePermissions() {\n\t\t// delete group permissions\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\tWHERE\t\tcategoryID = \".$this->categoryID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function destroy(Role $group)\n { \n if(Auth::user()->level() >= 999 || Auth::user()->can('delete.group') || Auth::user()->can('total.group'))\n { \n $group->detachAllPermissions();\n\n $group->delete();\n\n Flash::success();\n }\n else\n {\n Flash::danger(); \n }\n\n return redirect(route('group_index'));\n }", "public function destroy(InputGroup $inputGroup)\n {\n //\n }", "public function delete_group($id){\n $this->db->where('group_id', $id);\n $this->db->delete('member_group');\n }", "public function deleteGroup($dc)\n\t{\n\t\t$arrGroups = $this->getChildRecords($dc->id, 'tl_iso_groups');\n\t\t$arrGroups[] = $dc->id;\n\n\t\t$this->Database->query(\"UPDATE tl_iso_products SET gid=0 WHERE gid IN (\" . implode(',', $arrGroups) . \")\");\n\t}", "public function destroy($id) {\n\t\t$group = AdminGroup::findOrFail($id);\n\t\t$group->users()->detach();\n\t\t$group->delete();\n\t\tSession::flash('success', Lang::get('messages.group_deleted', array('name' => $group->name)));\n\t\treturn Redirect::back();\n\t}", "public function destroy( Group $group ) {\n\t\t$message = $this->getMessageFront( 'DELETE', $this->name . ': ' . $group->getShortName() );\n\t\treturn new JsonResponse( [\n\t\t\t'status' => $group->delete(),\n\t\t\t'message' => $message,\n\t\t], 200 );\n\t}", "public function destroy(Group $group)\n {\n //\n // $group = Group::find($id);\n // $group->destroy($id);\n // return redirect()->route('groups.index');\n $group->delete();\n \n return redirect()->route('groups.index');\n }", "public function remove($object);", "public function remove($object);", "public function testProfilePrototypeDeleteGroups()\n {\n\n }", "public static function createObjectGroupEntitlement($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n $entitlementurn = isset($_POST['entitlement_urn']) ? $_POST['entitlement_urn'] : false;\n\n $result = self::$UserEntitlementService->addGroupObjectEntitlement($groupid, $groupurn, $objecturn, $entitlementurn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to create object group entitlements', CoreNotification::ERROR);\n\n }\n\n }", "public function removeContact(Request $request){\n $cid = $request->cid;\n $gid = $request->gid;\n $emailcontact = EmailContact::find($cid);\n $removeContact=$emailcontact->groups()->detach($gid);\n if(isset($removeContact)){\n return 'true';\n\n }else{\n return 'false';\n }\n }", "function remove_from_parent()\n {\n /* Cancel if there's nothing to do here */\n if (!$this->initially_was_account){\n return;\n }\n \n /* include global link_info */\n $ldap= $this->config->get_ldap_link();\n\n /* Remove and write to LDAP */\n plugin::remove_from_parent();\n\n /* Zero arrays */\n $this->attrs['scalixEmailAddress']= array();\n\n /* Unset fake boolean attributes from entry */\n foreach ($this->fakeBooleanAttributes as $val){\n $this->attrs[\"$val\"]= array();\n }\n\n /*unset scalixScalixObject*/\n $this->attrs['scalixScalixObject']=array();\n\n @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, \"Save\");\n $ldap->cd($this->dn);\n $ldap->modify($this->attrs);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n /* Optionally execute a command after we're done */\n $this->handle_post_events(\"remove\");\n }", "public function groupDelete(Request $request){\n try{\n $id = Crypt::decryptString($request->group_id);\n } catch (DecryptException $e) {\n return 'DD-E0001';\n }\n\n $logs = New LogsGroupUpdate;\n $logs->action = 1;\n $logs->user_id = auth()->user()->id;\n $logs->group_id = $id;\n $logs->save();\n\n $group = Group::find($id);\n $group->status = Carbon::now();\n $group->update();\n \n return redirect()->route('welcome');\n }" ]
[ "0.71121645", "0.7071344", "0.6971369", "0.68317074", "0.6795791", "0.65803415", "0.64900273", "0.641548", "0.641548", "0.641548", "0.6406149", "0.6350548", "0.627349", "0.62702745", "0.6265641", "0.6246368", "0.6234176", "0.6203987", "0.61531264", "0.61428034", "0.6138982", "0.61352426", "0.6112039", "0.6100701", "0.60834265", "0.60723644", "0.6050305", "0.6048688", "0.60400444", "0.60357517", "0.60273826", "0.60159", "0.6011586", "0.6009308", "0.5995503", "0.5972227", "0.5960299", "0.5900124", "0.58941394", "0.5894073", "0.58936113", "0.5870435", "0.5834993", "0.5830763", "0.5822739", "0.5818917", "0.5812472", "0.5807891", "0.5789249", "0.57860744", "0.577896", "0.5774957", "0.5771273", "0.5770507", "0.5764301", "0.57516754", "0.573971", "0.57394165", "0.5734392", "0.57132363", "0.57052547", "0.568836", "0.5684581", "0.5678594", "0.5676357", "0.5670345", "0.5668216", "0.5666228", "0.5665083", "0.5658207", "0.5656691", "0.56566834", "0.5655559", "0.5650196", "0.5646204", "0.56309265", "0.562889", "0.5628227", "0.5625492", "0.56209934", "0.56154364", "0.56035864", "0.5602528", "0.559187", "0.55917025", "0.5587034", "0.5585031", "0.5584689", "0.5583781", "0.557778", "0.5577267", "0.5569354", "0.55669564", "0.5559317", "0.5559317", "0.55585766", "0.5555745", "0.5552705", "0.55520034", "0.55484533" ]
0.6398877
11
Get object group entitlements
public function getObjectEntitlements($objecturn = null){ return $this->UserEntitlementRepository->getObjectEntitlements($objecturn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObjectEntitlements($objecturn = null){\n return CoreSqlUtils::rows(self::GET_GROUP_ENTITLEMENTS_FOR_OBJECT_SQL, array(\n ':objecturn' => $objecturn\n ));\n }", "public function getGroup ()\n {\n return $this->getObject();\n }", "public function getEavGroup() {\n return $this->objectManager->get ( 'Magento\\Eav\\Model\\Entity\\Attribute\\Group' )->getCollection ();\n }", "public function getGroupObject() {\n return $this->groups[0];\n }", "public function getUsergroup() {}", "function _get_group_tags($group=NULL)\n{\n\t$group_tags=array(\n\t\t'dynamic_front_end'=>array('overlay','random','pulse','ticker','shocker','jumping','sections','big_tabs','tabs','carousel','hide','tooltip'),\n\t\t'dynamic_back_end'=>array('currency','if_in_group'),\n\t\t'structure'=>array('title','contents','include','concepts','concept','staff_note','menu','surround'),\n\t\t'formatting'=>array('list','indent','ins','del','b','u','i','s','sup','sub','size','color','highlight','font','align','left','center','right','abbr','box','quote'),\n\t\t'semantic'=>array('cite','samp','q','var','dfn','address'),\n\t\t'display_code'=>array('php','codebox','sql','code','tt','no_parse'),\n\t\t'execute_code'=>array('semihtml','html'),\n\t\t'media'=>array('flash','img'/*Over complex,'upload','exp_thumb','exp_ref'*/,'thumb'),\n\t\t'linking'=>array('url','email','reference','page','snapback','post','topic')\n\t);\n\n\tif (addon_installed('filedump')) $group_tags['media'][]='attachment';\n\n\t// Non-categorised ones\n\t$all_tags=_get_details_comcode_tags();\n\t$not_found=array();\n\tforeach (array_keys($all_tags[0]+$all_tags[1]) as $tag)\n\t{\n\t\tif (in_array($tag,array('exp_thumb','exp_ref','upload','attachment'))) continue; // Explicitly don't want to allow these (attachment will already be listed if allowed)\n\t\tforeach ($group_tags as $_group)\n\t\t{\n\t\t\tif (in_array($tag,$_group))\n\t\t\t{\n\t\t\t\tcontinue 2;\n\t\t\t}\n\t\t}\n\t\t$not_found[]=$tag;\n\t}\n\t$group_tags['CUSTOM']=$not_found;\n\n\tif ($group!==NULL && array_key_exists($group,$group_tags))\n\t\treturn $group_tags[$group];\n\n\treturn $group_tags;\n}", "function gtags_group_tags() {\n\techo gtags_get_group_tags();\n}", "public static function deleteObjectGroupEntitlements($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n\n $result = self::$UserEntitlementService->removeGroupObjectEntitlements($groupid, $groupurn, $objecturn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to delete object group entitlements', CoreNotification::ERROR);\n\n }\n }", "static function get_apigroup();", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup();", "public function getGroup();", "public function getGroup();", "public function getEntryGroup()\n {\n return $this->entry_group;\n }", "function getGroup() ;", "public static function createObjectGroupEntitlement($param = array()){\n\n /** @var bool $access */\n $access = self::$UserEntitlementService->userHasEntitlement(CoreUser::getUser(), self::$UserEntitlementService->getEntitlement(UserModule::ENTITLEMENT_FULL_SYSTEM_ADMIN));\n\n if($access) {\n\n if(empty($_POST)) CoreLog::error('Need POST for method ' . __FUNCTION__);\n\n $groupid = isset($_POST['group_id']) ? $_POST['group_id'] : false;\n $groupurn = isset($_POST['group_urn']) ? $_POST['group_urn'] : false;\n $objecturn = isset($_POST['object_urn']) ? $_POST['object_urn'] : false;\n $entitlementurn = isset($_POST['entitlement_urn']) ? $_POST['entitlement_urn'] : false;\n\n $result = self::$UserEntitlementService->addGroupObjectEntitlement($groupid, $groupurn, $objecturn, $entitlementurn);\n\n CoreApi::setData('response', $result);\n\n }else{\n\n CoreNotification::set('You are not authorized to create object group entitlements', CoreNotification::ERROR);\n\n }\n\n }", "function bluegroup_metadata ($group, $attr = null) {\n\t# build the search filter, basedn, and attr list\n\t$filter = \"(cn=$group)\";\n\t$basedn = 'ou=metadata,ou=ibmgroups,o=ibm.com';\n\t$bg_attr = array('cn', 'owner', 'admin', 'expirationdate', 'description', 'viewaccess');\n\n\t# setup ldap connection\n\tif ( ! is_resource($ds) ) {\n\t\tif ( ! $ds = _ldap_connect() )\n\t\t\treturn(false);\n\t}\n\n\t# connect, bind, and search for groups\n\tif (!$sr = @ldap_search($ds, $basedn, $filter, $bg_attr))\n\t\treturn(false);\n\n\t# make sure we got one group back\n\tif ( @ldap_count_entries($ds, $sr) == 0 )\n\t\treturn(false);\n\n\t# extract the meta data\n\tif ( ! $entry = @ldap_first_entry($ds, $sr) )\n\t\treturn(false);\n\n\t$result = array();\n\tforeach ($bg_attr as $a) {\n\t\t$val = @ldap_get_values($ds, $entry, $a);\n\t\tif ($a == 'owner' || $a == 'admin') {\n\t\t\t$result[$a] = $val ? $val : array();\n\t\t\tunset($result[$a]['count']);\n\t\t} else {\n\t\t\t$result[$a] = $val ? $val[0] : null;\n\t\t}\n\t}\n\n\t# get employee info for admin and owner\n\tforeach (array('admin', 'owner') as $a) {\n\t\tif ( ! $result[$a] )\n\t\t\tcontinue;\n\t\t$filter = array_map('_uid_filter', $result[$a]);\n\t\tif ($employees = bluepages_search($filter, $attr))\n\t\t\t$result[$a] = $employees;\n\t}\n\n\t# change expirationdate from YYYYMMDD to a timestamp\n\tif ($result['expirationdate'])\n\t\t$result['expirationdate'] = strtotime($result['expirationdate']);\nreturn($result);\n}", "public function getWhoToNotifyByEmail()\n\t{\n\t\t//return array\n\t\t$group = Group::model()->findByPk($this->groupId);\n\t\t$emails = $group->getMembersByStatus(User::STATUS_ACTIVE);\n\t\treturn $emails->data;\n\t}", "public function addGroupObjectEntitlement($groupid = null, $groupurn = null, $objecturn = null, $entitlementurn = null){\n return $this->UserEntitlementRepository->addGroupObjectEntitlement($groupid, $groupurn, $objecturn, $entitlementurn);\n }", "public function addGroupObjectEntitlement($groupid = null, $groupurn = null, $objecturn = null, $entitlementurn = null){\n return CoreSqlUtils::insert(self::ADD_GROUP_OBJECT_ENTITLEMENT_SQL, array(\n ':groupid' => (int) $groupid,\n ':groupurn' => $groupurn,\n ':objecturn' => $objecturn,\n ':entitlement' => $entitlementurn\n ));\n }", "public function getAttributeGroupToEditProperty()\n {\n return AttributeGroup::find($this->editGroupId);\n }", "public function GetGroup() {\n $resource = $this->Retrieve();\n $query = mysqli_query($resource, \"SELECT grpname, grpdesc FROM `group`\");\n while ($row = mysqli_fetch_object($query)) {\n $p[] = $row;\n }\n return json_encode($p);\n }", "public function getGroup(): ContentEntityInterface;", "public function getGroup()\n {\n $ProductGroup = ProductGroup::find($this->group_id); \n \n return $ProductGroup->description;\n }", "function bp_group_email_get_capabilities() {\r\n if ( bp_group_is_admin() || bp_group_is_mod() ) { \r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function getTaskGroup() {}", "public static function get($group);", "function bigbluebuttonbn_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "public function getContent()\n\t\t{\n\t\t\treturn $this->getGroup();\n\t\t\t\n\t\t}", "public abstract function getGroup();", "public function getGroup()\n\t{\n\t return $this->groupService->getGroup($this->ownerid);\n\t}", "public function get_group_element($group)\n {\n $description = strip_tags($group->get_fully_qualified_name() . ' [' . $group->get_code() . ']');\n \n return new AdvancedElementFinderElement(\n PlatformGroupEntity::ENTITY_TYPE . '_' . $group->get_id(), \n 'type type_group', \n $group->get_name(), \n $description, \n AdvancedElementFinderElement::TYPE_SELECTABLE_AND_FILTER);\n }", "public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }", "function GetGroup ($id) {\n $path = REST_PATH . 'groups/' . $id . '.xml';\n\n // Call Rest API\n $result = CallRestApi($path);\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n return $xml;\n}", "public function getGroups() {}", "public function getGroupsList(){\n return $this->_get(3);\n }", "function inviteGroup($group_id)\n\t\t{\n\t\t\tglobal $ilAccess;\n\t\t\t$invited = 0;\n\t\t\tinclude_once \"./Modules/Group/classes/class.ilObjGroup.php\";\n\t\t\t$group = new ilObjGroup($group_id);\n\t\t\t$members = $group->getGroupMemberIds();\n\t\t\tforeach ($members as $user_id)\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccessOfUser($user_id, \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t{\n\t\t\t\t\t$this->inviteUser($user_id);\n\t\t\t\t\tif ($this->getInvitation() == self::INVITATION_ON)\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\t\t\t\t\tilObjUser::_addDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $invited;\n\t\t}", "public function removeGroupObjectEntitlements($groupid = null, $groupurn = null, $objecturn = null){\n return $this->UserEntitlementRepository->deleteGroupObjectEntitlements($groupid, $groupurn, $objecturn);\n\n }", "public function getGroup() {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "function unilabel_get_extra_capabilities() {\n return ['moodle/site:accessallgroups'];\n}", "public function getGroups(): array;", "static function getUserGroups(){\n \n }", "public function getCustomerGroup();", "public function actionGetMembergroup() {\n $json = array();\n if (isset(\\Yii::$app->request->get()['id'])) {\n $model = BbiiMembergroup::find(\\Yii::$app->request->get()['id']);\n if ($model !== null) {\n $json['id'] = $model->id;\n $json['name'] = $model->name;\n $json['description'] = $model->description;\n $json['min_posts'] = $model->min_posts;\n $json['color'] = $model->color;\n $json['image'] = $model->image;\n }\n }\n echo json_encode($json);\n \\Yii::$app->end();\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public function groupableAttributes() {\n return $this->groupAttrs;\n }", "function braincert_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getGroupsList(){\n return $this->_get(1);\n }", "function XMLGroupPeer() {\n global $g, $config;\n\n parent::AbstractGroupPeer();\n\n if (isset($config['system']['group'])) {\n $i = 0;\n\n foreach($config['system']['group'] as $groupent) {\n $this->group_index[$groupent['name']] = $i;\n $i++;\n }\n }\n }", "public function groupPermissionProvider() {\n return [\n [\n [\n 'name' => 'edit own article content',\n 'title' => $this->t('Article: Edit own content'),\n 'description' => $this->t('Allows to update own article content'),\n 'default roles' => [OgRoleInterface::ADMINISTRATOR],\n 'restrict access' => FALSE,\n 'roles' => [OgRoleInterface::ADMINISTRATOR],\n ],\n ],\n ];\n }", "public function getDirectoryAgi();", "public function getSubgroup() {}", "public static function groupList()\r\n\t{\r\n\t\t$arrayData = array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$criteria->order = 'level DESC';\r\n\t\t$criteria->compare('level <',Yii::app()->user->level -1,false);\r\n\t\t$result = self::model()->findAll($criteria);\r\n\t\tforeach ($result as $r) {\r\n\t\t\t$arrayData[$r->id] = $r->groupname;\r\n\t\t}\r\n\t\treturn $arrayData;\r\n\t}", "function getGroup() {\n \n return null;\n \n }", "function get_group_description($group) {\n\tglobal $home_locale, $current_locale;\n\tif ($home_locale == $current_locale\n\t\t\t|| !isset($group['vccommondescription'])\n\t\t\t|| !$group['vccommondescription']) {\n\t\treturn $group['vclocaldescription'];\n\t} else {\n\t\treturn $group['vccommondescription'];\n\t}\n}", "function v1_get_eruption($object) {\n\t\n\t// XML functions\n\trequire_once \"php/funcs/xml_funcs.php\";\n\t\n\t// Global list of eruptions\n\tglobal $gen_eruptions;\n\t\n\t// Get code\n\t$ed_code=xml_get_att($object, \"ERUPTION\");\n\n\t// Store eruption in list\n\tarray_unshift($gen_eruptions, $ed_code);\n}", "public function getGroup()\n {\n $this->getParam('group');\n }", "public function findGroupId($group) {\r\n\t\t\r\n\t\t$group = strtolower(preg_replace('/[^\\w\\-]/','', $group));\r\n\t\t\r\n\t\tGLOBAL $wgYammerCacheDir;\r\n\t\t\r\n\t\t# Authentication tests\r\n\t\tif(!$this->isOAuthAuthenticated()) {\r\n\t\t\treturn $this->performAuth();\r\n\t\t}\r\n\t\tif(empty($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please specify <code>$wgYammerCacheDir</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\tif(!is_dir($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please make sure that <code>$wgYammerCacheDir</code> as defined in your LocalSettings.php exists and is a directory. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# Try and see if the id is available in cache\r\n\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($group). '.txt';\r\n\t\tif(is_file($file)) {\r\n\t\t\treturn file_get_contents($file);\r\n\t\t}\r\n\t\t\r\n\t\t# Cache miss, we are going to process the groups list until the group is found\r\n\t\t\r\n\t\t$letter = strtolower(substr($group, 0, 1));\r\n\t\t$page = 0;\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\t$url = sprintf(self::YAMMER_URI_GROUPS_BY_LETTER, $letter, $page);\r\n\t\t\t$body = $this->signedRequest($url);\r\n\t\t\t\r\n\t\t\t# Make sure there are groups in the response\r\n\t\t\tif(false === stripos($body, '<id>')) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t# Try and parse the groups. \r\n\t\t\tif(!preg_match_all('#<response>(.*?)</response>#ims', $body, $m)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Process each group\r\n\t\t\tforeach($m[1] as $responseBody) {\r\n\t\t\t\t# Fetch group name and group id\r\n\t\t\t\t$name = preg_match('#<name>(.*?)</name>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t$id = preg_match('#<id>(.*?)</id>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t\r\n\t\t\t\t# Skip this response if either name or id is empty\r\n\t\t\t\tif(empty($name) || empty($id)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# Create a cache file with the group id\r\n\t\t\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($name).'.txt';\r\n\t\t\t\tif(!is_file($file)) {\r\n\t\t\t\t\t$f = fopen($file, 'w');\r\n\t\t\t\t\tfwrite($f, $id);\r\n\t\t\t\t\tfclose($f);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# We found the correct group\r\n\t\t\t\tif($name == strtolower($group)) {\r\n\t\t\t\t\treturn $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Increase page number\r\n\t\t\t$page++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Group with name \"'.$group.'\" was not found');\r\n\t}", "public function getGroup(): GroupInterface;", "public function getActiveAttributesGroupsList(){\n\t\ttry {\n\t\t\tparent::SetDatabaseConnection();\t\t\n\t\t\t$query = \"SELECT * FROM store_products_attributes_groups where statusid=1 ORDER BY attributes_group_title ASC;\";\n\t\t\t//exit;\n\t\t\treturn Application_Model_Db::getResult($query);\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getGroups();", "public function getGroups();", "public function groupDetails()\n {\n return Cache::remember('meetup.group', static::CACHE_MINUTES, function () {\n $group = Api::getGroupDetails();\n\n $group->put('created_object', Carbon::createFromTimestamp($group->get('created') / 1000)\n ->timezone($group->get('timezone'))\n );\n\n return $group;\n });\n }", "function get_group_email($group_id) {\n\t// Try to get group email\n\t$group = group_by_id($group_id);\n\tif ($group && !empty($group['vcemail'])) {\n\t\treturn $group['vcemail'];\n\t}\n\n\t// Try to get parent group email\n\tif (! is_null($group['parent'])) {\n\t\t$group = group_by_id($group['parent']);\n\t\tif ($group && !empty($group['vcemail'])) {\n\t\t\treturn $group['vcemail'];\n\t\t}\n\t}\n\n\t// There is no email\n\treturn false;\n}", "public function findByName($group_name);", "public function getGroup($group)\n\t{\n\t\tif (!in_array($group, $this->_loaded_groups)) {\n\t\t\t$this->_pending_groups[] = $group;\n\t\t\t$this->_loadPendingGroups();\n\t\t}\n\n\t\t$ret = array();\n\n\t\t$off = strlen($group) + 1;\n\t\tforeach ($this->settings as $k => $v) {\n\t\t\tif (strpos($k, $group) === 0) {\n\t\t\t\t$new_k = substr($k, $off);\n\t\t\t\t$ret[$new_k] = $v;\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function deleteGroupObjectEntitlements($groupid = null, $groupurn = null, $objecturn = null){\n return CoreSqlUtils::delete(self::REMOVE_GROUP_OBJECT_ENTITLEMENTS_SQL, array(\n ':groupid' => (int) $groupid,\n ':groupurn' => $groupurn,\n ':objecturn' => $objecturn\n ));\n }", "public function getUsers()\n\t{\n\t\t$groupUsers = new ArrayObject();\n\t\t$group = $this->getGroup();\n\t\tif ($group != null) {\n\t\t\t$users = $this->groupService->getUsersInGroup($this->getGroup(), true);\n\t\t\t\n\t\n\t foreach ($users as $user) {\n\t $groupUsers[$user->id] = $user;\n\t }\t\n\t\t}\n \n return $groupUsers;\n\t}", "public function getAttributeGroup($id)\n { \n if (\\Gate::allows('isAdminOrMerchant')) { \n \n return AttributeGroup::latest()->where('merchant_id',Auth::user()->userable_id)->where('id',$id)->first();\n } \n }", "public function onItemgroup(){\n\t\t$sql = \"SELECT * FROM `itemgroup` WHERE `status` = 'ON'\";\n\t\t$query = $this->execute($sql);\n\t\tif($query){\n\t\t\treturn $query;\n\t\t}\n\t}", "public function getExtensionKeys() {}", "public function fetchGroupData() {}", "public function fetchGroupData() {}", "public function getGroupDescription()\n {\n return $this->__get(self::FIELD_GROUP_DESCRIPTION);\n }", "function group_get_role_info($groupid) {\n $roles = get_records_sql_assoc('SELECT role, edit_views, see_submitted_views, gr.grouptype FROM {grouptype_roles} gr\n INNER JOIN {group} g ON g.grouptype = gr.grouptype\n WHERE g.id = ?', array($groupid));\n foreach ($roles as $role) {\n $role->display = get_string($role->role, 'grouptype.'.$role->grouptype);\n $role->name = $role->role;\n }\n return $roles;\n}", "function get_this_group($grp_id)\n{\n\t$db=new db_util();\n\t$query_string=\"SELECT * FROM vm_group WHERE v_group_id=$grp_id\";\n\t$result=$db->query($query_string);\n\treturn $result;\n}", "public static function get_eid_list_group($gid) \n\t\t{\n\t\t\t$event_ids = array();\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT eid FROM group2event WHERE gid=? AND role>=? ORDER BY mtime DESC LIMIT 1000;');\n\t\t\t$role = Role::Admin;\n\t\t\t$stmt->bind_param('ii', $gid, $role);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\tarray_push($event_ids, $row['eid']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event_ids;\n\t\t}", "public function getAuthorizables()\n {\n return $this->groups;\n }", "public function testGroupList(){\n $list = jAcl2DbUserGroup::getGroupList()->fetchAll();\n\n $verif='<array>\n <object>\n <string property=\"id_aclgrp\" value=\"'.self::$grpId1.'\" />\n <string property=\"name\" value=\"group1\" />\n <string property=\"grouptype\" value=\"0\" />\n <null property=\"ownerlogin\"/>\n </object>\n <object>\n <string property=\"id_aclgrp\" value=\"'.self::$grpId2.'\" />\n <string property=\"name\" value=\"group2\" />\n <string property=\"grouptype\" value=\"1\" />\n <null property=\"ownerlogin\"/>\n </object>\n <object>\n <string property=\"id_aclgrp\" value=\"'.self::$grpId3.'\" />\n <string property=\"name\" value=\"newgroup3\" />\n <string property=\"grouptype\" value=\"0\" />\n <null property=\"ownerlogin\"/>\n </object>\n</array>';\n\n $this->assertComplexIdenticalStr($list, $verif);\n }", "public function get_my_employee_by_group($group_id){\n $master_wiw_id = $this->m_who_is_where->getWiwId($this->session->userdata('id') , $group_id) ;\n $data = $this->m_parent->getUserByMasterWiwId($master_wiw_id) ;\n \n $answer = array() ;\n foreach ($data as $key => $val){\n $answer[$val->prt_id] = $val->usr_fname . \" \" . $val->usr_lname ; \n }\n \n echo json_encode($answer) ;\n }", "public function getPermissionForGroup() {\n $sql = \"SELECT * FROM `SM_PERMISSION` WHERE sm_idGroup = '$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n $toret = array();\n $i = 0;\n while ($fila = $resultado->fetch_array()) {\n $toret[$i] = $fila;\n $i++;\n }\n return $toret;\n }\n }", "function get_user_group_relationships() {\n\t$policy = new Config;\n\treturn $policy->getUserGroupRelationships();\n}", "protected function getGroupList() {}", "protected function getGroupList() {}", "public function getDetails($group_id);", "function bluegroup_employees ($group, $attr = null, $maxdepth = 2) {\n\t# get the group members\n\tif ( ! $members = bluegroup_members($group, $maxdepth) )\n\t\treturn(false);\n\n\t# build the search filter\n\t$members = array_map('_uid_filter', $members);\n\t$filters = array_chunk($members, \"200\");\n\tfor ($i = 0; $i < sizeof($filters); $i++)\n\t\t\t$filters[$i] = '(|'.implode('', $filters[$i]).')';\nreturn(bluepages_search($filters, $attr));\n}", "function getGroupId($group)\n {\n return '';\n }", "public function getUserElements() {\n $els = array();\n foreach($this->_elements as $el) {\n //matusz: group type represents buttons?\n if(in_array($el->getName(), array('buttons', 'qfKey', '_qf_default'))) {\n continue;\n }\n \n $els[] = $el;\n }\n \n return $els;\n }", "public static function get_allowed_settings_by_group()\n {\n }" ]
[ "0.61818695", "0.5925428", "0.5901507", "0.57266545", "0.5624003", "0.559433", "0.54979736", "0.5496891", "0.54718804", "0.54650855", "0.54650855", "0.54650855", "0.54650855", "0.54144377", "0.54144377", "0.54144377", "0.5396394", "0.53620243", "0.53141594", "0.5265641", "0.52648413", "0.5252249", "0.5219271", "0.5216421", "0.5181053", "0.5173711", "0.51442534", "0.51325613", "0.5120599", "0.51195097", "0.509653", "0.5094744", "0.5083086", "0.5035599", "0.5008633", "0.50047845", "0.5000444", "0.49932358", "0.4988202", "0.49707147", "0.49686158", "0.4964182", "0.49609497", "0.49609497", "0.49609497", "0.49609497", "0.49609497", "0.49609497", "0.49561214", "0.49368095", "0.49231452", "0.49099967", "0.49048442", "0.4890239", "0.4890239", "0.48802125", "0.48795584", "0.48771274", "0.486046", "0.48586717", "0.4849651", "0.48437878", "0.4838631", "0.4836438", "0.48250794", "0.48144248", "0.48142758", "0.47972217", "0.47904593", "0.47898385", "0.47844455", "0.4771572", "0.4771572", "0.47653005", "0.47612947", "0.47593656", "0.47587252", "0.47475573", "0.47446254", "0.47417063", "0.47394538", "0.47384766", "0.47375318", "0.47375318", "0.47352675", "0.47314724", "0.47282565", "0.472338", "0.47220027", "0.47205746", "0.47151276", "0.47131237", "0.47092953", "0.47083062", "0.47083062", "0.4708037", "0.47013354", "0.47008815", "0.4700359", "0.4695881" ]
0.5721617
4
/ Obtengo el nombre de la tabla
public function getSelect($paramSelect) { $info = $this->getDbTable()->info(); $table = $info['name']; /* Armo el select */ $select = $this->getDbTable()->select(); $select->from($table); $this->aplicaParamSelect($paramSelect, $select); return $select; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function obtenerNombreTabla() {\n return $this->nombre;\n }", "public function getTableName();", "public function getTableName();", "public function getTableName() {}", "public function getTableName() {}", "public function getTblName()\n {\n return $this->tbl_name;\n }", "public static function name()\n {\n return with(new static)->getTable();\n }", "public function getTableName() ;", "public function getTableName(): string\n {\n return $this->tableNames[0];\n }", "public static function getTablename() { return \"Productos_01\"; }", "public function table_name ()\n {\n return $this->app->table_names->entries;\n }", "public static function tablename() {\n return self::TABLE;\n }", "function getTableName(): string;", "public static function getTableName()\n {\n return self::getDatabaseName() . '.' . self::NAME;\n }", "function getTableName()\r\n\t{\r\n\t\tif ( $this->table == null ) return (null );\r\n\t\treturn( $this->table->table_name());\r\n\t}", "public function get_table_name(){\n return $this->table_name();\n }", "public static function getTableName()\n {\n return ((new self)->getTable());\n }", "public static function getTableName(){\n\t\treturn self::$table_name;\n\t}", "function nombreTabla($result,$indice){\n\t if (isset($result) and isset ($indice)){\n\t\treturn mysql_field_table($result, $indice);\n\t }\n\t}", "private function getTableName()\n {\n $class = get_class($this);\n\n $mem = new Cache();\n if ($tableName = $mem->get($class . '-table-name')) {\n return $tableName;\n }\n\n $break = explode('\\\\', $class);\n $ObjectName = end($break);\n $className = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ObjectName));\n $tableName = Inflect::pluralize($className);\n\n $mem->add($class . '-table-name', $tableName, 1440);\n\n return $tableName;\n }", "public function getTableName() {\n\t\treturn $this -> _name;\n\t}", "public function getTableName(): string;", "public function getTableName(): string;", "public function getTableKeyName()\r\n\t{\r\n\t\treturn \"id\".$this->getTableName();\r\n\t}", "public function table_name(){\n $q = \"SHOW FULL TABLES FROM \".DATABASE;\n $re = $this->Request_model->peticion($q);\n $tabla = array();\n for ($i=0; $i <count($re) ; $i++):\n $db = 'Tables_in_'.DATABASE;\n $value = $re[$i][$db];\n $tabla[] = $value;\n endfor; \n return $tabla;\n }", "public function getTableName()\n {\n return $this->__get(\"table_name\");\n }", "protected function table () : string {\n return $this->guessName();\n }", "public function getTableName( )\n {\n return $this->table_name;\n }", "public function getTableKeyName()\n\t{\n\t\treturn \"id\".$this->getTableName();\n\t}", "public static function getTableName()\n {\n return _DB_PREFIX_ . self::$definition['table'];\n }", "protected static function get_table_name() {\n return null;\n }", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "protected function getTableName(): string {\n return self::TABLE_NAME;\n }", "public static function get_table_name()\n {\n return self::TABLE_NAME;\n }", "public static function tableName(): string;", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "abstract public static function getTableName();", "abstract public static function getTableName();", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "function table_name() {\n\t\tif ($this->table) {\n\t\t\treturn $this->table;\n\t\t} else {\n\t\t\treturn $this->_get_type();\n\t\t}\n\n\t}", "public function getTableName():string;", "public function getTableName(){\n\t\treturn $this->_table;\n\t}", "public static function getTableName() {\n return str_replace(\"-\", '_', self::getFolderName()) . 's';\n }", "public function getTableName() {\n if (isset($this->table)) {\n return $this->table;\n } else return $this->name;\n }", "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "abstract protected function getTableName();", "abstract protected function getTableName();", "public function getTableName()\n\t{\n\t\treturn $this->getPrefix().$this->tableName;\n\t}", "function GetNameById($Table, $id)\n {\n if (empty($id)) return $this->Msg->show_text('_VALUE_NOT_SET');\n $tmp_db = DBs::getInstance();\n $q=\"select name FROM `\".$Table.\"` WHERE id='\".$id.\"'\";\n $res = $tmp_db->db_Query($q);\n if (!$res) return false;\n if( !$tmp_db->result ) return false;\n $row_res=$tmp_db->db_FetchAssoc();\n //echo '<br> $id='.$id.' $row_res[cod]='.$row_res['cod'].' $row_ress[name]='. $row_ress['name'];\n return stripslashes($row_res['name']);\n }", "protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}", "public function getTableNames();", "public function getTableName()\n {\n return $this->table_name;\n }", "public function\n\t\tget_table_name()\n\t{\n\t\tif (!isset($this->table_name)) {\n\t\t\t$sxe = $this->get_simple_xml_element();\n\t\t\t\n\t\t\t$this->table_name = (string)$sxe->table['name'];\n\t\t}\n\t\t\n\t\treturn $this->table_name;\n\t}", "function getItemTableName() ;", "public function getTable()\n\t{\n\t\treturn empty($this->table) ? $this->table = Db_Inflector::pluralize($this->getSingular()) : $this->table;\n\t}", "public function _tablename() {\n if (isset($this->_table) && !isNull($this->_table)) {\n return $this->_table;\n } else {\n return camel_case_to_underscore(get_class($this));\n }\n }", "public function getTableName(){\n\t\treturn $this->tableName;\n\t}", "protected function table(): string\n {\n return $this->tableName;\n }", "protected function getTableName()\n {\n return $this->database->getPrefix() . $this->table;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public static function getTableName() {\n return self::$tableName;\n }", "protected function getTableName () {\n $class = explode('\\\\', get_class($this));\n\n return strtolower(end($class));\n }", "public static function getNomeTabella()\n {\n return self::$nomeTabella;\n }", "public function getTableName()\r\n {\r\n return $this->tableName;\r\n }", "public function getTableName() : string\n {\n if ($this->tableName !== null) {\n return $this->tableName;\n }\n\n return $this->reflectionClass->getShortName();\n }", "public function table_name()\n\t{\n\t\treturn $this->table_name;\n\t}", "public function getTableName()\n {\n return $this->parentTable->getName();\n }", "public function getTableName(): string\n {\n return $this->getEntityDao()->getTableName();\n }", "protected function get_table_name() {\n\t\treturn Model::get_table_name( 'Indexable_Hierarchy' );\n\t}", "public function getTableName() {\n return $this->table;\n }", "public function getTableName()\n\t{\n\t\treturn $this->tableName;\n\t}", "public function getTableName(){\n return $this->tableName;\n }", "public static function table_name() {\n $table_name = strtolower(get_called_class());\n\n if (!in_array($table_name, ApplicationSql::tablenames()))\n throw new TableNotFoundException(\"Veritabanında böyle bir tablo mevcut değil\", $table_name);\n\n return $table_name;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function get_table_name() {\n return $this->table_name;\n }", "public static function GetTableName() {\n\t\t\treturn \"person\";\n\t\t}", "public function getTableName(){\n\t\t $table = get_class($this);\n\t\treturn strtolower(substr($table, strripos($table, \"\\\\\")+1));\n\t}", "public function dataTableName()\n {\n $tableName = 'pd2_' . Utils::normalizeString($this->product()->name)\n . '__' . Utils::normalizeString($this->name);\n return strtolower($tableName);\n }", "public static function getTableName()\n {\n $type = static::getType();\n return $type::getTableName();\n }", "public function getTableName(){\r\n\t\treturn strtolower(get_class($this));\r\n\t}", "public function getTableName() {\n\t\t$dbName = empty($this->_dbName) ? '' : ($this->_dbName . '.');\n\t\t$tableName = $dbName . $this->_tableName;\n\t\treturn ($tableName);\n\t}", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTable(): string\n {\n return $this->prefix . $this->table;\n }", "public static function getTableName()\n {\n return Str::snake(Str::pluralStudly(class_basename(get_called_class())));\n }", "function nombrecampo($numcampo){return mysqli_field_name($this->Consulta_ID, $numcampo);}", "function getTableName() {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->_tableName;\n }", "public function table() {\n\t\treturn static::$table ?: strtolower(Str::plural(class_basename($this)));\n\t}", "function name_from_id($nfi_table, $nfi_id, $nfi_id_col, $nfi_name_col){\r\n\t\tglobal $conn;\r\n\t\t$sql_quary = \"SELECT * FROM \".$nfi_table.\" WHERE \".$nfi_id_col.\"='\".$nfi_id.\"';\";\r\n\t\t$sql = $conn->prepare($sql_quary);\r\n\t\t$sql->execute();\r\n\t\t\t\r\n\t\t$numRows = $sql->fetchAll();\r\n\t\t\tif(count($numRows)>0){\r\n\t\t\t\tforeach($numRows as $row){\r\n\t\t\t\t\treturn $row[$nfi_name_col];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}", "public function getMainTableName()\n {\n return $this->main_table_name;\n }", "function get_table_name()\n {\n global $table_prefix;\n global $wpdb;\n $prefix = $table_prefix;\n if ($wpdb != null && $wpdb->prefix != null) {\n $prefix = $wpdb->prefix;\n }\n return apply_filters('ngg_datamapper_table_name', $prefix . $this->_object_name, $this->_object_name);\n }" ]
[ "0.75973105", "0.7541626", "0.7541626", "0.7479761", "0.7479761", "0.7469244", "0.7462143", "0.7415301", "0.7375801", "0.7371506", "0.7346053", "0.7330673", "0.7329456", "0.72827893", "0.72729284", "0.7270253", "0.7249949", "0.7249774", "0.7229642", "0.72248405", "0.72111136", "0.7206957", "0.7206957", "0.72031754", "0.71954936", "0.71887344", "0.7186598", "0.71488845", "0.7141517", "0.7132846", "0.71312076", "0.71248895", "0.71248895", "0.71248895", "0.7117888", "0.70905715", "0.7080737", "0.70791435", "0.70791435", "0.70791435", "0.7073427", "0.7073427", "0.7071403", "0.7071403", "0.7071403", "0.7053347", "0.7043548", "0.7021132", "0.70124155", "0.7001813", "0.6991148", "0.69679445", "0.69679445", "0.69633925", "0.6960053", "0.695844", "0.6947538", "0.6944634", "0.6927932", "0.69202805", "0.69087803", "0.68945634", "0.68867195", "0.68743104", "0.68688244", "0.68664193", "0.6852204", "0.68515587", "0.6850557", "0.68404275", "0.68358254", "0.68261385", "0.68256015", "0.682295", "0.68229336", "0.6818698", "0.6817901", "0.6816982", "0.68168056", "0.6811877", "0.6811877", "0.6811877", "0.6811877", "0.68063617", "0.68051046", "0.68002367", "0.67777544", "0.6777721", "0.67774713", "0.6760596", "0.6755588", "0.6755588", "0.6733429", "0.67240065", "0.6715411", "0.67112213", "0.6699606", "0.66994536", "0.6699203", "0.6695205", "0.6691901" ]
0.0
-1
Display a listing of the users.
public function index(IndexRequest $request): View { $users = $this->users->search($request); $search = $request->get('search'); if ($users->count() > 0) { return view('admin.users.index', [ 'users' => $users, 'user_found' => trans('messages.found', ['search' => $search]), ]); } return view('admin.users.index', [ 'users' => $users, 'user_not_found' => trans('messages.search_not_found', ['search' => $search]), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }", "public function index()\n {\n $this->user_list();\n }", "public function showUsers()\n {\n $userRepo = $this->getDoctrine()->getRepository(User::class);\n $users = $userRepo->getUsersOrderByAsc();\n\n return $this->render('admin/list-of-users.html.twig', [\n 'users' => $users\n ]);\n }", "public function index()\n {\n $this->userlist();\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "public function index()\n {\n $users = $this->userService->getUserWithPaginate();\n return view('admin.user.list', compact('users'));\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function index() {\n $rows = AdminUser::paginate(10);\n return View::make(\"CoreCms::user.listing\")->with(\"models\", $rows);\n }", "public function index() {\n\t\t$this->accessible();\n\t\t$users = User::paginate(5);\n\n\t\treturn view('users.list', compact('users'));\n\t}", "public function indexAction()\n {\n // Get a query of listing all users from user service\n $pages = $this->get('app.user.service')->getUsers();\n \n // Get pagination\n $pagination = $this->get('app.service')->paginate($pages);\n \n // Render and return the view\n return $this->render(\n '::admin/user/users.html.twig',\n array(\n 'pagination' => $pagination\n )\n );\n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function index() \n {\n $users = $this->userRepo->listUser();\n return view('backend.pages.user.list', compact('users'));\n }", "public function index()\n {\n return view('admin.users.index', ['users' => $this->repository->getSortableListViaPagination()]);\n }", "public function index()\n {\n $count = \\App\\User::count();\n $users = \\App\\User::orderBy('id', 'desc')->paginate(10);\n\n return view('webcontrol.user.list', compact('count', 'users'));\n }", "public function index()\n {\n $users = $this->repository->all($columns = ['*']);\n return $this->success($users, trans('messages.users.getListSuccess'));\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function index()\n {\n // show list user\n }", "public function indexAction()\n {\n $listing = $this->listing( 'Panel\\Listing\\Users');\n\n return array( 'listing' => $listing );\n }", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function list ()\n {\n if (User::isLoggedIn() && User::getLoggedInUser()->is_admin === true) {\n\n // Alle User aus der DB laden\n $users = User::all();\n\n // Passenden View laden und User übergeben\n View::load('admin/users', [\n 'users' => $users\n ]);\n } else {\n \n // Wenn kein User eingeloggt ist, dann leider wir auf die Login Seite \n header(\"Location: login\");\n }\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function admin_user_list() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('User.created' => 'desc' ),\n 'conditions' => array('User.status' => 1),\n );\n $data = $this->paginate('User');\n $this->set('user', $data);\n $this->render('/Users/user_list');\n }", "public function index()\n {\n $users = User::order('created_at')->get();\n\n return view('users.list', compact('users'))->with(['mainmenu' => $this->mainmenu, 'submenu' => $this->submenu]);\n }", "public function listUsers() {\n \t$data['users'] = User::all();\n \treturn view('backend.users.index', $data);\n }", "public function index()\n\t{\n\t\t$users = $this->user->active()->paginate(10);\n\n\t\treturn $this->view->make('users.index', compact('users'));\n\t}", "public function index()\n\t{\n\t\t$searchKeyword = Input::get('q', '');\n\t\t$searchRoles = Input::get('roles', array());\n\n\t\t// Get Users (with roles) and limit it to only 30 results for\n\t\t// pagination. Don't you just love it when pagination simply works.\n\t\t$eloquent = App::make('orchestra.user')->search($searchKeyword, $searchRoles)->paginate();\n\t\t$roles = App::make('orchestra.role')->lists('name', 'id');\n\n\t\t// Build users table HTML using a schema liked code structure.\n\t\t$table = $this->presenter->table($eloquent);\n\n\t\tEvent::fire('orchestra.list: users', array($eloquent, $table));\n\n\t\t// Once all event listening to `orchestra.list: users` is executed,\n\t\t// we can add we can now add the final column, edit and delete \n\t\t// action for users.\n\t\t$this->presenter->actions($table);\n\n\t\tSite::set('title', trans('orchestra/foundation::title.users.list'));\n\n\t\treturn View::make('orchestra/foundation::users.index', array(\n\t\t\t'eloquent' => $eloquent,\n\t\t\t'roles' => $roles, \n\t\t\t'searchKeyword' => $searchKeyword,\n\t\t\t'searchRoles' => $searchRoles,\n\t\t\t'table' => $table, \n\t\t));\n\t}", "public function index()\n {\n return view('backend.user.list_user');\n }", "public function index()\n {\n $data['users'] = $this->user->all();\n return view('backend.user.list')->with($data);\n }", "public function index()\n {\n\n $users = $this->user->paginate(10);\n\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $users = $this->userService::getAll();\n\n return view('admin.pages.users')->with(compact('users'));\n }", "public function index()\n {\n $users = (new User)->findAll();\n $title = 'Liste des membres';\n\n $data = compact('title', 'users');\n\n return $this->view('user/list', $data);\n\t}", "public function index()\n {\n $users = User::paginate(15);\n return view('user.list', ['users' => $users]);\n }", "public function index()\n {\n $users = $this->userRepository->getPaginate();\n \n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $users = User::all();\n return view('users.userslist')->withUsers($users);\n }", "public function showUsers()\r\n\t{\r\n\t\t$users = User::paginate(10);\r\n\r\n\t\treturn view('admin/users', compact('users'));\r\n\t}", "public function indexAction(){\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $perpage = 2;\n $count = \\R::count('user');\n $pagination = new Pagination($page, $perpage, $count);\n $start = $pagination->getStart();\n $users = \\R::findAll('user', \"LIMIT $start, $perpage\");\n\n $this->setMeta('All users');\n $this->setData(compact('users', 'pagination', 'count'));\n }", "public function index() {\n $users = User::select(\"users.*\")->paginate(10);\n return view('layouts.user-list', ['data' => $users]);\n }", "public function index()\n\t{\n\t\tLog::info('Ingreso al Index');\n\t\t$page = Input::get('page', 1);\n\n\t\t$data = $this->user->getByPage($page, 15);\n\n\t\t$users = Paginator::make($data->items, $data->totalItems, 15);\n\t\t$users = $this->presenter->paginator($users, new UserPresenter);\n\n\t\treturn View::make(\"users.index\", compact(\"users\"));\n\t}", "public function index()\n {\n // user search\n\n $name = $this->request->name;\n $email = $this->request->email;\n\n $users = new User;\n\n if (!empty($name)) {\n \t$users = $users->name($name);\n }\n\n if (!empty($email)) {\n \t$users = $users->email($email);\n }\n\n $users = $users->paginate(5);\n\n return view('admin.users.index',compact('users'));\n }", "public function index()\n {\n $users = Base::user()->paginate();\n\n return view('admin::auth.users.index')->with(compact('users'));\n }", "public function index()\n {\n $users = $this->userRepository->getAllWithPaginate();\n\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $this->checkPermission();\n\n $this->title = trans('admin.users');\n $users = User::with('roles')->paginate(10);\n\n $this->content = view('admin.users.index')->with(compact('users'))->render();\n return $this->renderOutput();\n }", "public function index()\n {\n $users = User::all();\n return view('backend.user.list', compact(['users']));\n }", "public function index()\n {\n $users = \\App\\User::paginate(20);\n\n return view('admin.users', ['users' => $users]);\n }", "public function index()\n {\n\n $usersList = User::all();\n\n return view('dash.users')->with( compact('usersList') );\n }", "public function index()\n {\n $users = User::all();\n //show the users list, mostly advanced users\n return view('users.index')->with('users', $users);\n }", "public function index()\n {\n $pagintaionEnabled = true;\n if ($pagintaionEnabled) {\n $users = User::paginate(config('usersmanagement.paginateListSize'));\n } else {\n $users = User::all();\n }\n $roles = Role::all();\n\n return View('pages.admin.users.show-users', compact('users', 'roles'));\n }", "public function index()\n {\n //\n $_users = User::all();\n return view('admin.users.list', ['users' => $_users ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $users = $em->getRepository('AppBundle:User')->findAll();\n\n return $this->render('users_list.html.twig', array('users' => $users));\n }", "public function listUsers()\n {\n $users = User::all();\n\n return view('listUsers', ['users' => User::all()]);\n\n }", "public function index()\n {\n $users = $this->userRepository->paginate(10);\n return view('users.index')->with(['users' => $users]);\n }", "public function index()\n {\n $users = $this->userRepo->getDataPaginate($this->limit);\n\n return view('admin.user.index', compact('users'));\n }", "public function index()\n {\n // Retrieve Users from the database\n\n $userList = User::all();\n \n // Return that to the list view\n return View::make('user.index')->with('users', $userList); \n \n }", "public function index()\n {\n $users = User::paginate(10);\n\n return view('backend.users.index')->withUsers($users);\n }", "public function index()\n {\n $users = $this->usersRepo->paginate();\n return view('CMS::users.index', compact('users'));\n }", "public function listUsers()\n {\n $users = $this->apiHeaderNav();\n return view('user.userListAll',['data'=>$users]);\n }", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function actionIndex()\n {\n $request = Yii::$app->request;\n\n $params = ArrayHelper::merge($request->get(), [\n 'perPage' => $request->get('perPage', Yii::$app->params['per_pages'][0]),\n 'orderCol' => $request->get('orderCol', 'id'),\n 'orderDir' => $request->get('orderDir', 'asc')\n ]);\n\n $pageTitle = Yii::t('app', 'List of users');\n\n $breadcrumbs = [\n ['url' => ['/admin'], 'label' => Yii::t('app', 'Admin panel'), ],\n ['url' => ['/admin/user/list'], 'label' => $pageTitle, 'class' => 'active']\n ];\n\n $data = User::getList($params);\n\n return $this->render('/admin/user/list.twig', [\n 'params' => $params,\n 'pages' => $data['pages'],\n 'users' => $data['models'],\n 'pageTitle' => $pageTitle,\n 'breadcrumbs' => $breadcrumbs,\n ]);\n }", "public function list() {\n $users = User::orderBy('name')->paginate(10);\n $repository = new Repository(compact('users'));\n \n $layout = Layout::blank([\n Layout::view('vendor.platform.users.list')\n ]);\n \n return $layout->build($repository);\n }", "public function index()\n {\n $users = $this->users->sortable(['created_at' => 'desc'])->paginate(10);\n\n return view('admin.users.index', ['users' => $users]);\n }", "public function index()\n {\n $users = $this->users->sortable(['created_at' => 'desc'])->paginate(10);\n\n return view('admin.users.index', ['users' => $users]);\n }", "public function index()\n {\n $users = User::paginate(10);\n\n return view('admin.users.index', compact('users'));\n }", "public function index()\n\t{\n\t\t//list all users with db facade\n\t\t\n\t\t$list = \\DB::table('users')->get();\n\t\treturn view('users.index')->with( 'list', $list);\n\t}", "public function index()\n {\n \n return view('users.users_list');\n }", "function userListing()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n { \n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n $data['searchText'] = $searchText;\n \n $this->load->library('pagination');\n \n $count = $this->user_model->userListingCount($searchText);\n\n\t\t\t$returns = $this->paginationCompress ( \"userListing/\", $count, 5 );\n \n $data['userRecords'] = $this->user_model->userListing($searchText, $returns[\"page\"], $returns[\"segment\"]);\n \n $this->global['pageTitle'] = 'Garuda Informatics : User Listing';\n \n $this->loadViews($this->view.\"users\", $this->global, $data, NULL);\n }\n }", "public function index()\n {\n $data = [];\n $users = User::paginate(10);\n $data['users'] = $users;\n return view('admin.user.user-list',['data' => $data]);\n }", "public function allUsers()\n\t{\n\t\t$data['users'] = $this->MainModel->selectAll('users', 'first_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-users', $data);\n\t\t$this->load->view('layout/footer');\n\t}", "public function index() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$this->User->recursive = 0;\n\t\t$this->set('users', $this->paginate());\n\t\t$this->set('userId', $user['User']['id']);\n\t\t$this->set('userType', $user['User']['type']);\n\t}", "public function allUsers()\n {\n $users = $this->user->findAll();\n $this->show('admin/allusers', ['users' => $users]);\n }", "public function index() {\n $this->view->users = $this->model->getAllUsers();\n $this->view->errors = $this->model->errors;\n $this->view->render('users/index');\n }", "public function index()\n {\n $client = new Client($this->data);\n\n $response = $client->get('user');\n\n $body = $response->getBody();\n\n $users = json_decode($body);\n\n return view('user.list')->with(compact('users'));\n }", "public function index()\n {\n $users = User::all();\n return view('users.usersList', compact('users'));\n\n }", "public function listUser()\n {\n $user = User::where('id', '=', 1)->first();\n return view('listUser', [\n 'user' => $user\n ]);\n }", "public function index()\n {\n $users = $this->model->paginate();\n return view('menu-maker::users.index', compact('users'));\n }", "public function index()\n {\n $users = User::paginate(10);\n return view(\"users.index\", compact(\"users\"));\n }", "public function index()\n {\n $data['users'] = User::paginate(10);\n return view('admin.users.index', $data);\n }", "public function user_list()\n {\n \n \t$users = User::all();\n\n $data = array('users' => $users);\n\n return view('manage.user_list')->with($data);;\n }", "public function index(){\n\t\treturn view(Config::get('boxtar.viewUsers'))->with('users', User::latest()->get());\n\t}", "public function index()\n {\n $this->authorize('viewAny', User::class);\n $users = User::paginate(40);\n return view('admin.users.index', compact('users'));\n }", "public function listofUser()\n {\n return view('Admin.ShowallUser');\n }", "public function index()\n {\n $client = new Client($this->data);\n\n $response = $client->get('users');\n\n $body = $response->getBody();\n\n $users = json_decode($body);\n\n return view('users.list')->with(compact('users'));\n }", "public function index()\n {\n $users = $this->users->with('roles')->get();\n return \\View::make('admin.users.index', [\n 'users' => $users,\n 'title' => 'list',\n ]);\n }", "public function listAction()\n {\n $users = $this->container->get( 'wg.openid.user_manager' )->findUsers();\n return $this->container->get('templating')->renderResponse(\n 'WGOpenIdUserBundle:Profile:list.html.twig', array(\n 'users' => $users,\n ));\n }", "public function index()\n {\n $users = User::all();\n \n\n return view('admin.user.listar')->with(compact('users'));\n }", "public function index()\n {\n return view('administration::user.index')\n ->withUsers($this->user->all());\n }", "public function index()\n {\n $users = User::paginate();\n return view('manage.users.index')->withUsers($users);\n }", "public function index()\n {\n $users = User::paginate(10);\n return view('admin.user.index', ['users' => $users]);\n }", "public function index()\n {\n $users = User::paginate(10);\n return view('user.users.index', compact('users'));\n }", "public function indexAction()\n {\n $users = (new UserCollectionModel())->getUsers();\n echo (new View('userIndex'))\n ->addData('users', $users)\n ->render();\n }", "public function index()\n {\n $users = User::paginate();\n return view('admin.users.index')->with('users', $users);\n }", "public function index()\n {\n $users = User::sortable()->orderBy('created_at', 'desc')->paginate(config('paginate.number_users'));\n return view('admin.pages.users.index', compact('users'));\n }", "public function index()\n {\n $this->authorize('access_users_list', User::class);\n $users = User::orderBy('created_at', 'desc')->paginate(10);\n return view('users.index', [ 'users' => $users ]);\n }", "public function getUsers()\n {\n $title = \"Users\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the users from db\n $users = $this->di->get(\"user\")->getAllUsers();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"users\" => $users,\n ];\n\n $view->add(\"pages/users\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function index()\n {\n $users = User::latest()->paginate(10);\n $i = 1;\n return view('user_management.user', compact(['users', 'i']));\n }", "public function index()\n {\n $users = User::paginate(5);\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n return $this->showCollectionResponse(User::all(), 200);\n }", "public function index()\n {\n $users = User::All();\n return $this->showAll($users);\n }", "public function index()\n {\n $users = User::all();\n return $this->showAll($users);\n }", "function index() {\n $url = base_url() . \"index.php/users\";\n $total_records = count($this->musers->get_users());\n $config = $this->paginate($url, $total_records);\n $this->pagination->initialize($config);\n $data = $this->get_videos();\n $data['sys_users'] = $this->musers->get_users($config['per_page'], $this->uri->segment(3));\n $this->template->load('default', 'listUsers', $data);\n }" ]
[ "0.84975696", "0.8424116", "0.8382212", "0.83699566", "0.8355048", "0.83195335", "0.8219673", "0.82143384", "0.82093567", "0.8201486", "0.81907934", "0.8156546", "0.81461644", "0.80821127", "0.8063815", "0.80488044", "0.8031988", "0.8002079", "0.79930633", "0.798597", "0.7977237", "0.797538", "0.79725415", "0.7965154", "0.79646546", "0.795845", "0.79574156", "0.7941749", "0.7930604", "0.7929727", "0.7916691", "0.7910743", "0.7905096", "0.7901208", "0.7898221", "0.7895297", "0.78939855", "0.7890173", "0.7884177", "0.7883543", "0.7883072", "0.7880323", "0.7879571", "0.7871336", "0.78612465", "0.78599083", "0.78590375", "0.7857744", "0.78536624", "0.78510857", "0.7845252", "0.7841848", "0.78403485", "0.783563", "0.7827884", "0.782152", "0.7821133", "0.78200614", "0.7814205", "0.7813864", "0.781325", "0.7805784", "0.7805784", "0.78022134", "0.78020537", "0.7796691", "0.779225", "0.7791133", "0.7788625", "0.77882874", "0.77872473", "0.7786954", "0.7786643", "0.77831507", "0.7782746", "0.77762634", "0.77745855", "0.77716327", "0.77653044", "0.7764376", "0.7763344", "0.77587795", "0.7755948", "0.77540565", "0.7753605", "0.77535623", "0.77526253", "0.7751167", "0.77433616", "0.7740935", "0.77344334", "0.77324873", "0.7727016", "0.77228194", "0.77194387", "0.77181643", "0.77176243", "0.771387", "0.7710699", "0.77061653", "0.77061456" ]
0.0
-1
Display the specified user.
public function show(User $user): View { return view('admin.users.show', [ 'user' => $user, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function displayUser()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayUser();\n }\n }", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "function show( $id_user ) {\n\n\t\treturn '';\n\t}", "public function show(user $user)\n {\n //\n }", "public function show(user $user)\n {\n //\n }", "public final function display(){\n echo \"Username is{$this->user} and user id is{$this->userId}\";\n }", "public function showSingleUser(array $context) {\n\n echo $this->render('show_user.html', array(\n $this->user => $context[$this->user],\n $this->repos => $context[$this->repos],\n $this->followers => $context[$this->followers],\n $this->auth => $context[$this->auth],\n $this->search_q => $this->searchFieldName\n ));\n }", "public function show(user $user)\n {\n return $user;\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n //\n }", "public function show(User $user)\n {\n }", "public function show(User $user)\n {\n }", "public function show(NameUser $nameUser)\n {\n //\n }", "public function show($user)\n {\n return view('user::show');\n }", "public function actionUser()\n {\n $login = Yii::$app->request->get('id');\n $response = GitHubApi::getUser($login);\n\n return $this->render('user', [\n 'response' => $response,\n ]);\n }", "public function showAction($userId) {\r\n\t\t$this->view->user = Users::findFirst ( $userId );\r\n\t}", "public function show(User $user)\n {\n \n }", "public function userAction()\n {\n \n $request = $this->getRequest();\n\n $inline\t= $request->getParam('inline');\n \n if($inline){\n\t $pix\t= Point_Model_Picture::getInstance();\n\t //$pix->makeThumbnail('');\n\t /*\n\t * Check if user is logged-in and act accordingly\n\t */\n\t $viewRenderer\t= Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);\n\t \t$viewRenderer->setResponseSegment('userPane');\n\t \t\n\t \t$auth\t= Zend_Auth::getInstance();\n\t \t$this->view->username = Point_Model_User::getInstance()->fullname();\n\t\n\t \tif ($auth->hasIdentity()){ // We are to render the login profile menu\n\t \t\n\t \t$this->_helper->viewRenderer->render('userminipane');\n\t \n\t } else { // render 'Sign in' page\n\t\t \n\t\t /* create the dialog for user */\n\t\t \t$this->_prepareLoginDialog();\n\t\t \t$this->_helper->viewRenderer->render('-login');\n\t }\n\t \n } else { // accidentally called!!!\n \t$this->_helper->viewRenderer->setNoRender();\n \t$this->_redirect('/');\n }\n \n $this->_helper->viewRenderer->setNoRender(true);\n// $this->_helper->layout->disableLayout();\n\n }", "public function show(User $user)\n {\n\n }", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function show(User $user)\n {\n //\n\n }", "public function show(User $user)\n {\n //\n\n }", "public function user($user)\n {\n //pr($user);\n $this->template = 'display';\n $menu = [];\n $menu[] = [\n 'title' => $user['name'],\n 'url' => ['controller' => 'profiles', 'action' => 'show', $user['id']],\n 'options' => []\n ];\n $menu[] = [\n 'title' => 'Sign Out',\n 'url' => ['controller' => 'users', 'action' => 'logout'],\n 'options' => []\n ];\n $this->set('menu', $menu);\n }", "public function show(User $user)\n {\n return view('users.show', get_defined_vars());\n }", "function show() {\n // Process request with using of models\n $user = Service::get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n $view = 'user/show';\n return $this->render($view, $data);\n } else {\n return Application::error403();\n }\n}", "public function byuserAction()\n\t{\n\t\t$username = $this->_getParam('id');\n\t\t$this->view->username = $username;\n\t\t$this->view->comments = $this->_commentMapper->findByUser($username);\n\t\t$this->render('byuser');\n\t}", "public function show_user($id)\n\t{\n\t\t$user = User::find($id);\n\t\treturn view('admin.show_user', compact('user'));\n\t}", "public function show(User $user)\n { \n return $user;\n }", "public function viewUser($userid)\n {\n $user = $this->user->find($userid);\n if ($user) {\n $this->show('admin/userdetails.php', ['user' => $user]);\n } else {\n $this->showNotFound();\n }\n }", "public function actionViewuser($id)\n {\n $userone = \\common\\models\\User::findOne(['id'=>$id]);\n\n return $this->render('viewuser', [\n 'user' => $userone,\n ]);\n }", "public function show(\\App\\User $user)\n {\n //\n }", "public function show(UserController $user)\n {\n //\n }", "public function show(Server_User $server_User)\n {\n //\n }", "public function showAction(User $user)\n {\n $deleteForm = $this->createDeleteForm($user);\n\n return $this->render('user/show.html.twig', array(\n 'user' => $user,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(User $User)\n {\n //\n }", "public function show(User $User)\n {\n //\n }", "public function show(User $User)\n {\n //\n }", "public function show(User $User)\n {\n //\n }" ]
[ "0.7908481", "0.77904975", "0.7351653", "0.72784024", "0.72784024", "0.723638", "0.7144317", "0.7103893", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7098826", "0.7093857", "0.7093857", "0.7090712", "0.7077877", "0.7055094", "0.7054899", "0.70313966", "0.70182586", "0.69925874", "0.69559157", "0.69408107", "0.69408107", "0.6929154", "0.6916691", "0.68883526", "0.68266577", "0.6801227", "0.6784307", "0.6771055", "0.67664176", "0.67342985", "0.67304695", "0.67174757", "0.6711036", "0.6683765", "0.6683765", "0.6683765", "0.6683765" ]
0.0
-1
Show the form for editing the specified user.
public function edit(UserRequest $request, User $user): View { return view('admin.users.edit', [ 'user' => $user, 'input_name' => $request->input('input_name'), // variable que le dice a la vista cual input mostrar ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->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// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "public function editUser(UserEditForm $form, User $user);", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "public function edit($user) {\n\t\t$this->authorize('edit', $user);\n\t\treturn view(Config::get('boxtar.editUser'), compact('user'));\n\t}", "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($id)\n {\n // show form edit user info\n }", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "public function formUserEdit($user_id){\n // Get the user to edit\n $target_user = UserLoader::fetch($user_id); \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_users') && !$this->_app->user->checkAccess('uri_group_users', ['primary_group_id' => $target_user->primary_group_id])){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Determine which groups this user is a member of\n $user_groups = $target_user->getGroups();\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($user_groups[$group_id]))\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields\n $fields = ['display_name', 'email', 'title', 'password', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else if ($this->_app->user->checkAccess(\"view_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $disabled_fields[] = $field;\n else\n $hidden_fields[] = $field;\n }\n \n // Always disallow editing username\n $disabled_fields[] = \"user_name\";\n \n // Hide password fields for editing user\n $hidden_fields[] = \"password\";\n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-update.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Edit User\",\n \"submit_button\" => \"Update user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users/u/$user_id\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "public function edit(User $user) {\n\t\t$this->accessible();\n\n\t\treturn view('users.modify', compact('user'));\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit(User $user) {\n\t\tif ($user->id != (\\Auth::user()->id))\n\t\t\treturn $this->forbiddenResponse();\n\n\t\treturn $this->innerView('edit', compact('user'));\n\t}", "public function edit()\n {\n return view(config('const.template.user.edit'), ['user' => User::find($this->guard()->id())]);\n }", "public function edit(User $user) //mostra formulário de edição de um usuário\n {\n $form = \\FormBuilder::create(UserForm::class,[\n 'url' => route('admin.users.update', ['user' => $user->id]),\n 'method' => 'PUT',\n 'model' => $user\n ]); //classe de formulario, url de ação do formulario e método http\n\n return view('admin.users.edit', compact('form'));\n }", "public function edit()\n\t{\n\t\treturn view('admin.users.edit')->with('user', $this->user);\n\t}", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit(User $user)\n {\n return view('users.form', ['user' => $user]);\n }", "public function edit(User $user)\n {\n return view ('users.edit', compact('user'));\n\n }", "public function edit()\n {\n $id = Auth::user()->id;\n $user = User::find($id);\n return view('user.edit', compact('user'));\n }", "public function edit(User $user)\n {\n \n }", "public function edit(User $user)\n\t{\n return view('users.edit', compact('user'));\n\t}", "public function edit(User $user)\n {\n if(Auth::user()->group->id <= 1){\n $groups = UserGroups::all();\n }else{\n $groups = UserGroups::where('id', '>', 1)->get();\n }\n return view('admin.users.form',[\n 'user' => $user,\n 'title_postfix' => $user->name,\n 'navigation' => $this->navigation,\n 'groups' => $groups\n ]);\n }", "public function edit(user $user)\n {\n //\n }", "public function edit(user $user)\n {\n //\n }", "public function edit(User $user)\n {\n return view('users.form', compact('user'));\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n\t{\n\t\treturn view('users.edit', compact('user'));\n\t}", "public function edit(User $user)\n\t{\n\t\treturn view('users.edit', compact('user'));\n\t}", "public function edit()\n {\n return view('user.edit', [\n 'user' => Auth::user()\n ]);\n }", "public function edit(User $user)\n {\n //\n $this->authorize('update', $user);\n return view('users.edit', compact('user'));\n }", "public function edit($user)\n {\n $user = $this->user->findOrFail($user);\n return view('admin.users.edit', compact('user'));\n }", "public function edit()\n\t{\n\t\t$user = App::make('user.current');\n\t\treturn View::make('shared.user.edit-user', $user->toArray());\n\t}", "public function edit(UserEditFormRequest $request) {\n $user = User::findOrFail($request->id);\n $data['user'] = $user;\n Former::populate($user);\n return view('users.edit', $data );\n }", "public function edit(User $user)\n {\n $usr=$this->getUsr();\n return view('user/edit',compact('user','usr'));\n\n }", "public function edit(User $user)\n {\n // return view('users.edit', compact('user'));\n }", "public function edit(User $user)\n {\n }", "public function edit(User $user)\n {\n // $moderator_role = Role::findByName('moderator');\n // $user->syncRoles([$moderator_role]);\n $this->authorize('update', $user);\n return view('users.edit', compact('user'));\n }", "public function edit(User $user, $id)\n {\n $user = User::findOrFail($id);\n return view('editForms.editUser', [\n 'name' => Auth::user()->name,\n 'role' => Auth::user()->role,\n 'user_id' => $id,\n 'user_name' => $user->name,\n 'user_role' => $user->role\n ]);\n }", "public function edit(\\App\\User $user)\n {\n return view('users.sysuser.edit', compact('user'));\n }", "public function edit(User $user)\n {\n return view('users.edit', compact('user'));\n }", "public function edit(User $user)\n {\n return view('users.form', [\n 'user' => $user\n ]);\n }", "public function edit()\n {\n /*get the user form auth*/\n $user = auth()->user();\n /*return view with that user*/\n return view('user.edit', compact('user'));\n }", "public function edit()\n {\n return view('auth.user.edit')->with('user', auth()->user());\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit(User $user)\n {\n Gate::authorize('app.users.edit');\n \n $roles = Role::all();\n return view('layouts.backend.users.form', [\n 'roles' => $roles,\n 'user' => $user,\n ]);\n }", "public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function edit(User $user)\n {\n try {\n return view(\"backend.users.edit\", compact('user'));\n } catch (\\Throwable $e) {\n throw $e;\n }\n }", "public function edit(User $user) \n {\n return view('users.edit')->with( 'user', $user );\n }", "public function edit(User $user)\n {\n //\n\n\n return view(\"admin.users.create\",[\n 'user'=>$user\n ]);\n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function edit(User $user)\n {\n return view('user_management.edit', compact('user'));\n }", "public function edit(User $user)\n {\n return view('admin.auth.users.edit')->with(compact('user'));\n }", "public function edit(User $user)\n {\n if(! (\n Auth::user()->is_admin ||\n Auth::user() == $user)\n ) {\n return redirect('home');\n }\n\n //if the user is pending approval (and not already deleted/denied)\n //AND the active user is an admin, display the view\n //which allows admins to approve or deny\n if( !$user->is_approved && Auth::user()->is_admin ){\n $request_access= true;\n }\n else {\n $request_access= false;\n }\n\n if( Auth::user()->is_admin ){\n $admin_tools= true;\n }\n else {\n $admin_tools= false;\n }\n\n\n\n return view('user.edit', compact('user', 'request_access', 'admin_tools'));\n }", "public function edit(User $user, $id)\n\t{\n\t\t$user = Auth::guard('admin')->user();\n\n\t\t$employee = \\App\\User::find($id);\n\n\t\treturn view('admin.pages.users.edit', ['user' => $user, 'employee' => $employee]);\n\t}", "public function edit(User $user)\n {\n return view('admin.creator.edit', compact('user'));\n }", "public function edit(User $user)\n {\n return view('admin.user.edit',['user' => $user]);\n }" ]
[ "0.8212737", "0.7995539", "0.79488236", "0.79168403", "0.7796333", "0.77315855", "0.77141505", "0.7681968", "0.7671786", "0.7670402", "0.7632981", "0.763202", "0.7626699", "0.76171184", "0.761694", "0.7611683", "0.758565", "0.7563325", "0.7554998", "0.7525682", "0.75177723", "0.7505428", "0.74996215", "0.74879116", "0.7473389", "0.7467334", "0.7467334", "0.7466533", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74543923", "0.74540156", "0.74540156", "0.7445279", "0.7431158", "0.74298817", "0.7425718", "0.7423377", "0.74196297", "0.741524", "0.739792", "0.73939216", "0.7393039", "0.7389523", "0.73711556", "0.73653454", "0.73622036", "0.73581874", "0.7346799", "0.7341024", "0.733756", "0.7335437", "0.7335369", "0.7330519", "0.7323288", "0.7317981", "0.73130006", "0.73112357", "0.7311155", "0.73021966", "0.73009527" ]
0.0
-1
Update the specified user in storage.
public function update(UserRequest $request, User $user): RedirectResponse { $this->users->update($request, $user); return redirect(route( 'users.show', ['user' => $user] )) ->with('success', trans('messages.crud', [ 'resource' => trans_choice('users.user', 1, ['user_count' => '']), 'status' => trans('fields.updated') ])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($user)\n {\n }", "public function updateUser(UserInterface $user);", "public function testUpdateUser()\n {\n }", "public function update(User $user): void\n {\n }", "public function updating(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updated(User $user)\n {\n //\n }", "public function updateUser($data) {\n\t\t\n\t}", "public function update($user, array $input): void\n {\n $this->authorize(\n 'update',\n $this->user = $user->fresh()\n );\n\n $this->user->update(\n $this->validate($input)\n );\n }", "public function updated(User $user)\n {\n debug('User updated');\n }", "public function update()\n {\n $user = Auth::user();\n\n $data = request()->validate([\n 'name' => 'required|string',\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n ]);\n\n $user->update($data);\n }", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function update(Request $request, User $user)\n {\n \n }", "public function update(Request $request, User $user)\n {\n \n }", "public function update($user_id)\n\t{\n\t\t//\n\t}", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function updateUser( UserDataInf $user )\n {\n \n $userName = $user->getName();\n \n $userId = $this->getUserId( $userName );\n $passwd = Password::passwordHash( $user->getPasswd() );\n \n $sqlUser = <<<SQL\nUPDATE wbfsys_role_user\nSET\n name = '{$userName}', \n inactive = FALSE, \n non_cert_login = TRUE,\n profile = '{$user->getProfile()}',\n level = '{$user->getLevel()}',\n password = '{$passwd}'\nWHERE rowid = {$userId}\n;\nSQL;\n \n $this->db->update( $sqlUser );\n \n $personId = $this->db->select( 'SELECT id_person from wbfsys_role_user where rowid = '.$userId );\n \n \n $sqlPerson = <<<SQL\nUPDATE core_person\nSET\nfirstname = '{$user->getFirstname()}', \nlastname = '{$user->getLastname()}'\nWHERE rowid = {$personId};\nSQL;\n\n $this->db->update( $sqlPerson );\n \n }", "public function update(User $user)\n {\n $inputs = request()->validate([\n\n //'username' => ['required','string', 'max:255', 'alpha_dash'],\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'email', 'max:255'],\n 'avatar' => ['file'],\n //'password' => ['max:255', 'min:8', 'confirmed'],//confirmed is for password confirmation\n\n ]);\n\n if(request('avatar'))\n {\n $inputs['avatar'] = request('avatar')->store('images');\n }\n\n $user->update($inputs);\n session()->flash('user_updated', 'User '.$user->name.' has been updated.');\n return back(); \n }", "public function updated(User $user)\n {\n $this->clearCache($this->key);\n }", "public function updating(User $user)\n {\n\n $user->user_updater_id = \\Auth::id();\n }", "public function update(User $user, Storage $storage)\n {\n return ($user->id == $storage->user_id);\n }", "public function updated(User $user)\n {\n // dd('sdsd');\n }", "public function updateUserProfile(User $user, StoreUserRequest $request)\n {\n foreach($request->all() as $key => $value){\n $user->$key = $value;\n $user->save();\n }\n }", "public function update(UserRequest $request, Storage $storage, UserDetails $userDetails, User $user)\n {\n // Update the useer table\n $user->update($request->validated());\n\n //save user details\n $userDetails->saveDetails($request->all(), $user->id, 'user_profile');\n\n // process profile image\n $this->saveProfileImage($request, $storage, $user, $userDetails);\n\n // Return data\n return new UserResource($user);\n }", "public function update(Request $request, user $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n }", "public function update()\n { if (is_null($this->id))\n trigger_error(\"User::update(): Attempt to update a User object that does not have its ID property set.\", E_USER_ERROR);\n \n // Update the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE users SET user_name=:user_name, user_password_hash=:user_password_hash, user_email=:user_email, orcid=:orcid, orcid_code=:orcid_code, orcid_access_token=:orcid_access_token WHERE user_id = :id\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n $st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "public function modify_user($user);", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function update(Request $request, User $user)\n {\n $validate = $request->validate([\n 'name' => ['required', 'string', 'max:255'],\n 'src' => ['image'],\n 'description' => ['required', 'string','max:1000'],\n ]);\n if ($request->email != $user->email) {\n $validate = $request->validate([\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n ]);\n $user->email = $request->email;\n }\n if($request->file('src')){\n Storage::delete('public/img/team'.$user->src);\n Storage::put('public/img/team',$request->file('src'));\n $user->src = $request->file('src')->hashName();\n };\n $user->name = $request->name;\n $user->description = $request->description;\n if ($request->role_id) {\n $user->role_id = $request->role_id;\n }\n $user->save();\n if($request->job_title_id){\n $user->job_titles()->sync($request->job_title_id);\n }\n\n return redirect('/admin/users/'.$user->id);\n }", "public function update(Request $request, User $user)\n {\n $user->update($request->all());\n if ($request->hasFile('imagen')) {\n $user->imagen = $request->file('imagen')->store('profile');\n }\n if ($user->save()) {\n alert()->success('Usuario modificado correctamente', 'OK')->autoclose(2500);\n return redirect(route('users.show', $user));\n } else {\n alert()->error('Error al modificar los campos', 'Error')->autoclose(2500);\n return back();\n }\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function updateUser($data, $user)\n {\n $this->userRepo->update($data, $user);\n }", "public function update(Request $request, User $user)\n {\n abort_if(auth()->user()->cannot(app('roleHelper')->crudsToName('edit'), User::class), Response::HTTP_FORBIDDEN, '403 Forbidden');\n $request->validate([\n 'name' => 'required',\n 'email' => 'required|email',\n ]);\n\n if ($request->hasFile('img_temp')) {\n if ($user['img']) {\n File::delete($user['img']);\n }\n $request['img'] = 'storage/' . $request->file('img_temp')->store('UserProfiles', 'public');\n }\n\n $user->update($request->all());\n $this->actionsuccess();\n return redirect()->route('admin.users.index');\n }", "public function update(UpdateUserRequest $request, User $user) {\n\t\tif($request->has(\"name\")) {\n\t\t\t$user->name = $request->input(\"name\");\n\t\t}\n\n\t\tif($request->has(\"email\")) {\n\t\t\t$user->email = $request->input(\"email\");\n\t\t}\n\n if($request->has('password')) {\n $user->password = bcrypt($request->input('password'));\n }\n\n $user->save();\n\n if($request->has(\"images\")) {\n $user->files()->sync($request->input(\"images\"));\n }\n\n return $this->item($user, $this->transformer);\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function update(UpdateUserRequest $request, User $user)\n {\n $user = User::where('id', Auth::user()->id)->first();\n\n if($request->hasFile('cover')){\n $img = $request->file('cover');\n $nameImg = $img->hashName();\n\n $img = Image::make($img)->resize(300, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img->save('storage/users/'. $nameImg);\n $user->update([\n 'picture' => $nameImg,\n ]);\n }\n\n if($request->firstname){\n $user->update([\n 'firstname' => $request->firstname,\n ]);\n }\n if($request->name){\n $user->update([\n 'name' => $request->name\n ]);\n }\n if($request->email){\n $user->update([\n 'email' => $request->email,\n ]);\n }\n if($request->group){\n $user->update([\n 'group' => $request->group\n ]);\n }\n\n\n\n return redirect()->route('user.show', ['user' => $user->slug]);\n\n }", "public function update(Request $request, User $user)\n {\n //\n //только изменение информации, кроме head и blocked\n }", "public function updateSettings(User $user, array $data);", "public function update(UserRequest $request)\n\t{\n\t\t// Save the current user\n\t\t$user = $request->user();\n\t\t// Update user's info\n\t\t$data = $request->only(['name', 'email']);\n\n\t\tif ($request->has('password'))\n\t\t\t$data['password'] = Hash::make($request->password);\n\n\t\tif ($request->has('image'))\n\t\t{\n\t\t\tStorage::delete($user->image);\n\t\t\t$data['image'] = Storage::putFile('images', $request->file('image'));\n\t\t}\n\n\t\t$user->update($data);\n\n\t\t// Return updated info\n\t\treturn response(['user' => $user]);\n\t}", "public function update(UserRequest $request, $id)\n {\n \t$Users = User::find($id);\n\t\t$UsersInput = $request->user;\n\t\tforeach ($UsersInput as $key => $value) {\n\t\t\tif ($request->hasfile('user.'.$key))\n\t\t\t{\n\t\t\t\t$UsersInput[$key] = $value->store('project/images','public');\n\t\t\t}\n\t\t\t\n\t\t\tif($key != 'password_confirmation' && $key!='password')\n\t\t\t{\n\t\t\t\t$Users->$key = $UsersInput[$key];\t\n\t\t\t}\n\t\t\telseif($key =='password' && $UsersInput[$key])\n\t\t\t{\n\t\t\t\t$Users->$key = bcrypt($UsersInput[$key]);\n\t\t\t}\n\n }\n\t\t\n $Users->save();\n\t\t\n\t\treturn redirect()->route('user.edit', array('id'=>$Users->id));\n }", "public function update(User $user) {\n if (UserController::isAuthorized() || $user->id == auth()->user()->id) {\n // form validation\n $this->validate(request(), [\n 'fullname' => 'required',\n 'email' => ['required', Rule::unique('users')->ignore($user->id)],\n 'username' => ['required', 'min:4', Rule::unique('users')->ignore($user->id)],\n ]);\n \n // save\n $user->fullname = request('fullname');\n $user->email = request('email');\n $user->username = request('username');\n $user->updated_by = auth()->user()->id;\n $user->save();\n if (UserController::isAuthorized()) {\n // clear roles\n $user->roles()->delete();\n \n $checkboxes = ['admin', 'publish', 'edit', 'managedb'];\n \n foreach($checkboxes as $cb) {\n if (request($cb) == True) {\n $user->addRole($cb);\n }\n }\n }\n \n request()->session()->flash('success', 'Edit Successful!');\n return redirect()->back();\n }\n else {\n return view('unauthorized');\n }\n \n }", "public function update(UserRequest $request, User $user)\n {\n $this->user = $user;\n return $this->props($request)\n ->save()\n ->redirect($request,'Updated');\n }", "public function update(User $user, Upload $upload)\n {\n //\n }", "public function updating(User $user)\n{\n $userBeforeUpdated = $this->userRepository->find($user->id);\n\n $this->userService->trackUserActivity(Auth::id(),User::class, config('constants.TRACK_USER_FIELDS'),\n $userBeforeUpdated, $user);\n}", "public function update($user)\n {\n $user = \\App\\User::findOrFail($user);\n\n $user->name = request()->name;\n $user->email = request()->email;\n $user->bio = request()->bio;\n\n if(request()->password_confirmation)\n $user->password = bcrypt(request()->password_confirmation);\n\n $user->detachRoles();\n $user->attachRole(request()->role);\n\n $user->save();\n\n return redirect()->route('users.index')->with('success', 'User updated successfully.');\n }", "public function testUpdateUser()\n {\n $user = factory(User::class)->create();\n \n $userRepo = new UserRepository(new User);\n $update = $userRepo->update($user->id, $this->data);\n $updatedUser = $userRepo->get($user->id);\n \n $this->assertTrue($update);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($value, $updatedUser->$key);\n }\n }", "public function update(Request $request, User $user)\n {\n $user->update($request->all());\n }", "public function update(StoreUpdateUserFormRequest $request, $id)\n {\n $user = $this->user->find($id);\n \n if(!$user){\n return redirect()->back();\n }\n\n //Pega todos osdados que vem do formulario\n $data = $request->all();\n\n //Verifica se atualizou a senha, caso contrario não atualiza como null\n if( isset($data['password']) && $data['password'] != '' ){\n $data['password'] = bcrypt($data['password']);\n }else{\n unset($data['password']);\n }\n\n //verifica se o arquivo existe e se é valido \n if($request->hasFile('image') && $request->file('image')->isValid())\n { \n //verifica se existe, caso exista manter o nome mas troca o arquivo\n if($user->image)\n { \n $nameFile = $user->image; \n \n }else{\n $nameFile = uniqid(date('HisYmd')).'.'.$request->image->extension(); \n \n }\n\n \n \n //verifica se deu certo o upload\n if(!$request->image->storeAs('users', $nameFile)){\n return redirect()\n ->back()\n ->with('error', 'Falha ao fazer o upload')\n ->withInput(); \n }\n\n \n }else{\n $nameFile = null;\n \n }\n\n\n\n \n if($user->updateUser($request, $nameFile))\n {\n \n return redirect()\n ->route('users.index')\n ->with('success', 'Atualizado com sucesso');\n }else{\n return redirect()\n ->with('error', 'Falha ao atualizar')\n ->withInput();\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public function updateUserContext(UserContext $context);", "public function update_user(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n $user = User::where('userIdx', $request->userIdx)->get()->first();\n\n if($user){\n $data = array();\n $data['firstname'] = $request->firstname;\n $data['lastname'] = $request->lastname;\n $data['email'] = $request->email;\n $data['jobTitle'] = $request->jobTitle;\n if($request->businessName2 == \"Other industry\") {\n $data['businessName'] = $request->businessName;\n } else {\n $data['businessName'] = $request->businessName2;\n }\n if($request->role2 == \"Other\") {\n $data['role'] = $request->role;\n } else {\n $data['role'] = $request->role2;\n }\n User::where('userIdx', $request->userIdx)->update($data);\n\n $logDetail = 'Updated: UserID- '.$request->userIdx.', Email- '.$data['email'].', Firstname- '.$data['firstname'].', Lastname- '.$data['lastname'];\n SiteHelper::logActivity('USER', $logDetail, 'admin');\n\n Session::flash('flash_success', 'User detail has been updated successfully');\n echo \"success\";\n }else \n echo \"fail\";\n }", "public function update(Request $request, User $user)\n {\n // dd($request->all());\n // dd($user);\n // $user->update($request->all());\n\n $user->name = $request->name;\n $user->lastname = $request->lastname;\n $user->phone = $request->phone;\n $user->facebook = $request->facebook;\n $user->twitter = $request->twitter;\n\n if ($request->hasFile('avatar'))\n {\n $user->avatar = $request->file('avatar')->store('public');\n }\n\n $user->save();\n // $user->twitter = $request->twitter;\n return back();\n }", "public function update(Request $request, User $user)\n {\n $user = User::where('id', Auth::user()->id)->first();\n\n $request->validate([\n 'pseudo' => 'unique:users|max:15',\n 'picture' => 'image|mimes:jpg,png,jpeg,gif|max:200|dimensions:min_width=100,min_height=100,max_width500,max_height=500',\n 'email' => 'unique:users'\n ]);\n if($request->hasFile('picture')){\n $name = $request->picture->hashName();\n $path = Storage::putFileAs('public/users/picture', $request->file('picture'), $name);\n $user->update([\n 'picture' => $name,\n ]);\n }\n\n if($request->pseudo){\n $user->update([\n 'pseudo' => $request->pseudo,\n ]);\n }\n if($request->email){\n $user->update([\n 'email' => $request->email\n ]);\n }\n\n return redirect()->back();\n }", "public function update($user, $ident, DatabaseDataHandler $data);" ]
[ "0.75115865", "0.7362121", "0.7132806", "0.71238434", "0.7088548", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.70305514", "0.6919266", "0.69039994", "0.677032", "0.6766398", "0.67250645", "0.6720659", "0.6720659", "0.66999537", "0.6689136", "0.6688794", "0.66631126", "0.6660374", "0.6657739", "0.664455", "0.66373414", "0.6633408", "0.66308516", "0.6626247", "0.66247785", "0.6618177", "0.6607209", "0.65946853", "0.65814894", "0.65497816", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6548946", "0.6543688", "0.652451", "0.6510257", "0.6498654", "0.64960754", "0.6494557", "0.6486649", "0.6481806", "0.6470741", "0.6454293", "0.64438164", "0.643828", "0.6433655", "0.64318913", "0.6429009", "0.64151895", "0.6414179", "0.6408689", "0.64046997", "0.64013934", "0.6395203", "0.6393338" ]
0.0
-1
Remove the specified user from storage.
public function destroy(User $user): RedirectResponse { $this->users->destroy($user); return redirect('admin/users')->with('success', trans('messages.crud', [ 'resource' => trans_choice('users.user', 1, ['user_count' => '']), 'status' => trans('fields.deleted') ])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeUser(UserInterface $user);", "public function remove_user() { return $this->STOR->remove_user(); }", "public function removeUser()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_user]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_user]);\n\t\t}\n\t}", "public function delete_user($user);", "public function deleteUser()\n {\n $this->delete();\n }", "public function remove($user) : void\n {\n $this->em->remove($user);\n $this->em->flush();\n }", "public function destroy(User $user)\n {\n if (Storage::disk(\"local\")->exists($user->image)) {\n Storage::disk(\"local\")->delete($user->image);\n }\n if ($user->delete()) {\n Toastr::success('Successfully Admin Deleted', \"Success\");\n } else {\n Toastr::error('Something Went Wrong!', \"Error\");\n }\n return redirect()->back();\n }", "public function removeUserData($user)\n {\n\t throw new Ingo_Exception(_(\"Removing user data is not supported with the current filter storage backend.\"));\n }", "public function destroy(User $user)\n {\n \n }", "public function retract($user): void\n {\n $this->users()->detach($user);\n }", "public function destroy(user $user)\n {\n //\n }", "public function deleteUser(User $user): void\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user) {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n\n }", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function destroy(User $user)\n {\n }", "public function destroy(User $user)\n {\n }", "public function removeUser($user): void\n {\n if ($user->current_team_id === $this->id) {\n $user->forceFill([\n 'current_team_id' => null,\n ])->save();\n }\n\n $this->users()->detach($user);\n }", "public function destroy(User $user)\n {\n //TODO: montar excluir usuário\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function destroy(User $user)\n {\n $this->authorize('add', User::class);\n $user->delete();\n }", "function user_remove($user_info)\n {\n }", "public function deleted(User $user)\n {\n $this->clearCache($this->key);\n\n FileHelpers::deleteFile($user->avatar);\n }", "public function destroy(User $user)\n {\n $conteudos = $user->contents()->get();\n\n //Delete user contents from disk\n foreach($conteudos as $conteudo) {\n Storage::delete($conteudo->nome);\n $conteudo->forceDelete();\n }\n\n if ($user->forceDelete()) {\n return redirect()->back()->withSuccess(__('controllers.delete_user'));\n } else {\n return redirect()->back()->withErrors(__('controllers.error_occured'));\n }\n }", "public function removeUser($user)\n {\n if ($user->current_organization_id === $this->id) {\n $user->forceFill([\n 'current_organization_id' => null,\n ])->save();\n }\n\n $this->users()->detach($user);\n }", "private function remove_user(&$user) {\r\n\t\t$index = (int)$user->socket;\r\n\t\tif($this->socket_array[$index] == $user){\r\n\t\t\tunset($this->socket_array[$index]);\r\n\t\t}\r\n\t\t\r\n\t\t$user->remove();\r\n\t}", "public function delete(User $user)\n {\n //\n }", "public function destory(User $user)\n {\n return $user->delete();\n }", "public function destroy(User $user)\n {\n abort_if(auth()->user()->cannot(app('roleHelper')->crudsToName('delete'), User::class), Response::HTTP_FORBIDDEN, '403 Forbidden');\n if ($user['img'])\n File::delete($user['img']);\n $user->delete();\n $this->actionsuccess();\n return redirect()->back();\n }", "public function destroy(User $user)\n {\n Storage::disk('local')->delete('public/images/users/' . $user->image);\n $user->delete();\n\n return redirect()->route('admin.users.index')->with([\"success\" => 'User Deleted Successfully']);;\n }", "public function destroy(User $user)\n {\n if (Storage::disk('public')->exists($user->image)) {\n Storage::disk('public')->delete($user->image);\n }\n $user->delete();\n return redirect()->route('backend.users.index')->with('success', 'Pengguna berhasil dihapus');\n }", "public function destroy(User $user)\n {\n if ($user->image != 'default.png') {\n Storage::disk('public_uploads')->delete('/user_images/' . $user->image);\n }\n\n $user->delete();\n\n session()->flash('success', __('site.deleted_successfully'));\n\n return redirect()->route('dashboard.users.index');\n }", "public function destroy(User $user)\n {\n Gate::authorize('app.users.destroy');\n\n if (Storage::disk('public')->exists($user->image)){\n Storage::disk('public')->delete($user->image);\n }\n\n $user->delete();\n\n return back()->with(\"success\", \"User Successfully Deleted\");\n }", "public function deleted(User $user)\n {\n $avatar = $user->getOriginal('avatar_path');\n if (Storage::disk('public')->exists($avatar)) {\n Storage::disk('public')->delete($avatar);\n }\n }", "public function delete($user){\n }", "public function destroy(User $user)\n {\n // delete image\n $image = profiles_storage_path($user->profile->image);\n if($user->profile->image && File::exists($image)) {\n File::delete($image);\n }\n\n $user->delete();\n return redirect(route('dashboard.users.index'))->with('success', 'User deleted !');\n }", "public function delete($user)\n {\n\n }", "public function destroy(User $user)\n {\n $this->authorize('delete', [User::class, $user]);\n\n // Delete the user...\n }", "public function destroy(User $user)\n {\n if ($user->role === \"student\") {\n $image = $user->student->student_image;\n } elseif ($user->role === \"teacher\") {\n $image = $user->teacher->teacher_image;\n }\n\n // delete user\n $user::where('id', $user->id)->delete();\n\n // delete image from public\n if (File::exists(public_path($image)) && $image !== \"img/profile-user.png\") {\n File::delete(public_path($image));\n }\n\n // message\n if ($user) {\n return redirect(route('admin.user.index'))->with('success', 'User berhasil dihapus');\n } else {\n return redirect(route('admin.user.index'))->with('danger', 'User gagal dihapus!');\n }\n }", "public function deleting(User $user)\n {\n $this->userService->detachAbility($user);\n }", "public function deleteUser($userId);", "public function deleted(User $user)\n {\n debug('User deleted');\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }" ]
[ "0.75832164", "0.7455628", "0.7360062", "0.72751135", "0.72652036", "0.72400856", "0.6998661", "0.6949125", "0.69444776", "0.69277453", "0.69260436", "0.6918273", "0.690451", "0.6900282", "0.6893226", "0.6893226", "0.6893226", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68820506", "0.68612444", "0.6859878", "0.6859878", "0.6850094", "0.6850094", "0.68462646", "0.6835674", "0.68275625", "0.6810724", "0.6810724", "0.6805864", "0.6798265", "0.6782407", "0.6774308", "0.67569387", "0.67568845", "0.6753859", "0.67512184", "0.6740455", "0.6737537", "0.67320424", "0.6722617", "0.67130846", "0.67118114", "0.66893345", "0.66872174", "0.66768456", "0.66486406", "0.66399586", "0.66287386", "0.6615198", "0.6603807", "0.6600688" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { if ($this->input("_method") == "PUT") return [ "first_name" => "required|min:5", "last_name" => "required|min:5", "update_email" => "required|email|sometimes:unique:users", "password" => "sometimes|required|min:8", "password_verify" => "sometimes|required|same:password" ]; return [ "first_name" => "required|min:4", "last_name" => "required|min:4", "email" => "required|email|unique:users", "password" => "sometimes|required|min:8", "password_verify" => "sometimes|required|same:password" ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Create a new controller instance.
public function __construct( CustomerRepository $customerRepository, CouponRepository $couponRepository, RewardRepository $rewardRepository) { $this->customerRepository = $customerRepository; $this->couponRepository = $couponRepository; $this->rewardRepository = $rewardRepository; }
{ "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
Crucible API doesn't provide logout ability.
public function clearAuthorization() { // So we just get rid of the token. $this->clearCrucibleSession(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function logout() {\n }", "public static function logout();", "abstract public function logout();", "abstract protected function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "abstract protected function logoutImpl(): void;", "public function logout(): void\n {\n\n }", "protected function logout() {\n $logout_response = $this->call('<Envelope><Body></Logout></Body></Envelope>');\n }", "function logout() {\n\t}", "public function logOut(): void;", "public function logout()\n {\n }", "public function logout()\n {\n }", "public function logout()\n {\n }", "public function logout() {\n\n\t}", "public function logout()\n {\n \n }", "public function logout() {\n }", "public function logout()\n {\n // fonction qui ne fait rien car c'est le composant de securité qui s'en occupe. Cette fonction me sert a créer une route logout pour le transmettre dans le security.yaml\n }", "public function logout()\n {\n\n }", "public function customerLogout()\n {\n\n\n // Actual Logout\n Auth::logout();\n }", "public function signOut()\n {\n $this->getAttributeHolder()->removeNamespace('subscriber');\n $this->getAttributeHolder()->remove('recipe_history');\n $this->setAuthenticated(false);\n $this->clearCredentials();\n sfContext::getInstance()->getResponse()->setCookie('OpenEats', '', time() - 3600, '/');\n }", "public function logoutAction()\n {\n throw new \\Exception('This should never be reached!');\n }", "public function onLogout()\n {\n \n }", "public function logout()\n {\n throw new \\LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');\n }", "private function logout()\n {\n try\n {\n global $userquery;\n\n \n if(!userid())\n {\n $logout_response['logged_out'] = 0;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'you are not logged in', \"data\" => $logout_response);\n $this->response($this->json($data)); \n }\n\n $userquery->logout();\n if(cb_get_functions('logout')) \n cb_call_functions('logout'); \n \n setcookie('is_logout','yes',time()+3600,'/');\n\n $logout_response['logged_out'] = 1;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'logout successfully', \"data\" => $logout_response);\n $this->response($this->json($data));\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function logout(){\n\n}", "function logout_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n\n $this->session->sess_destroy();\n $this->response(array('status' => 'success'));\n }", "function logout() {\r\n $this->auth->logout();\r\n }", "function logout()\n {\n $this->fal_front->logout();\n }", "public function logout() {\n $this->client->get( 'https://instagram.com/accounts/logout/', array() );\n }", "public function logout() {\r\n $this->response()->setBody('OK'); \r\n }", "abstract public function logoutResponseProvider();", "public function logout(){\n\n }", "public function logout() {\n\t\t$this->authProvider->logout();\n\t\t$this->authProvider = new Client\\Authentication\\NoAuth($this, array(), array());\n\t\t$this->changeDescription(NULL);\n\t}", "public function testLogoutNotAuthenticated(): void { }", "function get_dologout()\n {\n // If not logged in then this does nothing\n $this->auth->logout();\n\n return \"see:/\";\n }", "public function getLogout()\n {\n\n // If login correct\n Auth::logout();\n Session::flush();\n\n // Todo return something;\n }", "public function logout(): bool\n {\n }", "public function logout(): bool\n {\n }", "public function logOut() {\n\t$this->isauthenticated = false;\n\tunset($_SESSION['clpauthid'], $_SESSION['clpareaname'], $_SESSION['clpauthcontainer']);\n\tsession_regenerate_id();\n}", "public function logoutAction()\n\t{\n\t\tZend_Auth::getInstance()->clearIdentity();\n\t\t$this->_redirect('https://strobe.uwaterloo.ca/cpadev/kiwi/user/out?__kiwi_referer__='\n\t\t\t\t\t\t\t\t. $_SERVER[\"HTTP_REFERER\"]);\n\t}", "public function apiIndex()\n {\n $user = Core::users()->indentity();\n if ($user) {\n Core::users()->logout($user);\n Core::app()->redirect(Core::users()->redirectAfterLogout);\n } else {\n Core::app()->redirect(Core::users()->redirectAfterLogout);\n }\n }", "function b2c_logout() {\n\ttry {\n\t\t$signout_endpoint = b2c_get_logout_endpoint();\n\t\tif ( $signout_endpoint ) {\n\t\t\twp_redirect( $signout_endpoint );\n\t\t}\n\t} catch ( Exception $e ) {\n\t\techo $e->getMessage();\n\t}\n\texit;\n}", "private function _logout(){\r\n $auth = new AuthenticationService();\r\n\r\n if ($auth->hasIdentity()) {\r\n // Identity exists; get it\r\n $auth->clearIdentity();\r\n $this->user = false;\r\n\r\n header('Location: '.WEBROOT ) ;\r\n }\r\n }", "public function logout()\n\t{\n\t\t$this->client->revokeToken();\n\t \t$this->destroy();\n\t}", "public function logout() {\n $this->run('logout', array());\n }", "public function logoff() {}", "public function logoff() {}", "public function logoff() {}", "public function logout()\n {\n// var_dump(auth()->user()->email); die();\n// $this->setBindExchangeRabbitMQ(auth()->user()->email, 'unbind');\n\n auth()->logout();\n\n return response()->json(['message' => 'Successfully logged out']);\n }", "public function logoutAction(){\n }", "public function logout()\n {\n $user = Auth::guard('api')->user();\n if($user != null){\n $user->update(['api_token' => null]);\n return response()->json([\n 'success' => trans('api.logout_success'),\n ], 200);\n }\n else{\n return response()->json([\n 'error' => trans('api.user_not_logged'),\n ], 401);\n }\n }", "public function logoutAction(): void {\r\n throw new \\Exception('This should never be reached!');\r\n }", "public static function logout()\n {\n (new Authenticator(request()))->logout();\n }", "public function logout(){\n $this->_user->logout();\n }", "public function logout()\n {\n throw new \\Exception('This should never be reached!');\n }", "public function signOut();", "public function signOut()\n\t{\n\t\tunlink($this->cookies_path . session_id() .\"_cookie.txt\"); // delete the cookie\n\t\tunset($_SESSION['appConfig']); // kill the ACP session\n\t\t\n\t\t// \"click\" the logout button via request\n\t\t$this->request('http://www.amazon.com/gp/dmusic/mp3/forceSignOut?ie=UTF8&ref_=dm_cp_m_redirect');\n\t\techo \"Logged out\";\n\t}", "public function testCanLogOut() {\n // TBA\n }", "public function logout(): Response\n {\n auth()->logout(); \n\n return response()->json([], Response::HTTP_OK); \n }", "public function Logoff();", "public function action_logout()\n\t{\n\t\tCookie::delete('user');\n\t\t\t\n\t\t// Redirect to the login\n\t\t$this->request->redirect(Route::get('kohanut-login')->uri(array('action'=>'login')));\n\t}", "private function exeLogout() {\n if (isset($this->_userInfo->login_token)) {\n // call login api\n $usrToken = $this->_userInfo->login_token;\n $logoutLnk = API_LOGOUT . '/token/' . $usrToken;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $logoutLnk);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(API_HEADER_CONTENT, API_HEADER_TYPE, API_HEADER_ACCEPT));\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, API_TIMEOUT); //timeout in seconds\n\n $results = curl_exec($ch);\n $results = json_decode($results);\n if ($results->meta->code == 200) {\n // destroy session at my page\n $this->session->unset_userdata('userInfo');\n $this->session->unset_userdata('linkBackLogin');\n $this->session->unset_userdata('passwordUser');\n }\n redirect(site_url('/'));\n } else {\n redirect(site_url('/'));\n }\n }", "public function _logout()\n {\n $this->_login( self::getGuestID() );\n }", "public function logout ()\n {\n User::logout(\"home\");\n }", "function logoutAPIResponse(){\n \n $authentication = new Authentication();\n\n $authentication->logout(); \n\n $return = array(\n 'status' => 200 ,\n 'message' => \"Logout was successful.\"\n );\n\n http_response_code(200);\n\n //Send back response to client. \n print_r(json_encode($return));\n\n}", "public function logoff();", "public function log_out() {\n $this->store_token(null);\n }", "public function logout()\n\t{\n\t\t$this->getAttributeHolder()->removeNamespace('client');\n\t\t$this->removeCredential();\n\t\t$this->setAuthenticated(false);\n\t}", "public function logout(){\n $update_params = array('status'=>0,'logout_time'=>date('Y-m-d H:i:s'),);\n $this->m->port->p->where('regid',$this->m->user_value('regid'));\n return $this->m->port->p->update('quickblox',$update_params);\n }", "public function sign_out()\n {\n\n }", "public function action_logout(){\n\t\tAuth::instance()->logout();\n \n\t\t#redirect to the user account and then the signin page if logout worked as expected\n\t\tHTTP::redirect('/');\t\n\n\t}", "public function logoutAction()\n {\n session_unset();\n header(\"Location: /SafeRideStore\");\n }", "public function logout ()\n {\n $this->session->delete('user');\n return $this->redirect('Front#Base#Index'); //doit retourner 200 CODE \n }", "public function logoutAction()\n {\n QuizSessionService::endSession();\n return new ResponseModel(ResponseModel::STATUS, true);\n }", "public function logout_get()\r\n\t{\r\n \tif(destroy_session_login())\r\n \t{\r\n \t\t// logout berhasil\r\n\t \t$this->response([\r\n\t \t\t'status'\t=> TRUE,\r\n\t \t\t'logged_out'=> TRUE,\r\n\t \t\t'message'\t=> 'Sesi telah habis!'\r\n\t \t], REST_Controller::HTTP_OK);\t\r\n \t}\r\n \telse\r\n \t{\r\n \t\t// gagal logout\r\n\t \t$this->response([\r\n\t \t\t'status'\t=> TRUE,\r\n\t \t\t'logged_out'=> TRUE,\r\n\t \t\t'message'\t=> 'Terjadi kesalahan saat keluar!'\r\n\t \t], REST_Controller::HTTP_OK);\r\n \t}\r\n\t\t\r\n\t}", "public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie();\n }", "function rpc_logout($user) {\n\n}", "function logout(){\r\n\t\t$action_details=array();\r\n\t\t$action_details['table_name']='users';\r\n\t\t$action_details['row_id']=$this->user_id;\r\n\t\t$action_details['operation']='Logged Out';\r\n\t\t$this->createActionLog($action_details);\r\n\t\t//$_SESSION['user_id'] = null;\r\n\t\treturn true;\r\n\t}", "public function logout()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth])) {\t\n\t\t\tSessionManager::instance()->trashLoginCreadentials();\n\t\t}\n\t}", "public function logOut()\n {\n $this->getElement('Toolbar')->logOut();\n }", "public function testLogout(): void { }", "function logout() {\n User::destroyLoginSession();\n header( \"Location: \" . APP_URL );\n}", "public function logout()\n {\n auth('api')->logout();\n\n return $this->response->noContent();\n }", "function remoteLogout(){\n if ($this->wtps == NULL)\n return;\n XLogs::notice(get_class($this), '::remoteLogout '.$this->wtps->getSessionId());\n $this->wtps->forceLogout();\n }", "public function logout()\n {\n\t\t$user = JWTAuth::GetJWTUser();\n\t\t$this->expireToken($user);\n\t\treturn $this->sendResponse('You are now logged out');\n\t}", "function get() {\n\n if (!empty($_GET['logout'])) {\n\n deauthorize();\n }\n}", "public function getLogout(){\n unset($_SESSION['userId']);\n unset($_SESSION['userName']);\n unset($_SESSION['userEmail']);\n header(\"Location: \". BASE_URL);\n }", "function logoutHandler() {\n clearLogin();\n formatOutput(true, 'logout success');\n}", "public function logout(){\n curl_setopt($this->curl, CURLOPT_URL, $this->way2smsHost . \"LogOut\");\n curl_setopt($this->curl, CURLOPT_REFERER, $this->refurl);\n $text = curl_exec($this->curl);\n curl_close($this->curl);\n }", "public static function logout()\n\t{\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->resetSession();\n\t}", "public function getLogout()\n {\n if (!Sentry::check())\n {\n // user is not logged in, why to logout again, hacker?\n return Redirect::to('/');\n }\n\n Sentry::logout();\n return Redirect::to('/');\n }", "public function logout()\n {\n $this->userId = 0;\n $this->createSession();\n $this->logger->loginOutEntry(2);\n }" ]
[ "0.7991213", "0.75631726", "0.7530181", "0.7524986", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7497259", "0.7479541", "0.74735904", "0.7437774", "0.73860055", "0.7357137", "0.730293", "0.730293", "0.730293", "0.72711194", "0.72579896", "0.7252255", "0.7205227", "0.71900684", "0.71570957", "0.71181613", "0.7106777", "0.71013343", "0.70814675", "0.70756245", "0.70651436", "0.70641476", "0.70339406", "0.70170844", "0.6994658", "0.69932675", "0.69848233", "0.69814557", "0.6968273", "0.6964317", "0.6958755", "0.6952499", "0.693827", "0.693827", "0.69339675", "0.692393", "0.6921551", "0.6909005", "0.69073594", "0.69056", "0.69029796", "0.6882733", "0.6882131", "0.68814594", "0.6878393", "0.6865246", "0.6843152", "0.6841151", "0.6825329", "0.6824747", "0.6820262", "0.68026555", "0.6796383", "0.6795411", "0.6789", "0.67856693", "0.67831796", "0.67820305", "0.6767542", "0.67633367", "0.6763227", "0.6759034", "0.6756783", "0.67545164", "0.6750387", "0.6739891", "0.67388266", "0.6737142", "0.6734227", "0.6732625", "0.6729413", "0.67176133", "0.67163885", "0.6715763", "0.67097646", "0.67053366", "0.67031777", "0.6702761", "0.6686477", "0.668352", "0.66770405", "0.6675275", "0.666275", "0.66615593", "0.6660758", "0.6658694", "0.6653569", "0.66432154" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Specifies the access control rules. This method is used by the 'accessControl' filter.
public function accessRules() { return array( array('allow', // allow authenticated user to perform 'create' and 'update' actions 'actions'=>array('createAjax'), 'roles'=>array('Superadmin', 'Account Admin', 'User') ), array('deny', // deny all users 'users'=>array('*'), ), ); }
{ "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\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 '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 {\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 {\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 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\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 {\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 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\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\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 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', // 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 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\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 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', '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 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()\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()\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 {\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.7229873", "0.72012293", "0.70917755", "0.70844513", "0.708018", "0.708018", "0.70799863", "0.7072431", "0.7072431", "0.70660526", "0.7064439", "0.700873", "0.700494", "0.70015746", "0.69986796", "0.69898736", "0.69839835", "0.6977239", "0.69746107", "0.6972772", "0.69703716", "0.69695455", "0.6966667", "0.6959773", "0.6956604", "0.6955104", "0.6949643", "0.69431823", "0.69371873", "0.69343966", "0.6932137", "0.69320303", "0.6930067", "0.69295216", "0.692494", "0.69246763", "0.6924622", "0.69232786", "0.69222337", "0.6917967", "0.691064", "0.69074327", "0.69057", "0.69042856", "0.6900149", "0.6893778", "0.6892782", "0.6891147", "0.6887545", "0.68868345", "0.688239", "0.6882229", "0.68806696", "0.6880583", "0.6876424", "0.68699807", "0.6866366", "0.6860592", "0.68601173", "0.6858248", "0.68579227", "0.6854373", "0.685073", "0.6848974", "0.6846176", "0.68456316", "0.68455005", "0.68437564", "0.6837181", "0.6836586", "0.68358904", "0.683505", "0.6833606", "0.68256164", "0.6823347", "0.68196326", "0.6819599", "0.68193954", "0.68188256", "0.6816514", "0.6814964", "0.6811807", "0.68108267", "0.6809761", "0.68045896", "0.68038595", "0.6800515", "0.6799485", "0.67960197", "0.67911613", "0.67899615", "0.6789926", "0.67883563", "0.6788353", "0.6785952", "0.67859", "0.6785493", "0.6785287", "0.678436", "0.6783886", "0.67802835" ]
0.0
-1
Creates a new model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreateAjax() { $response = array(); $form = new AjaxUploadImageForm; if(isset($_POST['AjaxUploadImageForm'])) { // $form->attributes = $_POST['AjaxUploadImageForm']; if($form->validate()) { $form->image = CUploadedFile::getInstance($form,'image'); $model = new Image; $model->_file = $form->image; $model->loadImage(); if($model->save()) { $response['file'] = $model->name; $response['imgId'] = $model->id; // redirect to success page } }else{ $response = array('error'=>CHtml::errorSummary($model)); } } if (!$response) { $response = array('error'=>$this->renderPartial('/object/_image', array('model' => new AjaxUploadImageForm),true, true)); } foreach ($response as $key=>$val) { $response[$key] = rawurlencode($response[$key]); } echo CJavaScript::jsonEncode($response); die; //$this->render('create', array('model'=>$model)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->setModelByConditions();\n\n if (Yii::$app->request->isPost &&\n $this->model->load(Yii::$app->request->post()) &&\n $this->setAdditionAttributes() &&\n $this->model->save()) {\n\n if ($this->viewCreated) {\n $redirectParams = [\n $this->urlPrefix.'view',\n 'id' => $this->model->getId(),\n ];\n } else {\n $redirectParams = [\n $this->urlPrefix.'index',\n ];\n }\n\n return $this->redirect($redirectParams);\n }\n\n return $this->render('create',\n ArrayHelper::merge(\n [\n 'model' => $this->model,\n ],\n $this->getAdditionFields()\n )\n );\n }", "public function actionCreate()\n {\n $model = new Crm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new $this->defaultModel;\n\n $isPjax = Yii::$app->request->isPjax;\n if (!$isPjax) {\n $this->performAjaxValidation($model);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($isPjax) {\n return $this->actionAjaxModalNameList(['selected_id' => $model->id]);\n } else {\n return $this->redirect('index');\n } \n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model,\n 'isModal' => true,\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'isModal' => false,\n ]);\n }\n }\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model = new Post;\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save())\n\t\t{\n\t\t\treturn $this->redirect(['site/index']);\n\t\t}\n\t\t\n\t\techo $this->render('create', array(\n\t\t\t'model' => $model\n\t\t));\n\t}", "public function actionCreate()\n {\n $models = $this->loadModelsByPid();\n\n $this->performAjaxValidationTabular($models);\n\n $success = $this->doAction($models);\n $newPid = current($models)->pid;\n\n if($success)\n {\n if(isset($_POST['apply']))\n {\n $this->redirectAction($newPid);\n }\n $this->redirectAction();\n }\n\n if($success !== null && $newPid)\n {\n $this->redirectAction($newPid);\n }\n\n $this->render($this->view['create'], array(\n 'models' => $models,\n 'model' => reset($models),\n 'languages' => Language::getList(),\n ));\n }", "public function actionCreate()\n\n {\n\n $model = new Orders();\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been added successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }", "public function actionCreate()\n {\n $model = new Keep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Photo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public\n function actionCreate()\n {\n $model = new Phforum();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->isCreateView = true;\n $modelClass = $this->_getModelClass();\n $model = new $modelClass;\n return $this->_renderView($model);\n }", "public function actionCreate()\n {\n $model = new JetShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Orders();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->redirect([\"site/register\"]);\n /*$this->render('/site/register', [\n 'model' => $model,\n ]);*/\n }\n }", "public function actionCreate()\n {\n $model = new Major();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n $this->success(Yii::t('flash', 'major.save_success'));\n } else {\n $this->error(Yii::t('flash', 'major.save_error'));\n }\n return $this->redirect(['index']);\n } \n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }", "public function actionCreate()\n {\n $model = new Mylive();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->live_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Rents();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->layout = 'headbar';\n $model = new ContactOne();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $dataProvider = new ActiveDataProvider([\n 'query' => ContactOne::find(),\n 'pagination' => [\n 'pageSize' => 20,\n ],\n ]);\n //return $this->redirect(['view', 'id' => $model->id]);\n\n return $this->render('view',[\n 'dataProvider' => $dataProvider,\n ]);\n\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $user = User::findOne(['username' => $model->username ]) ;\n return $this->redirect(['site/view','id' => $user->id]);\n } else {\n return $this->render('knpr/create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function actionCreate()\n {\n $model = new Book();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \tif (Yii::$app->request->getIsAjax()) {\n \t\treturn $this->renderPartial('create', [\n \t\t\t'model' => $model,\n \t\t]);\n \t}\n \telse {\n\t return $this->render('create', [\n\t 'model' => $model,\n\t ]);\n \t}\n }\n }", "public function actionCreate()\n {\n $model = new Article();\n if(!empty($_GET['kind'])) $model->kind=$_GET['kind'];\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Actividad();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate(){\n $model = new Category();\n// d($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->category_id]);\n } else {\n// d($_POST);\n return $this->render('create', ['model' => $model,]);\n }\n }", "public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new VehicleApply();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new TabelleRelease();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n\n return $this->redirect(['update', 'id' => $model->id, 'mySuccess' => 2]);\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Student();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new User;\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\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new User;\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\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Status();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Customers();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Products();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Template();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new UserFeeMaster();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //$this->paymentUMoney($model);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'userid' => Yii::$app->user->id,\n ]);\n }", "public function actionCreate()\n {\n $model = new Takwim();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Comment;\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['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new News();\n $author = Yii::$app->user->identity->username;\n\n if ($model->load(Yii::$app->request->post())){\n $model->setAuthor($author);\n if($model->save()){\n return $this->redirect('index');\n }\n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\t\n\t\t$model=new Articles;\n\t\tif(isset($_POST['Articles']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t\t$model->status = 0;\n\t\t\t}\n\t\t\t$model->user_id = Yii::app()->user->id;\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\tif (Yii::app()->user->isAdmin){\n\t\t\t\t\t$this->redirect(array('admin')); //,'id'=>$model->id));\n\t\t\t\t}else{\n\t\t\t\t\t$this->redirect(array('list')); //,'id'=>$model->id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array('model'=>$model));\n\t}", "public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model=new User('admin');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('index'));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new Contact();\n $model->user_id = $this->user->id;\n $model->scenario = 'form';\n\n if (Yii::$app->request->isPost && ($postData = Yii::$app->request->post()) && $model->load($postData)) {\n if ($model->save()) {\n return $this->redirect([\n 'view',\n 'id' => $model->id,\n ]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n Login::UserAuth('Customers', 'Create');\n $model = new Customers;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Customers'])) {\n $_POST['Customers'] = CI_Security::ChkPost($_POST['Customers']);\n $model->attributes = $_POST['Customers'];\n $model->password = md5($model->password);\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->cid));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new Kareer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Debtor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //$locationModel = Location::find()->where(['location_id' => $model->location->id])->one();\n $locationModel = new Location();\n $locationModel->load(Yii::$app->request->post());\n $locationModel->save();\n $model->link('location', $locationModel);\n\n //$nameModel = Name::find()->where(['name_id' => $this->name->id])->one();\n $nameModel = new Name();\n $nameModel->load(Yii::$app->request->post());\n $nameModel->save();\n $model->link('name', $nameModel);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n }", "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Route();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->save();\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionCreate()\n\t{\n $this->layout='admin';\n \n\t\t$model=new Bet;\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['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate() {\n\t\t$model = new Building();\n\n\t\tif ( $model->load( Yii::$app->request->post() ) && $model->save() ) {\n\t\t\treturn $this->redirect( [ 'index', 'id' => $model->id ] );\n\t\t} else {\n\t\t\treturn $this->render( 'create', [\n\t\t\t\t'model' => $model,\n\t\t\t] );\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Service();\n if($model->load(Yii::$app->request->post()) ){\n $model->created_by=Yii::$app->user->id;\n $model->created_at=time();\n if ( $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n\t\t$model = new Proyecto;\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['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\t$model -> Usuario_id = Yii::app() -> user -> id;\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('create', array('model' => $model, ));\n\t}", "public function actionCreate()\n {\n $model = new Programador();\n //Yii::$app->request->post() wrapper de Yii para obtener datos seguros enviados por POST\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new File();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /*\r\n * Get an instance of the respective model\r\n */\r\n case 'posts': \r\n $model = new Post; \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>create</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /*\r\n * Assign POST values to attributes \r\n */ \r\n foreach($_POST as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n * save the model\r\n */ \r\n if($model->save()) { \r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes) );\r\n } else {\r\n /*\r\n * Errors occurred\r\n */\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't create model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n\r\n var_dump($_REQUEST);\r\n }", "public function actionCreate() {\n $model = new TimeBooks();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Contact;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Contact'])) {\n $model->attributes = $_POST['Contact'];\n if ($model->save()) {\n $this->redirect(array('view','id' => $model->id));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new EnglishNanorep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Trees();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new UserAddForm();\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['UserAddForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['UserAddForm'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->data->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Cuenta();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Slaves();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new MissionCarers;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['MissionCarers'])) {\n $model->attributes = $_POST['MissionCarers'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new StandartOne();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\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['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Ddiet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Category();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function creating($model)\n\t{\n\t}", "public function actionCreate()\n {\n $model = new CourseSite();\n\n if ($model->load(Yii::$app->request->post())){\n if($model->createCourseSite($model->course)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model=new User('create');\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->save())\n $this->redirect(array('/site/index'));\n }\n\n //Yii::app()->user->setFlash('success', Yii::t('user', '<strong>Congratulations!</strong> You have been successfully registered on our website! <a href=\"/\">Go to main page.</a>'));\n $this->render('create', compact('model'));\n }", "public function actionCreate() {\r\n\t\t$model = new Follow ();\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( [ \r\n\t\t\t\t\t'view',\r\n\t\t\t\t\t'id' => $model->followID \r\n\t\t\t] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'create', [ \r\n\t\t\t\t\t'model' => $model \r\n\t\t\t] );\r\n\t\t}\r\n\t}", "public function actionCreate()\n {\n $model = new Content();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Menu();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n $model->save(false);\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n {\r\n $model = new Tax;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'added' => 'yes']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Data();\n $oldModel = $model->attributes;\n\n $model->discount = 0;\n $model->activation_date = date('Y-m-d');\n\n if ($model->load(Yii::$app->request->post()) /*&& $model->save()*/) {\n\n $check = self::check($model);\n\n if($check && $model->save()){\n $newModel = $model->attributes;\n (new History())->setRow(Yii::$app->controller, $oldModel, $newModel, 'Создан клиент '.$newModel['user_name']);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n else{\n // сформируем номер новой карты клиента\n $next_card = Data::find()->max('card') + 1;\n $model->card = $next_card;\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
[ "0.79611313", "0.79000247", "0.78687686", "0.75944376", "0.75330836", "0.74855393", "0.7461119", "0.7461119", "0.7461119", "0.7461119", "0.7448935", "0.74430025", "0.74393713", "0.74307716", "0.74092305", "0.7408396", "0.7384483", "0.73768485", "0.7333238", "0.7333016", "0.7305014", "0.7266088", "0.7256554", "0.7246151", "0.7240074", "0.7219553", "0.72103083", "0.7207039", "0.72027034", "0.71990466", "0.7190031", "0.71795887", "0.7178496", "0.71777654", "0.71723264", "0.7171185", "0.7168037", "0.7166517", "0.7158479", "0.71504015", "0.7143622", "0.7137446", "0.7092962", "0.7084762", "0.70801", "0.70757973", "0.70678055", "0.70678055", "0.7067472", "0.70641595", "0.7062934", "0.70628893", "0.7061302", "0.70597035", "0.7059426", "0.70591724", "0.70516926", "0.70381343", "0.7023516", "0.7016755", "0.7013404", "0.7013105", "0.7011832", "0.7010669", "0.7010178", "0.70091337", "0.6998711", "0.6992553", "0.6992082", "0.6988103", "0.69853383", "0.6984925", "0.69686913", "0.6964183", "0.6946878", "0.6940434", "0.69399595", "0.69396746", "0.69384736", "0.6938182", "0.6937701", "0.69354725", "0.69328076", "0.693225", "0.69308895", "0.69267493", "0.69228876", "0.69210005", "0.6920174", "0.69198334", "0.6918655", "0.69103307", "0.690009", "0.6888446", "0.68831265", "0.68775487", "0.68723536", "0.68675226", "0.68609864", "0.6853585", "0.6852476" ]
0.0
-1
Create a new event instance.
public function __construct(User $user) { $this->user = $user; $this->user->last_login = new DateTime; $this->user->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createEvent()\n {\n return new Event();\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "public static function createEvent(array $data)\n {\n $event = new \\echolibre\\google_wave\\Model\\Event;\n \n $event->type = $data['type'];\n $event->timestamp = $data['timestamp'];\n $event->modifiedBy = $data['modifiedBy'];\n $event->properties = new \\stdClass();\n \n if (isset($data['properties'])) {\n $event->properties = $data['properties'];\n }\n \n return $event;\n }", "public function newEvent()\n\t{\n $this->to = $this->domain;\n $this->email = $this->info_mail;\n $this->subject = 'Neue Messe gemeldet';\n $this->view = 'emails.user.new_event';\n\t\t\n\t\t$this->data = [\n\t\t\t'contact'\t\t=> \\Input::get('contact'),\n\t\t\t'email'\t\t\t=> \\Input::get('email'),\n\t\t\t'name'\t\t\t=> \\Input::get('name'),\n\t\t\t'location'\t\t=> \\Input::get('location'),\n\t\t\t'start_date'\t=> \\Input::get('start_date'),\n\t\t\t'end_date'\t\t=> \\Input::has('end_date') ? \\Input::get('end_date') : \\Input::get('start_date'),\n\t\t\t'region'\t\t=> \\Input::get('region'),\n\t\t\t'organizer'\t\t=> \\Input::get('organizer')\n\t\t];\n\n\t\treturn $this;\n\t}", "private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }", "private function event(): Event\n {\n if (!$this->event) {\n $this->event = new Event($this->eventMutex(), '');\n }\n\n return $this->event;\n }", "public function createEvent(string $name): Event\n {\n if (!$this->isEventIDValid($name)) {\n throw new RuntimeException('invalid event name: ' . $name);\n }\n\n $class = $this->validEventIDs[$name];\n /** @var \\CaptainHook\\App\\Event $event */\n $event = new $class($this->io, $this->config, $this->repository);\n return $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }", "protected function _Build_Event($context) {\r\n $form_instance = $this->form_instance;\r\n // Retrieve the event class item\r\n $class = $context['class'];\r\n // Generate a new event class\r\n $event_instance = new $class();\r\n // Populate with the form instance\r\n $event_instance->form_instance = $form_instance;\r\n // Populate with the form instance\r\n $event_instance->type = $context['type'];\r\n // Populate with the form instance\r\n $event_instance->title = $context['title'];\r\n // Populate with the event context\r\n $event_instance->context = $context;\r\n // If the field has a sanitize method\r\n if (method_exists($event_instance,'On_Create')) { $event_instance->On_Create(); }\r\n // Fire any on create action\r\n $event_instance->Do_Action('create');\r\n // Do a wordpress hook\r\n do_action('vcff_event_create',$event_instance);\r\n // Fire any on create action\r\n $event_instance->Do_Action('after_create');\r\n // Do a wordpress hook\r\n do_action('vcff_trigger_after_create',$event_instance);\r\n // Return the event instance\r\n return $event_instance;\r\n }", "protected function __construct()\n {\n parent::__construct(\n 'Event',\n array(\n TextField::create(\n 'title',\n array(\n 'mandatory' => true,\n )\n ),\n TextareaField::create(\n 'description',\n array(\n 'use_markdown' => true,\n )\n ),\n TextField::create(\n 'date',\n array()\n ),\n ReferenceField::create(\n 'guest_lists',\n array(\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\Guestlist\\\\GuestlistModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'title',\n ),\n ),\n )\n ),\n ReferenceField::create(\n 'assignee',\n array(\n 'max' => 1,\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\User\\\\UserModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'username',\n ),\n ),\n )\n ),\n KeyValueField::create(\n 'meta',\n array(\n 'constraints' => array(\n 'value_type' => 'dynamic',\n ),\n )\n ),\n AggregateField::create(\n 'workflowTicket',\n array(\n 'modules' => array(\n '\\\\Honeybee\\\\Domain\\\\Event\\\\WorkflowTicketModule',\n ),\n )\n ),\n ),\n array(\n 'prefix' => 'event',\n 'identifier_field' => 'identifier',\n 'slugPattern' => 'event-{shortId}',\n )\n );\n }", "public function create()\n {\n return view ('event.create');\n }", "public function create()\n {\n return view(\"Event::create\");\n }", "public function create_event( $eventname )\n\t{\n\t\tCmsEvents::create_event($this->get_name(), $eventname);\n\t}", "public function createNewEvent($copyLastEvent = true, $data = array())\n\t{\n\t\t$event = new App_Model_Event();\n\n\t\t// pokud $copyLastEvent == true, vezmu data z minule udalosti a nastavim\n\t\t// je teto\n\t\tif ($copyLastEvent) {\n\t\t\t// TODO: vzit nastaveni posledni udalosti u teto akce\n\t\t}\n\n\t\t// pokud byla zaslana nejaka inicializacni data, nastavim je\n\t\tif (is_array($data) && count($data)) {\n\t\t\t$event->setPropsFromArray($data);\n\t\t}\n\n\t\t$event->setActionId($this->_actionId);\n\t\t$event->setEventNo(count($this->getAllEvents()) + 1);\n\n\t\t$event->insert();\n\n\t\t// vytvorim take prvni navrh terminu, pokud byl zaslan\n\t\tif (isset($data['dates']) && $data['dates'] != '') {\n\t\t\t$event->createNewProposal($data['dates']);\n\t\t}\n\n\t\treturn $event;\n\t}", "public function __construct($event)\n {\n $this->event = $event;\n }", "public function __construct($event)\n {\n $this->event = $event;\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }", "public function create()\n {\n return view('events::create_event');\n }", "protected function create(array $data)\n {\n $user = Auth::user();\n $article = new Article($data);\n $article->userID = $user->userID;\n $article->ctgID = $data['category'];\n $article->updated_at = Carbon::now();\n $article->save();\n\n if (array_key_exists('image', $data)) {\n $path = $data['image']->store('articles/'.$article->artID, 'images');\n $article->image = $path;\n $article->save();\n }\n \n $event = new Event($data);\n if ($data['place'] !== 'none') {\n $event->placeID = $data['place'];\n }\n $event->artID = $article->artID;\n $event->save();\n \n return $event;\n }", "public function create()\n {\n return view('events.createevent');\n }", "public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }", "public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }", "public function createEvent(Event $event)\n {\n $this->setCalendarId($event->calendar_id);\n\n /*\n * Create new google event object\n */\n $googleEvent = new \\Google_Service_Calendar_Event();\n\n /*\n * Set Details\n */\n $googleEvent->setSummary($event->title);\n $googleEvent->setDescription($event->description);\n $googleEvent->setLocation($event->location);\n\n /*\n * Set Start Date\n */\n $start = $this->createDateTime($event->start, $event->timeZone, $event->all_day);\n $googleEvent->setStart($start);\n\n /*\n * Set End Date\n */\n $end = $this->createDateTime($event->end, $event->timeZone, $event->all_day);\n $googleEvent->setEnd($end);\n\n /*\n * Set Recurrence Rule, make sure it's not empty\n */\n if ($event->rrule) {\n $googleEvent->setRecurrence([$event->rrule]);\n }\n\n /*\n * Create the event\n */\n $newGoogleEvent = $this->service->events->insert($this->calendarId, $googleEvent);\n\n return $this->createEventObject($newGoogleEvent);\n }", "public function construct(CakeEvent $event) {\n\t\t$this->__startTime = time();\n\t}", "public function create()\n {\n return view('admin.adminevent.create_event');\n }", "protected function createEvent(DateTime $dateStart, DateTime $dateEnd)\n {\n $event = new Event();\n $event->setTitle($this->title);\n $event->setDescription($this->description);\n $event->setDateStart($dateStart);\n $event->setDateEnd($dateEnd);\n\n return $event;\n }", "public function __construct(array $event = array())\n {\n $this\n ->setEvent($event);\n }", "public function create(Request $request)\n {\n $data = $request->all();\n $event = Event::make($data);\n $event->user_id = Auth::user()->id;\n $event->save();\n }", "public function create()\n {\n\n $event = new Event;\n return view('events.create',compact('event'));\n }", "public function create()\n {\n return view('event');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "protected function getRandomInstance()\n {\n $eventLine = new EventTag();\n $this->fillThing($eventLine);\n\n return $eventLine;\n }", "function create_event( $options=array() ){\n\t\t\t//length = 255, present\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'title_unique' => 1\n\t\t\t), $options\n\t\t);\n\t\t\n\t\tif( empty( $options['title'] ) or empty( $options['description'] ) or empty( $options['date'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t$values['title'] = $this->validate_title( array('title' => $options['title']) );\n\t\tif(Core::has_error( $values['title'] )){\n\t\t\treturn $values['title'] ;\n\t\t}\n\t\t\n\t\t$values['description'] = $this->validate_description( array('description' => $options['description']) );\n\t\tif(Core::has_error( $values['description'] )){\n\t\t\treturn $values['description'];\n\t\t}\n\t\t\n\t\t$values['date_time'] = $this->validate_event_date( array('date' => $options['date']) );\n\t\tif(Core::has_error( $values['date_time'] )){\n\t\t\treturn $values['date_time'];\n\t\t}\n\t\t\n\t\tif($options['title_unique']){\n\t\t\t//TODO:Check if the title unique\n\t\t\tif( Core::db_count( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => array(\n\t\t\t\t\t'title' => $values['title']\n\t\t\t\t)\n\t\t\t))){\n\t\t\t\t$error = Core::error($this->errors, 7);\n\t\t\t\t$error['error_msg'] .= 'Event title must be unique. ';\n\t\t\t\t$error['error_msg'] .= $error_append;\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$result = Core::db_insert( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => $values\n\t\t));\n\t\t\n\t\tif( Core::has_error($result) or empty($result) ){\n\t\t\t$result['error_msg'] .= $error_append;\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "private function create()\n {\n $events = [\n Webhook::EVENT_CONVERSATION_CREATED,\n Webhook::EVENT_CONVERSATION_UPDATED,\n Webhook::EVENT_MESSAGE_CREATED,\n Webhook::EVENT_MESSAGE_UPDATED,\n ];\n\n $chosenEvents = $this->choice(\n 'What kind of event you want to create',\n $events,\n $defaultIndex = null,\n $maxAttempts = null,\n $allowMultipleSelections = true\n );\n\n $webhookUrl = $this->ask('Please enter the webhook URL'); \n\n $webhook = new Webhook();\n $webhook->events = $chosenEvents;\n $webhook->channelId = $this->whatsAppChannelId;\n $webhook->url = $webhookUrl;\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->create($webhook);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function createEvent(Actions $emailAction){\n $event = new Events();\n $event->type = self::$typeMap[$emailAction->type];\n $event->subtype = 'email';\n $event->associationId = $emailAction->associationId;\n $event->associationType = X2Model::getModelName($emailAction->associationType);\n $event->timestamp = time();\n $event->lastUpdated = $event->timestamp;\n $event->user = $emailAction->assignedTo;\n if($event->save())\n $this->log(Yii::t('app','Created activity feed event for the email.'));\n return $event;\n }", "function __construct($event) {\n $this->init($event);\n }", "public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "protected function initEvent()\n {\n $locales = $this->container->getParameter('event.locales');\n $event = $this->getRepository('EventEventBundle:Event')->getEvent();\n $now = new \\DateTime();\n\n if (!$event) {\n $event = new Event();\n $event\n ->setTitle('My Event')\n ->setDescription('My another awesome event!')\n ->setStartDate($now)\n ->setEndDate($now->modify('+1 day'))\n ->setVenue('Burj Khalifa Tower')\n ->setEmail('[email protected]')\n ;\n\n $speaker = new Speaker();\n $speaker\n ->setFirstName('Phill')\n ->setLastName('Pilow')\n ->setCompany('Reseach Supplier')\n ;\n\n if ($locales) {\n foreach ($locales as $locale => $title) {\n $eventTranslation = new EventTranslation();\n $eventTranslation->setEvent($event);\n $eventTranslation->setlocale($locale);\n\n $this->getManager()->persist($eventTranslation);\n\n $speakerTranslation = new SpeakerTranslation();\n $speakerTranslation->setSpeaker($speaker);\n $speakerTranslation->setlocale($locale);\n\n $this->getManager()->persist($speakerTranslation);\n }\n }\n\n $this->getManager()->persist($event);\n $this->getManager()->persist($speaker);\n $this->getManager()->flush();\n }\n }", "public function __construct($data)\n {\n $this->event = $data;\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('event::create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Event;\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['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n\t ->getStateMachine()\n ->getTransition()\n ->abortTransition()\n ->isTransitionAborted()\n // EventInterface\n ->getName()\n ->setName()\n ->getTarget()\n ->setTarget()\n ->getParams()\n ->setParams()\n ->getParam()\n ->setParam()\n ->stopPropagation()\n ->isPropagationStopped();\n\n return $mock->new();\n }", "protected function newEventLogger()\n {\n return new EventLogger(static::getLogger());\n }", "public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}", "public function __construct(?EventConfig $cfg = null) {}", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }", "public function createEvent(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $event = $this->create($request->all());\n \n return redirect('/cms/events');\n }", "public function __construct($name, $event)\n {\n $this->name = $name;\n $this->event = $event;\n }", "final private static function makeEvent(Sincronizacao $sincronizacao)\n {\n $endpoint = self::getEventEndpoint($sincronizacao->sym_table, $sincronizacao->sym_action);\n\n $dependencies = self::getDependencies($sincronizacao);\n $eventClass = self::getEventClass($endpoint);\n\n return new $eventClass($dependencies['entry'], $dependencies['extra']);\n }", "public static function create(Client $client, $data) {\n if ($data == null || is_array($data)) {\n $d = new Event($data == null ? array() : $data);\n $data = $d->jsonSerialize();\n }\n $req = $client->newRequest(\"POST\", \"/{accountname}/events\");\n $req->setBody($data, \"json\");\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }", "public function __construct()\n {\n parent::__construct('BaseEvent');\n }", "public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \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['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}", "public function create()\n {\n // $crud = new Events();\n // $crud->photo ='anniv.png';\n // $crud->title = 'Sogod Founding Anniversary Concert';\n // $crud->descriptions = 'secret';\n // $crud->venue = 'Sogod Covered Court';\n // $crud->date = date('04/02/2018');\n // $crud->time = time('h:i:s');\n\n // $crud->save(); \n }", "public function create(){}", "function event(): EventEmitter\n{\n return EventEmitter::getInstance();\n}", "public function create() {}", "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "public function create()\n {}", "public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }", "private function __construct() {\n\t\t$action = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';\n\t\t$copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0;\n\t\tif(!empty($copy)) {\n\t\t\t$this->copy_event = new EL_Event($copy);\n\t\t\tadd_filter('get_object_terms', array(&$this, 'set_copied_categories'));\n\t\t}\n\n\t\t$this->options = &EL_Options::get_instance();\n\t\t$this->is_new = 'edit' !== $action;\n\n\t\tadd_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox'));\n\t\tadd_action('edit_form_top', array(&$this, 'form_top_content'));\n\t\tadd_action('edit_form_after_title', array(&$this, 'form_after_title_content'));\n\t\tadd_action('admin_print_scripts', array(&$this, 'embed_scripts'));\n\t\tadd_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3);\n\t\tadd_filter('enter_title_here', array(&$this, 'change_default_title'));\n\t\tadd_filter('post_updated_messages', array(&$this, 'updated_messages'));\n\t}", "public static function create() {\n\t\t$entry = new GuestbookEntry();\n\t\t$entry->Date = SS_DateTime::now()->getValue();\n\t\t$entry->IpAddress = $_SERVER['REMOTE_ADDR'];\n\t\t$entry->Host = gethostbyaddr($entry->IpAddress);\n\t\treturn $entry;\n\t}", "public function create()\n {\n //\n return view('events.create');\n }", "public function create()\n\t{ \n\t\t# Return if just the countoff is needed\n\t\tif ($this->countoff<2) return;\n\t\t\n\t\t# Add a note on and note off for each beat in the click track\n\t\tfor($i=0; $i<$this->beatsTotal; $i++) { \n\t\t\t$vol = (($i%$this->timeSig)==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t}", "public function create()\n {\n return view('adm.events.create');\n }", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function run()\n {\n factory(TechnoEvent::class,10)->create();\n }", "protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }", "public function create(Event $event)\n {\n if ($this->shouldUseLocks($this->cache->store($this->store)->getStore())) {\n return $this->cache->store($this->store)->getStore()\n ->lock($event->mutexName(), $event->expiresAt * 60)\n ->acquire();\n }\n\n return $this->cache->store($this->store)->add(\n $event->mutexName(), true, $event->expiresAt * 60\n );\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public function create() {\n\t \n }", "public function actionCreate()\n\t{\n\t\t$model=new Events;\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "function add_new_event($eventName, $eventColor){\n\t\tif( isset($_POST[$eventName]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\t$title \t= $_POST[$eventName];\n\t\t\t$color \t= $_POST[$eventColor];\n\n\t\t\t$full_calendar_notifications = new full_calendar_notification();\n\n\t\t\t$full_calendar_notifications->user_id = $base->clear_string($_SESSION['user_id']);\n\t\t\t$full_calendar_notifications->notification_title = $title;\n\t\t\t$full_calendar_notifications->notification_color = $color;\n\n\t\t\t$full_calendar_notifications->create();\n\t\t}\n\t}", "public function initialize()\n {\n // attributes\n $this->setName('event');\n $this->setPhpName('Event');\n $this->setClassname('ArtRequestORM\\\\Event');\n $this->setPackage('ArtRequest');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('EVENT_ID', 'EventId', 'INTEGER', true, null, null);\n $this->addColumn('EVENT_TITLE', 'EventTitle', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_DESCRIPTION', 'EventDescription', 'LONGVARCHAR', true, null, null);\n $this->addColumn('EVENT_LOCATION', 'EventLocation', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_SPONSOR_NAME', 'EventSponsorName', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_START_TIME', 'EventStartTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_END_TIME', 'EventEndTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_START_DATE', 'EventStartDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_END_DATE', 'EventEndDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_PRICING_MEMBER', 'EventPricingMember', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STAFF', 'EventPricingStaff', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STUDENT', 'EventPricingStudent', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_PUBLIC', 'EventPricingPublic', 'DECIMAL', true, null, null);\n // validators\n }", "public static function create_event($pid, $event) \n\t\t{\t\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t\n\t\t\t// insert event\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('INSERT INTO event (title, owner, gowner, start_time, end_time, location, logo, description, category, size, tag, price) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);');\n\t\t\t$stmt->bind_param('siisssssiisd', $event['title'], $pid, $gid, $event['start_time'], $event['end_time'], $event['location'], $event['logo'], $event['description'], $event['category'], $event['size'], $event['tag'], $event['price']);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t// get auto generated id\n\t\t\t$eid = $mysqli->insert_id;\n\t\t\t\n\t\t\t$stmt->close();\n\t\t\t\n\t\t\t// grant user host role\n\t\t\tPeopleDAO::set_event_role_pid($pid, $eid, Role::Owner);\n\t\t\treturn $eid;\n\t\t}", "public static function create_event( $module_name, $event_name )\n\t{\n\t\t$event = cms_orm('CmsDatabaseEvent')->find_by_module_name_and_event_name($module_name, $event_name);\n\t\tif ($event == null)\n\t\t{\n\t\t\t$event = new CmsDatabaseEvent();\n\t\t\t$event->module_name = $module_name;\n\t\t\t$event->event_name = $event_name;\n\t\t\treturn $event->save();\n\t\t}\n\t}", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }" ]
[ "0.8178475", "0.73455495", "0.67515916", "0.6665345", "0.66544545", "0.66479546", "0.6640835", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6543442", "0.64682955", "0.645909", "0.64520663", "0.6441302", "0.6438299", "0.63917476", "0.6371641", "0.6371641", "0.63478637", "0.63475716", "0.63285524", "0.6319918", "0.63108855", "0.6275116", "0.6206908", "0.6195245", "0.6193101", "0.61870754", "0.61810726", "0.61807376", "0.612506", "0.612064", "0.61166775", "0.6116489", "0.6116489", "0.6116489", "0.6116489", "0.6111236", "0.6099429", "0.6076598", "0.6072973", "0.6068453", "0.60566765", "0.6056391", "0.6041123", "0.6033919", "0.60277027", "0.60277027", "0.60181046", "0.6014412", "0.6007521", "0.6007521", "0.6007521", "0.5998441", "0.59855086", "0.5971869", "0.5971259", "0.59670085", "0.5959153", "0.59413785", "0.59338146", "0.5930427", "0.5917219", "0.5907522", "0.59049624", "0.58941996", "0.58838826", "0.5868322", "0.58614963", "0.58599705", "0.5856868", "0.58510625", "0.5838314", "0.58332664", "0.5826795", "0.58255696", "0.58250695", "0.5822382", "0.58223313", "0.58191884", "0.58166337", "0.5807514", "0.5798503", "0.57970744", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.579301", "0.5784509", "0.5783719", "0.5780148", "0.57786983", "0.57786983", "0.57786983", "0.57786983" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth', ['except'=>['index','show','search']]); }
{ "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
Display a listing of the resource.
public function index() { // $user = auth()->user()->name; // User name for naming the image folder $posts = Post::latest()->paginate(30); // This will return last created post on top return view('posts.index')->with('posts', $posts); }
{ "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
Display a listing of the resource.
public function search(Request $request) { // $request->validate( // ['search'=>'required|min:1'] // ); $search = $request->input('searchQuery'); $posts = Post::where('title', 'like', "%$search%")->get(); return view('search')->with('posts', $posts); }
{ "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() { return view('posts.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'title' => 'required', 'body' => 'required', // 'image' => 'image|nullable|mimes:jpeg,png,jpg,gif,svg|max:2048' 'image' => 'nullable|mimes:jpeg,png,jpg,gif,svg|max:2048' ]); $user = auth()->user()->name; // User name for naming the image folder // Check if request has image in form if ($request->hasFile('image')) { // Working upload shorter $fileNameToStore = $request->file('image')->getClientOriginalName(); // $path = $request->file('image')->storeAs('public/images', $fileNameToStore); // All images in one folder $path = $request->file('image')->storeAs('public/images/'.$user, $fileNameToStore); // For every user create user(name) folder }else{ $fileNameToStore = 'noimage.jpg'; } // Create post $post = new Post; $post->title = $request->input('title'); $post->body = $request->input('body'); $post->user_id = auth()->user()->id; $post->image = $fileNameToStore; $post->save(); return redirect('/posts')->with('success', 'You have successfully crated a post.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $posts = Post::find($id); return view('posts.show')->with('posts',$posts); }
{ "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) { $posts = Post::find($id); // Check admin auth // if (Auth::user()->role == 'admin') { // return view('posts/edit')->with('posts',$posts); // } // Check for correct user if(Auth::user()->id !== $posts->user_id && Auth::user()->role !== 'admin'){ return redirect('/posts')->with('error', 'Nije moguce'); } return view('posts/edit')->with('posts',$posts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request, [ 'title' => 'required', 'body' => 'required', 'image' => 'nullable|mimes:jpeg,png,jpg,gif,svg|max:2048' ]); // Check if request has image in form $user = auth()->user()->name; // What user it is if ($request->hasFile('image')) { $fileNameToStore = $request->file('image')->getClientOriginalName(); $path = $request->file('image')->storeAs('public/images/'.$user, $fileNameToStore); } // Update post $post = Post::find($id); $post->title = $request->input('title'); $post->body = $request->input('body'); if ($request->hasFile('image')) { $post->image = $fileNameToStore; } $post->save(); return redirect('/posts')->with('success', 'Updated!'); }
{ "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) { // $post = Post::find($id); $post = Post::findOrFail($id); // Check for correct user if(Auth::user()->id !== $post->user_id){ return redirect('/posts')->with('error', 'Nije moguce'); } // Delete image from folder $user = auth()->user()->name; // $img = $post['image']; if ($post->image != 'noimage.jpg') { // Storage::delete('public/images/'.$post->image); // Working if img is in images folder Storage::delete('public/images/'.$user.'/'.$post->image); // This is working like charm, deleting img from user folder } $post->delete(); return redirect('/posts')->with('success','You have successfully deleted a post.'); }
{ "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
Returns a list of global variables to add to the existing list.
public function getGlobals() { $locales = $this->registry->getRegisteredLocales(); try { $locale = $this->requestStack->getCurrentRequest()->getLocale(); } catch (\Exception $e) { $locale = current($locales); } return [ '_locale' => $locale, '_locales' => $locales ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGlobals()\n {\n return array();\n }", "public function getGlobals()\n {\n return array();\n }", "public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }", "public function getGlobals();", "public function getGlobals();", "public function getGlobals() {\r\n\t\treturn [\r\n 'REQUEST' => [\r\n\t\t\t\t'url' => Response::$url\r\n\t\t\t],\r\n 'SESSION' => (isset($_SESSION)) ? $_SESSION : [],\r\n 'SERVER' => $_SERVER,\r\n 'INPUT' => App::$input,\r\n 'ENV' => App::$env\r\n ];\r\n }", "public function getGlobals()\n {\n global $APPLICATION;\n\n return array(\n 'APPLICATION' => $APPLICATION,\n 'LANG' => LANG,\n 'POST_FORM_ACTION_URI' => POST_FORM_ACTION_URI,\n 'DEFAULT_TEMPLATE_PATH' => self::DEFAULT_TEMPLATE_PATH,\n '_REQUEST' => $_REQUEST,\n 'SITE_SERVER_NAME' => SITE_SERVER_NAME,\n '_SESSION' => $_SESSION\n );\n }", "public function getGlobals()\n {\n }", "public function getGlobals()\n\t{\n\t\treturn array(\n\t\t\t'uri' => $this->app->get('uri'),\n\t\t\t'uri.base.path' => $this->app->get('uri.base.path')\n\t\t);\n\t}", "public static function get_template_global_variables()\n {\n return [\n 'FoxyStripe' => 'current_foxystripe_setting',\n ];\n }", "public function getGlobals()\n {\n return self::$globalsCache;\n }", "public static function getDefaultGlobals(){\n\t\treturn Array(\n\t\t);\n\t}", "public static function get_template_global_variables()\n {\n return [\n 'TemplateConfig' => 'current_template_config',\n ];\n }", "function fiorello_mikado_get_global_variables() {\n\t\t$global_variables = array();\n\n\t\t$global_variables['mkdfAddForAdminBar'] = is_admin_bar_showing() ? 32 : 0;\n\t\t$global_variables['mkdfElementAppearAmount'] = -100;\n\t\t$global_variables['mkdfAjaxUrl'] = esc_url( admin_url( 'admin-ajax.php' ) );\n\n\t\t$global_variables = apply_filters( 'fiorello_mikado_filter_js_global_variables', $global_variables );\n\n\t\twp_localize_script( 'fiorello-mikado-modules', 'mkdfGlobalVars', array(\n\t\t\t'vars' => $global_variables\n\t\t) );\n\t}", "private function globals() {\n global $pagesArray;\n \n $xml = XML2Array::createArray(file_get_contents(GSDATAOTHERPATH.'website.xml'));\n \n // turn PRETTYURLS into boolean\n if ($xml['item']['PRETTYURLS']=='') $xml['item']['PRETTYURLS'] = false;\n else $xml['item']['PRETTYURLS'] = true;\n \n // globals array\n $globals = array(\n 'sitename' => $xml['item']['SITENAME']['@cdata'],\n 'siteurl' => $xml['item']['SITEURL']['@cdata'],\n 'template' => $xml['item']['TEMPLATE']['@cdata'],\n 'pages' => $pagesArray,\n 'permalink' => $xml['item']['PERMALINK'],\n 'prettyurls' => $xml['item']['PRETTYURLS'],\n );\n return $globals;\n }", "public function getGlobals()\n {\n return [\n 'snippets' => new SnippetsTwig($this->flextype)\n ];\n }", "function return_globals() {\r\n foreach ($GLOBALS as $k => $v) {\r\n\tif ($k !== 'GLOBALS')\r\n\t $arr[$k] = $v;\r\n }\r\n return @json_encode($arr);\r\n}", "public static function fromGlobals() {}", "public function getVars() {\n return array();\n }", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function getVariablesList() {\n return $this->_get(2);\n }", "public function getAvailableVariables() :array\n {\n return [];\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "public function getVariablesList() {\n return $this->_get(4);\n }", "public function globalData() {\n $globalData = array();\n\n $this->db->select('*');\n $this->db->from('settings');\n $result = $this->db->get();\n foreach ($result->result_array() as $value) {\n $global[$value['setting_name']] = $value['setting_value'];\n }\n return $global;\n }", "static public function get_template_global_variables() {\n\t\treturn array\n\t\t(\n\t\t\t\"FacebookConnectURL\" => \"connect_url\",\n\t\t\t\"FacebookLoginURL\" => \"login_url\",\n\t\t\t\"FacebookDisconnectURL\" => \"disconnect_url\"\n\t\t);\n\t}", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "private function _prep_globals($globals = array())\n\t{\n\t\t$temp = array();\n\n\t\tforeach ($globals as $key => $val)\n\t\t{\n\t\t\tif (strpos($key,'.') !== FALSE)\n\t\t\t{\n\t\t\t\t$parts\t= explode('.', $key);\n\t\t\t\t$parent\t= array_shift($parts);\n\t\t\t\t$key\t= implode('.', $parts);\n\t\t\t\t$temp[$parent] = $this->_prep_globals(array(\n\t\t\t\t\t$key\t=> $val\n\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp[$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\treturn $temp;\n\t}", "public function getGlobals($load_extensions = true)\n {\n if (true === $load_extensions) {\n foreach ($this->getExtensions() as $extension) {\n $this->globals = array_merge($this->globals, $extension->getGlobals());\n }\n }\n\n return $this->globals;\n }", "public static function getScopeList() {\n\t\tif(!isset(self::$scopeList)) {\n trigger_error('Context::scopeList should be set!!!',E_USER_WARNING);\n self::$scopeList = implode('|',array_map(function ($s) {\n\t\t\t\t return substr(basename($s),0,- 4);\n\t\t\t },glob(self::getMapDir() . '/*.php')));\n\t\t}\n\t\treturn self::$scopeList;\n\t}", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function getGlobals()\n {\n if (!$this->runtimeInitialized && !$this->extensionInitialized) {\n return $this->initGlobals();\n }\n if (null === $this->globals) {\n $this->globals = $this->initGlobals();\n }\n return $this->globals;\n }", "public function getAll(): array\n {\n return $this->variables;\n }", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "public function getVars() {\r\n return $this->VARS;\r\n }", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "public function getVars()\n {\n return [\n 'get' => $this->get,\n 'session' => $this->session,\n ];\n }", "public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}", "public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }", "public function getGlobals()\n {\n $hostname = $this->container->get('request')->getHost();\n $host = $this->container->get('doctrine.orm.entity_manager')->getRepository('SandboxWebsiteBundle:Host')\n ->findOneBy(['name' => $hostname]);\n return array('host' => $host);\n }", "public function dumpGlobalPrefs()\n\t{\n\t\treturn $this->global_prefs;\n\t}", "public function exportedVars(): iterable;", "public function register()\n {\n return array(T_GLOBAL);\n\n }", "public function getBindVars(): array\n {\n return $this->container->getAll();\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 }", "protected static function initializeGlobalVariables() {}", "static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "function getSupportingConfigVars()\n {\n return array();\n }", "public static function registerGlobals() {\n\n foreach (self::$egpcs as $name) {\n\n if (!isset($GLOBALS[\"_$name\"])) {\n continue;\n }\n\n foreach($GLOBALS['_'.$name] as $key => & $value) {\n $GLOBALS[$key] = $value;\n }\n\n reset($GLOBALS[\"_$name\"]);\n }\n\n return true;\n }", "private static function addGlobals()\n {\n \tself::$twig->addGlobal('session', $_SESSION);\n self::$twig->addGlobal('APP', APP);\n self::$twig->addGlobal('auth', Auth::getAuth());\n }", "function getTemplateVars() {\n return array();\n }", "public function getGlobals()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('globals');\n }", "public function getVars() : array {\n\n\t\t\treturn $this->variables;\n\t\t}", "public static function getVars()\n {\n if (is_null(static::$vars)) {\n static::$vars = static::buildRepository(true);\n }\n\n return static::$vars;\n }", "public function vars()\n {\n $v = &$this->vars;\n return $v;\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "public function mergeGlobals(array $context)\n {\n // we don't use array_merge as the context being generally\n // bigger than globals, this code is faster.\n foreach ($this->getGlobals() as $key => $value) {\n if (!array_key_exists($key, $context)) {\n $context[$key] = $value;\n }\n }\n return $context;\n }", "public function getGlobalSettingsArray($fields_to_pass = '', $condition_to_pass = '', $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0) {\n $this->getRecords(\n \"mst_global_settings as mst_global left join \".parent::SUFFIX.\"trans_global_settings as trans_global on mst_global.global_name_id=trans_global.global_name_id\",$fields_to_pass, $condition_to_pass,$order_by_to_pass, $limit_to_pass, $debug_to_pass);\n\t\t\n $arr_to_return = array();\n while ($arrRow = $this->getRow()) {\n $arr_to_return[] = $arrRow;\n }\n foreach ($arr_to_return as $row) {\n $global[$row['name']] = $row['value'];\n }\n return $global;\n }", "public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }", "static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public static function fromGlobals() : PageVariables {\n\t\t\treturn new PageVariables(\n\t\t\t\t$_COOKIE ?? [],\n\t\t\t\t$_ENV ?? [],\n\t\t\t\t$_FILES ?? [],\n\t\t\t\t$_GET ?? [],\n\t\t\t\t$_POST ?? [],\n\t\t\t\t$_REQUEST ?? [],\n\t\t\t\t$_SERVER ?? [],\n\t\t\t\t$_SESSION ?? []\n\t\t\t);\n\t\t}", "public function mergeGlobals(array $context)\n {\n // we don't use array_merge as the context being generally\n // bigger than globals, this code is faster.\n foreach ($this->getGlobals() as $key => $value) {\n if (!array_key_exists($key, $context)) {\n $context[$key] = $value;\n }\n }\n\n return $context;\n }", "function filterGlobalArrays()\r\n{\r\n ### clean global namespace from register globals ###\r\n if (@ini_get('register_globals')) {\r\n foreach ($_REQUEST as $key => $value) {\r\n unset($GLOBALS[$key]);\r\n }\r\n }\r\n\r\n clearRequestVars();\r\n addRequestVars($_GET);\r\n addRequestVars($_POST);\r\n addRequestVars($_COOKIE);\r\n\r\n $_COOKIE= $_GET= $_POST=array();\r\n}", "public function register()\n {\n // Merge variables with current EE globals\n $global_variables = array_merge(ee()->config->_global_vars, $this->global_variables);\n\n // Set the merged array\n ee()->config->_global_vars = $global_variables;\n }", "function getPackageVariables(): array\n {\n return $this->compiler->getPackageVariables();\n }", "public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }", "function getExtraVars()\n\t{\n\t\treturn $this->keys;\n\t}", "public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }", "public function clearGlobal() {\n $this->arrVar['global'] = array();\n }", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "public function variables(): array;", "public function variables(): array;", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "protected function getReactVariables()\n {\n $variables = [\n 'module' => $this->getModuleName(),\n ];\n\n return $variables;\n }", "public function getVariables()\n {\n $variables = $this->getVariablesForPart($this->tempDocumentMainPart);\n\n foreach ($this->tempDocumentHeaders as $headerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($headerXML));\n }\n\n foreach ($this->tempDocumentFooters as $footerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($footerXML));\n }\n\n return array_unique($variables);\n }", "public function serverVariables()\n {\n return array_merge(Fpm::resolve()->serverVariables(), array_filter([\n 'AWS_REQUEST_ID' => $_ENV['AWS_REQUEST_ID'] ?? null,\n ]));\n }", "public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function vars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function &getVars() {\n return $this->app->getVars();\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "function qodef_re_set_global_map_variables() {\n \t\n \tif( qodef_re_theme_installed() ) {\n\t\t\t$global_map_variables = array();\n\t\t\n\t\t\t$global_map_variables['mapStyle'] = json_decode(bridge_qode_get_meta_field_intersect('real_estate_map_style'));\n\t\t\t$global_map_variables['scrollable'] = bridge_qode_options()->getOptionValue('real_estate_maps_scrollable') == 'yes' ? true : false;\n\t\t\t$global_map_variables['draggable'] = bridge_qode_options()->getOptionValue('real_estate_maps_draggable') == 'yes' ? true : false;\n\t\t\t$global_map_variables['streetViewControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_street_view_control') == 'yes' ? true : false;\n\t\t\t$global_map_variables['zoomControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_zoom_control') == 'yes' ? true : false;\n\t\t\t$global_map_variables['mapTypeControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_type_control') == 'yes' ? true : false;\n\t\t\n\t\t\t$global_map_variables = apply_filters('qodef_re_filter_js_global_map_variables', $global_map_variables);\n\t\t\n\t\t\twp_localize_script('bridge-default', 'qodefMapsVars', array(\n\t\t\t\t'global' => $global_map_variables\n\t\t\t));\n\t\t}\n }", "public function getVars()\n {\n return $this->_variables;\n }", "public function getWithAdditionalConstants(): array\n {\n return array_merge(\n $this->getConstants(),\n ['user' => ['user', 'stubbles.user.path']]\n );\n }", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}", "function get_vars( $list_id ) {\n\t\t$response = $this->call()->get( \"/lists/{$list_id}/merge-fields\" );\n\t\treturn isset( $response['merge_fields'] ) ? $response['merge_fields'] : array();\n\t}", "public function getGlobalSettingsIdentifiers()\n {\n return $this->getItemIdentifiers('GetGlobalSettingsIdentifiers');\n }", "private function registerTwigGlobals()\n {\n $files = array_merge(\n glob( $this->getThemeDirectory().'*.yaml' ),\n glob( $this->getContentPath().'*.yaml')\n );\n\n # Get the *.yaml files (either from content or from the theme):\n foreach( $files as $yaml )\n {\n if( substr(basename($yaml), 0, 1) != '_' )\n {\n $this->addTwigGlobal(\n Utils::removeExtension($yaml),\n Yaml::parseFile($yaml)\n );\n }\n }\n\n # Now add additional useful vars:\n $this->addTwigGlobal('theme_dir', $this->config->get('site.url').$this->config->get('site.dir').$this->config->get('dirs.view').'/'.$this->config->get('site.theme').'/');\n $this->addTwigGlobal('base_url', $this->config->get('site.url').$this->config->get('site.dir'));\n }", "public function getGlobalRoles()\n {\n $global_roles = config('laravel-fortress', []);\n\n return $global_roles;\n }", "public static function &all(): array\n\t{\n\t\treturn static::$config;\n\t}", "public function getVariables() {\n\t\treturn $this->variables;\n\t}", "public function getGetVariables();", "function SM_getScriptVars($excludeList=NULL) {\n\n // gather vars\n $varList = '';\n while (list($key, $val) = each($_REQUEST)) {\n if (is_array($excludeList)) {\n if ((!isset($excludeList[$key]))||($excludeList[$key] == ''))\n $varList .= \"&$key=\".urlencode($val);\n }\n else {\n $varList .= \"&$key=\".urlencode($val);\n }\n\n }\n\n $varList = substr($varList, 1);\n return $varList; \n\n}", "public function getGlobalJSVariables($globalVariables) {\n\t\t$global_variables['mkdfLogoAreaHeight'] = $this->logoAreaHeight;\n\t\t$global_variables['mkdfMenuAreaHeight'] = 0;\n\n\t\treturn $globalVariables;\n\t}", "public function vars(array $newvalue = null) \n {\n //if a new value was specified, use it to set the internal variable list\n if(is_array($newvalue))\n $this->vars = $newvalue;\n\n //and return the internal variable list\n return $this->vars;\n }" ]
[ "0.729674", "0.729674", "0.7222214", "0.70583993", "0.70583993", "0.6949429", "0.69218194", "0.68164724", "0.6792427", "0.6674383", "0.6634355", "0.6616216", "0.65718746", "0.6538482", "0.64802563", "0.64465857", "0.64193285", "0.6374329", "0.63421863", "0.63240165", "0.63206613", "0.6318446", "0.619338", "0.61867094", "0.61733836", "0.61614054", "0.6122855", "0.60928184", "0.60905856", "0.6081265", "0.60801965", "0.6065241", "0.60558504", "0.6015402", "0.59526765", "0.59494317", "0.5926241", "0.5921404", "0.5915716", "0.5915599", "0.59121126", "0.587897", "0.58583224", "0.5840249", "0.58369666", "0.582275", "0.5820304", "0.5813451", "0.5813451", "0.58101135", "0.57980657", "0.57902235", "0.574793", "0.5736355", "0.57235384", "0.5714736", "0.5714544", "0.5703536", "0.56996036", "0.56957626", "0.5694368", "0.5665479", "0.56501836", "0.5645688", "0.5645288", "0.56397", "0.5622824", "0.56198364", "0.56099254", "0.55971915", "0.5593371", "0.5575787", "0.55740887", "0.55667394", "0.55667394", "0.55648714", "0.5561726", "0.5558766", "0.55519366", "0.55488324", "0.5525272", "0.55164516", "0.55083364", "0.5507373", "0.5504174", "0.54915553", "0.54912215", "0.5467648", "0.5467648", "0.546641", "0.54626817", "0.544999", "0.5448449", "0.5430426", "0.5428606", "0.5425505", "0.5423866", "0.5410312", "0.5404529", "0.5403941" ]
0.65424633
13
Returns a list of functions to add to the existing list.
public function getFunctions() { return [ new \Twig_SimpleFunction('get_active_locales', [$this, 'getActiveLocales']), new \Twig_SimpleFunction('set_locale_switch_paths', [$this, 'setSwitchPaths']), new \Twig_SimpleFunction('get_locale_switch_paths', [$this, 'getSwitchPaths']), new \Twig_SimpleFunction('add_locale_switch_path', [$this, 'addSwitchPath']), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFunctions(): Collection\n {\n return $this->functions;\n }", "public function getFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn array_merge($this->groupFuncs, $this->valueFuncs);\n\t}", "public function funcs()\n { \n //start a new array, which which will store the function descriptions\n $output = array();\n\n //add each function to the array\n foreach ($this->user_functions as $fnn=>$dat)\n $output[] = $fnn . '(' . implode(',', $dat[MATHSCRIPT_ARGUMENTS]) . ')';\n\n //and return the completed array of functions\n return $output;\n }", "public function getMethods() {\n $list = array();\n $functions = $this->get('function');\n if (null != $functions) {\n foreach ($functions as $function) {\n $name = $function->getName();\n if ('__construct' != $name && $this->getName() != $name) {\n if ($function->accept()) {\n $list[] = $function;\n }\n }\n }\n }\n return $list;\n }", "public function getFunctions()\n {\n\treturn array(\n new \\Twig_SimpleFunction('snide_extra_form_addDoubleList', array($this, 'addDoubleList'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('snide_extra_form_init', array($this, 'init'), array('is_safe' => array('html'))),\n );\n }", "public function getFunctions()\n {\n return array();\n }", "public function getFunctions();", "abstract public function getFunctions();", "public function getFunctions()\n {\n return array(\n new \\Twig_SimpleFunction('adminlist_widget', array($this, 'renderWidget'), array('needs_environment' => true, 'is_safe' => array('html'))),\n new \\Twig_SimpleFunction('my_router_params', array($this, 'routerParams')),\n new \\Twig_SimpleFunction('supported_export_extensions', array($this, 'getSupportedExtensions')),\n );\n }", "public function getFunctions()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->functions;\n }", "public function getFunctions()\n {\n return $this->__getFunctions();\n }", "public function get_functions()\n\t{\n\t\treturn $this->driver_query('function_list', FALSE);\n\t}", "public function getFunctions()\n {\n $functions = [];\n\n $functions[] = new \\Twig_Function('path', [$this, 'functionPath']);\n $functions[] = new \\Twig_Function('preload', [$this, 'functionPreload']);\n\n return $functions;\n }", "public function getFunctions()\n\t{\n\t\treturn $this->__getFunctions();\n\t}", "public function getFunctions()\n {\n return array(\n new \\Twig_SimpleFunction('request', array($this, 'getRequest')),\n new \\Twig_SimpleFunction('request_locale', array($this, 'getLocale')),\n new \\Twig_SimpleFunction('request_parameter', array($this, 'getParameter')),\n );\n }", "public function functions()\n\t{\n\t\treturn $this->getFunctions();\n\t}", "public function getFunctions()\n {\n return array(\n 'link' => new \\Twig_Function_Method($this, 'getContentLink'),\n 'menu' => new \\Twig_Function_Method($this, 'getContentMenu'),\n 'widget' => new \\Twig_Function_Method($this, 'getContentWidget'),\n 'meta' => new \\Twig_Function_Method($this, 'getContentMeta'),\n 'pref' => new \\Twig_Function_Method($this, 'getPreference'),\n 'image' => new \\Twig_Function_Method($this, 'getImage'),\n 'thumb' => new \\Twig_Function_Method($this, 'getThumbImage'),\n 'pagination' => new \\Twig_Function_Method($this, 'getPagination'),\n );\n }", "public function getFunctions() {\n return array(\n new \\Twig_SimpleFunction('updateChildernMenu', array($this, 'updateChildernMenu'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('getasuheader', array($this, 'getasuheader'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('getContentsBeforeasuheader', array($this, 'getContentsBeforeasuheader'), array('is_safe' => array('html'))),\n );\n }", "public function getFunctions()\n {\n return [\n new TwigFunction('get_multi_domain_hosts', [$this, 'getMultiDomainHosts']),\n new TwigFunction('get_current_host', [$this, 'getCurrentHost']),\n new TwigFunction('get_extra_data', [$this, 'getExtraData']),\n new TwigFunction('get_current_full_host', [$this, 'getCurrentFullHost']),\n ];\n }", "public static function get_new_functions () : array\n {\n return k_include ( \"gnf\" );\n }", "public function getFunctions()\n {\n return [\n\n new Twig_SimpleFunction(\n 'set_active', function ($path, array $classes = [], $active = 'active') {\n return set_active($path, $classes, $active);\n }\n ),\n ];\n }", "public function getFunctions(): array\n {\n return [\n new TwigFunction('pswp_container_class', [PhotoswipeRuntime::class, 'getContainerClass']),\n new TwigFunction('pswp_attr', [PhotoswipeRuntime::class, 'getAttributes']),\n ];\n }", "public function getFunctions()\n {\n return array_merge(parent::getFunctions(), array(\n 'base' => new \\Twig_Function_Function('URL::base'),\n 'form_token' => new \\Twig_Function_Function('Form::token'),\n 'can' => new \\Twig_Function_Function('Auth::can'),\n 'editor' => new \\Twig_Function_Function('\\Ionic\\Editor::create'),\n 'widget' => new \\Twig_Function_Function('\\Ionic\\Widget::factory_show'),\n 'make' => new \\Twig_Function_Function('ionic_make_link'),\n 'thumb' => new \\Twig_Function_Function('ionic_thumb')\n ));\n }", "public function getTargetFunctions()\n {\n $result = new ArrayCollection();\n if ($this->targetFunction1) { $result[] = $this->targetFunction1; }\n if ($this->targetFunction2) { $result[] = $this->targetFunction2; }\n if ($this->targetFunction3) { $result[] = $this->targetFunction3; }\n return $result;\n }", "protected function getFunctionArray() {\n $allowed_functions = array_diff(self::$set_functions,\n self::$disallowed_functions);\n return $allowed_functions;\n }", "public function funcs_raw($newvalue = null)\n {\n //if a new value was specified, use it to set the internal function list\n if(is_array($newvalue))\n $this->user_functions = $newvalue;\n\n //and return the internal function list\n return $this->user_functions;\n }", "public function getFunctions()\n {\n return array(\n 'sonata_news_link_tag_rss' => new \\Twig_Function_Method($this, 'renderTagRss', array('is_safe' => array('html'))),\n 'sonata_news_permalink' => new \\Twig_Function_Method($this, 'generatePermalink'),\n );\n }", "public function getFunctions()\n {\n return array(\n 'get_node_for' => new \\Twig_Function_Method($this, 'getNodeFor'),\n 'get_node_translation_for' => new \\Twig_Function_Method($this, 'getNodeTranslationFor')\n );\n }", "public function getFunctions()\n {\n return array(\n new Twig_SimpleFunction('range', 'range'),\n new Twig_SimpleFunction('constant', 'twig_constant'),\n new Twig_SimpleFunction('cycle', 'twig_cycle'),\n new Twig_SimpleFunction('random', 'twig_random', array('needs_environment' => true)),\n new Twig_SimpleFunction('date', 'twig_date_converter', array('needs_environment' => true)),\n new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true)),\n );\n }", "public function getFunctions() {\n\t\t$functions = array(\n\t\t\t'labels' => array(),\n\t\t\t'targets' => array()\n\t\t);\n\t\tif ($this->hasParameter('functions')) {\n\t\t\tforeach ($this->getParameter('functions') as $name => $function) {\n\t\t\t\t$functions['labels'][$name] = $this->getTranslator()->trans($function['label']);\n\t\t\t\t$targetsList = $function['target'];\n\t\t\t\tif (in_array('all', $targetsList)) {\n\t\t\t\t\t$functions['targets'][$name] = ['data', 'datagroup', 'page', 'article', 'step', 'panel', 'blockgroup', 'fieldset', 'fieldrow', 'field', 'prenote', 'postnote', 'blockinfo', 'chapter', 'section', 'content', 'annotations', 'footnote'];\n\t\t\t\t} else {\n\t\t\t\t\t$functions['targets'][$name] = $targetsList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $functions;\n\t}", "public function getFunctions(): array\n {\n return [\n new Twig_Function('fileTime', [\n Module::fileOperationsService(),\n 'getFileTime'\n ]),\n ];\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('admin_menu_get', [$this, 'getAdminMenu']),\n ];\n }", "public function getFunctions() {\n return array(\n new \\Twig_Function(\"toc\", array($this, \"toc\")),\n new \\Twig_Function(\"render\", array($this, \"render\"))\n );\n }", "public function functions() {\n foreach ( $this->soap->__getFunctions() as $f ) {\n $fname = explode( ' ', $f );\n $functions[] = substr( $fname[0], 0, ( strlen( $fname[0] ) - 8 ) );\n }\n\n return $functions;\n }", "public function getFunctions()\n {\n $res = [];\n foreach ($this->client->__getFunctions() as $functionPrototype) {\n $ready = str_replace([' ','(',')'], ',', $functionPrototype);\n $ready = str_replace([',,'], ',', $ready);\n \n $res[] = explode(',',$ready);\n \n }\n \n return $res;\n }", "public function map(Callable $func) {\n $result = [];\n\n foreach ($this->list as $item) {\n $result[] = $func($item);\n }\n\n return $result;\n }", "public static function getFunctionList()\n {\n return ['onePageFunction'];\n }", "public function getFunctions()\n {\n return array(\n new Twig_SimpleFunction('ShowMessage', array($this, 'showMessage'), array('message')),\n new Twig_SimpleFunction('bitrix_sessid_post', array($this, 'bitrix_sessid_post')),\n new Twig_SimpleFunction('bitrix_sessid_get', array($this, 'bitrix_sessid_get')),\n new Twig_SimpleFunction('ShowError', array($this, 'showError'), array('message', 'css_class')),\n new Twig_SimpleFunction('ShowNote', array($this, 'showNote'), array('message', 'css_class')),\n new Twig_SimpleFunction('IsUserAdmin', array($this, 'isUserAdmin')),\n new Twig_SimpleFunction('IsUserAuthorized', array($this, 'isUserAuthorized')),\n new Twig_SimpleFunction('getComponent', array($this, 'getComponent')),\n new Twig_SimpleFunction('includeFile', array($this, 'includeFile')),\n );\n }", "protected function functions()\n {\n\n $functions = Load::file('/app/functions/twig.php');\n\n foreach($functions as $function) {\n $this->twig->addFunction($function);\n }\n }", "private function getListaFuncionarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function getFunctions() {\n return mysql_query(sprintf('SELECT definer, name, param_list, returns, body FROM mysql.proc WHERE db = \\'%s\\' AND type = \\'FUNCTION\\'', $this->config[\"database\"]));\n }", "public function getFunctions()\n {\n return array(\n 'date_format' => new \\Twig_Function_Method($this, 'getDateFormat'),\n 'date_time_format' => new \\Twig_Function_Method($this, 'getDateTimeFormat'),\n );\n }", "public function getFunctions()\n\t{\n\t\treturn [\n\t\t\tnew \\Twig_SimpleFunction('sprintf', 'sprintf')\n\t\t];\n\t}", "public function getFunctions()\n {\n return [\n 'dmkclub_paymentoption' => new \\Twig_Function_Method($this, 'getPaymentOptionLabel'),\n 'dmkclub_paymentinterval' => new \\Twig_Function_Method($this, 'getPaymentIntervalLabel'),\n ];\n }", "public function GetFunctions()\n {\n $functions = '';\n if(count($this->functions))\n $functions = implode('', $this->functions);\n return $functions;\n }", "public function getFunctions()\n {\n return [\n new Twig_Function('translateToppingStatus', function(string $status) {\n return $this->translateToppingStatus($status);\n })\n ];\n }", "public function getValueFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->valueFuncs;\n\t}", "function listAllFunctions() {\n include_once $_SERVER['DOCUMENT_ROOT'] . '/saved/functions.php';\n\n //Keep track of the names of the functions:\n $FUNCTIONS_ID = [\n 0 => 'Simple Div',\n 1 => 'Simple Link',\n 2 => 'Image',\n ];\n\n //Store the actual functions here.\n $FUNCTIONS_LIST = [];\n\n foreach($FUNCTIONS_ID as $function_id) {\n echo '<li>';\n echo '<div class=\"clones\" id=\"' . $function_id . '\">' . $function_id . '</div>';\n echo '</li>';\n }\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('csrf_token_name', [$this, 'getTokenName']),\n new \\Twig_SimpleFunction('csrf_token', [$this, 'generateCsrfToken']),\n new \\Twig_SimpleFunction(\n 'csrf_input_widget',\n [$this, 'generateInputWidget'],\n ['needs_environment' => true, 'is_safe' => ['html']]\n ),\n new \\Twig_SimpleFunction(\n 'csrf_meta_widget',\n [$this, 'generateMetaWidget'],\n ['needs_environment' => true, 'is_safe' => ['html']]\n ),\n ];\n }", "public function getFunctions(): iterable\n {\n yield from [\n new ExpressionFunction('date', function ($arg) {\n return sprintf('(new \\DateTimeImmutable(%s))->setTime(0, 0)', $arg);\n }, function (array $variables, $value) {\n return (new \\DateTimeImmutable($value))->setTime(0, 0);\n }),\n new ExpressionFunction('datetime', function ($arg) {\n return sprintf('new \\DateTimeImmutable(%s)', $arg);\n }, function (array $variables, $value) {\n return new \\DateTimeImmutable($value);\n }),\n ExpressionFunction::fromPhp('strtoupper', 'upper'),\n ExpressionFunction::fromPhp('strtolower', 'lower'),\n ExpressionFunction::fromPhp('str_contains', 'contains'),\n ExpressionFunction::fromPhp('str_starts_with', 'starts_with'),\n ExpressionFunction::fromPhp('str_ends_with', 'ends_with'),\n ExpressionFunction::fromPhp('array_keys', 'keys'),\n ];\n\n foreach ($this->providers as $provider) {\n yield from $provider->getFunctions();\n }\n }", "public function getPluginFunctions()\n {\n if (KILVIN_REQUEST === 'INSTALL') {\n return [];\n }\n\n $functions = [];\n $plugins = Plugins::installedPlugins();\n $registered = Plugins::twig()['function'];\n\n foreach($plugins as $plugin_name => $plugin_details) {\n\n if (!isset($registered[$plugin_name])) {\n continue;\n }\n\n foreach ($registered[$plugin_name] as $class) {\n if ($details = $this->getFunctionDetails($class)) {\n $functions = array_merge($functions, $details);\n }\n }\n }\n\n return array_filter($functions);\n }", "function make_all_functions_avaible_for_twig () {\r\n $this->CI->config->set_item( 'reveal_all_functions_to_twig', true );\r\n $get_defined_functions = get_defined_functions();\r\n\r\n foreach ( $get_defined_functions[ 'user' ] as $function ) {\r\n if ( ! isset( $this->_twig->$function ) ) {\r\n $this->_twig->addFunction( $function, new Twig_Function_Function( $function ) );\r\n }\r\n }\r\n\r\n unset( $get_defined_functions );\r\n }", "public function getAllFunctions() : array\n {\n /** @var \\Roave\\BetterReflection\\Reflection\\ReflectionFunction[] $allFunctions */\n $allFunctions = $this->sourceLocator->locateIdentifiersByType(\n $this,\n new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION)\n );\n\n return $allFunctions;\n }", "public function getFunctions()\n {\n return array(\n new TwigFunction(\n 'Message_notice',\n function ($string) {\n return Message::notice($string)->getDisplay();\n },\n array('is_safe' => array('html'))\n ),\n new TwigFunction(\n 'Message_error',\n function ($string) {\n return Message::error($string)->getDisplay();\n },\n array('is_safe' => array('html'))\n ),\n );\n }", "protected function add()\n {\n $this->numArgs = $this->findNumArgs($this->callback);\n if (is_string($this->callback) && class_exists($this->callback)) {\n $this->useCallbackManager('invoke', $this->callback);\n }\n foreach ((array) $this->hook as $hook) {\n \\add_filter($hook, $this->callback, $this->priority, $this->numArgs);\n }\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('settings_get', [$this->settings, 'get'])\n ];\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('line', [$this, 'line'], ['is_safe' => ['html']])\n ];\n }", "public function register()\n {\n return [\n T_FUNCTION,\n T_CLOSURE,\n T_FN,\n ];\n\n }", "public function getFunctions()\n\t{\n\t\treturn array(\n\t\t\tnew \\Twig_SimpleFunction('lang', array($this, 'lang')),\n\t\t);\n\t}", "public function add()\n {\n foreach ($this->filters as $filter) {\n call_user_func_array($this->addCallback, $filter);\n }\n }", "function createList()\n {\n $this->functionData['severity'] = array();\n $this->functionData['errorType'] = array();\n $this->functionData['function'] = array();\n $this->functionData['errorCodes'] = array();\n // If $this->addFunction list is not empty then merge it with defalut one.//\n if (sizeof($this->addFunctions) > 0 ) {\n /*\n * Append all functionList array with addFunctions array.\n */\n $this->functionList\n = array_merge($this->addFunctions, $this->functionList);\n }\n foreach ($this->functionList as $functionVal) {\n $expldVal = explode(\"-\", trim($functionVal));\n $functionName = $expldVal[3];\n // Check if function is already in the processed list or not.//\n if (sizeof($this->functionData['function']) > 0 ) {\n if (in_array($functionName, $this->functionData['function'])) {\n // If found, then skip the level.//\n continue;\n }\n }\n $errorCodes = $expldVal[2];\n $severityVal = $expldVal[0];\n $errorType = $expldVal[1];\n\n // Do not consider the ignore funtion.//\n if (sizeof($this->ignoreFunctions) > 0 ) {\n if (in_array($functionName, $this->ignoreFunctions)) {\n //Skip the loop.//\n continue;\n }\n }\n\n // Do not consider the Error codes present $this->ignoreCodes.//\n if (sizeof($this->ignoreCodes) > 0 ) {\n if (in_array($errorCodes, $this->ignoreCodes)) {\n //Skip the loop.//\n continue;\n }\n }\n /*\n * If $this->errorCodes is not null, then consider only\n * functions having errorCode matched to passed errorCodes.\n */\n if (sizeof($this->errorCodes) > 0 ) {\n if (!in_array($errorCodes, $this->errorCodes)) {\n //Skip the loop.//\n continue;\n }\n }\n $this->functionData['severity'][] = $severityVal;\n $this->functionData['errorType'][] = $errorType;\n $this->functionData['function'][] = $functionName;\n $this->functionData['errorCodes'][] = $errorCodes;\n }\n\n /*\n * Set the processFlag to 1.\n * Indicates process for sniff array is completed.\n */\n $this->functionData['processFlag'] = 1;\n }", "public function reflectFunctionsIn($sourceCode): ReflectionFunctionCollection;", "public static function toList(): callable {\r\n return function ($key, $val) {\r\n return new ListEntry($val);\r\n };\r\n }", "public function getFunctions()\n {\n return array(\n 'file_exists' => new \\Twig_Function_Function('file_exists'),\n );\n }", "public function getFunctions()\n {\n return array(\n new \\Twig_SimpleFunction('renderPaginator', array(\n $this,\n 'renderPaginator'\n ), array(\n 'is_safe' => array(\n 'html'\n ),\n 'needs_environment' => true\n )),\n new \\Twig_SimpleFunction('renderPaginatorLimit', array(\n $this,\n 'renderPaginatorLimit'\n ), array(\n 'is_safe' => array(\n 'html'\n ),\n 'needs_environment' => true\n ))\n );\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('icon', [$this, 'icon'], ['is_safe' => ['html']])\n ];\n }", "public function getFunctions()\n {\n return [\n 'get_possible_child_types' => new \\Twig_SimpleFunction('get_possible_child_types', function ($ref) {\n return $this->pagesConfiguration->getPossibleChildTypes($ref);\n })\n ];\n }", "public function getFunctions()\n {\n return array(\n 'page' => new Twig_Function_Method($this, 'page'),\n );\n }", "public function getFunctions()\n {\n return array(\n new \\Twig_SimpleFunction('dashboard_count_block_render', array($this, 'dashboardRender'), array(\n 'is_safe' => array('html'),\n 'needs_environment' => true\n )),\n new \\Twig_SimpleFunction('dashboard_message_block_render', array($this, 'dashboardMessageRender'), array(\n 'is_safe' => array('html'),\n 'needs_environment' => true\n )),\n );\n \n }", "public function getFunctions()\n {\n return [\n 'miliooo_friends_is_following' => new \\Twig_Function_Method($this, 'isFollowing')\n ];\n }", "public function getFunctions(): array\n {\n return [\n new \\Twig_SimpleFunction('path', [$this, 'pathFor']),\n ];\n }", "public function getFunctions()\n {\n return array(\n 'page_url' => new \\Twig_Function_Method($this, 'url'),\n );\n }", "public function getFunctions ()\n\t\t{\n\t\t\treturn [\n\t\t\t\tnew Twig_SimpleFunction('datatable_columns', [$this, 'datatableColumns'], ['is_safe' => ['html','json','javascript','js']])\n\t\t\t];\n\t\t}", "protected function buildCallbacks()\r\n {\r\n $rval = array();\r\n foreach ($this->getCallbacks() as $callback)\r\n {\r\n if (isset($this->options[$callback]))\r\n {\r\n $name = 'on'.ucfirst($callback);\r\n $code = $this->options[$callback];\r\n $rval[$name] = 'function() {'.$code.'}';\r\n }\r\n }\r\n \r\n if (isset($this->options['beforeBegin']))\r\n {\r\n $code = $this->options['beforeBegin'];\r\n $rval['beforeBegin'] = \"function() { $code }\";\r\n }\r\n \r\n if (isset($this->options['easing']))\r\n {\r\n $code = $this->options['easing'];\r\n $rval['easing'] = \"function(n) { $code }\";\r\n }\r\n \r\n return $rval;\r\n }", "public function getFunctions()\n {\n return array(\n 'logincidadao_initializeForm' => new \\Twig_Function_Method($this, 'initializeForm', array(\n 'is_safe' => array(\n 'html'\n )\n ))\n );\n }", "public function method($f) {\n\t\t$a = func_get_args();\n\t\tarray_shift($a); // remove first element: $f\n\t\tforeach($this->list as &$item) {\n\t\t\t// by-reference to allow manipulation\n\t\t\t// $list->item->$f($a[0], $a[1], ...)\n\t\t\tcall_user_func_array(array($item, $f), $a);\n\t\t}\n\t\t// return new array\n\t\treturn $this->list;\n\t}", "public function getFunctions() {\r\n\t\t\r\n\t\treturn array(\r\n\t\t\t'geoDistance' => new \\Twig_Function_Method($this, 'geoDistance'),\r\n\t\t);\r\n\t\t\r\n\t}", "public function getGroupFuncs()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->groupFuncs;\n\t}", "public function getFunctions()\n {\n return array(\n 'snide_travinizer_github_url' => new \\Twig_Function_Method(\n $this,\n 'getUrl',\n array('is_safe'=> array('html'))\n ),\n 'snide_travinizer_github_commit_url' => new \\Twig_Function_Method(\n $this,\n 'getCommitUrl',\n array('is_safe'=> array('html'))\n )\n );\n }", "static function getmethods() {\n $a_methods = call_user_func(array('PluginFusioninventoryStaticmisc', 'task_methods'));\n $a_modules = PluginFusioninventoryModule::getAll();\n foreach ($a_modules as $data) {\n if (is_callable(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods'))) {\n $a_methods = array_merge($a_methods, \n call_user_func(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods')));\n }\n }\n return $a_methods;\n }", "public function getFunctions()\n {\n return array(\n 'flob_foundation_breadcrumb_render' => new \\Twig_Function_Method($this, 'renderBreadcrumb', array('is_safe' => array('html')))\n );\n }", "public function register() {\n return array(\n T_FUNCTION,\n );\n }", "public function getFunctions()\n {\n return array(\n 'simplethings_formextra_validation' => new \\Twig_Function_Method($this, 'getValidationConstraints', array('is_safe' => array('html'))),\n );\n }", "public function getFunctions() {\n return $this->wsdlFunctions;\n }", "public function getFunctions()\n {\n return array(\n 'oro_get_owner_type' => new \\Twig_Function_Method(\n $this,\n 'getOwnerType'\n )\n );\n }", "abstract protected function registerFunctions();", "protected function getAddBeforeFunction()\n {\n \n }", "public function getFunctions()\n\t{\n\t\treturn array(\n\t\t\tnew Twig_SimpleFunction('field_list_value', array($this, 'fieldListValue')),\n\t\t\tnew Twig_SimpleFunction('get_flash', 'Session::get_flash'),\n\t\t\tnew Twig_SimpleFunction('get_link', 'CMF::getLink'),\n new Twig_SimpleFunction('get_type', 'CMF::getType'),\n new Twig_SimpleFunction('get_slug', 'CMF::getSlug'),\n\t\t\tnew Twig_SimpleFunction('video_embed', 'CMF\\\\Field\\\\Object\\\\VideoEmbed::getEmbedCode'),\n\t\t\tnew Twig_SimpleFunction('get_route', 'Router::get'),\n\t\t\tnew Twig_SimpleFunction('get_setting', array($this, 'settings')),\n\t\t\tnew Twig_SimpleFunction('static_url', 'CMF::getStaticUrl'),\n\t\t\tnew Twig_SimpleFunction('pluralize', 'Inflector::pluralize'),\n\t\t\tnew Twig_SimpleFunction('singularize', 'Inflector::singularize'),\n\t\t\tnew Twig_SimpleFunction('ordinalize', 'Inflector::ordinalize'),\n\t\t\tnew Twig_SimpleFunction('str_repeat', 'str_repeat'),\n\t\t\tnew Twig_SimpleFunction('array_to_attr', 'array_to_attr'),\n\t\t\tnew Twig_SimpleFunction('phpinfo', 'phpinfo'),\n\t\t\tnew Twig_SimpleFunction('basename', 'basename'),\n\t\t\tnew Twig_SimpleFunction('uri', array($this, 'uri')),\n\t\t\tnew Twig_SimpleFunction('base', array($this, 'base')),\n\t\t\tnew Twig_SimpleFunction('image', 'CMF\\\\Image::getUrl'),\n\t\t\tnew Twig_SimpleFunction('crop_url', 'CMF\\\\Image::getUrl'),\n\t\t\tnew Twig_SimpleFunction('asset', 'CMF::asset'),\n\t\t\tnew Twig_SimpleFunction('link' , 'CMF::link'),\n\t\t\tnew Twig_SimpleFunction('lang_enabled', 'CMF::langEnabled'),\n\t\t\tnew Twig_SimpleFunction('language', 'CMF::lang'),\n\t\t\tnew Twig_SimpleFunction('default_language', 'CMF::defaultLang'),\n\t\t\tnew Twig_SimpleFunction('languages', 'CMF::languages'),\n\t\t\tnew Twig_SimpleFunction('languageUrls', 'CMF::languageUrls'),\n\t\t\tnew Twig_SimpleFunction('all_languages', 'Admin::languages'),\n\t\t\tnew Twig_SimpleFunction('_', 'Lang::get'),\n\t\t\tnew Twig_SimpleFunction('session_set', 'Session::set'),\n\t\t\tnew Twig_SimpleFunction('session_get', 'Session::get'),\n\t\t\tnew Twig_SimpleFunction('get_content', 'file_get_contents'),\n\t\t\tnew Twig_SimpleFunction('module_url', 'CMF::moduleUrl'),\n\t\t\tnew Twig_SimpleFunction('current_module', 'CMF::currentModule'),\n\t\t\tnew Twig_SimpleFunction('get_options', 'CMF::getOptions'),\n\t\t\tnew Twig_SimpleFunction('get_options_select', array($this, 'getOptionsSelect')),\n\t\t\tnew Twig_SimpleFunction('get_hostname', array($this, 'getHostname')),\n\t\t\tnew Twig_SimpleFunction('array_as_hidden_inputs', 'CMF::arrayAsHiddenInputs'),\n new Twig_SimpleFunction('get_class', 'get_class'),\n new Twig_SimpleFunction('is_subclass_of', 'is_subclass_of'),\n new Twig_SimpleFunction('admin_url', 'CMF::adminUrl'),\n new Twig_SimpleFunction('admin_path', 'CMF::adminPath')\n\t\t);\n\t}", "public function getFunctions(): array {\n\n return [\n new TwigFunction(\"adminBSBButtonDanger\", [$this, \"adminBSBButtonDangerFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonDefault\", [$this, \"adminBSBButtonDefaultFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonInfo\", [$this, \"adminBSBButtonInfoFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonMaterialDesign\", [$this, \"adminBSBButtonMaterialDesignFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonPrimary\", [$this, \"adminBSBButtonPrimaryFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonSuccess\", [$this, \"adminBSBButtonSuccessFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonWarning\", [$this, \"adminBSBButtonWarningFunction\"], [\"is_safe\" => [\"html\"]]),\n ];\n }", "protected function getAddAfterFunction()\n {\n \n }", "public static function get_dynamic_functions() {\n return apply_filters(\n 'super_common_js_dynamic_functions_filter', \n array(\n // @since 1.0.0\n 'before_validating_form_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_post_url_tags' ),\n ),\n 'after_validating_form_hook' => array(),\n\n 'after_initializing_forms_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_html_tags' ),\n array( 'name' => 'init_replace_post_url_tags' )\n ),\n 'after_field_change_blur_hook' => array(\n array( 'name' => 'init_replace_datepicker_default_value_tags' ),\n array( 'name' => 'conditional_logic' ),\n array( 'name' => 'calculate_distance' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'init_replace_post_url_tags' )\n ),\n\n // @since 1.2.8\n 'after_email_send_hook' => array(),\n\n // @since 1.3\n 'after_responsive_form_hook' => array(),\n 'after_form_data_collected_hook' => array(),\n 'after_duplicate_column_fields_hook' => array(),\n \n // @since 1.9\n 'before_submit_button_click_hook' => array(),\n 'after_preview_loaded_hook' => array(),\n\n // @since 2.0.0\n 'after_form_cleared_hook' => array(),\n \n // @since 2.1.0\n 'before_scrolling_to_error_hook' => array(),\n 'before_scrolling_to_message_hook' => array(),\n \n // @since 2.4.0\n 'after_duplicating_column_hook' => array(),\n\n // @since 3.3.0\n 'after_appending_duplicated_column_hook' => array(),\n\n // @since 4.7.0\n 'before_submit_hook' => array(),\n\n // @since 4.9.0\n 'after_init_common_fields' => array(\n array( 'name' => 'init_distance_calculators' ),\n array( 'name' => 'init_color_pickers' ),\n array( 'name' => 'init_carouseljs' ),\n array( 'name' => 'init_tooltips' ),\n array( 'name' => 'init_datepicker' ),\n array( 'name' => 'init_adaptive_placeholder' ),\n array( 'name' => 'init_masked_input' ),\n array( 'name' => 'init_currency_input' ),\n array( 'name' => 'init_colorpicker' ),\n array( 'name' => 'init_slider_field' ),\n array( 'name' => 'init_button_colors' ),\n array( 'name' => 'init_text_editors' ),\n array( 'name' => 'init_fileupload_fields' ),\n array( 'name' => 'init_international_phonenumber_fields' ),\n array( 'name' => 'google_maps_init' ),\n array( 'name' => 'set_keyword_tags_width' ),\n array( 'name' => 'rating' ),\n array( 'name' => 'init_signature' ) // This should actually be called by the signature element, but it has been like this since the start.\n ),\n )\n );\n }", "public function register()\n {\n return array(\n T_FUNCTION,\n );\n }", "public function register()\n {\n return array(\n T_FUNCTION,\n );\n\n }", "public function getFunctions() {\n return array(\n new \\Twig_SimpleFunction('gchart_area_chart', array($this, 'gchartAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_bar_chart', array($this, 'gchartBarChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_bubble_chart', array($this, 'gchartBubbleChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_calendar', array($this, 'gchartCalendar'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_candlestick_chart', array($this, 'gchartCandleStickChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_column_chart', array($this, 'gchartColumnChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_combo_chart', array($this, 'gchartComboChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_donut_chart', array($this, 'gchartDonutChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_gantt', array($this, 'gchartGantt'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_gauge', array($this, 'gchartGauge'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_geo_chart', array($this, 'gchartGeoChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_get_icon_pin_url', array($this, 'getIconPinUrl'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('gchart_get_icon_url', array($this, 'getIconUrl'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('gchart_get_letter_pin_url', array($this, 'getLetterPinUrl'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('gchart_get_pie_chart_url', array($this, 'getPieChartUrl'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('gchart_get_pie_chart3d_url', array($this, 'getPieChart3DUrl'), array('is_safe' => array('html'))),\n new \\Twig_SimpleFunction('gchart_get_qrcode_url', array($this, 'getQrCodeUrl')),\n new \\Twig_SimpleFunction('gchart_histogram', array($this, 'gchartHistogram'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_interval', array($this, 'gchartInterval'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_line_chart', array($this, 'gchartLineChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_map', array($this, 'gchartMap'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_org_chart', array($this, 'gchartOrgChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_pie_chart', array($this, 'gchartPieChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_sankey', array($this, 'gchartSankey'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_scatter_chart', array($this, 'gchartScatterChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_stepped_area_chart', array($this, 'gchartSteppedAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_table', array($this, 'gchartTable'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_timeline', array($this, 'gchartTimeline'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_treemap', array($this, 'gchartTreeMap'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_trendlines', array($this, 'gchartTrendlines'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_waterfall', array($this, 'gchartWaterfall'), array('is_safe' => array('html'), 'needs_environment' => true)),\n new \\Twig_SimpleFunction('gchart_word_tree', array($this, 'gchartWordTree'), array('is_safe' => array('html'), 'needs_environment' => true)),\n );\n }", "public function getFunctions()\n {\n return array(\n 'renderInfo' => new \\Twig_Function_Method($this, 'renderInfo', array(\"is_safe\" => array(\"html\"))),\n );\n }", "static public function __hx__list () {\n\t\treturn [\n\t\t\t0 => 'AddColumn',\n\t\t\t1 => 'AddKey',\n\t\t\t2 => 'AlterColumn',\n\t\t\t3 => 'DropColumn',\n\t\t\t4 => 'DropKey',\n\t\t];\n\t}", "public function addFunction($function)\n {\n $this->functions[] = $function;\n }", "private function initFunctions() {\n $this->wsdlFunctions = array();\n foreach ($this->src->getElementsByTagName(\"function\") as $entity) {\n $wsdlFunction = $this->factory->createFunction($entity);\n $this->wsdlFunctions[$wsdlFunction->getRawName()] = $wsdlFunction;\n }\n return $this;\n }", "function _registerFunctions($functions) {\n if (is_array($functions)) {\n foreach ($functions as $function) {\n if (isset($function[2])) {\n \t _registerFunction($function[0], $function[1], $function[2]);\n } else {\n _registerFunction($function[0], $function[1]);\n }\n }\n }\n}", "public function applyFunction(string $functionName, ...$args): ICollection;" ]
[ "0.67827487", "0.67122453", "0.6573546", "0.65012515", "0.63629913", "0.6340914", "0.6255122", "0.6201298", "0.617127", "0.615298", "0.6129031", "0.6116953", "0.6109381", "0.60917217", "0.60755455", "0.6059028", "0.6025216", "0.60183895", "0.60178745", "0.60003287", "0.5999377", "0.5994753", "0.5992609", "0.5976735", "0.5949237", "0.5900821", "0.5900317", "0.5856526", "0.5842042", "0.58365697", "0.5831967", "0.58253413", "0.58248645", "0.5821245", "0.58196044", "0.5807437", "0.5806949", "0.57921374", "0.57803994", "0.5770841", "0.5766962", "0.5766297", "0.5757403", "0.57114375", "0.57056195", "0.57051915", "0.56653976", "0.56517005", "0.5648832", "0.5636201", "0.563431", "0.5624257", "0.5623079", "0.5605778", "0.5600983", "0.55871457", "0.5586153", "0.55743176", "0.55703205", "0.55504394", "0.5547398", "0.5546447", "0.5539714", "0.5513055", "0.5511632", "0.55095327", "0.55048406", "0.5500202", "0.5495762", "0.54953367", "0.54951257", "0.5469371", "0.5449631", "0.5445078", "0.5444337", "0.54399353", "0.5436732", "0.54245245", "0.5423858", "0.54175436", "0.5411636", "0.540794", "0.53982747", "0.53967154", "0.5387529", "0.5375412", "0.5374894", "0.5359929", "0.53528893", "0.53469014", "0.53422105", "0.53350234", "0.52917266", "0.5283924", "0.52734613", "0.52711123", "0.5259403", "0.52582735", "0.5256609", "0.5255732" ]
0.61696684
9
Returns a list of filters to add to the existing list.
public function getFilters() { return [ new \Twig_SimpleFilter('country', [$this, 'getCountry']), new \Twig_SimpleFilter('language', [$this, 'getLanguage']), new \Twig_SimpleFilter('locale_date', [$this, 'getLocaleDate']), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilters ()\n {\n $filters = [];\n\n return $filters;\n }", "protected function filters(): array\n {\n return $this->filters;\n }", "public function getFilters()\n {\n $filters = [];\n\n return $filters;\n }", "public function getFilters();", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getFilters()\n {\n return array();\n }", "abstract protected function getFilters();", "public function getFilters(): FilterCollection;", "public function getFilters()\n {\n if (null === $this->filters) {\n $this->filters = array();\n foreach ($this->getExtensions() as $extension) {\n $this->filters = array_merge($this->filters, $extension->getFilters());\n }\n }\n\n return $this->filters;\n }", "public function getFilters(): array\n {\n return $this->filters;\n }", "public function & GetFilters () {\n\t\t$filters = [];\n\t\tforeach ($this->filters as $direction => $handler) \n\t\t\t$filters[$direction] = $handler[1];\n\t\treturn $filters;\n\t}", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "protected function get_filters() {\n $langautoass = get_string('auto_assign', 'local_elisprogram');\n $filters = array(\n new deepsight_filter_usersetuser_autoassigned($this->DB, 'autoass', $langautoass, array(), $this->endpoint)\n );\n $filters = array_merge(parent::get_filters(), $filters);\n return $filters;\n }", "public function getFilters()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->filters;\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\LicenceType(),\n new Filter\\LicenceStatus(),\n new Filter\\LicenceTrafficArea(),\n new Filter\\EntityType(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\AddressType(),\n new Filter\\AddressComplaint(),\n new Filter\\AddressOpposition(),\n new Filter\\LicenceStatus(),\n new Filter\\ApplicationStatus(),\n new Filter\\AddressConditionUndertaking(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "public function getFilters()\n {\n return array_merge(parent::getFilters(), array(\n 'date' => new \\Twig_Filter_Function('ionic_date'),\n 'relativedate' => new \\Twig_Filter_Function('ionic_date_rel'),\n 'specialdate' => new \\Twig_Filter_Function('ionic_date_special'),\n 'url' => new \\Twig_Filter_Function('url'),\n 'nl2br_noescape' => new \\Twig_Filter_Function('nl2br'),\n 'limit' => new \\Twig_Filter_Function('Str::limit'),\n 'md5' => new \\Twig_Filter_Function('md5'),\n 'addslashes' => new \\Twig_Filter_Function('addslashes')\n ));\n }", "public function getAllFilters()\n {\n $filters = [];\n\n foreach ($this->filters as $filter) {\n $filters = array_merge($filters, $filter->getAllFilters());\n }\n\n return $filters;\n }", "public function getFilters()\n {\n $filters = [];\n\n $filters[] = new \\Twig_Filter('date_format', [$this, 'filterDateFormat']);\n $filters[] = new \\Twig_Filter('truncate', 'b_truncate');\n $filters[] = new \\Twig_Filter('nl2p', 'b_nl2p', ['is_safe' => ['html']]);\n $filters[] = new \\Twig_Filter('human_file_size', 'b_human_file_size');\n $filters[] = new \\Twig_Filter('json_decode', 'json_decode');\n\n return $filters;\n }", "public function getFilters()\n {\n return [\n new TwigFilter('dump', 'dump'),\n new TwigFilter('dd', 'dd'),\n ];\n }", "public function getFilters()\n {\n $filters = array();\n foreach ($this->_filters as $key => $filter) {\n if (!$filter instanceof Zend_Filter_Interface) {\n $filter = $this->_filters[$key] = $this->_loadFilter($filter);\n }\n $filters[] = $filter;\n }\n return $filters;\n }", "public function getFilters() : array\n {\n return $this->getLoader()->getFilters();\n }", "public function provideFilters() {\n return [\n 'filter ID mapped to plugin that exists' => [\n 'foo',\n 'filter_html',\n ],\n 'filter ID not mapped but unchanged from the source and the plugin exists' => [\n 'filter_html',\n 'filter_html',\n ],\n 'filter ID mapped to plugin that does not exist' => [\n 'baz',\n 'filter_null',\n 'php_code',\n ],\n 'filter ID not mapped but unchanged from the source and the plugin does not exist' => [\n 'php_code',\n 'filter_null',\n 'php_code',\n ],\n 'filter ID set and the plugin does not exist' => [\n ['filter', 1],\n 'filter_null',\n 'filter:1',\n ],\n 'transformation-only D7 contrib filter' => [\n 'editor_align',\n '',\n NULL,\n TRUE,\n ],\n 'non-transformation-only D7 contrib filter' => [\n 'bbcode',\n 'filter_null',\n ],\n ];\n }", "public function getAllFilters();", "public function getFilters()\n {\n return [\n new \\Twig_SimpleFilter('getBarMsgs', [$this, 'getRedisMsgs']),\n new \\Twig_SimpleFilter('json_decode', [$this, 'jsonDecode']),\n new \\Twig_SimpleFilter('routeExists', [$this, 'routeExists'])\n ];\n }", "public function getFilters(): array;", "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 }", "public function getFilters(): array\n {\n return [];\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 }", "private function getFilterList(): array\n {\n if ($this->filterList === null) {\n $filterListList = [];\n foreach (glob(__DIR__ . '/../../_files/state-filter-list*.php') as $filterListFile) {\n $filterListList[] = include($filterListFile);\n }\n $this->filterList = array_merge_recursive(...$filterListList);\n }\n return $this->filterList;\n }", "public function filters()\n {\n $filters = [];\n $filters['name'] = ['trim', 'empty_string_to_null', 'capitalize'];\n $filters['email'] = ['trim', 'empty_string_to_null', 'lowercase'];\n return $filters;\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\tnew Twig_SimpleFilter('trans', '__'),\n\t\t\tnew Twig_SimpleFilter('c', '__c'),\n\t\t\tnew Twig_SimpleFilter('d', '__d'),\n\t\t\tnew Twig_SimpleFilter('dc', '__dc'),\n\t\t\tnew Twig_SimpleFilter('n', '__n')\n\t\t);\n\t}", "public function getFilters()\n {\n $filters = array(\n new Twig_SimpleFilter('age', 'twig_age_filter'),\n );\n\n return $filters;\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\r\n {\r\n return $this->filters;\r\n }", "public function filters(): array\n {\n return [\n WhereIdIn::make($this),\n WhereIn::make('namespace')->delimiter(','),\n WhereIn::make('slug'),\n ];\n }", "public function getFilters()\n {\n if (null === $this->filters) {\n $this->filters = new Collection();\n }\n return $this->filters;\n }", "public function getFilters() \n {\n return $this->filters;\n }", "public function getFilters() \r\n\t{\r\n\t\treturn $this->_filters;\r\n\t}", "public function getFilters()\n\t{\n\t\treturn array(\n\t\t\tnew \\Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),\n\t\t\t// @deprecated 3.2.0 Uses twig's JS escape method instead of addslashes\n\t\t\tnew \\Twig_SimpleFilter('addslashes', 'addslashes'),\n\t\t);\n\t}", "public function getFilters(): array\n {\n return $this->request->only($this->filters);\n }", "public function getFilters(): array\n {\n return [\n new \\Twig_SimpleFilter('extract', [$this, 'extract']),\n ];\n }", "public static function alm_get_all_filters(){\n global $wpdb;\n \t$prefix = esc_sql( ALM_FILTERS_PREFIX );\n \t$options = $wpdb->options;\n \t$t = esc_sql( \"$prefix%\" );\n \t$sql = $wpdb -> prepare ( \"SELECT option_name FROM $options WHERE option_name LIKE '%s'\", $t );\n \t$filters = $wpdb -> get_col( $sql );\n\n \t$filters = ALMFilters::alm_remove_filter_license_options($filters);\n\n \treturn $filters;\n }", "public function get_filters_list($with_choices = false) {\n\t\tif (empty(self::$sl_filter_options)) {\n\t\t\tself::$sl_filter_options = PL_Shortcode_CPT::get_listing_filters(false, $with_choices);\n\t\t}\n\t\treturn self::$sl_filter_options;\n\t}", "function add_filters()\n {\n }", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "function xh_listFilters()\r\n\t{\r\n\t}", "public function addFilters()\n {\n }", "public function getFilters()\n {\n return array_filter($this->request->only($this->filters));\n }", "public function getFilters() {\n $filters = [];\n\n // Add a default filter on the publishing status field, if available.\n if ($this->entityType && is_subclass_of($this->entityType->getClass(), EntityPublishedInterface::class)) {\n $field_name = $this->entityType->getKey('published');\n $this->filters = [\n $field_name => [\n 'value' => TRUE,\n 'table' => $this->base_table,\n 'field' => $field_name,\n 'plugin_id' => 'boolean',\n 'entity_type' => $this->entityTypeId,\n 'entity_field' => $field_name,\n ],\n ] + $this->filters;\n }\n\n $default = $this->filter_defaults;\n\n foreach ($this->filters as $name => $info) {\n $default['id'] = $name;\n $filters[$name] = $info + $default;\n }\n\n return $filters;\n }", "public function getFilters()\n {\n return [\n 'setting' => new TwigFilter(\n 'setting',\n [$this, 'settingFilter'],\n []\n ),\n ];\n }", "public static function GET_FILTER(): array\n\t{\n\t\treturn self::$filters;\n\t}", "public function getFilters() {\n\n return [\n new TwigFilter('trans_items', [$this, 'translationItems']),\n ];\n }", "public function getFilters()\n {\n return array(\n 'sortable' => new \\Twig_Filter_Method($this, 'sortable', array('is_safe' => array('html'))),\n 'paginate' => new \\Twig_Filter_Method($this, 'paginate', array('is_safe' => array('html')))\n );\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "public function getFilters(): array;", "public function getFilters(): array\n {\n return [\n new TwigFilter('sonata_urlsafeid', [$this, 'getUrlsafeIdentifier']),\n ];\n }", "public function getFilters()\n\t{\n\t\treturn [\n\t\t\tnew \\Twig_SimpleFilter('basename', 'basename'),\n\t\t\tnew \\Twig_SimpleFilter('get_class', 'get_class'),\n\t\t\tnew \\Twig_SimpleFilter('json_decode', 'json_decode'),\n\t\t\tnew \\Twig_SimpleFilter('_', 'echo'),\n\t\t];\n\t}", "public function getActiveFilters()\n {\n \t$ret = $this->getSettingValue('filters', []);\n \treturn (is_array($ret)) ? $ret : [];\n }", "public function filters(): array\n {\n return [\n new DefaultSorted('created_at', 'desc')\n ];\n }", "public function createDefaultListFinderFilters(){\n \n $filters = array();\n \n $filters['id'] = new EqualsFilter('id', 'text', array(\n 'label' => 'ID'\n ));\n \n return $filters;\n \n }", "public function getFilters()\n {\n $filters = array(\n // formatting filters\n new Twig_SimpleFilter('date', 'twig_date_format_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('date_modify', 'twig_date_modify_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('format', 'sprintf'),\n new Twig_SimpleFilter('replace', 'strtr'),\n new Twig_SimpleFilter('number_format', 'twig_number_format_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('abs', 'abs'),\n // encoding\n new Twig_SimpleFilter('url_encode', 'twig_urlencode_filter'),\n new Twig_SimpleFilter('json_encode', 'twig_jsonencode_filter'),\n new Twig_SimpleFilter('convert_encoding', 'twig_convert_encoding'),\n // string filters\n new Twig_SimpleFilter('title', 'twig_title_string_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('capitalize', 'twig_capitalize_string_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('upper', 'strtoupper'),\n new Twig_SimpleFilter('lower', 'strtolower'),\n new Twig_SimpleFilter('striptags', 'strip_tags'),\n new Twig_SimpleFilter('trim', 'trim'),\n new Twig_SimpleFilter('nl2br', 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),\n // array helpers\n new Twig_SimpleFilter('join', 'twig_join_filter'),\n new Twig_SimpleFilter('split', 'twig_split_filter'),\n new Twig_SimpleFilter('sort', 'twig_sort_filter'),\n new Twig_SimpleFilter('merge', 'twig_array_merge'),\n new Twig_SimpleFilter('batch', 'twig_array_batch'),\n // string/array filters\n new Twig_SimpleFilter('reverse', 'twig_reverse_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('length', 'twig_length_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('slice', 'twig_slice', array('needs_environment' => true)),\n new Twig_SimpleFilter('first', 'twig_first', array('needs_environment' => true)),\n new Twig_SimpleFilter('last', 'twig_last', array('needs_environment' => true)),\n // iteration and runtime\n new Twig_SimpleFilter('default', '_twig_default_filter', array('node_class' => 'Twig_Node_Expression_Filter_Default')),\n new Twig_SimpleFilter('keys', 'twig_get_array_keys_filter'),\n // escaping\n new Twig_SimpleFilter('escape', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),\n new Twig_SimpleFilter('e', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),\n );\n if (function_exists('mb_get_info')) {\n $filters[] = new Twig_SimpleFilter('upper', 'twig_upper_filter', array('needs_environment' => true));\n $filters[] = new Twig_SimpleFilter('lower', 'twig_lower_filter', array('needs_environment' => true));\n }\n return $filters;\n }", "public function getFilters()\n {\n return array(\n new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))),\n );\n }", "public function getFilters(): array {\n\n return [\n new TwigFilter(\"adminBSBButtonLink\", [$this, \"bootstrapButtonLinkFilter\"], [\"is_safe\" => [\"html\"]]),\n new TwigFilter(\"adminBSBButtonSubmit\", [$this, \"bootstrapButtonSubmitFilter\"], [\"is_safe\" => [\"html\"]]),\n ];\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\t'size' => new Twig_Filter_Function('Cake_Number_Filters::size'),\n\t\t\t'pct' => new Twig_Filter_Function('Cake_Number_Filters::percentage'),\n\t\t\t'curr' => new Twig_Filter_Function('Cake_Number_Filters::currency'),\n\t\t\t'p' => new Twig_Filter_Function('Cake_Number_Filters::precision'),\n\t\t);\n\t}", "public static function getFilterList()\n {\n return ['onePageFilter'];\n }", "public function getFilters () {\n $filters = array( 'word_limiter' => new Twig_Filter_Function( 'twig_word_limiter_filter', array( 'needs_environment' => true ) ) );\n\n return $filters;\n }", "public function getFilters()\n {\n return array(\n new Twig_SimpleFilter('formatDate', array($this, 'formatDate'), array('rawDate', 'format')),\n new Twig_SimpleFilter('russianPluralForm', array($this, 'russianPluralForm'), array('string', 'count', 'delimiter')),\n );\n }", "public function allowedFilters()\n {\n return [];\n }", "public function GetFilters ();", "public function getFilters()\r\n {\r\n return array(\r\n 'localizeddate' => new Twig_Filter_Function('twig_localized_date_filter', array('needs_environment' => true)),\r\n );\r\n }", "public function getFilters()\r\n {\r\n\r\n return array(new \\Twig_SimpleFilter('montantTva', array($this, 'montantTva')));\r\n }", "public function getFilters (): array\n\t{\n\t\treturn [\n\t\t\t\"itemName\" => \"itemName\"\n\t\t];\n\t}", "public function defineFilters() {\n\t\treturn array(\n 'join' => array(\n 'car' => array(\n 'on' => array(\n '[car].id = [this].car_id'\n )\n )\n ),\n 'where' => array(\n 'id' => array(\n '[this].id = :id'\n )\n ),\n 'orderby' => array(\n 'date' => array(\n '[this].date :dir'\n )\n )\n );\n\t}", "protected function get_initial_filters() {\n $initialfilters = parent::get_initial_filters();\n $initialfilters[] = 'autoass';\n return $initialfilters;\n }", "public function getFilters()\n {\n return $this->getOptions()\n ->joinWith('taxGroup.lang')\n ->joinWith('lang');\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\") {\n\t\t\t$sSavedFilterList = isset($UserProfile) ? $UserProfile->GetSearchFilters(CurrentUserName(), \"fspplistsrch\") : \"\";\n\t\t} else {\n\t\t\t$sSavedFilterList = \"\";\n\t\t}\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tgl->AdvancedSearch->ToJSON(), \",\"); // Field tgl\n\t\t$sFilterList = ew_Concat($sFilterList, $this->no_spp->AdvancedSearch->ToJSON(), \",\"); // Field no_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jns_spp->AdvancedSearch->ToJSON(), \",\"); // Field jns_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kd_mata->AdvancedSearch->ToJSON(), \",\"); // Field kd_mata\n\t\t$sFilterList = ew_Concat($sFilterList, $this->urai->AdvancedSearch->ToJSON(), \",\"); // Field urai\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh->AdvancedSearch->ToJSON(), \",\"); // Field jmlh\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh1->AdvancedSearch->ToJSON(), \",\"); // Field jmlh1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh2->AdvancedSearch->ToJSON(), \",\"); // Field jmlh2\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh3->AdvancedSearch->ToJSON(), \",\"); // Field jmlh3\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh4->AdvancedSearch->ToJSON(), \",\"); // Field jmlh4\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nm_perus->AdvancedSearch->ToJSON(), \",\"); // Field nm_perus\n\t\t$sFilterList = ew_Concat($sFilterList, $this->alamat->AdvancedSearch->ToJSON(), \",\"); // Field alamat\n\t\t$sFilterList = ew_Concat($sFilterList, $this->npwp->AdvancedSearch->ToJSON(), \",\"); // Field npwp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->pimpinan->AdvancedSearch->ToJSON(), \",\"); // Field pimpinan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->bank->AdvancedSearch->ToJSON(), \",\"); // Field bank\n\t\t$sFilterList = ew_Concat($sFilterList, $this->rek->AdvancedSearch->ToJSON(), \",\"); // Field rek\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nospm->AdvancedSearch->ToJSON(), \",\"); // Field nospm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tglspm->AdvancedSearch->ToJSON(), \",\"); // Field tglspm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ppn->AdvancedSearch->ToJSON(), \",\"); // Field ppn\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps21->AdvancedSearch->ToJSON(), \",\"); // Field ps21\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps22->AdvancedSearch->ToJSON(), \",\"); // Field ps22\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps23->AdvancedSearch->ToJSON(), \",\"); // Field ps23\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps4->AdvancedSearch->ToJSON(), \",\"); // Field ps4\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kodespm->AdvancedSearch->ToJSON(), \",\"); // Field kodespm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nambud->AdvancedSearch->ToJSON(), \",\"); // Field nambud\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nppk->AdvancedSearch->ToJSON(), \",\"); // Field nppk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nipppk->AdvancedSearch->ToJSON(), \",\"); // Field nipppk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->prog->AdvancedSearch->ToJSON(), \",\"); // Field prog\n\t\t$sFilterList = ew_Concat($sFilterList, $this->prog1->AdvancedSearch->ToJSON(), \",\"); // Field prog1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->bayar->AdvancedSearch->ToJSON(), \",\"); // Field bayar\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function getFilterables()\n {\n return $this->filterables;\n }", "public function getFilters() {\n\t\tif (!$this->filter) {\n\t\t\t$f = $this->db->getAndFilter();\n\t\t} else {\n\t\t\t$f = $this->filter;\n\t\t}\n\t\tforeach ($this->join as $j) {\n\t\t\t$f->subEq($j[2]->getFilters());\n\t\t}\n\t\treturn $f;\n\t}", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fv_auction_list_adminlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tanggal->AdvancedSearch->ToJson(), \",\"); // Field tanggal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->auc_number->AdvancedSearch->ToJson(), \",\"); // Field auc_number\n\t\t$sFilterList = ew_Concat($sFilterList, $this->start_bid->AdvancedSearch->ToJson(), \",\"); // Field start_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->close_bid->AdvancedSearch->ToJson(), \",\"); // Field close_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lot_number->AdvancedSearch->ToJson(), \",\"); // Field lot_number\n\t\t$sFilterList = ew_Concat($sFilterList, $this->chop->AdvancedSearch->ToJson(), \",\"); // Field chop\n\t\t$sFilterList = ew_Concat($sFilterList, $this->grade->AdvancedSearch->ToJson(), \",\"); // Field grade\n\t\t$sFilterList = ew_Concat($sFilterList, $this->estate->AdvancedSearch->ToJson(), \",\"); // Field estate\n\t\t$sFilterList = ew_Concat($sFilterList, $this->sack->AdvancedSearch->ToJson(), \",\"); // Field sack\n\t\t$sFilterList = ew_Concat($sFilterList, $this->netto->AdvancedSearch->ToJson(), \",\"); // Field netto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->open_bid->AdvancedSearch->ToJson(), \",\"); // Field open_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->last_bid->AdvancedSearch->ToJson(), \",\"); // Field last_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->highest_bid->AdvancedSearch->ToJson(), \",\"); // Field highest_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->enter_bid->AdvancedSearch->ToJson(), \",\"); // Field enter_bid\n\t\t$sFilterList = ew_Concat($sFilterList, $this->auction_status->AdvancedSearch->ToJson(), \",\"); // Field auction_status\n\t\t$sFilterList = ew_Concat($sFilterList, $this->gross->AdvancedSearch->ToJson(), \",\"); // Field gross\n\t\t$sFilterList = ew_Concat($sFilterList, $this->row_id->AdvancedSearch->ToJson(), \",\"); // Field row_id\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "private function filters() {\n\n\n\t}", "public function register_filters() {\n\n\t\t}", "abstract public function filters();", "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 getFilters()\r\n {\r\n return array(\r\n new \\Twig_SimpleFilter('sha1', array($this, 'sha1Filter')),\r\n );\r\n }", "protected function getFilterable()\n {\n return [];\n }", "public function flattenFilters()\n {\n $filters = [];\n foreach ($this->filterdata['filters'] as $filter) {\n if (array_key_exists('filters', $filter)) {\n foreach ($filter['filters'] as $subfilter) {\n $filters[] = $subfilter;\n }\n } else {\n $filters[] = $filter;\n }\n }\n return $filters;\n }", "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 }", "public function getApplicableFilters()\n\t{\n\t\t$filters = App::getEntityRepository('DeskPRO:TicketFilter')->getAll();\n\t\t$filters_apply = array();\n\n\t\t$this->logMessage(\"Filters to check: \" . count($filters));\n\n\t\t$changed_fields = $this->getChangedFields();\n\t\t$new_messages = $this->tracker->getChangedProperty('messages') ? true : false;\n\n\t\t$hidden_changed = false;\n\t\tif (in_array('ticket.hidden_status', $changed_fields)) {\n\t\t\t$hidden_changed = true;\n\t\t}\n\n\t\tforeach ($filters as $filter) {\n\t\t\tif ($new_messages || $hidden_changed || $filter->getSearcher()->hasAnyAffectedFields($changed_fields)) {\n\t\t\t\t$filters_apply[] = $filter;\n\t\t\t}\n\t\t}\n\n\t\t$this->logMessage(\"Passed filters: \" . count($filters_apply));\n\n\t\treturn $filters_apply;\n\t}", "public function getWordpressFilters(): array\n {\n return $this->wordpressFilters;\n }" ]
[ "0.7288725", "0.7239691", "0.7215225", "0.71943426", "0.71684265", "0.712334", "0.70831263", "0.7078608", "0.70732886", "0.70470625", "0.7046991", "0.7045658", "0.7045658", "0.70395565", "0.70335275", "0.7015256", "0.6961713", "0.69372207", "0.6914802", "0.68778676", "0.6875841", "0.6870367", "0.6841371", "0.6839331", "0.6824162", "0.68238825", "0.67771304", "0.6766888", "0.6750276", "0.6750187", "0.6749967", "0.67412174", "0.6727795", "0.672436", "0.66904753", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66724354", "0.66660446", "0.6658717", "0.66451603", "0.6644999", "0.66354775", "0.66237867", "0.6621571", "0.6612342", "0.66092753", "0.66020924", "0.659029", "0.6567384", "0.6560354", "0.6542191", "0.65292436", "0.65256596", "0.65115404", "0.6496781", "0.64956975", "0.64621586", "0.6456207", "0.64449906", "0.6435102", "0.6416791", "0.64065456", "0.63907343", "0.63860834", "0.6375495", "0.6367616", "0.63602644", "0.633637", "0.6332581", "0.63258904", "0.63243806", "0.63194084", "0.6314396", "0.6314335", "0.6306543", "0.6294982", "0.6289227", "0.6281386", "0.6279748", "0.62718624", "0.62658083", "0.62592405", "0.62210137", "0.621827", "0.6213024", "0.62066025", "0.6205357", "0.61773866", "0.6176407", "0.61374927", "0.6130791", "0.61300844", "0.61266273" ]
0.68714684
21
Returns the name of the extension.
public function getName() { return '_locale'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtensionName() {}", "public function getName()\n {\n return self::EXTENSION_NAME;\n }", "abstract public function getExtensionName();", "public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "public function getName(): string\n {\n return 'Extension';\n }", "public function getNameWithExtension() {\n if ( ! $this->exists) return '';\n\n $extension = pathinfo($this->name, PATHINFO_EXTENSION);\n\n if ( ! $extension && $this->extension) {\n return $this->name .'.'. $this->extension;\n }\n\n return $this->name;\n }", "public function getName()\n\t{\n\t\treturn str_replace(\".{$this->getExtension()}\", '', $this->path);\n\t}", "public function getExtensionName()\n {\n return FluentDriver::EXTENSION_NAME;\n }", "public function getExtension(): string\n {\n return $this->getMeta()->getExtension();\n }", "public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension() : string\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "public function getExtensionFromName()\n {\n $vars = explode('.', $this->getClientFilename());\n return strtolower(array_pop($vars));\n }", "public function getName()\n {\n // TODO: Implement getName() method.\n return 'MyTwExtension';\n }", "public function getName($ext = true)\n\t{\n\t\tif (!$ext)\n\t\t\treturn substr($this->name, 0, strrpos($this->name, '.'));\n\t\treturn $this->name;\n\t}", "public function getName()\n {\n return 'metainfos_extension';\n }", "public function name()\n {\n if (!$this->info) {\n $this->info();\n }\n if (isset($this->info['extension'])) {\n return static::_basename($this->name, '.' . $this->info['extension']);\n }\n if ($this->name) {\n return $this->name;\n }\n\n return false;\n }", "public function getName()\n {\n return 'note_extension';\n }", "public function getName()\n {\n return 'jwkh_extension';\n }", "public function getExtension(): string\n {\n return pathinfo($this->getRelativePath(), PATHINFO_EXTENSION);\n }", "function getNameWithoutExtension() ;", "public function getName()\n {\n return 'bvw_upload_extension';\n }", "public function getExtension() : string;", "public function getExtension()\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "public function getExtensionName()\n\t{\n\t\treturn false;\n\t}", "public function getExtensionName()\n\t{\n\t\treturn false;\n\t}", "public function getExtensionName(): string {\r\n return $this->template->getConfigVars('cartpay_plugin');\r\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getName()\n {\n return 'bundle_extension';\n }", "public function getName()\n {\n return 'bundle_extension';\n }", "public function getExtension(): string\n {\n return pathinfo($this->getFilename(), PATHINFO_EXTENSION);\n }", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function getExtension()\n {\n return $this->file->getExtensionName();\n }", "public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}", "public function getOriginalExtension(): string\n {\n return pathinfo($this->originalName, PATHINFO_EXTENSION);\n }", "public function getName()\n {\n return 'tyhand_docdownloader_extension';\n }", "public function getParentExtensionName() {}", "public function extension() : string {\n return $this->file->extension;\n }", "public function extension()\n {\n return '';\n }", "public function get_name() {\n return get_string('pluginname', 'local_assessmentextensions');\n }", "public function getName()\n {\n return 'user_extension';\n }", "function getFileNameWithExtension()\n {\n return $this->fileNameWithExt;\n }", "public function getExtension() {\n\t\treturn CFileHelper::getExtension($this->getName());\n\t}", "public function getNameWithoutExtension() {}", "public function getNameWithoutExtension() {}", "public function getExtension() {}", "public function getExtension() {}", "public function getExtension()\n {\n return $this->_extension;\n }", "public function getName()\n {\n return 'AssetExtension';\n }", "public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }", "function getExtension() ;", "public function get_extension()\n {\n return $this->m_extension;\n }", "public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }", "public function getExtension(string $name);", "public function getName()\n {\n return $this->_path['filename'];\n }", "public function getExtension()\n {\n return $this->_path['extension'];\n }", "public function getExtension($name) {}", "public function getName()\n {\n return 'app_setting_extension';\n }", "public function getExtension() {\n \n return $this->extension;\n \n }", "public function extension(): string;", "public function getName()\n {\n return 'fitbase_questionnaire_extension';\n }", "public function getName()\n {\n return 'h5p_extension';\n }", "public function getExtensionIdentifier();", "public function getName()\r\n {\r\n\r\n // TODO: Implement getName() method.\r\n return 'montant_tva_extention';\r\n }", "public function extension()\n\t{\n\t\t$type = $this->type();\n\t\treturn self::getExtension($type);\n\t}", "public function getName()\n {\n // TODO: Implement getName() method.\n return \"troiswa_back.twig_extension\";\n }", "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 function getExtension()\n {\n \treturn $this->_extension;\n }", "public function getName()\n {\n return 'loyalty_identifier_extension';\n }", "public static function getName()\n\t{\n\t\treturn self::$filename;\n\t}", "public function getName()\n {\n return 'store_backend_extension';\n }", "public function getName()\n {\n return 'siciarek_js_trans_twig_extension';\n }", "public function getControllerExtensionName() {}", "public function getControllerExtensionName() {}", "public function getFileName(): string\n {\n if (strpos($this->savefileName, '.php') === false) {\n return $this->savefileName . $this->extension;\n }\n return $this->savefileName;\n }", "public function getName()\n {\n return $this->file->getName();\n }", "public function extension()\n {\n return pathinfo($this->path_filename, PATHINFO_EXTENSION);\n }", "abstract function getExtension(): string;", "function getName() {\n\t\treturn $this->data_array['filename'];\n\t}", "public function getExtension()\n\t{\n\t\treturn null;\n\t}", "public function getExtension()\n\t{\n\t\treturn null;\n\t}", "public function getExtension()\n {\n return $this->file['extension'];\n }", "public function getName()\n {\n return 'redis_extension';\n }", "public function getDefaultExtension(): string\n {\n return $this->defaultExtension;\n }", "public abstract function getExtension();", "public function getName()\n {\n return $this->file['name'];\n }", "public function get_extension()\n {\n }", "public function getExtension()\r\n {\r\n return pathinfo($this->filename, PATHINFO_EXTENSION);\r\n }", "public function getName()\n {\n return 'szg_feed_twig_extension';\n }", "public static function fromExtension(string $extension):string;", "public function getExtension()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return $this->extension;\r\n }", "public function getFileExtension(): string\n {\n return $this->fileExtension;\n }" ]
[ "0.91565424", "0.8927959", "0.8711921", "0.84661037", "0.83886665", "0.8361621", "0.83368284", "0.82452506", "0.8239709", "0.8229256", "0.81653655", "0.81653655", "0.80174255", "0.79762125", "0.79629993", "0.788117", "0.7860908", "0.7790925", "0.7765071", "0.7755446", "0.772374", "0.7696622", "0.76868373", "0.76820743", "0.7647251", "0.76461846", "0.76461846", "0.7644301", "0.76355803", "0.76355803", "0.76355803", "0.76355803", "0.76355803", "0.76355803", "0.76355803", "0.76128376", "0.76128376", "0.7607402", "0.75987005", "0.75987005", "0.75987005", "0.7584329", "0.7574282", "0.757028", "0.7565251", "0.75611126", "0.75451356", "0.7543287", "0.7542182", "0.7541774", "0.75315845", "0.75244117", "0.7508626", "0.7508482", "0.749837", "0.74981004", "0.7495324", "0.748743", "0.7463212", "0.74503577", "0.7441157", "0.74334216", "0.7432999", "0.7432494", "0.74261826", "0.74215305", "0.7416806", "0.74162215", "0.74020725", "0.7394408", "0.7389057", "0.7377084", "0.7346657", "0.73443776", "0.73395663", "0.7335862", "0.7290852", "0.7273607", "0.7269735", "0.7265738", "0.7201244", "0.7194809", "0.7194809", "0.7179532", "0.71752393", "0.7171331", "0.71488476", "0.71252805", "0.7123378", "0.7123378", "0.7106912", "0.71053255", "0.70936644", "0.70927036", "0.70837873", "0.7077111", "0.70688224", "0.7064809", "0.70622975", "0.7062273", "0.704007" ]
0.0
-1
Returns all active locales with short and long names
public function getActiveLocales($locale = null) { $registeredLocales = $this->registry->getRegisteredLocales(); if (empty($registeredLocales)) { return []; } elseif ($locale === null) { $translatedLocales = $registeredLocales; } else { if (strpos($locale, '_') > 0) { $displayCountryLocales = Intl::getLocaleBundle()->getLocaleNames($locale); $displayLgLocales = Intl::getLocaleBundle()->getLocaleNames(substr($locale, 0, strpos($locale, '_'))); $displayLocales = array_merge($displayLgLocales, $displayCountryLocales); } else { $displayLocales = Intl::getLocaleBundle()->getLocaleNames($locale); } // time to return a translated locale $translatedLocales = array_map( function($element) use($displayLocales, $locale) { if (array_key_exists($element, $displayLocales)) { // perfect, we have the full translated locale return $displayLocales[$element]; } elseif (strpos($element, '_') > 0) { // ow we don't, let's see if it's a locale containing the country list($lg, $country) = explode('_', $element); if (strpos($locale, '_') > 0) { // Yep! it's a full locale. Let's merge the translated countries for the full locale + his parent, the lg $displayCountriesChild = Intl::getRegionBundle()->getCountryNames($locale); $displayCountriesParent = Intl::getRegionBundle()->getCountryNames(substr($locale, 0, strpos($locale, '_'))); $displayCountries = array_merge($displayCountriesParent, $displayCountriesChild); } else { // it's just a lg $displayCountries = Intl::getRegionBundle()->getCountryNames($locale); } if (array_key_exists($country, $displayCountries)) { // ok we do have a country translation, let's manually build the full translation string $displayCountry = $displayCountries[$country]; $displayLg = Intl::getLanguageBundle()->getLanguageName($lg, null, $locale); return $displayLg . ' (' . $displayCountry . ')'; } else { // I give up. I just return the received locale. return $element; } } else { return $element; } }, $registeredLocales ); } return array_combine($registeredLocales, $translatedLocales); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLocales(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('localelist');\n return $this->execute($qb);\n }", "public function get_locales() {\n\t\t$existing_locales = Plugin::get_existing_locales();\n\n\t\t$locales = array();\n\t\tforeach ( $existing_locales as $locale ) {\n\t\t\t$locales[] = GP_Locales::by_slug( $locale );\n\t\t}\n\t\tusort( $locales, array( $this, '_sort_english_name_callback' ) );\n\t\tunset( $existing_locales );\n\n\t\t$contributors_count = Plugin::get_contributors_count();\n\t\t$translation_status = Plugin::get_translation_status();\n\n\t\t$this->tmpl( 'index-locales', get_defined_vars() );\n\t}", "public function getSupportedLocalesKeys();", "public function getAll()\n {\n return $this->getContainer()->getParameter('locales');\n }", "static public function getLocalesList()\r\n {\r\n /**\r\n * TODO It need to remove hard-coded language params and place them to config file for different implementations because\r\n * each implamentation can have different language settings\r\n */\r\n return Zend_Registry::get('cfg_translate_locales_xml');\r\n }", "function getLocales() {\n\t\treturn array_keys($this->localeData);\n\t}", "public function getAllLocales(): array\n {\n Craft::$app->getDeprecator()->log('craft.i18n.getAllLocales()', 'craft.i18n.getAllLocales() has been deprecated. Use craft.app.i18n.allLocales instead.');\n\n return Craft::$app->getI18n()->getAllLocales();\n }", "public function getLocalizedStringsList() {\n return $this->_get(1);\n }", "public function getAvailableLocales()\r\n {\r\n return $this->getLocales($this->getLocalesDirectory());\r\n }", "function lang_options_for_select($blank = true) {\n\t\t$list = array();\n\t\tforeach (glob(APP . 'Locale/*') as $dir) {\n\t\t\t$path = explode('/', $dir);\n\t\t\t$lang = end($path);\n\t\t\tif ($lang == 'default.pot') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list[$lang] = $this->get_lang_label($lang);\n\t\t}\n\t\treturn $list;\n\t}", "protected function getSupportedLocales()\n {\n return Blog::getSupportedLocalesKeys();\n }", "public static function getLocaleList()\n {\n return collect(config('lang-detector.languages'))->map(function ($lang) {\n return [\n 'lang' => $lang,\n 'name' => self::getLocaleName($lang),\n 'name-orig' => self::getLocaleName($lang, $lang),\n ];\n });\n }", "protected function getLocales()\n {\n return Strata::i18n()->getLocales();\n }", "function getLocales() {\n\t\t\treturn $this->locales;\n\t\t}", "public static function get_enabled_locales() {\r\n\t\treturn self::$enabled_locales;\r\n\t}", "public function getLocales()\n {\n return $this->locales;\n }", "public function localeIndex();", "public function getLocales()\n {\n return $this->_locales;\n }", "function locale_codes_dropdown() {\n\n\t$obj_service = new Java('com.googlecode.objectify.ObjectifyService');\n\t$ofy = $obj_service->begin();\n\t$localeclass = java_class('com.fi.twentythings.Locale');\n\tObjectifyService::register($localeclass);\t\n\t\n\t$localeField = 'locale';\n\t\n\t$locales = $ofy->query($localeclass)->list();\n\t\n\tforeach( $locales as $locale ) {\n echo '<p><a href=\"/cmseditlocale?locale='.$locale->getId().'\">'.$locale->getId().'</a></p>'.\"\\n\"; \n }\n \n}", "public function fb_locales() {\n\t\treturn [\n\t\t\t'af_ZA', // Afrikaans\n\t\t\t'ak_GH', // Akan\n\t\t\t'am_ET', // Amharic\n\t\t\t'ar_AR', // Arabic\n\t\t\t'as_IN', // Assamese\n\t\t\t'ay_BO', // Aymara\n\t\t\t'az_AZ', // Azerbaijani\n\t\t\t'be_BY', // Belarusian\n\t\t\t'bg_BG', // Bulgarian\n\t\t\t'bn_IN', // Bengali\n\t\t\t'br_FR', // Breton\n\t\t\t'bs_BA', // Bosnian\n\t\t\t'ca_ES', // Catalan\n\t\t\t'cb_IQ', // Sorani Kurdish\n\t\t\t'ck_US', // Cherokee\n\t\t\t'co_FR', // Corsican\n\t\t\t'cs_CZ', // Czech\n\t\t\t'cx_PH', // Cebuano\n\t\t\t'cy_GB', // Welsh\n\t\t\t'da_DK', // Danish\n\t\t\t'de_DE', // German\n\t\t\t'el_GR', // Greek\n\t\t\t'en_GB', // English (UK)\n\t\t\t'en_IN', // English (India)\n\t\t\t'en_PI', // English (Pirate)\n\t\t\t'en_UD', // English (Upside Down)\n\t\t\t'en_US', // English (US)\n\t\t\t'eo_EO', // Esperanto\n\t\t\t'es_CL', // Spanish (Chile)\n\t\t\t'es_CO', // Spanish (Colombia)\n\t\t\t'es_ES', // Spanish (Spain)\n\t\t\t'es_LA', // Spanish\n\t\t\t'es_MX', // Spanish (Mexico)\n\t\t\t'es_VE', // Spanish (Venezuela)\n\t\t\t'et_EE', // Estonian\n\t\t\t'eu_ES', // Basque\n\t\t\t'fa_IR', // Persian\n\t\t\t'fb_LT', // Leet Speak\n\t\t\t'ff_NG', // Fulah\n\t\t\t'fi_FI', // Finnish\n\t\t\t'fo_FO', // Faroese\n\t\t\t'fr_CA', // French (Canada)\n\t\t\t'fr_FR', // French (France)\n\t\t\t'fy_NL', // Frisian\n\t\t\t'ga_IE', // Irish\n\t\t\t'gl_ES', // Galician\n\t\t\t'gn_PY', // Guarani\n\t\t\t'gu_IN', // Gujarati\n\t\t\t'gx_GR', // Classical Greek\n\t\t\t'ha_NG', // Hausa\n\t\t\t'he_IL', // Hebrew\n\t\t\t'hi_IN', // Hindi\n\t\t\t'hr_HR', // Croatian\n\t\t\t'hu_HU', // Hungarian\n\t\t\t'hy_AM', // Armenian\n\t\t\t'id_ID', // Indonesian\n\t\t\t'ig_NG', // Igbo\n\t\t\t'is_IS', // Icelandic\n\t\t\t'it_IT', // Italian\n\t\t\t'ja_JP', // Japanese\n\t\t\t'ja_KS', // Japanese (Kansai)\n\t\t\t'jv_ID', // Javanese\n\t\t\t'ka_GE', // Georgian\n\t\t\t'kk_KZ', // Kazakh\n\t\t\t'km_KH', // Khmer\n\t\t\t'kn_IN', // Kannada\n\t\t\t'ko_KR', // Korean\n\t\t\t'ku_TR', // Kurdish (Kurmanji)\n\t\t\t'ky_KG', // Kyrgyz\n\t\t\t'la_VA', // Latin\n\t\t\t'lg_UG', // Ganda\n\t\t\t'li_NL', // Limburgish\n\t\t\t'ln_CD', // Lingala\n\t\t\t'lo_LA', // Lao\n\t\t\t'lt_LT', // Lithuanian\n\t\t\t'lv_LV', // Latvian\n\t\t\t'mg_MG', // Malagasy\n\t\t\t'mi_NZ', // Māori\n\t\t\t'mk_MK', // Macedonian\n\t\t\t'ml_IN', // Malayalam\n\t\t\t'mn_MN', // Mongolian\n\t\t\t'mr_IN', // Marathi\n\t\t\t'ms_MY', // Malay\n\t\t\t'mt_MT', // Maltese\n\t\t\t'my_MM', // Burmese\n\t\t\t'nb_NO', // Norwegian (bokmal)\n\t\t\t'nd_ZW', // Ndebele\n\t\t\t'ne_NP', // Nepali\n\t\t\t'nl_BE', // Dutch (België)\n\t\t\t'nl_NL', // Dutch\n\t\t\t'nn_NO', // Norwegian (nynorsk)\n\t\t\t'ny_MW', // Chewa\n\t\t\t'or_IN', // Oriya\n\t\t\t'pa_IN', // Punjabi\n\t\t\t'pl_PL', // Polish\n\t\t\t'ps_AF', // Pashto\n\t\t\t'pt_BR', // Portuguese (Brazil)\n\t\t\t'pt_PT', // Portuguese (Portugal)\n\t\t\t'qu_PE', // Quechua\n\t\t\t'rm_CH', // Romansh\n\t\t\t'ro_RO', // Romanian\n\t\t\t'ru_RU', // Russian\n\t\t\t'rw_RW', // Kinyarwanda\n\t\t\t'sa_IN', // Sanskrit\n\t\t\t'sc_IT', // Sardinian\n\t\t\t'se_NO', // Northern Sámi\n\t\t\t'si_LK', // Sinhala\n\t\t\t'sk_SK', // Slovak\n\t\t\t'sl_SI', // Slovenian\n\t\t\t'sn_ZW', // Shona\n\t\t\t'so_SO', // Somali\n\t\t\t'sq_AL', // Albanian\n\t\t\t'sr_RS', // Serbian\n\t\t\t'sv_SE', // Swedish\n\t\t\t'sy_SY', // Swahili\n\t\t\t'sw_KE', // Syriac\n\t\t\t'sz_PL', // Silesian\n\t\t\t'ta_IN', // Tamil\n\t\t\t'te_IN', // Telugu\n\t\t\t'tg_TJ', // Tajik\n\t\t\t'th_TH', // Thai\n\t\t\t'tk_TM', // Turkmen\n\t\t\t'tl_PH', // Filipino\n\t\t\t'tl_ST', // Klingon\n\t\t\t'tr_TR', // Turkish\n\t\t\t'tt_RU', // Tatar\n\t\t\t'tz_MA', // Tamazight\n\t\t\t'uk_UA', // Ukrainian\n\t\t\t'ur_PK', // Urdu\n\t\t\t'uz_UZ', // Uzbek\n\t\t\t'vi_VN', // Vietnamese\n\t\t\t'wo_SN', // Wolof\n\t\t\t'xh_ZA', // Xhosa\n\t\t\t'yi_DE', // Yiddish\n\t\t\t'yo_NG', // Yoruba\n\t\t\t'zh_CN', // Simplified Chinese (China)\n\t\t\t'zh_HK', // Traditional Chinese (Hong Kong)\n\t\t\t'zh_TW', // Traditional Chinese (Taiwan)\n\t\t\t'zu_ZA', // Zulu\n\t\t\t'zz_TR', // Zazaki\n\t\t];\n\t}", "function get_list_of_locales($locale)\r\n\t{\r\n\t\t/* Figure out all possible locale names and start with the most\r\n\t\t * specific ones. I.e. for sr_CS.UTF-8@latin, look through all of\r\n\t\t * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr.\r\n\t\t */\r\n\t\t$locale_names = array();\r\n\t\t$lang = NULL;\r\n\t\t$country = NULL;\r\n\t\t$charset = NULL;\r\n\t\t$modifier = NULL;\r\n\t\tif ($locale) {\r\n\t\t\tif (preg_match(\"/^(?P<lang>[a-z]{2,3})\" // language code\r\n\t\t\t\t. \"(?:_(?P<country>[A-Z]{2}))?\" // country code\r\n\t\t\t\t. \"(?:\\.(?P<charset>[-A-Za-z0-9_]+))?\" // charset\r\n\t\t\t\t. \"(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/\", // @ modifier\r\n\t\t\t\t$locale, $matches)) {\r\n\t\t\t\tif (isset($matches[\"lang\"]))\r\n\t\t\t\t\t$lang = $matches[\"lang\"];\r\n\t\t\t\tif (isset($matches[\"country\"]))\r\n\t\t\t\t\t$country = $matches[\"country\"];\r\n\t\t\t\tif (isset($matches[\"charset\"]))\r\n\t\t\t\t\t$charset = $matches[\"charset\"];\r\n\t\t\t\tif (isset($matches[\"modifier\"]))\r\n\t\t\t\t\t$modifier = $matches[\"modifier\"];\r\n\t\t\t\t\r\n\t\t\t\tif ($modifier) {\r\n\t\t\t\t\tif ($country) {\r\n\t\t\t\t\t\tif ($charset)\r\n\t\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country.$charset@$modifier\");\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country@$modifier\");\r\n\t\t\t\t\t} elseif ($charset)\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}.$charset@$modifier\");\r\n\t\t\t\t\tarray_push($locale_names, \"$lang@$modifier\");\r\n\t\t\t\t}\r\n\t\t\t\tif ($country) {\r\n\t\t\t\t\tif ($charset)\r\n\t\t\t\t\t\tarray_push($locale_names, \"${lang}_$country.$charset\");\r\n\t\t\t\t\tarray_push($locale_names, \"${lang}_$country\");\r\n\t\t\t\t} elseif ($charset)\r\n\t\t\t\t\tarray_push($locale_names, \"${lang}.$charset\");\r\n\t\t\t\tarray_push($locale_names, $lang);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If the locale name doesn't match POSIX style, just include it as-is.\r\n\t\t\tif (!in_array($locale, $locale_names))\r\n\t\t\t\tarray_push($locale_names, $locale);\r\n\t\t}\r\n\t\treturn $locale_names;\r\n\t}", "function getLocalizedOptions() {\n\t\treturn array();\n\t}", "public function getAllDomainsByLocale();", "public function getAvailableLocales()\n {\n return $this->config->get('locale.available_locales');\n }", "function supportedLocaleKeys(): array\n {\n return config('localized-routes.supported-locales');\n }", "protected function getAllAvailableLanguageOptions() {}", "function getLocaleFieldNames() {\n\t\treturn array('subscriptionAdditionalInformation', 'delayedOpenAccessPolicy', 'authorSelfArchivePolicy');\n\t}", "public function getMultilingual();", "protected function getLocales()\n {\n return \\localizer\\locales()->reduce(function ($ids, $locale) {\n $ids[] = $locale->id();\n\n return $ids;\n }, []);\n }", "public function getLanguageList();", "public function getAvailableLocales(): array\n {\n return $this->availableLocales;\n }", "public function locale();", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function all(): Collection\n {\n return $this->localeCollection;\n }", "function issuu_get_languages() {\n $predefined = _locale_get_predefined_list();\n foreach ($predefined as $key => $value) {\n // Issuu doesn't support variants (for example pt-br), so skip those.\n if (strlen($key) != 2) {\n unset($predefined[$key]);\n continue;\n }\n // Include native name in output, if possible\n if (count($value) > 1) {\n $tname = t($value[0]);\n $predefined[$key] = ($tname == $value[1]) ? $tname : \"$tname ($value[1])\";\n }\n else {\n $predefined[$key] = t($value[0]);\n }\n }\n asort($predefined);\n return $predefined;\n}", "private function getAllLangs()\n\t{\n\t\t$options = array();\n\t\t$sql = \"SELECT * FROM \" . $this->db->prefix . \"site_languages WHERE is_online = 1\";\n\t\t$result = $this->db->query($sql);\n\t\t$available_languages = array();\n\t\twhile($row = $this->db->fetchToRow($result)){\n\t\t\t$available_languages[] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'lang' ] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'language' ] = ucfirst($row[ 'language' ]);\n\t\t}\n\t\t$this->language_options = $options;\n\n\t\treturn $available_languages;\n\t}", "protected function get_date_locales() {\n\n\t\treturn array(\n\t\t\t'af',\n\t\t\t'ar-dz',\n\t\t\t'ar-kw',\n\t\t\t'ar-ly',\n\t\t\t'ar-ma',\n\t\t\t'ar-sa',\n\t\t\t'ar-tn',\n\t\t\t'ar',\n\t\t\t'az',\n\t\t\t'be',\n\t\t\t'bg',\n\t\t\t'bm',\n\t\t\t'bn',\n\t\t\t'bo',\n\t\t\t'br',\n\t\t\t'bs',\n\t\t\t'ca',\n\t\t\t'cs',\n\t\t\t'cv',\n\t\t\t'cy',\n\t\t\t'da',\n\t\t\t'de-at',\n\t\t\t'de-ch',\n\t\t\t'de',\n\t\t\t'dv',\n\t\t\t'el',\n\t\t\t'en-au',\n\t\t\t'en-ca',\n\t\t\t'en-gb',\n\t\t\t'en-ie',\n\t\t\t'en-il',\n\t\t\t'en-nz',\n\t\t\t'eo',\n\t\t\t'es-do',\n\t\t\t'es-us',\n\t\t\t'es',\n\t\t\t'et',\n\t\t\t'eu',\n\t\t\t'fa',\n\t\t\t'fi',\n\t\t\t'fo',\n\t\t\t'fr-ca',\n\t\t\t'fr-ch',\n\t\t\t'fr',\n\t\t\t'fy',\n\t\t\t'gd',\n\t\t\t'gl',\n\t\t\t'gom-latn',\n\t\t\t'gu',\n\t\t\t'he',\n\t\t\t'hi',\n\t\t\t'hr',\n\t\t\t'hu',\n\t\t\t'hy-am',\n\t\t\t'id',\n\t\t\t'is',\n\t\t\t'it',\n\t\t\t'ja',\n\t\t\t'jv',\n\t\t\t'ka',\n\t\t\t'kk',\n\t\t\t'km',\n\t\t\t'kn',\n\t\t\t'ko',\n\t\t\t'ku',\n\t\t\t'ky',\n\t\t\t'lb',\n\t\t\t'lo',\n\t\t\t'lt',\n\t\t\t'lv',\n\t\t\t'me',\n\t\t\t'mi',\n\t\t\t'mk',\n\t\t\t'ml',\n\t\t\t'mn',\n\t\t\t'mr',\n\t\t\t'ms-my',\n\t\t\t'ms',\n\t\t\t'mt',\n\t\t\t'my',\n\t\t\t'nb',\n\t\t\t'ne',\n\t\t\t'nl-be',\n\t\t\t'nl',\n\t\t\t'nn',\n\t\t\t'pa-in',\n\t\t\t'pl',\n\t\t\t'pt-br',\n\t\t\t'pt',\n\t\t\t'ro',\n\t\t\t'ru',\n\t\t\t'sd',\n\t\t\t'se',\n\t\t\t'si',\n\t\t\t'sk',\n\t\t\t'sl',\n\t\t\t'sq',\n\t\t\t'sr-cyrl',\n\t\t\t'sr',\n\t\t\t'ss',\n\t\t\t'sv',\n\t\t\t'sw',\n\t\t\t'ta',\n\t\t\t'te',\n\t\t\t'tet',\n\t\t\t'tg',\n\t\t\t'th',\n\t\t\t'tl-ph',\n\t\t\t'tlh',\n\t\t\t'tr',\n\t\t\t'tzl',\n\t\t\t'tzm-latn',\n\t\t\t'tzm',\n\t\t\t'ug-cn',\n\t\t\t'uk',\n\t\t\t'ur',\n\t\t\t'uz-latn',\n\t\t\t'uz',\n\t\t\t'vi',\n\t\t\t'x-pseudo',\n\t\t\t'yo',\n\t\t\t'zh-cn',\n\t\t\t'zh-hk',\n\t\t\t'zh-tw',\n\t\t);\n\t}", "public function getTranslationsByLocale()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n $out[$trans->getLocale()] = $trans;\n }\n\n return $out;\n }", "public function get_available_wp_locales() {\n\t\tglobal $wpdb;\n\n\t\t$locales = GP_Locales::locales();\n\t\t$wp_locales = array_filter( wp_list_pluck( $locales, 'wp_locale' ) );\n\t\t$wp_locales_in_use = $wpdb->get_col( 'SELECT locale FROM ' . Tables::LOCALES );\n\n\t\t$wp_locales_in_use[] = 'en_US';\n\n\t\treturn array_diff( $wp_locales, $wp_locales_in_use );\n\t}", "public function getList()\n {\n return ArrayHelper::map(LanguageLocalization::find()->all(), 'lan_id', 'lan_name');\n }", "public function getLovLocale()\n\t{\n\t\t$locales['De'] = 'De';\n\t\t$locales['En'] = 'En';\n\t\t$locales['Fr'] = 'Fr';\n\t\treturn $locales;\n\t}", "public static function supportedLocales($keysOnly = false);", "function getLocaleFieldNames() {\n\t\treturn array();\n\n\t}", "public function getAvailableLocales()\n {\n return $this->availableLocales;\n }", "abstract public function getLocaleName();", "public function getLocales(): array\n {\n $locales = $this->getSupportedLocales();\n\n if ($this->hasSimpleLocales()) {\n return $locales;\n }\n\n return array_keys($locales);\n }", "public function findAllActiveWithLocale($locale) \n {\n $queryBuilder = $this->createQueryBuilder('n');\n\n $queryBuilder\n ->where('n.active = :active')\n ->setParameter('active', true)\n ->orderBy('n.date_display', 'DESC')\n ;\n\n $query = $queryBuilder->getQuery();\n\n $query->setHint(\n Query::HINT_CUSTOM_OUTPUT_WALKER,\n 'Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker'\n );\n\n $query->setHint(TranslatableListener::HINT_TRANSLATABLE_LOCALE, $locale);\n\n return $query->getResult();\n }", "public function get_locale()\n {\n $locale = $this->fetchConfig('ml_locales', null, null, false, false);\n $currlang = $this->currlang();\n $output = array();\n \n return $locale[$currlang];\n }", "function yourls_get_available_languages( $dir = null ) {\n\t$languages = array();\n\n\t$dir = is_null( $dir) ? YOURLS_LANG_DIR : $dir;\n\n\tforeach( (array) glob( $dir . '/*.mo' ) as $lang_file ) {\n\t\t$languages[] = basename( $lang_file, '.mo' );\n\t}\n\n\treturn yourls_apply_filter( 'get_available_languages', $languages );\n}", "protected function getSupportedLocales()\n {\n $locales = app('localize-route')->getConfig('locale_keys') ?? [];\n\n return $locales;\n }", "protected function getLocales()\n {\n // Get user specified locales\n if ($locales = $this->option('locales')) {\n return array_filter(explode(',', preg_replace('/\\s+/', '', $locales)));\n }\n\n // Check for package\n if (class_exists('\\\\Torann\\\\Localization\\\\LocaleManager')) {\n return app(LocaleManager::class)->getSupportedLanguagesKeys();\n }\n\n return config('cloud-search.support_locales');\n }", "public function getSiteLocales(): array\n {\n Craft::$app->getDeprecator()->log('craft.i18n.getSiteLocales()', 'craft.i18n.getSiteLocales() has been deprecated. Use craft.app.i18n.siteLocales instead.');\n\n return Craft::$app->getI18n()->getSiteLocales();\n }", "protected function initializeL10nLocales() {}", "function getLocaleFieldNames() {\n\t\treturn array('name', 'possibleOptions');\n\t}", "function getStatusNameList()\n\t{\n\t\tglobal $lang;\n\t\tif(!isset($lang->status_name_list))\n\t\t\treturn array_flip($this->getStatusList());\n\t\telse return $lang->status_name_list;\n\t}", "public function getEditableLocales(): array\n {\n Craft::$app->getDeprecator()->log('craft.i18n.getEditableLocales()', 'craft.i18n.getEditableLocales() has been deprecated. Use craft.app.i18n.editableLocales instead.');\n\n return Craft::$app->getI18n()->getEditableLocales();\n }", "public function getSystemLanguages() {}", "public function getSystemLanguages() {}", "public static function languagesForAdmin()\n {\n $copies = Copy::serverTranslations();\n\n $languages = self::languages();\n\n foreach (LANGUAGES as $key => $value) {\n $localized[] = [\n 'key' => $key,\n 'value' => $copies[$value] ?? $value,\n 'checked' => \\in_array($key, $languages, true),\n ];\n }\n\n return $localized ?? null;\n }", "public function getLocale();", "public function getLocale();", "function getLocaleFieldNames() {\n\t\treturn array('name', 'description', \"applicationForm\", \"survey\");\n\t}", "protected function localizer() {\n\t\treturn wponion_localize()->as_array();\n\t}", "public function index(Request $request)\n {\n return (new LocaleCollection($this->countryService->getAvailable()));\n }", "public function getSysLanguages()\n {\n return $this->queryBuilder('sys_language')->select('uid', 'title', 'language_isocode')\n ->from('sys_language')\n ->execute()\n ->fetchAll();\n }", "function languagelist()\n{\n\t // Need to ensure this is loaded for language defines\n\tpnBlockLoad('Core', 'thelang');\n\t// All entries use ISO 639-2/T\n\t// hilope - added all 469 languages available under ISO 639-2\n\t\n\t$lang['aar'] = _LANGUAGE_AAR; // Afar\n\t$lang['abk'] = _LANGUAGE_ABK; // Abkhazian\n\t$lang['ace'] = _LANGUAGE_ACE; // Achinese\n\t$lang['ach'] = _LANGUAGE_ACH; // Acoli\n\t$lang['ada'] = _LANGUAGE_ADA; // Adangme\n\t$lang['ady'] = _LANGUAGE_ADY; // Adyghe; Adygei\n\t$lang['afa'] = _LANGUAGE_AFA; // Afro-Asiatic (Other)\n\t$lang['afh'] = _LANGUAGE_AFH; // Afrihili\n\t$lang['afr'] = _LANGUAGE_AFR; // Afrikaans\n\t$lang['aka'] = _LANGUAGE_AKA; // Akan\n\t$lang['akk'] = _LANGUAGE_AKK; // Akkadian\n\t$lang['ale'] = _LANGUAGE_ALE; // Aleut\n\t$lang['alg'] = _LANGUAGE_ALG; // Algonquian languages\n\t$lang['amh'] = _LANGUAGE_AMH; // Amharic\n\t$lang['ang'] = _LANGUAGE_ANG; // English, Old\n\t$lang['apa'] = _LANGUAGE_APA; // Apache languages\n\t$lang['ara'] = _LANGUAGE_ARA; // Arabic\n\t$lang['arc'] = _LANGUAGE_ARC; // Aramaic\n\t$lang['arg'] = _LANGUAGE_ARG; // Aragonese\n\t$lang['arn'] = _LANGUAGE_ARN; // Araucanian\n\t$lang['arp'] = _LANGUAGE_ARP; // Arapaho\n\t$lang['art'] = _LANGUAGE_ART; // Artificial (Other)\n\t$lang['arw'] = _LANGUAGE_ARW; // Arawak\n\t$lang['asm'] = _LANGUAGE_ASM; // Assamese\n\t$lang['ast'] = _LANGUAGE_AST; // Asturian; Bable\n\t$lang['ath'] = _LANGUAGE_ATH; // Athapascan languages\n\t$lang['aus'] = _LANGUAGE_AUS; // Australian languages\n\t$lang['ava'] = _LANGUAGE_AVA; // Avaric\n\t$lang['ave'] = _LANGUAGE_AVE; // Avestan\n\t$lang['awa'] = _LANGUAGE_AWA; // Awadhi\n\t$lang['aym'] = _LANGUAGE_AYM; // Aymara\n\t$lang['aze'] = _LANGUAGE_AZE; // Azerbaijani\n\t$lang['bad'] = _LANGUAGE_BAD; // Banda\n\t$lang['bai'] = _LANGUAGE_BAI; // Bamileke languages\n\t$lang['bak'] = _LANGUAGE_BAK; // Bashkir\n\t$lang['bal'] = _LANGUAGE_BAL; // Baluchi\n\t$lang['bam'] = _LANGUAGE_BAM; // Bambara\n\t$lang['ban'] = _LANGUAGE_BAN; // Balinese\n\t$lang['bas'] = _LANGUAGE_BAS; // Basa\n\t$lang['bat'] = _LANGUAGE_BAT; // Baltic (Other)\n\t$lang['bej'] = _LANGUAGE_BEJ; // Beja\n\t$lang['bel'] = _LANGUAGE_BEL; // Belarusian\n\t$lang['bem'] = _LANGUAGE_BEM; // Bemba\n\t$lang['ben'] = _LANGUAGE_BEN; // Bengali\n\t$lang['ber'] = _LANGUAGE_BER; // Berber (Other)\n\t$lang['bho'] = _LANGUAGE_BHO; // Bhojpuri\n\t$lang['bih'] = _LANGUAGE_BIH; // Bihari\n\t$lang['bik'] = _LANGUAGE_BIK; // Bikol\n\t$lang['bin'] = _LANGUAGE_BIN; // Bini\n\t$lang['bis'] = _LANGUAGE_BIS; // Bislama\n\t$lang['bla'] = _LANGUAGE_BLA; // Siksika\n\t$lang['bnt'] = _LANGUAGE_BNT; // Bantu (Other)\n\t$lang['bod'] = _LANGUAGE_BOD; // Tibetan\n\t$lang['bos'] = _LANGUAGE_BOS; // Bosnian\n\t$lang['bra'] = _LANGUAGE_BRA; // Braj\n\t$lang['bre'] = _LANGUAGE_BRE; // Breton\n\t$lang['btk'] = _LANGUAGE_BTK; // Batak (Indonesia)\n\t$lang['bua'] = _LANGUAGE_BUA; // Buriat\n\t$lang['bug'] = _LANGUAGE_BUG; // Buginese\n\t$lang['bul'] = _LANGUAGE_BUL; // Bulgarian\n\t$lang['byn'] = _LANGUAGE_BYN; // Blin; Bilin\n\t$lang['cad'] = _LANGUAGE_CAD; // Caddo\n\t$lang['cai'] = _LANGUAGE_CAI; // Central American Indian (Other)\n\t$lang['car'] = _LANGUAGE_CAR; // Carib\n\t$lang['cat'] = _LANGUAGE_CAT; // Catalan; Valencian\n\t$lang['cau'] = _LANGUAGE_CAU; // Caucasian (Other)\n\t$lang['ceb'] = _LANGUAGE_CEB; // Cebuano\n\t$lang['cel'] = _LANGUAGE_CEL; // Celtic (Other)\n\t$lang['ces'] = _LANGUAGE_CES; // Czech\n\t$lang['cha'] = _LANGUAGE_CHA; // Chamorro\n\t$lang['chb'] = _LANGUAGE_CHB; // Chibcha\n\t$lang['che'] = _LANGUAGE_CHE; // Chechen\n\t$lang['chg'] = _LANGUAGE_CHG; // Chagatai\n\t$lang['chk'] = _LANGUAGE_CHK; // Chuukese\n\t$lang['chm'] = _LANGUAGE_CHM; // Mari\n\t$lang['chn'] = _LANGUAGE_CHN; // Chinook jargon\n\t$lang['cho'] = _LANGUAGE_CHO; // Choctaw\n\t$lang['chp'] = _LANGUAGE_CHP; // Chipewyan\n\t$lang['chr'] = _LANGUAGE_CHR; // Cherokee\n\t$lang['chu'] = _LANGUAGE_CHU; // Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic\n\t$lang['chv'] = _LANGUAGE_CHV; // Chuvash\n\t$lang['chy'] = _LANGUAGE_CHY; // Cheyenne\n\t$lang['cmc'] = _LANGUAGE_CMC; // Chamic languages\n\t$lang['cop'] = _LANGUAGE_COP; // Coptic\n\t$lang['cor'] = _LANGUAGE_COR; // Cornish\n\t$lang['cos'] = _LANGUAGE_COS; // Corsican\n\t$lang['cpe'] = _LANGUAGE_CPE; // Creoles and pidgins, English based (Other)\n\t$lang['cpf'] = _LANGUAGE_CPF; // Creoles and pidgins, French-based (Other)\n\t$lang['cpp'] = _LANGUAGE_CPP; // Creoles and pidgins,\n\t$lang['cre'] = _LANGUAGE_CRE; // Cree\n\t$lang['crh'] = _LANGUAGE_CRH; // Crimean Tatar; Crimean Turkish\n\t$lang['crp'] = _LANGUAGE_CRP; // Creoles and pidgins (Other)\n\t$lang['csb'] = _LANGUAGE_CSB; // Kashubian\n\t$lang['cus'] = _LANGUAGE_CUS; // Cushitic (Other)\n\t$lang['cym'] = _LANGUAGE_CYM; // Welsh\n\t$lang['dak'] = _LANGUAGE_DAK; // Dakota\n\t$lang['dan'] = _LANGUAGE_DAN; // Danish\n\t$lang['dar'] = _LANGUAGE_DAR; // Dargwa\n\t$lang['day'] = _LANGUAGE_DAY; // Dayak\n\t$lang['del'] = _LANGUAGE_DEL; // Delaware\n\t$lang['den'] = _LANGUAGE_DEN; // Slave (Athapascan)\n\t$lang['deu'] = _LANGUAGE_DEU; // German\n\t$lang['dgr'] = _LANGUAGE_DGR; // Dogrib\n\t$lang['din'] = _LANGUAGE_DIN; // Dinka\n\t$lang['div'] = _LANGUAGE_DIV; // Divehi\n\t$lang['doi'] = _LANGUAGE_DOI; // Dogri\n\t$lang['dra'] = _LANGUAGE_DRA; // Dravidian (Other)\n\t$lang['dsb'] = _LANGUAGE_DSB; // Lower Sorbian\n\t$lang['dua'] = _LANGUAGE_DUA; // Duala\n\t$lang['dum'] = _LANGUAGE_DUM; // Dutch, Middle\n\t$lang['dyu'] = _LANGUAGE_DYU; // Dyula\n\t$lang['dzo'] = _LANGUAGE_DZO; // Dzongkha\n\t$lang['efi'] = _LANGUAGE_EFI; // Efik\n\t$lang['egy'] = _LANGUAGE_EGY; // Egyptian (Ancient)\n\t$lang['eka'] = _LANGUAGE_EKA; // Ekajuk\n\t$lang['ell'] = _LANGUAGE_ELL; // Greek, Modern\n\t$lang['elx'] = _LANGUAGE_ELX; // Elamite\n\t$lang['eng'] = _LANGUAGE_ENG; // English\n\t$lang['enm'] = _LANGUAGE_ENM; // English, Middle\n\t$lang['epo'] = _LANGUAGE_EPO; // Esperanto\n\t$lang['est'] = _LANGUAGE_EST; // Estonian\n\t$lang['eus'] = _LANGUAGE_EUS; // Basque\n\t$lang['ewe'] = _LANGUAGE_EWE; // Ewe\n\t$lang['ewo'] = _LANGUAGE_EWO; // Ewondo\n\t$lang['fan'] = _LANGUAGE_FAN; // Fang\n\t$lang['fao'] = _LANGUAGE_FAO; // Faroese\n\t$lang['fas'] = _LANGUAGE_FAS; // Persian\n\t$lang['fat'] = _LANGUAGE_FAT; // Fanti\n\t$lang['fij'] = _LANGUAGE_FIJ; // Fijian\n\t$lang['fin'] = _LANGUAGE_FIN; // Finnish\n\t$lang['fiu'] = _LANGUAGE_FIU; // Finno-Ugrian (Other)\n\t$lang['fon'] = _LANGUAGE_FON; // Fon\n\t$lang['fra'] = _LANGUAGE_FRA; // French\n\t$lang['frm'] = _LANGUAGE_FRM; // French, Middle\n\t$lang['fro'] = _LANGUAGE_FRO; // French, Old\n\t$lang['fry'] = _LANGUAGE_FRY; // Frisian\n\t$lang['ful'] = _LANGUAGE_FUL; // Fulah\n\t$lang['fur'] = _LANGUAGE_FUR; // Friulian\n\t$lang['gaa'] = _LANGUAGE_GAA; // Ga\n\t$lang['gay'] = _LANGUAGE_GAY; // Gayo\n\t$lang['gba'] = _LANGUAGE_GBA; // Gbaya\n\t$lang['gem'] = _LANGUAGE_GEM; // Germanic (Other)\n\t$lang['gez'] = _LANGUAGE_GEZ; // Geez\n\t$lang['gil'] = _LANGUAGE_GIL; // Gilbertese\n\t$lang['gla'] = _LANGUAGE_GLA; // Gaelic; Scottish Gaelic\n\t$lang['gle'] = _LANGUAGE_GLE; // Irish\n\t$lang['glg'] = _LANGUAGE_GLG; // Galician\n\t$lang['glv'] = _LANGUAGE_GLV; // Manx\n\t$lang['gmh'] = _LANGUAGE_GMH; // German, Middle High\n\t$lang['goh'] = _LANGUAGE_GOH; // German, Old High\n\t$lang['gon'] = _LANGUAGE_GON; // Gondi\n\t$lang['gor'] = _LANGUAGE_GOR; // Gorontalo\n\t$lang['got'] = _LANGUAGE_GOT; // Gothic\n\t$lang['grb'] = _LANGUAGE_GRB; // Grebo\n\t$lang['grc'] = _LANGUAGE_GRC; // Greek, Ancient\n\t$lang['grn'] = _LANGUAGE_GRN; // Guarani\n\t$lang['guj'] = _LANGUAGE_GUJ; // Gujarati\n\t$lang['gwi'] = _LANGUAGE_GWI; // Gwich´in\n\t$lang['hai'] = _LANGUAGE_HAI; // Haida\n\t$lang['hat'] = _LANGUAGE_HAT; // Haitian; Haitian Creole\n\t$lang['hau'] = _LANGUAGE_HAU; // Hausa\n\t$lang['haw'] = _LANGUAGE_HAW; // Hawaiian\n\t$lang['heb'] = _LANGUAGE_HEB; // Hebrew\n\t$lang['her'] = _LANGUAGE_HER; // Herero\n\t$lang['hil'] = _LANGUAGE_HIL; // Hiligaynon\n\t$lang['him'] = _LANGUAGE_HIM; // Himachali\n\t$lang['hin'] = _LANGUAGE_HIN; // Hindi\n\t$lang['hit'] = _LANGUAGE_HIT; // Hittite\n\t$lang['hmn'] = _LANGUAGE_HMN; // Hmong\n\t$lang['hmo'] = _LANGUAGE_HMO; // Hiri Motu\n\t$lang['hrv'] = _LANGUAGE_HRV; // Croatian\n\t$lang['hsb'] = _LANGUAGE_HSB; // Upper Sorbian\n\t$lang['hun'] = _LANGUAGE_HUN; // Hungarian\n\t$lang['hup'] = _LANGUAGE_HUP; // Hupa\n\t$lang['hye'] = _LANGUAGE_HYE; // Armenian\n\t$lang['iba'] = _LANGUAGE_IBA; // Iban\n\t$lang['ibo'] = _LANGUAGE_IBO; // Igbo\n\t$lang['ido'] = _LANGUAGE_IDO; // Ido\n\t$lang['iii'] = _LANGUAGE_III; // Sichuan Yi\n\t$lang['ijo'] = _LANGUAGE_IJO; // Ijo\n\t$lang['iku'] = _LANGUAGE_IKU; // Inuktitut\n\t$lang['ile'] = _LANGUAGE_ILE; // Interlingue\n\t$lang['ilo'] = _LANGUAGE_ILO; // Iloko\n\t$lang['ina'] = _LANGUAGE_INA; // Interlingua (International Auxiliary Language Association)\n\t$lang['inc'] = _LANGUAGE_INC; // Indic (Other)\n\t$lang['ind'] = _LANGUAGE_IND; // Indonesian\n\t$lang['ine'] = _LANGUAGE_INE; // Indo-European (Other)\n\t$lang['inh'] = _LANGUAGE_INH; // Ingush\n\t$lang['ipk'] = _LANGUAGE_IPK; // Inupiaq\n\t$lang['ira'] = _LANGUAGE_IRA; // Iranian (Other)\n\t$lang['iro'] = _LANGUAGE_IRO; // Iroquoian languages\n\t$lang['isl'] = _LANGUAGE_ISL; // Icelandic\n\t$lang['ita'] = _LANGUAGE_ITA; // Italian\n\t$lang['jav'] = _LANGUAGE_JAV; // Javanese\n\t$lang['jbo'] = _LANGUAGE_JBO; // Lojban\n\t$lang['jpn'] = _LANGUAGE_JPN; // Japanese\n\t$lang['jpr'] = _LANGUAGE_JPR; // Judeo-Persian\n\t$lang['jrb'] = _LANGUAGE_JRB; // Judeo-Arabic\n\t$lang['kaa'] = _LANGUAGE_KAA; // Kara-Kalpak\n\t$lang['kab'] = _LANGUAGE_KAB; // Kabyle\n\t$lang['kac'] = _LANGUAGE_KAC; // Kachin\n\t$lang['kal'] = _LANGUAGE_KAL; // Kalaallisut; Greenlandic\n\t$lang['kam'] = _LANGUAGE_KAM; // Kamba\n\t$lang['kan'] = _LANGUAGE_KAN; // Kannada\n\t$lang['kar'] = _LANGUAGE_KAR; // Karen\n\t$lang['kas'] = _LANGUAGE_KAS; // Kashmiri\n\t$lang['kat'] = _LANGUAGE_KAT; // Georgian\n\t$lang['kau'] = _LANGUAGE_KAU; // Kanuri\n\t$lang['kaw'] = _LANGUAGE_KAW; // Kawi\n\t$lang['kaz'] = _LANGUAGE_KAZ; // Kazakh\n\t$lang['kbd'] = _LANGUAGE_KBD; // Kabardian\n\t$lang['kha'] = _LANGUAGE_KHA; // Khasi\n\t$lang['khi'] = _LANGUAGE_KHI; // Khoisan (Other)\n\t$lang['khm'] = _LANGUAGE_KHM; // Khmer\n\t$lang['kho'] = _LANGUAGE_KHO; // Khotanese\n\t$lang['kik'] = _LANGUAGE_KIK; // Kikuyu; Gikuyu\n\t$lang['kin'] = _LANGUAGE_KIN; // Kinyarwanda\n\t$lang['kir'] = _LANGUAGE_KIR; // Kirghiz\n\t$lang['kmb'] = _LANGUAGE_KMB; // Kimbundu\n\t$lang['kok'] = _LANGUAGE_KOK; // Konkani\n\t$lang['kom'] = _LANGUAGE_KOM; // Komi\n\t$lang['kon'] = _LANGUAGE_KON; // Kongo\n\t$lang['kor'] = _LANGUAGE_KOR; // Korean\n\t$lang['kos'] = _LANGUAGE_KOS; // Kosraean\n\t$lang['kpe'] = _LANGUAGE_KPE; // Kpelle\n\t$lang['krc'] = _LANGUAGE_KRC; // Karachay-Balkar\n\t$lang['kro'] = _LANGUAGE_KRO; // Kru\n\t$lang['kru'] = _LANGUAGE_KRU; // Kurukh\n\t$lang['kua'] = _LANGUAGE_KUA; // Kuanyama; Kwanyama\n\t$lang['kum'] = _LANGUAGE_KUM; // Kumyk\n\t$lang['kur'] = _LANGUAGE_KUR; // Kurdish\n\t$lang['kut'] = _LANGUAGE_KUT; // Kutenai\n\t$lang['lad'] = _LANGUAGE_LAD; // Ladino\n\t$lang['lah'] = _LANGUAGE_LAH; // Lahnda\n\t$lang['lam'] = _LANGUAGE_LAM; // Lamba\n\t$lang['lao'] = _LANGUAGE_LAO; // Lao\n\t$lang['lat'] = _LANGUAGE_LAT; // Latin\n\t$lang['lav'] = _LANGUAGE_LAV; // Latvian\n\t$lang['lez'] = _LANGUAGE_LEZ; // Lezghian\n\t$lang['lim'] = _LANGUAGE_LIM; // Limburgan; Limburger; Limburgish\n\t$lang['lin'] = _LANGUAGE_LIN; // Lingala\n\t$lang['lit'] = _LANGUAGE_LIT; // Lithuanian\n\t$lang['lol'] = _LANGUAGE_LOL; // Mongo\n\t$lang['loz'] = _LANGUAGE_LOZ; // Lozi\n\t$lang['ltz'] = _LANGUAGE_LTZ; // Luxembourgish; Letzeburgesch\n\t$lang['lua'] = _LANGUAGE_LUA; // Luba-Lulua\n\t$lang['lub'] = _LANGUAGE_LUB; // Luba-Katanga\n\t$lang['lug'] = _LANGUAGE_LUG; // Ganda\n\t$lang['lui'] = _LANGUAGE_LUI; // Luiseno\n\t$lang['lun'] = _LANGUAGE_LUN; // Lunda\n\t$lang['luo'] = _LANGUAGE_LUO; // Luo (Kenya and Tanzania)\n\t$lang['lus'] = _LANGUAGE_LUS; // lushai\n\t$lang['mad'] = _LANGUAGE_MAD; // Madurese\n\t$lang['mag'] = _LANGUAGE_MAG; // Magahi\n\t$lang['mah'] = _LANGUAGE_MAH; // Marshallese\n\t$lang['mai'] = _LANGUAGE_MAI; // Maithili\n\t$lang['mak'] = _LANGUAGE_MAK; // Makasar\n\t$lang['mal'] = _LANGUAGE_MAL; // Malayalam\n\t$lang['man'] = _LANGUAGE_MAN; // Mandingo\n\t$lang['map'] = _LANGUAGE_MAP; // Austronesian (Other)\n\t$lang['mar'] = _LANGUAGE_MAR; // Marathi\n\t$lang['mas'] = _LANGUAGE_MAS; // Masai\n\t$lang['mdf'] = _LANGUAGE_MDF; // Moksha\n\t$lang['mdr'] = _LANGUAGE_MDR; // Mandar\n\t$lang['men'] = _LANGUAGE_MEN; // Mende\n\t$lang['mga'] = _LANGUAGE_MGA; // Irish, Middle\n\t$lang['mic'] = _LANGUAGE_MIC; // Micmac\n\t$lang['min'] = _LANGUAGE_MIN; // Minangkabau\n\t$lang['mis'] = _LANGUAGE_MIS; // Miscellaneous languages\n\t$lang['mkd'] = _LANGUAGE_MKD; // Macedonian\n\t$lang['mkh'] = _LANGUAGE_MKH; // Mon-Khmer (Other)\n\t$lang['mlg'] = _LANGUAGE_MLG; // Malagasy\n\t$lang['mlt'] = _LANGUAGE_MLT; // Maltese\n\t$lang['mnc'] = _LANGUAGE_MNC; // Manchu\n\t$lang['mni'] = _LANGUAGE_MNI; // Manipuri\n\t$lang['mno'] = _LANGUAGE_MNO; // Manobo languages\n\t$lang['moh'] = _LANGUAGE_MOH; // Mohawk\n\t$lang['mol'] = _LANGUAGE_MOL; // Moldavian\n\t$lang['mon'] = _LANGUAGE_MON; // Mongolian\n\t$lang['mos'] = _LANGUAGE_MOS; // Mossi\n\t$lang['mri'] = _LANGUAGE_MRI; // Maori\n\t$lang['msa'] = _LANGUAGE_MSA; // Malay\n\t$lang['mul'] = _LANGUAGE_MUL; // Multiple languages\n\t$lang['mun'] = _LANGUAGE_MUN; // Munda languages\n\t$lang['mus'] = _LANGUAGE_MUS; // Creek\n\t$lang['mwr'] = _LANGUAGE_MWR; // Marwari\n\t$lang['mya'] = _LANGUAGE_MYA; // Burmese\n\t$lang['myn'] = _LANGUAGE_MYN; // Mayan languages\n\t$lang['myv'] = _LANGUAGE_MYV; // Erzya\n\t$lang['nah'] = _LANGUAGE_NAH; // Nahuatl\n\t$lang['nai'] = _LANGUAGE_NAI; // North American Indian\n\t$lang['nap'] = _LANGUAGE_NAP; // Neapolitan\n\t$lang['nau'] = _LANGUAGE_NAU; // Nauru\n\t$lang['nav'] = _LANGUAGE_NAV; // Navajo; Navaho\n\t$lang['nbl'] = _LANGUAGE_NBL; // Ndebele, South; South Ndebele\n\t$lang['nde'] = _LANGUAGE_NDE; // Ndebele, North; North Ndebele\n\t$lang['ndo'] = _LANGUAGE_NDO; // Ndonga\n\t$lang['nds'] = _LANGUAGE_NDS; // Low German; Low Saxon; German, Low; Saxon, Low\n\t$lang['nep'] = _LANGUAGE_NEP; // Nepali\n\t$lang['new'] = _LANGUAGE_NEW; // Newari; Nepal Bhasa\n\t$lang['nia'] = _LANGUAGE_NIA; // Nias\n\t$lang['nic'] = _LANGUAGE_NIC; // Niger-Kordofanian (Other)\n\t$lang['niu'] = _LANGUAGE_NIU; // Niuean\n\t$lang['nld'] = _LANGUAGE_NLD; // Dutch; Flemish\n\t$lang['nno'] = _LANGUAGE_NNO; // Norwegian Nynorsk; Nynorsk, Norwegian\n\t$lang['nob'] = _LANGUAGE_NOB; // Norwegian Bokmċl; Bokmċl, Norwegian\n\t$lang['nog'] = _LANGUAGE_NOG; // Nogai\n\t$lang['non'] = _LANGUAGE_NON; // Norse, Old\n\t$lang['nor'] = _LANGUAGE_NOR; // Norwegian\n\t$lang['nso'] = _LANGUAGE_NSO; // Sotho, Northern\n\t$lang['nub'] = _LANGUAGE_NUB; // Nubian languages\n\t$lang['nwc'] = _LANGUAGE_NWC; // Classical Newari; Old Newari; Classical Nepal Bhasa\n\t$lang['nya'] = _LANGUAGE_NYA; // Chichewa; Chewa; Nyanja\n\t$lang['nym'] = _LANGUAGE_NYM; // Nyamwezi\n\t$lang['nyn'] = _LANGUAGE_NYN; // Nyankole\n\t$lang['nyo'] = _LANGUAGE_NYO; // Nyoro\n\t$lang['nzi'] = _LANGUAGE_NZI; // Nzima\n\t$lang['oci'] = _LANGUAGE_OCI; // Occitan; Provençal\n\t$lang['oji'] = _LANGUAGE_OJI; // Ojibwa\n\t$lang['ori'] = _LANGUAGE_ORI; // Oriya\n\t$lang['orm'] = _LANGUAGE_ORM; // Oromo\n\t$lang['osa'] = _LANGUAGE_OSA; // Osage\n\t$lang['oss'] = _LANGUAGE_OSS; // Ossetian; Ossetic\n\t$lang['ota'] = _LANGUAGE_OTA; // Turkish, Ottoman\n\t$lang['oto'] = _LANGUAGE_OTO; // Otomian languages\n\t$lang['paa'] = _LANGUAGE_PAA; // Papuan (Other)\n\t$lang['pag'] = _LANGUAGE_PAG; // Pangasinan\n\t$lang['pal'] = _LANGUAGE_PAL; // Pahlavi\n\t$lang['pam'] = _LANGUAGE_PAM; // Pampanga\n\t$lang['pan'] = _LANGUAGE_PAN; // Panjabi; Punjabi\n\t$lang['pap'] = _LANGUAGE_PAP; // Papiamento\n\t$lang['pau'] = _LANGUAGE_PAU; // Palauan\n\t$lang['peo'] = _LANGUAGE_PEO; // Persian, Old\n\t$lang['phi'] = _LANGUAGE_PHI; // Philippine (Other)\n\t$lang['phn'] = _LANGUAGE_PHN; // Phoenician\n\t$lang['pli'] = _LANGUAGE_PLI; // Pali\n\t$lang['pol'] = _LANGUAGE_POL; // Polish\n\t$lang['pon'] = _LANGUAGE_PON; // Pohnpeian\n\t$lang['por'] = _LANGUAGE_POR; // Portuguese\n\t$lang['pra'] = _LANGUAGE_PRA; // Prakrit languages\n\t$lang['pro'] = _LANGUAGE_PRO; // Provençal, Old\n\t$lang['pus'] = _LANGUAGE_PUS; // Pushto\n\t$lang['qaa-qtz'] = _LANGUAGE_QAA_QTZ; // Reserved for local use\n\t$lang['que'] = _LANGUAGE_QUE; // Quechua\n\t$lang['raj'] = _LANGUAGE_RAJ; // Rajasthani\n\t$lang['rap'] = _LANGUAGE_RAP; // Rapanui\n\t$lang['rar'] = _LANGUAGE_RAR; // Rarotongan\n\t$lang['roa'] = _LANGUAGE_ROA; // Romance (Other)\n\t$lang['roh'] = _LANGUAGE_ROH; // Raeto-Romance\n\t$lang['rom'] = _LANGUAGE_ROM; // Romany\n\t$lang['ron'] = _LANGUAGE_RON; // Romanian\n\t$lang['run'] = _LANGUAGE_RUN; // Rundi\n\t$lang['rus'] = _LANGUAGE_RUS; // Russian\n\t$lang['sad'] = _LANGUAGE_SAD; // Sandawe\n\t$lang['sag'] = _LANGUAGE_SAG; // Sango\n\t$lang['sah'] = _LANGUAGE_SAH; // Yakut\n\t$lang['sai'] = _LANGUAGE_SAI; // South American Indian (Other)\n\t$lang['sal'] = _LANGUAGE_SAL; // Salishan languages\n\t$lang['sam'] = _LANGUAGE_SAM; // Samaritan Aramaic\n\t$lang['san'] = _LANGUAGE_SAN; // Sanskrit\n\t$lang['sas'] = _LANGUAGE_SAS; // Sasak\n\t$lang['sat'] = _LANGUAGE_SAT; // Santali\n\t$lang['sco'] = _LANGUAGE_SCO; // Scots\n\t$lang['scr'] = _LANGUAGE_SCR; // Serbo-Croatian\n\t$lang['sel'] = _LANGUAGE_SEL; // Selkup\n\t$lang['sem'] = _LANGUAGE_SEM; // Semitic (Other)\n\t$lang['sga'] = _LANGUAGE_SGA; // Irish, Old\n\t$lang['sgn'] = _LANGUAGE_SGN; // Sign Languages\n\t$lang['shn'] = _LANGUAGE_SHN; // Shan\n\t$lang['sid'] = _LANGUAGE_SID; // Sidamo\n\t$lang['sin'] = _LANGUAGE_SIN; // Sinhalese\n\t$lang['sio'] = _LANGUAGE_SIO; // Siouan languages\n\t$lang['sit'] = _LANGUAGE_SIT; // Sino-Tibetan (Other)\n\t$lang['sla'] = _LANGUAGE_SLA; // Slavic (Other)\n\t$lang['slk'] = _LANGUAGE_SLK; // Slovak\n\t$lang['slv'] = _LANGUAGE_SLV; // Slovenian\n\t$lang['sma'] = _LANGUAGE_SMA; // Southern Sami\n\t$lang['sme'] = _LANGUAGE_SME; // Northern Sami\n\t$lang['smi'] = _LANGUAGE_SMI; // Sami languages (Other)\n\t$lang['smj'] = _LANGUAGE_SMJ; // Lule Sami\n\t$lang['smn'] = _LANGUAGE_SMN; // Inari Sami\n\t$lang['smo'] = _LANGUAGE_SMO; // Samoan\n\t$lang['sms'] = _LANGUAGE_SMS; // Skolt Sami\n\t$lang['sna'] = _LANGUAGE_SNA; // Shona\n\t$lang['snd'] = _LANGUAGE_SND; // Sindhi\n\t$lang['snk'] = _LANGUAGE_SNK; // Soninke\n\t$lang['sog'] = _LANGUAGE_SOG; // Sogdian\n\t$lang['som'] = _LANGUAGE_SOM; // Somali\n\t$lang['son'] = _LANGUAGE_SON; // Songhai\n\t$lang['sot'] = _LANGUAGE_SOT; // Sotho, Southern\n\t$lang['spa'] = _LANGUAGE_SPA; // Spanish; Castilian\n\t$lang['sqi'] = _LANGUAGE_SQI; // Albanian\n\t$lang['srd'] = _LANGUAGE_SRD; // Sardinian\n\t$lang['srp'] = _LANGUAGE_SRP; // Serbian\n\t$lang['srr'] = _LANGUAGE_SRR; // Serer\n\t$lang['ssa'] = _LANGUAGE_SSA; // Nilo-Saharan (Other)\n\t$lang['ssw'] = _LANGUAGE_SSW; // Swati\n\t$lang['suk'] = _LANGUAGE_SUK; // Sukuma\n\t$lang['sun'] = _LANGUAGE_SUN; // Sundanese\n\t$lang['sus'] = _LANGUAGE_SUS; // Susu\n\t$lang['sux'] = _LANGUAGE_SUX; // Sumerian\n\t$lang['swa'] = _LANGUAGE_SWA; // Swahili\n\t$lang['swe'] = _LANGUAGE_SWE; // Swedish\n\t$lang['syr'] = _LANGUAGE_SYR; // Syriac\n\t$lang['tah'] = _LANGUAGE_TAH; // Tahitian\n\t$lang['tai'] = _LANGUAGE_TAI; // Tai (Other)\n\t$lang['tam'] = _LANGUAGE_TAM; // Tamil\n\t$lang['tat'] = _LANGUAGE_TAT; // Tatar\n\t$lang['tel'] = _LANGUAGE_TEL; // Telugu\n\t$lang['tem'] = _LANGUAGE_TEM; // Timne\n\t$lang['ter'] = _LANGUAGE_TER; // Tereno\n\t$lang['tet'] = _LANGUAGE_TET; // Tetum\n\t$lang['tgk'] = _LANGUAGE_TGK; // Tajik\n\t$lang['tgl'] = _LANGUAGE_TGL; // Tagalog\n\t$lang['tha'] = _LANGUAGE_THA; // Thai\n\t$lang['tig'] = _LANGUAGE_TIG; // Tigre\n\t$lang['tir'] = _LANGUAGE_TIR; // Tigrinya\n\t$lang['tiv'] = _LANGUAGE_TIV; // Tiv\n\t$lang['tkl'] = _LANGUAGE_TKL; // Tokelau\n\t$lang['tlh'] = _LANGUAGE_TLH; // Klingon; tlhlngan-Hol\n\t$lang['tli'] = _LANGUAGE_TLI; // Tlingit\n\t$lang['tmh'] = _LANGUAGE_TMH; // Tamashek\n\t$lang['tog'] = _LANGUAGE_TOG; // Tonga (Nyasa)\n\t$lang['ton'] = _LANGUAGE_TON; // Tonga (Tonga Islands)\n\t$lang['tpi'] = _LANGUAGE_TPI; // Tok Pisin\n\t$lang['tsi'] = _LANGUAGE_TSI; // Tsimshian\n\t$lang['tsn'] = _LANGUAGE_TSN; // Tswana\n\t$lang['tso'] = _LANGUAGE_TSO; // Tsonga\n\t$lang['tuk'] = _LANGUAGE_TUK; // Turkmen\n\t$lang['tum'] = _LANGUAGE_TUM; // Tumbuka\n\t$lang['tup'] = _LANGUAGE_TUP; // Tupi languages\n\t$lang['tur'] = _LANGUAGE_TUR; // Turkish\n\t$lang['tut'] = _LANGUAGE_TUT; // Altaic (Other)\n\t$lang['tvl'] = _LANGUAGE_TVL; // Tuvalu\n\t$lang['twi'] = _LANGUAGE_TWI; // Twi\n\t$lang['tyv'] = _LANGUAGE_TYV; // Tuvinian\n\t$lang['udm'] = _LANGUAGE_UDM; // Udmurt\n\t$lang['uga'] = _LANGUAGE_UGA; // Ugaritic\n\t$lang['uig'] = _LANGUAGE_UIG; // Uighur\n\t$lang['ukr'] = _LANGUAGE_UKR; // Ukrainian\n\t$lang['umb'] = _LANGUAGE_UMB; // Umbundu\n\t$lang['und'] = _LANGUAGE_UND; // Undetermined\n\t$lang['urd'] = _LANGUAGE_URD; // Urdu\n\t$lang['uzb'] = _LANGUAGE_UZB; // Uzbek\n\t$lang['vai'] = _LANGUAGE_VAI; // Vai\n\t$lang['ven'] = _LANGUAGE_VEN; // Venda\n\t$lang['vie'] = _LANGUAGE_VIE; // Vietnamese\n\t$lang['vol'] = _LANGUAGE_VOL; // Volapük\n\t$lang['vot'] = _LANGUAGE_VOT; // Votic\n\t$lang['wak'] = _LANGUAGE_WAK; // Wakashan languages\n\t$lang['wal'] = _LANGUAGE_WAL; // Walamo\n\t$lang['war'] = _LANGUAGE_WAR; // Waray\n\t$lang['was'] = _LANGUAGE_WAS; // Washo\n\t$lang['wen'] = _LANGUAGE_WEN; // Sorbian languages\n\t$lang['wln'] = _LANGUAGE_WLN; // Walloon\n\t$lang['wol'] = _LANGUAGE_WOL; // Wolof\n\t$lang['xal'] = _LANGUAGE_XAL; // Kalmyk\n\t$lang['xho'] = _LANGUAGE_XHO; // Xhosa\n\t$lang['yao'] = _LANGUAGE_YAO; // Yao\n\t$lang['yap'] = _LANGUAGE_YAP; // Yapese\n\t$lang['yid'] = _LANGUAGE_YID; // Yiddish\n\t$lang['yor'] = _LANGUAGE_YOR; // Yoruba\n\t$lang['ypk'] = _LANGUAGE_YPK; // Yupik languages\n\t$lang['zap'] = _LANGUAGE_ZAP; // Zapotec\n\t$lang['zen'] = _LANGUAGE_ZEN; // Zenaga\n\t$lang['zha'] = _LANGUAGE_ZHA; // Zhuang; Chuang\n\t$lang['zho'] = _LANGUAGE_ZHO; // Chinese\n\t$lang['znd'] = _LANGUAGE_ZND; // Zande\n\t$lang['zul'] = _LANGUAGE_ZUL; // Zulu\n\t$lang['zun'] = _LANGUAGE_ZUN; // Zuni\n\t// Non-ISO entries are written as x_[language name]\n\t$lang['x_all'] = _ALL; // all languages\n\t$lang['x_brazilian_portuguese'] = _LANGUAGE_X_BRAZILIAN_PORTUGUESE; // Brazilian Portuguese\n\t$lang['x_rus_koi8r'] = _LANGUAGE_X_RUS_KOI8R; // Russian KOI8-R\n\t// end of list\n\treturn $lang;\n}", "public function get_desired_languages();", "protected function projectHasActiveLocales()\n {\n return Strata::i18n()->hasActiveLocales();\n }", "private static function get_supported_locales() {\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\treturn array(\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(\r\n\t\t\t\t\t'af', 'ar', 'az',\r\n\t\t\t\t\t'bg', 'bs',\r\n\t\t\t\t\t'ca', 'cs',\r\n\t\t\t\t\t'da', 'de', \r\n\t\t\t\t\t'el', 'en-GB', 'eo', 'es', 'et', 'eu', \r\n\t\t\t\t\t'fa', 'fi', 'fo', 'fr-CH', 'fr',\r\n\t\t\t\t\t'he', 'hr', 'hu', 'hy',\r\n\t\t\t\t\t'id', 'is', 'it', \r\n\t\t\t\t\t'ja', \r\n\t\t\t\t\t'ko', \r\n\t\t\t\t\t'lt', 'lv',\r\n\t\t\t\t\t'ms',\r\n\t\t\t\t\t'nl', 'no', \r\n\t\t\t\t\t'pl', 'pt-BR',\r\n\t\t\t\t\t'ro', 'ru',\r\n\t\t\t\t\t'sk', 'sl', 'sq', 'sr', 'sr-SR', 'sv',\r\n\t\t\t\t\t'ta', 'th', 'tr', \r\n\t\t\t\t\t'uk', \r\n\t\t\t\t\t'vi',\r\n\t\t\t\t\t'zh-CN', 'zh-HK', 'zh-TW',\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t}\t\r\n\t\telse {\r\n\t\t\t// Version 1.7\r\n\t\t\treturn array(\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(\r\n\t\t\t\t\t'ar',\r\n\t\t\t\t\t'bg',\r\n\t\t\t\t\t'ca', 'cs',\r\n\t\t\t\t\t'da', 'de', \r\n\t\t\t\t\t'el', 'eo', 'es', \r\n\t\t\t\t\t'fa', 'fi', 'fr',\r\n\t\t\t\t\t'he', 'hr', 'hu', 'hy',\r\n\t\t\t\t\t'id', 'is', 'it', \r\n\t\t\t\t\t'ja', \r\n\t\t\t\t\t'ko', \r\n\t\t\t\t\t'lt', 'lv',\r\n\t\t\t\t\t'ms',\r\n\t\t\t\t\t'nl', 'no', \r\n\t\t\t\t\t'pl', 'pt-BR',\r\n\t\t\t\t\t'ro', 'ru',\r\n\t\t\t\t\t'sk', 'sl', 'sq', 'sr', 'sr-SR', 'sv',\r\n\t\t\t\t\t'th', 'tr', \r\n\t\t\t\t\t'uk', \r\n\t\t\t\t\t'vi',\r\n\t\t\t\t\t'zh-CN', 'zh-TW',\r\n\t\t\t\t),\t\r\n\t\t\t);\r\n\t\t}\t\t\r\n\t}", "public function getLocaleAwares()\n {\n return array( $this->getParagraphMapper() );\n }", "public function getAppLocales(): array\n {\n Craft::$app->getDeprecator()->log('craft.i18n.getAppLocales()', 'craft.i18n.getAppLocales() has been deprecated. Use craft.app.i18n.appLocales instead.');\n\n return Craft::$app->getI18n()->getAppLocales();\n }", "public function testLocalesList()\n {\n $client = $this->createClient();\n $response = $client->get(sprintf('%s/locales', $_ENV['site_url']));\n $body = json_decode($response->getBody()->getContents(), true);\n\n $this->assertEquals(200 , $response->getStatusCode());\n $this->assertContains(['name' => 'test'], $body['response']);\n }", "private function getLocales(): Collection\n {\n return Site::all()->map(function ($locale, $key) {\n return $this->getLocale($key);\n })->pipe(function ($locales) {\n return $this->addData($locales);\n })->filter(function ($locale) {\n return $this->excludeCurrent($locale);\n })->values();\n }", "public function index()\n {\n return view('stevebauman/localization::locales.index');\n }", "public function getLanguages();", "function getSupportedLocalesNative()\n{\n $arr = [];\n foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)\n {\n $arr_list = [LaravelLocalization::getLocalizedURL($localeCode, null, [], true)=>$properties['native']];\n $arr= array_merge((array)$arr,(array)$arr_list);\n }\n return $arr;\n}", "static function getList() {\n if (self::$list === NULL) {\n\n $list_all = Lang::find()->published()->all();\n $l = array();\n foreach ($list_all as $data) {\n $l[$data->alias] = $data;\n }\n\n self::$list = $l;\n }\n return self::$list;\n }", "function abl_droploader_get_localisation() {\n\t\t$l10n = array(\n\t\t\t'open' => '',\n\t\t\t'open_title' => '',\n\t\t\t'close' => '',\n\t\t\t'close_title' => '',\n\t\t\t'error_method' => '',\n\t\t\t'info_text' => '',\n\t\t\t'err_invalid_filetype' => '',\n\t\t\t'err_browser_not_supported' => '',\n\t\t\t'err_too_many_files' => '',\n\t\t\t'err_file_too_large' => '',\n\t\t\t'all_files_uploaded' => '',\n\t\t\t'no_files_uploaded' => '',\n\t\t\t'some_files_uploaded' => '',\n\t\t);\n\t\tforeach ($l10n as $k => $v) {\n\t\t\t$l10n[$k] = gTxt('abl_droploader_' . $k);\n\t\t}\n\t\treturn $l10n;\n\t}", "private function getAvailableLocales()\n {\n if (empty($this->availableLocales)) {\n // Open the pages directory.\n $pagesDirectory = opendir('../data/pages/');\n while ($directory = readdir($pagesDirectory)) {\n if (($directory != '.') && ($directory != '..')) {\n $this->availableLocales[] = $directory;\n }\n }\n closedir($pagesDirectory);\n }\n\n return $this->availableLocales;\n }", "public function getLanguageComponents()\n {\n $langs = array_keys( HelperService::prozessLangArray());\n\n echo json_encode(['defaultLanguage' => DEFAULT_LANG, 'languagesArray' => $langs]);\n exit();\n }", "public function onLanguagesOptionsCallback(): array\n {\n return $this->locales->getLocales(null, true);\n }", "public function index()\n {\n return Session::get('app.locale');\n }", "public function getPreferredLocales(){\n\t\treturn $this->preferredLocales;\n\t}", "function pms_get_countries() {\r\n\r\n $country_array = apply_filters( 'pms_get_countries',\r\n array(\r\n ''\t => '',\r\n 'AF' => __( 'Afghanistan', 'paid-member-subscriptions' ),\r\n 'AX' => __( 'Aland Islands', 'paid-member-subscriptions' ),\r\n 'AL' => __( 'Albania', 'paid-member-subscriptions' ),\r\n 'DZ' => __( 'Algeria', 'paid-member-subscriptions' ),\r\n 'AS' => __( 'American Samoa', 'paid-member-subscriptions' ),\r\n 'AD' => __( 'Andorra', 'paid-member-subscriptions' ),\r\n 'AO' => __( 'Angola', 'paid-member-subscriptions' ),\r\n 'AI' => __( 'Anguilla', 'paid-member-subscriptions' ),\r\n 'AQ' => __( 'Antarctica', 'paid-member-subscriptions' ),\r\n 'AG' => __( 'Antigua and Barbuda', 'paid-member-subscriptions' ),\r\n 'AR' => __( 'Argentina', 'paid-member-subscriptions' ),\r\n 'AM' => __( 'Armenia', 'paid-member-subscriptions' ),\r\n 'AW' => __( 'Aruba', 'paid-member-subscriptions' ),\r\n 'AU' => __( 'Australia', 'paid-member-subscriptions' ),\r\n 'AT' => __( 'Austria', 'paid-member-subscriptions' ),\r\n 'AZ' => __( 'Azerbaijan', 'paid-member-subscriptions' ),\r\n 'BS' => __( 'Bahamas', 'paid-member-subscriptions' ),\r\n 'BH' => __( 'Bahrain', 'paid-member-subscriptions' ),\r\n 'BD' => __( 'Bangladesh', 'paid-member-subscriptions' ),\r\n 'BB' => __( 'Barbados', 'paid-member-subscriptions' ),\r\n 'BY' => __( 'Belarus', 'paid-member-subscriptions' ),\r\n 'BE' => __( 'Belgium', 'paid-member-subscriptions' ),\r\n 'BZ' => __( 'Belize', 'paid-member-subscriptions' ),\r\n 'BJ' => __( 'Benin', 'paid-member-subscriptions' ),\r\n 'BM' => __( 'Bermuda', 'paid-member-subscriptions' ),\r\n 'BT' => __( 'Bhutan', 'paid-member-subscriptions' ),\r\n 'BO' => __( 'Bolivia', 'paid-member-subscriptions' ),\r\n 'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'paid-member-subscriptions' ),\r\n 'BA' => __( 'Bosnia and Herzegovina', 'paid-member-subscriptions' ),\r\n 'BW' => __( 'Botswana', 'paid-member-subscriptions' ),\r\n 'BV' => __( 'Bouvet Island', 'paid-member-subscriptions' ),\r\n 'BR' => __( 'Brazil', 'paid-member-subscriptions' ),\r\n 'IO' => __( 'British Indian Ocean Territory', 'paid-member-subscriptions' ),\r\n 'VG' => __( 'British Virgin Islands', 'paid-member-subscriptions' ),\r\n 'BN' => __( 'Brunei', 'paid-member-subscriptions' ),\r\n 'BG' => __( 'Bulgaria', 'paid-member-subscriptions' ),\r\n 'BF' => __( 'Burkina Faso', 'paid-member-subscriptions' ),\r\n 'BI' => __( 'Burundi', 'paid-member-subscriptions' ),\r\n 'KH' => __( 'Cambodia', 'paid-member-subscriptions' ),\r\n 'CM' => __( 'Cameroon', 'paid-member-subscriptions' ),\r\n 'CA' => __( 'Canada', 'paid-member-subscriptions' ),\r\n 'CV' => __( 'Cape Verde', 'paid-member-subscriptions' ),\r\n 'KY' => __( 'Cayman Islands', 'paid-member-subscriptions' ),\r\n 'CF' => __( 'Central African Republic', 'paid-member-subscriptions' ),\r\n 'TD' => __( 'Chad', 'paid-member-subscriptions' ),\r\n 'CL' => __( 'Chile', 'paid-member-subscriptions' ),\r\n 'CN' => __( 'China', 'paid-member-subscriptions' ),\r\n 'CX' => __( 'Christmas Island', 'paid-member-subscriptions' ),\r\n 'CC' => __( 'Cocos Islands', 'paid-member-subscriptions' ),\r\n 'CO' => __( 'Colombia', 'paid-member-subscriptions' ),\r\n 'KM' => __( 'Comoros', 'paid-member-subscriptions' ),\r\n 'CK' => __( 'Cook Islands', 'paid-member-subscriptions' ),\r\n 'CR' => __( 'Costa Rica', 'paid-member-subscriptions' ),\r\n 'HR' => __( 'Croatia', 'paid-member-subscriptions' ),\r\n 'CU' => __( 'Cuba', 'paid-member-subscriptions' ),\r\n 'CW' => __( 'Curacao', 'paid-member-subscriptions' ),\r\n 'CY' => __( 'Cyprus', 'paid-member-subscriptions' ),\r\n 'CZ' => __( 'Czech Republic', 'paid-member-subscriptions' ),\r\n 'CD' => __( 'Democratic Republic of the Congo', 'paid-member-subscriptions' ),\r\n 'DK' => __( 'Denmark', 'paid-member-subscriptions' ),\r\n 'DJ' => __( 'Djibouti', 'paid-member-subscriptions' ),\r\n 'DM' => __( 'Dominica', 'paid-member-subscriptions' ),\r\n 'DO' => __( 'Dominican Republic', 'paid-member-subscriptions' ),\r\n 'TL' => __( 'East Timor', 'paid-member-subscriptions' ),\r\n 'EC' => __( 'Ecuador', 'paid-member-subscriptions' ),\r\n 'EG' => __( 'Egypt', 'paid-member-subscriptions' ),\r\n 'SV' => __( 'El Salvador', 'paid-member-subscriptions' ),\r\n 'GQ' => __( 'Equatorial Guinea', 'paid-member-subscriptions' ),\r\n 'ER' => __( 'Eritrea', 'paid-member-subscriptions' ),\r\n 'EE' => __( 'Estonia', 'paid-member-subscriptions' ),\r\n 'ET' => __( 'Ethiopia', 'paid-member-subscriptions' ),\r\n 'FK' => __( 'Falkland Islands', 'paid-member-subscriptions' ),\r\n 'FO' => __( 'Faroe Islands', 'paid-member-subscriptions' ),\r\n 'FJ' => __( 'Fiji', 'paid-member-subscriptions' ),\r\n 'FI' => __( 'Finland', 'paid-member-subscriptions' ),\r\n 'FR' => __( 'France', 'paid-member-subscriptions' ),\r\n 'GF' => __( 'French Guiana', 'paid-member-subscriptions' ),\r\n 'PF' => __( 'French Polynesia', 'paid-member-subscriptions' ),\r\n 'TF' => __( 'French Southern Territories', 'paid-member-subscriptions' ),\r\n 'GA' => __( 'Gabon', 'paid-member-subscriptions' ),\r\n 'GM' => __( 'Gambia', 'paid-member-subscriptions' ),\r\n 'GE' => __( 'Georgia', 'paid-member-subscriptions' ),\r\n 'DE' => __( 'Germany', 'paid-member-subscriptions' ),\r\n 'GH' => __( 'Ghana', 'paid-member-subscriptions' ),\r\n 'GI' => __( 'Gibraltar', 'paid-member-subscriptions' ),\r\n 'GR' => __( 'Greece', 'paid-member-subscriptions' ),\r\n 'GL' => __( 'Greenland', 'paid-member-subscriptions' ),\r\n 'GD' => __( 'Grenada', 'paid-member-subscriptions' ),\r\n 'GP' => __( 'Guadeloupe', 'paid-member-subscriptions' ),\r\n 'GU' => __( 'Guam', 'paid-member-subscriptions' ),\r\n 'GT' => __( 'Guatemala', 'paid-member-subscriptions' ),\r\n 'GG' => __( 'Guernsey', 'paid-member-subscriptions' ),\r\n 'GN' => __( 'Guinea', 'paid-member-subscriptions' ),\r\n 'GW' => __( 'Guinea-Bissau', 'paid-member-subscriptions' ),\r\n 'GY' => __( 'Guyana', 'paid-member-subscriptions' ),\r\n 'HT' => __( 'Haiti', 'paid-member-subscriptions' ),\r\n 'HM' => __( 'Heard Island and McDonald Islands', 'paid-member-subscriptions' ),\r\n 'HN' => __( 'Honduras', 'paid-member-subscriptions' ),\r\n 'HK' => __( 'Hong Kong', 'paid-member-subscriptions' ),\r\n 'HU' => __( 'Hungary', 'paid-member-subscriptions' ),\r\n 'IS' => __( 'Iceland', 'paid-member-subscriptions' ),\r\n 'IN' => __( 'India', 'paid-member-subscriptions' ),\r\n 'ID' => __( 'Indonesia', 'paid-member-subscriptions' ),\r\n 'IR' => __( 'Iran', 'paid-member-subscriptions' ),\r\n 'IQ' => __( 'Iraq', 'paid-member-subscriptions' ),\r\n 'IE' => __( 'Ireland', 'paid-member-subscriptions' ),\r\n 'IM' => __( 'Isle of Man', 'paid-member-subscriptions' ),\r\n 'IL' => __( 'Israel', 'paid-member-subscriptions' ),\r\n 'IT' => __( 'Italy', 'paid-member-subscriptions' ),\r\n 'CI' => __( 'Ivory Coast', 'paid-member-subscriptions' ),\r\n 'JM' => __( 'Jamaica', 'paid-member-subscriptions' ),\r\n 'JP' => __( 'Japan', 'paid-member-subscriptions' ),\r\n 'JE' => __( 'Jersey', 'paid-member-subscriptions' ),\r\n 'JO' => __( 'Jordan', 'paid-member-subscriptions' ),\r\n 'KZ' => __( 'Kazakhstan', 'paid-member-subscriptions' ),\r\n 'KE' => __( 'Kenya', 'paid-member-subscriptions' ),\r\n 'KI' => __( 'Kiribati', 'paid-member-subscriptions' ),\r\n 'XK' => __( 'Kosovo', 'paid-member-subscriptions' ),\r\n 'KW' => __( 'Kuwait', 'paid-member-subscriptions' ),\r\n 'KG' => __( 'Kyrgyzstan', 'paid-member-subscriptions' ),\r\n 'LA' => __( 'Laos', 'paid-member-subscriptions' ),\r\n 'LV' => __( 'Latvia', 'paid-member-subscriptions' ),\r\n 'LB' => __( 'Lebanon', 'paid-member-subscriptions' ),\r\n 'LS' => __( 'Lesotho', 'paid-member-subscriptions' ),\r\n 'LR' => __( 'Liberia', 'paid-member-subscriptions' ),\r\n 'LY' => __( 'Libya', 'paid-member-subscriptions' ),\r\n 'LI' => __( 'Liechtenstein', 'paid-member-subscriptions' ),\r\n 'LT' => __( 'Lithuania', 'paid-member-subscriptions' ),\r\n 'LU' => __( 'Luxembourg', 'paid-member-subscriptions' ),\r\n 'MO' => __( 'Macao', 'paid-member-subscriptions' ),\r\n 'MK' => __( 'Macedonia', 'paid-member-subscriptions' ),\r\n 'MG' => __( 'Madagascar', 'paid-member-subscriptions' ),\r\n 'MW' => __( 'Malawi', 'paid-member-subscriptions' ),\r\n 'MY' => __( 'Malaysia', 'paid-member-subscriptions' ),\r\n 'MV' => __( 'Maldives', 'paid-member-subscriptions' ),\r\n 'ML' => __( 'Mali', 'paid-member-subscriptions' ),\r\n 'MT' => __( 'Malta', 'paid-member-subscriptions' ),\r\n 'MH' => __( 'Marshall Islands', 'paid-member-subscriptions' ),\r\n 'MQ' => __( 'Martinique', 'paid-member-subscriptions' ),\r\n 'MR' => __( 'Mauritania', 'paid-member-subscriptions' ),\r\n 'MU' => __( 'Mauritius', 'paid-member-subscriptions' ),\r\n 'YT' => __( 'Mayotte', 'paid-member-subscriptions' ),\r\n 'MX' => __( 'Mexico', 'paid-member-subscriptions' ),\r\n 'FM' => __( 'Micronesia', 'paid-member-subscriptions' ),\r\n 'MD' => __( 'Moldova', 'paid-member-subscriptions' ),\r\n 'MC' => __( 'Monaco', 'paid-member-subscriptions' ),\r\n 'MN' => __( 'Mongolia', 'paid-member-subscriptions' ),\r\n 'ME' => __( 'Montenegro', 'paid-member-subscriptions' ),\r\n 'MS' => __( 'Montserrat', 'paid-member-subscriptions' ),\r\n 'MA' => __( 'Morocco', 'paid-member-subscriptions' ),\r\n 'MZ' => __( 'Mozambique', 'paid-member-subscriptions' ),\r\n 'MM' => __( 'Myanmar', 'paid-member-subscriptions' ),\r\n 'NA' => __( 'Namibia', 'paid-member-subscriptions' ),\r\n 'NR' => __( 'Nauru', 'paid-member-subscriptions' ),\r\n 'NP' => __( 'Nepal', 'paid-member-subscriptions' ),\r\n 'NL' => __( 'Netherlands', 'paid-member-subscriptions' ),\r\n 'NC' => __( 'New Caledonia', 'paid-member-subscriptions' ),\r\n 'NZ' => __( 'New Zealand', 'paid-member-subscriptions' ),\r\n 'NI' => __( 'Nicaragua', 'paid-member-subscriptions' ),\r\n 'NE' => __( 'Niger', 'paid-member-subscriptions' ),\r\n 'NG' => __( 'Nigeria', 'paid-member-subscriptions' ),\r\n 'NU' => __( 'Niue', 'paid-member-subscriptions' ),\r\n 'NF' => __( 'Norfolk Island', 'paid-member-subscriptions' ),\r\n 'KP' => __( 'North Korea', 'paid-member-subscriptions' ),\r\n 'MP' => __( 'Northern Mariana Islands', 'paid-member-subscriptions' ),\r\n 'NO' => __( 'Norway', 'paid-member-subscriptions' ),\r\n 'OM' => __( 'Oman', 'paid-member-subscriptions' ),\r\n 'PK' => __( 'Pakistan', 'paid-member-subscriptions' ),\r\n 'PW' => __( 'Palau', 'paid-member-subscriptions' ),\r\n 'PS' => __( 'Palestinian Territory', 'paid-member-subscriptions' ),\r\n 'PA' => __( 'Panama', 'paid-member-subscriptions' ),\r\n 'PG' => __( 'Papua New Guinea', 'paid-member-subscriptions' ),\r\n 'PY' => __( 'Paraguay', 'paid-member-subscriptions' ),\r\n 'PE' => __( 'Peru', 'paid-member-subscriptions' ),\r\n 'PH' => __( 'Philippines', 'paid-member-subscriptions' ),\r\n 'PN' => __( 'Pitcairn', 'paid-member-subscriptions' ),\r\n 'PL' => __( 'Poland', 'paid-member-subscriptions' ),\r\n 'PT' => __( 'Portugal', 'paid-member-subscriptions' ),\r\n 'PR' => __( 'Puerto Rico', 'paid-member-subscriptions' ),\r\n 'QA' => __( 'Qatar', 'paid-member-subscriptions' ),\r\n 'CG' => __( 'Republic of the Congo', 'paid-member-subscriptions' ),\r\n 'RE' => __( 'Reunion', 'paid-member-subscriptions' ),\r\n 'RO' => __( 'Romania', 'paid-member-subscriptions' ),\r\n 'RU' => __( 'Russia', 'paid-member-subscriptions' ),\r\n 'RW' => __( 'Rwanda', 'paid-member-subscriptions' ),\r\n 'BL' => __( 'Saint Barthelemy', 'paid-member-subscriptions' ),\r\n 'SH' => __( 'Saint Helena', 'paid-member-subscriptions' ),\r\n 'KN' => __( 'Saint Kitts and Nevis', 'paid-member-subscriptions' ),\r\n 'LC' => __( 'Saint Lucia', 'paid-member-subscriptions' ),\r\n 'MF' => __( 'Saint Martin', 'paid-member-subscriptions' ),\r\n 'PM' => __( 'Saint Pierre and Miquelon', 'paid-member-subscriptions' ),\r\n 'VC' => __( 'Saint Vincent and the Grenadines', 'paid-member-subscriptions' ),\r\n 'WS' => __( 'Samoa', 'paid-member-subscriptions' ),\r\n 'SM' => __( 'San Marino', 'paid-member-subscriptions' ),\r\n 'ST' => __( 'Sao Tome and Principe', 'paid-member-subscriptions' ),\r\n 'SA' => __( 'Saudi Arabia', 'paid-member-subscriptions' ),\r\n 'SN' => __( 'Senegal', 'paid-member-subscriptions' ),\r\n 'RS' => __( 'Serbia', 'paid-member-subscriptions' ),\r\n 'SC' => __( 'Seychelles', 'paid-member-subscriptions' ),\r\n 'SL' => __( 'Sierra Leone', 'paid-member-subscriptions' ),\r\n 'SG' => __( 'Singapore', 'paid-member-subscriptions' ),\r\n 'SX' => __( 'Sint Maarten', 'paid-member-subscriptions' ),\r\n 'SK' => __( 'Slovakia', 'paid-member-subscriptions' ),\r\n 'SI' => __( 'Slovenia', 'paid-member-subscriptions' ),\r\n 'SB' => __( 'Solomon Islands', 'paid-member-subscriptions' ),\r\n 'SO' => __( 'Somalia', 'paid-member-subscriptions' ),\r\n 'ZA' => __( 'South Africa', 'paid-member-subscriptions' ),\r\n 'GS' => __( 'South Georgia and the South Sandwich Islands', 'paid-member-subscriptions' ),\r\n 'KR' => __( 'South Korea', 'paid-member-subscriptions' ),\r\n 'SS' => __( 'South Sudan', 'paid-member-subscriptions' ),\r\n 'ES' => __( 'Spain', 'paid-member-subscriptions' ),\r\n 'LK' => __( 'Sri Lanka', 'paid-member-subscriptions' ),\r\n 'SD' => __( 'Sudan', 'paid-member-subscriptions' ),\r\n 'SR' => __( 'Suriname', 'paid-member-subscriptions' ),\r\n 'SJ' => __( 'Svalbard and Jan Mayen', 'paid-member-subscriptions' ),\r\n 'SZ' => __( 'Swaziland', 'paid-member-subscriptions' ),\r\n 'SE' => __( 'Sweden', 'paid-member-subscriptions' ),\r\n 'CH' => __( 'Switzerland', 'paid-member-subscriptions' ),\r\n 'SY' => __( 'Syria', 'paid-member-subscriptions' ),\r\n 'TW' => __( 'Taiwan', 'paid-member-subscriptions' ),\r\n 'TJ' => __( 'Tajikistan', 'paid-member-subscriptions' ),\r\n 'TZ' => __( 'Tanzania', 'paid-member-subscriptions' ),\r\n 'TH' => __( 'Thailand', 'paid-member-subscriptions' ),\r\n 'TG' => __( 'Togo', 'paid-member-subscriptions' ),\r\n 'TK' => __( 'Tokelau', 'paid-member-subscriptions' ),\r\n 'TO' => __( 'Tonga', 'paid-member-subscriptions' ),\r\n 'TT' => __( 'Trinidad and Tobago', 'paid-member-subscriptions' ),\r\n 'TN' => __( 'Tunisia', 'paid-member-subscriptions' ),\r\n 'TR' => __( 'Turkey', 'paid-member-subscriptions' ),\r\n 'TM' => __( 'Turkmenistan', 'paid-member-subscriptions' ),\r\n 'TC' => __( 'Turks and Caicos Islands', 'paid-member-subscriptions' ),\r\n 'TV' => __( 'Tuvalu', 'paid-member-subscriptions' ),\r\n 'VI' => __( 'U.S. Virgin Islands', 'paid-member-subscriptions' ),\r\n 'UG' => __( 'Uganda', 'paid-member-subscriptions' ),\r\n 'UA' => __( 'Ukraine', 'paid-member-subscriptions' ),\r\n 'AE' => __( 'United Arab Emirates', 'paid-member-subscriptions' ),\r\n 'GB' => __( 'United Kingdom', 'paid-member-subscriptions' ),\r\n 'US' => __( 'United States', 'paid-member-subscriptions' ),\r\n 'UM' => __( 'United States Minor Outlying Islands', 'paid-member-subscriptions' ),\r\n 'UY' => __( 'Uruguay', 'paid-member-subscriptions' ),\r\n 'UZ' => __( 'Uzbekistan', 'paid-member-subscriptions' ),\r\n 'VU' => __( 'Vanuatu', 'paid-member-subscriptions' ),\r\n 'VA' => __( 'Vatican', 'paid-member-subscriptions' ),\r\n 'VE' => __( 'Venezuela', 'paid-member-subscriptions' ),\r\n 'VN' => __( 'Vietnam', 'paid-member-subscriptions' ),\r\n 'WF' => __( 'Wallis and Futuna', 'paid-member-subscriptions' ),\r\n 'EH' => __( 'Western Sahara', 'paid-member-subscriptions' ),\r\n 'YE' => __( 'Yemen', 'paid-member-subscriptions' ),\r\n 'ZM' => __( 'Zambia', 'paid-member-subscriptions' ),\r\n 'ZW' => __( 'Zimbabwe', 'paid-member-subscriptions' ),\r\n )\r\n );\r\n\r\n return $country_array;\r\n }", "public function localeIndex()\n {\n return $this->localeIndex;\n }", "function fumseck_list_languages() {\n\t$languages = icl_get_languages('skip_missing=0');\n\t$output = '';\n\tforeach ($languages as $l){\n\t\tif ($l['active']) {\n\t\t\t$output .= '<li role=\"presentation\" class=\"setting-active\" title=\"'\n\t\t\t\t\t. esc_attr( sprintf( __('This page is currently shown in %s', 'fumseck'), $l['translated_name']))\n\t\t\t\t\t. '\"><span class=\"no-link-menu-item\"><i class=\"fa fa-chevron-right fa-smaller fa-fw\"></i> '\n\t\t\t\t\t. $l['native_name']\n\t\t\t\t\t. '</span></li>'\n\t\t\t\t\t. \"\\n\";\n\t\t} elseif ($l['missing']) {\n\t\t\t$output .= '<li role=\"presentation\" class=\"setting-disabled\" title=\"'\n\t\t\t\t\t. esc_attr( sprintf( __('This page is not available in %s', 'fumseck'), $l['translated_name']))\n\t\t\t\t\t. '\"><span class=\"no-link-menu-item\"><i class=\"fa fa-ban fa-smaller reveal fa-fw\"></i> '\n\t\t\t\t\t. $l['native_name']\n\t\t\t\t\t. '</span></li>'\n\t\t\t\t\t. \"\\n\";\n\t\t} else {\n\t\t\t$output .= '<li role=\"presentation\" class=\"setting-inactive\" title=\"'\n\t\t\t\t\t. esc_attr( sprintf( __('Show this page in %s', 'fumseck'), $l['translated_name']))\n\t\t\t\t\t. '\"><a href=\"'\n\t\t\t\t\t. $l['url']\n\t\t\t\t\t. '\"><i class=\"fa fa-chevron-right fa-smaller reveal fa-fw\"></i> '\n\t\t\t\t\t. $l['native_name']\n\t\t\t\t\t. '</a></li>'\n\t\t\t\t\t. \"\\n\";\n\t\t}\n\t}\n\techo $output;\n}", "function getAvailableLangsOfKey($key)\n {\n $langs = [];\n $modules = $this->getAllModulesOfProject();\n foreach ($modules as $module)\n {\n $translations = $this->getTranslationsOfModule($module);\n foreach ($translations as $lang => $value)\n {\n if (get($value,$key))\n $langs[$key][] = strtoupper($this->locale->shortCode ($lang));\n }\n }\n return $langs ? array_unique($langs[$key]) : [];\n }", "public function adminLocales(){\n $locales = $this->local->getLocales();\n $data['locales'] = $locales;\n if (isset($_SESSION['localAdmin'])){\n $data['localAdmin'] = $_SESSION['localAdmin'];\n }\n $_SESSION['localAdmin'] = 0;\n $this->view->show('adminLocales.php',$data);\n }", "public function getAvailableTranslationGroups()\r\n {\r\n // Use the fallback locale as the default\r\n $defaultLocale = $this->getFallbackLocale();\r\n\r\n // Get files in the default directory\r\n $files = File::files($this->getLocalesDirectory() . DIRECTORY_SEPARATOR . $defaultLocale);\r\n $files = collect($files);\r\n\r\n // Return array of filenames without extension\r\n return $files\r\n ->map(function ($item, $key) {\r\n return pathinfo($item, PATHINFO_FILENAME);\r\n })\r\n ->toArray();\r\n }", "public function getAvailableLanguages() {}", "public function getLocale() {}", "public function getLocaleManager();", "protected static function getRootLocaleLanguages()\n {\n $language_locale = new \\Innomatic\\Locale\\LocaleCatalog(\n 'innomatic::localization', \n \\Innomatic\\Core\\InnomaticContainer::instance(\n '\\Innomatic\\Core\\InnomaticContainer'\n )->getLanguage()\n );\n\n $languageQuery = \\Innomatic\\Core\\InnomaticContainer::instance(\n '\\Innomatic\\Core\\InnomaticContainer'\n )->getDataAccess()->execute('SELECT * FROM locale_languages');\n\n while (!$languageQuery->eof) {\n $langshort = $languageQuery->getFields('langshort');\n $langname = $languageQuery->getFields('langname');\n $languages[$langshort] = $language_locale->getStr($langname);\n $languageQuery->moveNext();\n }\n\n return $languages;\n }", "public function getLocalizedSlugs();", "public function getAllTranslationByLanguage();", "public static function GetAllActive()\n\t{\t\t\n\t\tglobal $objLogin;\n\t\t\n\t\tif($objLogin->IsLoggedInAs('owner','mainadmin','admin')){\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'back-end\\')';\t\t\t\t\n\t\t}else{\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'front-end\\')';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT\n\t\t\t\t\tid, lang_name, lang_name_en, abbreviation, lc_time_name, lang_dir, is_default, icon_image, used_on, priority_order, is_active,\n\t\t\t\t\tIF(is_default = 1, \"<span style=color:#00a600>'._YES.'</span>\", \"'._NO.'\") as is_default_verb,\n\t\t\t\t\tIF(is_active = 1, \"<span style=color:#00a600>'._YES.'</span>\", \"<span style=color:#a60000>'._NO.'</span>\") as is_active_verb\n\t\t\t\tFROM '.TABLE_LANGUAGES.'\n\t\t\t\tWHERE is_active = 1 '.$used_on.'\n\t\t\t\tORDER BY priority_order ASC';\t\t\t\n\t\t\n\t\treturn database_query($sql, DATA_AND_ROWS);\n\t}", "function getLocale();", "public static function allNames()\n {\n static $list;\n\n if ($list === null) {\n $list = [];\n $data = \\ResourceBundle::create(\\Locale::getDefault(), 'ICUDATA-curr')->get('Currencies');\n foreach ($data as $code => $values) {\n $list[$code] = $values[1];\n }\n }\n\n return $list;\n }", "public static function getSystemLanguages() {}", "function getLocaleFieldNames() {\n\t\treturn array('title', 'description');\n\t}" ]
[ "0.68166745", "0.68029225", "0.6692968", "0.6680582", "0.6617291", "0.66101766", "0.6500134", "0.6458341", "0.6443665", "0.64423686", "0.64178395", "0.6325171", "0.63234866", "0.6251534", "0.62099206", "0.61870235", "0.61541796", "0.61338836", "0.61008817", "0.605658", "0.6045192", "0.60310835", "0.5991119", "0.597803", "0.5973095", "0.59509975", "0.5945999", "0.5925862", "0.5923104", "0.59223455", "0.59181917", "0.59165156", "0.590891", "0.5908515", "0.5897859", "0.5892929", "0.5882328", "0.5878182", "0.5869605", "0.5861647", "0.58578753", "0.5825935", "0.5818484", "0.5789038", "0.5784", "0.5776796", "0.5772675", "0.5761594", "0.57501125", "0.5747036", "0.57376796", "0.57274795", "0.57020533", "0.57016444", "0.5695913", "0.56911314", "0.5681847", "0.56809765", "0.56752247", "0.56745046", "0.56745046", "0.56681114", "0.5667384", "0.5659733", "0.565679", "0.56535107", "0.56506944", "0.5636402", "0.563308", "0.56326824", "0.5630567", "0.5629871", "0.56281906", "0.5624573", "0.55971295", "0.55965686", "0.5591474", "0.55815005", "0.55667925", "0.5563091", "0.55603963", "0.55416214", "0.55397254", "0.5530891", "0.55254287", "0.5523149", "0.55215997", "0.5521149", "0.55200505", "0.55186796", "0.5518368", "0.5517054", "0.5515785", "0.5514261", "0.5509534", "0.55050737", "0.55046016", "0.550401", "0.549854", "0.5498314" ]
0.6615467
5
Translate a country indicator to its locale full name Uses default system locale by default. Pass another locale string to force a different translation
public function getCountry($country, $default = '', $locale = null) { $locale = $locale == null ? 'en' : $locale; $countries = Intl::getRegionBundle()->getCountryNames($locale); return array_key_exists($country, $countries) ? $countries[$country] : $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getLocaleName();", "public static function label() {\n return __('nova-laravel-world::novaLaravelWorld.countryLocale');\n }", "public function getCountryName();", "function agst_pmpro_default_country($country) {\n\treturn 'AU';\n}", "function erp_get_country_name( $country ) {\n\n $load_cuntries_states = \\WeDevs\\ERP\\Countries::instance();\n $countries = $load_cuntries_states->countries;\n\n // Handle full country name\n if ( '-1' != $country ) {\n $full_country = ( isset( $countries[ $country ] ) ) ? $countries[ $country ] : $country;\n } else {\n $full_country = '—';\n }\n\n return $full_country;\n}", "function storms_wc_get_country_locale_default( $default_locale ) {\n\n\t\t$fields = [ 'first_name', 'last_name', 'company', 'country', 'address_1', 'address_2', 'city', 'state', 'postcode' ];\n\t\t$fields_ordered = storms_wc_checkout_fields_order_billing_fields();\n\n\t\tforeach( $fields as $field ) {\n\t\t\t$default_locale[$field]['priority'] = $fields_ordered[$field];\n\t\t}\n\n\t\treturn $default_locale;\n\t}", "public function locale();", "function getDefaultLocale();", "public static function locale(): string\n {\n // in the end to handle that case\n return Arr::get(config('currencies'), strtolower(static::currency()).'.locale', 'en_US') ?? 'en_US';\n }", "public function getCountryName() {\n //check if we have a country code\n if ($this->country) {\n //return the country name\n return Locale::getDisplayRegion('en_' . $this->country);\n }\n return NULL;\n }", "function switch_to_locale($locale)\n {\n }", "function tep_get_country_name($country_id) {\n\t$country_array = tep_get_countries($country_id);\n\treturn $country_array['countries_name'];\n}", "public function sGetCountryTranslation($country = '')\n {\n $languageId = $this->contextService->getShopContext()->getShop()->getId();\n $fallbackId = $this->contextService->getShopContext()->getShop()->getFallbackId();\n\n $translationData = $this->translationComponent\n ->readBatchWithFallback($languageId, $fallbackId, 'config_countries');\n\n if (!$country) {\n return $translationData;\n }\n\n if (!isset($translationData[$country['id']])) {\n return $country;\n }\n\n // Pass (possible) translation to country\n if ($translationData[$country['id']]['countryname']) {\n $country['countryname'] = $translationData[$country['id']]['countryname'];\n }\n if ($translationData[$country['id']]['notice']) {\n $country['notice'] = $translationData[$country['id']]['notice'];\n }\n\n if ($translationData[$country['id']]['active']) {\n $country['active'] = $translationData[$country['id']]['active'];\n }\n\n return $country;\n }", "public function country_name($country)\n {\n $result = common_select_values('name', 'ad_countries', ' id = \"'.$country.'\"', 'row');\n return $result; \n }", "public function getDefaultLocale();", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "function determine_locale()\n {\n }", "function getCountry($country = 'Serbia')\n{\n return $country;\n}", "abstract public function getLocaleCode();", "public static function defaultCountry(): string\n {\n $default = Cache::get('country_default');\n\n if ($default === null) {\n $default = static::select('country')->where('is_default', '=', true)->first();\n $default = ! empty($default) ? $default->country : config('contentful.default_country');\n\n // Cache is cleaned in Console\\Commands\\SyncLocales (run at least daily)\n Cache::forever('country_default', $default);\n }\n\n return $default;\n }", "function acf_get_locale()\n{\n}", "public function getCountry() {}", "public function getCountry() {}", "function storms_wc_get_country_locale( $locales ) {\n\n\t\t$field = 'postcode';\n\t\t$fields_ordered = storms_wc_checkout_fields_order_billing_fields();\n\n\t\t$locales['BR'][$field]['priority'] = $fields_ordered[$field];\n\n\t\treturn $locales;\n\t}", "abstract public function countryISOCode();", "function fixCountryName(&$country){\n global $db;\n //premapuje sa povodna hodnota na novu ak sa krajina najde v tabulke 'mapping'\n $countryQuery = \"SELECT * FROM mapping WHERE original='{$country}'\";\n $countryResults = $db->query($countryQuery)->fetchAll(PDO::FETCH_ASSOC);\n if (count($countryResults)>0){\n $country = $countryResults[0][\"replacement\"];\n }\n}", "public function getLocale();", "public function getLocale();", "function getLocale();", "abstract public function country();", "function localize($phrase) {\n global $translations;\n /* Static keyword is used to ensure the file is loaded only once */\n if ($translations[$phrase])\n return $translations[$phrase];\n else\n return $phrase;\n}", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "public function getCountry();", "public function getCountry();", "public function settingLocale() {}", "public function locale(string $locale = null);", "public function getCountryName()\n {\n return $this->getValue('nb_icontact_prospect_country_name');\n }", "public function requestCountry();", "public function getLocalizedName();", "public function getLocale() {}", "public function getCountry()\n {\n return parent::getValue('country');\n }", "static public function english_name() : string {\n return \"Russian\";\n }", "function _wpsc_fix_latvia_currency() {\n\t$country = new WPSC_Country( array(\n\t\t'isocode' => 'LV',\n\t\t'currency' => __( 'Euro', 'wpsc' ),\n\t\t'symbol' => __( '€', 'wpsc' ),\n\t\t'symbol_html' => __( '&#8364;', 'wpsc' ),\n\t\t'code' => __( 'EUR', 'wpsc' )\n\t) );\n\n}", "protected function LiveDefaultCountry()\n {\n return self::get_default_country_code_combined();\n }", "public function getCountryName()\n {\n return $this->getCountry()->getName();\n }", "function get_lang_label($key){\n\t\t$list = array(\n\t\t\t//bg 'Bulgarian'\n\t\t\t'cat' => 'Català',\n\t\t\t//cs 'Čeština'\n\t\t\t//da 'Dansk'\n\t\t\t'deu' => 'Deutsch',\n\t\t\t'eng' => 'English',\n\t\t\t'esp' => 'Español',\n\t\t\t//fi 'Finnish (Suomi)'\n\t\t\t'fra' => 'Français',\n\t\t\t//he 'Hebrew (עברית)'\n\t\t\t//hu 'Magyar'\n\t\t\t//it 'Italiano'\n\t\t\t'jpn' => 'Japanese (日本語)',\n\t\t\t'kor' => 'Korean (한국어)',\n\t\t\t//lt 'Lithuanian (lietuvių)'\n\t\t\t//nl 'Nederlands'\n\t\t\t//no 'Norwegian (Norsk bokmål)'\n\t\t\t//pl 'Polski'\n\t\t\t'bra' => 'Português(Brasil)',\n\t\t\t//pt 'Português'\n\t\t\t'ron' => 'Română',\n\t\t\t'rus' => 'Russian (Русский)',\n\t\t\t//sk 'Slovensky'\n\t\t\t//sr 'Srpski'\n\t\t\t//sv 'Svenska'\n\t\t\t'tha' => 'Thai (ไทย)',\n\t\t\t//tr 'Türkçe'\n\t\t\t//uk 'Ukrainian (Українська)'\n\t\t\t//vn 'Tiếng Việt'\n\t\t\t//zh-tw 'Traditional Chinese (繁體中文)'\n\t\t\t'chi' => 'Simplified Chinese (简体中文)'\n\t );\n\t return isset($list[$key]) ? $list[$key] : $key;\n\t}", "function get_country_short_name($id)\n{\n $CI =& get_instance();\n $CI->db->where('country_id', $id);\n $country = $CI->db->get('tblcountries')->row();\n if ($country) {\n return $country->iso2;\n }\n\n return '';\n}", "function getIdByCountryName($country)\n{\n\tif (!empty($country))\n\t{\n\t\tif (isset($country->Name))\n\t\t\t$country = $country->Name;\n\t\tif (is_string($country))\n\t\t{\n\t\t\t$iso = '';\n\t\t\t$tbl = _DB_PREFIX_.'country_lang';\n\t\t\t$country = pSQL(trim($country));\n\t\t\t$q = \"SELECT * from $tbl WHERE name='$country'\";\n\t\t\t$q = Db::getInstance()->ExecuteS($q);\n\t\t\tif (!empty($q))\n\t\t\t\t$iso = $q[0]['id_country'];\n\t\t\treturn $iso;\n\t\t}\n\t}\n\treturn '';\n}", "public function getCountryNameDirectly()\r\n {\r\n\r\n $url_to_exch_code = \"https://freegeoip.net/json/\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country_name'])) {\r\n\r\n return $details['country_name'];\r\n\r\n } else {\r\n\r\n $url_to_exch_code = \"https://geoip.nekudo.com/api/json\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country']['name'])) {\r\n\r\n return $details['country']['name'];\r\n\r\n } else {\r\n\r\n return false;\r\n\r\n }\r\n }\r\n\r\n }", "public function country(): string\n {\n return $this->country;\n }", "public function setCountry($country = \"\");", "function lang_switcher(){\n\tif (function_exists('icl_get_languages')) {\n\t\t$langs = icl_get_languages('skip_missing=0');\n\t\tforeach ($langs as $lang) {\n\t\t\tif ($lang['active'] == 0) {\n\t\t\t\t$flag = preg_replace(' ', '', $lang['country_flag_url']);\n\t\t\t\t$display_lang = ($lang['native_name'] == 'עברית') ? \"עבר\" : ucfirst($lang['native_name']);\n\t\t\t $strlang = mb_substr($display_lang,0,3);\n\t\t\t\techo '<a class=\"lang-switcher lang-switch\" href=\"'. $lang['url'] .'\">'.'<span class=\"dropdown-item d-inline-block\"></span><img src=\"'. $lang['country_flag_url'] . '\"></a>';\n\t\t\t}\n\t\t}\n\t}\n}", "function sanitize_locale_name($locale_name)\n {\n }", "protected function formatCountry($countryCode)\n {\n $countries = trans('geolocation::countries');\n\n return array_key_exists($countryCode, $countries) ? $countries[$countryCode] : $countryCode;\n }", "function jr_get_server_country() {\r\n\r\n\t// Get user country\r\n\tif(isset($_SERVER['HTTP_X_FORWARD_FOR'])) $ip = $_SERVER['HTTP_X_FORWARD_FOR']; else $ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t$ip = strip_tags($ip);\r\n\t$country = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r\n\r\n\t$result = wp_remote_get('http://api.hostip.info/country.php?ip='.$ip);\r\n\tif (!is_wp_error($result) && strtolower($result['body']) != 'xx') $country = $result['body'];\r\n\r\n\treturn strtolower($country);\r\n}", "function setLocale($locale);", "public function getCountryName()\n {\n return $this->getShippingAddress()->getCountryModel()->getName($this->localeResolver->getLocale());\n }", "public static function map_locale( $locale ) {\n\n\t\tif ( in_array( $locale, self::$_validLocales ) ) {\n\n\t\t\t// Already a valid locale\n\t\t\t$paypal_friendly_locale = $locale;\n\n\t\t} else {\n\n\t\t\t// We need to map it based on the last two characters\n\t\t\t$shortened_locale = substr( $locale, -2 );\n\n\t\t\tif ( in_array( $shortened_locale, self::$_validLocales ) ) {\n\n\t\t\t\t// Already a valid locale\n\t\t\t\t$paypal_friendly_locale = $shortened_locale;\n\n\t\t\t} else {\n\n\t\t\t\t$paypal_friendly_locale = 'US';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $paypal_friendly_locale;\n\t}", "protected function _getLanguageForLocale()\n {\n $locale = $this->worldpayhelper->getLocaleDefault();\n if (substr($locale, 3, 2) == 'NO') {\n return 'no';\n }\n return substr($locale, 0, 2);\n }", "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "function get_lang_locale() {\n\tglobal $lang_code;\n\t$localeMap = array(\n\t\t'ca' => 'ca_ES',\n\t\t'cs' => 'cs_CZ',\n\t\t'cy' => 'cy_GB',\n\t\t'da' => 'da_DK',\n\t\t'de' => 'de_DE',\n\t\t'eu' => 'eu_ES',\n\t\t'en' => 'en_US',\n\t\t'es' => 'es_ES',\n\t\t'fi' => 'fi_FI',\n\t\t'fr' => 'fr_FR',\n\t\t'gl' => 'gl_ES',\n\t\t'hu' => 'hu_HU',\n\t\t'it' => 'it_IT',\n\t\t'ja' => 'ja_JP',\n\t\t'ko' => 'ko_KR',\n\t\t'nb' => 'nb_NO',\n\t\t'nl' => 'nl_NL',\n\t\t'pl' => 'pl_PL',\n\t\t'pt' => 'pt_BR',\n\t\t'ro' => 'ro_RO',\n\t\t'ru' => 'ru_RU',\n\t\t'sk' => 'sk_SK',\n\t\t'sl' => 'sl_SI',\n\t\t'sv' => 'sv_SE',\n\t\t'th' => 'th_TH',\n\t\t'tr' => 'tr_TR',\n\t\t'ku' => 'ku_TR',\n\t\t'zh_CN' => 'zh_CN',\n\t\t'zh_TW' => 'zh_TW',\n\t\t'af' => 'af_ZA',\n\t\t'sq' => 'sq_AL',\n\t\t'hy' => 'hy_AM',\n\t\t'az' => 'az_AZ',\n\t\t'be' => 'be_BY',\n\t\t'bs' => 'bs_BA',\n\t\t'bg' => 'bg_BG',\n\t\t'hr' => 'hr_HR',\n\t\t'eo' => 'eo_EO',\n\t\t'et' => 'et_EE',\n\t\t'fo' => 'fo_FO',\n\t\t'ka' => 'ka_GE',\n\t\t'el' => 'el_GR',\n\t\t'hi' => 'hi_IN',\n\t\t'is' => 'is_IS',\n\t\t'id' => 'id_ID',\n\t\t'ga' => 'ga_IE',\n\t\t'jv' => 'jv_ID',\n\t\t'kk' => 'kk_KZ',\n\t\t'la' => 'la_VA',\n\t\t'lv' => 'lv_LV',\n\t\t'lt' => 'lt_LT',\n\t\t'mk' => 'mk_MK',\n\t\t'mg' => 'mg_MG',\n\t\t'ms' => 'ms_MY',\n\t\t'mt' => 'mt_MT',\n\t\t'mn' => 'mn_MN',\n\t\t'ne' => 'ne_NP',\n\t\t'rm' => 'rm_CH',\n\t\t'sr' => 'sr_RS',\n\t\t'so' => 'so_SO',\n\t\t'sw' => 'sw_KE',\n\t\t'tl' => 'tl_PH',\n\t\t'uk' => 'uk_UA',\n\t\t'uz' => 'uz_UZ',\n\t\t'vi' => 'vi_VN',\n\t\t'zu' => 'zu_ZA',\n\t\t'ar' => 'ar_AR',\n\t\t'he' => 'he_IL',\n\t\t'ur' => 'ur_PK',\n\t\t'fa' => 'fa_IR',\n\t\t'sy' => 'sy_SY',\n\t\t'gn' => 'gn_PY'\n\t);\n\treturn (check_value($localeMap[$lang_code])) ? $localeMap[$lang_code] : 'en_US';\n}", "function get_user_locale($user = 0)\n {\n }", "public function getCountry() : string\n {\n return $this->country;\n }", "function tep_get_countries_with_iso_codes($countries_id) {\n\treturn tep_get_countries($countries_id, true);\n}", "public function wpml_display_language_names( $null, $native_name, $translated_name = false, $native_hidden = false, $translated_hidden = false ) {\n\t\treturn $native_name;\n\t}", "public function inDanish()\n {\n return $this->getTranslationIn('da');\n }", "public function getCountry() :string\n {\n return $this->country;\n }", "function restore_current_locale()\n {\n }", "protected function getCountry()\n {\n return strtoupper($this->checkoutSession->getLastRealOrder()->getBillingAddress()->getCountryId());\n }", "public function getCurrentOrDefaultLocale();", "static function i18n($in, $name = null) {\n\n\t\tif ( function_exists( 'langswitch_filter_langs_with_message' ) )\n\t\t\t$in = langswitch_filter_langs_with_message($in);\n\n\t\tif ( function_exists( 'polyglot_filter' ))\n\t\t\t$in = polyglot_filter($in);\n\n\t\tif ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ))\n\t\t\t$in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);\n\n if (is_string($name) && !empty($name) && function_exists('icl_translate'))\n $in = icl_translate('plugin_ngg', $name, $in, true);\n\n\t\t$in = apply_filters('localization', $in);\n\n\t\treturn $in;\n\t}", "public function getNameWithFallbackAttribute()\n {\n return $this->translateOrNew($this->locale())->name\n ?? $this->translateOrNew($this->getFallbackLocale())->name;\n }", "function localize_date($date, $location = 'en_EN') {\r\n if (strlen($date) == 10) {\r\n\r\n $date_array = explode('-', $date);\r\n\r\n if (substr($location, 0, 2) == 'fr' OR substr($location, 0, 2) == 'de' OR substr($location, 0, 2) == 'es') {\r\n return $date_array[2] . '.' . $date_array[1] . '.' . $date_array[0];\r\n } elseif (substr($location, 0, 2) == 'en') {\r\n return $date;\r\n }\r\n }\r\n\r\n return $date;\r\n}", "public function getIcuLocale(string $locale): string\n {\n $parts = explode('-', $locale);\n if (isset($parts[1])) {\n $parts[1] = mb_strtoupper($parts[1]);\n }\n\n return implode('_', $parts);\n }", "private function getFallbackLocale()\r\n {\r\n return config('app.fallback_locale');\r\n }", "public function getCountry()\n {\n $arr_countries = array(\n 'F' =>\t_('Austria'),\n 'T' =>\t_('Belgium'),\n 'D' =>\t_('Finland'),\n 'E' =>\t_('France'),\n 'L' =>\t_('France'),\n 'P' =>\t_('Germany'),\n 'R' =>\t_('Germany'),\n 'N' =>\t_('Greece'),\n 'K' =>\t_('Ireland'),\n 'J' =>\t_('Italy'),\n 'G' =>\t_('Netherlands'),\n 'H' =>\t_('United Kingdom'),\n 'U' =>\t_('Portugal'),\n 'M' =>\t_('Spain'),\n );\n\n return $arr_countries[$this->str_value[0]];\n }", "public static function getCountryFullName($iso)\n\t{\n\t\tif (strlen($iso) == 2)\n\t\t{\n\t\t\t$iso = self::convertIso2to3($iso);\n\t\t}\n\n\t\t$countries = self::getCountries();\n\n\t\tif (isset($countries[$iso]['name']))\n\t\t{\n\t\t\treturn JText::_($countries[$iso]['name']);\n\t\t}\n\t}", "public function getFromLanguage(): string;", "abstract public function getTranslationIn(string $locale);", "abstract public function getTranslationIn(string $locale);", "abstract public function getTranslationIn(string $locale);", "public function getNativeCountry()\n {\n return Wrapper\\World::country($this->getNativeLeagueId());\n }", "public static function locale() : string\n {\n // Compute the locale just one time\n if (self::$locale) {\n return self::$locale;\n }\n\n // Lang in cookies\n $locale = self::langToLocale($_COOKIE['NameYourGoat_User_Locale'] ?? '');\n\n // Lang in User repository\n if (! $locale && self::isAuth()) {\n $locale = self::langToLocale(self::$fullUser->lang);\n }\n\n // Lang in the request headers\n if (! $locale) {\n $acceptLang = explode(',', getallheaders()['Accept-Language'] ?? '');\n\n foreach ($acceptLang as $lang) {\n if ($locale = self::langToLocale(trim(strtok($lang, '-;')))) {\n break;\n }\n }\n }\n\n return self::$locale = $locale ?: self::$defaultLocale;\n }", "private static function localize(array &$arr)\n\t{\n\t\t$arr = isset($arr[LANG]) ? $arr[LANG] : $arr[0];\n\t}", "function multilang_locale_name($key) {\n $list = multilang_locales_list();\n if (isset($list[ $key ])){\n return $list[ $key ];\n } else {\n return $key;\n }\n}", "function getFallbackLocale()\n {\n return config('app.fallback_locale');\n }", "public function country(bool $long = false) : string\n {\n return $long ? get_country_name($this->country) : $this->country;\n }", "public function getCountryName($ip=null) {\r\r\n\t\tif (!$this->database)\r\r\n\t\t\treturn geoip_country_name_by_name($this->currentIp($ip));\r\r\n\t\treturn geoip_country_name_by_addr($this->database, $this->currentIp($ip));\r\r\n\t}", "public static function getShortCountryName($iso)\n\t{\n\t\tif (strlen($iso) == 2)\n\t\t{\n\t\t\t$iso = self::convertIso2to3($iso);\n\t\t}\n\n\t\t$full = self::getCountryName($iso);\n\n\t\tif (empty($full))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$parts = explode(',', $full);\n\n\t\treturn JText::_($parts[0]);\n\t}", "public static function getDefaultLanguageCode() {\n\t\t$oSprache = UnzerCw_VersionHelper::getInstance()->getDb()->executeQuery(\"SELECT kSprache, cISO FROM tsprache WHERE cShopStandard = 'Y'\", 1);\n\t\tif($oSprache->kSprache > 0) {\n\t\t\treturn UnzerCw_VersionHelper::getInstance()->convertISO2ISO639($oSprache->cISO);\n\t\t}\n\t\telse {\n\t\t\treturn 'de';\n\t\t}\n\t}", "function tep_get_fullname($firstname, $lastname) {\n global $language;\n $separator = ' ';\n return ($language == 'japanese')\n ? ($lastname.$separator.$firstname)\n : ($firstname.$separator.$lastname);\n}", "public function naturalName(string $language): string;", "function GetDefaultLang() : string\n{\n return 'ar';\n}", "function setLocale($localename)\r\n\t{\r\n\t\t$this->pathLocale = $localename;\r\n\t\t$f = $this->_getFileName();\r\n\t\t/* load language configuration */\r\n\t\tif (file_exists($f))\r\n\t\t{\r\n\t\t\tglobal $tmp;\r\n\t\t\tinclude($f);\r\n\t\t\tif ($this->varMode == 'names')\r\n\t\t\t{\r\n#\t\t\t\t$this->lang = array_merge($this->lang, ${$this->varName});\r\n\t\t\t\t$this->lang = ${$this->varName};\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function SI_determineCountry($ip) {\n\tif (!SI_isIPtoCountryInstalled()) return '';\n\t\n\tglobal $SI_tables;\n\t$ip = sprintf(\"%u\",ip2long($ip));\n\t\n\t$query = \"SELECT country_name FROM $SI_tables[countries]\n\t\t\t WHERE ip_from <= $ip AND\n\t\t\t ip_to >= $ip\";\n\tif ($result = mysql_query($query)) {\n\t\tif ($r = mysql_fetch_array($result)) {\n\t\t\treturn trim(ucwords(preg_replace(\"/([A-Z\\xC0-\\xDF])/e\",\"chr(ord('\\\\1')+32)\",$r['country_name'])));\n\t\t\t}\n\t\t}\n\t}", "public function countryCode();", "function getFallbackLocale() {\n return config('app.fallback_locale');\n }", "public function getName()\n {\n return '_locale';\n }" ]
[ "0.69071174", "0.6741136", "0.65871954", "0.6413279", "0.6352875", "0.6106532", "0.5999787", "0.59754026", "0.5950175", "0.5944036", "0.59170043", "0.5893998", "0.5869184", "0.58462375", "0.58101314", "0.578492", "0.578492", "0.578492", "0.57775694", "0.5773178", "0.57681876", "0.5746296", "0.5744706", "0.57180345", "0.57180345", "0.57172966", "0.5717248", "0.5693118", "0.5689276", "0.5689276", "0.5682305", "0.56766033", "0.56725353", "0.566638", "0.56635845", "0.56635845", "0.5662158", "0.56545746", "0.5636407", "0.5633275", "0.5624945", "0.5617942", "0.5602467", "0.56003475", "0.5594843", "0.55631673", "0.554946", "0.55437255", "0.5522572", "0.55093175", "0.55060416", "0.54901564", "0.5489135", "0.5481357", "0.54789984", "0.5478475", "0.5447668", "0.5442842", "0.5439694", "0.5438815", "0.5418041", "0.5411044", "0.5409797", "0.5407693", "0.540749", "0.5407171", "0.53951395", "0.53946775", "0.5391063", "0.5389609", "0.538082", "0.53691185", "0.53617215", "0.53526396", "0.5351228", "0.5344446", "0.5337988", "0.53357726", "0.5331132", "0.5328774", "0.53235763", "0.53235763", "0.53235763", "0.5323575", "0.5319146", "0.5318388", "0.53100294", "0.530829", "0.53040713", "0.53012437", "0.5300795", "0.529805", "0.52961934", "0.5288157", "0.52873564", "0.5282394", "0.5274169", "0.5272324", "0.52678764", "0.526409" ]
0.60338485
6
Translate a timestamp to a localized string representation. Parameters dateType and timeType defines a kind of format. Allowed values are (none|short|medium|long|full). Default is medium for the date and no time. Uses default system locale by default. Pass another locale string to force a different translation. You might not like the default formats, so you can pass a custom pattern as last argument.
public static function getLocaleDate($date, $dateType = 'medium', $timeType = 'none', $locale = null, $pattern = null) { $formatter = new DateFormatter(); return $formatter->format($date, $dateType, $timeType, $locale, $pattern); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultLocalizedFormat($locale = null, $dateType = null, $timeType = null);", "public function getLocalizedDateTimeFormat($locale = null, $dateType = null, $timeType = null);", "function getLocaleSurchargedDatetimeFormat($locale = null, $dateType = null, $timeType = null, $localizedFormats = null);", "function localized_date(DateTimeInterface $date, ?string $localeCode = null, int $dateType = IntlDateFormatter::FULL, int $timeType = IntlDateFormatter::SHORT): string\n {\n static $locale;\n\n if (!$locale) {\n $locale = $localeCode ?: (Mongez::getRequestLocaleCode() ?: app()->getLocale());\n }\n\n if (!class_exists(IntlDateFormatter::class)) return '';\n\n $formatter = new IntlDateFormatter(\n $locale,\n $dateType,\n $timeType,\n );\n\n return $formatter->format($date);\n }", "public function getDateTimeLocaleFormat($locale = null, $dateType = null, $timeType = null, $alphaOnly = false);", "protected function _applyFormat($message, $type, $time=0){\n\t\tif($time==0){\n\t\t\t$time = time();\n\t\t}\n\t\t$format = $this->_format;\n\t\tif(class_exists('Router')==true){\n\t\t\t$format = str_replace('%controller%', Router::getController(), $format);\n\t\t\t$format = str_replace('%action%', Router::getAction(), $format);\n\t\t\t$format = str_replace('%application%', Router::getApplication(), $format);\n\t\t\t$format = str_replace('%url%', Router::getURL(), $format);\n\t\t}\n\t\t$format = str_replace('%date%', @date($this->_dateFormat, $time), $format);\n\t\t$format = str_replace('%type%', $this->getTypeString($type), $format);\n\t\t$format = str_replace('%message%', $message, $format);\n\t\treturn $format;\n\t}", "public function getTimeFormat($type = null);", "public function getTimeFormat($type = null);", "function time($format, $date = null) {\n\t\treturn CaracoleI18n::strftime($format, strtotime($date));\n\t}", "function dokan_format_time( $datetime ) {\n $timestamp = strtotime( $datetime );\n\n $date_format = get_option( 'date_format' );\n $time_format = get_option( 'time_format' );\n\n return date_i18n( $date_format . ' ' . $time_format, $timestamp );\n}", "function formatTimestamp($time, $format = \"l\", $timeoffset = null)\n {\n global $xoopsConfig, $xoopsUser;\n\n $format_copy = $format;\n $format = strtolower($format);\n\n if ($format == 'rss' || $format == 'r') {\n return parent::formatTimestamp($time, \"rss\", $timeoffset);\n }\n\n if (($format == 'elapse' || $format == 'e') && $time < time()) {\n return XoopsLocaleJalali::Convertnumber2farsi(parent::formatTimestamp($time, \"elapse\", $timeoffset));\n }\n // disable user timezone calculation and use default timezone,\n // for cache consideration\n if ($timeoffset === null) {\n $timeoffset = ($xoopsConfig['default_TZ'] == '') ? '0.0' : $xoopsConfig['default_TZ'];\n }\n $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);\n switch ($format) {\n case 's':\n $datestring = _SHORTDATESTRING;\n break;\n\n case 'm':\n $datestring = _MEDIUMDATESTRING;\n break;\n\n case 'mysql':\n $datestring = 'Y-m-d H:i:s';\n break;\n\n case 'l':\n $datestring = _DATESTRING;\n break;\n\n case 'c':\n case 'custom':\n static $current_timestamp, $today_timestamp, $monthy_timestamp;\n if (!isset($current_timestamp)) {\n $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);\n }\n if (!isset($today_timestamp)) {\n $today_timestamp = mktime(0, 0, 0, date('m', $current_timestamp), date('d', $current_timestamp), date('Y', $current_timestamp));\n }\n\n if (abs($elapse_today = $usertimestamp - $today_timestamp) < 24 * 60 * 60) {\n $datestring = ($elapse_today > 0) ? _TODAY : _YESTERDAY;\n } else {\n if (!isset($monthy_timestamp)) {\n $monthy_timestamp[0] = mktime(0, 0, 0, 0, 0, date('Y', $current_timestamp));\n $monthy_timestamp[1] = mktime(0, 0, 0, 0, 0, date('Y', $current_timestamp) + 1);\n }\n if ($usertimestamp >= $monthy_timestamp[0] && $usertimestamp < $monthy_timestamp[1]) {\n $datestring = _MONTHDAY;\n } else {\n $datestring = _YEARMONTHDAY;\n }\n }\n break;\n\n default:\n if ($format != '') {\n $datestring = $format_copy;\n } else {\n $datestring = _DATESTRING;\n }\n break;\n }\n\n\t// Start hacked by irmtfan for show hegira date in persian and other languages www.jadoogaran.org\n\tif (_JDF_USE_HEGIRADATE && $format != 'mysql' ){\n\t return XoopsLocaleJalali::jdate($datestring,$usertimestamp);\n\t} else {\n\t\treturn ucfirst(date($datestring,$usertimestamp));\n }\n\t// End hacked by irmtfan for show hegira date in persian and other languages www.jadoogaran.org\n\t}", "function format_time( $time, $format = '', $i18n = true ) {\n\t\n\tif ( ! is_numeric( $time ) )\n\t\t$time = strtotime( $time );\n\t\n\t\n\tswitch ( strtolower( $format ) ) {\n\n\t\tcase 'mysql' :\n\t\t\treturn $i18n ? date_i18n( 'Y-m-d H:i:s', (int) $time ) : date( 'Y-m-d H:i:s', (int) $time );\n\t\t\tbreak;\n\n\t\tcase 'object' :\n\t\t\t$std = new stdClass();\n\t\t\t\n\t\t\tforeach ( array( \n\t\t\t\t'L', 'Y', 'y', 'W', 'F', 'm', 'M', 'n', 't', 'd', 'D', 'j', 'l', 'N', 'S', 'w', 'z',\n\t\t\t\t'a', 'A', 'B', 'g', 'G', 'h', 'H', 'i', 's', 'u', 'e', 'I', 'O', 'P', 'T', 'Z', 'r', 'U' ) as $ch )\n\t\t\t\n\t\t\t\t$std->$ch = $i18n ? date_i18n( $ch, (int) $time ) : date( $ch, (int) $time );\n\t\t\t\t\n\t\t\treturn $std;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'default' :\n\t\t\treturn $i18n ? date_i18n( get_option( 'date_format' ), (int) $time ) : date( get_option( 'date_format' ), (int) $time );\n\t\t\tbreak;\n\t\t\t\n\t\tdefault :\n\t\t\treturn $i18n ? date_i18n( $format, (int) $time ) : date( $format, (int) $time );\n\t\t\tbreak;\n\n\t}\n\n\treturn false;\n\n}", "public function format_timestamp($time)\n {\n }", "function s2_date_time($time)\n{\n if (!$time)\n return '';\n\n $date = date(Lang::get('Time format'), $time);\n $lang_month_small = Lang::get('Inline Months');\n if (!empty($lang_month_small))\n $date = str_replace(array_keys($lang_month_small), array_values($lang_month_small), $date);\n\n return $date;\n}", "private function format_time( $timestamp ) {\n\t if ( empty( $timestamp) ) {\n\t\t return __( 'never' , 'slp-premier' );\n\t }\n\t return date(\"d F Y H:i:s\",$timestamp);\n }", "function date_get_date_time($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date_time'], $timestamp);\n}", "public function datetime_format($datetime, $type = 0) {\n\t\tif ($datetime == '' || $datetime == \"0000-00-00 00:00:00\" || $datetime == '1970-01-01 05:30:00') {\n\t\t\treturn \"\";\n\t\t}\n\t\t$st = Yii::$app->getTable;\n\n\t\t$df = $st->settings('local', 'date_format');\n\t\tsetlocale(LC_TIME, 'en_US');\n\t\tif ($type == 1) {\n\t\t\t$result1 = date(\"$df\", $datetime); // date($df,strtotime($date));\n\t\t} else {\n\t\t\t$result1 = date(\"$df\", strtotime($datetime)); // date($df,strtotime($date));\n\n\t\t}\n\n\t\t$tf = $st->settings('local', 'time_format');\n\t\tif ($type == 1) {\n\t\t\t$result2 = date($tf, $datetime);\n\t\t} else {\n\t\t\t$result2 = date($tf, strtotime($datetime));\n\n\t\t}\n\t\t$result = $result1 . \" \" . $result2;\n\n\t\treturn $result;\n\t}", "function format_date($timestamp)\n{\n //format depends on wether we have a timestamp or not\n if (utf8_strlen($timestamp)>10) {\n $fstr = 'd M Y - G:i';\n } else {\n $fstr = 'd M Y';\n }\n if (utf8_substr($timestamp,0,10)=='0000-00-00') {\n return __('no date set yet');\n }\n if ($lang == \"de\") {\n return date($fstr, strtotime($timestamp));\n } else {\n return date($fstr, strtotime($timestamp));\n }\n}", "function formatTimestamp($time, $format=\"l\", $timeoffset=\"\")\r\n\t{\r\n\t global $xoopsConfig, $xoopsUser;\r\n\t if(strtolower($format) == \"rss\" ||strtolower($format) == \"r\"){\r\n \t$TIME_ZONE = \"\";\r\n \tif(!empty($GLOBALS['xoopsConfig']['server_TZ'])){\r\n\t\t\t\t$server_TZ = abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0));\r\n\t\t\t\t$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?\" -\":\" +\";\r\n\t\t\t\t$TIME_ZONE = $prefix.date(\"Hi\",$server_TZ);\r\n\t\t\t}\r\n\t\t\t$date = gmdate(\"D, d M Y H:i:s\", intval($time)).$TIME_ZONE;\r\n\t\t\treturn $date;\r\n \t}\r\n \t\r\n\t $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);\r\n\t switch (strtolower($format)) {\r\n\t case 's':\r\n\t $datestring = _SHORTDATESTRING;\r\n\t break;\r\n\t case 'm':\r\n\t $datestring = _MEDIUMDATESTRING;\r\n\t break;\r\n\t case 'mysql':\r\n\t $datestring = \"Y-m-d H:i:s\";\r\n\t break;\r\n\t case 'rss':\r\n\t \t$datestring = \"r\";\r\n\t break;\r\n\t case 'l':\r\n\t $datestring = _DATESTRING;\r\n\t break;\r\n\t case 'c':\r\n\t case 'custom':\t \r\n\t $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);\r\n\t if(date(\"Ymd\", $usertimestamp) == date(\"Ymd\", $current_timestamp)){\r\n\t\t\t\t$datestring = _TODAY;\r\n\t\t\t}elseif(date(\"Ymd\", $usertimestamp+24*60*60) == date(\"Ymd\", $current_timestamp)){\r\n\t\t\t\t$datestring = _YESTERDAY;\r\n\t\t\t}elseif(date(\"Y\", $usertimestamp) == date(\"Y\", $current_timestamp)){\r\n\t\t\t\t$datestring = _MONTHDAY;\r\n\t\t\t}else{\r\n\t\t\t\t$datestring = _YEARMONTHDAY;\r\n\t\t\t}\r\n\t break;\r\n\t default:\r\n\t if ($format != '') {\r\n\t $datestring = $format;\r\n\t } else {\r\n\t $datestring = _DATESTRING;\r\n\t }\r\n\t break;\r\n\t }\r\n\t return ucfirst(date($datestring, $usertimestamp));\r\n\t}", "function format($date, $type, $format){\r\n\tif($type&DATE){\r\n\t\t$y=substr($date,0,4);\r\n\t\t$M=substr($date,4,2);\r\n\t\t$d=substr($date,6,2);\r\n\t\tif($type & TIME){\r\n\t\t\t$h=substr($date,8,2);\r\n\t\t\t$m=substr($date,10,2);\r\n\t\t\t$s=substr($date,12,2);\r\n\t\t}\r\n\t}else{\r\n\t\t$h=substr($date,0,2);\r\n\t\t$m=substr($date,2,2);\r\n\t\t$s=substr($date,4,2);\r\n\t}\r\n\t\r\n\treturn $date==''?'':str_replace('s',$s,\r\n\t\t\t\t\t\tstr_replace('m',$m,\r\n\t\t\t\t\t\tstr_replace('H',$h,\r\n\t\t\t\t\t\tstr_replace('D',$d,\r\n\t\t\t\t\t\tstr_replace('M',$M,\r\n\t\t\t\t\t\tstr_replace('Y',$y,$format))))));\r\n}", "public function formatTime($time = null);", "public function getDateFormat($type = \\IntlDateFormatter::SHORT);", "function getDateFormat($type)\n{\n switch ($type) {\n case 'date':\n return '%Y-%m-%d';\n case 'datetime':\n return '%Y-%m-%d %I:%M:%S';\n case 'time':\n case 'timestamp':\n return '%I:%M:%S';\n case 'year':\n return '%Y';\n default: return '';\n }\n}", "static public function formatDateFromTimestamp($string) {\n if (self::$_static_handler == null) {\n self::$_static_handler = slDatabaseManager::getConnection();\n }\n $format = self::$_static_handler->getDateTimeFormat();\n return date($format, $string);\n }", "function show_date_time($date_time=null,$type){\t\t\n\t\treturn date($type,strtotime(str_replace(\"-\",\"/\",$date_time)));\n\t}", "protected function formatDate($time) {\n\t\treturn strftime(static::dateFormat, $time);\n\t}", "public function date_format($date, $type = 0) {\n\t\tif ($date == '' || $date == \"0000-00-00\") {\n\t\t\treturn \"\";\n\t\t}\n\t\t$st = Yii::$app->getTable;\n\n\t\t$df = $st->settings('local', 'date_format');\n\t\tsetlocale(LC_TIME, 'en_US');\n\t\tif ($type == 1) {\n\t\t\t$result = date(\"$df\", $date); // date($df,strtotime($date));\n\t\t} else {\n\t\t\t$result = date(\"$df\", strtotime($date)); // date($df,strtotime($date));\n\n\t\t}\n\n\t\treturn $result;\n\t}", "function yourls_date_i18n( $dateformatstring, $timestamp = false ) {\n /**\n * @var YOURLS_Locale_Formats $yourls_locale_formats\n */\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\tif ( false === $timestamp ) {\n $timestamp = yourls_get_timestamp( time() );\n\t}\n\n\t// store original value for language with untypical grammars\n\t$req_format = $dateformatstring;\n\n\t/**\n\t * Replace the date format characters with their translatation, if found\n\t * Example:\n\t * 'l d F Y' gets replaced with '\\L\\u\\n\\d\\i d \\M\\a\\i Y' in French\n\t * We deliberately don't deal with 'I', 'O', 'P', 'T', 'Z' and 'e' in date format (timezones)\n\t */\n\tif ( ( !empty( $yourls_locale_formats->month ) ) && ( !empty( $yourls_locale_formats->weekday ) ) ) {\n\t\t$datemonth = $yourls_locale_formats->get_month( date( 'm', $timestamp ) );\n\t\t$datemonth_abbrev = $yourls_locale_formats->get_month_abbrev( $datemonth );\n\t\t$dateweekday = $yourls_locale_formats->get_weekday( date( 'w', $timestamp ) );\n\t\t$dateweekday_abbrev = $yourls_locale_formats->get_weekday_abbrev( $dateweekday );\n\t\t$datemeridiem = $yourls_locale_formats->get_meridiem( date( 'a', $timestamp ) );\n\t\t$datemeridiem_capital = $yourls_locale_formats->get_meridiem( date( 'A', $timestamp ) );\n\n\t\t$dateformatstring = ' '.$dateformatstring;\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])D/\", \"\\\\1\" . yourls_backslashit( $dateweekday_abbrev ), $dateformatstring );\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])F/\", \"\\\\1\" . yourls_backslashit( $datemonth ), $dateformatstring );\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])l/\", \"\\\\1\" . yourls_backslashit( $dateweekday ), $dateformatstring );\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])M/\", \"\\\\1\" . yourls_backslashit( $datemonth_abbrev ), $dateformatstring );\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])a/\", \"\\\\1\" . yourls_backslashit( $datemeridiem ), $dateformatstring );\n\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])A/\", \"\\\\1\" . yourls_backslashit( $datemeridiem_capital ), $dateformatstring );\n\n\t\t$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );\n\t}\n\n\t$date = date( $dateformatstring, $timestamp );\n\n\t// Allow plugins to redo this entirely for languages with untypical grammars\n\treturn yourls_apply_filter('date_i18n', $date, $req_format, $timestamp);\n}", "function s2_date($time)\n{\n if (!$time)\n return '';\n\n $date = date(Lang::get('Date format'), $time);\n $lang_month_small = Lang::get('Inline Months');\n if (isset($lang_month_small))\n $date = str_replace(array_keys($lang_month_small), array_values($lang_month_small), $date);\n\n return $date;\n}", "function formatTime($time, $formatString)\n{\n //if the time is not null\n if($time !== \"NULL\" && isset($time))\n {\n $timestamp = strtotime($time);\n return date($formatString, $timestamp);\n }\n else\n {\n return \"N/A\";\n }\n}", "function time2string($timestamp=''){\n $meses = array('01' => 'enero','02'=>'febrero','03'=>'marzo','04'=>'abril','05'=>'mayo','06'=>'junio','07'=>'julio','08'=>'agosto','09'=>'septiembre','10'=>'octubre','11'=>'noviembre','12'=>'diciembre');\n $partes = preg_split('/[\\s,-]+/',$timestamp);\n $fecha = $partes[2].' de '.$meses[$partes[1]].' de '.$partes[0].' a las '.$partes[3];\n return $fecha;\n}", "public function timeFormat();", "public function date($locale, $dateTime, $format = 'LL') {\n\t\t\tif (substr($format, 0, 1) === 'L' && strpos($format, '%') === false) {\n\t\t\t\t\n\t\t\t\t// Look it up\n\t\t\t\t$format = $this->translate($locale, 'date.format.' . strtolower($format));\n\n\t\t\t}\n\n\t\t\t// Convert to timestamp\n\t\t\t$time = $dateTime->getTimestamp();\n\t\t\treturn strftime($format, $time);\n\n\t\t}", "function FormatTime($format, $date) {\n global $LANG;\n $translate = [];\n $locale = SYSTEM::get('locale');\n if ($locale !== 'en') {\n $datetime = 'datetime'.$locale;\n foreach($LANG[$datetime] as $match => $replace) {\n $translate[$match] = $replace;\n }\n }\n $tz = USER::getUser('tz');\n return empty($translate) ? gmdate($format, $date + (3600 * $tz)) : strtr(gmdate($format, $date + (3600 * $tz)), $translate);\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($date, $time, &$params)\n\t{\n\t\t$time = strftime( $params->get('formattime', '%H:%M'), strtotime( $date.' '.$time ));\n\n\t\treturn $time;\n\t}", "public function prepareDate($timestamp, $fieldType = 'DATETIME') {\n $date = '';\n if (!$timestamp === false && $timestamp > 0) {\n switch ($fieldType) {\n case 'DATE' :\n $date = date('Y-m-d', $timestamp);\n break;\n case 'TIME' :\n $date = date('H:i:s', $timestamp);\n break;\n case 'YEAR' :\n $date = date('Y', $timestamp);\n break;\n default :\n $date = date('Y-m-d H:i:s', $timestamp);\n break;\n }\n }\n return $date;\n }", "function time2date($timestamp=0, $showTime=true) {\n\t\tif ((int)$timestamp < 0) return ' - ';\n\n\t\t// TIMESTAMP EMPTY?\n\t\tif (empty($timestamp)) $timestamp = time();\n\n\t\t// DATE FORMAT\n\t\t$dateForm = ($showTime && !empty($this->timeformat))?\n\t\t\t\t\t\ttrim($this->dateformat .', '. $this->timeformat)\n\t\t\t\t\t\t:\n\t\t\t\t\t\ttrim($this->dateformat);\n\n\t\t// SIMULATION OF MISSING PARAMETERS\n\t\t$search = $replace = array();\n\t\t// '%n' AS MONTH WITHOUT LEADING ZERO\n\t\t$search[] = '%n';\n\t\t$replace[] = date('n', $timestamp);\n\t\t// '%e' AS DAY WITHOUT LEADING ZERO\n\t\t$search[] = '%e';\n\t\t$replace[] = date('j', $timestamp);\n\t\t// '%i' AS HOUR WITHOUT LEADING ZERO\n\t\t$search[] = '%i';\n\t\t$replace[] = date('g', $timestamp);\n\t\t// '%b' AS THREE CHARS OF MONTH (LOCALISED), kh_mod 0.3.1, changed\n\t\t$month = (int)date('n', $timestamp) - 1;\n\t\tif (!empty($this->lang['months'][$month])) {\n\t\t\t$search[] = '%b';\n\t\t\t$replace[] = $this->lang['months'][$month];\n\t\t}\n\t\t// '%r' DISPLAY a.m resp. p.m. STRING\n\t\t$search[] = '%r';\n\t\t$replace[] = strtr(date('a', $timestamp), array('am'=>'a.m.','pm'=>'p.m.'));\n\n\t\t// REPLACE\n\t\t$dateForm = str_replace($search,$replace,$dateForm);\n\n\t\t// DATE AND TIME FORMTTED\n\t\treturn strftime($dateForm, $timestamp);\n\t}", "function utf8_strftime($format, $time)\n{\n if (preg_match('/%p/', $format))\n {\n $ampm = strftime('%p', $time);\n if ($ampm == '')\n {\n $ampm = date('a',$time);\n }\n\n $format = preg_replace('/%p/', $ampm, $format);\n }\n\n $result = strftime($format,$time);\n return utf8_convert_from_locale($result);\n}", "function date_format_translated($format, $timestamp) {\n\tglobal $translation;\n\t\n\t$day_name_short = array($translation['tstat_su'], $translation['tstat_mo'], $translation['tstat_tu'], $translation['tstat_we'], $translation['tstat_th'], $translation['tstat_fr'], $translation['tstat_sa']);\n\t$day_name_full = array($translation['tstat_full_su'], $translation['tstat_full_mo'], $translation['tstat_full_tu'], $translation['tstat_full_we'], $translation['tstat_full_th'], $translation['tstat_full_fr'], $translation['tstat_full_sa']);\n\t$month_name_short = array($translation['tstat_jan'], $translation['tstat_feb'], $translation['tstat_mar'], $translation['tstat_apr'], $translation['tstat_may'], $translation['tstat_jun'],\n \t\t\t\t\t $translation['tstat_jul'], $translation['tstat_aug'], $translation['tstat_sep'], $translation['tstat_oct'], $translation['tstat_nov'], $translation['tstat_dec']);\n\t$month_name_full = array($translation['tstat_full_jan'], $translation['tstat_full_feb'], $translation['tstat_full_mar'], $translation['tstat_full_apr'], $translation['tstat_full_may'], $translation['tstat_full_jun'],\n \t\t\t\t\t $translation['tstat_full_jul'], $translation['tstat_full_aug'], $translation['tstat_full_sep'], $translation['tstat_full_oct'], $translation['tstat_full_nov'], $translation['tstat_full_dec']);\n \t\t\t\t\t \n // Loop char by char through php date format string, cacth the ones which need translating\n//--- PHP 4 :-)--------------------------------\nif(!function_exists('str_split')){\n function str_split($str,$split_lengt=1){\n\n $cnt = strlen($str);\n\n for ($i=0;$i<$cnt;$i+=$split_lengt)\n $rslt[]= substr($str,$i,$split_lengt); \n \n return $rslt;\n }\n} \n//----------------------------------------------\n\t$result = \"\";\n\t$format_chars = str_split($format, 1);\n\tforeach ($format_chars as $format_char) {\n\t\tif ($format_char == \"l\") {\n\t\t\t$day_index = date(\"w\", $timestamp);\n\t\t\t$result = $result . $day_name_full[$day_index];\n\t\t} else if ($format_char == \"D\") {\n\t\t\t$day_index = date(\"w\", $timestamp);\n\t\t\t$result = $result . $day_name_short[$day_index];\n\t\t} else if ($format_char == \"F\") {\n\t\t\t$month_index = date(\"n\", $timestamp) - 1;\n\t\t\t$result = $result . $month_name_full[$month_index];\n\t\t} else if ($format_char == \"M\") {\n\t\t\t$month_index = date(\"n\", $timestamp) - 1;\n\t\t\t$result = $result . $month_name_short[$month_index];\n\t\t} else {\n\t\t\t$result = $result . date($format_char, $timestamp);\n\t\t}\n\t}\n\t\n\treturn $result;\n}", "function template_date_format($timestamp,$showtime = FALSE)\n {\n if ($showtime == TRUE) {\n $date = date_format($timestamp,TRUE);\n } else {\n $date = date_format($timestamp,FALSE);\n }\n return $date;\n }", "protected function strftime($format, $datetime = null, $locale = null)\n\t{\n\t\tif (isset($locale)) {\n\t\t\t$oldLocale = setlocale(LC_TIME, \"0\");\n\t\t\tsetlocale(LC_TIME, $locale);\n\t\t}\n\t\t$return = \"\";\n\t\tif ($format) {\n\t\t\tif (isset($datetime)) {\n\t\t\t\tif ($datetime instanceof \\DateTime) {\n\t\t\t\t\t$timestamp = $datetime->format('U');\n\t\t\t\t} else {\n\t\t\t\t\t$timestamp = $datetime;\n\t\t\t\t}\n\t\t\t\t$return = strftime($format, $timestamp);\n\t\t\t} else {\n\t\t\t\t$return = strftime($format);\n\t\t\t}\n\t\t}\n\t\tif (isset($locale)) {\n\t\t\tsetlocale(LC_TIME, $oldLocale);\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "function dateElementFromEnglish($locale,$text,$strfTimeformat) {\n\t$saveLocale = setlocale(LC_TIME,0);setlocale(LC_TIME,$locale);\n\t$translation = strftime($strfTimeformat,strtotime($text));\n\tsetlocale(LC_TIME,$saveLocale);\n\treturn $translation;\n}", "function cjpopups_wp_date($timestamp, $time = null){\n\t$date_format = get_option('date_format');\n\t$time_format = (!is_null($time)) ? ' '.get_option('time_format') : '';\n\t$return_format = $date_format.$time_format;\n\treturn date($return_format, $timestamp);\n}", "public function formatTime(DateTimeInterface $time, Locale|string|null $locale = null): string\n {\n return $this->getFormatter($locale)->formatTime($time);\n }", "protected function formatTimestamp($time) {\n return date('Y-m-d H:i:s', !empty($time) ? $time : time());\n }", "function format_time(string $time = NULL, string $format = \"standard\"): ?string {\n\tif (!empty($time)) {\n\t\treturn date('g:i A', strtotime(trim($time)));\n\t}\n\telse {\n\t\treturn NULL;\n\t}\n}", "public static function timeToStr($format, $time=0){\n if(!$time){\n return date($format);\n }\n return date($format, $time);\n }", "public function getTimestampFormatter();", "public static function nice($dateString = null, $time = true)\n {\n $date = ($dateString) ? ((int)$dateString) ? $dateString : strtotime($dateString) : time();\n\n $y = (self::isThisYear($date)) ? '' : ' Y';\n\n if (self::isToday($date)) {\n $return = ($time) ? sprintf(CoreModule::t('Today') . ', %s', date(\"H:i\", $date)) : CoreModule::t('Today');\n } elseif (self::wasYesterday($date)) {\n $return = ($time) ? sprintf(CoreModule::t('Yesterday') . ', %s', date(\"H:i\", $date)) : CoreModule::t('Yesterday');\n } else {\n $return = ($time) ? date(\"d F{$y}, H:i\", $date) : date(\"d M{$y}\", $date);\n }\n\n return $return;\n }", "private function formatDateAndTimeStrings ($day, $dateString, $timeString) {\n \n $this->day = $day;\n $this->dateString = $dateString;\n $this->timeString = $timeString;\n $this->date_time = $dateString.' '.$timeString;\n\n $this->shortDay = getShortDay ($day);\n $this->shortDate = getShortDate ($dateString);\n $this->longDate = getLongDate ($dateString);\n $this->shortMonth = getShortMonth ($dateString);\n $this->dayOfMonth = getDayOfMonth ($dateString);\n $this->timeOfDay = get12HourTime ($timeString);\n\n }", "public function formatTime(\n $time = null,\n $format = \\Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface::FORMAT_TYPE_SHORT,\n $showDate = false\n );", "public static function timeStampToString($time = 0, $format = 'Y-m-d H:i:s')\r\n {\r\n if ($format == 'mysql') {\r\n $format = 'Y-m-d H:i:s';\r\n }\r\n \r\n if ($time == 0) {\r\n $time = time();\r\n }\r\n \r\n return date($format, $time);\r\n }", "function timestampformat($type) {\r\r\n\t\tif (!isset($_SESSION['timestampformat'])) {\r\r\n\t\t\t$prefix=$GLOBALS['core']->tbl_prefix;\r\r\n\t\t\t$q = $GLOBALS['core']->query(\"SELECT timestamp FROM ${prefix}mod_visitors_hit LIMIT 0, 1\", false);\r\r\n\t\t\t$q = $q->fetchRow();\r\r\n\t\t\tif (!$q) return array(0, 0);\r\r\n\t\t\tif (eregi(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}\", $q['timestamp']))\r\r\n\t\t\t\t$_SESSION['timestampformat'] = array('year'=>array(4, 6), 'month'=>array(7, 9), 'day'=>array(10, 12));\r\r\n\t\t\telse \r\r\n\t\t\t\t$_SESSION['timestampformat'] = array('year'=>array(4, 5), 'month'=>array(6, 7), 'day'=>array(8, 9));\r\r\n\t\t}\r\r\n\t\treturn $_SESSION['timestampformat'][$type];\r\r\n\t}", "public function getMessageTime ($timestamp)\n\t{\n\t\t$timestamp = explode(' ', $timestamp);\n\t\t$date = explode('-', $timestamp[0]);\n\t\t$time = explode(':', $timestamp[1]);\n\t\t$time[2] = ($time[0] > 12) ? 'PM' : 'AM';\n\t\tif ($time[0] > 12) $time[0] -= 12;\n\t\tif ($time[0] == 0) $time[0] = '01';\n\t\t\n\t\t$timestamp = $date[1] . '/' . $date[2] . '/' . $date[0] . ' ' . $time[0] . ':' . $time[1] . ' ' . $time[2];\n\t\treturn $timestamp;\n\t}", "static function translate_format( $field )\n\t\t{\n\t\t\treturn strtr( $field['js_options']['dateFormat'], self::$date_format_translation )\n\t\t\t. $field['js_options']['separator']\n\t\t\t. strtr( $field['js_options']['timeFormat'], self::$time_format_translation );\n\t\t}", "public static function displayFormat($dateStr, $type='date', $absoluteTime = FALSE) {\n \\Yii::$app->formatter->timeZone = \\Yii::$app->getTimeZone();\n if ($type === 'datetime') {\n $fmt = 'php:d-m-Y H:i:s';\n }\n elseif ($type === 'datetime2') {\n $fmt = 'php:d-m-Y H:i';\n }\n elseif ($type === 'time') {\n $fmt = self::TIME_FORMAT;\n }\n elseif ($type === 'date') {\n $fmt = self::DATE_FORMAT;\n }\n else {\n $fmt = 'php:d-m-Y';\n }\n\n if($absoluteTime) {\n // Krijg niet het de goede tijd terug waneer de looptijd berekend wordt.\n // Werkt wel wanneer ik hie UTC gebruik. Naderhand weer terug gezet.\n \\Yii::$app->formatter->timeZone = \"UTC\";\n }\n $time = \\Yii::$app->formatter->asDate($dateStr, $fmt);\n \\Yii::$app->formatter->timeZone = \\Yii::$app->getTimeZone();\n return $time;\n\n }", "public function toLocale($value, Type $type = null)\n\t{\n\t\tif (isset($type)) {\n\t\t\tif ($type->isDateTime()) {\n\t\t\t\treturn $this->date_format->toLocale($value);\n\t\t\t}\n\t\t\telseif ($type->isFloat()) {\n\t\t\t\treturn $this->number_format->floatToLocale($value);\n\t\t\t}\n\t\t\telseif ($type->isInteger()) {\n\t\t\t\treturn $this->number_format->integerToLocale($value);\n\t\t\t}\n\t\t}\n\t\t$context = $type->isClass() ? $type->getElementTypeAsString() : Loc::getContext();\n\t\treturn $this->translations->translate($value, $context);\n\t}", "protected function formatTime($time) {\n $year = date('Y');\n $date = null;\n $formattedTime = trim($time);\n $normalFormat = preg_match('/^([0-9]{1,2}) (\\S+) в ([0-9:]{5})/', $formattedTime, $date);\n if ($normalFormat) {\n $day = $date[1];\n $month = $this->formatMonth($date[2]);\n $hoursAndMinutes = $date[3];\n $formattedTime = \"{$year}-{$month}-{$day} {$hoursAndMinutes}\";\n } else {\n preg_match('/(\\S+) в ([0-9:]{5})/', $formattedTime, $date);\n $yearMonthDay = ($date[1] == 'сегодня')?date('Y-n-j'):date('Y-n-j', strtotime('yesterday'));\n $hoursAndMinutes = $date[2];\n $formattedTime = \"{$yearMonthDay} {$hoursAndMinutes}\";\n }\n\n return $formattedTime;\n }", "function timestampToString($time) {\n\treturn date('Y-m-d H:i:s', $time);\n}", "static function formatTime($time){\n return date('j.n.Y G:i:s', $time);\n\n }", "public function getTimeFormatter();", "function dateView($date,$dateOpt=null,$timeOpt=null) {\n\n //if there's a \":\" in it, we've been passed a time and date. otherwise, just a date\n if (!$date) return false;\n \n if (strstr($date,\":\")) {\n \n $arr = explode(\" \",$date);\n $date = formatDate($arr[0],$dateOpt);\n $time = formatTime($arr[1],$timeOpt);\n\n\t $str = $date.\" \"._I18N_AT.\" \".$time;\n\t return $str;\n\n } else {\n\n return formatDate($date,$dateOpt);\n \n } \n \n}", "function date_get_date($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date'], $timestamp);\n}", "function sky_date_french($format, $timestamp = null, $echo = null)\n{\n $param_D = array('', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim');\n $param_l = array('', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche');\n $param_F = array('', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');\n $param_M = array('', 'Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc');\n $return = '';\n if (is_null($timestamp)) {\n $timestamp = mktime();\n }\n for ($i = 0, $len = strlen($format); $i < $len; $i++) {\n switch ($format[$i]) {\n case '\\\\': // fix.slashes\n $i++;\n $return .= isset($format[$i]) ? $format[$i] : '';\n break;\n case 'D':\n $return .= $param_D[date('N', $timestamp)];\n break;\n case 'l':\n $return .= $param_l[date('N', $timestamp)];\n break;\n case 'F':\n $return .= $param_F[date('n', $timestamp)];\n break;\n case 'M':\n $return .= $param_M[date('n', $timestamp)];\n break;\n default:\n $return .= date($format[$i], $timestamp);\n break;\n }\n }\n if (is_null($echo)) {\n return $return;\n } else {\n echo $return;\n }\n}", "function formatDateLocaleVersDB($date, $type = 2)\n {\n $date = ltrim($date);\n $date = rtrim($date);\n /*\n * Separation de la date et de l'heure\n */\n $temp = @explode(\" \", $date);\n $date = $temp[0];\n $heure = $temp[1];\n $j = 0;\n do {\n $test = @strpos($date, $this->sepValide[$j]);\n if ($test === false) {\n $j++;\n }\n } while ($j < count($this->sepValide) && ($test === false));\n $separateurLocal = $this->sepValide[$j];\n $temp = @explode($separateurLocal, $date);\n /*\n * Assignation des champs\n */\n switch ($this->formatDate) {\n case 0:\n $annee = $temp[0];\n $mois = $temp[1];\n $jour = $temp[2];\n break;\n case 1:\n $annee = $temp[2];\n $mois = $temp[1];\n $jour = $temp[0];\n break;\n case 2:\n $annee = $temp[2];\n $mois = $temp[0];\n $jour = $temp[1];\n break;\n }\n /*\n * Prise en compte de l'annee par defaut\n */\n if ($annee == \"\") {\n $annee = date(\"Y\");\n }\n\n if ($annee < 100) {\n if ($annee <= $this->dateMini) {\n $annee = \"20\" . $annee;\n } else {\n $annee = \"19\" . $annee;\n }\n }\n\n $date = $annee . $this->separateurDB . $mois . $this->separateurDB . $jour;\n /*\n * Reintegration de l'heure le cas echeant\n */\n if ($type == 3) {\n $date .= \" \" . $heure;\n }\n return $date;\n }", "private function convertTimestampFormat($timestamp)\n {\n return str_replace('T', ' ', substr($timestamp, 0, 19));\n }", "public static function fuzzyTimeString($time = 0)\r\n {\r\n if (!is_numeric($time)) {\r\n $time = izDateTime::timeStringToStamp($time);\r\n }\r\n\r\n $now = time();\r\n $sodTime = mktime(0, 0, 0, date('m', $time), date('d', $time), date('Y', $time));\r\n $sodNow = mktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));\r\n \r\n if ($sodNow == $sodTime) {\r\n return 'today at ' . date('g:ia', $time); // check 'today'\r\n } else if (($sodNow - $sodTime) <= 86400) {\r\n return 'yesterday at ' . date('g:ia', $time); // check 'yesterday'\r\n } else if (($sodNow - $sodTime) <= 432000) {\r\n return date('l \\a\\\\t g:ia', $time); // give a day name if within the last 5 days\r\n } else if (date('Y', $now) == date('Y', $time)) {\r\n return date('M j \\a\\\\t g:ia', $time); // miss off the year if it's this year\r\n } else {\r\n return date('M j, Y \\a\\\\t g:ia', $time); // return the date as normal\r\n }\r\n }", "function getDateString($timeAmount) {\r\n\tswitch($timeAmount) {\r\n\t\tcase \"start\":\r\n\t\t\treturn \"right now.\";\r\n\t\t\tbreak;\r\n\t\tcase \"ten_before\":\r\n\t\t\treturn \"in 10 minutes.\";\r\n\t\t\tbreak;\r\n\t\tcase \"thirty_before\":\r\n\t\t\treturn \"in 30 minutes.\";\r\n\t\t\tbreak;\r\n\t\tcase \"hour_before\":\r\n\t\t\treturn \"in 1 hour.\";\r\n\t\t\tbreak;\r\n\t\tcase \"day_before\":\r\n\t\t\treturn \"in 1 day.\";\r\n\t\t\tbreak;\r\n\t\tcase \"week_before\":\r\n\t\t\treturn \"in 1 week.\";\r\n\t\t\tbreak;\r\n\t\tdefault: \r\n\t\t\treturn \"unknown event time.\";\r\n\t\t\tbreak;\r\n\t}\r\n}", "public function _strings_for_pot() {\n\t\t/* translators: Localized date format, see https://www.php.net/date */\n\t\t__( 'F j, Y' );\n\t\t/* translators: Localized time format, see https://www.php.net/date */\n\t\t__( 'g:i a' );\n\t\t/* translators: Localized date and time format, see https://www.php.net/date */\n\t\t__( 'F j, Y g:i a' );\n\t}", "function format_date($format, $timestamp, $timezone, $lang = LANG_NO)\n{\n\tglobal $_date_translations, $_default_date_translations, $_lang;\n\t\n\t$translations = $_default_date_translations;\n\tif (is_valid_lang($lang) && $lang != $_lang)\n\t{\n\t\t$lang_code = get_lang_code($lang);\n\t\tif (!isset($_date_translations[$lang_code]))\n\t\t{\n\t\t\t$_date_translations[$lang_code] = include(__DIR__ . '/languages/' . $lang_code . '/date.php');\n\t\t}\n\t\t$translations = $_date_translations[$lang_code];\n\t}\n\n\tdate_default_timezone_set($timezone);\n\t$row = date($format, $timestamp);\n\tforeach ($translations as $eng => $localized)\n\t{\n\t\t$row = str_replace($eng, $localized, $row);\n\t}\n\treturn $row;\n}", "public function formatSimpleTime($value = 0, $timezone = '', $type = \\intlDateFormatter::MEDIUM)\n {\n if (empty($value)) {\n $value = time();\n }\n\n $dateObject = $this->_getDateObject(\\intlDateFormatter::NONE, $type, $timezone);\n return $dateObject->format($value);\n }", "public function toString($date_format = 'short',$time_format = 'medium') {\n // NONE, NONE : 20150522 09:39 AM\n // Time Format :\n // SHORT : 09:39\n // MEDIUM : 09:39:59\n // LONG : 09:39:59 UTC-07:00\n // FULL : 09:39:59 heure avancée du Pacifique\n // Date Format :\n // SHORT : 22/05/15\n // MEDIUM : 22 mai 2015\n // LONG : 22 mai 2015\n // FULL : vendredi 22 mai 2015\n return static::getFormatter($date_format,$time_format)->format($this);\n }", "function Time_Format($text)\r\n{\r\n\tif($text ==\"\" || $text ==\"0000-00-00 00:00:00\")\r\n\t\treturn \"---\";\r\n\telse\r\n\t\treturn date('M j, y [G:i]',strtotime($text));\r\n}", "public function timeToString($tm, $type=false)\r\n\t\t{\r\n\t\t\tif (!$type || $type === 'date')\r\n\t\t\t\t$typeTime = '%x';\r\n\t\t\telse if ($type === 'datetime')\r\n\t\t\t\t$typeTime = '%x %X';\r\n\t\t\telse if ($type === 'time')\r\n\t\t\t\t$typeTime = '%X';\r\n\t\t\telse if ($type === 'datetimenosec')\r\n\t\t\t\t$typeTime = '%x %H:%M';\r\n\t\t\telse if ($type === 'timenosec')\r\n\t\t\t\t$typeTime = '%H:%M';\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t\tif(!$this->emuMode)\r\n\t\t\t\treturn strftime($typeTime, $tm);\r\n\t\t\telse\r\n\t\t\t\treturn self::emu_strftime($typeTime, $tm);\r\n\t\t}", "function Post_Time($timestamp)\n{\n\t$hrformat = \"%A, %d.%m.%Y. u %H:%M\"; \n\t$res = strftime($hrformat,strtotime($timestamp)); \n\t$vrijeme = iconv('ISO-8859-2', 'UTF-8', $res);\n\t\n\techo($vrijeme);\t\n}", "public static function formatTimestamp($rawTimestamp) {\n $timeString = date(\"h:i a | F j, o\", strtotime($rawTimestamp));\n return $timeString;\n }", "function _safe_strftime($format,$timestamp) {\r\n \r\n if ($timestamp>3600)\r\n return strftime($format,$timestamp);\r\n else\r\n return \"--\";\r\n \r\n}", "public static function jev_strftime($format = '', $timestamp = null, $timezone = false, $datetime = false)\n\t{\n\n\t\tif (!$timestamp) $timestamp = time();\n\n\t\t// Replace names by own translation to get rid of improper os system library\n\t\tif (strpos($format, '%a') !== false)\n\t\t\t$format = str_replace('%a', JEVHelper::getShortDayName(date('w', $timestamp)), $format);\n\t\tif (strpos($format, '%A') !== false)\n\t\t\t$format = str_replace('%A', JEVHelper::getDayName(date('w', $timestamp)), $format);\n\t\tif (strpos($format, '%b') !== false)\n\t\t\t$format = str_replace('%b', JEVHelper::getShortMonthName(date('n', $timestamp)), $format);\n\t\tif (strpos($format, '%B') !== false)\n\t\t\t$format = str_replace('%B', JEVHelper::getMonthName(date('n', $timestamp)), $format);\n\t\tif (strpos($format, '%Z') !== false && $timezone)\n\t\t{\n\t\t\t$format = str_replace('%Z', $timezone->getName(), $format);\n\t\t}\n\t\tif (strpos($format, '%z') !== false && $timezone && $datetime)\n\t\t{\n\t\t\t$offset = $timezone->getOffset($datetime);\n\t\t\t$format = str_replace('%z', $offset/3600 , $format);\n\t\t}\n\n\t\tif (IS_WIN)\n\t\t{\n\t\t\tif (!class_exists('JEV_CompatWin'))\n\t\t\t{\n\t\t\t\trequire_once(dirname(__FILE__) . '/compatwin.php');\n\t\t\t}\n\n\t\t\treturn JEV_CompatWin::win_strftime($format, $timestamp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn JevDate::strftime($format, $timestamp);\n\t\t}\n\n\t}", "public function getTimeFormat(string $locale): string\n {\n return $this->getConfig('time', $locale);\n }", "public static function siteDateFormat($timestamp)\n\t{\n\t\t$dt = new DateTime(\"@\".$timestamp);\n\t\t$dt->setTimeZone(new DateTimeZone(Config::date('timezone')));\n\t\treturn $dt->format(\"D d M Y\");\n\t}", "function date2text($the_date, $language='en'){\n // Input: $the_date = 'YYYY-MM-DD'\n // ie: date2text('2018-04-25', 'en') => '25th of April 2018'\n list($year, $month, $day) = explode('-', $the_date);\n $month = (int)$month;\n $day = (int)$day;\n \n if($language == 'fr'){\n $months = [1=>'janvier',\n 2=>'f&eacute;vrier',\n 3=>'mars',\n 4=>'avril',\n 5=>'mai',\n 6=>'juin',\n 7=>'juillet',\n 8=>'ao&ucirc;t',\n 9=>'septembre',\n 10=>'octobre',\n 11=>'novembre',\n 12=>'d&eacute;cembre',\n ];\n return $day.' '.$months[$month].' '.$year;\n }elseif($language == 'nl'){\n $months = [1=>'januari',\n 2=>'februari',\n 3=>'maart',\n 4=>'april',\n 5=>'mei',\n 6=>'juni',\n 7=>'juli',\n 8=>'augustus',\n 9=>'september',\n 10=>'oktober',\n 11=>'november',\n 12=>'december',\n ];\n return $day.' '.$months[$month].' '.$year;\n }\n $months = [1=>'January',\n 2=>'February',\n 3=>'March',\n 4=>'April',\n 5=>'May',\n 6=>'June',\n 7=>'July',\n 8=>'August',\n 9=>'September',\n 10=>'October',\n 11=>'November',\n 12=>'December',\n ];\n switch($day){\n case 1:\n case 21:\n case 31:\n $day .= 'st';\n break;\n case 2:\n case 22:\n $day .= 'nd';\n break;\n case 3:\n case 23:\n $day .= 'rd';\n break;\n default:\n $day .= 'th';\n }\n return $day.' of '.$months[$month].' '.$year;\n}", "function getTypeFormat($locale, $type, $key, $localizedFormats = null);", "private function _columnTypeTranslation($type) {\n $map = array(\n 'datetime' => 'timestamp',\n );\n if(!empty($map[$type])) {\n return $map[$type];\n }\n return $type;\n }", "function translate_metadate_to_string( $short_date = false ) {\n\t\n\tglobal $post;\n\t\n\t$output = '';\n\t$meta_day \t= get_the_time('D');\n\t$meta_date\t= get_the_time('d');\n\t$meta_month\t= get_the_time('M');\n\t$meta_year\t= get_the_time('Y');\n\t\n\tif ($short_date) {\n\t\tswitch ($meta_day) {\n\t\t\t\n\t\t\t//Translate Weekday\n\t\t\tcase 'Mon':\n\t\t\t\t$output .= __( 'Monday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Tue':\n\t\t\t\t$output .= __( 'Tuesday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Wed':\n\t\t\t\t$output .= __( 'Wednesday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Thu':\n\t\t\t\t$output .= __( 'Thursday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Fri':\n\t\t\t\t$output .= __( 'Friday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Sat':\n\t\t\t\t$output .= __( 'Saturday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'Sun':\n\t\t\t\t$output .= __( 'Sunday' , 'sptheme' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n\t\n\t$output .= ' ' . $meta_date . ' ';\n\t\n\t//Translate Month\n\tswitch ($meta_month) {\n\t\t\n\t\tcase 'Jan':\n\t\t\t$output .= __( 'January' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'Feb':\n\t\t\t$output .= __( 'February' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'Mar':\n\t\t\t$output .= __( 'March' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'Apr':\n\t\t\t$output .= __( 'April' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'May':\n\t\t\t$output .= __( 'May' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'Jun':\n\t\t\t$output .= __( 'June' , 'sptheme' );\n\t\t\tbreak;\n\t\t\n\t\tcase 'Jul':\n\t\t\t$output .= __( 'July' , 'sptheme' );\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'Aug':\n\t\t\t$output .= __( 'August' , 'sptheme' );\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'Sep':\n\t\t\t$output .= __( 'September' , 'sptheme' );\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'Oct':\n\t\t\t$output .= __( 'October' , 'sptheme' );\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'Nov':\n\t\t\t$output .= __( 'November' , 'sptheme' );\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'Dec':\n\t\t\t$output .= __( 'December' , 'sptheme' );\n\t\t\tbreak;\t\t\t\t\t\n\t\t\n\t\tdefault:\n\t\t\tbreak;\n\t\t\n\t}\n\t\n\t$output .= ', ' . $meta_year;\n\t\t\n\treturn $output;\t\n}", "function get_post_time($format = 'U', $gmt = \\false, $post = \\null, $translate = \\false)\n {\n }", "function date_i18n($format, $timestamp_with_offset = \\false, $gmt = \\false)\n {\n }", "public function viewHelperRespectsDefaultTimezoneForStringTimestampDataProvider() {}", "public function formatTime($time) {\n\t\t$timestamp = strtotime($time);\n\t\treturn date(\"F d, Y - g:i A\", $timestamp);\n\t}", "private function formatTime($timestamp)\n {\n return date('Y-m-d', $timestamp);\n }", "function eo_format_datetime($datetime,$format='d-m-Y'){\n\tglobal $wp_locale;\n\n\tif ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) :\n\t\t\t//Translate\n\t\t\t$datemonth = $wp_locale->get_month($datetime->format('m'));\n\t\t\t$datemonth_abbrev = $wp_locale->get_month_abbrev($datemonth);\n\t\t\t$dateweekday = $wp_locale->get_weekday($datetime->format('w'));\n\t\t\t$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );\n\t\t\t$datemeridiem = trim($wp_locale->get_meridiem($datetime->format('a')));\n\t\t\t$datemeridiem_capital =$wp_locale->get_meridiem($datetime->format('A'));\n\n\t\t\t$datemeridiem = (empty($datemeridiem) ? $datetime->format('a') : $datemeridiem);\n\t\n\t\t\t$dateformatstring = ' '.$format;\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])D/\", \"\\\\1\" . backslashit( $dateweekday_abbrev ), $dateformatstring );\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])F/\", \"\\\\1\" . backslashit( $datemonth ), $dateformatstring );\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])l/\", \"\\\\1\" . backslashit( $dateweekday ), $dateformatstring );\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])M/\", \"\\\\1\" . backslashit( $datemonth_abbrev ), $dateformatstring );\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])a/\", \"\\\\1\" . backslashit( $datemeridiem ), $dateformatstring );\n\t\t\t$dateformatstring = preg_replace( \"/([^\\\\\\])A/\", \"\\\\1\" . backslashit( $datemeridiem_capital ), $dateformatstring );\n\t\t\t$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );\n\t endif;\t\n\n\treturn $datetime->format($dateformatstring);\n}", "function _t($str/*[, mixed $args [, mixed $... ]]*/)\n{\n global $lc_lang;\n global $lc_translation;\n global $lc_translationEnabled;\n\n $args = func_get_args();\n $str = array_shift($args);\n $str = trim($str);\n\n if ($lc_translationEnabled == false) {\n return (count($args)) ? vsprintf($str, $args) : $str;\n }\n\n $po = session_get('po');\n if (!is_array($po)) {\n $po = array();\n }\n $po[$str] = '';\n\n if (isset($lc_translation[$lc_lang])) {\n # check with lowercase\n $lowerStr = strtolower($str);\n if (isset($lc_translation[$lc_lang][$lowerStr]) && !empty($lc_translation[$lc_lang][$lowerStr])) {\n $translated = $lc_translation[$lc_lang][$lowerStr];\n $str = (is_array($translated)) ? $translated[0] : $translated;\n }\n }\n\n if (isset($translated)) {\n $po[$str] = $translated;\n }\n return (count($args)) ? vsprintf($str, $args) : $str;\n}", "function the_time($format = '')\n {\n }", "function display_time ( $time, $ignore_offset=0 ) {\n\tglobal $TZ_OFFSET;\n\t$hour = (int) ( $time / 10000 );\n\tif ( ! $ignore_offset )\n\t$hour += $TZ_OFFSET;\n\t$min = abs( ( $time / 100 ) % 100 );\n\t//Prevent goofy times like 8:00 9:30 9:00 10:30 10:00\n\tif ( $time < 0 && $min > 0 ) $hour = $hour - 1;\n\twhile ( $hour < 0 )\n\t$hour += 24;\n\twhile ( $hour > 23 )\n\t$hour -= 24;\n\tif ( $GLOBALS[\"TIME_FORMAT\"] == \"12\" ) {\n\t\t$ampm = ( $hour >= 12 ) ? \"pm\" : \"am\";\n\t\t$hour %= 12;\n\t\tif ( $hour == 0 )\n\t\t$hour = 12;\n\t\t$ret = sprintf ( \"%d:%02d%s\", $hour, $min, $ampm );\n\t} else {\n\t\t$ret = sprintf ( \"%d:%02d\", $hour, $min );\n\t}\n\treturn $ret;\n}", "function french_to_english_datetime($datetime, $format='Y-m-d H:i:s') {\n\tif(\\DateTime::createFromFormat('d/m/Y H:i:s', $datetime)) {\n\t\treturn \\DateTime::createFromFormat('d/m/Y H:i:s', $datetime)->format($format);\n\t}\n\treturn null;\n}", "function ldate($format, $timestamp = null) {\n\tif (1 === func_num_args( )) {\n\t\t$timestamp = time( );\n\t}\n\n\tif ( ! is_numeric($timestamp)) {\n\t\t$timestamp = strtotime($timestamp);\n\t}\n\n\tdate_default_timezone_set($GLOBALS['_TZ']);\n\t$date = date($format, $timestamp);\n\tdate_default_timezone_set('UTC');\n\n\treturn $date;\n}", "protected function formatTimestamp($timestamp)\n {\n if ($this->timestampType === 'date')\n {\n $timestamp = new MongoDate(round($timestamp));\n }\n else\n {\n if ($this->timestampType === 'string')\n {\n $timestamp = date('Y-m-d H:i:s', $timestamp);\n }\n else\n {\n $timestamp = $timestamp;\n }\n }\n\n return $timestamp;\n }", "function e_formatDate($tstamp){\n $m = intval(date(\"m\", $tstamp));\n $d = (date(\"d\", $tstamp));\n $l = strtolower((date(\"l\", $tstamp)));\n switch ($m) {\n case 1: $m_name = $lang_months_short[0]; break;\n case 2: $m_name = $lang_months_short[1]; break;\n case 3: $m_name = $lang_months_short[2]; break;\n case 4: $m_name = $lang_months_short[3]; break;\n case 5: $m_name = $lang_months_short[4]; break;\n case 6: $m_name = $lang_months_short[5]; break;\n case 7: $m_name = $lang_months_short[6]; break;\n case 8: $m_name = $lang_months_short[7]; break;\n case 9: $m_name = $lang_months_short[8]; break;\n case 10: $m_name = $lang_months_short[9]; break;\n case 11: $m_name = $lang_months_short[10]; break;\n case 12: $m_name = $lang_months_short[11]; break;\n default: $m_name = \"\"; break;\n }\n\n switch ($l) {\n case 'sunday': $l_name = $lang_days[0]; break;\n case 'monday': $l_name = $lang_days[1]; break;\n case 'tuesday': $l_name = $lang_days[2]; break;\n case 'wednesday': $l_name = $lang_days[3]; break;\n case 'thursday': $l_name = $lang_days[4]; break;\n case 'friday': $l_name = $lang_days[5]; break;\n case 'saturday': $l_name = $lang_days[6]; break;\n default: $l_name = \"\"; break;\n }\n return $d . \" \" . $m_name . \"(\" . $l_name . \")\";\n }", "public function getDateFormat($type = null);", "public static function timeFormat($time = 0, $format = 'Y-m-d H:i:s')\r\n {\r\n if (!is_numeric($time)) {\r\n $time = izDateTime::timeStringToStamp($time);\r\n }\r\n \r\n if ($time == 0) {\r\n $time = time();\r\n }\r\n\r\n return izDateTime::timeStampToString($time, $format);\r\n }" ]
[ "0.6706632", "0.6418938", "0.6399475", "0.63208014", "0.61560684", "0.59890026", "0.5985692", "0.5985692", "0.5930802", "0.57994646", "0.578247", "0.5779096", "0.5758838", "0.57588124", "0.57393134", "0.5688777", "0.5686392", "0.5627449", "0.56128955", "0.5556577", "0.5541157", "0.55196494", "0.5495987", "0.5441744", "0.54383856", "0.5432868", "0.54320574", "0.5423339", "0.5412459", "0.53815675", "0.5352364", "0.53350013", "0.5318307", "0.53085965", "0.53065914", "0.52846617", "0.52704614", "0.52538645", "0.52532846", "0.52268577", "0.5217122", "0.52133703", "0.5190623", "0.51807815", "0.51686394", "0.5152469", "0.51399314", "0.5115538", "0.5076848", "0.50713474", "0.5066814", "0.5063369", "0.5059607", "0.5047094", "0.5042513", "0.5029853", "0.50241184", "0.50099105", "0.50016785", "0.49687564", "0.4966772", "0.4965942", "0.49597543", "0.49544153", "0.4952973", "0.4952758", "0.4947734", "0.49417657", "0.49404824", "0.49376437", "0.492926", "0.49282992", "0.49271828", "0.4920105", "0.49124205", "0.49074313", "0.49042135", "0.4897247", "0.4879012", "0.48718038", "0.4861976", "0.48614246", "0.48436943", "0.48412162", "0.4840502", "0.483876", "0.4837626", "0.4835552", "0.4833822", "0.482459", "0.48204187", "0.4816189", "0.48158702", "0.48086935", "0.48041284", "0.47967193", "0.47925922", "0.47914657", "0.47881058", "0.47845775" ]
0.6119174
5
Inject function when saving
public function save(array $options = []) { parent::save(); $this->formulir->formulirable_type = get_class($this); $this->formulir->formulirable_id = $this->id; $this->formulir->save(); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onAfterSave();", "function after_save() {}", "protected function hook_afterSave(){}", "abstract public static function saved($callback);", "public function postSave() {}", "public function save() {}", "public function save() {}", "public function save() {}", "public function preSave() {}", "public abstract function save();", "public function preSave() { }", "public function afterSave(){\n\t}", "public function onBeforeSave();", "public function afterSave()\n {\n\n }", "function save()\n {\n }", "function save()\n {\n }", "protected function hook_beforeSave(){}", "public function save()\r\n {\r\n //\r\n }", "public function save() {\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "protected function _postSave()\r\n\t{\r\n\t}", "protected function beforeSaveInDB(){}", "protected function afterSave() {\n\n }", "public function save()\n {\n }", "public function save()\n {\n }", "public function save():void;", "public function save() {\n }", "public function save() {\n }", "public function save() {\n\n }", "function save();", "function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function afterSaveCommit(): void\n {\n }", "public function save()\n {\n //\n }", "public function save()\n\t{\n\n\t}", "public function save() {\n\t\t\t\n\t\t}", "public function post_save(){\n\n }", "function before_save(){}", "public function save()\r\n {\r\n \r\n }", "public final function save() {\n }", "private function _saveExt() {\r\n\r\n }", "public function save(){\n }", "function _save_post_hook()\n {\n }", "public function save()\n {\n }", "public function save()\n {\n // For V2.0\n }", "function onSave()\n {\n $object = parent::onSave();\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "public final function save()\n {\n }", "public function Save()\n {\n }", "function Save();", "function save() {\n //save the added fields\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function saveToDB()\n {\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "public function save($method = true) {}", "protected function saveInsert()\n {\n }", "protected function _beforeSave() {\n\t}", "public function before_save() {\n \n }", "public function before_save() {\n \n }", "public function saveData()\r\n {\r\n \r\n }", "protected function onBeforeSave()\n {\n }", "function customize_save($customizer)\n {\n }", "function saveVister()\n {\n \n }", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "function preSave()\n {\n }", "protected function saveUpdate()\n {\n }", "abstract protected function save($data);", "public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function getSaveMethod() {}", "protected function beforeSave() {\n\n }", "function onsave(){\n\t\treturn true;\n\t}", "function preSave()\n\t{\n\n\t}", "public function onSaving(Step $step): void\n {\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "public static function saving($callback)\n {\n self::listenEvent('saving', $callback);\n }", "public function beforeSave(){\n\t}" ]
[ "0.75574815", "0.74190736", "0.7367076", "0.73183525", "0.7296953", "0.7281775", "0.7281775", "0.7281147", "0.72363794", "0.71672297", "0.7081549", "0.70772314", "0.7058463", "0.7029529", "0.7027085", "0.7027085", "0.7019591", "0.70089823", "0.7006287", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.6989736", "0.698664", "0.6985263", "0.69720894", "0.69707054", "0.69707054", "0.6960098", "0.6955942", "0.6955942", "0.6947046", "0.69301766", "0.69301766", "0.69273764", "0.69273764", "0.69273764", "0.69273764", "0.69273764", "0.6882181", "0.68814", "0.6859507", "0.685497", "0.68467426", "0.6803016", "0.6794383", "0.6782767", "0.67207754", "0.6700203", "0.6699736", "0.66955435", "0.66897243", "0.66830903", "0.6677667", "0.66748255", "0.6666641", "0.66539556", "0.66008997", "0.65888244", "0.6587344", "0.6580424", "0.6580424", "0.6580424", "0.65747887", "0.6538298", "0.65083903", "0.65012705", "0.65012705", "0.64993197", "0.6498647", "0.64968437", "0.649601", "0.6479481", "0.6475642", "0.64452714", "0.6437575", "0.64166015", "0.64010954", "0.64010954", "0.63670313", "0.6356907", "0.635595", "0.63533527", "0.6342037", "0.6324565", "0.6266074", "0.62488717" ]
0.0
-1
Create a new controller instance.
public function index(Books $books) { return view('home',['books'=>$books->first()->get()]); }
{ "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
Display a listing of the resource.
public function peminjaman() { try { $borrows =DB::table('borrows') ->join('books', 'books.id', '=', 'borrows.book_id') ->select('borrows.id as id','books.id as book_id','books.title as title','books.description as description','borrows.expired as expired') ->first(); if ($borrows===null){ return view('peminjaman',['borrows'=>0]); } $borrows =DB::table('borrows') ->join('books', 'books.id', '=', 'borrows.book_id') ->select('borrows.id as id','books.id as book_id','books.title as title','books.description as description','borrows.expired as expired') ->where('user_id','=',Auth::id()) ->get(); return view('peminjaman',['borrows'=>$borrows]); } catch (Exception $e) { return view('peminjaman',['borrows'=>0]); } }
{ "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
Function contains script for adding Resource Entry
public function doExecute() { $this->out('Do you want to add Resource(Name of Main files.) : (y/n)'); $add = $this->in(); ($add == 'y') ? $this->out('Enter Name of your Resource File :') : die('Bye'); $fileName = $this->in(); if($fileName) { for(; ; ) { $this->out('Enter version of your Resource File :'); $version = $this->in(); break; } } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->insert('#__resource'); $query->set("`file_name`='$fileName', `version`='$version'"); $db->setQuery($query); $db->query(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_new_resource() {\n // @codingStandardsIgnoreLine\n $add_resource_name = wc_clean( $_POST['add_resource_name'] );\n\n if ( empty( $add_resource_name ) ) {\n wp_send_json_error();\n }\n\n $resource = array(\n 'post_title' => $add_resource_name,\n 'post_content' => '',\n 'post_status' => 'publish',\n 'post_author' => dokan_get_current_user_id(),\n 'post_type' => 'bookable_resource',\n );\n $resource_id = wp_insert_post( $resource );\n $edit_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $resource_id;\n ob_start();\n ?>\n <tr>\n <td><a href=\"<?php echo $edit_url; ?>\"><?php echo $add_resource_name; ?></a></td>\n <td><?php esc_attr_e( 'N/A', 'dokan' ); ?></td>\n <td>\n <a class=\"dokan-btn dokan-btn-sm dokan-btn-theme\" href =\"<?php echo $edit_url; ?>\"><?php esc_attr_e( 'Edit', 'dokan' ); ?></a>\n <button class=\"dokan-btn dokan-btn-theme dokan-btn-sm btn-remove\" data-id=\"<?php echo $resource_id; ?>\"><?php esc_attr_e( 'Remove', 'dokan' ); ?></button>\n </td>\n </tr>\n\n <?php\n $output = ob_get_clean();\n wp_send_json_success( $output );\n }", "public function add_resources()\n\t{\n\t\t\n\t}", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\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 $this->_f3->reroute('/Admin');\n }\n\n }", "function add_resource($resource, $id) {\n\t//Create the HTML content for the resource page\n\t$content = '';\n\tif (isset($resource['description']))\n\t\t$content .= '<p>' . esc_attr($resource['description']) . '</p>';\n\t\n\t$content .= '<p><b>URL:</b> <a href=\"' . $resource['url'] . '\" target=\"_blank\">' . $resource['url'] . '</a><br/>';\n\tif (isset($resource['about'])) \n\t\t$content .= '<b>Keywords:</b> ' . join(\", \", $resource['about']) . '<br/>';\n\tif (isset($resource['author'])) \n\t\t$content .= '<b>Author:</b> ' . $resource['author'] . '<br/>';\n\tif (isset($resource['publisher'])) \n\t\t$content .= '<b>Publisher:</b> ' . $resource['publisher'] . '<br/>';\n\tif (isset($resource['dateCreated'])) \n\t\t$content .= '<b>Date created:</b> ' . $resource['dateCreated'] . '<br/>';\n\tif (isset($resource['language'])) \n\t\t$content .= '<b>Language:</b> ' . $resource['language'] . '<br/>';\n\tif (isset($resource['timeRequired'])) \n\t\t$content .= '<b>Time required:</b> ' . $resource['timeRequired'] . '<br/>';\n\tif (isset($resource['educationalUse'])) {\n\t\tcheck_term($resource['educationalUse'], \"asn_educational_use\");\n\t\t$content .= '<b>Educational use: </b><a href=\"'. get_term_link($resource['educationalUse'], \"asn_educational_use\") . '\">' . $resource['educationalUse'] . '</a><br/>';\n\t}\n\tif (isset($resource['educationalAudience'])) {\n\t\tcheck_term($resource['educationalAudience'], \"asn_educational_audience\");\n\t\t$content .= '<b>Educational audience: </b><a href=\"'. get_term_link($resource['educationalAudience'], \"asn_educational_audience\") . '\">' . $resource['educationalAudience'] . '</a><br/>';\n\t}\n\tif (isset($resource['interactivityType'])) {\n\t\tcheck_term($resource['interactivityType'], \"asn_interactivity_type\");\n\t\t$content .= '<b>Interactivity type: </b><a href=\"'. get_term_link($resource['interactivityType'], \"asn_interactivity_type\") . '\">' . $resource['interactivityType'] . '</a><br/>';\n\t}\n\tif (isset($resource['proficiencyLevel'])) {\n\t\tcheck_term($resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t$content .= '<b>Proficiency level: </b><a href=\"'. get_term_link($resource['proficiencyLevel'], \"asn_proficiency_level\") . '\">' . $resource['proficiencyLevel'] . '</a><br/>';\n\t}\n\t\n\t$content .= '</p>';\n\t//Prepare the post attributes\t\n\t$post = array(\n\t 'post_content' => $content,\n\t 'post_name' => sanitize_title(str_replace('-', ' ',$resource['title'])),\n\t 'post_title' => esc_attr($resource['title']),\n\t 'post_status' => 'publish',\n\t 'post_type' => 'learning_resource'\n\t);\n\t\n\n\t//Update existing post if appropriate\n\tif ($id >= 0) {\n\t\t$post['ID'] = $id;\n\t\twp_update_post($post);\n\t\twp_set_post_terms( $id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t//$content .= '<b>Interactivity type:</b> ' . $resource['interactivityType'];\n\t\tif(get_post_meta($id, 'resource_uri', true)==\"\") {\n\t\t\tadd_post_meta($id, 'resource_uri', rawurlencode($resource['url']), true);\n\t\t}\n\t}\n\t//Create new post if appropriate\n\telse {\n\t\t$post_id = wp_insert_post( $post);\n\t\twp_set_post_terms( $post_id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $post_id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($post_id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($post_id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\tadd_post_meta($post_id, 'resource_uri', rawurlencode($resource['url']), true);\n\t}\n\t\n}", "function addPOSEntry()\n{\n\n}", "private function _addResource()\n {\n //Add Resource\n $this->assets->collection('css_header')\n ->addCss('/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n\n $this->assets->collection('js_footer')\n ->addJs('/plugins/nestable/jquery.nestable.js')\n ->addJs('/plugins/nestable/ui-nestable.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modal.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modalmanager.js')\n ->addJs('/templates/backend/default/js/ui-modals.js');\n }", "function makeResource($rType, $details, $identifier, $department){\n sqlQuery(\"INSERT INTO resources (resource_type, resource_details, resource_identifier, resource_department) VALUES ('$rType','$details','$identifier','$department')\");\n alog(\"Added resource $identifier\");\n}", "public function add($data, Resource $resource);", "function adleex_resource_init() {\n\n\t// register posttype\n\t$posttype_definitions = array(\n 'labels' => array(\n 'singular_name' => __('Resource', ADLEEX_DOMAIN),\n 'name' => __('Resources', ADLEEX_DOMAIN),\n 'add_new' => __('Add new resource', ADLEEX_DOMAIN),\n 'all_items' => __('All resource', ADLEEX_DOMAIN),\n 'add_new_item' => __('Add new resource', ADLEEX_DOMAIN),\n 'edit_item' => __('Edit resource', ADLEEX_DOMAIN),\n 'view_item' => __('View this resource', ADLEEX_DOMAIN),\n 'search_items' => __('Search resources', ADLEEX_DOMAIN),\n 'not_found' => __('Resources not found', ADLEEX_DOMAIN),\n 'not_found_in_trash' => __('Not found resources in trash', ADLEEX_DOMAIN),\n 'parent_item_colon' => __(' : ', ADLEEX_DOMAIN),\n 'menu_name' => __('Resource', ADLEEX_DOMAIN),\n ),\n 'description' => 'Manage courses\\' resource', \n 'public' => true, \n 'publicly_queryable' => true, \n 'show_ui' => true, \n 'query_var' => 1, \n 'show_in_nav_menus' => false, \n 'show_in_admin_bar' => false, \n 'hierarchical' => true, \n 'has_archive' => true, \n 'show_in_menu' => 'true', \n 'menu_position' => 5, \n 'supports' => array(\n 'title', 'excerpt',\n ),\n 'taxonomies' => array(\n \n ),\n 'menu_icon' => 'myicon16.png', \n 'edit_icon' => 'myicon32.png', \n 'menu_icon_gray' => 'myicon16_gray.png', \n 'rewrite' => array(\n 'slug' => 'resource',\n ),\n 'capability_type' => array(\n 'resource', 'resources',\n ), \n 'map_meta_cap' => true, \n );\n\tregister_post_type('resource', $posttype_definitions);\n\t\n}", "public static function bkap_create_resource( $add_resource_name ) {\n\n\t\t$id = wp_insert_post( array(\n\t\t\t'post_title' => $add_resource_name,\n\t\t\t'menu_order' => 0,\n\t\t\t'post_content' => '',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => get_current_user_id(),\n\t\t\t'post_type' => 'bkap_resource',\n\t\t), true );\n\n\t\tif ( $id && ! is_wp_error( $id ) ) {\n\t\t\t\n\t\t\tupdate_post_meta( $id, '_bkap_resource_qty', 1 );\n\t\t\tupdate_post_meta( $id, '_bkap_resource_availability', array() );\n\n\t\t\treturn $id;\n\t\t}\n\t}", "function addResource($resObject)\n{\n\t\n\t\n\t$sql = \"INSERT INTO `\".DB_NAME.\"`.`resources` (\n\t\t`rid` ,\n\t\t`title` ,\n\t\t`link` ,\n\t\t`author` ,\n\t\t`timecreated` ,\n\t\t`rating` ,\n\t\t`description` ,\n\t\t`tags` ,\n\t\t`voteips`\n\t\t)\n\t\tVALUES (\n\t\tNULL , '\".sanitize($resObject->name).\"', '\".sanitize($resObject->url).\"', '\".$resObject->owner.\"',\n\t\t\".time().\" , '\".$resObject->score.\"', '\".sanitize($resObject->description).\"', '\".sanitize(dcSemicolonArrayToString($resObject->tags)).\"',\n\t\t'\".dcSemicolonArrayToString($resObject->voteips).\"'\n\t\t)\";\n\n\t$result = mysql_query($sql);\n\n\tif($result)\n\t\t$result = mysql_insert_id();\n\t\t\n\treturn $result;\n}", "public function add_entry($entry);", "abstract protected function createResource();", "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 }", "protected function createResource()\n {\n $this->call('wizard:resource', [\n 'name' => $this->argument('name'),\n ]);\n }", "protected function createResource()\n {\n $this->call('make:resource', array_filter([\n 'name' => $this->getNameInput().'Resource',\n ]));\n }", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "private function newResourceDatabaseEntry(\r\n\t\t\t$wp) {\r\n\t\t$this->logger->writeLOG( \"newResourceDatabaseEntry - start\");\r\n\t\tglobal $wpdb;\r\n\t\tif ($wpdb == null) {\r\n\t\t\tFraxionErrorPageImpl::fatalError ( \"Database unavailable.\", $this->logger );\r\n\t\t} else {\r\n\t\t\t$resourcePostID = null;\r\n\t\t\tif (array_key_exists ( 'forPostId', $wp->query_vars )) {\r\n\t\t\t\t$resourcePostID = $wp->query_vars ['forPostId'];\r\n\t\t\t}\r\n\t\t\t$this->logger->writeLOG( \"resourcePostID=\" . $resourcePostID);\r\n\t\t\t$newResName = self::getNewResourceName ( $wp );\r\n\t\t\t$this->logger->writeLOG( \"newResName=\" . $newResName);\r\n\t\t\t$newMimeType = self::getNewResourceMimeType ( $wp );\r\n\t\t\t$this->logger->writeLOG( \"newMimeType=\" . $newMimeType);\r\n\t\t\t\r\n\t\t\t$downloadFileName = null;\r\n\t\t\t$downloadSnippetFileName = null;\r\n\t\t\tif (array_key_exists ( 'force', $wp->query_vars )) {\r\n\t\t\t\t$force = $wp->query_vars ['force'];\r\n\t\t\t\tif ($force == 'true') {\r\n\t\t\t\t\t$downloadFileName = $newResName;\r\n\t\t\t\t\t$lastDotPos = strripos ( $newResName, '.' );\r\n\t\t\t\t\t$downloadSnippetFileName = null;\r\n\t\t\t\t\tif ($lastDotPos) {\r\n\t\t\t\t\t\t$downloadSnippetFileName = substr ( $newResName, 0, $lastDotPos ) . \"_snippet\" . substr ( \r\n\t\t\t\t\t\t\t\t$newResName, $lastDotPos );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$downloadSnippetFileName = $newResName . \"_snippet\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->logger->writeLOG( \"downloadFileName=\" . $downloadFileName);\r\n\t\t\t$this->logger->writeLOG( \"downloadSnippetFileName=\" . $downloadSnippetFileName);\r\n\t\t\t\r\n\t\t\t$newID = $this->fraxionResourceService->insertNewResourceDatabaseEntry ( $resourcePostID, $newResName, \r\n\t\t\t\t\t$newMimeType, $downloadFileName, $downloadSnippetFileName );\r\n\t\t\t\r\n\t\t\tif (! $newID) {\r\n\t\t\t\tFraxionErrorPageImpl::fatalError ( \"Failed to save data for resource. \" . $newResName, $this->logger );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logger->writeLOG( \"newResourceDatabaseEntry - end\");\r\n\t\t\r\n\t\treturn $newID;\r\n\t}", "function create_resource() {\n register_post_type( 'resources',\n array(\n 'labels' => array(\n 'name' => 'Downloadable Resources',\n 'singular_name' => 'Downloadable Resource',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Resource',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Resource',\n 'new_item' => 'New Resource',\n 'view' => 'View',\n 'view_item' => 'View Resource',\n 'search_items' => 'Search Downloadable Resources',\n 'not_found' => 'No Downloadable Resources found',\n 'not_found_in_trash' => 'No Downloadable Resources found in Trash',\n 'parent' => 'Parent Resource'\n ),\n \n 'public' => true,\n 'menu_position' => 15,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'resource_categories', 'resource_tags' ),\n 'menu_icon' => plugins_url( 'images/generic.png', __FILE__ ),\n 'has_archive' => true\n )\n );\n}", "public function attachUrl(ResourceEntry $resource);", "protected function addEmbeddedResources()\n {\n }", "public function add_entry($entry)\n {\n }", "public function addRequiredResources() {\n // None\n }", "function opinionstage_help_resource_load_footer(){\n}", "abstract protected function initResource();", "public function viewAddResources()\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 insertNewResourceDatabaseEntry(\r\n\t\t\t$resourcePostID, \r\n\t\t\t$newResName, \r\n\t\t\t$newMimeType, \r\n\t\t\t$downloadFileName, \r\n\t\t\t$downloadSnippetFileName) {\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\t$this->logger->writeLOG('insertNewResourceDatabaseEntry - start');\r\n\t\t\r\n\t\tif ($wpdb == null) {\r\n\t\t\tFraxionErrorPageImpl::fatalError ( \"Database unavailable.\", $this->logger );\r\n\t\t} else {\r\n\t\t\t$msg = 'insertNewResourceDatabaseEntry - values to insert :' . 'Insert resourcePostID=' . $resourcePostID;\r\n\t\t\t$msg .= '\\n newResName=' . $newResName . '\\n newMimeType=' . $newMimeType . '\\n downloadFileName=' . $downloadFileName;\r\n\t\t\t$msg .= '\\n downloadSnippetFileName=' . $downloadSnippetFileName;\r\n\t\t\t$this->logger->writeLOG($msg);\r\n\t\t\t\r\n\t\t\t// Table name should include this wp's prefix value (or does insert add that?) - need a mechanism for making\r\n\t\t\t// that correct\r\n\t\t\t$fieldsArray = array (\r\n\t\t\t\t\t\"resource_post_ID\" => $resourcePostID,\r\n\t\t\t\t\t\"resource_friendly_name\" => $newResName,\r\n\t\t\t\t\t\"resource_mime_type\" => $newMimeType,\r\n\t\t\t\t\t\"resource_snippet_mime_type\" => $newMimeType \r\n\t\t\t);\r\n\t\t\t$formatsArray = array (\r\n\t\t\t\t\t\"%d\",\r\n\t\t\t\t\t\"%s\",\r\n\t\t\t\t\t\"%s\",\r\n\t\t\t\t\t\"%s\" \r\n\t\t\t);\r\n\t\t\tif (! ($downloadFileName == null || strlen ( $downloadFileName ) == 0)) {\r\n\t\t\t\t$fieldsArray = array_merge ( $fieldsArray, array (\r\n\t\t\t\t\t\t\"download_file_name\" => $downloadFileName \r\n\t\t\t\t) );\r\n\t\t\t\t$formatsArray = array_merge ( $formatsArray, array (\r\n\t\t\t\t\t\t\"%s\" \r\n\t\t\t\t) );\r\n\t\t\t}\r\n\t\t\tif (! ($downloadSnippetFileName == null || strlen ( $downloadSnippetFileName ) == 0)) {\r\n\t\t\t\t$fieldsArray = array_merge ( $fieldsArray, \r\n\t\t\t\t\t\tarray (\r\n\t\t\t\t\t\t\t\t\"download_snippet_filename\" => $downloadSnippetFileName \r\n\t\t\t\t\t\t) );\r\n\t\t\t\t$formatsArray = array_merge ( $formatsArray, array (\r\n\t\t\t\t\t\t\"%s\" \r\n\t\t\t\t) );\r\n\t\t\t}\r\n\t\t\tif ($this->logger != null && $this->logger->isDebug ()) {\r\n\t\t\t\t$this->logger->writeLOG('insertNewResourceDatabaseEntry - fieldsArray length is ' . count ( $fieldsArray )\r\n\t\t\t\t\t. ' - formatsArray length is ' . count ($formatsArray ));\r\n\t\t\t\t$outstr = '';\r\n\t\t\t\tforeach ( $fieldsArray as $x => $x_value ) {\r\n\t\t\t\t\t$outstr .= \" [\" . $x . \", \" . $x_value . \"]\";\r\n\t\t\t\t}\r\n\t\t\t\t$this->logger->writeLOG($outstr);\r\n\t\t\t\t\r\n\t\t\t\t$arrlength = count ( $formatsArray );\r\n\t\t\t\t$outstr = '';\r\n\t\t\t\tfor($x = 0; $x < $arrlength; $x ++) {\r\n\t\t\t\t\t$outstr .= \" [\" . $formatsArray [$x] . \"]\";\r\n\t\t\t\t}\r\n\t\t\t\t$this->logger->writeLOG($outstr);\r\n\t\t\t}\r\n\t\t\t$wpdb->insert ( $this->resourceTableName, $fieldsArray, $formatsArray );\r\n\t\t\t$newResID = $wpdb->insert_id;\r\n\t\t\t\r\n\t\t\t$this->logger->writeLOG('insertNewResourceDatabaseEntry - end newResID=' . $newResID);\r\n\t\t\t\r\n\t\t\treturn $newResID;\r\n\t\t}\r\n\t}", "abstract public function resource();", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Permission Modify\");\t\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\t## for check admin or not\t##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"permission_modify\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"permission_modify_add\", $data, true, \"permission_modify\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function registerResource($id, $resource);", "abstract protected function getNewResource();", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "protected function addResource(Resource $resource)\n {\n $this->view->addResource($resource);\n }", "function custom_web_resources() {\n $labels = array(\n /*--- Begin Labels Options ---*/\n\n 'name' => _x( 'Links', 'post type general name' ),\n 'singular_name' => _x( 'Link', 'post type singular name' ),\n 'add_new' => _x( 'Add New', weblink ),\n 'add_new_item' => __( 'Add Link' ),\n 'edit_item' => __( 'Edit Links' ),\n 'new_item' => __( 'New Link' ),\n 'all_items' => __( 'All Links' ),\n 'view_item' => __( 'View Links' ),\n 'search_items' => __( 'Search Links' ),\n 'not_found' => __( 'No links found' ),\n 'not_found_in_trash' => __( 'No links found in the Trash' ), \n 'parent_item_colon' => '',\n 'menu_name' => 'Web Links'\n\n );\n $args = array(\n /*--- Begin Arguments Options ---*/\n\n 'labels' => $labels,\n 'description' => 'Place to put useful links to other web resources',\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),\n 'has_archive' => true,\n\n );\n register_post_type( 'resources', $args ); \n }", "private function addResource($name, $resource)\n {\n $this->resources[$name] = $resource;\n }", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "function custom_post_type_resource() {\n\t$labels = array(\n\t\t'name' => _x( 'Resources', 'Post Type General Name', 'leasepilot' ),\n\t\t'singular_name' => _x( 'Resource', 'Post Type Singular Name', 'leasepilot' ),\n\t\t'menu_name' => __( 'Resources', 'leasepilot' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'leasepilot' ),\n\t\t'archives' => __( 'Resources Archives', 'leasepilot' ),\n\t\t'attributes' => __( 'Resource Attributes', 'leasepilot' ),\n\t\t'parent_item_colon' => __( 'Parent Resource:', 'leasepilot' ),\n\t\t'all_items' => __( 'All Resources', 'leasepilot' ),\n\t\t'add_new_item' => __( 'Add New Resource', 'leasepilot' ),\n\t\t'add_new' => __( 'Add New', 'leasepilot' ),\n\t\t'new_item' => __( 'New Resource', 'leasepilot' ),\n\t\t'edit_item' => __( 'Edit Resource', 'leasepilot' ),\n\t\t'update_item' => __( 'Update Resource', 'leasepilot' ),\n\t\t'view_item' => __( 'View Resource', 'leasepilot' ),\n\t\t'view_items' => __( 'View Resources', 'leasepilot' ),\n\t\t'search_items' => __( 'Search Resources', 'leasepilot' ),\n\t\t'not_found' => __( 'Not found', 'leasepilot' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'leasepilot' ),\n\t\t'featured_image' => __( 'Featured Image', 'leasepilot' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'leasepilot' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'leasepilot' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'leasepilot' ),\n\t\t'insert_into_item' => __( 'Insert into resource', 'leasepilot' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this resource', 'leasepilot' ),\n\t\t'items_list' => __( 'Resources list', 'leasepilot' ),\n\t\t'items_list_navigation' => __( 'Resources list navigation', 'leasepilot' ),\n\t\t'filter_items_list' => __( 'Filter Resources list', 'leasepilot' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Resource', 'leasepilot' ),\n\t\t'description' => __( 'Resource Description', 'leasepilot' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'thumbnail' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-book-alt',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t\t'rewrite' => array( 'with_front' => false ), // This needs to be false so that custom Permalinks settings won't effect this permalink.\n\t);\n\tregister_post_type( 'resources', $args );\n}", "static private function registerResource(SimpleRdfResource $resource) {\r\n SimpleRdf::$resources[]=$resource;\r\n }", "function add()\n\t{\n\t\t$CFG = $this->config->item('image_configure');\n\t\t$data[\"title\"] = _e(\"Image\");\n\t\t## for check admin or not ##\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\n\t\t$this->load->module('context/context_admin');\n\t\t$user_context = $this->context_admin->getContext();\n\t\t$data['var']['context_dd'] = ( array('' => _e('Choose Context') ) + $user_context );\n\t\t$data['var']['relation_dd'] = ( array('' => _e('Choose Relation') ) );\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"image\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"image_add\", $data, true, \"image\");\n\t\t$this->template->build_admin_output($data);\n\t}", "protected function _init_resource()\n\t{\n\t\t$resource_id = $this->request->param('id');\n\t\tif (!$resource_id)\n\t\t{\n\t\t\t$this->session->set('error', 'Invalid resource id');\n\t\t\t$this->request->redirect('/admin/resource');\n\t\t}\n\t\t\n\t\t// check if resource exists\n\t\t$this->resource = Sprig::factory('resource', array(\n\t\t\t'resource_id' => $resource_id\n\t\t));\n\t\t\n\t\t$this->resource->load();\n\t\tif (!$this->resource->loaded())\n\t\t{\n\t\t\t$this->session->set('error', 'Resource not found');\n\t\t\t$this->request->redirect('/admin/resource');\n\t\t}\n\t}", "public function __construct(){\n add_action( 'init', [ $this, 'create_resource_lists' ], 0 ); \t\n \t\n \t//init the custom post type for record items\n add_action( 'init', [ $this, 'resource_list_generator' ], 0 ); \n \n\n }", "function thumbwhere_host_add_page() {\n $controller = entity_ui_controller('thumbwhere_host');\n return $controller->addPage();\n}", "public function add() {\n parent::add();\n \n if(!$this->request->is('restful')) {\n $this->set('title_for_layout', _txt('op.add-a', array($this->viewVars['vv_authenticator']['Authenticator']['description'])));\n }\n }", "public function bkap_load_resource_ajax_admin() {\n add_action( 'wp_ajax_bkap_add_resource', array( &$this, 'bkap_add_resource' ) );\n\n // ajax for deleting a single resource.\n add_action( 'wp_ajax_bkap_delete_resource', array( &$this, 'bkap_delete_resource' ) );\n }", "public function addResource($value) {\n return $this->add('resources', func_get_args());\n }", "abstract protected function setResource(): String;", "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 }", "abstract public function addEntry($long_url, $short_uri = null);", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function addResource($type, $object = null, ?\\SetaPDF_Core_Document $document = null) {}", "function add_rew_apartment()\n{\n\t$lables = array(\n\t\t\t'name' => 'Apartments',\n\t\t\t'singular_name'=>'Apartment',\n\t\t\t'rewrite' => array( 'slug' => 'apartment' ),\n\t\t\t'all_items'=> 'All Apartments',\n\t\t\t'add_new'=>'Add New Apartment',\n\t\t\t'add_new_item'=>' Add New Apartment',\n \n\n\t\t );\n\n\t$tax = array(\n\n\t\t\t\t\t'category',\n\n\t\t\t\t\t\n\t\t);\n\t$args = array(\n\t\t'labels'=> $lables,\n\t\t'public'=>true,\n\t\t'show_in_menu'=>true,\n\t\t//'show_in_admin_bar'=>true,\n\t//\t'show_in_nav_menus'=>true,\n\t\t'description'=>'Enter your Description',\n\t\t'menu_position'=>10,\n\t\t'menu_icon'=>'dashicons-format-quote',\n\t\t'taxonomies'=>$tax,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n\t\t 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'apartments',\n 'rest_controller_class' => 'WP_REST_Posts_Controller',\n\n\t\t);\t\n\tregister_post_type('Apartment', $args);\n\t//add_action('init' , 'codex_custom_init');\n\t\n}", "function insert_resouces($resources) {\r\n foreach ($resources['css'] as $css) {\r\n echo '<link rel=\"stylesheet\" href=\"'. $css .'\">';\r\n }\r\n foreach ($resources['js'] as $js) {\r\n echo '<script src=\"'. $js .'\"></script>';\r\n }\r\n }", "public function addrequest(){\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function add_resource_dir($path,$url,$append_nc=true,$ext=false)\n{\n $url = buildQuery($url);\n if( !$ext ) $ext = RESOURCE_EXTENSIONS;\n $GLOBALS['CONFIG']['resources'][] = compact('ext','path','url','append_nc');\n}", "public function add()\n\t{\n\t\t// Only add the events if we are on that controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.view_pre_render.layout', array($this, 'add_requirements'));\n\t\t\t\n\t\t\tEvent::add('ushahidi_action.header_scripts', array($this, '_main_js'));\n\t\t\tEvent::add('ushahidi_action.map_main_filters', array($this, '_button'));\n\t\t}\n\t}", "function _add_creators (&$folder)\n {\n parent::_add_creators ($folder);\n\n $cmd = $this->make_command ();\n \n $cmd->id = 'new_recipe';\n $cmd->title = 'New recipe';\n $cmd->link = \"create_recipe.php?id=$folder->id\";\n $cmd->icon = '{app_icons}buttons/new_recipe';\n $cmd->executable = $this->login->is_allowed (Privilege_set_entry, Privilege_create, $folder);\n $cmd->importance = Command_importance_high;\n $this->append ($cmd);\n }", "function opinionstage_help_resource_load_header(){\n}", "function createAtomEntry() {\n\t\t$this->create();\n\t}", "protected function _setupResources()\n {\n $this->_acl->addResource( new Zend_Acl_Resource('auth') );\n $this->_acl->addResource( new Zend_Acl_Resource('error') );\n \t$this->_acl->addResource( new Zend_Acl_Resource('index') );\n $this->_acl->addResource( new Zend_Acl_Resource('register') );\n $this->_acl->addResource( new Zend_Acl_Resource('dashboard') );\n }", "function addRecipe(){\n $name=$_REQUEST['name'];\n $chef=$_REQUEST['chef'];\n $overview=$_REQUEST['overview'];\n $ingr=$_REQUEST['ingr'];\n $inst=$_REQUEST['inst'];\n $image= $_REQUEST['image'];\n $cat=$_REQUEST['cat'];\n\n include(\"../model/recipe.php\");\n $obj = new recipe();\n if($obj->addRecipe($name, $chef, $overview, $ingr,$inst,$image,$cat)){\n echo '{\"result\":1}';\n }else {\n echo '{\"result\":0}';\n }\n }", "function wp_script_add_data($handle, $key, $value)\n {\n }", "function resources_custom_post() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Resources', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Resource', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Resources Post', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Resources Post', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Resource', 'text_domain' ),\n\t\t'description' => __( 'resources_custom_post', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\t\t\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\tregister_post_type('resources_post', $args);\n\n}", "function add_manifest() {\n\techo \"<link rel='manifest' href='\" . esc_url( ERI_SCAFFOLD_TEMPLATE_URL . '/manifest.json' ) . \"' />\";\n}", "public static function add_resource($resource) {\n // Ensure indiciaFns is always the first resource added.\n if (!self::$indiciaFnsDone) {\n self::$indiciaFnsDone = TRUE;\n self::add_resource('indiciaFns');\n }\n $resourceList = self::get_resources();\n // If this is an available resource and we have not already included it,\n // then add it to the list.\n if (array_key_exists($resource, $resourceList) && !in_array($resource, self::$required_resources)) {\n if (isset($resourceList[$resource]['deps'])) {\n foreach ($resourceList[$resource]['deps'] as $dep) {\n self::add_resource($dep);\n }\n }\n self::$required_resources[] = $resource;\n }\n }", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Language\");\t\n\t\t$CFG = $this->config->item('language_configure');\n\t\t\n\t\t ## for check admin or not\t ##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"language\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"language_add\", $data, true, \"language\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function addEntry()\n\t{\n\t\t//Get all data\n\t\t$data = \\Input::all();\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = Sentry::getUser()->id;\n\t\t//Add Data\n\t\t$result = $this->timesheet->addEntry($data,$userId);\n\n\n\t\t//代辦事項\n\t\t$userId = (int) \\Sentry::getUser()->id;\n\t\t$result_todo = $this->timesheet->postTodos($data, $userId);\n\n\t\t$result_calendar = $this->timesheet->addcalendar($data,$userId);\n\n\t\t//Redirect with appropriate message to the user\n\t\tif($result == 'success')\n\t\t{\n\t\t\treturn \\Redirect::to('dashboard/timesheet')->with('status','success')->with('message','Entry Added');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \\Redirect::to('dashboard/timesheet')->with('status','error')->with('message','Something Went Wrong. Please try again.');\n\t\t}\n\n\t}", "public static function init() {\n\t\t\tadd_action( 'admin_menu', __CLASS__ . '::simple_recipes_create_menu' );\n\t\t\n\t\t}", "abstract public function admin_add($type, $uri, Page $page);", "public function processApi()\n\t\t{\n\t\t\t$this->createEntry();\n\t\t}", "public function save() {\n\t\t$url = $this->items[ $this->id ]['url'];\n\t\t$handle = $this->items[ $this->id ]['name'];\n\t\t$deps = isset( $this->items[ $this->id ]['deps'] ) ? $this->items[ $this->id ]['deps'] : array();\n\t\t$ver = isset( $this->items[ $this->id ]['ver'] ) ? $this->items[ $this->id ]['ver'] : null;\n\t\t$ver = $ver && 'auto' === $ver ? \\Wpfw\\Asset::get_modified_time( $url ) : $ver;\n\t\t$in_footer = isset( $this->items[ $this->id ]['in_footer'] ) ? $this->items[ $this->id ]['in_footer'] : true; // put default to footer for non-blocking request.\n\t\t$localize = isset( $this->items[ $this->id ]['localize'] ) ? $this->items[ $this->id ]['localize'] : false;\n\n\t\twp_register_script( $handle, $url, $deps, $ver, $in_footer );\n\n\t\tif ( $localize ) {\n\t\t\twp_localize_script(\n\t\t\t\t$this->items[ $this->id ]['name'],\n\t\t\t\t$this->items[ $this->id ]['localize']['name'],\n\t\t\t\t$this->items[ $this->id ]['localize']['value']\n\t\t\t);\n\t\t}\n\t}", "public function addAction()\n\t{\n\n\t}", "function add_object_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '')\n {\n }", "public function add() {\n\t\t\n\t\t$this->template->content = View::instance(\"v_posts_add\");\n\t\t\n\t\t$client_files_body = Array(\n\t\t\t'/js/jquery.form.js',\n\t\t\t'/js/posts_add.js'\n\t\t);\n\t\t\n\t\t$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\techo $this->template;\n\t\t\n\t}", "public function addResources(RouteCollection $i18nRouteCollection);", "function create_resource_taxonomies() {\n\t// Add new taxonomy, make it hierarchical (like categories)\n\t$labels = array(\n\t\t'name' => _x( 'Resource Categories', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Resource Category', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Resource Categories' ),\n\t\t'all_items' => __( 'All Resource Categories' ),\n\t\t'parent_item' => __( 'Parent Resource Category' ),\n\t\t'parent_item_colon' => __( 'Parent Resource Category:' ),\n\t\t'edit_item' => __( 'Edit Resource Category' ),\n\t\t'update_item' => __( 'Update Resource Category' ),\n\t\t'add_new_item' => __( 'Add New Resource Category' ),\n\t\t'new_item_name' => __( 'New Genre Resource Category' ),\n\t\t'menu_name' => __( 'Resource Categories' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'resources' ),\n\t);\n\tregister_taxonomy( 'resource_categories', array( 'resources' ), $args );\n\t\n\t// Add new taxonomy, NOT hierarchical (like tags)\n\t$labels = array(\n\t\t'name' => _x( 'Resource Tags', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Resource Tag', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Resource Tags' ),\n\t\t'popular_items' => __( 'Popular Resource Tags' ),\n\t\t'all_items' => __( 'All Resource Tags' ),\n\t\t'parent_item' => null,\n\t\t'parent_item_colon' => null,\n\t\t'edit_item' => __( 'Edit resource tag' ),\n\t\t'update_item' => __( 'Update resource tag' ),\n\t\t'add_new_item' => __( 'Add New Resource Tag' ),\n\t\t'new_item_name' => __( 'New Writer Resource Tag' ),\n\t\t'separate_items_with_commas' => __( 'Separate tags with commas' ),\n\t\t'add_or_remove_items' => __( 'Add or remove resource tags' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used resource tags' ),\n\t\t'not_found' => __( 'No resource tags found.' ),\n\t\t'menu_name' => __( 'Resource Tags' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'resource-tags' ),\n\t);\n\n\tregister_taxonomy( 'resource_tags', 'resources', $args );\n\t}", "function thumbwhere_contentcollection_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollection');\n return $controller->addPage();\n}", "public function creating(EntryInterface $entry)\n {\n $entry->setAttribute('str_id', str_random(24));\n\n parent::creating($entry);\n }", "static public function add()\n {\n add_role(\n self::ROLE_KEY, // identifiant du rôle\n self::ROLE_NAME, // nom d'affichage du rôle\n // capabilities\n [ \n 'read' => true,\n \n //'edit_events' => true, // cette cap concerne l'ensemble des posts (tous types confondus)\n 'publish_events' => false,\n 'edit_event' => true, \n 'delete_event' => true,\n 'edit_others_events' => false,\n 'delete_others_events' => false,\n 'edit_published_events' => false, \n\n 'manage_events' => true,\n 'edit_events' => true, \n 'assign_events' => true, \n ] \n ); \n }", "public function isCreateResource();", "protected function add() {\n\t}", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "function thumbwhere_contentcollectionitem_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollectionitem');\n return $controller->addPage();\n}", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "protected function includeResources()\n {\n $path = craft()->request->path;\n\n if (preg_match('/^settings\\/sections\\/[0-9]\\/entrytypes\\/([0-9]|new)/', $path))\n {\n $target = 'entrytype';\n }\n else if (preg_match('/^entries\\/.*\\/([0-9]|new)/', $path))\n {\n $target = 'entry';\n } else {\n return false;\n }\n\n // Get revision manifest\n $manifestPath = dirname(__FILE__) . '/resources/rev-manifest.json';\n $manifest = (file_exists($manifestPath) && $manifest = file_get_contents($manifestPath)) ? json_decode($manifest) : false;\n\n switch ($target)\n {\n case 'entry' :\n $url = 'javascripts/EditForm.js';\n break;\n case 'entrytype' :\n $url = 'javascripts/FLD.js';\n break;\n }\n\n craft()->templates->includeJsResource('reasons/' . ($manifest ? $manifest->$url : $url));\n\n // Reasons data. TODO: Could stand to be optimized!\n $data = json_encode(array(\n 'conditionals' => craft()->reasons->getAllConditionals(),\n 'toggleFields' => craft()->reasons->getToggleFields(),\n 'entryTypeIds' => craft()->reasons->getEntryTypeIds(),\n 'fieldIds' => craft()->reasons->getFieldIds(),\n ));\n\n $commonCss = 'stylesheets/reasons.css';\n craft()->templates->includeCssResource('reasons/' . ($manifest ? $manifest->$commonCss : $commonCss));\n craft()->templates->includeJs('window._ReasonsData='.$data.';');\n\n }", "public function action_init()\n\t{\n\t\t$this->add_template( 'addon_preview', dirname(__FILE__) . '/templates/addon_preview.php' );\n\t\t$this->add_template( 'addon', dirname(__FILE__) . '/templates/addon.php' );\n\t\t\n\t\t$this->add_rule('\"retrieve_addonlist\"', 'retrieve_addonlist');\n\t\t$this->add_rule('\"install_addons\"', 'install_addons');\n\n\t}", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "function add()\r\n\t{\r\n\t\t$data['main_content'] = 'policy_add';\r\n\t\t$opt_load = array(\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/dashboardui.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/css3-buttons.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/progress.css\" />',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery-1.6.4.min.js\"></script>',\r\n\t\t\t'<script src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery.easytabs.min.js\" type=\"text/javascript\"></script>',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/progress.js\"></script>',\r\n\t\t\t);\r\n\t\t$opt_head = array(\r\n\t\t\t\"title\" => \"Policies\",\r\n\t\t\t\"opt_load\" => $opt_load,\r\n\t\t\t);\r\n\t\t$data['opt_head'] = $opt_head;\r\n\t\t$this->load->view('includes/template-beta', $data);\t\r\n\t}", "function add_rew_land()\n{\n\t$lables = array(\n\t\t\t'name' => 'Lands',\n\t\t\t'singular_name'=>'Land',\n\t\t\t'rewrite' => array( 'slug' => 'land' ),\n\t\t\t'all_items'=> 'All Lands',\n\t\t\t'add_new'=>'Add New Land',\n\t\t\t'add_new_item'=>' Add New Land',\n \n\n\t\t );\n\n\t$tax = array(\n\n\t\t\t\t\t'category',\n\n\t\t\t\t\t\n\t\t);\n\t$args = array(\n\t\t'labels'=> $lables,\n\t\t'public'=>true,\n\t\t'show_in_menu'=>true,\n\t\t'show_in_admin_bar'=>true,\n\t\t'show_in_nav_menus'=>true,\n\t\t'description'=>'Enter your Description',\n\t\t'menu_position'=>10,\n\t\t'menu_icon'=>'dashicons-format-quote',\n\t\t'taxonomies'=>$tax,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' , 'custom-fields' ),\n\t\t 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'land',\n\n\t\t);\t\n\tregister_post_type('Land', $args);\n\t//add_action('init' , 'codex_custom_init');\n\t\n}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public function insert(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_drone_insert')){\n $this->_app->notFound();\n }\n // do something here\n }", "function Define_Resources() : void\n {\n for($i = 0;$i < count($this->Scripts);$i++)\n {\n if($this->Scripts[$i] instanceof stdClass)\n {\n wp_enqueue_script($this->Scripts[$i]->Handle,$this->Scripts[$i]->Src,$this->Scripts[$i]->Deps,$this->Scripts[$i]->Ver,$this->Scripts[$i]->InFooter);\n }\n }\n for($i = 0;$i < count($this->Styles);$i++)\n {\n if($this->Styles[$i] instanceof stdClass)\n {\n wp_enqueue_style($this->Styles[$i]->Handle,$this->Styles[$i]->Src,$this->Styles[$i]->Deps,$this->Styles[$i]->Ver,$this->Styles[$i]->Media);\n }\n }\n }", "public function run()\n {\n foreach ($this->resources as $resource) {\n \tDB::table('resources')->insert($resource);\n }\n }", "public function admin_add(){\n \n $this->set(\"title_for_layout\",\"Create a Satellite Group\");\n \n // Load all existing satellites\n $this->set('satellites', $this->Satellite->find('all'));\n }", "function adleex_resource_define_cap() {\n\t$admin = get_role('administrator');\n\t$admin->add_cap('delete_resources');\n\t$admin->add_cap('edit_resources');\n\t$admin->add_cap('publish_resources');\n\t$admin->add_cap('edit_published_resources');\n\t$admin->add_cap('delete_published_resources');\n\t$admin->add_cap('read_private_resources');\n\t$admin->add_cap('edit_private_resources');\n\t$admin->add_cap('delete_private_resources');\n\t$admin->add_cap('edit_others_resources');\n\t$admin->add_cap('delete_others_resources');\n}", "function addInstruction(){\n $recipe=$_REQUEST['recipe'];\n $instr=$_REQUEST['instruction'];\n\n include(\"../model/instruction.php\");\n $obj = new instruction();\n if($obj->addInstruction($recipe, $instr)){\n echo '{\"result\":1}';\n }else {\n echo '{\"result\":0}';\n }\n }", "public function add_menu_item() {\n\t\t$screen_hook = add_options_page(\n\t\t\t__( 'SatisPress', 'satispress' ),\n\t\t\t__( 'SatisPress', 'satispress' ),\n\t\t\t'manage_options',\n\t\t\t'satispress',\n\t\t\tarray( $this, 'render_screen' )\n\t\t);\n\n\t\tadd_action( 'load-' . $screen_hook, array( $this, 'setup_screen' ) );\n\t}", "private function createEntry(){\n\t\t\t$con = Connection();\n\t\n\t\t\tif(!$con)\n\t\t\t{\n\t\t\t\t$arr_res = array();\n\t\t\t\t$arr_res['error'] = array(\"msg\" => \"no DB Connection\");\n\t\t\t\t$arr_res['result'] = array('status' => \"Failed\");\n\t\t\t\t$this->response($this->json($arr_res), 503);\n\t\t \t}\n\t\t \t$entityBody = file_get_contents('php://input');\n\t\t \t$myfile = fopen(\"newfile.txt\", \"w\") or die(\"Unable to open file!\");\n\t\t\t$txt = $entityBody;\n\t\t\tfwrite($myfile, $txt);\n\t\t\tfclose($myfile);\n\n \t\t\t$data = $this->convert_json_to_array($entityBody);\n \t\t\t\n \t\t\t$myfile2 = fopen(\"newfile2.txt\", \"w\") or die(\"Unable to open file!\");\n\t\t\t$txt2 = $data;\n\t\t\tfwrite($myfile2, $txt2);\n\t\t\tfclose($myfile2);\n\t\t\t$timeStamp= date(\"Y-m-d H:i:s\");\n\t\t\t$uid = $data['clientID'];\n\t\t\t$base64Image= $data['base64Image'];\n \t\t\t$query = \"INSERT INTO ringings (timeStamp, base64Image, uid) VALUES ('$timeStamp','$base64Image', '$uid')\"; \n \n\t\t\tif(!mysqli_query($con,$query))\n\t\t\t{\n\t\t\t\t\t$arr_res = array();\n\t\t\t\t\t$arr_res['error'] = array(\"msg\" => \"failed Adding Entry\");\n\t\t\t\t\t$arr_res['result'] = array('status' => \"Failed\");\n\t\t\t\t\t$this->response($this->json($arr_res), 417);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$last_id = $con->insert_id;\n\t\t\t\t$str_array = array('status' => \"Success\" ,'id' => $last_id, 'reply' => Null, 'base64Image' => $base64Image, 'uid' => $uid);\n\t\t\t\t\n\t\t\t\t$arr_res = array();\n\t\t\t\t$arr_res['error'] = $error;\n\t\t\t\t$arr_res['result'] = $str_array;\n\t\t\t\t$this->response($this->json($arr_res), 200);\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$con->close();\n\t\t}", "public function add_postAction() {\n\t\t$info = $this->getPost(array('name', 'link', 'img', 'sort', 'status', 'model_id','type_id'));\n\t\t$info = $this->_cookData($info);\n\t\t$result = Browser_Service_Recsite::addRecsite($info);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function showLevelResources()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;\n\n\t\t$ilToolbar->addButton(\n\t\t\t$lng->txt(\"skmg_add_resource\"),\n\t\t\t$ilCtrl->getLinkTarget($this, \"addLevelResource\"));\n\t\t\n\t\t$this->setLevelHead();\n\t\t$ilTabs->activateTab(\"level_resources\");\n\t\t\n\t\tinclude_once(\"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php\");\n\t\t$tab = new ilSkillLevelResourcesTableGUI($this, \"showLevelResources\",\n\t\t\t$this->base_skill_id, $this->tref_id, (int) $_GET[\"level_id\"]);\n\t\t\n\t\t$tpl->setContent($tab->getHTML());\n\t}", "public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}" ]
[ "0.7275109", "0.72169685", "0.6989702", "0.6976009", "0.657211", "0.65254927", "0.6423049", "0.6344306", "0.6328075", "0.63171864", "0.6298656", "0.6261765", "0.62451994", "0.62208265", "0.62089735", "0.61942047", "0.61826116", "0.61339694", "0.60545945", "0.5991201", "0.5958225", "0.5947263", "0.59182715", "0.5893037", "0.5846995", "0.58212286", "0.5800625", "0.5752653", "0.57381195", "0.5714959", "0.5699374", "0.5694129", "0.5692241", "0.56652445", "0.56568503", "0.562506", "0.56123674", "0.5605931", "0.5589563", "0.55872715", "0.5550388", "0.55498874", "0.55493814", "0.5541545", "0.5524122", "0.5519235", "0.549515", "0.54899085", "0.5485802", "0.5479359", "0.5447336", "0.54427916", "0.542362", "0.5412823", "0.53942627", "0.53903246", "0.5373594", "0.53734636", "0.53542435", "0.53504854", "0.53275275", "0.5323949", "0.531415", "0.53040516", "0.52973074", "0.52892303", "0.5288979", "0.5284444", "0.52618486", "0.52612215", "0.5257907", "0.525132", "0.5249988", "0.5243968", "0.52430475", "0.5242434", "0.5240196", "0.52397853", "0.52364737", "0.52334976", "0.5230778", "0.522891", "0.522011", "0.52168465", "0.5212492", "0.5210272", "0.52005094", "0.5190937", "0.51848394", "0.518338", "0.5175676", "0.51755273", "0.51720774", "0.5169144", "0.5164811", "0.5164513", "0.5163381", "0.515965", "0.5151835", "0.5148862" ]
0.62616014
12
Setup DB before each test.
public function setUp() : void { parent::setUp(); require_once(__DIR__.'/stubs/Stub_User.php'); require_once(__DIR__.'/stubs/Widget.php'); $this->loadLaravelMigrations(); $this->loadMigrationsFrom(__DIR__ . '/../src/database/migrations'); $this->withFactories(__DIR__.'/../src/database/factories'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUpTestDatabase() {}", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "protected function setUp() {\n $db = Kohana::config('database.default.connection.database');\n Kohana::config('database')->default['connection']['database'] = 'test_'.$db;\n DB::query(Database::DELETE, 'DROP TABLE IF EXISTS ut_init, ut_pop, db_deltas')\n ->execute();\n }", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$oContext = &Context::getInstance();\n\n\t\t$db_info = include dirname(__FILE__) . '/../config/db.config.php';\n\n\t\t$db = new stdClass();\n\t\t$db->master_db = $db_info;\n\t\t$db->slave_db = array($db_info);\n\t\t$oContext->setDbInfo($db);\n\n\t\tDB::getParser(TRUE);\n\t}", "public function setUp()\n {\n parent::setUp();\n\n $this->database = \\oxDb::getDb();\n }", "public function setUp()\n {\n TestConfiguration::setupDatabase();\n }", "protected function setUp(): void\n {\n $this->dbSetUp();\n $this->prepareObjects();\n $this->createDummyData();\n }", "function setUp()\n\t{\n\t\tglobal $config;\n\t\tDb::init($config);\n\t\t$this->db = Db::get_instance();\n\t\t$this->sql = SqlObject::get_instance();\n\t}", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "public function setUp()\n {\n parent::setUp();\n $this->setupDatabase();\n }", "protected function setUp(): void\n {\n $this->recreateDbScheme();\n $this->getConnection()\n ->insertInitData($this->getDataSet());\n parent::setUp();\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->setupTestDatabase();\n\n if ($this->usingInMemoryDatabase()) {\n\n // Setup database, then setup User & default role\n $this->refreshDatabase();\n $this->setupUser();\n } elseif (!static::$initialized) {\n\n // Only refresh db once\n $this->refreshDatabase();\n static::$initialized = true;\n }\n }", "protected function setUp()\n {\n try {\n chdir(CWD . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);\n if (!isset($this->db)) {\n $schema = \\Yana\\Files\\XDDL::getDatabase('check');\n $this->db = new \\Yana\\Db\\FileDb\\Connection($schema);\n }\n // reset database\n $this->db->remove('i', array(), 0);\n $this->db->remove('t', array(), 0);\n $this->db->remove('ft', array(), 0);\n $this->db->commit();\n $this->query = new \\Yana\\Db\\Queries\\Insert($this->db);\n } catch (\\Exception $e) {\n $this->markTestSkipped(\"Unable to connect to database\");\n }\n }", "public function setUp()\n\t{\n\t\t$this->handler = new DbHandler();\n\t}", "public function setUp() {\n ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n }", "protected function setUp() {\r\n $this->_instance = $this->getProvider()->get('PM\\Main\\Database');\r\n\r\n parent::setUp();\r\n }", "public function beforeSetup()\n {\n $this->setUpDatabaseConnection();\n\n $this->createSchema();\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\n parent::setUp();\n\n $this->db = get_db();\n $this->_exhibitsTable = $this->db->getTable('NeatlineExhibit');\n\n }", "public function setUp()\n\t{ \n\t\tparent::setUp();\n\n\t\t$this->app['config']->set('database.default','sqlite');\t\n\t\t$this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n\t\t$this->migrate();\n\t}", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp()\n\t{\n\t\t$this->connection = Db::connection(array(\n\t\t\t'driver' => 'mysql',\n\t\t\t'username' => 'root',\n\t\t\t'password' => isset($_SERVER['DB']) ? '' : 'root',\n\t\t\t'database' => 'test_database',\n\t\t));\n\t}", "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 }", "public function setUp() {\n\t\t$this->setUpDatabase();\n\t\t$this->match = new Match;\n\t}", "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\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 ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n\n Model::$auto_prefix_models = null;\n }", "public static function setUpBeforeClass() {\n Database::registry()\n ->addDriver('default', new MongoDriver(Config::get('db')));\n\n // Remove singletons\n User::flushInstances();\n Book::flushInstances();\n Series::flushInstances();\n Profile::flushInstances();\n }", "public function setUp()\n {\n parent::setUp();\n \n $this->db = Ediary_Db::getInstance();\n $this->object = new Ediary_Database_Schema($this->db);\n \n // DEBUG: THIS WILL DROP TABLES AND RECREATE THEM\n //Ediary_Db::getInstance()->upgrade();\n }", "public static function setUpBeforeClass() {\n\t\t$database = MYSQL_DSN;\n\t\t$pdo = new \\PDO(MYSQL_DSN, MYSQL_USER, MYSQL_PASSWORD);\n\t\t$pdo->exec('drop table if exists user');\n $pdo->exec('drop table if exists item');\n\t\t$create = <<<SQL\nCREATE TABLE `user` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(45) DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8\nSQL;\n\t$pdo->exec($create);\n\t$create2 = <<<SQL\nCREATE TABLE `item` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(45) DEFAULT NULL,\n `created_at` timestamp,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8\nSQL;\n\t\t$r = $pdo->exec($create2);\n\n\n\t\t$insert = <<<SQL\ninsert into user values(1, 'sato');\ninsert into user values(2, 'suzuki');\ninsert into user values(3, 'takahashi');\ninsert into user values(4, 'tanaka');\ninsert into user values(5, 'ito');\nSQL;\n\t\t$pdo->exec($insert);\n $pdo = null;\n\t}", "public function setUp() {\n\t\t$this->validConnectionString = \"host=testdatabase port=5432 dbname=AtroxTest user=WebUser password=test\";\n\t\t$this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());\n\t\t$this->application->setConnection(new Atrox_Core_Data_PostgreSql_Connection($this->validConnectionString));\n\t\t$this->application->getConnection()->connect();\n\t\t$this->application->setLogPath(realpath(\"../../../../../Log\"));\n\n\t\t$this->application->createBlogTable();\n\t}", "public static function setUpBeforeClass() {\n $dbh = new SQLiteDatabase(__DIR__ . '/../../database/chat_server.db');\n $dbh->query('INSERT INTO Users (username) VALUES(:username)', ['username' => 'Bob']);\n $dbh->query('INSERT INTO Users (username) VALUES(:username)', ['username' => 'Carl']);\n $dbh = null;\n }", "protected function setUp()\n {\n parent::setUp();\n\n $this->databaseTester = null;\n if (method_exists($this, 'getSetUpOperation')) {\n $this->getDatabaseTester()->setSetUpOperation($this->getSetUpOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n if ($this->databaseTester !== null) {\n $this->getDatabaseTester()->onSetUp();\n }\n }", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function setUp() {\n\t\t$this->PDO = $this->getConnection();\n\t\t$this->createTable();\n\t\t$this->populateTable();\n\n\t\t$this->ItemsTable = new ItemsTable($this->PDO);\n\t}", "protected function setUp () {\n $this->pdoConnection = new \\PDO('mysql:host='.$this->config['server'].';',\n $this->config['user'],\n $this->config['password']);\n $this->pdoConnection->exec('DROP SCHEMA IF EXISTS '.$this->config['name']);\n $this->pdoConnection->exec('CREATE SCHEMA '.$this->config['name']);\n $this->pdoConnection->exec('USE '.$this->config['name']);\n $this->pdoConnection->exec(file_get_contents(__DIR__.'\\ConnectionTestSchema.sql'));\n\n $this->mysqli = new mysqli($this->config['server'],\n $this->config['user'],\n $this->config['password'],\n $this->config['name']);\n\n $this->mysqliConnection = new MysqliConnection($this->mysqli);\n $this->run = true;\n }", "public function setUp()\n {\n $this->reloadSchema();\n $this->reloadDataFixtures();\n }", "public function setUp()\r\n\t{\r\n\t\t$this->dbConnection = new \\SQLite3(self::TEST_DATABASE_PATH);\r\n\r\n\t\t$statement = $this->dbConnection->prepare(\"DELETE FROM `counter`\");\r\n\t\t$statement->execute();\r\n\t}", "protected function setUp() {\n $this->dbh = DB::getDBConnection('mysql:dbname=www_lab0123_users_test;host=127.0.0.1');\n\n // check if we actually got a connection\n if ($this->dbh == null) {\n $this->fail('DB::getDBConnection returned null..');\n }\n\n // create table in database (fail if couldn't do so)\n if (!$this->dbh->query(\n 'CREATE TABLE `users` (\n `id` int(11) NOT NULL,\n `email` varchar(255) NOT NULL,\n `password` varchar(255) NOT NULL,\n `name` varchar(255) NOT NULL,\n `phone` varchar(30) NOT NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1;'\n )) {\n\n $this->fail('Coudn\\'t create table in setup stage of testing');\n }\n\n \n }", "protected function setUp(): void\n {\n // echo '### ' . env('DB_CONNECTION') . '::`' . env('DB_DATABASE') . '`';\n parent::setUp();\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.default', 'sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n $this->migrate();\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public static function setUpBeforeClass() {\n global $app;\n\n Debug::enable();\n\n $app = new \\Silex\\Application();\n\n require 'config/test.php'; /* seperate config for the test db */\n require 'src/app.php';\n\n self::createSchema();\n\n $app['session.test'] = true;\n\n }", "public function initDBConnections(): void\n {\n $this->addConnectionsToConfig();\n $this->testConnections();\n }", "protected function setUp() {\n\t\t$dsn = 'mysql:dbname=test;host=127.0.0.1';\n\t\t$user = 'root';\n\t\t$pass = '';\n\n\t\t$this->pdo = new PDO($dsn,$user,$pass);\n\t\t$this->profiler = new Profiler($this->pdo, 0, 0);\n\t}", "public function setUp(): void\n {\n parent::setUp();\n\n $this->after_fix = $this->isMySQL8AfterFix();\n\n $this->artisan('migrate:fresh');\n\n (new CreateTables)->up();\n (new UpdateTables)->up();\n\n //\\DB::listen(function($sql) {\n // var_dump($sql);\n //});\n }", "public function setUp(): void\n {\n // Boot parent TestCase, which will set up the database and connections for us.\n parent::setUp();\n\n // Boot database\n $this->ci->db;\n\n $this->createSchema();\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function setUp() {\n\t\t$this->getConnection();\n\t\tforeach($this->fixtureData() as $row) {\n\t\t\t$record = new ExampleSolrActiveRecord();\n\t\t\tforeach($row as $attribute => $value) {\n\t\t\t\t$record->{$attribute} = $value;\n\t\t\t}\n\t\t\t$this->assertTrue($record->save());\n\t\t}\n\t}", "public function setUp()\n\t{\n\t\t$this->prepare_tables(\n\t\t\t'Model_User', \n\t\t\t'Model_Role', \n\t\t\t'Model_Roles_Users', \n\t\t\t'Model_User_Token'\n\t\t\t);\n\t}", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "protected function setUp() {\r\n\t\t$this->cacheDatabaseEntryRepository = new Tx_StaticfilecacheMananger_Domain_Repository_CacheDatabaseEntryRepository ();\r\n\t\t$this->cacheDatabaseEntryRepository->setFileTable('tx_ncstaticfilecache_file');\r\n\t\t$this->assertTrue($this->createDatabase());\r\n\t\t$this->useTestDatabase();\r\n\t\t$this->importExtensions(array('nc_staticfilecache'));\r\n\t\t$path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR .'fixtures'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'tx_ncstaticfilecache_file.xml';\r\n\t\t$this->importDataSet($path);\r\n\t}", "public function setUp(): void\n {\n if (!defined('ROOT_DIR')) {\n define(\"ROOT_DIR\", __DIR__ . \"/../\");\n }\n \n if (!class_exists('Database', false)) {\n require(\"./www/classes/database.class.php\");\n }\n if (!class_exists('Settings', false)) {\n require(\"./www/classes/settings.class.php\");\n }\n $this->settings = new \\Settings();\n \n try {\n $this->database = new \\Database($this->settings);\n } catch (Exception $error) {\n $this->markTestSkipped(\"Something went when loading Database class: \" .\n $error->getMessage());\n }\n }", "public function setUp()\n {\n parent::setUp();\n $this->container = $this->app->getContainer();\n\n // Check if phinxlog table exists in database.\n $tableSchema = $this->container->get('settings')->get('db')['database'];\n $pdo = $this->getPdo();\n $stmt = $pdo->prepare('SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = :tableschema AND TABLE_NAME = :phinxlog');\n $stmt->execute(['tableschema' => $tableSchema, 'phinxlog' => 'phinxlog']);\n\n $shouldMigrate = true;\n\n if ($stmt->fetch()) {\n $shouldMigrate = $this->hasPendingMigrations($pdo);\n }\n\n if ($shouldMigrate) {\n chdir(__DIR__ . '/../config');\n $wrap = new TextWrapper(new PhinxApplication());\n // Execute the command and determine if it was successful.\n $target = null;\n call_user_func([$wrap, 'getMigrate'], 'local', $target);\n $error = $wrap->getExitCode() > 0;\n if ($error) {\n throw new Exception('Error: Setup database failed with exit code: %s', $wrap->getExitCode());\n }\n }\n\n $this->truncateTables();\n Factory::INSERT()->execute($this->getConnection(), $this->getDataSet());\n }", "private function setUpAndReturnDatabaseStub() {}", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->dao = new SDAO ();\n\t\t$this->_startCache ();\n\t\t$this->dao->setModelDatabase ( Fortune::class, 'bench' );\n\t\t$this->_startDatabase ( $this->dao, 'bench' );\n\t}", "public function setUp(): void\n {\n parent::setUp();\n\n $this->createTables();\n }", "protected function setUp()\n {\n global $testCase;\n $testCase = 'table_for_test';\n\n $this->container = include './config/container.php';\n $this->store = $this->container->get(StoreFactory::KEY);\n }", "public static function setUpBeforeClass(){\n\t\tself::$connection = new Connection( $GLOBALS['DB_DRIVER'], $GLOBALS['DB_HOST'], $GLOBALS['DB_NAME'], $GLOBALS['DB_USER'], $GLOBALS['DB_PASS']);\n\t}", "protected function _setupDb()\n {\n // First, delete the DB if it exists\n $this->_teardownDb();\n \n // Then, set up a clean new DB and return it\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n return Sopha_Db::createDb($db, $host, $port);\n }", "public function setUpDatabase()\n\t{\n\t\t$schemes = new Schemes;\n\t\t$schemes->createRequestTable();\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Osuagwu',\n\t 'last_name' => 'Emeka',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Lagos, Nigeria',\n\t 'sex' => 'Male',\n\t ]);\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Mustafa',\n\t 'last_name' => 'Ozyurt',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Berlin, Germany',\n\t 'sex' => 'Male',\n\t ]);\n\t}", "public function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\tif ( ! extension_loaded('pdo_sqlite'))\n\t\t{\n\t\t\t$this->markTestSkipped('SQLite PDO PHP Extension is not available');\n\t\t}\n\n\t\tif ( ! Kohana::$config->load('cache.sqlite'))\n\t\t{\n\t\t\tKohana::$config->load('cache')\n\t\t\t\t->set(\n\t\t\t\t\t'sqlite',\n\t\t\t\t\t[\n\t\t\t\t\t\t'driver' => 'sqlite',\n\t\t\t\t\t\t'default_expire' => 3600,\n\t\t\t\t\t\t'database' => 'memory',\n\t\t\t\t\t\t'schema' => 'CREATE TABLE caches(id VARCHAR(127) PRIMARY KEY, tags VARCHAR(255), expiration INTEGER, cache TEXT)',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t}\n\n\t\t$this->cache(Cache::instance('sqlite'));\n\t}", "public function _before(\\Codeception\\TestCase $test)\n {\n // Populate DB\n DatabaseSeeder::Seed(false);\n }", "protected function setUpTestDatabase()\n {\n $this->bootstrap->initializeTypo3DbGlobal();\n\n /** @var DatabaseConnection $database */\n $database = $GLOBALS['TYPO3_DB'];\n if (!$database->sql_pconnect()) {\n throw new Exception(\n 'TYPO3 Fatal Error: The current username, password or host was not accepted when the'\n . ' connection to the database was attempted to be established!',\n 1377620117\n );\n }\n\n $databaseName = $GLOBALS['TYPO3_CONF_VARS']['DB']['database'];\n // Drop database in case a previous test had a fatal and did not clean up properly\n $database->admin_query('DROP DATABASE IF EXISTS `' . $databaseName . '`');\n $createDatabaseResult = $database->admin_query('CREATE DATABASE `' . $databaseName . '`');\n if (!$createDatabaseResult) {\n $user = $GLOBALS['TYPO3_CONF_VARS']['DB']['username'];\n $host = $GLOBALS['TYPO3_CONF_VARS']['DB']['host'];\n throw new Exception(\n 'Unable to create database with name ' . $databaseName . '. This is probably a permission problem.'\n . ' For this instance this could be fixed executing'\n . ' \"GRANT ALL ON `' . substr($databaseName, 0, -10) . '_ft%`.* TO `' . $user . '`@`' . $host . '`;\"',\n 1376579070\n );\n }\n $database->setDatabaseName($databaseName);\n // On windows, this still works, but throws a warning, which we need to discard.\n @$database->sql_select_db();\n }", "protected function setUp()\n\t{\n\t\t$this->username = getenv('DBUSER') ? getenv('DBUSER') : NULL;\n\t\t$this->password = getenv('DBPASS') ? getenv('DBPASS') : NULL;\n\t\tparent::setUp();\n\t}", "protected function setUp()\n\t{\n $dsn = sprintf('sqlite:%s/pdo_test.db', __DIR__);\n $this->pdo = new \\PDO($dsn);\n $this->handler = new Handler($this->pdo);\n\n\t\t// create our logger and our pdo handler\n\t\t$this->logger = new Logger(self::APP_NAME);\n $this->logger->pushHandler($this->handler);\n\n // drop the table\n $drop_sql = sprintf(\"\n\t\t\tDROP TABLE IF EXISTS %s;\n\t\t\", Handler::DEFAULT_TABLE_NAME);\n\n\t\t$this->pdo->exec($drop_sql);\n \n // create the table\n\t\t$create_sql = sprintf(\"\n CREATE TABLE %s (\n id integer(11) PRIMARY KEY,\n time datetime DEFAULT(CURRENT_TIMESTAMP),\n level varchar(100) NOT NULL,\n channel varchar(25) NOT NULL,\n message text\n );\n \", Handler::DEFAULT_TABLE_NAME);\n\n $this->pdo->exec($create_sql);\n\t}", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->dropTables($this->tables);\n $this->createTables($this->tables);\n $this->insertDefaultRows();\n\n $this->repository = new RepositoryConcrete();\n $this->repository->getDbAdapter()->setAdapter($this->getAdapter());\n\n $cacheService = new CacheService();\n $cacheService->setCacheDir($this->getDataDir() . '/cache');\n $this->repository->setCache($cacheService->getFrontend());\n\n // Remove as pastas criadas\n $this->clearDataDir();\n }", "private function initDatabase() {\n \n \n \n }", "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function _before()\n {\n parent::_before();\n $path = dirname(__DIR__);\n Configuration::addPath($path);\n $cfg = include($path .'/orm-db-settings.php');\n $this->_adapter = new MysqlAdapter($cfg['orm-db']['options']);\n /** @var Schema $schemaDef */\n $schemaDef = include($path . '/schema_def.php');\n $sql = $schemaDef->setAdapter($this->_adapter)->getCreateStatement();\n $this->_adapter->execute($sql);\n }", "protected function setUp()\r\n {\r\n parent::setUp();\r\n\r\n $this->driver = new Driver([\r\n 'dsn' => 'mysql:dbname=mysql;host=127.0.0.1'\r\n ]);\r\n }", "protected function setUpDatabaseConnectionMock() {}", "protected function setUp()\n {\n parent::setUp();\n\n $this->loadMigrationsFrom(__DIR__.'/database/migrations');\n $this->withFactories(__DIR__.'/database/factories');\n $this->artisan('migrate', ['--database' => env('DB_DATABASE', 'lighthouse')]);\n }", "protected function setUp() {\n\t\t$this->object = new Model(\"test\", new PDODatabase(DB_DSN, DB_USER, DB_PASS, DB_CHARSET));\n\t}", "protected function setUp()\n {\n if (file_exists(__DIR__.'/../storage/testing/stub.sqlite')) {\n unlink(__DIR__.'/../storage/testing/stub.sqlite');\n }\n\n // Delete testing database if exists\n if (file_exists(__DIR__.'/../storage/testing/database.sqlite')) {\n unlink(__DIR__.'/../storage/testing/database.sqlite');\n }\n\n touch(__DIR__.'/../storage/testing/database.sqlite');\n\n ini_set('memory_limit', '1G');\n\n parent::setUp();\n\n Artisan::call('db:seed', ['--class' => 'TestingSeeder']);\n }", "protected function setUp()\n {\n parent::setUp();\n \n if (defined('SOPHA_TEST_DB_URL') && SOPHA_TEST_DB_URL) {\n $this->_url = SOPHA_TEST_DB_URL;\n } else {\n $this->_url = null;\n }\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->table = config('database-config.table');\n }", "protected function setUp()\n {\n $this->object = new Sql();\n }", "public function setUp() {\n parent::setUp();\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n }", "protected function setUpDatabase($app)\n {\n\n }", "public function setUp()\n {\n $this->manager = new SchemaInitializerManager();\n }", "public function __construct()\n {\n putenv('DB_CONNECTION=sqlite');\n putenv('DB_DATABASE=:memory:');\n parent::setUp();\n }", "protected function setUp(): void {\n $this->object = new \\PDOTester();\n }", "private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}", "protected function setUp()\n {\n $this->preSetup();\n parent::setUp();\n }", "protected function setUp(): void {\n // Code before Laravel application created.\n parent::setUp();\n // Code after Laravel application created.\n\n $this->setUpDatabase();\n\n Factory::guessFactoryNamesUsing(\n fn (string $modelName) => 'OndrejVrto\\\\Visitors\\\\Database\\\\Factories\\\\'.class_basename($modelName).'Factory'\n );\n }", "protected function setUp()\n {\n $this->setUpFilesystem();\n $this->object = Config::table('users');\n }", "protected function setUp()\n {\n Kohana::config('database')->default = Kohana::config('database')\n ->unit_testing;\n Auth::instance()->login(TEST_USERNAME, TEST_PASSWORD);\n\n // Index data and start up the search daemon\n exec('indexer --all --config ' . SPHINX_CONF);\n exec('searchd --config ' . SPHINX_CONF);\n }", "protected function setUp() {\n\t\t$this->sql = new $GLOBALS['SQLSOLUTION_TEST_USER_CLASS'];\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t}", "protected function initializeTestDatabase()\n {\n $this->bootstrap->initializeTypo3DbGlobal();\n /** @var DatabaseConnection $database */\n $database = $GLOBALS['TYPO3_DB'];\n if (!$database->sql_pconnect()) {\n throw new Exception(\n 'TYPO3 Fatal Error: The current username, password or host was not accepted when the'\n . ' connection to the database was attempted to be established!',\n 1377620117\n );\n }\n\n $database->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['database']);\n $database->sql_select_db();\n foreach ($database->admin_get_tables() as $table) {\n $database->admin_query('TRUNCATE ' . $table['Name'] . ';');\n }\n }", "public static function setUpBeforeClass() {\n\t\t$pdo = new \\PDO(PGSQL_DSN, PGSQL_USER, PGSQL_PASSWORD);\n $pdo->exec('SET search_path TO ' . PGSQL_SCHEMA);\n\t\t$r = $pdo->exec('drop table ' . PGSQL_SCHEMA . '.user');\n\t\t$create = 'CREATE TABLE ' .PGSQL_SCHEMA . '.';\n $create2 = <<<SQL\nuser (\n id int,\n name varchar(45) NOT NULL,\n PRIMARY KEY (id)\n );\nSQL;\n $create = $create . $create2;\n\t\t$pdo->exec($create);\n\n\t\t$insert = \"insert into \" . PGSQL_SCHEMA . \".user values(1, 'sato')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(2, 'suzuki')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(3, 'takahashi')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(4, 'tanaka')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(5, 'ito')\";\n $pdo->exec($insert);\n\n\t}", "protected function setUp()\n {\n parent::setUp();\n $this->query = new Query;\n }", "public function setUp(): void\n {\n parent::setUp();\n\n if ($this->getConnection()->config()['scheme'] !== 'postgres') {\n $this->markTestSkipped('Skipping tests for postgres, current driver is `' . $this->getConnection()->config()['scheme'] . '`');\n }\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.default', 'sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n $this->app['config']->set('jsonapi', [EmployeesTransformer::class, OrdersTransformer::class]);\n $this->app['config']->set('app.url', 'http://localhost/');\n $this->app['config']->set('app.debug', true);\n $this->app['config']->set('app.key', \\env('APP_KEY', '1234567890123456'));\n $this->app['config']->set('app.cipher', 'AES-128-CBC');\n\n $this->app->boot();\n\n $this->migrate();\n }", "public function setUp()\n {\n $dsn = 'mysql:host=localhost;dbname=demo';\n\n $pdo = new \\PDO($dsn, 'root', '');\n\n $driver = new MySQLDriver($pdo, 'demo');\n\n $this->table = new Table('post', $driver);\n }", "public function setUp()\n {\n $dbh = DB::getPDO();\n $dbh->beginTransaction();\n\n $this->user = new User( \"[email protected]\", \"Some User\", \"nopass\", \"lecturer\" );\n $this->assertNotFalse($this->user->insert());\n\n $this->extraUser = new User( \"[email protected]\", \"Another User\", \"nopass\", \"lecturer\" );\n $this->assertNotFalse($this->extraUser->insert());\n\n $this->video = $this->createDummyVideo();\n $this->assertNotFalse($this->video->insert());\n }", "protected function setUp()\n {\n $this->object = new Util_Db_Extends;\n }", "private function init_db()\n {\n /**\n * If we've set that we want to use the database, initialize it.\n * Or we may use our parent's\n *\n * Inicializa a base de dados se esse app estiver configurado pra usar a base\n * de dados. Ou usa do nosso parent\n */\n\n if (isset($this->parent->db)) {\n $this->db = $this->parent->db;\n } else {\n $this->load->db('mysql');\n }\n\n }", "private function setup_db_variables() {\n\t\tglobal $wpdb;\n\t\t$this::$dbtable = $wpdb->prefix . self::DBTABLE;\n\t\t$this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;\n\n\t\t/**\n\t\t * Filter db table used for simple history events\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table\n\t\t */\n\t\t$this::$dbtable = apply_filters( 'simple_history/db_table', $this::$dbtable );\n\n\t\t/**\n\t\t * Filter table name for contexts.\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table_contexts\n\t\t */\n\t\t$this::$dbtable_contexts = apply_filters(\n\t\t\t'simple_history/logger_db_table_contexts',\n\t\t\t$this::$dbtable_contexts\n\t\t);\n\t}", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp(): void\n {\n $this->resultSet = new ResultSet();\n }" ]
[ "0.8160622", "0.8041275", "0.7950353", "0.79292965", "0.79174125", "0.78887624", "0.785612", "0.781613", "0.77883744", "0.77487916", "0.7687011", "0.7618829", "0.7593557", "0.75930375", "0.7565489", "0.75577295", "0.7547589", "0.7539172", "0.750567", "0.7492445", "0.7492095", "0.74796", "0.74367934", "0.74241096", "0.74184066", "0.73707604", "0.7359349", "0.7351425", "0.73368853", "0.73279667", "0.7303706", "0.7303625", "0.72958684", "0.72733355", "0.72604364", "0.7259065", "0.72488236", "0.7245385", "0.7224995", "0.722135", "0.72038656", "0.71834236", "0.71820635", "0.71750534", "0.7173738", "0.7159156", "0.7151805", "0.71502227", "0.71456134", "0.7142373", "0.7136033", "0.7122094", "0.7107732", "0.7094484", "0.7077912", "0.70665973", "0.70556223", "0.70520663", "0.70504516", "0.70498866", "0.7041049", "0.70355725", "0.70298517", "0.699443", "0.69884074", "0.69459885", "0.6938349", "0.69359124", "0.6934859", "0.69315004", "0.6931165", "0.69303596", "0.6927823", "0.6922262", "0.69176054", "0.6915108", "0.6913832", "0.6912203", "0.69107735", "0.6909817", "0.6891754", "0.6886586", "0.686145", "0.6858981", "0.68582153", "0.6840844", "0.68342054", "0.6832575", "0.6831002", "0.6828448", "0.68037355", "0.6797639", "0.67963296", "0.6795581", "0.67916346", "0.6788383", "0.67849475", "0.67756146", "0.6773188", "0.676914", "0.67588353" ]
0.0
-1
PENDING SANG KDA ROW KA PRODUCT
public function get_restock_notif_list($pro_id){ $sql = "SELECT *, SUM(qty_total) as total_pending FROM tbl_order, tbl_orditem WHERE tbl_order.order_id=tbl_orditem.order_id AND tbl_order.status='0' AND pro_id='$pro_id'"; $result = mysqli_query($this->db,$sql); $row = mysqli_fetch_assoc($result); $value = $row['total_pending']; return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProductQuery() {\n\t $csvilog = JRequest::getVar('csvilog');\n\t \n\t /* Bind the initial data */\n\t $this->_vm_product->bind($this);\n\t \n\t /* Set some initial values */\n\t /* Set the modified date as we are modifying the product */\n\t $this->_vm_product->mdate = time();\n\t \n\t /* We have a succesful save, get the product_id */\n\t if ($this->_vm_product->store()) {\n\t\t $csvilog->AddMessage('debug', JText::_('DEBUG_STORE_PRODUCT'), true);\n\t\t if (substr($this->_vm_product->_db->getQuery(), 0, strpos($this->_vm_product->_db->getQuery(),' ')) == 'UPDATE') {\n\t\t\t $langtype = 'UPDATE_PRODUCT_SKU';\n\t\t\t $sqltype = 'updated';\n\t\t }\n\t\t else {\n\t\t\t $langtype = 'ADD_PRODUCT_SKU';\n\t\t\t $sqltype = 'added';\n\t\t }\n\t\t $csvilog->AddStats($sqltype, str_ireplace('{product_sku}', $this->record_identity, JText::_($langtype)), true);\n\t\t return true;\n\t }\n\t else {\n\t\t $csvilog->AddMessage('debug', JText::_('DEBUG_STORE_PRODUCT'), true);\n\t\t return false;\n\t }\n }", "public function getCustomOptionsOfProduct(Varien_Event_Observer $observer)\n{\n $invoice = $observer->getEvent()->getInvoice();\n$invoidData = $invoice->getData();\n//Mage::log($invoidData);\n$orderId = $invoidData['order_id'];\n$cid = $invoidData['customer_id'];\n$order1 = Mage::getModel('sales/order')->load($orderId);\n $Incrementid = $order1->getIncrementId();\n//Mage::log( $Incrementid.\"Order Id\"); \n\n// Assign Field To Inset Into CreditInfo Table\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); // Current TimeStamp\n\n$arr['c_id'] = $cid;//Customer Id\n$arr['store_view'] = Mage::app()->getStore()->getName(); //Storeview\n$arr['state'] = 1; //State Of Transaction\n$arr['order_id'] = $Incrementid; //OrderId\n$arr['action'] = \"Crdits\"; //Action\n$arr['customer_notification_status'] = 'Notified'; //Email Sending Status\n$arr['action_date'] = $nowdate; //Current TimeStamp\n$arr['website1'] = \"Main Website\"; //Website\n\nforeach ($invoice->getAllItems() as $item) {\n\n//Mage::log($item->getQty().\"Item Quntity\");\n\n$orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n$data = $orderItem->getData();\n$arr['action_credits'] = $data[0]['credits'] * $item->getQty();\n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$cid)->addFieldToFilter('website1','Main Website')->getLastItem();\n\n$totalcredits = $collection->getTotalCredits();\n$arr['total_credits'] = $arr['action_credits'] + $totalcredits;\n$arr['custom_msg'] = \"By User:For Purchage The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n$arr['item_id'] = $item->getOrderItemId();\n$table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr);\ntry{\n if($arr['action_credits'] > 0)\n $table1->save();\n\n}catch(Exception $e){\n Mage::log($e);\n }\n\n}//end Foreach\n\n\n\n}", "function onAction()\n {\n global $application;\n $request = $application->getInstance('Request');\n\t$msgres = $application->getInstance(\"MessageResources\", \"messages\");\n\n // checking if wishlist product is being added\n $wl_id = $request->getValueByKey('wl_id');\n if ($wl_id > 0)\n {\n $data = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id);\n if (!$data)\n {\n // invalid wishlist record...\n $request = new Request();\n $request -> setView('Wishlist');\n $application -> redirect($request);\n\t\t$this->setStatusError();\n\t\t$this->setMessage('Invalid wishlist record');\n }\n\n $options_sent = $data['options_sent'];\n $prod_id = $data['entity_id'];\n }\n else\n {\n $prod_id = $request->getValueByKey('prod_id');\n\n $data=array(\n 'parent_entity' => 'product'\n ,'entity_id' => $prod_id\n ,'options' => $request->getValueByKey('po')\n ,'qty' => $request->getValueByKey('quantity_in_cart')\n \t\t ,'colorname' => $request->getValueByKey('colorname')\n\n );\n\n $options_sent = $request->getValueByKey('options_sent');\n }\n\n // setting qty=1 if quantity_in_stock is not specified\n if (!$data['qty'] && $data['qty'] !== 0)\n $data['qty'] = 1;\n\n if($data['options']==null)\n {\n $data['options']=array();\n }\n\n\n $result = modApiFunc('Cart', 'processPostedProductData', $data, $options_sent);\n\n if (!$result['is_error'])\n {\n if(!empty($result['stock_discarded_by_warning']))\n {\n modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by_warning']);\n }\n\n $added = modApiFunc('Cart', 'addToCart', $result['data']);\n\t $cc = modApiFunc('Cart', 'getCartContent');\n\t $cartPrice = '';\n\t $cart_id = $prod_id.\"_\".modApiFunc(\"Product_Options\", \"getCombinationHash\", $result['data']['options']);\n\t if( !empty($cc))\n\t\t foreach($cc as $product)\n\t\t\t if($product[\"CartID\"]==$cart_id)\n\t\t\t\t $cartPrice = modApiFunc(\"Localization\", \"format\", $product[\"CartItemSalePrice\"], \"currency\");\n\n\t $this->setStatusSuccess();\n\n\t $p = new CProductInfo($prod_id);\n\t $message = array(\n\t\t \"<h2>\".$msgres->getMessage('CATALOG_PRODUCT_ADDED').\"</h2>\".\n\t\t \"<div class='ajax_message_cart_prod_link'><a href='\". $p->getProductInfoLink($prod_id, $p->chooseCategoryID()) .\"'>\".$p->getProductTagValue('name').\"</a></div>\".\n \"<div class='ajax_message_cart_prod_qty'>\".$data['qty'].\"&nbsp;\".$msgres->getMessage('CATALOG_X').\"&nbsp;\".$cartPrice.\"</div>\"\n );\n\n // if a wishlist product is being added...\n if ($wl_id > 0 && $added)\n {\n modApiFunc('Wishlist', 'removeFromWishlist', $wl_id);\n\t\t$message[] = 'This product was removed from your Wishlist';\n }\n\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView(CURRENT_REQUEST_URL);\n $application->redirect($request);\n }\n else\n {\n\t $this->setStatusError();\n\t $message = array();\n\n if($result['discard_by'] != 'none')\n {\n modApiFunc('Session','set','OptionsDiscardedBy',$result['discard_by']);\n\t\t$message[] = $msgres->getMessage($result['discard_by']);\n }\n if($result['stock_discarded_by'] != 'none')\n {\n\t\t modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by']);\n\t\t $message[] = $msgres->getMessage($result['stock_discarded_by']);\n }\n modApiFunc('Session','set','sentCombination',$result['data']['options']);\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView('ProductInfo');\n $request->setAction('SetCurrentProduct');\n $request->setKey('prod_id',$prod_id);\n $request->setProductID($prod_id);\n $p = new CProductInfo($prod_id);\n $request->setCategoryID($p->chooseCategoryID());\n $application->redirect($request);\n };\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "function setSyncItemsCodeProduct()\n {\n }", "public function approve_pros()\n {\n $data = [ 'aktif' => 'approve_pros',\n 'data_pros' => $this->M_prospektus->get_data_pros_con()->result_array(),\n\n ];\n\n $this->template->load('template', 'kontributor/V_approve_pros', $data);\n }", "public function report_product_prepration($id) {\n //permittedArea();\n $data['view_assistant'] = $this->db->get_where('product_ingredients', ['product_preparation' => $id]);\n \n \n theme('report_product_prepration', $data);\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function fn_warehouses_gather_additional_products_data_pre($products, &$params, $lang_code)\n{\n if (!isset($params['get_warehouse_amount'])) {\n $params['get_warehouse_amount'] = false;\n }\n\n if (AREA == 'A') {\n $params['get_warehouse_amount'] = true;\n }\n}", "public function getUpdateProductData();", "function recProduct($dt) {\n $payload = $dt;\n\n $this->sql = \"UPDATE inventory_tb SET is_Archive = 0 WHERE item_id =$dt->item_id\";\n\n $this->conn->query($this->sql);\n\n $this->data = $payload;\n\n return array(\n 'status'=>$this->status,\n 'payload'=>$this->data,\n 'prepared_by'=>'Inventory Admin',\n 'timestamp'=>date('D M j, Y h:i:s e')\n );\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function getAllOrderProductTable()\n {\n $statusComplete = false;\n try {\n // run your code here\n $sql = \"SELECT * FROM `pish_hikashop_order_product`\".\n \" WHERE `order_id` = \".$this->last_id.\";\"; //have error\n \n \n $result = $this->conn->query($sql);\n if ($result) {\n $rowcount = $result->num_rows;\n if ($rowcount > 0) {\n $dev_array = array();\n for ($i = 0; $i < $result->num_rows; $i++) {\n $row = $result->fetch_assoc();\n $dev_array[$i] = $row;\n }\n \n $message = '';\n //create message for send\n foreach($dev_array as $key => $value){\n $message .='تعداد ';\n $message .= $value['order_product_quantity'].' ';\n $message .='نام محصول: ';\n $message .= $value['order_product_name'];\n $message .= ' <br>';\n \n }\n $this->messageProducts = $message;\n\n return true;\n } else {\n $statusComplete = false;\n }\n } else {\n $statusComplete = false;\n return false;\n \n }\n } catch (exception $e) {\n //code to handle the exception\n return false;\n }\n return $statusComplete;\n }", "public function buy()\n\t{\n\t\t$data['aktif']\t= 'prospektus';\n\t\t$this->template->load('template','prospektus/V_buy', $data);\n\t}", "public function increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }", "public function offerApplyButton(\\WC_Product $product)\n { // amennyiben a sajátja az offer, akkor nem tud jelentkezni\n if (current_user_can('edit_post', $product->get_id())) {\n echo '';\n }\n\n // jelentekezett máár rá vagy nem?\n // todo Remco színezd meg légyszi a gombokat és a js függvényx bemenő paraméterének kellene az offer id\n if (!get_current_user_id() || (get_current_user_id() && !$this->offerApply->isUserAppliedOffer(get_current_user_id(), $product->get_id()))) {\n echo \"<button type='button' style='background-color: green !important;' onclick='window.synerbay.appearOffer(\".$product->get_id().\")' class='button'>[angol szöveg] jelentkezés</div></button>\";\n } else {\n echo \"<button type='button' onclick='window.synerbay.disAppearOffer(\".$product->get_id().\")' class='button'>[angol szöveg] lejelentkezés</div></button>\";\n }\n }", "public function AddProduct () {\n $piece1 = '(';\n \t$piece2 = '';\n\t\t\n\t\tif(isset($SKU)) {\n\t\t\t$piece1 .= 'ProductSKU,';\n\t\t\t$piece2 .= \"'\" . $this->SKU . \"'\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: SKU Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$productTable = 'Products';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $productResults = OrderData::InsertData($productTable, $productPiece);\n\t\t\n\t\tif($productResults === false)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(isset($Qty)) {\n\t\t\t$piece1 .= 'TotalAMT,';\n\t\t\t$piece2 .= \"\" . $this->initialquantityStock . \"\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: Quantity Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$piece1 .= 'CommittedAMT,';\n\t\t$piece2 .= $this->committedStock . ',';\n\n \t\t$piece1 .= 'AvailableAMT';\n $piece2 .= $this->availableStock . ')';\n\t\t\n\t\t$piece1 .= ') VALUES (';\n\n $inventoryPiece = $piece1 . $piece2;\n\t\t\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $inventoryResults = OrderData::InsertData($inventoryTable, $inventoryPiece);\n\t\t\n\t\tif($inventoryResults === false)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "private function getExistProductRecount() {\n return false;\n }", "function __approve_purchase($id) {\n\t\treturn $this -> db -> query('update purchase_order_tab set pstatus=3 where pid=' . $id);\n\t}", "public function run() {\n try {\n $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n \n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('preorder_calender', array('date' => true, 'to' => $todayDate));\n $emailContent = '';\n $emailContent .= $todayDate.\"\\n\";\n echo 'Preorder-InStock process started @ '.$todayDate.' :'.\"\\n\\n\";\n echo 'Name'.\"\\t\".'SKU'.\"\\n\\n\";\n\n // Write into CSV\n $io = new Varien_Io_File();\n $path = Mage::getBaseDir('var') . DS . 'export' . DS;\n $name = md5(microtime());\n $file = $path . DS . $name . '.csv';\n $io->setAllowCreateFolders(true);\n $io->open(array('path' => $path));\n $io->streamOpen($file, 'w+');\n $io->streamLock(true);\n\n $header = array(\"Name\",\"SKU\");\n $io->streamWriteCsv($header);\n\n foreach ($products as $product) {\n $product->load();\n $data = array();\n $data[] = $product->getName();\n $data[] = $product->getSku();\n $io->streamWriteCsv($data);\n $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());\n $stock->setData('is_in_stock', 1);\n $stock->save();\n\n $product->setData('preorder_calender', null);\n $product->setData('custom_stock_status', 14);\n\n $product->save();\n $output = $product->getName().\"\\t\".$product->getSku();\n echo $output.\"\\n\";\n }\n\n // Send email with configuration in System > Configuration > Preoder Instock Updates > Receivers\n $emailTemplate = Mage::getModel('core/email_template')\n ->loadDefault('preoder_stock_email');\n\n $emailTemplate->setSenderName('Milan Direct Administrator');\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));\n $emailTemplate->setTemplateSubject('Preorder-InStock process started @ '.$todayDate);\n\n $emailTemplateVariables = array();\n $emailTemplateVariables['message'] = 'Preorder-InStock process finished with '.$products->count().' updated';\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\n // Add attachment\n $emailTemplate->getMail()->createAttachment(\n file_get_contents($file),\n Zend_Mime::TYPE_OCTETSTREAM,\n Zend_Mime::DISPOSITION_ATTACHMENT,\n Zend_Mime::ENCODING_BASE64,\n 'preorder_stock_report.csv'\n );\n\n $names = array();\n $receivers = explode(\",\", Mage::getStoreConfig('notification/general/email'));\n\n foreach($receivers as $receiver)\n {\n $names[] = 'Milan Direct Staff';\n }\n\n $emailTemplate->send($receivers,$names, $emailTemplateVariables);\n\n echo 'Preorder-InStock process finished with '.$products->count().' updated'.\"\\n\";\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::log($e->getMessage(), 1, 'preorder_instock.log');\n }\n }", "public function hookActionUpdateQuantity($params)\n {\n if ($this->CheckModuleInstaled('mailalerts') && Configuration::get('DESCOMSMS_CHECK_PRODUCT_STOCK') == 'on') {\n //Avoid entering 2 times in the hook when modifying product with combinations stock\n if (!$params['id_product_attribute']) {\n $sql = 'SELECT count(*) FROM '._DB_PREFIX_.'product_attribute where id_product = '.$params['id_product'];\n if ($this->db->getValue($sql)) {\n return false;\n }\n }\n\n $sql = 'SELECT * FROM '._DB_PREFIX_.'mailalert_customer_oos WHERE id_product = '.$params['id_product'].' AND id_product_attribute = '.$params['id_product_attribute'];\n $results = $this->db->ExecuteS($sql);\n\n foreach ($results as $row) {\n $sql = 'SELECT id_address FROM '._DB_PREFIX_.'address WHERE id_customer = '.$row['id_customer'];\n $addresses = $this->db->ExecuteS($sql);\n $sended = false;\n foreach ($addresses as $address) {\n if (!$sended || Configuration::get('DESCOMSMS_CHECK_PRODUCT_STOCK_ALL_ADDRESSES') == 'on') {\n $address = new Address($address['id_address']);\n $country = new Country($address->id_country);\n if (!empty($this->GetPhoneMobile($address, $country))) {\n $sql = 'SELECT name FROM '._DB_PREFIX_.'product_lang pl, '._DB_PREFIX_.'customer c WHERE pl.id_lang = c.id_lang AND pl.id_product = '.$params['id_product'].' AND c.id_customer = '.$row['id_customer'];\n $name = $this->db->getValue($sql);\n\n $data = [\n 'user' => Configuration::get('DESCOMSMS_USER'),\n 'pass' => $this->MyDecrypt(Configuration::get('DESCOMSMS_PASS'), Configuration::get('DESCOMSMS_KEY')),\n 'sender' => Configuration::get('DESCOMSMS_SENDER'),\n 'message' => $this->GetSMSText(Configuration::get('DESCOMSMS_TEXT_PRODUCT_STOCK'), '', $name, $params['quantity']),\n ];\n $data['mobile'] = $this->GetPhoneMobile($address, $country);\n\n $result = $this->SendSMS($data);\n $sended = true;\n //error_log(json_encode($result)); //TODO\n }\n }\n }\n }\n }\n }", "public function quote_request_success(){\n \t\t$catrelatedproducts = $catrelatedproducts = '';\n \t\t$catid = $_GET['catid'];\n \t\t$pids = $_GET['pid'];\n \t\tif ($catid) {\n \t\t\t$catrelatedproducts = $this->getRelatedProducts( $catid);\n \t\t\t$quote_related_products['catrelatedproducts']['data'] = $catrelatedproducts;\n \t\t\t$selectedterm = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($catid);\n \t\t\t$quote_related_products['catrelatedproducts']['selected_cat'] = $selectedterm->label();\n \t\t}\n \t\telseif($pids){\n\t\t\t$relatedproducts = $this->relatedproducts( $pids);\n\t\t\t$product_nodequery = \\Drupal::database()->select('node_field_data', 'nfd');\n\t\t\t$product_nodequery->fields('nfd', array('title'));\n\t\t\t$product_nodequery->condition('nfd.nid', $pids, 'IN');\n\t\t\t$product_nodequery->condition('nfd.status', 1);\n\t\t\t$product_nodequery->condition('nfd.type', 'products');\n\t\t\t$selected_productdata = $product_nodequery->execute()->fetchAll();\n\t\t\t$quote_related_products['relatedproducts']['selected_products'] = $selected_productdata;\n\t\t\t$quote_related_products['relatedproducts']['data'] = $relatedproducts;\n \t\t}\n \t\treturn array(\n\t '#theme' => 'thanks_template',//'quote_request_thanks',\n\t '#quote_related_products' => $quote_related_products,\n\t );\n\n \t}", "public function manageOrderProducts()\n {\n }", "function editRow($editProdCode,$quantity){\n \n $length = count($_SESSION['cortTable']);\n \n for($i=0;$i<$length;$i++){\n \n if ($_SESSION['cortTable'][$i]['prodCode'] == $editProdCode){\n \n $_SESSION['cortTable'][$i]['quantity'] = $quantity;\n }\n } \n }", "function purchaseTicket($ar){\n\nif (isset($GLOBALS['RRTESTSTA'])){\n XLogs::critical(get_class($this), '::purchaseTicket RRTESTSTA');\n throw new Exception('Coucou');\n $ta = new StdClass();\n $ta->NPOSNO = 0;\n $ta->NJOURNALNO = sprintf('%05d', '1'.date('ms'));\n $ta->NSERIALNO = sprintf('%05d', '2'.date('ms'));\n $ta->NPROJECTNO = 444;\n return $ta;\n}\n\n $wtpsi = $this->getAWTPSI();\n $pt= $ar['tapt'];\n $pool = $ar['pool'];\n $tt = $ar['tatt'];\n $prj = $ar['projectno'];\n $firstname = $ar['firstname'];\n $lastname = $ar['lastname'];\n $dob = $ar['dob'];\n\n $pur = array();\n\n list($chipid, $crc, $accno) = explode('-', $ar['wtpno']);\n $pur[0]['NPERSONTYPENO'] = $pt;\n $pur[0]['NPOOLNO'] = $pool;\n $pur[0]['NTICKETTYPENO'] = $tt;\n $pur[0]['NPROJECTNO'] = $prj;\n $pur[0]['SZVALIDFROM'] = $ar['validfrom'];\n\n // jcp 28/12/11, preco support TA : ne transmettre que le CHIPID\n // $pur[1]['SZACCEPTANCENO'] = $accno;\n // $pur[1]['SZCHIPIDCRC'] = $crc;\n $pur[1]['SZCHIPID'] = $chipid;\n \n // person data\n $pur[2]['SZLASTNAME'] = $lastname;\n $pur[2]['SZFIRSTNAME'] = $firstname;\n $pur[2]['SZDATEOFBIRTH'] = $dob;\n $pur[2]['SZSEX'] = NULL;\n $pur[2]['SZTITLE'] = NULL;\n $pur[2]['SZSALUTATION'] = NULL;\n \n // pas d'adress data\n $pur[3] = NULL; // adress data\n \n // articles -> faire un purchaseProduct\n if (isset($ar['articlesData'])){\n $pur[4] = $ar['articlesData'];\n $soapfunc = 'doPurchaseProduct';\n } else {\n $soapfunc = 'doPurchaseTicket';\n }\n\n $cc = '';\n foreach($pur as $foo=>$block){\n $c = $foo . ' : ';\n if (isset($block)){\n foreach($block as $name=>$value){\n $c .= ' '.$name.'=>'.$value;\n }\n }\n $cc .= $c;\n XLogs::notice(get_class($this), get_class($this).\"::purchaseTicket $c\");\n }\n // purchaseProduct / purchaseTicket\n $r = $wtpsi->$soapfunc(array('purchasedata'=>$pur));\n\n return $r;\n }", "function checkAvailableProduct($prodNum )\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from products_tb where id= '\".$prodNum.\"' and status ='1' \"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function modifyTurkey()\n {\n echo PHP_EOL;\n \n $turkeyToModify = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN); \n $turkeyToModify->ean = self::PRODUCT_TURKEY_NEW_EAN;\n $turkeyToModify->name = self::PRODUCT_TURKEY_NEW_NAME;\n \n try\n {\n $isTurkeyModified = $this->productDao->modify($turkeyToModify);\n\n echo self::PRODUCT_TURKEY_NAME . ' modified ' . \n (($isTurkeyModified) ? '' : 'un') . \n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "function changeProduct($cart_table_id,$true_or_false)\n {\n $this->pdelivery[$cart_table_id]=$true_or_false; //change product group delivery\n }", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "function wc_marketplace_product() {\n global $wmp;\n $wmp->output_report_product();\n }", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "function hapus_cart(){\n\t\t$data = array(\n\t\t\t'rowid' => $this->input->post('row_id'), \n\t\t\t'qty' => 0, \n\t\t);\n\t\t$this->cart->update($data);\n\t\techo $this->show_cart();\n\t}", "public function testUpdateProductUsingPOST()\n {\n }", "public function getProductSKU()\n {\n }", "public function payWayPurchase()\n\t{\n\t}", "function hapus_cart(){\n \t$data = array(\n \t\t'rowid' => $this->input->post('row_id'), \n \t\t'qty' => 0, \n \t);\n \t$this->cart->update($data);\n \techo $this->show_cart();\n }", "public function startCreateCoupon(){\n return view('app.CRUD.walletDetail.redeemProducts',['data'=>Product_master::where('status','Activo')->get()]);\n }", "function action_woocommerce_order_item_meta_start( $item_name, $item, $order ) { \r\n\t\r\n\t$product_id = $item['product_id'];\r\n\t$_enable_warehouse=get_metadata('post',$product_id,'_enable_warehouse',true);\r\n\tif($_enable_warehouse==1) \r\n\treturn $item_name.' (shipped by warehouse) ';\r\n\telse return $item_name;\r\n\t\r\n\t\r\n}", "private function updateQty($object)\n\t{\n\t\t$common = new Qss_Model_Extra_Extra();\n $MaLenhSX = @(string)$object->getFieldByCode('MaLenhSX')->szValue;\n $mSanXuat = Qss_Model_Db::Table('OSanXuat');\n $mSanXuat->where(sprintf(' MaLenhSX = \"%1$s\"', $MaLenhSX));\n $oSanXuat = $mSanXuat->fetchOne();\n//\t\t$ThaoDo = @(int)$common->getDataset(array('module'=>'OSanXuat'\n//\t\t\t\t\t, 'where'=>array('MaLenhSX'=>$MaLenhSX), 'return'=>1))->ThaoDo;\n $ThaoDo = @(int)$oSanXuat->ThaoDo;\n\n\t\tif($ThaoDo == 1)\n\t\t{\n\t\t\t// Neu thao do, set so luong ve disabled\n\t\t\t// Cong don so luong phu pham, hoac set ve 0 neu khong co phu pham\n//\t\t\t$PhuPham = $common->getDataset(array('module'=>'OSanLuong'\n//\t\t\t\t\t\t, 'where'=>array('IFID_M717'=>$object->i_IFID)));\n $mPhuPham = Qss_Model_Db::Table('OSanLuong');\n $mPhuPham->where(sprintf('IFID_M717 = %1$d', $object->i_IFID));\n\n\t\t\t$SoLuongPhuPham = 0;\n\t\t\t$insert = array();\n\t\t\t\n\t\t\tforeach($mPhuPham->fetchAll() as $p)\n\t\t\t{\n\t\t\t\t$SoLuongPhuPham += $p->SoLuong;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$insert['OThongKeSanLuong'][0]['SoLuong'] = $SoLuongPhuPham;\n\t\t\t\n\t\t\t$service = $this->services->Form->Manual('M717',$object->i_IFID,$insert,false);\n\t\t\tif($service->isError())\n\t\t\t{\n\t\t\t\t$this->setError();\n\t\t\t\t$this->setMessage($service->getMessage(Qss_Service_Abstract::TYPE_TEXT));\n\t\t\t}\n\t\t}\n\t}", "function kanbanAddPrinc($line) {\r\n\t$addInPrinc = '';\r\n\t$kanbanFullWidthElement = Parameter::getUserParameter ( \"kanbanFullWidthElement\" );\r\n\tif ($kanbanFullWidthElement == \"on\") {\r\n\t\tif ($line ['idstatus']) {\r\n\t\t\t$addInPrinc .= '<div style=\"float:left;margin-bottom:1px;margin-left:3px;margin-top:2px;height:21px;max-height:21px;overflow:hidden;white-space:nowrap;width:25%\">' . colorNameFormatter ( SqlList::getNameFromId ( \"Status\", $line ['idstatus'] ) . '#split#' . SqlList::getFieldFromId ( \"Status\", $line ['idstatus'], 'color' ), $line ['id'] ) . '</div>';\r\n\t\t}\r\n\t\tif ($line ['idtargetproductversion']) {\r\n\t\t\t$versionName = SqlList::getNameFromId ( \"TargetProductVersion\", $line ['idtargetproductversion'] );\r\n\t\t\tif ($versionName == $line ['idtargetproductversion']) {\r\n\t\t\t\t$versionName = SqlList::getNameFromId ( \"ProductVersion\", $line ['idtargetproductversion'] );\r\n\t\t\t}\r\n\t\t\t$addInPrinc .= '\r\n \t<div title=\"'.i18n('colIdTargetProductVersion').'\" style=\"float:left;\" class=\"kanbanVersion\" style=\"border:1px solid red;border-left:1px solid #e0e0e0;margin-left:5px;\">\r\n\t\t\t <div class=\"iconProductVersion16 iconProductVersion iconSize16\" style=\"margin-left:10px;margin-top:5px;width:16px;height:16px;float:left\"></div>\r\n <div id=\"targetProductVersion' . $line ['id'] . '\" style=\"float:left;margin:5px 0 0 2px;overflow:hidden;\">\r\n ' . $versionName . '\r\n </div>\r\n </div>';\r\n\t\t}\r\n\t\tif (isset ($line['idactivity']) && $line['idactivity'] != 0) {\r\n\t\t\t$addInPrinc .= '\r\n <div title=\"'.((isset($line['WorkElement']))?i18n('colPlanningActivity'):i18n('colParentActivity')).'\" style=\"float:left;\"> \r\n <div class=\"iconActivity16 iconActivity iconSize16\" style=\"margin-left:10px;margin-top:5px;width:16px;height:16px;float:left\"></div>\r\n <div class=\"kanbanActivity\" style=\"margin:5px 0 0 2px;overflow:hidden;float:left;\">\r\n ' . SqlList::getNameFromId ( \"Activity\", $line ['idactivity'] ) . '\r\n </div>\r\n </div>';\r\n\t\t}\r\n\t} else {\r\n\t\tif ($line ['idstatus']) {\r\n\t\t\t$addInPrinc .= '<div style=\"height:20px\" >' . colorNameFormatter ( SqlList::getNameFromId ( \"Status\", $line ['idstatus'] ) . '#split#' . SqlList::getFieldFromId ( \"Status\", $line ['idstatus'], 'color' ), $line ['id'] ).'</div>';\r\n\t\t}\r\n\t\tif ($line ['idtargetproductversion']) {\r\n\t\t\t$versionName = SqlList::getNameFromId ( \"TargetProductVersion\", $line ['idtargetproductversion'] );\r\n\t\t\tif ($versionName == $line ['idtargetproductversion']) {\r\n\t\t\t\t$versionName = SqlList::getNameFromId ( \"ProductVersion\", $line ['idtargetproductversion'] );\r\n\t\t\t}\r\n\t\t\t$addInPrinc .= '\r\n <table style=\"margin: 2px;\">\r\n <tr title=\"'.i18n('colIdTargetProductVersion').'\">\r\n <td>\r\n <div class=\"iconProductVersion16 iconProductVersion iconSize16\" style=\"width:16px;height:16px;float:left\"></div>\r\n </td>\r\n <td id=\"targetProductVersion' . $line ['id'] . '\" style=\"float:left;overflow:hidden;max-width:120px;margin-left:2px;\">\r\n ' . $versionName . '\r\n </td>\r\n </tr>\r\n </table>';\r\n\t\t}\r\n\t\tif (isset ( $line ['idactivity'] )&& $line ['idactivity']!= 0) {\r\n\t\t\t$addInPrinc .= '\r\n <table style=\"margin: 2px;\">\r\n <tr title=\"'.((isset($line['WorkElement']))?i18n('colPlanningActivity'):i18n('colParentActivity')).'\" >\r\n <td>\r\n <div class=\"iconActivity16 iconActivity iconSize16\" style=\"width:16px;height:16px;float:left\"></div>\r\n </td>\r\n <td style=\"float:left;overflow:hidden;max-width:120px;margin-left:2px;\">\r\n ' . SqlList::getNameFromId ( \"Activity\", $line ['idactivity'] ) . '\r\n </td>\r\n </tr>\r\n </table>';\r\n\t\t}\r\n\t}\r\n\treturn $addInPrinc;\r\n}", "function show_cart_product($pro){\r\n\t\t\treturn $this->select(\"*\",\"items\",\"pro_id in($pro) order by pro_id desc\");\r\n\t\t}", "function uc_op_products_view_table($order) {\n $table = array(\n '#type' => 'tapir_table',\n '#attributes' => array('class' => array('order-pane-table')),\n );\n\n $table['#columns']['qty'] = array(\n 'cell' => array(\n 'data' => theme('uc_qty_label'),\n 'class' => array('qty'),\n ),\n 'weight' => 3,\n );\n $table['#columns']['product'] = array(\n 'cell' => array(\n 'data' => t('Product'),\n 'class' => array('product'),\n ),\n 'weight' => 2,\n );\n $table['#columns']['model'] = array(\n 'cell' => array(\n 'data' => t('SKU'),\n 'class' => array('sku'),\n ),\n 'weight' => 1,\n );\n if (user_access('administer products')) {\n $table['#columns']['cost'] = array(\n 'cell' => array(\n 'data' => t('Cost'),\n 'class' => array('cost'),\n ),\n 'weight' => 4,\n );\n }\n $table['#columns']['price'] = array(\n 'cell' => array(\n 'data' => t('Price'),\n 'class' => array('price'),\n ),\n 'weight' => 4,\n );\n $table['#columns']['total'] = array(\n 'cell' => array(\n 'data' => t('Total'),\n 'class' => array('total'),\n ),\n 'weight' => 5\n );\n\n $table['#columns']['vat_rate'] = array(\n 'cell' => array(\n 'data' => t('VAT rate'),\n 'class' => array('vat-rate'),\n ),\n 'weight' => 6,\n );\n\n if (!empty($order->products)) {\n $build = uc_order_product_view_multiple($order->products);\n $table['#rows'] = $build['uc_order_product'];\n }\n else {\n $table['#rows'][]['product'] = array(\n '#markup' => t('This order contains no products.'),\n '#cell_attributes' => array('colspan' => 'full'),\n );\n }\n return $table;\n}", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "function addeditvendorProduct( $ketObj )\n{ \n\n\tif( isset( $_REQUEST['avid'] ) && $_REQUEST['avid'] > 0 ){\n\t\t\t$avid = $_REQUEST['avid'];\n\t\t\n\t}else{\n\t\t\t$avid = \"\";\n\t}\n\t\tif( isset( $_REQUEST['productCat'] ) && ($_REQUEST['productCat'] > 0 || $_REQUEST['productCat']=\"ap\" )){\n\t\t\t$productCat = $_REQUEST['productCat'];\n\t\t\t\n\t\t\n\t\t}else{\n\t\t\t$productCat = \"\";\n\t\t}\n\t\tif( isset( $_REQUEST['searchbyproduct'] ) && $_REQUEST['searchbyproduct'] != \"\" ){\n\t\t\t$searchbyproduct = $_REQUEST['searchbyproduct'];\n\t\t\t\n\t\t\n\t\t}else{\n\t\t\t$searchbyproduct = \"\";\n\t\t}if( isset( $_REQUEST['searchp'] ) && $_REQUEST['searchp'] != \"\" ){\n\t\t\t$searchp = $_REQUEST['searchp'];\n\t\t\t\n\t\t\n\t\t}else{\n\t\t\t$searchp = \"\";\n\t\t}if( isset( $_REQUEST['buscatidS'] ) && $_REQUEST['buscatidS'] != \"\" ){\n\t\t\t$buscatidS = $_REQUEST['buscatidS'];\n\t\t}else{\n\t\t\t$buscatidS = $_REQUEST['buscatidS'];\n\t\t}if( isset( $_REQUEST['admin_approval'] ) && $_REQUEST['admin_approval'] != \"\" ){\n\t\t\t$admin_approval = $_REQUEST['admin_approval'];\n\t\t}else{\n\t\t\t$admin_approval = \"\";\n\t\t}\n\t\n $Cattext = \"\";\n $busCat = \"\";\n\tif( isset( $_POST['Catsecond'] ) && is_array( $_POST['Catsecond'] ) && count( $_POST['Catsecond'] ) > 0 )\n\t{\n\t\t\n\t\t$subCattext = $_POST['Catsecond'];\n\t\t\n\t\tforeach( $subCattext as $sub )\n\t\t{\n\t\t\t$Cattext = $Cattext.\"*\".$sub.\"*,\";\n\t\t\t$busCat = $sub;\n\t\t}\n\t\t\n}else {\n\t\t\t$Cattext = $_POST['sub_cat_text'];\n\t\t\t$busCat = $_POST['b_cat'];\n\t\n\t\n\t}\n\t\n\tif( isset( $_POST['productCat'] ) && $_POST['productCat'] > 0 ){ \n\t\t$parent_cat = $_POST['productCat'];\n\t}else {\n\t\t\t$parent_cat = $_POST['parent_cat'];\n\t\n\t}\n\t\n\tif( isset( $_POST['f_product'] ) && $_POST['f_product'] > 0 ){\n\t\t\t$mpq_fp = $_POST['mpq_fp'];\n\t\n\t}else {\n\t\t\t$mpq_fp = 1;\n\t\n\t}\n \n\tif( isset( $_POST['product'] ) && $_POST['product'] != \"\") { $pide = $_POST['product'];}else{$pide = $_POST['pide']; }\n\t$ketechVendorP['vid'] = $_POST['vid'];\n\t$ketechVendorP['b_cat'] = $busCat;\n\t$ketechVendorP['p_cat'] = $parent_cat;\n\t$ketechVendorP['sub_cat_text'] = $Cattext;\n\t$ketechVendorP['pid'] = $pide;\n\tif( isset( $_POST['modbasep']) && isset( $_POST['modsellp']) )\n\t{\n\t\t$ketechVendorP['modify_baseprice'] = \"\";\n\t $ketechVendorP['modify_sellprice'] = \"\";\n\t\t$ketechVendorP['admin_approval'] = 0;\n\t}\n\t$ketechVendorP['baseprice'] = $_POST['baseprice'];\n\t$ketechVendorP['sellprice'] = $_POST['sellprice'];\n\t$ketechVendorP['f_product'] = $_POST['f_product'];\n\t$ketechVendorP['mpq_fp'] = $mpq_fp;\n\t$ketechVendorP['stock'] = $_POST['stock'];\n\t$ketechVendorP['status'] =\t$_POST['status'];\n\t$ketechVendorP['max_buy_limit'] =\t$_POST['mblpq'];\n\t$hidcid\t\t\t\t =\t $_POST['hidcid'];\n\t\n // echo \"<pre>\";\n // print_r( $_POST );\n //die();\n\t\n\t//$allSet = $ketObj->runquery( \"SELECT\", \"*\", \"ketechprod\", array(), \"\" );\n\tif( isset( $hidcid ) && $hidcid > 0 )\n\t{\n\t\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"ketechvp_\".$_POST['hidchild'].\"\", $ketechVendorP, \"WHERE id=\".$hidcid );\n\t}else\n\t{\n\t\t$allSet = $ketObj->runquery( \"INSERT\", \"*\", \"ketechvp_\".$_POST['hidchild'].\"\", $ketechVendorP );\n\t}\n\tif( isset( $_POST['modbasep']) && isset( $_POST['modsellp']) )\n\t {\n\t\t\t\n\t\t\theader( \"Location: index.php?v=\".$_POST['v'].\"&f=\".$_POST['f'].\"&vid=\".$ketechVendorP['vid'].\"&avid=\".$avid.\"&productCat=\".$productCat.\"&searchbyproduct=\".$searchbyproduct.\"&searchp=\".$searchp.\"&buscatid=\".$buscatidS.\"&admin_approval=y\" );\n\t\t}else{\n\t\t\t\theader( \"Location: index.php?v=\".$_POST['v'].\"&f=\".$_POST['f'].\"&vid=\".$ketechVendorP['vid'].\"&avid=\".$avid.\"&productCat=\".$productCat.\"&searchbyproduct=\".$searchbyproduct.\"&searchp=\".$searchp.\"&buscatid=\".$buscatidS.\"&admin_approval=\".$admin_approval.\"\" );\n\t\t}\n}", "function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\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$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }", "public function product_rows( $rows ){ \n\n\t\tforeach ( $rows as $row ) {\n\t\t\t\n\t\t\t$product = wc_get_product( $row->ID ); \n\n\t\t\tif ( $product->product_type == __( 'auction', 'wcvendors-pro-simple-auctions') ) { \n\n\t\t\t\t// Update status field\n\t\t\t\t$row->status .= __( '<br />Auction Starts: <br />', 'wcvendors-pro-simple-auctions' ) . date_i18n( get_option( 'date_format' ), strtotime( $product->auction_dates_from ) ). __( '<br />Auction Ends: <br />', 'wcvendors-pro-simple-auctions' ) . date_i18n( get_option( 'date_format' ), strtotime( $product->auction_dates_to ) ); \n\t\t\t\t// Update price field \n\t\t\t\t$row->price = $product->get_price_html(); \n\t\t\t}\n\n\t\t}\n\n\t\treturn $rows; \n\n\t}", "static public function ctrAgregarProductoInventario(){\n\n\t\tif(isset($_POST[\"nuevaDescripcion\"])){\n\n\t\t\t\n/*\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoCliente\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"nuevoDocumentoId\"]) &&\n\t\t\t preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"nuevoEmail\"]) && \n\t\t\t preg_match('/^[()\\-0-9 ]+$/', $_POST[\"nuevoTelefono\"]) && \n\t\t\t preg_match('/^[#\\.\\-a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaDireccion\"]))*/\n\n\t\t\t \t$tabla = \"inventario\";\n\n\n\tdate_default_timezone_set('America/Bogota');\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$fecha = $fecha.' '.$hora;\n\n\n\t\t\t \t$datos = array(\"codigo_barras\"=>$_POST[\"nuevoCodigo\"],\n\t\t\t\t\t \"nombre\"=>$_POST[\"nuevaDescripcion\"],\n\n\t\t\t\t\t \"cantidad_alerta\"=>$_POST[\"crearStockMinimo\"],\n\t\t\t\t\t \"costo_ideal\"=>$_POST[\"costoIdeal\"],\n\t\t\t\t\t \"fecha\"=> $fecha,\n\t\t\t\t\t \n\n\t\t\t\t\t \"medida_ingreso\"=>$_POST[\"nuevaMedida\"]);\n\n\t\t\t\t\t\n\t\t\t \t$respuesta = ModeloInventario::mdlIngresarInventario($tabla, $datos);\n\n\n\tif( \t$respuesta == \"ok\" ) {\n\n\n \n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El producto ha sido creado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"inventario\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t \n\n\t\t\t\t} else \n\t\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"'.$respuesta. '\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t}).then(function(result){\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location = \"inventario\";\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t</script>';\n\n\t\t\n\n\t\t} \n\n\t}", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }", "public function licence_keys_meta_box() {\n\t\tglobal $woocommerce, $post, $wpdb, $wc_api_manager_helpers, $woocommerce_plugin_update_api_manager;\n\n\t\t$post_data = $wc_api_manager_helpers->get_postmeta_data( $post->ID );\n\n\t\tif ( isset( $post_data['_billing_email'][0] ) )\n\t\t\t$email = $post_data['_billing_email'][0];\n\n\t\tif ( isset( $post_data['_order_key'][0] ) )\n\t\t\t$order_key = $post_data['_order_key'][0];\n\n\t\t// Get the user order info\n\t\t$data = $wc_api_manager_helpers->get_order_info_by_email_with_order_key( $email, $order_key );\n\n\t\tif ( ! empty( $data ) ) {\n\n\t\t\t?>\n\t\t\t<div class=\"order_licence_keys wc-metaboxes-wrapper\">\n\n\t\t\t\t<div class=\"wc-metaboxes\">\n\n\t\t\t\t\t<?php\n\n\t\t\t\t\t// Get activation info\n\t\t\t\t\t$current_info = $wc_api_manager_helpers->get_users_activation_data( $data['user_id'], $data['order_key'] );\n\n\t\t\t\t\t$active_activations = 0;\n\n\t\t\t \tif ( ! empty( $current_info ) ) foreach ( $current_info as $key => $activations ) {\n\n\t\t\t \t\tif ( $activations['activation_active'] == 1 && $post_data['_order_key'][0] == $activations['order_key'] ) {\n\n\t\t\t\t\t\t\t$active_activations++;\n\n\t\t\t \t\t}\n\n\t\t\t \t}\n\n\t\t\t \t$num_activations = ( $active_activations > 0 ) ? $active_activations : 0;\n\n\t\t\t\t\t// Activations limit or unlimited\n\t\t\t\t\tif ( $data['is_variable_product'] == 'no' && $data['_api_activations_parent'] != '' )\n\t\t\t\t\t\t$activations_limit = absint( $data['_api_activations_parent'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] =='no' && $data['_api_activations_parent'] == '' )\n\t\t\t\t\t\t$activations_limit = 'unlimited';\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' && $data['_api_activations'] != '' )\n\t\t\t\t\t\t$activations_limit = absint( $data['_api_activations'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' && $data['_api_activations'] == '' )\n\t\t\t\t\t\t$activations_limit = 'unlimited';\n\n\t\t\t\t\t// Software Title\n\t\t\t\t\tif ( $data['is_variable_product'] == 'no' )\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['_api_software_title_parent'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' )\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['_api_software_title_var'] );\n\t\t\t\t\telse\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['software_title'] );\n\n\t\t\t\t\t?>\n\t\t \t\t<div class=\"wc-metabox closed\">\n\t\t\t\t\t\t<h3 class=\"fixed\">\n\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"<?php _e( 'Click to toggle', $woocommerce_plugin_update_api_manager->text_domain ); ?>\"></div>\n\t\t\t\t\t\t\t<strong><?php printf( __( 'API Key: %s | Activation Limit: %s | Activations: %s | API Access Permission: %s | Product Title: %s | Version: %s', $woocommerce_plugin_update_api_manager->text_domain ), $data['order_key'], $activations_limit, $num_activations, $data['_api_update_permission'], $software_title, $data['current_version'] ); ?></strong>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"user_id\" value=\"<?php echo $data['user_id']; ?>\" />\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" class=\"wc-metabox-content\">\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API License Key', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"order_key\" value=\"<?php echo $data['order_key']; ?>\" readonly />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Activation Limit', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $data['is_variable_product'] =='no' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_activations_parent\" value=\"<?php echo $data['_api_activations_parent'] ?>\" placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\telseif ( $data['is_variable_product'] == 'yes' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_activations\" value=\"<?php echo $data['_api_activations'] ?>\" placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API Access Permission', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" class=\"short\" name=\"_api_update_permission\" value=\"yes\" <?php checked( $data['_api_update_permission'], 'yes' ); ?> placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Software Title', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $data['is_variable_product'] =='no' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_software_title_parent\" value=\"<?php echo $data['_api_software_title_parent']; ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\telseif ( $data['is_variable_product'] == 'yes' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_software_title_var\" value=\"<?php echo $data['_api_software_title_var']; ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API License Email', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"license_email\" value=\"<?php echo $data['license_email']; ?>\" placeholder=\"<?php _e( 'Email Required', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Software Version', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"current_version\" value=\"<?php echo $data['current_version']; ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\n\t\t} // end if $data\n\n\t}", "function uc_op_products_customer_table($order) {\n $table = array(\n '#type' => 'tapir_table',\n '#attributes' => array('class' => array('order-pane-table')),\n );\n\n $table['#columns']['qty'] = array(\n 'cell' => array(\n 'data' => theme('uc_qty_label'),\n 'class' => array('qty'),\n ),\n 'weight' => 0,\n );\n $table['#columns']['product'] = array(\n 'cell' => array(\n 'data' => t('Product'),\n 'class' => array('product'),\n ),\n 'weight' => 1,\n );\n $table['#columns']['model'] = array(\n 'cell' => array(\n 'data' => t('SKU'),\n 'class' => array('sku'),\n ),\n 'weight' => 2,\n );\n if (user_access('administer products')) {\n $table['#columns']['cost'] = array(\n 'cell' => array(\n 'data' => t('Cost'),\n 'class' => array('cost'),\n ),\n 'weight' => 3,\n );\n }\n $table['#columns']['price'] = array(\n 'cell' => array(\n 'data' => t('Price'),\n 'class' => array('price'),\n ),\n 'weight' => 4,\n );\n $table['#columns']['total'] = array(\n 'cell' => array(\n 'data' => t('Total'),\n 'class' => array('total'),\n ),\n 'weight' => 5,\n );\n\n $table['#columns']['vat_rate'] = array(\n 'cell' => array(\n 'data' => t('VAT rate'),\n 'class' => array('vat-rate'),\n ),\n 'weight' => 6,\n );\n\n if (!empty($order->products)) {\n $build = uc_order_product_view_multiple($order->products);\n $table['#rows'] = $build['uc_order_product'];\n }\n else {\n $table['#rows'][]['product'] = array(\n '#markup' => t('This order contains no products.'),\n '#cell_attributes' => array('colspan' => 'full'),\n );\n }\n\n return $table;\n}", "public function act_add_penjualan()\n {\n\n $produk = $this->input->post('produk');\n $presentase = $this->input->post('presentase');\n $no_hp = $this->input->post('no_hp');\n\n $action = $this->general->create('m_customer_penjualan',\n array('produk' => $produk,\n 'presentase' => $presentase,\n 'no_hp' => $no_hp,\n ));\n if ($action) {\n echo (\"<script LANGUAGE='JavaScript'>window.location.href='\".base_url('sales/customer/data_verifikasi1/').\"';</script>\");\n }\n\n }", "public function getProductData() {\n \t$product_instocks = Product::with('product_resolutions')->get();\n foreach ($product_instocks as $key => $value) {\n foreach ($value->product_resolutions as $resolution_key => $resolution_value) {\n if ($value->product_resolutions[$resolution_key][\"stock\"] == 0) {\n $product_instocks->forget($key); //xóa phần từ cha có quan hệ con có trường [\"stock\"] = 0 đi\n }\n }\n }\n \treturn Datatables::of($product_instocks)\n \t->addColumn('action', function ($product) {\n \t\tif (Auth::guard('admin')->user()->permission == 0 || Auth::guard('admin')->user()->permission == 2) {\n return \n '<a href=\"#product_detail\" class=\"btn_detail\" data-url=\"'.route('admin.product.instock.detail',$product->id).'\" style=\"margin-right: 5px;\" data-toggle=\"modal\" title=\"Detail\"><button class=\"btn btn-warning\" id=\"product-detail\" title=\"Detail\" data-toggle=\"tooltip\"><i class=\"glyphicon glyphicon-eye-open\"></i></button></a>\n <a href=\"#product_edit\" class=\"btn_edit\" style=\"margin-right: 5px;\" data-url=\"'.route('admin.product.instock.edit',$product->id).'\" data-update=\"'.route('admin.product.instock.update',$product->id).'\" data-toggle=\"modal\" title=\"Edit\"><button class=\"btn btn-info\" id=\"product-edit\" title=\"Edit\" data-toggle=\"tooltip\"><i class=\"glyphicon glyphicon-edit\"></i></button></a>\n <a href=\"#product_resolution_edit\" class=\"btn_resolution_edit\" style=\"margin-right: 5px;\" data-url=\"'.route('admin.product.instock.resolutionedit',$product->id).'\" data-update=\"'.route('admin.product.instock.resolutionupdate',$product->id).'\" data-toggle=\"modal\" title=\"Resolution_Edit\"><button class=\"btn btn-success\" id=\"product-resolution-edit\" title=\"Resolution_Edit\" data-toggle=\"tooltip\"><i class=\"fa fa-window-restore\"></i></button></a>\n <a href=\"#product_image_edit\" class=\"btn_image_edit\" style=\"margin-right: 5px;\" data-url=\"'.route('admin.product.instock.productimageedit',$product->id).'\" data-update=\"'.route('admin.product.instock.dbproductimageupdate',$product->id).'\" data-image-update=\"'.route('admin.product.instock.productimageupdate',$product->id).'\" data-toggle=\"modal\" title=\"Image_Edit\"><button class=\"btn btn-outline-primary\" id=\"product-image-edit\" title=\"Image_Edit\" data-toggle=\"tooltip\"><i class=\"fa fa-picture-o\" aria-hidden=\"true\"></i></button></a>';\n } else {\n return \n '<a href=\"#product_detail\" class=\"btn_detail\" data-url=\"'.route('admin.product.instock.detail',$product->id).'\" style=\"margin-right: 5px;\" data-toggle=\"modal\" title=\"Detail\"><button class=\"btn btn-warning\" id=\"product-detail\" title=\"Detail\" data-toggle=\"tooltip\"><i class=\"glyphicon glyphicon-eye-open\"></i></button></a>\n <a href=\"#product_edit\" class=\"btn_edit\" style=\"margin-right: 5px;\" data-url=\"'.route('admin.product.instock.edit',$product->id).'\" data-update=\"'.route('admin.product.instock.update',$product->id).'\" data-toggle=\"modal\" title=\"Edit\"><button class=\"btn btn-info\" id=\"product-edit\" title=\"Edit\" data-toggle=\"tooltip\"><i class=\"glyphicon glyphicon-edit\"></i></button></a>\n <a href=\"#product_image_edit\" class=\"btn_image_edit\" style=\"margin-right: 5px;\" data-url=\"'.route('admin.product.instock.productimageedit',$product->id).'\" data-update=\"'.route('admin.product.instock.dbproductimageupdate',$product->id).'\" data-image-update=\"'.route('admin.product.instock.productimageupdate',$product->id).'\" data-toggle=\"modal\" title=\"Image_Edit\"><button class=\"btn btn-outline-primary\" id=\"product-image-edit\" title=\"Image_Edit\" data-toggle=\"tooltip\"><i class=\"fa fa-picture-o\" aria-hidden=\"true\"></i></button></a>';\n }\n \t})\n \t->editColumn('thumbnail', function(Product $product){\n return '<img style=\"width: 100px;height: 100px;\" src=\"http://computer-shop.projectlaravel15.zent/storage/'.$product->thumbnail.'\"/>';\n })\n ->rawColumns(['thumbnail','action'])\n \t->toJson();\n }", "private function showModifiedTurkey()\n {\n $modifiedTurkey = $this->productDao->getByEan(self::PRODUCT_TURKEY_NEW_EAN);\n \n echo PHP_EOL;\n echo self::PRODUCT_TURKEY_NAME . ' with modified data: ' . PHP_EOL;\n print_r($modifiedTurkey);\n }", "public function print_button() {\n\t\tglobal $product;\n\n\t\tswitch ( get_locale() ) {\n\t\t\tcase 'pt_BR':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Número de parcelas',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'es_ES':\n\t\t\tcase 'es_CO':\n\t\t\tcase 'es_CL':\n\t\t\tcase 'es_PE':\n\t\t\tcase 'es_MX':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Meses sin intereses'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Number of installments',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$max_instalments = $this->gateway->fetch_acquirer_max_installments_for_price($product->price);\n\n\t\t$args = apply_filters( 'ebanx_template_args', array(\n\t\t\t\t'cards' => $this->cards,\n\t\t\t\t'cart_total' => $product->price,\n\t\t\t\t'max_installment' => min($this->gateway->configs->settings['credit_card_instalments'], $max_instalments),\n\t\t\t\t'installment_taxes' => $this->instalment_rates,\n\t\t\t\t'label' => __( 'Pay with one click', 'woocommerce-gateway-ebanx' ),\n\t\t\t\t'instalments' => $messages['instalments']\n\t\t\t) );\n\n\t\twc_get_template( 'one-click.php', $args, '', WC_EBANX::get_templates_path() . 'one-click/' );\n\t}", "public function BuyProduct(Product $product) {\t\t\tif (isset($_SESSION[$this->m_orderIdSessionLocation]) == false) {\n\t\t\t\t//skapa en order och spara orderid\n\t\t\t\t$_SESSION[$this->m_orderIdSessionLocation] = $this->CreateNewOrder();\n\t\t\t}\n\t\t\t//TODO:\n\t\t\t//finns det en orderline för den här produkten redan?\n\t\t\t\t//hämta den och öka antalet\n\t\t\t//annars skapa en orderline\n\t\t\t$orderLine = new OrderLine();\n\t\t\t$orderLine->m_orderId = $_SESSION[$this->m_orderIdSessionLocation];\n\t\t\t$orderLine->m_productId = $product->pk;\n\t\t\t\n\t\t\t//spara till databasen\n\t\t\t$this->SaveOrderLine($orderLine);\n\t\t}", "public function activate_product_from_bundle($product_bundle_item_id)\n\t{\n\t\t$data = array(\n\t\t\t\t'product_bundle_item_status' => 1\n\t\t\t);\n\t\t$this->db->where('product_bundle_item_id', $product_bundle_item_id);\n\t\t\n\t\tif($this->db->update('product_bundle_item', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function activate_product($product_id)\n\t{\n\t\t$data = array(\n\t\t\t\t'product_status' => 1\n\t\t\t);\n\t\t$this->db->where('product_id', $product_id);\n\t\t\n\t\tif($this->db->update('product', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function jigoshop_upgrade_161() {\n\t\n\tJigoshop_Base::get_options()->add_option( 'jigoshop_catalog_product_button', 'cart' );\n\n}", "public function ready_take($quantity,$id,$bom_id){\n\n\t\t$sql6=\"Update bom set is_issued='2' WHERE bom_id='$bom_id'\";\n\t\t//$query6=$this->db->query($sql5);\n\t\t$query7=$this->db->query($sql6);\n\t\treturn $query7;\n\t}", "private function addBasketRow(string $product_code): void\r\n {\r\n if (array_key_exists($product_code, $this->basket)) {\r\n return;\r\n }\r\n\r\n $this->basket[$product_code] = 0;\r\n }", "function install(){\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Activar módulo Pagosonline', 'MODULE_PAYMENT_PAYCO_STATUS', 'True', 'Quiere aceptar pagos usando Payco?', '6', '3', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Id Usuario', 'MODULE_PAYMENT_PAYCO_ID_COM', '', 'Codigo de usuario (usuarioId) proporcionado por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Llave secreta', 'MODULE_PAYMENT_PAYCO_ID_SEED', '', 'Clave de encriptación proporcionada por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('URL de la pasarela de pago', 'MODULE_PAYMENT_PAYCO_URL', 'https://secure2.payco.co/payment.php', 'Direccion en internet de la pasarela de pago', '6', '4', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Prueba', 'MODULE_PAYMENT_PAYCO_PRUEBA', '1', 'Prueba es la variable para poner su carrito en modo de pruebas, si quiere hacer transacciones en modo de pruebas debe ingresar 1 y si si quiere estar en produccion debe dejarlo en o', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Orden de aparicion.', 'MODULE_PAYMENT_PAYCO_SORT_ORDER', '0', 'Orden de aparicion. Numero menor es mostrado antes que los mayores.', '6', '0', now())\");\n\n tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Zona de pago', 'MODULE_PAYMENT_PAYCO_ZONE', '0', 'Si selecciona una zona, este módulo sólo estará disponible en esa zona.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Estado del pedido', 'MODULE_PAYMENT_PAYCO_ORDER_STATUS_ID', '0', 'Seleccione el estado del pedido un vez procesado con este módulo', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n \n\t}", "public function delete_product() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo '{\"masterItemsList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while deleting';\n\t}", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n\n $productId = $this->getRequest()->getParam('productId');\n $qty = $this->getRequest()->getParam('qty');\n\n\n if (!$productId) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product ID is required'),\n ]);\n }\n\n\n // check product is in stock\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n $product = $this->productFactory->create();\n $product->load($productId);\n if (!$product->getId()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product not found'),\n ]);\n }\n if (!$product->isAvailable()) {\n // TODO: product placeholders\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n if ($product->isVirtual()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Virtual products cannot be shipped'),\n ]);\n }\n\n $messages = \"\";\n if ($this->getProductSalableQty && $this->isProductSalable) {\n if ($this->helper->getInventoryStock() != null) {\n if($product->getTypeId() == 'simple') {\n $qtyInStock = $this->getProductSalableQty->execute($product->getSku(), $this->helper->getInventoryStock());\n if ($qty > $qtyInStock) {\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n } else {\n $messages = \"stock = \" . $this->helper->getInventoryStock() . \" \" . $product->getSku() . \" \" . $qty . \" in stock \" . $qtyInStock . \" \" . $product->getTypeId();\n }\n }else{\n if($this->isProductSalable->execute($product->getSku(), $this->helper->getInventoryStock())){\n $messages = \"product is saleable\";\n }else{\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n }\n } else {\n $messages = \"inventory stock null\";\n }\n } else {\n $messages = __(\"MSI not supported: \") . $product->getSku() . \" \" . $product->getTypeId();\n //probably just means MSI not supported here.\n }\n\n\n $transport = new DataObject([\n 'available' => true,\n ]);\n $this->eventManager->dispatch('porterbuddy_availability', array(\n 'product' => $product,\n 'qty' => $qty,\n 'result' => $transport,\n ));\n\n if ($transport->getError()) {\n return $result->setData([\n 'error' => true,\n 'messages' => $transport->getMessage() ?: $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n\n return $result->setData([\n 'error' => false,\n 'available' => true,\n 'messages' => $messages\n ]);\n }", "public function actionrequestingEscrow(){\n \n \n \n \n $model = new Escrow;\n \n $member_id = Yii::app()->user->id;\n \n if(isset($_POST['quoted_id'])){\n $model->quote_id = $_POST['quote_id'];\n }else{\n $model->quote_id = 0;\n }\n \n $model->product_id = $_POST['product_id'];\n $model->escrow_number = $model->generateTheEscrowNumberForThisTransaction($model->quote_id,$model->product_id);\n if(isset($_POST['is_quotable'])){\n if($_POST['is_quotable'] == true){\n $model->is_quoted =1;\n }else{\n $model->is_quoted =0;\n }\n \n }else{\n $model->is_quoted = 0;\n }\n if(isset($_POST['future_trading'])){\n $model->is_futuristic = $_POST['future_trading'];\n }else{\n $model->is_futuristic = 0;\n \n }\n \n \n $model->minimum_number_of_product_to_buy = $_POST['minimum_number_of_product_to_buy_for_computation'];\n $model->whats_product_per_item = $_POST['whats_represents_an_item'];\n $model->status = strtolower('live');\n $model->escrow_operation_for = $_POST['escrow_request_from'];\n if($_POST['subscription_type'] == strtolower('post')){\n $model->quantity = $_POST['subscription_quantity'];\n }else{\n $model->quantity = $_POST['quantity_of_purchase'];\n }\n \n $model->price_per_item = $_POST['prevailing_retail_selling_price'];\n $model->total_amount_purchased=$_POST['amount_to_be_paid'];\n $model->escrow_initiation_date = new CDbExpression('NOW()');\n $model->escrow_initiated_by = Yii::app()->user->id;\n $model->direction = strtolower('initiation');\n \n $is_escrowed = 1;\n $is_escrow_accepted = 0;\n $start_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['start_price_validity_period'])); \n $end_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['end_price_validity_period'])); \n $cobuy_member_selling_price = 0;\n $amount_saved_on_purchase = 0;\n if($this->isMemberWithOpenOrder($member_id)){\n $order_id = $this->getTheOpenOrderInitiatedByMember($member_id);\n }else{\n $order_id = $this->createNewOrderForThisMember($member_id);\n }\n \n $escrow_file_error = 0;\n \n if($_FILES['escrow_agreement_file']['name'] != \"\"){\n if($_FILES['escrow_agreement_file']['type'] == 'application/pdf'){\n $escrow_filename = $_FILES['escrow_agreement_file']['name'];\n $escrow_filesize = $_FILES['escrow_agreement_file']['size'];\n }else{\n $escrow_file_error = $escrow_file_error + 1;\n \n }\n \n if($escrow_file_error == 0){\n if($model->validate()) {\n \n //move the escrow agreement file to the escrow directory \n $model->escrow_agreement_file = $model->moveTheEscrowAgreementToItsPathAndReturnItsFileName($escrow_filename);\n if($model->escrow_operation_for ==strtolower('noncart')){\n if($model->save()) {\n // if($this->isProductSubscriptionUpdatedSuccessfully($member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n /** }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section to consummate this transaction\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n } \n * \n */ \n \n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n if($model->hasTheEscrowOfThisSubscriptionAlreadyInitiated($member_id,$model->status,$model->product_id,$model->escrow_operation_for)==false){\n if($model->save()) {\n if($this->isProductSubscriptionUpdatedSuccessfully($model->id,$member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n \n }else{\n if($model->escrow_operation_for == 'pre'){\n $msg = \"This pre-subscribed product had been sent to the escrow administrator. If the escrow is accepted, the product will be added to your cart so as to effect payment. However, you may visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }\n \n \n } \n \n \n }else{\n \n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n $msg = \"You already have an escrow on this product subscription waiting for acceptance.You may need to wait for the escrow to be accepted before initiating a new one\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }\n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"Validaion Error: Check the forms fields for correctness\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg\n )\n );\n \n }\n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"File Format Error: There was an error in the uploaded escrow agreement document. Please check the uploaded file and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n }else{\n \n if($model->escrow_operation_for ==strtolower('noncart')){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n if($this->isProductEscrowable($model->product_id )){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n $msg = \"This product is not escrowable. Please choose another product and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }\n \n } \n \n \n }", "public function purchase_items()\n\t{\n\t\t$products = DB::table('products')->select('id as value', 'product_name as label')->where('category_id', 2)->orderBy('id', 'desc')->get();\n\t\t$str = json_encode($products);\n\t\t$str = preg_replace('/\"([^\"]+)\"\\s*:\\s*/', '$1:', $str);\n\t\techo $str;\n\t}", "public function action_done()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n post_param_integer('confirm'); // Make sure POSTed\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), array('id' => $id, 'c_enabled' => 1), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $row = $rows[0];\n\n $cost = $row['c_cost'];\n\n $c_title = get_translated_text($row['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n // Check points\n $points_left = available_points(get_member());\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n if ($row['c_one_per_member'] == 1) {\n // Test to see if it's been bought\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('sales', 'id', array('purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details2' => strval($row['id']), 'memberid' => get_member()));\n if (!is_null($test)) {\n warn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n }\n }\n\n require_code('points2');\n charge_member(get_member(), $cost, $c_title);\n $sale_id = $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details' => $c_title, 'details2' => strval($row['id'])), true);\n\n require_code('notifications');\n $subject = do_lang('MAIL_REQUEST_CUSTOM', comcode_escape($c_title), null, null, get_site_default_lang());\n $username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $message_raw = do_notification_lang('MAIL_REQUEST_CUSTOM_BODY', comcode_escape($c_title), $username, null, get_site_default_lang());\n dispatch_notification('pointstore_request_custom', 'custom' . strval($id) . '_' . strval($sale_id), $subject, $message_raw, null, null, 3, true, false, null, null, '', '', '', '', null, true);\n\n $member = get_member();\n\n // Email member\n require_code('mail');\n $subject_line = get_translated_text($row['c_mail_subject']);\n if ($subject_line != '') {\n $message_raw = get_translated_text($row['c_mail_body']);\n $email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($member);\n $to_name = $GLOBALS['FORUM_DRIVER']->get_username($member, true);\n mail_wrap($subject_line, $message_raw, array($email), $to_name, '', '', 3, null, false, null, true);\n }\n\n // Show message\n $url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n return redirect_screen($title, $url, do_lang_tempcode('ORDER_GENERAL_DONE'));\n }", "public function getTableProductRow()\n\t{\n\t\t$products = $this->model_products->getActiveProductData();\n\n\t\techo json_encode($products);\n\t}", "public function prosesedit_data_kbaak()\n\t{\n\n\t\t$this->m_aka->prosesedit_data_kbaak();\n\t\tredirect('c_index_aka/data_kbaak');\n\t}", "public function actionProductUpdate1()\n\t{\t\n\t\t\n\t\t$data = $_POST;\n\t\t$connection = Yii::$app->getDb();\n\t\tif(isset($data['id'])){\n\t\t\ttry{\n\n\t\t\t\t$id = $data['id'];\n\t\t\t\t$productData = $data['data'];\n\t\t\t\t$logFIle = 'product/update/'.$id;\n\t\t\t\tData::createLog('getting walmart config : ',$logFIle,'a');\n\t\t\t\t$walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$data['merchant_id'].\"'\",'one','select');\n\n\t\t\t\t$walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n\t\t\t\tData::createLog('create product on walmart : ',$logFIle,'a');\n\n\t\t\t\t$preparedData = $walmartApi->createProductOnWalmart([$id],$walmartApi,$data['merchant_id'],$connection,true);\n\t\t\t\t//Data::createLog('response:'.print_r($preparedData,true),$logFIle,'a');\n\t\t\t\tData::createLog('got prepared data : ',$logFIle,'a');\n\t\t\t\tforeach ($productData as $key => $pro_val) \n\t\t\t\t{\n\t\t\t\t\tforeach($pro_val as $index=>$val){\n\t\t\t\t\t\tswitch($index){\n\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['productName'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['longDescription'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'shelfDescription':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['shelfDescription'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'main_image':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['mainImage'] = [\n\t\t\t\t\t\t 'mainImageUrl' => $val,\n\t\t\t\t\t\t 'altText' => isset($pro_val['shelfDescription'])?$pro_val['shelfDescription']:$pro_val['sku'],\n\t\t\t\t\t\t ];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'default':\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \t\t\n\t\t\t\t}\n\n\t\t\t\t$dir = Yii::getAlias('@webroot').'/frontend/modules/walmart/filestorage/product/update/';\n\t\t\t\t$filePath = $dir.$data['merchant_id'].'.php';\n\t\t\t\tif(file_exists($filePath)){\n\n\t\t\t\t\t$storedData = require $filePath;\n\t\t\t\t\tunset($preparedData['MPItemFeed']['_value'][0]);\n\t\t\t\t\t$feedItems = $preparedData['MPItemFeed']['_value'];\n\t\t\t\t\t$storedItems = $storedData['MPItemFeed']['_value'];\n\t\t\t\t\t$feedItems = array_merge($storedItems,$feedItems);\n\t\t\t\t\t$preparedData['MPItemFeed']['_value'] = $feedItems;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!file_exists($dir)) {\n\t\t mkdir($dir, 0775, true);\n\n\t\t }\n\t\t Data::createLog('saving data : ',$logFIle,'a');\n\t\t\t\tfile_put_contents($filePath, '<?php return $arr = ' . var_export($preparedData, true) . ';');\n\t\t Data::createLog('Result : '.json_encode($preparedData),$logFIle,'a');\n\t\t }\n\t\t catch(Exception $e){\n\t\t \tData::createLog('Exception : '.$e->getMessage(),$logFIle,'a');\n\t\t }\n\t }\n\t}", "public function thankyou_page_kdbayar() {\n\t\tglobal $woocommerce;\n \n\t\t$invoice = $_POST['invoice'];\n\t\t$result_code = $_POST['result_code'];\n\t\t\n\t\t$customer_order = new WC_Order( $invoice );\n\t\t\n\t\tif($result_code == '00'){\n\t\t\t// Payment successful\n\t\t\t$customer_order->add_order_note( __( 'Finnet processing payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// paid order marked\n\t\t\t$customer_order->update_status('processing');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}elseif ($result_code == '05') {\n\t\t\t// Payment expired\n\t\t\t$customer_order->add_order_note( __( 'Finnet expired payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// expired order marked\n\t\t\t$customer_order->update_status('failed');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}\n\t}", "function _create_stock_entry($prod_id=0,$mrp=0,$barcode='',$loc_id=0,$rb_id=0)\r\n {\r\n $user = $this->erpm->auth();\r\n\r\n $inp = array();\r\n $inp['product_id'] = $prod_id;\r\n $inp['mrp'] = $mrp;\r\n $inp['location_id'] = $loc_id;\r\n $inp['rack_bin_id'] = $rb_id;\r\n $inp['product_barcode'] = $barcode;\r\n $inp['available_qty'] = 0;\r\n $inp['created_by'] = $user['userid'];\r\n $inp['created_on'] = cur_datetime();\r\n\r\n $p_stk_id = $this->db->insert(\"t_stock_info\",$inp);\r\n\r\n return $p_stk_id;\r\n }", "function arcProduct($dt) {\n $payload = $dt;\n\n $this->sql = \"UPDATE inventory_tb SET is_Archive = 1 WHERE item_id =$dt->item_id\";\n\n $this->conn->query($this->sql);\n\n $this->data = $payload;\n\n return array(\n 'status'=>$this->status,\n 'payload'=>$this->data,\n 'prepared_by'=>'Inventory Admin',\n 'timestamp'=>date('D M j, Y h:i:s e')\n );\n }", "public function vendorNotesSuccess($form){ \n $session = $this->hlp->sess(\"listing\");\n $date_ordered = date(\"j. n. Y\"); \n $buyer = $this->hlp->logn();\n $status = \"pending\";\n $buyer_notes = $form->getValues(TRUE)['notes'];\n $final_price = $session->finalPriceBTC;\n $czk_price = $session->finalPriceCZK;\n $quantity = $session->postageDetails['quantity'];\n $postage = $session->postageDetails['postage']; \n $product_name = $session->listingDetails['product_name'];\n $listing_id = $session->listingDetails->id;\n $author = $this->listings->getAuthor($listing_id);\n $FE = \"no\"; //$this->listings->isListingFE($listingID) ? \"yes\" : \"no\";\n \n //save order to DB and do BTC transactions\n //only if balance is sufficient\n // if ($this->wallet->balanceCheck($buyer, $price)){\n \n //unset unneccessary vars and assemble arg array\n //from these that remains\n unset($form, $session);\n $arguments = $this->orders->asArg(get_defined_vars());\n \n //and write new order to database\n $order_id = $this->orders->saveToDB($arguments);\n \n $con = $this->converter;\n\n //value that seller will receive and market profit\n $commisioned = $con->getCommisioned($final_price);\n $marketProfit = $con->getMarketProfit($final_price);\n $wallet = $this->wallet;\n \n //save and transact market profit\n $wallet->moveAndStore(\"saveprofit\", $buyer, \"profit\", $marketProfit, $order_id);\n \n //move funds and store trasactions into db\n if($FE == \"no\"){ \n //escrow branch\n $wallet->moveAndStore(\"pay\", $buyer, \"escrow\", $commisioned, $order_id, \"yes\");\n $this->flashMessage(\"Operace proběhla úspěšně. Platba je bezpečně uložena v Escrow.\"); \n // $this->redirect('Orders:in');\n }\n \n if ($FE == \"yes\"){ \n //FE - immediately transfer funds and redirect user to feedback\n $this->orders->finalize($order_id);\n $wallet->moveAndStore(\"pay\", $buyer, $author, $commisioned, $order_id, \"no\");\n $this->flashMessage(\"Finalize Early - Platba převedena na vendorův účet.\");\n $this->flashMessage(\"Zanechte feedback - Můžete později změnit ve Vašich objednávkách.\");\n $this->redirect(\"Orders:Feedback\", $order_id);\n }\n /* \n } else {\n $this->flashMessage(\"Něco se pokazilo. Prosím kontaktujte administrátora.\");\n $this->redirect(\"Orders:in\");\n } */\n }", "public function updateUserProductByProId($array_product = array()){\n \t\t global $myuser, $admin_id, $arrayBranch, $array_unit, $class_import_export;\n if($this->check_id()){\n if(empty($array_product)) return array();\n $row_product = $this->checkProId();\n $des_logs = '';\n if(!empty($row_product)){\n $array_update = array(); // mảng tên trường và value khi update vào bảng user_products\n $array_datas = array(); // mảng tên trường và value khi update vào bảng datas\n $new_name = '';\n $unit_parent = 0;\n $unit = 0;\n $specifi = 0;\n $set_log_delete = '';\n $usp_sale_money = 0;\n $active = 1;\n $usp_wholesale = 0;\n foreach($array_product as $column => $value){\n $check_col = $this->CheckExitColumn(USER_PRODUCTS,$column); // check tên trường tồn tại trong bang user_product\n if(empty($check_col)) return array();\n if(strstr($check_col['Type'],'int') !== false){ // check kiểu dữ liệu của trường\n if(trim($check_col['Field']) != 'usp_active'){ // kiểm tra tên trường . nếu khác trường usp_active thì giá trị phải lớn hơn 0\n if((int)$value <= 0) return array();\n }\n }\n if(strstr($check_col['Type'],'varchar') !== false){ // check kiểu dữ liệu của trường\n if(trim($value) == '') return array();\n $value = $value;\n }\n $array_update[] = $column . \" = '\" . $value .\"'\";\n switch($column){\n case 'usp_pro_name':\n $array_datas[] = \"dat_name = '\" . $value . \"'\";\n $new_name = $value;\n $des_logs .= \"\\n Sửa tên thuốc từ: <b>\". $row_product['usp_pro_name'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_unit_import':\n $array_datas[] = \"dat_unit_import = \" . $value;\n $unit_parent = $value;\n $des_logs .= \"\\n Sửa đơn vị nhập từ: <b>\". $array_unit[$row_product['usp_unit_import']] .\"</b> sang <b>\". $array_unit[$value] .\"</b>\";\n break;\n case 'usp_unit':\n $array_datas[] = \"dat_unit = \" . $value;\n $unit = $value;\n $des_logs .= \"\\n Sửa đơn vị bán từ: <b>\". $array_unit[$row_product['usp_unit']] .\"</b> sang <b>\". $array_unit[$value] .\"</b>\";\n break;\n case 'usp_specifi':\n $array_datas[] = \"dat_specifi = \" . $value;\n $specifi = $value;\n $des_logs .= \"\\n Sửa đơn vị bán từ: <b>\". $row_product['usp_specifi'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_sale_money':\n $usp_sale_money = $value;\n $des_logs .= \"\\n Sửa tiền hoa hồng từ: <b>\". $row_product['usp_sale_money'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_wholesale':\n $usp_wholesale = $value;\n $des_logs .= \"\\n Cập nhật giá bán buôn: <b>\". $value .\"</b>\";\n break;\n case 'usp_active':\n if($value == 0){\n $active = 0;\n $set_log_delete = ',usp_last_delete = '. time();\n $des_logs .= \"\\n Chuyển sản phẩm sang ngừng bán\";\n }else{\n $set_log_delete = ',usp_last_delete = '. time();\n $des_logs .= \"\\n Khôi phục sản phẩm để bán\";\n }\n break;\n }\n }\n //gán thông tin sản phẩm vào chính người sửa luôn\n\t\t\t\t\t $array_update[] = \"usp_use_child_id = \" . $this->use_id;\n \n $str_col_val = implode(', ',$array_update);\n $sql_update = \"UPDATE \" . USER_PRODUCTS . \" SET \". $str_col_val . $set_log_delete . \"\n WHERE usp_id = \" . $this->id . \"\n AND usp_branch_id = \" . $this->branch_id . \"\n AND usp_use_parent_id = \" . $this->admim_id;\n //kiem tra xem co quyen edit khong\n if(isset($_SERVER) && ($_SERVER['REMOTE_ADDR'] == '14.177.216.14' || $_SERVER['SERVER_NAME'] == 'localhost')){\n file_put_contents('../logs/logsupdate.cfn', $sql_update);\n }\n $db_ex = new db_execute($sql_update);\n \n // ghi logs \n logsAddEditData($row_product['usp_dat_id'],$new_name,$row_product['usp_id'],$unit_parent,$unit,$admin_id,$myuser->u_id, $specifi);\n \n // ghi log hành động\n $data_action = array(\n 'file' => json_encode(debug_backtrace()),\n 'action' => 'edit',\n 'des' => $des_logs,\n 'pro_id' => $this->id\n );\n\n log_action($data_action);\n \n // nếu chưa active dùng chung thì update luôn vào bảng data tên và đơn vị tính\n $dat_id = $row_product['usp_dat_id']; \n if($row_product['usp_dat_active'] == 0 && !empty($array_datas)){\n $str_col_data = implode(', ',$array_datas);\n $db_update_datas = new db_execute(\"UPDATE datas SET \" . $str_col_data . \" WHERE dat_id = \" . $dat_id);\n unset($db_update_datas);\n }\n \n // kiểm tra để cập nhật cho tất cả các sản phẩm của các chi nhánh cùng người chủ này quản lý cũng thay đổi luôn\n /*\n if(count($arrayBranch) > 1){\n $db_update = new db_execute(\"UPDATE \" . USER_PRODUCTS . \" SET \" . $str_col_val . \"\n WHERE usp_use_parent_id = \" . $this->admim_id . \"\n AND usp_id <> \" . $this->id . \" AND usp_dat_id = \" . $dat_id);\n unset($db_update);\n }\n */\n \n // nếu khách hàng thay đổi đơn vị bán thì\n //- xóa lịch sử nhập kho\n //- reset số tồn kho = 0\n if(($row_product['usp_unit'] > 0 && $unit > 0 && $unit != $row_product['usp_unit']) || $active == 0){\n $this->delete_reset_stock(array('pro_id' => $this->id));\n }\n \n //nếu là khôi phục thì update lại thông tin giá nhập giá bán\n if($active == 1){\n $import_last = $class_import_export->import_get_last_stocks(array('pro_id' => $this->id, 'quantity' => 1));\n \n $pr_im = isset($import_last['uss_price_import'])? $import_last['uss_price_import'] : 0;\n $pr_ex = isset($import_last['uss_price_out'])? $import_last['uss_price_out'] : 0;\n \n $db_update = new db_execute(\"UPDATE \" . USER_PRODUCTS . \"\n SET usp_price_import = \" . doubleval($pr_im) . \", usp_price = \" . doubleval($pr_ex) . \"\n WHERE usp_id = \" . $this->id);\n unset($db_update);\n }\n \n return $this->checkProId();\n }\n }\n return array();\n }", "public function isTheUpdateOfTheEscrowStatusOfATransactionASuccess($order_id,$product_id,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isTheUpdateOfTheEscrowStatusOfATransactionASuccess($order_id,$product_id,$is_escrowed,$is_escrow_accepted);\n }", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function get_data_produk()\n\t {\n\t\t$this->db->where('prod_hide_status','no');\n\t\t $query = $this->db->get('tbb_product');\n\t\t return $query->result_array();\n\t }", "public function testModerationByProduct(): void\n {\n $productSummaryArray = $this->getProductsSummary();\n static::assertSame(1, $productSummaryArray[4][ProductApprovalStatus::PENDING()->getKey()]);\n\n $this->moderationService->moderateByProduct(17, 'approve');\n $productSummaryArray = $this->getProductsSummary();\n static::assertArrayNotHasKey(ProductApprovalStatus::PENDING()->getKey(), $productSummaryArray[4]);\n }", "function displayOrder($orderoid){\n $r = array();\n // le champ INFOCOMPL de WTSCATALOG (PRODUCT) est optionnel, si présent nécessaire dans certains documents\n $r['do'] = $this->dsorder->display(array('oid'=>$orderoid, \n\t\t\t\t\t 'selectedfields'=>'all', \n\t\t\t\t\t 'options'=>array('PICKUPPOINT'=>array('target_fields'=>array('title')))\n\t\t\t\t\t ));\n $r['bl'] = $this->dsline->browse(\n\t\t\t\t array('selectedfields'=>'all',\n\t\t\t\t\t 'options'=>array('PRODUCT'=>array('target_fields'=>array('INFOCOMPL', 'label'))),\n\t\t\t\t\t 'order'=>'WTPCARD, REFERENCE',\n\t\t\t\t\t 'pagesize'=>9999,\n\t\t\t\t\t 'first'=>0,\n\t\t\t\t\t 'select'=>$this->dsline->select_query(array('cond'=>array('LNKORDER'=>array('=', $orderoid))))));\n // mise en forme des lignes achats carte, utlisation bonus, assurance, port\n // recup du premier jour de ski (paiement chq)\n $r['bl']['lines__bonu'] = array();\n $r['bl']['lines__validfromhidden'] = array();\n $r['bl']['lines__cart'] = array();\n $r['bl']['lines__assu'] = array();\n $r['bl']['lines__validtill'] = array();\n $r['bl']['lines__annul'] = array_fill(0, count($r['bl']['lines_oid']), false);\n $r['_totassu'] = 0;\n $r['_totcart'] = 0;\n $r['_totport'] = 0;\n $r['_nbforf'] = 0;\n $r['_tot1'] = 0;\n $r['_tot2'] = 0;\n $r['_totassuAnnul'] = 0;\n $r['_totcartAnnul'] = 0;\n $r['_totportAnnul'] = 0;\n $r['_tot1Annul'] = 0;\n $r['_tot2Annul'] = 0;\n $r['_cartesseules'] = array();\n $cartesfaites = array();\n $firstday = NULL;\n $nodates = true;\n // rem : assur pointe sur son forfait\n // bonus pointe sur son forfait\n // les forfaits de nouvelles cartes pointent TOUS vers la ligne ...\n // a ne compter qu'ne fois donc\n //\n // ajout du calendrier pour les lignes forfaits\n //\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if ($r['bl']['lines_oETATTA'][$l]->raw == XModEPassLibre::$WTSORDERLINE_ETATTA_ANNULATION){\n $r['bl']['lines__annul'][$l] = true;\n }\n $r['bl']['lines__validfromhidden'][$l] = 0;\n if($olinetype->raw == 'port'){\n\t$r['_totport']+=$r['bl']['lines_oTTC'][$l]->raw;\n }\n if($olinetype->raw == 'forf'){\n /* -- vente de cartes seules -- */\n $r['_nbforf'] += 1;\n /* -- vente de cartes seules -- */\n $r['_tot1']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n\t $r['_tot1Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($firstday == NULL || $r['bl']['lines_oVALIDFROM'][$l]->raw < $firstday)\n $firstday = $r['bl']['lines_oVALIDFROM'][$l]->raw;\n $rsc = selectQueryGetAll(\"select type from \".self::$tablePRDCALENDAR.\" c where c.koid=(select calendar from \".self::$tablePRDCONF.\" pc where pc.koid=(select prdconf from \".self::$tableCATALOG.\" p where p.koid='{$r['bl']['lines_oPRODUCT'][$l]->raw}'))\");\n if (count($rsc)>=1 && $rsc[0]['type'] == 'NO-DATE'){\n $r['bl']['lines__validfromhidden'][$l] = 1;\n } else {\n // calcul du validtill\n $dp = $this->modcatalog->displayProduct(NULL, NULL, NULL, NULL, $r['bl']['lines_oPRODUCT'][$l]->raw);\n $dpc = $this->modcatalog->getPrdConf($dp);\n $r['bl']['lines__validtill'][$l] = $this->getValidtill($r['bl']['lines_oVALIDFROM'][$l]->raw, $dp, $dpc);\n $nodates = false;\n }\n }\n $r['_tot2']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_tot2Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n\n $ll = false;\n if (!empty($r['bl']['lines_oLNKLINE'][$l]->raw)){\n $ll = array_search($r['bl']['lines_oLNKLINE'][$l]->raw, $r['bl']['lines_oid']);\n }\n if ($ll === false)\n continue;\n\n if($r['bl']['lines_oLINETYPE'][$ll]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$ll])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$ll]->raw;\n $cartesfaites['_'.$ll] = 1;\n if ($r['bl']['lines__annul'][$ll] == true)\n $r['_totcartAnnul']+= $r['bl']['lines_oTTC'][$ll]->raw;\n }\n $r['bl']['lines__cart'][$l] = $ll;\n }\n if($olinetype->raw == 'bonu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__bonu'][$ll] = $l;\n }\n if($olinetype->raw == 'assu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__assu'][$ll] = $l;\n $r['_totassu']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_totassuAnnul']+= $r['bl']['lines_oTTC'][$l]->raw;\n }\n }\n // utilisation avoirs et coupons\n if ($r['_tot2'] <= 0){\n $r['_tot2'] = 0;\n }\n /* -- vente de cartes seules -- */\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if($r['bl']['lines_oLINETYPE'][$l]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$l])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$l]->raw;\n $cartesfaites['_'.$l] = 1;\n $r['_cartesseules'][] = $l;\n }\n }\n }\n // calcul des totaux - annulations (pro)\n foreach(array('_tot1', '_tot2', '_totassu') as $tn){\n $r[$tn.'C'] = $r[$tn] - $r[$tn.'Annul'];\n }\n if ($firstday == NULL){\n $firstday = $r['do']['oFIRSTDAYSKI']->raw;\n }\n /* -- vente de cartes seules -- */\n $r['firstday'] = $firstday;\n $r['nodates'] = $nodates;\n /* -- cas des commandes pro -- */\n if ($this->customerIsPro()){\n $this->summarizeOrder($r);\n }\n\n return $r;\n }", "function insertOrdersProductPreProc(&$params, &$reference) {\n\n error_log(\"insertOrdersProductPreProc - begin\");\n\n $order_id = $params['insertArray']['orders_id'];\n $cart_product_item = $params['value'];\n $product_id = $cart_product_item['products_id'];\n $variant_id = $cart_product_item['variant_id'];\n\n\n // Get variant's details from the db\n $qry_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n 'v.variant_price, v.variant_sku',\n 'tx_msvariants_domain_model_variants v',\n 'v.variant_id='.$variant_id.' and v.product_id='.$product_id\n );\n\n if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_res) != 1) {\n // TODO this should never happen - raise exception?\n return;\n }\n\n $variant_data = $GLOBALS ['TYPO3_DB']->sql_fetch_assoc($qry_res);\n\n // Insert variant details about the order into the db\n $insert_array = array(\n 'order_id' => $order_id,\n 'product_id' => $product_id,\n 'variant_id' => $variant_id,\n 'price' => $variant_data['variant_price'],\n 'quantity' => $cart_product_item['qty'],\n 'sku' => $variant_data['variant_sku']\n );\n\n // TODO should we insert here the following logic:\n // - check if after the order the variants gets out of stock\n // - if such is the case, notify adming about this event\n // - and disable product variant! (ohh... that's new - we should do this in product detail script)\n $this->updateQtyInVariant($variant_id, $cart_product_item['qty']);\n\n $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n 'tx_msvariants_domain_model_variantsorders', $insert_array\n );\n\n // Insert variant attributes details about the order into the db\n $qry_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n 'va.attribute_id, va.option_id, va.option_value_id',\n 'tx_msvariants_domain_model_variantsattributes va',\n 'va.variant_id='.$variant_id.' and va.product_id='.$product_id\n );\n\n if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_res) <= 0) {\n // TODO this should never happen - raise exception?\n return;\n }\n\n while (($row = $GLOBALS ['TYPO3_DB']->sql_fetch_assoc($qry_res)) != false) {\n\n $row['option_name'] = mslib_fe::getRealNameOptions($row['option_id']);\n $row['option_value_name'] = mslib_fe::getNameOptions($row['option_value_id']);\n\n $insert_array = array(\n 'order_id' => $order_id,\n 'product_id' => $product_id,\n 'variant_id' => $variant_id,\n 'attribute_id' => $row['attribute_id'],\n 'option_id' => $row['option_id'],\n 'option_value_id' => $row['option_value_id'],\n 'option_name' => $row['option_name'],\n 'option_value_name' => $row['option_value_name']\n );\n\n $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n 'tx_msvariants_domain_model_variantsattributesorders', $insert_array\n );\n\n } // while\n\n error_log(\"insertOrdersProductPreProc - end\");\n\n\n }", "function uc_order_edit_products_add_blank($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n\n $order = $form_state['build_info']['args'][0];\n\n $product = new stdClass();\n $product->qty = 1;\n $product->order_id = $order->order_id;\n uc_order_product_save($order->order_id, $product);\n\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added new product line to order.')));\n}", "public function activate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_activate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $_POST[ $this->product_slug . '-license-key' ];\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( false === $license_data->success ) {\n\n\t\t\t\t\tswitch( $license_data->error ) {\n\n\t\t\t\t\t\tcase 'expired' :\n\n\t\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t\t__( 'Your license key expired on %s.' ),\n\t\t\t\t\t\t\t\tdate_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'revoked' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has been disabled.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'missing' :\n\n\t\t\t\t\t\t\t$message = __( 'Invalid license.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'invalid' :\n\t\t\t\t\t\tcase 'site_inactive' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license is not active for this URL.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'item_name_mismatch' :\n\n\t\t\t\t\t\t\t$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EAEL_SL_ITEM_NAME );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'no_activations_left':\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has reached its activation limit.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\n\t\t\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Check if anything passed on a message constituting a failure\n\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\n\t\t\t$this->set_license_key( $license );\n\t\t\t$this->set_license_status( $license_data->license );\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\t\t}\n\t}", "public function showProductButton() {\n\n\t\techo $this->getProductButton();\n\t}", "function product()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $product['content'] = Modules::run('product/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('product');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdminProduct',$product);\n \n \n $this->load->view('general',$data);\n \n }\n }", "function markPurchased($opm_productid,$accountid) {\n \n \t$this->load->model('accounts_model');\n\n\t\tif (checkPerms('can_mark_purchased',true)) {\n\n\t\t\t\n\t\t\tif ($this->accounts_model->markProductPurchased($opm_productid,$accountid)) {\n\t\t\t\t\n\t\t\t\t// fetch account name for history entry\n\t\t\t\t\n\t\t\t\t$account = $this->accounts_model->fetchAccount($accountid);\n\t\t\t\t\n\t\t\t\t$message = $account->account . \" purchased this product (entered by \" . $this->userinfo->username . \")\";\n\t\t\t\t\n\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t$this->opm->displayAlert(\"Product marked Purchased by \" . $account->account . \".\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\n }", "function insertPB()\n {\n\n $productos = $this->Import_model->get_productos();\n\n $valores = array();\n\n foreach ($productos as $key => $producto) {\n\n $detalle_pivote = $this->Import_model->get_detalle_pivote($producto->codigo_producto);\n\n $this->crearPresentacion($producto->id_entidad, $detalle_pivote);\n //$this->Import_model->insertProductoBodega($producto->id_entidad);\n //$this->Import_model->insertCategoriaProducto($producto->id_entidad, $producto->id_familia, $producto->id_grupo );\n\n }\n }", "function app_products() {\r\n $this->name=\"app_products\";\r\n $this->title=\"<#LANG_APP_PRODUCTS#>\";\r\n $this->module_category=\"<#LANG_SECTION_APPLICATIONS#>\";\r\n $this->checkInstalled();\r\n}", "public function reindexTragentoProduct() {\n $tp = new Magemore_Tragento_Reindex_Product_Process();\n }", "function updatepanier($user, $product, $quantite, $poids){ \t\t// Fonction pour update la quantite d'un produit au panier\n\n\t\tinclude(\"../../modele/modele.php\");\n\n\t\t$sql = 'UPDATE `detailcommande` SET `quantite`='.$quantite.', `poids`='.$poids.' WHERE id_user='.$user.' AND id_product='.$product.' AND actif = 1'; \n\t\t$reponse = $bdd->prepare($sql);\n\t\t$reponse ->execute();\n\t}", "public function index() {\n\t\tif (isset($this->request->post['payment_status']) && strtolower($this->request->post['payment_status']) == 'completed') {\n\t\t\t$this->data['success'] = $this->language->get('ms_success_product_published');\n\t\t}\n\n\t\t$seller_id = $this->customer->getId();\n\t\t$seller_group = $this->MsLoader->MsSellerGroup->getSellerGroupBySellerId($seller_id);\n\t\t$seller_group_id = isset($seller_group['seller_group']) ? $seller_group['seller_group'] : NULL;\n\n\t\t$total_products = $this->MsLoader->MsProduct->getTotalProducts(array(\n\t\t\t'seller_id' => $seller_id,\n\t\t\t'product_status' => array(MsProduct::STATUS_ACTIVE, MsProduct::STATUS_INACTIVE, MsProduct::STATUS_DISABLED, MsProduct::STATUS_UNPAID)\n\t\t));\n\n\t\t$slr_gr_settings = $this->MsLoader->MsSetting->getSellerGroupSettings(array('seller_group_id' => $seller_group_id));\n\t\tif(isset($slr_gr_settings['slr_gr_product_number_limit']) && $slr_gr_settings['slr_gr_product_number_limit'] !== '' && $total_products + 1 > (int)$slr_gr_settings['slr_gr_product_number_limit']) {\n\t\t\t$this->data['product_number_limit_exceeded'] = $this->language->get('ms_error_slr_gr_product_number_limit_exceeded');\n\t\t}\n\t\t\n\t\t// Links\n\t\t$this->data['link_back'] = $this->url->link('account/account', '', 'SSL');\n\t\t$this->data['link_create_product'] = $this->url->link('seller/account-product/create', '', 'SSL');\n\n\t\t// Title and friends\n\t\t$this->document->setTitle($this->language->get('ms_account_products_heading'));\t\t\n\t\t$this->data['breadcrumbs'] = $this->MsLoader->MsHelper->setBreadcrumbs(array(\n\t\t\tarray(\n\t\t\t\t'text' => $this->language->get('text_account'),\n\t\t\t\t'href' => $this->url->link('account/account', '', 'SSL'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'text' => $this->language->get('ms_account_dashboard_breadcrumbs'),\n\t\t\t\t'href' => $this->url->link('seller/account-dashboard', '', 'SSL'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'text' => $this->language->get('ms_account_products_breadcrumbs'),\n\t\t\t\t'href' => $this->url->link('seller/account-product', '', 'SSL'),\n\t\t\t)\n\t\t));\n\n\t\tlist($template, $children) = $this->MsLoader->MsHelper->loadTemplate('account-product');\n\t\t$this->response->setOutput($this->load->view($template, array_merge($this->data, $children)));\n\t}", "public function detailGrNotApprove($item){\n /* buat query temporary untuk dijoinkan dengan ec_gr_status */\n $_tmp = array();\n foreach($item as $i){\n $_t = array();\n foreach($i as $_k => $_v){\n array_push($_t,$_v .' as '.$_k);\n }\n array_push($_tmp,'select '.implode(',',$_t).' from dual');\n }\n $sql_tmp = implode(' union ',$_tmp);\n $sql = <<<SQL\n select EGS.*\n from EC_GR_STATUS EGS\n join ({$sql_tmp})TT\n on TT.GR_NO = EGS.GR_NO and TT.GR_YEAR = EGS.GR_YEAR and TT.GR_ITEM_NO = EGS.GR_ITEM_NO\n where EGS.STATUS = 0\nSQL;\n //log_message('ERROR',$sql);\n return $this->db->query($sql)->result_array();\n }", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "public function getProductTextAdv($product,$adv_type='Inline') {\n $product_id=$product->getId();\n $child_ids=array();\n if ($product->isConfigurable()){\n $associatedProducts = $product->getTypeInstance()->getConfigurableAttributesAsArray($product); \n foreach ($product->getTypeInstance()->getUsedProducts() as $childProduct) {\n $child_ids[]=$childProduct->getId();\n }\n }\n \n switch ($adv_type){\n case \"Bottom\":\n $display_zone=$this->product_bottom_advertisment_name;\n break;\n case \"Top\":\n $display_zone=$this->product_top_advertisment_name;\n break;\n case \"Inline\":\n default :\n $display_zone=$this->product_inline_advertisment_name;\n break;\n }\n\n $condition_2 = $this->_getReadAdapter()->quoteInto('bi.banner_id=b.banner_id','');\n $condition_3 = $this->_getReadAdapter()->quoteInto('bi.promotion_reference=pt.yourref', ''); // and bi.promotion_reference != \\'\\','');\n $condition_4 = $this->_getReadAdapter()->quoteInto(\"qphp.promotion_id=pt.promotion_id \",'');\n\n $where = \"b.status > 0 and \";\n $where .= \"(pt.promotion_text is null or pt.promotion_text!='' or bi.filename!='') and \";\n $where .= \"b.display_zone like '%\" . $display_zone . \"%' and \";\n $where .= \"(qphp.promotion_id is null or (\";\n if (count($child_ids))\n {\n $where .= \" ((qphp.parent_product_id='\" . (int)$product_id . \"' and \";\n $where .= \"qphp.product_id in (\" . join(\",\",$child_ids) . \")) or \";\n $where .= \"(qphp.product_id='\" . (int)$product_id.\"' and \";\n $where .= \"qphp.parent_product_id=0) )\";\n }\n else\n {\n $where .= \" qphp.product_id='\" . (int)$product_id . \"' and qphp.parent_product_id=0\";\n }\n $where .= \"))\";\n \n $select = $this->_getReadAdapter()->select()->from(array('b'=>$this->getTable('qixol/banner')))\n ->join(array('bi'=>$this->getTable('qixol/bannerimage')), $condition_2)\n ->joinLeft(array('pt'=>$this->getTable('promotions')), $condition_3)\n ->joinLeft(array('qphp'=>$this->getTable('promotionhasproduct')), $condition_4)\n ->where($where)\n ->group(array(\"bi.banner_id\",\"bi.banner_image_id\"))\n ->order('bi.sort_order')\n ->reset('columns')\n ->columns(array('bi.comment','bi.filename',\"bi.url\"));\n\n $data=$this->_getReadAdapter()->fetchAll($select);\n\n if (count($data)) return $data;\n return false;\n }", "public function checkProducto(){\n $sql='SELECT * FROM producto where nombre = ?';\n $params=array($this->nombre);\n return Database::getRow($sql, $params);\n }", "public function addToCart($product, $qtt){\n $this->lines[] = [\"product\" => $product, \"qtt\" => $qtt];\n }", "public function updateKitInventory() {\n\t\textract($this->request->data);\n\t\t//this->request->data contains\n\t\t//array(\n\t\t//\t'pullQty' => '1',\n\t\t//\t'itemId' => '90',\n\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t//\t'onHand' => 'undefined',\n\t\t//\t'mode' => 'pull'\n\t\t//)\n\t\t//setup return array\n\t\t$orderItemType = $this->Item->OrderItem->field('catalog_type', array('id' => $rowId));\n\t\tif($orderItemType & (ON_DEMAND | INVENTORY_KIT)){\n\t\t\t$orderItemCatId = $this->Item->OrderItem->field('catalog_id', array('id' => $rowId));\n\t\t\t$this->requestAction(array('controller' => 'Catalogs', 'action' => 'kitAdjustment', $orderItemCatId, abs($pullQty), $orderItemType));\n\t\t\t$onHand = $this->Item->field('quantity', array('id' => $itemId));\n\t\t}\n\t\treturn $onHand;\n\t}", "public function acceptFromPoAction()\r\n {\r\n $request = $this->getRequest();\r\n if ($request->getHeader('Referer') == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $id = (int) $this->params()->fromQuery('target_id');\r\n $token = $this->params()->fromQuery('token');\r\n\r\n /**@var \\Application\\Repository\\FinVendorInvoiceRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\FinVendorInvoice');\r\n $rows_tmp = $res->getAPInvoiceTmp($id, $token);\r\n\r\n if ($rows_tmp !== null) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoice $target ;*/\r\n $target = null;\r\n\r\n if (count($rows_tmp) > 0) {\r\n $row_1 = $rows_tmp[0];\r\n if ($row_1 instanceof FinVendorInvoiceRowTmp) {\r\n $target = $row_1->getInvoice();\r\n }\r\n\r\n if ($target == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $n = 0;\r\n foreach ($rows_tmp as $r) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoiceRowTmp $r ;*/\r\n\r\n $n ++;\r\n $ap_row = new FinVendorInvoiceRow();\r\n $ap_row->setIsActive(1);\r\n $ap_row->setRowNumber($n);\r\n $ap_row->setRowIndentifer($target->getSysNumber() . \"-$n\");\r\n\r\n $ap_row->setCurrentState($target->getCurrentState());\r\n $ap_row->setInvoice($target);\r\n $ap_row->setPoRow($r->getPoRow());\r\n $ap_row->setPrRow($r->getPrRow());\r\n $ap_row->setItem($r->getItem());\r\n\r\n $ap_row->setQuantity($r->getQuantity());\r\n $ap_row->setUnit($r->getUnit());\r\n $ap_row->setUnitPrice($r->getUnitPrice());\r\n\r\n $netAmount = $r->getQuantity() * $r->getUnitPrice();\r\n\r\n $taxRate = (int) $r->getTaxRate();\r\n $ap_row->setTaxRate($taxRate);\r\n\r\n $taxAmount = $netAmount * $taxRate;\r\n $grossAmount = $netAmount + $taxAmount;\r\n\r\n $ap_row->setNetAmount($netAmount);\r\n $ap_row->setGrossAmount($grossAmount);\r\n\r\n $u = $this->doctrineEM->getRepository('Application\\Entity\\MlaUsers')->findOneBy(array(\r\n \"email\" => $this->identity()\r\n ));\r\n\r\n $ap_row->setCreatedBy($u);\r\n $ap_row->setCreatedOn(new \\DateTime());\r\n $ap_row->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $ap_row->setRemarks($r->getRemarks());\r\n\r\n $this->doctrineEM->persist($ap_row);\r\n\r\n $r->setCurrentState(\"ACCEPTED\");\r\n $r->setIsActive(0);\r\n $this->doctrineEM->persist($r);\r\n\r\n $gr_entity = new NmtInventoryTrx();\r\n $gr_entity->setVendor($target->getVendor());\r\n $gr_entity->setFlow('IN');\r\n $gr_entity->setInvoiceRow($ap_row);\r\n $gr_entity->setItem($r->getItem());\r\n $gr_entity->setPrRow($r->getPrRow());\r\n $gr_entity->setQuantity($r->getQuantity());\r\n $gr_entity->setVendorItemCode($r->getVendorItemCode());\r\n $gr_entity->setVendorItemUnit($r->getUnit());\r\n $gr_entity->setVendorUnitPrice($r->getUnitPrice());\r\n $gr_entity->setTrxDate($target->getGrDate());\r\n $gr_entity->setCurrency($target->getCurrency());\r\n $gr_entity->setRemarks(\"GR of Invoice \" . $target->getInvoiceNo());\r\n $gr_entity->setWh($target->getWarehouse());\r\n $gr_entity->setCreatedBy($u);\r\n $gr_entity->setCreatedOn(new \\DateTime());\r\n $gr_entity->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $gr_entity->setChecksum(Rand::getString(32, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n\r\n $gr_entity->setTaxRate($r->getTaxRate());\r\n\r\n $gr_entity->setCurrentState($target->getCurrentState());\r\n\r\n if ($target->getCurrentState() == \"finalInvoice\") {\r\n $gr_entity->setIsActive(1);\r\n } else {\r\n $gr_entity->setIsActive(0);\r\n }\r\n\r\n $this->doctrineEM->persist($gr_entity);\r\n $this->doctrineEM->flush();\r\n }\r\n }\r\n\r\n $this->doctrineEM->flush();\r\n\r\n /*\r\n * $redirectUrl = \"/finance/v-invoice/copy-from-po1?token=\" . $target>getToken() . \"&entity_id=\" . $entity->getId();\r\n */\r\n $redirectUrl = \"/finance/v-invoice/list\";\r\n return $this->redirect()->toUrl($redirectUrl);\r\n\r\n /*\r\n * return new ViewModel(array(\r\n * 'target' => $target,\r\n * ));\r\n */\r\n }\r\n return $this->redirect()->toRoute('access_denied');\r\n }", "protected function _getSuccessData($data) {\n $data['event'] = 'purchase';\n $order_id = Mage::getSingleton('checkout/session')->getLastOrderId();\n $order_info = Mage::getModel('sales/order')->load($order_id);\n $increment_id = $order_info->getIncrementId();\n $products = [];\n\n foreach ($order_info->getAllVisibleItems() as $item) {\n $product = Mage::getModel('catalog/product')->load($item->getProductId());\n $products[] = array(\n 'name' => $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($item->getName())),\n 'sku' => $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($item->getProduct()->getData('sku'))),\n 'id' => $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($item->getProduct()->getData('sku'))),\n 'price' => $this->formatNumber($item->getBasePrice()),\n 'quantity' => (int) $item->getQtyOrdered()\n );\n $productsFacebook[] = array(\n 'id' => $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($item->getProduct()->getData('sku'))),\n 'item_price' => (float)$this->formatNumber($item->getBasePrice()),\n 'quantity' => (int) $item->getQty(),\n 'delivery_category' => 'home_delivery'\n );\n }\n \n $skus_for_remarketing = array();\n foreach ($products as $product) {\n $skus_for_remarketing[] = $product['sku'];\n }\n \n $data['google_tag_params']['ecomm_pagetype'] = 'purchase';\n $data['google_tag_params']['transactionId'] = $increment_id;\n $data['google_tag_params']['transactionType'] = Mage::helper('googletagmanager')->getTransactionType();\n $data['google_tag_params']['transactionAffiliation'] = Mage::helper('googletagmanager')->getTransactionAffiliation();\n $data['google_tag_params']['transactionDate'] = date(\"Y-m-d\");\n $data['google_tag_params']['transactionTotal'] = (float)$this->formatNumber($order_info->getBaseGrandTotal());\n $data['google_tag_params']['transactionShipping'] = (float)$this->formatNumber($order_info->getBaseShippingAmount());\n $data['google_tag_params']['transactionTax'] = (float)$this->formatNumber($order_info->getBaseTaxAmount());\n $data['google_tag_params']['transactionCurrency'] = \"BRL\";\n $data['google_tag_params']['transactionPromoCode'] = ($order_info->getCouponCode() ? $order_info->getCouponCode() : \"\");\n $data['google_tag_params']['transactionProducts'] = $products;\n $data['google_tag_params']['revenue'] = (float)$this->formatNumber($order_info->getBaseGrandTotal());\n $data['google_tag_params']['ecomm_totalvalue'] = (float)($this->formatNumber($order_info->getGrandTotal()));\n $data['google_tag_params']['impressions'] = $products;\n $data['google_tag_params']['ecomm_prodid'] = $skus_for_remarketing;\n\n\n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $data['google_tag_params']['user_id'] = (string) $customer->getCustomerId();\n }\n if($this->IsReturnedCustomer()){\n $data['google_tag_params']['returnCustomer'] = 'true';\n }\n else {\n $data['google_tag_params']['returnCustomer'] = 'false';\n }\n\n /* Facebook Conversion API Code */\n $custom_product = $productsFacebook;\n $custom_data = array(\n \"content\" => $custom_product,\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($order_info->getBaseGrandTotal()),\n \"currency\" => \"BRL\",\n \"num_items\" => count($products),\n \"order_id\" => $increment_id\n );\n\n $this->createFacebookRequest(\"Purchase\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n return $data;\n \n }" ]
[ "0.5962777", "0.59511894", "0.5944888", "0.5887753", "0.5860954", "0.5823517", "0.5810148", "0.57833606", "0.5783175", "0.5773097", "0.57255316", "0.56867623", "0.56749165", "0.5671198", "0.56633353", "0.5644062", "0.56353927", "0.56340504", "0.56190133", "0.56091285", "0.55826324", "0.5579545", "0.55788124", "0.55746603", "0.5562079", "0.556056", "0.5553283", "0.5552021", "0.55295527", "0.5518629", "0.5516778", "0.55121905", "0.5510391", "0.5501252", "0.54989165", "0.54899347", "0.54750466", "0.5471195", "0.54709345", "0.5469699", "0.54694784", "0.54682046", "0.5467131", "0.5465243", "0.54591846", "0.54580146", "0.54574066", "0.54516864", "0.5451585", "0.54478085", "0.5444638", "0.5436562", "0.5431663", "0.5427426", "0.54254806", "0.5420065", "0.541999", "0.54165787", "0.541418", "0.5413995", "0.5411766", "0.54075783", "0.54054296", "0.5397624", "0.53974247", "0.53922015", "0.53919256", "0.5388291", "0.5386293", "0.5381699", "0.5381561", "0.53800386", "0.5373719", "0.53722346", "0.5371115", "0.536946", "0.5366942", "0.53640777", "0.53613", "0.535281", "0.53490365", "0.5348258", "0.53417575", "0.5341129", "0.53405166", "0.53364843", "0.53360337", "0.5334187", "0.53298485", "0.53264856", "0.5325684", "0.53245455", "0.5321961", "0.53208965", "0.5319193", "0.5313701", "0.5310814", "0.53072864", "0.5305296", "0.53029037", "0.53017133" ]
0.0
-1
Add an importer and the directory (relative to the root directory) of where entity files to be imported live.
public function addImporter(EntityImporterInterface $entityImporterInterface, string $directory, int $order) { $this->entityImporterMappings[] = [ self::DIRECTORY => $directory, self::IMPORTER => $entityImporterInterface, self::ORDER => $order, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function import()\n {\n // Reorder importers\n usort($this->entityImporterMappings, function ($a, $b) {\n return $a[ORDER] <=> $b[ORDER];\n });\n\n // Import each entity type in turn\n foreach ($this->entityImporterMappings as $entityImporterMapping) {\n $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]);\n foreach ($files as $filename => $slug) {\n $fileContents = file_get_contents($filename);\n $entityData = json_decode($fileContents, true);\n $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData);\n }\n }\n }", "public function onConfigImporterImport(ConfigImporterEvent $event)\n {\n $this->settings->checkAndCreateEntities();\n }", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "protected function installEntities()\n {\n $sm = \\Core::make('Concrete\\Core\\Database\\DatabaseStructureManager');\n $entities = array('Concrete\\Core\\Entity\\File\\File');\n\n // Now we fill the rest of the class names recursively from the entity directory, since it's\n // entirely new\n $entityPath = DIR_BASE_CORE . '/' . DIRNAME_CLASSES . '/Entity';\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($entityPath, \\FilesystemIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::CHILD_FIRST\n );\n\n foreach ($iterator as $path) {\n if (!$path->isDir()) {\n $path = $path->__toString();\n if (substr(basename($path), 0, 1) != '.') {\n $path = str_replace(array($entityPath, '.php'), '', $path);\n $entities[] = 'Concrete\\Core\\Entity' . str_replace('/', '\\\\', $path);\n }\n }\n }\n\n $em = $this->connection->getEntityManager();\n $cmf = $em->getMetadataFactory();\n $metadatas = array();\n foreach ($cmf->getAllMetadata() as $meta) {\n if (in_array($meta->getName(), $entities)) {\n $metadatas[] = $meta;\n }\n }\n\n $sm->installDatabaseFor($metadatas);\n }", "public function addImportPath(string $strImportPath): void\n {\n $path = $this->dirExists($strImportPath);\n\n if ($path)\n {\n $this->importPaths[] = $path;\n }\n }", "public function import()\n {\n \n }", "private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_import_order_xml', 'WooCommerce Order XML', __('Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'OrderImpExpXML_Importer::order_importer');\n register_importer('woocommerce_wf_import_order_xml_cron', 'WooCommerce Order XML Cron', __('Cron Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'WF_OrderImpExpXML_ImportCron::orderxml_importer');\n }", "abstract protected function doImport(Finder $finder, InputInterface $input, OutputInterface $output);", "protected function initializeImport() {}", "public function import();", "function register_importer() {\n\t\tglobal $wp_importers;\n\n\t\tif( ! isset( $wp_importers['wgobd_the_events_calendar'] ) ) {\n\t\t\t$wp_importers['wgobd_the_events_calendar'] = array(\n\t\t\t\t__( 'The Events Calendar → All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\t__( 'Imports events created using The Events Calendar plugin into the All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\tarray( &$this, 'import_the_events_calendar' )\n\t\t\t);\n\t\t}\n\t}", "function _manually_load_importer() {\n\tif ( ! class_exists( 'WP_Import' ) ) {\n\t\trequire dirname( dirname( __FILE__ ) ) . '/src/wordpress-importer.php';\n\t}\n}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_order_csv', 'WooCommerce Order (CSV/XML)', __('Import <strong>Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrderImpExpCsv_Importer::order_importer');\n register_importer('order_csv_cron', 'WooCommerce Orders (CSV/XML)', __('Cron Import <strong>order</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrdImpExpCsv_ImportCron::order_importer');\n }", "function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "public function export_addFilesFromRelations() {}", "private function registerImporter()\n {\n $this->singleton(Contracts\\ImporterManager::class, ImporterManager::class);\n $this->singleton('arcanedev.excel.importer', Contracts\\ImporterManager::class);\n }", "function _fillDirectories($importDirectory)\n\t{\n\t\t\n\t\t@set_time_limit(60);\n\t\t\n\t\t$weDirectory = ereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . \"/webEdition\";\n\t\tif ($importDirectory == $weDirectory) { // we do not import stuff from the webEdition home dir\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// go throuh all files of the directory\n\t\t$d = dir($importDirectory);\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif ($entry == '.' || $entry == '..' || ((strlen($entry) >= 2) && substr($entry, 0, 2) == \"._\"))\n\t\t\t\tcontinue;\n\t\t\t\t// now we have to check if the file should be imported\n\t\t\t$PathOfEntry = $importDirectory . $this->_slash . $entry;\n\t\t\tif (!is_dir($PathOfEntry) && ($this->maxSize && (filesize($PathOfEntry) > (abs($this->maxSize) * 1024 * 1024))))\n\t\t\t\tcontinue;\n\t\t\t$contentType = getContentTypeFromFile($PathOfEntry);\n\t\t\t$importIt = false;\n\t\t\t\n\t\t\tswitch ($contentType) {\n\t\t\t\tcase \"image/*\" :\n\t\t\t\t\tif ($this->images) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/html\" :\n\t\t\t\t\tif ($this->htmlPages) {\n\t\t\t\t\t\tif ($this->createWePages) {\n\t\t\t\t\t\t\t$contentType = \"text/webedition\";\n\t\t\t\t\t\t\t// webEdition files needs to be post processed (external links => internal links)\n\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t$this->_postProcess, \n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\t\t\"contentType\" => \"post/process\", \n\t\t\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"application/x-shockwave-flash\" :\n\t\t\t\t\tif ($this->flashmovies) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"video/quicktime\" :\n\t\t\t\t\tif ($this->quicktime) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/js\" :\n\t\t\t\t\tif ($this->js) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/plain\" :\n\t\t\t\t\tif ($this->text) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/css\" :\n\t\t\t\t\tif ($this->css) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"folder\" :\n\t\t\t\t\t$importIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tif ($this->other) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif ($importIt) {\n\t\t\t\tarray_push(\n\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\"thumbs\" => $this->thumbs, \n\t\t\t\t\t\t\t\t\"width\" => $this->width, \n\t\t\t\t\t\t\t\t\"height\" => $this->height, \n\t\t\t\t\t\t\t\t\"widthSelect\" => $this->widthSelect, \n\t\t\t\t\t\t\t\t\"heightSelect\" => $this->heightSelect, \n\t\t\t\t\t\t\t\t\"keepRatio\" => $this->keepRatio, \n\t\t\t\t\t\t\t\t\"quality\" => $this->quality, \n\t\t\t\t\t\t\t\t\"degrees\" => $this->degrees, \n\t\t\t\t\t\t\t\t\"importMetadata\" => $this->importMetadata\n\t\t\t\t\t\t));\n\t\t\t}\n\t\t\tif ($contentType == \"folder\") {\n\t\t\t\tif (($this->depth == -1) || (abs($this->depth) > $this->_depth)) {\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\t\"thumbs\" => \"\", \n\t\t\t\t\t\t\t\t\t\"width\" => \"\", \n\t\t\t\t\t\t\t\t\t\"height\" => \"\", \n\t\t\t\t\t\t\t\t\t\"widthSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"heightSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"keepRatio\" => \"\", \n\t\t\t\t\t\t\t\t\t\"quality\" => \"\", \n\t\t\t\t\t\t\t\t\t\"degrees\" => \"\", \n\t\t\t\t\t\t\t\t\t\"importMetadata\" => 0\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$this->_depth++;\n\t\t\t\t\t$this->_fillDirectories($PathOfEntry);\n\t\t\t\t\t$this->_depth--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t}", "public function onMigratePostImport(MigrateImportEvent $event) {\n\n if ($this->searchStatus == TRUE) {\n \\Drupal::service('module_installer')->install(['search']);\n $config = $this->entityTypeManager->getStorage('search.settings')->load();\n $config->setOption('search.settings', $this->searchSettings);\n }\n if ($this->trackerStatus == TRUE) {\n \\Drupal::service('module_installer')->install(['tracker']);\n $config = $this->entityTypeManager->getStorage('tracker.settings')->load();\n $config->setOption('tracker.settings', $this->trackerSettings);\n }\n if ($this->pathautoStatus == TRUE) {\n \\Drupal::service('module_installer')->install(['pathauto']);\n $config = $this->entityTypeManager->getStorage('pathauto.settings')->load();\n $config->setOption('pathauto.settings', $this->pathautoSettings);\n }\n\n }", "public function wp_parser_starting_import() {\n\t\t$importer = new Importer;\n\n\t\tif ( ! $this->p2p_tables_exist() ) {\n\t\t\t\\P2P_Storage::init();\n\t\t\t\\P2P_Storage::install();\n\t\t}\n\n\t\t$this->post_types = array(\n\t\t\t'hook' => $importer->post_type_hook,\n\t\t\t'method' => $importer->post_type_method,\n\t\t\t'function' => $importer->post_type_function,\n\t\t);\n\t}", "protected function beforeImport($entities)\n {\n\n }", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('coupon_csv', 'WooCommerce Coupons (CSV)', __('Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_Importer::coupon_importer');\n register_importer('coupon_csv_cron', 'WooCommerce Coupons (CSV)', __('Cron Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_ImportCron::coupon_importer');\n wp_enqueue_script('woocommerce-order-xml-importer', plugins_url(basename(plugin_dir_path(WF_OrderImpExpXML_FILE)) . '/js/hf_order_admin.js', basename(__FILE__)), array(), '1.0.0', true);\n }", "public function importEntities() {\n\t\t$option = $this->option;\n\t\t// Access check\n\t\tif(!$this->allowEdit($option)) {\n\t\t\t$this->setRedirect('index.php?option=com_jmap&task=metainfo.display', JText::_('COM_JMAP_ERROR_ALERT_NOACCESS'), 'notice');\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Get the file manager instance with db connector dependency injection\n\t\t$filesManager = new JMapFileMetainfo(JFactory::getDbo(), $this->app);\n\t\n\t\tif(!$filesManager->import()) {\n\t\t\t// Model set exceptions for something gone wrong, so enqueue exceptions and levels on application object then set redirect and exit\n\t\t\t$filesManagerException = $filesManager->getError(null, false);\n\t\t\t$this->app->enqueueMessage($filesManagerException->getMessage(), $filesManagerException->getErrorLevel());\n\t\t\t$this->setRedirect ( \"index.php?option=$option&task=metainfo.display\", JText::_('COM_JMAP_METAINFO_ERROR_IMPORT'));\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$this->setRedirect ( \"index.php?option=$option&task=metainfo.display\", JText::_('COM_JMAP_METAINFO_SUCCESS_IMPORT'));\n\t}", "public function import(\\RecursiveIteratorIterator $files, OutputInterface $output);", "public function importPass()\n {\n // Prepare list of objects for import\n $remoteObjects = $this->getImportableObjects();\n if ($remoteObjects === null) {\n return;\n }\n \n // Add all objects\n $updated = 0;\n $added = 0;\n $total = 0;\n $remoteCount = $remoteObjects->count();\n foreach ($remoteObjects as $remoteObject) {\n // Show progress indicator\n $this->task->progress(++$total, $remoteCount);\n\n // If allowed, detect updateable objects\n $localObject = null;\n if ($this->canUpdate() && ($localObject = $this->findMatchedLocalObject($remoteObject->ID))) {\n // Update existing object\n $this->updateLocalObject($localObject, $remoteObject);\n ++$updated;\n }\n\n // If allowed, create a new object\n // If this step has an add only strategy, then this step relies on getImportableObjects\n // to filter out objects that have already been added.\n if (empty($localObject) && $this->canAdd()) {\n // Make a new object\n $this->createLocalFromRemoteObject($remoteObject);\n ++$added;\n }\n }\n // Done!\n $this->task->message(\" * Result: {$added} added, {$updated} updated\");\n }", "public function prepareImport();", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "public function __construct(Importer $importer)\n\t{\n\t\t$this->importer = $importer;\n\t\tparent::__construct();\n\t}", "public function importAction()\n {\n $this->importParameters = $this->importParameters + $this->_importExtraParameters;\n\n parent::importAction();\n }", "protected abstract function importCreate($entity);", "public function import(): void;", "function getImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$import_dir = ilUtil::getDataDir().\"/svy_data\".\n\t\t\t\"/svy_\".$this->getId().\"/import\";\n\t\tif (!is_dir($import_dir))\n\t\t{\n\t\t\tilUtil::makeDirParents($import_dir);\n\t\t}\n\t\tif(@is_dir($import_dir))\n\t\t{\n\t\t\treturn $import_dir;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function set_import_path( $path ) {\n\n\t\t$this->_import_path = $path;\n\t}", "public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }", "function run_endo_importer() {\n\t$plugin = new Endo_Importer();\n\t$plugin->run();\n}", "public function setImportPaths(array $arrImportPaths): void\n {\n foreach ($arrImportPaths as $path) {\n $this->addImportPath($path);\n }\n }", "public function import(SimpleXMLElement $el)\n\t{\n\t\t// Fetch the git repository.\n\t\t$basePath = $this->_fetchGitRepository('http://github.com/joomla/joomla-platform.git', (string) $el['version']);\n\n\t\t// Append the Joomla Platform libraries folder to the base path.\n\t\t$basePath .= '/libraries';\n\n\t\t// Check to see if legacy support should be imported.\n\t\t$legacy = (((string) $el['legacy'] == 'true') ? true : false);\n\n\t\t// Validate that the platform import file exists.\n\t\tif (!is_file($basePath . '/import.php'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('The platform import file could not be found.');\n\t\t}\n\n\t\t// Validate that the platform loader file exists.\n\t\tif (!is_file($basePath . '/loader.php'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('The platform loader file could not be found.');\n\t\t}\n\n\t\t// Add the hard requirements.\n\t\t$this->importFile($basePath . '/loader.php');\n\t\t$this->importFile($basePath . '/platform.php');\n\t\t$this->importFile($basePath . '/import.php');\n\n\t\t// If legacy is enabled import the legacy file.\n\t\tif ($legacy)\n\t\t{\n\t\t\t$this->importFile($basePath . '/import.legacy.php');\n\t\t}\n\n\t\t// Get the appropriate Joomla Platform packages to import.\n\t\t$packages = $this->_fetchPackagesToImport($el, $basePath);\n\n\t\t// If no packages were specified then assume we go for everything.\n\t\tif (empty($packages))\n\t\t{\n\t\t\t// Add everything in the main package folder.\n\t\t\t$this->importDirectoryRecursive($basePath . '/joomla', '/joomla');\n\n\t\t\t// Add everything in the legacy package folder if enabled.\n\t\t\tif ($legacy)\n\t\t\t{\n\t\t\t\t$this->importDirectoryRecursive($basePath . '/legacy', '/legacy');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add just the enumerated packages.\n\t\t\tforeach ($packages as $package)\n\t\t\t{\n\t\t\t\t// Add the package from the main package folder.\n\t\t\t\t$this->importDirectoryRecursive($basePath . '/joomla/' . $package, '/joomla/' . $package);\n\n\t\t\t\t// Add the package from the legacy package folder if enabled.\n\t\t\t\tif ($legacy)\n\t\t\t\t{\n\t\t\t\t\t$this->importDirectoryRecursive($basePath . '/legacy/' . $package, '/legacy/' . $package);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add just the files in the main package folder.\n\t\t\t$this->importDirectoryFiles($basePath . '/joomla', '/joomla');\n\n\t\t\t// Add just the files in the legacy package folder if enabled.\n\t\t\tif ($legacy)\n\t\t\t{\n\t\t\t\t$this->importDirectoryFiles($basePath . '/legacy', '/legacy');\n\t\t\t}\n\t\t}\n\n\t\t// Add the external library dependencies.\n\t\t$this->importDirectoryRecursive($basePath . '/phpmailer', '/phpmailer');\n\t\t$this->importDirectoryRecursive($basePath . '/phputf8', '/phputf8');\n\t\t$this->importDirectoryRecursive($basePath . '/simplepie', '/simplepie');\n\t}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_subscription_order_csv', 'WooCommerce Subscription Order (CSV)', __('Import <strong>Subcription Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'wf_subcription_orderImpExpCsv_Importer::subscription_order_importer');\n register_importer('woocommerce_subscription_csv_cron', 'WooCommerce Subscription Order Cron(CSV)', __('Cron Import <strong>subscription orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_SubscriptionOrderImpExpCsv_ImportCron::subcription_order_importer');\n }", "function import_front_end($import_type, $imports)\n{\n\n foreach ($imports as $key => $import) {\n switch ($import_type) {\n case 'css':\n drupal_add_css($import['path'], $import['options']);\n break;\n case 'js_inline':\n case 'js':\n drupal_add_js($import['path'], $import['options']);\n break;\n }\n }\n\n\n}", "public function import(string $filePath);", "private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }", "public function __construct(Importer $importer)\n\t{\n\t\t$this->importer = $importer;\n\n $this->checkRepository();\n\t}", "public function testOrgApacheSlingDistributionPackagingImplImporterLocalDistributio()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory';\n\n $crawler = $client->request('POST', $path);\n }", "public function autoDiscoverEntities()\n {\n $this->discoverEntitiesFromPath(dirname(__FILE__) . '/Entity');\n }", "function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n $addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n 'template' => 'templates',\n //'css' => 'templates/css',\n //'js' => 'js',\n ))->setParent($l);\n }", "public static function import_process() {}", "function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}", "function oo_import_multiple_posts_from_dir($import_id, $posts_dir) {\n $post_dirnames = oo_import_readdir($posts_dir);\n\n foreach ($post_dirnames as $post_dirname) {\n oo_import_post_from_dir(\n $import_id,\n $posts_dir . '/' . $post_dirname\n );\n }\n}", "public function testImport()\n {\n $doctrineEntityManager = $this->getMockDoctrineEntityManager();\n\n $elasticsearchManager = $this->getMockElasticsearchManager();\n\n $document = $this->getMockDocument();\n\n $sourceListener = new ImportSourceEventListener($doctrineEntityManager, 'Test', $elasticsearchManager, 'Test');\n $sourceEvent = new SourcePipelineEvent();\n $sourceListener->onSource($sourceEvent);\n $sources = $sourceEvent->getSources();\n foreach ($sources as $sourceItem) {\n foreach ($sourceItem as $item) {\n unset($item);\n }\n }\n $modifyListener = new TestModifyEventListener();\n $consumeListener = new ImportConsumeEventListener($elasticsearchManager);\n $finishListener = new ImportFinishEventListener($elasticsearchManager);\n $eventItem = new ItemPipelineEvent(new ImportItem(['Test'], $document));\n\n $dispatcher = $this->getMockDispatcher($finishListener, $consumeListener, $eventItem, $modifyListener);\n\n $dataImportService = new PipelineStarter();\n $pipelineFactory = new PipelineFactory();\n $pipelineFactory->setDispatcher($dispatcher);\n $pipelineFactory->setClassName('ONGR\\ConnectionsBundle\\Pipeline\\Pipeline');\n $dataImportService->setPipelineFactory($pipelineFactory);\n $dataImportService->startPipeline('import.', null);\n }", "protected function getDefaultImportExportFolder() {}", "protected function getDefaultImportExportFolder() {}", "public function import() {\n\n\t\t$output = array();\n\n\t\tif ($importUrl = Request::post('importUrl')) {\n\n\t\t\t// Resolve local URLs.\n\t\t\tif (strpos($importUrl, '/') === 0) {\n\n\t\t\t\tif (getenv('HTTPS') && getenv('HTTPS') !== 'off' && getenv('HTTP_HOST')) {\n\t\t\t\t\t$protocol = 'https://';\n\t\t\t\t} else {\n\t\t\t\t\t$protocol = 'http://';\n\t\t\t\t}\n\n\t\t\t\t$importUrl = $protocol . getenv('HTTP_HOST') . AM_BASE_URL . $importUrl;\n\t\t\t\tCore\\Debug::log($importUrl, 'Local URL');\n\n\t\t\t}\n\n\t\t\t$curl = curl_init(); \n \n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0); \n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t\tcurl_setopt($curl, CURLOPT_URL, $importUrl); \n\n\t\t\t$data = curl_exec($curl); \n\t\t\t\n\t\t\tif (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200 || curl_errno($curl)) {\n\t\t\t\n\t\t\t\t$output['error'] = Text::get('error_import');\n\t\t\t\n\t\t\t} else {\n\n\t\t\t\t$fileName = Core\\Str::sanitize(preg_replace('/\\?.*/', '', basename($importUrl)));\n\n\t\t\t\tif ($url = Request::post('url')) {\n\t\t\t\t\t$Page = $this->Automad->getPage($url);\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_PAGES . $Page->path . $fileName;\n\t\t\t\t} else {\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_SHARED . '/' . $fileName;\n\t\t\t\t}\n\n\t\t\t\tFileSystem::write($path, $data);\n\t\t\t\t$this->clearCache();\n\n\t\t\t} \n\n\t\t\tcurl_close($curl);\n\n\t\t\tif (!FileSystem::isAllowedFileType($path)) {\n\n\t\t\t\t$newPath = $path . FileSystem::getImageExtensionFromMimeType($path);\n\n\t\t\t\tif (FileSystem::isAllowedFileType($newPath)) {\n\t\t\t\t\tFileSystem::renameMedia($path, $newPath);\n\t\t\t\t} else {\n\t\t\t\t\tunlink($path);\n\t\t\t\t\t$output['error'] = Text::get('error_file_format');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$output['error'] = Text::get('error_no_url'); \n\n\t\t}\n\n\t\treturn $output;\n\n\t}", "public function import(string $path) {\n if(!file_exists($path)) {\n throw new FileNotFoundException($path . ' not found');\n }\n\n foreach($this->workers as $worker) {\n $files = $this->importStrategy->getFiles($path, $this->output);\n $worker->import($files, $this->output);\n }\n }", "function import( $folder, $element, $published, $params='' )\n\t{\n\t\tglobal $_MAMBOTS, $mainframe; //needed for backwards compatibility\n\n\t\t$path = JPATH_SITE . DS .'plugins'. DS . $folder . DS . $element . '.php';\n\t\tif (file_exists( $path )) {\n\t\t\trequire_once( $path );\n\t\t}\n\t}", "public function include_import_export(){\n\t\tglobal $import;\n\n\t\t// Load the Import class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-import.php' );\n\t\t$import = new VisualFormBuilder_Pro_Import();\n\t}", "function import($files) {\n\t\tforeach ($files as $file) {\n\t\t\t$dest_dir = $this->destDir($file);\n\t\t\t$src_path = JOURNALS_FILES . $file;\n\t\t\t$dest_path = DOWNLOAD_PATH . $this->destDir($file);\n\t\t\t$this->unzip($src_path, $dest_path);\n\t\t\t$res[] = $dest_path . \"/journals.xml\";\n\t\t}\n\t\treturn $res;\n\t}", "protected function afterImport($entities)\n {\n\n }", "public function newimportAction()\n {\n $importDir = ProgramConfig::getImportDir();\n \n //--- Get list of all .csv files that need to be imported\n $result = $this->_getImportFiles($importDir);\n if($result['status'] === false) {\n throw new Exception($result['data']);\n }\n $aryImportFiles = $result['data'];\n\n if(! is_writable($importDir)) {\n //Crap out and return to list if import directory not writeable\n $this->addError(\"ERROR: Import directory not writeable\");\n } elseif (count($aryImportFiles) === 0) {\n $this->addNotice(\"There are no new files to import\"); \n } else {\n\n\n //--- Loop through list and process each impoprt file\n $numFiles = count($aryImportFiles);\n for($i=0; $i<$numFiles; $i++) {\n $importFile = $aryImportFiles[$i];\n\n //Get md5 of this file.\n $result = $this->_getMd5($importFile);\n //@TODO Add code to handle md5 failure\n $this->md5 = $result['data'];\n\n //--- Check md5 against database, continue if file already imported\n $md5IsUnique = $this->getRepo('Fileops')->md5isUnique($this->md5);\n if($md5IsUnique !== true) {\n //md5 already exists. This file has already been processed\n $this->addNotice(\"File already imported: \" .$importFile);\n continue;\n }\n\n $this->_processImportFile($importFile);\n if(! is_writable(dirname($importFile))) {\n $this->addError(\"Directory not writeable: \" .dirname($importFile));\n }\n elseif(! is_writable($importFile)) {\n $this->addNotice(\"File not writeable: \" .$importFile);\n } else {\n $result = rename($importFile, $importFile.'.done');\n }\n }\n \n }\n\n //--- When done with imports, go back to list view\n $entities = $this->getRepo('Fileops')->getArrayList('');\n\n return $this->render('XarismaBundle:Fileops:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function setUp(): void\n {\n include __DIR__ .'/DCOM58Entity.php';\n }", "public function importAction()\n {\n $request = $this->getRequest();\n $masterForm = $this->createForm(new MasterImportType());\n $em = $this->getDoctrine()->getEntityManager();\n $images = array();\n $importForms = array();\n $finder = $this->getFinder();\n $catalogs = $this->get('berkman_catalog.catalog_manager')->getCatalogs();\n foreach ($catalogs as $catalog) {\n if ($catalog->hasCustomImporter()) {\n $importForms[$catalog->getId()] = $this->createForm(new MasterImportType())->createView();\n }\n }\n\n\n return $this->render('BerkmanSlideshowBundle:Slideshow:import.html.twig', array(\n 'master_form' => $masterForm->createView(),\n 'import_forms' => $importForms,\n 'catalogs' => $catalogs\n ));\n\n }", "public function Import()\n {\n if ($url = $this->GetPreference('remote_gallery', false)) {\n $result = MCFile::SyncFromUrl($url);\n }\n }", "public function install()\n {\n $logger = $this->container->get('logger');\n $userName = $this->container->get('zikula_users_module.current_user')->get('uname');\n \n // Check if upload directories exist and if needed create them\n try {\n $container = $this->container;\n $uploadHelper = new \\MU\\FilesModule\\Helper\\UploadHelper(\n $container->get('translator.default'),\n $container->get('filesystem'),\n $container->get('session'),\n $container->get('logger'),\n $container->get('zikula_users_module.current_user'),\n $container->get('zikula_extensions_module.api.variable'),\n $container->getParameter('datadir')\n );\n $uploadHelper->checkAndCreateAllUploadFolders();\n } catch (\\Exception $exception) {\n $this->addFlash('error', $exception->getMessage());\n $logger->error('{app}: User {user} could not create upload folders during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n // create all tables from according entity definitions\n try {\n $this->schemaTool->create($this->listEntityClasses());\n } catch (\\Exception $exception) {\n $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());\n $logger->error('{app}: Could not create the database tables during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n \n // set up all our vars with initial values\n $this->setVar('allowedExtensions', 'pdf,doc,docx,odt');\n $this->setVar('maxSize', '200k');\n $this->setVar('onlyParent', false);\n $this->setVar('specialCollectionMenue', false);\n $this->setVar('collectionEntriesPerPage', 10);\n $this->setVar('linkOwnCollectionsOnAccountPage', true);\n $this->setVar('fileEntriesPerPage', 10);\n $this->setVar('linkOwnFilesOnAccountPage', true);\n $this->setVar('showOnlyOwnEntries', false);\n $this->setVar('moderationGroupForCollections', 2);\n $this->setVar('moderationGroupForFiles', 2);\n $this->setVar('allowModerationSpecificCreatorForCollection', false);\n $this->setVar('allowModerationSpecificCreationDateForCollection', false);\n $this->setVar('allowModerationSpecificCreatorForFile', false);\n $this->setVar('allowModerationSpecificCreationDateForFile', false);\n $this->setVar('enabledFinderTypes', 'collection###file');\n \n // add default entry for category registry (property named Main)\n $categoryHelper = new \\MU\\FilesModule\\Helper\\CategoryHelper(\n $this->container->get('translator.default'),\n $this->container->get('request_stack'),\n $logger,\n $this->container->get('zikula_users_module.current_user'),\n $this->container->get('zikula_categories_module.category_registry_repository'),\n $this->container->get('zikula_categories_module.api.category_permission')\n );\n $categoryGlobal = $this->container->get('zikula_categories_module.category_repository')->findOneBy(['name' => 'Global']);\n if ($categoryGlobal) {\n $categoryRegistryIdsPerEntity = [];\n $entityManager = $this->container->get('doctrine.orm.default_entity_manager');\n \n $registry = new CategoryRegistryEntity();\n $registry->setModname('MUFilesModule');\n $registry->setEntityname('CollectionEntity');\n $registry->setProperty($categoryHelper->getPrimaryProperty('Collection'));\n $registry->setCategory($categoryGlobal);\n \n try {\n $entityManager->persist($registry);\n $entityManager->flush();\n } catch (\\Exception $exception) {\n $this->addFlash('warning', $this->__f('Error! Could not create a category registry for the %entity% entity. If you want to use categorisation, register at least one registry in the Categories administration.', ['%entity%' => 'collection']));\n $logger->error('{app}: User {user} could not create a category registry for {entities} during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'entities' => 'collections', 'errorMessage' => $exception->getMessage()]);\n }\n $categoryRegistryIdsPerEntity['collection'] = $registry->getId();\n }\n \n // initialisation successful\n return true;\n }", "public function getImportPaths()\n {\n return $this->importDirs;\n }", "public function createBaseFilesAndFolders()\n {\n $this\n ->createRootFolder()\n ->createRelsFolderAndFile()\n ->createDocPropsFolderAndFiles()\n ->createXlFolderAndSubFolders();\n }", "function oo_import_post_from_dir($import_id, $post_dir) {\n //\n // Load post.json as an associative array,\n // so that it is automatically compatible\n // with wp_insert_post\n //\n // https://www.php.net/manual/en/function.json-decode.php\n // https://developer.wordpress.org/reference/functions/wp_insert_post/\n //\n $post_data = json_decode(file_get_contents($post_dir . '/post.json'), true);\n $post_data['post_content'] = file_get_contents($post_dir . '/content.html');\n\n //\n // _resources field is a special one\n //\n $resources = array_map(function ($resource) use ($post_dir) {\n $resource['absolute_path'] = $post_dir . '/' . $resource['relative_path'];\n $resource['url_in_content'] = $resource['relative_path'];\n\n return $resource;\n }, $post_data['_resources']);\n\n $terms = array_map(function ($term) {\n // TODO\n }, $post_data['_terms'] ? $post_data['_terms'] : array());\n\n oo_import_post($import_id, $post_data, array(\n 'resources' => $resources,\n ));\n}", "private function includeExternalFiles($dirName) {\n if(isset($this->routesCollection[\"imports\"])) {\n foreach($this->routesCollection[\"imports\"] as $resource) {\n if(!isset($resource['resource'])) {\n throw new \\Exception(\"Imports is a reserved keyword. It can only be used to include files via resource keyword\");\n }\n $fileToInclude = $dirName.'/'.$resource['resource'];\n if (!$this->validateRouteFileSyntax($fileToInclude)) {\n $this->logger->addError('The included router '.$fileToInclude.' isn\\'t correct');\n throw new \\Exception('The router YAML file '.$fileToInclude.' isn\\'t correct');\n } else {\n $newRoutes = Yaml::parse(file_get_contents($fileToInclude));\n $this->routesCollection = array_merge($this->routesCollection, $newRoutes);\n }\n }\n unset($this->routesCollection[\"imports\"]);\n }\n }", "function dk_speakup_loadimporter(){\n\t\tif(function_exists('dk_speakup_meta_links')){\n\t\t\tload_plugin_textdomain( 'speakupimport', false, 'speakup-email-petitions-importer/languages' );\n\t\t\tinclude_once( dirname( __FILE__ ) . '/class.importer.php' );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( 'dk_Speakup_Import', 'scripts'));\n\t\t\t\n\t\t\tadd_action('admin_menu', array( 'dk_Speakup_Import', 'menu'),1000);\n\t\t}\n\t}", "public function getUploadDir()\n {\n return 'import/fichier/licencies';\n }", "public function importer($type) {\n $mappings = array(\n new Name('first_name'),\n new Name('last_name'),\n );\n if ($type == 'campaignion_action_taken') {\n $mappings = array_merge($mappings, array(\n new Field('field_gender', 'gender'),\n new Field('field_salutation', 'salutation'),\n new Field('field_title', 'title'),\n new Date('field_date_of_birth', 'date_of_birth'),\n new Address('field_address', array(\n 'thoroughfare' => 'street_address',\n 'premise' => 'street_address_2',\n 'postal_code' => ['zip_code', 'postcode'],\n 'locality' => 'city',\n 'administrative_area' => 'state',\n 'country' => 'country',\n )),\n new Phone('field_phone_number', 'phone_number'),\n new Phone('field_phone_number', 'mobile_number'),\n new EmailBulk('redhen_contact_email', 'email', 'email_newsletter'),\n new BooleanOptIn('field_opt_in_phone', 'phone_opt_in'),\n new BooleanOptIn('field_opt_in_post', 'post_opt_in'),\n new Field('field_preferred_language', 'language'),\n ));\n }\n return new ImporterBase($mappings);\n }", "public function import()\n {\n $itemTypeId = $this->_insertItemType();\n \n // Insert the Omeka collection.\n $collectionOmekaId = $this->_insertCollection();\n \n // Insert an Omeka item for every Sept11 object.\n foreach ($this->_fetchCollectionObjectsSept11() as $object) {\n \n $metadata = array('item_type_id' => $itemTypeId);\n \n // Set the story.\n $xml = new SimpleXMLElement($object['OBJECT_ABSOLUTE_PATH'], null, true);\n $elementTexts = array(\n ElementSet::ITEM_TYPE_NAME => array(\n 'SEIU Story: Story' => array(array('text' => $xml->STORY, 'html' => false)), \n 'SEIU Story: Local Union' => array(array('text' => $xml->LOCAL_UNION, 'html' => false)), \n )\n );\n \n $itemId = $this->_insertItem($collectionOmekaId, $object, $metadata, $elementTexts);\n }\n }", "public function install()\r\n {\r\n //----------------------------------------\r\n // EXP_MODULES\r\n //----------------------------------------\r\n $module = ee('Model')->make('Module');\r\n $module->module_name = ucfirst($this->module_name);\r\n $module->module_version = $this->version;\r\n $module->has_cp_backend = 'y';\r\n $module->has_publish_fields = 'n';\r\n $module->save();\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER\r\n //----------------------------------------\r\n $tagger = array(\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'entry_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'edit_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'hits' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'total_entries' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('tag_id', true);\r\n ee()->dbforge->add_key('tag_name');\r\n ee()->dbforge->create_table('tagger', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_LINKS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'entry_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'channel_id' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n 'field_id' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 0),\r\n// 'item_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'type' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 1),\r\n 'tag_order' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->add_key('entry_id');\r\n ee()->dbforge->create_table('tagger_links', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'group_title' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_desc' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'parent_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n '`order`' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('group_id', true);\r\n ee()->dbforge->create_table('tagger_groups', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS_ENTRIES\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n '`order`' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('group_id');\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->create_table('tagger_groups_entries', true);\r\n\r\n //----------------------------------------\r\n // EXP_ACTIONS\r\n //----------------------------------------\r\n $action = ee('Model')->make('Action');\r\n $action->class = ucfirst($this->module_name);\r\n $action->method = $this->module_name . '_router';\r\n $action->csrf_exempt = 0;\r\n $action->save();\r\n\r\n //----------------------------------------\r\n // EXP_MODULES\r\n // The settings column, Ellislab should have put this one in long ago.\r\n // No need for a seperate preferences table for each module.\r\n //----------------------------------------\r\n if (ee()->db->field_exists('settings', 'modules') == false) {\r\n ee()->dbforge->add_column('modules', array('settings' => array('type' => 'TEXT') ) );\r\n }\r\n\r\n return true;\r\n }", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function testImagesDirBase(): void\n {\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n $this->expectExceptionMessage('Images file directory is outside required directory');\n\n $this->_model->setData(\n Import::FIELD_NAME_VALIDATION_STRATEGY,\n ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS\n );\n $this->_model->setEntity('catalog_product');\n $this->_model->setData(Import::FIELD_NAME_IMG_FILE_DIR, '../_files');\n $this->_model->importSource();\n }", "function import($file , $load_time = 0, $on_init = false)\r\n\t{\r\n\t\treturn parent::import($file, $load_time);\r\n\t}", "public function PathAndUri(){\n\n $evald_path = $this->getPath();\n\n if( $evald_path ){\n\n $import_dirs = array();\n\n if( Less_Environment::isPathRelative($evald_path) ){\n //if the path is relative, the file should be in the current directory\n $import_dirs[ $this->currentFileInfo['currentDirectory'] ] = $this->currentFileInfo['uri_root'];\n\n }else{\n //otherwise, the file should be relative to the server root\n $import_dirs[ $this->currentFileInfo['entryPath'] ] = $this->currentFileInfo['entryUri'];\n\n //if the user supplied entryPath isn't the actual root\n $import_dirs[ $_SERVER['DOCUMENT_ROOT'] ] = '';\n\n }\n\n // always look in user supplied import directories\n $import_dirs = array_merge( $import_dirs, Less_Parser::$options['import_dirs'] );\n\n\n foreach( $import_dirs as $rootpath => $rooturi){\n if( is_callable($rooturi) ){\n list($path, $uri) = call_user_func($rooturi, $evald_path);\n if( is_string($path) ){\n $full_path = $path;\n return array( $full_path, $uri );\n }\n }else{\n $path = rtrim($rootpath,'/\\\\').'/'.ltrim($evald_path,'/\\\\');\n\n if( file_exists($path) ){\n $full_path = Less_Environment::normalizePath($path);\n $uri = Less_Environment::normalizePath(dirname($rooturi.$evald_path));\n return array( $full_path, $uri );\n }\n }\n }\n }\n }", "function importFolder(&$a, $echo = true)\n\t{\n\t\tinclude FLGALLERY_GLOBALS;\n\t\tglobal $startText;\n\t\t$startText = 'Import';\n\n\t\t$a['jsURL'] = $plugin->jsURL;\n\t\t$a['uploadsPath'] = preg_replace('#^' . preg_quote(FLGALLERY_SITE_URL, '#') . '/#', '', $plugin->uploadsURL);\n\t\t$a['href'] = $admpage->href;\n\n\t\t$out = $tpl->parse('media/add-directory', $a);\n\n\t\tif ($echo) {\n\t\t\techo $out;\n\t\t}\n\n\t\treturn $out;\n\t}", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "public function import($projectId, Google_Service_Datastore_GoogleDatastoreAdminV1ImportEntitiesRequest $postBody, $optParams = array())\n {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('import', array($params), \"Google_Service_Datastore_GoogleLongrunningOperation\");\n }", "public function addIncludeDirs($dirs);", "protected function setUp()\n {\n $this->stitcher = new SchemaStitcher();\n\n if (! is_dir(__DIR__.'/schema')) {\n mkdir(__DIR__.'/schema');\n }\n\n file_put_contents(__DIR__.'/foo.graphql', '\n #import ./schema/bar.graphql\n type Foo {\n foo: String!\n }');\n\n file_put_contents(__DIR__.'/schema/bar.graphql', '\n #import ./baz.graphql\n type Bar {\n bar: String!\n }');\n\n file_put_contents(__DIR__.'/schema/baz.graphql', '\n type Baz {\n baz: String!\n }');\n }", "public static function IncludeEntity()\r\n\t{\t\r\n\t\t$entites = array(\"EeAppCategory\", \"EeAppApp\", \"EeAppUser\");\r\n\t\t\r\n\t\tforeach($entites as $entite)\r\n\t\t{\r\n include(\"Entity/\".$entite.\".php\");\r\n\t\t}\r\n\t}", "public function load(): void\n {\n if ($this->paths->isEmpty()) {\n return;\n }\n\n foreach ((new Finder)->in($this->paths->toArray())->files() as $file) {\n $this->loadAction(\n $this->getClassnameFromPathname($file->getPathname())\n );\n }\n }", "public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }", "public function importAction()\n {\n \n $directory = 'data/officialstations/es/json/latest';\n $country = 'ES';\n \n $request = $this->getRequest();\n $filename = $request->getParam('filename', false);\n $verbose = $request->getParam('verbose', false) || $request->getParam('v', false);\n\n $fueltypes = array(\n 'BIE.json'=>9,\n 'BIO.json'=>7,\n 'G95.json'=>8,\n 'G98.json'=>2,\n 'GLP.json'=>10,\n 'GNC.json'=>11,\n 'GOA.json'=>3,\n 'GOB.json'=>5,\n 'GOC.json'=>6,\n 'GPR.json'=>1,\n 'NGO.json'=>4\n );\n \n // purge cache for every configuration\n if ($filename)\n {\n// $result = $this->priceMapper->truncate();\n $this->priceMapper->countChanges = 0;\n $this->priceMapper->cycleFailsFilename();\n \n // echo $iterator->getFilename() . \"\\n\";\n echo $filename . \"\\n\";\n if($filename == 'All')\n {\n foreach($fueltypes as $file => $id)\n {\n echo $file.\"\\n\";\n $content = file_get_contents($directory.'/'.$file);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n// $value['created'] = '2014-06-14';\n $result = $this->stationMapper->save($value); \n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$file]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n }\n else \n {\n // $content = file_get_contents($directory.'/'.$iterator->getFilename());\n $content = file_get_contents($directory.'/'.$filename);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n $result = $this->stationMapper->save($value);\n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$filename]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n echo $this->priceMapper->countChanges;\n }\n\n $this->output('Collecting all assets...', $verbose);\n $this->output(sprintf('Importing finished...', $verbose));\n }", "static public function Import($path) {\r\n \t// fix path seperator\r\n \tif (_ !== '/') $path = str_replace('/',_,$path);\r\n \t\r\n \tstatic $imports = array();\r\n\t\tif (in_array($path, $imports)) return;\r\n\t\t\r\n $filename = TII_PATH_FRAMEWORK._.$path;\r\n if (file_exists($filename)){\r\n include_once $filename;\r\n\t\t\t$imports[] = $path;\r\n\t\t}\r\n }", "public function export() {\n $folder = $this->config->get('oxygen.mod-import-export.path');\n if(!file_exists($folder)) {\n mkdir($folder);\n }\n $path = $folder . $this->environment;\n if(!file_exists($path)) {\n mkdir($path);\n }\n\n $this->exportStrategy->create($path);\n\n foreach($this->workers as $worker) {\n $files = $worker->export($this->output);\n foreach($files as $localPath => $path) {\n $this->output->writeln('Adding file: ' . $path);\n $this->exportStrategy->addFile($path, $localPath);\n }\n }\n\n $this->exportStrategy->commit();\n\n foreach($this->workers as $worker) {\n $worker->postExport($this->output);\n }\n }", "public function importAction()\n {\n\n $this->_initAction();\n $this->getLayout()->getBlock('head')->setTitle($this->__('Import / Rewrite Rules / Magento Admin'));\n $this->renderLayout();\n\n }", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "public function createImporter($importerClassName) {\n\t $importer = new $importerClassName; /* @var $importer Tx_Yag_Domain_Import_AbstractImporter */\n\t $importer->injectConfigurationBuilder($this->configurationBuilder);\n\t $importer->injectImageProcessor(new Tx_Yag_Domain_ImageProcessing_Processor($this->configurationBuilder->buildImageProcessorConfiguration()));\n\t $importer->injectItemRepository(t3lib_div::makeInstance('Tx_Yag_Domain_Repository_ItemRepository'));\n\t $importer->injectItemMetaRepository(t3lib_div::makeInstance('Tx_Yag_Domain_Repository_ItemMetaRepository'));\n\t $importer->injectPersistenceManager(t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager'));\n\t return $importer;\n\t}", "public function testImport() {\n return true;\n }", "protected function register_files()\r\n\t\t{\r\n\t\t\t// register paths\r\n\t\t\t$this->paths[ self::ROOT_INDEX ] = $this->local;\r\n\t\t\t$this->register_ini( $this->paths[ self::ROOT_INDEX ] . self::REGISTRY_FILE );\r\n\t\t\t\t\r\n\t\t\tforeach( $this->path_follow as $index => $p )\r\n\t\t\t{\r\n\t\t\t\t// put together local path names\r\n\t\t\t\t$this->paths[ $index ] = $this->local . $p . DIRECTORY_SEPARATOR;\r\n\t\t\t\t\r\n\t\t\t\t// look for registries to assign id's to\r\n\t\t\t\t$this->register_ini( $this->paths[ $index ] . self::REGISTRY_FILE, $p, $p, $index );\r\n\t\t\t}\r\n\t\t}", "function provide_import() {\n return true;\n }", "public function onMigratePreImport(MigrateImportEvent $event) {\n\n $this->searchStatus = FALSE;\n $this->searchSettings = NULL;\n if ($this->moduleHandler->moduleExists('search')) {\n \\Drupal::service('module_installer')->uninstall(['search']);\n $config = $this->entityTypeManager->getStorage('search.settings')->load();\n $this->searchSettings = $config->getOption('search.settings');\n unset($module_data['search']);\n }\n $this->trackerStatus = FALSE;\n $this->trackerSettings = NULL;\n if ($this->moduleHandler->moduleExists('tracker')) {\n $this->trackerStatus = TRUE;\n $config = $this->entityTypeManager->getStorage('tracker.settings')->load();\n $this->trackerSettings = $config->getOption('tracker.settings');\n \\Drupal::service('module_installer')->uninstall(['search']);\n }\n $this->pathautoStatus = FALSE;\n $this->pathautoSettings = NULL;\n if ($this->moduleHandler->moduleExists('pathauto')) {\n $this->pathautoStatus = TRUE;\n $config = $this->entityTypeManager->getStorage('pathauto.settings')->load();\n $this->pathautoSettings = $config->getOption('pathauto.settings');\n \\Drupal::service('module_installer')->uninstall(['search']);\n }\n\n }", "static public function import($dir)\n\t{\n\t\t$dh = opendir($dir);\n\t\twhile (false !== ($file = readdir($dh)))\n\t\t{\n\t\t\t$tmp = explode('.', $file);\n\t\t\tif (end($tmp) == 'php')\n\t\t\t{\n\t\t\t\trequire_once $dir . '/' . $file;\n\t\t\t}\n\t\t}\n\t\treturn closedir($dh); \n\t}", "public function addAssets() {}", "public function addAssets() {}", "function initializeImportLocalFolderDialog() {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');\n $data = array();\n $hidden = array(\n 'cmd' => $this->params['cmd'],\n 'confirm' => 1,\n 'folder' => $this->params['folder'],\n );\n\n $fields = array(\n 'target_folder_id' => array('Target folder', 'isNum', TRUE, 'combo',\n $this->getFolderComboArray($this->lngSelect->currentLanguageId)),\n );\n\n $this->dialog = new base_dialog($this, $this->paramName, $fields, $data, $hidden);\n $this->dialog->dialogTitle = $this->_gt('Import folder');\n $this->dialog->buttonTitle = 'Import';\n $this->dialog->inputFieldSize = 'large';\n }", "private function mustacheAddFilesystemLoaders(Mustache_Engine &$engine): void\n {\n // Get and reverse path entries to have the newest first.\n $pathEntries = $this->pathEntries;\n rsort($pathEntries);\n\n // Add filesystem loaders.\n $cascadingLoader = new Mustache_Loader_CascadingLoader();\n foreach ($pathEntries as $pathEntry) {\n $filesystemLoader = new Mustache_Loader_FilesystemLoader($pathEntry->getPath(), [\n 'extension' => $pathEntry->getExtension()\n ]);\n $cascadingLoader->addLoader($filesystemLoader);\n }\n $engine->setLoader($cascadingLoader);\n }" ]
[ "0.6770029", "0.5787068", "0.5758207", "0.5675538", "0.5665603", "0.5594215", "0.55703926", "0.5562516", "0.55560493", "0.5548485", "0.5514167", "0.5483573", "0.54782194", "0.54143226", "0.5408595", "0.5360179", "0.53329307", "0.5274535", "0.5245418", "0.5241675", "0.5233548", "0.5225544", "0.5220558", "0.5218365", "0.52150065", "0.51989573", "0.51867706", "0.5097394", "0.50877", "0.5058176", "0.505293", "0.5052639", "0.5041992", "0.5032216", "0.5026512", "0.5021109", "0.5018622", "0.5017701", "0.4996984", "0.49608126", "0.49296188", "0.4923763", "0.49180776", "0.49141404", "0.49125803", "0.4903917", "0.4901851", "0.48806873", "0.48798057", "0.4878897", "0.48523077", "0.48523077", "0.48476875", "0.4843937", "0.4837832", "0.48353186", "0.48350206", "0.48034173", "0.48019782", "0.47982043", "0.4769624", "0.4767667", "0.47495157", "0.47483128", "0.47451538", "0.47368422", "0.47304517", "0.47245416", "0.47210303", "0.47209156", "0.4720592", "0.47167638", "0.47133327", "0.47106636", "0.47010818", "0.4683779", "0.46826115", "0.4680279", "0.46754858", "0.46561813", "0.4656134", "0.4650457", "0.46466583", "0.46446392", "0.46345726", "0.46300557", "0.46298814", "0.46272078", "0.46198076", "0.4619753", "0.46168804", "0.46121743", "0.46055698", "0.46031454", "0.45948225", "0.45947266", "0.4589761", "0.4589761", "0.45865515", "0.45570832" ]
0.62480545
1
Import data for all registered importers.
public function import() { // Reorder importers usort($this->entityImporterMappings, function ($a, $b) { return $a[ORDER] <=> $b[ORDER]; }); // Import each entity type in turn foreach ($this->entityImporterMappings as $entityImporterMapping) { $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]); foreach ($files as $filename => $slug) { $fileContents = file_get_contents($filename); $entityData = json_decode($fileContents, true); $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_order_csv', 'WooCommerce Order (CSV/XML)', __('Import <strong>Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrderImpExpCsv_Importer::order_importer');\n register_importer('order_csv_cron', 'WooCommerce Orders (CSV/XML)', __('Cron Import <strong>order</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_OrdImpExpCsv_ImportCron::order_importer');\n }", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('coupon_csv', 'WooCommerce Coupons (CSV)', __('Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_Importer::coupon_importer');\n register_importer('coupon_csv_cron', 'WooCommerce Coupons (CSV)', __('Cron Import <strong>coupon</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_CpnImpExpCsv_ImportCron::coupon_importer');\n wp_enqueue_script('woocommerce-order-xml-importer', plugins_url(basename(plugin_dir_path(WF_OrderImpExpXML_FILE)) . '/js/hf_order_admin.js', basename(__FILE__)), array(), '1.0.0', true);\n }", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_import_order_xml', 'WooCommerce Order XML', __('Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'OrderImpExpXML_Importer::order_importer');\n register_importer('woocommerce_wf_import_order_xml_cron', 'WooCommerce Order XML Cron', __('Cron Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'WF_OrderImpExpXML_ImportCron::orderxml_importer');\n }", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_subscription_order_csv', 'WooCommerce Subscription Order (CSV)', __('Import <strong>Subcription Orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'wf_subcription_orderImpExpCsv_Importer::subscription_order_importer');\n register_importer('woocommerce_subscription_csv_cron', 'WooCommerce Subscription Order Cron(CSV)', __('Cron Import <strong>subscription orders</strong> to your store via a csv file.', 'wf_order_import_export'), 'WF_SubscriptionOrderImpExpCsv_ImportCron::subcription_order_importer');\n }", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "function get_importers()\n {\n }", "private function loadData(): void\n {\n $modules = BackendExtensionsModel::getModules();\n\n // split the modules in 2 separate data grid sources\n foreach ($modules as $module) {\n if ($module['installed']) {\n $this->installedModules[] = $module;\n } else {\n $this->installableModules[] = $module;\n }\n }\n }", "function register_importer() {\n\t\tglobal $wp_importers;\n\n\t\tif( ! isset( $wp_importers['wgobd_the_events_calendar'] ) ) {\n\t\t\t$wp_importers['wgobd_the_events_calendar'] = array(\n\t\t\t\t__( 'The Events Calendar → All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\t__( 'Imports events created using The Events Calendar plugin into the All-in-One Event Calendar', wgobd_PLUGIN_NAME ),\n\t\t\t\tarray( &$this, 'import_the_events_calendar' )\n\t\t\t);\n\t\t}\n\t}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function _importData()\n {\n Mage::dispatchEvent($this->_eventPrefix . '_before_import', array(\n 'data_source_model' => $this->_dataSourceModel,\n 'entity_model' => $this\n ));\n $result = parent::_importData();\n Mage::dispatchEvent($this->_eventPrefix . '_after_import', array(\n 'entities' => $this->_newCustomers,\n 'entity_model' => $this\n ));\n return $result;\n }", "public function import()\n {\n \n }", "protected function importDatabaseData() {}", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "protected function initializeImport() {}", "private function registerImporter()\n {\n $this->singleton(Contracts\\ImporterManager::class, ImporterManager::class);\n $this->singleton('arcanedev.excel.importer', Contracts\\ImporterManager::class);\n }", "public function import(array $data): void;", "public function import();", "public static function ImportAll()\n {\n $logger = self::getLogger();\n\n $aErrors = array();\n // get list of import handler\n /** @var $oCsv2SqlList TdbPkgCsv2sqlList */\n $oCsv2SqlList = TdbPkgCsv2sqlList::GetList();\n $oCsv2SqlList->GoToStart();\n while ($oListItem = $oCsv2SqlList->Next()) {\n $logger->info('TPkgCsv2SqlManager: Import '.$oListItem->fieldName);\n\n $aItemErrors = $oListItem->Import();\n $aErrors = TPkgCsv2Sql::ArrayConcat($aErrors, $aItemErrors);\n }\n\n return $aErrors;\n }", "public function prepareImport();", "public function import(): void\n\t{\n\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\tif (\n\t\t\t!$this->lastScan['start_date']\n\t\t\t|| (0 === $this->lastScan['id'] && $this->lastScan['start_date'] === $this->lastScan['end_date'])\n\t\t) {\n\t\t\t$this->config->setScan('import' . $this->name);\n\t\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('Start import ' . $this->name, [\n\t\t\t\t'lastScan' => $this->lastScan,\n\t\t\t]);\n\t\t}\n\t\t$i = 0;\n\t\ttry {\n\t\t\t$page = $this->lastScan['page'] ?? 1;\n\t\t\t$load = true;\n\t\t\t$finish = false;\n\t\t\t$limit = $this->config->get(self::LIMIT_NAME);\n\t\t\twhile ($load) {\n\t\t\t\tif ($rows = $this->getFromApi('Customer/GetAll?&page=' . $page . '&' . $this->getFromApiCond())) {\n\t\t\t\t\tforeach ($rows as $id => $row) {\n\t\t\t\t\t\tif ('JEDNORAZOWY' === $row['knt_Akronim']) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->importItem($row);\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'id', $id);\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\t\t\t\t\t++$page;\n\t\t\t\t\tif (\\is_callable($this->controller->bathCallback)) {\n\t\t\t\t\t\t$load = \\call_user_func($this->controller->bathCallback, 'import' . $this->name);\n\t\t\t\t\t}\n\t\t\t\t\tif ($limit !== \\count($rows)) {\n\t\t\t\t\t\t$finish = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$finish = true;\n\t\t\t\t}\n\t\t\t\tif ($finish || !$load) {\n\t\t\t\t\t$load = false;\n\t\t\t\t\tif ($finish) {\n\t\t\t\t\t\t$this->config->setEndScan('import' . $this->name, $this->lastScan['start_date']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'page', $page);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->logError('import ' . $this->name, null, $ex);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('End import ' . $this->name, ['imported' => $i]);\n\t\t}\n\t}", "private function loadSeedersAndCall(): void\n {\n $shipFiles = $this->getSeedersFromShip();\n $containersFiles = $this->getSeedersFromContainers();\n\n $files = array_merge($shipFiles, $containersFiles);\n\n foreach ($files as $file){\n $this->call($file);\n }\n }", "protected function import(): void {\n\t\t\t$sections = $this->load_and_decode_file();\n\n\t\t\tif ( empty( $sections ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $sections as $section ) {\n\t\t\t\tLearnDash_Settings_Section::set_section_settings_all(\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$section['fields']\n\t\t\t\t);\n\n\t\t\t\t$this->processed_items_count++;\n\t\t\t\t$this->imported_items_count++;\n\t\t\t}\n\t\t}", "public function importProvider() {\n\t\treturn array(\n\t\t\t//set #0\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(00),\n\t\t\t\t\t'Languages' => array(11),\n\t\t\t\t\t'Messages' => array(22),\n\t\t\t\t\t'References' => array(33),\n\t\t\t\t\t'Translations' => array(44)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public static function ProcessAll()\n {\n $aImportErrors = array();\n $aAllErr = array();\n\n $aData = array();\n $aData['oImportName'] = 'CSV-2-SQL Datenimport:';\n $aData['successMessage'] = '';\n\n $logger = self::getLogger();\n\n $logger->info('TPkgCsv2SqlManager: ProcessAll Start');\n $aValidationErrors = self::ValidateAll();\n $logger->info('TPkgCsv2SqlManager: ValidateAll end');\n if (0 == count($aValidationErrors)) {\n // all good, import\n $aImportErrors = self::ImportAll();\n $aData['successMessage'] = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_csv2sql.msg.import_completed'));\n }\n $logger->info('TPkgCsv2SqlManager: ImportAll end');\n\n $aAllErr = TPkgCsv2Sql::ArrayConcat($aAllErr, $aValidationErrors);\n $aAllErr = TPkgCsv2Sql::ArrayConcat($aAllErr, $aImportErrors);\n if (count($aAllErr) > 0) {\n //send all errors by email\n self::SendErrorNotification($aAllErr);\n }\n $logger->info('TPkgCsv2SqlManager: SendErrorNotification end');\n\n //View vars\n $aData['aValidationErrors'] = (array) $aValidationErrors;\n $aData['aImportErrors'] = (array) $aImportErrors;\n\n return $aData;\n }", "public function import(): void;", "public function importAll($listID, $importStep, $importID, $importType, $importData, $importFileName, $fieldTerminator, $fieldEncloser, $importMySQLHost, $importMySQLPort, $importMySQLUsername, $importMySQLPassword, $importMySQLDatabase, $importMySQLQuery, $addToGlobalSuppressionList, $addToSuppressionList, $mappedFields)\n\t{\n\n\t\t$command = \"Command=Subscribers.Import\";\n\t\t$listID = \"ListID=\".$listID;\n\t\t$importStep = \"ImportStep=\".$importStep;\n\t\t$importID = \"ImportID=\".$importID;\n\t\t$importType = \"ImportType=\".$importType;\n\t\t$importData = \"ImportData=\".$importData;\n\t\t$importFileName = \"ImportFileName=\".$importFileName;\n\t\t$fieldTerminator = \"FieldTerminator=\".$fieldTerminator;\n\t\t$fieldEncloser = \"FieldEncloser=\".$fieldEncloser;\n\t\t$importMySQLHost = \"ImportMySQLHost=\".$importMySQLHost;\n\t\t$importMySQLPort = \"ImportMySQLPort=\".$importMySQLPort;\n\t\t$importMySQLUsername = \"ImportMySQLUsername=\".$importMySQLUsername;\n\t\t$importMySQLPassword = \"ImportMySQLPassword=\".$importMySQLPassword;\n\t\t$importMySQLDatabase = \"ImportMySQLDatabase=\".$importMySQLDatabase;\n\t\t$importMySQLQuery = \"ImportMySQLQuery=\".$importMySQLQuery;\n\t\t$addToGlobalSuppressionList = \"AddToGlobalSuppressionList=\".$addToGlobalSuppressionList;\n\t\t$addToSuppressionList = \"AddToSuppressionList=\".$addToSuppressionList;\n\t\t$mappedFields = \"MappedFields=\".$mappedFields;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$listID\n\t\t\t\t\t\t.'&'.$importStep\n\t\t\t\t\t\t.'&'.$importID\n\t\t\t\t\t\t.'&'.$importType\n\t\t\t\t\t\t.'&'.$importData\n\t\t\t\t\t\t.'&'.$importFileName\n\t\t\t\t\t\t.'&'.$fieldTerminator\n\t\t\t\t\t\t.'&'.$fieldEncloser\n\t\t\t\t\t\t.'&'.$importMySQLHost\n\t\t\t\t\t\t.'&'.$importMySQLPort\n\t\t\t\t\t\t.'&'.$importMySQLUsername\n\t\t\t\t\t\t.'&'.$importMySQLPassword\n\t\t\t\t\t\t.'&'.$importMySQLDatabase\n\t\t\t\t\t\t.'&'.$importMySQLQuery\n\t\t\t\t\t\t.'&'.$addToGlobalSuppressionList\n\t\t\t\t\t\t.'&'.$addToSuppressionList\n\t\t\t\t\t\t.'&'.$mappedFields\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "function _processImport($data){\n\t\t$this->Session->write('Import.total', count($data));\n\t\t$this->Session->write('Import.progress', 0);\n\t\t$status = array();\n\t\t\n\t\t//Prep model\n\t\t$this->Project->Member->beforeImport();\n\t\t\n\t\t//Import.\n\t\tforeach($data as $i => $member){\t\t\t\n\t\t\t//import\n\t\t\t$status[$i]['status'] = $this->Project->Member->import($member);\n\t\t\t$status[$i]['error'] = $this->Project->Member->User->validationErrors;\n\t\t\t$this->Session->write('Import.progress', $i + 1);\n\t\t}\n\t\t//clean up\n\t\t$this->Project->Member->afterImport();\n\t\t\n\t\treturn $status;\n\t}", "public function metaImport($data);", "public function importFrom(array $data);", "function imports($files = array(), &$data = array())\r\n\t{\r\n\t\t\r\n\t}", "public function run()\n\t{\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tfor ($i=0;$i<20;$i++) {\n\t\t\t// create import\n\t\t\t$import = new Import;\n\t\t\t$import->countrycode = 'DE';\n\t\t\t$import->salutation = $faker->randomElement(['Herr', 'Frau', 'Firma']);\n\t\t\t$import->firstname = $faker->firstName;\n\t\t\t$import->lastname = $faker->lastName;\n\t\t\t$import->lastWorkshopVisit = $faker->date();\n\t\t\t$import->export = true;\n\n\t\t\t$import->save();\n\t\t}\n\t}", "protected function processUpdates()\n {\n $this->importStaticData();\n }", "public function getImports();", "public function import()\n {\n $this->initializeApplication();\n\n if ($this->alwaysRefreshIndex) {\n $this->deleteIndices();\n }\n\n if (!$this->indicesExist()) {\n $import = $this->getImport();\n $import->doImport($this->indexPrefix, null, $this->logger);\n }\n\n $this->destroyApplication();\n }", "public static function import_process() {}", "protected function beforeImport($entities)\n {\n\n }", "public function loadAll()\n {\n $this->setAll(array());\n $d = dir($this->getPath());\n $this->load($d);\n $d->close();\n }", "abstract protected function doImport(Finder $finder, InputInterface $input, OutputInterface $output);", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "public function wp_parser_starting_import() {\n\t\t$importer = new Importer;\n\n\t\tif ( ! $this->p2p_tables_exist() ) {\n\t\t\t\\P2P_Storage::init();\n\t\t\t\\P2P_Storage::install();\n\t\t}\n\n\t\t$this->post_types = array(\n\t\t\t'hook' => $importer->post_type_hook,\n\t\t\t'method' => $importer->post_type_method,\n\t\t\t'function' => $importer->post_type_function,\n\t\t);\n\t}", "function import(array $data);", "public function onInitImport(InitEvent $event, $event_name, EventDispatcherInterface $dispatcher) {\n $stage = $event->getStage();\n\n if (isset($this->importInited[$stage])) {\n return;\n }\n $this->importInited[$stage] = TRUE;\n\n switch ($stage) {\n case 'fetch':\n $dispatcher->addListener(FeedsEvents::FETCH, function (FetchEvent $event) {\n $feed = $event->getFeed();\n $result = $feed->getType()->getFetcher()->fetch($feed, $feed->getState(StateInterface::FETCH));\n $event->setFetcherResult($result);\n });\n break;\n\n case 'parse':\n $dispatcher->addListener(FeedsEvents::PARSE, function (ParseEvent $event) {\n $feed = $event->getFeed();\n\n $result = $feed\n ->getType()\n ->getParser()\n ->parse($feed, $event->getFetcherResult(), $feed->getState(StateInterface::PARSE));\n\n // Add data from source plugins to the parser result.\n $source_plugins = $this->getMappedSourcePlugins($feed->getType());\n if (!empty($source_plugins)) {\n /** @var \\Drupal\\feeds\\Feeds\\Item\\ItemInterface $item */\n foreach ($result as $item) {\n /** @var \\Drupal\\feeds\\Plugin\\Type\\Source\\SourceInterface $source_plugin */\n foreach ($source_plugins as $source => $source_plugin) {\n $item->set($source, $source_plugin->getSourceElement($feed, $item));\n }\n }\n }\n\n // Finally set the parser result on the event.\n $event->setParserResult($result);\n });\n break;\n\n case 'process':\n $dispatcher->addListener(FeedsEvents::PROCESS, function (ProcessEvent $event) {\n $feed = $event->getFeed();\n $feed\n ->getType()\n ->getProcessor()\n ->process($feed, $event->getItem(), $feed->getState(StateInterface::PROCESS));\n });\n break;\n\n case 'clean':\n foreach ($event->getFeed()->getType()->getPlugins() as $plugin) {\n if (!$plugin instanceof CleanableInterface) {\n continue;\n }\n\n $dispatcher->addListener(FeedsEvents::CLEAN, function (CleanEvent $event) use ($plugin) {\n $feed = $event->getFeed();\n $plugin->clean($feed, $event->getEntity(), $feed->getState(StateInterface::CLEAN));\n });\n }\n break;\n\n }\n }", "abstract public function loadAll();", "public function import() {\n\t\t$exchangeRateImporter = new EcbExchangeRateImporter();\n\t\t$exchangeRateImporter->import();\n\n\t\t$event = new CakeEvent('ExchangeRateImport.completed', $this);\n\t\tCakeEventManager::instance()->dispatch($event);\n\t}", "function importUsers()\n {\n geoAdmin::m('Fake import run, all users imported from bridge to local.', geoAdmin::NOTICE);\n return true;\n }", "public function importAction()\n {\n $this->importParameters = $this->importParameters + $this->_importExtraParameters;\n\n parent::importAction();\n }", "public function mergeImport($importData) {\n foreach ($importData as $key => $value) {\n $this->{$key} = $value;\n }\n }", "function data_snapshots_feeds_importer_default() {\n $export = array();\n\n $feeds_importer = new stdClass();\n $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */\n $feeds_importer->api_version = 1;\n $feeds_importer->id = 'data_snapshot_importer';\n $feeds_importer->config = array(\n 'name' => 'Data Snapshot Importer',\n 'description' => 'Imports Data Snapshot nodes from a CSV file via an HTTP URL',\n 'fetcher' => array(\n 'plugin_key' => 'FeedsHTTPFetcher',\n 'config' => array(\n 'auto_detect_feeds' => FALSE,\n 'use_pubsubhubbub' => FALSE,\n 'designated_hub' => '',\n 'request_timeout' => NULL,\n ),\n ),\n 'parser' => array(\n 'plugin_key' => 'FeedsCSVParser',\n 'config' => array(\n 'delimiter' => ',',\n 'no_headers' => 0,\n ),\n ),\n 'processor' => array(\n 'plugin_key' => 'FeedsNodeProcessor',\n 'config' => array(\n 'expire' => '-1',\n 'author' => 0,\n 'authorize' => 0,\n 'mappings' => array(\n 0 => array(\n 'source' => 'guid',\n 'target' => 'guid',\n 'unique' => 1,\n ),\n 1 => array(\n 'source' => 'dsmn',\n 'target' => 'field_ds_dsds_mn',\n 'unique' => FALSE,\n ),\n 2 => array(\n 'source' => 'ptk',\n 'target' => 'field_ds_ptk',\n 'unique' => FALSE,\n ),\n 3 => array(\n 'source' => 'stk',\n 'target' => 'field_ds_stk',\n 'unique' => FALSE,\n ),\n 4 => array(\n 'source' => 'title',\n 'target' => 'title',\n 'unique' => 0,\n ),\n 5 => array(\n 'source' => 'image_url',\n 'target' => 'field_ds_disimg:url',\n 'unique' => FALSE,\n ),\n 6 => array(\n 'source' => 'about',\n 'target' => 'body',\n 'unique' => FALSE,\n ),\n ),\n 'update_existing' => '0',\n 'input_format' => 'plain_text',\n 'skip_hash_check' => 0,\n 'bundle' => 'data_snapshot',\n ),\n ),\n 'content_type' => '',\n 'update' => 0,\n 'import_period' => '-1',\n 'expire_period' => 3600,\n 'import_on_create' => 1,\n 'process_in_background' => 0,\n );\n $export['data_snapshots'] = $feeds_importer;\n \n return $export;\n}", "private function setDataBaseFeeds()\n {\n $this->dataBaseFeeds = $this->dataBaseFeedsController->getFeeds();\n }", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "function _ec_partners_feeds_importer_default() {\n $export = array();\n $feeds_importer = new stdClass;\n $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */\n $feeds_importer->api_version = 1;\n $feeds_importer->id = 'partner';\n $feeds_importer->config = array(\n 'name' => 'Partner',\n 'description' => 'Import XML file of Master Partners',\n 'fetcher' => array(\n 'plugin_key' => 'FeedsHTTPFetcher',\n 'config' => array(\n 'use_pubsubhubbub' => FALSE,\n 'designated_hub' => '',\n ),\n ),\n 'parser' => array(\n 'plugin_key' => 'FeedsXMLParser',\n 'config' => array(),\n ),\n 'processor' => array(\n 'plugin_key' => 'FeedsNodeProcessor',\n 'config' => array(\n 'content_type' => 'partner',\n 'update_existing' => 1,\n 'expire' => '-1',\n 'mappings' => array(\n '0' => array(\n 'source' => 'nid',\n 'target' => 'guid',\n 'unique' => 1,\n ),\n '1' => array(\n 'source' => 'title',\n 'target' => 'title',\n 'unique' => FALSE,\n ),\n '2' => array(\n 'source' => 'body',\n 'target' => 'body',\n 'unique' => FALSE,\n ),\n '3' => array(\n 'source' => 'field_partner_logo',\n 'target' => 'field_partner_logo',\n 'unique' => FALSE,\n ),\n '4' => array(\n 'source' => 'field_partner_address',\n 'target' => 'field_partner_address',\n 'unique' => FALSE,\n ),\n '5' => array(\n 'source' => 'field_partner_city',\n 'target' => 'field_partner_city',\n 'unique' => FALSE,\n ),\n '6' => array(\n 'source' => 'field_partner_country',\n 'target' => 'field_partner_country',\n 'unique' => FALSE,\n ),\n '7' => array(\n 'source' => 'field_partner_location',\n 'target' => 'field_partner_location',\n 'unique' => FALSE,\n ),\n '8' => array(\n 'source' => 'field_partner_order',\n 'target' => 'field_partner_order',\n 'unique' => FALSE,\n ),\n '9' => array(\n 'source' => 'field_partner_website',\n 'target' => 'field_partner_website:url',\n 'unique' => FALSE,\n ),\n '10' => array(\n 'source' => 'master',\n 'target' => 'field_partner_grandparentref',\n 'unique' => FALSE,\n ),\n '11' => array(\n 'source' => 'created',\n 'target' => 'created',\n 'unique' => FALSE,\n ),\n '12' => array(\n 'source' => 'link',\n 'target' => 'url',\n 'unique' => FALSE,\n ),\n ),\n ),\n ),\n 'content_type' => 'partner_feed',\n 'update' => 0,\n 'import_period' => '3600',\n 'expire_period' => 3600,\n 'import_on_create' => 1,\n );\n\n $export['partner'] = $feeds_importer;\n return $export;\n}", "public static function loadAll();", "public function importProvider() {\n\t\treturn array(\n\t\t\t//set #0\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tnull,\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #1\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(),\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #2\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #3\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t\t'Languages' => array(),\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #4\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t\t'Languages' => array(),\n\t\t\t\t\t'Messages' => array(),\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #5\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t\t'Languages' => array(),\n\t\t\t\t\t'Messages' => array(),\n\t\t\t\t\t'References' => array(),\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\tnull,\n\t\t\t\t//message\n\t\t\t\t'Wrong or empty import file!'\n\t\t\t),\n\t\t\t//set #6\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t\t'Languages' => array(),\n\t\t\t\t\t'Messages' => array(),\n\t\t\t\t\t'References' => array(),\n\t\t\t\t\t'Translations' => array()\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\tfalse,\n\t\t\t\t//message\n\t\t\t\t'Import localization error!'\n\t\t\t),\n\t\t\t//set #7\n\t\t\tarray(\n\t\t\t\t//data\n\t\t\t\tarray(\n\t\t\t\t\t'Export' => array(),\n\t\t\t\t\t'Languages' => array(),\n\t\t\t\t\t'Messages' => array(),\n\t\t\t\t\t'References' => array(),\n\t\t\t\t\t'Translations' => array()\n\t\t\t\t),\n\t\t\t\t//success\n\t\t\t\ttrue,\n\t\t\t\t//message\n\t\t\t\t'Import localization success!'\n\t\t\t),\n\t\t);\n\t}", "public function importAction()\n {\n \n $directory = 'data/officialstations/es/json/latest';\n $country = 'ES';\n \n $request = $this->getRequest();\n $filename = $request->getParam('filename', false);\n $verbose = $request->getParam('verbose', false) || $request->getParam('v', false);\n\n $fueltypes = array(\n 'BIE.json'=>9,\n 'BIO.json'=>7,\n 'G95.json'=>8,\n 'G98.json'=>2,\n 'GLP.json'=>10,\n 'GNC.json'=>11,\n 'GOA.json'=>3,\n 'GOB.json'=>5,\n 'GOC.json'=>6,\n 'GPR.json'=>1,\n 'NGO.json'=>4\n );\n \n // purge cache for every configuration\n if ($filename)\n {\n// $result = $this->priceMapper->truncate();\n $this->priceMapper->countChanges = 0;\n $this->priceMapper->cycleFailsFilename();\n \n // echo $iterator->getFilename() . \"\\n\";\n echo $filename . \"\\n\";\n if($filename == 'All')\n {\n foreach($fueltypes as $file => $id)\n {\n echo $file.\"\\n\";\n $content = file_get_contents($directory.'/'.$file);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n// $value['created'] = '2014-06-14';\n $result = $this->stationMapper->save($value); \n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$file]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n }\n else \n {\n // $content = file_get_contents($directory.'/'.$iterator->getFilename());\n $content = file_get_contents($directory.'/'.$filename);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n $result = $this->stationMapper->save($value);\n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$filename]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n echo $this->priceMapper->countChanges;\n }\n\n $this->output('Collecting all assets...', $verbose);\n $this->output(sprintf('Importing finished...', $verbose));\n }", "public function ajax_get_import_data() {\n\t\t\tif ( ! wp_verify_nonce( $_GET['get_import_data_nonce'], 'get-import-data' ) ) {\n\t\t\t\tdie( 'This action was stopped for security purposes.' );\n\t\t\t}\n\n\t\t\techo json_encode( \n\t\t\t\tarray(\n\t\t\t\t\t'xml_data' => array(\n\t\t\t\t\t\t'input_name' => 'wpex_import_xml',\n\t\t\t\t\t\t'action' => 'wpex_post_import_xml_data',\n\t\t\t\t\t\t'method' => 'ajax_post_import_xml_data',\n\t\t\t\t\t\t'preloader' => __( 'Importing XML Data', 'total' )\n\t\t\t\t\t),\n\t \n\t\t\t\t\t'mods' => array(\n\t\t\t\t\t\t'input_name' => 'wpex_import_mods',\n\t\t\t\t\t\t'action' => 'wpex_post_import_mods',\n\t\t\t\t\t\t'method' => 'ajax_post_import_mods',\n\t\t\t\t\t\t'preloader' => __( 'Importing Customizer Settings', 'total' )\n\t\t\t\t\t),\n\t \n\t\t\t\t\t'widgets' => array(\n\t\t\t\t\t\t'input_name' => 'wpex_import_widgets',\n\t\t\t\t\t\t'action' => 'wpex_post_import_widgets',\n\t\t\t\t\t\t'method' => 'ajax_post_import_widgets',\n\t\t\t\t\t\t'preloader' => __( 'Importing Widgets', 'total' )\n\t\t\t\t\t),\n\t \n\t\t\t\t\t'sliders' => array(\n\t\t\t\t\t\t'input_name' => 'wpex_import_sliders',\n\t\t\t\t\t\t'action' => 'wpex_post_import_sliders',\n\t\t\t\t\t\t'method' => 'ajax_post_import_sliders',\n\t\t\t\t\t\t'preloader' => __( 'Importing Sliders', 'total' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdie();\n\t\t}", "public function importer_cron()\n\t{\n\t\tDBTP_Utils::log('Importer started');\n\n\t\t$importManager = new DBTP_Import_Manager();\n\t\t$schedule = $importManager->schedule_imports();\n\n\t\tif (is_wp_error($schedule)) {\n\t\t\tDBTP_Utils::log('Importer error: '. $schedule->get_error_message());\n\t\t} else {\n\t\t\tDBTP_Utils::log('Imported has been scheduled');\n\t\t}\n\t}", "public function uploadFeedsAll()\n {\n $this->uploadFeeds();\n }", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "public function importSubscribers() \n\t{\n\t\tif (!$this->_isImportSubscribersEnabled()) \n\t\t{\n\t\t\treturn;\n\t\t}\n Mage::getModel(\"contactlab_hub/importer_subscribers\")->import();\n\t}", "protected function init_bulkactions(){\r\n\t\t\tif ( file_exists( $this->include_path . '/Bulk' ) ) {\r\n\t\t\t\t$Directory = new RecursiveDirectoryIterator( $this->include_path . '/Bulk' );\r\n\t\t\t\t$Iterator = new RecursiveIteratorIterator( $Directory );\r\n\t\t\t\t$Regex = new RegexIterator( $Iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH );\r\n\t\t\t\t$include_array = array();\r\n\t\t\t\t$rc = new ReflectionClass( $this );\r\n\t\t\t\tforeach ( $Regex as $name => $obj ) {\r\n\t\t\t\t\t$name = str_replace($this->include_path . '/Bulk/', '', $name);\r\n\t\t\t\t\t$name = str_replace( ['.php', '/'], ['', '\\\\'], $name );\r\n\t\t\t\t\t$namespace = $rc->getNamespaceName();\r\n\t\t\t\t\tarray_push( $include_array, $namespace . '\\\\Bulk\\\\' . $name );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ( $include_array as $bulk ) {\r\n\t\t\t\t\tnew $bulk();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "function _manually_load_importer() {\n\tif ( ! class_exists( 'WP_Import' ) ) {\n\t\trequire dirname( dirname( __FILE__ ) ) . '/src/wordpress-importer.php';\n\t}\n}", "public static function getImports()\n\t{\n\t\t$db = get_db();\n\t\t$it = $db->getTable('CsvImport_Import');\n\t\t$s = $it->getSelect()->where('1')->order('added DESC');\n\t\t$imports = $it->fetchObjects($s, array());\n return $imports;\n\t}", "public function process(): void\n {\n foreach ($this->connection->list() as $filename) {\n $localFile = 'import_' .\n uniqid((string)\\Magento\\Framework\\Math\\Random::getRandomNumber(), true) .\n time() . '.' .\n pathinfo($filename, PATHINFO_EXTENSION);\n\n if ($this->connection->read($filename, $this->tmpDirectory->getAbsolutePath($localFile))) {\n if (!$this->tmpDirectory->isWritable($localFile)) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Cannot create a target file for reading.')\n );\n }\n }\n\n $source = $this->getSourceAdapter($this->tmpDirectory->getAbsolutePath($localFile));\n\n foreach ($source as $line) {\n $data = array_values($line);\n $this->stockImport->import($data);\n }\n }\n }", "public function init() {\r\n\r\n\t\tini_set('max_execution_time', 300); //300 seconds = 5 minutes\r\n\r\n\t\t// Includes\r\n\t\t//https://github.com/parsecsv/parsecsv-for-php\r\n\t\trequire_once( 'parsecsv-for-php/parsecsv.lib.php' );\r\n\r\n\t\trequire_once( 'inc/csv-functions.php' );\r\n\r\n\t\t//execute data\r\n\t\trequire_once( 'inc/data-import.php' );\r\n\r\n\t\t//filter data\r\n\t\trequire_once( 'inc/data-filter.php' );\r\n\r\n\r\n\r\n\t\t// Localisation\r\n\t\tload_plugin_textdomain( 'csv-import-wpdatables', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\r\n\t}", "public static function import_locations() {\n\t\t$data_to_import = FrmAppHelper::get_post_param( 'frm_import_files', '', 'sanitize_title' );\n\n\t\t$form = FrmForm::getOne( 'frm_loc_list' );\n\t\tif ( ! $form ) {\n\t\t\t$file = dirname( dirname( __FILE__ ) ) . '/templates/locations-forms.xml';\n\t\t\tFrmXMLHelper::import_xml( $file );\n\t\t}\n\n\t\t$opts = get_option( 'frm_usloc_options' );\n\t\t$remaining = self::remaining_count( $opts, $data_to_import );\n\n\t\tinclude dirname( dirname( __FILE__ ) ) . '/views/importing_page.php';\n\t}", "public function importedObjects()\n {\n $this->assertImportsSupport();\n if ($this->importedObjects === null) {\n $this->importedObjects = array();\n foreach ($this->imports()->listImportNames() as $import) {\n $this->importedObjects[$import] = $this->loadImportedObject($import);\n }\n }\n\n return $this->importedObjects;\n }", "public function run()\n {\n $this->config = Config::get('nla');\n $this->detectDataSource();\n $this->collectNLAIdentifiers();\n\n $count = count($this->nlaIdentifiers);\n $this->info(\"Processing {$count} nla identifiers\");\n\n $payload = \"\";\n $this->progressStart(count($this->nlaIdentifiers));\n foreach ($this->nlaIdentifiers as $identifier) {\n $this->progressAdvance(1);\n try {\n $rifcs = $this->getRIFCSFromNLAIdentifier($identifier);\n $rifcs = XMLUtil::unwrapRegistryObject($rifcs);\n $this->debug(\"Found rifcs for $identifier\");\n $payload .= $rifcs;\n } catch (Exception $e) {\n $this->error(\"Failed processing $identifier. {$e->getMessage()}\");\n }\n }\n $payload = XMLUtil::wrapRegistryObject($payload);\n $this->progressFinish();\n\n $this->log(\"Starting importing process...\");\n $this->import($payload);\n $this->log(\"Finished...\");\n }", "private function importManyFiles()\n {\n $path = storage_path(\"data/*.csv\");\n\n // run 2 loops at a time\n foreach (array_slice(glob($path), 0, 2) as $file) {\n // read the data into an array\n $data = array_map('str_getcsv', file($file));\n\n // loop over the data\n foreach ($data as $row) {\n // insert the record or update if the email already exists\n // User::updateOrCreate(\n // ['email' => $row[6]],\n // ['email' => $row[6]]\n // );\n }\n\n // delete the file\n unlink($file);\n }\n }", "public function import_all($parentselector = '') {\n\n }", "function PreProcessItemDataGroups()\n {\n $this->Import_Datas=array(\"Name\",\"Email\");\n array_unshift($this->ItemDataGroupPaths,\"../EventApp/System/Inscriptions\");\n }", "public function run()\n {\n $filename = storage_path('imports/car_serie.csv');\n Excel::import(new CarSerieImport, $filename);\n }", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function loadAllClassesIncrementally()\n {\n }", "private function collectAllData()\n {\n $this->getParsedHeader();\n $this->getServerConfig();\n $this->getPageTitle();\n $this->getLanguage();\n $this->getCharset();\n $this->getHeadingsCount();\n $this->getCanonicalLINKS();\n $this->getAllLinksData();\n }", "public function importProcess(Request $request)\n {\n // figure out the importable fields.\n $importFields = $this->getImportableFields();\n\n // load the data stored in the database.\n $requestFields = $request->fields;\n $data = CsvData::find($request->csv_data_file_id);\n $csv_data = json_decode($data->csv_data, true);\n\n $entities = [];\n foreach ($csv_data as $idx_1 => $row) {\n if ($idx_1 == 0) {\n continue;\n }\n $entity = [];\n\n foreach ($importFields as $idx_2 => $importField) {\n $t = array_search($importField['name'], $requestFields);\n if ($t !== false) {\n $entity[$importField['name']] = isset($row[$t]) ? $row[$t] : null;\n }\n }\n\n $entities[] = $entity;\n }\n\n // resolve all the foreign keys.\n foreach ($entities as $idx_1 => &$entity) {\n foreach ($importFields as $idx_2 => $importField) {\n if (isset($importField['import_resolver'])) {\n $importField['import_resolver']($entity);\n }\n }\n }\n\n // run validations.\n $errors = [];\n foreach ($entities as $idx => &$entity) {\n $rules = $this->importValidationRules();\n $messages = $this->importValidationMessages();\n $validator = Validator::make($entity, $rules, $messages);\n if ($validator->fails()) {\n $errors[] = [\n 'row_number' => $idx + 1,\n 'errors' => $validator->errors()->all()\n ];\n }\n }\n\n // create the user appointments.\n $entityObjects = [];\n $this->beforeImport($entities);\n if (empty($errors)) {\n foreach ($entities as $idx => &$entity) {\n $entityObjects[] = $this->importCreate($entity);\n }\n }\n $this->afterImport($entityObjects);\n\n return view($this->importProcessView(), [\n 'crud' => $this->crud,\n 'errors' => $errors,\n ]);\n }", "public static function setup_actions() {\n\t\tadd_action(\n\t\t\t'astoundify_import_content_after_import_item_type_object',\n\t\t\tarray( __CLASS__, 'set_products' )\n\t\t);\n\t}", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "function _mn_slingshot_feeds_importer_default() {\n $export = array();\n $feeds_importer = new stdClass;\n $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */\n $feeds_importer->api_version = 1;\n $feeds_importer->id = 'slingshot';\n $feeds_importer->config = array(\n 'name' => 'Slingshot',\n 'description' => 'Imports items from SMS',\n 'fetcher' => array(\n 'plugin_key' => 'FeedsSlingshotFetcher',\n 'config' => array(\n 'auto_detect_feeds' => FALSE,\n 'use_keyauth' => FALSE,\n 'keyauth_public' => '',\n 'subscription_period' => 86400,\n ),\n ),\n 'parser' => array(\n 'plugin_key' => 'FeedsSlingshotParser',\n 'config' => array(),\n ),\n 'processor' => array(\n 'plugin_key' => 'FeedsDataProcessor',\n 'config' => array(\n 'update_existing' => 0,\n 'expire' => -1,\n 'mappings' => array(\n '0' => array(\n 'source' => 'timestamp',\n 'target' => 'timestamp',\n 'unique' => 0,\n ),\n '1' => array(\n 'source' => 'title',\n 'target' => 'title',\n 'unique' => 0,\n ),\n '2' => array(\n 'source' => 'description',\n 'target' => 'description',\n 'unique' => FALSE,\n ),\n ),\n ),\n ),\n 'content_type' => 'slingshot_feed',\n 'update' => 0,\n 'import_period' => '-1',\n 'expire_period' => 3600,\n 'import_on_create' => 0,\n );\n\n $export['slingshot'] = $feeds_importer;\n return $export;\n}", "public function importPass()\n {\n // Prepare list of objects for import\n $remoteObjects = $this->getImportableObjects();\n if ($remoteObjects === null) {\n return;\n }\n \n // Add all objects\n $updated = 0;\n $added = 0;\n $total = 0;\n $remoteCount = $remoteObjects->count();\n foreach ($remoteObjects as $remoteObject) {\n // Show progress indicator\n $this->task->progress(++$total, $remoteCount);\n\n // If allowed, detect updateable objects\n $localObject = null;\n if ($this->canUpdate() && ($localObject = $this->findMatchedLocalObject($remoteObject->ID))) {\n // Update existing object\n $this->updateLocalObject($localObject, $remoteObject);\n ++$updated;\n }\n\n // If allowed, create a new object\n // If this step has an add only strategy, then this step relies on getImportableObjects\n // to filter out objects that have already been added.\n if (empty($localObject) && $this->canAdd()) {\n // Make a new object\n $this->createLocalFromRemoteObject($remoteObject);\n ++$added;\n }\n }\n // Done!\n $this->task->message(\" * Result: {$added} added, {$updated} updated\");\n }", "public function onConfigImporterImport(ConfigImporterEvent $event)\n {\n $this->settings->checkAndCreateEntities();\n }", "protected function FetchExporterList()\n\t{\n\t\t$exporterRoot = APP_ROOT.\"/includes/converter/exporters/\";\n\t\t$files = scandir($exporterRoot);\n\n\t\tforeach($files as $file) {\n\t\t\tif(!is_file($exporterRoot.$file) || isc_substr($file, -3) != \"php\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trequire_once $exporterRoot.$file;\n\t\t\t$file = isc_substr($file, 0, isc_strlen($file)-4);\n\t\t\t$className = \"ISC_ADMIN_EXPORTER_\".isc_strtoupper($file);\n\t\t\tif(!class_exists($className)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$exporter = new $className;\n\t\t\t$exporters[$file] = array(\n\t\t\t\t\"title\" => $exporter->title,\n\t\t\t\t\"configuration\" => \"\"\n\t\t\t);\n\t\t\tif(method_exists($exporter, \"Configure\")) {\n\t\t\t\t$exporters[$file]['configuration'] = $exporter->Configure();\n\t\t\t}\n\t\t}\n\t\treturn $exporters;\n\t}", "protected function _importData()\n {\n $this->_validatedRows = null;\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->_deleteProducts();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->_replaceFlag = true;\n $this->_replaceProducts();\n } else {\n $this->_saveProductsData();\n }\n $this->_eventManager->dispatch('catalog_product_import_finish_before', ['adapter' => $this]);\n return true;\n }", "public function import(\\Networkteam\\Import\\DataProvider\\DataProviderInterface $dataProvider): ImportResult;", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function getImported();", "public function postImport() {\n parent::postImport();\n if (!civicrm_initialize()) {\n return;\n }\n // Need to clear the cache once the fields are created.\n civicrm_api3('system', 'flush', array('version' => 3));\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}", "private function ajaxImportAllAtOnceRunImport($all_imports, $user_decisions = false)\n {\n foreach ($all_imports as $import) {\n $items_to_import = $user_decisions !== false\n ? $user_decisions\n : $import->getItemsToImport();\n\n $result = $import->import($items_to_import);\n\n if (is_wp_error($result)) {\n // Error\n return $this->response_ajax->failed()->setMessage($this->wordpressErrorMessage($result))->response();\n }\n\n // store that this import is done\n $this->finishStep($import);\n }\n\n // update url if author base url is available\n\t if( $this->settings->getAuthorBaseUrl() ) {\n\t\t\t$this->updateSiteURLs( $this->settings->getAuthorBaseUrl() );\n\t }\n\n\t // all imports are done\n\t $this->response_ajax->setMessage( __('Import was completed.', 'toolset-themes') )->response();\n }", "function wp_get_popular_importers()\n {\n }", "protected function _importData()\n {\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->deleteEntity();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->replaceEntity();\n } elseif (Import::BEHAVIOR_APPEND == $this->getBehavior()) {\n $this->saveEntity();\n }\n\n return true;\n }", "public function import_data()\r\n\t{\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE `enabled`>='1'\";\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_data` WHERE `mls_query_id` = '{$mls_query->id}' AND `imported` = 0 ORDER BY `date` LIMIT {$mls_query->import_limit}\";\r\n\t\t\t$mls_data = wpl_db::select($query);\r\n\t\t\tif(!$mls_data) continue;\r\n\t\t\t$results = array();\r\n\t\t\t$ids = array();\r\n\r\n\t\t\tforeach($mls_data as $data)\r\n\t\t\t{\r\n\t\t\t\t$results[$data->unique_value] = (array)json_decode(base64_decode($data->content));\r\n\t\t\t\t$ids[] = $data->id;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\r\n\t\t\tif(trim($wplrets->mls_server_data->mls_unique_field) == '') continue;\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\r\n\t\t\t/** map data **/\r\n\t\t\t$mapped = $wplrets->map($results, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** import properties **/\r\n\t\t\t$pids = $wplrets->import_mapped_data($mapped, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** download images **/\r\n\t\t\tif(trim($mls_query->images)) $wplrets->import_properties_images($pids, $mls_query->mls_server_id, $mls_query->images, false);\r\n\t\t\t\r\n\t\t\t/** finalizing properties **/\r\n\t\t\tforeach($pids as $pid) $wplrets->finalize($pid);\r\n\t\t\r\n\t\t\t/** update imported field **/\r\n\t\t\twpl_db::q(\"UPDATE `#__wpl_addon_mls_data` SET `imported` = '1' WHERE `id` IN ('\".implode(\"','\", $ids).\"')\");\r\n\t\t}\r\n\r\n\t\tif(wpl_request::getVar('rets_import_cron_job') == 1) exit;\r\n\t}", "public function readData()\n\t{\n\t\t$filesForImporting = array();\n\t\t\n\t\t$this->_checkPathsExists();\n\t\t\n\t\tBackupImportLogger::setLogInfo('Unzipping '.basename($this->file).' in userfiles...');\n\t\t\n\t\t$backupManager = new BackupManager();\n\t\t$backupLocation = $backupManager->getBackupLocation(). 'temp_backup_zip/';\n\n\t\t// Remove old files\n\t\t$this->_removeFilesFromPath($backupLocation);\n\t\t\n\t\t$unzip = new \\Microweber\\Utils\\Unzip();\n\t\t$unzip->extract($this->file, $backupLocation, true);\n\n\t\t\n\t\tif ($backupLocation != false and is_dir($backupLocation)) {\n\t\t\tBackupImportLogger::setLogInfo('Media restored!');\n\t\t\t$copy = $this->_cloneDirectory($backupLocation, userfiles_path());\n\t\t}\n\t\t\n\t\t$mwContentJsonFile = $backupLocation. 'mw_content.json';\n\t\t\n\t\tif (is_file($mwContentJsonFile)) {\n\t\t\t$filesForImporting[] = array(\"file\"=>$mwContentJsonFile, \"reader\"=>\"json\");\n\t\t}\n\t\t\n\t\t// Find data to import\n\t\t$tables = $this->_getTableList();\n\t\t$supportedReaders = $this->_getSupportedReaders();\n\t\t$backupFiles = scandir($backupLocation);\n\t\tforeach ($backupFiles as $filename) {\n\t\t\t$file = $backupLocation . $filename;\n\t\t\tif (!is_file($file)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fileExtension = get_file_extension($file);\n\t\t\t$importToTable = str_replace('.'.$fileExtension, false, $filename);\n\n\t\t\t$addToImport = false;\n\t\t\t\n\t\t\tif (strpos($importToTable, 'backup_export') !== false) {\n\t\t\t\t$addToImport = true;\n\t\t\t}\n\n if (strpos($importToTable, 'mw_content') !== false && strpos($importToTable, '_lang') !== false) {\n $addToImport = true;\n }\n\t\t\t\n\t\t\tif (in_array($fileExtension, $supportedReaders) && in_array($importToTable, $tables)) {\n\t\t\t\t$addToImport = true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($addToImport) {\n\t\t\t\t$filesForImporting[] = array(\"file\"=>$file, \"importToTable\"=> $importToTable, \"reader\"=>$fileExtension);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif (empty($filesForImporting)) {\n\t\t\tBackupImportLogger::setLogInfo('The zip file has no files to import.');\n\t\t\treturn;\n\t\t}\n\n $detectedLanguages = array();\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], 'bg_lang') !== false) {\n $detectedLanguages[] = 'bg';\n }\n }\n\n if (!$this->language && !empty($detectedLanguages)) {\n BackupImportLogger::setLogInfo('Its detected other languages in this import.');\n return array('must_choice_language' => true, 'detected_languages'=>$detectedLanguages);\n }\n\n if ($this->language) {\n $selectedLanguageFile = false;\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], $this->language . '_lang') !== false) {\n $selectedLanguageFile = $file;\n break;\n }\n }\n // File for this language is found\n if ($selectedLanguageFile) {\n unset($filesForImporting);\n $filesForImporting[] = $selectedLanguageFile;\n } else {\n // Its not found this language\n // Remove all other lang files\n $newFilesForImporting = array();\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], '_lang') !== false) {\n continue;\n }\n $newFilesForImporting[] = $file;\n }\n $filesForImporting = $newFilesForImporting;\n }\n }\n \n\t\t// Decode files in zip\n\t\t$readedData = array();\n\t\tforeach ($filesForImporting as $file) {\n\t\t\t\n\t\t\t$readerClass = 'Microweber\\\\Utils\\\\Backup\\\\Readers\\\\' . ucfirst($file['reader']) . 'Reader';\n\t\t\t$reader = new $readerClass($file['file']);\n\t\t\t$data = $reader->readData();\n\t\t\t\n\t\t\tif (strpos($importToTable, 'backup_export') !== false) {\n\t\t\t\t$readedData = $data;\n\t\t\t} else if (strpos($importToTable, 'mw_content') !== false) {\n\t\t\t\t$readedData = $data;\n\t\t\t} else {\n\t\t\t\tif (!empty($data)) {\n\t\t\t\t\tif (isset($file['importToTable'])) {\n\t\t\t\t\t\t$readedData[$file['importToTable']] = $data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif (empty($readedData)) {\n\t\t\tBackupImportLogger::setLogInfo('The files in zip are empty. Nothing to import.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn $readedData;\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n parent::init();\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'info.models.*',\n\t\t\t'info.components.*',\n\t\t));\n\t}", "public function all() {\r\n\t\tthrow new Exception('Cannot load all for this type of file, use the next() method.');\r\n\t}", "function importFromAllChannelSources($forceReparsing = false){\n $config = config::getInstance();\n $dir = new DirectoryIterator( $config->getValue(\"userdata\").\"sources/\" );\n foreach ($dir as $fileinfo) {\n if ( $fileinfo->isDir() && !$fileinfo->isDot()){\n $metaData = new channelImportMetaData( $fileinfo->getFilename() );\n if ( $metaData->userNameExists()){\n $importer = new channelImport( $metaData, $forceReparsing );\n $importer->addToUpdateLog( \"-\", \"Manually forced update: Checking for presence of unprocessed channels.conf to analyze.\");\n $importer->insertChannelsConfIntoDB();\n //print \"user account for folder \" . $fileinfo->getFilename() . \" does exist in global_user_data!\\n\";\n }\n else\n print \"user account for folder \" . $fileinfo->getFilename() . \" does not exist in global_user_data!\\n\";\n }\n }\n $labeller = channelGroupingManager::getInstance();\n $labeller->updateAllLabels();\n\n $x = new rawOutputRenderer();\n $x->writeRawOutputForAllSources();\n\n $x = new HTMLOutputRenderer();\n $x->renderAllHTMLPages();\n}", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'sys.models.*',\n 'product.models.*',\n 'sys.components.*',\n 'hr.models.*',\n ));\n }", "public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }" ]
[ "0.7452175", "0.7201632", "0.7172058", "0.7165438", "0.7058334", "0.69870883", "0.66171306", "0.6552752", "0.641454", "0.61889255", "0.6158516", "0.6139733", "0.6107283", "0.60530967", "0.59979624", "0.5971815", "0.5950689", "0.5939875", "0.5925115", "0.5904865", "0.5889245", "0.58624166", "0.5843111", "0.5832856", "0.57803667", "0.5770127", "0.57626486", "0.57344395", "0.5726165", "0.5720399", "0.5696732", "0.5674222", "0.56552935", "0.5649822", "0.5624976", "0.56246954", "0.5606583", "0.5598333", "0.55918837", "0.55900705", "0.5575713", "0.55363065", "0.55267465", "0.55219495", "0.5490595", "0.54806656", "0.54751724", "0.545936", "0.54581296", "0.5437828", "0.54342514", "0.5426739", "0.5408773", "0.54054105", "0.53992665", "0.539811", "0.538693", "0.5371629", "0.5350953", "0.5325369", "0.5324533", "0.53121734", "0.5305069", "0.530409", "0.5298543", "0.52969676", "0.5294919", "0.52938366", "0.52900463", "0.5278074", "0.5274099", "0.52686167", "0.52658916", "0.52581614", "0.52520305", "0.5246414", "0.52399266", "0.5229666", "0.52250105", "0.52249986", "0.52167124", "0.5210532", "0.5210387", "0.51949525", "0.5187433", "0.51799643", "0.5161051", "0.51508224", "0.515053", "0.5145669", "0.51422757", "0.5140934", "0.5138539", "0.51334506", "0.5128012", "0.5120814", "0.51061827", "0.51057136", "0.5105305", "0.5099145" ]
0.69760245
6
Display a listing of the resource.
public function index(Request $request) { // $this->repository->where('id','!=',23); //$signatures = $this->repository->getByCriteria(new SignaturesCriteria()); $signatures = $this->repository->paginate($limit = null, $columns = ['*']); return response()->json($signatures, 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(SignatureCreateRequest $request) { try { $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE); $signature = $this->repository->create($request->all()); $response = [ 'message' => 'Signature created.', 'data' => $signature, ]; return response()->json($response); } catch (ValidatorException $e) { return response()->json([ 'error' => true, 'message' => $e->getMessageBag() ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $signature = $this->repository->find($id); return response()->json([ 'data' => $signature, ]); }
{ "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 update(SignatureUpdateRequest $request, $id) { try { $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE); $signature = $this->repository->update($request->all(), $id); $response = [ 'message' => 'Signature updated.', 'data' => $signature, ]; return response()->json($response); } catch (ValidatorException $e) { return response()->json([ 'error' => true, 'message' => $e->getMessageBag() ]); } }
{ "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
Remove the specified resource from storage.
public function destroy($id) { $deleted = $this->repository->delete($id); return response()->json([ 'message' => 'Signature deleted.', 'deleted' => $deleted, ]); }
{ "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
Get the phone record associated with the user.
public function keyword() { return $this->hasOne(Keyword::class, 'id', 'keyword'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getPhone()\n {\n return $this->get(self::PHONE);\n }", "public function phone()\n {\n return $this->hasOne('App\\Models\\User\\Contact', 'user_id')->where('medium_id', '=', Medium::SMS);\n }", "public function getUserPhone($userId)\n {\n Paysera_WalletApi_Util_Assert::isId($userId);\n return $this->get('user/' . $userId . '/phone');\n }", "protected function get_user($phone)\n\t{\n\t\treturn model('user')->get_info_rule(compact('phone'));\n\t}", "public function getPhone()\n {\n return $this->get('Phone');\n }", "public function getPhone();", "public function getPhoneNumber()\n\t{\n\t\treturn $this->getIfSet('number', $this->data->phone);\n\t}", "public function get_phone() {\r\n return $this->phone;\r\n }", "public function getUserByPhone($phone);", "public function getPhone()\n {\n $res = $this->getEntity()->getPhone();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getPhone();\n\t\t}\n return $res;\n }", "public function getPhoneNumber()\n {\n return $this->getProfile() ? $this->getProfile()->getPhoneNumber() : null;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "public function getPhone() {\n\t\treturn $this->phone;\n\t}", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "public function getPhone()\n {\n return $this->phone;\n }", "function getUser($phone) {\n $userFetch = $this->db->dbQuery('select * from User where phoneNumber=' . $phone);\n if ($userFetch->num_rows > 0) {\n $user = $userFetch->fetch_assoc();\n return $user;\n } else return -1;\n }", "public function getPhone() {\n\t\treturn empty( $this->container['phones'] ) ? null : $this->container['phones'][0];\n\t}", "public function getPhone()\r\n {\r\n return $this->_phone;\r\n }", "function getPhone() {\n return $this->phone;\n }", "static function getPhoneById(string $id) {\n $db = new Database();\n return $db->getColumnValueWhere('users', 'phone', 'id', $id);\n }", "public function getPhoneNumber()\n {\n return $this->phone_number;\n }", "public function getBillingPhone();", "public function getProfilePhone() {\n\t\treturn ($this->profilePhone);\n\t}", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n\t{\n\t\treturn $this->phone_number;\n\t}", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "protected function getPhone()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getTelephone();\n }", "public function getPhone()\n {\n return $this->billingPhone;\n }", "public function getPhone()\n {\n $value = $this->get(self::PHONE);\n return $value === null ? (string)$value : $value;\n }", "public function get_telephone();", "public function getPhone(): string\n {\n return $this->phone;\n }", "public function getTel_user()\r\n {\r\n return $this->tel_user;\r\n }", "public function getTelephone() {}", "public function getPhone() : ?string \n {\n if ( ! $this->hasPhone()) {\n $this->setPhone($this->getDefaultPhone());\n }\n return $this->phone;\n }", "function getPrimaryPhone() {\n\t\treturn $this->getData('primaryPhone');\n\t}", "public function getProfilePhone() : string {\n\t\treturn $this->profilePhone;\n\t}", "function get_one_user_phone( $conds = array()) {\n\n\t\t$sql = \"SELECT * FROM core_users WHERE `user_phone` = '\" . $conds['user_phone'] . \"' \";\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query;\n\t}", "public function getPhoneNumber(): string\n {\n return $this->_phoneNumber;\n }", "public function getPhone():string\n {\n return $this->phone;\n }", "public function getShipToPhone();", "public function getCustomerPhone()\n {\n return $this->customerPhone;\n }", "public function getCallerPhone()\n\t{\n\t\treturn $this->caller_phone;\n\t}", "public function getPhoneNumber()\n {\n return $this->scopeConfig->getValue(\n self::CONFIG_PHONE_NUMBER,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getPhone(): ?string\n {\n return $this->_phone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getUser()\n {\n $user = User::find()->byPhone($this->phone)->one();\n\n if ($user == null) {\n $user = new User();\n $user->phone = $this->phone;\n $user->name = $this->name;\n $user->role = User::ROLE_USER;\n\n }\n\n $user->regenerateApiToken();\n $user->code = $this->generateRandomString();\n\n return $user;\n }", "public function getContactPhone()\n {\n return isset($this->contactPhone) ? $this->contactPhone : null;\n }", "public function getCustomerPhone()\n {\n if (array_key_exists(\"customerPhone\", $this->_propDict)) {\n return $this->_propDict[\"customerPhone\"];\n } else {\n return null;\n }\n }", "public function getDetails()\n {\n return [\n 'phone' => $this->user->phone\n ];\n }", "public function getTelephoneNumber()\n {\n return $this->telephoneNumber;\n }", "public function getPhoneNumber(): ?string;", "public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}", "public function phone($phone = null);", "public function getCustomerPhone(){\n return $this->customer_phone;\n }", "public function getReversePhone()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_REVERSEPHONE);\n\t\treturn $this->_result;\n\t}", "public function getTelephone() {\n\t\treturn $this->telephone;\n\t}", "public function getPhone()\n {\n return $this->getParameter('billingPhone');\n }", "public function telephoneNumber(): TelephoneNumber\n {\n return $this->telephoneNumber;\n }", "public function getPhone(): ?PhoneWithType\n {\n $phone = $this->{self::PHONE};\n if (is_array($phone))\n $this->setPhone(new PhoneWithType($phone));\n\n return $this->{self::PHONE};\n }", "public function getPhone()\n {\n return $this->getValue('nb_icontact_prospect_phone');\n }", "public static function PHONE(string $phone = null): UserInfo {\n return (new static())->init_p($phone);\n }", "public function getPhoneNo()\n {\n return $this->phone_no;\n }", "public function telephone()\n {\n return $this->hasOne('App\\Telephone', 'id_siswa');\n }", "public function phones()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select(['prefix', 'value AS number', 'is_primary'])\n ->where('type', 'phone');\n }", "public function getOffice_phone()\n {\n return $this->office_phone;\n }", "public function &findRelationByPhone($phone) {\n if (!is_null($ret = $this->_cache->get('rel_'.$phone))) {\n return $ret;\n }\n\n $this->log(\"Looking up phone $phone\", 'DEBUG');\n\n $contact = $this->findContactByPhone($phone);\n if (!$contact || !$contact['a_id']) {\n $account = $this->findAccountByPhone($phone);\n } else {\n $account = array(\n 'a_id' => $contact['a_id'],\n 'a_assigned' => $contact['a_assigned'],\n 'a_name' => $contact['a_name'],\n );\n unset($contact['a_id']);\n unset($contact['a_assigned']);\n unset($contact['a_name']);\n }\n $ret = array();\n if ($account) {\n $ret['relation_type'] = 'Accounts';\n $ret['relation_id'] = $account['a_id'];\n $ret['assigned_to'] = $account['a_assigned'];\n } elseif ($contact) {\n $ret['relation_type'] = 'Contacts';\n $ret['relation_id'] = $contact['c_id'];\n $ret['assigned_to']= $contact['c_assigned'] ? $contact['c_assigned'] : $account['a_assigned'];\n } else {\n $ret['relation_type'] = null;\n $ret['relation_id'] = null;\n $ret['assigned_to'] = null;\n }\n $ret['account'] = $account;\n $ret['contact'] = $contact;\n\n $this->_cache->set('rel_'.$phone, $ret, $this->cache_expire);\n return $ret;\n }", "public function getPhoneNumber()\n {\n return $this->country_code.$this->phone;\n }", "public function getHuman_phone()\n {\n return $this->human_phone;\n }", "public function getPosterPhone() {\n\t\treturn $this->posterPhone;\n\t}", "public static function findByPhone($phone)\n {\n return static::find()->where(['phone' => $phone])->one();\n }", "public function show(Phones $phone)\n {\n return new PhonesResource($phone);\n }", "public function getReadableContact()\n {\n return Extra::getBeautifulPhone($this->contact);\n }", "public function getPhoneNumber()\n {\n return $this->getParameter('phoneNumber');\n }" ]
[ "0.7334191", "0.7334191", "0.7149543", "0.7094013", "0.70562094", "0.7025061", "0.7022897", "0.69494003", "0.6903554", "0.6801412", "0.6782116", "0.6742409", "0.6729517", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.6727836", "0.66703075", "0.66703075", "0.66630876", "0.66616845", "0.66530955", "0.6647198", "0.66321456", "0.66235346", "0.6622486", "0.6617876", "0.65650487", "0.65438265", "0.6541607", "0.6531933", "0.6498995", "0.6458777", "0.6458777", "0.6458777", "0.6443251", "0.6404733", "0.6334787", "0.6334704", "0.63253546", "0.6296234", "0.626456", "0.62611455", "0.6183002", "0.61806494", "0.61532974", "0.61518717", "0.6140979", "0.6138651", "0.61253273", "0.61240757", "0.6118313", "0.60830885", "0.60766757", "0.60254884", "0.60173225", "0.60173225", "0.60173225", "0.60173225", "0.60173225", "0.60173225", "0.59932595", "0.59847206", "0.59651434", "0.5953312", "0.5947811", "0.5935712", "0.5930272", "0.59289795", "0.59289014", "0.59269583", "0.589255", "0.58875954", "0.5876589", "0.5869117", "0.5869096", "0.5861339", "0.5855428", "0.5854428", "0.584927", "0.5829514", "0.5819338", "0.5803556", "0.5802068", "0.57762325", "0.5744816", "0.5740451", "0.57190895", "0.5715411", "0.5689518" ]
0.0
-1
Adds the given class to the element options
public function addClass(array $options = [], $class = null, $key = 'class') { if (is_array($class)) { $class = implode(' ', array_unique(array_map('trim', $class))) ; } if (isset($options[$key])) { $optClass = $options[$key]; if (is_array($optClass)) { $optClass = trim(implode(' ', array_unique(array_map('trim', $optClass)))); } } if (isset($optClass) && $optClass) { $options[$key] = $optClass.' '.$class ; } else { $options[$key] = $class ; } return $options ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Html_CSS_Add($class,&$options)\n {\n if (empty($options[ \"CLASS\" ]))\n {\n $options[ \"CLASS\" ]=array();\n }\n elseif(!is_array($options[ \"CLASS\" ]))\n {\n $options[ \"CLASS\" ]=array($options[ \"CLASS\" ]);\n }\n\n array_push($options[ \"CLASS\" ],$class);\n\n $options[ \"CLASS\" ]=join(\",\",$options[ \"CLASS\" ]);\n }", "function Html_CSS_Set($class,&$options)\n {\n $options[ \"CLASS\" ]=$class;\n }", "public function addClass($options = array(), $class = null, $key = 'class') {\n if (isset($options[$key]) && trim($options[$key])) {\n $oClasses = explode(' ', $options[$key]);\n $nClasses = explode(' ', $class);\n foreach($nClasses as $nClass) {\n if(!in_array($nClass, $oClasses)) {\n $options[$key] .= ' ' . $class;\n $oClasses[] = $nClass;\n }\n }\n } else {\n $options[$key] = $class;\n }\n return $options;\n }", "private function computeClassAttribute(): void\n {\n $classes = $this->options['class'] ?? null;\n $paramClasses = $this->getRenderer()->getParam('class');\n\n if (null !== $classes || null !== $paramClasses) {\n $this->attributes['class'] = array_merge(\n $this->attributes['class'],\n $classes !== null ? is_array($classes) ? $classes : explode(' ', $classes) : [],\n $paramClasses !== null ? is_array($paramClasses) ? $paramClasses : explode(' ', $paramClasses) : []\n );\n }\n }", "public function add_class($class)\n\t{\n\t\t$this->config['class'] .= ' '.$class;\n\t\treturn $this;\n\t}", "public function addClass($class) {\n\t\t$this->class .= $class.' ';\n\t}", "protected function additionalOptions(&$opts)\r\n {\r\n if (isset($this->options['class']) && $this->options['class'])\r\n $opts['cssClass'] = '\"'.$this->options['class'].'\"';\r\n else\r\n throw new DojoEffectException('DojoRemoveClassEffect requires a class to add in the options.');\r\n }", "public static function AddClass($class, $element) {\n return 'Html.AddClass(\\'' . $element . '\\',\\'' . $class . '\\');';\n }", "private static function add_class($attributes, $class) {\n if(isset($attributes['class'])) {\n $attributes['class'] .= ' '.$class;\n } else {\n $attributes['class'] = $class;\n }\n return $attributes;\n }", "public function add_class( $class = null ) {\n\t\t\n\t\tif ( !is_string( $class ) ) return;\n\t\t\n\t\t$this->classes = Halp::_add_class( $class, $this->classes );\n\t\n\t}", "function gymfitness_a_class($atts,$item,$args) {\n \n $atts['class'] = 'nav-link pl-3 pr-3';\n \n return $atts;\n}", "protected function addClass($node,$class)\n {\n $existing = $node->getAttribute('class');\n if (strlen($existing)>0) $existing .= ' '; // add space delimiter\n $existing .= $class;\n $node->setAttribute('class',$existing);\n }", "public function testChosenClassAttribute()\n {\n $class = $this->Chosen->getSetting('class');\n $dom = new DomDocument();\n $html = $this->getSelectInput();\n $dom->loadHTML($html);\n $select = $dom->getElementsByTagName('select')->item(0);\n $this->assertNotNull($select);\n $this->assertInstanceOf('DOMElement', $select);\n $this->assertEqual($class, $select->getAttribute('class'));\n\n // Adding a class to the options array should not remove the chosen class\n $customClass = 'my-custom-class';\n $dom = new DomDocument();\n $html = $this->getSelectInput(array('class' => $customClass));\n $dom->loadHTML($html);\n $select = $dom->getElementsByTagName('select')->item(0);\n $this->assertNotNull($select);\n $this->assertInstanceOf('DOMElement', $select);\n $this->assertEqual(\"{$customClass} {$class}\", $select->getAttribute('class'));\n }", "public function addClass(string $class): HtmlElementInterface;", "function themesflat_custom_shortcodes_class( $classes, $atts = array(), $tag = '' ) {\n\t\tif ( function_exists( 'vc_shortcode_custom_css_class' ) && ! empty( $atts['css'] ) ) {\n\t\t\t$classes[] = vc_shortcode_custom_css_class( $atts['css'], ' ' );\n\t\t}\n\n\t\treturn $classes;\n\t}", "public function addElementClass(string $class)\n {\n $classes = explode(' ', $this->getElement()->getAttribute('class'));\n\n if ( ! in_array($class, $classes)) {\n $classes[] = $class;\n }\n\n $this->getElement()->setAttribute('class', implode(' ', $classes));\n\n return $this;\n }", "function ninja_forms_add_class($classes) {\n\t$classes .= ' nav-menus-php';\n\t// return the $classes array\n\treturn $classes;\n}", "public function add_body_class( $class ) {\n\n global $post_ID;\n\n // Grab the existing value for the custom template\n $active_editor = get_post_meta( $post_ID, '_cv_active_editor', true );\n $active_editor = cv_filter( $active_editor, array( 'default', 'advanced' ) );\n\n // Add the appropriate class\n return 'advanced' === $active_editor ? 'cv-builder-active' : 'cv-builder-hidden';\n\n }", "public function addClass(string $class): self\n\t{\n\t\t$this->getElementPrototype()->class[] = $class;\n\t\treturn $this;\n\t}", "function add_cssclass($class_to_add, $classes)\n {\n }", "public function setClassName(string $class): void {\n\t\t$this->setAttribute(\"class\", [$class]);\n\t}", "public function setClass($class) {\r\n\t$this->class = $class;\r\n }", "public function setClass($class){\n $this->class=$class;\n }", "public function setSubmitClass($class) {\n\n\t\t//$this->layout->render();\n\t\t$this->data['submit_class'] = $class;\n\t}", "public function set_item_class($class = 'SimplePie_Item')\n {\n }", "function addClass($class){\n\t\tif(!$this->isConfigured()) return false;\n\n\t\treturn $this->getTemplateObj()->addClass($class);\n\t}", "public function setClass(array $class) {\n \t$this->_class = $class;\n \treturn $this;\n }", "public function addClass(DOMElement $element, $class) {\n $classes = $element->getAttribute(\"class\");\n $classes .= \" $class\";\n $element->setAttribute(\"class\", trim($classes));\n }", "function studeon_vc_add_params_classes($classes, $sc, $atts) {\n\t\tif (in_array($sc, array('vc_section', 'vc_row', 'vc_row_inner', 'vc_column', 'vc_column_inner', 'vc_column_text'))) {\n\t\t\tif (!empty($atts['scheme']) && !studeon_is_inherit($atts['scheme']))\n\t\t\t\t$classes .= ($classes ? ' ' : '') . 'scheme_' . $atts['scheme'];\n\t\t} else if (in_array($sc, array('vc_empty_space'))) {\n\t\t\tif (!empty($atts['alter_height']) && !studeon_is_off($atts['alter_height']))\n\t\t\t\t$classes .= ($classes ? ' ' : '') . 'height_' . $atts['alter_height'];\n\t\t\tif (!empty($atts['hide_on_mobile'])) {\n\t\t\t\tif (strpos($atts['hide_on_mobile'], '1')!==false)\t$classes .= ($classes ? ' ' : '') . 'hide_on_mobile';\n\t\t\t\tif (strpos($atts['hide_on_mobile'], '2')!==false)\t$classes .= ($classes ? ' ' : '') . 'hide_on_notebook';\n\t\t\t\tif (strpos($atts['hide_on_mobile'], '3')!==false)\t$classes .= ($classes ? ' ' : '') . 'hide_on_tablet';\n\t\t\t}\n\t\t} else if (in_array($sc, array('vc_progress_bar'))) {\n\t\t\tif (!empty($atts['narrow']) && (int) $atts['narrow']==1)\n\t\t\t\t$classes .= ($classes ? ' ' : '') . 'vc_progress_bar_narrow';\n\t\t} else if (in_array($sc, array('vc_message'))) {\n\t\t\tif (!empty($atts['closeable']) && (int) $atts['closeable']==1)\n\t\t\t\t$classes .= ($classes ? ' ' : '') . 'vc_message_box_closeable';\n\t\t}\n\t\treturn $classes;\n\t}", "public function setClass($class){\n $this->_class = $class;\n }", "public function setClass($class);", "public function addClass(array &$attrs, $class)\n {\n $this->ensureClass($attrs);\n $attrs['class'][] = $class;\n }", "public function field_option_class( $class, $field ) {\n\n\t\tif ( 'email' === $field['type'] ) {\n\t\t\tif ( isset( $field['confirmation'] ) ) {\n\t\t\t\t$class = 'wpforms-confirm-enabled';\n\t\t\t} else {\n\t\t\t\t$class = 'wpforms-confirm-disabled';\n\t\t\t}\n\t\t}\n\t\treturn $class;\n\t}", "public function set_caption_class($class = 'SimplePie_Caption')\n {\n }", "public function addClassName(string $class): void {\n\t\t$this->m_attributes[\"class\"][] = $class;\n\t}", "public function addClass($class)\n {\n $this->classes .= \" \" . $class;\n return $this;\n }", "public function testAddClass()\n {\n $opts = [\n 'class' => 'class-1',\n ];\n $opts = $this->trait->addClass($opts, ' class-1 class-2 ');\n $this->assertEquals($opts, [\n 'class' => 'class-1 class-2',\n ]);\n // Test with an array\n $opts = $this->trait->addClass($opts, ['class-1', 'class-3']);\n $this->assertEquals($opts, [\n 'class' => 'class-1 class-2 class-3',\n ]);\n }", "public function setClass($class)\n {\n $this->class = $class;\n }", "public function addColgroupClass($class)\n {\n if (is_array($class)) {\n self::slugArray($class);\n $this->html_colgroup_class = array_unique(array_merge($this->html_colgroup_class, $class));\n } elseif (is_string($class)) {\n $this->html_colgroup_class[] = self::slug($class);\n $this->html_colgroup_class = array_unique($this->html_colgroup_class);\n }\n }", "public function add_class($class_name)\n {\n }", "public function setClass($class)\n {\n $this->class = str_replace(array('/', '.'), '', $class);\n }", "function setClass($a_class)\n\t{\n\t\tif (is_object($this->mob_node))\n\t\t{\n\t\t\t$mal_node = $this->mob_node->first_child();\n\t\t\tif (is_object($mal_node))\n\t\t\t{\n\t\t\t\tif (!empty($a_class))\n\t\t\t\t{\n\t\t\t\t\t$mal_node->set_attribute(\"Class\", $a_class);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($mal_node->has_attribute(\"Class\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$mal_node->remove_attribute(\"Class\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n\t{\n\t\t$this->options = array(\n\t\t\t'class.first' => 'first',\n\t\t\t'class.last' => 'last',\n\t\t\t'class.single' => 'single',\n\t\t);\n\t}", "protected function set_class( $class ) {\n\t\t$this->class = $class;\n\t\t$this->is_class_set = true;\n\t}", "function addClass($class) {\r\n if(empty($this->classes) || !$this->classes[$class]) {\r\n $this->classes[$class] = array();\r\n return true;\r\n //map array to class properties/methods\r\n }\r\n return false;\r\n }", "public function set_category_class($class = 'SimplePie_Category')\n {\n }", "public function addClass($class) {\n \t\n \t// si la classe n'existe pas deja, on la rajoute\n \tif (!$this->hasClass($class)) {$this->_class[] = $class;}\n \t\n \treturn $this;\n }", "public function setFooterClass($class) {\r\n $this->footerClass = \"class=\\\"$class\\\"\";\r\n }", "function wck_add_metabox_classes( $classes ){\r\n\t\tarray_push($classes,'wck-post-box');\r\n\t\treturn $classes;\r\n\t}", "public function setHeaderClass($class) {\r\n $this->headerClass = \"class=\\\"$class\\\"\";\r\n }", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "protected function setClassAttribute(DOMElement $node)\n {\n if ( ! $class = $this->settings->class) {\n return;\n }\n\n $classes = $node->getAttribute('class');\n\n $node->setAttribute('class', \"$classes $class\");\n }", "public function setHeaderClass($class) {\n $this->headerClass = \"class=\\\"$class\\\"\";\n }", "public function setFooterClass($class) {\n $this->footerClass = \"class=\\\"$class\\\"\";\n }", "function build_class_attribute($required, $extra_classes) {\n\t// Prepare the options\n\t// This allows people to pass in undefined for $classes (instead of an empty array) if they want it to be empty\n\tif (!is_array($extra_classes)) {\n\t\t$extra_classes = array();\n\t}\n\t\n\t// Build the class string\n\t$classes = array();\n\tif ($required) {\n\t\t$classes[] = 'required';\n\t}\n\t$classes = array_merge($classes, array_map('htmlentities', $extra_classes));\n\t$classes_html = 'class=\"' . join(' ', $classes) . '\"';\n\treturn $classes_html;\n}", "public function getOptionsClass();", "function cera_grimlock_posts_class( $class = '' ) {\n\t$classes = cera_grimlock_to_array( $class );\n\techo 'class=\"' . esc_attr( join( ' ', array_unique( apply_filters( 'grimlock_posts_class', $classes ) ) ) ) . '\"';\n}", "function jnews_post_class( $class = '', $post_id = null ) {\n return 'class=\"' . join( ' ', get_post_class( $class, $post_id ) ) . '\"';\n }", "function add_class_for_form_grid( $class, $id, $args ) {\n\t$class[] = 'give-form-grid-wrap';\n\n\tforeach ( $class as $index => $item ) {\n\t\tif ( false !== strpos( $item, 'give-display-' ) ) {\n\t\t\tunset( $class[ $index ] );\n\t\t}\n\t}\n\n\treturn $class;\n}", "function jetpack_the_content_customizer_class( $new_class = null ) {\n\tstatic $class;\n\tif ( isset( $new_class ) ) {\n\t\t// Assign a new class and return.\n\t\t$class = $new_class;\n\t} elseif ( isset( $class ) ) {\n\t\t// Reset the class after getting value.\n\t\t$prev_class = $class;\n\t\t$class = null;\n\t\treturn $prev_class;\n\t} else {\n\t\t// Return default class value.\n\t\treturn 'output-the-content';\n\t}\n}", "function post_class( $class = '', $post_id = null ) {\n\t\techo 'class=\"' . join( ' ', get_post_class( $class, $post_id ) ) . '\"';\n\t}", "private function addToSidebar($class)\n {\n $extender = $this->container->make($class);\n\n $this->menu->add($extender->extendWith($this->menu));\n }", "public function setUlClass(string $ulClass);", "public function set_rating_class($class = 'SimplePie_Rating')\n {\n }", "public function setClass($class)\n {\n $this->classes = $class;\n return $this;\n }", "public function addClass($addClass)\n {\n $this->option('addclass', $addClass);\n\n return $this;\n }", "function cera_grimlock_content_class( $class = '' ) {\n\t$classes = cera_grimlock_to_array( $class );\n\techo 'class=\"' . esc_attr( join( ' ', array_unique( apply_filters( 'grimlock_content_class', $classes ) ) ) ) . '\"';\n}", "public function setClass(string $class_name);", "function quadro_header_extras_class($classes) {\n\t\t$classes[] = 'header-extras-on';\n\t\treturn $classes;\n\t}", "function uvasomcmedept_add_classes( $classes ) {\n\t$classes[] = 'uvasomcmedept';\n\treturn $classes;\n}", "public function addClassToList($class, $listName, $options = array())\n {\n return $this->addToList(\n array_merge(\n array(\n 'child' => $class,\n 'list' => $listName,\n ),\n $options\n )\n );\n }", "public function setBodyClass($class) {\r\n $this->bodyClass = \"class=\\\"$class\\\"\";\r\n }", "protected function addErrorClassBS4(&$options)\n {\n $attributeName = Html::getAttributeName($this->attribute);\n if (!$this->form->isBs(3) &&\n $this->model->hasErrors($attributeName) &&\n $this->form->validationStateOn === ActiveForm::VALIDATION_STATE_ON_CONTAINER) {\n Html::addCssClass($options, 'is-invalid');\n }\n }", "protected function classes()\n {\n $this->label_attributes['class'] = ['columns'];\n $this->label_attributes['style']['float'] = 'left';\n $this->input_attributes['class'] = ['btn'];\n parent::classes();\n }", "public static function addClass(array $attributes, string|array $class = ''): array {\n\t\t$attributes['class'] = CSS::addClass($attributes['class'] ?? '', $class);\n\t\treturn $attributes;\n\t}", "public function set_enclosure_class($class = 'SimplePie_Enclosure')\n {\n }", "function greenfields_add_active_class($classes, $item)\n{\n if (in_array('current-menu-item', $classes)) {\n $classes[] = \"active\";\n }\n\n return $classes;\n}", "function woocommerce_isotope_cssclass($classes, $class, $ID) {\n\tif (is_tax('product_cat') || is_tax('product_tag') || is_post_type_archive('product')) {\n\t\t$categories = wp_get_object_terms( $ID, 'product_cat', 'slug' );\n\t\tforeach ($categories as $category) {\n\t\t\tarray_push($classes, 'category-'.$category->slug);\n\t\t}\n\t}\n\treturn $classes;\n}", "function kvell_edge_add_woocommerce_shortcode_class( $classes ) {\n\t\t$woocommerce_shortcodes = array(\n\t\t\t'woocommerce_order_tracking'\n\t\t);\n\t\t\n\t\tforeach ( $woocommerce_shortcodes as $woocommerce_shortcode ) {\n\t\t\t$has_shortcode = kvell_edge_has_shortcode( $woocommerce_shortcode );\n\t\t\t\n\t\t\tif ( $has_shortcode ) {\n\t\t\t\t$classes[] = 'edgtf-woocommerce-page woocommerce-account edgtf-' . str_replace( '_', '-', $woocommerce_shortcode );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $classes;\n\t}", "public function addClass(string $class): Field\n {\n $this->cssClasses[] = $class;\n\n return $this;\n }", "public function addExtraClass($class)\n {\n //split at white space\n $classes = preg_split('/\\s+/', $class ?? '');\n foreach ($classes as $class) {\n //add classes one by one\n $this->extraClasses[$class] = $class;\n }\n return $this;\n }", "public function set_restriction_class($class = 'SimplePie_Restriction')\n {\n }", "public function setBodyClass($class) {\n $this->bodyClass = \"class=\\\"$class\\\"\";\n }", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item';\n return $classes;\n}", "public function addClass(){\n return view(\"Admin.ClassSec.addclass\");\n }", "private function addErrorClass($name, &$options = [])\n {\n if (isset($options['class'])) {\n $options['class'] .= ($this->hasError($name) ? ' error' : '');\n } elseif ($this->hasError($name)) {\n $options['class'] = 'error';\n }\n }", "function setClass($value){\n\t\t$this->_class=$value;\n\t\treturn $this;\n\t}", "function SetClass($class){\n\t\t$this->nmclass=$class;\n\t\treturn 0;\n\t}", "abstract public function getOptionsClass(): string;", "public function getOptionsClassname();", "public function _init() {\n parent::_init();\n if(empty($this->options))\n \t $this->options = [];\n \tif (empty($this->options['class']))\n \t $this->options['class'] = '';\n \t$this->add_option($this->options['class'], 'btn');\n }", "public function build_metabox_priority_selector($_class, $_active = \"\") {\r\n \t$mpriorities = wcff()->dao->load_metabox_priorities();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \tif (count($mpriorities) > 0) {\r\n \t\tforeach ($mpriorities as $mpkey => $mpvalue) {\r\n \t\t\t$selected = ($mpkey == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($mpkey) . '\" ' . $selected . '>' . esc_html($mpvalue) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "public static function navigation_class( $class = '' ) {\n $classes = array( 'navigation page-navigation' );\n\n if ( ! empty( $class ) ) {\n if ( ! is_array( $class ) ) {\n $class = preg_split( '#\\s+#', $class );\n }\n $classes = array_merge( $classes, $class );\n } else {\n // Ensure that we always coerce class to being an array.\n $class = array();\n }\n $classes = apply_filters( 'insight_navigation_class', $classes, $class );\n\n echo 'class=\"' . esc_attr( join( ' ', $classes ) ) . '\"';\n }", "function setCSSClass($cssClass) {\n\t\t$this->cssclass = $cssClass;\n\t}", "public function set_copyright_class($class = 'SimplePie_Copyright')\n {\n }", "function ArrayToClass ($array) {\n \t$classes = implode(' ',$array);\n\n \tif (!empty($classes)) {\n \t\treturn 'class=\"' . $classes . '\"';\n \t}\n }", "static public function addCustomElementTag($tag, $class)\n\t{\n\t\tself::$_CUSTOM[$tag] = \\Framework\\Base\\CKernel::getInstance()->convertArbitrageNamespaceToPHP($class);\n\t}", "function wv_add_woocommerce_classs($classes) {\n $classes[] = \"woocommerce woocommerce-page\";\n return $classes;\n }", "function class_by_arguments($classNames, $args, $classNamesOnly = false) {\n\t\t$classNames = str_replace(\" \",\"\",$classNames);\n\t\t$dataString = \"data-update_class_with='$classNames' \";\n\t\t$classNames = explode(',',$classNames);\n\t\t$classString = \"class='\";\n\t\t$classes = \"\";\n\n\t\tforeach($classNames as $class)\n\t\t{\n\t\t\t$classes .= \"ac-$class-\".str_replace(\" \",\"_\",$args[$class]).\" \";\n\t\t}\n\n\t\tif($classNamesOnly) return $classes;\n\t\treturn $classString .$classes.\"' \".$dataString;\n\t}", "function wprt_preloader_class() {\n\t// Get preloader option from theme mod\n\t$class = wprt_get_mod( 'preloader', 'animsition' );\n\n\t// Return classes for element\n\treturn esc_attr( $class );\n}" ]
[ "0.736083", "0.7319217", "0.6949275", "0.6916004", "0.6856451", "0.6813059", "0.6812957", "0.6481236", "0.6479111", "0.6473873", "0.6448002", "0.6433297", "0.6428669", "0.63693374", "0.63535833", "0.63302654", "0.63106817", "0.63017637", "0.629639", "0.627731", "0.6263095", "0.62353283", "0.6227455", "0.6153945", "0.61495537", "0.61335593", "0.61208314", "0.61195064", "0.6114292", "0.6099915", "0.6093785", "0.6083275", "0.6072055", "0.6068071", "0.60678685", "0.60586786", "0.6049875", "0.60212606", "0.6011818", "0.60078776", "0.60066485", "0.5961717", "0.59517217", "0.5930009", "0.5879725", "0.58633083", "0.5854609", "0.58536905", "0.58392215", "0.5821352", "0.581413", "0.581317", "0.58015114", "0.57945997", "0.57737315", "0.5752068", "0.5748576", "0.5719618", "0.5690009", "0.56707096", "0.56491584", "0.5645577", "0.564349", "0.56395674", "0.56316805", "0.56181675", "0.56128556", "0.56033087", "0.55997133", "0.55789155", "0.5578035", "0.55659974", "0.5564588", "0.55595344", "0.55537224", "0.5546661", "0.5543628", "0.55382526", "0.55248535", "0.5524801", "0.5522871", "0.5512195", "0.55015314", "0.5479709", "0.54643905", "0.5457278", "0.5452305", "0.5449176", "0.5448351", "0.5433161", "0.54321873", "0.54232895", "0.54159373", "0.54138887", "0.541288", "0.5407213", "0.54070824", "0.5402266", "0.5398614", "0.53827834" ]
0.6992845
2
Create a new navbar.
public function create ($brand, $options = []) { $this->_fixed = $this->_extractOption('fixed', $options, false) ; unset($options['fixed']) ; $this->_responsive = $this->_extractOption('responsive', $options, false) ; unset($options['responsive']) ; $this->_static = $this->_extractOption('static', $options, false) ; unset($options['static']) ; $this->_inverse = $this->_extractOption('inverse', $options, false) ; unset($options['inverse']) ; $this->_fluid = $this->_extractOption('fluid', $options, false); unset($options['fluid']); /** Generate options for outer div. **/ $options = $this->addClass($options, 'navbar navbar-default') ; if ($this->_fixed !== false) { $options = $this->addClass($options, 'navbar-fixed-'.$this->_fixed) ; } else if ($this->_static !== false) { $options = $this->addClass($options, 'navbar-static-top') ; } if ($this->_inverse !== false) { $options = $this->addClass($options , 'navbar-inverse') ; } $toggleButton = '' ; $rightOpen = '' ; if ($this->_responsive) { $toggleButton = $this->Html->tag('button', implode('', array( $this->Html->tag('span', __('Toggle navigation'), array('class' => 'sr-only')), $this->Html->tag('span', '', array('class' => 'icon-bar')), $this->Html->tag('span', '', array('class' => 'icon-bar')), $this->Html->tag('span', '', array('class' => 'icon-bar')) )), array( 'type' => 'button', 'class' => 'navbar-toggle collapsed', 'data-toggle' => 'collapse', 'data-target' => '.navbar-collapse' ) ) ; $rightOpen = $this->Html->tag('div', null, ['class' => 'navbar-collapse collapse']) ; } if ($brand) { if (is_string($brand)) { $brand = $this->Html->link ($brand, '/', ['class' => 'navbar-brand', 'escape' => false]) ; } else if (is_array($brand) && array_key_exists('url', $brand)) { $brandOptions = $this->_extractOption ('options', $brand, []) ; $brandOptions = $this->addClass ($brandOptions, 'navbar-brand') ; $brand = $this->Html->link ($brand['name'], $brand['url'], $brandOptions) ; } $rightOpen = $this->Html->tag('div', $toggleButton.$brand, ['class' => 'navbar-header']).$rightOpen ; } /** Add and return outer div openning. **/ return $this->Html->tag('div', null, $options).$this->Html->tag('div', null, ['class' => $this->_fluid ? 'container-fluid' : 'container']).$rightOpen ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view(\"backend.navbars.create\");\n }", "public function create()\n {\n return view('navbar.create');\n }", "Public function Anavbar(){\n\t\n\t}", "function navbar()\r\n {\r\n }", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "public function create()\n {\n //\n\n return view('panel.pages.Createpages.nav_create');\n }", "public function generateNavbar(){\n echo \"<nav class='navbar navbar-expand-lg navbar-light bg-light fixed-top'>\n <a class='navbar-brand' href='decks.php'>Flashcards app</a>\n <button class='navbar-toggler' type='button' data-toggle='collapse' data-target='#navbarTogglerDemo01' aria-controls='navbarTogglerDemo01' aria-expanded='false' aria-label='Toggle navigation'>\n <span class='navbar-toggler-icon'></span>\n </button>\n <div class='collapse navbar-collapse' id='navbarTogglerDemo01'>\n <ul class='navbar-nav mr-auto mt-2 mt-lg-0'>\n <li class='nav-item'>\n <a class='nav-link' href='decks.php'>Decks</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='new_deck.php'>New deck</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='account.php'>Account</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='includes/logout.inc.php'>Logout</a>\n </li>\n </ul>\n </div>\n </nav>\";\n }", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "public static function GenerateNavbar($menu)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'id' => null,\n\t\t\t\t'class' => null,\n\t\t\t\t'wrapper' => 'nav',\n\t\t\t\t'create_url' => function ($url) {\n\t\t\t\t\treturn $url;\n\t\t\t\t},\n\t\t\t);\n\t\t\t\n\t\t\t$menu = array_replace_recursive($default, $menu);\n\t\t\t\n\t\t\t// Function to create urls\n\t\t\t$createUrl = $menu['create_url'];\n\t\t\t\n\t\t\t// Create the ul li menu from the array, use an anonomous recursive function that returns an array of values.\n\t\t\t$createMenu = function ($items, $callback) use (&$createMenu, $createUrl) \n\t\t\t{\n\t\t\t\t$html = null;\n\t\t\t\t$hasItemIsSelected = false;\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) \n\t\t\t\t{\n\t\t\t\t\t// has submenu, call recursivly and keep track on if the submenu has a selected item in it.\n\t\t\t\t\t$submenu = null;\n\t\t\t\t\t$selectedParent = null;\n\t\t\t\t\t$hasSubmenu \t= null; \n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['submenu'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$hasSubmenu = \" &#9662;\";\n\t\t\t\t\t\tlist($submenu, $selectedParent) = $createMenu($item['submenu']['items'], $callback);\n\t\t\t\t\t\t$selectedParent = $selectedParent ? \"selected-parent \" : null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['url']))\n\t\t\t\t\t\t// Check if the current menuitem is selected\n\t\t\t\t\t\t$selected = $callback($item['url']) ? \"selected \" : null;\n\t\t\t\t\telse\n\t\t\t\t\t\t$selected = NULL; \n\t\t\t\t\t\n\t\t\t\t\t// Is there a class set for this item, then use it\n\t\t\t\t\t$class = isset($item['class']) && ! is_null($item['class']) ? $item['class'] : null;\n\t\t\t\t\t\n\t\t\t\t\t// Prepare the class-attribute, if used\n\t\t\t\t\t$class = ($selected || $selectedParent || $class) ? \" class='{$selected}{$selectedParent}{$class}' \" : null;\n\t\t\t\t\t\n\t\t\t\t\t// Add the menu item\n\t\t\t\t\t$url = isset($item['url']) ? $createUrl($item['url']) : NULL;\n\t\t\t\t\tif (!isset($item['show']) || $item['show'] == TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($url)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active = (basename($_SERVER['REQUEST_URI']) == $url || (strtok($url,'?') == basename($_SERVER['PHP_SELF']) && $hasSubmenu) ? '' : '');\n\t\t\t\t\t\t\tif ($active == '▸ ') \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($hasSubmenu)\n\t\t\t\t\t\t\t\t\tself::$parent = $item; \n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tself::$child = $item; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>$active<a href='{$url}' title='{$item['title']}'>{$item['text']}{$hasSubmenu}</a>{$submenu}</li>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>{$item['text']}{$hasSubmenu}{$submenu}</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// To remember there is selected children when going up the menu hierarchy\n\t\t\t\t\tif ($selected) {\n\t\t\t\t\t\t$hasItemIsSelected = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return the menu\n\t\t\t\treturn array(\"\\n<ul>$html</ul>\\n\", $hasItemIsSelected);\n\t\t\t};\n\t\t\t\n\t\t\t// Call the anonomous function to create the menu, and submenues if any.\n\t\t\tlist($html, $ignore) = $createMenu($menu['items'], $menu['callback']);\n\t\t\t\n\t\t\t\n\t\t\t// Set the id & class element, only if it exists in the menu-array\n\t\t\t$id = isset($menu['id']) ? \" id='{$menu['id']}'\" : null;\n\t\t\t$class = isset($menu['class']) ? \" class='{$menu['class']}'\" : null;\n\t\t\t$wrapper = $menu['wrapper'];\n\t\t\t\n\t\t\treturn \"\\n<{$wrapper}{$id}{$class}>{$html}</{$wrapper}>\\n\";\n\t\t}", "function ppNavbar ($menuitems, $selected='', $parms='') {\n global $_CONF;\n\n $navbar = new Template($_CONF['path_layout'] . 'navbar');\n $navbar->set_file (array (\n 'navbar' => 'navbar.thtml',\n 'menuitem' => 'menuitem.thtml',\n ));\n $navbar->set_var ('xhtml', XHTML);\n for ($i=1; $i <= count($menuitems); $i++) {\n $parms = explode( \"=\",current($menuitems) );\n $navbar->set_var( 'link', current($menuitems));\n if (key($menuitems) == $selected) {\n $navbar->set_var( 'cssactive', 'id=\"active\"');\n $navbar->set_var( 'csscurrent','id=\"current\"');\n } else {\n $navbar->set_var( 'cssactive', '');\n $navbar->set_var( 'csscurrent','');\n }\n $navbar->set_var( 'label', key($menuitems));\n $navbar->parse( 'menuitems', 'menuitem', true );\n next($menuitems);\n }\n $navbar->parse ('output', 'navbar');\n $retval = $navbar->finish($navbar->get_var('output'));\n return $retval;\n}", "public function render()\n {\n return view('components.navbar');\n }", "public function updateNavbar()\n {\n if(! array_key_exists ( 'navbar', $this->options['paths'] ) )\n {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/navbar.blade.php';\n $target = base_path($this->options['paths']['navbar']);\n $hook = '<!-- bread_navbar -->';\n\n $this->updateFileContent($target, $hook, $file);\n }", "public function create()\n {\n $menu = new Menu();\n $menus = Menu::pluck( 'label', 'id' )->toArray();\n return view( 'navigation.add', compact('menus', 'menu') );\n }", "public function render()\n\t{\n\t\treturn view('components.navbar');\n\t}", "public function render()\n {\n return view('dwbtui::components.navbar');\n }", "function create_nav_bar()\n{\n $menus = array\n (\n 'Project' => array\n (\n array('label' => 'Create Project', 'url' => 'create_project.php'),\n array('label' => 'Search Projects', 'url' => 'search_projects.php')\n ),\n 'Experiment' => array\n (\n array('label' => 'Create Experiment', 'url' => 'create_experiment.php'),\n array('label' => 'Search Experiments', 'url' => 'search_experiments.php')\n ),\n 'Help' => array\n (\n array('label' => 'Report Issue', 'url' => '#'),\n array('label' => 'Request Feature', 'url' => '#')\n )\n );\n\n $selfExplode = explode('/', $_SERVER['PHP_SELF']);\n\n\n\n // nav bar and left-aligned content\n\n echo '<nav class=\"navbar navbar-default navbar-static-top\" role=\"navigation\">\n <div class=\"container-fluid\">\n <!-- Brand and toggle get grouped for better mobile display -->\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"index.php\" title=\"PHP Gateway with Airavata\">PGA</a>\n </div>\n\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n <ul class=\"nav navbar-nav\">';\n\n\n foreach ($menus as $label => $options)\n {\n isset($_SESSION['loggedin']) && $_SESSION['loggedin']? $disabled = '' : $disabled = ' class=\"disabled\"';\n\n echo '<li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">' . $label . '<span class=\"caret\"></span></a>\n <ul class=\"dropdown-menu\" role=\"menu\">';\n\n foreach ($options as $option)\n {\n $id = strtolower(str_replace(' ', '-', $option['label']));\n\n $option['url'] == $selfExplode[2]? $active = ' class=\"active\"' : $active = '';\n\n echo '<li' . $active . $disabled . '><a href=\"' . $option['url'] . '\" id=' . $id . '>' . $option['label'] . '</a></li>';\n }\n\n echo '</ul>\n </li>';\n }\n\n\n echo '</ul>\n\n <ul class=\"nav navbar-nav navbar-right\">';\n\n\n\n\n\n // right-aligned content\n\n if (isset($_SESSION['username']))\n {\n (USER_STORE === \"USER_API\" && !isset($_SESSION['excede_login'])) ? $link = \"user_profile.php\" : $link = \"index.php\";\n echo '<li><a href=\"' . $link . '\"><span class=\"glyphicon glyphicon-user\"></span> ' . $_SESSION['username'] . '</a></li>';\n }\n\n if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'])\n {\n echo '<li><a href=\"logout.php\"><span class=\"glyphicon glyphicon-log-out\"></span> Log out</a></li>';\n }\n elseif ($selfExplode[2] == 'login.php')\n {\n echo '<li><a href=\"create_account.php\"><span class=\"glyphicon glyphicon-user\"></span> Create account</a></li>';\n }\n elseif ($selfExplode[2] == 'create_account.php')\n {\n echo '<li><a href=\"login.php\"><span class=\"glyphicon glyphicon-log-in\"></span> Log in</a></li>';\n }\n elseif ($selfExplode[2] == 'index.php')\n {\n echo '<li><a href=\"create_account.php\"><span class=\"glyphicon glyphicon-user\"></span> Create account</a></li>';\n echo '<li><a href=\"login.php\"><span class=\"glyphicon glyphicon-log-in\"></span> Log in</a></li>';\n }\n\n\n echo '</ul>\n </div><!-- /.navbar-collapse -->\n </div><!-- /.container-fluid -->\n </nav>';\n}", "public function render()\n {\n return view('components.navbar-nav');\n }", "public function show(Navbar $navbar)\n {\n }", "function createNavBar($data, $displayGreeting = false, $helpLink = ''){\n\nglobal $base_url;\n\nprint \"<table width=100% class=\\\"yellowBorder\\\">\";\nprint \"<tr class=\\\"lightYellow\\\"><td width=10%>\"; //<b>NavBar : </b>\";\n\n$items = explode(\"|\", $data);\n\n$array_count = count($items);\n\nfor($i = 0; $i < $array_count; $i++){\n $piece = explode(\":\", $items[$i]);\n\n if($i == $array_count - 1){\n print \"<b>$piece[1]</b>\";\n }\n else{\n print \"<a class=\\\"menuLink\\\" href=\\\"$piece[0]\\\">$piece[1]</a>\";\n print \" > \";\n }\n}\nprint \"</td>\";\n\nif($displayGreeting){\n print \"<td align=center width=80%>\";\n print \"<b>Welcome \" . $_SESSION[\"fullname\"] . \"</b>\";\n print \"</td>\";\n}\n\nprint \"<td width=10% align=\\\"right\\\"><a class=menuLink target=\\\"_blank\\\" href=\\\"$base_url/help.php#$helpLink\\\">Help</a> :: <a class=\\\"menuLink\\\" href=\\\"$base_url/logout.php\\\">logout</a>\";\nprint \"</td></tr></table>\";\n}", "function nav(array $navLinks, $name = null, array $args = array())\n{\n if ($name !== null) {\n $navLinks = apply_filters($name, $navLinks, $args);\n }\n\n $menu = get_view()->navigation()->menu(new Omeka_Navigation($navLinks));\n\n if ($acl = get_acl()) {\n $menu->setRole(current_user())->setAcl($acl);\n }\n\n return $menu;\n}", "public function create()\n {\n return view('larape::pages.menu.create');\n }", "public function create()\n\t{\n\t\treturn Theme::View('menus::menus.create', $this->menu_repo->create());\n\t}", "public function create() {\n $menus = Menu::lists('name', 'id');\n $this->layout->content = View::make('admin.menus.create', array(\n 'menus' => $menus,\n ));\n }", "function nav_menu()\n{\n $menu = \"\";\n $menu .= '<ul class=\"nav navbar-nav navbar-right\">';\n $menu .= '<li><a href=\"'.site_url('#home').'\">Home</a></li>';\n $menu .= '<li><a href=\"'.site_url('#about').'\">About Me</a></li>';\n $menu .= '<li><a href=\"'.site_url('#whatdo').'\">What i do</a></li>';\n $menu .= '<li><a href=\"'.site_url('#work').'\">My Work</a></li>';\n $menu .= '<li><a href=\"'.site_url('blog').'\">Blog</a></li>';\n $menu .= '<li><a href=\"'.site_url('#contact').'\">Contact</a></li>';\n $menu .= '</ul>';\n return $menu;\n}", "public function render_navbar($items, $active = NULL) {\n $this->config['type_class'] = 'navbar-nav';\n return $this->render($items, $active); \n }", "function createAboutUsMenu () {\n $menu_name = __('About Us',CARE_TEXTDOMAIN);\n $menu_exists = wp_get_nav_menu_object( $menu_name );\n\n if( !$menu_exists) {\n $menu_id = wp_create_nav_menu($menu_name);\n\n // Set up default menu items\n wp_update_nav_menu_item($menu_id, 0, array(\n 'menu-item-title' => __('About Care',CARE_TEXTDOMAIN),\n // 'menu-item-classes' => 'home',\n 'menu-item-url' => home_url( '/about-care-centre/' ), \n 'menu-item-status' => 'publish'));\n }\n}", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "public function show(Navbar $navbar)\n {\n //\n }", "function ShowNavBar()\n{\n $navBar = \"\";\n //Navigation Start\n $navBar .= \"<nav class=\\\"navbar navbar-default navbar-sticky bootsnav\\\">\";\n $navBar .=\"<div class=\\\"container\\\">\";\n // Début Header Navigation\n $navBar .= \"<div class=\\\"navbar-header\\\">\";\n $navBar .=\"<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbar-menu\\\">\";\n $navBar .= \"<i class=\\\"fa fa-bars\\\"></i>\";\n $navBar .= \"</button>\";\n $navBar .= \"<a class=\\\"navbar-brand\\\" href=\\\"index.php\\\"><img src=\\\"./img/logo.png\\\" class=\\\"logo\\\" alt=\\\"Logo du site\\\"></a>\";\n $navBar .=\"</div>\";\n // Fin Header Navigation\n\n\n $navBar .= \"<div class=\\\"collapse navbar-collapse\\\" id=\\\"navbar-menu\\\">\";\n $navBar .= \"<ul class=\\\"nav navbar-nav navbar-left\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\";\n $navBar .= \"<li \".SetActivePage(\"index\") . \"><a href=\\\"index.php\\\">Accueil</a></li>\";\n //Affiche les liens de connexion et d'inscription si l'utilisateur n'est pas connecté\n if (!IsUserLoggedIn()) {\n $navBar .= \"<li \" .SetActivePage(\"login\") . \">\";\n $navBar .=\"<a href=\\\"login.php\\\">Se connecter</a>\";\n $navBar .=\"</li>\";\n $navBar .= \"<li \" .SetActivePage(\"signup\"). \">\";\n $navBar .= \"<a href=\\\"signup.php\\\">S'inscrire</a>\";\n $navBar .= \"</li>\";\n }\n //Sinon affiche les liens correspondant au type de l'utilisateur\n else \n {\n switch (GetUserType()) \n {\n //Affiche les liens correspondant au type Chercheur\n case \"Chercheur\":\n $navBar .= \"<li \" .SetActivePage(\"annonces\") . \">\";\n $navBar.= \"<a href=\\\"annonces.php\\\">Annonces</a>\";\n $navBar.= \"</li>\";\n $navBar.= \"<li \" .SetActivePage(\"wishlist\") . \">\";\n $navBar.= \"<a href=\\\"wishlist.php?idU=\".GetUserId().\"\\\">Ma Wishlist</a>\";\n $navBar.= \"</li>\";\n break;\n //Affiche les liens correspondant au type Annonceur\n case \"Annonceur\":\n $navBar .= \"<li \";\n if (isset($_GET['idU']))\n $navBar .= SetActivePage(\"annonces\");\n $navBar .= \">\";\n $navBar.=\"<a href=\\\"annonces.php?idU=\" . GetUserId() . \"\\\">Mes Annonces</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \" .SetActivePage(\"creer-annonce\"). \">\";\n $navBar.=\"<a href=\\\"creer-annonce.php\\\">Créer une annonce</a>\";\n $navBar.=\"</li>\";\n break;\n //Affiche les liens correspondant au type Administrateur\n case \"Admin\":\n $navBar .= \"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"utilisateurs\") \n $navBar .=SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=utilisateurs\\\">Gérer les utilisateurs</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"motscles\") $navBar .= SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=motscles\\\">Gérer les mots-clés</a>\";\n $navBar.=\" </li>\";\n break;\n }\n \n $navBar .= \"</ul>\";\n $navBar.=\"<ul class=\\\"nav navbar-nav navbar-right\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\"; \t\n $navBar.=\"<li><a href=\\\"logout.php\\\">Se déconnecter</a></li>\";\n }\n $navBar .= \"<li \".SetActivePage(\"faq\").\">\";\n $navBar .= \"<a href=\\\"faq.php\\\">Aide</a>\";\n $navBar.= \"</li>\";\n $navBar .= \"</ul>\";\n $navBar.=\"</div>\";\n $navBar.= \"</div>\" ;\n $navBar.=\"</nav>\";\n\n //Echo le contenu HTML de la barre de navigation\n echo $navBar;\n}", "public function create()\n {\n $breadcrumbs = [\n 'title' => __('admin.menus.breadcrumbs.title'),\n 'links' => [\n [\n 'href' => url('admin/menus'),\n 'text' => __('admin.menus.breadcrumbs.menu_index')\n ],\n [\n 'href' => url('#'),\n 'text' => __('admin.menus.breadcrumbs.add_menu')\n ]\n ]\n ];\n return view('admin.menus.create',compact( 'breadcrumbs'));\n }", "public function create() {\n\t\t$pages = Page::pluck('title', 'slug')->toArray();\n\t\treturn View('admin.menus.create', compact('pages'));\n\t}", "public function makeMenu() {}", "function getNavBar(){\r\n $barContent = \"\";\r\n \r\n $barContent .= '<ul class=\"nav navbar-nav\">';\r\n\t$barContent .= '<li><a class=\"active\" href=\"index.php\"><b>Home</b></a></li>';\r\n\t$barContent .= '<li><a class=\"active\" href=\"#\" onClick=\"ContactHandler()\"><b>Contact Info</b></a></li>';\r\n $barContent .= '</ul>';\r\n \r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"QRHandler()\"><b>CreateQR</b></a></li>';\r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"EventHandler()\"><b>Events</b></a></li>';\r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"PastEventHandler()\"><b>Events</b></a></li>';\r\n \r\n $barContent .= '<ul class=\"nav navbar-nav navbar-right\">';\r\n if(isUserLoggedIn())\r\n {\r\n\t\t$barContent .= '<li><a href=\"#\" onclick=\"javascript: performLogout()\"><b>Logout</b></a></li>';\r\n\t}\r\n else {\r\n $barContent .= '<div class=\"navbar-collapse collapse\"><form class=\"navbar-form navbar-right\" onSubmit=\"return false;\">' .\r\n\t\t\t\t\t\t\t'<div class=\"form-group\"><input type=\"text\" name=\"loginUsername\" id=\"loginUsername\" class=\"form-control\" placeholder=\"Email/User\"> </div>' .\r\n\t\t\t\t\t\t\t'<div class=\"form-group\"><input type=\"password\" name=\"password\" id=\"password\" class=\"form-control\" placeholder=\"Password\"> </div>' .\r\n\t\t\t\t\t\t\t'&nbsp;&nbsp;<button class=\"btn btn-success\" type=\"submit\" onclick=\"attemptLogin()\"><i class=\"glyphicon glyphicon-share icon-white\"></i>&nbsp;&nbsp;<b>Sign in</b></button>' .\r\n\t\t\t\t\t\t\t'&nbsp;&nbsp;<button class=\"btn btn-primary\" onClick=\"showRegistrationModal()\"/><i class=\"glyphicon glyphicon-user icon-white\"></i>&nbsp;&nbsp;<b>Sign Up!</b></button>' .\r\n\t\t\t\t\t\t'</form></div>';\r\n }\r\n $barContent .= '</ul>';\r\n\r\n return $barContent;\r\n}", "public function create()\n\t{\n\t\t$menuGroups = $this->getMenuGroups();\n\t\treturn view('components.system.menu.create', compact('menuGroups'));\n\t}", "function make_menu_bs($title) {\n\t$menu = '\n\t<nav class=\"navbar navbar-toggleable-md navbar-light bg-faded\">\n \t<button class=\"navbar-toggler navbar-toggler-right\" type=\"button\" data-toggle=\"collapse\" \n \t data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n \t<span class=\"navbar-toggler-icon\"></span>\n\t\t</button>\n\t\t<a class=\"navbar-brand\" href=\"home.php\">Trivia</a>\n\t\t<div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n \t<ul class=\"navbar-nav\">';\n\t$menu .= get_menu_items($title);\n\t$menu .= '\n\t\t\t</ul>\n\t\t</div>\n\t</nav>';\n\treturn $menu;\n}", "public function create_menu()\n\t{\n\t\t$obj = $this; // PHP 5.3 doesn't allow $this usage in closures\n\n\t\t// Add main menu page\n\t\tadd_menu_page(\n\t\t\t'Testimonials plugin', // page title\n\t\t\t'Testimonials', // menu title\n\t\t\t'manage_options', // minimal capability to see it\n\t\t\t'jststm_main_menu', // unique menu slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('main_menu'); // render main menu page template\n\t\t\t},\n\t\t\tplugins_url('images/theater.png', dirname(__FILE__)), // dashboard menu icon\n\t\t\t'25.777' // position in the dahsboard menu (just after the Comments)\n\t\t);\n\t\t// Add help page\n\t\tadd_submenu_page(\n\t\t\t'jststm_main_menu', // parent page slug\n\t\t\t'Testimonials plugin help', // page title\n\t\t\t'What is this?', // menu title\n\t\t\t'manage_options', // capability\n\t\t\t'jststm_help', // slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('help_page');\n\t\t\t}\n\t\t);\n\t}", "public function onSetupNavbar(KnpMenuEvent $event)\n {\n $menu = $event->getMenu();\n\n $menu->addChild(\n 'menu-label',\n ['label' => 'Main Navigation', 'childOptions' => $event->getChildOptions()]\n )->setAttribute('class', 'header');\n\n $menu->addChild(\n 'homepage',\n ['route' => 'homepage', 'label' => 'menu.homepage', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-tachometer-alt');\n\n $menu->addChild(\n 'forms',\n ['route' => 'forms', 'label' => 'menu.form', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fab fa-wpforms')->setExtra('badge', [\n 'color' => 'red',\n 'value' => 1,\n ]);\n\n $menu->addChild(\n 'context',\n ['route' => 'context', 'label' => 'AdminLTE context', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-code');\n\n $menu->addChild(\n 'menu-divider',\n ['label' => '<hr />']\n )->setExtra('safe_label', true);\n\n $menu->addChild(\n 'demo',\n ['label' => 'Demo', 'childOptions' => $event->getChildOptions(), 'options' => ['branch_class' => 'treeview']]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-right')->setExtra('badges', [\n ['value' => 2],\n ['value' => 'foo', 'color' => 'yellow'],\n ]);\n\n $menu->getChild('demo')->addChild(\n 'sub-demo',\n ['route' => 'forms2', 'label' => 'Form - Horizontal', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-down');\n\n $menu->getChild('demo')->addChild(\n 'sub-demo2',\n ['route' => 'forms3', 'label' => 'Form - Sidebar', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-up');\n\n if ($this->security->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $menu->addChild(\n 'logout',\n ['route' => 'fos_user_security_logout', 'label' => 'menu.logout', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-out-alt');\n } else {\n $menu->addChild(\n 'login',\n ['route' => 'fos_user_security_login', 'label' => 'menu.login', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-in-alt');\n }\n }", "public function create()\n\t{\n\t\treturn View::make('menus.create');\n\t}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "public function create()\n {\n $pages = Page::active()->get();\n $categories = Category::withDepth()->defaultOrder()->descendantsOf(1)->linkNodes();\n\n return view('berrier::admin.menus.create')\n ->with('menu', null)\n ->with(compact('pages'))\n ->with(compact('categories'));\n }", "function build_navBar()\n\t{\n\t\t$activeUser = $_SESSION['active_user'];\n\t\techo '<nav class=\"navbar navbar-inverse navbar-fixed-top\">';\n\t\techo '<div class=\"container-fluid\">';\n\t\techo '<div class=\"navbar-header\">';\n\t\techo '<button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">';\n\t\techo '<span class=\"sr-only\">Toggle navigation</span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '</button>';\n\t\techo '<a class=\"navbar-brand\" href=\"#\" style=\"font-family: titleFont;\">INFINITY</a>';\n\t\techo '</div>';\n\t\techo '<div id=\"navbar\" class=\"navbar-collapse collapse\">';\n\t\techo '<ul class=\"nav navbar-nav navbar-right\">';\n\t\techo '<li><a href=\"home.php\">Dashboard</a></li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"workouts.php\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Workouts <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"workouts.php\">My Workouts</a></li>';\n\t\techo '<li><a href=\"workoutLog.php\">My Log</a></li>';\n\t\techo '<li class=\"divider\"></li>';\n\t\techo '<li><a href=\"#\">Create Workout</a></li>';\n\t\techo '<li><a href=\"#\">Record Workout</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"groups.php\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Groups <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"groups.php\">My Groups</a></li>';\n\t\techo '<li><a href=\"createGroup.php\">Create Group</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Messages &nbsp;<span class=\"badge\">'.check_for_messages($activeUser).'</span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\tbuild_mini_inbox();\n\t\techo '<li><a href=\"messages.php\">Go to Inbox</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Settings <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"settings.php\">Update Profile</a></li>';\n\t\techo '<li><a href=\"#\">Privacy</a></li>';\n\t\techo '<li><a href=\"#\">Help</a></li>';\n\t\techo '<li class=\"divider\"></li>';\n\t\techo '<li><a href=\"#\">Logout</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '</ul>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '</nav>';\t\n\t}", "public function create()\n {\n return view('backend.pages.menu.create');\n }", "public function setMenu() {\n $loged_in = false;\n if (isset($_COOKIE['query_key']) && isset($_COOKIE['rememberme'])) {\n $loged_in = explode(\"@\", Token::verifyToken());\n }\n $menu = \"\n <nav class='navbar navbar-inverse navbar-fixed-top' role='navigation'>\n <div class='container'>\n <div class='navbar-header'>\n <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='#menu_bar' >\n <span class='sr-only'>Toggle navigation</span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n </button>\n <a class='navbar-brand' ><img src='assets/images/logo.png' height='30px'></a>\n </div>\n\n <div class='collapse navbar-collapse' id='menu_bar' >\n <ul class='nav navbar-nav navbar-right' >\";\n if ($loged_in == false) {\n $menu .=\" <li>\n <a href='./login' >Login</a>\n </li>\n <li>\n <a href='./signup' >Signup</a>\n </li>\";\n } else {\n $menu .= \" \n <li>\n <a>Welcome \" . $loged_in[0] . \"</a>\" .\n \"</li>\n <li>\n <a href='./posts' >Posts</a>\n </li>\n <li>\n <a href='./change' >Change Password</a>\n </li>\n <li>\n <a href='./user-logout' >logout</a>\n </li>\";\n }\n\n $menu .=\"</ul>\n </div>\n </div>\n</nav>\n<div style='height:100px;width:100%;position:relative;'></div>\n\";\n return $menu;\n }", "function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }", "function travomath_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'secondary', 'Footer Navigation Menu' );\n}", "public function newAction()\n {\n //set layout to no nav layout\n $this->view->setLayout('nonavlayout');\n }", "public function create()\n {\n //\n \n // dd($skulist);\n $skulist = $this::getAllSku();\n return view('Admin.Navbar.nav-add',['skulist'=>$skulist]);\n }", "function makeNavigation($nameCat, $tocs, $type) {\r\n\t\r\n\t$nameCat = fileNameTrans($nameCat);\r\n\t\r\n\t$result = '<ul class=\"nav navbar-nav\">';\r\n\tforeach($tocs as $field => $toc) {\r\n\t\t$classLiTop = 'download';\r\n\t\tif($field == $type) {\r\n\t\t\t$classLiTop = 'active';\r\n\t\t}\r\n\t\t$listItems = makeULContent($toc, $nameCat, $field);\r\n\t\t$fieldGer = translateFieldNames($field);\r\n\t\t$result .= '\r\n\t\t\t\t\t<li class=\"'.$classLiTop.'\">\r\n\t\t\t\t\t\t<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"'.$nameCat.'-'.$field.'.html\">nach '.$fieldGer.'<span class=\"caret\"></span></a>\r\n\t\t\t\t\t\t<ul class=\"dropdown-menu\">\r\n\t\t\t\t\t\t\t<li><a href=\"'.$nameCat.'-'.$field.'.html\">Seitenanfang</a></li>\r\n\t\t\t\t\t\t\t'.$listItems.'\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</li>';\r\n\t}\r\n\t$result .= '</ul>';\r\n\treturn($result);\r\n}", "public static function _NEW(){\n\t\tLibMenuBar::startTable();\n\t\tLibMenuBar::cancel();\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::help('screen.menus.new');\n\t\tLibMenuBar::endTable();\n\t}", "public function create()\n {\n return view('admin.mainmenus.create');\n\n }", "public function create()\n {\n return view('admin.backend.menus.create');\n }", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "public function run()\n {\n $nav = new \\App\\Models\\Navbar;\n $nav->title = \"Trang chủ\";\n $nav->url = json_encode([\"route\" => \"home\"]);\n $nav->icon = \"home\";\n $nav->ref = \"home\";\n $nav->save();\n\n }", "public static function navbar($paramsMap)\n {\n $page = NULL;\n // http://www.zomeoff.com/php-fast-way-to-determine-a-key-elements-existance-in-an-array/\n if (isset($paramsMap['page']) || array_key_exists('page', $paramsMap)) // Si no me lo pasan, tengo que poner el actual.\n $page = $paramsMap['page'];\n else\n throw new Exception(\"El parametro 'page' es obligatorio y no esta presente. \" . __FILE__ . \" \" . __LINE__);\n \n \n $out = '<div class=\"navbar\">';\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n while (($page = $page->getParent()) != NULL)\n {\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n }\n \n $out .= $ps . '</div>';\n return $out;\n }", "public function create()\n {\n // 添加一级导航分类\n $path = '0,';\n return view('admin.navigate_first.add',['path'=>$path]);\n }", "public function create()\n {\n //显示添加页\n return view('admin.navigation.create');\n }", "public function createMenu()\n {\n $parent = $this->Menu()->findOneBy(['label' => 'Artikel']);\n\n $this->createMenuItem(\n [\n 'label' => 'Custom sort',\n 'controller' => 'CustomSort',\n 'action' => 'Index',\n 'active' => 0,\n 'class' => 'sprite-blue-document-text-image',\n 'parent' => $parent,\n 'position' => 6,\n ]\n );\n }", "public function create()\n {\n \n return view('admin.Logos.header.create');\n\n }", "static function header($isLoggedIn, $user = null)\n {\n require('header.html');\n echo '<nav class=\"navbar navbar-inverse\">';\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"navbar-header\">';\n echo '<a class=\"navbar-brand\" href=\"index.php\">MUSTER STATION</a>';\n echo '</div><div>';\n\n if ($isLoggedIn) {\n echo \"<div class='collapse navbar-collapse' id='bs-example-navbar-collapse-1'>\";\n echo \"<ul class='nav navbar-nav'>\";\n echo '<li><a href=\"user.php?username=' . $user . '\"><span class=\"glyphicon glyphicon-user\"></span> Signed in as ' . $user . '</a></li>';\n\n // Projects dropdown\n echo \"<li class='dropdown'>\";\n echo \"<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>Projects <span class='caret'></span></a>\";\n echo \"<ul class='dropdown-menu'>\";\n\n try {\n $projects = ArmyDB::retrieveProjectsFromUser($user);\n foreach ($projects as $project) {\n $title = $project->projectname;\n $projectid = $project->id;\n echo \"<li><a href='project.php?id=\" . $projectid . \"'>$title</a></li>\";\n }\n } catch (Exception $e) {\n echo \"<li><a href='#'>No projects</a></li>\";\n }\n\n echo \"</ul>\";\n echo \"</li>\";\n\n // Units dropdown\n echo \"<li class='dropdown'>\";\n echo \"<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>Units<span class='caret'></span></a>\";\n echo \"<ul class='dropdown-menu'>\";\n\n try {\n $projects = ArmyDB::retrieveProjectsFromUser($user);\n $unitcount = 0;\n foreach ($projects as $project) {\n $projectid = $project->id;\n $projecttitle = $project->projectname;\n\n try {\n $units = ArmyDB::retrieveUnitsFromProject($projectid);\n\n foreach ($units as $unit) {\n $unitcount++;\n $unitid = $unit->id;\n $unitname = $unit->name;\n\n echo \"<li><a href='unit.php?id=\" . $unitid . \"'>$projecttitle: $unitname</a></li>\";\n }\n } catch (Exception $e) {\n\n }\n }\n if ($unitcount == 0) {\n echo \"<li><a href='#'>No units</a></li>\";\n }\n } catch (Exception $e) {\n echo \"<li><a href='#'>No units</a></li>\";\n }\n\n echo \"</ul>\";\n echo \"</li>\";\n\n // Final header\n echo \"</ul>\";\n echo '<ul class=\"nav navbar-nav navbar-right\">';\n echo '<li><a href=\"logout.php\"><span class=\"glyphicon glyphicon-log-out\"></span> Logout</a></li>';\n echo \"</ul>\";\n } else {\n echo \"<form class='navbar-form navbar-right' role='form' action='login.php'>\";\n echo \"<div class='form-group'>\";\n echo \"<input type='text' name='usr' class='form-control' placeholder='Username...' style='margin-right:10px;' required>\";\n echo \"<input type='password' name='pwd' class='form-control' placeholder='Password...' style='margin-right:10px;' required>\";\n echo \"<input type='hidden' name='action' value='login'><input type='submit' class='btn btn-warning' value='Login' style='margin-right:10px;' >\";\n echo \"<button type='button' class='btn btn-danger' data-toggle='modal' data-target='#myModal'>Create Account</button>\";\n echo \"</div></form>\";\n echo \"</ul>\";\n }\n echo \"</div></div></div></nav>\";\n echo \"<div class='container-fluid'>\";\n\n }", "function getNav(){\n $html = '\n<nav class=\"navbar navbar-toggleable-md navbar-inverse bg-inverse stickcontent\">\n <span class=\"navbar-brand text-center\">Bienvenue</span>\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navLittleScreen\" aria-controls=\"navLittleScreen\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navLittleScreen\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"http://tt3y5d3gkz2x5l4d.onion\">Home</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"http://tt3y5d3gkz2x5l4d.onion/certificates/\">Certificats</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"http://tt3y5d3gkz2x5l4d.onion/security/\">Mot de passe aléatoire</a>\n </li>\n </ul>\n </div>\n</nav>';\n\n return $html;\n\n}", "public function create( $args, $assoc_args ) {\n\n\t\t$menu_id = wp_create_nav_menu( $args[0] );\n\n\t\tif ( is_wp_error( $menu_id ) ) {\n\n\t\t\tWP_CLI::error( $menu_id->get_error_message() );\n\n\t\t} else {\n\n\t\t\tif ( Utils\\get_flag_value( $assoc_args, 'porcelain' ) ) {\n\t\t\t\tWP_CLI::line( $menu_id );\n\t\t\t} else {\n\t\t\t\tWP_CLI::success( \"Created menu {$menu_id}.\" );\n\t\t\t}\n\t\t}\n\t}", "private function createMenu() {\n $menu = new Menu;\n $menu->name = $this->page['title'];\n if ($this->page['parent_id']) {\n $parent = ModelsPage::findOrFail($this->page['parent_id']);\n $menu->link = env('APP_URL') . '/' . $parent->slug . '/' . $this->page['slug'];\n } else {\n $menu->link = env('APP_URL') . '/' . $this->page['slug'];\n }\n $menu->parent_id = null;\n $order = Menu::select('order')->where('parent_id', null)->orderBy('order', 'desc')->first();\n $menu->order = (($order) ? $order->order : 0) + 1;\n $menu->target = '_self';\n $menu->status = true;\n $menu->save();\n }", "function makeNav($active,$AdminEdit,$userObj)\r\n{\r\n $navArray = array(\r\n \"Resume Archive\" => \"ResumeArchive.php\",\r\n \"Address\" => \"AddressEdit.php\",\r\n \"Phone\" => \"PhoneEdit.php\",\r\n \"Job\" => \"JobEdit.php\",\r\n \"Help/Info\" => \"help.html\",\r\n \"Admin\" => \"Admin.php\"\r\n \r\n );\r\n \r\n \r\n //if they are not an admin delete the admin link\r\n if(!$userObj->isAdmin)\r\n {\r\n unset( $navArray[\"Admin\"]);\r\n }\r\n \r\n //if they are a guest then remove the multiple resume capability and admin link\r\n if($userObj->isGuest)\r\n {\r\n unset($navArray[\"Admin\"]);\r\n unset($navArray[\"Resume Archive\"]);\r\n $navArray = array(\"Create Resume\" => \"ResumeEdit.php\") + $navArray;\r\n \r\n }\r\n \r\n //BUILDS THE MENU\r\n //sets the begining of the menu\r\n $result = \"\r\n <!--Menu-->\r\n <div id='cssmenu'>\r\n <ul>\";\r\n \r\n \r\n //iterates through the array and adds additional items\r\n foreach ($navArray as $key => $value) \r\n { \r\n \r\n $selection = ($active == $value) ? \" class='active'\" : \"\";\r\n $result = $result . \"<li $selection><a href='$value'><span>$key</span></a></li>\";\r\n }\r\n //add closing brace\r\n $result = $result . \" \r\n </ul>\r\n </div>\";\r\n \r\n return $result;//return the nave menu\r\n}", "function make_menu($title) {;\t\n\t$menu = '<ul class=\"nav nav-pills\">';\n $menu .= get_menu_items($title);\n\t$menu .= '</ul>';\n\treturn $menu;\n}", "public function create()\n {\n return view('backoffice.main.createPageHeader');\n }", "public function get_navbar(){\r\n\t\treturn $this->elements;\r\n\t}", "public function create()\n {\n return view('backend.menu.create');\n }", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "public static function initToolbar($dir, $active, $sticky){\n $auth = Session::getAuth();\n?>\n <nav class=\"navbar navbar-expand-md navbar-dark bg-dark <?php if($sticky)echo 'sticky-top'; ?>\">\n <a class=\"navbar-brand\" href=\"<?php Nav::echoHome($dir); ?>\">\n <img src=\"<?php Asset::embedIcon($dir, 'primary.svg'); ?>\" width=\"30\" height=\"30\" class=\"d-inline-block align-top\" alt=\"\">\n </a>\n\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item <?php self::printActive($active, 'Home'); ?>\">\n <a class=\"nav-link\" href=\"<?php Nav::echoHome($dir); ?>\">Home<span class=\"sr-only\">(current)</span></a>\n </li>\n <li class=\"nav-item <?php self::printActive($active, 'Docs'); ?>\">\n <a class=\"nav-link\" href=\"https://www.trialation.com/proto-framework-docs/\" target=\"_blank\">Docs</a>\n </li>\n <li class=\"nav-item dropdown <?php self::printActive($active, 'Examples'); ?>\">\n <a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Samples\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">\n <a class=\"dropdown-item\" href=\"<?php Nav::echoPage($dir, \"examples/ex-api.php\") ?>\">Proto API Project</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoPage($dir, \"examples/ex-off-db.php\") ?>\">Proto DB Project</a>\n </div>\n </li>\n <li class=\"nav-item dropdown <?php self::printActive($active, 'More'); ?>\">\n <a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n More\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">\n <a class=\"dropdown-item\" href=\"https://www.trialation.com/proto-framework-docs/making-apis/\" target=\"_blank\">Proto API Docs</a>\n <a class=\"dropdown-item\" href=\"https://www.trialation.com/proto-framework-docs/proto-db/\" target=\"_blank\">Proto DB Docs</a>\n <div class=\"dropdown-divider\"></div>\n <a class=\"dropdown-item\" target=\"_blank\" href=\"https://github.com/TummanoonW/Proto-Framework\">GitHub</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoURL($dir, 'feedback.php'); ?>\">Send a feedback</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoURL($dir, 'about.php'); ?>\">About</a>\n </div>\n </li>\n </ul>\n\n <!-- Right Side Bar -->\n <div class=\"inline\">\n <ul class=\"navbar-nav mr-auto\">\n <?php if(Session::checkUserExisted()){ ?>\n <li class=\"nav-item <?php self::printActive($active, 'Profile'); ?>\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'profile.php'); ?>\">\n <i class=\"far fa-user\"></i>\n <?php echo $auth->username ?> \n </a>\n </li>\n <?php }else{ ?>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'register.php'); ?>\">\n Register\n </a>\n </li> \n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'login.php'); ?>\">\n Log In\n </a> \n </li> \n <?php } ?>\n </ul>\n </div>\n </div>\n </nav>\n<?php\n }", "public function create()\n {\n return view('menu.create');\n }", "public function create()\n {\n return view('menu.create');\n }", "public function nav()\n\t{\n\t\t$nav['dashboard'] = array('name' => Blocks::t('Dashboard'));\n\t\t$nav['content'] = array('name' => Blocks::t('Content'));\n\t\t$nav['assets'] = array('name' => Blocks::t('Assets'));\n\n\t\tif (Blocks::hasPackage(BlocksPackage::Users) && blx()->userSession->checkPermission('editUsers'))\n\t\t{\n\t\t\t$nav['users'] = array('name' => Blocks::t('Users'));\n\t\t}\n\n\t\t// Add any Plugin nav items\n\t\t$plugins = blx()->plugins->getPlugins();\n\n\t\tforeach ($plugins as $plugin)\n\t\t{\n\t\t\tif ($plugin->hasCpSection())\n\t\t\t{\n\t\t\t\t$lcHandle = strtolower($plugin->getClassHandle());\n\t\t\t\t$nav[$lcHandle] = array('name' => $plugin->getName());\n\n\t\t\t\t// Does the plugin have an icon?\n\t\t\t\t$resourcesPath = blx()->path->getPluginsPath().$lcHandle.'/resources/';\n\n\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-16x16.png'))\n\t\t\t\t{\n\t\t\t\t\t$nav[$lcHandle]['hasIcon'] = true;\n\n\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-16x16.png');\n\t\t\t\t\tblx()->templates->includeCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\n\t\t\t\t\t// Does it even have a hi-res version?\n\t\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-32x32.png'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-32x32.png');\n\t\t\t\t\t\tblx()->templates->includeHiResCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->checkPermission('autoUpdateBlocks'))\n\t\t{\n\t\t\t$numberOfUpdates = blx()->updates->getTotalNumberOfAvailableUpdates();\n\n\t\t\tif ($numberOfUpdates > 0)\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'), 'badge' => $numberOfUpdates);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'));\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->isAdmin())\n\t\t{\n\t\t\t$nav['settings'] = array('name' => Blocks::t('Settings'));\n\t\t}\n\n\t\treturn $nav;\n\t}", "function mocca_bootstrap_menu() {\n\n wp_nav_menu(array(\n 'theme_location' => 'bootstrap-menu',\n 'menu_class' => 'navbar-nav ml-auto',\n 'container' => false,\n 'depth' => 2,\n 'walker' => new wp_bootstrap_navwalker(),\n ));\n }", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "function h_add_menus(array $args) {\n if (!is_admin()) { return;}\n\n $menu = new H_Sidenav($args);\n $menu->add();\n}", "function folio_register_nav_menu()\n{\n register_nav_menu('primary', 'Sidebar Menu');\n}", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "public function create()\n {\n $pageMenu = [\n 'pageMain' => 'active',\n 'pageCreate' => 'active'\n ];\n\n return view('backend.pages.create')->with('pageMenu', $pageMenu );\n }", "public function index()\n {\n $navbars = Navbar::all();\n return view(\"backend.navbars.table\", compact(\"navbars\"));\n }", "public function create()\n {\n return view('menu.create', ['menu' => new Menu]);\n }", "public function create()\n {\n \n // Get Tools id and name to be displayed.\n $tools = Tools::get();\n foreach($tools as $key => $tool){\n $toolsArray[$tool['id']] = $tool['name'];\n }\n return view('backend.navigation.create')->with(\n 'routes', $toolsArray);\n }", "public function create()\n {\n $this->title .= ' create';\n $this->vars = array_add($this->vars, 'menuArray', $this->rep->makeArray());\n }", "public function index()\n {\n $navbar = Navbar::latest()->paginate(5);\n \n return view('navbar.index',compact('navbar'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function create()\n {\n $cramp2 = \"Add New Vendor Menu\";\n $vendors = Vendor::all();\n return view('vendor_menu.create', compact('cramp2', 'vendors'));\n }", "private function menu()\n {\n $data['links'] = ['create', 'read', 'update', 'delete'];\n\n return $this->view->render($data, 'home/menu');\n }", "private function gen_nav_links()\n\t{\n\t\t$this->template->assign_block_vars('navlinks', array(\n\t\t\t'S_IS_CAT'\t\t=> true,\n\t\t\t'S_IS_LINK'\t\t=> false,\n\t\t\t'S_IS_POST'\t\t=> false,\n\t\t\t'FORUM_NAME'\t=> $this->user->lang('BLOG_MAIN'),\n\t\t\t'FORUM_ID'\t\t=> -1,\n\t\t\t'U_VIEW_FORUM'\t=> append_sid('blog'),\n\t\t));\n\t}", "function public_nav_main()\n{\n $view = get_view();\n $nav = new Omeka_Navigation;\n $nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);\n $nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);\n return $view->navigation()->menu($nav);\n}", "function mocca_custom_menu() {\n\n register_nav_menus(array(\n 'bootstrap-menu' => 'Navigtion Bar',\n 'footer-menu' => 'footer Bar',\n ));\n }", "function simple_bootstrap_display_main_menu() {\n wp_nav_menu(\n array( \n 'theme_location' => 'main_nav', /* where in the theme it's assigned */\n 'menu_class' => 'navbar-nav mr-auto',\n 'container' => false, /* container class */\n 'depth' => 2,\n 'walker' => new simple_bootstrap_Bootstrap_walker(),\n )\n );\n}", "public function create()\n\t{\n\t\treturn view(\"Olaylar::admin.\".$this->theme.\".create\")\n\t\t->with('headName', $this->headName);\n\t}", "function getTopNav() {\n\t\t$topNav = \"\";\n\t\tif (adminSessionExists()) {\n\t\t\t$topNav = '<nav class=\"navbar navbar-default\" role=\"navigation\" style=\"background-color: transparent;\">\n\t\t\t<div class=\"container\">\n\t\t\t<div class=\"navbar-header\">\n\t\t\t<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t</button><a href=\"./index.php\"><img class=\"logo\" src=\"./pic/logo.png\" /></a>\n\t\t\t<div class=\"name-wrapper\"><font class=\"nav-font\">REBUS</font>\n\t\t\t</div></div>\n\t\t\t<div class=\"collapse navbar-collapse\">\n\t\t\t<ul class=\"nav navbar-nav\" style=\"float: right;\">\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"./admin.php\"><button id=\"admin\" class=\"navOption\">Admin</button></a>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"./puzzle_list.php\"><button id=\"list\" class=\"navOption\">List</button></a>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"./about.php\"><button id=\"addword\" class=\"navOption\">About</button></a>\n\t\t\t\t</li>\n\t\t\t\t<!--<li>\n\t\t\t\t\t<a href=\"./addWordPair.php\"><button id=\"addpuzzle\" class=\"navOption\">Add<br> Word<br> Pairs</button></a>\n\t\t\t\t</li> -->\n\t\t\t\t<li> \n\t\t\t\t\t<a href=\"./logout.php\"><button id=\"logout\" name =\"logout\" class=\"navOption\">Logout</button></a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t</div><!--.nav-collapse --></div></nav>';\n\t\t}\n\t\telse if (sessionExists()) {\n\t\t\t$topNav = '<nav class=\"navbar navbar-default\" role=\"navigation\" style=\"background-color: transparent;\">\n\t\t\t<div class=\"container\">\n\t\t\t<div class=\"navbar-header\">\n\t\t\t<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n\t\t\t<span class=\"sr-only\">Toggle navigation</span><span class=\"icon-bar\"></span>\n\t\t\t<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>\n\t\t\t</button><a href=\"./index.php\"><img class=\"logo\" src=\"./pic/logo.png\" /></a>\n\t\t\t<div class=\"name-wrapper\"><font class=\"nav-font\">REBUS</font>\n\t\t\t</div></div><div class=\"collapse navbar-collapse\">\n\t\t\t<ul class=\"nav navbar-nav\" style=\"float: right;\">\n\t\t\t<li>\n\t\t\t\t<a href=\"./puzzle_list.php\"><button id=\"list\" class=\"navOption\">List</button></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"./about.php\"><button id=\"addword\" class=\"navOption\">Abour</button></a>\n\t\t\t</li>\n\t\t\t<!--<li>\n\t\t\t\t<a href=\"./addWordPair.php\"><button id=\"addpuzzle\" class=\"navOption\">Add<br> Word<br> Pairs</button></a>\n\t\t\t</li> -->\n\t\t\t<li>\n\t\t\t\t<a href=\"./logout.php\"><button id=\"logout\" name =\"logout\" class=\"navOption\">Logout</button></a>\n\t\t\t</li>\n\t\t\t</ul></div><!--.nav-collapse --></div></nav>';\n\t\t}\n\t\telse{\n\t\t\t$topNav = '<nav class=\"navbar navbar-default\" role=\"navigation\" style=\"background-color: transparent;\">\n\t\t\t<div class=\"container\">\n\t\t\t<div class=\"navbar-header\"><button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t</button>\n\t\t\t<a href=\"./index.php\"><img class=\"logo\" src=\"./pic/logo.png\" /></a>\n\t\t\t<div class=\"name-wrapper\">\n\t\t\t<font class=\"nav-font\">REBUS</font>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"collapse navbar-collapse\">\n\t\t\t<ul class=\"nav navbar-nav\" style=\"float: right;\">\n\t\t\t<li>\n\t\t\t\t<a href=\"./puzzle_list.php\"><button id=\"list\" class=\"navOption\">List</button></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"./about.php\"><button id=\"addword\" class=\"navOption\">About</button></a>\n\t\t\t</li>\n\t\t\t<!--<li>\n\t\t\t\t<a href=\"./addWordPair.php\"><button id=\"addpuzzle\" class=\"navOption\">Add<br> Word<br> Pairs</button></a>\n\t\t\t</li> -->\n\t\t\t<li>\n\t\t\t\t<a href=\"./login.php\"><button id=\"login\" class=\"navOption\">Login</button></a>\n\t\t\t</li>\n\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<!--.nav-collapse -->\n\t\t\t</div>\n </nav>';\n\t\t}\n\t\treturn $topNav;\n\t}", "public function crear()\n {\n $menus = Menu::orderBy('id')->pluck('menu_nombre', 'id')->toArray();\n return view('theme.back.administracion.grabar_sub_menus', compact('menus'));\n }", "private function displayNav()\n {\n\n $links = array(\n 'home',\n 'browse',\n 'about',\n 'contact',\n );\n\n //Navbar\n $html = '<div id=\"navbar\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n\n // Loop through the links\n foreach ($links as $link) {\n\n $html .= '<li><a href=\"index.php?page=' . $link . '\"';\n\n if ($link == $_GET['page']) {\n $html .= ' class=\"active\"';\n }\n\n $html .= '>';\n\n if ($this->model->userLoggedIn && $link == 'home') {\n $html .= 'My Profile';\n } else {\n $html .= ucfirst($link);\n }\n\n $html .= '</a></li>' . \"\\n\";\n\n }\n\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n return $html;\n }", "public function createProfileMenu()\r\n {\r\n $menu = $this->factory->createItem('root', [\r\n 'childrenAttributes' => ['class' => 'vertical medium-horizontal menu']\r\n ]);\r\n\r\n $menu->addChild(\r\n $this->translator->trans('navigation.profile.main', [], 'MinervaAppBundle'),\r\n ['route' => 'fos_user_profile_show']\r\n );\r\n\r\n $menu->addChild(\r\n $this->translator->trans('navigation.profile.battlenet', [], 'MinervaAppBundle'),\r\n ['route' => 'minerva_user_battlenet_overview']\r\n );\r\n\r\n return $menu;\r\n }", "public function create() {\n //\n\t\t$menu = new Menu();\n\t\t$items = \\App\\Item::all();\n\t\treturn view('menus.create', compact('menu', 'items'));\n }", "function nav_main() {\n\n\techo '\n\t\n\t\t<ul>\n\t\t\t<li><a href=\"index.php?page=home\">Home</a></li>\n\t\t\t<li><a href=\"index.php?page=gallery\">Gallery</a></li>\n\t\t\t<li><a href=\"index.php?page=blog\">Blog</a></li>\n\t\t\t<li><a href=\"index.php?page=newpage\">New Page</a></li>\n\t\t\t<li><a href=\"index.php?page=contact\">Contact Us</a></li>\n\t\t</ul>\n\t\t\n\t';\t\n\t\n}", "public function create()\n {\n $parents = Menu::all();\n return view('menu/create')->with('parents', $parents);\n }", "public function create()\n {\n //\n $Menus = Menu::all();\n return view('Menu.create');\n }" ]
[ "0.7866018", "0.7706027", "0.75328577", "0.71954405", "0.6846228", "0.68332154", "0.6788386", "0.66661584", "0.653865", "0.6507996", "0.649587", "0.6449366", "0.6417094", "0.63968784", "0.6388708", "0.6362252", "0.63547385", "0.63131136", "0.63118845", "0.629783", "0.6249518", "0.624884", "0.6210239", "0.6209658", "0.61987317", "0.6186316", "0.61842716", "0.61652535", "0.6164423", "0.61538905", "0.6146741", "0.6141659", "0.61265194", "0.6083443", "0.608115", "0.60612047", "0.60594743", "0.60487187", "0.6046407", "0.6019487", "0.59970766", "0.5979219", "0.596476", "0.5961564", "0.5950414", "0.59487647", "0.59373516", "0.5919011", "0.5910846", "0.59039617", "0.58986896", "0.58719826", "0.5864299", "0.58595186", "0.5854852", "0.5848019", "0.58294374", "0.58254236", "0.5817991", "0.579966", "0.57875556", "0.57757354", "0.57723254", "0.576938", "0.57671684", "0.5763138", "0.5758408", "0.5741461", "0.57344174", "0.57316536", "0.57223904", "0.57204634", "0.57204634", "0.5712052", "0.5711536", "0.57013726", "0.56972885", "0.56807995", "0.5678861", "0.56707513", "0.5670604", "0.5666154", "0.56514966", "0.56481415", "0.5647453", "0.563481", "0.56288147", "0.5625377", "0.5622483", "0.56194633", "0.56164193", "0.5614298", "0.56099945", "0.56066734", "0.5582125", "0.5573397", "0.5571938", "0.5563599", "0.55552304", "0.55538017" ]
0.6414221
13
Add a link to the navbar or to a menu.
public function link ($name, $url = '', array $options = [], array $linkOptions = []) { if ($this->_level == 0 && $this->autoButtonLink) { $options = $this->addClass ($options, 'btn btn-default navbar-btn') ; return $this->Html->link ($name, $url, $options) ; } if (Router::url() == Router::url ($url) && $this->autoActiveLink) { $options = $this->addClass ($options, 'active'); } return $this->Html->tag('li', $this->Html->link ($name, $url, $linkOptions), $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMainMenuLink()\n {\n return '<a href=\"/Plugins/Products/Actions/Products.php\">Products</a> ';\n }", "public function addLink(AdminLink $link, string $desiredHeading = null): MenuWidget;", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "function add_links_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function log_viewer_add_menu_item() {\n\techo '<li><a href=\"http://localhost/ds-plugins/log-viewer/page.php\">Log Viewer</a></li>';\n}", "function nav(array $navLinks, $name = null, array $args = array())\n{\n if ($name !== null) {\n $navLinks = apply_filters($name, $navLinks, $args);\n }\n\n $menu = get_view()->navigation()->menu(new Omeka_Navigation($navLinks));\n\n if ($acl = get_acl()) {\n $menu->setRole(current_user())->setAcl($acl);\n }\n\n return $menu;\n}", "private function gen_nav_links()\n\t{\n\t\t$this->template->assign_block_vars('navlinks', array(\n\t\t\t'S_IS_CAT'\t\t=> true,\n\t\t\t'S_IS_LINK'\t\t=> false,\n\t\t\t'S_IS_POST'\t\t=> false,\n\t\t\t'FORUM_NAME'\t=> $this->user->lang('BLOG_MAIN'),\n\t\t\t'FORUM_ID'\t\t=> -1,\n\t\t\t'U_VIEW_FORUM'\t=> append_sid('blog'),\n\t\t));\n\t}", "protected function addLinks()\n {\n }", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "function ob_add_amazon_link_plugin_menu() {\n\tadd_menu_page( 'Amazon link', 'Amazon link', 'administrator', 'amazon-link', 'ob_amazon_link', 'dashicons-amazon' );\n}", "public function add_menu()\n {\n add_options_page(__('Master Link Plugin Settings'), __('Master Link Plugin'), 'manage_options', 'master_link_plugin', array(\n &$this,\n 'plugin_settings_page'\n ));\n }", "Public function Anavbar(){\n\t\n\t}", "public function add_menu_link() {\n\t\tadd_submenu_page(null, __('Operations', 'wpas_attendeeinfo') , __('Operations', 'wpas_attendeeinfo') , 'manage_operations_emd_contacts', 'operations_emd_contact', array(\n\t\t\t$this,\n\t\t\t'get_operations'\n\t\t));\n\t}", "function addPageNavLink(& $link, & $parentElement) {\n\t\t$linkElement =& $this->_document->createElement('navlink');\n\t\t$parentElement->appendChild($linkElement);\n\t\t\n\t\t$this->addCommonProporties($link, $linkElement);\n\t\t\n\t\t// url\n\t\t$url =& $this->_document->createElement('url');\n\t\t$linkElement->appendChild($url);\n\t\t$url->appendChild($this->_document->createTextNode(htmlspecialchars($link->getField('url'))));\n\t\t\n\t\tif ($link->getField('location') == 'right')\n\t\t\t$linkElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$linkElement->setAttribute('location', 'left');\n\t}", "function printItemNavbar( $text, $link, $actual, $index ) {\n\n // seta a classe\n $cl = $index == $actual ? 'active' : '';\n\n // imprime o item\n echo \"<a href='\".site_url( $link ).\"' class='nav-link $cl'>$text</a>\"; \n}", "function ou_df_menu_link(&$variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n $title = $element['#title'];\n if (empty($element['#localized_options']['html'])) {\n $title = check_plain($title);\n }\n $element['#localized_options']['html'] = TRUE;\n $output = l('<span>' . $title . '</span>', $element['#href'], $element['#localized_options']);\n\n if (in_array('active', $element['#attributes']['class']) || in_array('active-trail', $element['#attributes']['class'])) {\n $element['#attributes']['class'][] = 'int-nav-active';\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "function caNavLink($po_request, $ps_content, $ps_classname, $ps_module_path, $ps_controller, $ps_action, $pa_other_params=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caNavUrl($po_request, $ps_module_path, $ps_controller, $ps_action, $pa_other_params, $pa_options))) {\n\t\t\t//return \"<strong>Error: no url for navigation</strong>\";\n\t\t\t$vs_url = '/';\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='{$vs_url}' \";\n\t\t\n\t\tif ($ps_classname) { $pa_attributes['class'] = $ps_classname; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\t$vs_tag .= _caHTMLMakeAttributeString($pa_attributes);\n\t\t}\n\t\t\n\t\t$vs_tag .= \">{$ps_content}</a>\";\n\t\t\n\t\treturn $vs_tag;\n\t}", "public function add_new_site_link() {\n\t\tif ( count( get_blogs_of_user( get_current_user_id() ) ) > 1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->add_admin_menu_separator();\n\t\tadd_menu_page( __( 'Add New Site', 'jetpack' ), __( 'Add New Site', 'jetpack' ), 'read', 'https://wordpress.com/start?ref=calypso-sidebar', null, 'dashicons-plus-alt' );\n\t}", "function travomath_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'secondary', 'Footer Navigation Menu' );\n}", "function addSectionNavLink(& $link, & $parentElement) {\n\t\t$linkElement =& $this->_document->createElement('navlink');\n\t\t$parentElement->appendChild($linkElement);\n\t\t\n\t\t$this->addCommonProporties($link, $linkElement);\n\t\t\n\t\t// url\n\t\t$url =& $this->_document->createElement('url');\n\t\t$linkElement->appendChild($url);\n\t\t$url->appendChild($this->_document->createTextNode(htmlspecialchars($link->getField('url'))));\n\t}", "function atwork_menu_link(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n // Adding a class depending on the TITLE of the link (not constant)\n $element['#attributes']['class'][] = atwork_id_safe($element['#title']);\n // Adding a class depending on the ID of the link (constant)\n $element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function susy_menu_link(array $vars) {\n $element = $vars['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n // Adding a class depending on the TITLE of the link (not constant)\n $element['#attributes']['class'][] = drupal_html_id($element['#title']);\n // Adding a class depending on the ENGLISH title of the link (constant)\n $element['#attributes']['class'][] = drupal_html_id($element['#original_link']['link_title']);\n // Adding a class depending on the ID of the link (constant)\n if (isset($element['#original_link']['mlid']) && !empty($element['#original_link']['mlid'])) {\n $element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "public function add_to_mainmenu($anchor, $url) {\n $this->mainmenu[$anchor][$url];\n }", "function register_my_menu() {\n register_nav_menu('main-menu',__( 'Navegador Primario' ));\n }", "function navbar()\r\n {\r\n }", "function mocca_custom_menu() {\n\n register_nav_menus(array(\n 'bootstrap-menu' => 'Navigtion Bar',\n 'footer-menu' => 'footer Bar',\n ));\n }", "public function add_menus()\n {\n }", "function minorite_menu_link(array $variables) {\n $element = $variables['element'];\n $path = $element['#href'];\n $sub_menu = '';\n\n // Append active class.\n if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&\n (empty($options['language']) || $options['language']->language == $language_url->language)) {\n $element['#attributes']['class'][] = 'nav-selected';\n }\n\n if (!empty($element['#below'])) {\n $sub_menu = drupal_render($element['#below']);\n $element['#attributes']['class'][] = 'nav-has-child';\n }\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function ento_cdn_menu_link(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n // Prevent dropdown functions from being added to management menu so it\n // does not affect the navbar module.\n if (($element['#original_link']['menu_name'] == 'management') && (module_exists('navbar'))) {\n $sub_menu = drupal_render($element['#below']);\n }\n elseif ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) {\n // Add our own wrapper.\n unset($element['#below']['#theme_wrappers']);\n $sub_menu = '<ul class=\"dropdown-menu\">' . drupal_render($element['#below']) . '</ul>';\n // Generate as standard dropdown.\n $element['#title'] .= ' <span class=\"caret\"></span>';\n $element['#attributes']['class'][] = 'dropdown';\n $element['#localized_options']['html'] = TRUE;\n\n // Set dropdown trigger element to # to prevent inadvertant page loading\n // when a submenu link is clicked.\n $element['#localized_options']['attributes']['data-target'] = '#';\n $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';\n $element['#localized_options']['attributes']['data-toggle'] = 'dropdown';\n }\n }\n // On primary navigation menu, class 'active' is not set on active menu item.\n // @see https://drupal.org/node/1896674\n if (($element['#href'] == $_GET['q'] || ($element['#href'] == '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) {\n $element['#attributes']['class'][] = 'active';\n }\n\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "public function onNavigationBar($event) {\n if ($this->user) {\n // add the profile links\n Navigation::addBar('default', array('title' => 'View Profile', 'slug' => 'account/profile', 'icon' => 'cog'));\n\n // add the admin links\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'View Logs', 'slug' => 'logviewer', 'icon' => 'wrench'));\n Navigation::addBar('default', array('title' => 'Caching', 'slug' => 'caching', 'icon' => 'tachometer'));\n Navigation::addBar('default', array('title' => 'CloudFlare', 'slug' => 'cloudflare', 'icon' => 'cloud'));\n Navigation::addBar('default', array('title' => 'Queuing', 'slug' => 'queuing', 'icon' => 'random'));\n }\n\n // add the view users link\n if (Sentry::getUser()->hasAccess('mod')) {\n Navigation::addBar('default', array('title' => 'View Users', 'slug' => 'users', 'icon' => 'user'));\n }\n\n // add the create user link\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'Create User', 'slug' => 'users/create', 'icon' => 'star'));\n }\n\n // add the create page link\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Page', 'slug' => 'pages/create', 'icon' => 'pencil'));\n }\n\n // add the create post link\n if (Config::get('cms.blogging')) {\n if (Sentry::getUser()->hasAccess('blog')) {\n Navigation::addBar('default', array('title' => 'Create Post', 'slug' => 'blog/posts/create', 'icon' => 'book'));\n }\n }\n\n // add the create event link\n if (Config::get('cms.events')) {\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Event', 'slug' => 'events/create', 'icon' => 'calendar'));\n }\n }\n }\n }", "function nav_menu()\n{\n $menu = \"\";\n $menu .= '<ul class=\"nav navbar-nav navbar-right\">';\n $menu .= '<li><a href=\"'.site_url('#home').'\">Home</a></li>';\n $menu .= '<li><a href=\"'.site_url('#about').'\">About Me</a></li>';\n $menu .= '<li><a href=\"'.site_url('#whatdo').'\">What i do</a></li>';\n $menu .= '<li><a href=\"'.site_url('#work').'\">My Work</a></li>';\n $menu .= '<li><a href=\"'.site_url('blog').'\">Blog</a></li>';\n $menu .= '<li><a href=\"'.site_url('#contact').'\">Contact</a></li>';\n $menu .= '</ul>';\n return $menu;\n}", "public function add_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\t'Amazon Affiliate | Products',\n\t\t\t\t'Products',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\tarray( &$this, 'load_product_page' ),\n\t\t\t\tplugins_url( 'amz-affiliate/img/icon.png' ),\n\t\t\t\t50\n\t\t\t);\n\t\t\tadd_submenu_page(\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\t'Amazon Affiliate | Tables',\n\t\t\t\t'Tables',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/table.php',\n\t\t\t\tarray( &$this, 'load_table_page' )\n\t\t\t);\n\t\t}", "public function addToMenu()\n\t{\n\t\t$content = sprintf(\n\t\t\t\"$%s = (\\$user->hasPermission(%d)) ? new Link(route('report.%s'), _('%s %s %s')) : new Node();\",\n\t\t\tcamel_case(str_replace('.', '_', $this->class)),\n\t\t\t$this->permission,\n\t\t\t$this->route,\n\t\t\t$this->class,\n\t\t\t$this->sufix,\n\t\t\t'TODO'\n\t\t);\n\n\t\treturn parent::addToMenu($content);\n\t}", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "function my_admin_bar_link() {\n global $wp_admin_bar;\n if ( !is_super_admin() || !is_admin_bar_showing() )\n return;\n $wp_admin_bar->add_menu( array(\n 'id' => 'sharpmachine',\n 'parent' => 'wp-logo',\n 'title' => __( 'Sharp Machine Media'),\n 'href' => 'http://www.sharpmachinemedia.com'\n ) );\n\n $wp_admin_bar->add_menu( array(\n 'id' => 'mailchimp',\n 'parent' => 'wp-logo-external',\n 'title' => __( 'Mailchimp'),\n 'href' => 'http://login.mailchimp.com'\n ) );\n\n $wp_admin_bar->add_menu( array(\n 'id' => 'analytics',\n 'parent' => 'wp-logo-external',\n 'title' => __( 'Analytics'),\n 'href' => 'http://www.google.com/analytics'\n ) );\n\n $wp_admin_bar->add_menu( array(\n 'id' => 'mail',\n 'parent' => 'wp-logo-external',\n 'title' => __( 'Mail'),\n 'href' => 'http://mail.'. substr(get_bloginfo('url'), 7).''\n ) );\n\n $wp_admin_bar->add_menu( array(\n 'id' => 'calendar',\n 'parent' => 'wp-logo-external',\n 'title' => __( 'Calendar'),\n 'href' => 'http://calendar.'. substr(get_bloginfo('url'), 7).''\n ) );\n\n $wp_admin_bar->add_menu( array(\n 'id' => 'docs',\n 'parent' => 'wp-logo-external',\n 'title' => __( 'Docs'),\n 'href' => 'http://docs.'. substr(get_bloginfo('url'), 7).''\n ) );\n}", "function createNavBar($data, $displayGreeting = false, $helpLink = ''){\n\nglobal $base_url;\n\nprint \"<table width=100% class=\\\"yellowBorder\\\">\";\nprint \"<tr class=\\\"lightYellow\\\"><td width=10%>\"; //<b>NavBar : </b>\";\n\n$items = explode(\"|\", $data);\n\n$array_count = count($items);\n\nfor($i = 0; $i < $array_count; $i++){\n $piece = explode(\":\", $items[$i]);\n\n if($i == $array_count - 1){\n print \"<b>$piece[1]</b>\";\n }\n else{\n print \"<a class=\\\"menuLink\\\" href=\\\"$piece[0]\\\">$piece[1]</a>\";\n print \" > \";\n }\n}\nprint \"</td>\";\n\nif($displayGreeting){\n print \"<td align=center width=80%>\";\n print \"<b>Welcome \" . $_SESSION[\"fullname\"] . \"</b>\";\n print \"</td>\";\n}\n\nprint \"<td width=10% align=\\\"right\\\"><a class=menuLink target=\\\"_blank\\\" href=\\\"$base_url/help.php#$helpLink\\\">Help</a> :: <a class=\\\"menuLink\\\" href=\\\"$base_url/logout.php\\\">logout</a>\";\nprint \"</td></tr></table>\";\n}", "function mpp_Add_Admin_Link()\n{\n add_menu_page(\n 'Moses Post Piglatin page', // Title of the page\n 'Moses Post Piglatin', // Text to show on the menu link\n 'manage_options', // Capability requirement to see the link\n 'includes/mpp-post-piglatin-cp.php' // The 'slug' - file to display when clicking the link\n );\n}", "public function addLinks()\n {\n if (isset($_GET['page']) == 'bolsista'):\n $css = [\n plugins_url(Path::PLGCSS . 'bootstrap.min.css'),\n plugins_url(Path::PLGCSS . 'custom.css'),\n ];\n\n $js = [\n plugins_url(Path::PLGJS . 'bootstrap.min.js'),\n plugins_url(Path::PLGJS . 'js-view.js')\n ];\n $this->insertCSS($css);\n $this->insertJS($js);\n\n else:\n $css = [\n plugins_url(Path::PLGCSS . 'bootstrap.min.css'),\n plugins_url(Path::PLGCSS . 'custom.css')\n ];\n $js = [\n plugins_url(Path::PLGJS . 'bootstrap.min.js'),\n plugins_url(Path::PLGJS . 'js-view.js')\n ];\n $this->insertCSS($css);\n $this->insertJS($js);\n endif;\n }", "function folio_register_nav_menu()\n{\n register_nav_menu('primary', 'Sidebar Menu');\n}", "public function add_menu_link() {\n\n\t\t$this->page_id = add_submenu_page(\n\t\t\t'woocommerce',\n\t\t\t__( 'Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN ),\n\t\t\t__( 'Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN ),\n\t\t\t'manage_woocommerce',\n\t\t\t'wc_pre_orders',\n\t\t\tarray( $this, 'show_sub_menu_page' )\n\t\t);\n\n\t\t// add the Pre-Orders list Screen Options\n\t\tadd_action( 'load-' . $this->page_id, array( $this, 'add_pre_orders_list_options' ) );\n\t}", "function wimbase_menu_link(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n $icon = NULL;\n\n $menu_icon = isset($element['#localized_options']['menu_icon']) ? $element['#localized_options']['menu_icon'] : NULL;\n // Add menu item icon.\n if (is_array($menu_icon) && $menu_icon['enable'] && $menu_icon['path']) {\n $icon = '<span><img class=\"item-icon rs_skip\" src=\"' . image_style_url($menu_icon['image_style'], $menu_icon['path']) . '\"></span>';\n $element['#localized_options']['html'] = TRUE;\n }\n if ($element['#below']) {\n // Prevent dropdown functions from being added to management menu so it\n // does not affect the navbar module.\n if (($element['#original_link']['menu_name'] === 'management') && (module_exists('navbar'))) {\n $sub_menu = drupal_render($element['#below']);\n }\n elseif ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) {\n // Add our own wrapper.\n unset($element['#below']['#theme_wrappers']);\n $sub_menu = '<ul class=\"dropdown-menu\">' . drupal_render($element['#below']) . '</ul>';\n // Generate as standard dropdown.\n $element['#attributes']['class'][] = 'dropdown';\n $element['#localized_options']['html'] = TRUE;\n\n // Set dropdown trigger element to # to prevent inadvertant page loading\n // when a submenu link is clicked.\n $element['#localized_options']['attributes']['data-target'] = '#';\n $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';\n $element['#localized_options']['attributes']['data-toggle'] = 'dropdown';\n }\n }\n // On primary navigation menu, class 'active' is not set on active menu item.\n // @see https://drupal.org/node/1896674\n if (($element['#href'] == $_GET['q'] || ($element['#href'] === '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) {\n $element['#attributes']['class'][] = 'active';\n }\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], ['expanded']);\n\n $output = l($icon . $element['#title'], $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function add_nav_menu_items($items) {\n if(!is_user_logged_in()) {\n $items = $items. '<li class=\"right-nav menu-item login-link\"><a href=\"/wp-login.php\">Login</a></li>';\n }\n if(!wp_is_mobile()) {\n $twitterlink= '<li class=\"right-nav menu-item\"><a href=\"https://www.twitter.com/F3thefort\"><i class=\"fa fa-twitter\"></i></a></li>';\n $slacklink= '<li class=\"right-nav menu-item\"><a href=\"https://f3thefort.slack.com/\"><i class=\"fa fa-slack\"></i></a></li>';\n $items = $items . $twitterlink . $slacklink;\n }\n return $items;\n}", "function threed_admin_plugin_menu_links($menu)\n{\n $menu[] = array(\n 'NAME' => 'ThreeD',\n 'URL' => THREED_ADMIN,\n );\n return $menu;\n}", "function add_sub_menu($name, $link, $root_menu, $meta = FALSE)\r\n {\r\n global $wp_admin_bar;\r\n if ( !is_super_admin() || !is_admin_bar_showing() )\r\n return;\r\n \r\n $wp_admin_bar->add_menu( array(\r\n 'parent' => $root_menu,\r\n 'title' => $name,\r\n 'href' => $link,\r\n 'meta' => $meta) );\r\n \r\n }", "function custom_adminbar_menu( $meta = TRUE ) { \n global $wp_admin_bar; \n if ( !is_user_logged_in() ) { return; } \n if ( !is_super_admin() || !is_admin_bar_showing() ) { return; } \n $wp_admin_bar->add_menu( array( \n 'id' => 'custom_menu', \n 'title' => __( 'Menu Name', 'tabula-rasa' ), \n 'href' => 'http://google.com/', \n 'meta' => array( target => '_blank' ) ) \n ); \n}", "function h_add_menu(string $title, array $args) {\n h_add_menus([\n $title => $args\n ]);\n}", "function menuMahasiswa(){\n?>\n <!-- Optionally, you can add icons to the links -->\n <li><a href=\"index.php\"><i class=\"fa fa-circle\"></i> <span>Biodata</span></a></li>\n <li><a href=\"transkripNilai.php\"><i class=\"fa fa-circle\"></i> <span>Laporan Nilai</span></a></li>\n<?php\n }", "function power_do_nav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'primary' ) || ! has_nav_menu( 'primary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-primary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'primary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "public function add()\n\t{\n\t\t// Add a Sub-Nav Link\n\t\tEvent::add('ushahidi_action.nav_admin_settings', array($this, '_settings_link'));\n\t\tEvent::add('ushahidi_action.nav_main_top', array($this, '_top_nav_link'));\t\t\n\t\t// Only add the events if we are on the main controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\tswitch (Router::$method)\n\t\t\t{\n\n\t\t\t\t// Hook into the main dashboard\n\t\t\t\tcase 'index':\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tEvent::add('ushahidi_action.main_sidebar', array($this, '_display_flickrwiji'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telseif (Router::$controller == 'flickrwijit')\n\t\t{ \t\n\t\t\t// Add Flickrwijit to settings page\n\t\t\tswitch(Router::$method) \n\t\t\t{\n\t\t\t\tcase 'index':\n\t\t\t\t\t\n\t\t\t\t\t//Hook js and css files into flickrwijit page\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function add_Main_Nav() {\n\tregister_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function do_menu() {\n print \"\n <a href=\\\"member-index.php\\\">Home</a> |\n <a href=\\\"display-comment.php\\\">Display All Comments</a> |\n <a href=\\\"add-comment.php\\\">Add Comment</a> |\n <a href=\\\"edit-comment.php\\\">Edit Comment</a> |\n <a href=\\\"delete-comment.php\\\">Delete Comment</a> |\n <a href=\\\"logout.php\\\">Logout</a> \n <HR>\n \";\n }", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function adwr_menu_link($vars) {\n //gs\n $menu_class = str_replace(' ', '-', strtolower($vars['element']['#original_link']['link_title']));\n $vars['element']['#attributes']['class'][] = 'menu-li-' . $menu_class;\n if (isset($variables['element']['#localized_options'])) {\n $vars['element']['#localized_options']['attributes']['class'][] = 'menu-' . $menu_class;\n }\n return theme_menu_link($vars);\n}", "function login_menu() {\n $asf = CAsdf::Instance();\n if($asf->user['isAuthenticated']) {\n $items = \"<a href='\" . create_url('user/profile') . \"'><img class='gravatar' src='\" . get_gravatar(20) . \"' alt=''> \" . $asf->user['acronym'] . \"</a> \";\n if($asf->user['hasRoleAdministrator']) {\n $items .= \"<a href='\" . create_url('acp') . \"'>acp</a> \";\n }\n $items .= \"<a href='\" . create_url('user/logout') . \"'>logout</a> \";\n } else {\n $items = \"<a href='\" . create_url('user/login') . \"'>login</a> \";\n }\n return \"<nav id='login-menu'>$items</nav>\";\n}", "function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '', $position = \\null)\n {\n }", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "function afrozaar_add_plugin_link($links)\n{\n $links[] = '<a href=\"options-general.php?page=plugin.php\">Settings</a>';\n //array_unshift($links, $settings_link);\n return $links;\n}", "function elzero_add_menu() {\n // register_nav_menu('manin-menu', __('Main Navigation Menu'));\n register_nav_menus(array(\n 'main-menu' => 'Main Navigation Menu',\n 'footer-menu' => 'Footer Classic Menu'\n ));\n}", "function h_add_menus(array $args) {\n if (!is_admin()) { return;}\n\n $menu = new H_Sidenav($args);\n $menu->add();\n}", "function grav_footer_links() {\n wp_nav_menu(\n \tarray(\n \t\t'menu' => 'footer_links', /* menu name */\n \t\t'theme_location' => 'footer_links', /* where in the theme it's assigned */\n \t\t'container_class' => 'footer-links clearfix' /* container class */\n \t)\n\t);\n}", "function register_nav_menu($location, $description)\n {\n }", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_host_add_list', array('content' => $content));\n }", "public function updateNavbar()\n {\n if(! array_key_exists ( 'navbar', $this->options['paths'] ) )\n {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/navbar.blade.php';\n $target = base_path($this->options['paths']['navbar']);\n $hook = '<!-- bread_navbar -->';\n\n $this->updateFileContent($target, $hook, $file);\n }", "function add_admin_menu() {\n\t\t$this->readme_page = new Launchable_AdminPage();\n\n\t\t$this->menu_id = add_menu_page(\n\t\t\t__( 'Launchable Options', $this->text_domain ), // Page Title\n\t\t\t__( 'Launchable', $this->text_domain ), // Menu Title\n\t\t\t'manage_options', // Capability\n\t\t\t$this->text_domain, // Slug\n\t\t\tarray(&$this->options_page, 'readme_page') );\n\n\t\t$this->options_page = new Launchable_AdminPage();\n\t\tadd_submenu_page(\n\t\t\t$this->text_domain, // Slug\n\t\t\t__( 'Readme', $this->text_domain ), // Page Title\n\t\t\t__( 'Readme', $this->text_domain ), // Menu Title\n\t\t\t'manage_options', // Capability\n\t\t\t'launchable-readme',//$this->text_domain, // Menu Slug\n\t\t\tarray(&$this->readme_page, 'readme_page') );\n\t}", "function myplugin_Add_My_Admin_Link()\n{\n add_menu_page(\n 'Plugin TOTO Page', // Titre de la page\n 'Plugin TOTO', // Texte du lien dans le menu\n 'manage_options', // capacité nécessaire pour accéder au lien\n 'ShotcodeAndSEO/includes/toto-acp-page.php' // fichier à afficher quand on clique sur le lien\n );\n}", "public function add_menu($node)\n {\n }", "function links_add_target($content, $target = '_blank', $tags = array('a'))\n {\n }", "static function add_link($menu_params) {\n // requiered parameters\n self::check_params(__CLASS__, __FUNCTION__, $menu_params, array(\n 'title' => 'Param is required!',\n 'url' => 'Param is required!',\n 'xfn' => 'Param is required!',\n 'add_to_menu_id' => 'A menu id generated by ale_demo_menus::create_menu is required'\n ));\n\n\n $itemData = array (\n 'menu-item-object' => '',\n 'menu-item-type' => 'custom',\n 'menu-item-title' => $menu_params['title'],\n 'menu-item-url' => $menu_params['url'],\n 'menu-item-xfn' => $menu_params['xfn'],\n 'menu-item-status' => 'publish'\n );\n\n if (!empty($menu_params['parent_id'])) {\n $itemData['menu-item-parent-id'] = $menu_params['parent_id'];\n }\n\n $menu_item_id = wp_update_nav_menu_item($menu_params['add_to_menu_id'], 0, $itemData);\n return $menu_item_id;\n }", "function thesis_openhooks_menu() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->add_menu(array(\n\t\t\t'id' => 'openhook',\n\t\t\t'title' => __('OpenHook'),\n\t\t\t'href' => admin_url('options-general.php?page=openhook&tab=tha')\n\t\t\t//'href' => $bloginfo('url')'/wp-admin/options-general.php?page=openhook&tab=tha'\n\t));\n}", "private function menu()\n {\n $data['links'] = ['create', 'read', 'update', 'delete'];\n\n return $this->view->render($data, 'home/menu');\n }", "protected function setLinksBar()\n {\n $mysidia = Registry::get(\"mysidia\");\n $this->linksBar = new Paragraph;\n $linkTitle = new Comment(\"{$mysidia->user->username}'s Links:\");\n $linkTitle->setBold();\n $this->linksBar->add($linkTitle);\n \n $linksList = new LinksList(\"ul\");\n $this->setLinks($linksList);\n \n $this->linksBar->add($linksList);\n $this->setDivision($this->linksBar);\n }", "function wpbp_bookmark_add_menu($items, $args)\n{\n if (!is_user_logged_in()) return $items;\n\n if( $args->theme_location == 'primary' ) {\n return $items . '\n <li id=\"wpbp_bookmark_item\" class=\"menu-item menu-item-type-custom menu-item-object-custom wpbp_bookmark_menu\">\n <a href=\"/page-bookmarks/\"><i>★</i>Bookmarks</a>\n </li>\n ';\n }\n return $items;\n}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function artspace_aboutmenu() {\n\n\t$locations = array(\n\t\t'orange' => __( 'Top About Menu', 'text_domain' ),\n\t);\n\tregister_nav_menus( $locations );\n\n}", "function tccc_theme_menu_link(array $variables) {\n \n $element = $variables['element'];\n $output = '';\n $sub_menu = '';\n \n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n \n \n //If dummy output different markup \n if($element['#href'] == 'dummy'){\n $output .= '<div class=\"category-link\">' . $element['#title'] . '</div>';\n }\n \n elseif($element['#href'] == 'column'){\n \n $element['#attributes']['class'][] = 'column';\n $output .= '';\n \n }\n \n else {\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']); \n\n if($element['#original_link']['depth'] == 1){\n $output .= '<div class=\"arrow-pointer\"></div>';\n } \n \n }\n \n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "private function __addMainNav($title, $link, $access, $statuses) {\n\t\t$this->__mainNav[] = array(\n\t\t\t\t\t\t\t\t'title'\t\t=>\t$title,\n\t\t\t\t\t\t\t\t'link'\t\t=>\t$link,\n\t\t\t\t\t\t\t\t'access'\t=>\t$access,\n\t\t\t\t\t\t\t\t'statuses'\t=>\t$statuses\n\t\t\t\t\t\t\t\t);\n\t}", "function add_nav_options( $options ) {\r\n global $bp;\r\n \r\n $options[__( 'Schedule', 'bpsp' )] = $options[__( 'Home', 'bpsp' )] . '/schedules';\r\n return $options;\r\n }", "public function updateJsNavbar()\n {\n if(! array_key_exists( 'js_navbar', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_navbar']);\n $hook = '/* bread_js_navbar_link */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/navbar.js';\n $this->updateFileContent($target, $hook, $file);\n }", "function register_ac_menu() \n{\n register_nav_menu( 'primary', 'Primary Menu' );\n}", "function printMenuLink() {\r\n\tprint '<br><br><a href=\"/menu/menu.php\">Back to Menu</a>';\r\n}", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollectionitem_add_list', array('content' => $content));\n }", "public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->name,\n\t\t\t'publish_pages',\n\t\t\t$this->plugin->varName,\n\t\t\tarray($this, 'page'),\n\t\t\t$this->plugin->uri . 'assets/images/icn-menu.png'\n\t\t);\n\t}", "public function _top_nav_link()\n\t{\n\t\t$top_nav = Event::$data;\n\t\t\n\t\t//fetch flickrwijit settings from db\n\t\t$flickrwijit_settings = ORM::factory('flickrwijit',1);\n\t\t\n\t\tif($flickrwijit_settings->block_position == 1 ) {\n\t\t\n\t\t\techo ($top_nav == \"flickrwijit\") ? \n\t\t\t\tKohana::lang('flickrwijit.flickrwijit_top_nav') : \n\t\t\t\t\"<a href=\\\"\".url::site().\"flickrwijit\\\">\".\n\t\t\t\tKohana::lang('flickrwijit.flickrwijit_top_nav').\"</a>\";\n\t\n\t\t}\n\t}", "function ahr_add_settings_link( $links ) {\r\n \r\n\tglobal $AHR_SLUG;\r\n\t\r\n $settings_link = \"<a href='options-general.php?page=$AHR_SLUG'>\" . __( 'Settings' ) . '</a>';\r\n array_unshift( $links, $settings_link );\r\n \r\n return $links;\r\n \r\n}", "function add_root_menu($name, $id, $href = FALSE)\r\n {\r\n global $wp_admin_bar;\r\n if ( !is_super_admin() || !is_admin_bar_showing() )\r\n return;\r\n\r\n $wp_admin_bar->add_menu( array(\r\n 'id' => $id,\r\n 'title' => $name,\r\n 'href' => $href ) );\r\n }", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollection_add_list', array('content' => $content));\n }", "function ieatwp_default_menu(){ ?>\n\t\t<ul class=\"navbar navbar-right\">\n <li><a href=\"#section_intro\" class=\"easing\">Home</a></li>\n <li><a href=\"#section_about\" class=\"easing\">About</a></li>\n <li><a href=\"#section_work\" class=\"easing\">Strategy</a></li>\n <li><a href=\"#section_resume\" class=\"easing\">Resume</a></li>\n <li><a href=\"#section_portfolio\" class=\"easing\">Portfolio</a></li>\n <li><a href=\"#section_services\" class=\"easing\">Services</a></li>\n <li><a href=\"#section_contact\" class=\"easing\">Contact</a></li>\n </ul>\n<?php }", "function register_my_menu() {\n register_nav_menu( 'blog-menu', __( 'Blog Menu' ) );\n}", "public function add_browse_sites_link() {\n\t\tif ( count( get_blogs_of_user( get_current_user_id() ) ) < 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the menu item.\n\t\tadd_menu_page( __( 'site-switcher', 'jetpack' ), __( 'Browse sites', 'jetpack' ), 'read', 'https://wordpress.com/home', null, 'dashicons-arrow-left-alt2', 0 );\n\t\tadd_filter( 'add_menu_classes', array( $this, 'set_browse_sites_link_class' ) );\n\t}", "function myphotolinks_menu() {\n\n add_options_page(\n 'myphotolinks',\n 'myphotolinks',\n 'manage_options',\n 'myphotolinks',\n 'myphotolinks_options_page'\n );\n }", "public function nav($nav)\n { \n $this->sBody.=$nav;\n }", "public function addMenu($data){\n\n\t\treturn $this->insert(['item'=>$data['item'], 'anchor' => $data['anchor']]);\n\t}", "function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }", "function add_menu() {\n // Add \"Telegram Bot\" menu\n $telegram_logo = \"https://upload.wikimedia.org/wikipedia/commons/8/82/Telegram_logo.svg\";\n add_menu_page(\"Telegram Bot\", \"Telegram Bot\", 4, sanitize_key(\"home\"), \"plugin_home_page\", $telegram_logo);\n \n // Add \"Admin panel\" submenu\n add_submenu_page(sanitize_key(\"home\"), \"Admin panel\", \"Admin panel\", 4, sanitize_key(\"admin\"), \"plugin_admin_panel_page\");\n}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "function bang_menu_link__menu_tabs_menu($vars) {\n // Run classes array through our custom stripper.\n $vars['element']['#attributes']['class'] = ddbasic_remove_default_link_classes($vars['element']['#attributes']['class']);\n\n // Check if the class array is empty.\n if (empty($vars['element']['#attributes']['class'])) {\n unset($vars['element']['#attributes']['class']);\n }\n\n $element = $vars['element'];\n\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n // Add default class to a tag.\n $element['#localized_options']['attributes']['class'] = array(\n 'menu-item',\n );\n\n // Make sure text string is treated as html by l function.\n $element['#localized_options']['html'] = TRUE;\n\n $element['#localized_options']['attributes']['class'][] = 'js-topbar-link';\n $title_prefix = '';\n\n // Add some icons to our top-bar menu. We use system paths to check against.\n switch ($element['#href']) {\n case 'search':\n $title_prefix = '<i class=\"icon-search\"></i>';\n $element['#localized_options']['attributes']['class'][] = 'topbar-link-search';\n $element['#attributes']['class'][] = 'topbar-link-search';\n $element['#title'] = '';\n break;\n\n case 'node':\n // Special placeholder for mobile user menu. Fall through to next case.\n $element['#localized_options']['attributes']['class'][] = 'default-override';\n\n case 'user':\n // If a user is logged in we change the menu item title.\n if (user_is_logged_in()) {\n $element['#title'] = t('My Account');\n $element['#attributes']['class'][] = 'topbar-link-user-account';\n $element['#localized_options']['attributes']['class'][] = 'topbar-link-user-account';\n }\n else {\n $element['#attributes']['class'][] = 'topbar-link-user';\n $element['#localized_options']['attributes']['class'][] = 'topbar-link-user';\n }\n break;\n\n case 'user/logout':\n $element['#localized_options']['attributes']['class'][] = 'topbar-link-signout';\n $element['#attributes']['class'][] = 'topbar-link-signout';\n\n // For some unknown issue translation fails for this title.\n $element['#title'] = t($element['#title']);\n break;\n\n default:\n $element['#localized_options']['attributes']['class'][] = 'topbar-link-menu';\n $element['#attributes']['class'][] = 'topbar-link-menu';\n break;\n }\n\n $output = l($title_prefix . '<span>' . $element['#title'] . '</span>', $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function elhero_register_menu()\r\n{\r\n //register_nav_menu('bootstrap-menu',__('Bootstrap Navigation Bar'));\r\n register_nav_menus( array(\r\n 'bootstrap-menu' => 'Bootstrap Navigation Bar',//create location\r\n 'footer-menu' => 'Footer-menu'//to add new location to wordpress dashboard menu \r\n //name => location_name\r\n ) );\r\n}" ]
[ "0.64595234", "0.6451323", "0.6442086", "0.63449335", "0.6333488", "0.6293829", "0.6293795", "0.6258476", "0.6257735", "0.6255168", "0.62467146", "0.6231069", "0.6186833", "0.6182114", "0.61751217", "0.6152263", "0.61469096", "0.6121513", "0.61150986", "0.6092867", "0.6092637", "0.6086336", "0.6077875", "0.60616034", "0.605567", "0.604408", "0.60320514", "0.60199475", "0.6002787", "0.60022944", "0.59998626", "0.5999419", "0.5990991", "0.59789765", "0.59778845", "0.59758455", "0.5960345", "0.5958386", "0.59423107", "0.5940163", "0.59344506", "0.5930041", "0.59281623", "0.59271187", "0.59193385", "0.5917898", "0.5910372", "0.58909744", "0.5880749", "0.58775073", "0.58656484", "0.58640873", "0.58602285", "0.58584386", "0.58510715", "0.5827497", "0.58193994", "0.58147764", "0.58087295", "0.58081686", "0.5803823", "0.5803391", "0.57997805", "0.5799693", "0.5795054", "0.57924026", "0.57900506", "0.57866234", "0.5783537", "0.5781497", "0.57736766", "0.57701224", "0.57676846", "0.5764253", "0.57625425", "0.5754014", "0.5736633", "0.5734493", "0.57340264", "0.5731948", "0.5730469", "0.5729009", "0.571978", "0.5711492", "0.5709149", "0.5706558", "0.57035375", "0.56997347", "0.56978065", "0.56956434", "0.5692834", "0.5691006", "0.5688878", "0.56883955", "0.5682914", "0.56502223", "0.56488776", "0.5648812", "0.56438935", "0.5637923" ]
0.5727567
82
Add a button to the navbar.
public function button ($name, array $options = []) { $options = $this->addClass ($options, 'navbar-btn') ; return $this->Form->button ($name, $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navbar()\r\n {\r\n }", "function nav_buttons()\n\t{\n\t\t?>\n\t\t<input type=\"button\" value=\"Create New Preorder &gt;\" onclick=\"document.location='/admin/utilities/preorder.php?act=new'\" class=\"btn\">\n\t\t<p />\n\t\t<?php\n\t}", "function addButton($label='Continue'){\n if(!is_array($label)){\n $label=array($label, 'icon-r'=>'right-big');\n }\n return $this->add('Button',null,'Button')\n ->set($label);\n }", "protected function _setAddButton()\n {\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array('id' => \"add_tax_\" . $this->getElement()->getHtmlId(),\n 'label' => Mage::helper('catalog')->__('Add Tax'),\n 'onclick' => \"weeeTaxControl.addItem('\" . $this->getElement()->getHtmlId() . \"')\",\n 'class' => 'add'\n )));\n }", "public function addButton(&$button)\n {\n $this->getChildren()->addControl($button);\n }", "public function decorate()\n {\n\n $this->element->addItemButton\n ->addClass('btn-sm push-top')\n ->appendContent(' <i class=\"btr bt-plus btn-no-anim\"></i>')\n ;\n\n $this->element->removeItemButton->content->clear();\n $this->element->removeItemButton->content('<i class=\"btr bt-trash\" style=\"margin:0\"></i>');\n\n }", "public function addsButtons() {}", "public function addButton(\\SetaPDF_FormFiller_Field_Button $button) {}", "function addButton($a_button_name)\n\t{\n\t\tarray_push($this->buttons, $a_button_name);\n\t}", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "public function add_page_button($button) {\n $this->buttons[]=$button;\n }", "Public function Anavbar(){\n\t\n\t}", "public function makeLinkButton() {}", "function newButton($view) {\n\t\t$str = '<a class=\"button is-primary\" href=\"?do=edit&amp;view='.$view.'\">New</a>';\n\t\treturn $str;\n\t}", "public function create()\n {\n return view(\"backend.navbars.create\");\n }", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "public function create()\n {\n return view('navbar.create');\n }", "protected function addToolBar() \r\n {\r\n // Ponemos el nombre del titulo de la vista y el icono que seleccionemos.\r\n JToolBarHelper::title(JText::_('Modelos de Marcas de Vehiculo'),'bookmark banners');\r\n JToolBarHelper::deleteList('', 'nodelos.delete');\r\n JToolBarHelper::editList('nodelo.edit');\r\n JToolBarHelper::addNew('nodelo.add');\r\n }", "function createEmptyCartButton(){\n return '<h2 class = \"ui horizontal divider\"><a class = \"ui red button\" href =\"shopping-cart.php?removeAllCart=1\"> Empty Cart</a></h2><br>';\n}", "function email_link_add_button($buttons) {\r\n\tarray_push($buttons, 'separator', 'email_link_name');\r\n\treturn $buttons;\r\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "public function show(Navbar $navbar)\n {\n }", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "protected function add_header_button( $add_param = '' ) {\n\n\t\t\tif ( 'off' === $this->allow_insert ) {\n\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( WPDA::is_wpda_table( $this->table_name ) ||\n\t\t\t\t ( 'on' === WPDA::get_option( WPDA::OPTION_BE_ALLOW_INSERT ) &&\n\t\t\t\t count( $this->wpda_list_columns->get_table_primary_key() ) ) > 0\n\t\t\t\t) {\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<form\n\t\t\t\t\t\t\tmethod=\"post\"\n\t\t\t\t\t\t\taction=\"?page=<?php echo esc_attr( $this->page ); ?><?php echo '' === $this->schema_name ? '' : '&schema_name=' . esc_attr( $this->schema_name ); ?>&table_name=<?php echo esc_attr( $this->table_name ); ?><?php echo esc_attr( $add_param ); ?>\"\n\t\t\t\t\t\t\tstyle=\"display: inline-block; vertical-align: baseline;\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"new\">\n\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php echo __( 'Add New', 'wp-data-access' ); ?>\"\n\t\t\t\t\t\t\t\t class=\"page-title-action\">\n\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t// Add import button to title.\n\t\t\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\n\t\t\t\t\t<?php\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Add import button to title.\n\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function addButtons()\n {\n if (!Mage::getSingleton('sheep_subscription/adminhtml_acl')->canEditSubscription()) {\n return;\n }\n\n /** @var Sheep_Subscription_Model_Subscription $subscription */\n $subscription = $this->_getModel();\n /** @var Sheep_Subscription_Model_Service $service */\n $service = Mage::getSingleton('sheep_subscription/service');\n\n if ($service->canBeCancelled($subscription)) {\n $this->addButton('cancel', array(\n 'label' => 'Cancel',\n 'onclick' => \"window.setLocation('{$this->getCancelUrl()}')\"\n ));\n }\n\n if ($service->canBePaused($subscription)) {\n $this->addButton('pause', array(\n 'label' => $this->__('Pause'),\n 'onclick' => \"window.setLocation('{$this->getPauseUrl()}')\"\n ));\n }\n\n if ($service->canBeResumed($subscription)) {\n $this->addButton('resume', array(\n 'label' => 'Resume',\n 'onclick' => \"window.setLocation('{$this->getResumeUrl()}')\"\n ));\n }\n }", "public function updateNavbar()\n {\n if(! array_key_exists ( 'navbar', $this->options['paths'] ) )\n {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/navbar.blade.php';\n $target = base_path($this->options['paths']['navbar']);\n $hook = '<!-- bread_navbar -->';\n\n $this->updateFileContent($target, $hook, $file);\n }", "function shortcode_insert_button()\n {\n $this->config['self_closing'] = 'yes';\n\n $this->config['name'] = __('Download Button', 'avia_framework');\n $this->config['tab'] = __('Content Elements', 'avia_framework');\n $this->config['icon'] = AviaBuilder::$path['imagesURL'] . \"sc-button.png\";\n $this->config['order'] = 1;\n $this->config['target'] = 'avia-target-insert';\n $this->config['shortcode'] = 'avia_download_button';\n $this->config['tooltip'] = __('Creates a download button', 'avia_framework');\n $this->config['tinyMCE'] = ['tiny_always' => true];\n $this->config['preview'] = true;\n }", "function techmarket_header_action_button() {\n\t\t\n\t\t$action_button_args = apply_filters( 'techmarket_header_action_button_args', array(\n\t\t\t'url'\t=> '#',\n\t\t\t'text' => esc_html__( 'Go to TechMarket Shop', 'techmarket' ),\n\t\t\t'icon'\t=> is_rtl() ? 'tm tm-long-arrow-left' : 'tm tm-long-arrow-right'\n\t\t) );\n\n\n\t\tif ( apply_filters( 'techmarket_show_header_action_button', true ) && ! empty( $action_button_args ) ) : ?>\n\t\t<a role=\"button\" class=\"header-action-btn\" href=\"<?php echo esc_url( $action_button_args['url'] );?>\">\n\t\t\t<?php echo esc_html( $action_button_args['text'] ); ?>\n\t\t\t<?php if( ! empty( $action_button_args['icon'] ) ) : ?>\n\t\t\t\t<i class=\"<?php echo esc_attr( $action_button_args['icon'] );?>\"></i>\n\t\t\t<?php endif; ?>\n\t\t</a>\n\t\t<?php endif;\n\t}", "function admin_profile_button(){\n\n echo \"\n <li class=\\\"dropdown-header\\\">\n Pages\n </li>\n <li>\n <a href=\\\"?_route=profile\\\">Profile</a>\n </li>\n <li>\n <a href=\\\"base_pages_profile.html\\\"><span class=\\\"badge badge-success pull-right\\\">3</span> Blog</a>\n </li>\n <li>\n <a href='?_route=logout'>Logout</a>\n </li>\n \";\n}", "public function initPageHeaderToolbar()\n {\n if (empty($this->display)) {\n $this->page_header_toolbar_btn['new_reward'] = [\n 'href' => self::$currentIndex.'&addgamifications_reward&token='.$this->token,\n 'desc' => $this->l('Add new reward'),\n 'icon' => 'process-icon-new',\n ];\n }\n\n parent::initPageHeaderToolbar();\n }", "protected function addToolbar()\n\t{\n\t\tif (!$this->edit)\n\t\t{\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_CLUB_ADD_NEW'),'jl-clubs');\n\t\t\tJLToolBarHelper::save('club.save');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('club.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close` and the apply button is showed\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_CLUB_EDIT'). ': ' . $this->form->getValue('name'), 'jl-clubs');\n\t\t\tJLToolBarHelper::apply('club.apply');\n\t\t\tJLToolBarHelper::save('club.save');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('club.cancel','COM_JOOMLEAGUE_GLOBAL_CLOSE');\n\t\t}\n\t\t\n\t\tJToolBarHelper::help('screen.joomleague',true);\n\t}", "public function initPageHeaderToolbar()\n {\n if (empty($this->display)){\n $this->page_header_toolbar_btn = array(\n 'new' => array(\n 'href' => self::$currentIndex.'&addwpproductcarousels&token='.$this->token,\n 'desc' => $this->l('Add New Carousel', null, null, false),\n 'icon' => 'process-icon-new'\n ),\n 'options' => array(\n 'href' => $this->context->link->getAdminLink('AdminModules') . '&configure=wpproductcarousels',\n 'desc' => $this->l('Options'),\n 'icon' => 'process-icon-cogs'\n )\n );\n }\n\n parent::initPageHeaderToolbar();\n }", "function add_tinymce_toolbar_button( $buttons ) {\n \n array_push( $buttons, '|', 'custom_link_class' );\n return $buttons;\n }", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "function add_button(TinyMCE_Button_Interface $button) {\n\t\t$button_id = $button->get_id();\n\t\t$this->buttons[$button_id][] = $button;\n\t}", "public function show(Navbar $navbar)\n {\n //\n }", "public function addButton(TDProject_Core_Interfaces_Block_Widget_Button $block);", "function bg_AddBeyondGrammarButton($buttons){\n array_push($buttons, \"separator\", \"BeyondGrammar\");\n return $buttons;\n}", "public function render()\n {\n return view('dwbtui::components.navbar');\n }", "public function render()\n {\n return view('components.button-bar');\n }", "protected function makeButtons()\n {\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n // Add CSH (Context Sensitive Help) icon to tool bar\n $contextSensitiveHelpButton = $this->buttonBar->makeHelpButton()\n ->setModuleName($this->descrTable)\n ->setFieldName('columns_' . $this->MOD_SETTINGS['function']);\n $this->buttonBar->addButton($contextSensitiveHelpButton);\n }\n $lang = $this->getLanguageService();\n // View page\n if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {\n $viewButton = $this->buttonBar->makeLinkButton()\n ->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))\n ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage'))\n ->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))\n ->setHref('#');\n\n $this->buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n // Shortcut\n $shortcutButton = $this->buttonBar->makeShortcutButton()\n ->setModuleName($this->moduleName)\n ->setGetVariables([\n 'id',\n 'M',\n 'edit_record',\n 'pointer',\n 'new_unique_uid',\n 'search_field',\n 'search_levels',\n 'showLimit'\n ])\n ->setSetVariables(array_keys($this->MOD_MENU));\n $this->buttonBar->addButton($shortcutButton);\n\n // Cache\n if (empty($this->modTSconfig['properties']['disableAdvanced'])) {\n $clearCacheButton = $this->buttonBar->makeLinkButton()\n ->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))\n ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))\n ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);\n }\n if (empty($this->modTSconfig['properties']['disableIconToolbar'])) {\n // Edit page properties and page language overlay icons\n if ($this->pageIsNotLockedForEditors() && $this->getBackendUser()->checkLanguageAccess(0)) {\n // Edit localized page_language_overlay only when one specific language is selected\n if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)\n ->getQueryBuilderForTable('pages_language_overlay');\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class))\n ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));\n $overlayRecord = $queryBuilder\n ->select('uid')\n ->from('pages_language_overlay')\n ->where(\n $queryBuilder->expr()->eq(\n 'pid',\n $queryBuilder->createNamedParameter($this->id, \\PDO::PARAM_INT)\n ),\n $queryBuilder->expr()->eq(\n 'sys_language_uid',\n $queryBuilder->createNamedParameter($this->current_sys_language, \\PDO::PARAM_INT)\n )\n )\n ->setMaxResults(1)\n ->execute()\n ->fetch();\n // Edit button\n $urlParameters = [\n 'edit' => [\n 'pages_language_overlay' => [\n $overlayRecord['uid'] => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')\n ];\n $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);\n $editLanguageButton = $this->buttonBar->makeLinkButton()\n ->setHref($url)\n ->setTitle($lang->getLL('editPageLanguageOverlayProperties'))\n ->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n $urlParameters = [\n 'edit' => [\n 'pages' => [\n $this->id => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')\n ];\n $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);\n $editPageButton = $this->buttonBar->makeLinkButton()\n ->setHref($url)\n ->setTitle($lang->getLL('editPageProperties'))\n ->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n }\n }", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "function add_ind_button($buttons) {\n\tarray_push($buttons, 'Indizar');\n\treturn $buttons;\n}", "function displayCreateButton() {\r\n\t \t\r\n\t \techo \"<a href='create.php' class='btn btn-success'>Create a New Question!!</a><br />\";\r\n\t \t\r\n\t }", "private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }", "public function showAddMenu()\n {\n return view('Admin.Bakery.pages.addMenu');\n }", "function addButton($caption, $href, $img = '', $hint = '',\n $down = FALSE, $noTranslation = FALSE) {\n if (!$noTranslation) {\n $hint = $this->_gt($hint);\n $caption = $this->_gt($caption);\n }\n $downString = (($down) ? ' down=\"down\"' : '');\n if (isset($this->images[$img])) {\n $glyph = ' glyph=\"'.papaya_strings::escapeHTMLChars($this->images[$img]).'\"';\n } elseif (preg_match('~^module:([a-f\\d]{32})/(.+)~', $img, $regs)) {\n $glyph = ' glyphscript=\"modglyph.php?module='.\n urlencode($regs[1]).'&amp;src='.urlencode($regs[2]).'\"';\n } else {\n $glyph = ' glyph=\"'.papaya_strings::escapeHTMLChars($img).'\"';\n }\n $button = sprintf(\n '<button title=\"%s\" href=\"%s\"%s hint=\"%s\" target=\"_self\"%s/>',\n papaya_strings::escapeHTMLChars($caption),\n papaya_strings::escapeHTMLChars($href),\n $glyph,\n papaya_strings::escapeHTMLChars($hint),\n $downString\n );\n $this->toolbar[] = array('btn', $button);\n }", "protected function addToolbar()\n\t{\t\t\n\t\t// Set toolbar items for the page\n\t\t$edit=JRequest::getVar('edit',true);\n\t\t$text=!$edit ? JText::_('COM_JOOMLEAGUE_GLOBAL_NEW') : JText::_('COM_JOOMLEAGUE_GLOBAL_EDIT');\n\t\tJLToolBarHelper::save('playground.save');\n\t\tif (!$edit)\n\t\t{\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_ADD_NEW'),'playground');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close` and the apply button is showed\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_EDIT'),'playground');\n\t\t\tJLToolBarHelper::apply('playground.apply');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel','COM_JOOMLEAGUE_GLOBAL_CLOSE');\n\t\t}\n\t\tJToolBarHelper::divider();\n\t\tJLToolBarHelper::onlinehelp();\t\n\t}", "function SidebarButton ($text, $link, $class = 'btn', $external = false) {\n \t$this->sidebar_buttons[] = array(\n \t\t\t\t\t\t\t\t'text' => $text,\n \t\t\t\t\t\t\t\t'link' => ($external == false) ? site_url($link) : $link,\n \t\t\t\t\t\t\t\t'class' => $class\n \t\t\t\t\t\t\t\t);\n \treturn true;\n }", "function add_record_button($action_title, $file_name, $button_text)\n{\n ?>\n <p style=\"font-size:21px\"><?= ucwords($action_title) ?></p>\n <p>\n <a href=\"<?= $_SERVER['SCRIPT_NAME'] ?>?p=<?= $file_name ?>\" class=\"btn btn-primary\" role=\"button\">\n <span class=\"glyphicon glyphicon-plus-sign\"></span> Add <?= ucwords($button_text) ?></a>\n </p>\n <?php\n}", "function reactor_do_nav_bar() { \n\tif ( has_nav_menu('main-menu') ) {\n\t\t$nav_class = ( reactor_option('mobile_menu', 1) ) ? 'class=\"hide-for-small\" ' : ''; ?>\n\t\t<div class=\"main-nav\">\n\t\t\t<nav id=\"menu\" <?php echo $nav_class; ?>role=\"navigation\">\n\t\t\t\t<div class=\"section-container horizontal-nav\" data-section=\"horizontal-nav\" data-options=\"one_up:false;\">\n\t\t\t\t\t<?php reactor_main_menu(); ?>\n\t\t\t\t</div>\n\t\t\t</nav>\n\t\t</div><!-- .main-nav -->\n\t\t\n\t<?php\t\n\tif ( reactor_option('mobile_menu', 1) ) { ?> \n\t\t<div id=\"mobile-menu-button\" class=\"show-for-small\">\n\t\t\t<button class=\"secondary button\" id=\"mobileMenuButton\" href=\"#mobile-menu\">\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t</button>\n\t\t</div><!-- #mobile-menu-button --> \n\t<?php }\n\t}\n}", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "public function addButtons()\n {\n if ($this->isCreateButtonRequired()) {\n $this->getToolbar()->addChild('bluemedia_return', Button::class, [\n 'label' => __('Return BM'),\n 'onclick' => 'BlueMedia.BluePayment.showPopup();'\n ]);\n }\n\n return $this;\n }", "protected function addToolbar()\n\t{\n\t\t$bar = JToolBar::getInstance('sender');\n\t\t$bar->appendButton('Link', 'export', 'COM_NEWSLETTER_NEWSLETTER_SEND', '#');\n\n\t\t// Load the submenu.\n\t\tNewsletterHelper::addSubmenu(JRequest::getVar('view'));\n\t}", "function addButton($context){\n\t\t$context .= '<a href=\"'.admin_url('admin.php?action=iframe_pagination_ssm&TB_iframe=1').'\" onclick=\"return false;\" class=\"thickbox\" title=\"' . __(\"Browse in shortcode manager\", 'ssm') . '\"><img src=\"'.SSM_URL . \"/images/shortcodes.png\".'\" alt=\"' . __(\"Insert a shortcode\", 'ssm') . '\" /></a>';\n\t\treturn $context;\n\t}", "public function render()\n {\n return view('components.navbar');\n }", "public function onNavigationBar($event) {\n if ($this->user) {\n // add the profile links\n Navigation::addBar('default', array('title' => 'View Profile', 'slug' => 'account/profile', 'icon' => 'cog'));\n\n // add the admin links\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'View Logs', 'slug' => 'logviewer', 'icon' => 'wrench'));\n Navigation::addBar('default', array('title' => 'Caching', 'slug' => 'caching', 'icon' => 'tachometer'));\n Navigation::addBar('default', array('title' => 'CloudFlare', 'slug' => 'cloudflare', 'icon' => 'cloud'));\n Navigation::addBar('default', array('title' => 'Queuing', 'slug' => 'queuing', 'icon' => 'random'));\n }\n\n // add the view users link\n if (Sentry::getUser()->hasAccess('mod')) {\n Navigation::addBar('default', array('title' => 'View Users', 'slug' => 'users', 'icon' => 'user'));\n }\n\n // add the create user link\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'Create User', 'slug' => 'users/create', 'icon' => 'star'));\n }\n\n // add the create page link\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Page', 'slug' => 'pages/create', 'icon' => 'pencil'));\n }\n\n // add the create post link\n if (Config::get('cms.blogging')) {\n if (Sentry::getUser()->hasAccess('blog')) {\n Navigation::addBar('default', array('title' => 'Create Post', 'slug' => 'blog/posts/create', 'icon' => 'book'));\n }\n }\n\n // add the create event link\n if (Config::get('cms.events')) {\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Event', 'slug' => 'events/create', 'icon' => 'calendar'));\n }\n }\n }\n }", "public function render()\n {\n return view('components.navbar-nav');\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "private function loadButtons()\n {\n $objAdd = $this->addButtonNew(_FEST);\n $objAdd->setInline();\n }", "public static function add_button() {\r\n\t\tif (current_user_can('edit_posts') || current_user_can('edit_pages')) {\r\n\t\t\tadd_filter('mce_external_plugins', 'TpsShortCodes::add_plugin');\r\n\t\t\tadd_filter('mce_buttons', 'TpsShortCodes::register_button');\r\n\t\t}\r\n\t}", "public function render()\n\t{\n\t\treturn view('components.navbar');\n\t}", "public function laba_rugi_bulanan() {\n\n $this->layout_lib->template_with_custom_navbar('analisa/navbar-sub-laba-rugi-bulanan', 'analisa/laba-rugi-bulanan');\n\n }", "public static function initToolbar($dir, $active, $sticky){\n $auth = Session::getAuth();\n?>\n <nav class=\"navbar navbar-expand-md navbar-dark bg-dark <?php if($sticky)echo 'sticky-top'; ?>\">\n <a class=\"navbar-brand\" href=\"<?php Nav::echoHome($dir); ?>\">\n <img src=\"<?php Asset::embedIcon($dir, 'primary.svg'); ?>\" width=\"30\" height=\"30\" class=\"d-inline-block align-top\" alt=\"\">\n </a>\n\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item <?php self::printActive($active, 'Home'); ?>\">\n <a class=\"nav-link\" href=\"<?php Nav::echoHome($dir); ?>\">Home<span class=\"sr-only\">(current)</span></a>\n </li>\n <li class=\"nav-item <?php self::printActive($active, 'Docs'); ?>\">\n <a class=\"nav-link\" href=\"https://www.trialation.com/proto-framework-docs/\" target=\"_blank\">Docs</a>\n </li>\n <li class=\"nav-item dropdown <?php self::printActive($active, 'Examples'); ?>\">\n <a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Samples\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">\n <a class=\"dropdown-item\" href=\"<?php Nav::echoPage($dir, \"examples/ex-api.php\") ?>\">Proto API Project</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoPage($dir, \"examples/ex-off-db.php\") ?>\">Proto DB Project</a>\n </div>\n </li>\n <li class=\"nav-item dropdown <?php self::printActive($active, 'More'); ?>\">\n <a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n More\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">\n <a class=\"dropdown-item\" href=\"https://www.trialation.com/proto-framework-docs/making-apis/\" target=\"_blank\">Proto API Docs</a>\n <a class=\"dropdown-item\" href=\"https://www.trialation.com/proto-framework-docs/proto-db/\" target=\"_blank\">Proto DB Docs</a>\n <div class=\"dropdown-divider\"></div>\n <a class=\"dropdown-item\" target=\"_blank\" href=\"https://github.com/TummanoonW/Proto-Framework\">GitHub</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoURL($dir, 'feedback.php'); ?>\">Send a feedback</a>\n <a class=\"dropdown-item\" href=\"<?php Nav::echoURL($dir, 'about.php'); ?>\">About</a>\n </div>\n </li>\n </ul>\n\n <!-- Right Side Bar -->\n <div class=\"inline\">\n <ul class=\"navbar-nav mr-auto\">\n <?php if(Session::checkUserExisted()){ ?>\n <li class=\"nav-item <?php self::printActive($active, 'Profile'); ?>\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'profile.php'); ?>\">\n <i class=\"far fa-user\"></i>\n <?php echo $auth->username ?> \n </a>\n </li>\n <?php }else{ ?>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'register.php'); ?>\">\n Register\n </a>\n </li> \n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"<?php Nav::echoURL($dir, 'login.php'); ?>\">\n Log In\n </a> \n </li> \n <?php } ?>\n </ul>\n </div>\n </div>\n </nav>\n<?php\n }", "function travelogue_buttons() {\n add_filter( \"mce_external_plugins\", \"travelogue_add_buttons\" );\n // add new buttons\n add_filter( 'mce_buttons', 'travelogue_register_buttons' );\n}", "protected function registerButtons() {}", "public function add_media_button(){\n\t\tif ( current_user_can( 'vfb_view_entries' ) ) :\n?>\n\t\t\t<a href=\"<?php echo add_query_arg( array( 'action' => 'visual_form_builder_media_button', 'width' => '450' ), admin_url( 'admin-ajax.php' ) ); ?>\" class=\"button add_media thickbox\" title=\"Add Visual Form Builder form\">\n\t\t\t\t<img width=\"18\" height=\"18\" src=\"<?php echo plugins_url( 'visual-form-builder-pro/images/vfb_icon.png' ); ?>\" alt=\"<?php _e( 'Add Visual Form Builder form', 'visual-form-builder-pro' ); ?>\" style=\"vertical-align: middle; margin-left: -8px; margin-top: -2px;\" /> <?php _e( 'Add Form', 'visual-form-builder-pro' ); ?>\n\t\t\t</a>\n<?php\n\t\tendif;\n\t}", "public function buttonbar (\\stdClass $param);", "function AddButtonURL( $ATitle, $AURL, $Size = \"full\"){\n $item['text'] = $ATitle;\n $item['url'] = $AURL;\n $item['size'] = $Size;\n return $item; \n}", "protected function registerButtons() {}", "function deleteButton() {\r\n\t \t\r\n\t \techo \"<a href='delete.php' class='btn btn-success'></a><br />\"; \r\n\t }", "public function ext_makeToolBar() {}", "function shortcode_insert_button()\n {\n $this->config['name']\t\t\t= __('Carousel With Thumbnails', 'swedenWp' );\n $this->config['tab']\t\t\t= __('Content Elements', 'swedenWp' );\n $this->config['icon']\t\t\t= swedenBuilder::$path['imagesURL'].\"sc-postslider.png\";\n $this->config['order']\t\t\t= 2;\n $this->config['target']\t\t\t= 'avia-target-insert';\n $this->config['shortcode'] \t\t= 'sw_thumb_nav_carousel';\n $this->config['shortcode_nested'] = array('sw_thumb_carousel_slide');\n $this->config['tooltip'] \t = __('Display a carousel element with thumb navigation', 'swedenWp' );\n }", "function holistic_nav_widget() {\n\tregister_widget( 'Holistic_Nav_Widget' );\n}", "public function define_navbar_nav_button_activate($p_state)\r\n\t\t{\r\n\t\t\t$this->c_navbar_nav_button_activate = $p_state;\r\n\t\t}", "protected function addToolBar()\n {\n $title = JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLDS');\n\n if ($this->pagination->total)\n {\n $title .= \"<span style='font-size: 0.5em; vertical-align: middle;'>(\" . $this->pagination->total . \")</span>\";\n }\n }", "function rt_ui_button($label, $target, $icon, $options = array())\n{\n $options['class'] = 'new ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary';\n $content = sprintf('<span class=\"ui-button-icon-primary ui-icon ui-icon-%s\"></span><span class=\"ui-button-text\">%s</span>', $icon, $label);\n return link_to($content, $target, $options);\n}", "public function generateNavbar(){\n echo \"<nav class='navbar navbar-expand-lg navbar-light bg-light fixed-top'>\n <a class='navbar-brand' href='decks.php'>Flashcards app</a>\n <button class='navbar-toggler' type='button' data-toggle='collapse' data-target='#navbarTogglerDemo01' aria-controls='navbarTogglerDemo01' aria-expanded='false' aria-label='Toggle navigation'>\n <span class='navbar-toggler-icon'></span>\n </button>\n <div class='collapse navbar-collapse' id='navbarTogglerDemo01'>\n <ul class='navbar-nav mr-auto mt-2 mt-lg-0'>\n <li class='nav-item'>\n <a class='nav-link' href='decks.php'>Decks</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='new_deck.php'>New deck</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='account.php'>Account</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='includes/logout.inc.php'>Logout</a>\n </li>\n </ul>\n </div>\n </nav>\";\n }", "private function build_navigation() {\n\t\t$content = \"<nav id='formlift-header' class='formlift-nav'>\";\n\t\tforeach ( $this->sections as $section ) {\n\t\t\t$content .= $section->get_header();\n\t\t}\n\n\t\treturn $content . \"<button type='submit' style='margin: 45px' class='button button-large'>SAVE CHANGES</button></nav>\";\n\t}", "public function add_quick_view_button() {\n\t\t\t$options = $this->get_options();\n\t\t\tif ( 'top-right' !== $options['shop_page_quick_view_position'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobal $product;\n\t\t\t$icon = apply_filters( 'woostify_pro_quick_view_button_icon', 'ti-eye' );\n\t\t\t?>\n\n\t\t\t<span title=\"<?php esc_attr_e( 'Quick View', 'woostify-pro' ); ?>\" data-pid=\"<?php echo esc_attr( $product->get_id() ); ?>\" class=\"<?php echo esc_attr( $icon ); ?> product-quick-view-btn quick-view-with-icon\"></span>\n\t\t\t<?php\n\t\t}", "public function addMainMenuLink()\n {\n return '<a href=\"/Plugins/Products/Actions/Products.php\">Products</a> ';\n }", "function shortcode_insert_button()\n {\n $this->config['name']\t\t\t= __('Section Divider', 'swedenWp' );\n $this->config['tab']\t\t\t= __('Content Elements', 'swedenWp' );\n $this->config['icon']\t\t\t= swedenBuilder::$path['imagesURL'].\"sc-hr.png\";\n $this->config['order']\t\t\t= 16;\n $this->config['target']\t\t\t= 'avia-target-insert';\n $this->config['shortcode'] \t\t= 'sw_section_divider';\n $this->config['modal_data'] = array('modal_class' => 'mediumscreen');\n $this->config['tooltip'] = __('Creates a custom gallery', 'swedenWp' );\n }", "public function add_edit_activity_button() {\r\n\r\n\t\tglobal $activities_template;\r\n\r\n\t\t// Get Activity.\r\n\t\tif ( yzea_is_activity_editable( $activities_template->activity ) ) {\r\n\r\n\t\t\t?>\r\n\t\t\t\r\n\t\t\t<a href=\"#\" class=\"button bp-secondary-action yz-edit-activity\" data-activity-id=\"<?php bp_activity_id() ;?>\" data-activity-type=\"<?php echo $activities_template->activity->type; ?>\"><?php _e( 'Edit', 'youzer-edit-activity' ); ?>\r\n\t\t\t</a>\r\n\r\n\t\t\t<?php\r\n\t\t}\r\n\r\n\t}", "protected function addToolbar()\n\t{\n\t\tJRequest::setVar('hidemainmenu', true);\n\t}", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }", "function adminButton(){\n if($_SESSION['level'] == 2){\n global $url, $lang, $ADMINISTRATION;\n echo '<a type=\"button\" class=\"btn btn-primary col-3\" href=\"'.$url.'/index.php?lang='.$lang.'&page=admin\">'.$ADMINISTRATION.'</a>';\n }\n }", "public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }", "public function updateJsNavbar()\n {\n if(! array_key_exists( 'js_navbar', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_navbar']);\n $hook = '/* bread_js_navbar_link */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/navbar.js';\n $this->updateFileContent($target, $hook, $file);\n }", "public function openAddPanel()\n {\n sleep(1);\n // TODO: Add ID to \"Add\" button\n $this->_webui->clickButton('.btn.btn-primary.btn-xs.pull-right.mb20');\n }", "public function indexCreateButton(Request $request)\n {\n return view('merch.unibutton');\n }", "public function userDashboardMenuBlocNavAction(){\n\n \treturn $this->render('UserBundle:Includes:ModulesLeft/user_dashboard_menu_bloc_nav.html.twig');\n }", "protected function addToolBar() \r\n {\r\n JFactory::getApplication()->input->set('hidemainmenu', true);\r\n\r\n $user = JFactory::getUser();\r\n $userId = $user->get('id');\r\n\r\n //Get the allowed actions list\r\n $canDo = OdysseyHelper::getActions($this->state->get('filter.category_id'));\r\n $isNew = $this->item->id == 0;\r\n\r\n //Display the view title and the icon.\r\n JToolBarHelper::title(JText::_('COM_ODYSSEY_EDIT_CUSTOMER'), 'pencil-2');\r\n\r\n if($canDo->get('core.edit') || (count($user->getAuthorisedCategories('com_odyssey', 'core.edit'))) > 0 || $this->item->created_by == $userId) {\r\n // We can save the new record\r\n JToolBarHelper::apply('customer.apply', 'JTOOLBAR_APPLY');\r\n JToolBarHelper::save('customer.save', 'JTOOLBAR_SAVE');\r\n }\r\n\r\n JToolBarHelper::cancel('customer.cancel', 'JTOOLBAR_CANCEL');\r\n }", "public function makeShortcutButton() {}", "protected function setAddButton($link, $name) {\n return '<p class=\"add\"><a href=\"'.$this->url->getAdminPage().$link.'\">Добавить '.$name.'</a></p>';\n }", "public static function add() {\n\t\tif (\n\t\t\t( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) ||\n\t\t\t'true' !== get_user_option( 'rich_editing' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<a href=\"#\" id=\"sgdg-tinymce-button\" class=\"button\"><img class=\"sgdg-tinymce-button-icon\" src=\"' .\n\t\t\tesc_attr( plugins_url( '/skaut-google-drive-gallery/admin/icon.png' ) ) .\n\t\t\t'\">' .\n\t\t\tesc_html__( 'Google Drive gallery', 'skaut-google-drive-gallery' ) .\n\t\t\t'</a>';\n\t\tadd_thickbox();\n\t}", "public function renderButton(){\n\t\t\t$content = <<<ENDBUTTON\n\t<li><a id=\"btn-import-{$this->ID}\" href=\"#importerModal{$this->ID}\" data-toggle=\"modal\"><i class=\"{$this->icon}\"></i> From {$this->source}</a></li>\nENDBUTTON;\n\t\t\t\n\t\t\treturn $content;\n\t\t}", "function insert_btn_detail(){\n\t?>\n\t<div class=\"text-center wrap-detail\">\n\t\t<a href=\"<?php the_permalink( );?>\" title=\"<?php _e( 'View detail', 'shtheme' );?>\">\n\t\t\t<?php _e( 'View detail', 'shtheme' );?>\n\t\t</a>\n\t</div>\n\t<?php\n}", "function wpvideocoach_admin_toolbar() {\r\n\tglobal $wp_admin_bar;\r\n\t\r\n\t// Add the Parent link.\r\n\t$adminurl = admin_url('admin.php?page=wpvideocoach');\r\n\t$admin_toolbar_title = wpvideocoach_toolbar_link_title();\r\n\t$wp_admin_bar->add_menu( array(\r\n\t\t'title' => $admin_toolbar_title,\r\n\t\t'href' => $adminurl,\r\n\t\t'id' => 'wpvideocoach_links',\r\n\t));\r\n\r\n}" ]
[ "0.6394405", "0.63553274", "0.6319652", "0.6235728", "0.61661375", "0.6148528", "0.6140288", "0.6131436", "0.6082005", "0.6066705", "0.6054757", "0.6024961", "0.6018478", "0.5985662", "0.59780526", "0.5928924", "0.588992", "0.58065575", "0.5780179", "0.5755452", "0.5691292", "0.56880385", "0.56503314", "0.56437165", "0.564162", "0.56379133", "0.563637", "0.56109154", "0.5607639", "0.55911595", "0.5590795", "0.5581245", "0.5573378", "0.5572527", "0.5570832", "0.55682", "0.5555718", "0.55512464", "0.554833", "0.5543246", "0.5540661", "0.5529105", "0.5521996", "0.55081415", "0.5507279", "0.55019087", "0.5494406", "0.54845", "0.548024", "0.5479409", "0.54695314", "0.5468987", "0.54672056", "0.54632425", "0.54601884", "0.54571533", "0.5455858", "0.54478544", "0.54357207", "0.5435564", "0.5432895", "0.5410122", "0.54013276", "0.5400442", "0.5394893", "0.5380922", "0.53725696", "0.53715575", "0.53693753", "0.53686655", "0.53686595", "0.5368533", "0.53682506", "0.53471607", "0.53468674", "0.53418106", "0.5324421", "0.5322852", "0.5320598", "0.53147954", "0.5308459", "0.5305579", "0.5304464", "0.53034025", "0.53021705", "0.5300521", "0.5291972", "0.52899027", "0.5287203", "0.5280983", "0.5276507", "0.5274944", "0.52548563", "0.5249747", "0.5249047", "0.5246499", "0.52426934", "0.5241129", "0.5240708", "0.5229647" ]
0.58777165
17
Add a divider to the navbar or to a menu.
public function divider (array $options = []) { $options = $this->addClass ($options, 'divider') ; $options['role'] = 'separator' ; return $this->Html->tag('li', '', $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addDivider()\n\t{\n\t\t$this->items[] = new MenuItem(array('name' => 'divider'));\n\n\t\treturn $this;\n\t}", "function horizon_separator() {\n\t\tget_template_part('inc/partials/homepage', 'separator');\n\t}", "function addDivider(& $divider, & $parentElement) {\n\t\t$dividerElement =& $this->_document->createElement('divider');\n\t\t$parentElement->appendChild($dividerElement);\n\t\t\n\t\t// history\n\t\t$history =& $this->_document->createElement('history');\n\t\t$dividerElement->appendChild($history);\n\t\t$this->gethistory($divider, $history);\n\t\n\t\t// permissions\n\t\t$permissions =& $this->_document->createElement('permissions');\n\t\t$hasPerms = $this->getPermissions($divider, $permissions);\n\t\tif ($hasPerms)\n\t\t\t$dividerElement->appendChild($permissions);\n\t\t\n\t\tif ($divider->getField('location') == 'right')\n\t\t\t$dividerElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$dividerElement->setAttribute('location', 'left');\n\t}", "public function render() {\n\t\treturn '<li class=\"uk-nav-divider\"></li>';\n\t}", "function addDivider($label = \"\") {\n $this->dividers[] = $label;\n\n // find the number of HTML components before the divider on the page\n $components = $this->getHtmlComponents();\n\n $this->dividerIndexes[] = count($components);\n }", "function add_separator($arr = array())\n\t{\n\t\tif (empty($arr[\"parent\"]))\n\t\t{\n\t\t\t$arr[\"parent\"] = $this->menu_id;\n\t\t}\n\n\t\tif (!isset($this->menus[$arr[\"parent\"]]))\n\t\t{\n\t\t\t$this->menus[$arr[\"parent\"]] = \"\";\n\t\t}\n\t\t\n\t\tif (!isset($this->items[$arr[\"parent\"]]))\n\t\t{\n\t\t\t$this->items[$arr[\"parent\"]] = array();\n\t\t}\n\t\t$this->items[$arr[\"parent\"]][] = array_merge($arr, array(\"separator\" => true));\n\n\t\t$this->menus[$arr[\"parent\"]] .= '<div class=\"menuItemSep\"></div>'.\"\\n\";\n\t}", "public function addSeparator() {\n $this->items[] = self::SEPARATOR;\n }", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "public function getDividerCssClass()\r\n\t{\r\n\t\treturn 'divider';\r\n\t}", "function addSeperator() {\n $this->addSeparator();\n }", "function addSeparator() {\n if (is_array($this->toolbar) && count($this->toolbar) > 0) {\n $last = end($this->toolbar);\n if (isset($last) && is_array($last)) {\n if ($last[0] != '-') {\n $this->toolbar[] = array('-', '<seperator/>');\n }\n }\n }\n }", "function horizon_second_separator() {\n\t\tget_template_part('inc/partials/homepage', 'separator');\n\t}", "function filter_wpseo_breadcrumb_separator($this_options_breadcrumbs_sep) {\n return '<i class=\"fas fa-angle-right fa-sm\"></i>';\n}", "public function addSeparator()\n\t{\n\t\t$this->body .= '<hr>';\n\t\treturn $this;\n\t}", "function split_nav_in_two($items, $args) {\n\tif( $args->theme_location == 'primary' ){\n\t$items .= '</ul><ul class=\"cv-util-nav\">'\n\t\t\t\t\t.\t'<li class=\"menu-item flex-end\">'\n\t\t\t\t\t. '<div class=\"menu-item__button-row\">'\n\t\t\t\t\t. '<a class=\"cv-btn cv-btn--transparent\" href=\"https://support.clearviewsoftware.net/LogOn?returnUrl=/\">Client Login</a>'\n\t\t\t\t\t. '<a class=\"cv-btn get_demo_trigger\">Get a Demo</a>'\n\t\t\t\t\t. '</div>'\n\t\t\t\t\t. '</li>';\n\t}\nreturn $items;\n}", "protected function register_content_separator() {\n\t\t$this->start_controls_section(\n\t\t\t'section_separator',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Separator', 'uael' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'separator_settings',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Separator', 'uael' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'uael' ),\n\t\t\t\t'label_off' => __( 'Hide', 'uael' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'yes',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'separator_position',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Position', 'uael' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'below_desig',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'below_name' => __( 'Below Name', 'uael' ),\n\t\t\t\t\t'below_desig' => __( 'Below Designation', 'uael' ),\n\t\t\t\t\t'below_desc' => __( 'Below Description', 'uael' ),\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'separator_settings' => 'yes',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'separator_size',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Width', 'uael' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px', '%' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t),\n\t\t\t\t\t'%' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => '20',\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .uael-separator ' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'separator_settings' => 'yes',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'separator_thickness',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Thickness', 'uael' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px', 'em', 'rem' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 10,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => 2,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'separator_settings' => 'yes',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .uael-separator' => 'border-top-width: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'separator_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'uael' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'scheme' => array(\n\t\t\t\t\t'type' => Scheme_Color::get_type(),\n\t\t\t\t\t'value' => Scheme_Color::COLOR_4,\n\t\t\t\t),\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .uael-separator' => 'border-top-color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'separator_settings' => 'yes',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_section();\n\t}", "function separator() {\n echo \"<br>\\n<hr>\";\n }", "function add_admin_menu_separator($position) {\n\n\tglobal $menu;\n\t$index = 0;\n\n\tforeach($menu as $offset => $section) {\n\t\tif (substr($section[2],0,9)=='separator')\n\t\t\t$index++;\n\t\tif ($offset>=$position) {\n\t\t\t$menu[$position] = array('','read',\"separator{$index}\",'','wp-menu-separator');\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tksort( $menu );\n}", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "function custom_hseparator() {\n\t\tadd_option( 'bcn_options', array( 'hseparator' => '' ) );\n\t}", "private function ToolBarSeparator()\r\n\t\t{\r\n\t\t\techo \"<td align = 'left' width ='5'>\";\r\n\t\t\techo $this->img(\"$this->toolbarBackgroundImageName\", 7, 20);\r\n\t\t\techo \"</td>\";\r\n\t\t}", "public function breadCrumbs()\n {\n $menu = Menu::new()\n ->addClass('m-subheader__breadcrumbs m-nav m-nav--inline')\n ->add(\n Link::toRoute('home', '<i class=\"m-nav__link-icon la la-home\"></i>')\n ->addClass('m-nav__link m-nav__link--icon')\n ->addParentClass('m-nav__item m-nav__item--home')\n )\n ;\n\n foreach ($this->crumbs($this->sections()) as $item) {\n $menu\n ->add(\n Html::raw('>')\n ->addParentClass('m-nav__separator')\n )\n ->add(\n Link::to($item['link'], '<span class=\"m-nav__link-text\">'. $item['text'] . '</span>')\n ->addClass('m-nav__link')\n ->addParentClass('m-nav__item')\n )\n ;\n }\n\n return $menu;\n }", "function custom_menu_separators( $menu_items, $args ) {\n\t$filtered_menu_items = array();\n\n\t$limit = count( $menu_items );\n\n\t$separator = new WP_Post();\n\n\t// These parameters will be added to our separator object.\n\t$add = array(\n\t\t'type' => 'sep',\n\t\t'type_label' => 'sep',\n\t\t'title' => '|',\n\t\t'classes' => array( 'menu-separator' ),\n\t);\n\tforeach ( $add as $k => $v ) $separator->{$k} = $v;\n\n\t$i = 0;\n\t$last_sep = null;\n\t$last_toplevel_page = null;\n\tforeach ( $menu_items as $k => $item ) {\n\t\t$filtered_menu_items[$i] = $item;\n\t\tif ( $item->menu_item_parent == false ) {\n\t\t\t$last_toplevel_page = $i;\n\t\t}\n\t\t$i++;\n\n\t\t// Add our separator if this item is a top-level item (has no parent)\n\t\tif ( $item->menu_item_parent == false ) {\n\t\t\t// Our separator object is not a menu item, but a wp_post object. Add any missing menu item keys with a value of false (prevents errors)\n\t\t\tforeach ( $item as $menu_k => $menu_v ) if ( !property_exists( $separator, $menu_k ) ) {\n\t\t\t\t$separator->{$menu_k} = false;\n\t\t\t}\n\n\t\t\t// Use the ID of the current item, with append -sep to prevent ID clashing.\n\t\t\t$separator->ID = $item->ID . '-sep';\n\n\t\t\t// Add our separator to the menu\n\t\t\t$filtered_menu_items[$i] = $separator;\n\t\t\t$last_sep = $i;\n\t\t\t$i++;\n\t\t}\n\t}\n\n\t// The last element should never be a separator.\n\tif ( $last_sep && ( $last_toplevel_page < $last_sep ) ) {\n\t\tunset( $filtered_menu_items[$last_sep] );\n\t}\n\n\treturn $filtered_menu_items;\n}", "public static function breadcrumbs() {\n\t\tif(!self::has_breadcrumbs()) return;\n\t\t?>\n\t\t\t<h6 id=\"header-breadcrumbs\">\n\t\t\t\t<?php dimox_breadcrumbs('&middot;') ?>\n\t\t\t</h6>\n\t\t<?php\n\t}", "public function render_navbar($items, $active = NULL) {\n $this->config['type_class'] = 'navbar-nav';\n return $this->render($items, $active); \n }", "public function add_admin_menu_separator( $position = null, $cap = 'read' ) {\n\t\t$menu_item = array(\n\t\t\t'', // Menu title (ignored).\n\t\t\t$cap, // Required capability.\n\t\t\twp_unique_id( 'separator-custom-' ), // URL or file (ignored, but must be unique).\n\t\t\t'', // Page title (ignored).\n\t\t\t'wp-menu-separator', // CSS class. Identifies this item as a separator.\n\t\t);\n\n\t\t$this->set_menu_item( $menu_item, $position );\n\t}", "public function get_list_item_separator()\n {\n }", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "Public function Anavbar(){\n\t\n\t}", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "function wp_get_list_item_separator()\n {\n }", "public function nextDivider() {}", "function htmlSeparator(){\n\treturn \"\\n\\n<br/><hr/>\\n<!-- ----------------------------------------------->\\n\\n\";\n}", "private function ToolButtonSeparator()\r\n\t\t{\r\n\t\t\techo \"<td align = 'center' width = '5px'>\";\r\n\t\t\techo $this->img(\"$this->toolbarSeparatorImageName\", 1, 17);\r\n\t\t\techo \"</td>\";\r\n\t\t}", "public function getDividerWrapper()\n {\n }", "public function setSeparator($separator);", "function setNavVarsSeparator($t) {\r\n global $SYS;\r\n\r\n $SYS[\"NAV_SEPARATOR\"]=$t;\r\n $SYS[\"NAV_SEPARATOR_I\"]=\"\";\r\n\r\n}", "public function setTitleSeparator(string $separator);", "public function getSeparator();", "function navbar()\r\n {\r\n }", "public function processHeader()\n {\n $toggle =\n '<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#' . $this->getWidgetId() . '_collapse\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>';\n\n $brand = '';\n if ($this->getBrand())\n {\n $brand = $this->getBrand();\n $brand = self::$html->decode(self::$html->link($brand[1], $brand[0], ['class' => 'navbar-brand']));\n }\n\n $this->addHeader($this->createWrapper('div', ['class' => 'navbar-header'], $toggle . $brand));\n }", "function crumble_divider_1px_dashed($atts, $content = null) {\r\n\treturn '<div class=\"divider-1px-dashed\"></div><div class=\"clear\"></div>';\r\n}", "public function updateNavbar()\n {\n if(! array_key_exists ( 'navbar', $this->options['paths'] ) )\n {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/navbar.blade.php';\n $target = base_path($this->options['paths']['navbar']);\n $hook = '<!-- bread_navbar -->';\n\n $this->updateFileContent($target, $hook, $file);\n }", "protected function render_action_menu_filler(action_menu_filler $action) {\n return html_writer::tag('li', '', array('class' => 'divider'));\n }", "function _renderSpacer()\n {\n // ... maybe append form-spacer to class of next or previous element\n echo '<div class=\"form-spacer\">&nbsp;</div>';\n }", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n\t // This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values\n\t $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\t //pre($path);\n\t // This will build our \"base URL\" ... Also accounts for HTTPS :)\n\t $base = base_url();\n\t \n\t // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n\t $breadcrumbs = Array(\"<a href=\\\"$base\\\">$home</a>\");\n\t \n\t // Find out the index for the last value in our path array\n\t $last = end(array_keys($path));\n\t \n\t // Build the rest of the breadcrumbs\n\t foreach ($path AS $x => $crumb) {\n\t // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n\t $title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb));\n\t \n\t // If we are not on the last index, then display an <a> tag\n\t if ($x != $last)\n\t $breadcrumbs[] = \"<a href=\\\"$base$crumb\\\">$title</a>\";\n\t // Otherwise, just display the title (minus)\n\t else\n\t $breadcrumbs[] = $title;\n\t }\n\t \n\t // Build our temporary array (pieces of bread) into one big string :)\n\t return implode($separator, $breadcrumbs);\n\t}", "function bridge_qode_register_separator_widget( $widgets ) {\n $widgets[] = 'BridgeQodeSeparator';\n\n return $widgets;\n }", "function mocca_custom_menu() {\n\n register_nav_menus(array(\n 'bootstrap-menu' => 'Navigtion Bar',\n 'footer-menu' => 'footer Bar',\n ));\n }", "public function isNavbarIncludespacer()\r\n\t{\r\n\t\treturn $this->navbarIncludespacer;\r\n\t}", "function crumble_divider_1px($atts, $content = null) {\r\n\treturn '<div class=\"divider-1px\"></div>';\r\n}", "function techmarket_navbar_primary_menu() {\n\t\t?>\n\t\t<nav id=\"navbar-primary\" class=\"navbar-primary\" aria-label=\"<?php esc_html_e( 'Navbar Primary', 'techmarket' ); ?>\" data-nav=\"flex-menu\">\n\t\t\t<?php\n\t\t\t\twp_nav_menu( apply_filters( 'techmarket_navbar_primary_menu_args', array(\n\t\t\t\t\t'theme_location'\t=> 'navbar-primary',\n\t\t\t\t\t'container'\t\t\t=> false,\n\t\t\t\t\t'menu_class'\t\t=> 'nav yamm',\n\t\t\t\t\t'fallback_cb'\t\t=> 'WP_Bootstrap_Navwalker::fallback',\n\t\t\t\t\t'walker'\t\t\t=> new WP_Bootstrap_Navwalker(),\n\t\t\t\t) ) );\n\t\t\t?>\n\t\t</nav><!-- #site-navigation -->\n\t\t<?php\n\t}", "public function onSetupNavbar(KnpMenuEvent $event)\n {\n $menu = $event->getMenu();\n\n $menu->addChild(\n 'menu-label',\n ['label' => 'Main Navigation', 'childOptions' => $event->getChildOptions()]\n )->setAttribute('class', 'header');\n\n $menu->addChild(\n 'homepage',\n ['route' => 'homepage', 'label' => 'menu.homepage', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-tachometer-alt');\n\n $menu->addChild(\n 'forms',\n ['route' => 'forms', 'label' => 'menu.form', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fab fa-wpforms')->setExtra('badge', [\n 'color' => 'red',\n 'value' => 1,\n ]);\n\n $menu->addChild(\n 'context',\n ['route' => 'context', 'label' => 'AdminLTE context', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-code');\n\n $menu->addChild(\n 'menu-divider',\n ['label' => '<hr />']\n )->setExtra('safe_label', true);\n\n $menu->addChild(\n 'demo',\n ['label' => 'Demo', 'childOptions' => $event->getChildOptions(), 'options' => ['branch_class' => 'treeview']]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-right')->setExtra('badges', [\n ['value' => 2],\n ['value' => 'foo', 'color' => 'yellow'],\n ]);\n\n $menu->getChild('demo')->addChild(\n 'sub-demo',\n ['route' => 'forms2', 'label' => 'Form - Horizontal', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-down');\n\n $menu->getChild('demo')->addChild(\n 'sub-demo2',\n ['route' => 'forms3', 'label' => 'Form - Sidebar', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-up');\n\n if ($this->security->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $menu->addChild(\n 'logout',\n ['route' => 'fos_user_security_logout', 'label' => 'menu.logout', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-out-alt');\n } else {\n $menu->addChild(\n 'login',\n ['route' => 'fos_user_security_login', 'label' => 'menu.login', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-in-alt');\n }\n }", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "function crumble_divider_15px($atts, $content = null) {\r\n\treturn '<div class=\"divider-15px\"></div>';\r\n}", "public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}", "public function setMenu() {\n $loged_in = false;\n if (isset($_COOKIE['query_key']) && isset($_COOKIE['rememberme'])) {\n $loged_in = explode(\"@\", Token::verifyToken());\n }\n $menu = \"\n <nav class='navbar navbar-inverse navbar-fixed-top' role='navigation'>\n <div class='container'>\n <div class='navbar-header'>\n <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='#menu_bar' >\n <span class='sr-only'>Toggle navigation</span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n </button>\n <a class='navbar-brand' ><img src='assets/images/logo.png' height='30px'></a>\n </div>\n\n <div class='collapse navbar-collapse' id='menu_bar' >\n <ul class='nav navbar-nav navbar-right' >\";\n if ($loged_in == false) {\n $menu .=\" <li>\n <a href='./login' >Login</a>\n </li>\n <li>\n <a href='./signup' >Signup</a>\n </li>\";\n } else {\n $menu .= \" \n <li>\n <a>Welcome \" . $loged_in[0] . \"</a>\" .\n \"</li>\n <li>\n <a href='./posts' >Posts</a>\n </li>\n <li>\n <a href='./change' >Change Password</a>\n </li>\n <li>\n <a href='./user-logout' >logout</a>\n </li>\";\n }\n\n $menu .=\"</ul>\n </div>\n </div>\n</nav>\n<div style='height:100px;width:100%;position:relative;'></div>\n\";\n return $menu;\n }", "function sp_divider_sc( $atts, $content = null ) {\n\n\t\textract( shortcode_atts( array(\n\t\t\t'style' => ''\n\t\t), $atts ) );\n\n\t\treturn '<hr class=\"' . esc_attr( $style ) . '\" />';\n\t\n\t}", "function nav_menu()\n{\n $menu = \"\";\n $menu .= '<ul class=\"nav navbar-nav navbar-right\">';\n $menu .= '<li><a href=\"'.site_url('#home').'\">Home</a></li>';\n $menu .= '<li><a href=\"'.site_url('#about').'\">About Me</a></li>';\n $menu .= '<li><a href=\"'.site_url('#whatdo').'\">What i do</a></li>';\n $menu .= '<li><a href=\"'.site_url('#work').'\">My Work</a></li>';\n $menu .= '<li><a href=\"'.site_url('blog').'\">Blog</a></li>';\n $menu .= '<li><a href=\"'.site_url('#contact').'\">Contact</a></li>';\n $menu .= '</ul>';\n return $menu;\n}", "function crumble_divider_5px($atts, $content = null) {\r\n\treturn '<div class=\"divider-5px\"></div>';\r\n}", "public static function navbar($paramsMap)\n {\n $page = NULL;\n // http://www.zomeoff.com/php-fast-way-to-determine-a-key-elements-existance-in-an-array/\n if (isset($paramsMap['page']) || array_key_exists('page', $paramsMap)) // Si no me lo pasan, tengo que poner el actual.\n $page = $paramsMap['page'];\n else\n throw new Exception(\"El parametro 'page' es obligatorio y no esta presente. \" . __FILE__ . \" \" . __LINE__);\n \n \n $out = '<div class=\"navbar\">';\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n while (($page = $page->getParent()) != NULL)\n {\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n }\n \n $out .= $ps . '</div>';\n return $out;\n }", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "function mocca_bootstrap_menu() {\n\n wp_nav_menu(array(\n 'theme_location' => 'bootstrap-menu',\n 'menu_class' => 'navbar-nav ml-auto',\n 'container' => false,\n 'depth' => 2,\n 'walker' => new wp_bootstrap_navwalker(),\n ));\n }", "function scribbles_nav_wrapper_close(){\n\n\techo '</div><!-- .main-navigation-wrapper -->';\n\n\tget_template_part('templates/parts/nav-border');\n\n}", "private function setupEndMenuItem() {\n Blade::directive('endmenuitem',function($expression) {\n return '</a>\n </li>';\n });\n }", "public function testSeparator() {\n\t\t\t$builder = new StringBuilder('Hello');\n\n\t\t\t$builder->setSeparator(' ')->append('World');\n\t\t\t$this->assertEquals('Hello World', $builder->__toString());\n\n\t\t\t$builder->prepend('Extra');\n\t\t\t$this->assertEquals('Extra Hello World', $builder->__toString());\n\n\t\t\tunset($builder);\n\t\t}", "function wploop_change_separator()\n{\nreturn '|';\n}", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "public function getMenu()\n{\n $lang=$this->translation;\n foreach($this->_headerMenu as $hmenukey => $hmenu){\n foreach($hmenu as $hkey=>$hval){\n $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey);\n }\n }\n $auth = $this->session->get('auth');\n if ($auth) {\n $this->_headerMenu['navbar-right']['oturum'] = array(\n 'caption' => $lang->_('logout'),\n 'action' => 'bitir'\n );\n\n } else {\n unset($this->_headerMenu['navbar-left']['islemler']);\n unset($this->_headerMenu['navbar-left']['r4t']);\n unset($this->_headerMenu['navbar-left']['hesap']);\n }\n\n $controllerName = $this->view->getControllerName();\n foreach ($this->_headerMenu as $position => $menu) {\n echo '<div class=\"nav-collapse\">';\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\n foreach ($menu as $controller => $option) {\n if ($controllerName == $controller) {\n echo '<li class=\"active\">';\n } else {\n echo '<li>';\n }\n if ($controller=='admin'){\n if(($auth) and ($auth['auth']==0)){\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }}else{\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }\n echo '</li>';\n }\n\n echo '</ul>';\n echo '</div>';\n }\n\n }", "protected function render_content() {\n\t\t\t?>\n\t\t\t\t<div class=\"customizer-divider\"></div>\n\t\t\t<?php\n\t\t}", "public function generateNavbar(){\n echo \"<nav class='navbar navbar-expand-lg navbar-light bg-light fixed-top'>\n <a class='navbar-brand' href='decks.php'>Flashcards app</a>\n <button class='navbar-toggler' type='button' data-toggle='collapse' data-target='#navbarTogglerDemo01' aria-controls='navbarTogglerDemo01' aria-expanded='false' aria-label='Toggle navigation'>\n <span class='navbar-toggler-icon'></span>\n </button>\n <div class='collapse navbar-collapse' id='navbarTogglerDemo01'>\n <ul class='navbar-nav mr-auto mt-2 mt-lg-0'>\n <li class='nav-item'>\n <a class='nav-link' href='decks.php'>Decks</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='new_deck.php'>New deck</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='account.php'>Account</a>\n </li>\n <li class='nav-item'>\n <a class='nav-link' href='includes/logout.inc.php'>Logout</a>\n </li>\n </ul>\n </div>\n </nav>\";\n }", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "function add_nav_menu_items($items) {\n if(!is_user_logged_in()) {\n $items = $items. '<li class=\"right-nav menu-item login-link\"><a href=\"/wp-login.php\">Login</a></li>';\n }\n if(!wp_is_mobile()) {\n $twitterlink= '<li class=\"right-nav menu-item\"><a href=\"https://www.twitter.com/F3thefort\"><i class=\"fa fa-twitter\"></i></a></li>';\n $slacklink= '<li class=\"right-nav menu-item\"><a href=\"https://f3thefort.slack.com/\"><i class=\"fa fa-slack\"></i></a></li>';\n $items = $items . $twitterlink . $slacklink;\n }\n return $items;\n}", "function h_add_menus(array $args) {\n if (!is_admin()) { return;}\n\n $menu = new H_Sidenav($args);\n $menu->add();\n}", "private function createDivider($string) {\n\t\t$string = $this->cleanString($string);\n\t\t$string = '</p><div class=\"divider\"></div><p>';\n\t\treturn $string;\n\t}", "public function render()\n\t{\n\t\treturn view('components.navbar');\n\t}", "function slug_post_type_breadcrumb( $divider = '&gt;&gt;' ) {\n\t$front = slug_link( site_url(), 'Home' );\n\tif ( is_home() || is_front_page() ) {\n\t\treturn $front;\n\n\t}\n\n\tif( is_post_type_archive() || ( is_singular() && get_post_type() !== false ) ) {\n\t\t$post_type = get_post_type();\n\t\t$pod = pods_api()->load_pod( $post_type );\n\t\tif ( !is_string( $pod ) ) {\n\t\t\t$single = $pod->options[ 'single_label' ];\n\t\t\t$plural = slug_link( get_post_type_archive( $post_type ), $pod->label, 'All ' . $single );\n\n\n\t\t\tif ( is_post_type_archive() ) {\n\t\t\t\treturn $front . $divider . $plural;\n\n\t\t\t}\n\n\t\t\tglobal $post;\n\t\t\t$single = slug_link( get_permalink( $post->ID ), get_the__title( $post->ID ), 'View '.$single );\n\t\t\treturn $front . $divider . $single;\n\n\t\t}\n\t\telse {\n\n\t\t\treturn;\n\n\t\t}\n\t}\n\n}", "function ve_get_header_navigation() {\n?>\n<ul class=\"nav navbar-nav\">\n\t<li><a href=\"<?php echo home_url() ?>\">Front page <span class=\"sr-only\">(current)</span></a></li>\n\t<li class=\"dropdown\">\n\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Companies <span class=\"caret\"></span></a>\n\t\t<ul class=\"dropdown-menu purple\">\n\t\t\t<?php ve_get_company_navigation() ?>\n\t\t</ul>\n\t<li class=\"dropdown\">\n\t <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Partnership <span class=\"caret\"></span></a>\n\t <ul class=\"dropdown-menu turquoise\">\n\t\t<?php ve_get_group_of_companies_navigation() ?>\n\t </ul>\n\t</li>\n</ul>\n<?php\n}", "function loadHeaderView($controller) {\n return '<div class=\"container\">\n <nav class=\"navbar navbar-default navbar-static-top navbar-center\">\n <div class=\"container\">\n <ul class=\"list-unstyled list-inline text-center\">\n <li><a href=\"' . BASE . '\">HOME</a></li>\n <li><a href=\"' . BASE . 'home/logout\">LOGOUT</a></li>\n </ul>\n </div>\n </nav>\n\n </div>';\n}", "private function setSeparator()\n\t\t{\n\t\t\t$separetor = explode('/', $this->_url);\n\t\t\t$separetor[2] = (isset($separetor[2]) && $separetor[2] != null ? $separetor[2] . 'Action' : 'indexAction');\n\t\t\tunset($separetor[0]);\n\t\t\t$this->_separetor = $separetor;\n\t\t}", "protected function get_separator_position() { ?>\n\t\t<div class=\"uael-separator-wrapper\">\n\t\t\t<span class=\"uael-separator\"></span>\n\t\t</div>\n\t\t<?php\n\t}", "function simple_bootstrap_display_main_menu() {\n wp_nav_menu(\n array( \n 'theme_location' => 'main_nav', /* where in the theme it's assigned */\n 'menu_class' => 'navbar-nav mr-auto',\n 'container' => false, /* container class */\n 'depth' => 2,\n 'walker' => new simple_bootstrap_Bootstrap_walker(),\n )\n );\n}", "function social_links_navbar_content() {\n\n\t\t$content = $before = $after = $separator = '';\n\n\t\t$social_mode = get_theme_mod( 'navbar_social', 'off' );\n\t\t$navbar_position = get_theme_mod( 'navbar_position', 'normal' );\n\n\t\t// Early exit if social is set to off.\n\t\tif ( 'off' == $social_mode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'inline' == $social_mode ) {\n\n\t\t\t$before = ( $navbar_position == 'right-slide' || $navbar_position == 'left-slide' ) ? '<ul class=\"nav navbar-nav navbar-inline-socials\"><li>' : '<ul class=\"nav navbar-nav navbar-right navbar-inline-socials\"><li>';\n\t\t\t$after = '</li></ul>';\n\t\t\t$separator = '</li><li>';\n\n\t\t} elseif ( 'dropdown' == $social_mode ) {\n\n\t\t\t$before = ( $navbar_position == 'right-slide' || $navbar_position == 'left-slide' ) ? '<ul class=\"nav navbar-nav navbar-dropdown-socials\"><li class=\"dropdown\"><a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"dashicons dashicons-share\"></i>&nbsp;<b class=\"caret\"></b></a><ul class=\"dropdown-menu\" role=\"menu\"><li>' : '<ul class=\"nav navbar-nav navbar-right navbar-dropdown-socials\"><li class=\"dropdown\"><a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"dashicons dashicons-share\"></i>&nbsp;<b class=\"caret\"></b></a><ul class=\"dropdown-menu\" role=\"menu\"><li>';\n\t\t\t$after = '</li></ul></li></ul>';\n\t\t\t$separator = '</li><li>';\n\n\t\t}\n\n\t\t$content = $this->social_links_builder( $before, $after, $separator );\n\n\t\techo $content;\n\n\t}", "public function render()\n {\n return view('dwbtui::components.navbar');\n }", "function minorite_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n return '<ul class=\"nav\"><li>' . implode('</li><li>', $breadcrumb) . '</li></ul>';\n }\n}", "public function render()\n {\n return view('components.navbar-nav');\n }", "function reactor_do_nav_bar() { \n\tif ( has_nav_menu('main-menu') ) {\n\t\t$nav_class = ( reactor_option('mobile_menu', 1) ) ? 'class=\"hide-for-small\" ' : ''; ?>\n\t\t<div class=\"main-nav\">\n\t\t\t<nav id=\"menu\" <?php echo $nav_class; ?>role=\"navigation\">\n\t\t\t\t<div class=\"section-container horizontal-nav\" data-section=\"horizontal-nav\" data-options=\"one_up:false;\">\n\t\t\t\t\t<?php reactor_main_menu(); ?>\n\t\t\t\t</div>\n\t\t\t</nav>\n\t\t</div><!-- .main-nav -->\n\t\t\n\t<?php\t\n\tif ( reactor_option('mobile_menu', 1) ) { ?> \n\t\t<div id=\"mobile-menu-button\" class=\"show-for-small\">\n\t\t\t<button class=\"secondary button\" id=\"mobileMenuButton\" href=\"#mobile-menu\">\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t</button>\n\t\t</div><!-- #mobile-menu-button --> \n\t<?php }\n\t}\n}", "function elhero_register_menu()\r\n{\r\n //register_nav_menu('bootstrap-menu',__('Bootstrap Navigation Bar'));\r\n register_nav_menus( array(\r\n 'bootstrap-menu' => 'Bootstrap Navigation Bar',//create location\r\n 'footer-menu' => 'Footer-menu'//to add new location to wordpress dashboard menu \r\n //name => location_name\r\n ) );\r\n}", "function folio_register_nav_menu()\n{\n register_nav_menu('primary', 'Sidebar Menu');\n}", "public function create()\n {\n return view(\"backend.navbars.create\");\n }", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "function podcast_pro_add_bar() {\r\n\r\n\tif ( ! is_front_page() ) {\r\n\r\n\t\tgenesis_widget_area( 'utility-bar', array(\r\n\t\t\t'before' => '<div class=\"utility-bar\"><div class=\"wrap\">',\r\n\t\t\t'after' => '</div></div>',\r\n\t\t) );\r\n\t}\r\n}", "public function navbarNav(array $items, $currentPath = null, array $option = [])\n {\n $option = array_replace_recursive([\n // ul class\n 'class' => 'nav navbar-nav',\n // append ul class\n 'appendClass' => '',\n // ul > li attr\n 'parentAttr' => [\n 'class' => 'dropdown',\n ],\n // ul > li > a attr\n 'parentItemAttr' => [\n 'class' => 'dropdown-toggle',\n 'data-toggle' => 'dropdown',\n 'role' => 'button',\n 'aria-haspopup' => 'true',\n 'aria-expanded' => 'false',\n ],\n // ul > li > ul attr\n 'childGroupAttr' => [\n 'class' => 'dropdown-menu',\n ],\n // ul > li > ul > li\n 'childAttr' => [\n ],\n // ul > li > ul > li > a\n 'childItemAttr' => [\n ],\n 'useCaret'=>true,\n ], $option);\n\n $app = App::instance();\n $role = $app->service(User::class)->get('role');\n $str = '';\n foreach ($items as $item) {\n $item += [\n 'path' => null,\n 'label' => null,\n 'items' => [],\n 'roles' => [],\n ];\n if ($item['roles'] && !in_array($role, $item['roles'])) {\n continue;\n }\n $list = '';\n $strChild = '';\n $active = $currentPath === $item['path'];\n $parentAttr = [];\n $parentItemAttr = [];\n $childGroupAttr = $option['childGroupAttr'];\n $childAttr = $option['childAttr'];\n $childItemAttr = $option['childItemAttr'];\n $childCounter = 0;\n\n if (count($item['items'])) {\n $activeFromChild = false;\n foreach ($item['items'] as $child) {\n $child += [\n 'path' => null,\n 'label' => null,\n 'roles' => [],\n ];\n\n if ($child['roles'] && !in_array($role, $child['roles'])) {\n continue;\n }\n\n $childCounter++;\n $childActive = $currentPath === $child['path'];\n if (!$activeFromChild) {\n $activeFromChild = $childActive;\n $active = $activeFromChild;\n }\n $url = '#'===$child['path']?'#':$app->url($child['path']);\n $strChild .= '<li'\n . $this->renderAttributes($childAttr, ['class'=>$childActive?'active':''])\n . '>'\n . '<a'\n . $this->renderAttributes(['href'=>$url]+$childItemAttr)\n . '>'\n . $child['label']\n . '</a>'\n . '</li>';\n }\n if ($childCounter) {\n $parentAttr += $option['parentAttr'];\n $parentItemAttr += $option['parentItemAttr'];\n $strChild = '<ul'\n . $this->renderAttributes($childGroupAttr)\n . '>'\n . $strChild\n . '</ul>';\n if ($option['useCaret']) {\n $item['label'] .= ' <span class=\"caret\"></span>';\n }\n } else {\n $strChild = '';\n }\n }\n\n if (count($item['items']) && 0 === $childCounter) {\n continue;\n }\n $url = '#'===$item['path']?'#':$app->url($item['path']);\n $str .= '<li'\n . $this->renderAttributes($parentAttr, ['class'=>$active?'active':''])\n . '>'\n . '<a'\n . $this->renderAttributes(['href'=>$url]+$parentItemAttr)\n . '>'\n . $item['label']\n . '</a>'\n . $strChild\n . '</li>';\n }\n $str = '<ul'\n . $this->renderAttributes(['class'=>$option['class']], ['class'=>$option['appendClass']])\n . '>'\n . $str\n . '</ul>';\n\n return $str;\n }", "function breadcrumb(){\n\t global $view;\n\t \n \t$view_header = ucfirst($view);\n\treturn \"<ul class='breadcrumb'>\n\t <li>System</li>\n\t <li class='active'>$view_header</li>\n\t\t </ul>\";\n }", "public function render()\n {\n return view('components.navbar');\n }", "function bootstrap_nav_footer()\r\n{\r\n\twp_nav_menu( array(\r\n 'theme_location' => 'footer-menu',\r\n 'depth' => 2,\r\n 'container' => 'false',\r\n 'menu_class' => 'nav navbar-nav',\r\n 'fallback_cb' => 'wp_bootstrap_navwalker::fallback',\r\n 'walker' => new wp_bootstrap_navwalker())\r\n );\r\n}", "function social_media_menu() {\r\n // display the WordPress Custom Menu if available\r\n wp_nav_menu(array(\r\n 'menu' => 'social-media',\r\n 'theme_location' => 'social',\r\n 'depth' => 2,\r\n 'container' => 'div',\r\n 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',\r\n 'menu_class' => 'nav navbar-nav soc-med',\r\n 'fallback_cb' => 'wp_bootstrap_navwalker::fallback',\r\n 'walker' => new wp_bootstrap_navwalker()\r\n ));\r\n}", "public function htheme_line_element(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Line Divider\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_line_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_line_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"Content\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Horizontal line divider.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Layout\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_line_layout\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t\"Full width\" => \"full\",\r\n\t\t\t\t\t\t\t\"Contained\" => \"contained\",\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the layout for your content line separator.\", \"js_composer\" )\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"colorpicker\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Line Color\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_line_color\",\r\n\t\t\t\t\t\t\"value\" => __( \"#EEE\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Set the color for your content line separator.\", \"js_composer\" )\r\n\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}", "function my_document_title_separator($sep) {\n if (is_singular(array('post', 'page'))) {\n $sep = '|';\n }\n\n return $sep;\n}", "public function add_menus()\n {\n }" ]
[ "0.71136826", "0.6871223", "0.67022276", "0.6700888", "0.6480203", "0.64491737", "0.6408355", "0.6349327", "0.6333924", "0.6320825", "0.623159", "0.62203777", "0.59711915", "0.58870906", "0.5759771", "0.5755224", "0.57179284", "0.5698374", "0.5642188", "0.56184876", "0.5609969", "0.5510052", "0.5495148", "0.5426441", "0.54007137", "0.53963345", "0.53943104", "0.53837997", "0.53489316", "0.52769417", "0.52736", "0.52627814", "0.5172777", "0.515643", "0.51306057", "0.51266766", "0.51157445", "0.5107883", "0.51005685", "0.50938904", "0.5091112", "0.50905144", "0.50660264", "0.5043117", "0.50333047", "0.5020981", "0.4994367", "0.4989504", "0.49812824", "0.49763057", "0.4970569", "0.4965353", "0.49398702", "0.49374935", "0.49155387", "0.49056658", "0.48889786", "0.48888966", "0.48871619", "0.48812133", "0.48790872", "0.4870205", "0.4851485", "0.4847335", "0.48459283", "0.48374936", "0.48369142", "0.48308295", "0.4825991", "0.4817917", "0.48144805", "0.4811075", "0.48064455", "0.480076", "0.4799609", "0.4793413", "0.47866088", "0.47815266", "0.47810602", "0.4778146", "0.4754102", "0.4751391", "0.47494024", "0.4744843", "0.4741999", "0.47368369", "0.47313637", "0.47261503", "0.47261322", "0.47246966", "0.47200617", "0.47187364", "0.4709337", "0.47068515", "0.47067836", "0.4704834", "0.47047403", "0.4692505", "0.46901914", "0.468989" ]
0.66344464
4
Add a header to the navbar or to a menu, should not be used outside a submenu.
public function header ($name, array $options = []) { $options = $this->addClass ($options, 'dropdown-header') ; return $this->Html->tag('li', $name, $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "public function processHeader()\n {\n $toggle =\n '<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#' . $this->getWidgetId() . '_collapse\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>';\n\n $brand = '';\n if ($this->getBrand())\n {\n $brand = $this->getBrand();\n $brand = self::$html->decode(self::$html->link($brand[1], $brand[0], ['class' => 'navbar-brand']));\n }\n\n $this->addHeader($this->createWrapper('div', ['class' => 'navbar-header'], $toggle . $brand));\n }", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "public function addChild($header = \"\");", "function add_Main_Nav() {\n\tregister_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function add_admin_header() {\n }", "public function addHeader()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/header.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/header.php\");\n }\n }", "function mai_do_header_before() {\n\tif ( ! is_active_sidebar( 'header_before' ) ) {\n\t\treturn;\n\t}\n\n\t// Variable function.\n\t$header_before = function( $attributes ) {\n\t\t$attributes['class'] = 'nav-header-before';\n\t\treturn $attributes;\n\t};\n\n\t// Change the header before menu class.\n\tadd_filter( 'genesis_attr_nav-header', $header_before );\n\n\t// Before Header widget area\n\t_mai_add_widget_header_menu_args();\n\tgenesis_widget_area( 'header_before' );\n\t_mai_remove_widget_header_menu_args();\n\n\t// Remove the filter.\n\tremove_filter( 'genesis_attr_nav-header', $header_before );\n}", "static function header($isLoggedIn, $user = null)\n {\n require('header.html');\n echo '<nav class=\"navbar navbar-inverse\">';\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"navbar-header\">';\n echo '<a class=\"navbar-brand\" href=\"index.php\">MUSTER STATION</a>';\n echo '</div><div>';\n\n if ($isLoggedIn) {\n echo \"<div class='collapse navbar-collapse' id='bs-example-navbar-collapse-1'>\";\n echo \"<ul class='nav navbar-nav'>\";\n echo '<li><a href=\"user.php?username=' . $user . '\"><span class=\"glyphicon glyphicon-user\"></span> Signed in as ' . $user . '</a></li>';\n\n // Projects dropdown\n echo \"<li class='dropdown'>\";\n echo \"<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>Projects <span class='caret'></span></a>\";\n echo \"<ul class='dropdown-menu'>\";\n\n try {\n $projects = ArmyDB::retrieveProjectsFromUser($user);\n foreach ($projects as $project) {\n $title = $project->projectname;\n $projectid = $project->id;\n echo \"<li><a href='project.php?id=\" . $projectid . \"'>$title</a></li>\";\n }\n } catch (Exception $e) {\n echo \"<li><a href='#'>No projects</a></li>\";\n }\n\n echo \"</ul>\";\n echo \"</li>\";\n\n // Units dropdown\n echo \"<li class='dropdown'>\";\n echo \"<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>Units<span class='caret'></span></a>\";\n echo \"<ul class='dropdown-menu'>\";\n\n try {\n $projects = ArmyDB::retrieveProjectsFromUser($user);\n $unitcount = 0;\n foreach ($projects as $project) {\n $projectid = $project->id;\n $projecttitle = $project->projectname;\n\n try {\n $units = ArmyDB::retrieveUnitsFromProject($projectid);\n\n foreach ($units as $unit) {\n $unitcount++;\n $unitid = $unit->id;\n $unitname = $unit->name;\n\n echo \"<li><a href='unit.php?id=\" . $unitid . \"'>$projecttitle: $unitname</a></li>\";\n }\n } catch (Exception $e) {\n\n }\n }\n if ($unitcount == 0) {\n echo \"<li><a href='#'>No units</a></li>\";\n }\n } catch (Exception $e) {\n echo \"<li><a href='#'>No units</a></li>\";\n }\n\n echo \"</ul>\";\n echo \"</li>\";\n\n // Final header\n echo \"</ul>\";\n echo '<ul class=\"nav navbar-nav navbar-right\">';\n echo '<li><a href=\"logout.php\"><span class=\"glyphicon glyphicon-log-out\"></span> Logout</a></li>';\n echo \"</ul>\";\n } else {\n echo \"<form class='navbar-form navbar-right' role='form' action='login.php'>\";\n echo \"<div class='form-group'>\";\n echo \"<input type='text' name='usr' class='form-control' placeholder='Username...' style='margin-right:10px;' required>\";\n echo \"<input type='password' name='pwd' class='form-control' placeholder='Password...' style='margin-right:10px;' required>\";\n echo \"<input type='hidden' name='action' value='login'><input type='submit' class='btn btn-warning' value='Login' style='margin-right:10px;' >\";\n echo \"<button type='button' class='btn btn-danger' data-toggle='modal' data-target='#myModal'>Create Account</button>\";\n echo \"</div></form>\";\n echo \"</ul>\";\n }\n echo \"</div></div></div></nav>\";\n echo \"<div class='container-fluid'>\";\n\n }", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "public function headerMenu()\n {\n if ($this->headerMenu === null) {\n $dashboardConfig = $this->dashboardConfig();\n\n if (isset($dashboardConfig['sidemenu'])) {\n $this->headerMenu = $this->createHeaderMenu($dashboardConfig['sidemenu']);\n } else {\n $this->headerMenu = $this->createHeaderMenu();\n }\n }\n\n return $this->headerMenu;\n }", "public function addHeader()\n {\n }", "function v2_mumm_menu_link__menu_header(&$variables) {\n\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) {\n\n $output = '<button id=\"search-btn\" class=\"icon icon-search-gray search-btn\" data-trigger-toggle=\"search-box\" title=\"\" name=\"search-btn\" type=\"button\"\n data-tracking data-track-action=\"click\" data-track-category=\"header\" data-track-label=\"search\" data-track-type=\"event\">\n </button>';\n }\n else {\n $class = $element['#localized_options']['attributes']['class'];\n $element['#localized_options']['attributes'] = array(\n 'class' =>$class,\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => 'book_a_visit',\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']);\n }\n return $output;\n}", "function register_menus() {\n register_nav_menu('header-menu', __('Header Menu'));\n}", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "public function onSetupNavbar(KnpMenuEvent $event)\n {\n $menu = $event->getMenu();\n\n $menu->addChild(\n 'menu-label',\n ['label' => 'Main Navigation', 'childOptions' => $event->getChildOptions()]\n )->setAttribute('class', 'header');\n\n $menu->addChild(\n 'homepage',\n ['route' => 'homepage', 'label' => 'menu.homepage', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-tachometer-alt');\n\n $menu->addChild(\n 'forms',\n ['route' => 'forms', 'label' => 'menu.form', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fab fa-wpforms')->setExtra('badge', [\n 'color' => 'red',\n 'value' => 1,\n ]);\n\n $menu->addChild(\n 'context',\n ['route' => 'context', 'label' => 'AdminLTE context', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-code');\n\n $menu->addChild(\n 'menu-divider',\n ['label' => '<hr />']\n )->setExtra('safe_label', true);\n\n $menu->addChild(\n 'demo',\n ['label' => 'Demo', 'childOptions' => $event->getChildOptions(), 'options' => ['branch_class' => 'treeview']]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-right')->setExtra('badges', [\n ['value' => 2],\n ['value' => 'foo', 'color' => 'yellow'],\n ]);\n\n $menu->getChild('demo')->addChild(\n 'sub-demo',\n ['route' => 'forms2', 'label' => 'Form - Horizontal', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-down');\n\n $menu->getChild('demo')->addChild(\n 'sub-demo2',\n ['route' => 'forms3', 'label' => 'Form - Sidebar', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'far fa-arrow-alt-circle-up');\n\n if ($this->security->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $menu->addChild(\n 'logout',\n ['route' => 'fos_user_security_logout', 'label' => 'menu.logout', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-out-alt');\n } else {\n $menu->addChild(\n 'login',\n ['route' => 'fos_user_security_login', 'label' => 'menu.login', 'childOptions' => $event->getChildOptions()]\n )->setLabelAttribute('icon', 'fas fa-sign-in-alt');\n }\n }", "function wp_admin_bar_header()\n {\n }", "function register_my_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' )\n )\n );\n }", "function ve_get_header_navigation() {\n?>\n<ul class=\"nav navbar-nav\">\n\t<li><a href=\"<?php echo home_url() ?>\">Front page <span class=\"sr-only\">(current)</span></a></li>\n\t<li class=\"dropdown\">\n\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Companies <span class=\"caret\"></span></a>\n\t\t<ul class=\"dropdown-menu purple\">\n\t\t\t<?php ve_get_company_navigation() ?>\n\t\t</ul>\n\t<li class=\"dropdown\">\n\t <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Partnership <span class=\"caret\"></span></a>\n\t <ul class=\"dropdown-menu turquoise\">\n\t\t<?php ve_get_group_of_companies_navigation() ?>\n\t </ul>\n\t</li>\n</ul>\n<?php\n}", "public function add_header() {\n }", "function header_menu( $data ) {\n\t\t\t\t\t\tif (($locations = get_nav_menu_locations()) && isset($locations[ 'sgn_menu' ])) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Retrieve the menu in location sgn_menu */\n\t\t\t\t\t\t\t$menu = wp_get_nav_menu_object($locations['sgn_menu']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Create an empty array to store our JSON */\n\t\t\t\t\t\t\t$menuItems = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* If the menu isn't empty, start process of building an array, otherwise return a 404 error */\n\t\t\t\t\t\t\tif (!empty($menu)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Assign array of navigation items to $menu_items variable */\n\t\t\t\t\t\t\t\t$menu_items = wp_get_nav_menu_items($menu->term_id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* if $menu_items isn't empty */\n\t\t\t\t\t\t\t\tif ($menu_items) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* for each menu item, verify the menu item has no parent and then push the menu item to the $menuItems array */\n\t\t\t\t\t\t\t\t\tforeach ($menu_items as $key => $menu_item) {\n\t\t\t\t\t\t\t\t\t\tif ($menu_item->menu_item_parent == 0) {\n\t\t\t\t\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t\t\t\t$menuItems, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title' => $menu_item->title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'url' => $menu_item->url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'slug' => $menu_item->slug\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t\t\t\t'no_menus',\n\t\t\t\t\t\t\t\t\t'Could not find any menus',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'status' => 404\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Return array of list items with title and url properties */\n\t\t\t\t\t\t\t\treturn $menuItems;\n\t\t\t\t\t}", "Public function Anavbar(){\n\t\n\t}", "function sloodle_print_header()\r\n {\r\n global $CFG;\r\n $navigation = \"<a href=\\\"{$CFG->wwwroot}/mod/sloodle/view.php?_type=course&id={$this->course->id}\\\">\".get_string('courseconfig', 'sloodle').\"</a>\";\r\n\r\n\r\n sloodle_print_header_simple(get_string('courseconfig','sloodle'), \"&nbsp;\", $navigation, \"\", \"\", true, '', navmenu($this->course));\r\n }", "function soho_menu_tree__header_menu_below($variables){\n return '<ul class=\"sub-menu\">' . $variables['tree'] . '</ul>';\n}", "function mai_do_header() {\n\t$left = mai_get_do_action( 'mai_header_left' );\n\t$right = mai_get_do_action( 'mai_header_right' );\n\t$has_mobile = apply_filters( '_mai_mobile_menu', true ); // Mobile menu kill switch. In landing.php also.\n\t$mobile = ! mai_is_side_menu_enabled() ? mai_get_mobile_menu() : '';\n\n\t/**\n\t * Add classes to know when the header has left or right header content.\n\t *\n\t * @param array $attributes The header attributes.\n\t *\n\t * @return array The modified attributes.\n\t */\n\tadd_filter( 'genesis_attr_site-header', function( $attributes ) use ( $left, $right ) {\n\n\t\tif ( ! ( $left || $right ) ) {\n\t\t\t$attributes['class'] .= ' no-header-content';\n\t\t}\n\n\t\tif ( $left ) {\n\t\t\t$attributes['class'] .= ' has-header-left';\n\t\t}\n\n\t\tif ( $right ) {\n\t\t\t$attributes['class'] .= ' has-header-right';\n\t\t}\n\n\t\treturn $attributes;\n\n\t});\n\n\t/**\n\t * Filter the (site) header context of the genesis_structural_wrap.\n\t * Add new before/after header content hooks.\n\t *\n\t * @return string|HTML The content\n\t */\n\tadd_filter( 'genesis_structural_wrap-header', function( $output, $original_output ) use ( $left, $right, $has_mobile, $mobile ) {\n\n\t\tif ( 'open' == $original_output ) {\n\n\t\t\t// Default classes.\n\t\t\t$row['class'] = 'site-header-row row middle-xs';\n\n\t\t\t// Alignment.\n\t\t\t$row['class'] .= $has_mobile ? ' between-xs' : ' around-xs';\n\n\t\t\t// Justification. If no left or right, and we have mobile. If no mobile we already have around-xs.\n\t\t\t$row['class'] .= ( ! ( $left || $right ) && $has_mobile ) ? ' around-md' : '';\n\n\t\t\t// Output with row open.\n\t\t\t$output = $output . sprintf( '<div %s>', genesis_attr( 'site-header-row', $row ) );\n\n\t\t} elseif ( 'close' == $original_output ) {\n\n\t\t\t// Build header left markup.\n\t\t\tif ( $left ) {\n\n\t\t\t\t$left_atts['class'] = 'header-left col col-xs';\n\n\t\t\t\tif ( $right ) {\n\t\t\t\t\t$left_atts['class'] .= ' col-md-6 col-lg first-lg text-xs-right';\n\t\t\t\t} else {\n\t\t\t\t\t$left_atts['class'] .= ' first-xs';\n\t\t\t\t}\n\n\t\t\t\t$left = sprintf( '<div %s>%s</div>', genesis_attr( 'header-left', $left_atts ), $left );\n\n\t\t\t}\n\n\t\t\t// Build header right markup.\n\t\t\tif ( $right ) {\n\n\t\t\t\t$right_atts['class'] = 'header-right col col-xs';\n\n\t\t\t\tif ( $left ) {\n\t\t\t\t\t$right_atts['class'] .= ' col-md-6 col-lg text-xs-left';\n\t\t\t\t} else {\n\t\t\t\t\t$right_atts['class'] .= ' text-xs-right';\n\t\t\t\t}\n\n\t\t\t\t$right = sprintf( '<div %s>%s</div>', genesis_attr( 'header-right', $right_atts ), $right );\n\n\t\t\t}\n\n\t\t\t// Output with row close.\n\t\t\t$output = $left . $right . $output . $mobile . '</div>';\n\n\t\t}\n\n\t\treturn $output;\n\n\t}, 10, 2 );\n\n\t// Add Flexington classes to the title area\n\tadd_filter( 'genesis_attr_title-area', function( $attributes ) use ( $left, $right ) {\n\n\t\t// Default classes\n\t\t$attributes['class'] .= ' col col-xs-auto';\n\n\t\t// If left and right content, or logo\n\t\tif ( $left && $right ) {\n\n\t\t\t$attributes['class'] .= ' col-md-12 col-lg-auto';\n\n\t\t\tif ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) {\n\t\t\t\t$attributes['class'] .= ' text-xs-center';\n\t\t\t}\n\t\t}\n\n\t\t// If left or right content\n\t\tif ( $left || $right ) {\n\n\t\t\t$attributes['class'] .= ' start-xs';\n\t\t\tif ( $left && ! $right ) {\n\t\t\t\t$attributes['class'] .= ' last-xs';\n\t\t\t}\n\n\t\t} else {\n\t\t\t$attributes['class'] .= ' center-xs';\n\t\t}\n\n\t\treturn $attributes;\n\n\t});\n\n}", "function travomath_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'secondary', 'Footer Navigation Menu' );\n}", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "public function addHeader($header);", "function printHeader()\n\t{\n\t\t$_SESSION['last_page'] = $_SERVER['QUERY_STRING'];\n\t\tif( isset($_SESSION['admin']) && $_SESSION['admin'])\n\t\t{\n\t\t\t$this->admin_nav = \"<a class=\\\"button\\\" href=\\\"?section=project_management\\\" title=\\\"Go to project management\\\">Project Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=reference_value_management\\\" title=\\\"Go to reference value management\\\">Reference Value Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=user_management\\\" title=\\\"Go to user management\\\">User Management</a>\\n\";\n\t\t}\n\t\t$this->initSessionVariables();\n\t\tinclude 'View/Header.html';\n\t}", "function soho_menu_link__header_menu(array $variables) {\n $output = '';\n unset($variables['element']['#attributes']['class']);\n $element = $variables['element'];\n static $item_id = 0;\n $menu_name = $element['#original_link']['menu_name'];\n\n // set the global depth variable\n global $depth;\n $depth = $element['#original_link']['depth'];\n\n if ( ($element['#below']) && ($depth == \"1\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children '.$element['#original_link']['mlid'].'';\n }\n \n if ( ($element['#below']) && ($depth >= \"2\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children';\n }\n \n $sub_menu = $element['#below'] ? drupal_render($element['#below']) : '';\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']);\n // if link class is active, make li class as active too\n if(strpos($output,\"active\")>0){\n $element['#attributes']['class'][] = \"current-menu-parent\";\n }\n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';\n \n}", "function html_header()\n {\n global $site, $userIcon;\n ?>\n <header class=\"main-header\">\n <!-- Logo -->\n <a href=\"<?= SERVER_NAME ?>/\" class=\"logo\">\n <!-- mini logo for sidebar mini 50x50 pixels -->\n <span class=\"logo-mini\"><b><?= PROJECT_NAME ?></b><?= strtoupper($site) ?></span>\n <!-- logo for regular state and mobile devices -->\n <span class=\"logo-lg\"><b><?= PROJECT_NAME ?></b> <?= strtoupper($site) ?></span>\n </a>\n <!-- Header Navbar: style can be found in header.less -->\n <nav class=\"navbar navbar-static-top\" role=\"navigation\">\n <!-- Sidebar toggle button-->\n <a href=\"#\" class=\"sidebar-toggle\" data-toggle=\"offcanvas\" role=\"button\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </a>\n\n <div class=\"navbar-custom-menu\">\n <ul class=\"nav navbar-nav\">\n <!-- Messages: style can be found in dropdown.less-->\n <li class=\"dropdown messages-menu\">\n <a href=\"#\" class=\"dropdown-toggle hide\" data-toggle=\"dropdown\">\n <i class=\"fa fa-envelope-o\"></i>\n <span class=\"label label-success\"><? $objInitClass = new htmlClass(); ?></span>\n </a>\n <ul class=\"dropdown-menu\">\n <li class=\"header\">You have 4 messages</li>\n <li>\n <!-- inner menu: contains the actual data -->\n <ul class=\"menu\">\n <li><!-- start message -->\n <a href=\"#\">\n <div class=\"pull-left\">\n <img\n src=\"<?= SERVER_NAME ?>/../assets/dist/img/<?= $userIcon ?>.png\"\n class=\"img-circle\" alt=\"User Image\">\n </div>\n <h4>\n Support Team\n <small><i class=\"fa fa-clock-o\"></i> 5 mins</small>\n </h4>\n <p>Why not buy a new awesome theme?</p>\n </a>\n </li>\n <!-- end message -->\n </ul>\n </li>\n <li class=\"footer\"><a href=\"#\">See All Messages</a></li>\n </ul>\n </li>\n <!-- Notifications: style can be found in dropdown.less -->\n <li class=\"dropdown notifications-menu\">\n <a href=\"#\" class=\"dropdown-toggle hide\" data-toggle=\"dropdown\">\n <i class=\"fa fa-bell-o\"></i>\n <span class=\"label label-warning\">10</span>\n </a>\n <ul class=\"dropdown-menu\">\n <li class=\"header\">You have 10 notifications</li>\n <li>\n <!-- inner menu: contains the actual data -->\n <ul class=\"menu\">\n <li>\n <a href=\"#\">\n <i class=\"fa fa-users text-aqua\"></i> 5 new members joined today\n </a>\n </li>\n </ul>\n </li>\n <li class=\"footer\"><a href=\"#\">View all</a></li>\n </ul>\n </li>\n <!-- Tasks: style can be found in dropdown.less -->\n <li class=\"dropdown tasks-menu \">\n <a href=\"#\" class=\"dropdown-toggle hide\" data-toggle=\"dropdown\">\n <i class=\"fa fa-flag-o\"></i>\n <span class=\"label label-danger\">9</span>\n </a>\n <ul class=\"dropdown-menu\">\n <li class=\"header\">You have 9 tasks</li>\n <li>\n <!-- inner menu: contains the actual data -->\n <ul class=\"menu\">\n <li><!-- Task item -->\n <a href=\"#\">\n <h3>\n Design some buttons\n <small class=\"pull-right\">20%</small>\n </h3>\n <div class=\"progress xs\">\n <div class=\"progress-bar progress-bar-aqua\" style=\"width: 20%\"\n role=\"progressbar\" aria-valuenow=\"20\" aria-valuemin=\"0\"\n aria-valuemax=\"100\">\n <span class=\"sr-only\">20% Complete</span>\n </div>\n </div>\n </a>\n </li>\n <!-- end task item -->\n </ul>\n </li>\n <li class=\"footer\">\n <a href=\"#\">View all tasks</a>\n </li>\n </ul>\n </li>\n <!-- User Account: style can be found in dropdown.less -->\n <li class=\"dropdown user user-menu\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">\n <img src=\"<?= SERVER_NAME ?>/../assets/dist/img/<?= $userIcon ?>.png\" class=\"user-image\"\n alt=\"User Image\">\n <span class=\"hidden-xs\"><?= $_SESSION[SS_USER_INFO][name] ?></span>\n </a>\n <ul class=\"dropdown-menu\">\n <!-- User image -->\n <li class=\"user-header\">\n <img src=\"<?= SERVER_NAME ?>/../assets/dist/img/<?= $userIcon ?>.png\"\n class=\"img-circle\" alt=\"User Image\">\n\n <p>\n <?= $_SESSION[SS_USER_INFO][job] ?>\n <small><?= $_SESSION[SS_USER_INFO][work] ?></small>\n </p>\n </li>\n <!-- Menu Body -->\n <li class=\"user-body hide\">\n <div class=\"col-xs-4 text-center\">\n <a href=\"#\">Followers</a>\n </div>\n <div class=\"col-xs-4 text-center\">\n <a href=\"#\">Sales</a>\n </div>\n <div class=\"col-xs-4 text-center\">\n <a href=\"#\">Friends</a>\n </div>\n </li>\n <!-- Menu Footer-->\n <li class=\"user-footer\">\n <div class=\"pull-left\">\n <a href=\"#\" class=\"btn btn-default btn-flat\">Profile</a>\n </div>\n <div class=\"pull-right\">\n <button id=\"btnLogout\" class=\"btn btn-danger\">Sign out</button>\n </div>\n </li>\n </ul>\n </li>\n\n </ul>\n </div>\n </nav>\n </header>\n <?\n $out = ob_get_contents();\n ob_end_clean();\n return $out;\n }", "function Header(){\n\t\t}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function in_admin_header()\n {\n }", "function theme_hbmode_process_header($app, &$vars) {\n $entries = $app->module('collections')->find(\"main_menu\");\n foreach ($entries as $entry) {\n $vars['links'][$entry['_id']] = [\n 'title' => $entry['title'],\n 'slug' => $entry['link'],\n ];\n }\n}", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function new_header($name=\"Default\", $urlLink=\"\") {\n\t\techo \"<head>\";\n\t\techo \"\t<title>$name</title>\";\n\t\t//\t\t<!-- Link to Foundation -->\";\n\t\techo \"\t<link rel='stylesheet' href='css/normalize.css'>\";\n\t\techo \"\t<link rel='stylesheet' href='css/foundation.css'>\";\n\t \n\t\techo \"\t<script src='js/vendor/modernizr.js'></script>\";\n\t\techo \"</head>\";\n\t\techo \"<body>\";\n\t\techo \"<div class='contain-to-grid sticky'>\";\n\t\techo \"<nav class='top-bar' data-topbar data-options='sticky_on: large'>\";\n\t\techo \"<ul class='title-area'>\";\n\t\techo \"<li class='name'>\";\n\t\techo \" <h1 align='left'><a href='/~**********/\".$urlLink.\"'>Username/Password</a></h1>\";\n\t\techo \"</li>\";\n\t\techo \"</ul>\";\n\t\techo \"</nav>\";\n\t\techo \"</div>\";\t\n\t\techo \"<body>\";\n\t}", "function genesisawesome_do_before_header() {\n\n\techo '<div id=\"ga-topbar\">';\n\t\techo '<div class=\"wrap\">';\n\n\t\t\techo '<ul id=\"social-profiles\">';\n\t\t\t$soc_urls = array(\n\t\t\t\t'rssfeed_url' => __( 'Rss Feeds', 'genesisawesome' ),\n\t\t\t\t'twitter_url' => __( 'Twitter', 'genesisawesome' ),\n\t\t\t\t'facebook_url' => __( 'Facebook', 'genesisawesome' ),\n\t\t\t\t'dribbble_url' => __( 'Dribbble', 'genesisawesome' ),\n\t\t\t);\n\t\t\tforeach ( $soc_urls as $soc_opt => $soc_name ) {\n\n\t\t\t\tif ( ! $soc_url = genesis_get_option( $soc_opt, GA_CHILDTHEME_FIELD ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t?>\n\t\t\t\t<li class='<?php echo sanitize_title( $soc_name );?>'>\n\t\t\t\t\t<a href='<?php echo esc_url( $soc_url ) ?>' target='_blank' title='<?php echo esc_attr( $soc_name );?>'><?php echo esc_attr( $soc_name );?></a>\n\t\t\t\t</li>\n\t\t\t\t<?php\n\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t\t\n\t\t\tget_search_form();\n\n\t\techo '</div>';\n\techo '</div>';\n\n}", "function sunset_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'top-header', 'Top Header Navigation Menu' );\n}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "function vodi_page_header() {\n if ( is_page() && apply_filters( 'vodi_show_site_content_page_header', true ) ) : ?>\n <header class=\"page__header stretch-full-width\">\n <div class=\"container\">\n <?php if ( apply_filters( 'vodi_show_site_content_page_title', true ) ) : ?>\n <h1 class=\"page__title\"><?php echo esc_html( apply_filters( 'vodi_site_content_page_title', get_the_title() ) ); ?></h1>\n <?php endif; ?>\n <div class=\"page__header--aside\"><?php do_action( 'vodi_page_header_aside' ); ?></div>\n </div>\n </header><!-- .entry-header -->\n <?php endif;\n }", "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "function mai_do_header_left() {\n\tif ( ! ( is_active_sidebar( 'header_left' ) || has_nav_menu( 'header_left' ) ) ) {\n\t\treturn;\n\t}\n\n\t// Header Left widget area\n\tif ( is_active_sidebar( 'header_left' ) ) {\n\t\t_mai_add_widget_header_menu_args();\n\t\tgenesis_widget_area( 'header_left' );\n\t\t_mai_remove_widget_header_menu_args();\n\t}\n\n\t// Header Left menu\n\tif ( has_nav_menu( 'header_left' ) ) {\n\t\techo genesis_get_nav_menu( array( 'theme_location' => 'header_left' ) );\n\t}\n}", "function farmhouse_header_left_menu() {\n genesis_nav_menu(\n array(\n 'theme_location' => 'header-left',\n 'depth' => 2,\n )\n );\n}", "public function admin_head(){\r\n global $submenu;\r\n \r\n if(isset( $submenu[self::menu_tag] ) \r\n &&isset($submenu[self::menu_tag][0])\r\n &&isset($submenu[self::menu_tag][0][2])\r\n &&$submenu[self::menu_tag][0][2]==self::menu_tag){\r\n \r\n unset( $submenu[self::menu_tag][0] );\r\n }\r\n }", "public function register_menus() {\n // register_nav_menus(array(\n // 'header_menu' => 'Header Navigation Menu'\n // ));\n }", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "function register_my_menus() {\n\tregister_nav_menus(\n\t\tarray(\n\t\t\t'header-menu' => __( 'Header Menu' )\n\t\t\t)\n\t);\n}", "function register_my_menus() {\n\tregister_nav_menus(\n\t\tarray(\n\t\t\t'header-menu' => __( 'Header Menu' )\n\t\t\t)\n\t);\n}", "function register_basics_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n 'extra-menu' => __( 'Extra Menu' )\n )\n );\n}", "public function displayContentHeader($nav=True) {\n ?>\n <h1 class=\"header\"><br>~ Weekend Trackers ~<br><br></h1>\n <?php\n if($nav) {\n ?>\n <nav class=\"navbar navbar-inverse\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#myNavbar\">\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"home.php\">Weekend Trackers</a>\n </div>\n <div class=\"collapse navbar-collapse\" id=\"myNavbar\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"home.php\">Home</a></li>\n <li><a href=\"add_weekend.php\">Add Weekend Plan</a></li>\n <li><a href=\"check_weekend.php\">Check Weekend Status</a></li>\n <li><a href=\"check_incentive.php\">Check Incentives</a></li>\n <li><a href=\"add_incentive.php\">Add Incentives</a></li>\n <li><a href=\"update.php\">Update Profile</a></li>\n <li><a href=\"approve.php\">Approve Weekends</a></li>\n <li><a href=\"add_users.php\">Add Users</a></li>\n <li><a href=\"create_incentive.php\">Create Incentives</a></li>\n <li><a href=\"reset.php\">Reset</a></li>\n </ul>\n <form action=\"logout.php\" method=\"post\" class=\"form-inline my-2 my-lg-0\">\n <button class=\"btn btn-outline-success my-2 my-sm-0\" name=\"logoff\" type=\"logoff\">Log Off</button>\n </form>\n </div>\n </div>\n </nav>\n <?php\n }\n }", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "function erp_render_menu_header( $component ) {\n $headers = erp_get_menu_headers();\n if ( empty( $headers[$component] ) ) {\n return \"\";\n }\n\n $html = sprintf( '<div class=\"erp-page-header\">\n <div class=\"module-icon\">\n %s\n </div>\n <h2>%s</h2>\n </div>',\n $headers[$component]['icon'], $headers[$component]['title'] );\n\n return $html;\n}", "function register_my_menus() {\nregister_nav_menus(\n\tarray(\t \n\t 'header-menu' => __('Header Menu')\t \n\t ) \n );\n}", "function register_my_menus() {\nregister_nav_menus(\n\tarray(\t \n\t 'header-menu' => __('Header Menu')\t \n\t ) \n );\n}", "function navbar()\r\n {\r\n }", "function print_html_header($title) {\n\tif ($title != \"Login\")\n\t\t$menu = make_menu_bs($title);\n\n\techo '\n<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t <meta charset=\"utf-8\">\n\t <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n\t <title>'.$title.'</title>\n\t\t<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css\">\n\t\t<link rel=\"stylesheet\" href=\"css/style.css\">\n\t</head>\n\t<body>\n\t\t<div class=\"container\">\n\t\t\t'.$menu.'\n\t\t\t<div class=\"content\">\n\t';\n\tif ($title != \"Login\")\n\t\techo '<h1>'.$title.'</h1>';\n}", "function loadHeaderView($controller) {\n return '<div class=\"container\">\n <nav class=\"navbar navbar-default navbar-static-top navbar-center\">\n <div class=\"container\">\n <ul class=\"list-unstyled list-inline text-center\">\n <li><a href=\"' . BASE . '\">HOME</a></li>\n <li><a href=\"' . BASE . 'home/logout\">LOGOUT</a></li>\n </ul>\n </div>\n </nav>\n\n </div>';\n}", "function kvell_edge_include_header_vertical_menu( $menus ) {\n\t\t$menus['vertical-navigation'] = esc_html__( 'Vertical Navigation', 'kvell' );\n\t\t\n\t\treturn $menus;\n\t}", "function basey_head_output() { ?>\n\t<nav class=\"uk-navbar\">\n\t\t<div class=\"uk-container\">\n\t\t\t<a class=\"uk-navbar-brand\" href=\"<?php echo home_url(); ?>\"><img src=\"/wp-content/themes/dyn-build/assets/svg/build/dyn-logo-white.svg\"></a>\n\t\t\t<?php\n\t\t\twp_nav_menu( array(\n\t\t\t\t'menu' => 'primary',\n\t\t\t\t'theme_location' => 'primary',\n\t\t\t\t'depth' => 2,\n\t\t\t\t'container' => '',\n\t\t\t\t'menu_class' => 'uk-navbar-nav uk-hidden-small uk-hidden-medium',\n\t\t\t\t'fallback_cb' => 'basey_primary_menu::fallback',\n\t\t\t\t'walker' => new basey_primary_menu())\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"uk-navbar-flip uk-hidden-large\">\n\t\t\t\t<a href=\"#offcanvas-menu\" class=\"uk-navbar-toggle\" data-uk-offcanvas></a>\n\t\t\t</div>\n\t\t\t<div id=\"navbar-side\" class=\"uk-navbar-flip uk-hidden-small\">\n\t\t\t\t\t<ul class=\"uk-navbar-nav\">\n\t\t\t\t\t\t\t<li><a class=\"uk-text-uppercase uk-text-spaced uk-button-nav\" href=\"#main-contact\" data-uk-modal>Connect</a></li>\n\t\t\t\t\t\t\t<li><a href=\"#main-search\" data-uk-modal><i class=\"icon-search uk-icon-medium\"></i></a></li>\n\t\t\t\t\t\t\t<li class=\"uk-parent\" data-uk-dropdown=\"\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <a href=\"\"><i class=\"icon-circle_account uk-icon-medium\"></i></a>\n <div class=\"uk-dropdown uk-dropdown-navbar uk-dropdown-bottom\" aria-hidden=\"true\" style=\"top: 40px; left: 0px;\" tabindex=\"\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\twp_nav_menu( array(\n\t\t\t\t\t\t\t\t\t\t\t'menu' => 'user',\n\t\t\t\t\t\t\t\t\t\t\t'theme_location' => 'user',\n\t\t\t\t\t\t\t\t\t\t\t'depth' => 2,\n\t\t\t\t\t\t\t\t\t\t\t'container' => '',\n\t\t\t\t\t\t\t\t\t\t\t'menu_class' => 'uk-nav uk-hidden-small',\n\t\t\t\t\t\t\t\t\t\t\t'fallback_cb' => 'basey_primary_menu::fallback',\n\t\t\t\t\t\t\t\t\t\t\t'walker' => new basey_primary_menu())\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t?>\n </div>\n\n </li>\n\t\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t</nav>\n\t<?php\n}", "public function wordpress_default_header(){\n\t\tif(is_home() && $this->_template_builder->get_specific_option('carousel_global')){\r\n\t\t\tif(!$this->_template_builder->get_specific_option('jumbotron')){\r\n\t\t\t\t$this->_build_header();\r\n\t\t\t}else{\r\n\t\t\t\t$this->_template_builder->render_view('jumbotron');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->_template_builder->get_specific_option('socialbar')){\r\n\t\t\t\t$this->_template_builder->render_view('socialbar');\t\r\n\t\t\t}\r\n\t\t}\n\t}", "function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "public function displayHeader()\n {\n parent::displayHeader();\n\n $this->printHtml('<div class=\"aiMainContent clearfix\">');\n\n $this->printHtml('<div class=\"aiTopNav\">');\n\n if ( $this->isLoggedIn() ) {\n\n $userObj = $this->getUser();\n $roleObj = $userObj->getRole();\n\n $this->printHtml('<!-- role: ' . $roleObj->name . ' -->');\n\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '\">' . $this->getSiteTitle() . '</a></li>');\n\n $allowedRoles = array( 'user', 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/test/suites/\">Suites</a></li>');\n }\n\n $allowedRoles = array( 'user', 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/tests/\">Tests</a></li>');\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n // $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/folders/\">Folders</a></li>');\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml(\n '<li><a href=\"' . $this->getBaseUrl() . '/test/param/library/\">' .\n 'Parameter Library' .\n '</a></li>'\n );\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/test/runs/\">Runs</a></li>');\n }\n\n\n $this->printHtml(\n '<li><a href=\"' . $this->getBaseUrl() . '/user/logout/\">' .\n 'Logout : ' . $this->escapeVariable($userObj->username) . \n '</a></li>'\n );\n\n $this->printHtml('</ul>');\n\n if ( $this->isLoggedIn() && $roleObj->name == 'admin' ) {\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/manager/\">Manage Users</a></li>');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl(). '/test/machines/\">Machines</a></li>');\n $this->printHtml('</ul>');\n }\n } else {\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/login/\">Login</a></li>');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/create/\">Create Account</a></li>');\n $this->printHtml('</ul>');\n }\n\n\n $this->printHtml('</div>');\n\n return true;\n }", "function display_header() {}", "public function section_header() {\r\n\t\techo '<p>Other menu options will only show when there is a connection to the API.</p>';\r\n\t}", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "public function admin_header( array $header_data = array(), string $menu_key = '', array $menu_items = array() ) : array {\n\t\t\t// Clear out $header_data if we are showing our page.\n\t\t\treturn $menu_key === $this->parent_menu_page_url ? array() : $header_data;\n\t\t}", "public function admin_header( array $header_data = array(), string $menu_key = '', array $menu_items = array() ) : array {\n\t\t\t// Clear out $header_data if we are showing our page.\n\t\t\treturn $menu_key === $this->parent_menu_page_url ? array() : $header_data;\n\t\t}", "function createAboutUsMenu () {\n $menu_name = __('About Us',CARE_TEXTDOMAIN);\n $menu_exists = wp_get_nav_menu_object( $menu_name );\n\n if( !$menu_exists) {\n $menu_id = wp_create_nav_menu($menu_name);\n\n // Set up default menu items\n wp_update_nav_menu_item($menu_id, 0, array(\n 'menu-item-title' => __('About Care',CARE_TEXTDOMAIN),\n // 'menu-item-classes' => 'home',\n 'menu-item-url' => home_url( '/about-care-centre/' ), \n 'menu-item-status' => 'publish'));\n }\n}", "function generate_header_items() \r\n{\r\n\t// Header widget\r\n\tgenerate_construct_header_widget();\r\n\t\r\n\t// Site logo\r\n\tgenerate_construct_logo();\r\n\t\r\n\t// Site title and tagline\r\n\tgenerate_construct_site_title();\r\n\t\r\n}", "public function context_header($headerinfo = null, $headinglevel = 1) {\n if ($headinglevel == 1 && !empty($this->page->theme->settings->logo)) {\n return html_writer::tag('div', '', array('class' => 'logo'));\n }\n return parent::context_header($headerinfo, $headinglevel);\n }", "public function Header() {\n // si la pagina es diferente de la 2\n // if (count($this->pages) !== 2) \n // {\n // Logo\n $image_file = K_PATH_IMAGES.'logoesen.jpg';\n $this->Image($image_file, 90, 5, 25, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);\n // Set font\n $this->SetFont('helvetica', 'B', 20);\n // Title\n //$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');\n // }\n }", "function v2_mumm_menu_tree__menu_header(&$variables) {\n return $variables['tree'];\n}", "function mocca_custom_menu() {\n\n register_nav_menus(array(\n 'bootstrap-menu' => 'Navigtion Bar',\n 'footer-menu' => 'footer Bar',\n ));\n }", "function sloodle_print_header()\n {\n global $CFG;\n\n // Offer the user an 'update' button if they are allowed to edit the module\n $editbuttons = '';\n if ($this->canedit) {\n $editbuttons = update_module_button($this->cm->id, $this->course->id, get_string('modulename', 'sloodle'));\n }\n // Display the header\n $navigation = \"<a href=\\\"index.php?id={$this->course->id}\\\">\".get_string('modulenameplural','sloodle').\"</a> ->\";\n sloodle_print_header_simple(format_string($this->sloodle->name), \"&nbsp;\", \"{$navigation} \".format_string($this->sloodle->name), \"\", \"\", true, $editbuttons, navmenu($this->course, $this->cm));\n\n // Display the module name\n $img = '<img src=\"'.$CFG->wwwroot.'/mod/sloodle/icon.gif\" width=\"16\" height=\"16\" alt=\"\"/> ';\n sloodle_print_heading($img.$this->sloodle->name, 'center');\n \n // Display the module type and description\n $fulltypename = get_string(\"moduletype:{$this->sloodle->type}\", 'sloodle');\n echo '<h4 style=\"text-align:center;\">'.get_string('moduletype', 'sloodle').': '.$fulltypename;\n echo sloodle_helpbutton(\"moduletype_{$this->sloodle->type}\", $fulltypename, 'sloodle', true, false, '', true).'</h4>';\n // We'll apply a general introduction to all Controllers, since they seem to confuse lots of people!\n $intro = $this->sloodle->intro;\n if ($this->sloodle->type == SLOODLE_TYPE_CTRL) $intro = '<p style=\"font-style:italic;\">'.get_string('controllerinfo','sloodle').'</p>' . $this->sloodle->intro;\n\t\t// Display the intro in a box, if we have an intro\n\t\tif (!empty($intro)) sloodle_print_box($intro, 'generalbox', 'intro');\n \n }", "function mai_do_header_right() {\n\tif ( ! ( is_active_sidebar( 'header_right' ) || has_nav_menu( 'header_right' ) ) ) {\n\t\treturn;\n\t}\n\n\t// Header Right widget area\n\tif ( is_active_sidebar( 'header_right' ) ) {\n\t\t_mai_add_widget_header_menu_args();\n\t\tgenesis_widget_area( 'header_right' );\n\t\t_mai_remove_widget_header_menu_args();\n\t}\n\t// Header Right menu\n\tif ( has_nav_menu('header_right') ) {\n\t\techo genesis_get_nav_menu( array( 'theme_location' => 'header_right' ) );\n\t}\n}", "public function addHeader($header){\n\t\theader($header);\n\t}", "function bb_header()\n{\n\tdo_action('bb_header');\n}", "public function setHeader($header, $margin) {\n\t}", "public function register_admin_menu() {\n\n\t\t\t$page_header_capability = apply_filters( 'astra_page_header_capability', 'edit_theme_options' );\n\n\t\t\tadd_submenu_page(\n\t\t\t\t'themes.php',\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t$page_header_capability,\n\t\t\t\t'edit.php?post_type=astra_adv_header'\n\t\t\t);\n\t\t}", "public function header() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfHeader'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateHeader', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}", "public function full_header() {\n $header = new stdClass();\n $header->settingsmenu = $this->context_header_settings_menu();\n $header->handytoolbar = $this->context_handy_toolbar();\n $header->contextheader = $this->context_header();\n $header->hasnavbar = empty($this->page->layout_options['nonavbar']);\n $header->navbar = $this->navbar();\n $header->pageheadingbutton = $this->page_heading_button();\n $header->courseheader = $this->course_header();\n $template = 'theme_savoir/header';\n if ($this->is_on_frontpage()) {\n $template = 'theme_savoir/header_fp';\n $options = new stdClass();\n $options->noclean = true; // Don't clean Javascripts etc.\n $options->overflowdiv = false;\n $context = context_course::instance($this->page->course->id);\n $summary =\n file_rewrite_pluginfile_urls(\n $this->page->course->summary,\n 'pluginfile.php',\n $context->id,\n 'course',\n 'summary',\n null);\n $content = format_text($summary, $this->page->course->summaryformat, $options);\n if (!isloggedin()) {\n $header->loginurl = get_login_url();\n }\n $header->frontpageslogan = $content;\n $header->frontpagestitle = $this->page->course->shortname;\n $header->alertmessage = format_text(get_config('theme_savoir', 'fpmessage'), FORMAT_HTML);\n $header->alertenabled = get_config('theme_savoir', 'fpmessageenabled');\n } else if ($this->is_on_page_with_description()) {\n $header->pageslogan = get_string(preg_replace('/^theme-savoir-pages-/', '', $this->page->pagetype, 1) . '-description',\n 'theme_savoir');\n $header->bgimageurl = $this->image_url('genericbackground', 'theme_savoir');\n $template = 'theme_savoir/header_desc';\n }\n return $this->render_from_template($template, $header);\n }", "public function wishlist_header( $var ) {\n\t\t $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';\n\t\t\t$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';\n\n\t\t yith_wcwl_get_template_part( $template, 'header', $layout, $var );\n }", "function renderHeader(&$header)\n {\n if ($name = $header->getName()) {\n $this->_ary['header'][$name] = $header->toHtml();\n } else {\n $this->_ary['header'][$this->_sectionCount] = $header->toHtml();\n }\n $this->_currentSection = $this->_sectionCount++;\n }", "public function hookBackOfficeHeader()\n {\n if (Tools::getValue('module_name') == $this->name || Tools::getValue('configure') == $this->name) {\n $this->context->controller->addJS($this->_path . 'views/js/back.js');\n $this->context->controller->addCSS($this->_path . 'views/css/back.css');\n }\n }", "public function hookBackOfficeHeader()\n {\n if (Tools::getValue('module_name') == $this->name || Tools::getValue('configure') == $this->name) {\n $this->context->controller->addJS($this->_path . 'views/js/back.js');\n $this->context->controller->addCSS($this->_path . 'views/css/back.css');\n }\n }", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "function studio_before_header_widget_area() {\n\n\tgenesis_widget_area( 'before-header', array(\n\t 'before' => '<div class=\"before-header\"><div class=\"wrap\">',\n\t 'after'\t => '</div></div>',\n\t) );\n}", "function elzero_add_menu() {\n // register_nav_menu('manin-menu', __('Main Navigation Menu'));\n register_nav_menus(array(\n 'main-menu' => 'Main Navigation Menu',\n 'footer-menu' => 'Footer Classic Menu'\n ));\n}", "function get_custom_header()\n {\n }", "function quadro_site_menu() {\n\tglobal $quadro_options;\n\tif ( $quadro_options['menu_header_display'] == 'hide' ) return false;\n\t?>\n\t<h1 class=\"menu-toggle\">\n\t\t<a href=\"#msite-navigation\">\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-1\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-2\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-3\"></span>\n\t\t</a>\n\t</h1>\n\t<nav id=\"site-navigation\" class=\"main-navigation\">\n\t\t<div class=\"inner-nav\">\n\t\t\t<a class=\"skip-link screen-reader-text\" href=\"#content\"><?php esc_html_e( 'Skip to content', 'indigo' ); ?></a>\n\t\t\t<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>\n\t\t</div>\n\t</nav><!-- #site-navigation -->\n\t<?php\n}", "public function getMenu()\n{\n $lang=$this->translation;\n foreach($this->_headerMenu as $hmenukey => $hmenu){\n foreach($hmenu as $hkey=>$hval){\n $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey);\n }\n }\n $auth = $this->session->get('auth');\n if ($auth) {\n $this->_headerMenu['navbar-right']['oturum'] = array(\n 'caption' => $lang->_('logout'),\n 'action' => 'bitir'\n );\n\n } else {\n unset($this->_headerMenu['navbar-left']['islemler']);\n unset($this->_headerMenu['navbar-left']['r4t']);\n unset($this->_headerMenu['navbar-left']['hesap']);\n }\n\n $controllerName = $this->view->getControllerName();\n foreach ($this->_headerMenu as $position => $menu) {\n echo '<div class=\"nav-collapse\">';\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\n foreach ($menu as $controller => $option) {\n if ($controllerName == $controller) {\n echo '<li class=\"active\">';\n } else {\n echo '<li>';\n }\n if ($controller=='admin'){\n if(($auth) and ($auth['auth']==0)){\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }}else{\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }\n echo '</li>';\n }\n\n echo '</ul>';\n echo '</div>';\n }\n\n }", "function ks_nav() {\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'header-menu',\n\t\t\t'menu' => '',\n\t\t\t'container' => 'div',\n\t\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t\t'container_id' => '',\n\t\t\t'menu_class' => 'menu',\n\t\t\t'menu_id' => '',\n\t\t\t'echo' => true,\n\t\t\t'fallback_cb' => 'wp_page_menu',\n\t\t\t'before' => '',\n\t\t\t'after' => '',\n\t\t\t'link_before' => '',\n\t\t\t'link_after' => '',\n\t\t\t'items_wrap' => '<ul>%3$s</ul>',\n\t\t\t'depth' => 0,\n\t\t\t'walker' => ''\n\t\t)\n\t);\n}", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }" ]
[ "0.72142714", "0.7131464", "0.68916434", "0.68634874", "0.66280705", "0.6590642", "0.6531796", "0.64827025", "0.6472052", "0.6464167", "0.645855", "0.6417311", "0.63774425", "0.6368261", "0.63662624", "0.6329185", "0.631694", "0.6232463", "0.62131196", "0.6178124", "0.6141416", "0.6135649", "0.61196506", "0.6113456", "0.61071396", "0.6103361", "0.60859406", "0.60508406", "0.6045635", "0.6035038", "0.60272515", "0.60195804", "0.5992747", "0.59866387", "0.5981835", "0.59754616", "0.5961043", "0.59561044", "0.5952799", "0.5903292", "0.59013534", "0.58782065", "0.5870519", "0.58691573", "0.5862694", "0.58589435", "0.58449286", "0.5828809", "0.5826297", "0.5825772", "0.58236873", "0.5819679", "0.58046436", "0.58046436", "0.58039343", "0.5794863", "0.5793625", "0.57931626", "0.57881695", "0.57881695", "0.5781533", "0.5771431", "0.5767331", "0.5763933", "0.5746441", "0.5741947", "0.57417464", "0.573971", "0.57348937", "0.5722349", "0.57097465", "0.57043433", "0.5703564", "0.5703564", "0.569392", "0.56896085", "0.56669736", "0.56613505", "0.56579036", "0.56488454", "0.56421345", "0.56391966", "0.5638767", "0.5636392", "0.56334007", "0.5631792", "0.56317866", "0.5630897", "0.5629907", "0.561904", "0.5617303", "0.5617303", "0.5616969", "0.5612225", "0.5609826", "0.5605803", "0.56028295", "0.56002945", "0.560026", "0.5597996" ]
0.57562786
64