query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Configure the roles and permissions that are available within the application. | protected function configurePermissions()
{
Jetstream::defaultApiTokenPermissions(['read']);
Jetstream::role('admin', __('Yonetici'), [
'create',
'read',
'update',
'delete',
])->description(__('Şirket hakkındaki herşeyi yapabilir'));
Jetstream::role('editor', __('İlan Yöneticisi'), [
'read',
'create',
'update',
])->description(__('Sadece ilanları yönetebilir'));
Jetstream::role('operasyon', __('Operasyon Yöneticisi'), [
'read',
'create',
'update',
])->description(__('Sadece operasyonları yönetebilir'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Administrator'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Administrator users can perform any action.'));\n\n Jetstream::role('editor', __('Editor'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Editor users have the ability to read, create, and update.'));\n }",
"public function init() {\n $config_array = $this->config->toArray();\n $prev_role = null;\n\n foreach ($config_array as $role => $permissions) {\n $prev_role = $this->addUserRole($role, $prev_role);\n \n if(empty($permissions) || !is_array($permissions)) {\n continue;\n }\n \n foreach($permissions as $controller => $actionList) {\n $controller = $this->addController($controller);\n $priviliges = $this->getPriviliges($actionList);\n \n $this->allow($role, $controller, $priviliges);\n } \n }\n }",
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::permissions([\n 'create',\n 'read',\n 'update',\n 'delete',\n ]);\n }",
"protected function _setupRoles()\n {\n $this->_acl->addRole( new Zend_Acl_Role('guest') );\n $this->_acl->addRole( new Zend_Acl_Role('user') );\n }",
"private function setRoles() {\r\n\t\t$all_roles = array(); $role = Model_Role::retrieve(); \r\n\t\tforeach ($role->fetchEntries(array(\r\n \t\t'NAME', 'PARENT' => new Data_Column('PARENT_ROLE_ID', null, $role, 'NAME'))) as $rel)\r\n\t\t{\t\r\n \t\t$all_roles[$rel['NAME']] = array($rel['PARENT']);\r\n\t\t}\r\n\t\t\r\n\t\t// get users with role reslationship \r\n\t\t$userRole = Model_User_Role::retrieve(); \r\n\t\tforeach ($userRole->fetchEntries(array(\r\n \t\t'NAME' => new Data_Column('USER_ID', null, $userRole, 'LOGIN'),\r\n \t\t'PARENT' => new Data_Column('ROLE_ID', null, $userRole, 'NAME')), null, true) as $rel)\r\n\t\t{\t\t\t\r\n\t\t // one user can belong to more than one role\r\n\t\t\tif (array_key_exists($rel['NAME'], $all_roles))\r\n\t\t array_push($all_roles[$rel['NAME']], $rel['PARENT']);\r\n\t\t else\r\n\t\t $all_roles[$rel['NAME']] = array($rel['PARENT']);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// now register all roles and users from database as application roles\r\n\t\tforeach ($all_roles as $name => $roles) {\r\n\t\t $this->_registerRole($name, $all_roles);\r\n\t\t}\r\n\t\t\r\n\t\t//$this->_registerRole('Guest', array());\r\n\t}",
"public function init_roles()\n {\n }",
"public function RegisterRolesAndPermissions()\n {\n //create role by defined default data in config->permission.php\n //if don't exist in database\n if (Role::where('name', config('permission.default_roles')[0])->count() <1){\n foreach (config('permission.default_roles') as $role){\n Role::create([\n 'name' => $role,\n ]);\n }\n }\n\n //create permission by defined default data in config->permission.php\n //if don't exist in database\n if (Permission::where('name', config('permission.default_permission')[0])->count() <1) {\n foreach (config('permission.default_permission') as $permission) {\n Permission::create([\n 'name' => $permission,\n ]);\n }\n }\n }",
"protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}",
"private function checkConfig() {\n\n $roleModelName = Configure::read('acl.aro.role.model');\n\n if (! empty($roleModelName)) {\n $this->set('roleModelName', $roleModelName);\n $this->set('userModelName', Configure::read('acl.aro.user.model'));\n $this->set('rolePkName', $this->getRolePrimaryKeyName());\n $this->set('userPkName', $this->getUserPrimaryKeyName());\n $this->set('roleFkName', $this->_getRoleForeignKeyName());\n\n $this->authorizeAdmins();\n\n if (Configure::read('acl.check_act_as_requester')) {\n $is_requester = true;\n\n if (! $this->AclManager->checkAclRequester(\n Configure::read('acl.aro.user.model'))) {\n $this->set('model_is_not_requester', false);\n $is_requester = false;\n }\n\n if (! $this->AclManager->checkAclRequester(\n Configure::read('acl.aro.role.model'))) {\n $this->set('role_is_not_requester', false);\n $is_requester = false;\n }\n\n if (! $is_requester) {\n $this->render('Acl.Aros/admin_not_acl_requester');\n }\n }\n } else {\n $this->Session->setFlash(\n __d('acl',\n 'The role model name is unknown. The ACL plugin bootstrap.php file has to be loaded in order to work. (see the README file)'),\n 'flash_error', null, 'plugin_acl');\n }\n }",
"protected function configure(): void\n {\n $this->mergeConfigFrom(\n __DIR__ . '/config/permissions_makr.php', 'permissions_makr'\n );\n }",
"function __construct() {\n\n $this->addRole(new Zend_Acl_Role('guests'));\n $this->addRole(new Zend_Acl_Role('admins'), 'guests');\n\n // >>>>>>>>>>>> Adding Resources <<<<<<<<<<<<<<<\n \n // **** Resources for module Default *****\n\n $this->add(new Zend_Acl_Resource('default'));\n $this->add(new Zend_Acl_Resource('default:index'), 'default');\n \n\n // **** Resources for module Admin *****\n\n $this->add(new Zend_Acl_Resource('admin'));\n $this->add(new Zend_Acl_Resource('admin:index'), 'admin');\n $this->add(new Zend_Acl_Resource('admin:devis'), 'admin');\n\n // >>>>>>>>>>>> Affecting Resources <<<<<<<<<<<<<<<\n \n // ------- >> module Default << -------\n $this->allow('guests', 'default:index');\n \n \n // ------- >> module Admin << -------\n $this->allow('guests', 'admin:index');\n $this->allow('guests', 'admin:devis');\n \n \n }",
"static public function set_core_roles_capabilities(){\n stablish_capabilities('administrator', TA_Roles_Plugin::get_capabilities() );\n\n stablish_capabilities('subscriber', TA_Roles_Plugin::get_capabilities(array(\n 'comments_pre_aproved',\n )) );\n\n stablish_capabilities('editor', TA_Roles_Plugin::get_capabilities(array(\n 'portada',\n 'micrositio_home',\n 'article_section_edit',\n 'article_place_edit',\n 'article_tema_edit',\n 'article_tag',\n 'article_author',\n 'article_micrositio',\n 'article_micrositio_edit',\n 'menus',\n 'articles_edit',\n 'articles_publish',\n 'media_uploads',\n 'ed_impresa',\n 'fotogaleria',\n 'taller',\n 'memberships',\n 'mailtrain',\n 'comments',\n 'extra',\n 'comments_pre_aproved',\n )) );\n }",
"protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }",
"public function run()\n {\n $this->disableForeignKeys();\n\n // Create Roles\n $admin = Role::create(['name' => config('access.users.admin_role')]);\n $executive = Role::create(['name' => 'executive']);\n $user = Role::create(['name' => config('access.users.default_role')]);\n\n // Create Permissions\n Permission::create(['name' => 'view backend']);\n // Create Permission For Inventory Module\n Permission::create(['name' => 'view inventory']);\n Permission::create(['name' => 'create item']);\n Permission::create(['name' => 'store item']);\n Permission::create(['name' => 'edit item']);\n Permission::create(['name' => 'update item']);\n Permission::create(['name' => 'delete item']);\n Permission::create(['name' => 'restore item']);\n Permission::create(['name' => 'force delete item']);\n // Create Permission For Inventory Module\n Permission::create(['name' => 'view sizes']);\n Permission::create(['name' => 'store size']);\n Permission::create(['name' => 'update size']);\n Permission::create(['name' => 'delete size']);\n Permission::create(['name' => 'restore size']);\n Permission::create(['name' => 'force delete size']);\n\n // ALWAYS GIVE ADMIN ROLE ALL PERMISSIONS\n $admin->givePermissionTo('view backend');\n // Give all Permission for Inventory to Admin\n $admin->givePermissionTo('view inventory');\n $admin->givePermissionTo('create item');\n $admin->givePermissionTo('store item');\n $admin->givePermissionTo('edit item');\n $admin->givePermissionTo('update item');\n $admin->givePermissionTo('delete item');\n $admin->givePermissionTo('restore item');\n $admin->givePermissionTo('force delete item');\n // Give all Permission for Size to Admin\n $admin->givePermissionTo('view sizes');\n $admin->givePermissionTo('store size');\n $admin->givePermissionTo('update size');\n $admin->givePermissionTo('delete size');\n $admin->givePermissionTo('restore size');\n $admin->givePermissionTo('force delete size');\n\n // Assign Permissions to other Roles\n $executive->givePermissionTo('view backend');\n\n $this->enableForeignKeys();\n }",
"public function __construct()\n {\n $this->roles = [\n \n [\n 'name' => 'administrator',\n 'pengguna' => [\n 'ramdan'\n ],\n 'permissions' => [\n 'anggota-create',\n 'anggota-update',\n 'anggota-delete'\n ]\n ],\n\n ];\n }",
"protected function _addRoleResources() {\n if (!empty($this->commonPermission)) {\n foreach ($this->commonPermission as $resource => $permissions) {\n foreach ($permissions as $permission) {\n $this->allow(self::DEFAULT_ROLE, $resource, $permission);\n }\n }\n }\n\n if (!empty($this->rolePermission)) {\n foreach ($this->rolePermission as $rolePermissions) {\n $this->allow($rolePermissions['role_name'], $rolePermissions['resource_name'], $rolePermissions['permission_name']);\n }\n }\n\n return $this;\n }",
"public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }",
"protected function initRoles()\n {\n $this->roles = new ArrayCollection();\n }",
"public function run()\n {\n $this->disableForeignKeys();\n\n User::find(1)->assignRole(config('access.users.admin_role'));\n User::find(2)->assignRole(config('access.users.owner_role'));\n User::find(3)->assignRole(config('access.users.operational_manager_role'));\n User::find(4)->assignRole(config('access.users.operational_staff_role'));\n User::find(5)->assignRole(config('access.users.akunting_manager_role'));\n User::find(6)->assignRole(config('access.users.akunting_staff_role'));\n User::find(6)->assignRole(config('access.users.butler_role'));\n User::find(7)->assignRole(config('access.users.default_role'));\n\n $this->enableForeignKeys();\n }",
"public function setAllRoles()\n {\n Role::create(['name' => 'Member']);\n Role::create(['name' => 'Creator']);\n Role::create(['name' => 'Admin']);\n }",
"protected function registerRoles()\n {\n if (! is_dir($path = resource_path('roles'))) {\n return;\n }\n\n $files = Finder::create()\n ->in($path)\n ->name('*.php')\n ->notName('defaults.php');\n\n $bouncer = app(Bouncer::class);\n $bouncer->seeder(function () use ($bouncer, $files) {\n collect($files)->each(function ($file) use ($bouncer) {\n $role = require $file->getRealPath();\n $name = $role['name'];\n $permissions = $role['permissions'];\n\n $bouncer->allow(\"$name\")->to($permissions);\n });\n });\n }",
"public function run()\n {\n /*\n\t\t\tWeb Roles\n\t\t*/\n // Creation of Primary Roles\n\t\t// $role = Role::create(['guard_name' => 'web', 'name' => 'administrator']);\n if ( ! Role::whereName('Administrator')->exists()) {\n \t\t$role = Role::create(['name' => 'Administrator']);\n\n // Assign permissions to the Role\n $role->givePermissionTo('browse');\n $role->givePermissionTo('catalogs_browse');\n $role->givePermissionTo('catalogs_admin');\n $role->givePermissionTo('users_manage');\n }\n\n /*\n Example: Assigning a Role with a non existing Permission\n It is possible to implement an automatic creation of the non existent Permission\n */\n /*\n $role = Role::whereName('Administrator')->firstOrFail();\n try {\n $role->givePermissionTo('No Existe browse');\n } catch ( Spatie\\Permission\\Exceptions\\PermissionDoesNotExist $ex) {\n echo \"Permission: \".\"No Existe browse \".\" doesn't exist\" . \"\\n\"; \n }\n try {\n $role->givePermissionTo('browse');\n } catch ( Spatie\\Permission\\Exceptions\\PermissionDoesNotExist $ex) {\n echo \"Permission: \".\"browse\".\" doesn't exist\" . \"\\n\"; \n }\n try {\n $role->givePermissionTo('No Existe browse 2');\n } catch ( Spatie\\Permission\\Exceptions\\PermissionDoesNotExist $ex) {\n echo \"Permission: \".\"No Existe browse 2\".\" doesn't exist\" . \"\\n\"; \n }\n */\n\n //\n // Creation of Secondary Roles\n\t\t// $role = Role::create(['guard_name' => 'web','name' => 'user']);\n //\n $Table = 'roles';\n $Records = [];\n\n // $role = Role::create(['name' => 'user']);\n // $role->givePermissionTo('browse');\n // $role->givePermissionTo('catalogs_browse');\n $Records[] = [\n 'name' => 'User',\n // 'guard_name' => 'web' ,\n // 'description' => 'User',\n 'permissions' => ['browse', 'catalogs_browse','browsing'],\n // 'planets' => ['mercury', 'venus','earth','mars'],\n ]; \n\n\n\t\t// $role = Role::create(['guard_name' => 'web', 'name' => 'guest']);\n\t\t// $role = Role::create(['name' => 'guest']);\n // $role->givePermissionTo('browse');\n $Records[] = [\n 'name' => 'Guest',\n 'guard_name' => 'web' ,\n 'description' => 'Guest User',\n 'permissions' => ['browse']\n ]; \n\t\t\n\t\t/*\n\t\t *\tSystem Roles\n\t\t*/\n /*\n\t\t$role = Role::create(['name' => 'User Administrator']);\n $role->givePermissionTo('catalogs_admin');\n $role->givePermissionTo('users_manage');\n $role->givePermissionTo('browse');\n */\n $Records[] = [\n 'name' => 'User Administrator',\n 'guard_name' => 'web' ,\n 'description' => 'Guest User',\n 'permissions' => ['catalogs_admim', 'users_manage','browse']\n ]; \n\n // Roles Creation\n // $this->createRecordClass(Spatie\\Permission\\Models\\Role::class, $Records);\n $this->createRecordClass(Spatie\\Permission\\Models\\Role::class, $Records,['permissions','planets']);\n\n }",
"public function run()\n {\n $clients = Permission::where('name', 'like', '%clients%')->get()->toArray();\n $corporations = Permission::where('name', 'like', '%corporations%')->get()->toArray();\n $jobs = Permission::where('name', 'like', '%jobs%')->get()->toArray();\n $users = Permission::where('name', 'like', '%users%')->get()->toArray();\n $tags = Permission::where('name', 'like', '%tags%')->get()->toArray();\n\n \\tecai\\Models\\System\\Role::create([\n 'name' => 'root',\n 'display_name' => 'Super Admin',\n 'description' => 'the root account,Super Admin'\n ]);\n\n $roleAdmin = \\tecai\\Models\\System\\Role::create([\n 'name' => 'admin',\n 'display_name' => 'platform Admin',\n 'description' => 'the guy to admin the platform'\n ]);\n $this->attachPermission($roleAdmin, $clients, $corporations, $jobs, $users, $tags);\n\n\n $roleLegaler = \\tecai\\Models\\System\\Role::create([\n 'name' => 'legaler',\n 'display_name' => 'corporation-legaler',\n 'description' => 'the corporation legal person'\n ]);\n $this->attachPermission($roleLegaler, $corporations, $jobs, $users, $tags);\n\n $roleStaff = \\tecai\\Models\\System\\Role::create([\n 'name' => 'staff',\n 'display_name' => 'corporation-staff',\n 'description' => 'the corporation staff'\n ]);\n $this->attachPermission($roleStaff, $corporations, $jobs, $users, $tags);\n\n }",
"public function __construct()\n {\n $this->middleware('permission:/list_role')->only(['show', 'index']);\n # the middleware param 5 = Create, update, delete roles\n $this->middleware('permission:/create_role')->only('update');\n }",
"public function run()\n {\n AdminRole::creates(['name' => '超级管理员', 'description' => '拥有系统的全部权限']);\n AdminRole::creates(['name' => '内容管理员', 'description' => '拥有管理内容的权限']);\n }",
"public function _construct()\n {\n $this->middleware('permission:read_roles')->only(['index']);\n $this->middleware('permission:create_roles')->only(['create','store']);\n $this->middleware('permission:update_roles')->only(['edit','update']);\n $this->middleware('permission:delete_roles')->only(['destroy']);\n \n }",
"public function __construct()\n {\n $this->authorizeResource(Role::class, 'roles');\n }",
"protected function _setupPrivileges()\n {\n $this->_acl\t->allow( 'guest', 'index', 'index' )\n ->allow( 'guest', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'guest', 'register', 'index');\n\n $this->_acl\t->allow( 'user', 'index', 'index' )\n ->allow( 'user', 'auth' , array('index', 'login', 'logout') )\n ->allow( 'user', 'register', 'index')\n ->allow( 'user', 'dashboard', 'index');\n }",
"public function __construct()\n {\n $this->middleware(['permission:read_roles'])->only('index');\n $this->middleware(['permission:create_roles'])->only('create');\n $this->middleware(['permission:update_roles'])->only('edit');\n $this->middleware(['permission:delete_roles'])->only('destroy');\n }",
"public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }"
]
| [
"0.81627846",
"0.7353705",
"0.72163177",
"0.69928795",
"0.6643593",
"0.65624666",
"0.65544295",
"0.6506982",
"0.64614314",
"0.6461098",
"0.64407104",
"0.64307064",
"0.63897914",
"0.6353988",
"0.63536364",
"0.63150376",
"0.6307666",
"0.62971354",
"0.62647355",
"0.6251233",
"0.6243525",
"0.6220211",
"0.61983955",
"0.61149627",
"0.6106528",
"0.60938334",
"0.60803205",
"0.6049014",
"0.60428953",
"0.60375226"
]
| 0.78103733 | 1 |
inject the Doctrine EntityManager and Social Service Provider | public function __construct(EntityManagerInterface $entityManager, SocialServiceInterface $socialService)
{
$this->entityManager = $entityManager;
$this->socialService = $socialService;
$socialService->socialAuthenticate();
$this->resultPerPage = 10;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntityManager(EntityManager $em);",
"public function setEntityManager(\\Doctrine\\ORM\\EntityManager $em);",
"public function setEntityManager(EntityManagerInterface $manager);",
"public function getEntityManager()\n{\nif (null === $this->em) {\n$this->em = $this->getServiceLocator()\n->get('doctrine.entitymanager.orm_default');\n}\nreturn $this->em;\n}",
"public function __construct(SocialManager $socialManager)\n {\n $this->socialManager = $socialManager;\n }",
"public function initDoctrine()\n {\n // initialize Doctrine\n $config = new \\Doctrine\\DBAL\\Configuration();\n $connectionParams = array(\n 'dbname' => self::$config_array['DB_NAME'],\n 'user' => self::$config_array['DB_USERNAME'],\n 'password' => self::$config_array['DB_PASSWORD'],\n 'host' => self::$config_array['DB_HOST'],\n 'port' => self::$config_array['DB_PORT'],\n 'driver' => 'pdo_mysql',\n );\n define('CMS_TABLE_PREFIX', self::$config_array['TABLE_PREFIX']);\n\n $this->app['db'] = $this->app->share(function() use($connectionParams, $config) {\n return \\Doctrine\\DBAL\\DriverManager::getConnection($connectionParams, $config);\n });\n $this->app['monolog']->addInfo(\"Doctrine initialized\",\n array('method' => __METHOD__, 'line' => __LINE__));\n }",
"public function __construct($em)\n{\n $this->em = $em;\n}",
"public function __construct()\n {\n require_once APPPATH . 'config/database.php';\n\n include_once APPPATH . 'third_party/Doctrine/vendor/autoload.php';\n\n // load the entities\n $entityClassLoader = new ClassLoader('Entity', APPPATH . 'models');\n $entityClassLoader->register();\n // load the proxy entities\n $proxiesClassLoader = new ClassLoader('Proxies', APPPATH . 'models');\n $proxiesClassLoader->register();\n\n // Set up the configuration\n $config = new Configuration;\n\n // Set up caches\n if (ENVIRONMENT == 'development') // set environment in index.php\n // set up simple array caching for development mode\n $cacheDriver = new \\Doctrine\\Common\\Cache\\ArrayCache;\n else {\n // set up caching with APC for production mode\n $redis = new Redis();\n $redis->connect('redis_host', 'redis_port');\n $cacheDriver = new \\Doctrine\\Common\\Cache\\RedisCache();\n $cacheDriver->setRedis($redis);\n }\n $config->setMetadataCacheImpl($cacheDriver);\n $config->setQueryCacheImpl($cacheDriver);\n\n $driverImpl = $config->newDefaultAnnotationDriver(APPPATH . 'models/Entity');\n $config->setMetadataDriverImpl($driverImpl);\n\n // Proxy configuration\n $config->setProxyDir(APPPATH . '/models/Proxies');\n $config->setProxyNamespace('Proxies');\n\n // Set up logger\n if (ENVIRONMENT == 'development') {\n $logger = new \\Doctrine\\DBAL\\Logging\\EchoSQLLogger();\n $config->setSQLLogger($logger);\n }\n\n\n $config->setAutoGenerateProxyClasses(true); // only for development\n\n\n $connectionOptions = array(\n 'driver' => 'pdo_mysql',\n 'user' => $db['default']['username'],\n 'password' => $db['default']['password'],\n 'host' => $db['default']['hostname'],\n 'dbname' => $db['default']['database'],\n 'charset' => $db['default']['char_set'],\n 'driverOptions' => array(\n 'charset' => $db['default']['char_set'],\n ),\n );\n $this->em = EntityManager::create($connectionOptions, $config);\n// $connection_options = array(\n// 'driver' => 'pdo_mysql',\n// 'user' => $db['default']['username'],\n// 'password' => $db['default']['password'],\n// 'host' => $db['default']['hostname'],\n// 'dbname' => $db['default']['database'],\n// 'charset' => $db['default']['char_set'],\n// 'driverOptions' => array(\n// 'charset' => $db['default']['char_set'],\n// ),\n// );\n//\n// // With this configuration, your model files need to be in application/models/Entity\n// // e.g. Creating a new Entity\\User loads the class from application/models/Entity/User.php\n// $models_namespace = 'Entity';\n// $models_path = APPPATH . 'models';\n// $proxies_dir = APPPATH . 'models/Proxies';\n// $metadata_paths = array(APPPATH . 'models/Entity');\n//\n// // Set $dev_mode to TRUE to disable caching while you develop\n// $dev_mode = true;\n//\n// // If you want to use a different metadata driver, change createAnnotationMetadataConfiguration\n// // to createXMLMetadataConfiguration or createYAMLMetadataConfiguration.\n// $config = Setup::createAnnotationMetadataConfiguration($metadata_paths, $dev_mode, $proxies_dir);\n// $this->em = EntityManager::create($connection_options, $config);\n//\n// $loader = new ClassLoader($models_namespace, $models_path);\n// $loader->register();\n }",
"public function getEntityManager();",
"public function init()\n {\n $registry = Zend_Registry::getInstance();\n $this->em = $registry->entitymanager;\n \n \n }",
"public function _initDoctrine() {\n require_once 'Doctrine.php';\n\n //Get a Zend Autoloader instance\n $loader = Zend_Loader_Autoloader::getInstance();\n\n //Autoload all the Doctrine files\n $loader->pushAutoloader(array('Doctrine', 'autoload'));\n\n //Get the Doctrine settings from application.ini\n $doctrineConfig = $this->getOption('doctrine');\n\n //Get a Doctrine Manager instance so we can set some settings\n $manager = Doctrine_Manager::getInstance();\n\n //set models to be autoloaded and not included (Doctrine_Core::MODEL_LOADING_AGGRESSIVE)\n $manager->setAttribute(\n Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);\n\n //enable ModelTable classes to be loaded automatically\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true\n );\n\n //enable validation on save()\n $manager->setAttribute(\n Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL\n );\n\n //enable sql callbacks to make SoftDelete and other behaviours work transparently\n $manager->setAttribute(\n Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true\n );\n\n //not entirely sure what this does :)\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true\n );\n\n //enable automatic queries resource freeing\n $manager->setAttribute(\n Doctrine_Core::ATTR_AUTO_FREE_QUERY_OBJECTS, true\n );\n\n //connect to database\n $manager->openConnection($doctrineConfig['connection_string']);\n\n //set to utf8\n $manager->connection()->setCharset('utf8');\n\n return $manager;\n }",
"public function __construct(EntityManager $em) {\n $this->em = $em; \n }",
"public function __construct(EntityManager $em) {\n $this->em = $em; \n }",
"private static function createEntityManager() {\n $isDevMode = true;\n $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . \"/src/entities\"), $isDevMode, null, null, false);\n // or if you prefer yaml or XML\n //$config = Setup::createXMLMetadataConfiguration(array(__DIR__.\"/config/xml\"), $isDevMode);\n //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__.\"/config/yaml\"), $isDevMode);\n\n // database configuration parameters\n $conn = array(\n 'driver' => 'pdo_mysql',\n 'host' => 'localhost',\n 'dbname' => 'mydb',\n 'user' => 'root',\n 'password' => 'root',\n 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',\n 'server_version' => '5.6.38',\n );\n\n // obtaining the entity manager\n self::$entityManager = EntityManager::create($conn, $config);\n }",
"function __construct() {\n $bootstrap = new Bootstrap();\n \n $this->entityManager = $bootstrap->getEntityManager();\n }",
"protected function entityManager() {\n\t\treturn $this->serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\t}",
"public function __construct(EntityManager $em)\n {\n \t$this->em = $em;\n\n }",
"public function __construct(CompetitorRepository $competitorRepository, EntityManagerInterface $em)\n {\n //$this->middleware('guest', ['except' => 'logout']);\n $this->competitorRepository = $competitorRepository;\n $this->em = $em;\n\n // middleware to require login\n\n }",
"public function initDoctrine()\n {\n $config = new Configuration();\n $config->setProxyDir($this->runtimeDir . '/Proxies');\n $config->setProxyNamespace('Proxies');\n $config->setHydratorDir($this->runtimeDir . '/Hydrators');\n $config->setHydratorNamespace('Hydrators');\n $config->setDefaultDB($this->dbname);\n $config->setMetadataDriverImpl(\n AnnotationDriver::create($this->documentsDir . '/documents')\n );\n\n AnnotationDriver::registerAnnotationClasses();\n\n $this->documentManager = DocumentManager::create(new Connection($this->dsn), $config);\n }",
"public function __construct(EntityManager $entityManager)\n\t{\n $this->entityManager = $entityManager;\n }",
"public function __construct(\n EntityManager $em\n ) {\n $this->em = $em;\n }",
"public function register()\n {\n $this->container->share(ORM\\EntityManager::class, function () {\n $environment = $this->container->get(Environment::class);\n\n $entityDirectory = __DIR__ . '/../Entities';\n $proxyDirectory = __DIR__ . '/../proxies/';\n\n $cache = ($environment->isTesting())\n ? new Common\\Cache\\ArrayCache()\n : new Common\\Cache\\ApcuCache();\n\n $config = new ORM\\Configuration();\n $annotationDriver = $config->newDefaultAnnotationDriver($entityDirectory, false);\n $config->setMetadataDriverImpl($annotationDriver);\n $config->setQueryCacheImpl($cache);\n $config->setMetadataCacheImpl($cache);\n $config->setProxyDir($proxyDirectory);\n $config->setProxyNamespace('HelpMeAbstract\\Proxies');\n\n if ($environment->isProduction()) {\n $config->setAutoGenerateProxyClasses(Common\\Proxy\\AbstractProxyFactory::AUTOGENERATE_NEVER);\n } else {\n $config->setAutoGenerateProxyClasses(Common\\Proxy\\AbstractProxyFactory::AUTOGENERATE_ALWAYS);\n }\n\n $dbParams = [\n 'driver' => 'mysqli',\n 'user' => getenv('MYSQL_USER'),\n 'password' => getenv('MYSQL_PASSWORD'),\n 'host' => 'db',\n 'dbname' => 'helpmeabstract', ];\n\n return ORM\\EntityManager::create($dbParams, $config);\n });\n }",
"public function registerDoctrineHandler()\n\t{\n\t\t$this->app->singleton('pagination.handler.doctrine', function($app) {\n\t\t\treturn new Doctrine;\n\t\t});\n\t}",
"public function injectDoctrine() {\n $options = $this->getOptions();\n\n // prior to version 1.2.3\n $path = 'Doctrine.php';\n $path_compiled = 'Doctrine.compiled.php';\n\n if(isset($options['library']['version']) && version_compare($options['library']['version'], '1.2.3', '>=')) {\n $path = 'Doctrine.php';\n $path_compiled = 'Doctrine.compiled.php';\n }\n\n // compiled version doesn't work for CLI\n if(isset($options['library']['compiled']) && (bool) $options['library']['compiled'] === true && PHP_SAPI !== 'cli') {\n if(!(@include_once $path_compiled)) {\n require_once $path;\n }\n }\n else {\n require_once $path;\n }\n }",
"function __construct($em)\n {\n $this->em = $em;\n }",
"public function __construct(EntityManagerInterface $entity_manager) {\n $this->entityManager = $entity_manager;\n }",
"public function __construct(EntityManagerInterface $entity_manager) {\n $this->entityManager = $entity_manager;\n }",
"public function init()\n {\n parent::init();\n $this->initDoctrine();\n }",
"public function getEntityManager($emName = null);",
"public function load(ObjectManager $em)\n {\n\n /* LDAP */\n $ldapHost = new Config();\n $ldapHost->setNameParameter('ldap_host');\n $ldapHost->setValue('');\n $em->persist($ldapHost);\n\n $ldapPort = new Config();\n $ldapPort->setNameParameter('ldap_port');\n $ldapPort->setValue('389');\n $em->persist($ldapPort);\n\n $ldapUserDn = new Config();\n $ldapUserDn->setNameParameter('ldap_user_dn');\n $ldapUserDn->setValue('ou=People,dc=example,dc=com');\n $em->persist($ldapUserDn);\n\n $ldapUserFilter = new Config();\n $ldapUserFilter->setNameParameter('ldap_user_filter');\n $ldapUserFilter->setValue('(objectClass=posixAccount)');\n $em->persist($ldapUserFilter);\n\n $ldapUsernameAttribute = new Config();\n $ldapUsernameAttribute->setNameParameter('ldap_username_attribute');\n $ldapUsernameAttribute->setValue('cn');\n $em->persist($ldapUsernameAttribute);\n\n $ldapMailAttribute = new Config();\n $ldapMailAttribute->setNameParameter('ldap_mail_attribute');\n $ldapMailAttribute->setValue('mail');\n $em->persist($ldapMailAttribute);\n\n $ldapUser = new Config();\n $ldapUser->setNameParameter('ldap_user');\n $ldapUser->setValue('uid=admin,dc=example,dc=com');\n $em->persist($ldapUser);\n\n $ldapPass = new Config();\n $ldapPass->setNameParameter('ldap_pass');\n $ldapPass->setValue('XXXXXXXX');\n $em->persist($ldapPass);\n\n $ldapPasswordAttribute = new Config();\n $ldapPasswordAttribute->setNameParameter('ldap_password_attribute');\n $ldapPasswordAttribute->setValue('userpassword');\n $em->persist($ldapPasswordAttribute);\n\n $ldapFirstNameAttribute = new Config();\n $ldapFirstNameAttribute->setNameParameter('ldap_firstname_attribute');\n $ldapFirstNameAttribute->setValue('givenname');\n $em->persist($ldapFirstNameAttribute);\n\n $ldapLastNameAttribute = new Config();\n $ldapLastNameAttribute->setNameParameter('ldap_lastname_attribute');\n $ldapLastNameAttribute->setValue('sn');\n $em->persist($ldapLastNameAttribute);\n\n /* DESIGN CONFIG */\n $designBackgroundAttribute = new Config();\n $designBackgroundAttribute->setNameParameter('design_background');\n $designBackgroundAttribute->setValue('#1E7475');\n $em->persist($designBackgroundAttribute);\n\n $designTextAttribute = new Config();\n $designTextAttribute->setNameParameter('design_text');\n $designTextAttribute->setValue('#1E7475');\n $em->persist($designTextAttribute);\n\n $designTitleAttribute = new Config();\n $designTitleAttribute->setNameParameter('design_title');\n $designTitleAttribute->setValue('#FFFFFF');\n $em->persist($designTitleAttribute);\n\n $designBackgroundTextAttribute = new Config();\n $designBackgroundTextAttribute->setNameParameter('design_background_text');\n $designBackgroundTextAttribute->setValue('#B8D3D3');\n $em->persist($designBackgroundTextAttribute);\n\n $designTableAttribute = new Config();\n $designTableAttribute->setNameParameter('design_table');\n $designTableAttribute->setValue('#45B1B3');\n $em->persist($designTableAttribute);\n\n $designHoverAttribute = new Config();\n $designHoverAttribute->setNameParameter('design_hover');\n $designHoverAttribute->setValue('#83B2B3');\n $em->persist($designHoverAttribute);\n\n $designLogoAttribute = new Config();\n $designLogoAttribute->setNameParameter('design_logo');\n $designLogoAttribute->setValue('/bundles/imrimlms/images/logo-esial.png');\n $em->persist($designLogoAttribute);\n\n /* DESIGN CONFIG DEFAULT */\n $designBackgroundDefaultAttribute = new Config();\n $designBackgroundDefaultAttribute->setNameParameter('design_background_default');\n $designBackgroundDefaultAttribute->setValue('#1E7475');\n $em->persist($designBackgroundDefaultAttribute);\n\n $designTextDefaultAttribute = new Config();\n $designTextDefaultAttribute->setNameParameter('design_text_default');\n $designTextDefaultAttribute->setValue('#1E7475');\n $em->persist($designTextDefaultAttribute);\n\n $designTitleDefaultAttribute = new Config();\n $designTitleDefaultAttribute->setNameParameter('design_title_default');\n $designTitleDefaultAttribute->setValue('#FFFFFF');\n $em->persist($designTitleDefaultAttribute);\n\n $designBackgroundTextDefaultAttribute = new Config();\n $designBackgroundTextDefaultAttribute->setNameParameter('design_background_text_default');\n $designBackgroundTextDefaultAttribute->setValue('#B8D3D3');\n $em->persist($designBackgroundTextDefaultAttribute);\n\n $designTableDefaultAttribute = new Config();\n $designTableDefaultAttribute->setNameParameter('design_table_default');\n $designTableDefaultAttribute->setValue('#45B1B3');\n $em->persist($designTableDefaultAttribute);\n\n $designHoverDefaultAttribute = new Config();\n $designHoverDefaultAttribute->setNameParameter('design_hover_default');\n $designHoverDefaultAttribute->setValue('#83B2B3');\n $em->persist($designHoverDefaultAttribute);\n\n $em->flush();\n }"
]
| [
"0.61683804",
"0.6098077",
"0.601724",
"0.59384906",
"0.5934995",
"0.5889194",
"0.57693416",
"0.5741861",
"0.5731008",
"0.5694273",
"0.5619626",
"0.55790097",
"0.55790097",
"0.55661637",
"0.55557626",
"0.54445666",
"0.54440165",
"0.5441862",
"0.5432687",
"0.5395664",
"0.5369611",
"0.5361809",
"0.5341702",
"0.5337166",
"0.5319095",
"0.52840704",
"0.52840704",
"0.5275243",
"0.5270167",
"0.52424306"
]
| 0.66879284 | 0 |
saveUserTimeLine fetch social messages from social provider and save into db | public function saveUserTimeLine(){
try {
$messages = $this->socialService->getSocialUserTimeline()->toArray();
} catch (ClientException $ex){
if ($ex->hasResponse()) {
throw new TwitterAuthException(Psr7\str($ex->getResponse()));
}
}
foreach($messages as $message){
$msg = new Social();
$msg->setId($message['id']);
$msg->setSocialTXT($message['social_txt']);
$msg->setUserId($message['user_id']);
$msg->setUserScreenName($message['user_screen_name']);
//create DateTime object
$created_at = new DateTime($message['created_at']);
$created_at->setTimezone(new DateTimeZone('Europe/London'));
$msg->setCreatedAt($created_at);
//create or update
$this->entityManager->merge($msg);
$this->entityManager->flush();
}
return response(json_encode(['msg'=>'ssuccess', 'code'=>200]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncTwitterTimeLine($username,$count){\n //Define response array\n $response = array(\n \"success\" => false,\n \"message\" => \"\",\n \"data\"=>array()\n );\n \n $user = User::where(\"username\",\"=\",$username)->first();\n //Checking if user exist in database\n if( !$user instanceof User){\n $response[\"message\"] = trans(\"app.user_no_exist\");\n return Response::json($response);\n }\n \n //Api rest user_timeline parameters\n $parameters = array(\n 'screen_name' => substr($user->twitter_account, 1),\n 'count' => $count\n );\n \n //Get last tweet from database for syncronization\n $last_tweet = $user->get_last_tweet();\n if( $last_tweet ){\n //Append parameter since\n $parameters['since_id'] = $last_tweet->tw_id;\n }\n \n \n //Get form Twitter API, the last tweet since local tweet saved.\n try {\n $tweets = Twitter::getUserTimeline($parameters);\n } catch (Exception $e) {\n $response[\"message\"] = $e->getMessage();\n return Response::json($response);\n }\n\n //If have new tweets, add in database\n if( count($tweets )){\n foreach($tweets as $tweet){\n $tweet_entry = new Tweet;\n $tweet_entry->tw_id = $tweet->id_str;\n $tweet_entry->tw_text = $tweet->text;\n $tweet_entry->tw_name = $tweet->user->name;\n $tweet_entry->tw_screen_name = $tweet->user->screen_name;\n $tweet_entry->tw_profile_image_url = $tweet->user->profile_image_url;\n $tweet_entry->tw_created_at = strtotime($tweet->created_at);\n $tweet_entry->user_id = $user->id;\n $tweet_entry->is_hidden = 0;\n $tweet_entry->time_created = \\time();\n $tweet_entry->save();\n \n $response[\"data\"][$tweet_entry->tw_id] = $tweet_entry->toArray();\n }\n }\n //Fix order for HTML list in view\n ksort($response[\"data\"]);\n \n //Return JSON response with new new tweet, for display\n $response[\"message\"] = trans(\"app.loaded_new_tweets\",array(\"count\"=>count($tweets )));\n $response[\"total\"] = count($tweets);\n $response[\"success\"] = true;\n return Response::json($response);\n }",
"public function save_tokens_user($data)\n {\n $this->db->insert('social_media', $data);\n }",
"function addSocial(){\n\t$request = Slim::getInstance()->request();\n\t$evaluation = $request->getBody();\n\t$social = array(\"mercury_room_id\"=>\"\", \"mercry_room_social_type\"=>\"\", \"mercury_room_social_data\"=>\"\", \"mercury_user_id\"=>\"\");\n\t\n\t// construct data object\n\tforeach (explode('&', $evaluation) as $chunk) {\n\t $social = explode(\"=\", $chunk);\n\n\t if ($param) {\n\t \t$social[$param[0]] = $param[1];\n\t }\n\t}\n\n\t$mercury_room_social_url = \"\";\n\n\t// check if the user exists\n\t$sql = \"INSERT INTO mercury_rooms_social (mercury_room_social_type, mercury_room_social_data, mercury_user_id, mercury_room_social_url) VALUES (:mercury_room_social_type, :mercury_room_social_data, :mercury_user_id, :mercury_room_social_url)\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"mercury_room_social_type\", $social[\"mercury_room_social_type\"]);\n\t\t$stmt->bindParam(\"mercury_room_social_data\", $social[\"mercury_room_social_data\"]);\n\t\t$stmt->bindParam(\"mercury_user_id\", $social[\"mercury_user_id\"]);\n\t\t$stmt->bindParam(\"mercury_room_social_url\", $social[\"mercury_room_social_url\"]);\n\t\t$stmt->execute();\n\t\t$social[\"mercury_room_id\"] = $db->lastInsertId();\n\t\t$db = null;\n\t\techo json_encode($user); \n\t} catch(PDOException $e) {\n\t\terror_log($e->getMessage(), 3, '/var/tmp/php.log');\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n\n}",
"public function twitter() {\n $user_id = $this->Session->read('Auth.User.id');\n //twitter object\n $twitter = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET);\n //if a request for process\n if (isset($_GET['type_request']) && $_GET['type_request'] === 'twitter') {\n //new user profile request\n $user_access_data = $twitter->oauth('oauth/access_token', array('oauth_token' => $_GET['oauth_token'], 'oauth_verifier' => $_GET['oauth_verifier']));\n //create user's oauth object\n $post = new TwitterOAuth($this->Twitter->CONSUMER_KEY, $this->Twitter->CONSUMER_SECRET, $user_access_data['oauth_token'], $user_access_data['oauth_token_secret']);\n //get user's profile\t\t\n $profile = $post->get(\"users/lookup\", array('user_id' => $user_access_data['user_id']));\n //Save profile\n $save['uid'] = $user_id;\n $save['tw_id'] = $profile[0]->id;\n $save['access_token'] = $user_access_data['oauth_token'];\n $save['access_token_secret'] = $user_access_data['oauth_token_secret'];\n $save['name'] = $profile[0]->name;\n $save['screeen_name'] = $profile[0]->screen_name;\n $save['followers_count'] = $profile[0]->friends_count;\n $save['followedby_count'] = $profile[0]->followers_count;\n $save['p_picture'] = $profile[0]->profile_image_url;\n $save['link'] = $profile[0]->url;\n $save['timezone'] = $profile[0]->time_zone;\n //if exists\n if ($this->Twitter->newProfile($user_id, $profile[0]->id)) {\n //Save and redirect\n if ($this->Twitter->save($save)) {\n //Redirect user added\n $this->Session->setFlash(__(\"Profile saved.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n }\n //WTF happened...\n else {\n $this->Session->setFlash(__(\"Something went wrong saving Twitter profile! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //User exists.\n // When validation fails or other local issues\n $this->Session->setFlash(__(\"User already linked! Logout from Twitter and login with a diffrent account.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //Request for approval\n // create a link\n $tokens = $twitter->oauth('oauth/request_token', array('oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //get token's\n $app_oauth_token = $tokens['oauth_token'];\n $app_oauth_token_secret = $tokens['oauth_token_secret'];\n //if successful\n //build url \t\t\n $url = $twitter->url('oauth/authorize', array('oauth_token' => $app_oauth_token, 'oauth_callback' => $this->Twitter->OAUTH_CALLBACK));\n //redirect\n $this->redirect($url);\n }\n }",
"public function addTwitterAccount()\r\n {\r\n \r\n $now = date('Y-m-d');\r\n $data = array(\r\n 'consumer_key' => $this->input->post('consumer_key'),\r\n 'consumer_secret' => $this->input->post('consumer_secret'),\r\n 'access_token' => $this->input->post('access_token'),\r\n 'access_token_secret' => $this->input->post('access_token_secret'),\r\n 'created_by' => $_SESSION['iduser'],\r\n 'name' => $this->input->post('name'),\r\n 'picture_url' => $this->input->post('picture_url'),\r\n 'banner_url' => $this->input->post('banner_url'),\r\n 'follower_count' => $this->input->post('follower_count'),\r\n 'following_count' => $this->input->post('following_count'),\r\n 'tweet_count' => $this->input->post('tweet_count'),\r\n 'screen_name' => $this->input->post('screen_name'),\r\n 'created_date' => $now,\r\n );\r\n $this->user_model->addTwAcc($data);\r\n\r\n $now = date('Y-m-d');\r\n $month = date('m');\r\n $file = array(\r\n 'activity_type' => 'Create_Account',\r\n 'activity_name' => $this->input->post('screen_name'),\r\n 'activity_date' => $now,\r\n 'month' => $month,\r\n 'user_id' => $_SESSION['iduser'],\r\n );\r\n $this->load->model('Log_model');\r\n $this->Log_model->Create_account($file);\r\n\r\n\r\n redirect('Social_account');\r\n }",
"public function saveProfile()\n {\n if ($this->validate()) {\n $user = $this->user;\n\n $graph = Yii::$container\n ->get(\\common\\components\\Graph::class, [$this->user]);\n\n if ($this->timezone) {\n $user->timezone = $this->timezone;\n }\n if ($this->expose_graph) {\n $user->expose_graph = true;\n\n // generate behaviors graph image\n $checkins_last_month = (Yii::$container->get(\\common\\interfaces\\UserBehaviorInterface::class))\n ->getCheckInBreakdown();\n\n // if they haven't done a check-in in the last month this will explode\n // because $checkins_last_month is an empty array\n if ($checkins_last_month) {\n $graph->create($checkins_last_month, true);\n }\n } else {\n $user->expose_graph = false;\n // remove behaviors graph image\n $graph->destroy();\n }\n\n if ($this->send_email) {\n $user->send_email = true;\n $user->email_category = $this->email_category;\n $user->partner_email1 = $this->partner_email1;\n $user->partner_email2 = $this->partner_email2;\n $user->partner_email3 = $this->partner_email3;\n } else {\n $user->send_email = false;\n $user->email_category = 4; // default to \"Speeding Up\"\n $user->partner_email1 = null;\n $user->partner_email2 = null;\n $user->partner_email3 = null;\n }\n $user->save();\n return $user;\n }\n\n return null;\n }",
"public function save()\n {\n\n // Doesn't exist yet -- Insert it\n if( $this->id == -1 )\n {\n $sql = 'INSERT INTO messages (recipient, sender, annotation)\n VALUES (?, ?, ?);';\n $params = array( $this->recipient, $this->sender, $this->annotation );\n $query = $this->db->query( $sql, $params );\n }\n\n // Already exists -- Update it\n else \n {\n $sql = 'UPDATE messages\n SET recipient = ?, sender = ?, annotation = ?\n WHERE id = ?';\n $params = array( $this->id, $this->recipient->id, $this->sender->id, $this->annotation->id );\n $query = $this->db->query( $sql, $params );\n }\n }",
"protected function saveData($data) {\n\t\t$msg = '';\n\t\t$dtype = $data->dtype;\n\t\t$token = md5(time()); \n\t\tif($dtype=='email'){\n\t\t\t$email \t\t= $data->email;\n\t\t\t$password \t= $data->password;\n\t\t\t$username \t= $data->username;\n\t\t\t$user_id\t= $this->app_model->getUserIdByUsername($username);\n\t\t\tif($user_id) {\n\t\t\t\t$this->falseResponse(\"Username already exists.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t$user_email\t= $this->app_model->getUserEmailByEmail($email);\n\t\t\tif($user_email) {\n\t\t\t\t$this->falseResponse(\"Email already exists.\");\n\t\t\t} else {\n\t\t\t\t$data = array(\n\t\t\t\t\t'email' \t\t=> $email,\n\t\t\t\t\t'password' \t\t=> md5($password),\n\t\t\t\t\t'username' \t\t=> $username, \n\t\t\t\t\t'fb_tw_id'\t\t=> '',\n\t\t\t\t\t'creation_date' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'session_token' => $token,\n\t\t\t\t\t'dtype' \t\t=> $dtype,\n\t\t\t\t\t'is_logged_in' \t=> '1',\n\t\t\t\t\t'user_from' \t=> 'app'\n\t\t\t\t);\n\t\t\t\t$result = $this->db->insert('users', $data);\n\t\t\t\t$last_inserted_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($last_inserted_id)) { \n\t\t\t\t\t$userData\t= $this->app_model->getUserAllDataById($last_inserted_id);\n\t\t\t\t\tif($userData) {\n\t\t\t\t\t\t$id \t\t\t= $userData['id'];\n\t\t\t\t\t\t$email \t\t\t= $userData['email'];\n\t\t\t\t\t\t$fb_tw_id\t\t= '';\n\t\t\t\t\t\t$session_token \t= $userData['session_token'];\n\t\t\t\t\t\t$username \t\t= $userData['username'];\n\t\t\t\t\t\t$dtype \t\t\t= $userData['dtype'];\n\t\t\t\t\t\t$is_logged_in \t= $userData['is_logged_in'];\n\t\t\t\t\t\t$data1\t\t\t= array('user_id' => $id, 'session_token' => $session_token, 'username' => $username, 'dtype' => $dtype, 'is_logged_in' => $is_logged_in, 'fb_tw_id' => $fb_tw_id, 'email' => $email);\n\t\t\t\t\t\t$this->trueResponse($data1,'success'); \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->falseResponse(\"No response\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($dtype=='fb' || $dtype=='tw'){ die('you are here');\n\t\t\t$fb_tw_id \t= $data->fb_tw_id;//check\n\t\t\t$username \t= $data->username;\n\t\t\t$sql \t\t= \"select id as user_id from users where fb_tw_id='$fb_tw_id' AND dtype='$dtype'\";\n\t\t\t$query \t\t= $this->db->query($sql);\n\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t$userData \t\t= $query->_fetch_object();\n\t\t\t\t$this->falseResponse(\"User Already exists\", $userData);\n\t\t\t} else {\n\t\t\t\t$data = array(\n\t\t\t\t\t'email' \t\t=> '',\n\t\t\t\t\t'password'\t\t=> '',\n\t\t\t\t\t'username' \t\t=> $username, \n\t\t\t\t\t'fb_tw_id'\t\t=> $fb_tw_id, \n\t\t\t\t\t'creation_date'\t=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'session_token' => $token,\n\t\t\t\t\t'dtype' \t\t=> $dtype,\n\t\t\t\t\t'is_logged_in' \t=> '1',\n\t\t\t\t\t'user_from' \t=> 'app'\n\t\t\t\t);\n\t\t\t\t$result\t\t\t\t= $this->db->insert('users', $data);\n\t\t\t\t$last_inserted_id \t= $this->db->insert_id();\n\t\t\t\tif(!empty($last_inserted_id)) {\n\t\t\t\t\t$sql = \"select * from users where id='$last_inserted_id'\";\n\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t\t\t$userData \t\t= $query->_fetch_object();\n\t\t\t\t\t\t$id \t\t\t= $userData->id;\n\t\t\t\t\t\t$fb_tw_id \t\t= $userData->fb_tw_id;\n\t\t\t\t\t\t$email \t\t\t= '';//$userData->email;\n\t\t\t\t\t\t$session_token \t= $userData->session_token;\n\t\t\t\t\t\t$username \t\t= $userData->username;\n\t\t\t\t\t\t$dtype \t\t\t= $userData->dtype;\n\t\t\t\t\t\t$is_logged_in \t= $userData->is_logged_in;\n\t\t\t\t\t\t$data1\t\t\t= array('user_id' => $id, 'session_token' => $session_token, 'username' => $username, 'dtype' => $dtype, 'is_logged_in' => $is_logged_in, 'fb_tw_id' => $fb_tw_id, 'email' => $email);\n\t\t\t\t\t\t$this->trueResponse($data1,'success'); \n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->falseResponse(\"No response\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"function slDataSave($lrdata = array())\n{\n\t$module = new sociallogin();\n\t$context = Context::getContext();\n\t$cookie = $context->cookie;\n\t$provider_id = pSQL($lrdata['id']);\n\t$provider_name = pSQL($lrdata['provider']);\n\tif (!Context:: getContext()->customer->isLogged())\n\t{\n\t\t$email = pSQL($lrdata['email']);\n\t\t$query = 'SELECT c.id_customer from '._DB_PREFIX_.'customer AS c INNER JOIN '._DB_PREFIX_.'sociallogin AS sl ON sl.id_customer=c.id_customer\n\t\tWHERE c.email=\"'.pSQL($email).'\"';\n\t\t$query = Db::getInstance()->ExecuteS($query);\n\t\tif (!empty($query['0']['id_customer']))\n\t\t{\n\t\t\t$error_message = Configuration::get('ERROR_MESSAGE');\n\t\t\t$error_msg = \"<p style ='color:red;'>\".$error_message.'</p><p\n\t\t\t\t\t\t\t\tstyle=\"color: red;margin-bottom: -10px; font-size: 10px;\">Email-adddress has already used.</p>';\n\t\t\t$lrdata['email'] = '';\n\t\t\tpopUpWindow($error_msg, $lrdata);\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cookie->login_radius_data = '';\n\t\t\t$cookie->sl_hidden = '';\n\t\t\t$query1 = 'SELECT * FROM '._DB_PREFIX_.\"customer WHERE email='\".pSQL($email).\"'\";\n\t\t\t$query1 = Db::getInstance()->ExecuteS($query1);\n\t\t\t$num = (!empty($query1['0']['id_customer']) ? $query1['0']['id_customer'] : '');\n\t\t\tif (!empty($num))\n\t\t\t{\n\t\t\t\t$rand = pSQL(slRandomChar());\n\t\t\t\t$tbl = pSQL(_DB_PREFIX_.'sociallogin');\n\t\t\t\t$query = \"INSERT into $tbl (`id_customer`,`provider_id`,`Provider_name`,`rand`,`verified`)\n\t\t\t\tvalues ('\".$num.\"','\".pSQL($provider_id).\"','\".pSQL($provider_name).\"','\".pSQL($rand).\"','0') \";\n\t\t\t\tDb::getInstance()->Execute($query);\n\t\t\t\t$sub = $module->l('Verify your email id. ', 'sociallogin_functions');\n\t\t\t\t$protocol_content = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';\n\t\t\t\t$link = $protocol_content.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.\"?SL_VERIFY_EMAIL=$rand&SL_PID=$provider_id\";\n\t\t\t\t$msg = $module->l('Please click on the following link or paste it in browser to verify your email: ', 'sociallogin_functions').$link;\n\t\t\t\t$sub = $module->l('Verify your email id.', 'sociallogin_functions');\n\t\t\t\tslEmail($email, $sub, $msg, $provider_id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$rand = pSQL(slRandomChar());\n\t\t\t\tstoreAndLogin($lrdata, $rand);\n\t\t\t}\n\t\t}\n\t}\n}",
"function saveFeed()\n {\n // And subscribe the current user to the local profile\n $user = common_current_user();\n $local = $this->oprofile->localProfile();\n if ($user->isSubscribed($local)) {\n // TRANS: OStatus remote subscription dialog error.\n $this->showForm(_m('Already subscribed!'));\n } elseif (Subscription::start($user, $local)) {\n $this->success();\n } else {\n // TRANS: OStatus remote subscription dialog error.\n $this->showForm(_m('Remote subscription failed!'));\n }\n }",
"public function createUserFromSocialite($user);",
"public function handleSocialCallback($social)\n {\n\n try {\n\n // get user token\n $user = Socialite::driver($social)->user();\n //dd($user);\n\n $log = new Logger('stderr');\n $stream = new StreamHandler('php://stderr', Logger::WARNING);\n $stream->setFormatter(new JsonFormatter());\n $log->pushHandler($stream);\n // add records to the log\n $log->warning('this is the user',['user'=>$user]);\n // $log->error($user);\n\n // check exist user in database\n $finduser = User::where('email', $user->getEmail())->first();\n\n if($finduser){\n // login if user exist and redirect to homepage\n Auth::login($finduser);\n\n return view('home');\n\n }else{\n // if not exist make create and login with new user and redirect to homepage\n $newUser = User::create([\n 'name' => $user->name,\n 'email' => $user->email,\n //'github_id'=> $user->id,\n 'password' => encrypt('ahmed123456a')\n ]);\n\n Auth::login($newUser);\n\n return view('home');\n }\n // if take exception example after login make drop tables return this exception not user found\n\n } catch (Exception $e) {\n\n\n dd($e->getMessage() . \"Not User Found\");\n }\n\n\n\n }",
"function save()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_save_start');\n\n $message=$this->get_input_vals();\n\n // create conversation or get\n \tif (0==$message['cid'] &&\n is_numeric($message['uid']))\n \t{\n $this->load->model('node_model');\n\n $other_user=$this->node_model->get_node($message['uid']);\n\n \t\t// create new conversation\n $users=array(\n 0=>$this->user,\n 1=>$other_user\n );\n \t\t\t$message['cid']=$this->conversation_model->create_conversation($users,$this->user);\n \t}\n\n // save the message\n \t$participants=$this->conversation_model->get_conversation_users($message['cid']);\n\n \t$this->message_model->save_message($this->user,$message['message'],$message['cid'],$participants);\n\n // get a new message panel for appending to the message stream\n $data['m']=$this->message_model->get_latest_message($this->user,array('conversation_id'=>$message['cid']));\n $data['user']=$this->user;\n \t$message_panel=$this->load->view(\"template/node/message\",$data,true);\n\n /* BENCHMARK */ $this->benchmark->mark('func_save_end');\n\n // success\n \texit(json_encode($message_panel));\n }",
"function saveUserDataToDB(){\n\t\n\t\trequire(realpath(dirname(__FILE__) . \"/../config.php\"));\t\t\n\t\t\t$servername = $config[\"db\"][\"fanbot\"][\"host\"];\n\t\t\t$username = $config[\"db\"][\"fanbot\"][\"username\"];\n\t\t\t$password = $config[\"db\"][\"fanbot\"][\"password\"];\n\t\t\t$dbname = $config[\"db\"][\"fanbot\"][\"dbname\"];\n\n\n\t\t\t\t// Create connection\n\t\t\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t\t\t\t// Check connection\n\t\t\t\tif ($conn->connect_error) {\n\t\t\t\t die(\"Connection failed: \" . $conn->connect_error);\n\t\t\t\t} \n\t\t\t\t\n\t\t$sql = \"SELECT * FROM users WHERE fbID = '\". $_SESSION['fbUser']['id']. \"'\";\n\t\t$result = $conn->query($sql);\n\t\t\n\t\tif ($result->num_rows > 0) {\t\t \n\t\t\t\t$sql = \"UPDATE users\n\t\t\t\t\t\t\tSET friends='\". $_SESSION['fbUser']['friends'] .\"'\n\t\t\t\t\t\t\tWHERE fbID = '\". $_SESSION['fbUser']['id']. \"'\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO users (fbID, fbName, firstName, lastName, email, gender, friends) \n\t\t\t\t\t\t\tVALUES ( '\". $_SESSION['fbUser']['id']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['name']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['firstName']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['lastName']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['email'] .\"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['gender'].\"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['friends'].\"')\";\n\t\t\t\t\n\t\t\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t\t} else {\n\t\t\t\t echo \"Error\";\n\t\t\t\t}\n\t\t}\n\t\t\t\t$conn->close();\n\t\t}",
"public function handleProviderCallback()\n {\n\n try {\n $facebook_user = Socialite::driver('facebook')\n ->fields([\n 'name',\n 'first_name',\n 'last_name',\n 'email',\n 'verified',\n \"id\"\n ])->user();\n } catch (Exception $e) {\n return Redirect::route(\"client::pages.index\")->withErrors([\"Servicio temporalmente no disponible\"]);\n }\n\n if (!filter_var( $facebook_user->getEmail() , FILTER_VALIDATE_EMAIL)) {\n return Socialite::driver('facebook')->reRequest()->redirect();\n }\n\n $local_users = User::withTrashed()\n\t\t\t->where([\"email\" => $facebook_user->getEmail()])\n\t\t\t->orWhere([\"facebook_id\" => $facebook_user->getId()])\n\t\t\t->get();\n\n switch ($local_users->count()) {\n case 0:\n\n $data = [\n \"name\" => User::createUniqueUsername( $facebook_user->getName() , \"\" ),\n \"active\" => true,\n 'email' => $facebook_user->getEmail(),\n 'first_name' => isset($facebook_user->user[\"first_name\"]) ? $facebook_user->user[\"first_name\"] : \"\",\n 'last_name' => isset($facebook_user->user[\"last_name\"]) ? $facebook_user->user[\"last_name\"] : \"\",\n 'password' => User::setRandomPassword(),\n 'facebook_id' => $facebook_user->getId(),\n ];\n\n $local_user = User::CltvoCreate($data);\n\n break;\n case 1:\n\n $local_user = $local_users->first();\n\n if ($local_user->facebook_id != $facebook_user->getId()) {\n $local_user->facebook_id = $facebook_user->getId();\n $local_user->save();\n }\n\n break;\n default:\n $local_user = $local_users->where(\"facebook_id\" , $facebook_user->getId())->first();\n break;\n }\n\n\n if ($local_user) {\n foreach ($this->cookie_bags as $bag_key) {\n $bag_user = BagUser::where([\"user_id\"=> null])->with(\"bag\")->whereHas(\"bag\",function($q) use ($bag_key) {\n return $q->ByKey($bag_key)->Actives();\n })->first();\n if ($bag_user) {\n $bag_user->user_id = $local_user->id;\n $bag_user->save();\n }\n }\n }\n\n\t\tif ($local_user->trashed()) {\n\t\t\treturn Redirect::back()->withErrors([\n 'active' => \"La cuenta a sido desactivada\"\n ]);;\n\t\t}\n\t\tif( !$local_user->isActive() ){\n\t\t\treturn Redirect::back()->withErrors([\n\t\t\t\t'active' => \"te enviamos un correo para activar tu cuenta\"\n\t\t\t]);\n\t\t}\n\n Auth::login($local_user);\n return Redirect::to($this->redirectPath());\n }",
"private function saveData(): void\n {\n $this->tab_chat_call->call_update = gmdate(\"Y-m-d H:i:s\"); //data e hora UTC\n $result = $this->tab_chat_call->save();\n\n if ($result) {\n $this->Result = true;\n $this->Error = [];\n $this->Error['msg'] = \"Sucesso!\";\n $this->Error['data']['call'] = $this->tab_chat_call->call_id;\n } else {\n $this->Result = false;\n $this->Error = [];\n $this->Error['msg'] = $this->tab_chat_call->fail()->getMessage();\n $this->Error['data'] = null;\n }\n }",
"function saveMsgSent($profile_id, $msg, $conv, $msg_id, $date, $template=0, $watson_msg=0, $context=null, $account){\n\t\tglobal $db;\n\t\t$date = gettype($date)=='string'?$date:date('Y-m-d G:i:s', $date);\n\t\t$statement = $db->prepare('INSERT INTO msg_conversation (by_bot, profile_id, conv_id, msg_id, template_msg, msg, watson_msg, is_read, watson_context, date, accountID) VALUES (1, :profile_id, :conv, :msg_id, :template, :msg, :watson_msg, :read, :context, :date, :account)');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':conv' => $conv, ':msg_id' => $msg_id, ':template'=>$template, ':msg' => $msg, ':watson_msg'=>$watson_msg, ':read'=>true, ':context'=>$context, ':date'=>$date, ':account'=>$account));\n\t}",
"public static function getEntriesByTimeline() {\n\t\t\t\t$sql = rex_sql::factory();\n\t\t\t\t$timelines = $sql->getArray('SELECT `user_id`/*, `twitter_next_id`*/ FROM `'.rex::getTablePrefix().'socialhub_twitter_timeline`');\n\t\t\t\tunset($sql);\n\t\t\t\t\n\t\t\t\tif (empty($timelines)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t//End - get all timelines from the database\n\t\t\t\n\t\t\t//Start - get all accounts from the database\n\t\t\t\t$sql = rex_sql::factory();\n\t\t\t\t$accounts = $sql->getArray('SELECT * FROM `'.rex::getTablePrefix().'socialhub_twitter_account` ORDER BY `id` ASC');\n\t\t\t\tunset($sql);\n\t\t\t\t\n\t\t\t\tif (empty($accounts)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t//End - get all accounts from the database\n\t\t\t\n\t\t\t//Start - get entries by timeline from twitter\n\t\t\t\tforeach ($timelines as $timeline) {\n\t\t\t\t\t$connection = new Abraham\\TwitterOAuth\\TwitterOAuth($accounts[0]['consumer_token'], $accounts[0]['consumer_secret_token'], $accounts[0]['access_token'], $accounts[0]['secret_token']);\n\t\t\t\t\t$response = $connection->get(\"statuses/user_timeline\",['user_id'=>$timeline['user_id']]); //todo: add since_id\n\t\t\t\t\t\n\t\t\t\t\tforeach ($response as $r) {\n\t\t\t\t\t\tif (empty($r->in_reply_to_status_id)) {\n\t\t\t\t\t\t\t$sql = rex_sql::factory();\n\t\t\t\t\t\t\t$sql->setTable(rex::getTablePrefix().'socialhub_entry_timeline');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$sql->setValue('source', 'twitter');\n\t\t\t\t\t\t\t$sql->setValue('post_id', $r->id_str);\n\t\t\t\t\t\t\t$sql->setValue('message', $r->text);\n\t\t\t\t\t\t\t$sql->setValue('author_id', $r->user->id);\n\t\t\t\t\t\t\t$sql->setValue('author_name', $r->user->screen_name);\n\t\t\t\t\t\t\t$sql->setValue('created_time', date('Y-m-d H:i:s', strtotime($r->created_at)));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$sql->insert();\n\t\t\t\t\t\t\t} catch (rex_sql_exception $e) {\n\t\t\t\t\t\t\t\techo rex_view::warning($e->getMessage());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tunset($sql);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//End - get entries by timeline from twitter\n\t\t}",
"public function handleFacebookCallback()\n {\n \t$user = Socialite::driver('facebook')->user();\n \t$user_details=$user->user; \n \tif(User::where('fb_id',$user_details['id'])->exists()){\n \t\t$fbloged_user=User::where('fb_id',$user_details['id'])->get();\n \t\t$fbloged_user=$fbloged_user[0]; \t\n \t\t$user_login = Sentinel::findById($fbloged_user->id);\n \t\tSentinel::login($user_login);\n \t\treturn redirect('/');\n \t}else{\n \t\ttry {\n \t\t\t$registed_user=DB::transaction(function () use ($user_details){\n\n \t\t\t\t$user = Sentinel::registerAndActivate([\t\t\t\t\t\t\t\t\n \t\t\t\t\t'email' =>$user_details['id'].'@fbmail.com',\n \t\t\t\t\t'username' => $user_details['name'],\n \t\t\t\t\t'password' => $user_details['id'],\n \t\t\t\t\t'fb_id' => $user_details['id']\n \t\t\t\t]);\n\n \t\t\t\tif (!$user) {\n \t\t\t\t\tthrow new TransactionException('', 100);\n \t\t\t\t}\n\n \t\t\t\t$user->makeRoot();\n\n \t\t\t\t$role = Sentinel::findRoleById(1);\n \t\t\t\t$role->users()->attach($user);\n\n \t\t\t\tUser::rebuild();\n \t\t\t\treturn $user;\n\n\n \t\t\t});\n \t\t\tSentinel::login($registed_user);\n \t\t\treturn redirect('/');\n\n \t\t} catch (TransactionException $e) {\n \t\t\tif ($e->getCode() == 100) {\n \t\t\t\tLog::info(\"Could not register user\");\n\n \t\t\t\treturn redirect('user/register')->with(['error' => true,\n \t\t\t\t\t'error.message' => \"Could not register user\",\n \t\t\t\t\t'error.title' => 'Ops!']);\n \t\t\t}\n \t\t} catch (Exception $e) {\n\n \t\t}\n \t}\n\n\n\n\n\n\n // $user->token;\n }",
"public function handleProviderCallback()\n {\n $googleApi = Socialite::driver('google')->user();\n $currentUserRp = User::where('Email', $googleApi->getEmail())->first();\n $sessionId = $this->generateRandomString(10);\n\n if( $currentUserRp )\n {\n Auth::login($currentUserRp);\n\n $currentUserRp->google_id = $googleApi->getId();\n $currentUserRp->google_lastsessionid = $sessionId;\n $currentUserRp->save();\n \n $currentGoogleUser = googleUser::find($googleApi->getId());\n $currentGameUser = gameUser::find(Auth::user()->ID);\n\n if( !$currentGoogleUser )\n {\n $addGooglerUser = googleUser::create([ \n 'gouser_id' => $googleApi->getId(),\n 'gouser_name' => $googleApi->getName(),\n 'gamuser_id' => Auth::user()->ID,\n 'gouser_nick' => Auth::user()->Nick,\n 'gouser_avatar' => $googleApi->getAvatar(),\n 'gouser_email' => $googleApi->getEmail(),\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n ]);\n }\n\n if( !$currentGameUser )\n {\n $addGameUser = gameUser::create([ \n 'gamuser_id' => Auth::user()->ID,\n 'gamuser_nick' => Auth::user()->Nick,\n ]);\n }\n\n $logGoogleLogin = googleUserLogin::create([\n 'gosession_token' => $sessionId,\n 'gouser_ip' => $_SERVER[\"HTTP_CF_CONNECTING_IP\"],\n 'gouser_id' => $googleApi->getId()\n ]);\n\n return redirect('/');\n }\n else\n {\n return redirect()->route(\"api.result\", ['result_state' => 'error', 'result_aux' => \"ERR04\"]);\n }\n\n\n\n\n /*\n $myUser = Socialite::driver('google')->user();\n $manageUser = User::where('Email', $myUser->getEmail())->first();\n\n if( !$manageUser )\n {\n // $manageUser = User::create([\n // 'name' => $myUser->getName(),\n // 'email' => $myUser->getEmail(),\n // 'google_id' => $myUser->getId(),\n // 'google_avatar' => $myUser->getAvatar(),\n // ]);\n return redirect('/unkownemail');\n }\n else {\n Auth::login($manageUser);\n\n if( Auth::user()->Certificado < env(\"AUTH_MINIMUM_CERTIFICATE\") )\n {\n return redirect('/invalidcert');\n }\n\n return redirect('/');\n }\n \n // $user->token;\n */\n }",
"public function callBack($provider)\n\t{\n\t\ttry {\n\n\t\t\t// $userSocial\t= Socialite::driver($provider)->stateless()->user();\n\t\t\t$userSocial\t= Socialite::driver($provider)->user();\n\n\t\t\t$user\t\t= User::where(['email' => $userSocial->getEmail()])->first();\n\n\t\t\tif($user){\n\n\t\t\t\tif ($user->is_active == 1) {\n\n\t\t\t\t\t// If User is active redirect to home page.\n\t\t\t\t\tAuth::guard('web')->login($user);\n\t\t\t\t\tUserInfo::where('user_id',$user->id)->update([\n\t\t\t\t\t\t$provider.'_id'\t=> $userSocial->getId(),\n\t\t\t\t\t]);\n\n\t\t\t\t\t$user->update([\n\t\t\t\t\t\t'last_login'\t\t=> Carbon::now()->toDateTimeString(),\n\t\t\t\t\t\t'last_login_type'\t=> ucfirst($provider)\n\t\t\t\t\t]);\n\t\t\t\t\treturn redirect()->route('home');\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// If User is inactive\n\t\t\t\t\treturn redirect()->route('login')\n\t\t\t\t\t->with('incorrect' , 'Your account is inactive');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$user = User::create([\n\t\t\t\t\t'first_name' \t=> $userSocial->getName(),\n\t\t\t\t\t'email' \t=> $userSocial->getEmail(),\n\t\t\t\t\t'password'\t\t\t=> '',\n\t\t\t\t\t'last_login'\t\t=> Carbon::now()->toDateTimeString(),\n\t\t\t\t\t'last_login_type'\t=> ucfirst($provider)\n\t\t\t\t]);\n\n\t\t\t\t$userInfo = [\n\t\t\t\t\t'user_id'\t\t=>\t$user->id,\n\t\t\t\t\t$provider.'_id'\t=>\t$userSocial->getId(),\n\t\t\t\t];\n\t\t\t\tUserInfo::storeUserInfo($userInfo);\n\n\t\t\t\tAuth::guard('web')->login($user);\n\t\t\t\treturn redirect()->route('home');\n\t\t\t}\n\n\t\t} catch (Exception $exception) {\n\n\t\t\t\\Log::debug($exception);\n\n\t\t\treturn redirect()->route('login')\n\t\t\t->with('incorrect' , 'Something went wrong! Please contact administrator.');\n\t\t}\n\t}",
"public function store(Request $request)\n {\n $user = new User;\n\n // var_dump(request('user_id_line'));\n \n $user->firstname = request('firstname');\n $user->lastname = request('lastname');\n $user->age = request('age');\n $user->tel_number = request('tel_number');\n $user->email = request('email');\n $user->addr = request('addr');\n $user->addr_sub_dist = request('addr_sub_dist');\n $user->addr_dist = request('addr_dist');\n $user->addr_prov = request('addr_prov');\n $user->addr_postal_code = request('addr_postal_code');\n $user->career = request('career');\n $user->edu_faculty = request('edu_faculty');\n $user->edu_major = request('edu_major');\n $user->edu_place = request('edu_place');\n $user->edu_level = request('edu_level');\n $user->save();\n $user_id_line = $request->input('user_id_line'); \n\n $httpClient = new CurlHTTPClient(LINE_MESSAGE_ACCESS_TOKEN);\n $bot = new LINEBot($httpClient, array('channelSecret' => LINE_MESSAGE_CHANNEL_SECRET));\n $Message1 = 'ลงทะเบียนเรียบร้อย';\n $textMessageBuilder = new TextMessageBuilder($Message1);\n $response = $bot->pushMessage( $user_id_line ,$textMessageBuilder);\n $response->getHTTPStatus() . ' ' . $response->getRawBody();\n\n return view('register');\n\n }",
"function saveMsgReceived($profile_id, $msg, $conv, $msg_id, $date, $template=0, $watson_context=null, $account){\n\t\tglobal $db;\n\t\t$date = gettype($date)=='string'?$date:date('Y-m-d G:i:s', $date);\n\t\t$statement = $db->prepare('INSERT INTO msg_conversation (by_bot, profile_id, conv_id, msg_id, template_msg, msg, watson_context, date, accountID) VALUES (0, :profile_id, :conv, :msg_id, :template, :msg, :watson_context, :date, :account)');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':conv' => $conv, ':msg_id' => $msg_id, ':template'=>$template, ':msg' => $msg, ':watson_context'=>$watson_context, ':date'=>$date, ':account'=>$account));\n\t}",
"public function save( $params ) {\n $query = \"INSERT INTO stat SET user = ?, answer_id=?\";\n $this->db->execute( $query, array($params['user'], $params['answer_id']) );\n\n $this->id = $this->db->getLastId();\n $this->init();\n\n }",
"function do_save_assign_user() {\r\n foreach(array(\"stream_id\",\"userid\") as $i)\r\n $$i=$this->input->post($i);\r\n \r\n $info=$this->db->query(\"select su.stream_id,su.user_id,su.access,su.created_by from m_stream_users su where su.user_id=? and su.stream_id=?\",array($userid,$stream_id))->result_array();\r\n if(count($info[0])<1) {\r\n $read=1;$st_status=1;\r\n $created_by=$user['userid'];\r\n $created_time=time();\r\n $this->db->query(\"insert into m_stream_users(stream_id,user_id,access,is_active,created_by,created_on) values(?,?,?,?,?,?)\",array($stream_id,$userid,$read,$st_status,$created_by,$created_time));\r\n }\r\n \r\n// if(isset($_POST['permissions_w'])) { \r\n// $write=2;\r\n// foreach($_POST['permissions_w'] as $userid) {\r\n// $this->db->query(\"insert into m_stream_users(stream_id,user_id,access,is_active,created_by,created_on) values(?,?,?,?,?,?)\",array($streamid,$userid,$write,$status,$created_by,$created_time));\r\n// }\r\n// }\r\n }",
"function timeline($userName = false, $page=1)\n {\n $userInfo = array(); \n if(!empty($userName)){\n $uid = $userName;\n $userInfo['timeline']['wall_user_id'] = $userName;//TIMELINE ID IS USER_ID and is double md5 ed\n } else {\n\t\t\t$uid = MD5(MD5($this->session->userdata('user_id')));\n\t\t\t$userInfo['timeline']['wall_user_id'] = MD5(MD5($this->session->userdata('user_id')));//TIMELINE ID IS USER_ID and is double md5 ed\n\t\t}\n // Login verification and user stats update \n $userInfo['logged'] =false;\n $user =null;\n $config['site_url'] =base_url();\n $config['theme_url'] ='';\n $config['script_path'] =str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] =base_url() . 'ajax/socialAjax';\n $userInfo['config'] =$config;\n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if(!isset($user) || empty($user)){\n show_404();\n }\n if (!empty($user['id']) && $user['type'] == \"user\") { \n $leftBarSide = $this->commonTimelineQry($uid);\n $userInfo['user'] = $user; \n $userInfo['logged'] = true;\n \n ### Posted Jobs ###\n $perpage = 10;\n $page = ($this->uri->segment(4)) ? $this->uri->segment(4) : 1; \n $offset = ($page - 1) * $perpage;\n $totalRecQry = $this->module->getCustomQryRow(\"SELECT COUNT(*) as numRows FROM jobs_list WHERE jobs_list.status='1' AND jobs_list.added_by='0' AND md5(md5(jobs_list.userid)) = '\".$uid.\"'\");\n $totalRecords = $totalRecQry['numRows'];\n $jobPosted = $this->jobs_model->postedJobList($offset,$perpage,$uid,'yes',true); \n \n }\n\t\t\t$userInfo['privacyArray'] = $this->model_user->getPrivacyOptions();\n\t\t\t\n $data = array(\n 'userInfo'=>$userInfo,\n 'totalRecords'=>$totalRecords,\n 'timelineJobInfo'=>$jobPosted\n );\t\t\t\t\n $data = array_merge($data,$leftBarSide);\n $this->load->view('user/timelinenew', $data); \n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()));\n }\n }",
"public function handleProviderCallback($social)\n {\n $user = Socialite::driver($social)->user();\n $userExist = $this->user->getByEmail($user->getEmail());\n\n if($userExist) {\n Auth::login($userExist);\n\n if($url = \\Session::get('redirect')) {\n \\Session::forget('redirect');\n return redirect()->to($url);\n }\n\n return redirect()->to('/');\n } else {\n if($userCreated = $this->user->createUserFromSocialite($user)) {\n\n // Upload ảnh\n $config = Config::get('image');\n $thumbs = $config['array_crop_image'];\n $resUpload = $this->image->download($user->getAvatar(), PATH_UPLOAD_USER_AVATAR, $thumbs, 'crop');\n if($resUpload['status'] > 0) {\n $userCreated->avatar = $resUpload['filename'];\n $userCreated->save();\n }\n\n Auth::login($userCreated);\n return redirect()->to('/');\n }\n }\n }",
"function saveConnectSent($profile_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('INSERT INTO connect_asked (profile_id, accountID) VALUES (:profile_id, :account)');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':account'=>$account));\n\t}",
"function timelineold($userName = false){\n $sk = array();\n $uid = $this->session->userdata('user_id');\n \n if(!empty($userName))\n {\n $uid = $userName;\n $sk['timeline']['wall_user_id'] = $userName;//TIMELINE ID IS USER_ID and is double md5 ed\n }\n // Login verification and user stats update \n \n $sk['logged'] = false;\n $user = null;\n $config['site_url'] = base_url();\n $config['theme_url'] = '';\n $config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] = base_url() . 'ajax/socialAjax';\n $sk['config'] = $config;\n $privacyArray='';\n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if(!isset($user) || empty($user)){\n show_404();\n }\n //echo '<pre>'; print_r($user); die;\n if (!empty($user['id']) && $user['type'] == \"user\") {\n $sk['user'] = $user; \n $privacyArray = $this->model_user->getPrivacyOptions();\n $sk['privacyArray'] = $privacyArray; \n $sk['logged'] = true;\n }\n $data['sk'] = $sk;\n $data['privacyArray'] = $privacyArray;\n //pr($sk); die;\n $this->load->view('user/timeline', $data); \n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()) );\n }\n }",
"function updateTWuser($oauth_request_token = '',$oauth_request_token_secret = '',$twitter_userid = '',$username='')\n\t{\n \n\t\tif($_SESSION[\"userrole\"] == 1)\n\t\t{ \n\t\t\t\t$userid = $_SESSION[\"userid\"];\n\t\t\t\t$image_path = \"http://a1.twimg.com/sticky/default_profile_images/default_profile_2_normal.png\";\n\t\t\t\t$oauth_request_token = htmlentities($oauth_request_token, ENT_QUOTES);\n\t\t\t\t$oauth_request_token_secret = htmlentities($oauth_request_token_secret, ENT_QUOTES);\n\t\t\t\t\n\t\t\t\t$check_account_exist = mysql_query(\"select * from social_account where account_user_id = '$twitter_userid' \");\n\t\t\t\t\n\t\t\t\tif(mysql_num_rows($check_account_exist) == 0)\n\t\t\t\t{\n\t\t\t\t\t$update_users_fb = mysql_query(\"insert into social_account(first_name,image_url,account_user_id,access_token,access_token_secret,userid,type)values('$username','$image_path','$twitter_userid','$oauth_request_token','$oauth_request_token_secret','$userid','2')\");\n\t\t\t\t\t$_SESSION[\"mes\"] = \"Twitter account has been added\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"emes\"] = \"Twitter account already exist\";\n\t\t\t\t}\n\t\t}\n\t\treturn;\n\n\t}"
]
| [
"0.589219",
"0.5686585",
"0.5467757",
"0.5410428",
"0.5407477",
"0.5379563",
"0.53723794",
"0.53591806",
"0.5352307",
"0.53262806",
"0.5326073",
"0.5311935",
"0.5295915",
"0.5230922",
"0.521633",
"0.51970136",
"0.5196925",
"0.5180001",
"0.5160863",
"0.5158906",
"0.5136321",
"0.5133263",
"0.51241547",
"0.51211464",
"0.5116541",
"0.510245",
"0.50764847",
"0.50701636",
"0.5067636",
"0.50640464"
]
| 0.8168409 | 0 |
TODO: Implement getUserMessagesAll() method. | public function getUserMessagesAll(User $user)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAll()\n\t{\n\t\t$msgs = Message::findByUser($this->getUser());\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}",
"public function getMessages() {}",
"public function getMessages() {}",
"public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages(){ }",
"public function showAllMessagesOfCurrentUser()\n {\n $token = substr($this->request->getHeaderLine('Authorization'),7);\n $pageNumber = (int)$this->request->getHeaderLine('Page-Number');\n $pageSize = (int)$this->request->getHeaderLine('Page-Size');\n \n if(\n $token == null or \n $pageNumber == null or \n $pageNumber < 1 or\n $pageSize == null or\n $pageSize < 1\n )\n {\n $this->logger->warning(\n \"Missing or bad data!\",\n [\n \"token\" => $token,\n \"pageNumber\" => $pageNumber,\n \"pageSize\" => $pageSize\n ]\n );\n return $this->badRequest(\"Missing or bad data!\");\n }\n\n $userHelper = new HelperUser();\n $currentUser = $userHelper -> authenticateWithToken($token);\n\n if ($currentUser == null)\n {\n $this->logger->warning(\n \"Unable to authorize user!\",\n [\n \"token\" => $token\n ]\n );\n return $this->unauthorized();\n }\n\n $messageRepository = new RepositoryMessage();\n $messages = $messageRepository->fetchMessagesOfUser(\n $currentUser,\n $pageNumber,\n $pageSize\n );\n\n return $this->responseFactory->generateResponse(\n $this->response,\n 200,\n $this->jsonFactory->generateMessagesJson($messages),\n true\n );\n }",
"function getAllMessages(){\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}",
"public function all()\r\n {\r\n return $this->messages;\r\n }",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): Collection;",
"public function getMessages(): Collection;",
"static function getMessages($application=\"all\", $userName=\"\"){\n $usr = (!$userName)? (self::getUser()) : ($userName);\n $result = Array();\n return $result;\n }",
"public function get_messages() {\n\t\t$messages = $this->_read_messages();\n\t\t$this->clear_messages();\n\t\treturn apply_filters( 'tn_get_messages', $messages );\t\n\t}",
"public function getAll()\n {\n $messageObject = new Message();\n $messagesObjects = $messageObject->getAllMessages();\n\n foreach ($messagesObjects as $messagesObject )\n {\n echo $messagesObject->getDate();\n echo \" \".$messagesObject->getName().\"<br>\\n\";\n echo $messagesObject->getMessage().\"<br>\\n<br><hr/>\";\n }\n }",
"public function getMessages()\n {\n //PEMBAHASAN MENGENAI EAGER LOADING BISA DI CARI DI DAENGWEB.ID\n return Message::with('user')->get();\n }",
"public function getAllMsg() : array\n {\n return $this->messages;\n }",
"public function messages() {\n\t\treturn $this->master->call('account/messages');\n\t}",
"public function getReceivedMessages();",
"public function all(): array\n {\n return $this->messages;\n }",
"function GetMessages()\n\t{\n\t\t$trns = LiveChat::GetSessionsHeaders(array('sid' => $this->sid));\n\t\t$trns = $trns[0];\n\t\t\n\t\t$r = $this->db->q(\"\n\t\t\tSELECT *\n\t\t\tFROM #_PREF_lc_messages messages\n\t\t\t LEFT JOIN #_PREF_lc_users users ON messages.user_id = users.user_id\n\t\t\tWHERE messages.sid = \". $this->sid .\"\n\t\t\");\n\t\t\n\t\t$chat = array();\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$chat[] = $item;\n\t\t}\n\t\t\n\t\t$trns['messages'] = $chat;\n\t\treturn $trns;\n\t}",
"function getMessages(){\r\n return $this->messages;\r\n }"
]
| [
"0.796697",
"0.7772985",
"0.7772985",
"0.7730543",
"0.7661503",
"0.7661503",
"0.7661503",
"0.7661503",
"0.7661503",
"0.7661503",
"0.7661503",
"0.74403864",
"0.73074996",
"0.7259104",
"0.7202516",
"0.7188276",
"0.7188276",
"0.7188276",
"0.71113104",
"0.71113104",
"0.7049612",
"0.70490795",
"0.7049074",
"0.7031726",
"0.69988585",
"0.69987315",
"0.69762415",
"0.69752",
"0.6952377",
"0.69353724"
]
| 0.79915184 | 0 |
TODO: Implement getUserMessagesByUsername() method. | public function getUserMessagesByUsername(User $user, string $username)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserMessages($username){\n\t\t$username = escapeQuery($username);\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\n\t\t\tWHERE U2.username = '$username'\";\n\t\t\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}",
"function getUserSentMessages($username){\n\t\t$username = escapeQuery($username);\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\n\t\t\tWHERE U1.username = '$username'\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}",
"public function getMessages() {}",
"public function getMessages() {}",
"static function getMessages($application=\"all\", $userName=\"\"){\n $usr = (!$userName)? (self::getUser()) : ($userName);\n $result = Array();\n return $result;\n }",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages(){ }",
"function listUserMessages($username) {\r\n\t\t$query = \"SELECT * FROM \".TBL_MAIL.\" WHERE UserTo = :username AND Deleted = 0 ORDER BY SentDate DESC\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':username' => $username));\r\n\t\t$dbarray = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn false; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}",
"public function showAllMessagesOfCurrentUserFromUser(string $senderUsername)\n {\n $token = substr($this->request->getHeaderLine('Authorization'),7);\n $pageNumber = (int)$this->request->getHeaderLine('Page-Number');\n $pageSize = (int)$this->request->getHeaderLine('Page-Size');\n\n if(\n $token == null or \n $pageNumber == null or \n $pageNumber < 1 or\n $pageSize == null or\n $pageSize < 1\n )\n {\n $this->logger->warning(\n \"Missing or bad data!\",\n [\n \"token\" => $token,\n \"pageNumber\" => $pageNumber,\n \"pageSize\" => $pageSize\n ]\n );\n return $this->badRequest(\"Missing or bad data!\");\n }\n\n $userHelper = new HelperUser();\n $currentUser = $userHelper -> authenticateWithToken($token);\n\n if ($currentUser == null)\n {\n $this->logger->warning(\n \"Unable to authorize user!\",\n [\n \"token\" => $token\n ]\n );\n return $this->unauthorized();\n }\n\n $senderUser = $userHelper -> authenticateWithUsername($senderUsername);\n\n if ($senderUser == null)\n {\n $this->logger->warning(\n \"Unable to authorize user!\",\n [\n \"username\" => $senderUsername\n ]\n );\n return $this->badRequest(\"Given user does not exist!\");\n }\n\n $messageRepository = new RepositoryMessage();\n $messages = $messageRepository->fetchMessagesOfUserFromUser(\n $currentUser,\n $senderUser,\n $pageNumber,\n $pageSize\n );\n\n return $this->responseFactory->generateResponse(\n $this->response,\n 200,\n $this->jsonFactory->generateMessagesJson($messages),\n true\n );\n }",
"public function getUserMessagesAll(User $user)\n {\n }",
"public function showAllMessagesOfCurrentUser()\n {\n $token = substr($this->request->getHeaderLine('Authorization'),7);\n $pageNumber = (int)$this->request->getHeaderLine('Page-Number');\n $pageSize = (int)$this->request->getHeaderLine('Page-Size');\n \n if(\n $token == null or \n $pageNumber == null or \n $pageNumber < 1 or\n $pageSize == null or\n $pageSize < 1\n )\n {\n $this->logger->warning(\n \"Missing or bad data!\",\n [\n \"token\" => $token,\n \"pageNumber\" => $pageNumber,\n \"pageSize\" => $pageSize\n ]\n );\n return $this->badRequest(\"Missing or bad data!\");\n }\n\n $userHelper = new HelperUser();\n $currentUser = $userHelper -> authenticateWithToken($token);\n\n if ($currentUser == null)\n {\n $this->logger->warning(\n \"Unable to authorize user!\",\n [\n \"token\" => $token\n ]\n );\n return $this->unauthorized();\n }\n\n $messageRepository = new RepositoryMessage();\n $messages = $messageRepository->fetchMessagesOfUser(\n $currentUser,\n $pageNumber,\n $pageSize\n );\n\n return $this->responseFactory->generateResponse(\n $this->response,\n 200,\n $this->jsonFactory->generateMessagesJson($messages),\n true\n );\n }",
"public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }",
"public function messages_for_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByFromUserID($uid, $skip, $limit);\n\n\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}",
"public function messages() {\n\t\treturn $this->master->call('account/messages');\n\t}",
"public function getMessages()\n {\n //PEMBAHASAN MENGENAI EAGER LOADING BISA DI CARI DI DAENGWEB.ID\n return Message::with('user')->get();\n }",
"public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}",
"public function findByUser() {\n try \n {\n $params = $this->app->request()->params();\n $fields = array_to_json($params);\n\n //get request url parmameters\n $offset = isset($fields->offset) ? $fields->offset : 0;\n $limit = isset($fields->limit) ? $fields->limit : 7; \n $receiver = isset($fields->receiver) ? $fields->receiver : 'none'; \n\n $messages = Message::findByUser($offset, $limit, $receiver);\n\n //return finded users\n response_json_data($messages);\n }\n catch(Exception $e) \n {\n response_json_error($this->app, 500, $e->getMessage());\n }\n }",
"function GetMessages()\n\t{\n\t\t$trns = LiveChat::GetSessionsHeaders(array('sid' => $this->sid));\n\t\t$trns = $trns[0];\n\t\t\n\t\t$r = $this->db->q(\"\n\t\t\tSELECT *\n\t\t\tFROM #_PREF_lc_messages messages\n\t\t\t LEFT JOIN #_PREF_lc_users users ON messages.user_id = users.user_id\n\t\t\tWHERE messages.sid = \". $this->sid .\"\n\t\t\");\n\t\t\n\t\t$chat = array();\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$chat[] = $item;\n\t\t}\n\t\t\n\t\t$trns['messages'] = $chat;\n\t\treturn $trns;\n\t}",
"public function getAll()\n\t{\n\t\t$msgs = Message::findByUser($this->getUser());\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): array;",
"function GetMessagesForUser($curr_user_id, $sid, $messages_from = null)\n\t{\n\t\t$where_clause = array (\n\t\t\t'#WHERE' => array (\n\t\t\t\t'messages.sid' => $sid, \n\t\t\t\t'messages.user_id' => array('!=', $curr_user_id),\n\t\t\t),\n\t\t\t'#ORDER' => 'messages.rec_time'\n\t\t);\n\t\t\n\t\t$where_clause['#WHERE']['get_status.user_id'] = null;\n\t\t\n\t\t/* old style by time if ($messages_from !== null) {\n\t\t\t$where_clause['#WHERE']['messages.rec_time'] = array('>', $messages_from);\n\t\t} */\n\t\t\n\t\t$this->db->q(\"\n\t\t\tSELECT \n\t\t\t users.user_nickname,\n\t\t\t messages.conversation_id,\n\t\t\t messages.message,\n\t\t\t messages.message_params,\n\t\t\t messages.rec_time,\n\t\t\t messages.service_command\n\t\t\tFROM #_PREF_lc_messages messages\n\t\t\t INNER JOIN #_PREF_lc_users users ON messages.user_id = users.user_id\n\t\t\t LEFT JOIN #_PREF_lc_users_messages_status get_status ON get_status.message_id = messages.message_id\n\t\t\t\", $where_clause\n\t\t);\n\n\t\t$messages = array();\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$item['message_params'] = unserialize($item['message_params']);\n\t\t\t$messages[] = $item;\n\t\t}\n\t\t\n\t\treturn $messages;\n\t}",
"function getAllMessages(){\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}"
]
| [
"0.73914415",
"0.72065824",
"0.7187663",
"0.7187663",
"0.711694",
"0.70896125",
"0.70896125",
"0.70896125",
"0.70896125",
"0.70896125",
"0.70896125",
"0.70896125",
"0.6917909",
"0.6863951",
"0.6807001",
"0.6723794",
"0.67154646",
"0.66435647",
"0.66296554",
"0.6612778",
"0.6591766",
"0.65873307",
"0.6564765",
"0.6555262",
"0.653168",
"0.6468815",
"0.6468815",
"0.6468815",
"0.6436266",
"0.6399422"
]
| 0.7635346 | 0 |
Convert a Braintree address into a Magento address | public function convertToMagentoAddress($address)
{
$addressModel = Mage::getModel('customer/address');
$addressModel->addData(array(
'firstname' => $address->firstName,
'lastname' => $address->lastName,
'street' => $address->streetAddress . (isset($address->extendedAddress) ? "\n" . $address->extendedAddress : ''),
'city' => $address->locality,
'postcode' => $address->postalCode,
'country' => $address->countryCodeAlpha2
));
if (isset($address->region)) {
$addressModel->setData('region_code', $address->region);
}
if (isset($address->company)) {
$addressModel->setData('company', $address->company);
}
return $addressModel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function convertToBraintreeAddress($address)\n {\n if (is_object($address)) {\n // Build up the initial array\n $return = array(\n 'firstName' => $address->getFirstname(),\n 'lastName' => $address->getLastname(),\n 'streetAddress' => $address->getStreet1(),\n 'locality' => $address->getCity(),\n 'postalCode' => $address->getPostcode(),\n 'countryCodeAlpha2' => $address->getCountry()\n );\n\n // Any extended address?\n if ($address->getStreet2()) {\n $return['extendedAddress'] = $address->getStreet2();\n }\n\n // Region\n if ($address->getRegion()) {\n $return['region'] = $address->getRegionCode();\n }\n\n // Check to see if we have a company\n if ($address->getCompany()) {\n $return['company'] = $address->getCompany();\n }\n\n return $return;\n }\n }",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function convertAddress(array $data, $type = 'billing')\n {\n $address = Mage::getModel('customer/address');\n $address->setId(null);\n $address->setIsDefaultBilling(true);\n $address->setIsDefaultShipping(false);\n if ($type == 'shipping') {\n $address->setIsDefaultBilling(false);\n $address->setIsDefaultShipping(true);\n }\n Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data,\n $address);\n if ($type == 'shipping') {\n $type = 'delivery';\n }\n $address_1 = $data[$type . '_address'];\n $address_2 = $data[$type . '_address_2'];\n // Fix address 1\n if (empty($address_1) && !empty($address_2)) {\n $address_1 = $address_2;\n $address_2 = null;\n }\n // Fix address 2\n if (!empty($address_2)) {\n $address_1 = $address_1 . \"\\n\" . $address_2;\n }\n $address_3 = $data[$type . '_address_complement'];\n if (!empty($address_3)) {\n $address_1 = $address_1 . \"\\n\" . $address_3;\n }\n // adding relay to address\n if (isset($data['tracking_relay'])) {\n $address_1 .= ' - Relay : ' . $data['tracking_relay'];\n }\n $address->setStreet($address_1);\n $tel_1 = $data[$type . '_phone_office'];\n $tel_2 = $data[$type . '_phone_mobile'];\n // Fix tel\n $tel_1 = empty($tel_1) ? $tel_2 : $tel_1;\n\n if (!empty($tel_1)) {\n $this->setTelephone($tel_1);\n }\n if (!empty($tel_1)) {\n $address->setFax($tel_1);\n } else {\n if (!empty($tel_2)) {\n $address->setFax($tel_2);\n }\n }\n $codeRegion = (integer)substr(str_pad($address->getPostcode(), 5, '0', STR_PAD_LEFT), 0, 2);\n $id_region = Mage::getModel('directory/region')->getCollection()\n ->addRegionCodeFilter($codeRegion)\n ->addCountryFilter($address->getCountry())\n ->getFirstItem()\n ->getId();\n $address->setRegionId($id_region);\n $address->setCustomer($this);\n return $address;\n }",
"public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }",
"public function getBillingAddress() : Address;",
"public function getBillingAddress();",
"public function getBillingAddress();",
"function drum_smart_address($address_array) {\n\t// Set up variables\n\t$street1 = $address_array['street1'];\n\t$street2 = $address_array['street2'];\n\t$city = $address_array['city'];\n\t$state = $address_array['state'];\n\t$zip = $address_array['zip'];\n\t// Format address for links to map\n\tif ($street2 == null) {\n\t\t$address = $street1 . ', ' . $street2 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t} else {\n\t\t$address = $street1 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t}\n\t// Create address output\n\t$output = $street1 . '<br />';\n\tif ($street2 != null) {\n\t\t$output .= $street2 . '<br />';\n\t}\n\t$output .= $city . ', ' . $state . ' ' . $zip;\n return $output;\n}",
"public function getAccountAddress($account);",
"function hook_commerce_adyen_shopper_address_alter(\\Commerce\\Adyen\\Payment\\Composition\\Address $address, \\EntityDrupalWrapper $profile, array $checkout_values, \\EntityDrupalWrapper $order) {\n if ('Dnipropetrovsk' === $address->getCity()) {\n $address->setCity('Dnipro');\n }\n}",
"public static function getShipToAddress($address)\n {\n $addressLine1 = \"\";\n if (array_key_exists(0, $address->getStreet(0))) {\n $addressLine1 = $address->getStreet(0)[0];\n }\n $addressLine2 = \"\";\n if (array_key_exists(1, $address->getStreet(0))) {\n $addressLine2 = $address->getStreet(0)[1];\n }\n $city = $address->getCity();\n $stateCode = $address->getRegionCode();\n\n $zip = $address->getPostcode();\n\n $country = $address->getCountryModel()->getIso2Code();\n\n // if we only have state + zip, then don't verify address.\n $tStateCode = trim($stateCode);\n $tZip = trim($zip);\n $verifyAddress =\n (\n (trim($addressLine1) == false)\n && (trim($city) == false)\n && (trim($addressLine2) == false)\n && ($tStateCode != false)\n && ($tZip != false && strlen($tZip) == 5)\n ) == true ? false : true;\n if (isset($country) && strcasecmp($country, 'US') !== 0) {\n $verifyAddress = false;\n }\n\n $estimatedAddress = array(\n 'PrimaryAddressLine'=>$addressLine1,\n 'SecondaryAddressLine'=>$addressLine2,\n 'City'=>$city,\n 'State'=>$stateCode,\n 'PostalCode'=>$zip,\n 'Plus4'=>\"\",\n 'Country'=>$country,\n 'VerifyAddress'=>$verifyAddress);\n\n return $estimatedAddress;\n }",
"private function _createAddressField()\n {\n $address = new Zend_Form_Element_Text('address');\n $address->setLabel('bankAddress')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array(2, 150)));\n\n return $address;\n }",
"public static function formatted_billing_address( $address, $order ) {\n\t\t$vat_id = wc_eu_vat_get_vat_from_order( $order );\n\n\t\tif ( $vat_id ) {\n\t\t\t$address['vat_id'] = $vat_id;\n\t\t}\n\t\treturn $address;\n\t}",
"public function punyencodeAddress($address)\n {\n }",
"private function resolveAddressData()\n {\n /** @var \\Magento\\Quote\\Model\\Quote $quote */\n $quote = $this->checkoutSession->getQuote();\n /** @var \\Magento\\Quote\\Model\\Quote\\Address $shippingAddress */\n $shippingAddress = $quote->getShippingAddress();\n\n $customerData = $this->geoIp->getCurrentLocation();\n if ($customerData->getCode() && $this->helper->isCountryAllowed($customerData->getCode())) {\n /** @var \\Magento\\Directory\\Model\\Country $currentCountry */\n $currentCountry = $shippingAddress\n ->getCountryModel()\n ->loadByCode($customerData->getCode());\n\n if (!$currentCountry) {\n return;\n }\n\n $shippingAddress->setCountryId($currentCountry->getId());\n $shippingAddress->setRegion($customerData->getRegion());\n $shippingAddress->setRegionCode($customerData->getRegionCode());\n $shippingAddress->setCity($customerData->getCity());\n $shippingAddress->setPostcode($customerData->getPosttalCode());\n\n $regionModel = $this->regionFactory->create();\n if ($customerData->getRegionCode() && $currentCountry->getId()) {\n $regionModel->loadByCode($customerData->getRegionCode(), $currentCountry->getId());\n $regionId = $regionModel->getRegionId();\n $shippingAddress->setRegionId($regionId);\n }\n }\n }",
"public function varifyaddress($parameters_array){\n\t\n\t$url = \"https://secure.shippingapis.com/ShippingAPI.dll?API=Verify\";\n\t\n\t$xml_data=urlencode('<AddressValidateRequest USERID=\"'.env('USERID').'\">\n\t<IncludeOptionalElements>true</IncludeOptionalElements>\n \t<ReturnCarrierRoute>true</ReturnCarrierRoute>\n\t<Address ID=\"0\"> \n\t <FirmName /> \n\t <Address1>'.$parameters_array['Address1'].'<Address1/> \n\t <Address2>'.$parameters_array['Address2'].'</Address2> \n\t <City>'.$parameters_array['City'].'</City> \n\t <State>'.$parameters_array['State'].'</State> \n\t <Zip5></Zip5> \n\t <Zip4>'.$parameters_array['Zip4'].'</Zip4> \n\t</Address> \n \n </AddressValidateRequest>');\n\t\n\t$output=$this->callCurl($url,$xml_data);\n\n\t\t$array_data = json_decode(json_encode(simplexml_load_string($output)), true);\n\t\treturn $array_data;\n}",
"function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {\n $address_format_query = tep_db_query(\"select address_format as format from \" . TABLE_ADDRESS_FORMAT . \" where address_format_id = '\" . (int)$address_format_id . \"'\");\n $address_format = tep_db_fetch_array($address_format_query);\n\n $company = tep_output_string_protected($address['company']);\n if (isset($address['firstname']) && tep_not_null($address['firstname'])) {\n $firstname = tep_output_string_protected($address['firstname']);\n $lastname = tep_output_string_protected($address['lastname']);\n } elseif (isset($address['name']) && tep_not_null($address['name'])) {\n $firstname = tep_output_string_protected($address['name']);\n $lastname = '';\n } else {\n $firstname = '';\n $lastname = '';\n }\n $street = tep_output_string_protected($address['street_address']);\n $suburb = tep_output_string_protected($address['suburb']);\n $city = tep_output_string_protected($address['city']);\n $state = tep_output_string_protected($address['state']);\n if (isset($address['country_id']) && tep_not_null($address['country_id'])) {\n $country = tep_get_country_name($address['country_id']);\n\n if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {\n $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);\n }\n } elseif (isset($address['country']) && tep_not_null($address['country'])) {\n $country = tep_output_string_protected($address['country']);\n } else {\n $country = '';\n }\n $postcode = tep_output_string_protected($address['postcode']);\n $zip = $postcode;\n\n if ($html) {\n// HTML Mode\n $HR = '<hr>';\n $hr = '<hr>';\n if ( ($boln == '') && ($eoln == \"\\n\") ) { // Values not specified, use rational defaults\n $CR = '<br>';\n $cr = '<br>';\n $eoln = $cr;\n } else { // Use values supplied\n $CR = $eoln . $boln;\n $cr = $CR;\n }\n } else {\n// Text Mode\n $CR = $eoln;\n $cr = $CR;\n $HR = '----------------------------------------';\n $hr = '----------------------------------------';\n }\n\n $statecomma = '';\n $streets = $street;\n if ($suburb != '') $streets = $street . $cr . $suburb;\n if ($country == '') $country = tep_output_string_protected($address['country']);\n if ($state != '') $statecomma = $state . ', ';\n\n $fmt = $address_format['format'];\n eval(\"\\$address = \\\"$fmt\\\";\");\n\n if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {\n $address = $company . $cr . $address;\n }\n\n return $address;\n }",
"public function getFormatedAddress()\n\t{\n\t\tif (!$this->formatedAddress)\n\t\t{\n\t\t\t$this->formatAddress();\n\t\t}\n\n\t\treturn $this->formatedAddress;\n\t}",
"public function addressvs($address) {\n\t\n\t\n\t\n\t\treturn $address;\n\t\n\t}",
"public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }",
"public function getnewaddress($account = '') {\n return $this->bitcoin->getnewaddress($account);\n }",
"public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }",
"public function parseAddressesProvider() {}",
"function retrieveAddress()\n{\n $usertoken = $_SESSION['usertoken'];\n\n //here is where you can override what the default values were set for your site. If you have a piece of content that\n //should be priced differently, you can set that value here\n $payload = array(\n// 'required_confirmations_override' => 3, //optional, default 0\n// 'amount_override' => 1, //optional\n// 'denomination_override' => 'usd' //optional\n );\n\n //this will return a jsonencoded array with an address, auto created if not found, and payment info if found\n $endpoint = 'https://api.coinbee.io/retrieve/' . $usertoken;\n\n return json_encode(doCurl($endpoint, $payload));\n}",
"public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}",
"public function saveOfferBillingAddress($address, $tax_rate, $id)\r\n {\r\n if($address['stateID'] == null)\r\n {\r\n $address['stateID']='0';\r\n }\r\n $checkForExistingDocument = Shopware()->Db()->fetchRow(\"SELECT id FROM s_offer_billingaddress WHERE offerID = ?\",array($id));\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $customer = Shopware()->Models()->getRepository('Shopware\\Models\\Customer\\Customer')->find($address[\"userID\"]);\r\n if($customer instanceof \\Shopware\\Models\\Customer\\Customer) {\r\n $address['customernumber'] = $customer->getNumber();\r\n }\r\n }\r\n\r\n if (!empty($checkForExistingDocument[\"id\"])) {\r\n\r\n $sql = \"\r\n UPDATE s_offer_billingaddress SET\r\n userID = ?,\r\n customernumber = ?,\r\n company = ?,\r\n department = ?,\r\n salutation = ?,\r\n firstname = ?,\r\n lastname = ?,\r\n street = ?,\r\n zipcode = ?,\r\n city = ?,\r\n phone = ?,\r\n fax = ?,\r\n countryID = ?,\r\n stateID = ?,\r\n ustid = ?,\r\n shipping_tax = ?\r\n WHERE offerID = ?\r\n \";\r\n\r\n\t\t\t$street = $address[\"street\"];\r\n $fax = $address[\"fax\"];\r\n $phone = $address[\"phone\"];\r\n $ustid = $address[\"ustid\"];\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $fax = \"\";\r\n if(!isset($phone) || empty($phone)) {\r\n $phone = \"\";\r\n }\r\n if(!isset($ustid) || empty($ustid)) {\r\n $ustid = \"\";\r\n }\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n $array = array(\r\n $address[\"userID\"],\r\n $address[\"customernumber\"],\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $phone,\r\n $fax,\r\n $address[\"countryID\"],\r\n $address[\"stateID\"],\r\n $ustid,\r\n $tax_rate,\r\n $id\r\n );\r\n }\r\n else{\r\n $sql = \"\r\n INSERT INTO s_offer_billingaddress\r\n (\r\n userID,\r\n offerID,\r\n customernumber,\r\n company,\r\n department,\r\n salutation,\r\n firstname,\r\n lastname,\r\n street,\r\n zipcode,\r\n city,\r\n phone,\r\n fax,\r\n countryID,\r\n stateID,\r\n ustid,\r\n shipping_tax\r\n )\r\n VALUES (\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?\r\n )\r\n \";\r\n\t\t\t$street = $address[\"street\"];\r\n $fax = $address[\"fax\"];\r\n $phone = $address[\"phone\"];\r\n $ustid = $address[\"ustid\"];\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $fax = \"\";\r\n if(!isset($phone) || empty($phone)) {\r\n $phone = \"\";\r\n }\r\n if(!isset($ustid) || empty($ustid)) {\r\n $ustid = \"\";\r\n }\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n\r\n $array = array(\r\n $address[\"userID\"],\r\n $id,\r\n $address[\"customernumber\"],\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $phone,\r\n $fax,\r\n $address[\"countryID\"],\r\n $address[\"stateID\"],\r\n $ustid,\r\n $tax_rate\r\n );\r\n\r\n }\r\n $result = Shopware()->Db()->executeUpdate($sql,$array);\r\n if (!$result) {\r\n throw new Enlight_Exception(\"Shopware Offer Fatal-Error {$_SERVER[\"HTTP_HOST\"]} : No row affected in s_offer_billingaddress.\", 0);\r\n }\r\n return $result;\r\n }",
"function encodeAddress($address)\n{\n\t$part = explode(chr(10), $address);\n\t$result = array();\n\tfor($i = 0; $i < count($part); $i++)\n\t{\n\t\t$part[$i] = trim(str_replace(' ', ' ', $part[$i]));\n\t\tif($part[$i] != '') $result[] = $part[$i];\n\t}\n\treturn implode(chr(10), $result);\n}",
"protected function extractAddress()\n {\n if (!$this->getRequest()->getPost('create_address')) {\n return null;\n }\n\n $addressForm = $this->formFactory->create('customer_address', 'customer_register_address');\n $allowedAttributes = $addressForm->getAllowedAttributes();\n\n $addressData = [];\n\n $regionDataObject = $this->regionDataFactory->create();\n foreach ($allowedAttributes as $attribute) {\n $attributeCode = $attribute->getAttributeCode();\n $value = $this->getRequest()->getParam($attributeCode);\n if ($value === null) {\n continue;\n }\n switch ($attributeCode) {\n case 'region_id':\n $regionDataObject->setRegionId($value);\n break;\n case 'region':\n $regionDataObject->setRegion($value);\n break;\n default:\n $addressData[$attributeCode] = $value;\n }\n }\n $addressDataObject = $this->addressDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $addressDataObject,\n $addressData,\n '\\Magento\\Customer\\Api\\Data\\AddressInterface'\n );\n $addressDataObject->setRegion($regionDataObject);\n\n $addressDataObject->setIsDefaultBilling(\n $this->getRequest()->getParam('default_billing', false)\n )->setIsDefaultShipping(\n $this->getRequest()->getParam('default_shipping', false)\n );\n return $addressDataObject;\n }",
"private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}",
"function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}"
]
| [
"0.6586505",
"0.64665896",
"0.6340639",
"0.6233224",
"0.6228289",
"0.6077428",
"0.6077428",
"0.6022687",
"0.5991683",
"0.5981037",
"0.5886395",
"0.58652145",
"0.5861576",
"0.5831261",
"0.57772857",
"0.5775209",
"0.5740167",
"0.57074904",
"0.56984013",
"0.5687154",
"0.56864965",
"0.56852657",
"0.5681724",
"0.5679557",
"0.56506926",
"0.5642846",
"0.5641114",
"0.5630668",
"0.5630159",
"0.5618319"
]
| 0.687373 | 0 |
Convert a Magento address into a Braintree address | public function convertToBraintreeAddress($address)
{
if (is_object($address)) {
// Build up the initial array
$return = array(
'firstName' => $address->getFirstname(),
'lastName' => $address->getLastname(),
'streetAddress' => $address->getStreet1(),
'locality' => $address->getCity(),
'postalCode' => $address->getPostcode(),
'countryCodeAlpha2' => $address->getCountry()
);
// Any extended address?
if ($address->getStreet2()) {
$return['extendedAddress'] = $address->getStreet2();
}
// Region
if ($address->getRegion()) {
$return['region'] = $address->getRegionCode();
}
// Check to see if we have a company
if ($address->getCompany()) {
$return['company'] = $address->getCompany();
}
return $return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function convertToMagentoAddress($address)\n {\n $addressModel = Mage::getModel('customer/address');\n\n $addressModel->addData(array(\n 'firstname' => $address->firstName,\n 'lastname' => $address->lastName,\n 'street' => $address->streetAddress . (isset($address->extendedAddress) ? \"\\n\" . $address->extendedAddress : ''),\n 'city' => $address->locality,\n 'postcode' => $address->postalCode,\n 'country' => $address->countryCodeAlpha2\n ));\n\n if (isset($address->region)) {\n $addressModel->setData('region_code', $address->region);\n }\n\n if (isset($address->company)) {\n $addressModel->setData('company', $address->company);\n }\n\n return $addressModel;\n }",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function convertAddress(array $data, $type = 'billing')\n {\n $address = Mage::getModel('customer/address');\n $address->setId(null);\n $address->setIsDefaultBilling(true);\n $address->setIsDefaultShipping(false);\n if ($type == 'shipping') {\n $address->setIsDefaultBilling(false);\n $address->setIsDefaultShipping(true);\n }\n Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data,\n $address);\n if ($type == 'shipping') {\n $type = 'delivery';\n }\n $address_1 = $data[$type . '_address'];\n $address_2 = $data[$type . '_address_2'];\n // Fix address 1\n if (empty($address_1) && !empty($address_2)) {\n $address_1 = $address_2;\n $address_2 = null;\n }\n // Fix address 2\n if (!empty($address_2)) {\n $address_1 = $address_1 . \"\\n\" . $address_2;\n }\n $address_3 = $data[$type . '_address_complement'];\n if (!empty($address_3)) {\n $address_1 = $address_1 . \"\\n\" . $address_3;\n }\n // adding relay to address\n if (isset($data['tracking_relay'])) {\n $address_1 .= ' - Relay : ' . $data['tracking_relay'];\n }\n $address->setStreet($address_1);\n $tel_1 = $data[$type . '_phone_office'];\n $tel_2 = $data[$type . '_phone_mobile'];\n // Fix tel\n $tel_1 = empty($tel_1) ? $tel_2 : $tel_1;\n\n if (!empty($tel_1)) {\n $this->setTelephone($tel_1);\n }\n if (!empty($tel_1)) {\n $address->setFax($tel_1);\n } else {\n if (!empty($tel_2)) {\n $address->setFax($tel_2);\n }\n }\n $codeRegion = (integer)substr(str_pad($address->getPostcode(), 5, '0', STR_PAD_LEFT), 0, 2);\n $id_region = Mage::getModel('directory/region')->getCollection()\n ->addRegionCodeFilter($codeRegion)\n ->addCountryFilter($address->getCountry())\n ->getFirstItem()\n ->getId();\n $address->setRegionId($id_region);\n $address->setCustomer($this);\n return $address;\n }",
"public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }",
"public function getBillingAddress() : Address;",
"function drum_smart_address($address_array) {\n\t// Set up variables\n\t$street1 = $address_array['street1'];\n\t$street2 = $address_array['street2'];\n\t$city = $address_array['city'];\n\t$state = $address_array['state'];\n\t$zip = $address_array['zip'];\n\t// Format address for links to map\n\tif ($street2 == null) {\n\t\t$address = $street1 . ', ' . $street2 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t} else {\n\t\t$address = $street1 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t}\n\t// Create address output\n\t$output = $street1 . '<br />';\n\tif ($street2 != null) {\n\t\t$output .= $street2 . '<br />';\n\t}\n\t$output .= $city . ', ' . $state . ' ' . $zip;\n return $output;\n}",
"public function getBillingAddress();",
"public function getBillingAddress();",
"public function getAccountAddress($account);",
"function hook_commerce_adyen_shopper_address_alter(\\Commerce\\Adyen\\Payment\\Composition\\Address $address, \\EntityDrupalWrapper $profile, array $checkout_values, \\EntityDrupalWrapper $order) {\n if ('Dnipropetrovsk' === $address->getCity()) {\n $address->setCity('Dnipro');\n }\n}",
"public static function formatted_billing_address( $address, $order ) {\n\t\t$vat_id = wc_eu_vat_get_vat_from_order( $order );\n\n\t\tif ( $vat_id ) {\n\t\t\t$address['vat_id'] = $vat_id;\n\t\t}\n\t\treturn $address;\n\t}",
"public static function getShipToAddress($address)\n {\n $addressLine1 = \"\";\n if (array_key_exists(0, $address->getStreet(0))) {\n $addressLine1 = $address->getStreet(0)[0];\n }\n $addressLine2 = \"\";\n if (array_key_exists(1, $address->getStreet(0))) {\n $addressLine2 = $address->getStreet(0)[1];\n }\n $city = $address->getCity();\n $stateCode = $address->getRegionCode();\n\n $zip = $address->getPostcode();\n\n $country = $address->getCountryModel()->getIso2Code();\n\n // if we only have state + zip, then don't verify address.\n $tStateCode = trim($stateCode);\n $tZip = trim($zip);\n $verifyAddress =\n (\n (trim($addressLine1) == false)\n && (trim($city) == false)\n && (trim($addressLine2) == false)\n && ($tStateCode != false)\n && ($tZip != false && strlen($tZip) == 5)\n ) == true ? false : true;\n if (isset($country) && strcasecmp($country, 'US') !== 0) {\n $verifyAddress = false;\n }\n\n $estimatedAddress = array(\n 'PrimaryAddressLine'=>$addressLine1,\n 'SecondaryAddressLine'=>$addressLine2,\n 'City'=>$city,\n 'State'=>$stateCode,\n 'PostalCode'=>$zip,\n 'Plus4'=>\"\",\n 'Country'=>$country,\n 'VerifyAddress'=>$verifyAddress);\n\n return $estimatedAddress;\n }",
"private function _createAddressField()\n {\n $address = new Zend_Form_Element_Text('address');\n $address->setLabel('bankAddress')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array(2, 150)));\n\n return $address;\n }",
"public function punyencodeAddress($address)\n {\n }",
"public function getFormatedAddress()\n\t{\n\t\tif (!$this->formatedAddress)\n\t\t{\n\t\t\t$this->formatAddress();\n\t\t}\n\n\t\treturn $this->formatedAddress;\n\t}",
"public function varifyaddress($parameters_array){\n\t\n\t$url = \"https://secure.shippingapis.com/ShippingAPI.dll?API=Verify\";\n\t\n\t$xml_data=urlencode('<AddressValidateRequest USERID=\"'.env('USERID').'\">\n\t<IncludeOptionalElements>true</IncludeOptionalElements>\n \t<ReturnCarrierRoute>true</ReturnCarrierRoute>\n\t<Address ID=\"0\"> \n\t <FirmName /> \n\t <Address1>'.$parameters_array['Address1'].'<Address1/> \n\t <Address2>'.$parameters_array['Address2'].'</Address2> \n\t <City>'.$parameters_array['City'].'</City> \n\t <State>'.$parameters_array['State'].'</State> \n\t <Zip5></Zip5> \n\t <Zip4>'.$parameters_array['Zip4'].'</Zip4> \n\t</Address> \n \n </AddressValidateRequest>');\n\t\n\t$output=$this->callCurl($url,$xml_data);\n\n\t\t$array_data = json_decode(json_encode(simplexml_load_string($output)), true);\n\t\treturn $array_data;\n}",
"private function resolveAddressData()\n {\n /** @var \\Magento\\Quote\\Model\\Quote $quote */\n $quote = $this->checkoutSession->getQuote();\n /** @var \\Magento\\Quote\\Model\\Quote\\Address $shippingAddress */\n $shippingAddress = $quote->getShippingAddress();\n\n $customerData = $this->geoIp->getCurrentLocation();\n if ($customerData->getCode() && $this->helper->isCountryAllowed($customerData->getCode())) {\n /** @var \\Magento\\Directory\\Model\\Country $currentCountry */\n $currentCountry = $shippingAddress\n ->getCountryModel()\n ->loadByCode($customerData->getCode());\n\n if (!$currentCountry) {\n return;\n }\n\n $shippingAddress->setCountryId($currentCountry->getId());\n $shippingAddress->setRegion($customerData->getRegion());\n $shippingAddress->setRegionCode($customerData->getRegionCode());\n $shippingAddress->setCity($customerData->getCity());\n $shippingAddress->setPostcode($customerData->getPosttalCode());\n\n $regionModel = $this->regionFactory->create();\n if ($customerData->getRegionCode() && $currentCountry->getId()) {\n $regionModel->loadByCode($customerData->getRegionCode(), $currentCountry->getId());\n $regionId = $regionModel->getRegionId();\n $shippingAddress->setRegionId($regionId);\n }\n }\n }",
"public function parseAddressesProvider() {}",
"public function addressvs($address) {\n\t\n\t\n\t\n\t\treturn $address;\n\t\n\t}",
"public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }",
"function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}",
"function retrieveAddress()\n{\n $usertoken = $_SESSION['usertoken'];\n\n //here is where you can override what the default values were set for your site. If you have a piece of content that\n //should be priced differently, you can set that value here\n $payload = array(\n// 'required_confirmations_override' => 3, //optional, default 0\n// 'amount_override' => 1, //optional\n// 'denomination_override' => 'usd' //optional\n );\n\n //this will return a jsonencoded array with an address, auto created if not found, and payment info if found\n $endpoint = 'https://api.coinbee.io/retrieve/' . $usertoken;\n\n return json_encode(doCurl($endpoint, $payload));\n}",
"function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {\n $address_format_query = tep_db_query(\"select address_format as format from \" . TABLE_ADDRESS_FORMAT . \" where address_format_id = '\" . (int)$address_format_id . \"'\");\n $address_format = tep_db_fetch_array($address_format_query);\n\n $company = tep_output_string_protected($address['company']);\n if (isset($address['firstname']) && tep_not_null($address['firstname'])) {\n $firstname = tep_output_string_protected($address['firstname']);\n $lastname = tep_output_string_protected($address['lastname']);\n } elseif (isset($address['name']) && tep_not_null($address['name'])) {\n $firstname = tep_output_string_protected($address['name']);\n $lastname = '';\n } else {\n $firstname = '';\n $lastname = '';\n }\n $street = tep_output_string_protected($address['street_address']);\n $suburb = tep_output_string_protected($address['suburb']);\n $city = tep_output_string_protected($address['city']);\n $state = tep_output_string_protected($address['state']);\n if (isset($address['country_id']) && tep_not_null($address['country_id'])) {\n $country = tep_get_country_name($address['country_id']);\n\n if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {\n $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);\n }\n } elseif (isset($address['country']) && tep_not_null($address['country'])) {\n $country = tep_output_string_protected($address['country']);\n } else {\n $country = '';\n }\n $postcode = tep_output_string_protected($address['postcode']);\n $zip = $postcode;\n\n if ($html) {\n// HTML Mode\n $HR = '<hr>';\n $hr = '<hr>';\n if ( ($boln == '') && ($eoln == \"\\n\") ) { // Values not specified, use rational defaults\n $CR = '<br>';\n $cr = '<br>';\n $eoln = $cr;\n } else { // Use values supplied\n $CR = $eoln . $boln;\n $cr = $CR;\n }\n } else {\n// Text Mode\n $CR = $eoln;\n $cr = $CR;\n $HR = '----------------------------------------';\n $hr = '----------------------------------------';\n }\n\n $statecomma = '';\n $streets = $street;\n if ($suburb != '') $streets = $street . $cr . $suburb;\n if ($country == '') $country = tep_output_string_protected($address['country']);\n if ($state != '') $statecomma = $state . ', ';\n\n $fmt = $address_format['format'];\n eval(\"\\$address = \\\"$fmt\\\";\");\n\n if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {\n $address = $company . $cr . $address;\n }\n\n return $address;\n }",
"function encodeAddress($address)\n{\n\t$part = explode(chr(10), $address);\n\t$result = array();\n\tfor($i = 0; $i < count($part); $i++)\n\t{\n\t\t$part[$i] = trim(str_replace(' ', ' ', $part[$i]));\n\t\tif($part[$i] != '') $result[] = $part[$i];\n\t}\n\treturn implode(chr(10), $result);\n}",
"private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}",
"public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }",
"public function extractPostCodeForShippingRequest($addressObject)\n {\n $idState = $addressObject->id_state;\n $countryName = pSQL($addressObject->country);\n\n $regionName = State::getNameById($idState);\n\n $address = array(\n 'country' => $countryName,\n 'region' => $regionName,\n 'city' => pSQL($addressObject->city),\n 'address' => pSQL($addressObject->address1) . (($addressObject->address2) ? ' ' . pSQL($addressObject->address2) : ''),\n 'postcode' => pSQL($addressObject->postcode)\n );\n\n\n if ($this->isEnabledAutocompleteForPostcode($countryName)) {\n $dpdPostcodeAddress = new DpdGeopostDpdPostcodeAddress();\n $dpdPostcodeAddress->loadDpdAddressByAddressId($addressObject->id);\n $currentHash = $this->generateAddressHash($address);\n\n if (\n !empty($dpdPostcodeAddress->id_address) &&\n $currentHash == $dpdPostcodeAddress->hash\n ) {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n if (\n empty($dpdPostcodeAddress->id_address) ||\n $currentHash != $dpdPostcodeAddress->hash\n ) {\n $postcodeRelevance = new stdClass();\n $postCode = $this->search($address, $postcodeRelevance);\n\n $dpdPostcodeAddress->auto_postcode = $postCode;\n $dpdPostcodeAddress->id_address = $addressObject->id;\n\n $dpdPostcodeAddress->hash = $currentHash;\n if ($this->isValid($postCode, $postcodeRelevance)) {\n $dpdPostcodeAddress->relevance = 1;\n\n $addressObject->postcode = $postCode;\n $addressObject->save();\n\n } else {\n $dpdPostcodeAddress->relevance = 0;\n }\n\n if(!empty($dpdPostcodeAddress->dpd_postcode_id)){\n $dpdPostcodeAddress->id = $dpdPostcodeAddress->dpd_postcode_id;\n }\n $dpdPostcodeAddress->save();\n } else {\n return $dpdPostcodeAddress->auto_postcode;\n }\n\n\n } else {\n $postCode = $addressObject->postcode;\n }\n\n return $postCode;\n }",
"protected function extractAddress()\n {\n if (!$this->getRequest()->getPost('create_address')) {\n return null;\n }\n\n $addressForm = $this->formFactory->create('customer_address', 'customer_register_address');\n $allowedAttributes = $addressForm->getAllowedAttributes();\n\n $addressData = [];\n\n $regionDataObject = $this->regionDataFactory->create();\n foreach ($allowedAttributes as $attribute) {\n $attributeCode = $attribute->getAttributeCode();\n $value = $this->getRequest()->getParam($attributeCode);\n if ($value === null) {\n continue;\n }\n switch ($attributeCode) {\n case 'region_id':\n $regionDataObject->setRegionId($value);\n break;\n case 'region':\n $regionDataObject->setRegion($value);\n break;\n default:\n $addressData[$attributeCode] = $value;\n }\n }\n $addressDataObject = $this->addressDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $addressDataObject,\n $addressData,\n '\\Magento\\Customer\\Api\\Data\\AddressInterface'\n );\n $addressDataObject->setRegion($regionDataObject);\n\n $addressDataObject->setIsDefaultBilling(\n $this->getRequest()->getParam('default_billing', false)\n )->setIsDefaultShipping(\n $this->getRequest()->getParam('default_shipping', false)\n );\n return $addressDataObject;\n }",
"protected function _getOrderAddress(array $addrData = array())\n {\n return Mage::getModel('sales/order_address', $addrData);\n }",
"public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}"
]
| [
"0.6854984",
"0.6390598",
"0.62811434",
"0.6193847",
"0.6102055",
"0.5999954",
"0.5994217",
"0.5994217",
"0.59023803",
"0.5869602",
"0.58635855",
"0.585815",
"0.5821388",
"0.574222",
"0.57407266",
"0.5733933",
"0.56911755",
"0.5690929",
"0.5676617",
"0.56586415",
"0.5648029",
"0.5647831",
"0.5645729",
"0.5638588",
"0.56348425",
"0.56263703",
"0.559721",
"0.55827004",
"0.55756366",
"0.5568325"
]
| 0.64799505 | 1 |
Can we update information in Kount for a payment? kount_ens_update is set when an ENS update is received from Kount | public function canUpdateKount()
{
return !Mage::registry('kount_ens_update')
&& Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id')
&& Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateSuperfund()\n {\n }",
"public function testUpdatePayrun()\n {\n }",
"public static function ipnStatusEdit($event) { \n\t\t$keyAttrs = $event->key->attributes();\n\t\t$value = (string) $event->new_value;\n\t\t$agent = (string) $event->agent;\n\t\t$shoppingCartId = $keyAttrs['order_number'];\n\t\t$transactionId = (string) $event->key;\n\t\t\n\t\t$transaction = new transactionModel();\n\t\t$transaction->shoppingCartId = $shoppingCartId;\n\t\t\n\t\tif (!$transaction->load()){ \n\t\t\tthrow new exception (\"transaction id is invalid for shoppingCartId:$shoppingCartId\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlog::info(\"Processing Kount notification: \" . print_r($event, true));\n\t\t\n\t\t//if the shopping cart isn't a complete int\n\t\t//i.e. 1178D in the case of a decline, let's just return\n\t\tif(preg_match('/[^0-9]/',$shoppingCartId)) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t//otherwise we need to int up the shopping cart\n\t\t\t$shoppingCartId = (int) $shoppingCartId;\n\t\t}\n\t\t\n\t\t$cart = new shoppingCartModel($shoppingCartId);\n\t\tnew eventLogModel(\"screen\", \"kountReview\", $value, $cart->partner);\n\t\t\n\t\tif($value == kountHelper::APPROVE) { \n\t\t\tscreeningHelper::approveCart($shoppingCartId, $agent);\n\t\t}\n\t\t\n\t\telse if($value == kountHelper::DECLINE) { \n\t\t\tscreeningHelper::rejectCart($shoppingCartId, $agent);\n\t\t}\n\t\t\n\t\t$fraud = new fraud($transaction, $cart, null);\n\t\t$kount = new Kount($fraud);\n\t\t$kount->doUpdate($transactionId);\n\t}",
"public function update(Request $request, Cryptocurrency $cryptocurrency)\n {\n //\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function update($p_merchant_name, $p_merchant_email, $p_tax_govt, $p_tax_service)\n {\n $result_update = false;\n \n // format\n $p_merchant_name = sanitizeNoTags($p_merchant_name);\n $p_merchant_email = sanitizeEmail(sanitizeNoTags($p_merchant_email));\n $p_tax_govt = sanitizeFloat($p_tax_govt);\n $p_tax_service = sanitizeFloat($p_tax_service);\n \n // set\n $p_tax_govt = number_format(($p_tax_govt/100), 2);\n $p_tax_service = number_format(($p_tax_service/100), 2);\n\n // set\n $arr_vars = array(\n 'MERCHANT_NAME' => $p_merchant_name,\n 'MERCHANT_EMAIL' => $p_merchant_email,\n 'TAX_GOVT' => $p_tax_govt,\n 'TAX_SERVICE' => $p_tax_service\n );\n \n // connect to database \n parent::connect();\n \n while(list($key,$value) = each($arr_vars))\n {\n if ($value != '')\n {\n // update\n $result = parent::dataUpdate($key, $value); \n }\n \n $key = '';\n $value = '';\n }\n \n // disconnect from database\n parent:: disconnect();\n \n $result_update = '1';\n \n return $result_update; \n }",
"public function update(Request $request, Kkm $kkm)\n {\n //\n }",
"public function actionProductupdate()\n\t{\n\t\tif($_POST)\n\t\t{\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$product=$_POST;\n\t\t\t\t$path='productupdate/'.$product['merchant_id'].'/update.log';\n\t\t\t\t$walmartConfig=[];\n\t\t\t $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$product['merchant_id'].\"'\",'one','select');\n\t\t\t $merchant_id = $product['merchant_id'];\n\t\t\t if(is_array($walmartConfig) && count($walmartConfig)>0)\n\t\t\t {\n\t\t\t \tData::createLog(\"walmart_configuration available: \".PHP_EOL,$path);\n\t\t\t //$walmartHelper = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key'],$walmartConfig['consumer_channel_type_id']);\n\t\t\t // define(\"MERCHANT_ID\", $merchant_id);\n\t\t\t if(isset($product['type']) && $product['type']==\"price\")\n\t\t\t {\n\t\t\t \t//update custom price on walmart\n\t\t\t \t/*$updatePrice = Data::getCustomPrice($product['price'],$merchant_id);\n\t\t\t \tif($updatePrice)\n\t\t\t \t\t$product['price']=$updatePrice;*/\n\n\t\t\t \t$product['price'] = WalmartRepricing::getProductPrice($product['price'], $product['type'], $product['id'], $merchant_id);\n\t\t\t \t\n\t\t\t \t//change price log\n\t\t\t \t//$path='productupdate/price/'.$merchant_id.'/'.Data::getKey($product['sku']).'.log';\n\t\t\t \t//Data::createLog(\"price data: \".json_encode($product).PHP_EOL,$path);\n\t\t\t \t$shopDetails = Data::getWalmartShopDetails(MERCHANT_ID);\n\t\t\t $product['currency'] = isset($shopDetails['currency'])?$shopDetails['currency']:'USD';\n\n\t\t\t //define(\"CURRENCY\", $currency);\n\t\t\t //$walmartHelper->updatePriceOnWalmart($product,\"webhook\");\n\t\t\t }\n\t\t\t elseif(isset($product['type']) && $product['type']==\"inventory\")\n\t\t\t {\n\t\t\t \t//change price log\n\t\t\t \t//$path='productupdate/inventory/'.$merchant_id.'/'.Data::getKey($product['sku']).'.log';\n\t\t\t \t//Data::createLog(\"inventory data: \".json_encode($product).PHP_EOL,$path);\n\t\t\t \t//$walmartHelper->updateInventoryOnWalmart($product,\"webhook\");\n\n\t\t\t }\n\t\t\t //save product update log\n\t\t\t $productExist=Data::sqlRecords(\"SELECT id FROM walmart_price_inventory_log WHERE merchant_id='\".$product['merchant_id'].\"' and sku='\".addslashes($product['sku']).\"' LIMIT 0,1\",'one','select');\n\t\t\t if(is_array($productExist) && count($productExist)>0)\n\t\t\t {\n\n\t\t\t \t$query=\"UPDATE walmart_price_inventory_log SET type='\".$product['type'].\"',data='\".addslashes(json_encode($product)).\"' WHERE merchant_id='\".$product['merchant_id'].\"' and sku='\".addslashes($product['sku']).\"'\";\n\t\t\t \tData::createLog(\"product update data: \".$query.PHP_EOL,$path);\n\t\t\t \t//echo \"<br>\".\"update\".$query;\n\t\t\t \tData::sqlRecords($query,null,'update');\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \t$sku = addslashes($product['sku']);\n\t\t\t \t$query=\"INSERT INTO `walmart_price_inventory_log`(`merchant_id`,`type`,`data`,`sku`) VALUES('{$product['merchant_id']}','{$product['type']}','\".addslashes(json_encode($product)).\"','{$sku}')\";\n\t\t\t \t//echo \"<br>\".\"insert\".$query;\n\t\t\t \tData::createLog(\"product insert data: \".$query.PHP_EOL,$path);\n\t\t\t \tData::sqlRecords($query,null,'insert');\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"productupdate error \".json_decode($_POST),'productupdate/exception.log','a',true);\n\t\t\t}\n\t }\n\t else\n\t\t{\n\t\t\tData::createLog(\"product update error\");\n\t\t}\n\t}",
"public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }",
"public function testUpdateFinancialStatementUsingPut()\n {\n }",
"public function updateDbKlarnaobtConfiguration()\n {\n $sql = \"UPDATE `s_core_paymentmeans` SET `name` = 'vrpay_klarnaobt', `description` = 'Online Bank Transfer.' \"\n . \"WHERE `name` = 'vrpay_sofort'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_snippets` SET `name` = 'FRONTEND_PM_KLARNAOBT', `value` = 'Sofort.' \"\n . \"WHERE localeID = (SELECT id FROM s_core_locales WHERE locale = 'de_DE') AND `name` = 'FRONTEND_PM_SOFORT'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_snippets` SET `name` = 'FRONTEND_PM_KLARNAOBT', `value` = 'Online Bank Transfer.' \"\n . \"WHERE localeID = (SELECT id FROM s_core_locales WHERE locale = 'en_GB') AND `name` = 'FRONTEND_PM_SOFORT'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_element_translations` SET `label` = 'Sofot.' \"\n . \"WHERE `label` = 'SOFORT Überweisung'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_element_translations` SET `label` = 'Online Bank Transfer.' \"\n . \"WHERE `label` = 'SOFORT Banking'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_PM_KLARNAOBT', \"\n . \" `label` = 'Online Bank Transfer.' WHERE `name` = 'BACKEND_PM_SOFORT'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAOBT_ACTIVE', \"\n . \" `label` = 'Online Bank Transfer. Enabled' WHERE `name` = 'BACKEND_CH_SOFORT_ACTIVE'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAOBT_SERVER', \"\n . \" `label` = 'Online Bank Transfer. Server' WHERE `name` = 'BACKEND_CH_SOFORT_SERVER'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAOBT_CHANNEL', \"\n . \" `label` = 'Online Bank Transfer. Entity-ID' WHERE `name` = 'BACKEND_CH_SOFORT_CHANNEL'\";\n Shopware()->Db()->query($sql);\n }",
"public function update(Request $request, Wallet $wallet)\n {\n //\n }",
"public function update(Request $request, Wallet $wallet)\n {\n //\n }",
"public function updateDbKlarnapaylaterConfiguration()\n {\n $sql = \"UPDATE `s_core_paymentmeans` SET `name` = 'vrpay_klarnapaylater', \"\n .\" `description` = 'Pay later.' WHERE `name` = 'vrpay_klarnainv'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_snippets` SET `name` = 'FRONTEND_PM_KLARNAPAYLATER', `value` = 'Rechnung.' \" .\n \"WHERE localeID = (SELECT id FROM s_core_locales WHERE locale = 'de_DE') AND `name` = 'FRONTEND_PM_KLARNAINV'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_snippets` SET `name` = 'FRONTEND_PM_KLARNAPAYLATER', `value` = 'Pay later.' \" .\n \"WHERE localeID = (SELECT id FROM s_core_locales WHERE locale = 'en_GB') AND `name` = 'FRONTEND_PM_KLARNAINV'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_element_translations` SET `label` = 'Rechnung.' \"\n . \"WHERE `label` = 'Klarna Rechnung'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_element_translations` SET `label` = 'Pay later.' \"\n . \"WHERE `label` = 'Klarna Invoice'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_PM_KLARNAPAYLATER', `label` = 'Pay later.' \"\n . \"WHERE `name` = 'BACKEND_PM_KLARNAINV'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAPAYLATER_ACTIVE', \"\n . \"`label` = 'Pay later. Enabled' WHERE `name` = 'BACKEND_CH_KLARNAINV_ACTIVE'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAPAYLATER_SERVER', \"\n .\"`label` = 'Pay later. Server' WHERE `name` = 'BACKEND_CH_KLARNAINV_SERVER'\";\n Shopware()->Db()->query($sql);\n\n $sql = \"UPDATE `s_core_config_elements` SET `name` = 'BACKEND_CH_KLARNAPAYLATER_CHANNEL', \"\n . \" `label` = 'Pay later. Entity-ID' WHERE `name` = 'BACKEND_CH_KLARNAINV_CHANNEL'\";\n Shopware()->Db()->query($sql);\n }",
"function update_wallet($cust_id,$amount,$sale_id,$user_id,$sale_type){\n\tglobal $connection; \n\t$trans=\"CUSTOMER PAID UPFRONT\"; \n\t$update_wallet=mysqli_query($connection,\"INSERT INTO kp_sc (cust_id,amount) VALUES ('$cust_id', '$amount') ON DUPLICATE KEY UPDATE amount=amount+'$amount'\") or die(mysqli_error($connection));\n\n\tif ($update_wallet) {\n\t\t$create_history = mysqli_query($connection,\"INSERT INTO kp_sc_hist(cust_id,amount,trans,user_id,trans_id,trans_type,day) \n\t\tVALUES('$cust_id','$amount','$trans','$user_id','$sale_id','$sale_type',CURRENT_DATE)\") or die(mysqli_error($connection));\n\t}else{\n\t\t error_logs(\"PAY CREDIT ORDER\",\"COULDN'T UPDATE WALLET FOR SALE ID $sale_id\");\n\t}\n\t\n}",
"function update() {\n\n\t \t$sql = \"UPDATE evs_database.evs_key_component \n\t \t\t\tSET\tkcp_key_component_detail_en=?, kcp_key_component_detail_th=?, kcp_cpn_id=? \n\t \t\t\tWHERE kcp_id=?\";\n\t\t\n\t\t$this->db->query($sql, array( $this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id, $this->kcp_id));\n\t\t\n\t }",
"function mint_update_account($session, $token, $account_id, $account_name, $total) {\n $_post = array(\n \"accountId\" => $account_id,\n \"types\" => \"ot\",\n \"accountName\" => $account_name, \n \"accountValue\" => $total,\n \"associatedLoanRadio\" => \"No\", \n \"accountType\" => \"3\", \n \"accountStatus\" => \"1\",\n \"token\" => $token,\n );\n $session->URLFetch(\"https://wwws.mint.com/updateAccount.xevent\", $_post);\n}",
"public function testUpdateKey()\n {\n }",
"function update($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n if (@$_POST[\"sek_simple_used\"]) {\r\n $sek_simple_used = 'TRUE';\r\n } else {\r\n $sek_simple_used = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_bulkchange\"]) {\r\n $sek_bulkchange = 'TRUE';\r\n } else {\r\n $sek_bulkchange = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_adv_visible\"]) {\r\n $sek_adv_visible = 'TRUE';\r\n } else {\r\n $sek_adv_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_myfez_visible\"]) {\r\n $sek_myfez_visible = 'TRUE';\r\n } else {\r\n $sek_myfez_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_faceting\"]) {\r\n $sek_faceting = 'TRUE';\r\n } else {\r\n $sek_faceting = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_cardinality\"] == '1') {\r\n $sek_cardinality = 'TRUE';\r\n } else {\r\n $sek_cardinality = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_relationship\"] == '1') {\r\n $sek_relationship = 'TRUE';\r\n } else {\r\n $sek_relationship = 'FALSE';\r\n }\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n $stmt = \"UPDATE\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n SET\r\n sek_title = \" . $db->quote($_POST[\"sek_title\"]) . \",\r\n sek_desc = \" . $db->quote($_POST[\"sek_desc\"]) . \",\r\n\t\t\t\t\tsek_alt_title = \" . $db->quote($_POST[\"sek_alt_title\"]) . \",\r\n sek_meta_header = \" . $db->quote($_POST[\"sek_meta_header\"]) . \",\r\n\t\t\t\t\tsek_simple_used = \" . $sek_simple_used . \",\r\n\t\t\t\t\tsek_bulkchange = \" . $sek_bulkchange . \",\r\n\t\t\t\t\tsek_myfez_visible = \" . $sek_myfez_visible . \",\r\n\t\t\t\t\tsek_adv_visible = \" . $sek_adv_visible . \",\r\n\t\t\t\t\tsek_faceting = \" . $sek_faceting . \",\";\r\n if ($_POST[\"sek_order\"]) {\r\n $stmt .= \"sek_order = \" . $db->quote($_POST[\"sek_order\"], 'INTEGER') . \",\";\r\n }\r\n if (isset($_POST[\"sek_relationship\"])) {\r\n $stmt .= \"sek_relationship = \" . $sek_relationship . \",\";\r\n }\r\n if (isset($_POST[\"sek_cardinality\"])) {\r\n $stmt .= \"sek_cardinality = \" . $sek_cardinality . \",\";\r\n }\r\n\r\n $stmt .= \"\r\n sek_html_input = \" . $db->quote($_POST[\"field_type\"]) . \",\r\n sek_smarty_variable = \" . $db->quote($_POST[\"sek_smarty_variable\"]) . \",\r\n\t\t\t\t\tsek_lookup_function = \" . $db->quote($_POST[\"sek_lookup_function\"]) . \",\r\n\t\t\t\t\tsek_lookup_id_function = \" . $db->quote($_POST[\"sek_lookup_id_function\"]) . \",\r\n\t\t\t\t\tsek_suggest_function = \" . $db->quote($_POST[\"sek_suggest_function\"]) . \",\r\n\t\t\t\t\tsek_comment_function = \" . $db->quote($_POST[\"sek_comment_function\"]) . \",\r\n\t\t\t\t\tsek_derived_function = \" . $db->quote($_POST[\"sek_derived_function\"]) . \",\r\n\t\t\t\t\tsek_data_type = \" . $db->quote($_POST[\"sek_data_type\"]) . \",\r\n sek_fez_variable = \" . $db->quote($_POST[\"sek_fez_variable\"]);\r\n if (is_numeric($_POST[\"sek_cvo_id\"])) {\r\n $stmt .= \",sek_cvo_id = \" . $db->quote($_POST[\"sek_cvo_id\"], 'INTEGER');\r\n }\r\n $stmt .= \"\r\n WHERE sek_id = \" . $db->quote($sek_id);\r\n\r\n try {\r\n $db->exec($stmt);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return -1;\r\n }\r\n\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n /*\r\n * Should we create the table/column for this search key?\r\n */\r\n if ($_POST['create_sql']) {\r\n\r\n if ($_POST[\"sek_relationship\"] == 1) {\r\n\r\n /*\r\n * Create new table\r\n */\r\n return Search_Key::createSearchKeyDB($sek_id);\r\n\r\n } elseif ($_POST[\"sek_relationship\"] == 0) {\r\n\r\n /*\r\n * Create column which requires an alter\r\n */\r\n include_once(APP_INC_PATH . 'class.bgp_create_searchkey.php');\r\n\r\n /*\r\n * Because the alter might take a while, run in\r\n * a background process\r\n */\r\n $bgp = new BackgroundProcess_Create_SearchKey();\r\n $bgp->register(serialize(array('sek_id' => $sek_id)), Auth::getUserID());\r\n Session::setMessage('The column is being created as a background process (see My Fez to follow progress)');\r\n return 1;\r\n\r\n }\r\n }\r\n }",
"public function update(Request $request, IntentionToPay $intentionToPay)\n {\n //\n }",
"public function updated(HoldAmount $holdAmount)\n {\n //\n }",
"public function testUpdatePayslip()\n {\n }",
"public function update(Request $request, wallet $wallet)\n {\n //\n }",
"public function testUpdate()\n {\n\n // $payment = $this->payment\n // ->setEvent($this->eventId)\n // ->acceptCash()\n // ->acceptCheck()\n // ->acceptGoogle()\n // ->acceptInvoice()\n // ->acceptPaypal()\n // ->setCashInstructions($instructions)\n // ->setCheckInstructions($instructions)\n // ->setInvoiceInstructions($instructions)\n // ->setGoogleMerchantId($this->googleMerchantId)\n // ->setGoogleMerchantKey($this->googleMerchantKey)\n // ->setPaypalEmail($this->paypalEmail)\n // ->update();\n\n // $this->assertArrayHasKey('process', $payment);\n // $this->assertArrayHasKey('status', $payment['process']);\n // $this->assertTrue($payment['process']['status'] == 'OK');\n }",
"protected function _postUpdate()\n {\n \tif($this->_old_currency_code != $this->currency_code) {\n \t\t$pins = new \\Pin\\Pin();\n \t\t$pins->update(array(\n \t\t\t'currency_code' => $this->currency_code\t\t\n \t\t), array(\n \t\t\t'user_id = ?' => $this->user,\n \t\t\t'currency_code IS NOT NULL' => true\n \t\t));\n \t}\n }",
"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}",
"function update_price($symbol = null) {\n\n $whereCondition = \"WHERE user_id = \".$this->user->user_id.\" AND symbol = '\".$symbol.\"';\";\n DB::instance(DB_NAME)->update(\"transactions\", $_POST, $whereCondition);\n\n }",
"public function testUpdateProductUsingPOST()\n {\n }",
"public function update(Request $request, Kumpul_Tp $kumpul_Tp)\n {\n //\n }",
"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 }"
]
| [
"0.65465504",
"0.64529794",
"0.60469157",
"0.5990693",
"0.58008426",
"0.57362884",
"0.57291186",
"0.5711061",
"0.56581914",
"0.56432563",
"0.563268",
"0.56152546",
"0.56152546",
"0.5589125",
"0.5581432",
"0.5567886",
"0.5558687",
"0.55558026",
"0.55481434",
"0.5532721",
"0.55318004",
"0.55273724",
"0.5504676",
"0.5492893",
"0.54838765",
"0.5476533",
"0.5474662",
"0.5455523",
"0.5446356",
"0.5434433"
]
| 0.71354496 | 0 |
Can we run the migration? Requires the Braintree_Payments module to be installed | public function canRunMigration()
{
return Mage::helper('core')->isModuleEnabled('Braintree_Payments');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function shouldRunMigration()\n {\n return $this->canRunMigration()\n && !Mage::getStoreConfigFlag(self::MIGRATION_COMPLETE)\n && !Mage::getStoreConfig('payment/gene_braintree/merchant_id')\n && !Mage::getStoreConfig('payment/gene_braintree/sandbox_merchant_id');\n }",
"public function run(){\n \n //product\n if (!Schema::hasColumn('products', 'plus_option')) {\n Schema::table('products', function (Blueprint $table) {\n $table->boolean('plus_option')->default(true)->after('is_active');\n });\n }\n\n //coupons\n if (!Schema::hasColumn('coupons', 'times')) {\n Schema::table('coupons', function (Blueprint $table) {\n $table->integer('times')->default(0)->after('is_active');\n });\n }\n\n //option groups\n if (!Schema::hasColumn('option_groups', 'required')) {\n Schema::table('option_groups', function (Blueprint $table) {\n $table->boolean('required')->default(false)->after('multiple');\n });\n }\n\n //force migration for new tables\n if (!Schema::hasTable('coupon_user')) {\n Artisan::call('migrate --path=database/migrations/2021_08_07_124104_create_coupon_user_pivot_table.php --force');\n }\n\n //vendor min/max orders\n if (!Schema::hasColumn('vendor_types', 'color')) {\n Schema::table('vendor_types', function (Blueprint $table) {\n $table->string('color')->default(\"#000\")->after('name');\n });\n }\n\n //users\n if (!Schema::hasColumn('users', 'country_code')) {\n Schema::table('users', function (Blueprint $table) {\n $table->string('country_code')->nullable()->after('phone');\n });\n }\n\n }",
"public function migrate() {}",
"function sfgov_utilities_deploy_08_field_transactions_migration() {\n try {\n $transactionNodes = Utility::getNodes('transaction');\n $relatedServicesFieldMigration = new TopLevelFieldMigration();\n $relatedServicesFieldMigration->migrate($transactionNodes, 'field_transactions', 'field_related_content');\n } catch(\\Exception $e) {\n error_log($e->getMessage(), \"\\n\");\n }\n}",
"function chawa_db_transactions_install() {\n\tglobal $wpdb;\n\tglobal $chawa_table_ver_transactions;\n\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $table_name (\n\t\ttransaction_id varchar(50) DEFAULT 'chawa_000000000000000000000000' NOT NULL,\n\t\ttransaction_type varchar(50) NOT NULL,\n\t\ttransaction_status varchar(50) NOT NULL,\n\t\tsource_id varchar(50) NOT NULL,\n\t\tsource_status varchar(50) NOT NULL,\n\t\tcharge_id varchar(50) NOT NULL,\n\t\tcharge_status varchar(50) NOT NULL,\n\t\tuser_id mediumint(9) NOT NULL,\n\t\tamount varchar(50) NOT NULL,\n\t\trecurring BOOLEAN,\n\t\ttime datetime NOT NULL,\n\t\tPRIMARY KEY (transaction_id)\n\t) $charset_collate;\";\n\n\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\tdbDelta($sql);\n\n\tadd_option('chawa_table_ver_transactions', $chawa_table_ver_transactions);\n}",
"function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }",
"public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }",
"function setUpPayments() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n DB::execute(\"CREATE TABLE \" . TABLE_PREFIX . \"payment_gateways (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApplicationObject',\n raw_additional_properties longtext,\n is_default tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX type (type)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE \" . TABLE_PREFIX . \"payments (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApplicationObject',\n parent_type varchar(50) DEFAULT NULL,\n parent_id int unsigned NULL DEFAULT NULL,\n amount decimal(12, 3) DEFAULT 0,\n currency_id int(5) NULL DEFAULT NULL,\n gateway_type varchar(50) DEFAULT NULL,\n gateway_id int(10) unsigned NULL DEFAULT NULL,\n status enum('Paid', 'Pending', 'Deleted', 'Canceled') DEFAULT NULL,\n reason enum('Fraud', 'Refund', 'Other') DEFAULT NULL,\n reason_text text,\n created_by_id int(10) unsigned NULL DEFAULT NULL,\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n paid_on date DEFAULT NULL,\n comment text,\n raw_additional_properties longtext,\n PRIMARY KEY (id),\n INDEX type (type),\n INDEX parent (parent_type, parent_id),\n INDEX created_by_id (created_by_id),\n INDEX currency_id (currency_id),\n INDEX status (status),\n INDEX created_on (created_on),\n INDEX paid_on (paid_on)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?)', 'allow_payments', 'payments', serialize(false));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?)', 'allow_payments_for_invoice', 'payments', serialize(true));\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }",
"public function run()\n {\n\n\n //force migration for new tables\n if (!Schema::hasTable('sms_gateways')) {\n Artisan::call('migrate --path=database/migrations/2021_08_18_133903_create_sms_gateways_table.php --force');\n Artisan::call('db:seed --class=SmsGatewaysTableSeeder --force');\n }\n if (!Schema::hasTable('auto_assignments')) {\n Artisan::call('migrate --path=database/migrations/2021_08_20_214110_create_auto_assignments_table.php --force');\n }\n if (!Schema::hasTable('otps')) {\n Artisan::call('migrate --path=database/migrations/2021_08_22_143802_create_otps_table.php --force');\n }\n //twilio sms gateway\n $smsGateway = SmsGateway::where('slug', \"twilio\")->first();\n if (empty($smsGateway)) {\n \\DB::table('sms_gateways')->insert(array(\n 0 =>\n array(\n 'name' => 'Twilio',\n 'slug' => 'twilio',\n 'is_active' => 0,\n 'created_at' => now(),\n 'updated_at' => now(),\n ),\n ));\n }\n\n\n //vendors auto accept order\n if (!Schema::hasColumn('vendors', 'auto_accept')) {\n Schema::table('vendors', function (Blueprint $table) {\n $table->boolean('auto_accept')->default(false)->after('auto_assignment');\n });\n }\n //\n if (!Schema::hasColumn('package_type_pricings', 'multiple_stop_fee')) {\n Schema::table('package_type_pricings', function (Blueprint $table) {\n $table->double('multiple_stop_fee', 8, 2)->default(0.00)->after('base_price');\n });\n }\n \n //aading status to auto assignments\n if (!Schema::hasColumn('auto_assignments', 'status')) {\n Schema::table('auto_assignments', function (Blueprint $table) {\n $table->enum('status', ['pending', 'rejected'])->default('pending')->after('driver_id');\n });\n }\n \n \n }",
"public function supportsMigrations();",
"public function migrate()\n\t{\n\t}",
"function mhm_memberpress_clickbank_db_activate() {\n\tglobal $wpdb;\n\n\n\t$table_name = $wpdb->prefix . \"mhm_memberpress_clickbank_memberpress_products\";\n\tif($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) \n\t{\n\t\t\n\t\t$sql = \"CREATE TABLE \" . $table_name . \" (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\tmemberpress_id mediumint(9) NOT NULL,\n\t\t\tproduct_id mediumint(9) NOT NULL,\n\t\t\tprice VARCHAR(30) NOT NULL,\n\t\t\tsku VARCHAR(255),\n\t\t\tcreated_at timestamp,\n\n\t\t\tPRIMARY KEY (id)\n\n\t\t);\";\n\n\t\t$results = $wpdb->query( $sql );\n\n\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\tdbDelta($sql);\n\t}\n\n\n}",
"public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }",
"public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('CREATE TABLE payment_methods (id INT UNSIGNED AUTO_INCREMENT NOT NULL, gateway_config_id INT UNSIGNED DEFAULT NULL, code VARCHAR(255) NOT NULL, environment VARCHAR(255) DEFAULT NULL, is_enabled TINYINT(1) DEFAULT \\'0\\' NOT NULL, uuid CHAR(36) NOT NULL COMMENT \\'(DC2Type:uuid)\\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_4FABF983D17F50A6 (uuid), INDEX IDX_4FABF983F23D6140 (gateway_config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE payment_tokens (hash VARCHAR(255) NOT NULL, details LONGTEXT DEFAULT NULL COMMENT \\'(DC2Type:object)\\', after_url LONGTEXT DEFAULT NULL, target_url LONGTEXT NOT NULL, gateway_name VARCHAR(255) NOT NULL, PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE credit_cards (id INT UNSIGNED AUTO_INCREMENT NOT NULL, customer_id INT UNSIGNED DEFAULT NULL, token VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, last_four VARCHAR(4) NOT NULL, uuid CHAR(36) NOT NULL COMMENT \\'(DC2Type:uuid)\\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_5CADD653D17F50A6 (uuid), INDEX IDX_5CADD6539395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE payments (id INT UNSIGNED AUTO_INCREMENT NOT NULL, order_id INT UNSIGNED DEFAULT NULL, method_id INT UNSIGNED DEFAULT NULL, credit_card_id INT UNSIGNED DEFAULT NULL, currency_code VARCHAR(3) NOT NULL, amount INT NOT NULL, state VARCHAR(255) NOT NULL, details LONGTEXT DEFAULT NULL COMMENT \\'(DC2Type:array)\\', uuid CHAR(36) NOT NULL COMMENT \\'(DC2Type:uuid)\\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_65D29B32D17F50A6 (uuid), INDEX IDX_65D29B328D9F6D38 (order_id), INDEX IDX_65D29B3219883967 (method_id), INDEX IDX_65D29B327048FD0F (credit_card_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('CREATE TABLE gateway_configs (id INT UNSIGNED AUTO_INCREMENT NOT NULL, gateway_name VARCHAR(255) NOT NULL, factory_name VARCHAR(255) NOT NULL, config JSON NOT NULL COMMENT \\'(DC2Type:json_array)\\', uuid CHAR(36) NOT NULL COMMENT \\'(DC2Type:uuid)\\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_33BD31DCD17F50A6 (uuid), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');\n $this->addSql('ALTER TABLE payment_methods ADD CONSTRAINT FK_4FABF983F23D6140 FOREIGN KEY (gateway_config_id) REFERENCES gateway_configs (id)');\n $this->addSql('ALTER TABLE credit_cards ADD CONSTRAINT FK_5CADD6539395C3F3 FOREIGN KEY (customer_id) REFERENCES players (id)');\n $this->addSql('ALTER TABLE payments ADD CONSTRAINT FK_65D29B328D9F6D38 FOREIGN KEY (order_id) REFERENCES orders (id)');\n $this->addSql('ALTER TABLE payments ADD CONSTRAINT FK_65D29B3219883967 FOREIGN KEY (method_id) REFERENCES payment_methods (id)');\n $this->addSql('ALTER TABLE payments ADD CONSTRAINT FK_65D29B327048FD0F FOREIGN KEY (credit_card_id) REFERENCES credit_cards (id)');\n }",
"public function up() {\n\t\tSchema::table('sites', function (Blueprint $table) {\n\t\t\t$table->float('vat')->default(21)->after('country_id');\n\t\t});\n\n\t\t// Add vat to sites_payments\n\t\tSchema::table('sites_payments', function (Blueprint $table) {\n\t\t\t$table->float('payment_vat')->default(21)->after('payment_rate');\n\t\t});\n\n\t\t// Recalculate commissions\n\t\t\\App\\Models\\Site\\Payment::whereNotNull('reseller_id')->chunk(10, function ($payments) {\n\t\t\tforeach ($payments as $payment) \n\t\t\t{\n\t\t\t\t$payment_net_amount = $payment->payment_amount / ( ( 100 + $payment->payment_vat ) / 100 );\n\t\t\t\t$reseller_amount = $payment->reseller_fixed + ( $payment_net_amount * $payment->reseller_variable / 100 );\n\t\t\t\t$payment->update([\n\t\t\t\t\t'reseller_amount' => $reseller_amount,\n\t\t\t\t]);\n\t\t\t}\n\t\t});\n\t}",
"public function install() {\n global $wpdb;\n\n // cancel the installation process, if the requirements check returns errors\n $notices = (array) $this->check_requirements();\n if ( count( $notices ) ) {\n $this->logger->warning( __METHOD__, $notices );\n return;\n }\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n $table_terms_price = $wpdb->prefix . 'laterpay_terms_price';\n $table_history = $wpdb->prefix . 'laterpay_payment_history';\n $table_post_views = $wpdb->prefix . 'laterpay_post_views';\n $table_passes = $wpdb->prefix . 'laterpay_passes';\n\n $sql = \"\n CREATE TABLE $table_terms_price (\n id int(11) NOT NULL AUTO_INCREMENT,\n term_id int(11) NOT NULL,\n price double NOT NULL DEFAULT '0',\n revenue_model enum('ppu','sis') NOT NULL DEFAULT 'ppu',\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE $table_history (\n id int(11) NOT NULL AUTO_INCREMENT,\n mode enum('test','live') NOT NULL DEFAULT 'test',\n post_id int(11) NOT NULL DEFAULT 0,\n currency_id int(11) NOT NULL,\n price float NOT NULL,\n date datetime NOT NULL,\n ip int NOT NULL,\n hash varchar(56) NOT NULL,\n revenue_model enum('ppu','sis') NOT NULL DEFAULT 'ppu',\n pass_id int(11) NOT NULL DEFAULT 0,\n code varchar(6) NULL DEFAULT NULL,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE $table_post_views (\n id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n post_id int(11) NOT NULL,\n mode enum('test','live') NOT NULL DEFAULT 'test',\n date datetime NOT NULL,\n user_id varchar(32) NOT NULL,\n ip varbinary(16) NOT NULL,\n has_access int(1) NOT NULL DEFAULT 0,\n KEY idx_post_views_date_mode (date,mode),\n KEY idx_post_views_post_id_date_mode (post_id,date,mode)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE IF NOT EXISTS $table_passes (\n pass_id int(11) NOT NULL AUTO_INCREMENT,\n duration int(11) NULL DEFAULT NULL,\n period int(11) NULL DEFAULT NULL,\n access_to int(11) NULL DEFAULT NULL,\n access_category bigint(20) NULL DEFAULT NULL,\n price decimal(10,2) NULL DEFAULT NULL,\n revenue_model varchar(12) NULL DEFAULT NULL,\n title varchar(255) NULL DEFAULT NULL,\n description varchar(255) NULL DEFAULT NULL,\n is_deleted int(1) NOT NULL DEFAULT 0,\n PRIMARY KEY (pass_id),\n KEY access_to (access_to),\n KEY period (period),\n KEY duration (duration)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n add_option( 'laterpay_teaser_content_only', '1' );\n add_option( 'laterpay_plugin_is_in_live_mode', '0' );\n add_option( 'laterpay_sandbox_merchant_id', $this->config->get( 'api.sandbox_merchant_id' ) );\n add_option( 'laterpay_sandbox_api_key', $this->config->get( 'api.sandbox_api_key' ) );\n add_option( 'laterpay_live_merchant_id', '' );\n add_option( 'laterpay_live_api_key', '' );\n add_option( 'laterpay_global_price', $this->config->get( 'currency.default_price' ) );\n add_option( 'laterpay_global_price_revenue_model', 'ppu' );\n add_option( 'laterpay_currency', $this->config->get( 'currency.default' ) );\n add_option( 'laterpay_ratings', false );\n add_option( 'laterpay_bulk_operations', '' );\n add_option( 'laterpay_voucher_codes', '' );\n add_option( 'laterpay_gift_codes', '' );\n add_option( 'laterpay_voucher_statistic', '' );\n add_option( 'laterpay_gift_statistic', '' );\n add_option( 'laterpay_gift_codes_usages', '' );\n add_option( 'laterpay_purchase_button_positioned_manually', '' );\n add_option( 'laterpay_time_passes_positioned_manually', '' );\n add_option( 'laterpay_landing_page', '' );\n add_option( 'laterpay_only_time_pass_purchases_allowed', 0 );\n add_option( 'laterpay_is_in_visible_test_mode', 0 );\n add_option( 'laterpay_hide_free_posts', 0 );\n\n // advanced settings\n add_option( 'laterpay_sandbox_backend_api_url', 'https://api.sandbox.laterpaytest.net' );\n add_option( 'laterpay_sandbox_dialog_api_url', 'https://web.sandbox.laterpaytest.net' );\n add_option( 'laterpay_live_backend_api_url', 'https://api.laterpay.net' );\n add_option( 'laterpay_live_dialog_api_url', 'https://web.laterpay.net' );\n add_option( 'laterpay_api_merchant_backend_url', 'https://merchant.laterpay.net/' );\n add_option( 'laterpay_access_logging_enabled', 1 );\n add_option( 'laterpay_caching_compatibility', (bool) LaterPay_Helper_Cache::site_uses_page_caching() );\n add_option( 'laterpay_teaser_content_word_count', '60' );\n add_option( 'laterpay_preview_excerpt_percentage_of_content', '25' );\n add_option( 'laterpay_preview_excerpt_word_count_min', '26' );\n add_option( 'laterpay_preview_excerpt_word_count_max', '200' );\n add_option( 'laterpay_enabled_post_types', get_post_types( array( 'public' => true ) ) );\n add_option( 'laterpay_show_time_passes_widget_on_free_posts', '' );\n add_option( 'laterpay_maximum_redemptions_per_gift_code', 1 );\n add_option( 'laterpay_debugger_enabled', defined( 'WP_DEBUG' ) && WP_DEBUG );\n add_option( 'laterpay_api_fallback_behavior', 0 );\n add_option( 'laterpay_api_enabled_on_homepage', 1 );\n\n // keep the plugin version up to date\n update_option( 'laterpay_version', $this->config->get( 'version' ) );\n\n // update / remove plugin options\n $this->maybe_update_options();\n\n // clear opcode cache\n LaterPay_Helper_Cache::reset_opcode_cache();\n\n // update capabilities\n $laterpay_capabilities = new LaterPay_Core_Capability();\n $laterpay_capabilities->populate_roles();\n }",
"public static function activate() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"cf7_transactions\";\n $version = get_option( 'payro24_cf7_version', '1.0' );\n\n if ( $wpdb->get_var( \"show tables like '$table_name'\" ) != $table_name ) {\n $sql = \"CREATE TABLE $table_name (\n id mediumint(11) NOT NULL AUTO_INCREMENT,\n form_id bigint(11) DEFAULT '0' NOT NULL,\n trans_id VARCHAR(255) NOT NULL,\n track_id VARCHAR(255) NULL,\n gateway VARCHAR(255) NOT NULL,\n amount bigint(11) DEFAULT '0' NOT NULL,\n phone VARCHAR(11) NULL,\n description VARCHAR(255) NOT NULL,\n email VARCHAR(255) NULL,\n created_at bigint(11) DEFAULT '0' NOT NULL,\n status VARCHAR(255) NOT NULL,\n PRIMARY KEY id (id)\n );\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta( $sql );\n }\n\n if ( file_exists( ABSPATH . \"wp-config.php\" ) && is_writable( ABSPATH . \"wp-config.php\" ) ) {\n self::wp_config_put();\n } else if ( file_exists( dirname( ABSPATH ) . \"/wp-config.php\" ) && is_writable( dirname( ABSPATH ) . \"/wp-config.php\" ) ) {\n self::wp_config_put( '/' );\n } else {\n ?>\n <div class=\"error\">\n <p><?php _e( 'wp-config.php is not writable, please make wp-config.php writable - set it to 0777 temporarily, then set back to its original setting after this plugin has been activated.', 'payro24-contact-form-7' ); ?></p>\n </div>\n <?php\n exit;\n }\n\n $payro24_cf7_options = array(\n 'api_key' => '',\n 'return' => '',\n 'sandbox' => '1',\n 'currency' => 'rial',\n 'success_message' => __( 'Your payment has been successfully completed. Tracking code: {track_id}', 'payro24-contact-form-7' ),\n 'failed_message' => __( 'Your payment has failed. Please try again or contact the site administrator in case of a problem.', 'payro24-contact-form-7' ),\n );\n\n add_option( \"payro24_cf7_options\", $payro24_cf7_options );\n }",
"public function run()\n {\n PaymentMethod::insert(\n array(\n [\n 'name' => 'Mercado Pago',\n 'picture'=> 'visa-mastercard-amex.jpg',\n 'active' => 1\n ],\n [\n 'name' => 'Contra Entrega',\n 'picture'=> 'wire-transfer-white.png',\n 'active' => 1\n ],\n\n [\n 'name' => 'Transferencia bancaria',\n 'picture'=> 'wire-transfer-white.png',\n 'active' => 1\n ],\n\n )\n );\n }",
"public function installDb()\n\t{\n\t\treturn Db::getInstance()->Execute('\n\t\tCREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'stripepro_customer` (`id_stripe_customer` int(10) unsigned NOT NULL AUTO_INCREMENT,\n\t\t`stripe_customer_id` varchar(32) NOT NULL, `token` varchar(32) NOT NULL, `id_customer` int(10) unsigned NOT NULL,\n\t\t`cc_last_digits` int(11) NOT NULL, `date_add` datetime NOT NULL, PRIMARY KEY (`id_stripe_customer`), KEY `id_customer` (`id_customer`),\n\t\tKEY `token` (`token`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1') &&\n\t\tDb::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'stripepro_transaction` (`id_stripe_transaction` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`type` enum(\\'payment\\',\\'refund\\') NOT NULL,`source` varchar(32) NOT NULL DEFAULT \\'card\\',`btc_address` VARCHAR( 50 ) NOT NULL, `id_stripe_customer` int(10) unsigned NOT NULL, `id_cart` int(10) unsigned NOT NULL,\n\t\t`id_order` int(10) unsigned NOT NULL, `id_transaction` varchar(32) NOT NULL, `amount` decimal(10,2) NOT NULL, `status` enum(\\'paid\\',\\'unpaid\\',\\'uncaptured\\') NOT NULL,\n\t\t`currency` varchar(3) NOT NULL, `cc_type` varchar(16) NOT NULL, `cc_exp` varchar(8) NOT NULL, `cc_last_digits` int(11) NOT NULL,\n\t\t`cvc_check` tinyint(1) NOT NULL DEFAULT \\'0\\', `fee` decimal(10,2) NOT NULL, `mode` enum(\\'live\\',\\'test\\') NOT NULL,\n\t\t`date_add` datetime NOT NULL, `charge_back` tinyint(1) NOT NULL DEFAULT \\'0\\', PRIMARY KEY (`id_stripe_transaction`), KEY `idx_transaction` (`type`,`id_order`,`status`))\n\t\tENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1') && Db::getInstance()->Execute(\"CREATE TABLE IF NOT EXISTS `\"._DB_PREFIX_.\"stripepro_subscription` (\n `id_stripe_subscription` int(10) NOT NULL AUTO_INCREMENT,\n `stripe_subscription_id` varchar(32) NOT NULL,\n `stripe_customer_id` varchar(32) NOT NULL,\n `id_customer` int(11) NOT NULL,\n `stripe_plan_id` varchar(100) NOT NULL,\n `quantity` int(11) NOT NULL,\n `current_period_start` varchar(32) NOT NULL,\n `current_period_end` varchar(32) NOT NULL,\n `status` enum('trialing','active','past_due','canceled','unpaid') NOT NULL,\n `date_add` datetime NOT NULL,\n PRIMARY KEY (`id_stripe_subscription`)\n) ENGINE=\"._MYSQL_ENGINE_.\" DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\") && Db::getInstance()->Execute(\"CREATE TABLE IF NOT EXISTS `\"._DB_PREFIX_.\"stripepro_plans` (\n `id_stripe_plan` int(10) NOT NULL AUTO_INCREMENT,\n `stripe_plan_id` varchar(100) NOT NULL,\n `name` varchar(100) NOT NULL,\n `interval` enum('day','week','month','year') NOT NULL,\n `amount` float NOT NULL,\n `currency` varchar(3) NOT NULL,\n `interval_count` varchar(5) NOT NULL,\n `trial_period_days` int(5) NOT NULL,\n PRIMARY KEY (`id_stripe_plan`)\n) ENGINE=\"._MYSQL_ENGINE_.\" DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\");\n\t}",
"public function migrateDatabase();",
"public function handle()\n\t{\n\t\t$users = User::where('tier', '>=', '2')\n\t\t ->where('vip', FALSE)\n\t\t ->where('admin', FALSE)\n\t\t ->get();\n\n\t\t$num_stripe_active_paying_user = 0;\n\t\t$num_bt_active_paying_user = 0;\n\n\t\tforeach ($users as $user) {\n\n\t\t\t$user_tier = 1;\n\n\t\t\tif ($user->braintree_id != NULL) {\n\n\t\t\t\t\\Braintree_Configuration::environment('production');\n\t\t\t\t\\Braintree_Configuration::merchantId('4x5qk4ggmgf9t5vw');\n\t\t\t\t\\Braintree_Configuration::publicKey('vtq3w9x62s57p82y');\n\t\t\t\t\\Braintree_Configuration::privateKey('c578012b2eb171582133ed0372f3a2ae');\n\n\t\t\t\t$transactions = BraintreeTransaction::select('sub_id')->distinct()\n\t\t\t\t ->whereNotNull('sub_id')\n\t\t\t\t ->where('braintree_id', $user->braintree_id)->get();\n\t\t\t\tforeach ($transactions as $transaction) {\n\t\t\t\t\t$sub_id = $transaction->sub_id;\n\t\t\t\t\t$subscription = \\Braintree_Subscription::find($sub_id);\n\t\t\t\t\t$braintree_subscription = BraintreeSubscription::find($sub_id);\n\t\t\t\t\tif ($braintree_subscription == NULL) {\n\t\t\t\t\t\t$braintree_subscription = new BraintreeSubscription;\n\t\t\t\t\t}\n\t\t\t\t\t$braintree_subscription->subscription_id = $sub_id;\n\t\t\t\t\t$braintree_subscription->braintree_id = $user->braintree_id;\n\t\t\t\t\t$braintree_subscription->plan_id = $subscription->planId;\n\t\t\t\t\t$braintree_subscription->status = $subscription->status;\n\n\t\t\t\t\tif ($braintree_subscription->plan_id == 'MX970_depreciated') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($braintree_subscription->save()) {\n\t\t\t\t\t\tdump($braintree_subscription);\n\t\t\t\t\t\t$plan = $braintree_subscription->plan_id;\n\n\t\t\t\t\t\tif ($braintree_subscription->status == \"Active\") {\n\t\t\t\t\t\t\tif ($plan == \"0137\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 1;\n\t\t\t\t\t\t\t} else if ($plan == \"0297\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 10;\n\t\t\t\t\t\t\t} else if ($plan == \"MX370\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 2;\n\t\t\t\t\t\t\t} else if ($plan == \"MX297\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 2;\n\t\t\t\t\t\t\t} else if ($plan == \"MX970\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 20;\n\t\t\t\t\t\t\t} else if ($plan == \"0167\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 12;\n\t\t\t\t\t\t\t} else if ($plan == \"0197\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 11;\n\t\t\t\t\t\t\t} else if ($plan == \"0297\") {\n\t\t\t\t\t\t\t\t$user_tier = $user_tier + 12;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$user->tier = $user_tier;\n\t\t\t\tif ($user->save()) {\n\t\t\t\t\tif ($user->tier > 1) {\n\t\t\t\t\t\t$num_bt_active_paying_user++;\n\t\t\t\t\t}\n\t\t\t\t\techo $user->email . \" [$user_tier] saved!\\n\";\n\t\t\t\t} else {\n\t\t\t\t\techo $user->email . \" [$user_tier] failed to save!\\n\";\n\t\t\t\t}\n\t\t\t}\n\n//\t\t\telse {\n//\t\t\t\tif ($user->stripeDetails()->count() > 0) {\n//\t\t\t\t\t//Stripe User\n//\t\t\t\t\tforeach ($user->stripeDetails() as $stripe_detail) {\n//\t\t\t\t\t\t$stripe_id = $stripe_detail->stripe_id;\n//\n//\t\t\t\t\t\t$user_active_subscriptions = StripeActiveSubscription::where('stripe_id', $stripe_id)\n//\t\t\t\t\t\t ->whereRaw('(status = \\'active\\' OR status=\\'trialing\\')')->get();\n//\t\t\t\t\t\tforeach ($user_active_subscriptions as $active_sub) {\n//\n//\t\t\t\t\t\t\t$plan = $active_sub->subscription_id;\n//\n//\t\t\t\t\t\t\tif ($plan == \"0137\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 1;\n//\t\t\t\t\t\t\t} else if ($plan == \"0297\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 10;\n//\t\t\t\t\t\t\t} else if ($plan == \"MX370\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 2;\n//\t\t\t\t\t\t\t} else if ($plan == \"MX297\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 2;\n//\t\t\t\t\t\t\t} else if ($plan == \"MX970\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 20;\n//\t\t\t\t\t\t\t} else if ($plan == \"0167\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 11;\n//\t\t\t\t\t\t\t} else if ($plan == \"0197\") {\n//\t\t\t\t\t\t\t\t$user_tier = $user_tier + 11;\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$user->tier = $user_tier;\n//\t\t\t\t\tif ($user->save()) {\n//\t\t\t\t\t\tif ($user->tier > 1) {\n//\t\t\t\t\t\t\t$num_stripe_active_paying_user++;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\techo $user->email . \" [$user_tier] saved!\\n\";\n//\t\t\t\t\t} else {\n//\t\t\t\t\t\techo $user->email . \" [$user_tier] failed to save!\\n\";\n//\t\t\t\t\t}\n//\t\t\t\t} else {\n//\n//\t\t\t\t}\n//\t\t\t}\n\n\t\t}\n\n//\t\techo \"Total number of paying users via Stripe: $num_stripe_active_paying_user\\n\";\n\t\techo \"Total number of paying users via Braintree: $num_bt_active_paying_user\\n\";\n\t}",
"public function install()\r\n {\r\n $this->db->query('\r\n\t\t\tCREATE TABLE `' . DB_PREFIX . \"accept_cards_tokens` (\r\n\t\t\t\t`id` INT(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t`customer_id` BIGINT(20) NOT NULL,\r\n\t\t\t\t`card_subtype` VARCHAR(56) DEFAULT '' NOT NULL,\r\n\t\t\t\t`token` VARCHAR(56) DEFAULT '' NOT NULL,\r\n\t\t\t\t`masked_pan` VARCHAR(19) DEFAULT '' NOT NULL,\r\n\t\t\t\tKEY `customer_id` (`customer_id`),\r\n\t\t\t\tPRIMARY KEY `id` (`id`)\r\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;\r\n\t\t\");\r\n }",
"public function run()\n {\n PaymentGateway::firstOrCreate(['code' => 'paypal'], ['name' => 'PayPal']);\n\n PaymentGateway::firstOrCreate(['code' => 'stripe'], ['name' => 'Stripe']);\n\n PaymentGateway::firstOrCreate(['code' => 'coinpayments'], ['name' => 'Coinpayments']);\n\n PaymentGateway::firstOrCreate(['code' => 'ethereum'], ['name' => 'Ethereum']);\n\n PaymentGateway::firstOrCreate(['code' => 'tron'], ['name' => 'Tron']);\n }",
"public static function check_version() {\n\t\ttry {\n\t\t\t$current_version = get_option( self::CK_DB_VERSION, 0 );\n\t\t\t$version_keys = array_keys( self::$db_migrations );\n\t\t\tif ( version_compare( $current_version, '0', '>' ) && version_compare( $current_version, end( $version_keys ), '<' ) ) {\n\t\t\t\t// We migrate the Db for all blogs.\n\t\t\t\tself::install_db( true );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action(\n\t\t\t\t\t'admin_notices',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'WC_PostFinanceCheckout_Admin_Notices',\n\t\t\t\t\t\t'migration_failed_notices',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function task_verify_probed_wallets() {\n\n require 'Tasks/verify_probed_wallets/verify_probed_wallets.php';\n\n }",
"function migrate(){\n\n create_table();\n save_migration_tables();\n\n}",
"public function run() {\n\t\t//\n\n\n\t\t//\n\t\t// Let's clear the users table first\n\t\tPaymentMethod::truncate();\n\n\n\t\t$inputs = [\n\t\t\t['name' => 'Bank Deposit'],\n\t\t\t['name' => 'PayPal - Checkout'],\n\t\t];\n\t\tPaymentMethod::insert($inputs);\n\t}",
"public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}",
"public function run()\n {\n PaymentMethod::create([\n 'description_payment_methods'=>'P3'\n ]);\n }",
"public function install()\n {\n return parent::install()\n && $this->registerHook('payment')\n && $this->registerHook('paymentReturn')\n && $this->defaultConfiguration()\n && $this->createDatabaseTables();\n }"
]
| [
"0.6793458",
"0.5980437",
"0.5979496",
"0.5975387",
"0.5971543",
"0.59567803",
"0.5955138",
"0.5932166",
"0.5888833",
"0.5818952",
"0.575944",
"0.57486707",
"0.5665119",
"0.5664528",
"0.5661015",
"0.56197315",
"0.56167066",
"0.5601573",
"0.55725",
"0.5519048",
"0.5506389",
"0.55044866",
"0.54990613",
"0.5496951",
"0.5491865",
"0.5489866",
"0.548045",
"0.54782623",
"0.5475984",
"0.5471918"
]
| 0.8323674 | 0 |
Should the system run the migration tool automatically | public function shouldRunMigration()
{
return $this->canRunMigration()
&& !Mage::getStoreConfigFlag(self::MIGRATION_COMPLETE)
&& !Mage::getStoreConfig('payment/gene_braintree/merchant_id')
&& !Mage::getStoreConfig('payment/gene_braintree/sandbox_merchant_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isMigratingUp();",
"public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }",
"public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }",
"public function supportsMigrations();",
"public function migrationsToRun()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tfor ($i = 0; $i < count($manifestData); $i++)\n\t\t{\n\t\t\t$row = explode(';', $manifestData[$i]);\n\n\t\t\t// We found a migration\n\t\t\tif (UpdateHelper::isManifestMigrationLine($row[0]) && $row[1] == PatchManifestFileAction::Add)\n\t\t\t{\n\t\t\t\tBlocks::log('Found migration file: '.$row[0], \\CLogger::LEVEL_INFO);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function doMigrations() {\n\t\t$tbl = $this->tableManager->doMigrations();\n\t\t$fld = $this->fieldManager->doMigrations();\n\t\t$axs = $this->accessManager->doMigrations();\n\t\treturn $tbl && $fld && $axs;\n\t}",
"public function canRunMigration()\n {\n return Mage::helper('core')->isModuleEnabled('Braintree_Payments');\n }",
"private function run() {\n\t\tif ( $this->upgrade_schema->does_table_exist( $this->get_table() ) ) {\n\t\t\tif ( ! $this->upgrade_schema->does_column_exist( $this->get_table(), $this->get_column() ) ) {\n\t\t\t\t$this->upgrade_schema->add_column( $this->get_table(), $this->get_column(), $this->get_column_definition() );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function migrate()\n\t{\n\t}",
"public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}",
"public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }",
"function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }",
"public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }",
"public function testMigrateInstance()\n {\n $_result = \\Artisan::call('dfe:migrate-instance', ['--all']);\n }",
"public static function dbMigrate(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Migrate the database\n\t\t\tArtisan::call('migrate');\n\t\t}\n\t}",
"public function preExecuteCheck()\n {\n return true;\n }",
"public function migrationsNeeded() {\n\t\treturn $this->tableManager->migrationsNeeded() || $this->fieldManager->migrationsNeeded() || $this->accessManager->migrationsNeeded();\n\t}",
"public function __invoke()\n {\n $this->migrate();\n }",
"public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }",
"public function migrate() {}",
"public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }",
"public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }",
"public function migrate($execute = false)\n {\n }",
"function migrate($migrateTo){\n\t$settingsModel = new Settings;\n\t(int) $currentVersion = $settingsModel->getVersion();\n\t\n\t//Display current database version\n\tif($migrateTo == 'version'){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database is currently at version #\".$currentVersion.\"\\n\\n\");\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($migrateTo == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//Get migration scripts\n\t$migrations = scandir(APPLICATION_PATH.\"/../scripts/migrations\");\n\t\n\t//Get latest migration number and filter .. and .\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\t\n\t\t\t$latestMigration = $number;\n\t\t}\n\t}\n\t\n\t//decide whether to take user input or migrate to most recent version\n\tif(isset($migrateTo)){\n\t\t(int)$migrateTo = $migrateTo;\n\t} else {\n\t\t(int)$migrateTo = $latestMigration;\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($latestMigration == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//decide whether we are migrating up or down and order scripts accordingly\n\tif($migrateTo <= $currentVersion){\n\t\t$direction = 'down';\n\t\t$migrations = array_reverse($migrations);\n\t} else {\n\t\t$direction = 'up';\n\t}\n\t\n\t//build runFiles array\n\t$runFiles = array();\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t//get only the version number\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\tif($direction == 'up'){\n\t\t\t\tif($currentVersion < $number && $number <= $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($direction == 'down'){\n\t\t\t\tif($currentVersion >= $number && $number > $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\t//start counter at 0\n\t$migratedTo = 0;\n\n\t//cycle through scripts\n\tforeach($runFiles AS $file){\n\t\t//get only the version number\n\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$file));\n\t\t\n\t\t//get migration class name\n\t\t$className = ucwords(str_replace(\".php\",'',$file));\n\t\t\n\t\t//include dependencies\n\t\tinclude APPLICATION_PATH.'/../scripts/migrations/'.$file;\n\t\t\n\t\t//instantiate migration class\n\t\t$migration = new $className;\n\t\t\n\t\tif($direction == 'up'){\n\t\t\t//run up() migration method\n\t\t\t$migration->up();\n\t\t\t//mark as last migration run\n\t\t\t$migratedTo = $number;\n\t\t}\n\t\tif($direction == 'down'){\n\t\t\t//run down migration method\n\t\t\t$migration->down();\n\t\t\t//mark as lat migration run\n\t\t\t$migratedTo = $number - 1;\n\t\t}\n\t\t\n\t\t\n\t}\n\t//update db with new version number\n\t$settingsModel->setVersion($migratedTo);\n\t\n\t//output results to terminal\n\techo \"\\n\\n\";\n\techo \"Database Migrated to Version #\".$migratedTo;\n\techo \"\\n\\n\";\n\n}",
"public function doDatabaseUpdate()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\t$dbBackup = new DbBackup();\n\t\t\t\t$this->_dbBackupPath = $dbBackup->run();\n\t\t\t}\n\n\t\t\tif (blx()->migrations->runToTop())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t\t}\n\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\tif ($this->_backupDb)\n\t\t{\n\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t}\n\n\t\treturn false;\n\t}",
"function auto_migrate($last_migration_file = null) {\n\t\t$migrations = $this->migration;\n\n\n\t\ttry {\n\t\t\t# get last migration (if not given):\n\t\t\t$last_migration_file = $last_migration_file ??\n\t\t\t $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t} catch(Exception $e) {\n\t\t\ttry {\n\t\t\t\t// commit initial migration\n\t\t\t\t$this->_migrate('0.sql');\n\n\t\t\t\t// check if migration succeeded\n\t\t\t\t$last_migration_file = $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t\t} catch(Exception $e) {\n\t\t\t\t// initial migration failed, give up now\n\t\t\t\thttp_response_code(500);\n\t\t\t\techo 'the database could not be set-up. Please check your initial migration';\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t}\n\n\n\t\t// check if there is a migration file > last_migration and migrate it\n\n\t\t$migration_files = scandir('migrations');\n\t\t$migration_index = array_search($last_migration_file, $migration_files);\n\t\tif ($migration_index == null) {\n\t\t\t// file not found, just stop.\n\t\t\treturn;\n\t\t}\n\t\t$new_file = @$migration_files[$migration_index + 1];\n\t\tif ($new_file) {\n\t\t\t$this->_migrate($new_file);\n\n\t\t\t// continue checking the rest\n\t\t\t$this->auto_migrate($new_file);\n\t\t} // else: no files left\n\n\t}",
"public static function ignoreMigrations()\n {\n static::$runsMigrations = false;\n }",
"function migrate()\r\n\t{\r\n\t\treturn '';\r\n\t}",
"public function needsUpgrade() {\n $schema = $this->Version->Version->schema();\n\n // Needs upgrade\n if (isset($schema['version'])) {\n return;\n }\n\n // Do not need, 001 already set it as string\n // Unset actions, records and mappings, so it wont try again\n $this->migration = array(\n 'up' => array(),\n 'down' => array(),\n );\n $this->records = array();\n $this->mappings = array();\n }",
"protected function migration_process() {\n\t\t$available_languages = Fusion_Multilingual::get_available_languages();\n\t\tself::$available_languages = ( ! empty( $available_languages ) ) ? $available_languages : [ '' ];\n\n\t\t$this->migrate_options();\n\t}"
]
| [
"0.6954632",
"0.6761658",
"0.67213285",
"0.6699633",
"0.66636103",
"0.66186184",
"0.6539002",
"0.6516198",
"0.64371294",
"0.6427038",
"0.64209986",
"0.63902366",
"0.63767916",
"0.6326578",
"0.6326274",
"0.6321944",
"0.6288583",
"0.6277459",
"0.6220412",
"0.6210137",
"0.6162212",
"0.61569846",
"0.6142935",
"0.61418784",
"0.6139767",
"0.6130564",
"0.6129316",
"0.61093104",
"0.610671",
"0.61031"
]
| 0.7653 | 0 |
Sets the relative flag | public function relative($relative) {
$this->relative = (bool)$relative;
return $this->relative;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function relative($relative) {\n if (is_bool($relative)) {\n $this->relative = $relative;\n }\n return $this->relative;\n }",
"public function SetAbsolute ($absolute = TRUE);",
"public function setRelativePosition($value) {\r\n $this->relativePosition = $this->setDoubleProperty($this->relativePosition, $value);\r\n }",
"public function setRelativePath($txt)\n {\n $this->_relPath = $txt;\n }",
"public function setUseRelativeUrls(bool $enable): void\n {\n $this->relativeUrls = $enable;\n }",
"public function useRelativeUrls(): bool\n {\n return $this->relativeUrls;\n }",
"protected function setInitialRelativePath() {}",
"public function isRelative()\n {\n if($this->_address == $this->_request)\n return true;\n return false;\n }",
"public function setUseAbsoluteUri($flag = true)\n {\n $this->_useAbsoluteUri = ($flag) ? true : false;\n return $this;\n }",
"public function isRelativeUri() {\n return !$this->isAbsoluteUri();\n }",
"function wp_make_link_relative($link)\n {\n }",
"private static function setScriptRelativePath() {\n\t\tself::$_ScriptRelativePath = str_replace(\n\t\t\tself::getConfig()->getBasePath().self::getDirSeparator(), '', self::getScriptPath()\n\t\t);\n\t}",
"public function isRelative()\n {\n if (preg_match('~^https?:\\/\\/~i', $this->url) OR preg_match('~^\\/\\/~i', $this->url)) {\n return false;\n } else {\n return true;\n }\n }",
"private function compensateForProtocolRelativeUrl() {\n if (substr($this->preparedOrigin, 0, strlen(self::PROTOCOL_RELATIVE_START)) == self::PROTOCOL_RELATIVE_START) {\n $this->preparedOrigin = $this->protocolRelativeDummyScheme() . ':' . $this->preparedOrigin;\n $this->hasProtocolRelativeDummyScheme = true;\n $this->isProtocolRelative = true;\n }\n }",
"abstract protected function setIsAbsolute($str);",
"public function setAbsRefPrefix() {}",
"public static function absolutize($base, $relative)\n {\n }",
"public static function absolutize($base, $relative)\n {\n }",
"public function setServerRelativeUrl($value)\n {\n $this->setProperty(\"ServerRelativeUrl\", $value, true);\n }",
"public function yoast_allow_rel() {\n\t\tglobal $allowedtags;\n\t\t$allowedtags['a']['rel'] = array ();\n\t}",
"public function getRelativePath($relative_to_this_path = '')\n {\n $hold = getcwd();\n $target = $this->normalise($relative_to_this_path);\n chdir($target);\n $this->data = realpath($this->path);\n chdir($hold);\n\n return;\n }",
"public function setTargetRelativePath(string $relative_path) : Page {\n $this->relative_path = preg_replace(\n '/^\\.\\//',\n '',\n $relative_path\n );\n return $this;\n }",
"function adjust_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= '../';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}",
"public function fullpath($flag = true) {\n\t\t$this->fullpath = (boolean) $flag;\n\t\treturn $this;\n\t}",
"public function hasRelativePath()\n {\n return false;\n }",
"public function url(bool $relative = false): string\n {\n $parent = $this->model->parent()->panel()->url($relative);\n return $parent . '/' . $this->path();\n }",
"public function setForReferenceOnly($flag = true)\n {\n $this->forReferenceOnly = (boolean)$flag;\n }",
"public static function isRelative($path) {\n return !static::isAbsolute($path);\n }",
"function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}",
"function url_to_relative($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_RELATIVE_ROOT__, $url);\n}"
]
| [
"0.70307744",
"0.63239795",
"0.6143951",
"0.6117714",
"0.60353297",
"0.58966285",
"0.583431",
"0.57801837",
"0.5590096",
"0.5526776",
"0.5501168",
"0.5478037",
"0.545992",
"0.5452076",
"0.54490334",
"0.5442625",
"0.53240454",
"0.53238535",
"0.53065914",
"0.52629024",
"0.5260912",
"0.52275693",
"0.51987004",
"0.51864487",
"0.5156144",
"0.5143859",
"0.5118927",
"0.51179796",
"0.5117384",
"0.5019786"
]
| 0.7146466 | 0 |
Sets the from URLs array used for matching. | private function from_urls($from_urls) {
if (is_array($from_urls)) {
$this->from_urls = $from_urls;
}
return $this->from_urls;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setLinksFoundArray()\n { \n $cnt = count($this->links_found_url_descriptors);\n for ($x=0; $x<$cnt; $x++)\n {\n $UrlDescriptor = $this->links_found_url_descriptors[$x];\n \n // Convert $UrlDescriptor-object to an array\n $object_vars = get_object_vars($UrlDescriptor);\n \n $this->links_found[] = $object_vars;\n }\n }",
"public function setFrom(array $from = [])\r\n {\r\n if (empty($from)) {\r\n $from = []; //site default sender\r\n }\r\n\r\n $this->from = $this->formatFrom($from);\r\n return $this;\r\n }",
"public function testSetURLFromArray()\n {\n $url = 'http://example.com/';\n $this->assertEquals(\n $url,\n self::getProperty(\\Twitter\\Intents\\Tweet::fromArray(array( 'url' => $url )), 'url'),\n 'Failed to set URL from array'\n );\n }",
"protected function initSources(): self {\n if(preg_match_all(Templater::MARKERS['source'], $this->source, $matches)) {\n foreach($matches[0] as $marker) {\n if(!array_key_exists($marker, $this->sources)) { $this->sources[$marker] = null; }\n }\n }\n return $this;\n }",
"public function getUrls(): array;",
"public function getUrls(): array;",
"private function setQueryStrings()\n {\n $params = explode('?', $this->url);\n $queries = array();\n\n if (count($params) > 1) {\n $params = end($params);\n $relations = explode('&', $params);\n\n $queries = array();\n\n foreach ($relations as $relation) {\n $camps = explode('=', $relation);\n $queries[ $camps[0] ] = $camps[1];\n }\n }\n\n $this->querystrings = $queries;\n }",
"private function loadURLs() {\r\n $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\tforeach ($this->_url as $scriptname => $modes)\r\n\t{\r\n\t\t$this->url[$scriptname] = $modes[$status];\r\n\t}\r\n }",
"public function setUrls(?array $value): void {\n $this->getBackingStore()->set('urls', $value);\n }",
"public function setFrom($addresses);",
"private function loadURLs()\r\n\t{\r\n\t\t$status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\t\tforeach ($this->url as $scriptname => $modes)\r\n\t\t\t$this->url_script[$scriptname] = $modes[$status];\r\n\t}",
"public function updateAllShortURLs(){\n\t\t\tglobal $db;\n\t\t\t\n\t\t\t// We need to get the longURL and drawLink() to match...\n\t\t\tif($urls = $db->get_results(\"SELECT * FROM shorturls WHERE guid<=''\") ){\n\t\t\t\tforeach($urls as $url){\n\t\t\t\t\t// So now we have all of the unassigned urls...\n\t\t\t\t\t// ??????\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function setFrom($from) {\n\t\tif (is_array($from)) {\n\t\t\t$this->from = self::buildAddress(key($from), current($from), false);\n\t\t}\n\t\telse {\n\t\t\t$this->from = $from;\n\t\t}\n\t}",
"public function getUrls()\r\n {\r\n }",
"private static function setArray() {\n\tself::$requests = explode(\"/\", self::$uri);\n if(self::$requests[0] == 'api') {\n array_shift(self::$requests);\n self::$api = True;\n }\n }",
"function setServerURLs($serverURLs) {\n\t\t$this->m_serverURLs = $serverURLs;\n\t}",
"protected function setFrom() {}",
"public function from($from) {\n if (is_string($from)) {\n $this->fromValue = $from;\n\n /*\n * This URL set covers most of our usual use cases and URL variants for\n * development sites, etc.\n *\n * We don't filter this list according to the setting of\n * TigerfishDTLFilter->https as we want to catch instances where\n * HTTP and HTTPS versions of URLs have been used incorrectly in the site\n * content.\n */\n $this->from_urls(array(\n 'https://' . $this->fromValue,\n 'https://local.' . $this->fromValue,\n 'https://www.' . $this->fromValue,\n 'http://' . $this->fromValue,\n 'http://local.' . $this->fromValue,\n 'http://www.' . $this->fromValue,\n ));\n\n }\n return $this->fromValue;\n }",
"public function testSetAndGetUrls()\n {\n $this->getWeather->setUrls();\n $result = $this->getWeather->getUrls();\n\n $this->assertIsArray($result);\n }",
"public function getUrls() {\n return $this->urls;\n }",
"public function setPageUrls($urls);",
"protected function generateUrls()\n\t{\n\t\t// Video URL array\n\t\t$videoUrl = $this->videoUrl;\n\n\t\t// Array for URLs\n\t\t$urls\t= [];\n\n\t\t$query\t= '';\n\n\t\t$keywords = $this->keywords;\n\n\t\t// Check if there is at least one keyword\n\t\tif(count($keywords) < 1) return false;\n\n\t\t// Setup dev key\n\t\t$devKey = (! is_null($this->developerKey)) ? '&key=' . $this->developerKey : null;\n\n\t\t// Loop keywords\n\t\tforeach($keywords as $keyword)\n\t\t{\n\t\t\t// Check keyword string length\n\t\t\tif(strlen($keyword) < 4) continue;\n\n\t\t\tforeach($this->modList as $modword)\n\t\t\t{\n\t\t\t\t$query = str_replace('-', ' ', Str::slug($modword . ' ' . $keyword));\n\n\t\t\t\t$urls[] = $videoUrl . urlencode($query) . $devKey;\n\t\t\t}\n\t\t}\n\n\t\t// Update the URLs\n\t\t$this->urls = $urls;\n\n\t\treturn $urls;\n\t}",
"public function get_allowed_urls()\n {\n }",
"function thinkup_extract_urls_filter ( $tu_post ) {\n\n $regex = '/[a-z]+:\\/\\/[a-z0-9-_]+\\.[a-z0-9-_@:~%&\\?\\+#\\/.=]+[^:\\.,\\)\\s*$]/i';\n\n if ( preg_match_all($regex, $tu_post->wp_post->post_content, $matches) ) {\n\n $tu_post->links = array_merge($tu_post->links, $matches[0]);\n\n }\n\n return $tu_post;\n\n}",
"public function initUrlKeys();",
"public function validUrlProvider() : array\n {\n return Yaml::parseFile(__DIR__ . DIRECTORY_SEPARATOR . 'urls.yml')['valid'];\n }",
"public function set_video_url_list( $url_list ) {\n\n\t\t$this->video_url_list = array();\n\n\t\tforeach ( (array) $url_list as $url ) {\n\n\t\t\t$this->push_single_video_url( trim( $url ) );\n\t\t}\n\t}",
"private function getUrls() {\n\t\t// reassign the array because of a php bug (solved later with php 5.2.x @see: http://bugs.php.net/39449)\n\t\t$arr = $this->formData;\n\n\t\t// build bas URL for replacement variables\n\t\t$protocol\t= 'http'\n . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ? 's' : '' )\n . '://';\n\t\t$url\t\t= $_SERVER['HTTP_HOST'] . dirname( $_SERVER['PHP_SELF'] ) . '/';\n $url = str_replace( '//', '/', $url ); // some server add 2 /\n $url = $protocol . $url . 'index.php?route=payment/directebanking/';\n\n\t\tif( $this->_param['successUrlStd'] ) {\n\t\t\t$arr['user_variable_0'] = $url . 'success'\n\t\t\t. '&transaction=-TRANSACTION-&security_criteria=-SECURITY_CRITERIA-'\n\t\t\t. '&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['successUrl'] ) {\n\t\t\t\t$arr['user_variable_0'] = $this->_param['successUrl'];\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_param['cancelUrlStd'] ) {\n\t\t\t$arr['user_variable_1'] = $url . 'cancel'\n\t\t\t. '&transaction=-TRANSACTION-&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['cancelUrl'] ) {\n\t\t\t\t$arr['user_variable_1'] = $this->_param['cancelUrl'];\n\t\t\t}\n\t\t}\n\n\t\t// and reassign again\n\t\t$this->formData = $arr;\n\n\t\tunset( $arr );\n\t}",
"public function addAll(array $uris);",
"public function initCampaignLinks()\n\t{\n\t\t$this->collCampaignLinks = array();\n\t}"
]
| [
"0.624209",
"0.5642078",
"0.55370617",
"0.5502138",
"0.547881",
"0.547881",
"0.54528564",
"0.54377615",
"0.54377496",
"0.53958905",
"0.5381506",
"0.53243273",
"0.52862126",
"0.5280621",
"0.52668285",
"0.5263272",
"0.52441674",
"0.5214679",
"0.5199855",
"0.5187761",
"0.5154621",
"0.5149248",
"0.51100355",
"0.510482",
"0.51019925",
"0.5092234",
"0.5079989",
"0.5075433",
"0.50634855",
"0.50537086"
]
| 0.74515975 | 0 |
Copies the selected file to the storage system. If the project name is supplied, the file is stored under a directory having the name of the project. Else, the file is stored under the defined destination. | public function store($sourceFile, $projectName = null); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function copyStorageFileToLocalPath(StorageFile $file, $destinationPath);",
"abstract public function copyLocalFile($from, $to);",
"public function copyStorageFileToScratch(StorageFile $file);",
"public function transferTo($destFolder);",
"public function copy($path, $target)\n {\n \n }",
"private function appCopy()\n {\n global $boot;\n\n $boot->eol(1);\n $boot->echo('Adding Project: ' . $this->newName);\n\n foreach ($this->data as $n => $data) {\n $path = $this->rootDir . $data->generatePath;\n $boot->mkdir($path);\n $file = $this->rootDir . $data->generate;\n $content = '';\n\n if (!empty($data->templatePath)) {\n $content = file_get_contents($this->rootDir . $data->templatePath . $data->template);\n\n if (!empty($data->replace)) {\n $content = strtr($content, $data->replace);\n }\n file_put_contents($file, $content);\n }\n\n// $t = 1;\n\n if ($data->dirOnly && $data->sourceDir) {\n ZFileHelper::copyDirectory($this->rootDir . $data->sourceDir, $path);\n\n $source_path = ZFileHelper::findFiles($path);\n if (!empty($data->replace)) {\n foreach ($source_path as $inner_path) {\n $content = file_get_contents($inner_path);\n $content = strtr($content, $data->replace);\n file_put_contents($inner_path, $content);\n }\n }\n\n /*if (!$data->affectFileToo)\n continue;*/\n\n\n }\n\n }\n }",
"public function copy($dest)\r\n {\r\n $this->getDatabase()->copy($this->getPath(), $dest);\r\n }",
"public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }",
"public function copy($file, $new_file);",
"public function copy($name){\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\tcopy($this->path, $newPath);\n\t}",
"public function copy($source, $destination);",
"public function copyFiles($destination);",
"public function storeForProjectGallery(UploadedFile $file, Project $project){\n //TODO write image to the local storage\n }",
"function upload_file($src, $dest){\t\n\t\tif(!empty($src)){\t\t\t\n\t\t\t// copy the file to the image path\t\t\t\n\t\t\tif(!copy($src, $dest)){\n\t\t\t\techo 'failed to copy the file';\n\t\t\t}else{\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}",
"public function copyFilesTo()\r\n {\r\n // check 'FROM' permission\r\n $from_gid = $this->input->get_post('gid') ?: '-1';\r\n if ( ! $this->_is_group_viewer($from_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n // check 'TO' permission\r\n $to_gid = $this->input->get_post('to_gid') ?: '-1';\r\n if ( ! $this->_is_group_editor($to_gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n\r\n // check crumb\r\n $this->_check_path_crumb();\r\n\r\n // insert userlog\r\n $to_access_full_path = $this->_get_access_full_path($to_gid, $this->_get_path('to_path'));\r\n $details = lang('miiicloud-files-userlog_copy_to', NULL, array('path' => $to_access_full_path));\r\n $this->_insert_userlog(Userlog_model::FILE_COPY, $details);\r\n\r\n $from_access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $rtn = $this->files_model->copy_files_to($from_access_full_path, $to_access_full_path, $filenames_arr);\r\n $format = $this->input->get_post('format');\r\n if ($format == 'json' || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'))\r\n {\r\n $this->_outputJSON($rtn);\r\n }\r\n\r\n // return to folder\r\n $folder_url = '/files?' . $this->files_model->build_query_string();\r\n header('Location: ' . $folder_url);\r\n }",
"abstract public function copyLocalDir($from, $to);",
"public function storeLocalSource($localCopy, $destination)\n\t{\n\t\t$maxCachedImageSize = $this->getCachedCloudImageSize();\n\n\t\t// Resize if constrained by maxCachedImageSizes setting\n\t\tif ($maxCachedImageSize > 0 && ImageHelper::isImageManipulatable($localCopy))\n\t\t{\n\n\t\t\t$image = craft()->images->loadImage($localCopy);\n\n\t\t\tif ($image instanceof Image)\n\t\t\t{\n\t\t\t\t$image->setQuality(100);\n\t\t\t}\n\n\t\t\t$image->scaleToFit($maxCachedImageSize, $maxCachedImageSize)->saveAs($destination);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($localCopy != $destination)\n\t\t\t{\n\t\t\t\tIOHelper::copyFile($localCopy, $destination);\n\t\t\t}\n\t\t}\n\t}",
"public function uploadSource()\n {\n $entity = $this->getEntity();\n $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);\n $uploader->skipDbProcessing(true);\n $result = $uploader->save(self::getWorkingDir());\n $extension = pathinfo($result['file'], PATHINFO_EXTENSION);\n\n $uploadedFile = $result['path'] . $result['file'];\n if (!$extension) {\n unlink($uploadedFile);\n Mage::throwException(Mage::helper('storelocator')->__('Uploaded file has no extension'));\n }\n\n $sourceFile = self::getWorkingDir() . $entity;\n\n $sourceFile .= '.' . $extension;\n\n if (strtolower($uploadedFile) != strtolower($sourceFile)) {\n if (file_exists($sourceFile)) {\n unlink($sourceFile);\n }\n\n if (!@rename($uploadedFile, $sourceFile)) {\n Mage::throwException(Mage::helper('storelocator')->__('Source file moving failed'));\n }\n }\n\n // trying to create source adapter for file and catch possible exception to be convinced in its adequacy\n try {\n $this->_getSourceAdapter($sourceFile);\n } catch (Exception $e) {\n unlink($sourceFile);\n Mage::throwException($e->getMessage());\n }\n\n return $sourceFile;\n }",
"public function make($filename, $destination);",
"public function copy_file_to_device($local_file_path, $local_file_name, $destination_file_path, $destination_file_name)\r\n\t{\r\n\t\tif ($this->_device_type == 'cisco') {\r\n\r\n\t\t} elseif ($this->_device_type == 'bairos') {\r\n\r\n\t\t} elseif ($this->_device_type == 'directvstb') {\r\n\r\n\t\t} elseif ($this->_device_type == 'routeros') {\r\n\t\t\t\r\n\t\t\t$upload_file = new Thelist_Routeros_command_uploadfile($this, $local_file_path, $local_file_name, $destination_file_path, $destination_file_name);\r\n\t\t\treturn $upload_file->execute();\r\n\r\n\t\t} elseif ($this->_device_type == 'linuxserver') {\r\n\t\t\t\r\n\t\t\t$upload_file = new Thelist_Linuxserver_command_uploadfile($this, $local_file_path, $local_file_name, $destination_file_path, $destination_file_name);\r\n\t\t\treturn $upload_file->execute();\r\n\r\n\t\t} else {\r\n\t\r\n\t\t\t$trace = debug_backtrace();\r\n\t\t\t$method = $trace[0][\"function\"];\r\n\t\r\n\t\t\tthrow new exception(\"\".$method.\" is not defined for \".$this->_device_type.\"\", 1200);\r\n\t\t}\r\n\t}",
"protected function publishFile($from, $to)\n {\n if ($this->files->exists($to) && !$this->option('force')) {\n return;\n }\n\n $this->createParentDirectory(dirname($to));\n\n $this->files->copy($from, $to);\n }",
"public function store(Request $request)\n {\n //\n $this ->validate($request,[\n 'file' => 'nullable|max:1900'\n ]);\n if ($request->hasFile('file')) {\n #get file with Storage::extension(filePath);\n $filenamewithex = $request->file('file')->getClientOriginalName();\n //get file name file\n $filename = pathinfo($filenamewithex, PATHINFO_FILENAME);\n //get just ext\n $extension = $request -> file('file')->getClientOriginalExtension();\n //file to store\n $filetostore = $filename.'_'.time().'.'.$extension ;\n //upload file #endregion\n $path = $request -> file('file')->storeAs('path(public/projects)',$filetostore) ;\n\n\n } else {\n # code...\n $filetostore = 'noproject';\n }\n\n\n $project = Project::create([\n 'name' => $request->input('name'),\n 'website' => $request->input('website'),\n 'status' => $request ->input('status'),\n 'category' => $request->input('category'),\n 'file' => $filetostore ,\n 'company_id' => $request->input('company_id'),\n 'user_id' => Auth::user()->id\n\n ]);\n\n if($project){\n if (Auth::user()->role_id == 1 ) {\n //dd($project);\n return view('admins.home',['project',$project->id])->with('project' , $project->id);\n return redirect()->route('projects.store')->with('project' , $project->id);\n }\n\n return view('clients.projects.show')->with('project' , $project->id);\n }\n\n return back()->withInput()->with('errors', 'Error creating new project');\n\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function store(Request $request) \n {\n //dd($request->all());\n\n $newproject = Project::create([\n 'name' => $request['name'],\n 'systemID' => app('system')->id, // from appServiceprovider\n 'description' => $request['description'],\n 'location' => $request['location'],\n 'city' => $request['city'],\n 'state' => $request['state'],\n 'imageFileName' => null,\n 'created_at' => Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon::now()->toDateTimeString(),\n ]);\n\n \n if($request->hasFile('imageFileName')) {\n $file = $request->file('imageFileName');\n\n if($file) {\n $filename = 'project' . '_' . app('system')->id . '_' . $newproject->id . '_' . $file->getClientOriginalName();\n\n $stored = Storage::disk('public')->put($filename, File::get($file));\n\n $project = Project::find($newproject->id);\n $project->imageFileName = $filename;\n\n if($stored)\n $project->imageFileName = $filename;\n else\n $project->imageFileName = \"file not stored\";\n\n $project->save();\n } \n }\n return redirect('projects');\n }",
"function copy($src, $dest = null) {\n \n if (!$dest) {\n $dest = $src;\n \t$src = $this->_file;\n }\n \n if (Fire_File_Helper::isFile($src)) {\n \tif (!@copy($src, $dest)) {\n Fire_Error::throwError(sprintf('Failed to copy \"%s\" to \"%s\".',\n $src,\n $dest\n ), __FILE__, __LINE__\n );\n } \n } else {\n Fire_Error::throwError(sprintf('\"%s\" was not found as valid file.',\n $src\n ), __FILE__, __LINE__\n );\n }\n }",
"function duplicateFile( $src, $dst, $replaceFileTarget=false , &$result)\n\t{\n\t if( strpos( $dst, $src ) === 0 ){\n\t \t// if the copy is not into the same folder\n\t \tif($src != $dst )\n\t \t{\n\t\t \t$result['state'] = 'ERROR';\n\t\t \t$result['message'] = 'Non puoi copiare una cartella dentro se stessa o una cartella figlia!';\n\t\t \treturn;\n\t \t}\n\t } \n\t \n\t if ( file_exists($dst) )\n\t {\n\t \t// if we want replace the target\n\t \tif($replaceFileTarget)\n\t \t{\n\t \t\tif($src == $dst ) return; // cna't replace self\n\t \t\t$this->removeFile($dst); // remove file or folder\n\t \t}\n\t \telse\n\t \t{\n\t \t\t// if the copy is made into the same folder\n\t \t\tif($src == $dst )\n\t \t\t{\n\t \t\t\t$path_parts = pathinfo($dst);\n\t \t\t\t$fileExtension = '';\n\t \t\t\tif( isset( $path_parts['extension'] )) $fileExtension = '.'.$path_parts['extension'];\n\t\t\t\t \n\t \t\t\t// append 'copy' at the end of the filename\n\t \t\t\tif( is_file($dst) )\n\t \t\t\t{\n\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy'.$fileExtension;\n\t\t\t\t\t$num = 1;\n\t\t\t\t\twhile( file_exists( $dst ) ) { \t\t\t\n\t\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy '.$num.$fileExtension;\n\t\t\t\t\t\t$num++;\n\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\telse if( is_dir($dst) )\n\t \t\t\t{\n\t \t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy';\n\t\t\t\t\t$num = 1;\n\t\t\t\t\twhile( file_exists( $dst ) ) { \t\t\t\n\t\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy '.$num;\n\t\t\t\t\t\t$num++;\n\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\t// add the paths to the list of existents files ( to send to the client for replacing request )\n\t \t\t\t$result['state'] = 'EXISTENT_FILES';\n\t\t\t \t$fileToReplace = array();\n\t\t\t \t$fileToReplace['sourcePath'] = $src;\n\t\t\t \t$fileToReplace['targetPath'] = $dst;\n\t\t\t \tarray_push( $result['existentFiles'] , $fileToReplace );\n\t\t\t \treturn;\n\t \t\t}\n\n\t \t}\n\t } \n\t \n\t if (file_exists($src))\n\t {\n\t\t if (is_dir($src))\n\t\t {\n\t\t if( ! mkdir($dst)) exit;\n\t\t $files = scandir($src);\n\t\t foreach ($files as $file)\n\t\t {\n\t\t \tif ($file != \".\" && $file != \"..\") $this->duplicateFile(\"$src/$file\", \"$dst/$file\", $replaceFileTarget , $result);\n\t\t }\n\t\t \n\t\t }\n\t\t else if (is_file($src))\n\t\t {\n\t\t \tif( ! copy($src, $dst) ) exit;\n\t\t }\n\t } \n\t \n\n}",
"public function copy($path, $newpath)\n {\n }",
"protected function copyFileRequest(Requests\\CopyFileRequest $request)\n {\n // verify the required parameter 'src_path' is set\n if ($request->srcPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $srcPath when calling copyFile');\n }\n // verify the required parameter 'dest_path' is set\n if ($request->destPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $destPath when calling copyFile');\n }\n\n $resourcePath = '/slides/storage/file/copy/{srcPath}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->destPath !== null) {\n $queryParams['destPath'] = ObjectSerializer::toQueryValue($request->destPath);\n }\n // query params\n if ($request->srcStorageName !== null) {\n $queryParams['srcStorageName'] = ObjectSerializer::toQueryValue($request->srcStorageName);\n }\n // query params\n if ($request->destStorageName !== null) {\n $queryParams['destStorageName'] = ObjectSerializer::toQueryValue($request->destStorageName);\n }\n // query params\n if ($request->versionId !== null) {\n $queryParams['versionId'] = ObjectSerializer::toQueryValue($request->versionId);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"srcPath\", $request->srcPath);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }",
"public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }"
]
| [
"0.61989295",
"0.5870429",
"0.57550645",
"0.57374996",
"0.57236904",
"0.56876945",
"0.56661314",
"0.56074524",
"0.55708444",
"0.556004",
"0.5504543",
"0.55019796",
"0.54269797",
"0.5424",
"0.5389043",
"0.538511",
"0.5384046",
"0.53829277",
"0.53541386",
"0.5336523",
"0.53348553",
"0.52960104",
"0.5249567",
"0.5247429",
"0.5243026",
"0.5222749",
"0.5216524",
"0.5206934",
"0.5198172",
"0.5191375"
]
| 0.6104249 | 1 |
$lib = new LibraryGenerator(); | public function setUp()
{
//$lib->setName('Dom');
$class = new ClassGenerator(/*$lib*/);
$class->setNamespaceName('DOM');// MySQL => my_sql_
$class->setName('Node');
$method = new MethodGenerator(/*parent, options*/);
$method->setParentGenerator($class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function library()\n\t{\n\t\n\t}",
"function __autoload($class)\n{\n require LIBS.$class.\".php\";\n}",
"abstract protected function newGenerator(GeneratorConfiguration $config);",
"public function getGenerator(): \\Generator;",
"function &generator()\r\n {\r\n if ( $this->Generator == false )\r\n {\r\n include_once( \"ezarticle/classes/\" . $this->RendererFile );\r\n $this->Generator = new $this->RendererClass( $this->Article, $this->Template );\r\n }\r\n\r\n return $this->Generator;\r\n }",
"function __autoload($class){\nrequire LIBS.$class.\".php\";\n}",
"public function generator() {}",
"public function make() {}",
"public function make();",
"function instances()\n {\n echo \"There are \" . Library::$libraries . \" libraries.\";\n }",
"public function __construct()\n {\n\n $this->docuVaultGeneratorRepo = new DocuVaultGeneratorRepository();\n }",
"public function getGenerator();",
"public function getGenerator();",
"public static function getLibrary() {}",
"public function generator();",
"function __autoload($class) {\n include './libs/class_'.$class.'.php';\n}",
"public function generate() {}",
"public function generate() {}",
"public function generate() {}",
"public function generate() {}",
"public function generate() {}",
"public function generate() {}",
"public function generate() {}",
"public abstract function make();",
"public function generate();",
"public function generate();",
"public function generate();",
"public function generate();",
"public function generate();",
"function __constructor(){}"
]
| [
"0.68695176",
"0.61995757",
"0.6194395",
"0.6187042",
"0.61674494",
"0.615329",
"0.6148352",
"0.6142824",
"0.6110546",
"0.6110405",
"0.60697436",
"0.6066225",
"0.6066225",
"0.60583204",
"0.6045767",
"0.59969515",
"0.5977964",
"0.5977964",
"0.5977903",
"0.5977903",
"0.5977903",
"0.5977903",
"0.5977903",
"0.5954573",
"0.5904792",
"0.5904792",
"0.5904792",
"0.5904792",
"0.5904792",
"0.5878298"
]
| 0.64018804 | 1 |
WordPress Options implementation for Discussion Settings. | function add_settings_fields_options_discussion() {
sae_add_settings_section( 'article', __( 'Default article settings' ), 'settings_section_article_before', 'discussion' );
sae_add_settings_field( 'default_pingback_flag', '', 'checkbox', 'discussion', 'article', array(
'skip_title' => true,
'label' => __( 'Attempt to notify any blogs linked to from the article' ),
) );
sae_add_settings_field( 'default_ping_status', '', 'checkbox', 'discussion', 'article', array(
'skip_title' => true,
'label' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles' ),
) );
sae_add_settings_field( 'default_comment_status', '', 'checkbox', 'discussion', 'article', array(
'skip_title' => true,
'label' => __( 'Allow people to post comments on new articles' ),
) );
sae_add_settings_section( 'comment', __( 'Other comment settings' ), null, 'discussion' );
sae_add_settings_field( 'require_name_email', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Comment author must fill out name and email' ),
) );
if ( ! get_option( 'users_can_register' ) && is_multisite() ) {
sae_add_settings_field( 'comment_registration', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Users must be registered and logged in to comment' ),
'description' => __( 'Signup has been disabled. Only members of this site can comment.' ),
) );
} else {
sae_add_settings_field( 'comment_registration', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Users must be registered and logged in to comment' ),
) );
}
sae_add_settings_field( 'close_comments_for_old_posts', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Automatically close comments on old articles: enter the number of days in the field below' ),
) );
sae_add_settings_field( 'close_comments_days_old', __( 'Number of days after which comments will be automatically closed' ), 'number', 'discussion', 'comment', array(
'input_class' => 'small-text',
'min' => '0',
'step' => '1',
) );
sae_add_settings_field( 'thread_comments', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Enable threaded (nested) comments: set the number of levels in the field below' ),
) );
/**
* Filters the maximum depth of threaded/nested comments.
*
* @since 2.7.0.
*
* @param int $max_depth The maximum depth of threaded comments. Default 10.
*/
$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
for ( $depth_index = 2; $depth_index <= $maxdeep; $depth_index++ ) {
$thread_comments_depth_choices[ $depth_index ] = $depth_index;
}
sae_add_settings_field( 'thread_comments_depth', __( 'Nested comments levels deep' ), 'select', 'discussion', 'comment', array(
'choices' => $thread_comments_depth_choices,
) );
sae_add_settings_field( 'page_comments', '', 'checkbox', 'discussion', 'comment', array(
'skip_title' => true,
'label' => __( 'Break comments into pages' ),
) );
sae_add_settings_field( 'comments_per_page', __( 'Number of top level comments per page' ), 'number', 'discussion', 'comment', array(
'input_class' => 'small-text',
'min' => '0',
'step' => '1',
) );
sae_add_settings_field( 'default_comments_page', __( 'Comments page displayed by default' ), 'select', 'discussion', 'comment', array(
'choices' => array(
'newest' => __( 'last page' ),
'oldest' => __( 'first page' ),
)
) );
sae_add_settings_field( 'comment_order', __( 'Comments to display at the top of each page' ), 'select', 'discussion', 'comment', array(
'choices' => array(
'asc' => __( 'older comments' ),
'desc' => __( 'newer comments' ),
)
) );
sae_add_settings_section( 'notifications', __( 'Notifications' ), null, 'discussion' );
sae_add_settings_field( 'comments_notify', '', 'checkbox', 'discussion', 'notifications', array(
'skip_title' => true,
'label' => __( 'Email me when anyone posts a comment' ),
) );
sae_add_settings_field( 'moderation_notify', '', 'checkbox', 'discussion', 'notifications', array(
'skip_title' => true,
'label' => __( 'Email me when a comment is held for moderation' ),
) );
sae_add_settings_section( 'moderation', __( 'Comment moderation' ), null, 'discussion' );
sae_add_settings_field( 'comment_moderation', '', 'checkbox', 'discussion', 'moderation', array(
'skip_title' => true,
'label' => __( 'Before a comment appears, it must be manually approved' ),
) );
sae_add_settings_field( 'comment_whitelist', '', 'checkbox', 'discussion', 'moderation', array(
'skip_title' => true,
'label' => __( 'Before a comment appears, the comment author must have a previously approved comment' ),
) );
sae_add_settings_field( 'comment_max_links', __( 'Number of links in a comment after which it will be held in the moderation queue' ), 'number', 'discussion', 'moderation', array(
'input_class' => 'small-text',
'min' => '0',
'step' => '1',
'description' => __( 'A common characteristic of comment spam is a large number of links.' ),
) );
sae_add_settings_field( 'moderation_keys', __( 'Moderation words' ), 'textarea', 'discussion', 'moderation', array(
'rows' => '10',
'cols' => '50',
'input_class' => 'large-text code',
'description' => sprintf(
__( 'When a comment contains any of these words in its content, name, URL, email, or IP, it will be held in the %1$smoderation queue%2$s. One word or IP per line. It will match inside words, so “press” will match “WordPress”.' ),
'<a href="edit-comments.php?comment_status=moderated">',
'</a>'
),
) );
sae_add_settings_field( 'blacklist_keys', __( 'Comment blacklist' ), 'textarea', 'discussion', 'moderation', array(
'rows' => '10',
'cols' => '50',
'input_class' => 'large-text code',
'description' => __( 'When a comment contains any of these words in its content, name, URL, email, or IP, it will be put in the trash. One word or IP per line. It will match inside words, so “press” will match “WordPress”.' )
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ci_cptr_plugin_options() {\n\t\n\tif ( !current_user_can('manage_options') )\n\t{\n\t\twp_die( __('You do not have sufficient permissions to access this page.') );\n\t}\n\t?>\n\t<div class=\"wrap\" id=\"cptr-options\">\n\t\t<!--<h2><?php echo sprintf(__('CSSIgniter Custom Post Types Relationships v%s - Settings', 'cptr'), CPTR_VERSION); ?></h2>-->\n\t\t<h2><?php echo sprintf(__('CSSIgniter Custom Post Types Relationships', 'cptr'), CPTR_VERSION); ?></h2>\n\t\t<p><?php _e(\"In this page you can define general options for the Custom Post Types Relationships plugin. All options here can be overridden manually by passing the appropriate parameters to the shortcode or the theme function. If you find yourself making changes here that don't have any effect, it's because your WordPress theme has hardcoded options for you, so check with the theme's developer.\", 'cptr'); ?></p>\n\t\t<p><?php echo sprintf(__('For complete usage instructions, please visit the <a href=\"%s\">plugin\\'s homepage</a>.', 'cptr'), 'http://www.cssigniter.com/ignite/custom-post-types-relationships/'); ?></p>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php settings_fields('ci_cptr_plugin_settings'); ?>\n\t\n\t\t\t<?php\n\t\t\t\t$options = get_option(CI_CPTR_PLUGIN_OPTIONS);\n\t\t\t\t$options = ci_cptr_plugin_settings_validate($options);\n\t\t\t?>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Max number of displayed related posts:', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[limit]\" type=\"text\" value=\"<?php echo $options['limit']; ?>\" class=\"small-text\" />\n\t\t\t\t\t\t<p><?php _e('Set to 0 for no limit.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Show the excerpt for each post?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[excerpt]\" type=\"checkbox\" value=\"1\" <?php checked($options['excerpt'], 1); ?> />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('How many words the excerpt should be?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[words]\" type=\"text\" value=\"<?php echo $options['words']; ?>\" class=\"small-text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Display the thumbnail?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[thumb]\" type=\"checkbox\" value=\"1\" <?php checked($options['thumb'], 1); ?> />\n\t\t\t\t\t\t<p><?php _e('The thumbnail will be displayed after the title and before the excerpt.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Thumbnail size', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<label><?php _e('Width', 'cptr'); ?></label>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[width]\" type=\"text\" value=\"<?php echo $options['width']; ?>\" class=\"small-text\" />\n\t\t\t\t\t\t<label><?php _e('Height', 'cptr'); ?></label>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[height]\" type=\"text\" value=\"<?php echo $options['height']; ?>\" class=\"small-text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><h3><?php _e('Display Options', 'cptr'); ?></h3></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t \n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Metabox title', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[metabox_name]\" type=\"text\" value=\"<?php echo $options['metabox_name']; ?>\" class=\"regular-text\" />\n\t\t\t\t\t\t<p><?php _e('This is the title of the metabox that the users will see while in the post edit screens.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Allowed roles', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<p><?php _e('Select the roles that will have access to the plugin (i.e. can create/delete relationships).', 'cptr'); ?></p>\n\t\t\t\t\t\t<fieldset class=\"allowed-roles\">\n\t\t\t\t\t\t\t<?php cptr_checkbox_roles(CI_CPTR_PLUGIN_OPTIONS.'[allowed_roles][]', $options['allowed_roles']); ?>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Allowed post types', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<p><?php _e('Select the post types that the plugin will be available to.', 'cptr'); ?></p>\n\t\t\t\t\t\t<fieldset class=\"allowed-post-types\">\n\t\t\t\t\t\t\t<?php cptr_checkbox_post_types(CI_CPTR_PLUGIN_OPTIONS.'[allowed_post_types][]', $options['allowed_post_types']); ?>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t</table>\n\t\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n\t\t\t</p>\n\t\t</form>\n\t</div>\n\t\n\t<?php\n}",
"function post_options()\n\t{\n\t\tglobal $auth;\n\n\t\t$this->auth_bbcode = ($auth->acl_get('u_blogbbcode')) ? true : false;\n\t\t$this->auth_smilies = ($auth->acl_get('u_blogsmilies')) ? true : false;\n\t\t$this->auth_img = ($auth->acl_get('u_blogimg')) ? true : false;\n\t\t$this->auth_url = ($auth->acl_get('u_blogurl')) ? true : false;\n\t\t$this->auth_flash = ($auth->acl_get('u_blogflash')) ? true : false;\n\n\t\tblog_plugins::plugin_do('post_options');\n\t}",
"function sec_site_options(){\n\t\t$options_array = array(\n\t\t\tarray(\n\t\t\t\t'type' \t=> \t'multi',\n\t\t\t\t'col'\t=> 1,\n\t\t\t\t'title' => __( 'Post Type Settings', 'pagelines' ),\n\t\t\t\t'opts'\t=> array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key'\t=>\t'disable_public_pt',\n\t\t\t\t\t\t'type'\t=> 'check',\n\t\t\t\t\t\t'label'\t=> __( 'Set Projects Post Type to Private.', 'pagelines' ),\n\t\t\t\t\t\t'help'\t=> __( 'Disable Single Project Post view.', 'pagelines' ),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\treturn $options_array;\n\t}",
"function the_champ_options_init(){\r\n\tregister_setting('the_champ_facebook_options', 'the_champ_facebook', 'the_champ_validate_options');\r\n\tregister_setting('the_champ_login_options', 'the_champ_login', 'the_champ_validate_options');\r\n\tregister_setting('the_champ_sharing_options', 'the_champ_sharing', 'the_champ_validate_options');\r\n\tregister_setting('the_champ_counter_options', 'the_champ_counter', 'the_champ_validate_options');\r\n\tregister_setting('the_champ_general_options', 'the_champ_general', 'the_champ_validate_options');\r\n\tif((the_champ_social_sharing_enabled() || the_champ_social_counter_enabled() || the_champ_social_commenting_enabled()) && current_user_can('manage_options')){\r\n\t\t// show option to disable sharing on particular page/post\r\n\t\t$post_types = get_post_types( array('public' => true), 'names', 'and');\r\n\t\t$post_types = array_unique( array_merge($post_types, array('post', 'page')));\r\n\t\tforeach($post_types as $type){\r\n\t\t\tadd_meta_box('the_champ_meta', 'Super Socializer', 'the_champ_sharing_meta_setup', $type);\r\n\t\t}\r\n\t\t// save sharing meta on post/page save\r\n\t\tadd_action('save_post', 'the_champ_save_sharing_meta');\r\n\t}\r\n}",
"public function get_options(){\n $this->options = [\n 'items' => get_post_meta( $this->ID, 'opt_items' ),\n 'margin' => get_post_meta( $this->ID, 'opt_margin' ),\n 'loop' => get_post_meta( $this->ID, 'opt_loop' ),\n 'nav' => get_post_meta( $this->ID, 'opt_nav' ),\n 'dots' => get_post_meta( $this->ID, 'opt_dots' ),\n 'autoplay' => get_post_meta( $this->ID, 'opt_autoplay' ),\n 'autoplaySpeed' => get_post_meta( $this->ID, 'opt_autoplaySpeed' ),\n ];\n }",
"function get_options() {\r\n\t\t\t$set_options = array(\r\n\t\t\t\t'plugin_css' => true, \r\n\t\t\t\t'home' => true,\r\n\t\t\t\t'single' => true,\r\n\t\t\t\t'page' => true,\r\n\t\t\t\t'archive' => true,\r\n\t\t\t\t'search' => true,\r\n\t\t\t\t'feed' => true,\r\n\t\t\t\t'attachment' => true,\r\n\t\t\t\t'tag' => true,\r\n\t\t\t\t'category' => true,\r\n\t\t\t\t'date' => true,\r\n\t\t\t\t'author' => true,\r\n\t\t\t\t'the_content' => true,\r\n\t\t\t\t'the_excerpt' => true,\r\n\t\t\t\t'the_comment' => false,\r\n\t\t\t\t'excluded_cats' => array(),\r\n\t\t\t\t'excluded_ids' => array()\r\n\t\t\t\t);\r\n\t\t\t$options = get_option($this->options_name);\r\n\t\t\tif (!empty($options)) {\r\n\t\t\t\tforeach ($options as $key => $option)\r\n\t\t\t\t\t$set_options[$key] = $option;\r\n\t\t\t}else{\r\n\t\t\t\tupdate_option($this->options_name, $set_options);\r\n\t\t\t}\r\n\t\t\treturn $set_options;\r\n\t\t}",
"public function set_options()\n {\n // Attempt to retrieve our feature default settings so that we can compare against our post types query\n $defaults = get_option(self::FEATURE_DEFAULTS);\n\n // Retrieve all post types for the given instance and filter down to only publicly accessible types\n $types = get_post_types([\n 'public' => true,\n 'show_in_menu' => true,\n 'exclude_from_search' => false\n ]);\n\n // Remove all post types that we don't want to support duplication for\n $post_types = array_keys(\n array_filter(\n $types,\n function ($key) {\n return !in_array($key, ['attachment']);\n },\n ARRAY_FILTER_USE_KEY\n )\n );\n\n $this->defaults = [\n 'post_types' => $post_types\n ];\n\n // We don't want to ALWAYS update our feature defaults option unless\n // we know that new post types have been added/deleted\n if (isset($defaults) && $post_types === $defaults['post_types']) {\n return;\n }\n\n update_option(self::FEATURE_DEFAULTS, $this->defaults);\n }",
"public static function getOldVersionOptions(){\n\n\t\t$options = WordpressConnect::getDefaultOptions();\n\n\t\t// general options\n\t\t$language = get_option( WPC_OPTIONS_LANGUAGE );\n\t\tif ( $language !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_LANGUAGE ] = $language; \n\t\t\tdelete_option( WPC_OPTIONS_LANGUAGE ); \n\t\t}\n\n\t\t$app_id = get_option( WPC_OPTIONS_APP_ID );\n\t\tif ( $app_id !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_APP_ID ] = $app_id;\n\t\t\tdelete_option( WPC_OPTIONS_APP_ID ); \n\t\t}\n\n\t\t$app_admins = get_option( WPC_OPTIONS_APP_ADMINS );\n\t\tif ( $app_admins !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_APP_ADMINS ] = $app_admins;\n\t\t\tdelete_option( WPC_OPTIONS_APP_ADMINS ); \n\t\t}\n\n\t\t$image = get_option( WPC_OPTIONS_IMAGE_URL );\n\t\tif ( $image !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_IMAGE_URL ] = $image;\n\t\t\tdelete_option( WPC_OPTIONS_IMAGE_URL ); \n\t\t}\n\n\t\t$description = get_option( WPC_OPTIONS_DESCRIPTION );\n\t\tif ( $description !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_DESCRIPTION ] = $description;\n\t\t\tdelete_option( WPC_OPTIONS_DESCRIPTION ); \n\t\t}\n\n\t\t// comments\n\n\t\t$comments_number = get_option( WPC_OPTIONS_COMMENTS_NUMBER );\n\t\tif ( $comments_number !== FALSE && is_int( $comments_number ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_COMMENTS_NUMBER ] = $comments_number;\n\t\t\tdelete_option( WPC_OPTIONS_COMMENTS_NUMBER );\n\t\t}\n\n\t\t$comments_width = get_option( WPC_OPTIONS_COMMENTS_WIDTH );\n\t\tif ( $comments_width !== FALSE && is_int( $comments_width ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_COMMENTS_WIDTH ] = $comments_width;\n\t\t\tdelete_option( WPC_OPTIONS_COMMENTS_WIDTH );\n\t\t}\n\n\t\t$comments_display_homepage = get_option( WPC_OPTIONS_COMMENTS_SHOW_ON_HOMEPAGE );\n\t\tif ( $comments_display_homepage !== FALSE && !empty( $comments_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_COMMENTS_SHOW_ON_HOMEPAGE );\n\n\t\t$comments_display_categories = get_option( WPC_OPTIONS_COMMENTS_SHOW_ON_CATEGORIES );\n\t\tif ( $comments_display_homepage !== FALSE && !empty( $comments_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_COMMENTS_SHOW_ON_CATEGORIES );\n\t\t\n\t\t// like button\n\n\t\t$like_layout = get_option( WPC_OPTIONS_LIKE_BUTTON_LAYOUT );\n\t\tif ( $like_layout !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_LAYOUT ] = $like_layout; \n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_LAYOUT );\n\t\t}\n\n\t\t$like_width = get_option( WPC_OPTIONS_LIKE_BUTTON_WIDTH );\n\t\tif ( $like_width !== FALSE && is_int( $like_width ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_COMMENTS_WIDTH ] = $like_width;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_WIDTH );\n\t\t}\n\n\t\t$like_show_faces = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_FACES );\n\t\tif ( $like_show_faces !== FALSE && !empty( $like_show_faces ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FACES ] = WPC_OPTION_ENABLED;\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FACES ] = WPC_OPTION_DISABLED; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_FACES );\n\t\t\n\t\t$like_verb = get_option( WPC_OPTIONS_LIKE_BUTTON_VERB );\n\t\tif ( $like_verb !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_VERB ] = $like_verb;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_VERB );\n\t\t}\n\n\t\t$like_font = get_option( WPC_OPTIONS_LIKE_BUTTON_FONT );\n\t\tif ( $like_font !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FONT ] = $like_font;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_FONT );\n\t\t}\n\n\t\t$like_display_homepage = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_HOMEPAGE );\n\t\tif ( $like_display_homepage !== FALSE && !empty( $like_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_HOMEPAGE );\n\n\n\t\t$like_display_categories = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_CATEGORIES );\n\t\tif ( $like_display_categories !== FALSE && !empty( $like_display_categories ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_CATEGORIES );\n\t\t\n\t\treturn $options;\n\n\t}",
"function init_integrated_options() {\n\t\t$this->permalink_sections();\n\n\t}",
"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 section_optionator( $settings ){\n\t\t$settings = wp_parse_args($settings, $this->optionator_default);\n\t\t$opt_array = array(\n\t\t\t'tm_candy_open' => array(\n\t\t\t\t'title'\t\t\t=> 'Show at the start',\n\t\t\t\t'type' \t=> 'check',\n\t\t\t\t'inputlabel' \t=> __( 'Show at the start', $this->domain ),\n\t\t\t\t'shortexp' \t\t=> 'Default: Hidden',\n\t\t\t\t'exp' \t\t=> 'Check if you want to show the notification when the page is loaded, by default the notification area is hidden and it show the ribbon to open it.'\n\t\t\t),\n\t\t\t'tm_candys_set' \t=> array(\n\t\t\t\t'type' \t\t\t=> 'select_taxonomy',\n\t\t\t\t'taxonomy_id'\t=> $this->tax_id,\n\t\t\t\t'title' \t\t=> __('Select notiofication set to show', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('The set to show', $this->domain),\n\t\t\t\t'inputlabel'\t=> __('Select a set', $this->domain),\n\t\t\t\t'exp' \t\t\t=> __('if don\\'t select a set it will show all notification entries', $this->domain)\n\t\t\t),\n\t\t\t'tm_candys_items' => array(\n\t\t\t\t'type' \t\t\t=> 'count_select',\n\t\t\t\t'inputlabel'\t=> __('Number of notifications to show', $this->domain),\n\t\t\t\t'title' \t\t=> __('Number of notifications', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('Default value is 1', $this->domain),\n\t\t\t\t'count_start'\t=> 1, \n \t\t\t\t'count_number'\t=> 5,\n\t\t\t),\n\t\t\t'tm_candys_pause_on_hover' => array(\n\t\t\t\t'type'\t\t\t=> 'check',\n\t\t\t\t'title'\t\t\t=> __('Pause on hover', $this->domain),\n\t\t\t\t'inputlabel'\t=> __('Pause on hover', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('', $this->domain),\n\t\t\t\t'exp'\t\t\t=> __('Determines whether the timeout between transitions should be paused \"onMouseOver\"', $this->domain)\n\t\t\t),\n\t\t\t'tm_candys_duration_pause' \t=> array(\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t\t'inputlabel'\t=> __('Pause Duration', $this->domain),\n\t\t\t\t'title' \t\t=> __('Pause Duration', $this->domain),\n\t\t\t\t'shortexp'\t\t=> '',\n\t\t\t\t'exp'\t\t\t=> __('The amount of milliseconds the carousel will pause. 1000 = 1 second', $this->domain),\n\t\t\t),\n\n\t\t\t\t\n\t\t);\n\n\t\t$settings = array(\n\t\t\t'id' \t\t=> $this->id.'_meta',\n\t\t\t'name' \t\t=> $this->name,\n\t\t\t'icon' \t\t=> $this->icon, \n\t\t\t'clone_id'\t=> $settings['clone_id'], \n\t\t\t'active'\t=> $settings['active']\n\t\t);\n\n\t\tregister_metatab($settings, $opt_array);\n\t\t\n\t}",
"function wpmantis_set_options()\n{\n\t$options = array(\n\t\t'mantis_soap_url' => 'http://yoursite.com/bugs/api/soap/mantisconnect.php?wsdl',\n\t\t'mantis_user' => 'wordpress',\n\t\t'mantis_password' => 'password',\n\t\t'mantis_base_url' => 'http://yoursite.com',\n\t\t'mantis_max_desc_lenght' => 25,\n\t\t'mantis_statuses' => array(\n\t\t\t'10' => __('New', 'wp-mantis'),\n\t\t\t'20' => __('Feedback', 'wp-mantis'),\n\t\t\t'30' => __('Acknowledged', 'wp-mantis'),\n\t\t\t'40' => __('Confirmed', 'wp-mantis'),\n\t\t\t'50' => __('Assigned', 'wp-mantis'),\n\t\t\t'80' => __('Resolved', 'wp-mantis'),\n\t\t\t'90' => __('Closed', 'wp-mantis')\n\t\t),\n\t\t'mantis_colors' => array(\n\t\t\t'10' => '#fcbdbd',\n\t\t\t'20' => '#e3b7eb',\n\t\t\t'30' => '#ffcd85',\n\t\t\t'40' => '#fff494',\n\t\t\t'50' => '#c2dfff',\n\t\t\t'80' => '#d2f5b0',\n\t\t\t'90' => '#c9ccc4'\n\t\t),\n\t\t'mantis_enable_pagination' => true,\n\t\t'mantis_bugs_per_page' => 8\n\t);\n\n}",
"function pm_initialize_options() {\n if( false == get_option( 'pm_display_options' ) ) {\n add_option( 'pm_display_options' );\n } // end if \n \n // First, we register a section. This is necessary since all future options must belong to a \n add_settings_section( \n 'general_settings_section',\t\t\t// ID used to identify this section and with which to register options \n 'Display Options',\t\t\t\t\t// Title to be displayed on the administration page \n 'pm_general_options_callback',\t\t// Callback used to render the description of the section \n 'pm_display_options'\t\t\t\t// Page on which to add this section of options \n ); \n \n // Next, we'll introduce the fields for toggling the visibility of content elements. \n add_settings_field( \n 'walled_garden',\t\t\t\t\t// ID used to identify the field throughout the theme \n 'Walled Garden',\t\t\t\t\t// The label to the left of the option interface element \n 'pm_toggle_walled_garden_callback',\t// The name of the function responsible for rendering the option interface \n 'pm_display_options',\t\t\t\t// The page on which this option will be displayed \n 'general_settings_section',\t\t\t// The name of the section to which this field belongs \n array(\t\t\t\t\t\t\t\t// The array of arguments to pass to the callback. In this case, just a description. \n 'Require users to be logged-in to access the site.' \n ) \n ); \n\n // Finally, we register the fields with WordPress \n register_setting( \n 'pm_display_options', \n 'pm_display_options' \n ); \n \n}",
"private function load_options() {\r\n\t\t$this->options = get_option( 'conditional_captcha_options', array() );\r\n\r\n\t\t// If it looks like first run, check compat\r\n\t\tif ( empty( $this->options ) && version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {\r\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\r\n\t\t\tdeactivate_plugins( __FILE__ );\r\n\t\t\tif ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )\r\n\t\t\t\texit( 'Conditional CAPTCHA requires WordPress version 3.4 or greater.' );\r\n\t\t}\r\n\r\n\t\t// if db_version has changed...\r\n\t\tif( !isset( $this->options['db_version'] ) || $this->options['db_version'] != self::db_version ) {\r\n\t\t\t$defaults = array(\r\n\t\t\t\t'captcha-type' => 'default', 'pass_action' => 'hold',\r\n\t\t\t\t'recaptcha-private-key' => '', 'recaptcha-public-key' => '', 'recaptcha_use_new_api' => false,\r\n\t\t\t\t'fail_action' => 'spam', 'style' => '', 'prompt_text' => '', 'akismet_no_login' => false, 'akismet_no_history' => false\r\n\t\t\t);\r\n\r\n\t\t\t// set defaults if they don't exist\r\n\t\t\tforeach( $defaults as $k => $v ) {\r\n\t\t\t\tif( !isset( $this->options[$k] ) ) {\r\n\t\t\t\t\t$this->options[$k] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// this was renamed\r\n\t\t\tif( isset( $this->options['trash'] ) ) {\r\n\t\t\t\t$this->options['fail_action'] = $this->options['trash'];\r\n\t\t\t}\r\n\r\n\t\t\t// remove old options\r\n\t\t\tunset( $this->options['noscript'] );\r\n\t\t\tunset( $this->options['trash'] );\r\n\t\t\tunset( $this->options['recaptcha_lang'] );\r\n\t\t\tunset( $this->options['recaptcha_theme'] );\r\n\r\n\t\t\t// don't store CSS if it's the default\r\n\t\t\tif( trim( str_replace( \"\\r\\n\", \"\\n\", file_get_contents( $this->cssfile ) ) ) == trim( str_replace( \"\\r\\n\", \"\\n\", $this->options['style'] ) ) )\r\n\t\t\t\t$this->options['style'] = '';\r\n\r\n\t\t\t$this->options['db_version'] = self::db_version;\r\n\t\t\tupdate_option('conditional_captcha_options', $this->options);\r\n\t\t}\r\n\t}",
"public function get_plugin_settings_page() { ?>\r\n\t\t<p>Configure the default MF-Timeline settings below. You can override these settings when calling the shortcode in your posts or the function in your templates.</p>\r\n\t\r\n\t\t<form action=\"options.php\" method=\"POST\">\r\n\t\t\t<?php\r\n\t\t\t\tglobal $wp_taxonomies, $wp;\r\n\t\t\t\t$nonhierarchical = null;\r\n\t\t\t\t\r\n\t\t\t\tsettings_fields( 'mf_timeline_settings' );\r\n\t\t\t\t$options = get_option( 'mf_timeline' );\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"mf_timeline[db_version]\" value=\"<?php echo $options['db_version']; ?>\" />\r\n\t\t\t\r\n\t\t\t<h3>General Settings</h3>\r\n\t\t\t<fieldset>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<label for=\"mf_timeline[options][timeline_nav]\"><strong>Timeline Years Menu:</strong></label><br/>\r\n\t\t\t\t\t\t<select name=\"mf_timeline[options][timeline_nav]\" id=\"mf_timeline[options][timeline_nav]\" style=\"width: 100px;\">\r\n\t\t\t\t\t\t\t<option value=\"1\" <?php selected( '1', $options['options']['timeline_nav'] ); ?>>Show</option>\r\n\t\t\t\t\t\t\t<option value=\"0\" <?php selected( '0', $options['options']['timeline_nav'] ); ?>>Hide</option>\r\n\t\t\t\t\t\t</select><br/>\r\n\t\t\t\t\t\t<span class=\"description\">Appears fixed next to the timeline allowing the user to navigate past events more easily.</span>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t</ul>\r\n\t\t\t</fieldset>\r\n\t\t\t<h3>Wordpress Content</h3>\r\n\t\t\t<fieldset>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<h4>Include content from:</h4>\r\n\t\t\t\t\t\t<?php foreach( get_post_types( '', 'object' ) as $key=>$post_type ) :?>\r\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"mf_timeline[options][wp][content][<?php echo $key;?>]\" id=\"mf_timeline[options][wp][content][<?php echo $key;?>]\" value=\"1\" <?php checked( '1', $options['options']['wp']['content'][$key] ); ?> />\r\n\t\t\t\t\t\t\t<label for=\"mf_timeline[options][wp][content][<?php echo $key;?>]\"><?php _e( $post_type->labels->name ); ?></label><br />\r\n\t\t\t\t\t\t<?php endforeach;?>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<h4>Filter by the following taxonomies:</h4>\r\n\t\t\t\t\t\t<p class=\"description clear\">Leave blank to not filter by taxonomies.</p>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<?php if ( is_array( $wp_taxonomies ) ) : ?>\r\n\t\t\t\t\t\t\t<?php foreach ( $wp_taxonomies as $tax ) :?>\r\n\t\t\t\t\t\t\t\t<?php if ( !in_array( $tax->name, array( 'nav_menu', 'link_category', 'podcast_format' ) ) ) : ?>\r\n\t\t\t\t\t\t\t\t\t<?php if ( !is_taxonomy_hierarchical( $tax->name ) ) : // non-hierarchical ?>\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$nonhierarchical .= '<p class=\"alignleft\"><label for=\"mf_timeline[options][wp][filter][term][' . esc_attr($tax->name).']\"><strong>' . esc_html( $tax->label ) . ': </strong></label><br />';\r\n\t\t\t\t\t\t\t\t\t\t\t$nonhierarchical .= '<input type=\"text\" name=\"mf_timeline[options][wp][filter][term][' . esc_attr( $tax->name ) . ']\" id=\"mf_timeline[options][wp][filter][term][' . esc_attr( $tax->name ) . ']\" class=\"widefloat\" style=\"margin-right: 2em;\" value=\"' . $options['options']['wp']['filter']['term'][$tax->name] . '\" /></p>';\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t<?php else: // hierarchical ?>\r\n\t\t\t\t\t\t\t\t\t\t <div class=\"categorychecklistbox\">\r\n\t\t\t\t\t\t\t\t\t\t\t<label><strong><?php echo $tax->label;?></strong><br />\r\n\t\t\t\t\t\t\t\t \t<ul class=\"categorychecklist\">\r\n\t\t\t\t\t\t\t\t\t \t\t<?php $terms = get_terms( $tax->name );?>\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<?php foreach( $terms as $term ) :?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"mf_timeline[options][wp][filter][taxonomy][<?php echo $term->term_id;?>]\" id=\"mf_timeline[options][wp][filter][taxonomy][<?php echo $term->term_id;?>]\" value=\"1\" <?php checked('1', $options['options']['wp']['filter']['taxonomy'][$term->term_id]); ?> />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"mf_timeline[options][wp][filter][taxonomy][<?php echo esc_html($term->term_id);?>]\"><?php echo $term->name;?></label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<?php endforeach;?>\r\n\t\t\t\t\t\t\t\t\t\t\t</ul> \r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<?php endif;?>\r\n\t\t\t\t\t\t\t\t<?php endif;?>\r\n\t\t\t\t\t\t\t<?php endforeach; ?>\r\n\t\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li class=\"clear\">\r\n\t\t\t\t\t\t<br /><h4>Filter by the following terms:</h4>\r\n\t\t\t\t\t\t<p class=\"description\">Separate terms with commas. Leave blank to not filter by terms.</p>\r\n\t\t\t\t\t\t<?php echo $nonhierarchical;?>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t</ul>\r\n\t\t\t</fieldset>\r\n\t\t\r\n\t\t\t<h3>Twitter Content</h3>\r\n\t\t\t<fieldset>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<label for=\"mf_timeline[options][twitter][content][username]\"><strong>Twitter Username:</strong></label><br/>\r\n\t\t\t\t\t\t<input type=\"text\" name=\"mf_timeline[options][twitter][content][username]\" id=\"mf_timeline[options][twitter][content][username]\" value=\"<?php echo ( !empty( $options['options']['twitter']['content']['username'] ) ) ? $options['options']['twitter']['content']['username'] : null;?>\" />\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<label for=\"mf_timeline[options][twitter][filter][tags]\"><strong>Filter by the following hashtags:</strong></label><br/>\r\n\t\t\t\t\t\t<input type=\"text\" name=\"mf_timeline[options][twitter][filter][tags]\" id=\"mf_timeline[options][twitter][filter][tags]\" value=\"<?php echo ( !empty( $options['options']['twitter']['filter']['tags']) ) ? $options['options']['twitter']['filter']['tags'] : null;?>\" />\r\n\t\t\t\t\t\t<span class=\"description\">Separate tags with commas. Leave blank to not filter by any tags.</span>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t</ul>\r\n\t\t\t</fieldset>\r\n\t\t\t<p class=\"submit\">\r\n\t\t\t\t<input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button-primary\" value=\"Save Settings\">\r\n\t\t\t</p>\r\n\t\t</form>\r\n\t<?php\r\n\t}",
"function bdpp_default_settings() {\n\t\n\tglobal $bdpp_options;\n\t\n\t$bdpp_options = array(\n\t\t\t\t\t'post_types'\t\t\t=> array(0 => 'post'),\n\t\t\t\t\t'trend_post_types'\t\t=> array(),\n\t\t\t\t\t'sharing_enable'\t\t=> 0,\n\t\t\t\t\t'sharing'\t\t\t\t=> array(),\n\t\t\t\t\t'sharing_lbl'\t\t\t=> esc_html__('Share this', 'blog-designer-pack'),\n\t\t\t\t\t'sharing_design'\t\t=> 'design-1',\n\t\t\t\t\t'sharing_post_types'\t=> array(),\n\t\t\t\t\t'disable_font_awsm_css'\t=> 0,\n\t\t\t\t\t'disable_owl_css'\t\t=> 0,\n\t\t\t\t\t'custom_css'\t\t\t=> '',\n\t\t\t\t);\n\n\t$default_options = apply_filters('bdpp_default_options_values', $bdpp_options );\n\n\t// Update default options\n\tupdate_option( 'bdpp_opts', $default_options );\n\t\n\t// Overwrite global variable when option is update\n\t$bdpp_options = bdpp_get_settings();\n}",
"public function describe_client_options() {\n echo '<p>The following options configure what URL to access when a post is published in this blog.</p>';\n }",
"public function get_options() {\n\t\tif ( ! isset( $this->options ) ) {\n\t\t\t$this->options = self::wp_parse_args_recursive( get_user_meta( get_current_user_id(), 'monsterinsights_user_preferences', true ), self::$default_options );\n\t\t}\n\n\t\treturn apply_filters( 'monsterinsights_dashboard_widget_options', $this->options );\n\n\t}",
"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 init() {\t\t\n\t\t$this->options = new NHP_Options(\r\n\t\t\tarray(), array(\r\n\t\t\t\t\t'opt_name' => $this->cpt_slug . '-configuration',\r\n\t\t\t\t\t'page_slug' => $this->cpt_slug . '-configuration',\r\n\t\t\t\t\t'menu_title' => __( 'Configuration', WPcpt::$domain ),\r\n\t\t\t\t\t'page_title' => __( 'Configuration', WPcpt::$domain ),\r\n\t\t\t\t\t'page_cap' => 'manage_options',\r\n\t\t\t\t\t'dev_mode' => WP_DEBUG,\r\n\t\t\t\t\t'show_import_export' => false,\r\n\t\t\t\t\t'page_type' => 'submenu',\r\n\t\t\t\t\t'page_parent' => 'edit.php?post_type=' . $this->cpt_slug,\r\n\t\t\t) );\n\t}",
"public function options()\n {\n $options = apply_filters(\n $this->id . '_option_fields',\n [\n 'id' => $this->id, // upstream_milestones\n 'title' => $this->title,\n 'menu_title' => $this->menu_title,\n 'desc' => $this->description,\n 'show_on' => ['key' => 'options-page', 'value' => [$this->id],],\n 'show_names' => true,\n 'fields' => [\n [\n 'name' => upstream_milestone_label_plural(),\n 'id' => 'milestone_title',\n 'type' => 'title',\n ],\n [\n 'name' => 'Milestone Categories',\n 'id' => 'enable_milestone_categories',\n 'type' => 'radio',\n 'description' => '',\n 'options' => [\n '1' => __('Enabled', 'upstream'),\n '0' => __('Disabled', 'upstream'),\n ],\n 'default' => '0',\n ],\n ],\n ]\n );\n\n return $options;\n }",
"public function register_options() {\n register_setting($this->group, $this->group, array(&$this, 'sanitize_settings'));\n\n $this->sections[] = $debug_section = 'wp_remote_cache_clear_debug';\n add_settings_section($debug_section, 'Debug Settings', array(&$this, 'describe_debug_options'), $debug_section);\n\n add_settings_field('wp_remote_cache_clear_debug', 'Enabled?', array(&$this, 'display_option_debug'), $debug_section, $debug_section);\n add_settings_field('wp_remote_cache_clear_debug_file', 'Debug log', array(&$this, 'display_option_debug_file'), $debug_section, $debug_section);\n\n $this->sections[] = $server_section = 'wp_remote_cache_clear_server';\n add_settings_section($server_section, 'Server Settings', array(&$this, 'describe_server_options'), $server_section);\n\n add_settings_field('wp_remote_cache_clear_server_key', 'Secret key', array(&$this, 'display_option_server_key'), $server_section, $server_section);\n add_settings_field('wp_remote_cache_clear_server_allowed_ip_regex', 'Allow IPs matching', array(&$this, 'display_option_server_allowed_ip_regex'), $server_section, $server_section);\n add_settings_field('wp_remote_cache_clear_server_min_seconds', 'Minimum number of seconds between requests', array(&$this, 'display_option_server_min_seconds'), $server_section, $server_section);\n add_settings_field('wp_remote_cache_clear_server_delete_transients', 'Delete transients?', array(&$this, 'display_option_server_delete_transients'), $server_section, $server_section);\n\n $this->sections[] = $client_section = 'wp_remote_cache_clear_client';\n add_settings_section($client_section, 'Client Settings', array(&$this, 'describe_client_options'), $client_section);\n\n add_settings_field('wp_remote_cache_clear_client_remote_url', 'Remote URL', array(&$this, 'display_option_client_remote_url'), $client_section, $client_section);\n add_settings_field('wp_remote_cache_clear_client_key', 'Secret key', array(&$this, 'display_option_client_key'), $client_section, $client_section);\n }",
"function ba_options_init() {\n\n register_setting('ba_theme_options', 'ba_social'); // Options group, option name\n register_setting('ba_theme_options', 'ba_contact');\n register_setting('ba_theme_options', 'ba_cf_shortcode');\n\n\n\n// ----------------------------- Sections ----------------------------- //\n\n // Social media section\n add_settings_section(\n 'ba_social_section', // Section ID\n __('Social Media Links'), // Section title\n 'ba_social_cb', // Section callback function\n 'ba_theme_options' // Options group\n );\n\n // Contact info section\n add_settings_section(\n 'ba_contact_section',\n __('Contact Info'),\n 'ba_contact_cb',\n 'ba_theme_options'\n );\n\n // Contact form shortcode\n add_settings_section(\n 'ba_cf_section',\n __('Contact Form Shortcode'),\n 'ba_cf_shortcode_cb',\n 'ba_theme_options'\n );\n\n\n\n// ------------------------- Settings Fields ------------------------- //\n\n\n\n // ------ Social Media Settings fields ------ //\n\n add_settings_field(\n 'ba_facebook', // id\n __('Facebook'), // Title\n 'ba_social_field', // Callback\n 'ba_theme_options', // Options group\n 'ba_social_section', // Section\n array(\n 'label_for' => 'ba_facebook',\n 'class' => 'ba-social-row',\n 'ba_custom_data' => 'custom'\n )\n );\n\n add_settings_field(\n 'ba_twitter',\n __('Twitter'),\n 'ba_social_field',\n 'ba_theme_options',\n 'ba_social_section',\n array(\n 'label_for' => 'ba_twitter',\n 'class' => 'ba-social-row',\n )\n );\n\n add_settings_field(\n 'ba_youtube',\n __('YouTube'),\n 'ba_social_field',\n 'ba_theme_options',\n 'ba_social_section',\n array(\n 'label_for' => 'ba_youtube',\n 'class' => 'ba-social-row',\n )\n );\n\n\n\n // ------ Contact info settings fields ------ //\n\n add_settings_field(\n 'ba_phone',\n __('Phone Number'),\n 'ba_contact_field',\n 'ba_theme_options',\n 'ba_contact_section',\n array(\n 'label_for' => 'ba_phone',\n 'class' => 'ba-social-row',\n )\n );\n\n add_settings_field(\n 'ba_email',\n __('Email Address'),\n 'ba_contact_field',\n 'ba_theme_options',\n 'ba_contact_section',\n array(\n 'label_for' => 'ba_email',\n 'class' => 'ba-social-row',\n )\n );\n\n // ------ Contact form shortcode fields ------ //\n\n add_settings_field(\n 'ba_shortcode',\n __('Contact Form Shortcode'),\n 'ba_cf_field',\n 'ba_theme_options',\n 'ba_cf_section',\n array(\n 'label_for' => 'ba_shortcode',\n 'class' => 'ba-social-row',\n )\n );\n\n}",
"function get_options() \n {\n // don't forget to set up the default options\n if ( ! $the_options = get_option( $this->options_name) ) {\n $the_options = array(\n 'bbquotations-slug' =>'quotes',\n 'use-css-file' => false\n );\n update_option($this->options_name, $the_options);\n }\n $this->options = $the_options;\n }",
"function template_options()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t$context['theme_options'] = array(\n\t\tarray(\n\t\t\t'id' => 'show_board_desc',\n\t\t\t'label' => $txt['board_desc_inside'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_children',\n\t\t\t'label' => $txt['show_children'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'use_sidebar_menu',\n\t\t\t'label' => $txt['use_sidebar_menu'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_avatars',\n\t\t\t'label' => $txt['show_no_avatars'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_signatures',\n\t\t\t'label' => $txt['show_no_signatures'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_censored',\n\t\t\t'label' => $txt['show_no_censored'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'return_to_post',\n\t\t\t'label' => $txt['return_to_post'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'no_new_reply_warning',\n\t\t\t'label' => $txt['no_new_reply_warning'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_first',\n\t\t\t'label' => $txt['recent_posts_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_pm_first',\n\t\t\t'label' => $txt['recent_pms_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'posts_apply_ignore_list',\n\t\t\t'label' => $txt['posts_apply_ignore_list'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'wysiwyg_default',\n\t\t\t'label' => $txt['wysiwyg_default'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'popup_messages',\n\t\t\t'label' => $txt['popup_messages'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'copy_to_outbox',\n\t\t\t'label' => $txt['copy_to_outbox'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'pm_remove_inbox_label',\n\t\t\t'label' => $txt['pm_remove_inbox_label'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'auto_notify',\n\t\t\t'label' => $txt['auto_notify'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'topics_per_page',\n\t\t\t'label' => $txt['topics_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'messages_per_page',\n\t\t\t'label' => $txt['messages_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'calendar_start_day',\n\t\t\t'label' => $txt['calendar_start_day'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['days'][0],\n\t\t\t\t1 => $txt['days'][1],\n\t\t\t\t6 => $txt['days'][6],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_reply',\n\t\t\t'label' => $txt['display_quick_reply'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_reply1'],\n\t\t\t\t1 => $txt['display_quick_reply2'],\n\t\t\t\t2 => $txt['display_quick_reply3']\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_mod',\n\t\t\t'label' => $txt['display_quick_mod'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_mod_none'],\n\t\t\t\t1 => $txt['display_quick_mod_check'],\n\t\t\t\t2 => $txt['display_quick_mod_image'],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t);\n}",
"public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_directlink';\n\n\t\treturn $settings;\n\t}",
"function page_builder_settings() {\n\n\t\t$settings = parent::page_builder_settings();\n\n\t\treturn array_merge( $settings, array(\n\t\t\t'name' => __( 'Dribbble Shots', 'publisher' ),\n\t\t\t\"id\" => $this->id,\n\t\t\t\"weight\" => 10,\n\t\t\t\"wrapper_height\" => 'full',\n\t\t\t\"category\" => publisher_white_label_get_option( 'publisher' ),\n\t\t\t'icon_url' => PUBLISHER_THEME_URI . 'images/shortcodes/bs-dribbble.png',\n\t\t) );\n\t}",
"function options() {\n wp_enqueue_style('adminstyles', plugins_url('css/admin-options.css', __FILE__));\n if (version_compare(get_bloginfo('version'), '3.3', '<')) {\n wp_head();\n }\n $buttonOptions = $this->_followOptions->getButtonOptions();\n $style = $this->_followOptions->getDefaultStyle();\n $title = $this->_followOptions->getDefaultTitle();\n\n $commonFollowOptions = get_option('addthis_follow_settings');\n $followWidgetOptions = get_option('widget_addthis-follow-widget');\n /**\n * Restore from widget settings if possible\n */\n if (($commonFollowOptions == false || empty($commonFollowOptions)) && $followWidgetOptions != false) {\n foreach ($followWidgetOptions as $key => $list) {\n if (is_int($key) && is_array($list)) {\n merge_options($list, $buttonOptions, $title, $style);\n }\n }\n $restoreOptions = array('title' => $title, 'style' => $style);\n foreach($buttonOptions as $key => $value) {\n $restoreOptions[$key] = $value['placeholder'];\n }\n add_option('addthis_follow_settings', $restoreOptions);\n } elseif ($commonFollowOptions != false && !empty($commonFollowOptions)) {\n /**\n * Follow options already exists, just update it\n */\n merge_options($commonFollowOptions, $buttonOptions, $title, $style);\n }\n\n $this->displayOptionsForm($buttonOptions, $style, $title);\n }",
"protected function get_options()\n\t{}",
"private function setOptions()\n\t{\n\t\t$this->site = ( isset($_POST['site']) ) ? sanitize_text_field($_POST['site']) : null;\n\t\t$this->feed_type = ( isset($_POST['type']) && $_POST['type'] !== 'search' ) ? sanitize_text_field($_POST['type']) : 'search';\n\t\t$this->post_id = ( isset($_POST['id']) ) ? sanitize_text_field($_POST['id']) : null;\n\t\t$this->feed_format = ( isset($_POST['format']) && $_POST['format'] !== 'unformatted' ) ? sanitize_text_field($_POST['format']) : 'unformatted';\n\t}"
]
| [
"0.66515255",
"0.66283154",
"0.6481121",
"0.64136285",
"0.6383131",
"0.6308863",
"0.62851787",
"0.6273663",
"0.6265167",
"0.6232458",
"0.6227361",
"0.6188906",
"0.6148076",
"0.6120388",
"0.61195356",
"0.61006784",
"0.6100154",
"0.6096246",
"0.6095549",
"0.60656744",
"0.6062536",
"0.6041463",
"0.6038006",
"0.60033715",
"0.59958625",
"0.5994563",
"0.5970003",
"0.5969619",
"0.59684706",
"0.59667253"
]
| 0.714491 | 0 |
Callback function for self::sortByKeyNumieric() Returning int value 1, 0, or 1 on (lt,eq, or gt) or vice versa depending on sort order | protected static function sortByKeyNumericCallback($a, $b)
{
// temp. setting elements with key and zero values, if missing in child array
if (! array_key_exists(self::$sortKey, $a) || is_null($a[self::$sortKey])) {
$a[self::$sortKey] = 0;
}
if (! array_key_exists(self::$sortKey, $b) || is_null($b[self::$sortKey])) {
$b[self::$sortKey] = 0;
}
// sort order ascending
if (self::$sortOrder == 'asc') {
// return 0 if equals
if ($a[self::$sortKey] == $b[self::$sortKey]) {
return 0;
// -1 if less, or 1 if greater
// @TODO : using Php 7+'s new operators ??
} else {
return ((float) $b[self::$sortKey]) < ((float) $a[self::$sortKey]) ? 1 : - 1;
}
} elseif (self::$sortOrder == 'desc') { // or sort order descending
// return 0 if equals
if ($a[self::$sortKey] == $b[self::$sortKey]) {
return 0;
// 1 if less, or -1 if greater
} else {
return ((float) $b[self::$sortKey]) > ((float) $a[self::$sortKey]) ? 1 : - 1;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _ting_ranking_field_sort($a, $b) {\n if ($a['weight'] == $b['weight']) {\n return 0;\n }\n return ($a['weight'] > $b['weight']) ? -1 : 1;\n}",
"function getSort() {\n return 999;\n }",
"function key_compare_func($a, $b) {\n if ($a === $b) {\n return 0;\n }\n return ($a > $b) ? 1 : -1;\n}",
"function getSort(){\n return 999;\n }",
"function getSort(){\n return 999;\n }",
"function getSort(){\n return 100;\n }",
"function getSort(){\n return 155;\n }",
"function getSort(){\n return 155;\n }",
"function getSort(){\n return 155;\n }",
"public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}",
"public function compareIntDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = (int) $this->getData($key);\n $otherValue = (int) $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }",
"function getSort(){\n return 188;\n }",
"protected function get_sort_order() {\n return 111;\n }",
"function getSort(){\n\treturn 281;\n}",
"public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }",
"public function getSortValue() {}",
"function cmpByOrderIndexAsc($a, $b)\n{\n if ($a['order_index'] == $b['order_index']) {\n return 0;\n }\n return($a['order_index'] < $b['order_index']) ? -1 : 1;\n}",
"function action_sort($a, $b) {\r return $a['priority'] > $b['priority'] ? 1 : -1;\r}",
"public function getSort()\n {\n return 125;\n }",
"function getSort(){ return 301; }",
"public function getSortIndex();",
"function cmp_function($value1, $value2)\n{\n if($value1 == $value2) {\n return 0;\n }\n else if($value1 > $value2) {\n return 1;\n }\n else {\n return -1;\n }\n}",
"function recognizer_node_cmp($a, $b)\r\n{\r\n if($a->score == $b->score) return 0;\r\n return ($a->score < $b->score) ? -1 : 1; //从小到大排序\r\n}",
"function getSort(){\n return 301;\n }",
"function _sortOccurrencesCallback($a, $b) {\n return $a['start'] <= $b['start'] ? -1 : 1;\n }",
"function cmpScore($a, $b)\n{\n if ($a['score'] == $b['score']) {\n return 0;\n }\n return ($a['score'] < $b['score']) ? 1 : -1;\n}",
"private static function sort_by_value($a,$b) {\r\n\t\t$intA = (int)$a[\"value\"];\r\n\t\t$intB = (int)$b[\"value\"];\r\n\t\tif ($intA === $intB) return 0;\r\n\t\treturn ($intA < $intB) ? -1 : 1;\r\n\t}",
"function cmp($a, $b) {\n\treturn $a['posi'] - $b['posi'];\n}",
"function sortiere_nach_punkten(&$ranking) {\n\n\t$last_punkte = 0;\n\t$gewinn_rang = 1;\n\t$last_gewinn_rang = $gewinn_rang;\n\tforeach (array_keys($ranking) as $key)\n\t{\n\t\t$punkte = $ranking[$key][\"punkte\"];\t\t\n\t\tif ($punkte == $last_punkte) {\n\t\t\t$ranking[$key][\"rang\"] = $last_gewinn_rang;\n\t\t} else {\n \t\t$gewinn_rang = $key+1;\n \t\t$ranking[$key][\"rang\"] = $gewinn_rang;\n\t\t}\n\t\t\n\t\t$last_punkte = $punkte;\n\t\t$last_gewinn_rang = $gewinn_rang;\n }\n\n\tif (debug()) {\n\t\tprint \"<br>\";\n\t foreach(array_keys($ranking) as $key) {\n\t\t\tprint \"spieler = \". $ranking[$key][\"user\"]. \"<br>\";\n\t\t\tprint \"rang = \". $ranking[$key][\"rang\"]. \"<br>\";\n\t\t\tprint \"punkte = \". $ranking[$key][\"punkte\"]. \"<br>\";\t\t\t\n\t\t}\n\t\tprint \"<br>\";\n\t}\n}",
"function mmrpg_action_sort_switch($info1, $info2){\n if ($info1['robot_position'] == 'active'){ return -1; }\n elseif ($info2['robot_position'] == 'active'){ return 1; }\n elseif ($info1['robot_key'] < $info2['robot_key']){ return -1; }\n elseif ($info1['robot_key'] > $info2['robot_key']){ return 1; }\n else { return 0; }\n }"
]
| [
"0.63746434",
"0.6135504",
"0.6104151",
"0.60845566",
"0.60845566",
"0.60843474",
"0.60793245",
"0.60793245",
"0.60793245",
"0.6059034",
"0.60589004",
"0.6052298",
"0.60297173",
"0.5992052",
"0.5982303",
"0.5973703",
"0.59114265",
"0.5891295",
"0.587458",
"0.58466095",
"0.58305925",
"0.57820785",
"0.578193",
"0.5777364",
"0.5741957",
"0.5733126",
"0.56774896",
"0.5636687",
"0.56305146",
"0.56102175"
]
| 0.67515653 | 0 |
Tests a purchase and shop flow. | public function testPurchaseFlow()
{
// Prepare
$user = factory('App\User')->create(['password' => Hash::make('laravel-shop')]);
$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);
$cart = App\Cart::current()
->add(['sku' => '0001', 'price' => 1.99])
->add(['sku' => '0002', 'price' => 2.99]);
Shop::setGateway('testPass');
Shop::checkout();
$order = Shop::placeOrder();
$this->assertNotNull($order);
$this->assertNotEmpty($order->id);
$this->assertTrue($order->isCompleted);
$user->delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCreatePurchase()\n {\n print \"testPurchase()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }",
"public function purchaseTest()\n {\n\t $this->json('POST','/compraproducto', [\n 'user_id' => '15',\n 'product_id' => '31',\n 'quantity' => '9',\n 'payment'=>'2878.29',\n ]);\n\t $this->assertDatabaseHas('purchases', ['user_id' => '15']);\n }",
"function xtestLive(){\n $this->clearAll();\n \n $seller = $this->createUser('seller');\n $evt = $this->createEvent('Quebec CES' , $seller->id, $this->createLocation()->id, date('Y-m-d', strtotime(\"+1 day\")) );\n $this->setEventId($evt, 'aaa');\n $cat = $this->createCategory('Verde', $evt->id, 10.00);\n \n \n \n //Transaction setup\n $foo = $this->createUser('foo');\n \n //let's buy\n $buyer = new \\WebUser($this->db);\n $buyer->login($foo->username);\n\n //let's pay\n Utils::clearLog();\n \n $buyer->addToCart($cat->id, 3); //cart in session\n \n $data = $this->getCCPurchaseData();\n //$data['street'] = 'N ' . $data['street']; //fail avs\n $data['cc_cvd'] = '666'; //fail cvd \n \n $payer = $this->createInstance('foo');\n $payer->setData($data);\n $payer->setCart($buyer->getCart());\n //$payer->amount_override = '0.25'; //hardcoded fail\n $payer->process();\n \n $this->assertFalse($payer->success()); \n }",
"public function testSuccess(){ \n\n $buyableProduct = Product::where('price', '<', 70)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($buyableProduct, $this->testVisaPan);\n $response->assertSee(\"Payment successful\");\n\n\n //test card 2\n $response = $this->checkoutAction($buyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Payment successful\"); \n \n }",
"public function testPurchasesIsShown()\n {\n // Create a user\n $user = User::create([\n 'password' => Hash::make('password'),\n 'email' => '[email protected]',\n 'name' => 'John Doe',\n ]);\n\n // Create room\n $room = Room::create([\n 'id' => 1,\n 'name' => 'Test room',\n ]);\n\n // Create sample product\n $product = Product::create([\n 'name' => 'Test product',\n 'color' => 'fff',\n 'quantity' => '1,2,5',\n 'price' => '1232.00',\n ]);\n\n $quantity = 2;\n\n // Buy something\n $beer = new Beer();\n $beer->room = $room->id;\n $beer->quantity = $quantity;\n $beer->product = $product->id;\n $beer->ipAddress = request()->ip();\n $beer->amount = -($product->price * $quantity);\n $beer->save();\n\n // Login that user in\n Auth::login($user);\n\n // Get the page\n $response = $this->get('/rooms/1');\n\n // Asser user is logged in\n $this->assertAuthenticatedAs($user);\n\n // And that we get the expected 200 OK\n $response->assertStatus(200);\n\n // And the purchase shows up, we only check if the price is shown\n $response->assertSee('-'.($product->price * 2).'.00');\n }",
"public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }",
"public function testGetOneShop()\n {\n //Given\n $shop = factory(Shop::class)->create(['user_id' => $this->user->id]);\n\n //When\n $response = $this->actingAs($this->user)->get('api/admin/shop/' . $shop->id);\n\n //Then\n $response->assertStatus(200);\n }",
"public function testFailPurchase()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testFail');\n\n\t\t$this->assertFalse(Shop::checkout());\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Checkout failed.');\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->hasFailed);\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Payment failed.');\n\n\t\t$user->delete();\n\t}",
"public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function testBuy()\n {\n VCR::insertCassette('pickups/buy.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $boughtPickup);\n $this->assertStringMatchesFormat('pickup_%s', $boughtPickup->id);\n $this->assertNotNull($boughtPickup->confirmation);\n $this->assertEquals('scheduled', $boughtPickup->status);\n }",
"public function test() {\n $this->drupalLogout();\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n\n // Checkout as guest.\n $this->assertCheckoutProgressStep('Login');\n $this->submitForm([], 'Continue as Guest');\n $this->assertCheckoutProgressStep('Event registration');\n\n // Save first registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => '[email protected]',\n 'field_comments[0][value]' => 'No commments',\n ], 'Save');\n\n // Add second registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 2',\n 'person[field_email][0][value]' => '[email protected]',\n ], 'Save');\n\n // Add third registrant and continue to order information.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 3',\n 'person[field_email][0][value]' => '[email protected]',\n ], 'Save');\n $this->submitForm([], 'Continue');\n\n // Add order information.\n $this->assertSession()->pageTextContains('3 items');\n $this->processOrderInformation();\n\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n $this->assertSession()->pageTextContains('Person 2');\n $this->assertSession()->pageTextContains('Person 3');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n\n // Assert that three registrants were added to the order.\n $order = Order::load(1);\n $registrations = $this->container->get('commerce_rng.registration_data')->getOrderRegistrations($order);\n $registrants = $this->container->get('commerce_rng.registration_data')->formatRegistrationData($registrations);\n $this->assertCount(3, $registrants);\n }",
"public function testCreatePayItem()\n {\n }",
"public function testPurchaseSuccess()\n {\n // $this->setMockHttpResponse('WebservicePurchaseSuccess.txt');\n $data = file_get_contents(__DIR__ . '/Mock/WebservicePurchaseSuccess.txt');\n\n $purchase = $this->gateway->purchase($this->options);\n $response = $purchase->createResponse($data);\n\n // echo \"Response data =\\n\";\n // print_r($response->getData());\n // echo \"\\nEnd Response data\\n\";\n\n $this->assertTrue($response->isSuccessful());\n $this->assertFalse($response->isRedirect());\n $this->assertEquals('259611::1452486844', $response->getTransactionReference());\n $this->assertNull($response->getMessage());\n $this->assertEquals('APPROVED', $response->getCode());\n }",
"public function testGetUsersShops()\n {\n //Given\n factory(Shop::class, 20)->create(['user_id' => $this->user->id]);\n\n //When\n $response = $this->actingAs($this->user)->get('api/admin/shop');\n\n //Then\n $response->assertStatus(200);\n }",
"public function testGetPayItems()\n {\n }",
"public function testSuccessOrder()\n {\n $user = User::factory()->create([\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => 'asdqwe123'\n ]);\n $orderData = [\n 'product_id' => 1,\n 'quantity' => 1\n ];\n $this->actingAs($user,'api_user');\n\n $this->json('POST', 'api/order',$orderData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJson([\n 'message' => 'You have successfully ordered this product'\n ]);\n }",
"public function testStore()\n {\n $cart = $this -> fakeUser -> carts() -> create();\n $product = Product::create([\n 'title' => 'test',\n 'content' => 'try',\n 'price' => 30,\n 'quantity' => 10\n ]);\n //ˇˇˇ結構 ˇˇˇ method, route, data\n $response = $this->call(\n 'POST',\n 'cart-items',\n ['cart_id' => $cart -> id,'product_id' => $product->id, 'quantity' => 3]\n );\n $response -> assertOk();\n\n }",
"public function testApplyOrderWarehouseFulfillmentPlan()\n {\n }",
"public function setUp()\n {\n $this->purchase = new Purchase();\n }",
"public function testBillingSources()\n {\n }",
"public function testBillingInvoices()\n {\n }",
"public function testTsSeagel()\n {\n $testConfig = $this->getTestConfig();\n if ($testConfig->isSubShop()) {\n $this->markTestSkipped('Test is not for subshops');\n }\n\n //trusted shops setup in admin\n $this->loginAdminTs();\n $this->assertElementPresent(\"aShopID_TrustedShops[0]\");\n $this->type(\"aShopID_TrustedShops[0]\", $this->getLoginDataByName('trustedShopsIdForLanguageDe'));\n $this->check(\"//input[@name='tsTestMode' and @value='true']\");\n $this->check(\"//input[@name='tsSealActive' and @value='true']\");\n\n $this->assertEquals(\"Direct debit Credit Card / Debit Card Invoice Cash on delivery Cash in advance Cheque Paybox PayPal Amazon Payments Cash on pickup Financing Leasing T-Pay Click&Buy Giropay Google Checkout Online shop payment card SOFORT Banking moneybookers.com / Skrill Dotpay Przelewy24 Other method of payment\", $this->getText(\"paymentids[oxidcashondel]\"));\n $this->assertTextPresent(\"Test payment method [EN] šÄßüл\");\n $this->assertEquals(\"Direct debit Credit Card / Debit Card Invoice Cash on delivery Cash in advance Cheque Paybox PayPal Amazon Payments Cash on pickup Financing Leasing T-Pay Click&Buy Giropay Google Checkout Online shop payment card SOFORT Banking moneybookers.com / Skrill Dotpay Przelewy24 Other method of payment\", $this->getText(\"paymentids[testpayment]\"));\n $this->select(\"paymentids[testpayment]\", \"label=Credit Card / Debit Card\");\n $this->clickAndWait(\"save\");\n $this->assertTextNotPresent(\"Invalid Trusted Shops ID\", \"Invalid Trusted Shops ID for testing\");\n $this->assertEquals(\"Credit Card / Debit Card\", $this->getSelectedLabel(\"paymentids[testpayment]\"));\n $this->assertEquals(\"on\", $this->getValue(\"//input[@name='tsSealActive' and @value='true']\"));\n $this->assertEquals(\"on\", $this->getValue(\"//input[@name='tsTestMode' and @value='true']\"));\n $this->assertEquals($this->getLoginDataByName('trustedShopsIdForLanguageDe'), $this->getValue(\"aShopID_TrustedShops[0]\"));\n $this->type(\"aShopID_TrustedShops[0]\", \"nonExisting\");\n $this->clickAndWait(\"save\");\n $this->assertTextPresent(\"The certificate does not exist\");\n $this->assertEquals($this->getLoginDataByName('trustedShopsIdForLanguageDe'), $this->getValue(\"aShopID_TrustedShops[0]\"));\n }",
"public function testGetUnitBillingMethods()\n {\n }",
"public function finishPurchase() {}",
"public function testBillingDownloadInvoice()\n {\n }",
"public function testChainedPaymentShopIdInEachReciever()\n {\n $applane_integration = new ApplaneIntegrationControllerTest();\n $user_info = $applane_integration->getLoginUser();\n $access_token = $user_info['access_token'];\n $user_id = $user_info['user_id'];\n $type = $this->getContainer()->getParameter('chained_payment_fee_payer');\n $shop_id = $this->getContainer()->getParameter('chained_payment_eachreciever_shop_id');\n $item_type = $this->getContainer()->getParameter('item_type_shop');\n $paypal_service = $this->getContainer()->get('paypal_integration.payment_transaction');\n $fee_payer = $paypal_service->getPaypalFeePayer($type,$shop_id,$item_type);\n $expected_fee_payer = $this->getContainer()->getParameter('eachreciever');\n \n $this->assertEquals($expected_fee_payer,$fee_payer);\n }",
"function testStartTransaction() {\n\n /* test title */\n echo '<h2 style=\"color: black;\">testStartTransaction...</h2>';\n\n /* get the application url */\n $this->baseurl = current(split(\"webroot\", $_SERVER['PHP_SELF']));\n\n /* cut off the 'app' suffix and add that stupid 'index.php' thing */\n $this->baseurl = substr($this->baseurl, 0, strrpos($this->baseurl, \"app\")) . 'index.php/';\n\n /* go to correct page */\n $this->get('http://localhost' . $this->baseurl . 'transactions/transactions');\n\n /* see if relevant field names are there */\n $this->assertText('Author');\n $this->assertText('Title');\n $this->assertText('ISBN');\n \n /* see if relevant options are there */\n $this->assertPattern('/<input.*type=\"submit\".*value=\"Accept\".*>/');\n $this->assertPattern('/<input.*type=\"submit\".*value=\"Counter.*\".*>/');\n \n }",
"public function testCheckProduct()\n {\n $response = $this->get('product');\n\n $response->assertStatus(200);\n }",
"public function test_can_checkout()\n {\n $data = $this->get_sample_data();\n\n $this->postJson('api/v1/vehicle/checkout', $data)\n ->assertStatus(200)\n ->assertJson([\n 'status' => 'success',\n ]);\n }",
"public function test_ShouldStorePurchaseOrder()\n {\n $response = $this->storePurchaseOrder();\n dump( json_decode($response->content(), JSON_PRETTY_PRINT) );\n $response->assertStatus(201)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 201,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code',\n 'purchase_order_id',\n ]);\n $obj = json_decode( $response->content() );\n\n return $obj->purchase_order_id;\n }"
]
| [
"0.7443279",
"0.73323864",
"0.6954387",
"0.6948993",
"0.67016095",
"0.66181165",
"0.6580395",
"0.65131956",
"0.65059507",
"0.63474095",
"0.6316441",
"0.6208938",
"0.61863816",
"0.61861706",
"0.6174373",
"0.6167726",
"0.61453515",
"0.61388654",
"0.6111685",
"0.6102436",
"0.6099646",
"0.60796595",
"0.60547507",
"0.60513544",
"0.6048791",
"0.6039435",
"0.6011545",
"0.6001391",
"0.6000127",
"0.59797615"
]
| 0.8077523 | 0 |
Tests if failed transactions are being created. | public function testFailedTransactions()
{
// Prepare
$user = factory('App\User')->create(['password' => Hash::make('laravel-shop')]);
$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);
$cart = App\Cart::current()
->add(['sku' => '0001', 'price' => 1.99])
->add(['sku' => '0002', 'price' => 2.99]);
Shop::setGateway('testFail');
// Beging test
$order = Shop::placeOrder();
$this->assertNotNull($order);
$this->assertNotEmpty($order->id);
$this->assertTrue($order->hasFailed);
$this->assertEquals(count($order->transactions), 1);
$user->delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function HasFailedTrans() {}",
"public static function fail_transaction()\n {\n if (!self::hasMasterDB()) {\n return;\n }\n\n self::getMasterDB()->FailTrans();\n }",
"public function hasFailed();",
"public function _transaction_status_check()\n {\n if (!$this->_transaction_in_progress) {\n return;\n }\n $this->rollback();\n }",
"public function fails(): bool {\r\n return !$this -> execute();\r\n }",
"function _executeTransactions()\n {\n foreach($this->_transactionCollection as $k => $trans)\n {\n if (! $this->_transactionCollection[$k]->execute())\n {\n\t $eCol = $this->_transactionCollection[$k]->getErrorCollection();\n $errors = $eCol->getErrors();\n foreach($errors as $e)\n $this->_errors->addError($e);\n return false;\n }\n }\n return true;\n }",
"public function testExistentRecord()\n {\n try {\n DAL::beginTransaction();\n $assetidOne = 123;\n $typeid = 'asset';\n $sql = $this->_getInsertQuery($assetidOne, $typeid).';';\n\n $assetidTwo = 124;\n $typeid = 'asset';\n $sql .= $this->_getInsertQuery($assetidTwo, $typeid);\n\n $expected = 'asset';\n DAL::executeQueries($sql);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidOne);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n\n $type = TestDALSys1::dalTestExecuteOne($assetidTwo);\n PHPUnit_Framework_Assert::assertEquals($expected, $type);\n DAL::rollBack();\n\n } catch (PDOException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n } catch (ChannelException $e) {\n DAL::rollBack();\n PHPUnit_Framework_Assert::fail($e->getMessage().$e->getTraceAsString());\n }\n\n }",
"public function fails(): bool\n {\n return !$this->succeeds();\n }",
"public function testCreateUnsuccessfulReason()\n {\n }",
"public function testErrorInTransactionCallback()\n {\n $this->assertEquals(3, $this->connection->executeFirstCell('SELECT COUNT(`id`) AS \"row_count\" FROM `writers`'));\n\n /** @var Exception $exception_caught */\n $exception_caught = false;\n\n $this->connection->transact(\n function () {\n $this->connection->execute('INSERT INTO `writers` (`name`, `birthday`) VALUES (?, ?)', 'Anton Chekhov', new DateTime('1860-01-29'));\n throw new RuntimeException('Throwing an exception here');\n },\n null,\n function (Exception $e) use (&$exception_caught) {\n $exception_caught = $e;\n }\n );\n\n $this->assertInstanceOf('\\RuntimeException', $exception_caught);\n $this->assertEquals('Throwing an exception here', $exception_caught->getMessage());\n\n $this->assertEquals(3, $this->connection->executeFirstCell('SELECT COUNT(`id`) AS \"row_count\" FROM `writers`'));\n }",
"public function hasTransactions();",
"public function isUnderTransaction();",
"public function test_if_failed_update()\n {\n }",
"public function fails();",
"public function fails();",
"public function testSaveFailed() {\n $startDate = Date::today()->addWeek();\n\n /** @var Course $course */\n $course = $this->mockModel(Course::class);\n $teacher = $this->mockModel(Teacher::class);\n\n $this->mockCoursePossible($teacher, $startDate);\n $this->mockLessons();\n $course->shouldReceive(['save' => false])->between(1, 1);\n\n $courseSpec = $this->mockCreateSpec($startDate, null, $course);\n\n $this->assertException(function() use ($courseSpec, $teacher) {\n $this->courseService->createCourse($courseSpec, $teacher);\n }, CourseException::class, CourseException::SAVE_FAILED);\n }",
"protected function subscriptionCreationFailed(): bool\n {\n report(SubscriptionCreationFailed::create($this));\n\n return false;\n }",
"public function testBeginTransactionPdoFailure()\n {\n $this->mockPdo->shouldReceive('beginTransaction')->once()->andReturn(false);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertFalse($connection->beginTransaction());\n }",
"public function testCanRollback(){\n $cleanPDO = new cleanPDO($this->goodConfig);\n $cleanPDO->beginTransaction();\n $cleanPDO->query(\"INSERT INTO test_table VALUES(null, 1)\");\n\n $stmt = $cleanPDO->query(\"SELECT * FROM `test_table` WHERE `value` = 1 LIMIT 1\");\n $stmt->execute();\n $res = $stmt->fetch();\n $this->assertTrue($res['value'] == 1);\n\n // We detected an error (not seen here) and have to rollback the transaction\n $this->assertTrue($cleanPDO->rollback());\n\n }",
"public function testAdminUserCreateAndGetTransactions()\n {\n $transactionRepo = new TransactionRepository;\n $users = new UserRepository;\n $transactionService = new TransactionService;\n $adminUser = $users->getAdminUser();\n $amount = 15.99;\n $transactionService->createUserTransaction($adminUser, $amount);\n $transactions = $transactionRepo->getByUserId($adminUser->id);\n $this->assertGreaterThan(0, $transactions->count());\n }",
"public function testRowsCantBeInsertedOnceDone()\n {\n $this->expectException(RuntimeException::class);\n\n $batch_insert = $this->connection->batchInsert('writers', ['name', 'birthday'], 350);\n\n $batch_insert->insert('Leo Tolstoy', new DateTime('1828-09-09'));\n $batch_insert->insert('Alexander Pushkin', new DateTime('1799-06-06'));\n\n $this->assertEquals(0, $this->connection->executeFirstCell('SELECT COUNT(`id`) AS \"row_count\" FROM `writers`'));\n\n $batch_insert->done();\n\n $this->assertEquals(2, $this->connection->executeFirstCell('SELECT COUNT(`id`) AS \"row_count\" FROM `writers`'));\n\n $batch_insert->insert('Fyodor Dostoyevsky', new DateTime('1821-11-11'));\n }",
"public function fails()\n {\n return !$this->passes();\n }",
"public function isFailure() {\n\n return !$this->isSuccessful();\n }",
"public function testFailPurchase()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testFail');\n\n\t\t$this->assertFalse(Shop::checkout());\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Checkout failed.');\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->hasFailed);\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Payment failed.');\n\n\t\t$user->delete();\n\t}",
"public function testCantBeginTransactionWhileInTransaction(){\n $cleanPDO = new cleanPDO($this->goodConfig);\n $cleanPDO->beginTransaction();\n $cleanPDO->query(\"INSERT INTO test_table VALUES(null, 1)\");\n\n $stmt = $cleanPDO->query(\"SELECT * FROM `test_table` WHERE `value` = 1 LIMIT 1\");\n $stmt->execute();\n $res = $stmt->fetch();\n $this->assertTrue($res['value'] == 1);\n\n $this->assertFalse($cleanPDO->beginTransaction());\n }",
"public function has_failed()\n {\n return !$this->success;\n }",
"public function isFailed()\n {\n return $this->getResult() == self::RESULT_FAILED;\n }",
"function fails() {\n return !($this->startValidation());\n }",
"public function isFailed()\r\n {\r\n return $this->status < 0;\r\n }",
"public function testDeleteUnsuccessfulReason()\n {\n }"
]
| [
"0.69478875",
"0.6739031",
"0.6566308",
"0.6480289",
"0.64404553",
"0.63927454",
"0.638956",
"0.6377925",
"0.6365319",
"0.6272036",
"0.62243897",
"0.6218126",
"0.6202211",
"0.61805546",
"0.61805546",
"0.6153341",
"0.61309755",
"0.61016524",
"0.6085042",
"0.608083",
"0.6071926",
"0.6049197",
"0.6037936",
"0.6036556",
"0.60298824",
"0.6025983",
"0.6009824",
"0.5992505",
"0.5991062",
"0.5954729"
]
| 0.7613613 | 0 |
Gets a singleton instance of AdsUtilityRegistry. | public static function getInstance() {
if (AdsUtilityRegistry::$instance === null) {
AdsUtilityRegistry::$instance = new AdsUtilityRegistry();
}
return AdsUtilityRegistry::$instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function getInstance() {\n if (is_null(self::$instance)) {\n self::$instance = new Registry();\n }\n\n return self::$instance;\n }",
"public static function getInstance()\n {\n if (null === self::$_instance) {\n self::$_instance = new Erfurt_Wrapper_Registry();\n }\n\n return self::$_instance;\n }",
"public static function getInstance() {\n if(!self::$instance instanceof self) {\n self::$instance = new Registry;\n }\n return self::$instance;\n }",
"static public function getInstance(){\r\n if(self::$_instance === NULL){\r\n self::$_instance = new Registry;\r\n }\r\n return self::$_instance;\r\n }",
"public static function getInstance()\r\n\t{\r\n\t\tif ( empty( self::$instance ) )\r\n\t\t{\r\n\t\t\tself::$instance = new Registry();\r\n\t\t\t$object = self::$instance;\r\n\t\t\t$object->init();\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$instance;\r\n\t}",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(__CLASS__);\n }",
"protected static function __instance()\n {\n return DiPool::getinstance()->getSingleton(static::class);\n }",
"public static function getInstance()\n\t{\n\t\tstatic $instance;\n\t\tif ($instance === null) {\n\t\t\t$instance = new Util();\n\t\t}\n\t\treturn $instance;\n\t}",
"static public function getInstance()\n {\n if (!isset(self::$instance))\n {\n self::$instance = new Autoload();\n }\n\n return self::$instance;\n }",
"public static function getInstance() {\n if (is_null(self::$_instance)) {\n self::$_instance = self::bootstrap();\n }\n \n return self::$_instance;\n }",
"public function getUtility()\n {\n if (!$this->utility) {\n $this->utility = new Utility($this);\n }\n\n return $this->utility;\n }",
"static function getRegistry() {\n\t\tif ( self::$_Registry === false ) {\n\t\t\tself::$_Registry = new systemRegistry();\n\t\t}\n\t\treturn self::$_Registry;\n\t}",
"public static function registry()\n {\n\t\tif ( empty(self::$registry) ){\n\t\t\tself::$registry = new Registry();\n\t\t}\n\t\treturn self::$registry;\n\n }",
"public static function getInstance()\n {\n return static::$instance;\n }",
"public static function getInstance() {\n return self::$instance;\n }",
"public static function getInstance()\r\n {\r\n return static::$instance;\r\n }",
"public static function getInstance()\n {\n if (!array_key_exists(static::class, self::$instances)) {\n self::$instances[static::class] = new static;\n }\n\n return self::$instances[static::class];\n }",
"public static function getInstance()\n {\n return self::$instance;\n }",
"public static function getInstance()\n {\n return self::$instance;\n }",
"public static function getInstance() {\n static $manager;\n\n if (!isset($manager)) {\n $manager = new AddThisScriptManager();\n }\n return $manager;\n }",
"public static function getInstance() {\n\t\treturn self::$instance;\n\t}",
"public final static function getInstance() {\n if (static::$_instance === null) {\n static::$_instance = new static();\n }\n return static::$_instance;\n }",
"public static function getInstance() {\n\t\tself::init();\n\t\treturn parent::getInstance();\n\t}",
"public static function getInstance()\n {\n if (null === self::$instance) {\n self::initInstance();\n }\n\n return self::$instance;\n }",
"public static function getInstance()\n {\n if (!isset(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }",
"public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}",
"public static function getInstance()\n {\n if (static::$instance === null) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }",
"public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }"
]
| [
"0.7134761",
"0.70926714",
"0.70070636",
"0.68938255",
"0.6865972",
"0.6787268",
"0.6787268",
"0.67415017",
"0.6689432",
"0.6570779",
"0.6468434",
"0.6364053",
"0.6343517",
"0.6302693",
"0.62996197",
"0.6286468",
"0.6283082",
"0.62771463",
"0.6276897",
"0.62636983",
"0.62636983",
"0.62515944",
"0.6248548",
"0.6235714",
"0.62277555",
"0.62264186",
"0.6222867",
"0.62224025",
"0.62169063",
"0.62131184"
]
| 0.90742975 | 0 |
Adds a new ads utility to the ads utilities list. | public function addUtility($adsUtility) {
$this->adsUtilities[$adsUtility] = $adsUtility;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addads() \n\t{\n\t\t$view = $this->getView('ads');\n\t\t// Get/Create the model\n\t\tif ($model = $this->getModel('addads'))\n\t\t{\n\t\t\t//Push the model into the view (as default)\n\t\t\t//Second parameter indicates that it is the default model for the view\n\t\t\t$view->setModel($model, true);\n\t\t}\n\t\t$view->setLayout('adslayout');\n\t\t$view->ads();\n\t}",
"function smash_wp_footer_add_ads() {\n\n\t?>\n\n\t<?php /* appending the JS-File to the document */ ?>\n\t<script>try {\n\t\t\tSmashingAds.loadAds();\n\t\t} catch ( e ) {\n\t\t}</script>\n\n\t<?php /* rendering the ads after JS-File is added */ ?>\n\t<script>try {\n\t\t\tSmashingAds.render( OA_output );\n\t\t} catch ( e ) {\n\t\t}</script>\n\n\t<?php\n}",
"public function addAction() {\n $this->assign('ad_ptypes', $this->ad_ptypes);\n }",
"protected function getTextFormatter_AcpUtilsService()\n {\n return $this->services['text_formatter.acp_utils'] = new \\phpbb\\textformatter\\s9e\\acp_utils(${($_ = isset($this->services['text_formatter.s9e.factory']) ? $this->services['text_formatter.s9e.factory'] : $this->getTextFormatter_S9e_FactoryService()) && false ?: '_'});\n }",
"function add() {\n }",
"function add($item);",
"protected function add() {\n\t}",
"public function add();",
"public function add();",
"public function addAction() {\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\tlist(, $subjects) = Client_Service_Subject::getAllSubject();\n\t\t$this->assign('subjects', $subjects);\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() {\n Ad::addAd($_POST['title'], $_POST['url'], $_POST['description']);\n unset($_POST['title']);\n unset($_POST['url']);\n unset($_POST['description']);\n }",
"function iadlearning_add_instance($iad) {\n global $DB;\n\n // Create the iad.\n $iad->timecreated = time();\n $iad->timemodified = $iad->timecreated;\n\n return $DB->insert_record('iadlearning', $iad);\n}",
"public function add($element);",
"public function add($element);",
"public function add($element);",
"public function add($item);",
"public function add($item);",
"function addHelper() {\r\n $args = func_get_args();\r\n if(!is_array($args)) {\r\n return false;\r\n } // if\r\n \r\n foreach($args as $helper_name) {\r\n if(trim($helper_name) == '') {\r\n continue;\r\n } // if\r\n \r\n if(!in_array($helper_name, $this->helpers) && $this->engine->useHelper($helper_name)) {\r\n $this->helpers[] = $helper_name;\r\n } // if\r\n } // foreach\r\n \r\n return true;\r\n }",
"function helper_add_scripts( $scripts ) {\n\t\t$rel = str_replace( ABSPATH, '/', HELPERPATH );\n\t\t$scripts->add( 'helper', $rel . 'scripts/helper.functions.js', array( 'jquery' ), '1' );\n\t}",
"public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}",
"public function add()\n {\n }",
"public function add()\n {\n }",
"public function add()\n {\n }",
"public function add()\n\t{\n\t\tEvent::add('ushahidi_filter.map_base_layers', array($this, '_add_layer'));\n\t\tif (Router::$controller != 'settings')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.map_layers_js', array($this, '_add_map_layers_js'));\n\t\t}\n\t}",
"public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }",
"static function add_list_usage($user_id, $word_list_id) {\n global $con;\n $sql = \"INSERT INTO `list_usage` (`user`, `list`, `time`)\n VALUES (\".$user_id.\", \".$word_list_id.\", \".time().\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n }",
"function add_dashboard() {\n}",
"function ad()\n {\n return app('ad');\n }",
"public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }"
]
| [
"0.5385179",
"0.5314983",
"0.5279856",
"0.5146267",
"0.5079267",
"0.4978246",
"0.49534488",
"0.49397013",
"0.49397013",
"0.48824134",
"0.4882009",
"0.4877826",
"0.48247582",
"0.47846347",
"0.47846347",
"0.47846347",
"0.47723496",
"0.47723496",
"0.4743089",
"0.4708489",
"0.46523443",
"0.46328568",
"0.46328568",
"0.46328568",
"0.46305135",
"0.4605903",
"0.46055427",
"0.4602957",
"0.4594616",
"0.45921063"
]
| 0.80423445 | 0 |
Gets all utilities in the registry and clear the registry. | public function popAllUtilities() {
$currentUtilities = $this->adsUtilities;
$this->adsUtilities = array();
return $currentUtilities;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clear_util(){\n\t\t$this->util->purge();\n\t}",
"static public function __unsetRegistry()\n {\n self::$_registry = null;\n }",
"public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}",
"function clearall() {\n}",
"final public static function clear() {\n static::free_all();\n }",
"public function clearAll() {}",
"public function clearAll();",
"public function clearAll();",
"public function menu_cache_clear_all()\n {\n return menu_cache_clear_all();\n }",
"public function clearRIssuesAllplugins()\n {\n $this->collRIssuesAllplugins = null; // important to set this to NULL since that means it is uninitialized\n }",
"public static function getUtilities()\n\t\t{\n\t\t\treturn self::$utilities;\n\t\t}",
"public static function clear()\n {\n self::$drivers = array();\n }",
"public function clear_all()\n {\n }",
"public function clearAllPlugins()\n {\n $this->collAllPlugins = null; // important to set this to NULL since that means it is uninitialized\n }",
"public static function removeAll(){\n\n foreach(static::all() as $key => $value){\n static::remove($key);\n }\n }",
"public static function clear()\n {\n static::getInstance()->clear();\n }",
"public function clearAll()\n {\n }",
"function global_Purge() {\n\tglobal $SH;\n\t\n\tcache_Delete(_SH_GLOBAL_CACHE_KEY);\n\t$SH = [];\n}",
"protected function cleanup()\n {\n $cache = sprintf('%s/phantomjs_*', sys_get_temp_dir());\n\n array_map('unlink', glob($cache));\n }",
"public function clearModules();",
"public function clearAll(){\n\n }",
"public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }",
"public function clear () {\n array_map('unlink', glob(CACHE.\"*.cache\"));\n /*\n $files = scandir(CACHE);\n foreach ($files as $file){\n if (pathinfo($file, PATHINFO_EXTENSION) == 'cache') @unlink(CACHE.$file);\n }\n */\n }",
"public function clearAll()\n {\n $this->clearDir($this->file_path . '/sb_Cache');\n }",
"public function checkAllSystems() {\n\t\techo \"Systems have already been cleared.<br>\";\n\t}",
"public function checkAllSystems() {\n\t\techo \"Systems have already been cleared.<br>\";\n\t}",
"public function checkAllSystems() {\n\t\techo \"Systems have already been cleared.<br>\";\n\t}",
"public static function unregister() {\n self::$lookup_path = null;\n self::$special_classes = null;\n return spl_autoload_unregister(array(__CLASS__, \"load\"));\n }",
"public function resetHelperMocks()\n {\n $names = array_keys($this->_registeredHelperMocks);\n foreach ($names as $n) {\n $this->unsetHelper($n);\n }\n }",
"public static function reset()\n {\n if (self::$_instance != null) {\n self::$_instance->_wrapperRegistry = array();\n }\n self::$_instance = null;\n }"
]
| [
"0.72773737",
"0.6379552",
"0.63398796",
"0.6173307",
"0.60482985",
"0.60220873",
"0.59556115",
"0.59556115",
"0.5931432",
"0.59047455",
"0.59003496",
"0.58981335",
"0.5818988",
"0.5774138",
"0.57187855",
"0.5647654",
"0.56298476",
"0.56226015",
"0.5579766",
"0.55760056",
"0.5530019",
"0.55294836",
"0.55139637",
"0.5492449",
"0.54808104",
"0.54808104",
"0.54808104",
"0.547928",
"0.5476711",
"0.5447145"
]
| 0.68395483 | 1 |
allPortletEntries function This function is used to get all portlet enteries | public function allPortletEntries() {
try {
$client = new SoapClient($this->PORTLETS_WHDL);
$res = $client->getAllPortlet();
return $res;
} catch (Zend_Exception $e) {
var_dump($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllLeaflets(){\n\t\t//$queryEbsLeaflets = db_select('ebs_leaflets_final_static', 'elf')\n\t\t$queryEbsLeaflets = db_select('ebs_leaflets_final', 'elf')\n\t\t->fields('elf');\n\t\t//->condition('leaflet_code', 'L16302');//Plastering\n\t\t//->range(0,10);\n\t\t$results = $queryEbsLeaflets->execute();\n\t\t//dsm($results->rowCount());\n\t\t\n\t\tforeach ($results as $row) :\n\t\t\t$this->leaflets[$row->leaflet_code] = $row;\n\t\tendforeach;\n\t\t\n\t}",
"public function userPortletEntries() {\n try {\n $client = new SoapClient($this->USER_PORTLETS_WHDL);\n $res = $client->getUserPortlet(array('userid' => $_SESSION['User']['id']));\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public function entries();",
"public function getPortlets() {\n try {\n $client = new SoapClient($this->PORTLETS_WSDL);\n $res = $client->findAllActivePortlets();\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public function actionAddressListAll() \r\n {\r\n return $this->listing(0, true, Yii::$app->request->get('area_id'));\r\n }",
"public function getEntriesList(){\n return $this->_get(2);\n }",
"public function getRootEntries();",
"public function entries(){\n return $this->routes;\n }",
"public function getEntries(): array\n {\n return $this->entries;\n }",
"public function get_all_hotspot(){\n return $this->query('/ip/hotspot/getall');\n }",
"public function get_sitemap_entries()\n {\n }",
"public static function all();",
"public static function all();",
"public static function all();",
"public function get_all()\n\t{\n\t\t$db = $this->db_connection->get_connection();\n\n $sql = \"SELECT id, realtor, manager FROM settings_reserve ORDER BY id DESC\";\n\n \t$query = $db->prepare($sql);\n\n\t\tif ($query->execute()) {\n\t\t\treturn $query->fetchAll(\\PDO::FETCH_ASSOC);\n\t\t} else {\n\t\t\thttp_response_code(500);\n\t\t\t$this->validator->check_response();\n\t\t}\n\t}",
"public static function getAll() {}",
"public function getPageEntryIds();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();"
]
| [
"0.6176444",
"0.604833",
"0.5811748",
"0.5711449",
"0.5634922",
"0.5633302",
"0.5483635",
"0.54601353",
"0.5457423",
"0.5445203",
"0.5368463",
"0.53073496",
"0.53073496",
"0.53073496",
"0.5245478",
"0.52420926",
"0.5237719",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111",
"0.5219111"
]
| 0.79756707 | 0 |
userPortletEntries function This function is used to get all portlet enteries selected by user | public function userPortletEntries() {
try {
$client = new SoapClient($this->USER_PORTLETS_WHDL);
$res = $client->getUserPortlet(array('userid' => $_SESSION['User']['id']));
return $res;
} catch (Zend_Exception $e) {
var_dump($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allPortletEntries() {\n try {\n $client = new SoapClient($this->PORTLETS_WHDL);\n $res = $client->getAllPortlet();\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }",
"public function getEntriesList(){\n return $this->_get(2);\n }",
"public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}",
"public function getPartinUsersList(){\n return $this->_get(2);\n }",
"public function getPresidentUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'President/CEO'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }",
"public function getLTIUsers();",
"function nice_get_entries()\n\t{\n\t\t$_m=$GLOBALS['SITE_DB']->query_select('f_welcome_emails',array('*'));\n\t\t$entries=new ocp_tempcode();\n\t\tforeach ($_m as $m)\n\t\t{\n\t\t\t$entries->attach(form_input_list_entry(strval($m['id']),false,$m['w_name']));\n\t\t}\n\n\t\treturn $entries;\n\t}",
"public function api_entry_list() {\n $data = $this->Mdl_Users->get_list(\n $_POST['rp'],\n $_POST['page'],\n $_POST['query'],\n $_POST['qtype'],\n $_POST['sortname'],\n $_POST['sortorder']);\n\n echo json_encode(array(\n 'page'=>$_POST['page'],\n 'total'=>$this->Mdl_Users->get_length(),\n 'rows'=>$data,\n ));\n }",
"public function entries();",
"public function getVPOperationUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'VP Operations'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }",
"public function getPageEntryIds();",
"public function getPostersArray() {\n\t\treturn icms::handler('icms_member')->getUserList();\n\t}",
"public static function userdept(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM user_department'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }",
"public function getEntries($user) {\n\t\t$db = $this->db;\n\t\t$user = $db->quote($user);\n\t\t$query = \"SELECT value FROM entries WHERE user=$user\";\n\t\t$result = $db->query($query);\n\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t}",
"public function getPortlets() {\n try {\n $client = new SoapClient($this->PORTLETS_WSDL);\n $res = $client->findAllActivePortlets();\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"private function getPortletsForMode ()\n\t{\n\t\t$this->import('Database');\n\t\t$query = \"SELECT * FROM tl_module WHERE isSimpleFrontendPortlet = ?\";\n\t\t$params = array('1');\n\t\t\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$query .= \" AND pid IN (SELECT t.id FROM tl_theme t JOIN tl_layout l ON t.id = l.pid WHERE l.id = ?)\";\n\t\t\tglobal $objPage;\n\t\t\t$params[] = $objPage->layout;\n\t\t}\n\t\t\n\t\treturn $this->Database->prepare($query)->execute($params);\n\t}",
"public function getPrivateUsers()\n\t{\n\t\t$opt = get_option('ld_private_users');\n\t\tif ( !is_array( $opt ) )\n\t\t\treturn array();\n\t\t\n\t\treturn $opt;\n\t}",
"function get_user_list(){\n\t\treturn array();\n\t}",
"public function getUsers(){\n\t\t\n\t\t$ar = array();\n\t\t\n\t\t$result = $this->adapter->query(\"select * from vemplist order by ctct_name\")->execute();\n\t\t\n\t\tforeach ($result as $row) \n\t\t\t{\n\t\t\t\t$ar[$row['emp_id']]=$row['ctct_name'];\n\t\t\t}\n\t\t\n\t\treturn $ar;\n\t}",
"function get_all_user_settings()\n {\n }",
"function Eternizer_user_main($args) {\n $tpl = FormUtil::getPassedValue('tpl', $args['tpl'], 'G');\n if (!SecurityUtil::checkPermission('Eternizer::', '::', ACCESS_READ)) {\n return LogUtil::registerPermissionError();\n }\n\n $dom = ZLanguage::getModuleDomain('Eternizer');\n\n $startnum = FormUtil::getPassedValue('startnum', $args['startnum'], 'G');\n $perpage = FormUtil::getPassedValue('perpage', $args['perpage'], 'G');\n\n $config = pnModGetVar('Eternizer');\n if (!empty($perpage))\n $config['perpage'] = $perpage;\n\n $entries = pnModAPIFunc('Eternizer', 'user', 'GetEntries', array('startnum' => $startnum-1, 'perpage' => $perpage));\n\n $pnRender = pnRender::getInstance('Eternizer', false, null, true);\n\n $count = pnModAPIFunc('Eternizer', 'user', 'CountEntries');\n\n $pnRender->assign('startnum', $startnum);\n $pnRender->assign('count', $count);\n $pnRender->assign('config', $config);\n\n $entryhtml = array();\n foreach (array_keys($entries) as $k) {\n $act =& $entries[$k];\n $act = DataUtil::formatForDisplayHTML($act);\n $act['text'] = Eternizer_WWAction($act['text']);\n $act['text'] = nl2br($act['text']);\n $act['comment'] = nl2br($act['comment']);\n list($act['text']) = pnModCallHooks('item', 'transform', '', array($act['text']));\n list($act['comment']) = pnModCallHooks('item', 'transform', '', array($act['comment']));\n\n $act['right_moderate'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_MODERATE);\n $act['right_edit'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_EDIT);\n $act['right_delete'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_DELETE);\n\n $profile = array();\n foreach (array_keys($config['profile']) as $pk) {\n $profile[$pk] = $act['profile'][$pk];\n }\n\n $act['profile'] = $profile;\n $act['avatarpath'] = pnModGetVar('Users', 'avatarpath');\n\n $pnRender->assign($act);\n if (!empty($tpl) && $pnRender->template_exists('Eternizer_user_'. DataUtil::formatForOS($tpl) .'_entry.tpl')) {\n $entryhtml[] = $pnRender->fetch('Eternizer_user_'. DataUtil::formatForOS($tpl) . '_entry.tpl');\n }\n else {\n $entryhtml[] = $pnRender->fetch('Eternizer_user_entry.tpl');\n }\n }\n\n $pnRender->assign('entries', $entryhtml);\n $pnRender->assign('entryarray', $entries);\n\n $form = pnModFunc('Eternizer', 'user', 'new', array( 'inline' => true));\n $pnRender->assign('form', $form===false?'':$form );\n\n if (!empty($tpl) && $pnRender->template_exists('Eternizer_user_'. DataUtil::formatForOS($tpl) .'_main.tpl')) {\n return $pnRender->fetch('Eternizer_user_'. DataUtil::formatForOS($tpl).'_main.tpl');\n }\n else {\n return $pnRender->fetch('Eternizer_user_main.tpl');\n }\n}",
"public function UserOptions() {\n return $this->connection->query_direct('DBCC UserOptions')->fetchAllKeyed();\n }",
"public function colonies() {\n $form_node_title = 'Members Only'; \n \n\n // find node with webform\n $node = \\Drupal::entityTypeManager()\n ->getStorage('node')\n ->loadByProperties(['title' => $form_node_title]);\n\n // find form submissions\n# $wf = Webform::load('cat_colony_form');\n $storage = \\Drupal::entityTypeManager()->getStorage('webform_submission');\n $submissions = $storage->loadByProperties([\n 'entity_type' => 'node',\n 'entity_id' => array_keys($node)[0]\n ]);\n $locations = array();\n foreach ($submissions as $submission) {\n $data = $submission->getData();\n $data[id] = $submission->id();\n $locations[] = $data;\n }\n return array(\n '#theme' => 'colony_map',\n\t'#title' => 'Colony Map',\n '#locations' => $locations, \n );\n }",
"public function findUserPairsForSelectForm($padding = '-'){\n\n $options = array();\n $user_table = $this->_db->getTable('User');\n $assignable_users = $user_table->findAll();\n\n foreach ($assignable_users as $user) {\n $options[$user['id']] = $user['name'] ? $user['name'] : $user['username'];\n }\n\n return $options;\n }",
"public function memberAdminProgrammeList($eid) {\n $content = array();\n\n $content['message'] = array(\n '#markup' => $this->t('Here is a list of all members who ticked the \"programme participant\" checkbox.'),\n );\n\n $rows = array();\n $headers = array(\n t('Type'),\n t('Member No'),\n t('First Name'),\n t('Last Name'),\n t('Email'),\n t('Badge Name'),\n t('Paid'),\n t('Approved'),\n );\n\n foreach ($entries = SimpleConregStorage::adminProgrammeMemberListLoad($eid) as $entry) {\n // Sanitize each entry.\n $rows[] = $entry;\n }\n $content['table'] = array(\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n // Don't cache this page.\n $content['#cache']['max-age'] = 0;\n\n return $content;\n }",
"public function allupgraders(){\n // SQL statement\n $sql = \"SELECT * FROM user WHERE special = 1 AND (role = 'account' OR role = 'administrator') \";\n $result = $this->con->query($sql);\n\n // check if there is a user\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }",
"function get_all_users($not_include_admin = 0)\r\n{ \r\n global $db,$strings;\r\n $count = 0;\r\n $result = $db->query('SELECT user_id,username FROM users ORDER BY username ASC');\r\n\r\n while (@extract($db->fetch_array($result), EXTR_PREFIX_ALL, 'db')) {\r\n\t\tif(($not_include_admin == 0) || ($db_username != \"admin\")) {\r\n \t$users[$db_user_id] = $db_username;\r\n\t\t\t$count ++;\r\n\t\t}\r\n }\r\n\r\n\t$users[-1] = $strings[IPMAP_NOTASSIGNED];\r\n return $users;\r\n}",
"function users_list($how=0,$offlim=NULL){\n $res = array();\n if(!is_null($offlim) and count($this->domains)>1) qz();\n foreach($this->domains as $ck=>$cd){\n $tmp = array();\n foreach((array)$cd->user_list($offlim) as $vdn)\n\t$tmp[$vdn] = $this->user_disp($vdn);\n if(empty($tmp)) continue;\n if($how==1) $res[$ck] = $tmp; \n else $res = array_merge($res,$tmp);\n }\n return $res;\n }",
"public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}"
]
| [
"0.67762697",
"0.57619816",
"0.5582212",
"0.54887474",
"0.5416936",
"0.5363085",
"0.5272938",
"0.5263771",
"0.5249547",
"0.5231821",
"0.52012074",
"0.51996034",
"0.5195534",
"0.51937926",
"0.5169772",
"0.51692915",
"0.5168951",
"0.5033899",
"0.5026059",
"0.50259656",
"0.5016418",
"0.50158554",
"0.5000633",
"0.4999919",
"0.49987206",
"0.49853113",
"0.4984479",
"0.49750182",
"0.4968725",
"0.49641442"
]
| 0.7723702 | 0 |
getResolutions function This function is used to get all resolutions | public function getResolutions() {
try {
$client = new SoapClient($this->RESOLUTION_WSDL);
$res = $client->findAllActiveResolution();
return $res;
} catch (Zend_Exception $e) {
var_dump($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getResolutions(){\n\t\t\t$result = ScreenResolution::select('screen_size_id', DB::raw('CONCAT( width, \"x\", height ) AS resolution') )\n\t\t\t\t\t\t\t\t\t ->where('status', '=', 1)\n\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $result;\n\t\t}",
"public function getResolution();",
"private function getResolutions($for)\n\t{\n\t\tif(array_key_exists($for, config('filter.for'))) {\n\t\t\treturn array_map(function($item) {\n\t\t\t\treturn $item['value'];\n\t\t\t}, config('filter.for')[$for]['resolutions']);\n\t\t}\n\n\t\treturn array();\n\t}",
"function getVideoResolutions() {\n // Load Report Video values\n $model = Settings::where('key', VIDEO_RESOLUTIONS_KEY)->get();\n // Return array of values\n return $model;\n}",
"function getImageResolutions() {\n // Load Report Video values\n $model = Settings::where('key', IMAGE_RESOLUTIONS_KEY)->get();\n // Return array of values\n return $model;\n}",
"public function getResolution()\n {\n return $this->resolution;\n }",
"private function getRegisteredImageSizes()\n {\n foreach(get_intermediate_image_sizes() as $size){\n $arr[$size] = ucfirst($size);\n };\n return $arr;\n }",
"public function getResources()\n {\n// 18.02.2015 php 5.2\n// $resources = array_map(function ($resource) {\n// return is_array($resource) ? $resource : array($resource);\n// }, $this->getRawResources());\n//\n $resources = array_map(array(\"FikenHal\", \"inner\"), $this->getRawResources());\n\n return $resources;\n }",
"public function getResources(): array {\n\t\tif (is_null($this->resources)) {\n\t\t $this->loadResources();\n\t\t}\n\t\treturn $this->resources;\n\t}",
"public function getEvolutions()\n {\n return $this->evolutions;\n }",
"public static function getResolutions($committeeId, $topicId){\n $result = mysql_query(\"SELECT id FROM resolution_list WHERE committeeId='$committeeId' AND topicId='$topicId'\") or die(mysql_error());\n $resolutionIds = array();\n while($row = mysql_fetch_array($result)){\n array_push($resolutionIds, $row['id']);\n }\n return $resolutionIds;\n }",
"public function getResources()\n {\n return $this->resources;\n }",
"public function getResources()\n {\n return $this->resources;\n }",
"public function getResources()\n {\n return $this->resources;\n }",
"public function getResources()\n {\n return $this->resources;\n }",
"private function get_image_sizes() {\n\n\t\treturn array(\n\t\t\t'square_medium' => array( 200, 200 ),\n\t\t\t'full' => array( 1200, 1200 ),\n\t\t);\n\n\t}",
"public static function getAllImageSizes()\n {\n $sizes = array();\n // make thumbnails and other intermediate sizes\n global $_wp_additional_image_sizes;\n\n foreach (get_intermediate_image_sizes() as $s) {\n $sizes[$s] = array('width' => '', 'height' => '', 'crop' => false);\n if (isset($_wp_additional_image_sizes[$s]['width']))\n $sizes[$s]['width'] = intval($_wp_additional_image_sizes[$s]['width']); // For theme-added sizes\n else\n $sizes[$s]['width'] = get_option(\"{$s}_size_w\"); // For default sizes set in options\n if (isset($_wp_additional_image_sizes[$s]['height']))\n $sizes[$s]['height'] = intval($_wp_additional_image_sizes[$s]['height']); // For theme-added sizes\n else\n $sizes[$s]['height'] = get_option(\"{$s}_size_h\"); // For default sizes set in options\n if (isset($_wp_additional_image_sizes[$s]['crop']))\n $sizes[$s]['crop'] = intval($_wp_additional_image_sizes[$s]['crop']); // For theme-added sizes\n else\n $sizes[$s]['crop'] = get_option(\"{$s}_crop\"); // For default sizes set in options\n }\n\n $sizes = apply_filters('intermediate_image_sizes_advanced', $sizes);\n return $sizes;\n }",
"private function _getProjectionSize() {\n\t\t$sourceWidth = $this->params['sourceWidth'];\n\t\t$sourceHeight = $this->params['sourceHeight'];\n\t\t$sourceRatio = $sourceWidth / $sourceHeight;\n\n\t\t$canvasWidth = $this->params['w'];\n\t\t$canvasHeight = $this->params['h'];\n\t\t$canvasRatio = $canvasWidth / $canvasHeight;\n\n\n\t\t//\tthe image is not allowed to be cut off in any dimension\n\t\tif ($sourceRatio < $canvasRatio) {\n\t\t\t//\tsource is less landscape-like than canvas\n\t\t\t$leadDimension = !$this->params['crop'] ?\n\t\t\t\t'Height' : 'Width';\n\t\t} else {\n\t\t\t//\tsource is more landscape-like than canvas\n\t\t\t$leadDimension = !$this->params['crop'] ?\n\t\t\t\t'Width' : 'Height';\n\t\t}\n\n\t\tif (\n\t\t\t!$this->params['grow'] &&\n\t\t\t${'source'.$leadDimension} < ${'canvas'.$leadDimension}\n\t\t) {\n\t\t\t${'projection'.$leadDimension} = ${'source'.$leadDimension};\n\t\t} else {\n\t\t\t${'projection'.$leadDimension} = ${'canvas'.$leadDimension};\n\t\t}\n\n\t\tif (isset($projectionWidth)) {\n\t\t\t$projectionHeight = $projectionWidth / $sourceRatio;\n\t\t} elseif (isset($projectionHeight)) {\n\t\t\t$projectionWidth = $projectionHeight * $sourceRatio;\n\t\t}\n\n\t\treturn array(round($projectionWidth), round($projectionHeight));\n\t}",
"public function getResources(): array\n {\n return $this->resources;\n }",
"protected function getResources()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCES_ARGUMENT_NAME)->getValue();\n\t}",
"public static function getAllDimensions()\n {\n $cacheId = CacheId::pluginAware('VisitDimensions');\n $cache = PiwikCache::getTransientCache();\n\n if (!$cache->contains($cacheId)) {\n $plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();\n $instances = array();\n\n foreach ($plugins as $plugin) {\n foreach (self::getDimensions($plugin) as $instance) {\n $instances[] = $instance;\n }\n }\n\n $instances = self::sortDimensions($instances);\n\n $cache->save($cacheId, $instances);\n }\n\n return $cache->fetch($cacheId);\n }",
"private function getImageConfigSizes() : Array\n\t\t{\n\t\t\t$configKeysToFind = ['large.image.size', 'medium.image.size', 'small.image.size'];\n\t\t\t\n\t\t\t$dql = \"SELECT c.name, c.value \n\t\t\t\t\tFROM ReaccionEstudio\\ReaccionCMSBundle\\Entity\\Configuration c\n\t\t\t\t\tWHERE c.name IN (:configKeys)\";\n\n\t\t\t$query = $this->em->createQuery($dql)\n\t\t\t\t\t\t\t\t->setParameter(\"configKeys\", $configKeysToFind);\n\n\t\t\treturn $query->getResult();\n\t\t}",
"private function get_definitions() {\n\t\t// Load definitions if not set\n\t\tif (empty($this->definition_list)) {\n\t\t\t$search_engines = \\Spyc::YAMLLoad(self::DEFINITION_FILE);\n\n\t\t\t$url_to_info = [];\n\n\t\t\tforeach ($search_engines as $name => $info) {\n\t\t\t\tif (empty($info) || !is_array($info)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($info as $url_definitions) {\n\t\t\t\t\tforeach ($url_definitions['urls'] as $url) {\n\t\t\t\t\t\t$search_engine_data = $url_definitions;\n\t\t\t\t\t\tunset($search_engine_data['urls']);\n\t\t\t\t\t\t$search_engine_data['name'] = $name;\n\t\t\t\t\t\t$url_to_info[$url] = $search_engine_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->definition_list = $url_to_info;\n\t\t}\n\n\t\treturn $this->definition_list;\n\t}",
"public function findAllAvailableDimensions()\n {\n $query = $this->getEntityManager()->createQuery('SELECT c.width, c.height FROM AppBundle\\Entity\\Contentunit c');\n\n return $query->getArrayResult();\n }",
"public function getRegisteredResources()\n {\n $result = array();\n foreach ($this->getResourcesTypes() as $type) {\n $result[$type] = $this->getRegisteredResourcesByType($type);\n }\n\n return $result;\n }",
"public function getResolver()\n {\n }",
"public function getFiltroResolucion()\n {\n $resultado = array();\n $sql = \"\n SELECT STRING_AGG(v.tipo_resolucion,',') AS o_resultado FROM ( \nSELECT CAST(r.tipo_resolucion AS CHARACTER VARYING)\nFROM cargos c\nINNER JOIN resoluciones r ON c.resolucion_ministerial_id = r.id\nWHERE c.baja_logica = 1\nGROUP BY r.id,r.tipo_resolucion\nORDER BY r.id\n) AS v\n \";\n $this->_db = new Cargos();\n $arr = new Resultset(null, $this->_db, $this->_db->getReadConnection()->query($sql));\n if (count($arr) > 0) {\n /**\n * Para agregar un valor nulo al inicio se añade una coma\n */\n $res = $arr[0]->o_resultado;\n $resultado = explode(\",\", $res);\n }\n return $resultado;\n }",
"public function getPlanResolution()\n {\n return $this->plan_resolution;\n }",
"public function resolvable();",
"public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}"
]
| [
"0.80982244",
"0.6909432",
"0.6531623",
"0.63554764",
"0.6345761",
"0.6285803",
"0.56788623",
"0.56481916",
"0.5644111",
"0.5577921",
"0.54016495",
"0.53626347",
"0.53626347",
"0.53626347",
"0.53626347",
"0.5349729",
"0.53468484",
"0.5334881",
"0.5330813",
"0.5326807",
"0.53228617",
"0.53216064",
"0.5320695",
"0.52969915",
"0.52780145",
"0.527517",
"0.5257441",
"0.5253929",
"0.52465403",
"0.524435"
]
| 0.75999534 | 1 |
updateContainer function This function is used to update container | public function updateContainer($data) {
try {
$client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
print_r($data);
$client->setOptions($options);
$client->action = 'updateContainer';
$result = $client->updateContainer(array(
'backgroundColor' => $data['backgroundColor'],
'borderBottom' => $data['borderBottom'],
'borderBottomColor' => $data['borderBottomColor'],
'borderBottomStyle' => $data['borderBottomStyle'],
'borderBottomUnit ' => $data['borderBottomUnit'],
'borderLeft' => $data['borderLeft'],
'borderLeftColor' => $data['borderLeftColor'],
'borderLeftStyle' => $data['borderLeftStyle'],
'borderLeftUnit' => $data['borderLeftUnit'],
'borderRight' => $data['borderRight'],
'borderRightColor' => $data['borderRightColor'],
'borderRightStyle' => $data['borderRightStyle'],
'borderRightUnit' => $data['borderRightUnit'],
'borderTop' => $data['borderTop'],
'borderTopColor' => $data['borderTopColor'],
'borderTopStyle' => $data['borderTopStyle'],
'borderTopUnit' => $data['borderTopUnit'],
'bottomMargin' => $data['bottomMargin'],
'bottomMarginUnit' => $data['bottomMarginUnit'],
'bottomPadding' => $data['bottomPadding'],
'bottomPaddingUnit' => $data['bottomPaddingUnit'],
'containerHeight' => $data['containerHeight'],
'containerId' => $data['containerId'],
'containerName' => $data['containerName'],
'containerWidth' => $data['containerWidth'],
'containerXaxis' => $data['containerXaxis'],
'containerYaxis' => $data['containerYaxis'],
'css' => $data['css'],
'font' => $data['font'],
'fontAlignment' => $data['fontAlignment'],
'fontColor' => $data['fontColor'],
'fontSize' => $data['fontSize'],
'isActive' => true,
'isBold' => $data['isBold'],
'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],
'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],
'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],
'isItalic' => $data['isItalic'],
'isMargineSameForAll' => $data['isMargineSameForAll'],
'isPaddingSameForAll' => $data['isPaddingSameForAll'],
'leftMargin' => $data['leftMargin'],
'leftMarginUnit' => $data['leftMarginUnit'],
'leftPadding' => $data['leftPadding'],
'leftPaddingUnit' => $data['leftPaddingUnit'],
'letterSpacing' => $data['letterSpacing'],
'lineHeight' => $data['lineHeight'],
'primaryKey' => $data['containerId'],
'rightMargin' => $data['rightMargin'],
'rightMarginUnit' => $data['rightMarginUnit'],
'rightPadding' => $data['rightPadding'],
'rightPaddingUnit' => $data['rightPaddingUnit'],
'textDecoration' => $data['textDecoration'],
'topMargin' => $data['topMargin'],
'topMarginUnit' => $data['topMarginUnit'],
'topPadding' => $data['topPadding'],
'topPaddingUnit' => $data['topPaddingUnit'],
'updatedby' => $_SESSION['Username'],
'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',
'wordSpacing' => $data['wordSpacing'],
'containerId' => $data['containerId'],
));
return $result;
} catch (Exception $e) {
// print_r($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateContainer($container)\n {\n $container->content = 'L';\n $container->dl_check = 1;\n $container->m_content = 'L';\n $container->save();\n\n return $container;\n }",
"public function testUpdatePolicyContainer()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function updateStatus(): void\n {\n $shell = $this->getShell();\n $shell->exec(\"docker ps | grep traefik | awk '{print \\$1;}'\");\n if ($shell->getOutput() !== '') {\n $this->started = true;\n $this->containerId = $shell->getOutput();\n } else {\n $this->started = false;\n $this->containerId = null;\n }\n }",
"function update() {\n\n\t\t\t}",
"public function modify(Container $container): void\n {\n }",
"public function rebuildContainer()\n {\n $container = new ContainerBuilder();\n\n $loader = new YamlFileLoader($container, new FileLocator(static::getAppDir()));\n $loader->load('config_'.$this->env.'.yml');\n\n $this->setContainer($container);\n $this->loadBundles();\n }",
"public function processContainer()\n {\n $class = \"container\";\n if ($this->hasFluid()) $class .= \"-fluid\";\n $this->add($this->createWrapper('div', ['class' => $class], $this->stringifyHeader() . $this->stringifyCollapse()));\n }",
"public function getContainer() {}",
"public function rebuild()\n {\n // Clean up unused images\n $this->clean();\n\n // Shut down the containters\n $this->destroyContainers();\n\n // Re-build new containers\n $this->buildContainers();\n }",
"public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }",
"public function update() {\n \n }",
"public function update() {\r\n\r\n\t}",
"abstract public function update();",
"abstract public function update();",
"protected function update() {}",
"abstract function update();",
"function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }",
"public function modify(Container $di);",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function update() {\n parent::update();\n }",
"public abstract function update();",
"public function update() {\r\n }",
"public function flushContainersCaches()\n {\n $containers = $this->getContainers();\n\n foreach ($containers as $key => $containerName) {\n $this->flushContainerCache($containerName);\n }\n }",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"public static function update(){\n }"
]
| [
"0.6290778",
"0.5947805",
"0.582383",
"0.5721363",
"0.57212317",
"0.5496775",
"0.54782546",
"0.54083705",
"0.53717107",
"0.53517413",
"0.5305107",
"0.53033054",
"0.52776194",
"0.52776194",
"0.52726024",
"0.5252824",
"0.52504414",
"0.5248724",
"0.5245301",
"0.5245301",
"0.5245301",
"0.5245301",
"0.5245301",
"0.52405983",
"0.5229706",
"0.52241695",
"0.5217847",
"0.51929295",
"0.51929295",
"0.51829994"
]
| 0.64739907 | 0 |
getContainerById function This function is used to get container by id | public function getContainerById($id) {
try {
$client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
$client->setOptions($options);
$client->action = 'findByContainerId';
$result = $client->findByContainerId($id);
return $result;
} catch (Exception $e) {
//return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiContainer($id){\n try{\n $query_id = Crypt::decryptString($id);\n } catch (DecryptException $e) {\n return 'UPD-E0002';\n }\n \n $container = GroupContainer::find($query_id);\n $container->crypt = $id;\n return $container;\n }",
"public function editContainer($id){\n\t\tdd('TemplateEditorRepository: editContainer()');\n\t\treturn(TemplateContainer::find($id));\n\t}",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"private function get($id){\n global $kernel;\n if ('AppCache' == get_class($kernel)) {\n $kernel = $kernel->getKernel();\n }\n return $kernel->getContainer()->get($id);\n }",
"public function getContainer() {}",
"public function getContainerPortletById($id) {\n try {\n $client = new Zend_Soap_Client($this->LAYOUT_PORTLET_WSDL);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'findByContainerId';\n $result = $client->findByContainerId($id);\n return $result;\n } catch (Exception $e) {\n //return false;\n }\n }",
"protected function get($id)\n {\n return $this->container[$id];\n }",
"public function get($id)\n {\n return $this->getContainer()->get($id);\n }",
"function di($id = null)\n {\n $container = ApplicationContext::getContainer();\n if ($id) {\n return $container->get($id);\n }\n return $container;\n }",
"protected function _getContainer()\n {\n if ($this->_oContainer === null) {\n $this->_oContainer = oxNew('bestitAmazonPay4OxidContainer');\n }\n\n return $this->_oContainer;\n }",
"function di(?string $id = null)\n {\n $container = ApplicationContext::getContainer();\n if ($id) {\n return $container->get($id);\n }\n\n return $container;\n }",
"public function get_by_container_id($id, $owner) {\n if ($owner == 'cartao') {\n $tabela = 'cartao_papel';\n $coluna = 'cartao';\n } else if ($owner == 'envelope') {\n $tabela = 'envelope_papel';\n $coluna = 'envelope';\n } else if ($owner == 'personalizado') {\n $tabela = 'personalizado_papel';\n $coluna = 'personalizado';\n } else {\n return false;\n }\n $this->db->where($coluna, $id);\n $result = $this->db->get($tabela);\n if (!empty($result->num_rows())) {\n $containers = $this->get_posicao_papel_parent_grouped($tabela, $coluna, $id);\n $result_container = array();\n foreach ($containers as $value) {\n $result_container[$value['posicao_papel_parent']] = $this->get_container_papel($tabela, $coluna,$id,$value['posicao_papel_parent'], $owner);\n }\n return $result_container;\n }\n return array();\n }",
"public function get($id)\n {\n return $this->container->get($id);\n }",
"protected function get($id)\n {\n return $this->container->get($id);\n }",
"public function setContainerId($id)\n\t{\n\t\t$this->_containerId = $id;\n\t}",
"abstract protected function getContainer(): ContainerInterface;",
"private function getContainerId(): ?string\n {\n return $this->containerId;\n }",
"public function container();",
"public function get_container() { return $this->container; }",
"public function getContainer($selector)\n {\n\n }",
"public function getContainer()\n\t{\n\t\tif (!$this->container) {\n\t\t\t$this->createContainer();\n\t\t}\n\t\treturn $this->container;\n\t}",
"public function getContainer($name=NULL)\r\n\t{\r\n\t\tif ($this->_container != NULL)\r\n\t\t\treturn $this->_container;\r\n\r\n\t\tif ($name == NULL)\r\n\t\t\treturn $this->_container = false;\r\n\r\n $this->_container = $this->getService()->getContainer($name);\r\n\r\n // Enforce the quote if one is defined in our override control\r\n if (($container_max_size = Cii::get($this->_overrideControl, 'max_container_size', 0)) != 0)\r\n \t$this->_container->setBytesQuota($container_max_size);\r\n\r\n return $this->_container;\r\n\t}",
"public function getContainer(): ContainerInterface\n {\n return parent::getContainer();\n }",
"public function show($id){\n $container = Container::find($id);\n\n if(is_object($container)){\n $data = [\n 'code' => 200,\n 'status' => 'success',\n 'container' => $container\n ];\n }else{\n $data = [\n 'code' => 400,\n 'status' => 'error',\n 'message' => 'El envase no existe'\n ];\n }\n\n //Devolver resultado\n return response()->json($data, $data['code']);\n }",
"public function resolve(string $id, ContainerInterface $container);",
"public function get_control($id)\n {\n }"
]
| [
"0.7313941",
"0.72630984",
"0.6917761",
"0.6917761",
"0.6917761",
"0.6917761",
"0.6917761",
"0.6870776",
"0.6857306",
"0.68522614",
"0.6818698",
"0.66124433",
"0.65994334",
"0.6469962",
"0.6407047",
"0.63505465",
"0.6324328",
"0.6303207",
"0.6069069",
"0.6059326",
"0.6023313",
"0.5950165",
"0.5925837",
"0.58717394",
"0.5792506",
"0.5775219",
"0.57673496",
"0.5707188",
"0.57070655",
"0.57066655"
]
| 0.7747591 | 0 |
getPortletById function This function is used to get portlet by id | public function getPortletById($id) {
try {
$client = new Zend_Soap_Client($this->PORTLETS_WSDL);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
$client->setOptions($options);
$client->action = 'findByPortletId';
$result = $client->findByPortletId($id);
return $result;
} catch (Exception $e) {
//return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getContainerPortletById($id) {\n try {\n $client = new Zend_Soap_Client($this->LAYOUT_PORTLET_WSDL);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'findByContainerId';\n $result = $client->findByContainerId($id);\n return $result;\n } catch (Exception $e) {\n //return false;\n }\n }",
"function _getportbyid($id)\n{\n\tforeach (Config::$Servers as $sid => $sport)\n\t\tif ($id == $sid + 1)\n\t\t\treturn $sport;\n\t\n\tthrow new Exception('Bad server ID #' . $id);\n}",
"private function getPortletsForMode ()\n\t{\n\t\t$this->import('Database');\n\t\t$query = \"SELECT * FROM tl_module WHERE isSimpleFrontendPortlet = ?\";\n\t\t$params = array('1');\n\t\t\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$query .= \" AND pid IN (SELECT t.id FROM tl_theme t JOIN tl_layout l ON t.id = l.pid WHERE l.id = ?)\";\n\t\t\tglobal $objPage;\n\t\t\t$params[] = $objPage->layout;\n\t\t}\n\t\t\n\t\treturn $this->Database->prepare($query)->execute($params);\n\t}",
"public function show($id, $port) {\n if(empty($port)){\n return $this->handleNotFound(function () use ($id) {\n return $this->service->findAll($this->userId, $id);\n });\n }\n return $this->handleNotFound(function () use ($id, $port) {\n return $this->service->find($this->userId, $id, $port);\n });\n }",
"function get_portal_by_id($portal_id) {\n $sql = \"SELECT * FROM com_portal WHERE portal_id = ?\";\n $query = $this->db->query($sql, $portal_id);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"public function get_panel($id)\n {\n }",
"public function getDropletById($id)\n {\n $url = $this->host . '/droplets/' . $id;\n $data = $this->get($url);\n $droplet = new Droplet();\n $droplet->fromArray($data['droplet']);\n\n $response = new Response();\n $response->setData($droplet);\n return $response;\n }",
"public function get( $id ){}",
"public function getById($id)\n {\n return $this->getResult($this->client->get(\"droplets/{$id}\"))->droplet;\n }",
"protected function getPortletDetailsUrl()\n {\n return Yii::app()->createUrl('/' . $this->moduleId . '/defaultPortlet/details',\n array_merge($_GET, array( 'portletId' =>\n $this->params['portletId'],\n 'uniqueLayoutId' => $this->uniqueLayoutId)));\n }",
"public function show($id)\n {\n $port = Port::find($id);\n return view('ports.show', compact('port'));\n }",
"public function getPlanById(int $id){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $id, PDO::PARAM_INT)\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n return $foundPlan;\n }\n\n }\n else{\n // It isn't found so return false\n return false;\n }\n\n }",
"public function get($id) {\n\t}",
"public function getPortalId(): string;",
"public function getPortlets($objModule)\n\t{\n\t\t$objPortlets = $this->getPortletsForMode();\n\n\t\tif ($objPortlets->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$arrPortlets = array();\n\t\twhile ($objPortlets->next())\n\t\t{\n\t\t\t$arrPortlets[$objPortlets->id] = $objPortlets->simpleFrontendPortletName . \" (\" . $objPortlets->simpleFrontendPortletDescription . \")\";\n\t\t}\n\t\treturn $arrPortlets;\n\t}",
"public function planFind($id);",
"public function get( $id );",
"public function edit($id)\n {\n $port = Port::find($id);\n $servers = Server::all();\n $cryptos = Crypto::hydrate( DB::table('cryptos')->orderBy('name')->get()->toArray() );\n return view('ports.edit', compact('port', 'servers', 'cryptos'));\n }",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);"
]
| [
"0.69989693",
"0.6604329",
"0.6031833",
"0.5862441",
"0.5812298",
"0.5744732",
"0.55939275",
"0.5591593",
"0.550928",
"0.54824084",
"0.54546523",
"0.54375875",
"0.541807",
"0.54007286",
"0.5387358",
"0.5378726",
"0.5368209",
"0.533004",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387",
"0.53278387"
]
| 0.8178555 | 0 |
getContainerPortletById function This function is used to get container assigned portlet | public function getContainerPortletById($id) {
try {
$client = new Zend_Soap_Client($this->LAYOUT_PORTLET_WSDL);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
$client->setOptions($options);
$client->action = 'findByContainerId';
$result = $client->findByContainerId($id);
return $result;
} catch (Exception $e) {
//return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPortletById($id) {\n try {\n $client = new Zend_Soap_Client($this->PORTLETS_WSDL);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'findByPortletId';\n $result = $client->findByPortletId($id);\n return $result;\n } catch (Exception $e) {\n //return false;\n }\n }",
"private function getContainerId(): ?string\n {\n return $this->containerId;\n }",
"public function editContainer($id){\n\t\tdd('TemplateEditorRepository: editContainer()');\n\t\treturn(TemplateContainer::find($id));\n\t}",
"public function getContainerById($id) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'findByContainerId';\n $result = $client->findByContainerId($id);\n return $result;\n } catch (Exception $e) {\n //return false;\n }\n }",
"public function getContainer() {}",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"private function initContainerId()\n {\n if ($this->containerId === null) {\n $procFile = sprintf('/proc/%d/cpuset', $this->processId);\n if (is_readable($procFile)) {\n if (preg_match(\"#([a-f0-9]{64})#\", trim(file_get_contents($procFile)), $cid)) {\n $this->containerId = $cid[0];\n return;\n }\n }\n $this->containerId = '';\n }\n }",
"public function apiContainer($id){\n try{\n $query_id = Crypt::decryptString($id);\n } catch (DecryptException $e) {\n return 'UPD-E0002';\n }\n \n $container = GroupContainer::find($query_id);\n $container->crypt = $id;\n return $container;\n }",
"private function get($id){\n global $kernel;\n if ('AppCache' == get_class($kernel)) {\n $kernel = $kernel->getKernel();\n }\n return $kernel->getContainer()->get($id);\n }",
"public function getHtmlContainerId()\n {\n return $this->htmlContainerId;\n }",
"protected function _getContainer()\n {\n if ($this->_oContainer === null) {\n $this->_oContainer = oxNew('bestitAmazonPay4OxidContainer');\n }\n\n return $this->_oContainer;\n }",
"protected function get($id)\n {\n return $this->container[$id];\n }",
"public function getContainer()\n {\n return $this->getModule()->getContainer();\n }",
"public function getContainerName();",
"public function get_container() { return $this->container; }",
"public function get_by_container_id($id, $owner) {\n if ($owner == 'cartao') {\n $tabela = 'cartao_papel';\n $coluna = 'cartao';\n } else if ($owner == 'envelope') {\n $tabela = 'envelope_papel';\n $coluna = 'envelope';\n } else if ($owner == 'personalizado') {\n $tabela = 'personalizado_papel';\n $coluna = 'personalizado';\n } else {\n return false;\n }\n $this->db->where($coluna, $id);\n $result = $this->db->get($tabela);\n if (!empty($result->num_rows())) {\n $containers = $this->get_posicao_papel_parent_grouped($tabela, $coluna, $id);\n $result_container = array();\n foreach ($containers as $value) {\n $result_container[$value['posicao_papel_parent']] = $this->get_container_papel($tabela, $coluna,$id,$value['posicao_papel_parent'], $owner);\n }\n return $result_container;\n }\n return array();\n }",
"public function getContainer()\n {\n return $this->container = SMRESTBundle::getContainer();\n\n }",
"abstract protected function getContainer(): ContainerInterface;",
"function pixelgrade_get_posts_container_id( $location = array() ) {\n\t\treturn apply_filters( 'pixelgrade_posts_container_id', 'posts-container', $location );\n\t}",
"function di($id = null)\n {\n $container = ApplicationContext::getContainer();\n if ($id) {\n return $container->get($id);\n }\n return $container;\n }",
"public static function getContainer()\n {\n return self::$kernel->getContainer();\n }",
"public static function container(){\n\n $container = 'container';\n\n return $container;\n\n }",
"public function getContainer()\r\n {\r\n return $this->container;\r\n }",
"protected function getContainer()\n {\n return $this->kernel->getContainer();\n }",
"public function getContainer()\n {\n //Return container\n return $this->contentListContainer;\n }",
"public function container(): string;"
]
| [
"0.6206179",
"0.60682017",
"0.59871316",
"0.594841",
"0.5863705",
"0.56761324",
"0.56761324",
"0.56761324",
"0.56761324",
"0.56761324",
"0.55957335",
"0.5563759",
"0.55250055",
"0.5523886",
"0.54104036",
"0.5404021",
"0.53600514",
"0.5324838",
"0.53228927",
"0.52966577",
"0.5258112",
"0.5236482",
"0.5207876",
"0.5175958",
"0.51644707",
"0.51627266",
"0.51533896",
"0.5142002",
"0.5121126",
"0.51126784"
]
| 0.7637612 | 0 |
getLayoutList function This function is used to get layout list | public function getLayoutList() {
try {
$client = new Zend_Soap_Client($this->LAYOUT_WSDL_URI);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
$client->setOptions($options);
$client->action = 'findAllActiveLayout';
$result = $client->findAllActiveLayout();
return $result;
} catch (Exception $e) {
//return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLayouts();",
"public function getThemeLayouts();",
"public function getLayout();",
"public function getLayouts()\r\n {\r\n return $this->layouts;\r\n }",
"public function getLayouts() {\n $path = APPPATH.'opencnab/layouts';\n $diretorio = dir($path);\n\n //Grava em um array todos eles para uso durante a aplicação.\n $cont = 0;\n while($arquivo = $diretorio -> read()){\n if($arquivo <> '.' && $arquivo <> '..'){\n $this->layouts[$cont] = require_once($path.'/'.$arquivo);\n $cont++;\n }\n }\n $diretorio -> close();\n\n return $this->layouts;\n }",
"public function getPagelayouts($dc)\n\t{\n\t\t$objLayouts = $this->Database->prepare('SELECT id,name FROM tl_layout WHERE pid=?')->execute($dc->activeRecord->pid);\n\t\t$arrLayouts = array();\n\t\twhile($objLayouts->next())\t$arrLayouts[$objLayouts->id] = $objLayouts->name;\n\t\treturn $arrLayouts;\n\t}",
"public function getLayout() {}",
"public function get_layouts ()\n {\n return $this->_layouts;\n }",
"public function getLayouts(): ?array;",
"public function getLayouts(): array\n {\n $layouts = [];\n\n foreach ($this->config->get('layouts') as $layout) {\n $layout->setParentKey($this->getKey());\n\n $layouts[] = $layout->toArray();\n }\n\n return $layouts;\n }",
"function getLayout() {return $this->readLayout();}",
"public static function getLayout()\r\n {\r\n if (!isset(static::$_layout[static::layoutName()])) {\r\n $connection = static::getDb();\r\n static::$_layout[static::layoutName()] = $connection->getLayout(static::layoutName());\r\n }\r\n return static::$_layout[static::layoutName()];\r\n }",
"public function getLayoutsForSelect()\n {\n if (!$this->_layoutsInitialized) {\n $this->_initLayouts();\n }\n\n $results = [];\n foreach ($this->_layouts as $layout) {\n $results[$layout->id()] = $layout->name();\n }\n\n return $results;\n }",
"public function getPageLayout() {}",
"public function getLayout(){\n $layout = $this->getAttribute('layout');\n\n $initLayout = $this->initLayout();\n\n if(!$layout){ // layout hasn't been initialized?\n $layout = $initLayout;\n $this->layout = json_encode($layout);\n $this->update(array('layout'));\n }else{\n $layout = json_decode($layout, true); // json to associative array\n if (!is_array ($layout)) $layout = array ();\n\n $this->addRemoveLayoutElements('left', $layout, $initLayout);\n $this->addRemoveLayoutElements('right', $layout, $initLayout);\n }\n\n return $layout;\n }",
"public function getThemeLayouts()\n {\n return $this->layouts;\n }",
"function getModuleLayouts( $module ) {\n return Core::getLayouts( esf_Extensions::MODULE, $module );\n}",
"function LayoutList()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'LayoutList',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result['code']);\n var_dump($result['headers']);\n var_dump($result['body']);\n\n echo $result['body'];\n\n $xml = new DOMDocument();\n $xml->loadXML($result['body']);\n \n foreach($xml->getElementsByTagName('layout') as $layout) {\n echo 'Title: ' . $layout->getAttribute('layout') . '<br/>';\n echo 'Description: ' . $layout->getAttribute('description') . '<br/>';\n }\n}",
"public function get_layouts() {\n $layouts = array();\n\n foreach ( glob( self::_find_view_folder() . 'layouts/*.*' ) as $layout ) {\n $layouts[] = pathinfo( $layout, PATHINFO_BASENAME );\n }\n\n return $layouts;\n }",
"public function getThemeLayout();",
"public function getLayoutParameters(): array;",
"public function getLayout(){\n return $this->_layout;\n }",
"public function getLayoutDependencies()\n {\n $objectManager = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager();\n return [\n 'processorFactory' => $objectManager->get(\\Magento\\Framework\\View\\Layout\\ProcessorFactory::class),\n 'eventManager' => $objectManager->get(\\Magento\\Framework\\Event\\ManagerInterface::class),\n 'structure' => $objectManager->create(\\Magento\\Framework\\View\\Layout\\Data\\Structure::class, []),\n 'messageManager' => $objectManager->get(\\Magento\\Framework\\Message\\ManagerInterface::class),\n 'themeResolver' => $objectManager->get(\\Magento\\Framework\\View\\Design\\Theme\\ResolverInterface::class),\n 'readerPool' => $objectManager->get('commonRenderPool'),\n 'generatorPool' => $objectManager->get(\\Magento\\Framework\\View\\Layout\\GeneratorPool::class),\n 'cache' => $objectManager->get(\\Magento\\Framework\\App\\Cache\\Type\\Layout::class),\n 'readerContextFactory' => $objectManager->get(\\Magento\\Framework\\View\\Layout\\Reader\\ContextFactory::class),\n 'generatorContextFactory' => $objectManager->get(\n \\Magento\\Framework\\View\\Layout\\Generator\\ContextFactory::class\n ),\n 'appState' => $objectManager->get(\\Magento\\Framework\\App\\State::class),\n 'logger' => $objectManager->get(\\Psr\\Log\\LoggerInterface::class),\n ];\n }",
"function getLayouts(){\n if(!getSession('USER')) return NULL;\n\n $dir = 'uploads/_tmp/'.$_SESSION['USER']['user_id'].'/';\n\n if($files = scandir($dir)){\n unset($files[0]);\n unset($files[1]);\n $files = array_values($files);\n\n for($i=0; $i<count($files); $i++){\n $layouts[$i]['src'] = $dir.$files[$i];\n $layouts[$i]['type'] = end(explode(\".\", $files[$i]));\n $layouts[$i]['size'] = ceil(filesize($dir.$files[$i]) / 1024) < 1024 ? ceil(filesize($dir.$files[$i]) / 1024) . ' Кб' : (round(filesize($dir.$files[$i]) / 1024 / 1024, 2)) . ' Мб';\n }\n }else{\n return false;\n }\n\n return $layouts;\n }",
"public function getLayouts(){\n\n $defaultTheme = env('THEME', 'default');\n $path = app_path() . \"/../resources/views/themes/$defaultTheme/\";\n $layoutPath = $path . \"layouts\";\n $metaFilePath = $path . \"$defaultTheme.json\";\n try{\n $validator = file_exists($metaFilePath) && is_dir($layoutPath);\n if ($validator){\n\n // Read layouts\n $layouts = [];\n if ($dh = opendir($layoutPath)){\n while (($file = readdir($dh)) !== false){\n $filePath = $layoutPath . '/' . $file; \n if ($file == '.' || $file == '..') {\n continue;\n }\n $content = file_get_contents($filePath);\n $info = $this->extractInfo($content);\n $layouts[] = [\n 'name' => $file,\n 'info' => isset($info[1]) ? json_decode($info[1], true) : null\n ];\n }\n closedir($dh);\n }\n return $layouts;\n }\n else{\n return [];\n }\n }\n catch (\\Exception $e){ \n return [];\n }\n }",
"function wp_get_layout_definitions()\n {\n }",
"function getLayoutListEntries($module)\n{\n\t$tabid = getTabid($module);\n\tglobal $adb;\n\tglobal $theme;\n\tglobal $current_language;\n\tglobal $app_strings;\n\tif($module == \"Events\") {\n\t\t$module = \"Calendar\";\n\t}\n\t$cur_module_strings = return_specified_module_language($current_language,$module);\n\t$theme_path=\"themes/\".$theme.\"/\";\n\t$image_path=$theme_path.\"images/\";\n\t$query = \"select * from ec_blocks where tabid='\".$tabid.\"' order by sequence\";\n\t$block_result = $adb->getList($query);\n\t$blcoklist = Array();\n\tforeach($block_result as $block_row)\n\t{\n\t\t$blockid = $block_row['blockid'];\n\t\t$blocklabel = $block_row['blocklabel'];\n\t\tif(isset($cur_module_strings[$blocklabel])) {\n\t\t\t$blocklabel = $cur_module_strings[$blocklabel];\n\t\t}\n\t\t\n\t\t$dbQuery = \"select ec_field.fieldid,ec_field.fieldlabel,ec_field.block,ec_field.sequence,ec_field.typeofdata from ec_field inner join ec_def_org_field on ec_def_org_field.fieldid=ec_field.fieldid where ec_def_org_field.visible=0 and ec_field.tabid=$tabid and displaytype in(1,2,4) and ec_field.block='\".$blockid.\"' order by ec_field.block,ec_field.sequence\";\n\t\t$result = $adb->getList($dbQuery);\n\t\t$count=1;\n\t\t$cflist = Array();\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$cf_element = Array();\n\t\t\t\t$cf_element['no'] = $count;\n\t\t\t\tif(isset($cur_module_strings[$row[\"fieldlabel\"]])) {\n\t\t\t\t\t$cf_element['fieldlabel'] = $cur_module_strings[$row[\"fieldlabel\"]];\n\t\t\t\t} elseif(isset($app_strings[$row[\"fieldlabel\"]])) {\n\t\t\t\t\t$cf_element['fieldlabel'] = $app_strings[$row[\"fieldlabel\"]];\n\t\t\t\t} else {\n\t\t\t\t\t$cf_element['fieldlabel'] = $row[\"fieldlabel\"];\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$cf_element['sequence'] = $row[\"sequence\"];\n\t\t\t\t$typeofdata = $row[\"typeofdata\"];\n\t\t\t\tif(strpos($typeofdata,\"~M\") > -1) {\n\t\t\t\t\t$typeofdata = \"true\";\n\t\t\t\t} else {\n\t\t\t\t\t$typeofdata = \"false\";\n\t\t\t\t}\n\t\t\t\t$cf_element['typeofdata'] = $typeofdata;\n\t\t\t\t//getCreateCustomBlockForm(customModule,blockid,tabid,label,order)\n\t\t\t\t$cf_element['tool']='<img src=\"'.$image_path.'editfield.gif\" border=\"0\" style=\"cursor:pointer;\" onClick=\"getFieldLayoutForm(\\''.$module.'\\',\\''.$row[\"fieldid\"].'\\',\\''.$tabid.'\\',\\''.$cf_element['fieldlabel'].'\\',\\''.$blocklabel.'\\',\\''.$row[\"sequence\"].'\\',\\''.$row['block'].'\\',\\''.$typeofdata.'\\')\" alt=\"'.$app_strings['LNK_EDIT'].'\" title=\"'.$app_strings['LNK_EDIT'].'\"/>';\n\n\t\t\t\t$cflist[] = $cf_element;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t$blcoklist[$blocklabel] = $cflist;\n }\n\treturn $blcoklist;\n}",
"public function all_layouts() {\n\t\t// Globals\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the layouts from the database as an array\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_layouts` ORDER BY `name` ASC;\";\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Create the return object\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each layout\n\t\tforeach( $sqlret as $layout ) {\n\t\t\t// Add the screen info to the return object\n\t\t\t$return->$layout['id'] = new StdClass();\n\t\t\t$return->$layout['id']->name = $layout['name'];\n\t\t\t$return->$layout['id']->id = $layout['id'];\n\t\t}\n\t\treturn $return;\n\t}",
"private function setLayouts() {\n # list of layout names!\n $availableLayouts = $this->fileMaker->listLayouts();\n\n foreach ($availableLayouts as $layoutName){\n if ($this->name === 'mi' or $this->name === 'miw') {\n if ($layoutName == 'search-'.strtoupper($this->name)) {\n $this->search_layout = $this->fileMaker->getLayout($layoutName);\n } else if ($layoutName == 'results-'.strtoupper($this->name)) {\n $this->result_layout = $this->fileMaker->getLayout($layoutName);\n } else if ($layoutName == 'details-'.strtoupper($this->name)) {\n $this->detail_layout = $this->fileMaker->getLayout($layoutName);\n }\n } else {\n if (str_contains($layoutName, 'search')) {\n $this->search_layout = $this->fileMaker->getLayout($layoutName);\n } else if (str_contains($layoutName, 'results')) {\n $this->result_layout = $this->fileMaker->getLayout($layoutName);\n } else if (str_contains($layoutName, 'details')) {\n $this->detail_layout = $this->fileMaker->getLayout($layoutName);\n }\n }\n }\n }",
"public function getLayout(){\n\n return $this->layout;\n\n }"
]
| [
"0.74406",
"0.67492497",
"0.66446334",
"0.66443837",
"0.6602989",
"0.6568083",
"0.64953923",
"0.64392877",
"0.63960826",
"0.6287807",
"0.61981934",
"0.6124567",
"0.6124254",
"0.61240125",
"0.60523856",
"0.60431004",
"0.6041389",
"0.6018977",
"0.6004391",
"0.5986772",
"0.596231",
"0.5952078",
"0.5945992",
"0.59452796",
"0.59383446",
"0.5923792",
"0.5906468",
"0.5892226",
"0.5887801",
"0.5882613"
]
| 0.7614369 | 0 |
getLayoutById function This function is used to get layout by id | public function getLayoutById($id) {
try {
$client = new Zend_Soap_Client($this->LAYOUT_WSDL_URI);
$options = array('soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
);
$client->setOptions($options);
$client->action = 'findByLayoutId';
$result = $client->findByLayoutId($id);
return $result;
} catch (Exception $e) {
//return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getLayout($id='default'){\n\t\tinclude($this->layoutsPath.'/'.$id.'.php');\n\t}",
"public function get_layout($id)\n\t{\n\t\treturn $this->get_single($id);\n\t}",
"function getLayout($id){\r\n \r\n $transform = ucfirst(str_replace('-', \"_\", $id));\r\n $layout_name = \"\\\\LK\\PXEdit\\\\Layouts\\\\\" . $transform;\r\n \r\n // Force an Autoload\r\n \\PXEdit_Autoload($layout_name);\r\n \r\n if(!class_exists($layout_name)){\r\n $this ->sendError('Layout ' . $layout_name . \" is not existing.\");\r\n } \r\n \r\n $layout = new $layout_name();\r\n return $layout;\r\n }",
"public function get_layout( $layout_id = '' ) {\n // Globals\n\t\tglobal $wpdb;\n \n try {\n // Layout ID is not optional\n if( @$layout_id != '' ) {\n $layout_id = sanitize_text_field( $layout_id );\n } else {\n throw new Exception( 'Layout ID is required.' );\n }\n \n // Get the layout from the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_layouts` WHERE `id` = '\" . $layout_id . \"';\";\n $layout = $wpdb->get_row( $sql, ARRAY_A );\n \n // Make sure we found something\n if( $layout == null ) {\n // Nope\n throw new Exception( 'Layout not found.' );\n } else {\n // Got it! Put it in an object.\n $return = new StdClass();\n $return->status = 'success';\n $return->id = $layout['id'];\n $return->name = $layout['name'];\n $return->description = $layout['description'];\n $return->type = $layout['type'];\n $return->width = $layout['width'];\n $return->height = $layout['height'];\n $return->bgimage = $layout['bgimage'];\n $return->bgimagetype = $layout['bgimagetype'];\n $return->bgcolor = $layout['bgcolor'];\n $return->startimage = $layout['startimage'];\n $return->items = (object) unserialize( $layout['items'] );\n $return->lastmodified = $layout['lastmodified'];\n \n // Return it!\n return $return;\n }\n } catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n }",
"public function getLayout($id)\n {\n if (!$this->_layoutsInitialized) {\n $this->_initLayout($id);\n }\n if (!isset($this->_layouts[$id])) {\n throw new Exception(__d('wasabi_cms', 'Layout \"{0}\" for theme \"{1}\" does not exist.', $id, $this->id()));\n }\n\n return $this->_layouts[$id];\n }",
"public static function get_layouts($id=null)\n {\n // We return an array if returning all layouts\n // Other wise return the object if we looking up a specific layout id\n $return = array();\n\n // Are we looking for a specific studio layout id?\n // If not we return all layouts\n if($id){\n // Return a specific studio layout by ID\n if(($data = Layout::find($id)) != NULL){\n $data->formatted_cost = $data->cost == '' ? '' : '£' . number_format($data->cost,2);\n $return = $data;\n }\n }else{\n // Get all studio layout data and iterate the returned data\n $layouts = DB::table('quotation_layouts')->order_by('size_y', 'asc')->order_by('size_x', 'asc')->get();\n foreach($layouts as $layout)\n {\n $layout->formatted_cost = $layout->cost == '' ? '' : '£' . number_format($layout->cost, 2);\n $code = str_replace('.', '', $layout->size_x) . 'x' . str_replace('.', '', $layout->size_y);\n $return[$code] = $layout;\n }\n }\n\n return $return;\n }",
"public function get_layout_id()\n\t{\n\t\treturn $this->_layout_id;\n\t}",
"public function getLayout();",
"public function getLayout() {}",
"public function findLayout($name = '', $masterId = 1)\r\n {\r\n foreach ($this->layouts as $layout) {\r\n if ($layout['name'] == $name && $layout['masterid'] == $masterId) {\r\n return $layout;\r\n }\r\n }\r\n\r\n throw new \\Exception(\"Could not find slide layout $name in current layout pack.\");\r\n }",
"public function mapPage($selectedLayoutId) {\n try {\n $client = new SoapClient($this->LAYOUT_WSDL_URI);\n $res = $client->findByLayoutId($selectedLayoutId);\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public static function getLayout()\r\n {\r\n if (!isset(static::$_layout[static::layoutName()])) {\r\n $connection = static::getDb();\r\n static::$_layout[static::layoutName()] = $connection->getLayout(static::layoutName());\r\n }\r\n return static::$_layout[static::layoutName()];\r\n }",
"public function getLayouts();",
"public function get_layout ( $layout_name )\n {\n $layouts = $this->get_layouts();\n\n if ( isset( $layouts[$layout_name] ) /* @perf array_key_exists( $layout_name, $layouts ) */ )\n {\n return $layouts[ $layout_name ];\n }\n\n throw new \\Exception( 'No layout exists with the name \"' . $layout_name . '\"' );\n }",
"public function getBackendLayout($identifier, $pageId){\n $backendLayout = NULL;\n if(array_key_exists($identifier,$this->backendLayouts)) {\n return $this->createBackendLayout($this->backendLayouts[$identifier]);\n }\n return $backendLayout;\n }",
"function getLayout() {return $this->readLayout();}",
"public function getlayoutAction() {\n $request = $this->getRequest(); /* Fetching Request */\n $em = $this->getEntityManager(); /* Call Entity Manager */\n $url = $this->getRequest()->getBasePath();\n\n $response = 0;\n /* Check with passed password exist in DB */\n if ($request->isPost()) {\n $postdata = $request->getPost();\n $layout_id = $postdata['layout_id'];\n $objLayout = $em->getRepository('Admin\\Entity\\Layout')->find($layout_id);\n if (!empty($objLayout)) {\n $layoutPath = $objLayout->getLayoutImage();\n $response = '<img id=\"map\" src=\"' . $url . '/uploads/layout/' . $layoutPath . '\" alt=\"\" style=\"margin: 0; border: none; position: absolute; top: 0; left: 0; z-index: 500\">';\n }\n }\n echo $response;\n exit;\n }",
"public function findLayoutId($name = '', $masterId = 1)\r\n {\r\n foreach ($this->layouts as $layoutId => $layout) {\r\n if ($layout['name'] == $name && $layout['masterid'] == $masterId) {\r\n return $layoutId;\r\n }\r\n }\r\n\r\n throw new \\Exception(\"Could not find slide layout $name in current layout pack.\");\r\n }",
"protected function getLayout() {\n\t\treturn $this->getFrontcontroller()->getResource('layout');\n\t}",
"public function getLayout(){\n return $this->_layout;\n }",
"public function getLayout(){\n\n return $this->layout;\n\n }",
"protected function getLayout()\n {\n return $this->layout;\n }",
"protected function getLayout()\n {\n return $this->layout;\n }",
"public function getLayout(){\n $layout = $this->getAttribute('layout');\n\n $initLayout = $this->initLayout();\n\n if(!$layout){ // layout hasn't been initialized?\n $layout = $initLayout;\n $this->layout = json_encode($layout);\n $this->update(array('layout'));\n }else{\n $layout = json_decode($layout, true); // json to associative array\n if (!is_array ($layout)) $layout = array ();\n\n $this->addRemoveLayoutElements('left', $layout, $initLayout);\n $this->addRemoveLayoutElements('right', $layout, $initLayout);\n }\n\n return $layout;\n }",
"public function getLayout(): string;",
"function layout(string $layout)\n {\n return the_layout($layout);\n }",
"public function layout($layout_name)\n {\n if (!isset($this->layoutTable[$layout_name])) {\n $this->layoutTable[$layout_name] = new Supporting\\FileMakerLayout($this->provider, $layout_name);\n }\n return $this->layoutTable[$layout_name];\n }",
"public function getLayoutId(): UuidInterface\n {\n return $this->layoutId;\n }",
"public function getLayout() {\n\t\treturn $this->_layout;\n\t}",
"public function getLayout() {\n \t\n \t// Return the current layout\n \treturn $this->sLayout;\n }"
]
| [
"0.7934728",
"0.7855377",
"0.7808574",
"0.71562916",
"0.6929441",
"0.69128704",
"0.6854917",
"0.6632366",
"0.6515695",
"0.64206934",
"0.63828343",
"0.62927973",
"0.6284169",
"0.62073284",
"0.6178479",
"0.6165249",
"0.6155828",
"0.6104079",
"0.60934794",
"0.60568744",
"0.60456693",
"0.60301477",
"0.60301477",
"0.6014074",
"0.59862185",
"0.5945546",
"0.5917557",
"0.58961815",
"0.5888509",
"0.5860992"
]
| 0.8035609 | 0 |
getSection function This function is used to get section entries | public function getSection() {
try {
$client = new SoapClient($this->SECTION_WSDL);
$res = $client->findAllActiveSection();
return $res;
//print_r($res);
} catch (Zend_Exception $e) {
var_dump($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}",
"public function get_section($id)\n {\n }",
"private function get_section_data() {\n\t\t$sections = apply_filters( 'toolset_get_troubleshooting_sections', array() );\n\t\t\n\t\tif( !is_array( $sections ) ) {\n\t\t\t$sections = array();\n\t\t}\n\t\t\n\t\treturn $sections;\n\t}",
"function getSection($sectionName,$sectionID='', $attr='VALUE') {\n if (isset($this->sectionList[$sectionName])) { \n return $this->sectionList[$sectionName]->getSection($sectionID, $attr);\n }\n else {\n $this->debugLog(\"getSection: sectionName [$sectionName] wasn't found, ignoring.\",6);\n return NULL;\n }\n }",
"public function section()\n {\n /*if ($this->section != '') {\n return $this->section;\n }\n else {*/\n // Kill trailing period\n $pattern = \"/\\.$/\"; // remove last \".\"\n $cleaned = $this->section_comment();\n $cleaned = trim($cleaned);\n $cleaned = preg_replace($pattern, '', $cleaned);\n\n $pattern = \"/Styleguide (.+)/\";\n preg_match_all($pattern, $cleaned, $sections);\n //$this->section = $sections[1][0];\n //return $this->section;\n return $sections[1][0];\n //}\n }",
"public function getSection() : string{\n return $this->section;\n }",
"public function getSection() {\n return $this->section;\n }",
"public function get_section()\n\t\t{\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}",
"private function retrieveSections() {\n\t\t$this->sections = array();\n\n\t\t$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\tself::TABLE_SECTIONS,\n\t\t\t'content_uid = ' . $this->getContentUid() .\n\t\t\t\ttx_oelib_db::enableFields(self::TABLE_SECTIONS),\n\t\t\t'',\n\t\t\t'sorting'\n\t\t);\n\t\tif (!$dbResult) {\n\t\t\tthrow new Exception(DATABASE_QUERY_ERROR);\n\t\t}\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {\n\t\t\t$GLOBALS['TSFE']->sys_page->versionOL(self::TABLE_SECTIONS, $row);\n\t\t\t$GLOBALS['TSFE']->sys_page->fixVersioningPid(\n\t\t\t\tself::TABLE_SECTIONS, $row\n\t\t\t);\n\t\t\tif ($GLOBALS['TSFE']->sys_language_content > 0) {\n\t\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\tself::TABLE_SECTIONS,\n\t\t\t\t\t$row,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_contentOL\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sections[] = $row;\n\t\t}\n\t}",
"public function getSection($section) {\n $data=[];\n\n foreach($this->settings AS $name=>$settingData) {\n if($section===$settingData['section']) {\n $data[$name]=$this->get($name);\n }\n }\n\n return $data;\n }",
"public function sections_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $course_id = $_GET['course_id'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->sections_get($course_id, $logged_in_user_details['user_id']);\n }else{\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }",
"public function read($section);",
"private function _getSection()\n\t{\n\t\tif (!isset($this->_section))\n\t\t{\n\t\t\t$this->_section = false;\n\n\t\t\t$sectionId = $this->getSettings()->section;\n\n\t\t\tif ($sectionId)\n\t\t\t{\n\t\t\t\t$this->_section = craft()->sections->getSectionById($sectionId);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_section;\n\t}",
"function theSection()\n\t{\n\t\treturn array_shift( $this->getSections() );\n\t}",
"public function getSection(): string\n {\n return $this->section;\n }",
"function getSection($section='') {\r\n if(!empty($section)) {\r\n return $this->parsed_ini_file[$section];\r\n } else {\r\n return '';\r\n }\r\n }",
"static function get_section_info($modinfo, $sectionnum) {\n global $DB;\n\n if (method_exists($modinfo, 'get_section_info')) {\n // Moodle >= 2.3\n return $modinfo->get_section_info($sectionnum);\n }\n\n // Moodle <= 2.2\n $params = array('course' => $modinfo->get_course_id(),\n 'section' => $sectionnum);\n return $DB->get_record('course_sections', $params);\n }",
"public function get_section_by_id( $id ) {\n\t\treturn $this->sections[$id];\n\t}",
"public function get($section){\n\t\t$body = $this->toArray();\n\t\treturn $body[$section];\n\t}",
"public function getSections(): array {\n\t\t\n\t\tif (isset($this->sections)) {\n\t\t\treturn $this->sections;\n\t\t}\n\t\t\n\t\t$this->sections = [];\n\t\t\n\t\t$sections = elgg_extract('sections', $this->config, []);\n\t\tforeach ($sections as $section) {\n\t\t\t$this->sections[] = new Section($section);\n\t\t}\n\t\t\n\t\treturn $this->sections;\n\t}",
"static function get_section_info_all($modinfo) {\n global $DB;\n\n if (method_exists($modinfo, 'get_section_info_all')) {\n // Moodle >= 2.3\n return $modinfo->get_section_info_all();\n }\n\n // Moodle <= 2.2\n $info = array();\n $params = array('course' => $modinfo->get_course_id());\n if ($sections = $DB->get_records('course_sections', $params, 'section')) {\n foreach ($sections as $section) {\n $sectionnum = $section->section;\n $info[$sectionnum] = $section;\n }\n }\n return $info;\n }",
"private function getSections() {\n\t\t$sections = array();\n\t\tforeach (Craft::$app->getSections()->getEditableSections() as $section) {\n\t\t\t$sections[$section->id] =['value'=>$section->handle, 'label' =>Craft::t('site',$section->name)];\n\t\t}\n\t\treturn $sections;\n\t}",
"public function getAllSections();",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }",
"public function getSections(){\n\t\treturn $this->sections;\n\t}",
"function wantedSection() {\n $urlParts = $this->_getPathUrl();\n return $urlParts[$this->sectionOffset];\n }",
"public function section_details(){\n\t\treturn array(\n\t\t\t'section_name'\t=> $this->section_name,\n\t\t\t'section_url'\t=> $this->section_url,\n\t\t\t'list_columns'\t=> $this->list_columns,\n\t\t\t'column_prefix'\t=> $this->model->db_column_prefix,\n\t\t\t'tabs'\t\t\t=> $this->tabs,\n\t\t\t'hide_tabs'\t\t=> $this->hide_tabs,\n\t\t\t'actions'\t\t=> misc::getActionsDropdowns(),\n\t\t\t'filters'\t\t=> misc::getFiltersDropdowns(),\n\t\t\t'per_page'\t\t=> misc::getPerPageDropdowns(),\n\t\t\t'id'\t\t\t=> $this->id,\n\t\t\t'item_name'\t\t=> $this->item_name,\n\t\t\t'active_tab'\t=> isset($_GET['active_tab']) ? $_GET['active_tab'] : ($this->session->get('active_tab') ? $this->session->get_once('active_tab') : $this->active_tab)\n\t\t);\n\t}",
"public function getSections(): iterable;",
"private function getSection($sectionId)\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$section = $this->sectionFactory->create();\n $this->sectionResourceModel->load($section, $sectionId);\n return $section;\n\t\t}\n\t}"
]
| [
"0.7111836",
"0.70920223",
"0.70709133",
"0.7065703",
"0.7050888",
"0.703154",
"0.6953231",
"0.69414365",
"0.6926791",
"0.69164747",
"0.6908541",
"0.6907127",
"0.69016635",
"0.6859368",
"0.68413264",
"0.6777993",
"0.67745495",
"0.6727927",
"0.66207397",
"0.65879625",
"0.6585813",
"0.6572223",
"0.65584725",
"0.6535401",
"0.65309745",
"0.65280217",
"0.6427659",
"0.6383251",
"0.63737804",
"0.6352489"
]
| 0.7470858 | 0 |
getPortlets function This function is used to get portlets | public function getPortlets() {
try {
$client = new SoapClient($this->PORTLETS_WSDL);
$res = $client->findAllActivePortlets();
return $res;
} catch (Zend_Exception $e) {
var_dump($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allPortletEntries() {\n try {\n $client = new SoapClient($this->PORTLETS_WHDL);\n $res = $client->getAllPortlet();\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public function getPortlets($objModule)\n\t{\n\t\t$objPortlets = $this->getPortletsForMode();\n\n\t\tif ($objPortlets->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$arrPortlets = array();\n\t\twhile ($objPortlets->next())\n\t\t{\n\t\t\t$arrPortlets[$objPortlets->id] = $objPortlets->simpleFrontendPortletName . \" (\" . $objPortlets->simpleFrontendPortletDescription . \")\";\n\t\t}\n\t\treturn $arrPortlets;\n\t}",
"private function getPortletsForMode ()\n\t{\n\t\t$this->import('Database');\n\t\t$query = \"SELECT * FROM tl_module WHERE isSimpleFrontendPortlet = ?\";\n\t\t$params = array('1');\n\t\t\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$query .= \" AND pid IN (SELECT t.id FROM tl_theme t JOIN tl_layout l ON t.id = l.pid WHERE l.id = ?)\";\n\t\t\tglobal $objPage;\n\t\t\t$params[] = $objPage->layout;\n\t\t}\n\t\t\n\t\treturn $this->Database->prepare($query)->execute($params);\n\t}",
"public function fetchOutlets();",
"public function userPortletEntries() {\n try {\n $client = new SoapClient($this->USER_PORTLETS_WHDL);\n $res = $client->getUserPortlet(array('userid' => $_SESSION['User']['id']));\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"public function getPortList()\n {\n $value = $this->get(self::PORTLIST);\n return $value === null ? (string)$value : $value;\n }",
"public function getPortBindings()\n {\n return $this->_portBindings;\n }",
"public function getPorts()\n {\n return $this->_ports;\n }",
"public function getPortletById($id) {\n try {\n $client = new Zend_Soap_Client($this->PORTLETS_WSDL);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'findByPortletId';\n $result = $client->findByPortletId($id);\n return $result;\n } catch (Exception $e) {\n //return false;\n }\n }",
"protected function getConfiguredPort() {}",
"public function getPorts(): array\n {\n return $this->getSpec('ports', []);\n }",
"public function ports()\n {\n $ports = [];\n $port_list = config( 'pw-api.ports' );\n foreach ( $port_list as $name => $port )\n {\n $ports[$name]['port'] = $port;\n $ports[$name]['open'] = @fsockopen( setting('server.ip', '127.0.0.1'), $port, $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }\n return $ports;\n }",
"public function getPort() {}",
"public function ports() {\n // Query each HttpRequest object sequentially, and add to a master list.\n // If HTTP is used and no port is specified, then add 80\n // If HTTPS is used and no port is specified, then add 443\n $ports = array();\n foreach ($this->requests as $request) {\n $url = $request->url;\n $port = parse_url($url, PHP_URL_PORT);\n $scheme = parse_url($url, PHP_URL_SCHEME);\n if (($scheme == \"http\") && ($port == null)) {\n $port = 80;\n } else if (($scheme == \"https\") && ($port == null)) {\n $port = 443;\n }\n if (!in_array($port, $ports)) {\n $ports[] = $port;\n }\n }\n return $ports;\n }",
"function readPcpInfo()\n{\n $params = readConfigParams(array('pcp_port'));\n return $params;\n}",
"public function getPort();",
"public function getPort();",
"public function getPort();",
"public function getPort();",
"function pages_applets_initiate($page)\n{\n $applets = array();\n\n if (!empty($page)) {\n foreach ($page as $key => $value) {\n $applets[$key] = $value;\n }\n }\n return $applets;\n}",
"protected function getPortletDetailsUrl()\n {\n return Yii::app()->createUrl('/' . $this->moduleId . '/defaultPortlet/details',\n array_merge($_GET, array( 'portletId' =>\n $this->params['portletId'],\n 'uniqueLayoutId' => $this->uniqueLayoutId)));\n }",
"public function GetAllowPorts () {\n\t\treturn $this->allowPorts;\n\t}",
"public function pokeULServers () {\n $capsule = true;\n $exchange = true;\n\n // Test for Capsule availability\n $request = $this->_fetchPage( '/pls/etprod8/twbkwbis.P_WWWLogin', 'GET', array(), false );\n\n if ( !$request ) {\n $capsule = false;\n }\n \n // Check if login form is available\n if ( $capsule && strpos( $request[ 'response' ], '<input type=\"submit\" value=\"Connexion\">' ) < 1 ) {\n $capsule = false;\n }\n\n // Test for Exchange availability\n $this->host = 'exchange.ulaval.ca';\n $request = $this->_fetchPage( '/owa/auth/logon.aspx', 'GET', array(), false );\n\n if ( !$request ) {\n $exchange = false;\n }\n \n // Check if login form is available\n if ( strpos( $request[ 'response' ], '<input type=\"submit\" class=\"btn\" value=\"\" onclick=\"clkLgn()\">' ) < 1 ) {\n $exchange = false;\n }\n\n return array( 'capsule' => $capsule, 'exchange' => $exchange );\n }",
"public function GetAllowedPorts () {\n\t\treturn $this->allowedPorts;\n\t}",
"public function getServers();",
"public function getServers() {}",
"public function index()\n {\n $ports = Port::all()->reverse();\n $servers = Server::all();\n $cryptos = Crypto::hydrate( DB::table('cryptos')->orderBy('name')->get()->toArray() );\n return view('ports.index', compact('ports','servers', 'cryptos'));\n }",
"public function beLoginLinkIPList() {}",
"function GetWebPanelList()\n\t{\n\t\t$result = $this->sendRequest(\"GetWebPanelList\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function _getUsedHostPorts($scenariosetup_id){\r\n $usedHosts = $this->UsedHost->find('all', array('conditions'=>'scenariosetup_id='.$scenariosetup_id));\r\n $hosts = array();\r\n if (!empty($usedHosts)){\r\n foreach($usedHosts as $host) {\r\n $h = $this->Host->read(null, $host['UsedHost']['host_id']);\r\n $port = $h['Host']['id'] + START_PORT;\r\n $hosts[$port] = $h['Host']['description'];\r\n }\r\n } \r\n return $hosts;\r\n }"
]
| [
"0.69863886",
"0.69406146",
"0.6893998",
"0.6561756",
"0.61531913",
"0.6107161",
"0.59942466",
"0.59285027",
"0.5887251",
"0.582165",
"0.5774122",
"0.57290596",
"0.56584764",
"0.56342655",
"0.5625925",
"0.561996",
"0.561996",
"0.561996",
"0.561996",
"0.5273533",
"0.5258295",
"0.52400994",
"0.52178484",
"0.5181159",
"0.5174107",
"0.5168452",
"0.5162082",
"0.5150433",
"0.5141097",
"0.5133899"
]
| 0.7519339 | 0 |
Show View New Satker | public function viewNewSatker()
{
$id_account = Auth::id();
$check_access = Acces::where('user', $id_account)
->first();
if($check_access->kelola_akun == 1){
return view('manage_satker.new_satker');
}else{
return back();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showView()\n\t{\n\t\ttrigger_error(\"showView() is not implemented\");\n\t}",
"public function showNew()\n {\n\n return view('backend.floors.new');\n }",
"public function view()\n\t{\n\t\t// TODO Implement\t\n\t}",
"public function createView();",
"public function view() {\r\n\r\n\t}",
"public function actionView() {\n $this->active_menu = \"gpu2\";\n $this->open_class = \"factory\";\n $this->active_class = \"create\";\n $model = Itemstock::model()->findByPk(Yii::app()->request->getParam('id'));\n $this->render('view', array(\n 'model' => $model,\n ));\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}",
"protected function viewAction()\n {\n }",
"public function view() {\n $this->view->data['view'] = 'hehe';\n /*** load the index template ***/\n $this->view->show('index/view');\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 actionView()\n\t{\n\t\t$this->render('view');\n\t}",
"public function show()\n\t{\n\n\t}",
"public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}",
"public function show()\n {\n //\n }",
"public function actionView() {}",
"public function actionView() {}",
"public function show()\n\t{\n\t\t\n\t}",
"public function view() {\n }",
"function view()\n\t{\n\t\tglobal $tree, $ilUser, $ilCtrl, $lng;\n\n\t\t$this->showHierarchy();\n\t}",
"public function show() {\n\t}",
"public function show()\n {\n \n }",
"public function show()\n {\n \n }",
"public function createNewDokter()\n {\n return view('dokter::create');\n }",
"public function show() {\n \n }",
"public function view(){\n\t\t\t$this->__switchboard();\n\t\t}",
"public function show()\n { \n \n }",
"public function actionView()\n {\n \n }"
]
| [
"0.6980852",
"0.6954369",
"0.6946453",
"0.69158417",
"0.6882767",
"0.68267924",
"0.67632693",
"0.67377275",
"0.6723841",
"0.6677313",
"0.6647056",
"0.6647056",
"0.6647056",
"0.6636263",
"0.66105044",
"0.660442",
"0.6596854",
"0.6594862",
"0.6594862",
"0.65854454",
"0.6581243",
"0.65498847",
"0.6537297",
"0.6528438",
"0.6528438",
"0.65273374",
"0.6500935",
"0.649142",
"0.64908046",
"0.64837706"
]
| 0.70965886 | 0 |
This covers the case when: Custom choice type added after a choice type. Custom type is expanded. Custom type replaces 'choices' normalizer with a custom one. In this case, custom type should not inherit labels from the first added choice type. | public function testCustomChoiceTypeDoesNotInheritChoiceLabels()
{
$builder = $this->factory->createBuilder();
$builder->add('choice', static::TESTED_TYPE, [
'choices' => [
'1' => '1',
'2' => '2',
],
]);
$builder->add('subChoice', 'Symfony\Component\Form\Tests\Fixtures\ChoiceSubType');
$form = $builder->getForm();
// The default 'choices' normalizer would fill the $choiceLabels, but it has been replaced
// in the custom choice type, so $choiceLabels->labels remains empty array.
// In this case the 'choice_label' closure returns null and not the closure from the first choice type.
$this->assertNull($form->get('subChoice')->getConfig()->getOption('choice_label'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testChoiceRowWithCustomBlock()\n {\n $form = $this->factory->createNamedBuilder('name_c', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\ChoiceType', 'a', [\n 'choices' => ['ChoiceA' => 'a', 'ChoiceB' => 'b'],\n 'expanded' => true,\n ])\n ->getForm();\n\n $this->assertWidgetMatchesXpath($form->createView(), [],\n '/div\n [\n ./label[.=\"Custom name label: [trans]ChoiceA[/trans]\"]\n /following-sibling::label[.=\"Custom name label: [trans]ChoiceB[/trans]\"]\n ]\n'\n );\n }",
"public function getParent()\n {\n return RestChoiceType::class;\n }",
"public function getName()\n {\n return 'oo_content_type_choice';\n }",
"public function getParent()\n {\n return 'choice';\n }",
"function acf_wc_product_type_rule_type($choices) {\n // this will be a place to put all custom rules assocaited with woocommerce\n // the reason for checking to see if it exists or not first\n // is just in case another custom rule is added\n if (!isset($choices['Product'])) {\n $choices['Product'] = array();\n }\n // now add the 'Category' rule to it\n if (!isset($choices['Product']['product_cat'])) {\n // product_cat is the taxonomy name for woocommerce products\n $choices['Product']['product_cat_term'] = 'Product Category Term';\n }\n return $choices;\n }",
"function acf_wc_product_type_rule_values($choices) {\n // and put the into an array for choices\n $args = array(\n 'taxonomy' => 'product_cat',\n 'hide_empty' => false\n );\n $terms = get_terms($args);\n foreach ($terms as $term) {\n $choices[$term->term_id] = $term->name;\n }\n return $choices;\n }",
"public function testNewEntityType(): void {\n\n $res = FormFactory::newEntityType(NavigationNode::class, $this->entities);\n $this->assertCount(3, $res);\n $this->assertArrayHasKey(\"class\", $res);\n $this->assertArrayHasKey(\"choice_label\", $res);\n $this->assertArrayHasKey(\"choices\", $res);\n\n $this->assertEquals(NavigationNode::class, $res[\"class\"]);\n\n $this->assertCount(3, $res[\"choices\"]);\n $this->assertSame($this->entities[0], $res[\"choices\"][0]);\n $this->assertSame($this->entities[1], $res[\"choices\"][1]);\n $this->assertSame($this->entities[2], $res[\"choices\"][2]);\n\n $this->assertIsCallable($res[\"choice_label\"]);\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][0]));\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][1]));\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][2]));\n }",
"function admin_bar_change_type_label() {\n global $wp_admin_bar;\n global $post;\n\n // Removes Options that aren't needed anymore\n $wp_admin_bar->remove_menu('customize');\n $wp_admin_bar->remove_menu('updates');\n $wp_admin_bar->remove_menu('comments');\n\n // Remove WordPress Menu Items.\n $wp_admin_bar->remove_menu('wp-logo');\n $wp_admin_bar->remove_menu('wp-logo-external');\n $wp_admin_bar->remove_menu('about');\n $wp_admin_bar->remove_menu('wporg');\n $wp_admin_bar->remove_menu('documentation');\n $wp_admin_bar->remove_menu('support-forums');\n $wp_admin_bar->remove_menu('feedback');\n\n if (!isset($post->post_type)) {\n return;\n }\n\n $type = str_replace('-', ' ', $post->post_type);\n $change_edit = $wp_admin_bar->get_node('edit');\n $change_view = $wp_admin_bar->get_node('view');\n if ($change_edit !== NULL) {\n $change_edit->title = __('Edit ' . ucwords($type), 'bramble');\n $wp_admin_bar->add_node($change_edit);\n }\n elseif ($change_view !== NULL) {\n $change_view->title = __('View ' . ucwords($type), 'bramble');\n $wp_admin_bar->add_node($change_view);\n }\n\n}",
"function add_types_for_translation() {\n\t\t$dummy = __(\"added\", \"simple-history\");\n\t\t$dummy = __(\"approved\", \"simple-history\");\n\t\t$dummy = __(\"unapproved\", \"simple-history\");\n\t\t$dummy = __(\"marked as spam\", \"simple-history\");\n\t\t$dummy = __(\"trashed\", \"simple-history\");\n\t\t$dummy = __(\"untrashed\", \"simple-history\");\n\t\t$dummy = __(\"created\", \"simple-history\");\n\t\t$dummy = __(\"deleted\", \"simple-history\");\n\t\t$dummy = __(\"updated\", \"simple-history\");\n\t\t$dummy = __(\"nav_menu_item\", \"simple-history\");\n\t\t$dummy = __(\"attachment\", \"simple-history\");\n\t\t$dummy = __(\"user\", \"simple-history\");\n\t\t$dummy = __(\"settings page\", \"simple-history\");\n\t\t$dummy = __(\"edited\", \"simple-history\");\n\t\t$dummy = __(\"comment\", \"simple-history\");\n\t\t$dummy = __(\"logged in\", \"simple-history\");\n\t\t$dummy = __(\"logged out\", \"simple-history\");\n\t\t$dummy = __(\"added\", \"simple-history\");\n\t\t$dummy = __(\"modified\", \"simple-history\");\n\t\t$dummy = __(\"upgraded it\\'s database\", \"simple-history\");\n\t\t$dummy = __(\"plugin\", \"simple-history\");\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}",
"public function buildChoices(FormEvent $event)\n {\n $attribute = $event->getData();\n if (null === $attribute) {\n return;\n }\n\n $type = $attribute->getType();\n\n if (null === $type || AttributeTypes::CHOICE === $type) {\n $event->getForm()->add(\n $this->factory->createNamed('choices', 'collection', null, array(\n 'type' => 'text',\n 'allow_add' => true,\n 'allow_delete' => true,\n 'by_reference' => false\n ))\n );\n }\n }",
"public function registerCustomConsentTypes()\n {\n $savedConsentTypes = gdpr('options')->get('consent_types');\n\n if (is_array($savedConsentTypes) && count($savedConsentTypes)) \n {\n foreach ($savedConsentTypes as $consentType) \n {\n $this->customConsentTypes[$consentType['slug']] = [\n 'slug' => isset($consentType['slug']) ? $consentType['slug'] : '',\n 'title' => isset($consentType['title']) ? $consentType['title'] : '',\n 'description' => isset($consentType['description']) ? $consentType['description'] : '',\n 'visible' => isset($consentType['visible']) ? $consentType['visible'] : '',\n ];\n }\n }\n }",
"public function testCollectionRowWithCustomBlock()\n {\n $collection = ['one', 'two', 'three'];\n $form = $this->factory->createNamedBuilder('names', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\CollectionType', $collection)\n ->getForm();\n\n $this->assertWidgetMatchesXpath($form->createView(), [],\n '/div\n [\n ./div[./label[.=\"Custom label: [trans]0[/trans]\"]]\n /following-sibling::div[./label[.=\"Custom label: [trans]1[/trans]\"]]\n /following-sibling::div[./label[.=\"Custom label: [trans]2[/trans]\"]]\n ]\n'\n );\n }",
"protected function getForm_Type_ChoiceService()\n {\n return $this->services['form.type.choice'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\ChoiceType(new \\Symfony\\Component\\Form\\ChoiceList\\Factory\\CachingFactoryDecorator(new \\Symfony\\Component\\Form\\ChoiceList\\Factory\\PropertyAccessDecorator(new \\Symfony\\Component\\Form\\ChoiceList\\Factory\\DefaultChoiceListFactory(), $this->get('property_accessor'))));\n }",
"public function buildGroupedChoices()\n {\n return parent::buildActiveAndPreferredChoices(function (Language $language) {\n return [\n 'value' => $language->getId(),\n 'text' => $language->getName(),\n ];\n });\n }",
"function types_rename_build_in_post_types() {\n global $wp_post_types;\n $custom_types = get_option( WPCF_OPTION_NAME_CUSTOM_TYPES, array() );\n\n if ( !empty( $custom_types ) ) {\n foreach ( $custom_types as $post_type => $data ) {\n // only for build_in\n if (\n isset( $data['_builtin'] )\n && $data['_builtin']\n && isset( $data['slug'] )\n && isset( $data['labels']['name'] )\n ) {\n // check if slug (post/page) exists\n if( isset( $wp_post_types[$data['slug']] ) ) {\n // refer $l to post labels\n $l = &$wp_post_types[$data['slug']]->labels;\n\n // change name\n $l->name = isset( $data['labels']['name'] ) ? $data['labels']['name'] : $l->name;\n\n // change singular name\n $l->singular_name = isset( $data['labels']['singular_name'] ) ? $data['labels']['singular_name'] : $l->singular_name;\n\n // change labels\n $l->add_new_item = 'Add New';\n $l->add_new = 'Add New ' . $l->singular_name;\n $l->edit_item = 'Edit ' . $l->singular_name;\n $l->new_item = 'New ' . $l->name ;\n $l->view_item = 'View ' . $l->name;\n $l->search_items = 'Search '. $l->name;\n $l->not_found = 'No ' . $l->name . ' found';\n $l->not_found_in_trash = 'No ' . $l->name . ' found in Trash';\n $l->parent_item_colon = 'Parent '. $l->name;\n $l->all_items = 'All ' . $l->name;\n $l->menu_name = $l->name;\n $l->name_admin_bar = $l->name;\n\n }\n }\n }\n }\n}",
"function load_choices() {\n /*\n if (is_array($this->choices)) {\n return true;\n }\n .... load choices here\n */\n return true;\n }",
"function load_choices() {\n /*\n if (is_array($this->choices)) {\n return true;\n }\n .... load choices here\n */\n return true;\n }",
"public function getChoiceList()\n {\n return $this->choice;\n }",
"public function add_meta_box() {\r\n\r\n\t\tif( ! is_wp_error( $this->tax_obj ) && isset($this->tax_obj->object_type ) ) foreach ( $this->tax_obj->object_type as $post_type ):\r\n\t\t\t$label = $this->tax_obj->labels->name;\r\n\t\t\t$id = ! is_taxonomy_hierarchical( $this->taxonomy ) ? 'radio-tagsdiv-'.$this->taxonomy : 'radio-' .$this->taxonomy .'div' ;\r\n\t\t\tadd_meta_box( $id, $label ,array( $this,'metabox' ), $post_type ,'side','core', array( 'taxonomy'=>$this->taxonomy ) );\r\n\t\tendforeach;\r\n\t}",
"public function testLineItemTypeEditing() {\n $values = [\n 'id' => strtolower($this->randomMachineName(8)),\n 'label' => $this->randomMachineName(16),\n 'purchasableEntityType' => 'commerce_product_variation',\n 'orderType' => 'default',\n ];\n $lineItemType = $this->createEntity('commerce_line_item_type', $values);\n\n $edit = [\n 'label' => $this->randomMachineName(16),\n ];\n $this->drupalPostForm('admin/commerce/config/line-item-types/' . $values['id'] . '/edit', $edit, t('Save'));\n $lineItemTypeNew = LineItemType::load($values['id']);\n $this->assertEqual($lineItemTypeNew->label(), $edit['label'], 'The label of the line item type has been changed.');\n }",
"function hook_i18n_sync_options_alter(&$fields, $entity_type, $bundle_name) {\n\n}",
"public function other_choice_display() {\n return self::content_other_choice_display($this->content);\n }",
"public function acf_location_rules_types($choices)\n {\n\n $choices['Basic']['brick'] = 'Brick';\n return $choices;\n\n }",
"public function getChoices();",
"public function testNewEntityTypeWithChoiceValueInterface(): void {\n\n $arg = [\n new TestChoiceValue(),\n new TestChoiceValue(),\n ];\n\n $res = FormFactory::newEntityType(TestChoiceValue::class, $arg);\n $this->assertCount(4, $res);\n $this->assertArrayHasKey(\"class\", $res);\n $this->assertArrayHasKey(\"choice_label\", $res);\n $this->assertArrayHasKey(\"choice_value\", $res);\n $this->assertArrayHasKey(\"choices\", $res);\n\n $this->assertEquals(TestChoiceValue::class, $res[\"class\"]);\n\n $this->assertCount(2, $res[\"choices\"]);\n $this->assertSame($arg[0], $res[\"choices\"][0]);\n $this->assertSame($arg[1], $res[\"choices\"][1]);\n\n $this->assertIsCallable($res[\"choice_label\"]);\n\n $this->assertIsCallable($res[\"choice_value\"]);\n }",
"public function definition_after_data() {\n parent::definition_after_data();\n $this->_form->freeze(['type']);\n $this->tool->form_definition_after_data($this->_form);\n }",
"function hook_xml_crawler_xml_types() {\n return ['new' => t('New type')];\n}",
"function load_type_widget() {\n register_widget( 'custom_type_widget' );\n}",
"function ctools_term_list_content_type_edit_form(&$form, &$form_state) {\n $conf = $form_state['conf'];\n\n $form['type'] = array(\n '#type' => 'radios',\n '#title' => t('Which terms'),\n '#options' => ctools_admin_term_list_options(),\n '#default_value' => $conf['type'],\n '#prefix' => '<div class=\"clear-block no-float\">',\n '#suffix' => '</div>',\n );\n\n $form['list_type'] = array(\n '#type' => 'select',\n '#title' => t('List type'),\n '#options' => array('ul' => t('Unordered'), 'ol' => t('Ordered')),\n '#default_value' => $conf['list_type'],\n );\n}"
]
| [
"0.6111748",
"0.55591875",
"0.5556261",
"0.5527538",
"0.53797257",
"0.52370995",
"0.5233238",
"0.51429194",
"0.5089764",
"0.50459105",
"0.5021706",
"0.5017269",
"0.49889198",
"0.49784356",
"0.4976623",
"0.4967231",
"0.49495542",
"0.49495542",
"0.49294254",
"0.49079007",
"0.48897102",
"0.4880346",
"0.48591924",
"0.4836338",
"0.4818287",
"0.48121378",
"0.479418",
"0.4790348",
"0.47648722",
"0.47518584"
]
| 0.784494 | 0 |
Checks if discount applies | public function isApplicable() : bool{
$items = $this->order->getOrderItems();
foreach($items as $item){
// checks every item for order if the quantity is >= $products_nr
if($item["quantity"] >= $this->products_nr){
$tmp_item = $this->order->getProductById($item["product-id"]);
// checks if product category equals $category_id
if((int)$tmp_item["category"] === $this->category_id){
$tmp_item["qty"] = $item["quantity"];
// saves the discounted items in a temporary array
$this->items_matching[] = $tmp_item;
// stores the total cost of the discount
$this->discounted_value += $tmp_item["price"] * floor($item["quantity"] / $this->products_nr);
}
}
}
if($this->discounted_value > 0){
$this->is_applicable = true;
$this->calculateDiscount();
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasDiscount(){\n return $this->_has(9);\n }",
"protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }",
"public function hasActdiscount(){\n return $this->_has(34);\n }",
"public function hasDiscountPercentage()\n {\n return $this->discount_percentage !== null;\n }",
"function is_filter_discount( $conds )\n\t{\n\t\treturn ( isset( $conds['is_discount'] ) && $conds['is_discount'] == 1 );\n\t}",
"public function isDiscounted()\n\t{\n\t\treturn $this->discounted;\n\t}",
"public function itemHasDiscount($item) {\n /**\n * Item has discount check\n */\n if ($item->getDiscountAmount () || $item->getFreeShipping ()) {\n /**\n * If the items has discount\n * @var unknown\n */\n /**\n * set it as true\n * @var unknown\n */\n $hasDiscount = true;\n }\n /**\n * return the has discount tata\n */\n return $hasDiscount;\n }",
"public function isOnDiscount() {\n\t\treturn $this->onDiscount;\n\t}",
"public function hasDiscount()\n {\n $time = new \\DateTime('now');\n $today = $time->format('Y-m-d');\n\n $discounts = \\common\\models\\Discounts::find()\n ->where(['iid' => $this->id])\n ->andWhere(['<=', 'start_at', $today])\n ->andWhere(['>', 'stop_at', $today])\n ->all();\n\n if (count($discounts) === 1) {\n return true;\n } else {\n return false;\n };\n \n }",
"function has_discount( $code ) {\n\t\t\tif (in_array($code, $this->applied_coupons)) return true;\n\t\t\treturn false;\n\t\t}",
"function pp_edd_auto_apply_discount() {\n\n\tif ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() ) {\n\n\t\tif ( ! edd_cart_has_discounts() && edd_is_discount_valid( 'BFCM2016', '', false ) ) {\n\t\t\tedd_set_cart_discount( 'BFCM2016' );\n\t\t}\n\n\t}\n\n}",
"function _apply_discount($coupon)\n\t{\n\t\t$this->database->SaveCheatCode($coupon);\n\t\t$discount_percentage = 0;\n\t\t$coupon_info = $this->database->GetDiscountCoupon($coupon);\n\n\t\t//Run some conditional-check for code\n\t\tif($this->_can_apply_code($coupon_info))\n\t\t{\n\t\t\t$discount_percentage = $this->_getDiscount($coupon);\n\t\t\t$this->cart->apply_discount($coupon, $discount_percentage);\n\t\t}\n\n\t\t$this->_notify_discount_applied($discount_percentage, $coupon_info);\n\n\t}",
"static function has_discount(Book $book){\n if(isset($book->discounts->days)){\n $create_date = $book->discounts->updated_at;\n $date_now = Carbon::now();\n $diff_val = $book->discounts->days;\n $start_date = $create_date->addDays($diff_val);\n $diff = $start_date->diffInDays($date_now);\n /* ~~~~~ */\n if(round($diff/24) > 0 ){\n return false;\n }else if ($book->discounts->procent > 0) return true;\n }\n return false;\n }",
"protected function hasRemainingDiscount()\n {\n return !$this->limited || $this->remaining > 0;\n }",
"public function applyDiscount()\n {\n if (request('discountType') == 1) {\n cart()->applyDiscount($percentage = request('red'));\n return $this->getCartDetails();\n }\n cart()->applyFlatDiscount($amount = request('discountInput'));\n\n return redirect()->route('cart');\n }",
"public function AssignDiscount()\n\t{\t\n\t}",
"public function getDiscountRefunded();",
"private function validate_item_discounts($item_discount_data)\r\n\t{\r\n\t\t// Check the discount tables exist in the config file and are enabled.\r\n\t\tif ($this->get_enabled_status('discounts'))\r\n\t\t{\r\n\t\t\t// Set an array to hold the ids of all items that have had a discount applied.\r\n\t\t\t$valid_item_discount_data = array('item_price' => array(), 'item_shipping' => array());\r\n\t\t\t$discounted_items = array();\r\n\t\t\t$discounted_cart_value = 0;\r\n\t\t\t$non_combinable_discount = FALSE;\r\n\t\t\t\r\n\t\t\t// Loop through submitted discount data and remove all non item discounts.\r\n\t\t\tforeach($item_discount_data as $target_column => $discount_data)\r\n\t\t\t{\r\n\t\t\t\tif (! in_array($target_column, array('item_price', 'item_shipping')))\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($item_discount_data[$target_column]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// All discounts are applied to the cheapest applicable items first, to enforce this, sort items by price, cheapest to most expensive.\r\n\t\t\t$items = $this->flexi->cart_contents['items'];\r\n\t\t\tforeach ($items as $row_id => $column) \r\n\t\t\t{\t\r\n\t\t\t\t$items_sorted[$row_id] = $column[$this->flexi->cart_columns['item_price']];\r\n\t\t\t}\r\n\t\t\tarray_multisort($items_sorted, SORT_ASC, $items);\r\n\t\t\t\r\n\t\t\t// Get array of current user submitted discount codes.\r\n\t\t\t$discount_codes = $this->flexi->cart_contents['settings']['discounts']['codes'];\r\n\t\t\t\r\n\t\t\t// Start looping through each item based discount and calculate the discount value.\r\n\t\t\tforeach($item_discount_data as $target_column => $discount_data)\r\n\t\t\t{\r\n\t\t\t\t// Loop through all discounts for current target column.\r\n\t\t\t\tforeach($discount_data as $discount_id => $discount_cols)\r\n\t\t\t\t{\r\n\t\t\t\t\t// If an item discount is activated via a user submitted code, ensure the discount code has been entered.\r\n\t\t\t\t\t// Or if a discount is 'Non-Combinable' (i.e. There can be no other cart discounts), check no other discounts have been set.\r\n\t\t\t\t\tif ((strlen($discount_cols['code']) > 0 && ! array_key_exists($discount_cols['code'], $discount_codes)) ||\r\n\t\t\t\t\t\t($discount_cols['non_combinable'] == 1 && ! empty($discounted_items)))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Tally discount data to check if discount has a valid minimum quantity and value of items to activate discount.\r\n\t\t\t\t\t$applicable_item_quantity = $applicable_item_value = 0;\r\n\t\t\t\t\t$applicable_items = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Loop through cart items and tally the quantity and value of items applicable to the discount.\r\n\t\t\t\t\tforeach($items as $row_id => $column)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (in_array($column[$this->flexi->cart_columns['item_id']], $discount_cols['item_ids']) && \r\n\t\t\t\t\t\t\t! in_array($column[$this->flexi->cart_columns['item_id']], $discounted_items))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$applicable_item_quantity += $column[$this->flexi->cart_columns['item_quantity']];\r\n\t\t\t\t\t\t\t$applicable_item_value += ($column[$this->flexi->cart_columns['item_price']] * $column[$this->flexi->cart_columns['item_quantity']]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$applicable_items[$row_id] = array(\r\n\t\t\t\t\t\t\t\t'id' => $discount_id,\r\n\t\t\t\t\t\t\t\t'item_id' => $column[$this->flexi->cart_columns['item_id']],\r\n\t\t\t\t\t\t\t\t'description' => $discount_cols['description'],\r\n\t\t\t\t\t\t\t\t'discount_quantity' => 0,\r\n\t\t\t\t\t\t\t\t'non_discount_quantity' => $column[$this->flexi->cart_columns['item_quantity']],\r\n\t\t\t\t\t\t\t\t'item_value' => $column[$this->flexi->cart_columns['item_price']],\r\n\t\t\t\t\t\t\t\t'item_discount' => 0,\r\n\t\t\t\t\t\t\t\t'taxable_value' => 0,\r\n\t\t\t\t\t\t\t\t'non_taxable_value' => 0,\r\n\t\t\t\t\t\t\t\t'tax_value' => 0,\r\n\t\t\t\t\t\t\t\t'void_reward_points' => (bool)$discount_cols['void_reward_points'],\r\n\t\t\t\t\t\t\t\t'force_shipping_discount' => (bool)$discount_cols['force_shipping_discount']\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Check that the total quantity and value of items has activated the discounted.\r\n\t\t\t\t\tif (! empty($applicable_items) && \r\n\t\t\t\t\t\t$applicable_item_quantity >= $discount_cols['quantity_required'] && \r\n\t\t\t\t\t\t$applicable_item_value >= $discount_cols['value_required']\r\n\t\t\t\t\t)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Calculate the quantity of items that the discount will apply to.\r\n\t\t\t\t\t\t// Set default quantity values incase they equal zero.\r\n\t\t\t\t\t\t$quantity_discounted = ($discount_cols['quantity_discounted'] >= 1) ? $discount_cols['quantity_discounted'] : 1;\r\n\t\t\t\t\t\t$quantity_required = ($discount_cols['quantity_required'] >= 1) ? $discount_cols['quantity_required'] : 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t// If the discount is recursive, calculate number of times the discount needs to be applied.\r\n\t\t\t\t\t\t// Example: Buy 2, Get 1 @ 50% off, and 7 items are added to the cart.\r\n\t\t\t\t\t\t// If 'recursive' = TRUE (1), 2 items will have 50% off, and 5 at normal price, if FALSE (0), 1 item will have 50% off, and 6 at normal price.\r\n\t\t\t\t\t\t$repeat_discount = ($discount_cols['recursive'] == 1) ? floor($applicable_item_quantity / $quantity_required) : 1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Calculate the number of items to be discounted.\r\n\t\t\t\t\t\t$discounted_quantity = ($repeat_discount * $quantity_discounted);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Loop through applicable items and apply discount values.\r\n\t\t\t\t\t\tforeach($applicable_items as $row_id => $item_data)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ($discounted_quantity > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Calculate the quantity of items that the discount can and cannot be applied to.\r\n\t\t\t\t\t\t\t\t$applicable_items[$row_id]['discount_quantity'] = ($discounted_quantity >= $item_data['non_discount_quantity']) ? \r\n\t\t\t\t\t\t\t\t\t$item_data['non_discount_quantity'] : $discounted_quantity;\r\n\t\t\t\t\t\t\t\t$applicable_items[$row_id]['non_discount_quantity'] = ($item_data['non_discount_quantity'] - $applicable_items[$row_id]['discount_quantity']);\r\n\r\n\t\t\t\t\t\t\t\t// Calculate the number of items discounted by the loop so far.\r\n\t\t\t\t\t\t\t\t$discounted_quantity = ($discounted_quantity >= $item_data['non_discount_quantity']) ? \r\n\t\t\t\t\t\t\t\t\t($discounted_quantity - $item_data['non_discount_quantity']) : 0;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Calculate item tax data.\r\n\t\t\t\t\t\t\t\t$item_tax_rate = $this->get_item_tax_rate($row_id, TRUE);\r\n\t\t\t\t\t\t\t\t$item_tax_data = $this->calculate_tax($applicable_items[$row_id]['item_value'], $item_tax_rate);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Calculate item discount data.\r\n\t\t\t\t\t\t\t\t$discount_calculation_data = $this->calculate_discount(\r\n\t\t\t\t\t\t\t\t\t$discount_cols['value_discounted'], \r\n\t\t\t\t\t\t\t\t\t$item_tax_data['taxable_value'], $item_tax_data['non_taxable_value'], $item_tax_data['tax_value'], $item_tax_rate, \r\n\t\t\t\t\t\t\t\t\t$discount_cols['calculation_id'], $discount_cols['tax_method']\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\tif (! empty($discount_calculation_data))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tforeach($discount_calculation_data as $column => $discount_data)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif ($column == 'total')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Calculate discount value per quantity.\r\n\t\t\t\t\t\t\t\t\t\t\t$applicable_items[$row_id]['item_discount'] = $this->format_calculation(\r\n\t\t\t\t\t\t\t\t\t\t\t\t($applicable_items[$row_id]['item_value'] - $discount_data)\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$applicable_items[$row_id]['item_value'] = $discount_data;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$applicable_items[$row_id][$column] = $discount_data;\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}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tunset($applicable_items[$row_id]);\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\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Loop through items discount has been applied to.\r\n\t\t\t\t\t\tforeach($applicable_items as $row_id => $item_data)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Save item discount data to an array of valid item discounts.\r\n\t\t\t\t\t\t\t$valid_item_discount_data[$target_column][$row_id] = $item_data;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Add discounted item ids to the discounted item array to prevent it being included in another discount.\r\n\t\t\t\t\t\t\t$discounted_items[] = $item_data['item_id'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// If the discount is 'Non-Combinable' (i.e. There can be no other cart discounts), set var to indicate discount is non-combinable.\r\n\t\t\t\t\t\t\t// Stop all further item discount loops. \r\n\t\t\t\t\t\t\tif ($discount_cols['non_combinable'] == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$non_combinable_discount = TRUE;\r\n\t\t\t\t\t\t\t\tbreak 3;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn array(\r\n\t\t\t\t'discounts' => $valid_item_discount_data,\r\n\t\t\t\t'non_combinable_discount' => $non_combinable_discount\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"function _apply_auto_disc()\n\t{\n\t\t$num_items = $this->cart->total_items();\n\t\t$auto_disc_info = null;\n\n\t\tforeach ($this->auto_disc_array as $cart_items => $disc_info)\n\t\t{\n\t\t\tif($num_items >= $cart_items)\n\t\t\t{\n\t\t\t\t$auto_disc_info = $disc_info;\n\t\t\t}\n\t\t}\n\n\t\t$applied_disc = $this->cart->discount_info();\n\n\t\t//auto discount should be more than the applied disc (if any)\n\t\tif($applied_disc['percentage'] < $auto_disc_info['percentage'])\n\t\t{\n\t\t\t$this->_apply_discount( $auto_disc_info['coupon'] );\n\t\t}\t\t\n\t}",
"function get_total_discount() {\n\t\t\tif ($this->discount_total || $this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_total + $this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"function course_discounted_amount($price, $coupon)\n{\n $return_val = $price;\n if (!empty($coupon)) {\n $coupon_details = CourseCoupon::where('code', $coupon)->first();\n if (!empty($coupon_details)) {\n if ($coupon_details->discount_type === 'percentage') {\n $discount_bal = ($price / 100) * (int)$coupon_details->discount;\n $return_val = $price - $discount_bal;\n } elseif ($coupon_details->discount_type === 'amount') {\n $return_val = $price - (int)$coupon_details->discount;\n }\n }\n }\n\n return $return_val;\n}",
"protected function applyDiscounts()\n {\n $discounts = $this->booking->bookingDiscounts;\n $this->discountedPeriodsTotal = $this->periodsTotal;\n $discountedTotal = $this->periodsTotal;\n\n if (!$discounts) return;\n\n // Apply discounts based on the order of discount sequence.\n foreach ($this->discountSequence as $sequence) {\n // Filter discounts so that we don't have to loop through all of them.\n $filteredDiscounts = $discounts->where('type', $sequence);\n\n $methodName = \"apply\" . Str::studly($sequence) . \"Discount\";\n\n // Apply and store discount information.\n foreach ($filteredDiscounts as $filteredDiscount) {\n $discountInformation = ['beforeDiscount' => $discountedTotal];\n $discountedTotal = $this->$methodName($discountedTotal, $filteredDiscount);\n $discountInformation['afterDiscount'] = $discountedTotal;\n\n if (!$this->discountApplied($discountInformation['beforeDiscount'], $discountInformation['afterDiscount'])) {\n continue;\n }\n\n $discountInformation['discount'] = $filteredDiscount;\n $this->appliedDiscounts[] = $discountInformation;\n }\n }\n\n $this->discountedPeriodsTotal = $discountedTotal;\n }",
"public function getDiscountCanceled();",
"public function getDiscountAmount();",
"public function getTotalDiscountAmount();",
"public function applyGlobalDiscount($discount_rate)\n {\n }",
"public function getDiscount()\r\n {\r\n return $this->discount;\r\n }",
"public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }",
"function get_discounts_before_tax() {\n\t\t\tif ($this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"function _reconfirm_cheat_code()\n\t{\n\t\t//If discount is applied, do a conditional-check again\n\t\tif($this->cart->is_discount_applied())\n\t\t{\n\t\t\t$coupon = $this->cart->discount_info();\n\t\t\tif($this->_can_apply_code($coupon) == false)\n\t\t\t{\n\t\t\t\t$this->cart->remove_discount();\n\t\t\t}\n\t\t}\n\t}"
]
| [
"0.7618146",
"0.7270947",
"0.72340137",
"0.715524",
"0.71517646",
"0.71249115",
"0.70885605",
"0.706408",
"0.7057738",
"0.7048481",
"0.7021707",
"0.69795144",
"0.6943336",
"0.6913798",
"0.6840746",
"0.68282205",
"0.66541547",
"0.66393834",
"0.66211575",
"0.6599872",
"0.65642697",
"0.65517914",
"0.65512776",
"0.6520882",
"0.65050006",
"0.6431622",
"0.6379043",
"0.6377253",
"0.6344581",
"0.6337256"
]
| 0.73404837 | 1 |
Calculate discount values For this type of discount, it calculates the discount percentage and total value based on what the customer would have paid if the free items were payed also | protected function calculateDiscount() : void{
$percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();
$new_total = $this->order->getTrueTotal() - $this->discounted_value;
$this->order_discount_value = $this->discounted_value;
$this->order_discount_percentage = $percentage;
$this->order_discount_reason = "For every " . $this->products_nr . " products from category #" . $this->category_id . " you get one free. You got: ";
foreach($this->items_matching as $item){
$this->order_discount_reason .= floor($item["qty"] / $this->products_nr) . " x '" . $item["description"] . "' (€". $item["price"] ." each) ; ";
}
$this->order_new_total = $new_total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTotalDiscountAmount();",
"public function getTotalDiscount(): float;",
"public function getDiscountAmount();",
"public function calculate_discount_percentage() {\n extract($_POST);\n $disc_rate = ($discount_amount / $class_fees) * 100;\n $fees_due = $class_fees - $discount_amount;\n $subsidy_per = ($subsidy * 100) / $fees_due;\n $result = $this->classtraineemodel->calculate_net_due($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr = array();\n if ($result < 0) {\n $arr['label'] = \"NEGATIVE Total Fees Due NOT ALLOWED. Please correct Discount AND/ OR Subsidy Amounts.\";\n $arr['amount'] = \"\";\n } else {\n $arr['label'] = \"\";\n $arr['amount'] = number_format($result, 4, '.', '');\n $arr['disc_rate'] = number_format($disc_rate, 4, '.', '');\n $arr['subsidy_per'] = number_format($subsidy_per, 4, '.', '');\n $gst_amount = $this->classtraineemodel->calculate_gst($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr['gst_amount'] = number_format($gst_amount, 4, '.', '');\n }\n echo json_encode($arr);\n exit();\n }",
"function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\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$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\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\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/** \n\t\t\t\t\t\t\t * This is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}",
"public function calculate_shipping_total($discount_data)\r\n\t{\r\n\t\t// Calculate item shipping rates.\r\n\t\t$item_shipping_discount_status = $this->calculate_shipping_items($discount_data, TRUE);\r\n\t\t\r\n\t\t// Check if there is a valid summary 'shipping total' discount available.\r\n\t\t$ship_discount_data = $this->validate_summary_discount($discount_data['shipping_total'], $this->flexi_cart->item_summary_total(TRUE, FALSE, TRUE));\r\n\t\t\t\t\r\n\t\t// If a discount is set, check whether it is set to 'force' the discount against available shipping options, regardless of if they are set as discountable.\r\n\t\t$force_shipping_discount = (isset($ship_discount_data['force_shipping_discount'])) ? $ship_discount_data['force_shipping_discount'] : FALSE;\r\n\t\t\r\n\t\t// Set a status as whether to lookup only discountable shipping options.\r\n\t\t$shipping_discount_status = (! $force_shipping_discount && ($ship_discount_data || $item_shipping_discount_status));\r\n\t\t\r\n\t\t// Update shipping details in cart session.\r\n\t\t// If a shipping discount is active, try to match a shipping option rate which accepts discounts.\r\n\t\tif (! $this->update_shipping($this->flexi_cart->shipping_id(), $this->flexi_cart->shipping_location_data(), $shipping_discount_status))\r\n\t\t{\r\n\t\t\t// If no discountable shipping options are returned, then the shipping discount cannot be applied, therefore unset any discount data.\r\n\t\t\t$ship_discount_data = FALSE;\r\n\t\t\t\r\n\t\t\t// If item shipping discounts were applied, recalculate the item shipping costs with only 'forced' item shipping discounts applied.\r\n\t\t\tif ($item_shipping_discount_status)\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->calculate_shipping_items($discount_data, FALSE);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->update_shipping($this->flexi_cart->shipping_id(), $this->flexi_cart->shipping_location_data());\r\n\t\t}\r\n\t\t\r\n\t\treturn $ship_discount_data;\r\n\t}",
"function course_discounted_amount($price, $coupon)\n{\n $return_val = $price;\n if (!empty($coupon)) {\n $coupon_details = CourseCoupon::where('code', $coupon)->first();\n if (!empty($coupon_details)) {\n if ($coupon_details->discount_type === 'percentage') {\n $discount_bal = ($price / 100) * (int)$coupon_details->discount;\n $return_val = $price - $discount_bal;\n } elseif ($coupon_details->discount_type === 'amount') {\n $return_val = $price - (int)$coupon_details->discount;\n }\n }\n }\n\n return $return_val;\n}",
"private function calculate_discount(\r\n\t\t$discount_value = 0, $taxable_value_ex_tax = 0, $non_taxable_value = 0, $tax_value = 0, $tax_rate = FALSE, $calculation_method = FALSE, $discount_tax_method = FALSE)\r\n\t{\r\n\t\t// Check sufficient discount data has been submitted.\r\n\t\tif (($calculation_method != 3 && $discount_value <= 0) || ($taxable_value_ex_tax == 0 && $non_taxable_value == 0) || ($taxable_value_ex_tax > 0 && $tax_value == 0))\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Set default calculation and tax application methods if not set.\r\n\t\t// By default, the discount calculation method is a percentage discount.\r\n\t\tif (! in_array($calculation_method, array(1,2,3)))\r\n\t\t{\r\n\t\t\t$calculation_method = 1;\r\n\t\t}\r\n\t\t\r\n\t\t// Check if a discount method has been set, else, use the carts default tax setting to apply tax to the discount in the same way it is applied to item pricing.\r\n\t\tif (! in_array($discount_tax_method, array(1,2,3)))\r\n\t\t{\r\n\t\t\t$discount_tax_method = ($this->flexi_cart->cart_prices_inc_tax()) ? 1 : 2;\r\n\t\t}\r\n\t\t\r\n\t\t// Start discount calculations.\r\n\t\t// Calculate the current 'to-be-discounted' total.\r\n\t\t$current_total = ($discount_tax_method == 1) ? ($taxable_value_ex_tax + $non_taxable_value + $tax_value) : ($taxable_value_ex_tax + $non_taxable_value);\t\t\t\r\n\t\t\r\n\t\t// Calculate the discounted total in accordance to the specified discount method.\r\n\t\tif ($calculation_method == 1)\r\n\t\t{\r\n\t\t\t$discounted_total = $this->format_calculation($current_total - ($current_total * ($discount_value / 100)));\r\n\t\t}\r\n\t\telse if ($calculation_method == 2)\r\n\t\t{\r\n\t\t\t$discounted_total = $this->format_calculation($current_total - $discount_value);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$discounted_total = $this->format_calculation($discount_value);\r\n\t\t}\r\n\t\t\r\n\t\t// Check if the new discounted total is more the zero.\r\n\t\tif ($discounted_total > 0)\r\n\t\t{\r\n\t\t\t// Calculate value discount factor that can then be used to calculate the newly discounted taxed and non-taxed applicable values.\r\n\t\t\t$value_discount_factor = ($current_total / $discounted_total);\r\n\t\t\t$taxable_value_ex_tax = ($taxable_value_ex_tax / $value_discount_factor);\r\n\t\t\t$non_taxable_value = ($non_taxable_value / $value_discount_factor);\r\n\t\t\t\r\n\t\t\tif ($tax_value > 0 && $discount_tax_method != 3)\r\n\t\t\t{\r\n\t\t\t\t$tax_value = ($tax_value / $value_discount_factor);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Else, a 'New Value' discount may be set with the item value as zero (Or free).\r\n\t\telse \r\n\t\t{\r\n\t\t\t$taxable_value_ex_tax = $non_taxable_value = 0;\r\n\t\t\t$tax_value = ($tax_value > 0 && $discount_tax_method == 3) ? ($tax_value) : 0;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// Calculate discounted total and return total value either ex/including tax depending on the carts tax inclusion setting.\r\n\t\t$item_total = ($taxable_value_ex_tax + $non_taxable_value);\r\n\t\t$total = ($this->flexi_cart->cart_prices_inc_tax()) ? ($item_total + $tax_value) : $item_total;\r\n\r\n\t\t// Set and format return values.\r\n\t\t$discount['tax_method'] = $discount_tax_method;\r\n\t\t$discount['taxable_value'] = $this->format_calculation($taxable_value_ex_tax, 4);\r\n\t\t$discount['non_taxable_value'] = $this->format_calculation($non_taxable_value, 4);\r\n\t\t$discount['tax_value'] = $this->format_calculation($tax_value, 4);\r\n\t\t$discount['total'] = $this->format_calculation($total);\r\n\t\t\r\n\t\treturn $discount;\r\n\t}",
"function getDiscountedPrice()\n {\n if (!$this->hasDiscount()) return null;\n $price = $this->price;\n if ($this->discount_active) {\n $price = $this->discountprice;\n }\n// NOTE: Add more conditions and rules as desired, i.e.\n// if ($this->testFlag('Outlet')) {\n// $discountRate = $this->getOutletDiscountRate();\n// $price = number_format(\n// $price * (100 - $discountRate) / 100,\n// 2, '.', '');\n// }\n return $price;\n }",
"function fuc_discount($product, $percentage){\r\n $discountValue = $product / 100 * $percentage;\r\n $totalValue = $product - $discountValue; \r\n return $totalValue;\r\n\r\n}",
"public function discountOrChargeValueBoleta()\n {\n if($this->discount_or_charge_value > 0)\n return $this->discount_or_charge_value;\n else if ($this->discount_or_charge_percentage > 0)\n return (int) round( ($this->discount_or_charge_percentage / 100) * ($this->price * $this->quantity));\n else //pos sale without discount\n return 0;\n }",
"public function getShippingDiscountAmount();",
"private function calcDiscountPercent()\n\t{\n\t if( $this->db->table_exists($this->c_table)) $record = $this->db->query(\"select * from {$this->c_table} where products_count<=? and order_amount<=? order by discount_percent desc\",array($this->products_count,$this->order_amount))->row_array();\n\t if(!@$record) return 0;\n\t return $record['discount_percent'];\n\t}",
"public function calculateDiscount(): ?float;",
"function applyCouponDiscounts($coupons, $shippingType = null, $cartItems){\n\t\t\t$allTotals = array();\n\t\t\t$allTotals['shippingPrice'] = $this->totals['shippingPrice'];\n\t\t\t$allTotals['giftWrapTotal'] = $this->totals['giftWrapTotal'];\n\t\t\t$allTotals['noTaxNoShipping'] = $this->totals['noTaxNoShipping'];\n\t\t\t$this->totals['discount'] = $this->Coupon->applyCoupons($coupons, $shippingType, $cartItems, $allTotals);\n\t\t\t\n\t\t\t//recalculate grandtotal:\n\t\t\t$grandTotal = 0;\n\t\t\tif(array_sum($allTotals) - $this->totals['discount'] > 0){\n\t\t\t\t$grandTotal = array_sum($allTotals) - $this->totals['discount'];\n\t\t\t}else{\n\t\t\t\t//if discounts are greater than grand total, then change discount to difference:\n\t\t\t\t$this->totals['discount'] = $this->totals['discount'] + (array_sum($allTotals) - $this->totals['discount']);\n\t\t\t}\n\t\t\t$this->totals['total'] = $grandTotal;\n\t\t}",
"public function getTotalWithDiscount()\n {\n return $this->totalWithDiscount;\n }",
"public function getBaseDiscountAmount();",
"protected function calculate_discounts() {\n\t\t$this->get_coupons_from_cart();\n\n\t\t$discounts = new WC_Discounts( $this->cart );\n\n\t\t// Set items directly so the discounts class can see any tax adjustments made thus far using subtotals.\n\t\t$discounts->set_items( $this->items );\n\n\t\tforeach ( $this->coupons as $coupon ) {\n\t\t\t$discounts->apply_coupon( $coupon );\n\t\t}\n\n\t\t$coupon_discount_amounts = $discounts->get_discounts_by_coupon( true );\n\t\t$coupon_discount_tax_amounts = array();\n\n\t\t// See how much tax was 'discounted' per item and per coupon.\n\t\tif ( $this->calculate_tax ) {\n\t\t\tforeach ( $discounts->get_discounts( true ) as $coupon_code => $coupon_discounts ) {\n\t\t\t\t$coupon_discount_tax_amounts[ $coupon_code ] = 0;\n\n\t\t\t\tforeach ( $coupon_discounts as $item_key => $coupon_discount ) {\n\t\t\t\t\t$item = $this->items[ $item_key ];\n\n\t\t\t\t\tif ( $item->product->is_taxable() ) {\n\t\t\t\t\t\t// Item subtotals were sent, so set 3rd param.\n\t\t\t\t\t\t$item_tax = wc_round_tax_total( array_sum( WC_Tax::calc_tax( $coupon_discount, $item->tax_rates, $item->price_includes_tax ) ), 0 );\n\n\t\t\t\t\t\t// Sum total tax.\n\t\t\t\t\t\t$coupon_discount_tax_amounts[ $coupon_code ] += $item_tax;\n\n\t\t\t\t\t\t// Remove tax from discount total.\n\t\t\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] -= $item_tax;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->coupon_discount_totals = (array) $discounts->get_discounts_by_item( true );\n\t\t$this->coupon_discount_tax_totals = $coupon_discount_tax_amounts;\n\n\t\tif ( wc_prices_include_tax() ) {\n\t\t\t$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) - array_sum( $this->coupon_discount_tax_totals ) );\n\t\t\t$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );\n\t\t} else {\n\t\t\t$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) );\n\t\t\t$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );\n\t\t}\n\n\t\t$this->cart->set_coupon_discount_totals( wc_remove_number_precision_deep( $coupon_discount_amounts ) );\n\t\t$this->cart->set_coupon_discount_tax_totals( wc_remove_number_precision_deep( $coupon_discount_tax_amounts ) );\n\n\t\t// Add totals to cart object. Note: Discount total for cart is excl tax.\n\t\t$this->cart->set_discount_total( $this->get_total( 'discounts_total' ) );\n\t\t$this->cart->set_discount_tax( $this->get_total( 'discounts_tax_total' ) );\n\t}",
"public function getDiscountRefunded();",
"public function AssignDiscount()\n\t{\t\n\t}",
"private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }",
"public function getTotaldiscount()\n {\n return $this->totaldiscount;\n }",
"public function get_company_net_calculation() {\n $amount = '';\n $percentage = '';\n $tenant_id = $this->tenant_id;\n $discount = $this->input->post('discount');\n $class = $this->input->post('class');\n $company = $this->input->post('company');\n $amt = $this->input->post('amt');\n $per = $this->input->post('per');\n $classes = $this->class->get_class_details($tenant_id, $class);\n $courses = $this->course->get_course_detailse($classes->course_id);\n $gstrate = $this->classtraineemodel->get_gst_current();\n $data = $this->input->post('data');\n $discount_changed = $this->input->post('discount_changed');\n if($discount_changed == 'Y'){\n $temp_ind_discnt_amt = $discount; \n $discount_rate = round( (($temp_ind_discnt_amt/ $classes->class_fees) * 100), 4);\n $discount_total = round(($classes->class_fees *($discount_rate / 100)),4); \n }else{\n $discount = $this->classtraineemodel->calculate_discount_enroll(0, $company, $classes->class_id, $classes->course_id, $classes->class_fees); \n $discount_rate = $discount['discount_rate'];\n $discount_total = round(($classes->class_fees *($discount_rate / 100)),4);\n if ($discount_total > $classes->class_fees) {\n $discount_rate = 100;\n $discount_total = $classes->class_fees;\n }\n }\n $feesdue = round(($classes->class_fees - $discount_total),4);\n $company_net_due = 0;\n $company_subsidy = 0;\n $company_gst = 0;\n foreach ($data as $row) {\n if (!empty($row['subsidy_amount']) && !empty($row['subsidy_pers'])) {\n $subsidy = $row['subsidy_amount'];\n } else if (!empty($row['subsidy_amount'])) {\n $subsidy = $row['subsidy_amount'];\n } else if (!empty($row['subsidy_pers'])) {\n $subsidy = ($row['subsidy_pers'] * $feesdue) / 100;\n } else {\n $subsidy = 0;\n }\n if ($per == $row['user_id']) {\n $amount = $subsidy;\n }\n if ($amt == $row['user_id']) {\n $percentage = ($subsidy * 100) / $feesdue;\n }\n $gst_total = $this->classtraineemodel->calculate_gst($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, $subsidy, $gstrate);\n $calculated_net_due = $this->classtraineemodel->calculate_net_due($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, $subsidy, $gstrate);\n if ($calculated_net_due < 0) {\n echo json_encode(array('error' => 'The Net amount is negative', 'amount' => $amount, 'percentage' => $percentage));\n exit();\n }\n $company_net_due = $company_net_due + round($calculated_net_due, 4); \n $company_subsidy = $company_subsidy + round($subsidy, 4); \n $company_gst = $company_gst + $gst_total; \n }\n echo json_encode(array('error' => '', 'company_net' => round($company_net_due, 4), 'amount' => $amount,\n 'discount_rate' => $discount_rate,\n 'percentage' => $percentage, 'company_subsidy' => round($company_subsidy, 4), 'company_gst' => round($company_gst, 4)));\n exit();\n }",
"public function getDiscountInvoiced();",
"public function getDiscountTaxCompensationAmount();",
"function get_total_discount() {\n\t\t\tif ($this->discount_total || $this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_total + $this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"private function calculate_summary_discount($discount_data, $taxable_value_ex_tax = 0, $non_taxable_value = 0, $tax_value = 0, $tax_rate = FALSE, \r\n\t\t$append_values = TRUE, $target_column = FALSE)\r\n\t{\r\n\t\t// Only allow 'New Value' discounts to be applied to the shipping rate, otherwise a cart of unlimited items could be sold for the 'New Value'.\r\n\t\tif (empty($discount_data) || (isset($discount_data['calculation_id']) && $discount_data['calculation_id'] == 3 && $target_column != 'shipping')\r\n\t\t)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\t// Calculate the non discounted summary total.\r\n\t\t$non_discounted_total = ($this->flexi_cart->cart_prices_inc_tax()) ? \r\n\t\t\tround(($taxable_value_ex_tax + $non_taxable_value + $tax_value), 2) : round(($taxable_value_ex_tax + $non_taxable_value), 2);\r\n\r\n\t\t// Calculate discount value.\r\n\t\t$discount = $this->calculate_discount(\r\n\t\t\t$discount_data['value_discounted'], $taxable_value_ex_tax, $non_taxable_value, $tax_value, $tax_rate,\r\n\t\t\t$discount_data['calculation_id'], $discount_data['tax_method']\r\n\t\t);\r\n\t\t\r\n\t\t// If a 'new value' shipping discount has been set that costs more than the original value, recalculate the 'new value' to equal the original value.\r\n\t\tif (($target_column == 'shipping' && $discount_data['calculation_id'] == 3) && ($discount['total'] > $non_discounted_total))\r\n\t\t{\r\n\t\t\t$discount = $this->calculate_discount(\r\n\t\t\t\t$non_discounted_total, $taxable_value_ex_tax, $non_taxable_value, $tax_value, $tax_rate,\r\n\t\t\t\t$discount_data['calculation_id'], $discount_data['tax_method']\r\n\t\t\t);\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// Check discount value is set and is not more than the target column value, else it would result in a negative value.\r\n\t\tif ($discount && ($non_discounted_total >= $discount['total']))\r\n\t\t{\r\n\t\t\t$discount['non_combinable'] = (bool)$discount_data['non_combinable'];\r\n\t\t\t$discount['void_reward_points'] = (bool)$discount_data['void_reward_points'];\r\n\t\t\t\t\r\n\t\t\t// Calculate discount value and discount tax.\r\n\t\t\t$discount['value'] = ($discount['tax_method'] == 1) ? ($non_discounted_total - $discount['total']) : \r\n\t\t\t\t(($taxable_value_ex_tax + $non_taxable_value) - ($discount['taxable_value'] + $discount['non_taxable_value']));\r\n\t\t\t$discount['discount_tax'] = ($discount['value'] - ($taxable_value_ex_tax - $discount['taxable_value']) > 0) ?\r\n\t\t\t\t($discount['value'] - ($taxable_value_ex_tax - $discount['taxable_value'])) : 0;\r\n\r\n\t\t\tif ($target_column != 'reward_vouchers')\r\n\t\t\t{\r\n\t\t\t\t// Update summary discount data.\r\n\t\t\t\t$this->flexi->cart_contents['settings']['discounts']['data']['summary_discount_savings'] += $discount['value'];\t\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['summary_discount_tax'] += $discount['discount_tax'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Update reward voucher data.\r\n\t\t\t\t$this->flexi->cart_contents['settings']['discounts']['data']['reward_vouchers'] += $discount['value'];\t\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['reward_voucher_tax'] += $discount['discount_tax'];\r\n\t\t\t}\t\t\t\t\r\n\t\t\t\r\n\t\t\t// Update tax columns.\r\n\t\t\tif ($append_values)\r\n\t\t\t{\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_tax'] += $discount['tax_value'];\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_taxable_value'] += $discount['taxable_value'];\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_non_taxable_value'] += $discount['non_taxable_value'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_tax'] = $discount['tax_value'];\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_taxable_value'] = $discount['taxable_value'];\r\n\t\t\t\t$this->flexi->cart_contents['settings']['tax']['data']['cart_non_taxable_value'] = $discount['non_taxable_value'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $discount;\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"private function discountOrChargePercetageBoleta()\n {\n if($this->discount_or_charge_percentage > 0)\n return $this->discount_or_charge_percentage;\n else if ($this->discount_or_charge_value > 0)\n return round(\n $this->discount_or_charge_value * 100 /\n ($this->price * $this->quantity)\n , 2); // 2 => decimal precition\n else //pos sale without discount\n return 0;\n }",
"protected function applyDiscounts()\n {\n $discounts = $this->booking->bookingDiscounts;\n $this->discountedPeriodsTotal = $this->periodsTotal;\n $discountedTotal = $this->periodsTotal;\n\n if (!$discounts) return;\n\n // Apply discounts based on the order of discount sequence.\n foreach ($this->discountSequence as $sequence) {\n // Filter discounts so that we don't have to loop through all of them.\n $filteredDiscounts = $discounts->where('type', $sequence);\n\n $methodName = \"apply\" . Str::studly($sequence) . \"Discount\";\n\n // Apply and store discount information.\n foreach ($filteredDiscounts as $filteredDiscount) {\n $discountInformation = ['beforeDiscount' => $discountedTotal];\n $discountedTotal = $this->$methodName($discountedTotal, $filteredDiscount);\n $discountInformation['afterDiscount'] = $discountedTotal;\n\n if (!$this->discountApplied($discountInformation['beforeDiscount'], $discountInformation['afterDiscount'])) {\n continue;\n }\n\n $discountInformation['discount'] = $filteredDiscount;\n $this->appliedDiscounts[] = $discountInformation;\n }\n }\n\n $this->discountedPeriodsTotal = $discountedTotal;\n }",
"public function applyDiscount()\n {\n if (request('discountType') == 1) {\n cart()->applyDiscount($percentage = request('red'));\n return $this->getCartDetails();\n }\n cart()->applyFlatDiscount($amount = request('discountInput'));\n\n return redirect()->route('cart');\n }"
]
| [
"0.73960626",
"0.7374415",
"0.71881676",
"0.7114153",
"0.6973156",
"0.6847869",
"0.6844876",
"0.68253005",
"0.67820567",
"0.67662627",
"0.67467326",
"0.6726075",
"0.672154",
"0.67117846",
"0.67021674",
"0.66355133",
"0.66330737",
"0.66272503",
"0.66185063",
"0.65991306",
"0.6583929",
"0.65749717",
"0.65731055",
"0.6557791",
"0.65325636",
"0.6523841",
"0.6516801",
"0.64782983",
"0.6470146",
"0.6451259"
]
| 0.7469309 | 0 |
The index page, locate to the browse page. | public function index()
{
$this->locate(inlink('browse'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n { \n $this->locate(inlink('browse'));\n }",
"public function indexAction()\n {\n $this->_forward($this->_getBrowseAction());\n }",
"public function index()\n {\n return view('browse::index');\n }",
"private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }",
"function index()\n{\n\t$index=Page::get(array(\"pg_type\" => \"index\"));\n\tif(isset($index))\n\t{\n\t\t$GLOBALS['GCMS']\n\t\t\t\t->assign('gcms_page_title',\n\t\t\t\t\t\t$GLOBALS['GCMS_SETTING']['seo']['title'].\" | \".$index->pg_title);\n\t\t$GLOBALS['GCMS']\n\t\t\t\t->assign('boxes',\n\t\t\t\t\t\tBox::get(array(\"parent_id\" => $index->id, \"box_status\" => \"publish\"), true,\n\t\t\t\t\t\t\t\tarray(\"by\" => \"id\")));\n\t\t$GLOBALS['GCMS']->assign('show_index', $index);\n\t}\n\telse\n\t\theader(\"location: /error404?error=page&reason=page_not_exist\");\n}",
"function index() {\r\n \t\r\n // The default action is the showall action\r\n $this->browse();\r\n }",
"public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }",
"public function index()\n\t{\n\t\t$data = array(\n\t\t\t'body' => 'browse/index',\n\t\t\t'na_servers' => $this->browse_model->get_shards('na'),\n\t\t\t'eu_servers' => $this->browse_model->get_shards('eu')\n\t\t);\n\t\t$this->load->view('template', $data);\n\t}",
"public function index()\n {\n Config::setJsConfig('curPage', 'downloads-index');\n parent::displayIndex(get_class());\n }",
"public function browseAction() {\r\n\r\n //GET PAGE OBJECT\r\n $pageTable = Engine_Api::_()->getDbtable('pages', 'core');\r\n $pageSelect = $pageTable->select()->where('name = ?', \"sitestoreproduct_wishlist_browse\");\r\n $pageObject = $pageTable->fetchRow($pageSelect);\r\n\r\n //GET SEARCH TEXT\r\n if ($this->_getParam('search', null)) {\r\n $metaParams['search'] = $this->_getParam('search', null);\r\n\r\n //SET META KEYWORDS\r\n Engine_Api::_()->sitestoreproduct()->setMetaKeywords($metaParams);\r\n }\r\n\r\n if(Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\r\n $this->_helper->content\r\n ->setContentName($pageObject->page_id)\r\n ->setNoRender()\r\n ->setEnabled();\r\n }else{\r\n $this->_helper->content\r\n ->setNoRender()\r\n ->setEnabled();\r\n } \r\n }",
"public function page_uri_index()\n {\n }",
"function index() {\r\n $this->page();\r\n }",
"public function browseAction()\n {\n $range = (int) $this->_getParam($this->_rangeParam, $this->_defaultPageRange);\n $page = (int) $this->_getParam($this->_pageParam, $this->_defaultPageNumber);\n\n $paginator = Zend_Paginator::factory($this->_getBrowseQuery());\n\n if ($range > 0) {\n $paginator->setPageRange($range);\n }\n\n if ($page > 0) {\n $paginator->setCurrentPageNumber($page);\n }\n\n $this->view->paginator = $paginator;\n }",
"public static function getIndexPage() {\n chdir(ROOTDIR);\n\n //FIXME: move to Request class\n $queryString = $_SERVER['REQUEST_URI'];\n $filePath = realpath(ROOTDIR . parse_url($queryString)['path']);\n\n $res = [];\n if ($filePath && is_dir($filePath)){\n // attempt to find an index file\n// function getRendererName($rendererName) { return \"index.$rendererName\";};\n $availableRenderers = array_values(array_intersect(\n Renderer::getRenderersPriority(),\n Renderer::getRenderersNames()\n ));\n// $renderers = array_map(function($rendererName) { return \"index.$rendererName\";}, $availableRenderers);\n foreach ($availableRenderers as $rname){\n if ($indexFilePath = realpath($filePath . DIRECTORY_SEPARATOR . \"index.\" . $rname)){\n $res['renderer'] = $rname;\n $res['path'] = $indexFilePath;\n break;\n }\n }\n }\n return $res;\n }",
"public function indexAction()\n {\n $this->page = Brightfame_Builder::loadPage(null, 'initialize.xml');\n \n // load the data\n Brightfame_Builder::loadPage(null, 'load_data.xml', $this->page);\n\n // load the view\n Brightfame_Builder::loadPage(null, 'load_view.xml', $this->page, $this->view);\n \n // render the page\n $this->view->page = $this->page;\n $this->view->layout()->page = $this->page->getParam('xhtml');\n }",
"function index() {\n \n }",
"public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function index() {\n\t\t$this->display('index');\n\t}",
"public function browse() {\n\n \n $data['view_name'] = \"filebrowse\";\n\n $this->load->view(\"admin/common/template\", $data);\n }",
"function getIndexPage( $pIndexType = NULL ){\n\t\tglobal $userlib, $gBitUser, $gBitSystem;\n\t\t$pIndexType = !is_null( $pIndexType )? $pIndexType : $this->getConfig( \"bit_index\" );\n\t\t$url = '';\n\t\tif( $pIndexType == 'group_home') {\n\t\t\t// See if we have first a user assigned default group id, and second a group default system preference\n\t\t\tif( !$gBitUser->isRegistered() && ( $group_home = $gBitUser->getGroupHome( ANONYMOUS_GROUP_ID ))) {\n\t\t\t} elseif( @$this->verifyId( $gBitUser->mInfo['default_group_id'] ) && ( $group_home = $gBitUser->getGroupHome( $gBitUser->mInfo['default_group_id'] ))) {\n\t\t\t} elseif( $this->getConfig( 'default_home_group' ) && ( $group_home = $gBitUser->getGroupHome( $this->getConfig( 'default_home_group' )))) {\n\t\t\t}\n\n\t\t\tif( !empty( $group_home )) {\n\t\t\t\tif( $this->verifyId( $group_home ) ) {\n\t\t\t\t\t$url = BIT_ROOT_URL.\"index.php\".( !empty( $group_home ) ? \"?content_id=\".$group_home : \"\" );\n\t\t\t\t// wiki dependence - NO bad idea\n\t\t\t\t// } elseif( strpos( $group_home, '/' ) === FALSE ) {\n\t\t\t\t// \t$url = BitPage::getDisplayUrl( $group_home );\n\t\t\t\t} elseif( strpos( $group_home, 'http://' ) === FALSE ){\n\t\t\t\t\t$url = BIT_ROOT_URL.$group_home;\n\t\t\t\t} else {\n\t\t\t\t\t$url = $group_home;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif( $pIndexType == 'my_page' || $pIndexType == 'my_home' || $pIndexType == 'user_home' ) {\n\t\t\t// TODO: my_home is deprecated, but was the default for BWR1. remove in DILLINGER - spiderr\n\t\t\tif( $gBitUser->isRegistered() ) {\n\t\t\t\tif( !$gBitUser->isRegistered() ) {\n\t\t\t\t\t$url = USERS_PKG_URL.'login.php';\n\t\t\t\t} else {\n\t\t\t\t\tif( $pIndexType == 'my_page' ) {\n\t\t\t\t\t\t$url = $gBitSystem->getConfig( 'users_login_homepage', USERS_PKG_URL.'my.php' );\n\t\t\t\t\t\tif( $url != USERS_PKG_URL.'my.php' && strpos( $url, 'http://' ) === FALSE ){\n\t\t\t\t\t\t\t// the safe assumption is that a custom path is a subpath of the site \n\t\t\t\t\t\t\t// append the root url unless we have a fully qualified uri\n\t\t\t\t\t\t\t$url = BIT_ROOT_URL.$url;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif( $pIndexType == 'user_home' ) {\n\t\t\t\t\t\t$url = $gBitUser->getDisplayUrl();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$users_homepage = $gBitUser->getPreference( 'users_homepage' );\n\t\t\t\t\t\tif( isset( $users_homepage ) && !empty( $users_homepage )) {\n\t\t\t\t\t\t\tif( strpos($users_homepage, '/') === FALSE ) {\n\t\t\t\t\t\t\t\t$url = BitPage::getDisplayUrl( $users_homepage );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$url = $users_homepage;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$url = USERS_PKG_URL . 'login.php';\n\t\t\t}\n\t\t} elseif( in_array( $pIndexType, array_keys( $gBitSystem->mPackages ) ) ) {\n\t\t\t$work = strtoupper( $pIndexType ).'_PKG_URL';\n\t\t\tif (defined(\"$work\")) {\n\t\t\t\t$url = constant( $work );\n\t\t\t}\n\n\t\t\t/* this was commented out with the note that this can send requests to inactive packages - \n\t\t\t * that should only happen if the admin chooses to point to an inactive pacakge.\n\t\t\t * commenting this out however completely breaks the custom uri home page feature, so its\n\t\t\t * turned back on and caviate admin - if the problem is more severe than it seems then \n\t\t\t * get in touch on irc and we'll work out a better solution than commenting things on and off -wjames5\n\t\t\t */\n\t\t} elseif( !empty( $pIndexType ) ) {\n\t\t\t$url = BIT_ROOT_URL.$pIndexType;\n\t\t}\n\n\t\t// if no special case was matched above, default to users' my page\n\t\tif( empty( $url ) ) {\n\t\t\tif( $this->isPackageActive( 'wiki' ) ) {\n\t\t\t\t$url = WIKI_PKG_URL;\n\t\t\t} elseif( !$gBitUser->isRegistered() ) {\n\t\t\t\t$url = USERS_PKG_URL . 'login.php';\n\t\t\t} else {\n\t\t\t\t$url = USERS_PKG_URL . 'my.php';\n\t\t\t}\n\t\t}\n\n\t\tif( strpos( $url, 'http://' ) === FALSE ) {\n\t\t\t$url = preg_replace( \"#//#\", \"/\", $url );\n\t\t}\n\n\t\treturn $url;\n\t}",
"public function pageAction()\n {\n return $this->indexAction();\n }",
"function index() {\n\t}",
"public function index()\n {\n return \"INDEX PAGE\";\n }",
"public function indexAction()\n {\n session_start();\n // On vérifie si le visiteur viens pour la premier fois sur le site\n $this->session();\n // On récuper la liste des contents\n $contents = $this->contentManager->findAllPerPage(\"index\");\n // On va récupérer le dernier article publier\n $chapterManager = new ChapterManager();\n $chapter = $chapterManager->findLastPublished();\n if (!$contents || !$chapter) {\n throw new \\Exception(\"Page introuvable\");\n }\n echo $this->render(\n 'index.html.twig',\n array('contents' => $contents, 'chapter' => $chapter),\n $_SESSION\n );\n }",
"public function browse() {\n\n\t}",
"public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}",
"public function index(){\r\n $this->display(index);\r\n }",
"public function actionIndex()\n\t{\n\t\t$this->session->delete('page.lastSearch');\n\n\t\treturn $this->template->partial('content', 'pages/index', [\n\t\t\t'pages' => Page::findAll('SELECT * FROM nerd_pages'),\n\t\t]);\n\t}",
"function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\n\n }"
]
| [
"0.79717267",
"0.7480382",
"0.7168533",
"0.71246254",
"0.70695394",
"0.70135677",
"0.7005812",
"0.6942369",
"0.683793",
"0.6764486",
"0.6635541",
"0.6625695",
"0.65831625",
"0.6521389",
"0.65118533",
"0.6490293",
"0.64698666",
"0.64491755",
"0.6427759",
"0.64161557",
"0.64073986",
"0.6400838",
"0.6385434",
"0.6376954",
"0.6318596",
"0.6313663",
"0.6299989",
"0.6295204",
"0.62720925",
"0.6268893"
]
| 0.81339765 | 1 |
manage detail of a trade. | public function detail($tradeID, $mode = '')
{
$trade = $this->trade->getByID($tradeID);
if($trade->type == 'out') $this->loadModel('tree')->checkRight($trade->category);
if($_POST)
{
$result = $this->trade->saveDetail($tradeID);
if($result) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$details = $this->trade->getDetail($tradeID);
if(empty($details))
{
$detail = $trade;
$detail->desc = '';
$detail->money = '';
$details[] = $detail;
}
$this->view->title = $this->lang->trade->detail;
$this->view->modalWidth = 900;
$this->view->trade = $trade;
$this->view->details = $details;
$this->view->users = $this->loadModel('user')->getPairs('nodeleted,noforbidden');
if($trade->type == 'in' or $trade->type == 'out') $this->view->categories = $this->loadModel('tree')->getOptionMenu($trade->type, 0, $removeRoot = true);
$this->display();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQuoteDetails()\n {\n $types = [\n ['value' => 'Full Kitchen', 'text' => 'Full Kitchen'],\n ['value' => 'Cabinet Only', 'text' => 'Cabinet Only'],\n ['value' => 'Cabinet Small Job', 'text' => 'Cabinet Small Job'],\n ['value' => 'Cabinet and Install', 'text' => 'Cabinet and Install'],\n ['value' => 'Granite Only', 'text' => 'Granite Only'],\n ];\n if (Auth::user()->id == 5 || Auth::user()->id == 1)\n {\n $types[] = ['value' => 'Builder', 'text' => 'Builder'];\n }\n $type = Editable::init()->id(\"quote_type\")->placement('right')->type('select')->title(\"Quote Type\")\n ->linkText($this->quote->type)\n ->source($types)->url(\"/quote/{$this->quote->id}/type/liveupdate\")->render();\n\n if (!$this->quote->title)\n {\n $this->quote->title = \"Main Quote\";\n }\n $title = Editable::init()->id(\"quote_title\")->placement('right')->type('text')->title(\"Title\")\n ->linkText($this->quote->title)\n ->url(\"/quote/{$this->quote->id}/title/liveupdate\")->render();\n $markup = Editable::init()->id(\"quote_markup\")->placement('right')->type('text')->title(\"Markup Percentage\")\n ->linkText($this->quote->markup)\n ->url(\"/quote/{$this->quote->id}/markup/liveupdate\")->render();\n\n $rows = [];\n $rows[] = ['Quote Type:', $type];\n $rows[] = ['Title (Description)', $title];\n if ($this->quote->type == 'Full Kitchen')\n {\n $rows[] = ['Customer Picking Slab:', $this->quote->picking_slab];\n }\n if ($this->quote->type == 'Builder')\n {\n $rows[] = ['Frugal Markup Percentage:', $markup];\n }\n if (isset($this->meta['finance']))\n {\n switch ($this->meta['finance']['type'])\n {\n case 'all':\n $type = \"100% Financing Option for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'partial':\n\n $type = \"Partial financing Option putting $\" . $this->meta['finance']['downpayment'] . \" down\n with \";\n if (isset($this->meta['finance']['down_cash']) && $this->meta['finance']['down_cash'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_cash'] . \" in cash, \";\n }\n if (isset($this->meta['finance']['down_credit']) && $this->meta['finance']['down_credit'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_credit'] . \" in cash, \";\n }\n $type = substr($type, 0, -2);\n $type .= \" and financing for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'none':\n $type = \"No financing paying \";\n if (isset($this->meta['finance']['method']) && $this->meta['finance']['method'] == 'split')\n {\n if (isset($this->meta['finance']['no_cash']) && $this->meta['finance']['no_cash'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_cash'], 2) . \" in cash, \";\n }\n if (isset($this->meta['finance']['no_credit']) && $this->meta['finance']['no_credit'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_credit'], 2) . \" in credit, \";\n }\n $type = substr($type, 0, -2);\n }\n else\n {\n $type = \"No finance using \" . $this->meta['finance']['method'] . \" for payment\";\n }\n break;\n default:\n $type = \"Financing Option Needed\";\n }\n $rows[] = ['Financing Options', $type];\n }\n\n $table = Table::init()->rows($rows)->render();\n $panel = Panel::init('primary')\n ->header(\"Quote Details <small style='color:#fff'>Quote Type and Cabinet Information</small>\")\n ->content($table)->render();\n return $panel;\n }",
"public function record() {\n $data = array(\n \"name\" => $this->name,\n \"description\" => $this->description,\n \"image\" => $this->image,\n \"type\" => $this->type,\n \"discount\" => $this->discount_offer,\n \"code\" => $this->coupon_code,\n \"expiration\" => $this->expiration\n );\n return $this->db->insert(\"trade\", $data);\n }",
"public function edit(Buy $buy)\n {\n //\n }",
"public static function trade($tradeId) {\n //Return an object containing information on a single pair\n\t\t\treturn self::get(self::trade_index() . $tradeId);\n\t\t}",
"public function sellsDetails(Transaction $transaction)\n {\n $payments = $transaction->payments()->orderBy('id', 'desc')->get();\n $total_paid = $transaction->payments()->where('type', 'credit')->sum('amount');\n $total_return = $transaction->payments()->where('type', 'return')->sum('amount');\n $total = $total_paid - $total_return;\n return view('sells.details')\n ->withTransaction($transaction)\n ->withPayments($payments)\n ->withTotal($total);\n }",
"public function edit(Quote $quote)\n {\n //\n }",
"public function edit(Quote $quote)\n {\n //\n }",
"public function testeditTrade() {\n $user = 1;\n $product = 1;\n $price = 999;\n $newprice = 500;\n $desc = 'test';\n $newdesc = 'uusi testi';\n R::exec('UPDATE collection set products = \"{\"\"1\"\": 1}\" WHERE id = :id', [':id' => $user]);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n addNewTrade($user, $product, $price, $desc);\n $trades = getOpenTrades($user);\n editTrade($user, $trades[0]['id'], $newprice, $newdesc);\n $trades = getOpenTrades($user);\n $this->assertEquals($newprice, $trades[0]['price']);\n $this->assertEquals($newdesc, $trades[0]['description']);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n }",
"public function show(Quote $quote)\n {\n //\n }",
"public function show(Quote $quote)\n {\n //\n }",
"public function show(Quote $quote)\n {\n //\n }",
"public function show(Quote $quote)\n {\n //\n }",
"public function prodViewDetails($quote_id)\n\t{\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t/* $related_files='';\n\t\t\t\t\t\t$documents_path=explode(\"|\",$quote['documents_path']);\n\t\t\t\t\t\t$documents_name=explode(\"|\",$quote['documents_name']);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($documents_path as $k=>$file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($documents_name[$k])\n\t\t\t\t\t\t\t\t$file_name=$documents_name[$k];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$file_name=basename($file);\n\n\t\t\t\t\t\t\t$related_files.='\n\t\t\t\t\t\t\t<a href=\"/quote/download-document?type=quote&index='.$k.'"e_id='.$quote_id.'\">'.$file_name.'</a><br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} */\n\t\t\t\t\t\t$files = array('documents_path'=>$quote['documents_path'],'documents_name'=>$quote['documents_name'],'quote_id'=>$quote_id,'delete'=>false);\n\t\t\t\t\t\t$related_files = $this->getQuoteFiles($files);\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=$related_files;\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\t\t\t\t\t\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\n\n\t\t\t\t\t\t\t$quoteDetails[$q]['missions_list'][$mission['identifier']]='Mission '.($m+1).' - '.$missonDetails[$m]['product_name'];\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'sales');\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\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}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\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($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\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($mission['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//Get seo missions related to a mission\n\t\t\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t\t\t\t\t$searchParameters['related_to']=$mission['identifier'];\n\t\t\t\t\t\t\t$searchParameters['product']=$mission['product'];\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($searchParameters);\n\t\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t$seoMissonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($seoMissonDetails);exit;\n\t\t\t\t\t\t\tif($seoMissonDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$s=0;\n\t\t\t\t\t\t\t\tforeach($seoMissonDetails as $smission)\n\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$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($smission['created_by']);\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['comment_time']=time_ago($smission['created_at']);\n\n\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['product_type_name']=$this->producttype_array[$smission['product_type']];\n\n\t\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$smission['identifier'];\n\t\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t//getting suggested mission Details for seo missions\n\t\t\t\t\t\t\t\t\t\tif($smission['sales_suggested_missions'])\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t\t\t\t\t\t$archParameters['mission_id']=$smission['sales_suggested_missions'];\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($suggested_mission_details as $key=>$suggested_mission)\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$sug_mission_length=$smission['volume']*($smission['nb_words']/$suggested_mission['article_length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_mission_length=round($suggested_mission['mission_length']*($sug_mission_length/$suggested_mission['num_of_articles']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=$prod_mission_length;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=round(($smission['mission_length']*90)/100);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=ceil(($smission['mission_length']*10)/100);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length ? $staff_setup_length :1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length < 10 ? $staff_setup_length :10;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['staff_setup_length']=$staff_setup_length < 10 ? $staff_setup_length :10;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//pre-fill staff calculations\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//total mission words\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_volume=$smission['volume'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_nb_words=$smission['nb_words'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_mission_words=($mission_volume*$mission_nb_words);\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\t//words that can write per writer with in delivery weeks\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_time=$smission['mission_length_option']=='hours' ? ($smission['mission_length']/24) : $smission['mission_length'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_week=ceil($sales_delivery_time/7);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$mission_product=$smission['product_type'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$articles_perweek=$this->configval['max_writer_'.$mission_product];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$words_perweek_peruser=$articles_perweek*250;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$words_peruser_perdelivery=$sales_delivery_week*$words_perweek_peruser;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//wrting and proofreading staff calculations\n\t\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=round($total_mission_words/$words_peruser_perdelivery);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!$writing_staff || $writing_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_staff']=$writing_staff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['suggested_mission_details']=$suggested_mission_details;\t\n\t\t\t\t\t\t\t\t\t\t\t\t//staff time details\n\t\t\t\t\t\t\t\t\t\t\t\t$seoMissonDetails[$s]['staff_time']=$staff_setup_length;\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($seoMissonDetails);exit;\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t$s++;\t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['seoMissions']=$seoMissonDetails;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\n\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\n\t\t\t\t\t\t\t$searchParameters['quote_mission_id']=$mission['identifier'];\n\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($searchParameters);\n\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);exit;\n\n\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$p=0;\n\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $mission)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails=$prodMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$prodMissionObj->getMissionVersionDetails($mission['identifier']);\n\n\t\t\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\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$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_versions=$staff_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\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\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 \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\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 \t$staff_versions.=\"<tr><td>\".$versions['staff'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$staff_length_option=$versions['staff_time_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$staff_length_versions.=\"<tr><td>\".$versions['staff_time'].\" $staff_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t//checking the version differences\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\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$prodMissionDetails[$p]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($mission['staff'] !=$previousMissionDetails[0]['staff'])\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$prodMissionDetails[$p]['staff_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_versions']=$table_start.$staff_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\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$prodMissionDetails[$p]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$current_staff_lenght=$mission['staff_time_option']=='hours' ? ($mission['staff_time']/24) : $mission['staff_time'];\n\t\t\t\t\t\t\t\t\t\t\t$previous_staff_lenght=$previousMissionDetails[0]['staff_time_option']=='hours' ? ($previousMissionDetails[0]['staff_time']/24) : $previousMissionDetails[0]['staff_time'];\n\t\t\t\t\t\t\t\t\t\t\tif($current_staff_lenght !=$previous_staff_lenght)\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$prodMissionDetails[$p]['staff_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['staff_length_versions']=$table_start.$staff_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t\t\t$prodMissionDetails[$p]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$p++;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t$missonDetails[$m]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//getting suggested mission Details for quote missions\n\t\t\t\t\t\t\t\tif($mission['sales_suggested_missions'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t\t\t\t$archParameters['mission_id']=$mission['sales_suggested_missions'];\n\t\t\t\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\n\t\t\t\t\t\t\t\t\tif($suggested_mission_details)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach($suggested_mission_details as $key=>$suggested_mission)\n\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\tif($suggested_mission['writing_cost_before_signature_currency']!=$quote['sales_suggested_currency'])\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$conversion=$quote['conversion'];\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_cost_before_signature']=($suggested_mission['writing_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['correction_cost_before_signature']=($suggested_mission['correction_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['other_cost_before_signature']=($suggested_mission['other_cost_before_signature']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['unit_price']=($suggested_mission['selling_price']*$conversion);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['unit_price']=($suggested_mission['selling_price']);\n\n\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['mission_length']=round(($mission['mission_length']*90)/100);\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=ceil(($mission['mission_length']*10)/100);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length ? $staff_setup_length :1;\n\t\t\t\t\t\t\t\t\t\t\t$staff_setup_length=$staff_setup_length < 10 ? $staff_setup_length :10;\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['staff_setup_length']=$staff_setup_length < 10 ? $staff_setup_length :10;\n\n\t\t\t\t\t\t\t\t\t\t\t//pre-fill staff calculations\n\n\t\t\t\t\t\t\t\t\t\t\t//total mission words\n\t\t\t\t\t\t\t\t\t\t\t$mission_volume=$mission['volume'];\n\t\t\t\t\t\t\t\t\t\t\t$mission_nb_words=$mission['nb_words'];\n\t\t\t\t\t\t\t\t\t\t\t$total_mission_words=($mission_volume*$mission_nb_words);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t//words that can write per writer with in delivery weeks\n\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_time=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t\t\t\t\t$sales_delivery_week=ceil($sales_delivery_time/7);\n\n\t\t\t\t\t\t\t\t\t\t\t$mission_product=$mission['product_type'];\n\t\t\t\t\t\t\t\t\t\t\tif($mission['product_type']=='autre')\n\t\t\t\t\t\t\t\t\t\t\t\t$mission_product='article_seo';\n\n\t\t\t\t\t\t\t\t\t\t\t$articles_perweek=$this->configval['max_writer_'.$mission_product];\n\t\t\t\t\t\t\t\t\t\t\t$words_perweek_peruser=$articles_perweek*250;\n\t\t\t\t\t\t\t\t\t\t\t$words_peruser_perdelivery=$sales_delivery_week*$words_perweek_peruser;\n\n\t\t\t\t\t\t\t\t\t\t\t//wrting and proofreading staff calculations\n\t\t\t\t\t\t\t\t\t\t\t$writing_staff=round($total_mission_words/$words_peruser_perdelivery);\n\t\t\t\t\t\t\t\t\t\t\tif(!$writing_staff || $writing_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t$writing_staff=1;\n\n\t\t\t\t\t\t\t\t\t\t\t$proofreading_staff=round($total_mission_words/($words_peruser_perdelivery*5));\n\t\t\t\t\t\t\t\t\t\t\tif(!$proofreading_staff || $proofreading_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t\t$proofreading_staff=1;\n\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['writing_staff']=$writing_staff;\n\t\t\t\t\t\t\t\t\t\t\t$suggested_mission_details[$key]['proofreading_staff']=$proofreading_staff;\n\n\t\t\t\t\t\t\t\t\t\t\t//ENDED\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['suggested_mission_details']=$suggested_mission_details;\t\n\t\t\t\t\t\t\t\t\t\t//staff time details\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['staff_time']=$staff_setup_length;\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\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\t\t\t\t\t}\n\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion,'sales');\n\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\t\t\t\t\t}\n\n\t\t\t\t\t//client aims\n\t\t\t\t\t\t$client_aims=explode(\",\",$quote['client_aims']);\n\t\t\t\t\t\t$client_prio=explode(\",\",$quote['client_prio']);\n\t\t\t\t\t\t$client_aims_text='';\n\t\t\t\t\t\tif(count($client_aims)>0 && is_array($client_aims))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($client_aims as $i=>$aim)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$client_aims_text.='<b>'.ucfirst($aim).'</b> - Prio '.$client_prio[$i].'<br>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$quoteDetails[$q]['client_aims_text']=$client_aims_text;\t\t\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->quoteDetails=$quoteDetails;\n\n\t\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\t\t\t\n\n\t\t\t//getting tech mission details\n\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\t//echo \"<pre>\";print_r($techMissionDetails);exit;\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$t=0;\n\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$techMissionDetails[$t]['tech_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t$techMissionDetails[$t]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\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$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$techMissionDetails[$t]['files'] = \"\";\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getTechFiles($filesarray);\n\t\t\t\t\t\t$techMissionDetails[$t]['files'] = $files;\n\t\t\t\t\t}\n\n\t\t\t\t\t$t++;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->_view->techMissionDetails=$techMissionDetails;\n\t\t\t}\n\n\t\t\t//ALL language list\n\t\t\t$language_array=$this->_arrayDb->loadArrayv2(\"EP_LANGUAGES\", $this->_lang);\n \tnatsort($language_array);\n \t$this->_view->ep_language_list=$language_array;\n\n\t\t\t//getting seo mission details\n\t\t\t//getting mission details\n\t\t\tunset($searchParameters);\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$searchParameters['misson_user_type']='seo';\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\tif($seoMissionDetails)\n\t\t\t{\n\t\t\t\t$s=0;\n\t\t\t\tforeach($seoMissionDetails as $mission)\n\t\t\t\t{\n\t\t\t\t\tif($mission['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$filesarray = array('documents_path'=>$mission['documents_path'],'documents_name'=>$mission['documents_name'],'id'=>$mission['identifier'],'delete'=>false);\n\t\t\t\t\t\t$files = $this->getSeoFiles($filesarray);\n\t\t\t\t\t\t$seoMissionDetails[$s]['files'] = $files;\n\t\t\t\t\t}\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($mission['created_by']);\n\t\t\t\t\t$seoMissionDetails[$s]['seo_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t\t$seoMissionDetails[$s]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t$seoMissionDetails[$s]['product_name']=$this->seo_product_array[$mission['product']];\n\n\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion,'seo');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],NULL,'seo');\n\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t$product_versions=$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_versions.=\"<tr><td>\".$this->seo_product_array[$versions['product']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($mission['product'] !=$previousMissionDetails[0]['product'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_versions']=$table_start.$product_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($mission['mission_length']/24) : $mission['mission_length'];\n\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t$seoMissionDetails[$s]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$seoMissionDetails[$s]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$s++;\n\t\t\t\t}\t\n\t\t\t\t$this->_view->seoMissionDetails=$seoMissionDetails;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//echo \"<pre>\";print_r($seoMissionDetails);exit;\n\n\t\treturn $html=$this->_view->renderHtml('prod-quote-view-details'); \n\n\t\t\n\t}",
"public function store(StoreTradeRequest $request)\n {\n\n if (Gate::allows('trades')) {\n\n $fileNameToStore = $this->storeImg($request->file('trade_img'), 'trades');\n\n $trade = Trade::create([\n 'user_id' => auth()->id(),\n 'trade_img' => $fileNameToStore,\n 'portfolio_id' => \\App\\Models\\Portfolio::isactive()->first(),\n ] + $request->validated());\n\n //$trade_performance = $request->all();\n\n $trade->add_to_balance($trade);\n $trade->add_to_trade_performance($request->all());\n\n if ($request->input('entry_rule_id')) {\n $trade->add_to_used_entry_rules($request->entry_rule_id);\n }\n } else {\n return response('Upgrade account', 402);\n }\n }",
"public function show(Transaction $transaction)\n {\n //\n }",
"public function show(Transaction $transaction)\n {\n //\n }",
"public function show(Transaction $transaction)\n {\n //\n }",
"function saveEstimateSignDetailsAction()\n\t{\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$signParams = $this->_request->getParams();\n\n\t\t\t$quote_id=$signParams['quote_id'];\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\t\t\t$status=$quoteDetails[0]['sales_review'];\n\t\t\t\tif($status=='not_done')\n\t\t\t\t\t$status='';\n\n\t\t\t\t\n\t\t\t\t$quote_update['estimate_sign_percentage']=$signParams['estimate_sign_percentage'];\n\t\t\t\t$quote_update['estimate_sign_date']=$signParams['estimate_sign_date'];\n\t\t\t\t$quote_update['estimate_sign_comments']=$signParams['estimate_sign_comments'];\n\n\n\t\t\t\t//echo \"<pre>\";print_r($_SERVER);exit;\t\t\t\t\n\t\t\t\t$quoteObj->updateQuote($quote_update,$quote_id);\n\n\t\t\t\t$this->_helper->FlashMessenger('Details updated successfully');\n\t\t\t}\t\n\n\n\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2&active=\".$status);\n\t\t}\n\t\t\n\t}",
"public function show(Order $order)\n { \n //\n }",
"public function show(Transaction $transaction)\n {\n }",
"public function getTradeDetailsByTransactionId($trade_id = '', $transaction_id = '', $debug = '') {\n\n// $this->db->select('txn.*,trd.*,user.*');\n $this->db->select('txn.transaction_id,txn.buyer_id,txn.seller_id,txn.fiat_currency,txn.btc_amount,txn.local_currency_rate,txn.transaction_type,txn.transaction_status,txn.transaction_status,txn.verify_code,txn.action_taken_by,txn.created_on,trd.trade_id,trd.user_id as advertiser_id,trd.currency_id,trd.trade_type ,trd.trade_type,e.escrow_status ,e.seller_funded, e.escrow_transaction_id, e.escrow_wallet_address,u.user_name as action_taken_user');\n $this->db->from('buy_sell_transaction as txn');\n $this->db->join('mst_trades as trd', 'txn.trade_id = trd.trade_id', 'inner');\n\t\t$this->db->join('mst_escrow_management as e', 'txn.transaction_id = e.contact_id', 'left');\n $this->db->join('mst_users as u', 'txn.action_taken_by = u.user_id', 'inner');\n// $this->db->join('');\n if ($trade_id != '')\n $this->db->where('txn.trade_id', $trade_id);\n if ($transaction_id != '')\n $this->db->where('txn.transaction_id', $transaction_id);\n\n $result = $this->db->get();\n\n if ($debug) {\n die($this->db->last_query());\n }\n return $result->result_array();\n }",
"public function edit(OrderDetails $orderDetails)\n {\n //\n }",
"public function edit(Transaction $transaction)\n {\n //\n }",
"public function edit(Transaction $transaction)\n {\n //\n }",
"public function edit(Transaction $transaction)\n {\n //\n }",
"public function edit(Transaction $transaction)\n {\n //\n }",
"public function store(OrderDetails $orderDetail, PaymentGatewayContract $payment)\n {\n \t$order = $orderDetail->all();\n dd($payment->charge(2500));\n }",
"function viewtransactionAction() {\n /**\n * Checked that user is loggin or not.\n */\n if (! $this->_getSession ()->isLoggedIn ()) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return;\n }\n /**\n * load and render layout\n */\n $this->loadLayout ();\n $this->getLayout ()->getBlock ( 'head' )->setTitle ( $this->__ ( 'Transaction History' ) );\n $this->renderLayout ();\n }",
"private function getItemTransactionDetail($transaction_key)\n\t{\n\t\t$data = array();\n\t\t$data['currency'] \t\t\t\t\t= $this->payment_details['currencyCode'];\n\t\t$data['reference_content_id'] \t\t= $this->order_details['id'];\n\t\t$data['invoice_id'] \t\t\t\t= $this->order_details['id'];\n\t\t//$data['item_id'] \t\t\t\t\t= $this->invoice_detail['item_id'];\n\t\t$data['reference_content_table']\t= 'shop_order';\n\t\t$data['status'] \t\t\t\t\t= $this->order_details['order_status'];\n\n\t\t//echo \"<pre>\";print_r($this->order_details);echo \"</pre>\";exit;\n\t\t$total_item_amount\t= $this->payment_amount_details['total_amount'];\n\n\t\t//This is to include the wallet amount (if purchased using both wallet and paypal) while debit from buyer\n\t\tif(!isset($this->wallet_transaction_details['buyer']['amount']))\n\t\t\t$this->wallet_transaction_details['buyer']['amount'] = 0;\n\t\t$buyer_debit_amount = $total_item_amount + $this->wallet_transaction_details['buyer']['amount'];\n\n\t\t$receiver_amount\t= $this->payment_amount_details['seller_amount'];\n\t\t$site_commission\t= $this->payment_amount_details['site_commission'];\n\t\t$credit_to_admin\t= $this->payment_amount_details['credit_to_admin'];\n\t\t$credit_to_seller\t= $this->payment_amount_details['credit_to_seller'];\n\t\t//$receiver_amount\t= $total_item_amount - $site_commission;\n\t\t//echo \"dsds<pre>\";print_r($this->paypal_adaptive_transaction_details);echo \"</pre>\";exit;\n\t\t$payment_type = 'purchase';\n\t\t$site_payment_type = 'purchase_fee';\n\t\tswitch ($transaction_key) {\n\n\t\t\tcase 'BuyerCredit':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Amount credited to wallet account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $total_item_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['buyer_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= isset($this->paypal_adaptive_transaction_details['buyer_trans_id'])?$this->paypal_adaptive_transaction_details['buyer_trans_id']:'';\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'BuyerDebit':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Debited amount from paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $buyer_debit_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['buyer_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= isset($this->paypal_adaptive_transaction_details['buyer_trans_id'])?$this->paypal_adaptive_transaction_details['buyer_trans_id']:'';\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to paypal account from buyer for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_admin;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->site_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteDebitSellerAmount':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Debited amount from your paypal account to transfer seller amount except site commission for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SellerCreditFromSite':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to your paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['seller_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->seller_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'ParallelSellerCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to your paypal acccount for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['seller_id'];\n\t\t\t\t\t$data['transaction_id'] \t\t= $this->seller_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'ParallelSiteCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited site commission amount to paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_admin;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->site_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'PurchaseItem':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Purchase Item Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $receiver_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\n\t\t\t\tbreak;\n\t\t\t//in case of parrallel payment, for buyer there will be 2 debits\n\t\t case 'ParallelBuyerSitePayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'SiteCommission';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ParallelBuyerSitePayment- Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $site_commission;//$this->getPaymentInfo('receiver.amount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'ParallelAuthorPayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'AuthorPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ParallelAuthorPayment - Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $receiver_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'ChainedAuthorPayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'AuthorPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ChainedAuthorPayment - Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\t//in case of chained payment, for seller there will be 1 additional debit\n\t\t\tcase 'ChainedAuthorSitePayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'SiteCommission';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ChainedAuthorSitePayment-Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->invoice_detail['item_site_commission'];\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteCommission':\n\t\t\t\t\t$data['transaction_type']\t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes']\t\t= 'SiteCommission-Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->invoice_detail['item_site_commission'];\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');;\n\t\t\t\tbreak;\n\n\t\t\t//\tDebit for seller\n\t\t\tcase 'AuthorRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'AuthorRefund - Debit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'AuthorPayment', $this->invoice_detail['item_owner_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//\tCredit for buyer\n\t\t\tcase 'BuyerRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundPayment';\n\t\t\t\t\t$data['transaction_notes'] = 'BuyerRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t=$this->getRelativeTransactionId($data['invoice_id'], 'PurchaseItem', $this->invoice_detail['buyer_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of chained payment, site refund will be to the seller, Credit for seller\n\t\t\tcase 'ChainedSiteRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] \t = 'ChainedSiteRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', $this->invoice_detail['item_owner_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of parallel payment, site refund will be to the buyer, Credit for buyer\n\t\t\tcase 'ParallelSiteRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] \t= 'ParallelSiteRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', $this->invoice_detail['buyer_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of site refund for both , site refund will be debit to the admin\n\t\t\tcase 'SiteCommissionRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] = 'SiteCommissionRefund - Debit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', Config::get('generalConfig.admin_id'));\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\tbreak;\n\t\t}\n\t\treturn $data;\n\t}",
"public function show(Deal $deal)\n {\n //\n }"
]
| [
"0.60432565",
"0.5811585",
"0.57815534",
"0.5633134",
"0.56263375",
"0.55697936",
"0.55697936",
"0.5567643",
"0.55544335",
"0.55544335",
"0.55544335",
"0.55544335",
"0.5516662",
"0.544131",
"0.54307914",
"0.54307914",
"0.54307914",
"0.5408633",
"0.5399683",
"0.5399591",
"0.53966796",
"0.53801495",
"0.53693956",
"0.53693956",
"0.53693956",
"0.53693956",
"0.5369126",
"0.5366405",
"0.5353994",
"0.53538924"
]
| 0.6152902 | 0 |
Ajax get depositor of customer. | public function ajaxGetDepositor($customerID)
{
$customer = $this->loadModel('customer')->getByID($customerID);
if(!$customer) die();
die($customer->depositor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getdepositorDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }",
"public function getCustomer();",
"public function getCustomerDob();",
"public function ajaxGetAllDeposits(Request $request)\n {\n $user_id = session()->get('sel_user');\n if(request()->ajax()) {\n if($user_id == 0)\n {\n $list = Deposit::with('admin', 'admin.client_details')->orderBy('made_date', 'desc')->get();\n } else\n {\n $list = Deposit::where(['user_id' => $user_id])->with('admin', 'admin.client_details')->orderBy('made_date', 'desc')->get();\n }\n return response()->json(['results' => $list]);\n }\n }",
"function getListDeleteCustomer()\n {\n $model = new CustomerModel();\n $getListCustomer = $model->getListCustomerDel();\n\n //set view and title\n $title = TITLE_LIST_CUSTOMERS;\n $view = \"View/v_list-delete-customer.php\";\n include(DIRECTORY_ADMIN_VIEW);\n }",
"public function ajaxGetCustomer()\n {\n $customers = $this->FacturasQueries->getClientes();\n $array = $customers->toArray();\n return response()->json($array); \n }",
"public function getAllCustomerByAjax()\n {\n $customers = RestaurantCustomer::where('restaurant_id', Auth::guard('restaurantUser')->user()->restaurant_id)->where('del_status', 'Live')->orderBy('updated_at', 'desc')->get();\n return response()->json($customers);\n }",
"public function deposite(){\n return view('admin.deposite_list');\n\n // echo \"<pre>\";\n // print_r($users);\n }",
"public function obtienedatosdestinoAction()\n {\n $this->disableAutoRender();\n\n /* Recibo parámetros */\n $dependencia_iddestino = $this->_getParam('dependencia_iddestino');\n\n $modelDependencia = new Gidoc_Model_DependenciaMapper(); \n \n $objDependencia = $modelDependencia->getById($dependencia_iddestino);\n \n echo $objDependencia->nombre.'|'.$objDependencia->cargo;\n \n }",
"public function list_depto(Request $request)\n {\n if($request->ajax()){\n\t\t $pais = $request->get('cod');\n\t\t $listdepto = DB::table('par_departamento')->select('dep_codigo','dep_nombre')\n\t\t ->where('pai_id',$pais)\n\t\t ->orderBy('dep_nombre')->get();\n\t\t return response()->json($listdepto);\n\t\t}\n }",
"public function getObjetcustomer()\n{\nreturn $this->objetcustomer;\n}",
"function get_deleted_companies() {\n return get_view_data('org_list_archived');\n}",
"public function get_lst_customer() {\n Work_Order_Controller::define_asset();\n $lstVehicle = Vehicle::listAll(array());\n return View::make('wo.modal.customer', array(\n 'lstVehicle' => $lstVehicle\n ));\n }",
"public function debt()\n {\n $inDebt = $this->data->getAccounts()->filter(function($value, $key) {\n return $value->balance < 0;\n })->pluck('id');\n\n return response()->json([\n 'data' => $inDebt\n ], 200);\n }",
"public function show_comentarios()\n {\n $input=Request::all();\n $comentarios=$this->ComentarioRepository->findAllBy('id_post',$input['id_post']);\n\n foreach ($comentarios as $comentario) {\n \t$comentario->usuario=$comentario->Usuario; \t\n }\n return json_encode($comentarios->reverse());\n }",
"public static function listData()\n\t{\n\t\t\n\t\t$customers = RestController::getAdminData('customers');\n\t\treturn CHtml::listData($customers, 'id', 'customerName');\n\t}",
"public function accessBruyerFromCustomerAction($domaine, $uuid) {\n $customer = $this->getCustomerByDomaine($domaine); \n if (!$customer == null) { \n $buyer = $this->getBuyerByUid($uuid); // get buyer or creat it if no exist\n $buyerCustomer= $this->getBuyerCustomer($customer, $buyer);// get buyerCustomer or creat it if no exist\n $visites = $buyerCustomer->getTotalAccess();\n $tabPromo = $customer->getPromoCodesAsArray();\n if ($customer->isGlobalPromo() && (!$tabPromo === FALSE)) { \n foreach(array_reverse($tabPromo) as $ligneCode) {\n var_dump($ligneCode);\n if ($customer->getPricingType() == 1) {\n if ($ligneCode[0] = $vistit) {\n $codePromo = $ligneCode[1];\n $msg = $ligneCode[2];\n break;\n }\n } else {\n if ($ligneCode[0] <= $vistit) {\n $codePromo = $ligneCode[1];\n $msg = $ligneCode[2];\n break;\n }\n }\n }\n }\n $code = \"\" ;\n $msg = '<resp><visite>'.$visites.'</visite><code>'.$code.'</code></resp>'; \n } else { \n $msg = '<resp>no exist></resp>';\n }\n return new Response($msg,200,array('content-type' => 'text/xml'));\n }",
"public function get_discount($dealer_id) {\r\n $fields = array('discount');\r\n $criteria = array('id' => $dealer_id);\r\n $data = $this->dealer_model->get_dealer($fields,$criteria);\r\n //var_dump($data);\r\n echo json_encode($data);\r\n\r\n }",
"public function obtener_delincuentes()\n {\n // linea que carga la base de datos \n $this->load->database();\n\n // se obtiene el listado de delincuentes y se guarda en la variable $delincuentes\n $delincuentes = $this->db->get('delincuente');\n\n\n // retorna resultado obtenido de la base de datos\n return $delincuentes->result();\n }",
"public function get_customers_for_dropdown($company){\r\n\t\theader(\"Access-Control-Allow-Origin: \". base_url());\r\n\t\terror_log(\"get_customers_for_dropdown($company)\");\r\n\r\n\t\t$cid = intval($company);\r\n\t\tif($cid>0){\r\n\t\t\t$cs = $this->customer_model->get_companys_customers($cid);\r\n\t\t}\r\n\t\telse if($cid == 0){\r\n\t\t\t$cs = $this->customer_model->get_customers();\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo \"0\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\t\tforeach($cs as $c){\r\n\t\t\t$id = $c[\"id\"];\r\n\t\t\t$name = $c[\"namn\"];\r\n\t\t\t$data[] = array($id => $name);\r\n\t\t}\r\n\t\terror_log(print_r($data, true));\r\n\t\techo json_encode($data);\r\n\t}",
"public function getcboinspector() {\n \n\t\t$resultado = $this->mregctrolprov->getcboinspector();\n\t\techo json_encode($resultado);\n\t}",
"public function getcliente()\r\n {\r\n return $this->cliente;\r\n }",
"private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }",
"public function getCustomer($customer_id);",
"public function listDemarcaciones()\n {\n $list_demarcaciones = \\common\\models\\autenticacion\\Demarcaciones::find()->all();\n\n return $list_demarcaciones;\n }",
"public function actionAjaxCustomer()\n { \n $this->layout = false;\n if ( Yii::$app->request->post() ) {\n $woId = Yii::$app->request->post()['woId'];\n $quotation_type = Yii::$app->request->post()['quotation_type'];\n if ($quotation_type == 'work_order'){\n $workOrder = WorkOrder::find()->where(['id' => $woId])->one();\n return $workOrder->customer_id;\n } else {\n $uphostery = Uphostery::find()->where(['id' => $woId])->one();\n return $uphostery->customer_id;\n }\n }\n }",
"function get_customer_to_order($customer_id) {\n\t$sql = \"SELECT cust.name, \n\t\t cust.address, \"\n\t\t .TB_PREF.\"credit_status.dissallow_invoices, \n\t\t cust.sales_type AS salestype,\n\t\t cust.dimension_id,\n\t\t cust.dimension2_id,\n\t\t stype.sales_type,\n\t\t stype.tax_included,\n\t\t stype.factor,\n\t\t cust.curr_code,\n\t\t cust.discount,\n\t\t cust.payment_terms,\n\t\t cust.pymt_discount,\n\t\t cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,\n\t\t\t-1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit\n\t\tFROM \".TB_PREF.\"debtors_master cust\n\t\t LEFT JOIN \".TB_PREF.\"debtor_trans trans ON trans.type!=\".ST_CUSTDELIVERY.\" AND trans.debtor_no = cust.debtor_no,\"\n\t\t .TB_PREF.\"credit_status, \"\n\t\t .TB_PREF.\"sales_types stype\n\t\tWHERE cust.sales_type=stype.id\n\t\t\tAND cust.credit_status=\".TB_PREF.\"credit_status.id\n\t\t\tAND cust.debtor_no = \".db_escape($customer_id)\n\t\t.\" GROUP by cust.debtor_no\";\n\n\t$result =db_query($sql,\"Customer Record Retreive\");\n\treturn \tdb_fetch($result);\n}",
"public function entrepotDemandeAction(request $request )\n { $securityContext = $this->container->get('security.authorization_checker');\n if ( $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED'))\n {\n $user = $this->container->get('security.token_storage')->getToken()->getUser()->getId();\n $em= $this->getDoctrine()->getManager();\n $query = $em->createQuery(\n \"SELECT \n e.idEntrepot id_Entrepot, e.adresse adresse , e.numFiscale numFiscale, e.entreprise entreprise , l.idLocation id_Location, l.dateDebLocation dateDebLocation,l.dateFinLocation dateFinLocation, l.prixLocation prixLocation, u.prenom prenom , u.nom nom, u.tel tel, u.email email\n FROM GererEntrepotBundle:Entrepot e \n JOIN GererEntrepotBundle:Location l WITH e.idEntrepot = l.fkEntrepot and e.id = $user and e.etat = 'En Attente'\n JOIN AppBundle:User u WITH l.fkUser= u.id\n \n \");\n\n $entrepots = $query->getResult();\n return $this->render('@GererEntrepot/entrepot/demande.html.twig', array('entrepots' => $entrepots));\n\n\n }\n\n # if user not logged in yet\n else\n {\n return $this->redirectToRoute('fos_user_security_login');\n }\n\n }",
"function customerIsDebtor($connection,$customer_id){\n\t$query = \"SELECT SUM(amount) as amount, customers.customer_name AS name FROM `debtors` INNER JOIN customers ON debtors.customer_id = customers.id WHERE customer_id = '$customer_id'\";\n\n\tif($result = mysqli_query($connection,$query)){\n\t\t$debt_arr = mysqli_fetch_assoc($result);\n\t\treturn [\n\t\t\t'name'=> $debt_arr['name'],\n\t\t\t'amount' => $debt_arr['amount']\n\t\t];\n\t}else{\n\t\ttrigger_error(mysqli_error($connection));\n\t\treturn false;\n\t}\n\n}",
"static public function getnotasDebitoController(){\n\n\t\t\t $respuesta = NotasModel::getNotasDebitoModel('notadebito');\n\n\t\t\t if ($respuesta) {\n\n\t\t\t echo json_encode($respuesta);\n\n\t\t\t }\n\n }"
]
| [
"0.6361772",
"0.6106198",
"0.6021105",
"0.5990199",
"0.5872384",
"0.58593726",
"0.5815851",
"0.5694056",
"0.5691081",
"0.5619118",
"0.56175154",
"0.5585047",
"0.55311126",
"0.5492871",
"0.5465653",
"0.5449429",
"0.5435644",
"0.5433026",
"0.53804153",
"0.5361763",
"0.53282577",
"0.5325175",
"0.5315001",
"0.5307294",
"0.5301074",
"0.53002083",
"0.52986586",
"0.5282949",
"0.52567905",
"0.5252438"
]
| 0.77174145 | 0 |
get all metas by product id | public function getAllMetasByProductId($product_id){
$metas = self::model()->findAllByAttributes(array('meta_product_id'=>$product_id));
return $metas;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetAll()\n {\n $this->abrir_conexion();\n $sql = \"SELECT * FROM metas order by meta_id\";\n $resultado = mysqli_query($this->db, $sql);\n\n while ($row = mysqli_fetch_assoc($resultado)) {\n $datos[] = $row;\n }\n\n return $datos;\n $this->cerrar_conexion();\n }",
"public function index($id = null){\n if($id == null){\n $productTypes = ProductType::all(); \n } else {\n $productTypes = ProductType::find($id);\n }\n return $productTypes;\n }",
"public function getProductById(int $id);",
"function GetById($id)\n {\n $this->abrir_conexion();\n $sql = \"SELECT * FROM metas where meta_id = '{$id}'\";\n $resultado = mysqli_query($this->db, $sql);\n $row = mysqli_fetch_assoc($resultado);\n return $row;\n $this->cerrar_conexion();\n }",
"public function getProductsOfGenre($id) {\n\t\t$products_of_genre = Product::where('genre_id', $id)\n\t\t ->orderBy('created_at', 'desc')\n\t\t ->with('image')\n\t\t ->where( 'amount', '>', 0 )\n\t\t ->get();\n\t\treturn $products_of_genre;\n\t}",
"function getPreciousMetalById($id) {\n global $PRECIOUS_METAL_BY_ID_SQL;\n \n $SQL = sprintf($PRECIOUS_METAL_BY_ID_SQL, $id);\n $result = mysql_query($SQL);\n\n $metal = array();\n if (mysql_num_rows($result) == 0) {\n return $metal;\n }\n \n $row = mysql_fetch_array($result);\n \n $metal['id'] = $row['pmid'];\n $metal['name'] = $row['name'];\n $metal['symbol'] = $row['symbol'];\n $metal['unit'] = $row['unit'];\n $metal['conversionFactor'] = $row['conversionFactor'];\n \n return $metal;\n}",
"public function getProduct($id)\n {\n }",
"private function load($id = null) {\n\n if (!is_null($id)) {\n\n return $this->search->getProduct($id);\n\n }\n\n return $this->search->getProducts($this->filters);\n\n }",
"public function getById($id)\n {\n return $this->product->find($id);\n \n }",
"public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}",
"public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }",
"public function getProductInfosList(){\n return $this->_get(1);\n }",
"public function fetchMetas($ids)\n { $clause = implode(',', array_fill(0, count($ids), '?'));\n\n $stmt = $this->db->prepare(\"SELECT * FROM $this->postmeta_table WHERE post_id IN ($clause)\");\n\n //call_user_func_array(array($stmt, 'bindParam'), $ids);\n\n if ($stmt->execute($ids)) {\n $results = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $results[$row['post_id']][$row['meta_key']] = $row['meta_value'];\n }\n return $results;\n }\n }",
"protected function getMetas(): array\n {\n return $this->metas;\n }",
"public function getProduct($id)\n {\n $data = ProductPhase::where('product_id', $id)->get();\n return $data;\n }",
"function get_product($id) {\n $query = $this->db->where('id', $id)->get('product');\n return $query->result_array();\n }",
"function particularproductlist($id)\n\t{\n\t\t$getParproduct=\"SELECT * from product_category where ptdcatgry_id = $id\";\n\t\t$product_data=$this->get_results( $getParproduct );\n\t\treturn $product_data;\n\t}",
"function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }",
"private function getProducts() {\n\n $products = [];\n\n $args = array(\n 'post_type' => 'product'\n );\n $loop = new WP_Query( $args );\n if ( $loop->have_posts() ) {\n while ( $loop->have_posts() ) :\n $loop->the_post();\n $product = new Product();\n $product->setTitle(get_the_title());\n $product->setId(get_the_ID());\n $products[] = $product;\n endwhile;\n }\n wp_reset_postdata();\n\n return $products;\n }",
"function ciniki_merchandise_web_productLoad($ciniki, $tnid, $args) {\n \n $strsql = \"SELECT ciniki_merchandise.id, \"\n . \"ciniki_merchandise.uuid, \"\n . \"ciniki_merchandise.name, \"\n . \"ciniki_merchandise.permalink, \"\n . \"ciniki_merchandise.flags, \"\n . \"ciniki_merchandise.primary_image_id, \"\n . \"'' AS primary_image_caption, \"\n . \"ciniki_merchandise.synopsis, \"\n . \"ciniki_merchandise.description \"\n . \"FROM ciniki_merchandise \"\n . \"WHERE ciniki_merchandise.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n if( isset($args['permalink']) && $args['permalink'] != '' ) {\n $strsql .= \"AND ciniki_merchandise.permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \";\n } elseif( isset($args['id']) && $args['id'] > 0 ) {\n $strsql .= \"AND ciniki_merchandise.id = '\" . ciniki_core_dbQuote($ciniki, $args['id']) . \"' \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.27', 'msg'=>'No product specified'));\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'product');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.28', 'msg'=>'Product not found', 'err'=>$rc['err']));\n }\n if( !isset($rc['product']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.29', 'msg'=>'Unable to find Product'));\n }\n $product = $rc['product'];\n\n //\n // Get the images\n //\n if( isset($args['images']) && $args['images'] == 'yes' ) {\n $strsql = \"SELECT id, \"\n . \"name AS title, \"\n . \"permalink, \"\n . \"flags, \"\n . \"image_id, \"\n . \"description \"\n . \"FROM ciniki_merchandise_images \"\n . \"WHERE product_id = '\" . ciniki_core_dbQuote($ciniki, $product['id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(\n array('container'=>'images', 'fname'=>'id', 'fields'=>array('id', 'title', 'permalink', 'flags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['images']) ) {\n $product['images'] = $rc['images'];\n } else {\n $product['images'] = array();\n }\n if( $product['primary_image_id'] > 0 ) {\n $found = 'no';\n foreach($product['images'] as $image) {\n if( $image['image_id'] == $product['primary_image_id'] ) {\n $found = 'yes';\n }\n }\n if( $found == 'no' ) {\n array_unshift($product['images'], array('title'=>'', 'flags'=>1, 'permalink'=>$product['uuid'], 'image_id'=>$product['primary_image_id'], 'description'=>''));\n }\n }\n }\n\n return array('stat'=>'ok', 'product'=>$product);\n}",
"public function getSpecific()\n {\n $qb = $this->em->createQueryBuilder();\n $results = $qb->select('p')\n ->from('Plugin\\DoctrineExample\\Entity\\Product', 'p')\n ->orderBy('p.title', 'ASC')->getQuery()->execute();\n return $results;\n }",
"private function loadAll() {\n\n return $this->search->getProducts();\n\n }",
"public function readProductosMarcas()\n {\n $sql = 'SELECT nombre, id_producto, imagen_producto,producto, descripcion, precio\n FROM producto INNER JOIN marca USING(id_marca)\n WHERE id_marca = ? \n ORDER BY producto';\n $params = array($this->nombre);\n return Database::getRows($sql, $params);\n }",
"public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }",
"public function getAll()\n {\n if (Auth::user()->id_role == 1) \n {\n $company_id = GetSession::getCompanyId();\n }elseif(Auth::user()->id_role == 2)\n {\n $company_id = Auth::user()->id_company;\n }\n \n return Product::where('id_company', $company_id)->orderBy('created_at','desc')->get();\n }",
"public function index() {\n\t\treturn $this->product->all();\n\t}",
"public function all()\n {\n return Product::orderBy('id', 'desc')->get();\n \n }",
"public function show($id)\n {\n return $product->load('reticles');\n }",
"public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }",
"public static function fetch_all_product_ids() {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$product_ids = $wpdb->get_results( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'product' AND post_status = 'publish';\" );\r\n\r\n\t\t\treturn $product_ids;\r\n\t\t}"
]
| [
"0.61366117",
"0.5819989",
"0.58198357",
"0.581712",
"0.5810902",
"0.5800615",
"0.5780671",
"0.57743186",
"0.5771443",
"0.57713085",
"0.5757353",
"0.57418656",
"0.5723199",
"0.5714585",
"0.5708035",
"0.5689784",
"0.5682461",
"0.56792915",
"0.56739163",
"0.56724083",
"0.5668427",
"0.5659673",
"0.56554776",
"0.5647728",
"0.5640408",
"0.5639187",
"0.56271994",
"0.56178087",
"0.5615982",
"0.5613348"
]
| 0.7990064 | 0 |
get profile by term id | public function getProfileByTerm($term_id){
$term_id = intval($term_id);
$profiles = self::model()->findAllByAttributes(array('term_id'=>$term_id));
return $profiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_term_by_id_only($term, $output = OBJECT, $filter = 'raw') \n{\n global $wpdb;\n $null = null;\n\n if(empty($term)) \n {\n $error = new WP_Error('invalid_term', __('Empty Term'));\n return $error;\n }\n\n if (is_object($term) && empty($term->filter)) \n {\n wp_cache_add($term->term_id, $term, 'my_custom_queries');\n $_term = $term;\n } \n else \n {\n if (is_object($term)) $term = $term->term_id;\n $term = (int) $term;\n if (!$_term = wp_cache_get($term, 'my_custom_queries')) \n {\n $_term = $wpdb->get_row( $wpdb->prepare( \"SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id = %s LIMIT 1\", $term) );\n if(!$_term) return $null;\n wp_cache_add($term, $_term, 'my_custom_queries');\n }\n }\n\n if ( $output == OBJECT ) \n {\n return $_term;\n } \n else if ($output == ARRAY_A) \n\t{\n $__term = get_object_vars($_term);\n return $__term;\n } \n else if ( $output == ARRAY_N ) \n {\n $__term = array_values(get_object_vars($_term));\n return $__term;\n } \n else \n {\n return $_term;\n }\n}",
"static function getProfile($profile_id)\n\t{\n\t\t$profile = ORM::for_table('PROFILE')->where('profile_id', $profile_id)->find_array();\n\n\t\treturn $profile;\n\t}",
"function get_sample_type_info($sample_type_id, $term) { \r\n\t\tglobal $db;\r\n\t\t$query = \"SELECT * from sample_types WHERE sample_type_id='\".$sample_type_id.\"'\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t$row = $result->fetch_array();\r\n\t\treturn $row[$term];\r\n\t}",
"function get_laboratorist_info($laboratorist_id, $term) { \r\n\t\tglobal $db;\r\n\t\t$query = \"SELECT * from laboratorist WHERE laboratorist_id='\".$laboratorist_id.\"'\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t$row = $result->fetch_array();\r\n\t\treturn $row[$term];\r\n\t}",
"function getProfile($id){\n return $this->activity_model->fetchProfile($id)->row();;\n }",
"public function selectTerm($termID)\n {\n $qq = 'sc';\n $this->sdb->prepare($qq,\n 'select\n id, type, value, uri, description\n from vocabulary where $1=id');\n $result = $this->sdb->execute($qq, array($termID));\n $row = $this->sdb->fetchrow($result);\n $this->sdb->deallocate($qq);\n return $row;\n }",
"public function getTaxonomyTerm($id, $taxonomy);",
"public function getStudentById($id, $term)\n {\n $id = trim($id);\n\n if (!isset($id) || empty($id) || $id == '') {\n throw new InvalidArgumentException('Missing Banner id. Please enter a valid Banner ID (nine digits).');\n }\n\n if (strlen($id) > 9 || strlen($id) < 9 || !preg_match(\"/^[0-9]{9}$/\", $id)) {\n throw new InvalidArgumentException('That was not a valid Banner ID. Please enter a valid Banner ID (nine digits).');\n }\n\n $student = new Student();\n\n $soap = SOAP::getInstance(UserStatus::getUsername(), UserStatus::isAdmin()?(SOAP::ADMIN_USER):(SOAP::STUDENT_USER));\n $soapData = $soap->getStudentProfile($id, $term);\n\n if ($soapData->error_num == 1101 && $soapData->error_desc == 'LookupStudentID') {\n PHPWS_Core::initModClass('hms', 'exception/StudentNotFoundException.php');\n throw new StudentNotFoundException('No matching student found.');\n }elseif (isset($soapData->error_num) && $soapData->error_num > 0) {\n //test($soapData,1);\n throw new SOAPException(\"Error while accessing SOAP interface: {$soapData->error_desc} ({$soapData->error_num})\", $soapData->error_num, 'getStudentProfile', array($id, $term));\n }\n\n SOAPDataProvider::plugSOAPData($student, $soapData);\n\n //SOAPDataProvider::applyExceptions($student);\n require_once(PHPWS_SOURCE_DIR . SOAP_DATA_OVERRIDE_PATH);\n $dataOverride = new SOAPDataOverride();\n $dataOverride->applyExceptions($student);\n\n $student->setDataSource(get_class($this));\n\n return $student;\n }",
"function get_primaryTermName($taxonomy,$id) {\n $primary_term = new WPSEO_Primary_Term($taxonomy,$id); \n $term = get_term_by('id',$primary_term->get_primary_term(),$taxonomy);\n return $term->name; \n}",
"public function getTermName($id) {\n $term = Term::load($id);\n return $term->getName();\n }",
"public function getProfile($userid);",
"public function termId() { return $this->post->term_id; }",
"public function showId($id)\n {\n $profiles = Profiles::where('profile_id', $id)->get();\n return $profiles;\n }",
"public function show($id)\n {\n return $this->profileRepository->find($id);\n }",
"public static function resolve_term_object($id, \\WPGraphQL\\AppContext $context)\n {\n }",
"function get_the_show_term( $post_id ) {\n $terms = wp_get_object_terms($post_id, 'shows');\n if ( !is_wp_error($terms) && isset($terms[0]) ) {\n return $terms[0];\n }\n return false;\n}",
"public function show($id) {\n $profile = Profile::where(\"profile_id\", $id)->with(\"placuser\")->first();\n return $profile;\n }",
"function retrieve_profile_publication($id)\r\n {\r\n $pmdm = ProfilerDataManager :: get_instance();\r\n return $pmdm->retrieve_profile_publication($id);\r\n }",
"function getProfileUser($id) {\n $this->load->model('Usermodel');\n print_r(json_encode($this->Usermodel->fetchProfileUser($id)));\n }",
"function get_tbl_profile($id)\n {\n return $this->db->get_where('tbl_profile',array('id'=>$id))->row_array();\n }",
"public function find($id)\n {\n $model = Term::find($id);\n\n if ($model) {\n return $model;\n }\n\n throw new ResourceNotFoundException('Term was not found.');\n }",
"public function get_name( $id ){\n\t\t\n\t\t$term = get_term( $id , $this->get_slug() );\n\t\t\n\t\tif ( $term ){\n\t\t\t\n\t\t\treturn $term->name;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn '';\n\t\t\t\n\t\t} // end if\n\t\t\n\t}",
"function getProfile($prj_id, $usr_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->getProfile($usr_id);\n }",
"function _post_format_get_term($term)\n {\n }",
"public function profile( $id )\n {\n $data = array();\n\n $curUser = UserHelper::getUserInfo();\n $userFacility = Users::with('facilityUser')->where('user_id', $id)->first();\n\n\n // get data\n $data['currentID'] = $curUser->user_id;\n $userInfo = Users::getRecordById($id);\n $data['userInfo'] = $userInfo;\n $userContact = Contact::getRecordById($id);\n $data['userContact'] = $userContact;\n $userMd = MDUsers::getRecordById($id);\n $data['userMd'] = $userMd;\n $data['profile_completeness'] = Users::computeProfileCompleteness($id);\n $data['role'] = Roles::all()->toArray();\n $data['userRole'] = getRoleByFacilityUserID($userFacility->facilityUser[0]->facilityuser_id);\n //dd($data['userRole']);\n // lovs\n $regions = Lovs::getLovs('region');\n $data['regions'] = $regions;\n $provinces = Lovs::getLovs('province');\n $data['provinces'] = $provinces;\n $citymunicipalities = Lovs::getLovs('citymunicipalities');\n $data['citymunicipalities'] = $citymunicipalities;\n\n // dd($data);\n return view($this->viewPath.'userprofile')->with($data);\n }",
"function get_term_custom( $term_id = 0 ) {\n\t$term_id = absint( $term_id );\n\tif ( ! $term_id )\n\t\t$term_id = get_the_ID();\n\n\treturn get_term_meta( $term_id );\n}",
"public function getTerm()\n\t{\n\t $year_id = $this->getYear();\n\t\t$sqlTerm = \"SELECT * FROM edu_terms WHERE NOW() >= from_date AND NOW() <= to_date AND year_id = '$year_id' AND status = 'Active'\";\n\t\t$term_result = $this->db->query($sqlTerm);\n\t\t$ress_term = $term_result->result();\n\n\t\tif($term_result->num_rows()==1)\n\t\t{\n\t\t\tforeach ($term_result->result() as $rows)\n\t\t\t{\n\t\t\t $term_id = $rows->term_id;\n\t\t\t}\n\t\t\treturn $term_id;\n\t\t}\n\t}",
"function acf_get_term($term_id, $taxonomy = '')\n{\n}",
"public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }",
"public function getItem($id = null) {\n\t \n\t if (!$id) {\n\t $id = $this->getState($this->option.\".profile.user_id\");\n\t\t}\n\t\t\n\t\t$storedId = $this->getStoreId($id);\n\t\t\n\t\tif (!isset($this->item[$storedId])) {\n\n\t\t $db = JFactory::getDbo();\n\t\t $query = $db->getQuery(true);\n\t\t $query\n\t\t ->select(\"*\")\n\t\t ->from(\"#__itpsc_profiles\")\n\t\t ->where(\"id = \" . (int)$id);\n\n\t\t $db->setQuery($query, 0, 1);\n\t\t $result = $db->loadAssoc();\n \n\t\t\t// Check published state.\n\t\t\tif (empty($result)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$this->item[$storedId] = $result;\n\t\t\t\n\t\t}\n\n\t\treturn $this->item[$storedId];\n\t}"
]
| [
"0.6048984",
"0.58989257",
"0.5848117",
"0.58226085",
"0.58089286",
"0.5793495",
"0.5746491",
"0.5742494",
"0.56389517",
"0.5634547",
"0.561424",
"0.5608936",
"0.5608586",
"0.5608173",
"0.554196",
"0.54852825",
"0.5465611",
"0.5425418",
"0.53936136",
"0.5373281",
"0.5351662",
"0.5350826",
"0.535027",
"0.534957",
"0.5342082",
"0.53354496",
"0.53352344",
"0.53313744",
"0.5317408",
"0.5313439"
]
| 0.8214183 | 0 |
Get a default directory value, if any is available | public function getDefaultDirectory(): string|null; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDefaultFolder() ;",
"public function getDefaultFolder() {}",
"public function getDefaultFolder() {}",
"public function getDirectoryVar();",
"public function getDefaultDirectoryName()\r\n {\r\n // make sure the default directory is configured\r\n $dir = $this->configuration['default_directory'];\r\n if ( array_key_exists( $dir, $this->configuration['directories'] ))\r\n {\r\n return $dir;\r\n }\r\n throw new \\Exception( \"Default directory not configured!\" );\r\n }",
"public function getDirectory(): string|null;",
"public function getUploadPathFolder($defaultPath);",
"private function getPath($default) {\n $fixedPath = ROOT_PATH.DS.trim(trim(str_replace('\\\\', DS, str_replace('/', DS, $default)),'/'),'\\\\');\n\n if (!Util::isDirectory($fixedPath, true)) {\n throw new InvalidArgumentException(\"Unable to create class at $default\");\n }\n\n return $fixedPath;\n }",
"function default_database_directory() {\n $configdir = isset($_SERVER['CONFIG_DIR']) ? $_SERVER['CONFIG_DIR'] : 'local';\n $local_default_file_path_inc = $configdir.DIRECTORY_SEPARATOR.'default-file-path.inc';\n if (file_exists($local_default_file_path_inc)) {\n try {\n @include($local_default_file_path_inc);\n } catch (Exception $e) {\n unset($default_file_path);\n }\n return isset($default_file_path) ? $default_file_path : \"\";\n }\n}",
"public function defaultOutputPath()\n {\n static $defaultPath;\n\n if ($defaultPath === null) {\n $defaultPath = sprintf(\n '%1$s/%2$s',\n $this->filterPath(static::DEFAULT_DIRNAME),\n $this->filterPath(static::DEFAULT_BASENAME)\n );\n }\n\n return $defaultPath;\n }",
"public function getDirectory() : ?string;",
"public static function get_directory(): string {\n return Simply_Static\\Options::instance()->get('local_dir') ?: '';\n }",
"public function getDefaultInstallDirectory() {\n return $this->getConfig(\"default_install_directory\");\n }",
"function get($path=null, $default=null)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t\n\t\t\tif ($path==null) return $this->settings;\n\t\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$tmp = $this->settings;\n\t\t\tforeach($path as $pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\tif (!isset($tmp[$pointer])){\n\t\t\t\t\t\treturn $default;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = $tmp[$pointer];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $tmp;\n\t\t}",
"public function getBaseDirectory()\n {\n return $this->getParam(DirectoryKeys::BASE);\n }",
"protected function get_default_root_path(): string {\n return dirname($this->nowqsPath, 4) . DIRECTORY_SEPARATOR;\n }",
"function get_directory($filebase){\n\tswitch ($filebase) {\n\t\tcase 'home':\n\t\t\treturn HOME_DIR;\n\t\t\tbreak;\n\t\tcase 'gprofile':\n\t\t\treturn GPROFILE_DIR;\n\t\t\tbreak;\n\t\tcase 'profile':\n\t\t\treturn PROFILE_DIR;\n\t\t\tbreak;\n\t\tcase 'account':\n\t\t\treturn ACCOUNT_DIR;\n\t\t\tbreak;\n\t\tcase 'search':\n\t\t\treturn SEARCH_DIR;\n\t\t\tbreak;\n\t\tcase 'stats':\n\t\t\treturn STATS_DIR;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn '/';\n\t\t\tbreak;\n\t}\n}",
"public abstract function getDirectory();",
"public static function getDefaultFolder()\n {\n return apply_filters(\n 'lf_default_views_folder',\n Loc::lolita()->baseDir() . DS . 'app' . DS . 'views' . DS\n );\n }",
"public function getDirectory(): string;",
"public function getDirectory();",
"public function getDirectory();",
"function GetDefaultLocation()\r\n{\r\n $locations = parse_ini_file('./settings/locations.ini', true);\r\n BuildLocations($locations);\r\n \r\n $def = $locations['locations']['default'];\r\n if( !$def )\r\n $def = $locations['locations']['1'];\r\n $loc = $locations[$def]['default'];\r\n if( !$loc )\r\n $loc = $locations[$def]['1'];\r\n \r\n return $locations[$loc];\r\n}",
"public function getDir(): string;",
"public function getDefaultPartialRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultPartialRootPath);\r\n }",
"public function getDefaultIndexDirectoryPath();",
"public function getDefaultFolderAttribute()\n\t{\n\t\treturn self::firstOrCreate([\n\t\t\t'posttype_id' => $this->posttype_id,\n\t\t\t'locale' => $this->locale,\n\t\t\t'slug' => \"no\",\n\t\t]);\n\n\t}",
"public function get_default_min_dir()\n\t{\n\t\t$plugin_wp_dir = trailingslashit(plugin_dir_path($this->plugin_file));\n\t\treturn $plugin_wp_dir . 'min/';\n\t}",
"public static function get_default_dirs() {\n\t\t// Always include default admin and include directories.\n\t\t$defaults = [ '/wp-admin/', '/wp-includes/' ];\n\n\t\t// Include directories set by dependencies classes if parent directory not already included.\n\t\treturn array_unique( array_merge( $defaults, (array) wp_scripts()->default_dirs, (array) wp_styles()->default_dirs ) );\n\t}",
"protected function _getDefaultImage()\n {\n $path = $this->_getImageBasePath(false)\n . self::USER_DEFAULT_IMAGE;\n\n return $path;\n }"
]
| [
"0.75598466",
"0.737822",
"0.73770374",
"0.69499046",
"0.6821692",
"0.67223114",
"0.6644269",
"0.6623192",
"0.66207135",
"0.65349984",
"0.6511435",
"0.6482287",
"0.64784783",
"0.6465363",
"0.63043064",
"0.626823",
"0.6229162",
"0.6209954",
"0.6208406",
"0.61950034",
"0.6176035",
"0.6176035",
"0.6172885",
"0.6165196",
"0.6158616",
"0.6120577",
"0.6104083",
"0.60815954",
"0.6066424",
"0.60634637"
]
| 0.78473544 | 0 |
Returns latest handled event. | public function getLastEvent()
{
return $this->_lastEvent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastEvent()\n\t{\n\t\treturn App_Model_Event_Mapper::getInstance()->getLastEventForAction($this->_actionId);\n\t}",
"final public function getLastEvent()\n\t\t{\n\n\t\t\treturn $this->getEventByTimeAlgo(\"last_event\");\n\n\t\t}",
"public function getLastEvent()\n {\n $events = $this->getEvents();\n if (count($events) > 0) {\n return $events[count($events) - 1];\n }\n\n return null;\n }",
"public function getNextEvent()\n {\n return isset($this->eventIds[$this->currentEvent]) ? $this->eventIds[$this->currentEvent] : null;\n }",
"public function getEvent(): Event\n {\n return $this->mainEvent;\n }",
"final public function getNextEvent()\n\t\t{\n\n\t\t\treturn $this->getEventByTimeAlgo(\"next_event\");\n\n\t\t}",
"public function getNextEvent()\n\t{\n\t\tif (!$this->_nextEvent || !$this->_nextEvent instanceof App_Model_Event || !$this->_nextEvent->getEventId()) {\n\t\t\t$this->_nextEvent = App_Model_Event_Mapper::getInstance()->getNextEventForAction($this->_actionId);\n\t\t}\n\n\t\treturn $this->_nextEvent;\n\t}",
"public function event()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\r\n {\r\n return $this->Event;\r\n }",
"public function getEvent() {\n return $this->event;\n }",
"public static function getLastRegisteredHandler() {\n return self::$lastRegisteredHandler;\n }",
"public function getEvent()\n {\n return $this->getData('event');\n }",
"public function getEvent()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Event']) ? $headers['X-NE-Event'] : null;\n }",
"public function getEventType()\n {\n return $this->proxyBase->eventType;\n }",
"public function getNextEvent(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t// extract the next event that will happen\n\t\t$nextEvent = array_shift($events);\n\t\tfor ($i = 1; $i < sizeof($events); $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($events[0]['is_approved'] == 1 && $events[0]['date'] > $nextEvent['date']){\n\t\t\t\t$nextEvent = $event;\n\t\t\t}\n\t\t}\n\n\t\treturn $nextEvent;\n\t}",
"public function getEventType() {\n\t\treturn ($this->eventType);\n\t}",
"public function getEvent() {\n $request = $this->getRequest();\n\n if (request('type') == 'event_callback') {\n $event = $request['event'];\n } else {\n $event = $request;\n }\n\n return $event;\n }",
"public function getLatestResultsEvent()\n\t{\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('e.*')\n\t\t\t\t->from('#__tracks_events_results AS res')\n\t\t\t\t->innerJoin('#__tracks_events AS e ON e.id = res.event_id')\n\t\t\t\t->order('modified_date DESC');\n\n\t\t\t$db->setQuery($query);\n\n\t\t\tif (!$res = $db->loadObject())\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$entity = TrackslibEntityEvent::getInstance($res->id);\n\n\t\t\treturn $entity->bind($res);\n\t}",
"public function followingEvent()\n {\n return Event::where('starts_at', '>=', $this->ends_at)\n ->where('type', '=', Event::MEETUP)\n ->first();\n }",
"public function current()\n {\n return \\current($this->events);\n }",
"public function getEventId() {\n\t\treturn ($this->eventId);\n\t}",
"protected function getEvent()\n {\n if (null === $this->event) {\n $this->event = $event = new EntityEvent;\n\n $event->setTarget($this);\n }\n\n return $this->event;\n }",
"abstract public function getEventName();",
"public function getEventName() {\n\t\treturn ($this->eventName);\n\t}",
"public function getEventId()\n {\n return $this->eventId;\n }",
"function get_event(){\n\t\tglobal $EM_Event;\n\t\tif( is_object($EM_Event) && $EM_Event->event_id == $this->event_id ){\n\t\t\treturn $EM_Event;\n\t\t}else{\n\t\t\tif( is_numeric($this->event_id) && $this->event_id > 0 ){\n\t\t\t\treturn em_get_event($this->event_id, 'event_id');\n\t\t\t}elseif( is_array($this->bookings) ){\n\t\t\t\tforeach($this->bookings as $EM_Booking){\n\t\t\t\t\t/* @var $EM_Booking EM_Booking */\n\t\t\t\t\treturn em_get_event($EM_Booking->event_id, 'event_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn em_get_event($this->event_id, 'event_id');\n\t}"
]
| [
"0.7083937",
"0.68813014",
"0.67795074",
"0.64995176",
"0.6392295",
"0.6388409",
"0.6358545",
"0.62646884",
"0.6257622",
"0.61114824",
"0.61114824",
"0.61114824",
"0.6091731",
"0.6026872",
"0.60109454",
"0.5905975",
"0.5821422",
"0.5802755",
"0.5799888",
"0.5789211",
"0.5692925",
"0.5692391",
"0.56808734",
"0.5642757",
"0.5622639",
"0.5621213",
"0.5593583",
"0.5570566",
"0.5563389",
"0.5528281"
]
| 0.7270454 | 0 |
RemoveDuplicatedLines This function removes all duplicated lines of the given text file. | function RemoveDuplicatedLines($Filepath, $IgnoreCase=false, $NewLine="\n"){
if (!file_exists($Filepath)){
$ErrorMsg = 'RemoveDuplicatedLines error: ';
$ErrorMsg .= 'The given file ' . $Filepath . ' does not exist!';
die($ErrorMsg);
}
$Content = file_get_contents($Filepath);
$Content = RemoveDuplicatedLinesByString($Content, $IgnoreCase, $NewLine);
// Is the file writeable?
if (!is_writeable($Filepath)){
$ErrorMsg = 'RemoveDuplicatedLines error: ';
$ErrorMsg .= 'The given file ' . $Filepath . ' is not writeable!';
die($ErrorMsg);
}
// Write the new file
$FileResource = fopen($Filepath, 'w+');
fwrite($FileResource, $Content);
fclose($FileResource);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RemoveDuplicatedLinesByString($Lines, $IgnoreCase=false, $NewLine=\"\\n\"){\n if (is_array($Lines))\n $Lines = implode($NewLine, $Lines);\n $Lines = explode($NewLine, $Lines);\n $LineArray = array();\n $Duplicates = 0;\n // Go trough all lines of the given file\n for ($Line=0; $Line < count($Lines); $Line++){\n // Trim whitespace for the current line\n $CurrentLine = trim($Lines[$Line]);\n // Skip empty lines\n if ($CurrentLine == '')\n continue;\n // Use the line contents as array key\n $LineKey = $CurrentLine;\n if ($IgnoreCase)\n $LineKey = strtolower($LineKey);\n // Check if the array key already exists,\n // if not add it otherwise increase the counter\n if (!isset($LineArray[$LineKey]))\n $LineArray[$LineKey] = $CurrentLine; \n else \n $Duplicates++;\n }\n // Sort the array\n //asort($LineArray);\n // Return how many lines got removed\n return implode($NewLine, array_values($LineArray)); \n}",
"public function remove_lines( $file ) {\n\t\tif ( is_dir( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_code_file( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$plugin_dir = dirname( app()->plugin_file );\n\n\t\t$relative_file = ltrim( str_replace( $plugin_dir, '', $file ), '/' );\n\n\t\tif ( ! in_array( $relative_file, array_keys( $this->line_removals ), true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$lines = $this->line_removals[ $relative_file ];\n\n\t\t$file_content_array = $this->fs->get_contents_array( $file );\n\n\t\tforeach ( $lines as $line ) {\n\t\t\tif ( ! isset( $file_content_array[ $line ] ) ) {\n\t\t\t\tthrow new \\Exception( \"{$line} is not in {$file}.\" );\n\t\t\t}\n\n\t\t\t// Remove that line.\n\t\t\tunset( $file_content_array[ $line - 1 ] );\n\t\t}\n\n\t\tif ( ! $this->dryrun ) {\n\t\t\t// @codingStandardsIgnoreLine: We want this, it's cheap and works with an array.\n\t\t\tfile_put_contents( $file, $file_content_array );\n\t\t}\n\t}",
"public function cleanDuplicates( );",
"protected function removeDuplicates(): void\n {\n $this->startTiming();\n\n $this->logInfo('Removing duplicates...');\n\n $this->list = array_unique($this->list);\n\n $this->endTiming();\n }",
"function stripLines( $lines ) {\n return array_filter(\n array_map( 'trim',\n preg_replace( '/#.*$/', '',\n $lines ) ) );\n}",
"private static function skip_empty_lines( $file ) {\n $str = file_get_contents( $file );\n $str = preg_replace( \"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\" , \"\\n\" , $str );\n\n file_put_contents( $file, $str );\n }",
"private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}",
"function delete_duplicates_from_db() {\n //TODO: possibly log or flag the file duplication.\n //it could be 2 physical files in different folders!\n //Somehow signal that case.\n\n $result = $this->pdo->query('DELETE FROM files WHERE rowid NOT IN (\n SELECT MIN(rowid) FROM files GROUP BY filename, md5_sign)');\n $results = $result->rowCount();\n\n return true;\n }",
"public function flush()\n {\n $f = fopen($this->file, 'w');\n\n foreach ($this->duplicates as $hash => $similarFiles) {\n $lines = implode(\"\\r\\n\", $similarFiles) . \"\\r\\n\\r\\n\";\n fwrite($f, $lines);\n }\n\n fclose($f);\n }",
"private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }",
"private function DeleteFirstLine() {\r\n\t\t$handle = fopen($this->results_file, \"r\");\r\n\t\t$first = fgets($handle,2048); \r\n\t\t$outfile=\"temp.txt\";\r\n\t\t$o = fopen($outfile,\"w\");\r\n\t\twhile (!feof($handle)) {\r\n\t\t\t$buffer = fgets($handle,2048);\r\n\t\t\tfwrite($o,$buffer);\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t\tfclose($o);\r\n\t}",
"public static function removeHashFromLines(array $lines): array\n {\n $mark = self::getMarkMd5();\n $pattern = sprintf('/^%s(?<hash>.*)$/', preg_quote($mark, '/'));\n if (!empty($lines) && preg_match($pattern, end($lines))===1)\n {\n array_pop($lines);\n $lines = self::removeEmptyTrainingLines($lines);\n }\n\n return $lines;\n }",
"function striplinesfromcsv($numberoflines,$filename) {\r\n\t\t\r\n\t\t$fileName = 'nightlies/'.$filename;\r\n\t\t$a = preg_replace(\"/^(.*?\\n){0,$numberoflines}/\",'', file_get_contents($fileName));\r\n\t\t$b = fopen($fileName, 'w');\r\n\t\tfwrite($b, $a);\r\n\t\tfclose($b);\r\n\t\t\r\n\t\t//$filename = 'nightlies/'.$filename;\t\t\r\n\t\t//$file = file($filename);\r\n\t\t//file_put_contents($filename, implode(\"\\n\", array_slice($file, $numberoflines)));\r\n\t\t\r\n\t\techo \" > > > Stripping \".$numberoflines.\" lines from '\".$filename.\"' <br>\";\r\n\t}",
"public static function remove_row( $name, $file ) {;\n $content = file_get_contents( $file );\n $content = str_replace( $name.'.php', '' , $content );\n\n file_put_contents( $file, $content );\n self::skip_empty_lines( $file);\n }",
"public function remove_duplicates($array) {\n\n // Just the first row\n $header = $array[0];\n // We don't want to filter the header\n $data = array_slice($array, 1);\n\n // Get an array of the LEVEL column indices, ordered properly.\n // See function for details.\n $ordered_levels = array_keys(self::ordered_columns_of_type($header, 1));\n\n // Our hash table for detecting duplicates.\n $hash_table = array();\n\n // The number of duplicates.\n $num_duplicates = 0;\n\n // Loop through the data, adding each row to a hash table.\n // If a hash is already encountered, it means the item is a duplicate.\n foreach ($data as $m => $row) {\n $hash = '';\n foreach ($ordered_levels as $n) {\n $hash .= '->' . $row[$n];\n }\n\n // If the array key exists already, that means this item is a duplicate.\n // Increment the counter and remove this row from the dataset.\n if (array_key_exists($hash, $hash_table)) {\n $num_duplicates++;\n unset($data[$m]);\n } else {\n $hash_table[$hash] = 1;\n }\n }\n\n // Let the user know that the duplicate rows have been deleted.\n if ($num_duplicates > 0) {\n $text = \" rows identified as duplicate items have been removed from your dataset.\";\n if ($num_duplicates == 1) {\n $text = \" row identified as a duplicate item has been removed from your dataset.\";\n }\n $this->notifier->add($num_duplicates . $text, 'warning', 111);\n }\n\n // Prepend the header row back on and then return it.\n array_unshift($data, $header);\n return $data;\n }",
"public static function removeEmptyLines($text)\n {\n return preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n }",
"private function _deleteLine(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n $line = $tokens[$stackPtr]['line'];\n\n $phpcsFile->fixer->beginChangeset();\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i--) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i++) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n $phpcsFile->fixer->endChangeset();\n\n }",
"public function removeLines($start, $numLines=1) {\r\n $arr = $this->toArray();\r\n array_splice($arr, $start, $numLines);\r\n $this->contents = implode(\"\\n\", $arr);\r\n }",
"private function _deleteExtraLines()\n {\n foreach ($this->_currentLines as $lineId => $lineModel) {\n if (in_array($lineId, $this->_newLineIds) === true) {\n continue;\n }\n\n $lineModel->delete();\n unset($this->_currentLines[$lineId]);\n }\n\n return $this;\n }",
"public function deleteLine($line) {\r\n\t\tif ($this->exists && $line !== null) {\r\n\t\t\t$lineData = $this->readByLine ();\r\n\t\t\t\r\n\t\t\t$inodes = new iArrayList ();\r\n\t\t\tfor($y = 0; $y < sizeof ( $lineData ); $y ++) {\r\n\t\t\t\t$inodes->add_iNode ( new iNode ( $lineData [$y], null, null, null ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$inodes->removeNode ( $line );\r\n\t\t\t\r\n\t\t\t$this->clearFile ();\r\n\t\t\t\r\n\t\t\tfor($y = 0; $y < $inodes->count; $y ++) {\r\n\t\t\t\t$this->writeToFile ( $inodes->getNode ( $y )->Data1 );\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$inodes->__destruct ();\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function loadHistory(string $path): void {\n\t\t// - Read it,\n\t\t// - Remove duplicates,\n\t\t// - And save it again.\n\t\t$entries = \\file($path, \\FILE_SKIP_EMPTY_LINES | \\FILE_IGNORE_NEW_LINES);\n\t\t$fixed = \\array_reverse(\\array_unique(\\array_reverse($entries)));\n\t\t\\file_put_contents($path, \\implode(\\PHP_EOL, $fixed));\n\n\t\t\\readline_read_history($path);\n\n\t}",
"public function delete_duplicates()\n {\n if (empty($this->params['named']['field']))\n {\n echo 'You must enter a field to work with. http://recipe-manager/ingredients/delete_duplicates/field:ingredient';\n exit();\n }\n\n $field = $this->params['named']['field'];\n\n var_dump($field);\n\n $params = array();\n $result = $this->{$this->modelClass}->find('all', $params);\n\n\n foreach ($result as $item)\n {\n $params = array(\n 'conditions' => array($this->modelClass . '.' . $field => $item[$this->modelClass][$field]), //array of conditions\n );\n $r = $this->{$this->modelClass}->find('all', $params);\n\n if (count($r) == 2)\n {\n while (count($r) > 1)\n {\n $t = array_pop($r);\n var_dump($t[$this->modelClass]['_id']);\n $this->{$this->modelClass}->delete($t[$this->modelClass]['_id']);\n }\n }\n }\n\n\n exit('done');\n }",
"private function stripDuplicates()\n\t{\n\t\t$tmp = array();\n\t\t$len = count($this->sides);\n\n\t\tfor( $c=0; $c<$len; $c++ )\n\t\t{\n\t\t\t$count = 1;\n\t\t\tfor( $d=0; $d<$len; $d++ )\n\t\t\t{\n\t\t\t\tif ( $c == $d )\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ( $this->sides[$c]->equals($this->sides[$d]) )\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $count == 1 )\n\t\t\t\tarray_push($tmp, $this->sides[$c]);\n\t\t}\n\t\t$this->sides = $tmp;\n\t}",
"function purgeLog($file, $line_end, $max_bytes, $purge_bytes) {\r\n $size = filesize($file); //Check the log file size (bytes).\r\n if($size > $max_bytes){ //If log file is too big, delete some from the beginning\r\n $temp_string = file_get_contents($file, NULL, NULL, $purge_bytes); //Load the existing log file into a temporary string except for the first x number of bytes\r\n $temp_string = strstr($temp_string, $line_end); //Remove all characters prior to the first line break\r\n $temp_string = ltrim($temp_string); //Remove the first line break\r\n file_put_contents($file, $temp_string); //Print the temporary string to the log file, overwriting previous contents of the file\r\n }\r\n}",
"public function deleteDuplicate() {\n\t\t$sql = \"DELETE FROM reestr_distinct\";\n\t\t$this->query_data($sql);\n\t\t$sql = \"INSERT INTO reestr_distinct SELECT DISTINCT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, col15, col16, col17, now(),NULL,'Бессрочно' FROM reestr\";\n\t\t$this->query_data($sql);\n\t\treturn 0;\n\t}",
"function delLineFromFile($fileName, $lineNum){\n\t\t if(!is_writable($fileName))\n\t\t\t{\n\t\t\t// print an error\n\t\t\tprint \"The file $fileName is not writable\";\n\t\t\t// exit the function\n\t\t\texit;\n\t\t\t}\n\t\t else\n\t\t\t {\n\t\t\t// read the file into an array \n\t\t\t$arr = file($fileName);\n\t\t\t}\n\n\t\t // the line to delete is the line number minus 1, because arrays begin at zero\n\t\t $lineToDelete = $lineNum-1;\n\n\t\t // check if the line to delete is greater than the length of the file\n\t\t if($lineToDelete > sizeof($arr))\n\t\t\t{\n\t\t\t // print an error\n\t\t\tprint \"You have chosen a line number, <b>[$lineNum]</b>, higher than the length of the file.\";\n\t\t\t// exit the function\n\t\t\texit;\n\t\t\t}\n\n\t\t //remove the line\n\t\t unset($arr[\"$lineToDelete\"]);\n\n\t\t // open the file for reading\n\t\t if (!$fp = fopen($fileName, 'w+'))\n\t\t\t{\n\t\t\t// print an error\n\t\t\t\tprint \"Cannot open file ($fileName)\";\n\t\t\t // exit the function\n\t\t\t\texit;\n\t\t\t\t}\n\n\t\t // if $fp is valid\n\t\t if($fp)\n\t\t\t{\n\t\t\t\t// write the array to the file\n\t\t\t\tforeach($arr as $line) { fwrite($fp,$line); }\n\n\t\t\t\t// close the file\n\t\t\t\tfclose($fp);\n\t\t\t\t}\n\n\t\t\n\t\t}",
"function deleteStringFromFile($file, $string)\n {\n $rowNumber = 0;\n $array = array();\n\n $read = fopen($file, \"r\");\n while (!feof($read)) {\n $array[$rowNumber] = fgets($read);\n ++$rowNumber;\n }\n fclose($read);\n\n $write = fopen($file, \"w\");\n foreach($array as $value) {\n if(!strstr($value, $string)) {\n fwrite($write, $value);\n }\n }\n fclose($write);\n }",
"public function remove($index)\n {\n $this->lines = \\array_diff_key($this->lines, array($index => ''));\n\n $this->write();\n }",
"public static function clearInfoConnectorsLineCache($lineId)\n\t{\n\t\t$cache = Cache::createInstance();\n\t\t$cache->clean($lineId, Library::CACHE_DIR_INFO_CONNECTORS_LINE);\n\t}",
"public function clean($file)\n {\n }"
]
| [
"0.7019022",
"0.6194791",
"0.6020027",
"0.5620988",
"0.55878454",
"0.5495907",
"0.5182459",
"0.51132655",
"0.5075179",
"0.50046223",
"0.4944887",
"0.4906421",
"0.48951763",
"0.4855937",
"0.4718631",
"0.4704232",
"0.46540707",
"0.46366915",
"0.46352515",
"0.4634059",
"0.4608613",
"0.46069235",
"0.45714766",
"0.45466718",
"0.45258805",
"0.449751",
"0.44607887",
"0.44550186",
"0.44521806",
"0.44511175"
]
| 0.68688625 | 1 |
RemoveDuplicatedLinesByString This function removes all duplicated lines of the given string. | function RemoveDuplicatedLinesByString($Lines, $IgnoreCase=false, $NewLine="\n"){
if (is_array($Lines))
$Lines = implode($NewLine, $Lines);
$Lines = explode($NewLine, $Lines);
$LineArray = array();
$Duplicates = 0;
// Go trough all lines of the given file
for ($Line=0; $Line < count($Lines); $Line++){
// Trim whitespace for the current line
$CurrentLine = trim($Lines[$Line]);
// Skip empty lines
if ($CurrentLine == '')
continue;
// Use the line contents as array key
$LineKey = $CurrentLine;
if ($IgnoreCase)
$LineKey = strtolower($LineKey);
// Check if the array key already exists,
// if not add it otherwise increase the counter
if (!isset($LineArray[$LineKey]))
$LineArray[$LineKey] = $CurrentLine;
else
$Duplicates++;
}
// Sort the array
//asort($LineArray);
// Return how many lines got removed
return implode($NewLine, array_values($LineArray));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RemoveDuplicatedLines($Filepath, $IgnoreCase=false, $NewLine=\"\\n\"){\n if (!file_exists($Filepath)){\n $ErrorMsg = 'RemoveDuplicatedLines error: ';\n $ErrorMsg .= 'The given file ' . $Filepath . ' does not exist!';\n die($ErrorMsg);\n }\n $Content = file_get_contents($Filepath);\n $Content = RemoveDuplicatedLinesByString($Content, $IgnoreCase, $NewLine);\n // Is the file writeable?\n if (!is_writeable($Filepath)){\n $ErrorMsg = 'RemoveDuplicatedLines error: ';\n $ErrorMsg .= 'The given file ' . $Filepath . ' is not writeable!'; \n die($ErrorMsg);\n }\n // Write the new file\n $FileResource = fopen($Filepath, 'w+'); \n fwrite($FileResource, $Content); \n fclose($FileResource); \n}",
"public function cleanDuplicates( );",
"function deleteStringFromFile($file, $string)\n {\n $rowNumber = 0;\n $array = array();\n\n $read = fopen($file, \"r\");\n while (!feof($read)) {\n $array[$rowNumber] = fgets($read);\n ++$rowNumber;\n }\n fclose($read);\n\n $write = fopen($file, \"w\");\n foreach($array as $value) {\n if(!strstr($value, $string)) {\n fwrite($write, $value);\n }\n }\n fclose($write);\n }",
"private function _noLineBreaks($string) {\n\t\treturn preg_replace( \"/\\r|\\n/\", \" \", $string);\n\t}",
"public static function removeLineBreaks( $string ) {\n\t\t\treturn str_replace( array ( chr( 10 ), chr( 13 ) ), '', $string );\n\t\t}",
"public static function arrayRemoveDuplicates(&$s)\n {\n $found = [];\n $j = 0;\n foreach ($s as $i => $x) {\n if (!isset($found[$x])) {\n $found[$x] = true;\n $s[$j] = $s[$i];\n ++$j;\n }\n }\n $s = \\array_slice($s, 0, $j);\n }",
"function remove_empty_lines($str) {\n\t\t\treturn preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $str);\n\t\t}",
"function stripLines( $lines ) {\n return array_filter(\n array_map( 'trim',\n preg_replace( '/#.*$/', '',\n $lines ) ) );\n}",
"protected function removeComments($str){\n\t\t$res = array();\n\t\tforeach(preg_split(\"/\\n/\", $str) as $line){\n\t\t\tif(isset($line[0]) && $line[0]!==\"#\")\n\t\t\t\t$res[] = $line;\n\t\t}\n\t\treturn implode(\"\\n\",$res);\n\t}",
"public static function maintain_multiline($string)\n {\n if (strpos($string, \"\\n\") !== false) {\n return array('type' => 'multiline', 'lines' => explode(\"\\n\", $string));\n }\n else {\n return $string;\n }\n }",
"function reduce_string($str)\n {\n $str = preg_replace(array(\n\n // eliminate single line comments in '// ...' form\n '#^\\s*//(.+)$#m',\n\n // eliminate multi-line comments in '/* ... */' form, at start of string\n '#^\\s*/\\*(.+)\\*/#Us',\n\n // eliminate multi-line comments in '/* ... */' form, at end of string\n '#/\\*(.+)\\*/\\s*$#Us'\n\n ), '', $str);\n\n // eliminate extraneous space\n return trim($str);\n }",
"function reduce_string($str)\n {\n $str = preg_replace(array(\n\n // eliminate single line comments in '// ...' form\n '#^\\s*//(.+)$#m',\n\n // eliminate multi-line comments in '/* ... */' form, at start of string\n '#^\\s*/\\*(.+)\\*/#Us',\n\n // eliminate multi-line comments in '/* ... */' form, at end of string\n '#/\\*(.+)\\*/\\s*$#Us'\n\n ), '', $str);\n\n // eliminate extraneous space\n return trim($str);\n }",
"private static function breakDownStringLinesIntoArray(string $string): array\n {\n $temp = str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"\\n\", $string));\n return array_filter(explode(\"\\n\", $temp));\n }",
"private function normalizeLineEndings(string $string)\n {\n return preg_replace('~(*BSR_ANYCRLF)\\R~', \"\\n\", $string);\n }",
"protected function _reduce_string($str)\n {\n $str = preg_replace(array(\n \n // eliminate single line comments in '// ...' form\n '#^\\s*//(.+)$#m',\n \n // eliminate multi-line comments in '/* ... */' form, at start of string\n '#^\\s*/\\*(.+)\\*/#Us',\n \n // eliminate multi-line comments in '/* ... */' form, at end of string\n '#/\\*(.+)\\*/\\s*$#Us'\n \n ), '', $str);\n \n // eliminate extraneous space\n return trim($str);\n }",
"function getLines($string, $allow_empty = false)\n{\n $string = trim($string);\n $string = str_replace([\"\\r\\n\",PHP_EOL,\"<br>\",\"<br />\",\";\"], \"\\r\\n\", $string);\n\n if (!$string)\n {\n return [];\n }\n\n $string = explode(\"\\r\\n\", $string);\n foreach ($string as $i => $line)\n {\n $string[$i] = trim($line);\n if (!$allow_empty && empty($string[$i]))\n {\n unset($string[$i]);\n }\n }\n\n return $string;\n}",
"protected function stripReferences($string)\n\t{\n\t\t$pattern = '/^[ \\t]{0,3}\\[([^\\]]+)\\]\\:[ \\t]*\\<?([^\\s]+?)\\>?(?:(?:[ \\t]+|[ \\t]*\\n[ \\t]*)(\\\".+\\\"|\\(.+\\)|\\'.+\\'))?[ \\t]*$/m';\n\t\tif (preg_match_all($pattern, $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))\n\t\t{\n\t\t\tforeach (array_reverse($matches) as $match)\n\t\t\t{\n\t\t\t\t$label = strtolower($match[1][0]);\n\t\t\t\t$url = htmlentities($match[2][0]);\n\t\t\t\t$title = isset($match[3]) ? substr($match[3][0], 1, -1) : '';\n\n\t\t\t\t$this->references[$label] = array(\n\t\t\t\t\t'url' => $url,\n\t\t\t\t\t'title' => $title,\n\t\t\t\t);\n\n\t\t\t\t$string = substr_replace($string, '', $match[0][1], strlen($match[0][0]) + 1);\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}",
"public function deleteDuplicate() {\n\t\t$sql = \"DELETE FROM reestr_distinct\";\n\t\t$this->query_data($sql);\n\t\t$sql = \"INSERT INTO reestr_distinct SELECT DISTINCT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, col15, col16, col17, now(),NULL,'Бессрочно' FROM reestr\";\n\t\t$this->query_data($sql);\n\t\treturn 0;\n\t}",
"protected function removeDuplicates(): void\n {\n $this->startTiming();\n\n $this->logInfo('Removing duplicates...');\n\n $this->list = array_unique($this->list);\n\n $this->endTiming();\n }",
"protected static function trim($string) {\n\t\t$string = preg_replace('/^(\\s*\\n)+/', '', $string);\n\t\t$string = preg_replace('/(\\s*\\n)+$/', '', $string);\n\t\treturn $string;\n\t}",
"function No_new_Line($string){\n \n return str_replace(\"'\",\"' + \" . '\"' . \"'\" . '\"' . \" + '\",str_replace(\"\\n\",\"\",$string));\n \n }",
"public function clean($string)\n {\n // strip all tab indentation and newlines, replace with spaces\n $string = preg_replace(\"/[\\r|\\n|\\t]/m\", \" \", $string);\n \n // strip all empty lines\n $string = preg_replace(\"/^[\\s]*$[\\r\\n]*/m\", \" \", $string);\n \n // strip all excess whitespace\n $string = preg_replace(\"/ +/m\", \" \", $string);\n \n // trim remainder\n return trim($string);\n }",
"public static function removeRepeatWords($str) {\n\t\treturn preg_replace ( \"/s(w+s)1/i\", \"$1\", $str );\n\t}",
"public function remove_duplicates($array) {\n\n // Just the first row\n $header = $array[0];\n // We don't want to filter the header\n $data = array_slice($array, 1);\n\n // Get an array of the LEVEL column indices, ordered properly.\n // See function for details.\n $ordered_levels = array_keys(self::ordered_columns_of_type($header, 1));\n\n // Our hash table for detecting duplicates.\n $hash_table = array();\n\n // The number of duplicates.\n $num_duplicates = 0;\n\n // Loop through the data, adding each row to a hash table.\n // If a hash is already encountered, it means the item is a duplicate.\n foreach ($data as $m => $row) {\n $hash = '';\n foreach ($ordered_levels as $n) {\n $hash .= '->' . $row[$n];\n }\n\n // If the array key exists already, that means this item is a duplicate.\n // Increment the counter and remove this row from the dataset.\n if (array_key_exists($hash, $hash_table)) {\n $num_duplicates++;\n unset($data[$m]);\n } else {\n $hash_table[$hash] = 1;\n }\n }\n\n // Let the user know that the duplicate rows have been deleted.\n if ($num_duplicates > 0) {\n $text = \" rows identified as duplicate items have been removed from your dataset.\";\n if ($num_duplicates == 1) {\n $text = \" row identified as a duplicate item has been removed from your dataset.\";\n }\n $this->notifier->add($num_duplicates . $text, 'warning', 111);\n }\n\n // Prepend the header row back on and then return it.\n array_unshift($data, $header);\n return $data;\n }",
"public static function cleanString(string $string): string\n {\n $string = preg_replace('/[\\t]+/', ' ', $string);\n $string = preg_replace('/\\r\\n|\\r|\\n/', '\\n', $string);\n\n return $string;\n }",
"private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}",
"public static function removeHashFromLines(array $lines): array\n {\n $mark = self::getMarkMd5();\n $pattern = sprintf('/^%s(?<hash>.*)$/', preg_quote($mark, '/'));\n if (!empty($lines) && preg_match($pattern, end($lines))===1)\n {\n array_pop($lines);\n $lines = self::removeEmptyTrainingLines($lines);\n }\n\n return $lines;\n }",
"public static function stripHtml($string)\n {\n $strippedCss = preg_replace('/<style.*<\\/style>/s', '', $string);\n $strippedJs = preg_replace('/<script.*<\\/script>/s', '', $strippedCss);\n $removedOneLineTags = preg_replace(\"/<[^>\\n]*>/mu\", '', $strippedJs);\n $removedMultiLineTags = preg_replace(\"/<a [^>]*?>/s\", '', $removedOneLineTags);\n return $removedMultiLineTags;\n }",
"public function removeCcEmail($string)\n {\n return $this->setCcEmails(\n array_diff($this->getCcEmails(), [$string])\n );\n }",
"public static function clearInfoConnectorsLineCache($lineId)\n\t{\n\t\t$cache = Cache::createInstance();\n\t\t$cache->clean($lineId, Library::CACHE_DIR_INFO_CONNECTORS_LINE);\n\t}"
]
| [
"0.59280765",
"0.5641486",
"0.54177105",
"0.5278075",
"0.52758557",
"0.5216487",
"0.5210474",
"0.5115459",
"0.50858736",
"0.50508696",
"0.50501883",
"0.50501883",
"0.49964908",
"0.49439558",
"0.48893446",
"0.48761228",
"0.4866521",
"0.48469144",
"0.48248908",
"0.48046523",
"0.4803883",
"0.47899133",
"0.47728395",
"0.47227108",
"0.4680582",
"0.4676833",
"0.46688396",
"0.4653603",
"0.46458203",
"0.46440217"
]
| 0.7064799 | 0 |
Provides unique string. Can be used to compare or aggregate charges. | public function getUniqueString(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function value(): string\n {\n return uniqid(prefix: 'dsafsdaf-');\n }",
"function cjpopups_unique_string(){\n\t$unique_string = sprintf(\n\t\t\"%04s%03s%s\", base_convert(mt_rand(0, pow(36, 4) - 1), 10, 36), base_convert(mt_rand(0, pow(36, 3) - 1), 10, 36), substr(sha1(md5(strtotime(date('Y-m-d H:i:s')))), 7, 3)\n );\n return strtoupper($unique_string);\n}",
"private static function GenerateUniqueString(): string\n {\n $returnString = \"\";\n $characterString = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n $characterStringLength = strlen($characterString) - 1;\n for ($i = 0; $i < 6; $i++) {\n $randomNumber = rand(0, $characterStringLength);\n $returnString .= substr($characterString, $randomNumber, 1);\n }\n return $returnString;\n }",
"protected function _uniqueId()\n {\n $t = explode(\" \", microtime());\n\n return sprintf(\n '%08s-%08s-%04s-%04x%04x',\n $this->_ipToHex(),\n substr(\"00000000\" . dechex($t[1]), -8),\n substr(\"0000\" . dechex(round($t[0] * 65536)), -4),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }",
"public function canonical(): string\n {\n return $this->_uuid;\n }",
"public function uniqueId(): string\n {\n return strval($this->user->id);\n }",
"protected function createConfirmString()\n {\n return md5(\\uniqid($this->getSubscriber()->getUid()));\n }",
"protected function GetUName() { return md5(uniqid(rand(),true)); }",
"private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}",
"private function generateUniqueHash()\n {\n $rand = mt_rand(0, 10000);\n $string = $this->generateRandomString();\n $hash = md5($rand . $string);\n return $hash;\n }",
"public static function getUuid(): string {\n mt_srand((double)microtime() * 10000);\n $charid = strtolower(md5(uniqid(rand(), TRUE)));\n $hyphen = chr(45);\n $uuid = substr($charid, 0, 8) . $hyphen\n . substr($charid, 8, 4) . $hyphen\n . substr($charid, 12, 4) . $hyphen\n . substr($charid, 16, 4) . $hyphen\n . substr($charid, 20, 12);\n return $uuid;\n }",
"protected function generateUUID(): string {\n return Str::uuid();\n }",
"static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }",
"private function generateUniqueFileName() :string\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"public function generateTicketCode()\n {\n return uniqid($this->ID);\n }",
"public static function getUuid(): string\n {\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4));\n }",
"protected function getUniqueString($prefix='str_')\n {\n return uniqid($prefix);\n }",
"public function getUniqueId()\n {\n return '';\n }",
"public function getUsageString(){\n\t\t$usageStr = \"\";\n\t\tswitch($this->usage){\n\t\t\tcase \"once\": $usageStr=_(\"Unique\");break;\n\t\t\tcase \"count\": $usageStr=_(\"Multiple\").\" (\".$this->usageCount.\"/\".$this->maxUsage.\")\";break;\n\t\t\tcase \"unlimited\": $usageStr=_(\"Illimité\");break;\n\t\t}\n\t\treturn $usageStr;\n\t}",
"protected function _createUniqueId()\n {\n $id = '';\n $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));\n $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));\n $id .= '.' . php_uname('n');\n\n return $id;\n }",
"public function generateUniqueId(){\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand()*mt_rand()),rand(0,24), rand(6,8));\n $this->uniqueId = \\uniqid($prefix);\n }",
"protected function generateId() : string\n {\n return '';\n\n }",
"private function generateUniqueFileName() {\r\n \r\n return md5(uniqid());\r\n }",
"private function uuid(){\n return uniqid('');\n }",
"public static function generateUniqueId()\n {\n $request = Request::createFromGlobals();\n $leftHandString = time(). '-';\n $rightHandString = '@' . $request->server->get('SERVER_NAME');\n $fillValue = bin2hex(get_current_user()) . '-' . mt_rand(1000000,9999999);\n\n $fillLength = self::MAX_LENGTH_PER_LINE - strlen($leftHandString) - strlen($rightHandString);\n if (strlen($fillValue) > $fillLength){\n $fillValue = substr($fillValue, 0, $fillLength);\n }\n\n $uniqueIdCandidate = $leftHandString . $fillValue . $rightHandString;\n $uniqueId = substr($leftHandString . $fillValue . $rightHandString, (strlen($uniqueIdCandidate) > self::MAX_LENGTH_PER_LINE) ? strlen($uniqueIdCandidate)-self::MAX_LENGTH_PER_LINE : 0);\n\n return $uniqueId;\n }",
"public function message(): string\n {\n return \"the value of $this->key must be unique within the given input.\";\n }",
"private function randomString() {\r\n\t\t\t$rand=md5(microtime(true));\r\n\t\t\treturn $rand;\r\n\t\t}",
"private function generateUniqueFileName()\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"public function generateUniqueId()\n {\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand() * mt_rand()), rand(0, 24), rand(6, 8));\n $this->uniqueId = \\uniqid($prefix);\n }",
"protected function getUniqId()\n {\n return uniqid('', true);\n }"
]
| [
"0.7504234",
"0.7376836",
"0.7351319",
"0.71266276",
"0.70953906",
"0.7089753",
"0.7088121",
"0.70299673",
"0.70288724",
"0.69950056",
"0.69773144",
"0.6973052",
"0.69697887",
"0.6964284",
"0.6929929",
"0.6928505",
"0.6916197",
"0.6910288",
"0.6862804",
"0.68600863",
"0.6855145",
"0.6842619",
"0.68391407",
"0.683674",
"0.681778",
"0.6817204",
"0.6788558",
"0.67845273",
"0.6758471",
"0.67550814"
]
| 0.83400697 | 0 |
Arrange data by activity > schools > students | public function getByActivity (){
if(empty($this->filters)){
$this->filters[] = " 1 = 1 ";
}
$f = array('a.', 'p.school_id');
$r = array('','team_id');
$totals = $this->db->Query("select type,count(*) as total from activities where ".str_replace($f, $r,implode("&&", $this->filters))." group by type");
$schools = $this->db->Query("select type,count(distinct team_id) as total from activities where ".str_replace($f, $r,implode("&&", $this->filters))." group by type");
$parts = $this->db->Query("SELECT type,COUNT(DISTINCT supporter_id) AS total FROM activities where ".str_replace($f, $r,implode("&&", $this->filters))." GROUP BY TYPE");
$out = array(
1 => array('total' => 0, 'parts' => 0, 'schools' => 0),
2 => array('total' => 0, 'parts' => 0, 'schools' => 0),
3 => array('total' => 0, 'parts' => 0, 'schools' => 0)
);
foreach ( $totals as $item) {
$out[$item['type']]['total'] = $item['total'];
}
foreach ( $schools as $item) {
$out[$item['type']]['schools'] = $item['total'];
}
foreach ( $parts as $item) {
$out[$item['type']]['parts'] = $item['total'];
}
/*
$tmp = Util::groupMultiArray($this->data,'type');
foreach ($tmp as $type => $typedata){
$out[$type]['total'] = count($typedata);
$parts = Util::groupMultiArray($typedata,'supporter_id');
$out[$type]['parts'] = count($parts);
$schools = Util::groupMultiArray($typedata,'school_id');
$out[$type]['schools'] = count($schools);
}*/
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBySchool (){\n\t\t\n\t\t$schools = array();\n\t\t\n\t\t$tmp = Util::groupMultiArray($this->data, 'school_id');\n\t\t\n\t\tforeach ($tmp as $school_id => $choicedata){\n $open_email_count = '0';\n $link_visit_open = '0';\n\t\t\tforeach ($choicedata as $choiceid => $choices){\n if(($choices['email_open'] == '1')) {\n $open_email_count++;\n }\n if(($choices['link_visit_open'] == '1')) {\n $link_visit_open++;\n }\n }\n $schools[$school_id][4] = $open_email_count;\n $schools[$school_id][5] = $link_visit_open;\n\t\t\t$activities = Util::groupMultiArray( $choicedata, 'type');\n\t\t\t\n\t\t\t$schools[$school_id][0] = count($choicedata);\n\t\t\t\t\t\t\n\t\t\tforeach ($activities as $typeid => $typedata){\n\t\t\t\t$schools[$school_id]['id'] = $school_id;\n\t\t\t\t$schools[$school_id][$typeid] = count($typedata);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tuasort($schools,'sortByActivity');\n\t\treturn $schools;\n\t}",
"protected function initialize_activities(){\n $this->initialize_activities_recursive($this->gtree->top_element); \n\n //initialize activitysortedindex\n switch($this->sort) {\n case self::SORT_COURSE :\n foreach ($this->activities as $key => $value) {\n $this->activitysortedindex[$key] = $key;\n }\n break;\n\n case self::SORT_COURSE_INCOMPLETE :\n $completes = array();\n $incompletes = array();\n foreach ($this->activities as $key => $value) {\n if ($value['incomplete']) {\n $incompletes[] = $key;\n } else {\n $completes[] = $key;\n }\n }\n foreach ($incompletes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n foreach ($completes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n break;\n\n case self::SORT_WEIGHT :\n $weights = array();\n foreach ($this->activities as $key => $value) {\n $weights[$key] = $value['weight'];\n }\n asort($weights);\n foreach ($weights as $key => $value) {\n $this->activitysortedindex[] = $key;\n }\n break;\n\n case self::SORT_WEIGHT_INCOMPLETE :\n $weights = array();\n foreach ($this->activities as $key => $value) {\n $weights[$key] = $value['weight'];\n }\n asort($weights);\n $completes = array();\n $incompletes = array();\n foreach ($weights as $key => $value) {\n if($this->activities[$key]['incomplete']) {\n $incompletes[] = $key;\n } else {\n $completes[] = $key;\n }\n }\n foreach ($incompletes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n foreach ($completes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n break;\n }\n }",
"function sort_courses()\n{\n global $CSC_courses;\n global $CSC_electives;\n global $MATH_courses;\n global $ENGL_courses;\n global $SCI_courses;\n global $MATH_electives;\n $mcore = math_required();\n $melec = math_elective();\n $core = csc_required();\n $elec = csc_elective();\n $courses = simplexml_load_file(\"course_data/courses.xml\");\n foreach( $courses as $c)\n {\n if( $c->prefix == 'CSC' && in_array($c->number, $core))\n {\n array_push($CSC_courses,$c);\n }\n elseif( $c->prefix == 'CSC' && in_array($c->number, $elec) )\n {\n array_push($CSC_electives, $c );\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $mcore))\n {\n array_push($MATH_courses, $c);\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $melec))\n {\n array_push($MATH_electives,$c);\n }\n elseif($c->prefix=='ENGL')\n {\n array_push($ENGL_courses, $c);\n }\n elseif($c->prefix=='PHYS')\n {\n array_push($SCI_courses, $c);\n }\n }\n}",
"function sortByTeacher() {\n debugPrint(\"Sort by teacher\");\n $this->ararSortedStandIns = array();\n $arStandIns = $this->oParser->oManager->getStandIns();\n foreach($arStandIns as $oStandIn) {\n // special case for Sondereinsatz: there is no original teacher\n static $sAnonTeacher;\n if(trim($oStandIn->getOriginalTeacher()) == \"\") {\n // increment by non-printables to get a unique key for the array and\n // at the same time not having anything confusing in the table\n $sAnonTeacher = $sAnonTeacher . \" \"; \n $oStandIn->setOriginalTeacher($sAnonTeacher);\n }\n\n $strOT = $oStandIn->getOriginalTeacher();\n $strST = $oStandIn->getStandInTeacher();\n $nL = intval($oStandIn->getLesson());\n\n // original teacher can be set free (\"Freisetzung\"), in this case, do not\n // overwrite already existing stand in in this lesson\n unset($oOld);\n if(isset($this->ararSortedStandIns[$strOT]) and \n isset($this->ararSortedStandIns[$strOT][$nL])) {\n $oOld = $this->ararSortedStandIns[$strOT][$nL];\n }\n // we can insert the stand in if one of the following cases is true:\n // - old stand in does not exist\n // - old one is not Freisetzung and new one is not Freisetzung\n if(!isset($oOld) or ($oOld->getTeacherTo() == \"Freis.\" and $oStandIn->getTeacherTo() != \"Freis.\")) {\n if(isset($oOld)) {\n debugPrint(\"sortByTeacher(): overwriting existing stand in\");\n debugPrint(\"old stand in was: \".var_export($oOld, true).\"\\n new stand in is: \".\n var_export($oStandIn, true));\n }\n\tdebugPrint(\"Inserting stand in \".var_export($oStandIn, true));\n $this->ararSortedStandIns[$strST][$nL] = $oStandIn;\n // also notify the original teacher that he is not in duty\n if($strOT != $strST) {\n $oNewStandIn = clone $oStandIn; // PHP5 assigns objects by reference\n // field \"Teacher to\" can be like \"Mi-27.8. / 4\"\n if(trim($oStandIn->getTeacherTo()) == \"\") {\n $oNewStandIn->setTeacherTo(\"Entfall\");\n }\n $this->ararSortedStandIns[$strOT][$nL] = $oNewStandIn;\n }\n\n } else {\n debugPrint(\"sortByTeacher(): not overwriting existing stand in with \".\n \"Freisetzung\");\n debugPrint(\"old stand in was: \".var_export($oOld, true).\"\\n new stand in was: \".\n var_export($oStandIn, true));\n }\n\n #debugPrint(\"############\\nsortByTeacher: $strST: \".print_r($this->ararSortedStandIns[$strST], true));\n if(isset($this->ararSortedStandIns[$strST])) {\n ksort($this->ararSortedStandIns[$strST]);\n }\n if(isset($this->ararSortedStandIns[$strOT])) {\n ksort($this->ararSortedStandIns[$strOT]);\n }\n }\n ksort($this->ararSortedStandIns);\n\n debugPrint(\"sortByTeacher(): finished, array is now: \".var_export($this->ararSortedStandIns, true));\n }",
"function theme_moove_order_courses_by_shortname(&$array_courses){\n\n $grouped_courses_array = array();\n $regular_courses_array = array();\n $no_regular_courses_array = array();\n $counter = 0;\n\n foreach($array_courses as $key=>&$course){\n\n $idcourse = $course->id;\n $timecreated = $this->theme_moove_get_timecreated_course($idcourse);\n $timemodified = $this->theme_moove_get_timemodified_course($idcourse);\n $categoryid = $this->theme_moove_get_course_category($idcourse);\n\n $course->timecreated = $timecreated;\n $course->timemodified = $timemodified;\n $course->categoryid = $categoryid;\n\n // Validación para cursos regulares\n if($course->categoryid >= 30001 && $course->categoryid <= 30999){\n\n array_push($regular_courses_array, $course);\n\n $explode_course_shortname = explode(\"-\", $course->shortname);\n\n // Se verifica que tenga en su nombre corto la especificación de fecha de creación\n // una vez identificada se le añade como atributo al curso\n if(count($explode_course_shortname) && preg_match(\"/^20/\", $explode_course_shortname[3])){\n $date_course = substr($explode_course_shortname[3], 0, -3);\n $course->date_course = $date_course;\n }\n\n }else{\n // Cursos no regulares\n array_push($no_regular_courses_array, $course);\n }\n }\n\n $this->array_sort_by($regular_courses_array, 'timecreated', $order = SORT_DESC);\n $this->array_sort_by($no_regular_courses_array, 'timecreated', $order = SORT_DESC);\n\n $grouped_courses_array['regular_courses'] = $regular_courses_array;\n $grouped_courses_array['no_regular_courses'] = $no_regular_courses_array;\n\n return $grouped_courses_array;\n }",
"public function getActivities()\n {\n $enrollments = Enrollment::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $enrol = Enroll::where('id', $item->enrolid)->first();\n return ['type' => 'enroll',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $enrol->courseid)->first()->fullname,\n ];\n });\n\n $completions = Completion::latest('timecompleted')->take(4)->get()->sortBy('timecompleted')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n return ['type' => 'completion',\n 'ts' => $item->timecompleted,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $item->course)->first()->fullname,\n ];\n });\n\n $grades = Grades::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $grade = DB::table('mdl_grade_items')->where('id', $item->itemid)->first();\n\n return ['type' => 'grade',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $grade->courseid)->first()->fullname,\n 'score' => $item->finalgrade,\n ];\n });\n\n\n $merged = array_merge($enrollments->toArray(), $completions->toArray(), $grades->toArray());\n\n return collect($merged)->sortByDesc('ts')->take(4)->toArray();\n }",
"function stream_results(){\r\n // \r\n //Get all the subjects that this student is taught \r\n $subjects= $this->get_student($stream, $grade, $year);\r\n //\r\n $sql= \"select student.name as name\";\r\n // \r\n //Appends every subjects name\r\n foreach ($subjects as $value) {\r\n //\r\n $sql.\"{$value}.score as $value\"; \r\n }\r\n \r\n }",
"function getStandings($allSchools){\n \n $all_records = [];\n $all_leagues = [];\n $brk = [];\n $ccc = [];\n $cra = [];\n $csc = [];\n $ecc = [];\n $fciac = [];\n $nvl = [];\n $nccc = [];\n $scc = [];\n $shr = [];\n $swc = [];\n \n $db_standings = new Database();\n //\n foreach($allSchools as $team){\n $getTeamRecord = \"CALL getRecord('$team[0]')\";\n $record = $db_standings->getData($getTeamRecord);\n $record = getRecords($record, $team);\n\n if($record['league'] == 'Berkshire'){ array_push($brk, $record); }\n elseif($record['league']=='Central Connecticut'){ array_push($ccc, $record); }\n elseif($record['league']=='Capital Region Athletic'){ array_push($cra,$record); }\n elseif($record['league']=='Constitution State'){ array_push($csc, $record); }\n elseif($record['league']=='Eastern Connecticut'){ array_push($ecc, $record); }\n elseif($record['league']=='Fairfield County Interscholastic Athletic'){ array_push($fciac, $record); }\n elseif($record['league']=='Naugatuck Valley'){ array_push($nvl, $record); }\n elseif($record['league']=='North Central Connecticut'){ array_push($nccc, $record); }\n elseif($record['league']=='Southern Connecticut'){ array_push($scc, $record); }\n elseif($record['league']=='Shoreline'){ array_push($shr, $record); }\n elseif($record['league']=='South West'){ array_push($swc, $record); }\n else{ array_push($all_records, $record); }\n\n // Sort brk arrays by overall w,l\n usort($brk,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ccc arrays by overall w,l\n usort($ccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort cra arrays by overall w,l\n usort($cra,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort csc arrays by overall w,l\n usort($csc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ecc arrays by overall w,l\n usort($ecc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort fcica arrays by overall w,l\n usort($fciac,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nccc arrays by overall w,l\n usort($nccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nvl arrays by overall w,l\n usort($nvl,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort scc arrays by overall w,l\n usort($scc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort shr arrays by overall w,l\n usort($shr,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort swc arrays by overall w,l\n usort($swc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n \n // Combine sorted divisions into all leagues array\n $all_leagues = [\n 'berkshire'=>$brk,\n 'capital region athletic'=>$cra,\n 'central connecticut'=>$ccc,\n 'constitution state'=>$csc,\n 'eastern connecticut'=>$ecc,\n 'fairfield county interscholastic athletic'=>$fciac,\n 'north central connecticut'=>$nccc,\n 'naugatuck valley'=>$nvl,\n 'shoreline'=>$shr,\n 'southern connecticut'=>$scc,\n 'south west'=>$swc\n ];\n }\n \n return $all_leagues;\n}",
"function get_uc_groups_by_school( $school_id = '', $activity_id = '', $check_ell = false, $check_at_risk = false, $grade = 'all', $post_status = 'publish', $school_year = false ) {\n\n\t$classes = get_uc_classes_by_school( $school_id, $check_ell, $check_at_risk, $grade, $post_status ) ;\n\n\tif ( count($classes) ) {\n\n\t\t$args = array(\n\t\t\t'post_type' => 'uc_group',\n\t\t\t'post_status' => $post_status,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t),\n\t\t);\n\n\t\tif ( $school_year ) {\n\t\t\t$school_year_array = get_school_year( $school_year );\n\t\t\t$args['date_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t\t'inclusive' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $classes as $class ) {\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'class',\n\t\t\t\t\t'value' => $class['value'],\n\t\t\t);\n\t\t}\n\n\t\t$wp_posts = get_posts( $args );\n\n\t\t$result = array();\n\t\tforeach ($wp_posts as $post) {\n\t\t\t$signup_id = get_post_meta( $post->ID, 'signup', true );\n\t\t\t$group_activity_id = get_post_meta( $signup_id, 'activity', true );\n\t\t\tif ( $group_activity_id == $activity_id )\n\t\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t}\n\t\treturn $result;\n\t} else\n\t\treturn false;\n}",
"protected function sortDataArray() {}",
"function sortByClass() {\n debugPrint(\"Sort by class\");\t \n $this->ararSortedStandIns = array();\n $arStandIns = $this->oParser->oManager->getStandIns();\n foreach($arStandIns as $oStandIn) {\n $strClass = $oStandIn->getClass();\n // Don't take the lessons as the indices, as there can be multiple\n // courses at the same time (e.g. elective courses)\n $this->ararSortedStandIns[$strClass][] = $oStandIn;\n usort($this->ararSortedStandIns[$strClass], \"vpSortByLesson\");\n }\n natSortKey($this->ararSortedStandIns);\n }",
"public function get_student_list_of_logged_in_parent() {\n\t\t$parent_id = $this->session->userdata('user_id');\n\t\t$parent_data = $this->db->get_where('parents', array('user_id' => $parent_id))->row_array();\n\t\t$checker = array(\n\t\t\t'parent_id' => $parent_data['id'],\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\t$students = $this->db->get_where('students', $checker)->result_array();\n\t\tforeach ($students as $key => $student) {\n\t\t\t$checker = array(\n\t\t\t\t'student_id' => $student['id'],\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->row_array();\n\n\t\t\t$user_details = $this->db->get_where('users', array('id' => $student['user_id']))->row_array();\n\t\t\t$students[$key]['student_id'] = $student['id'];\n\t\t\t$students[$key]['name'] = $user_details['name'];\n\t\t\t$students[$key]['email'] = $user_details['email'];\n\t\t\t$students[$key]['role'] = $user_details['role'];\n\t\t\t$students[$key]['address'] = $user_details['address'];\n\t\t\t$students[$key]['phone'] = $user_details['phone'];\n\t\t\t$students[$key]['birthday'] = $user_details['birthday'];\n\t\t\t$students[$key]['gender'] = $user_details['gender'];\n\t\t\t$students[$key]['blood_group'] = $user_details['blood_group'];\n\t\t\t$students[$key]['class_id'] = $enrol_data['class_id'];\n\t\t\t$students[$key]['section_id'] = $enrol_data['section_id'];\n\n\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol_data['class_id'])->row_array();\n\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol_data['section_id'])->row_array();\n\n\t\t\t$students[$key]['class_name'] = $class_details['name'];\n\t\t\t$students[$key]['section_name'] = $section_details['name'];\n\t\t}\n\t\treturn $students;\n\t}",
"function cmpSemester($a, $b) {\n \n global $semesters;\n\n // Assumption is being made on the comparison where a/b is:\n // YEAR SEMESTER_NAME DEPARTMENT COURSE_NUMBER SECTION_NUMBER\n list($a_year, $a_semester, $a_department, $a_course_number, $a_section_number) = explode(' ', $a);\n list($b_year, $b_semester, $b_department, $b_course_number, $b_section_number) = explode(' ', $b);\n\n if ($a_year != $b_year) {\n return strcmp($a_year, $b_year);\n } else if ($a_semester != $b_semester) {\n return strcmp($semesters[$a_semester], $semesters[$b_semester]);\n } else if ($a_department != $b_department) {\n return strcmp($a_department, $b_department);\n } else if ($a_course_number != $b_course_number) {\n return strcmp($a_course_number, $b_course_number);\n } else if ($a_section_number != $b_section_number) {\n return strcmp($a_section_number, $b_section_number);\n }\n\n return 0;\n}",
"function get_uc_groups_by_activity( $class_id = '', $activity_id = '', $grade = 'all', $post_status = 'publish', $school_year = false ) {\n\n\t$signup_id = get_signup( $class_id, $activity_id, $post_status );\n\n\tif ( $signup_id ) {\n\t\t$args = array(\n\t\t\t'post_type' => 'uc_group',\n\t\t\t'post_status' => $post_status,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'signup',\n\t\t\t\t\t'value' => $signup_id,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'class',\n\t\t\t\t\t'value' => $class_id,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( $school_year ) {\n\t\t\t$school_year_array = get_school_year( $school_year );\n\t\t\t$args['date_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t\t'inclusive' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$wp_posts = get_posts( $args );\n\t\t$result = array();\n\t\tforeach ($wp_posts as $post) {\n\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t}\n\t\treturn $result;\n\t} else\n\t\treturn false;\n}",
"function by_age($students, $age)\n {\n for($i=0; $i<count($students)-1; $i++)\n {\n $ages[$i] = $students[$i]['age'];\n }\n sort($ages);\n for($j=0; $j<count($students)-1; $j++)\n {\n if($ages[$age] == $students[$j]['age'])\n {\n print $students[$j]['name'] .'-'. $students[$j]['age'];\n }\n }\n }",
"private function getstudent(){\n foreach($this->students as &$student){\n $student['room'] = [];\n $student['week'] = [];\n }\n}",
"function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page='', $recordsperpage='',\n $firstinitial='', $lastinitial='', $group=NULL, $search='', $fields='', $exceptions='') {\n\n global $CFG;\n\n // make sure it works on the site course\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n\n /// For the site course, old way was to check if $CFG->allusersaresitestudents was set to true.\n /// The closest comparible method using roles is if the $CFG->defaultuserroleid is set to the legacy\n /// student role. This function should be replaced where it is used with something more meaningful.\n if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {\n if ($roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, $context)) {\n $hascap = false;\n foreach ($roles as $role) {\n if ($role->id == $CFG->defaultuserroleid) {\n $hascap = true;\n break;\n }\n }\n if ($hascap) {\n // return users with confirmed, undeleted accounts who are not site teachers\n // the following is a mess because of different conventions in the different user functions\n $sort = str_replace('s.timeaccess', 'lastaccess', $sort); // site users can't be sorted by timeaccess\n $sort = str_replace('timeaccess', 'lastaccess', $sort); // site users can't be sorted by timeaccess\n $sort = str_replace('u.', '', $sort); // the get_user function doesn't use the u. prefix to fields\n $fields = str_replace('u.', '', $fields);\n if ($sort) {\n $sort = $sort .' '. $dir;\n }\n // Now we have to make sure site teachers are excluded\n\n if ($teachers = get_course_teachers(SITEID)) {\n foreach ($teachers as $teacher) {\n $exceptions .= ','. $teacher->userid;\n }\n $exceptions = ltrim($exceptions, ',');\n\n }\n\n return get_users(true, $search, true, $exceptions, $sort, $firstinitial, $lastinitial,\n $page, $recordsperpage, $fields ? $fields : '*');\n }\n }\n }\n\n $LIKE = sql_ilike();\n $fullname = sql_fullname('u.firstname','u.lastname');\n\n $groupmembers = '';\n\n $select = \"c.contextlevel=\".CONTEXT_COURSE.\" AND \"; // Must be on a course\n if ($courseid != SITEID) {\n // If not site, require specific course\n $select.= \"c.instanceid=$courseid AND \";\n }\n $select.=\"rc.capability='moodle/legacy:student' AND rc.permission=\".CAP_ALLOW.\" AND \";\n\n $select .= ' u.deleted = \\'0\\' ';\n\n if (!$fields) {\n $fields = 'u.id, u.confirmed, u.username, u.firstname, u.lastname, '.\n 'u.maildisplay, u.mailformat, u.maildigest, u.email, u.city, '.\n 'u.country, u.picture, u.idnumber, u.department, u.institution, '.\n 'u.emailstop, u.lang, u.timezone, ul.timeaccess as lastaccess';\n }\n\n if ($search) {\n $search = ' AND ('. $fullname .' '. $LIKE .'\\'%'. $search .'%\\' OR email '. $LIKE .'\\'%'. $search .'%\\') ';\n }\n\n if ($firstinitial) {\n $select .= ' AND u.firstname '. $LIKE .'\\''. $firstinitial .'%\\' ';\n }\n\n if ($lastinitial) {\n $select .= ' AND u.lastname '. $LIKE .'\\''. $lastinitial .'%\\' ';\n }\n\n if ($group === 0) { /// Need something here to get all students not in a group\n return array();\n\n } else if ($group !== NULL) {\n $groupmembers = \"INNER JOIN {$CFG->prefix}groups_members gm on u.id=gm.userid\";\n $select .= ' AND gm.groupid = \\''. $group .'\\'';\n }\n\n if (!empty($exceptions)) {\n $select .= ' AND u.id NOT IN ('. $exceptions .')';\n }\n\n if ($sort) {\n $sort = ' ORDER BY '. $sort .' ';\n }\n\n $students = get_records_sql(\"SELECT $fields\n FROM {$CFG->prefix}user u INNER JOIN\n {$CFG->prefix}role_assignments ra on u.id=ra.userid INNER JOIN\n {$CFG->prefix}role_capabilities rc ON ra.roleid=rc.roleid INNER JOIN\n {$CFG->prefix}context c ON c.id=ra.contextid LEFT OUTER JOIN\n {$CFG->prefix}user_lastaccess ul on ul.userid=ra.userid\n $groupmembers\n WHERE $select $search $sort $dir\", $page, $recordsperpage);\n\n return $students;\n}",
"abstract public function retrieve_course_summary_data();",
"function icress_getSubject_wrapper($campus, $faculty, $subject) {\n $jadual = file_get_contents(getTimetableURL(true) . \"/list/{$campus}/{$faculty}/{$subject}.html\");\n $http_response_header or die(\"Alert_Error: Icress timeout! Please try again later.\"); \n\t\n # parse the html to more neat representation about classes\n $jadual = str_replace(array(\"\\r\", \"\\n\"), '', $jadual);\n\n\t// set error level\n\t$internalErrors = libxml_use_internal_errors(true);\n\t$htmlDoc = new DOMDocument();\n\t$htmlDoc->loadHTML($jadual);\n\t// Restore error level\n\tlibxml_use_internal_errors($internalErrors);\n\n\t$tableRows = $htmlDoc->getElementsByTagName('tr');\n\t$groups = [];\n\n\tforeach ($tableRows as $key => $row) {\n\t\tif ($key === 0 || $key === 1) {\n\t\t\tcontinue;\n\t\t}\n\t\t$tableDatas = [];\n\t\tforeach($row->childNodes as $tableData) {\n\t\t\tif (strcmp($tableData->nodeName, 'td') === 0) {\n\t\t\t\tarray_push($tableDatas, $tableData->nodeValue);\n\t\t\t}\n\t\t}\n\n\t\t$group = trim($row->childNodes[5]->nodeValue);\n\t\tarray_shift($tableDatas);\n\t\t$groups[$group][] = $tableDatas;\n\t}\n\n return $groups;\n}",
"public function schools()\n {\n $noHidden = (bool)$this->request->getQuery('no-hidden');\n $metrics = $this->getMetrics(Context::SCHOOL_CONTEXT, $noHidden);\n\n $this->set([\n '_serialize' => ['metrics'],\n 'metrics' => array_values($metrics),\n ]);\n }",
"function Assessors_Inscription_Assessors_Table_Titles($datas,$frienddatas,$submissiondatas)\n {\n return\n array_merge\n (\n array($this->B(\"No\")),\n $this->FriendsObj()->MyMod_Data_Titles($frienddatas),\n $this->SubmissionsObj()->MyMod_Data_Titles($submissiondatas),\n $this->MyMod_Data_Titles($datas),\n array(\"\")\n );\n }",
"private function format_organizer($stuff) {\n $num = 1;\n\n // Recognized activity types\n $valid = array('lesson', 'video', 'tutorial', 'lab',\n 'assignment', 'example', 'github', 'download', 'pdf');\n\n $result = '';\n foreach ($stuff as $week) {\n $number = (int) $week['num'];\n $topic = (string) $week->topic;\n\n // Collect the activities for this week\n $partial = '';\n foreach ($week->children() as $activity) {\n $type = (string) isset($activity['type']) ?\n $activity['type'] : $activity->getName();\n if (in_array($type, $valid)) {\n $item = (string) $activity;\n $name = (string) $activity['name'];\n $pdf = (string) $activity['pdf'];\n $active = ((string) $activity['active']) != 'n';\n $duedate = (string) isset($activity['duedate']) ?\n ' (due ' . $activity['duedate'] . ')' : '';\n $survey = (string) $activity['survey'];\n $link = (string) $activity['link'];\n\n // over-rides for special icons\n $icon = (string) isset($activity['icon']) ?\n $activity['icon'] : $type;\n\n $parms = array('type' => $type, 'item' => $item,\n 'name' => $name, 'typed' => ucfirst($type),\n 'duedate' => $duedate, 'pdf' => $pdf,\n 'icon' => $icon, 'survey' => $survey,\n 'ou' => $this->data['ou'],\n 'link' => $link);\n\n // replace survey code with appropriate link\n if (isset($activity['survey']))\n $parms['survey'] = $this->parser->parse('theme/_survey', $parms, true);\n\n // use external domain if so configured\n $site = (string) isset($activity['domain']) ?\n 'http://' . $activity['domain'] : '';\n $parms['site'] = $site;\n\n // generate a download link for PDF; not sure this is needed\n $download = (string) isset($activity['pdf']) ?\n $this->parser->parse('theme/_download', $parms, true) : '';\n $parms['download'] = $download;\n\t\t\t\t\t$parms['download'] = '';\t// cripple this until PDF generation in place\n\n // build the proper presentation link\n $kind = $this->organizer->kind($type, $name);\n $thelink = $this->parser->parse('theme/_show', $parms, true);\n if (!empty($link))\n $thelink = $this->parser->parse('theme/_link', $parms, true);\n if ($kind == 'md')\n $thelink = $this->parser->parse('theme/_display', $parms, true);\n\t\t\t\t\tif ($kind == 'pdf')\n $thelink = $this->parser->parse('theme/_pdf', $parms, true);\n $parms['thelink'] = $thelink;\n\n // build the optional presentation links\n $thelinks = $this->parser->parse('theme/__display', $parms, true);\n // cripple this until PDF generation in place\n //if ($kind != 'pdf')\n // $thelinks .= $this->parser->parse('theme/__pdf', $parms, true);\n $thelinks = ' | ' . $thelinks;\n if (!empty($link))\n $thelinks = '';\n $parms['thelinks'] = $thelinks;\n\n // distinguish between active or not activities\n $target = $active ? 'theme/_activity' : 'theme/_almost';\n\n // generate, finally, the single line for the organizer\n $partial .= $this->parser->parse($target, $parms, true);\n }\n }\n\n $parms = array('number' => $number, 'topic' => $topic,\n 'activities' => $partial, 'num' => $num ++);\n $result .= $this->parser->parse('theme/_week', $parms, true);\n }\n return $result;\n }",
"public function loadStudents(){\n $data=$this->studentsInRiskForThis();\n $cantidad=count($data);\n $contador=0;\n foreach($data as $fila){\n IF(Talleresdet::firstOrCreateStatic([\n 'talleres_id'=>$this->id,\n 'codalu'=>$fila['codalu'],\n ], Talleresdet::SCENARIO_BATCH ))\n $contador++; \n }\n return ['total'=>$cantidad,'contador'=>$contador];\n }",
"public function view_students()\n{\n $school =$this->getSchool(self::Admin,self::Active);\n$students =Student::where('user_id',$this->user_id())->orderBy('id','DES')->paginate(100);\n return view('home.student.index')->withS($school);\n}",
"function getStudents() {\n $students = array();\n\n // Add first student into the students array.\n $first = new Student();\n $first->surname = \"Doe\";\n $first->first_name = \"John\";\n $first->add_email('home','[email protected]');\n $first->add_email('work','[email protected]');\n $first->add_grade(65);\n $first->add_grade(75);\n $first->add_grade(55);\n $students['j123'] = $first; \n\n // Add seconde student into the students array.\n $second = new Student();\n $second->surname = \"Einstein\";\n $second->first_name = \"Albert\";\n $second->add_email('home','[email protected]');\n $second->add_email('work1','[email protected]');\n $second->add_email('work2','[email protected]');\n $second->add_grade(95);\n $second->add_grade(80);\n $second->add_grade(50);\n $students['a456'] = $second;\n\n\n // Add my info into the students array.\n $me = new Student();\n $me->surname = \"Tan\";\n $me->first_name = \"Hai Hua\";\n $me->add_email('school', '[email protected]');\n $me->add_grade(90);\n $students['b721'] = $me;\n\n\n // Add random generated students to the array\n $num = mt_rand(1, 10);\n for ($i = 0; $i < $num; ++$i) {\n $student = new Student();\n $student->surname = Helper::rand_name(10);\n $student->first_name = Helper::rand_name(10);\n $student->add_email('school', $student->first_name . '@.my.bcit.ca');\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $students['k' . mt_rand(100,999)] = $student;\n }\n\n return $students;\n }",
"public function index()\n {\n \n\n //get current date\n $today = Carbon::today();\n\n //get Authenticated user\n $user = Auth::user();\n\n //all_users\n $all_users = User::get();\n\n //get user reg code\n $reg_code = $user->registration_code;\n\n\n $student = Student::where('registration_code', '=', $reg_code)->first();\n\n $student_group = Group::where('id','=', $student->group_id)->first();\n\n $class_members = Student::where('group_id', '=', $student_group->id)->get();\n $class_members_count = Student::where('group_id', '=', $student_group->id)->count();\n\n //Attendance\n $attendance_today = Attendance::join('attendance_codes', 'attendances.attendance_code_id', '=', 'attendance_codes.id')\n ->where('student_id', '=', $student->id)\n ->where('day', '=', $today)\n ->first();\n \n\n $att_code = AttendanceCode::get();\n\n //get events\n $events = Event::where('group_id', '=', $student->group_id)->orderBy('start_date', 'desc')->paginate(3);\n\n $upcomming_events = Event::where('group_id', '=', $student->group_id)->whereDate('start_date', '>', $today)->count();\n\n $active_events = Event::where('group_id', '=', $student->group_id)->where('start_date', '<=', $today)\n ->Where('end_date', '>=', $today)->count();\n\n $expired_events = Event::where('group_id', '=', $student->group_id)->whereDate('end_date', '<', $today )->count();\n\n //Start of School statistics - school year\n //school max, min, total, count, school average\n $school_max = Grade::max('total');\n $school_min = Grade::min('total');\n $school_total = Grade::sum('total');\n $school_count = Grade::count('total');\n $school_avg = Grade::avg('total');\n\n \n //student stats - school year\n $student_max = Grade::where('student_id', '=', $student->id)->max('total');\n $student_min = Grade::where('student_id', '=', $student->id)->min('total');\n $student_total = Grade::where('student_id', '=', $student->id)->sum('total');\n $student_count = Grade::where('student_id', '=', $student->id)->count('total');\n $student_avg = Grade::where('student_id', '=', $student->id)->avg('total');\n\n //class statistics - school year\n $student_class_max = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->max('total');\n\n $student_class_min = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->min('total'); \n\n $student_class_avg = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->avg('total'); \n \n\n //School-Student-Class Statistics- school year\n $school_class_student_chart = Charts::multi('bar', 'material')\n // Setup the chart settings\n ->title(\"School-Student-Class Year Statistics\")\n // A dimension of 0 means it will take 100% of the space\n ->dimensions(0, 230) // Width x Height\n // This defines a preset of colors already done:)\n ->template(\"material\")\n ->responsive(true)\n // You could always set them manually\n // ->colors(['#2196F3', '#F44336', '#FFC107'])\n // Setup the diferent datasets (this is a multi chart)\n ->dataset('School', [$school_min,$school_max,$school_avg])\n ->dataset('Student', [$student_min,$student_max,$student_avg])\n ->dataset('Class', [$student_class_min,$student_class_max,$student_class_avg])\n // Setup what the values mean\n ->labels(['Minimum', 'Maximum', 'Average']); \n\n \n return view('/home', compact('events', 'class_members', 'all_users' , 'class_members_count','attendance_today', 'att_code',\n 'upcomming_events', 'active_events', 'expired_events', 'school_max', 'school_min', 'school_avg', 'school_class_student_chart'\n\n\n ));\n }",
"function get_group_students($groupids, $sort='ul.timeaccess DESC') {\n\n if (is_array($groupids)){\n $groups = $groupids;\n // all groups must be from one course anyway...\n $group = groups_get_group(array_shift($groups));\n } else {\n $group = groups_get_group($groupids);\n }\n if (!$group) {\n return NULL;\n }\n\n $context = get_context_instance(CONTEXT_COURSE, $group->courseid);\n return get_users_by_capability($context, 'moodle/legacy:student', 'u.*, ul.timeaccess as lastaccess', $sort, '','',$groupids, '', false);\n}",
"function get_subject_scores(\r\n string $subject,\r\n string $stream,\r\n string $exam, \r\n string $grade\r\n ): string{\r\n return \"select \" \r\n .\" student.name as name ,\"\r\n .\" score.value as score \"\r\n .\" from score \"\r\n .\" inner join allocation on score.allocation=allocation.allocation\"\r\n .\" inner join teacher on teacher.teacher= allocation.teacher\"\r\n .\" inner join subject on teacher.subject=subject.subject\"\r\n .\" inner join student on score.student= student.student\"\r\n .\" inner join progress on progress.student= student.student\" \r\n .\" inner join stage on progress.stage= stage.stage\"\r\n .\" inner join stream on stage.stream= stream.stream\"\r\n .\" inner join grade on stream.grade=grade.grade\"\r\n .\" inner join school on school.school=grade.school\"\r\n .\" inner join term on score.term= term.term\"\r\n .\" where subject.name='$subject'\"\r\n .\" AND school.id='{$this->id}'\"\r\n .\" AND term.name= '$exam'\"\r\n .\" AND stream.name='$stream'\"\r\n .\" AND grade.name= '$grade'\";\r\n }",
"public function search($params)\n {\n $query = SessionAttendance::find();\n $query->joinWith(['child', 'child.grade']);\n \n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false,\n// 'sort' => [\n// 'defaultOrder' => ['child.c_surname' => SORT_ASC, 'child.c_first_name' => SORT_ASC]\n// ]\n ]);\n \n $dataProvider->setSort([\n 'attributes' => [\n 'surnameSearch' => [\n 'asc' => ['child.c_surname' => SORT_ASC],\n 'desc' => ['child.c_surname' => SORT_DESC], \n 'default' => SORT_ASC\n ],\n 'firstNameSearch' => [\n 'asc' => ['child.c_first_name' => SORT_ASC],\n 'desc' => ['child.c_first_name' => SORT_DESC], \n 'default' => SORT_ASC\n ] \n ],\n //'defaultOrder' => [ 'child.c_first_name' => SORT_ASC]\n ]);\n \n// $dataProvider->setSort([\n// 'attributes' => [\n// 'firstNameSearch' => [\n// 'asc' => ['child.c_first_name' => SORT_ASC],\n// 'desc' => ['child.c_first_name' => SORT_DESC], \n// 'default' => SORT_DESC\n// ]\n// ]\n// ]);\n\n// $dataProvider->sort->attributes['surnameSearch'] = [\n// // The tables are the ones our relation are configured to\n// // in my case they are prefixed with \"tbl_\"\n// 'asc' => ['child.c_surname' => SORT_ASC],\n// 'desc' => ['child.c_surname' => SORT_DESC],\n// ];\n \n// $dataProvider->sort->attributes['firstNameSearch'] = [\n// // The tables are the ones our relation are configured to\n// // in my case they are prefixed with \"tbl_\"\n// 'asc' => ['child.c_first_name' => SORT_ASC],\n// 'desc' => ['child.c_first_name' => SORT_DESC],\n// ]; \n \n $dataProvider->sort->attributes['gradeSearch'] = [\n // The tables are the ones our relation are configured to\n // in my case they are prefixed with \"tbl_\"\n 'asc' => ['grade.gd_name' => SORT_ASC],\n 'desc' => ['grade.gd_name' => SORT_DESC],\n ]; \n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'sat_id' => $this->sat_id,\n 'sat_session_id' => $this->sat_session_id,\n 'sat_student_id' => $this->sat_student_id,\n 'sat_present' => $this->sat_present,\n ]);\n \n $query->andFilterWhere(['like', 'child.c_surname', $this->surnameSearch])\n ->andFilterWhere(['like', 'child.c_first_name', $this->firstNameSearch])\n ->andFilterWhere(['like', 'grade.gd_name', $this->gradeSearch]);\n\n return $dataProvider;\n }",
"function sort_members($a, $b){\n\t\t\t\t\t\t\t\t return (strtolower($a->organization) < strtolower($b->organization)) ? -1 : 1;\n\t\t\t\t\t\t\t\t}"
]
| [
"0.60964024",
"0.54600704",
"0.5420084",
"0.52236366",
"0.50539434",
"0.5053795",
"0.50533044",
"0.5020938",
"0.4981034",
"0.4952567",
"0.49342927",
"0.48563623",
"0.48418856",
"0.48338583",
"0.48278847",
"0.48257017",
"0.4785199",
"0.47564226",
"0.47513956",
"0.4739258",
"0.47103894",
"0.47033185",
"0.4699858",
"0.46971822",
"0.46904603",
"0.4686124",
"0.4675705",
"0.46667188",
"0.4665687",
"0.4664412"
]
| 0.5590284 | 1 |
Arrange data by challenge and activity Arrange data by challenge and activity | public function getByChallenge (){
$challenge = array();
$tmp = Util::groupMultiArray($this->data, 'choice');
foreach ($tmp as $choice_id => $choicedata){
if(empty($choice_id)){
continue;
}
$open_email_count = '0';
$link_visit_open = '0';
foreach ($choicedata as $choiceid => $choices){
if(($choices['email_open'] == '1')) {
$open_email_count++;
}
if(($choices['link_visit_open'] == '1')) {
$link_visit_open++;
}
}
$challenge[$choice_id][4] = $open_email_count;
$challenge[$choice_id][5] = $link_visit_open;
$activities = Util::groupMultiArray( $choicedata, 'type');
/*echo '<pre>';
print_r($choicedata);
print_r($activities );
echo '</pre>';*/
$challenge[$choice_id][0] = count($choicedata);
foreach ($activities as $typeid => $typedata){
$challenge[$choice_id][$typeid] = count($typedata);
}
}
return $challenge; //uasort($challenge,'sortByActivity');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function sortDataArray() {}",
"protected function initialize_activities(){\n $this->initialize_activities_recursive($this->gtree->top_element); \n\n //initialize activitysortedindex\n switch($this->sort) {\n case self::SORT_COURSE :\n foreach ($this->activities as $key => $value) {\n $this->activitysortedindex[$key] = $key;\n }\n break;\n\n case self::SORT_COURSE_INCOMPLETE :\n $completes = array();\n $incompletes = array();\n foreach ($this->activities as $key => $value) {\n if ($value['incomplete']) {\n $incompletes[] = $key;\n } else {\n $completes[] = $key;\n }\n }\n foreach ($incompletes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n foreach ($completes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n break;\n\n case self::SORT_WEIGHT :\n $weights = array();\n foreach ($this->activities as $key => $value) {\n $weights[$key] = $value['weight'];\n }\n asort($weights);\n foreach ($weights as $key => $value) {\n $this->activitysortedindex[] = $key;\n }\n break;\n\n case self::SORT_WEIGHT_INCOMPLETE :\n $weights = array();\n foreach ($this->activities as $key => $value) {\n $weights[$key] = $value['weight'];\n }\n asort($weights);\n $completes = array();\n $incompletes = array();\n foreach ($weights as $key => $value) {\n if($this->activities[$key]['incomplete']) {\n $incompletes[] = $key;\n } else {\n $completes[] = $key;\n }\n }\n foreach ($incompletes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n foreach ($completes as $key => $value) {\n $this->activitysortedindex[] = $value;\n }\n break;\n }\n }",
"public function arrange() {}",
"function sortTransits() {\n $sortedtransits = array();\n for( $aspect = 0; $aspect < count($this->m_transit); $aspect++ ) {\n $sortedtransits[substr($this->m_transit[$aspect],17,11)] = $this->m_transit[$aspect];\n }\n ksort($sortedtransits);\n\n unset($this->m_transit);\n $this->m_transit = array();\n reset($sortedtransits);\n while( list($key,$value) = each($sortedtransits) ) {\n array_push(\n $this->m_transit,\n $value\n );\n }\n }",
"function reArrange($source)\r\n{\r\n\t\r\n\t$i = 0;\r\n\t$fact_id=\"\";\r\n\t\t\t\r\n\tforeach($source as $key=>$val)\r\n\t{\t\r\n\t\t$res[$i]['Zone'] = $val['factories']['Zone'];\r\n\t\t\r\n\t\tif( intval($val['RESULT']['status']) == 0 ) \r\n\t\t{\r\n\t\t\t$fact_id = $val['RESULT']['factory_id'];\r\n\t\t\t\r\n\t\t\t$res[$i]['base_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t$res[$i]['base_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t$res[$i]['base_point'] = $val['RESULT']['points'];\r\n\t\t\t\r\n\t\t\t$res[$i]['follow_fact_id'] = \"\";\r\n\t\t\t$res[$i]['follow_point'] = \"\";\r\n\t\t}\r\n\t\t\t\r\n\t\telseif( intval($val['RESULT']['status']) != 0 ) \r\n\t\t{\r\n\t\t\tif($val['RESULT']['factory_id'] == $fact_id)\r\n\t\t\t{\r\n\t\t\t\t$res[$i-1]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i-1]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$res[$i]['base_fact_id'] = \"\";\r\n\t\t\t\t$res[$i]['base_point'] = \"\";\r\n\t\t\t\t\r\n\t\t\t\t$res[$i]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i]['follow_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t\t$res[$i]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$i++;\r\n\t}\r\n\t\r\n\treturn $res;\t\t\r\n}",
"private function sortQueryOrders() {\n foreach ($this->queryResult as $index => $order) {\n $order = $this->injectKitData($order);\n $this->statusOutputOrder[$order['Order']['status']][$order['Order']['id']] = $order;\n }\n }",
"public function getTestResultsData()\n {\n $out = [];\n\n // Case #0, sorted in default acceding\n $out[] = [\n [\n 'green',\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc'\n ];\n\n // Case #1, sorted in descending order by term, blue is prioritized.\n $out[] = [\n [\n 'acme',\n 'bar',\n 'foo',\n ],\n 'sc_zero_choices'\n ];\n\n // Case #2, all items prioritized, so sorting shouldn't matter.\n $out[] = [\n [\n 'blue',\n 'green',\n ],\n 'sc_sort_term_a'\n ];\n\n // Case #3, sort items by count, red prioritized.\n $out[] = [\n [\n 'yellow',\n ],\n 'sc_sort_term_d'\n ];\n\n // Case #4\n $out[] = [\n [\n 'blue',\n 'red',\n 'green',\n 'yellow'\n ],\n 'sc_sort_count'\n ];\n\n // Case #5 with selected man\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc',\n ['manufacturer' => 'a']\n ];\n\n // Case #6 with selected man with zero choices\n $out[] = [\n [\n 'acme',\n 'foo',\n 'bar',\n ],\n 'sc_zero_choices',\n ['manufacturer' => 'a']\n ];\n\n // Case #7 with selected man with zero choices\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n 'green',\n ],\n 'sc_zero_choices_color',\n ['manufacturer' => 'a']\n ];\n\n return $out;\n }",
"public function getByActivity (){\n\t\t\n\t\tif(empty($this->filters)){\n\t\t\t$this->filters[] = \" 1 = 1 \";\t\n\t\t}\n\t\t\n\t\t$f = array('a.', 'p.school_id');\n\t\t$r = array('','team_id');\n\t\t\n\t\t$totals = $this->db->Query(\"select type,count(*) as total from activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" group by type\");\n\n\t\t$schools = $this->db->Query(\"select type,count(distinct team_id) as total from activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" group by type\");\n\n\t\t$parts = $this->db->Query(\"SELECT type,COUNT(DISTINCT supporter_id) AS total FROM activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" GROUP BY TYPE\");\n\t\t\n\t\t$out = array(\n\t\t\t1 => array('total' => 0, 'parts' => 0, 'schools' => 0),\n\t\t\t2 => array('total' => 0, 'parts' => 0, 'schools' => 0),\n\t\t\t3 => array('total' => 0, 'parts' => 0, 'schools' => 0) \n\t\t);\n\t\t\n\t\t\n\t\tforeach ( $totals as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['total'] = $item['total'];\n\t\t}\n\t\t\n\t\tforeach ( $schools as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['schools'] = $item['total'];\n\t\t}\n\t\t\n\t\tforeach ( $parts as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['parts'] = $item['total'];\n\t\t}\n\t\t\n\t\t/*\n\t\t$tmp = Util::groupMultiArray($this->data,'type');\n\t\t\n\t\tforeach ($tmp as $type => $typedata){\n\t\t\t\n\t\t\t$out[$type]['total'] = count($typedata);\n\t\t\t\n\t\t\t$parts = Util::groupMultiArray($typedata,'supporter_id');\n\t\t\t$out[$type]['parts'] = count($parts);\n\t\t\t\n\t\t\t$schools = Util::groupMultiArray($typedata,'school_id');\n\t\t\t$out[$type]['schools'] = count($schools);\t\n\t\t}*/\n\t\t\n\t\treturn $out;\n\t}",
"function data_sorter(){\n $client = getClient();\n $service = new Google_Service_Reports($client);\n\n // Print the last 10 login events.\n $userKey = 'all';\n $applicationName = 'meet';\n $optParams =[\n 'maxResults' => 1000,\n ];\n $results = $service->activities->listActivities(\n $userKey, $applicationName, $optParams);\n\n $fp_raw = fopen('results_raw.json', 'w');\n fwrite($fp_raw, serialize($results));\n fclose($fp_raw);\n\n\n $arrMeetData = [];\n $meeting_code =\"\";\n $duration_seconds= 0;\n $organizer_email = \"\";\n $display_name = \"\";\n $device_type = \"\";\n $identifier = \"\";\n $conference_id = \"\";\n $location_region =\"\";\n $screencast_send_bitrate_kbps_mean = 0;\n $screencast_recv_bitrate_kbps_mean = 0;\n $screencast_recv_seconds = 0;\n $screencast_send_seconds = 0;\n $date_meet =\"\";\n $hour_end_meet = \"\";\n $oldData = json_decode(file_get_contents('results.json'),true);\n\n foreach ($results->getItems() as $res){\n $duration_seconds_tmp =0;\n $tmp_time =explode(\"T\",$res->getId()->getTime());\n $date_meet = $tmp_time[0];\n $hour_end_meet = explode(\".\",$tmp_time[1])[0];\n foreach ($res->getEvents()[0]->getParameters() as $rest) {\n switch ($rest->getName()) {\n case \"meeting_code\":\n $meeting_code = $rest->value;\n break;\n case \"duration_seconds\":\n $duration_seconds = $rest->intValue;\n if($duration_seconds > $duration_seconds_tmp){\n $duration_seconds_tmp = $duration_seconds;\n }\n break;\n case \"organizer_email\":\n $organizer_email = $rest->value;\n break;\n case \"display_name\":\n $display_name = $rest->value;\n break;\n case \"device_type\":\n $device_type = $rest->value;\n break;\n case \"identifier\";\n $identifier = $rest->value;\n break;\n case \"conference_id\":\n $conference_id = $rest->value;\n break;\n case \"location_region\":\n $location_region = $rest->value;\n break;\n case \"screencast_send_bitrate_kbps_mean\":\n if($rest->value>$screencast_send_bitrate_kbps_mean){\n $screencast_send_bitrate_kbps_mean = $rest->value;\n }\n break;\n case \"screencast_recv_bitrate_kbps_mean\":\n if($rest->value>$screencast_recv_bitrate_kbps_mean){\n $screencast_recv_bitrate_kbps_mean = $rest->value;\n }\n break;\n case \"screencast_recv_seconds\":\n if($rest->value>$screencast_recv_seconds){\n $screencast_recv_seconds = $rest->value;\n }\n break;\n case \"screencast_send_seconds\":\n if($rest->value>$screencast_send_seconds){\n $screencast_send_seconds = $rest->value;\n }\n break;\n }\n }\n\n $id = $meeting_code.\"-\".$conference_id;\n\n if(!in_array($id,$oldData)){\n if(!array_key_exists($id,$arrMeetData)){\n $arrMeetData[$id]= [\n 'meeting_code'=>$meeting_code,\n 'conference_id' => $conference_id,\n 'duration_seconds'=>$duration_seconds_tmp,\n 'organizer_email'=>$organizer_email,\n 'date_meet'=>$date_meet,\n 'hour_end_meet' => $hour_end_meet,\n ];\n }\n\n if(!array_key_exists('participante',$arrMeetData[$id])){\n $arrMeetData[$id]['participante'] = [];\n }\n $arrMeetData[$id]['participante'][] = [\n 'display_name'=>$display_name,\n 'device_type'=>$device_type,\n 'identifier'=>$identifier,\n 'conference_id' => $conference_id,\n 'duration_seconds_in_call'=>$duration_seconds,\n 'location_region'=>$location_region,\n 'screencast_send_bitrate_kbps_mean'=>$screencast_send_bitrate_kbps_mean,\n 'screencast_recv_bitrate_kbps_mean'=>$screencast_recv_bitrate_kbps_mean,\n 'screencast_recv_seconds'=>$screencast_recv_seconds,\n 'screencast_send_seconds'=>$screencast_send_seconds\n ];\n }else{\n echo \"No existen nuevas entradas\";\n }\n\n }\n\n if(!empty($arrMeetData)){\n $database = new database();\n\n foreach ($arrMeetData as $meet){\n $database->meetData($meet['conference_id'],$meet['meeting_code'],$meet['duration_seconds'],$meet['organizer_email'],$meet['date_meet'],$meet['hour_end_meet']);\n foreach ($meet['participante'] as $meet_p){\n $database->meetParticipant($meet_p['display_name'],$meet_p['device_type'],$meet_p['identifier'],$meet_p['conference_id'],$meet_p['duration_seconds_in_call'],$meet_p['location_region'],$meet_p['screencast_send_bitrate_kbps_mean'],$meet_p['screencast_recv_bitrate_kbps_mean'],strval($meet_p['screencast_recv_seconds']),strval($meet_p['screencast_send_seconds']));\n }\n }\n $fp = fopen('results.json', 'w');\n fwrite($fp, json_encode($arrMeetData,JSON_UNESCAPED_UNICODE));\n fclose($fp);\n }else{\n echo \"Sin datos que agregar a sistema\";\n }\n\n}",
"public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}",
"public function sortStrategy();",
"public function sortPhoneData(){\n usort($this->phoneData, function($a, $b) {\n return $a['activationDate'] <=> $b['activationDate'];\n });\n\n }",
"abstract public function prepareSort();",
"public function testDataSort()\n {\n $obj = new CSVFileReader();\n $obj->loadFileContent('test/data/hotels.csv');\n\n $obj->dataSort('name');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['name'], 'Apartment Ruggiero Giordano');\n $this->assertEquals($res[1]['name'], 'Comfort Inn Reichel');\n $this->assertEquals($res[2]['name'], 'Diaz');\n $this->assertEquals($res[15]['name'], 'The Rolland');\n $this->assertEquals($res[16]['name'], 'The Zimmer');\n \n $obj->dataSort('stars');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['stars'], '1');\n $this->assertEquals($res[4]['stars'], '2');\n $this->assertEquals($res[7]['stars'], '3');\n $this->assertEquals($res[9]['stars'], '4');\n $this->assertEquals($res[16]['stars'], '5');\n \n $obj->dataSort('contact');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['contact'], 'Alex Henry');\n $this->assertEquals($res[1]['contact'], 'Arlene Hornig');\n $this->assertEquals($res[2]['contact'], 'Benedetta Caputo');\n $this->assertEquals($res[3]['contact'], 'Clémence Hoarau');\n $this->assertEquals($res[16]['contact'], 'Victor Bodin-Leleu');\n\n\n }",
"public function getActivity(){\n\t\t$activityJSON = json_decode('[{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091459,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091506,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862412,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091625,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091919,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458855256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862529,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458878187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458884355,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458951476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458954501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459027340,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459031419,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036422,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036489,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036803,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459039428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459041802,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459045348,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459052681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459054504,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459095354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459103693,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106189,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106533,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106764,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107148,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107592,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459108612,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459108859,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459116818,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459117841,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459118056,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459119912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459122951,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459124218,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459128266,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128588,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459130553,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131015,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131421,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131513,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131527,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131569,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131625,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131736,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131740,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131839,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132001,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132411,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132504,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132807,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459133055,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133407,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133441,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133465,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133492,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133507,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133511,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133615,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133644,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133723,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134005,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134041,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134152,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134206,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134408,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134572,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134581,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135440,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459135552,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136623,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136624,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136693,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136765,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136830,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136838,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136877,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137197,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137301,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137334,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137389,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138075,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138127,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138180,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138599,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459138837,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138857,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139196,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139728,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459139916,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459140265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363777,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363778,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362805,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459363876,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459372978,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459383363,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459403946,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885868,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885870,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459921911,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459922060,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460149101,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460154126,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460165710,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165742,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165745,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241854,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074050,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460068718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440021,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460496700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460497103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500872,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459277007,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459278245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459320218,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459360248,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362702,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459374597,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459394150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459396245,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459398742,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399066,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399156,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399378,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459399529,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399739,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400211,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400630,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400686,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400859,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400940,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400951,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401128,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401174,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401186,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401215,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401469,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459402071,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402195,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402542,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402551,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459404536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459404915,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405537,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405603,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405776,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406030,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406090,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407272,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407322,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407476,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408828,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408999,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459413295,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440105,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440425,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443054,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443074,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443102,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443119,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443158,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443520,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443696,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443777,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459446291,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459526366,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459704710,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072516,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074115,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232036,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460246528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250345,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460514183,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460518330,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460519779,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460523934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232451,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460307680,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460515263,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519047,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460520866,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460249923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460254929,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460515460,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519269,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525976,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460527887,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460697367,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680199,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680217,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460680924,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680956,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681107,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681317,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681589,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681787,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681901,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682008,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682069,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682913,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460684169,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460685921,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460686277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460686909,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687670,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460689203,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690237,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690481,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460692290,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460695261,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460727282,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460695587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751998,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680258,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681907,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460694376,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460754522,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756048,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460758121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460843708,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460848382,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460835446,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460842868,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848973,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916368,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924220,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924373,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460917702,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460930922,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848040,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460849169,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460854613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859331,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916771,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932451,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859255,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859280,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460913502,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916609,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933975,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460931001,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933992,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690702,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460690703,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460694377,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460746602,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752225,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460754523,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460833949,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460842616,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460870052,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948365,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752002,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460755659,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460835972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460951953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948511,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948773,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951251,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460952232,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460955069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962897,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932429,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460934562,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460943791,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951769,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460957051,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962696,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461100004,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460511060,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460524256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525274,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525288,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525358,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525714,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525781,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460526586,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460529681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460952655,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460960195,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460976232,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461017048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107213,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932349,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932358,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461009132,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014454,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107316,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460052009,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460483549,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460494428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526286,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526459,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460527491,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460529046,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460603259,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460966099,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461107331,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107501,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110199,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460171872,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460173203,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460174200,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460231864,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460239810,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460317732,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460327728,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460335915,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460485984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460497970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499694,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499783,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499817,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499822,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499925,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500085,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500311,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460500315,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500324,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500346,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500435,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500437,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500448,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500452,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500571,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501404,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501419,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501726,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460501788,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502786,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503543,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460504438,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460511336,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460604302,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104939,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105562,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111751,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112017,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461125417,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935895,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460939457,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944211,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460944678,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944850,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460945971,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460946923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947846,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947902,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948148,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948337,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460948348,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948441,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460949023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949429,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949775,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949860,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460949890,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460950123,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460950910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951798,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460958944,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460959747,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460959960,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960040,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960509,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960601,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960769,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960775,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960888,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960906,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460961127,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460961179,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460962695,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963592,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963712,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963750,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964286,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964291,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460964381,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964621,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964775,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965160,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965298,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461008879,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461090151,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102204,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461102276,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102506,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461103526,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461103770,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106883,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107063,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107964,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108055,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108484,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109745,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109930,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109942,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110024,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110366,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110546,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110573,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110627,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110664,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110670,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461111111,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111333,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111336,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111443,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111548,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461111613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111676,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461112249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112463,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112633,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113143,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113215,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113307,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113583,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113689,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114087,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114228,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114303,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114406,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114469,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114737,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114791,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114933,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114942,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115117,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461115151,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116134,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461116244,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116379,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461119303,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461121523,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461122625,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123034,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123637,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123772,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461124550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126859,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127738,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127889,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128029,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128432,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128741,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461128937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129510,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129601,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129678,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130145,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130150,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130151,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131381,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461132279,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461192042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714753,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714914,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716190,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459717945,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459721768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459722848,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459726240,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459732605,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459734819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459735947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736050,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736143,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736153,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736162,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736467,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736597,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736935,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737023,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737270,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737278,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459737611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737635,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737842,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737978,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738067,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738656,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459738759,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739031,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459739498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739838,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459741134,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741257,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741342,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742002,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742020,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742380,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742507,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742616,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743111,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743247,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743427,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743439,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743442,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743515,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743544,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743576,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743726,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744091,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744178,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744192,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744219,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744297,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744814,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745648,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745778,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746161,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459746302,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459746437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746794,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746974,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746980,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747076,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747158,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747309,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747384,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747549,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747553,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747584,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747715,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747754,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747762,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747820,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748293,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748577,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748922,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748932,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749300,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749618,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749784,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749810,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749848,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749890,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750704,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750805,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750928,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751073,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751328,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751380,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751385,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751428,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751497,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751512,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751576,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751748,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752310,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752578,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752688,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752891,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753461,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753505,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753580,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460160150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166197,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167931,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460170970,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460238640,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460258700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460265851,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460317221,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460326650,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460328076,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460330953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460331422,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460334550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460339277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460431663,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460433944,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460434618,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460435130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437306,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437318,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437459,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437631,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437792,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438236,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438253,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439515,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439574,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439605,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460493473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110334,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126555,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461270347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333782,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333842,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461371326,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503714,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503724,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460524255,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460529582,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607349,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460608706,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609058,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460609081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609586,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460610035,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460611953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612043,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612695,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460612713,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460613973,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460614117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460614588,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460615101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615167,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461109673,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461818721,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461882154,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882298,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882881,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883568,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461885826,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461887194,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460495947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460496869,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460517967,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460608470,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461101191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106428,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106538,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109904,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110836,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115060,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115156,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115382,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123212,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127141,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461132965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461134296,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461188023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461253841,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461275430,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461291029,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461299970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461307230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461338321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461341524,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461361910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461376273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461378319,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461384392,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461388841,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461422894,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461437636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461448456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461474362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461480100,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461482202,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461505503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461524155,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461534168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461537084,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539241,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461540182,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461544687,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461550993,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461559744,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461563898,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461708868,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461819989,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461861185,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461874701,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461881867,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461893239,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461894417,\"source\":\"googledrive\"}]');\n\t\treturn $activityJSON;\n\t}",
"function arrange_group($g,$additions)\n\t{\n\t\t// we also know they share the same lastname\n\t\tif(!count($g)) return;\n\t\t// Lastname, Firstnames[], email[], cellphones[], Address + Homephone\n\t\tforeach($g as $r)\n\t\t{\n\t\t\t$res['lastname'] = $r['lastname'];\n\t\t\t$res['firstnames'][] = $r['firstname'];\n\t\t\t$res['emails'][] = $r['email'];\n\t\t\t$res['cellphones'][] = $r['cellphone'];\n\t\t\t$res['address'] = $r['line1'] . ($r['line2']?\", {$r['line2']}\":\"\") . \"\\\\n\" . $r['city'] . \" \" . $r['state'] . \" \" . $r['postalcode'] . ($r['homephone']?\"\\\\n\\\\nTel: {$r['homephone']}\":\"\");\n\t\t}\n\t\t// add the exceptions if applicable\n\t\tif(in_array($res['lastname'],array_keys($additions))) $res['firstnames'] = array_merge($res['firstnames'],$additions[$res['lastname']]);\n\n\t\treturn $res;\n\t}",
"public function asort() {}",
"function sortdata( $table, $column, $direction ) {\n\n\t global $tpl;\n\t global $user_data;\n\t global $getmonth;\n\t\t \n $objResponse = new xajaxResponse(); \n \n //include('settings/template.php'); \n include('settings/tables.php'); \n\n\t if ( $user_data == '' ) require_once('lib/functions/get_userdata.php'); \n\n\t if ($table == $tbl_goals) {\n\n //define sort column\n\t\t $goals_order = $column.\" \".$direction;\n\t include(\"lib/functions/fetch_goals.php\");\n\t $tpl->assign('ay_goals', $ay_goals);\n\t\t\t \t \t\n \t\t\t//define direction DESC or ASC\n\t\t if ($direction == 'DESC') $tpl->assign(\"sort_\".$column, 'ASC');\n\t\t else $tpl->assign(\"sort_\".$column, 'DESC');\n\t\t \n\t\t //update template\n \t $html = $tpl->fetch('modules/improve/goals/sort_'.$column.'.tpl'); \t\n $objResponse->assign(\"sortdiv_\".$column,\"innerHTML\",$html); \t\n\t\t \t\t \t\t\t \n\t\t\t \t\t\t\t\t \t \n $html2 = $tpl->fetch(\"modules/improve/goals/goal_entries.tpl\"); \n\n\n\t \t $objResponse->assign(\"goal_entries\",\"innerHTML\",$html2); \n\t\t \n\t }\n\t \n return $objResponse; \n \n }",
"public function getActivities()\n {\n $enrollments = Enrollment::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $enrol = Enroll::where('id', $item->enrolid)->first();\n return ['type' => 'enroll',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $enrol->courseid)->first()->fullname,\n ];\n });\n\n $completions = Completion::latest('timecompleted')->take(4)->get()->sortBy('timecompleted')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n return ['type' => 'completion',\n 'ts' => $item->timecompleted,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $item->course)->first()->fullname,\n ];\n });\n\n $grades = Grades::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $grade = DB::table('mdl_grade_items')->where('id', $item->itemid)->first();\n\n return ['type' => 'grade',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $grade->courseid)->first()->fullname,\n 'score' => $item->finalgrade,\n ];\n });\n\n\n $merged = array_merge($enrollments->toArray(), $completions->toArray(), $grades->toArray());\n\n return collect($merged)->sortByDesc('ts')->take(4)->toArray();\n }",
"public function arrange(): void;",
"function exp_activitySort($a,$b){\n return $b[\"session_count\"] - $a[\"session_count\"];\n}",
"public function testSortWithSuites()\n {\n // mock tests for test object handler.\n $numberOfCalls = 0;\n $mockTest1 = AspectMock::double(\n TestObject::class,\n ['getEstimatedDuration' => function () use (&$numberOfCalls) {\n $actionCount = [300, 275];\n $result = $actionCount[$numberOfCalls];\n $numberOfCalls++;\n\n return $result;\n }]\n )->make();\n\n $mockHandler = AspectMock::double(\n TestObjectHandler::class,\n ['getObject' => function () use ($mockTest1) {\n return $mockTest1;\n }]\n )->make();\n\n AspectMock::double(TestObjectHandler::class, ['getInstance' => $mockHandler])->make();\n\n // create test to size array\n $sampleTestArray = [\n 'test1' => 100,\n 'test2' => 300,\n 'test3' => 500,\n 'test4' => 60,\n 'test5' => 125\n ];\n\n // create mock suite references\n $sampleSuiteArray = [\n 'mockSuite1' => ['mockTest1', 'mockTest2']\n ];\n\n // perform sort\n $testSorter = new ParallelGroupSorter();\n $actualResult = $testSorter->getTestsGroupedBySize($sampleSuiteArray, $sampleTestArray, 500);\n\n // verify the resulting groups\n $this->assertCount(4, $actualResult);\n\n $expectedResults = [\n 1 => ['mockSuite1_0'],\n 2 => ['mockSuite1_1'],\n 3 => ['test3'],\n 4 => ['test2','test5', 'test4'],\n 5 => ['test1'],\n ];\n\n foreach ($actualResult as $groupNum => $group) {\n $this->assertEquals($expectedResults[$groupNum], array_keys($group));\n }\n }",
"function sortReportByMonth($data) {\n\t\t$sortedLabels = array();\n\t\t$sortedValues = array();\n\t\t$sortedLinks = array();\n\t\t$years = array();\n\t\t$mOrder = array(\"January\" => 0,\"February\" => 1,\"March\" => 2, \"April\" => 3, \"May\" => 4, \"June\" => 5,\"July\" => 6,\"August\" => 7,\"September\" => 8,\"October\" => 9,\"November\" => 10,\"December\" => 11);\n\t\tforeach($data['labels'] as $key=>$label) {\n\t\t\tlist($month, $year) = explode(' ', $label);\n\t\t\tif(!empty($year)) {\n\t\t\t\t$indexes = $years[$year];\n\t\t\t\tif(empty($indexes)) {\n\t\t\t\t\t$indexes = array();\n\t\t\t\t\t$indexes[$mOrder[$month]] = $key;\n\t\t\t\t\t$years[$year] = $indexes; \n\t\t\t\t} else {\n\t\t\t\t\t$indexes[$mOrder[$month]] = $key;\n\t\t\t\t\t$years[$year] = $indexes;\n\t\t\t\t}\n\t\t\t} else if ($label == '--'){\n\t\t\t\t$indexes = $years['unknown'];\n\t\t\t\tif(empty($indexes)) {\n\t\t\t\t\t$indexes = array();\n\t\t\t\t\t$indexes[] = $key;\n\t\t\t\t\t$years['unknown'] = $indexes; \n\t\t\t\t} else {\n\t\t\t\t\tdie;\n\t\t\t\t\t$indexes[] = $key;\n\t\t\t\t\t$years['unknown'] = $indexes;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($years)) {\n\t\t\tksort($years);\n\t\t\tforeach ($years as $indexes) {\n\t\t\t\tksort($indexes); // to sort according to the index\n\t\t\t\tforeach($indexes as $index) {\n\t\t\t\t\t$sortedLabels[] = $data['labels'][$index];\n\t\t\t\t\t$sortedValues[] = $data['values'][$index];\n\t\t\t\t\t$sortedLinks[] = $data['links'][$index];\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$indexes = array();\n\t\t\tforeach ($data['labels'] as $key=>$label) {\n\t\t\t\tif(isset($mOrder[$label])) {\n\t\t\t\t\t$indexes[$mOrder[$label]] = $key;\n\t\t\t\t} else {\n\t\t\t\t\t$indexes['unknown'] = $key;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tksort($indexes);\n\t\t\tforeach ($indexes as $index) {\n\t\t\t\t$sortedLabels[] = $data['labels'][$index];\n\t\t\t\t$sortedValues[] = $data['values'][$index];\n\t\t\t\t$sortedLinks[] = $data['links'][$index];\n\t\t\t}\n\t\t}\n\n\t\t$data['labels'] = $sortedLabels;\n\t\t$data['values'] = $sortedValues;\n\t\t$data['links'] = $sortedLinks;\n\n\t\treturn $data;\n\t}",
"public function organizeData()\n {\n $this->data = [\n \"thing2\" => ['value'=>'申请通过'],\n \"date1\" => ['value'=>date(\"Y-m-d H:i:s\",time())],\n ];\n }",
"function sort_courses()\n{\n global $CSC_courses;\n global $CSC_electives;\n global $MATH_courses;\n global $ENGL_courses;\n global $SCI_courses;\n global $MATH_electives;\n $mcore = math_required();\n $melec = math_elective();\n $core = csc_required();\n $elec = csc_elective();\n $courses = simplexml_load_file(\"course_data/courses.xml\");\n foreach( $courses as $c)\n {\n if( $c->prefix == 'CSC' && in_array($c->number, $core))\n {\n array_push($CSC_courses,$c);\n }\n elseif( $c->prefix == 'CSC' && in_array($c->number, $elec) )\n {\n array_push($CSC_electives, $c );\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $mcore))\n {\n array_push($MATH_courses, $c);\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $melec))\n {\n array_push($MATH_electives,$c);\n }\n elseif($c->prefix=='ENGL')\n {\n array_push($ENGL_courses, $c);\n }\n elseif($c->prefix=='PHYS')\n {\n array_push($SCI_courses, $c);\n }\n }\n}",
"public function testGetDataTableRowAndColumnOrder() {\r\n\t\t// Create values via SQL\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testGetDataTable 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testGetDataTable 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testGetDataTable 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t// Get value data table with columns in different order\r\n\t\t$datatablecolumnsordered = $this->getPersistenceAdapter()->getDataTable('select STRING_VALUE, BOOLEAN_VALUE, UUID, INT_VALUE from POTEST');\r\n\t\t$headerscolumnsordered = $datatablecolumnsordered->getHeaders();\r\n\t\t$this->assertEquals(4, count($headerscolumnsordered), 'Wrong header names count');\r\n\t\t$this->assertEquals('STRING_VALUE', $headerscolumnsordered[0], 'Column 0 has wrong header name');\r\n\t\t$this->assertEquals('BOOLEAN_VALUE', $headerscolumnsordered[1], 'Column 1 has wrong header name');\r\n\t\t$this->assertEquals('UUID', $headerscolumnsordered[2], 'Column 2 has wrong header name');\r\n\t\t$this->assertEquals('INT_VALUE', $headerscolumnsordered[3], 'Column 3 has wrong header name');\r\n\t\t$datamatrixcolumnsordered = $datatablecolumnsordered->getDataMatrix();\r\n\t\t$this->assertEquals(3, count($datamatrixcolumnsordered), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals(4, count($datamatrixcolumnsordered[$i]), 'Wrong column count in row '.$i);\r\n\t\t\t// The cell values are all strings\r\n\t\t\t$this->assertEquals(''.$records[$i]['string'], $datamatrixcolumnsordered[$i][0], 'Cell content does not match in row '.$i.' in column 0');\r\n\t\t\t$this->assertEquals(''.($records[$i]['bool']?1:0), $datamatrixcolumnsordered[$i][1], 'Cell content does not match in row '.$i.' in column 1');\r\n\t\t\t$this->assertEquals(''.$records[$i]['UUID'], $datamatrixcolumnsordered[$i][2], 'Cell content does not match in row '.$i.' in column 2');\r\n\t\t\t$this->assertEquals(''.$records[$i]['int'], $datamatrixcolumnsordered[$i][3], 'Cell content does not match in row '.$i.' in column 3');\r\n\t\t}\r\n\t\t// Get value data table with rows in different order\r\n\t\t$datatablerowsordered = $this->getPersistenceAdapter()->getDataTable('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST order by INT_VALUE desc');\r\n\t\t$headersrowsordered = $datatablerowsordered->getHeaders();\r\n\t\t$this->assertEquals(4, count($headersrowsordered), 'Wrong header names count');\r\n\t\t$this->assertEquals('UUID', $headersrowsordered[0], 'Column 0 has wrong header name');\r\n\t\t$this->assertEquals('BOOLEAN_VALUE', $headersrowsordered[1], 'Column 1 has wrong header name');\r\n\t\t$this->assertEquals('INT_VALUE', $headersrowsordered[2], 'Column 2 has wrong header name');\r\n\t\t$this->assertEquals('STRING_VALUE', $headersrowsordered[3], 'Column 3 has wrong header name');\r\n\t\t$datamatrixrowsordered = $datatablerowsordered->getDataMatrix();\r\n\t\t$this->assertEquals(3, count($datamatrixrowsordered), 'Wrong row count');\r\n\t\t// Row 0\r\n\t\t$this->assertEquals(''.$records[2]['UUID'], $datamatrixrowsordered[0][0], 'Cell content does not match in row 0 in column 0');\r\n\t\t$this->assertEquals(''.($records[2]['bool']?1:0), $datamatrixrowsordered[0][1], 'Cell content does not match in row 0 in column 1');\r\n\t\t$this->assertEquals(''.$records[2]['int'], $datamatrixrowsordered[0][2], 'Cell content does not match in row 0 in column 2');\r\n\t\t$this->assertEquals(''.$records[2]['string'], $datamatrixrowsordered[0][3], 'Cell content does not match in row 0 in column 3');\r\n\t\t// Row 1\r\n\t\t$this->assertEquals(''.$records[1]['UUID'], $datamatrixrowsordered[1][0], 'Cell content does not match in row 0 in column 0');\r\n\t\t$this->assertEquals(''.($records[1]['bool']?1:0), $datamatrixrowsordered[1][1], 'Cell content does not match in row 0 in column 1');\r\n\t\t$this->assertEquals(''.$records[1]['int'], $datamatrixrowsordered[1][2], 'Cell content does not match in row 0 in column 2');\r\n\t\t$this->assertEquals(''.$records[1]['string'], $datamatrixrowsordered[1][3], 'Cell content does not match in row 0 in column 3');\r\n\t\t// Row 2\r\n\t\t$this->assertEquals(''.$records[0]['UUID'], $datamatrixrowsordered[2][0], 'Cell content does not match in row 0 in column 0');\r\n\t\t$this->assertEquals(''.($records[0]['bool']?1:0), $datamatrixrowsordered[2][1], 'Cell content does not match in row 0 in column 1');\r\n\t\t$this->assertEquals(''.$records[0]['int'], $datamatrixrowsordered[2][2], 'Cell content does not match in row 0 in column 2');\r\n\t\t$this->assertEquals(''.$records[0]['string'], $datamatrixrowsordered[2][3], 'Cell content does not match in row 0 in column 3');\r\n\t}",
"public function run()\n {\n $data = [\n [\n \"id\" => 1,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-07-01\",\n \"checkOut\" => \"2021-07-04\",\n \"bookingDate\" => \"2021-07-01\",\n \"comment\" => \"Lorem ipsum dolor sit amet, consectetur adipiscing elit\"\n ],\n [\n \"id\" => 2,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-07-06\",\n \"checkOut\" => \"2021-07-11\",\n \"bookingDate\" => \"2021-07-03\",\n \"comment\" => \"Vestibulum scelerisque nulla non cursus consequat\"\n ],\n [\n \"id\" => 3,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-07-15\",\n \"checkOut\" => \"2021-07-22\",\n \"bookingDate\" => \"2021-07-05\",\n \"comment\" => \"Phasellus id lobortis risus\"\n ],\n [\n \"id\" => 4,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-07-28\",\n \"checkOut\" => \"2021-07-30\",\n \"bookingDate\" => \"2021-07-07\",\n \"comment\" => \"Fusce eleifend felis in nulla fringilla efficitur\"\n ],\n [\n \"id\" => 5,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-08-07\",\n \"checkOut\" => \"2021-08-11\",\n \"bookingDate\" => \"2021-07-09\",\n \"comment\" => \"Ut euismod lorem sed libero cursus viverra\"\n ],\n [\n \"id\" => 6,\n \"accomodationId\" => 1,\n \"checkIn\" => \"2021-08-21\",\n \"checkOut\" => \"2021-08-29\",\n \"bookingDate\" => \"2021-07-11\",\n \"comment\" => \"Duis placerat mi sodales odio accumsan, sed dignissim nisi tincidunt\"\n ],\n [\n \"id\" => 7,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-07-01\",\n \"checkOut\" => \"2021-07-03\",\n \"bookingDate\" => \"2021-07-01\",\n \"comment\" => \"Phasellus varius fermentum malesuada\"\n ],\n [\n \"id\" => 8,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-07-05\",\n \"checkOut\" => \"2021-07-12\",\n \"bookingDate\" => \"2021-07-03\",\n \"comment\" => \"Etiam elementum eros ac lacus rhoncus, sed aliquet ligula aliquam\"\n ],\n [\n \"id\" => 9,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-07-16\",\n \"checkOut\" => \"2021-07-20\",\n \"bookingDate\" => \"2021-07-05\",\n \"comment\" => \"Nam sed ex condimentum, venenatis dolor eget, hendrerit sem\"\n ],\n [\n \"id\" => 10,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-07-26\",\n \"checkOut\" => \"2021-08-04\",\n \"bookingDate\" => \"2021-07-07\",\n \"comment\" => \"Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus\"\n ],\n [\n \"id\" => 11,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-08-12\",\n \"checkOut\" => \"2021-08-17\",\n \"bookingDate\" => \"2021-07-09\",\n \"comment\" => \"Mauris eu feugiat magna, quis vestibulum nisi\"\n ],\n [\n \"id\" => 12,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-08-27\",\n \"checkOut\" => \"2021-08-29\",\n \"bookingDate\" => \"2021-07-11\",\n \"comment\" => \"Aliquam lobortis suscipit libero, vitae consectetur est bibendum dictum\"\n ],\n [\n \"id\" => 13,\n \"accomodationId\" => 2,\n \"checkIn\" => \"2021-09-10\",\n \"checkOut\" => \"2021-09-17\",\n \"bookingDate\" => \"2021-07-13\",\n \"comment\" => \"Mauris sagittis erat nec tellus sollicitudin sodales\"\n ],\n [\n \"id\" => 14,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-07-01\",\n \"checkOut\" => \"2021-07-02\",\n \"bookingDate\" => \"2021-07-01\",\n \"comment\" => \"Fusce id pharetra est, a porttitor dui\"\n ],\n [\n \"id\" => 15,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-07-04\",\n \"checkOut\" => \"2021-07-10\",\n \"bookingDate\" => \"2021-07-03\",\n \"comment\" => \"Morbi vitae ex vitae velit convallis pulvinar vitae eget justo\"\n ],\n [\n \"id\" => 16,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-07-14\",\n \"checkOut\" => \"2021-07-18\",\n \"bookingDate\" => \"2021-07-05\",\n \"comment\" => \"Sed iaculis ultricies purus dictum semper\"\n ],\n [\n \"id\" => 17,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-07-24\",\n \"checkOut\" => \"2021-08-01\",\n \"bookingDate\" => \"2021-07-07\",\n \"comment\" => \"Suspendisse potenti\"\n ],\n [\n \"id\" => 18,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-08-09\",\n \"checkOut\" => \"2021-08-11\",\n \"bookingDate\" => \"2021-07-09\",\n \"comment\" => \"Quisque sit amet congue est\"\n ],\n [\n \"id\" => 19,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-08-21\",\n \"checkOut\" => \"2021-08-26\",\n \"bookingDate\" => \"2021-07-11\",\n \"comment\" => \"Donec ligula nibh, vulputate non magna a, rhoncus aliquam purus\"\n ],\n [\n \"id\" => 20,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-09-07\",\n \"checkOut\" => \"2021-09-10\",\n \"bookingDate\" => \"2021-07-13\",\n \"comment\" => \"Mauris ac nisl ac ex aliquet convallis\"\n ],\n [\n \"id\" => 21,\n \"accomodationId\" => 3,\n \"checkIn\" => \"2021-09-24\",\n \"checkOut\" => \"2021-09-28\",\n \"bookingDate\" => \"2021-07-15\",\n \"comment\" => \"Integer at pretium urna, eu dapibus dui\"\n ],\n [\n \"id\" => 22,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-07-01\",\n \"checkOut\" => \"2021-07-05\",\n \"bookingDate\" => \"2021-07-01\",\n \"comment\" => \"Aenean convallis tincidunt eros eu tristique\"\n ],\n [\n \"id\" => 23,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-07-07\",\n \"checkOut\" => \"2021-07-10\",\n \"bookingDate\" => \"2021-07-03\",\n \"comment\" => \"Aenean venenatis nunc orci, a fringilla mi consectetur vel\"\n ],\n [\n \"id\" => 24,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-07-14\",\n \"checkOut\" => \"2021-07-20\",\n \"bookingDate\" => \"2021-07-05\",\n \"comment\" => \"Praesent nisl tellus, tempor a neque sit amet, maximus malesuada orci\"\n ],\n [\n \"id\" => 25,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-07-26\",\n \"checkOut\" => \"2021-07-30\",\n \"bookingDate\" => \"2021-07-07\",\n \"comment\" => \"Nunc auctor nunc sed magna suscipit, quis condimentum mauris tincidunt\"\n ],\n [\n \"id\" => 26,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-08-07\",\n \"checkOut\" => \"2021-08-12\",\n \"bookingDate\" => \"2021-07-09\",\n \"comment\" => \"Proin ex ligula, venenatis in lorem id, dictum bibendum nibh\"\n ],\n [\n \"id\" => 27,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-08-22\",\n \"checkOut\" => \"2021-08-24\",\n \"bookingDate\" => \"2021-07-11\",\n \"comment\" => \"Integer quis scelerisque augue, vitae pretium est\"\n ],\n [\n \"id\" => 28,\n \"accomodationId\" => 4,\n \"checkIn\" => \"2021-09-05\",\n \"checkOut\" => \"2021-09-13\",\n \"bookingDate\" => \"2021-07-13\",\n \"comment\" => \"Maecenas consectetur commodo dui, id vestibulum ex vestibulum non\"\n ]\n ];\n\n foreach ($data as $row) {\n Booking::forceCreate($row);\n }\n }",
"public function sort_data_table($arr, $timming, $isAsc = false){\n $new = array();\n for($i=0;$i<count($arr);$i++){\n $sort_key = $arr[$i]['log_date'];\n if($timming != \"4\" && $timming != \"5\" && $timming != \"6\"){\n $t1 = explode(\"-\", substr($arr[$i]['log_date'],0,7));\n $sort_key = $t1[1] . \"-\" . $t1[0];\n }\n $new[$sort_key] = $arr[$i];\n }\n if($isAsc == true){\n \tksort($new);\n }\n $return = array();\n foreach($new as $sort_key => $value){\n $return[] = $value;\n }\n return $return;\n }",
"public function play_offs_preparation() {\n //reverse\n $all = array();\n if ($this->mode == 1) {\n //DECLARING TEAMS!!!!\n $all[0] = array();\n $all[0] = $this->teams;\n } else {\n $all = $this->promoted_all_teams();\n }\n $places_qtt = count($all);\n $promoted_qtt = count($all[0]); //group_qtt?!?\n $new_order = array();\n $new_order_qtt = -1;\n for ($i = 0; $i < $places_qtt; $i++) {\n if ($i % 2 == 0) {\n $place = $i;\n $new_order_qtt++;\n } else {\n $place = $places_qtt - $i;\n }\n for ($j = 0; $j < $promoted_qtt; $j++) {\n if ($i % 2 == 0) {\n $new_order[$new_order_qtt * $promoted_qtt + $j] = new Match();\n $new_order[$new_order_qtt * $promoted_qtt + $j]->set_team1($all[$place][$j]);\n } else {\n $new_order[$new_order_qtt * $promoted_qtt + $j]->set_team2($all[$place][$j]);\n }\n }\n }\n return $new_order;\n }",
"public function getScoreBoardData() {\n $participations = $this->participations;\n foreach ($participations as $p) {\n $p->final_points = $p->user->score($this);\n $p->final_latest_submit = $p->user->getLatestSubmitTime($this);\n }\n // $participations = $participations\n // ->sortBy('final_latest_submit')\n // ->sortByDesc('final_points');\n\n\n $participations = $participations->sort(function($a, $b) {\n if($a->final_points === $b->final_points) {\n if($a->final_latest_submit === $b->final_latest_submit) {\n return 0;\n }\n return $a->final_latest_submit < $b->final_latest_submit ? -1 : 1;\n } \n return $a->final_points < $b->final_points ? 1 : -1;\n });\n\n $i = 1;\n foreach ($participations as $p) {\n $p->final_position = $i++;\n }\n\n return $participations;\n }"
]
| [
"0.5519562",
"0.5512391",
"0.544221",
"0.53600746",
"0.5229912",
"0.5196752",
"0.51283705",
"0.5114642",
"0.5088958",
"0.49749327",
"0.48850858",
"0.48195067",
"0.48067945",
"0.47703865",
"0.47537145",
"0.4752663",
"0.47087455",
"0.46840525",
"0.46815547",
"0.46609443",
"0.46584773",
"0.46476972",
"0.4627462",
"0.46155462",
"0.45853576",
"0.45810485",
"0.45764947",
"0.45736548",
"0.45668066",
"0.4561109"
]
| 0.64218104 | 0 |
Arrange data by school and acivity | public function getBySchool (){
$schools = array();
$tmp = Util::groupMultiArray($this->data, 'school_id');
foreach ($tmp as $school_id => $choicedata){
$open_email_count = '0';
$link_visit_open = '0';
foreach ($choicedata as $choiceid => $choices){
if(($choices['email_open'] == '1')) {
$open_email_count++;
}
if(($choices['link_visit_open'] == '1')) {
$link_visit_open++;
}
}
$schools[$school_id][4] = $open_email_count;
$schools[$school_id][5] = $link_visit_open;
$activities = Util::groupMultiArray( $choicedata, 'type');
$schools[$school_id][0] = count($choicedata);
foreach ($activities as $typeid => $typedata){
$schools[$school_id]['id'] = $school_id;
$schools[$school_id][$typeid] = count($typedata);
}
}
uasort($schools,'sortByActivity');
return $schools;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_schools()\n {\n $this->db->distinct();\n return $this->db->select(\"sandik_alani as okullar\")->order_by(1)->get($this->tableName)->result();\n }",
"function get_uc_groups_by_school( $school_id = '', $activity_id = '', $check_ell = false, $check_at_risk = false, $grade = 'all', $post_status = 'publish', $school_year = false ) {\n\n\t$classes = get_uc_classes_by_school( $school_id, $check_ell, $check_at_risk, $grade, $post_status ) ;\n\n\tif ( count($classes) ) {\n\n\t\t$args = array(\n\t\t\t'post_type' => 'uc_group',\n\t\t\t'post_status' => $post_status,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t),\n\t\t);\n\n\t\tif ( $school_year ) {\n\t\t\t$school_year_array = get_school_year( $school_year );\n\t\t\t$args['date_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t\t'inclusive' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $classes as $class ) {\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'class',\n\t\t\t\t\t'value' => $class['value'],\n\t\t\t);\n\t\t}\n\n\t\t$wp_posts = get_posts( $args );\n\n\t\t$result = array();\n\t\tforeach ($wp_posts as $post) {\n\t\t\t$signup_id = get_post_meta( $post->ID, 'signup', true );\n\t\t\t$group_activity_id = get_post_meta( $signup_id, 'activity', true );\n\t\t\tif ( $group_activity_id == $activity_id )\n\t\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t}\n\t\treturn $result;\n\t} else\n\t\treturn false;\n}",
"function get_payment_for_school($payment_request_id){\n //each scholarhsip payment linked to the school the student is in\n //group the payment by school and return school name, total amount, number of scholarship paymennt in the given request\n //you have to cont the sponsred sudent that belong to this payment request and school\n /*\n $str_query=\"select sp.`schools_school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";*/\n\n $str_query=\"select sp.`schools_school_id`,s.`school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.schools_school_id=s.school_id) and (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";\n\n if (!$this->sql_query($str_query)){\n return false;\n }\n else{\n return true;\n }\n \n }",
"function sortByTeacher() {\n debugPrint(\"Sort by teacher\");\n $this->ararSortedStandIns = array();\n $arStandIns = $this->oParser->oManager->getStandIns();\n foreach($arStandIns as $oStandIn) {\n // special case for Sondereinsatz: there is no original teacher\n static $sAnonTeacher;\n if(trim($oStandIn->getOriginalTeacher()) == \"\") {\n // increment by non-printables to get a unique key for the array and\n // at the same time not having anything confusing in the table\n $sAnonTeacher = $sAnonTeacher . \" \"; \n $oStandIn->setOriginalTeacher($sAnonTeacher);\n }\n\n $strOT = $oStandIn->getOriginalTeacher();\n $strST = $oStandIn->getStandInTeacher();\n $nL = intval($oStandIn->getLesson());\n\n // original teacher can be set free (\"Freisetzung\"), in this case, do not\n // overwrite already existing stand in in this lesson\n unset($oOld);\n if(isset($this->ararSortedStandIns[$strOT]) and \n isset($this->ararSortedStandIns[$strOT][$nL])) {\n $oOld = $this->ararSortedStandIns[$strOT][$nL];\n }\n // we can insert the stand in if one of the following cases is true:\n // - old stand in does not exist\n // - old one is not Freisetzung and new one is not Freisetzung\n if(!isset($oOld) or ($oOld->getTeacherTo() == \"Freis.\" and $oStandIn->getTeacherTo() != \"Freis.\")) {\n if(isset($oOld)) {\n debugPrint(\"sortByTeacher(): overwriting existing stand in\");\n debugPrint(\"old stand in was: \".var_export($oOld, true).\"\\n new stand in is: \".\n var_export($oStandIn, true));\n }\n\tdebugPrint(\"Inserting stand in \".var_export($oStandIn, true));\n $this->ararSortedStandIns[$strST][$nL] = $oStandIn;\n // also notify the original teacher that he is not in duty\n if($strOT != $strST) {\n $oNewStandIn = clone $oStandIn; // PHP5 assigns objects by reference\n // field \"Teacher to\" can be like \"Mi-27.8. / 4\"\n if(trim($oStandIn->getTeacherTo()) == \"\") {\n $oNewStandIn->setTeacherTo(\"Entfall\");\n }\n $this->ararSortedStandIns[$strOT][$nL] = $oNewStandIn;\n }\n\n } else {\n debugPrint(\"sortByTeacher(): not overwriting existing stand in with \".\n \"Freisetzung\");\n debugPrint(\"old stand in was: \".var_export($oOld, true).\"\\n new stand in was: \".\n var_export($oStandIn, true));\n }\n\n #debugPrint(\"############\\nsortByTeacher: $strST: \".print_r($this->ararSortedStandIns[$strST], true));\n if(isset($this->ararSortedStandIns[$strST])) {\n ksort($this->ararSortedStandIns[$strST]);\n }\n if(isset($this->ararSortedStandIns[$strOT])) {\n ksort($this->ararSortedStandIns[$strOT]);\n }\n }\n ksort($this->ararSortedStandIns);\n\n debugPrint(\"sortByTeacher(): finished, array is now: \".var_export($this->ararSortedStandIns, true));\n }",
"protected function sortDataArray() {}",
"public function getSchool();",
"function getStandings($allSchools){\n \n $all_records = [];\n $all_leagues = [];\n $brk = [];\n $ccc = [];\n $cra = [];\n $csc = [];\n $ecc = [];\n $fciac = [];\n $nvl = [];\n $nccc = [];\n $scc = [];\n $shr = [];\n $swc = [];\n \n $db_standings = new Database();\n //\n foreach($allSchools as $team){\n $getTeamRecord = \"CALL getRecord('$team[0]')\";\n $record = $db_standings->getData($getTeamRecord);\n $record = getRecords($record, $team);\n\n if($record['league'] == 'Berkshire'){ array_push($brk, $record); }\n elseif($record['league']=='Central Connecticut'){ array_push($ccc, $record); }\n elseif($record['league']=='Capital Region Athletic'){ array_push($cra,$record); }\n elseif($record['league']=='Constitution State'){ array_push($csc, $record); }\n elseif($record['league']=='Eastern Connecticut'){ array_push($ecc, $record); }\n elseif($record['league']=='Fairfield County Interscholastic Athletic'){ array_push($fciac, $record); }\n elseif($record['league']=='Naugatuck Valley'){ array_push($nvl, $record); }\n elseif($record['league']=='North Central Connecticut'){ array_push($nccc, $record); }\n elseif($record['league']=='Southern Connecticut'){ array_push($scc, $record); }\n elseif($record['league']=='Shoreline'){ array_push($shr, $record); }\n elseif($record['league']=='South West'){ array_push($swc, $record); }\n else{ array_push($all_records, $record); }\n\n // Sort brk arrays by overall w,l\n usort($brk,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ccc arrays by overall w,l\n usort($ccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort cra arrays by overall w,l\n usort($cra,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort csc arrays by overall w,l\n usort($csc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ecc arrays by overall w,l\n usort($ecc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort fcica arrays by overall w,l\n usort($fciac,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nccc arrays by overall w,l\n usort($nccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nvl arrays by overall w,l\n usort($nvl,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort scc arrays by overall w,l\n usort($scc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort shr arrays by overall w,l\n usort($shr,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort swc arrays by overall w,l\n usort($swc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n \n // Combine sorted divisions into all leagues array\n $all_leagues = [\n 'berkshire'=>$brk,\n 'capital region athletic'=>$cra,\n 'central connecticut'=>$ccc,\n 'constitution state'=>$csc,\n 'eastern connecticut'=>$ecc,\n 'fairfield county interscholastic athletic'=>$fciac,\n 'north central connecticut'=>$nccc,\n 'naugatuck valley'=>$nvl,\n 'shoreline'=>$shr,\n 'southern connecticut'=>$scc,\n 'south west'=>$swc\n ];\n }\n \n return $all_leagues;\n}",
"function sort_courses()\n{\n global $CSC_courses;\n global $CSC_electives;\n global $MATH_courses;\n global $ENGL_courses;\n global $SCI_courses;\n global $MATH_electives;\n $mcore = math_required();\n $melec = math_elective();\n $core = csc_required();\n $elec = csc_elective();\n $courses = simplexml_load_file(\"course_data/courses.xml\");\n foreach( $courses as $c)\n {\n if( $c->prefix == 'CSC' && in_array($c->number, $core))\n {\n array_push($CSC_courses,$c);\n }\n elseif( $c->prefix == 'CSC' && in_array($c->number, $elec) )\n {\n array_push($CSC_electives, $c );\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $mcore))\n {\n array_push($MATH_courses, $c);\n }\n elseif( $c->prefix=='MATH' && in_array($c->number, $melec))\n {\n array_push($MATH_electives,$c);\n }\n elseif($c->prefix=='ENGL')\n {\n array_push($ENGL_courses, $c);\n }\n elseif($c->prefix=='PHYS')\n {\n array_push($SCI_courses, $c);\n }\n }\n}",
"public function getByActivity (){\n\t\t\n\t\tif(empty($this->filters)){\n\t\t\t$this->filters[] = \" 1 = 1 \";\t\n\t\t}\n\t\t\n\t\t$f = array('a.', 'p.school_id');\n\t\t$r = array('','team_id');\n\t\t\n\t\t$totals = $this->db->Query(\"select type,count(*) as total from activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" group by type\");\n\n\t\t$schools = $this->db->Query(\"select type,count(distinct team_id) as total from activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" group by type\");\n\n\t\t$parts = $this->db->Query(\"SELECT type,COUNT(DISTINCT supporter_id) AS total FROM activities where \".str_replace($f, $r,implode(\"&&\", $this->filters)).\" GROUP BY TYPE\");\n\t\t\n\t\t$out = array(\n\t\t\t1 => array('total' => 0, 'parts' => 0, 'schools' => 0),\n\t\t\t2 => array('total' => 0, 'parts' => 0, 'schools' => 0),\n\t\t\t3 => array('total' => 0, 'parts' => 0, 'schools' => 0) \n\t\t);\n\t\t\n\t\t\n\t\tforeach ( $totals as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['total'] = $item['total'];\n\t\t}\n\t\t\n\t\tforeach ( $schools as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['schools'] = $item['total'];\n\t\t}\n\t\t\n\t\tforeach ( $parts as $item) {\n\t\t\t\n\t\t\t$out[$item['type']]['parts'] = $item['total'];\n\t\t}\n\t\t\n\t\t/*\n\t\t$tmp = Util::groupMultiArray($this->data,'type');\n\t\t\n\t\tforeach ($tmp as $type => $typedata){\n\t\t\t\n\t\t\t$out[$type]['total'] = count($typedata);\n\t\t\t\n\t\t\t$parts = Util::groupMultiArray($typedata,'supporter_id');\n\t\t\t$out[$type]['parts'] = count($parts);\n\t\t\t\n\t\t\t$schools = Util::groupMultiArray($typedata,'school_id');\n\t\t\t$out[$type]['schools'] = count($schools);\t\n\t\t}*/\n\t\t\n\t\treturn $out;\n\t}",
"function by_age($students, $age)\n {\n for($i=0; $i<count($students)-1; $i++)\n {\n $ages[$i] = $students[$i]['age'];\n }\n sort($ages);\n for($j=0; $j<count($students)-1; $j++)\n {\n if($ages[$age] == $students[$j]['age'])\n {\n print $students[$j]['name'] .'-'. $students[$j]['age'];\n }\n }\n }",
"function theme_moove_order_courses_by_shortname(&$array_courses){\n\n $grouped_courses_array = array();\n $regular_courses_array = array();\n $no_regular_courses_array = array();\n $counter = 0;\n\n foreach($array_courses as $key=>&$course){\n\n $idcourse = $course->id;\n $timecreated = $this->theme_moove_get_timecreated_course($idcourse);\n $timemodified = $this->theme_moove_get_timemodified_course($idcourse);\n $categoryid = $this->theme_moove_get_course_category($idcourse);\n\n $course->timecreated = $timecreated;\n $course->timemodified = $timemodified;\n $course->categoryid = $categoryid;\n\n // Validación para cursos regulares\n if($course->categoryid >= 30001 && $course->categoryid <= 30999){\n\n array_push($regular_courses_array, $course);\n\n $explode_course_shortname = explode(\"-\", $course->shortname);\n\n // Se verifica que tenga en su nombre corto la especificación de fecha de creación\n // una vez identificada se le añade como atributo al curso\n if(count($explode_course_shortname) && preg_match(\"/^20/\", $explode_course_shortname[3])){\n $date_course = substr($explode_course_shortname[3], 0, -3);\n $course->date_course = $date_course;\n }\n\n }else{\n // Cursos no regulares\n array_push($no_regular_courses_array, $course);\n }\n }\n\n $this->array_sort_by($regular_courses_array, 'timecreated', $order = SORT_DESC);\n $this->array_sort_by($no_regular_courses_array, 'timecreated', $order = SORT_DESC);\n\n $grouped_courses_array['regular_courses'] = $regular_courses_array;\n $grouped_courses_array['no_regular_courses'] = $no_regular_courses_array;\n\n return $grouped_courses_array;\n }",
"public function getstudentbymajor($data) {\n $year = $data['year'];\n $major = $data['major'];\n\n if ($major == \"all\") {\n $this->db->where('year', $year);\n } else {\n $this->db->where('year', $year)->where('major', $major);\n }\n $query = $this->db->from('student_establish')->join('student', \"student.id_st= student_establish.id_st\")->get()->result_array();\n return $query;\n }",
"function __construct($schoolId){\n $query = \"SELECT * FROM school WHERE id='$schoolId'\";\n $result = mysql_query($query) or die(mysql_error());\n $row = mysql_fetch_array($result);\n $this->schoolId = $schoolId;\n $this->schoolName = $row['schoolName'];\n $this->numStudents = $row['numStudents'];\n $this->numAdvisers = $row['numAdvisers'];\n $this->totalAttendees = $this->numStudents + $this->numAdvisers;\n $this->regTime = $row['regTime'];\n $this->address = array();\n $this->address['1'] = $row['address1'];\n $this->address['2'] = $row['address2'];\n $this->address['city'] = $row['city'];\n $this->address['state'] = $row['state'];\n $this->address['zip'] = $row['zip'];\n $this->address['countryId'] = $row['country'];\n $this->address['country'] = country::getCountryName($this->address['countryId']);\n $this->hearAboutUs = $row['hearAboutUs'];\n $this->finAid = $row['finaid'];\n $this->stayInHotel = $row['stayInHotel'];\n $this->countryId = array();\n $this->countryName = array();\n for($i = 1; $i<=school::NUM_COUNTRY_PREFS; $i++){\n $this->countryId[$i] = $row['country'.$i];\n $this->countryName[$i] = country::getCountryName($this->countryId[$i]);\n }\n $this->numSpecialPositions = $row['numSpecialPositions'];\n $this->countryConfirm = $row['countryConfirm'];\n $this->finaidQuestion = array();\n for($i = 1; $i<=5; $i++){\n $this->finaidQuestion[$i] = $row['finaidQuestion'.$i];\n }\n $this->userIds = user::getSchoolUsers($this->schoolId);\n $this->getPayments();\n $this->getAttendees();\n $this->getStatus();\n }",
"function build_school_list(){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT school_id, name '.\r\n\t\t\t 'FROM school;';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\tdie ('Error '. mysqli_errno($dbc) .'<br />');\r\n\t}\r\n\telse {\r\n\t\t$temparr = array();\r\n\t\twhile($row = mysqli_fetch_object($result)){\r\n\t\t\t$temparr[$row->school_id] = $row->name;\r\n\t\t}\r\n\t\treturn $temparr;\r\n\t}\r\n}",
"public function get_school_list()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('cms_schools');\n\t\t$this->db->where('schl_status','0');\n\t\t$query = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $query->result();\n\t}",
"public function add_school($school) {\n\t\t$repository = $this->em->getRepository ( 'AcmeMyBundle:School' );\n\t\t$saved_school = $repository->findOneBy ( array (\n\t\t\t\t'name' => $school->getName (),\n\t\t\t\t'state' => $school->getState () \n\t\t) );\n\t\t$s = null;\n\t\tif ($saved_school == null) {\n\t\t\ttry {\n\t\t\t\t$s = $school;\n\t\t\t\t// query greatschools.org API\n\t\t\t\t$key = '6nx7p1nfibuutxapl3vkmwxx';\n\t\t\t\t$state = $school->getState ();\n\t\t\t\t$query_url = 'http://api.greatschools.org/search/schools?key=' . $key . '&state=' . $state . '&q=' . urlencode ( $school->getName () ) . '&limit=1';\n\t\t\t\t$xml = file_get_contents ( $query_url );\n\t\t\t\t$parsed_xml = simplexml_load_string ( $xml );\n\t\t\t\tif ($parsed_xml === false) {\n\t\t\t\t\tthrow new \\Exception ( 'error in parsing school xml' );\n\t\t\t\t}\n\t\t\t\tif (! isset ( $parsed_xml->school->gsId )) {\n\t\t\t\t\tthrow new \\Exception ( 'school xml is empty and query name is: ' . $school->getName () );\n\t\t\t\t}\n\t\t\t\t$s->setAddress ( ( string ) $parsed_xml->school->address );\n\t\t\t\t$s->setCity ( ( string ) $parsed_xml->school->city );\n\t\t\t\t$s->setDistrict ( ( string ) $parsed_xml->school->district );\n\t\t\t\t$s->setGradeRange ( ( string ) $parsed_xml->school->gradeRange );\n\t\t\t\t$s->setGsId ( ( string ) $parsed_xml->school->gsId );\n\t\t\t\t$s->setGsRating ( ( string ) $parsed_xml->school->gsRating );\n\t\t\t\t$s->setLatitude ( ( string ) $parsed_xml->school->lat );\n\t\t\t\t$s->setLongitude ( ( string ) $parsed_xml->school->lon );\n\t\t\t\t$s->setParentRating ( ( string ) $parsed_xml->school->parentRating );\n\t\t\t\t$s->setType ( ( string ) $parsed_xml->school->type );\n\t\t\t\t// query census data\n\t\t\t\t$query_url = 'http://api.greatschools.org/school/census/' . $state . '/' . $s->getGsId () . '?key=' . $key;\n\t\t\t\t$xml = file_get_contents ( $query_url );\n\t\t\t\t$parsed_xml = simplexml_load_string ( $xml );\n\t\t\t\t$s->setEnrollment ( ( string ) $parsed_xml->enrollment );\n\t\t\t\t$s->setStudentTeacherRatio ( ( string ) $parsed_xml->studentTeacherRatio );\n\t\t\t\t// TODO: add races\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\techo $e->getMessage () . \"\\r\\n\";\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\t$s = $saved_school;\n\t\t}\n\t\t$this->em->persist ( $s );\n\t\t$this->em->flush ();\n\t\treturn $s;\n\t}",
"public function getMajor(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}",
"public function get_school($sch_type_id)\n {\n\t$this->db->where('school_type_id', $sch_type_id);\n\t$this->db->where('active', 1);\n\t//$cont_query = $this->db->get_where('school_tb',$cont_array,\"\",\"\");\n\t$cont_query = $this->db->get('school_tb');\n\t//var_dump($cont_query);\n\t//print_r($cont_query->result_array());\n return $cont_query->result_array();\t\t\t\n \n }",
"public function show(School $school)\n {\n //\n }",
"public function show(School $school)\n {\n //\n }",
"public function get_subjects_list_for_school()\n\t{\n\t\t$schl_id = $this->input->post('schl_id');\n\t\t//print_r($schl_id);\n\t\t$result['subject_info'] = $this->tmtl->get_subjects_by_school_id($schl_id);\n\t\techo json_encode($result);\n\t}",
"public function asort() {}",
"function list_school(){\n\n\t $this->load->view('header',$this->data); \n $this->data['school_details']=$this->Masters_model->list_school();\n $this->load->view('Masters/list_school',$this->data);\n $this->load->view('footer');\n\n\n\t}",
"public function list_assigned_schools($user_id = FALSE) \r {\r // $user_id required\r \r if ($user_id === FALSE) {\r }\r else {\r $assignments_table = $this->db->dbprefix('assignments');\r $locations_table = $this->db->dbprefix('locations');\r \r $query_text = \"\r SELECT $locations_table.id as school_id, \r $locations_table.name as school_name, \r $locations_table.days_btwn_visits\r FROM $locations_table, \r $assignments_table\r WHERE $assignments_table.location_id = $locations_table.id\r AND $assignments_table.user_id = '$user_id'\r AND $locations_table.active = 'Y'\r ORDER BY school_name ASC\"; \r \r $query = $this->db->query($query_text);\r return $query->result_array();\r }\r }",
"function get_uc_groups_by_geography( $geography_array, $post_status = 'publish', $school_year = false ) {\n\t$teachers = get_uc_teachers_by_geography( $geography_array, $post_status );\n\n\t$args = array(\n\t\t'post_type' => 'uc_group',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\t'relation' => 'OR'\n\t\t),\n\t);\n\n\tif ( $school_year ) {\n\t\t$school_year_array = get_school_year( $school_year );\n\t\t$args['date_query'] = array(\n\t\t\tarray(\n\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t'inclusive' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\tforeach ( $teachers as $teacher )\n\t\t$args['meta_query'][] = array( 'key' => 'teacher', 'value' => $teacher['value'] );\n\n\t$result = array();\n\t$wp_posts = get_posts($args);\n\tforeach ($wp_posts as $post) {\n\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t}\n\treturn $result;\n}",
"public function createSchoolWithDetails(array $data);",
"function sortByClass() {\n debugPrint(\"Sort by class\");\t \n $this->ararSortedStandIns = array();\n $arStandIns = $this->oParser->oManager->getStandIns();\n foreach($arStandIns as $oStandIn) {\n $strClass = $oStandIn->getClass();\n // Don't take the lessons as the indices, as there can be multiple\n // courses at the same time (e.g. elective courses)\n $this->ararSortedStandIns[$strClass][] = $oStandIn;\n usort($this->ararSortedStandIns[$strClass], \"vpSortByLesson\");\n }\n natSortKey($this->ararSortedStandIns);\n }",
"function cmpSemester($a, $b) {\n \n global $semesters;\n\n // Assumption is being made on the comparison where a/b is:\n // YEAR SEMESTER_NAME DEPARTMENT COURSE_NUMBER SECTION_NUMBER\n list($a_year, $a_semester, $a_department, $a_course_number, $a_section_number) = explode(' ', $a);\n list($b_year, $b_semester, $b_department, $b_course_number, $b_section_number) = explode(' ', $b);\n\n if ($a_year != $b_year) {\n return strcmp($a_year, $b_year);\n } else if ($a_semester != $b_semester) {\n return strcmp($semesters[$a_semester], $semesters[$b_semester]);\n } else if ($a_department != $b_department) {\n return strcmp($a_department, $b_department);\n } else if ($a_course_number != $b_course_number) {\n return strcmp($a_course_number, $b_course_number);\n } else if ($a_section_number != $b_section_number) {\n return strcmp($a_section_number, $b_section_number);\n }\n\n return 0;\n}",
"public function getWhatIfData(School $school)\n {\n $whatIfData = $this->getMembershipData('PR');\n\n $moe = new Moe($this->school->getModel());\n $teacherMoe = $moe->getTeacherMoe($whatIfData);\n\n $dataSet = array(\n 'whatif' => $this->backwardCompatibleMembershipFormat($whatIfData),\n 'teacherMoe' => $moe->backwardCompatibleMoeFormat($teacherMoe), //$whatIfData['teacherMoe']), // $teacherMoe),\n 'taMoe' => $moe->getAssistantMoe('PR')\n );\n\n return $dataSet;\n }",
"public function schoolOfHumanitiesAndSocialSciences(){\n $name = 'SCHOOL OF HUMANITIES AND SOCIAL SCIENCES';\n $title = 'SHSS';\n\t\t$students = DB::table('students')\n ->where('students.faculty', '=', 'SHSS')->where('state', '=', 'Activated')\n ->whereNotIn('students.studentNo', function($q){\n $q->select('students_studentNo')->from('charge');\n })->paginate(15);\n\n return view('staff/faculty', compact('name','title','students'));\n\t}"
]
| [
"0.55212367",
"0.5400751",
"0.53849584",
"0.5379177",
"0.5371904",
"0.5297006",
"0.5292969",
"0.5268308",
"0.51599336",
"0.5158711",
"0.5154702",
"0.5128926",
"0.5094118",
"0.50899875",
"0.5087187",
"0.50431824",
"0.49920872",
"0.4902799",
"0.4898545",
"0.4898545",
"0.488725",
"0.4865825",
"0.48651534",
"0.48648033",
"0.4856973",
"0.4831853",
"0.480959",
"0.47869477",
"0.47825575",
"0.47823542"
]
| 0.6779914 | 0 |
organize affliates by donation Amounts | public function getStatisticByAffliate (){
$affliate = array();
$amounts = array();
$donorcount = array();
$tmp = $this->getDonationsByAffliate();
// transform it to to be abel to plot on the graph
foreach ($tmp as $dt => $data){
$affliate[] = $data['account'];
$amounts[] = $data['donation'];
$donorcount[] = $data['donorcount'];
}
return array('label' => $affliate, 'amounts' => $amounts, 'donorcount' => $donorcount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchTotalDonations() {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT user_id, sum(amount) as total FROM donation group by user_id\");\n\t$results = $query->results();\n\t$s = array();\n\tforeach ($results as $u) {\n\t\t$s[\"$u->user_id\"] = $u->total;\n\t}\n\treturn $s;\n\t\n}",
"public function get_total_amounts_donated()\n {\n $this->db->select('\n totals_donations.firstname,\n totals_donations.lastname,\n totals_donations.streetaddress,\n totals_donations.total_amount_donated AS total_company,\n totals_contributors.total_amount_donated AS total_other'\n );\n\n $this->db->from('totals_donations');\n\n $this->db->join('totals_contributors', 'totals_donations.lastname = totals_contributors.lastname AND totals_donations.firstname = totals_contributors.firstname AND totals_donations.city = totals_contributors.city AND totals_donations.state = totals_contributors.state');\n\n $this->db->group_by('lastname');\n\n $query = $this->db->get();\n\n return $query;\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 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}",
"protected function addDonationToFundraisersTotalRaise()\n {\n $this->fundraiser_profile->addDonation( $this->data['amount'] );\n $this->fundraiser_profile->update();\n }",
"function recalculatingPaymentTotals() {\n $invoice_objects_table = TABLE_PREFIX . 'invoice_objects';\n $payments_table = TABLE_PREFIX . 'payments';\n\n // set balance due to invoice total\n DB::execute('UPDATE ' . $invoice_objects_table . ' SET balance_due = total');\n\n $total_payments = DB::execute('SELECT parent_id AS invoice_id, SUM(amount) AS paid_amount FROM ' . $payments_table . ' WHERE parent_type = ? AND status = ? GROUP BY parent_id ORDER BY parent_id ASC', 'Invoice', 'Paid');\n if ($total_payments) {\n foreach ($total_payments as $total_payment) {\n $invoice_id = $total_payment['invoice_id'];\n $paid_amount = $total_payment['paid_amount'];\n $invoice_total = DB::executeFirstCell('SELECT total FROM ' . $invoice_objects_table . ' WHERE id = ? AND type = ?', $invoice_id, 'Invoice');\n $balance_due = $invoice_total - $paid_amount;\n DB::execute('UPDATE ' . $invoice_objects_table . ' SET balance_due = ?, paid_amount = ? WHERE id = ? AND type = ?', $balance_due, $paid_amount, $invoice_id, 'Invoice');\n } // foreach\n } // if\n }",
"function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}",
"public function rankAffiliatesByRevenue()\n {\n $this->affiliates = DB::select(\"SELECT SUM(sale_amount) AS 'revenue', affiliate_id FROM \" . $this->source_table . \" GROUP BY (affiliate_id) ORDER BY sale_amount DESC LIMIT 1000;\");\n }",
"private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }",
"public function calculateLoanRepaymentDue($date) {\n // Active loans due on the given date\n $loans = $this->model\n ->with(['paymentFrequency'])\n ->where('next_repayment_date', $date)\n ->where('end_date', null)\n ->get();\n\n if (isset($loans)){\n foreach ($loans as $loan) {\n DB::beginTransaction();\n try\n {\n if(null !== $loan){\n // Its the first period of repayment so get details from the loan itself\n $loanAmount = $loan['amount_approved'];\n $totalPeriods = $loan['repayment_period'];\n $rate = $loan['interest_rate'];\n\n $periodCounter = 0;\n\n $totalPrincipal = DB::table('loan_principal_repayments')\n ->select(DB::raw('SUM(amount) as totalPrincipal, COUNT(period_count) as counter'))\n ->where('loan_id', $loan['id'])->get();\n\n if (isset($totalPrincipal)){\n foreach ($totalPrincipal->toArray() as $principal) {\n if (null !== $principal) {\n $periodCounter = $principal->counter;\n }\n }\n }\n\n // Check if Loan Principal balance has been reduced by direct transactions\n $totalPrincipalReduction = DB::table('transactions')\n ->select(DB::raw('SUM(amount) as totalPrincipalReduction'))\n ->where('transaction_type', 'balance_reduction')\n ->where('loan_id', $loan['id'])\n ->get();\n\n if (isset($totalPrincipalReduction)){\n foreach ($totalPrincipalReduction->toArray() as $totalReduction) {\n if (null !== $totalReduction) {\n $loanAmount = $loanAmount - $totalReduction->totalPrincipalReduction;\n }\n }\n }\n\n $loanInterestType = $this->interestTypeRepository->getWhere('id', $loan->interest_type_id)->name;\n switch ($loanInterestType){\n case 'reducing_balance':{\n $payment = $this->calculatePeriodicalReducingBalancePayment($loanAmount, $totalPeriods, $rate, $periodCounter+1)['payment'];\n $interest = $this->calculatePeriodicalReducingBalancePayment($loanAmount, $totalPeriods, $rate, $periodCounter+1)['interest'];\n $principal = $this->calculatePeriodicalReducingBalancePayment($loanAmount, $totalPeriods, $rate, $periodCounter+1)['principal'];\n $count = $this->calculatePeriodicalReducingBalancePayment($loanAmount, $totalPeriods, $rate, $periodCounter+1)['count'];\n }\n break;\n case 'fixed': {\n $payment = $this->calculatePeriodicalFixedInterest($loanAmount, $totalPeriods, $rate, $periodCounter+1)['payment'];\n $interest = $this->calculatePeriodicalFixedInterest($loanAmount, $totalPeriods, $rate, $periodCounter+1)['interest'];\n $principal = $this->calculatePeriodicalFixedInterest($loanAmount, $totalPeriods, $rate, $periodCounter+1)['principal'];\n $count = $this->calculatePeriodicalFixedInterest($loanAmount, $totalPeriods, $rate, $periodCounter+1)['count'];\n }\n break;\n default: {\n $payment = 0;\n $interest = 0;\n $principal = 0;\n $count = 0;\n }\n }\n\n $dueDate = $this->calculateDueDate($loan['start_date'],\n $loan->paymentFrequency->name,\n $count\n );\n\n // Due interest repayment entry\n $interestDue = $this->loanInterestRepayment->create([\n 'branch_id' => $loan['branch_id'],\n 'loan_id' => $loan['id'],\n 'period_count' => $count,\n 'due_date' => $dueDate,\n 'amount' => $interest,\n 'paid_on' => null\n ]);\n\n // Journal entry for the interest due\n $this->journalRepository->interestDue($loan, $interest, $interestDue->id);\n\n // Due principal repayment entry\n $this->loanPrincipalRepayment->create([\n 'branch_id' => $loan['branch_id'],\n 'loan_id' => $loan['id'],\n 'period_count' => $count,\n 'due_date' => $dueDate,\n 'amount' => $principal,\n 'paid_on' => null\n ]);\n\n // Update loan for future due date\n $next_repayment_date = $this->calculateDueDate($loan['next_repayment_date'], $loan->paymentFrequency->name, 1);\n Loan::where('id', $loan['id'])->update([\n 'next_repayment_date' => $next_repayment_date\n ]);\n\n // We have come to the end of periodic payments\n if($periodCounter+1 == $totalPeriods){\n Loan::where('id', $loan['id'])->update([\n 'end_date' => $next_repayment_date,\n 'next_repayment_date' => null\n ]);\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n throw $e;\n }\n }\n }\n }",
"function aff()\n {\n $invoice_order = App\\Invoice\\Model\\InvoiceOrderModel::find(1);\n $invoice_order_aff = new \\App\\Invoice\\InvoiceService\\Affiliate();\n $invoice_order_aff->active($invoice_order);\n }",
"function ed_charitable_edd_print_payment_donations( $payment_id ) {\n $output = '';\n \n $campaign_donations = Charitable_EDD_Payment::get_instance()->get_campaign_donations_through_payment( $payment_id );\n \n if ( ! $campaign_donations ) {\n return $output;\n }\n \n foreach ( $campaign_donations as $campaign_donation ) {\n\n /** \n * Variables you can use:\n *\n * $campaign_donation->campaign_name = The name of the campaign that received a donation.\n * $campaign_donation->campaign_id = The ID of the campaign that received a donation.\n * $campaign_donation->donation_id = The ID of the donation.\n * $campaign_donation->amount = The amount donated.\n */\n $output .= $campaign_donation->campaign_name . ': ' . charitable_format_money( $campaign_donation->amount ) . PHP_EOL;\n\n }\n \n return $output;\n}",
"public function consolidatedLoanBalanceAggregateAt($collection){\n $sumBal=0;\n\n //find unique users\n $uniqueUsers = $collection->unique('user_id');\n foreach($uniqueUsers as $item){\n\n //total debit\n $totalDebit = $collection->where('user_id',$item->user_id)\n ->sortBy('date_entry')\n ->sum('debit');\n //total credit\n $totalCredit = $collection->where('user_id',$item->user_id)\n ->sortBy('date_entry')\n ->sum('credit');\n\n $bal = $totalDebit-$totalCredit;\n $sumBal = $sumBal+$bal;\n }\n return $sumBal;\n }",
"public function getSumma()\n {\n $summa = 0;\n\n foreach ($purchases as $purchase) {//place for future comments\n\n if($purchase->status_bought == 1)\n {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != 0 && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != 0)\n\n {//\n\n if (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2)) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif(round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;//\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n } elseif (round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n } elseif (round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n // \n } elseif($purchase->first()->book->discont_privat != 0 && $purchase->magazin->discont_privat != 0)\n\n {//\n if($purchase->first()->book->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n\n }\n\n elseif($purchase->magazin->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n //\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {//\n\n if($purchase->first()->book->author->status_discont_id == 1) \n\n {//\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n elseif($purchase->magazin->author->status_discont_id == 1) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n // \n } else \n\n {//\n\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n } \n\n }\n return $summa;\n\n }",
"private function aggregate($opinionz){\n $count = count($opinionz);\n\n if($count == 0) return $opinionz;\n\n $total = 0;\n\n foreach ($opinionz as $opinion) {\n $int_Votes = intval($opinion->getVotes());\n $votes = $int_Votes? $int_Votes : 0;\n $total += $votes;\n }\n\n foreach ($opinionz as $i => $opinion) {\n $opinionz[$i]->pct = $opinion->getVotes() / $total * 100;\n }\n return $opinionz;\n }",
"public function getStatForDonations() {\r\n // TODO: Move to config\r\n $requiredPerYear = 1000;\r\n $requiredPerMonth = 85;\r\n\r\n // Calculate donations received for current year\r\n $result = $this->dao->query(\"\r\n SELECT\r\n SUM(amount) AS YearDonation,\r\n year(NOW()) AS yearnow,\r\n month(NOW()) AS month,\r\n quarter(NOW()) AS quarter\r\n FROM\r\n donations\r\n WHERE\r\n created > CONCAT(CONCAT(year(NOW()), '-01'), '-01')\r\n \");\r\n $rowYear = $result->fetch(PDB::FETCH_OBJ);\r\n\r\n switch ($rowYear->quarter) {\r\n case 1:\r\n $start = $rowYear->yearnow . \"-01-01\";\r\n $end = $rowYear->yearnow . \"-04-01\";\r\n break;\r\n case 2:\r\n $start = $rowYear->yearnow . \"-04-01\";\r\n $end = $rowYear->yearnow . \"-07-01\";\r\n break;\r\n case 3:\r\n $start = $rowYear->yearnow . \"-07-01\";\r\n $end = $rowYear->yearnow . \"-10-01\";\r\n break;\r\n case 4:\r\n $start = $rowYear->yearnow . \"-10-01\";\r\n $end = $rowYear->yearnow . \"-12-31\";\r\n break;\r\n }\r\n\r\n $query = \"\r\n SELECT\r\n SUM(ROUND(amount)) AS Total,\r\n year(now()) AS year\r\n FROM\r\n donations\r\n WHERE\r\n created >= '$start'\r\n AND\r\n created < '$end'\r\n \";\r\n $result = $this->dao->query($query);\r\n\r\n $row = $result->fetch(PDB::FETCH_OBJ);\r\n $row->QuarterDonation = sprintf(\"%d\", $row->Total);\r\n $row->MonthNeededAmount = $requiredPerMonth;\r\n $row->YearNeededAmount = $requiredPerYear;\r\n $row->QuarterNeededAmount = $requiredPerMonth * 3;\r\n $row->YearDonation = $rowYear->YearDonation;\r\n\r\n return $row;\r\n }",
"public function getTotalPaid();",
"private function add_rolls_up_to_relation() {\n foreach ($this->class_details as $classid => &$cl_details) {\n foreach ($cl_details['constituents'] as $c) {\n $this->class_details[$c]['rolls_up_to'][] = $classid;\n }\n }\n\n // Propagate 'rolls_up_to' relation across non-racing aggregate classes\n do {\n $repeat = false;\n foreach ($this->class_details as $classid => &$cl_details) {\n foreach ($cl_details['rolls_up_to'] as $c) {\n if (count($this->class_details[$c]['rounds']) == 0) {\n foreach ($this->class_details[$c]['rolls_up_to'] as $q) {\n if (!in_array($q, $cl_details['rolls_up_to'])) {\n $cl_details['rolls_up_to'][] = $q;\n $repeat = true;\n }\n }\n }\n }\n }\n } while ($repeat);\n }",
"public function donations(){\n include_once 'donation.class.php';\n return $this->get_dependents('donation');\n }",
"function make_all_payments($date) {\n $money = 0;\n foreach ($this->list as $this_loan) {\n $money += $this_loan->make_payment($date);\n }\n return $money;\n }",
"public function getTotalDiscountAmount();",
"public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"function getMyAffiliates($uID = null)\n\t\t{\n\t\t\t$query = \"select affiliate_id,associated_aff_id,status from tbl_affiliate_association where affiliate_id = $uID || associated_aff_id=$uID \";\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\t$arrAffiliates = array();\n\t\t\tif($rs->RecordCount()) {\t\t\t\n\t\t\t\twhile($row = $rs->FetchRow())\n\t\t\t\t{\n\t\t\t\t\tif($row['associated_aff_id']!=$uID)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($row['status']=='confirmed')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arrAffiliates[] \t= $row['associated_aff_id'];\n\t\t\t\t\t\t\t$arrStatus[] \t= $row['status'];\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$arrAffiliates[] \t= $row['affiliate_id'];\n\t\t\t\t\t\t$arrStatus[] \t= $row['status'];\t\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t$arrAffiliates=array_combine($arrAffiliates,$arrStatus);\n\t\t\t\t\t\n\t\t\t$myAffiliates = array();\n\t\n\t\t\tif(count($arrAffiliates) > 0) {\n\t\t\t\t\n\t\t\t\tforeach($arrAffiliates as $affID=>$affStatus) {\n\t\t\t\t\t\n\t\t\t\t\t$query = \"select first_name, last_name , reg_date , banner, description, donation_url,organisation_name \n\t\t\t\t\tfrom tbl_member , tbl_affiliate where member_id = '$affID' and affiliate_id = '$affID'\";\n\t\t\t\t\t$rs = $this->Execute($query);\n\t\t\t\t\t\n\t\t\t\t\t$myAffiliate = array();\t\n\t\t\t\t\t\n\t\t\t\t\twhile($row = $rs->FetchRow()) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$row['member_id'] \t \t\t=\t$affID;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$row['name'] \t\t\t\t=\t$row['first_name'].\" \".$row['last_name'];\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t$myAffiliate['reg_date'] \t\t\t=\t$row['reg_date'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$myAffiliate['banner'] \t\t\t\t=\t$row['banner'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$myAffiliate['organisation_name'] \t=\t$row['organisation_name'];\t\t\n\t\t\t\t\t\t\t$myAffiliate['donation_url'] \t\t= \t$row['donation_url'];\t\n\t\t\t\t\t\t\t$myAffiliate['description'] \t\t=\t$row['description'];\t\t\n\t\t\t\t\t\t\techo \"<pre>----\";\n\t\t\t\t\t\t\tprint_r($row);\n\t\t\t\t\t\t*/\t\t\t\t\t\t\n\t\t\t\t\t\t$row['status']\t=\t$affStatus;\n\t\t\t\t\t\t$myAffiliates[] = $row;\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\n\t\t\t}\n\t\t\t\n\t\t\treturn $myAffiliates;\n\t\t}",
"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}",
"protected function checkTotalRoseAff_m($affiliate_id){\n $sql = \"SELECT SUM(tbl_order_referal.total_rose) as 'total_rose_aff' FROM tbl_referal, tbl_order_referal WHERE tbl_referal.id = tbl_order_referal.referal_id AND tbl_referal.affiliate_id =:affiliate_id GROUP BY tbl_referal.affiliate_id\";\n $result = $this->pdo->prepare($sql);\n $result->bindParam(\":affiliate_id\", $affiliate_id);\n $result->execute();\n return $result->fetch(PDO::FETCH_ASSOC);\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 static function calculateEffectiveAmendmentValues($rowData)\n {\n // These are already sorted by ascending source_fiscal\n\n foreach ($rowData as $row) {\n // Fix for situations where the end year is earlier than the start year\n // use whichever is later of the start year or the source year (when it was published).\n if ($row->gen_end_year < $row->gen_start_year) {\n $row->gen_end_year = $row->gen_start_year;\n if ($row->source_year > $row->gen_end_year) {\n $row->gen_end_year = $row->source_year;\n }\n }\n }\n\n // We're using Collection methods here, which are great:\n // https://laravel.com/docs/5.6/collections\n\n // Step 1: find the earliest and latest years of the contract\n $earliestYear = $rowData->min('gen_start_year');\n\n // Update: rather than the maximum end year, it should actually be the end year of the *last* row in the (ordered by source_fiscal) array of amendments.\n // In some cases, the contract gets *shortened* from what was originally planned.\n // $latestYear = $rowData->max('gen_end_year');\n $latestYear = $rowData->last()->gen_end_year;\n\n // Edge cases where the end year is earlier than the start year, use the last one's start year instead:\n if ($rowData->last()->gen_start_year > $rowData->last()->gen_end_year) {\n $latestYear = $rowData->last()->gen_start_year;\n }\n\n $originalValue = $rowData->min('original_value');\n if (! $originalValue) {\n $originalValue = $rowData->min('contract_value');\n }\n\n // Step 2: create an array range of each year in this set, and then match each year with the most updated amendment row ID\n\n $years = range($earliestYear, $latestYear);\n $yearMapping = [];\n\n $firstRow = 1;\n $genAmendmentGroupId = null;\n\n foreach ($rowData as $row) {\n // Store this for error tracking later (it's the same for all rows in rowData)\n if (! $genAmendmentGroupId) {\n $genAmendmentGroupId = $row->gen_amendment_group_id;\n }\n\n foreach ($years as $year) {\n if ($firstRow) {\n // Use the start_year since this is the beginning\n // even if the source_year is later (if it was retroactively published)\n if ($row->gen_start_year <= $year && $row->gen_end_year >= $year) {\n $yearMapping[$year] = $row->id;\n }\n } else {\n // Use the source_year instead of the start_year\n if ($row->source_year <= $year && $row->gen_end_year >= $year) {\n $yearMapping[$year] = $row->id;\n }\n }\n }\n\n $firstRow = 0;\n }\n\n // dd($yearMapping);\n // var_dump($yearMapping);\n // array:3 [\n // 2010 => 1251303\n // 2011 => 1250608\n // 2012 => 1250608\n // ]\n\n // Step 3: loop through rows again and set effective start and end years\n $cumulativeTotal = 0;\n $firstRow = 1;\n $rowIdsToUpdate = [];\n\n foreach ($rowData as $row) {\n $effectiveStartYear = null;\n $effectiveEndYear = null;\n\n foreach ($yearMapping as $year => $rowId) {\n if ($rowId == $row->id) {\n // If they match, update the effective start and end years\n // echo \"Match: \" . $row->id . \" for \" . $year . \"\\n\";\n if ($effectiveStartYear == null || $year < $effectiveStartYear) {\n $effectiveStartYear = $year;\n }\n if ($effectiveEndYear == null || $year > $effectiveEndYear) {\n $effectiveEndYear = $year;\n }\n } else {\n // echo \"No match for: \" . $row->id . \" for \" . $year . \"\\n\";\n }\n }\n\n if ($effectiveStartYear == null || $effectiveEndYear == null) {\n // If this row ID isn't in the yearMapping array, skip to the next row.\n // echo \"Skipping... \\n\";\n continue;\n }\n\n $rowIdsToUpdate[] = $row->id;\n // echo \"here for \" . $row->id . \"\\n\";\n\n $row->gen_effective_start_year = $effectiveStartYear;\n $row->gen_effective_end_year = $effectiveEndYear;\n\n // Effective total value is, the theoretical yearly value of the contract over the originally planned start and end years\n if ($firstRow) {\n $theoreticalYearlyValue = $row->contract_value / ($row->gen_end_year - $row->gen_start_year + 1);\n } else {\n // Update 2021-04-03: Subtract the cumulative total from the latest contract value here, before averaging across the years between the row's end year and source year\n $theoreticalYearlyValue = ($row->contract_value - $cumulativeTotal) / ($row->gen_end_year - $row->source_year + 1);\n }\n \n\n // dd($effectiveEndYear);\n\n $row->gen_effective_total_value = $theoreticalYearlyValue * ($effectiveEndYear - $effectiveStartYear + 1);\n $row->gen_effective_yearly_value = $row->gen_effective_total_value / ($effectiveEndYear - $effectiveStartYear + 1);\n\n $cumulativeTotal += $row->gen_effective_total_value;\n\n $firstRow = 0;\n }\n\n $updatesSaved = 0;\n // Update the rows in the database:\n foreach ($rowData as $index => $row) {\n $isFinalValue = 0;\n if ($index == count($rowData) - 1) {\n $isFinalValue = 1;\n }\n \n\n // Make sure there are actually changes\n if (in_array($row->id, $rowIdsToUpdate)) {\n DB::table('l_contracts')\n ->where('owner_acronym', '=', $row->owner_acronym)\n ->where('id', '=', $row->id)\n ->update([\n 'gen_effective_start_year' => $row->gen_effective_start_year,\n 'gen_effective_end_year' => $row->gen_effective_end_year,\n 'gen_effective_total_value' => $row->gen_effective_total_value,\n 'gen_effective_yearly_value' => $row->gen_effective_yearly_value,\n 'gen_original_value' => $originalValue,\n 'gen_is_most_recent_value' => $isFinalValue,\n ]);\n $updatesSaved = 1;\n // echo \"Updated \" . $row->id . \"\\n\";\n } else {\n // Update the effective total and yearly values, but not the start and end years\n // these are amendments that were overridden by other amendments in the same year.\n DB::table('l_contracts')\n ->where('owner_acronym', '=', $row->owner_acronym)\n ->where('id', '=', $row->id)\n ->update([\n 'gen_effective_total_value' => 0,\n 'gen_effective_yearly_value' => 0,\n ]);\n }\n }\n\n if ($updatesSaved) {\n return true;\n } else {\n echo \"No updates for gen_amendment_group_id \" . $genAmendmentGroupId . \"\\n\";\n return false;\n }\n }",
"public function get_data() {\n\n\t\t$data = array();\n\t\t$i = 0;\n\t\t// Payment query.\n\t\t$payments = give_get_payments( $this->get_donation_argument() );\n\n\t\tif ( $payments ) {\n\n\t\t\tforeach ( $payments as $payment ) {\n\n\t\t\t\t$columns = $this->csv_cols();\n\t\t\t\t$payment = new Give_Payment( $payment->ID );\n\t\t\t\t$payment_meta = $payment->payment_meta;\n\t\t\t\t$address = $payment->address;\n\n\t\t\t\t// Set columns.\n\t\t\t\tif ( ! empty( $columns['donation_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_id'] = $payment->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['seq_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['seq_id'] = Give()->seq_donation_number->get_serial_code( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['title_prefix'] ) ) {\n\t\t\t\t\t$data[ $i ]['title_prefix'] = ! empty( $payment->title_prefix ) ? $payment->title_prefix : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['first_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['first_name'] = isset( $payment->first_name ) ? $payment->first_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['last_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['last_name'] = isset( $payment->last_name ) ? $payment->last_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['email'] ) ) {\n\t\t\t\t\t$data[ $i ]['email'] = $payment->email;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['company'] ) ) {\n\t\t\t\t\t$data[ $i ]['company'] = empty( $payment_meta['_give_donation_company'] ) ? '' : str_replace( \"\\'\", \"'\", $payment_meta['_give_donation_company'] );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['address_line1'] ) ) {\n\t\t\t\t\t$data[ $i ]['address_line1'] = isset( $address['line1'] ) ? $address['line1'] : '';\n\t\t\t\t\t$data[ $i ]['address_line2'] = isset( $address['line2'] ) ? $address['line2'] : '';\n\t\t\t\t\t$data[ $i ]['address_city'] = isset( $address['city'] ) ? $address['city'] : '';\n\t\t\t\t\t$data[ $i ]['address_state'] = isset( $address['state'] ) ? $address['state'] : '';\n\t\t\t\t\t$data[ $i ]['address_zip'] = isset( $address['zip'] ) ? $address['zip'] : '';\n\t\t\t\t\t$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['comment'] ) ) {\n\t\t\t\t\t$comment = give_get_donor_donation_comment( $payment->ID, $payment->donor_id );\n\t\t\t\t\t$data[ $i ]['comment'] = ! empty( $comment ) ? $comment->comment_content : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_total'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_total'] = give_format_amount( give_donation_amount( $payment->ID ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_code'] ) ) {\n\t\t\t\t\t$data[ $i ]['currency_code'] = empty( $payment_meta['_give_payment_currency'] ) ? give_get_currency() : $payment_meta['_give_payment_currency'];\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_symbol'] ) ) {\n\t\t\t\t\t$currency_code = $data[ $i ]['currency_code'];\n\t\t\t\t\t$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_status'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_status'] = give_get_payment_status( $payment, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_gateway'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_gateway'] = $payment->gateway;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_mode'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_mode'] = $payment->mode;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_id'] = $payment->form_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_title'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_title'] = get_the_title( $payment->form_id );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_level_id'] = $payment->price_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_title'] ) ) {\n\t\t\t\t\t$var_prices = give_has_variable_prices( $payment->form_id );\n\t\t\t\t\tif ( empty( $var_prices ) ) {\n\t\t\t\t\t\t$data[ $i ]['form_level_title'] = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 'custom' === $payment->price_id ) {\n\t\t\t\t\t\t\t$custom_amount_text = give_get_meta( $payment->form_id, '_give_custom_amount_text', true );\n\n\t\t\t\t\t\t\tif ( empty( $custom_amount_text ) ) {\n\t\t\t\t\t\t\t\t$custom_amount_text = esc_html__( 'Custom', 'give' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = $custom_amount_text;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_date'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_date'] = date( give_date_format(), $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_time'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_time'] = date_i18n( 'H', $payment_date ) . ':' . date( 'i', $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['userid'] ) ) {\n\t\t\t\t\t$data[ $i ]['userid'] = $payment->user_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donorid'] ) ) {\n\t\t\t\t\t$data[ $i ]['donorid'] = $payment->customer_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donor_ip'] ) ) {\n\t\t\t\t\t$data[ $i ]['donor_ip'] = give_get_payment_user_ip( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_private'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t\t'compare' => '!=',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t) );\n\n\t\t\t\t\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$data[ $i ]['donation_note_private'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_to_donor'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t) );\n\n\t\t\t\t\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\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$data[ $i ]['donation_note_to_donor'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\t// Add custom field data.\n\t\t\t\t// First we remove the standard included keys from above.\n\t\t\t\t$remove_keys = array(\n\t\t\t\t\t'donation_id',\n\t\t\t\t\t'seq_id',\n\t\t\t\t\t'first_name',\n\t\t\t\t\t'last_name',\n\t\t\t\t\t'email',\n\t\t\t\t\t'address_line1',\n\t\t\t\t\t'address_line2',\n\t\t\t\t\t'address_city',\n\t\t\t\t\t'address_state',\n\t\t\t\t\t'address_zip',\n\t\t\t\t\t'address_country',\n\t\t\t\t\t'donation_total',\n\t\t\t\t\t'payment_gateway',\n\t\t\t\t\t'payment_mode',\n\t\t\t\t\t'form_id',\n\t\t\t\t\t'form_title',\n\t\t\t\t\t'form_level_id',\n\t\t\t\t\t'form_level_title',\n\t\t\t\t\t'donation_date',\n\t\t\t\t\t'donation_time',\n\t\t\t\t\t'userid',\n\t\t\t\t\t'donorid',\n\t\t\t\t\t'donor_ip',\n\t\t\t\t);\n\n\t\t\t\t// Removing above keys...\n\t\t\t\tforeach ( $remove_keys as $key ) {\n\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t}\n\n\t\t\t\t// Now loop through remaining meta fields.\n\t\t\t\tforeach ( $columns as $col ) {\n\t\t\t\t\t$field_data = get_post_meta( $payment->ID, $col, true );\n\t\t\t\t\t$data[ $i ][ $col ] = $field_data;\n\t\t\t\t\tunset( $columns[ $col ] );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filter to modify Donation CSV data when exporting donation\n\t\t\t\t *\n\t\t\t\t * @since 2.1\n\t\t\t\t *\n\t\t\t\t * @param array Donation data\n\t\t\t\t * @param Give_Payment $payment Instance of Give_Payment\n\t\t\t\t * @param array $columns Donation data $columns that are not being merge\n\t\t\t\t * @param Give_Export_Donations_CSV $this Instance of Give_Export_Donations_CSV\n\t\t\t\t *\n\t\t\t\t * @return array Donation data\n\t\t\t\t */\n\t\t\t\t$data[ $i ] = apply_filters( 'give_export_donation_data', $data[ $i ], $payment, $columns, $this );\n\n\t\t\t\t$new_data = array();\n\t\t\t\t$old_data = $data[ $i ];\n\n\t\t\t\t// sorting the columns bas on row\n\t\t\t\tforeach ( $this->csv_cols() as $key => $value ) {\n\t\t\t\t\tif ( array_key_exists( $key, $old_data ) ) {\n\t\t\t\t\t\t$new_data[ $key ] = $old_data[ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$data[ $i ] = $new_data;\n\n\t\t\t\t// Increment iterator.\n\t\t\t\t$i ++;\n\n\t\t\t}\n\n\t\t\t$data = apply_filters( 'give_export_get_data', $data );\n\t\t\t$data = apply_filters( \"give_export_get_data_{$this->export_type}\", $data );\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t\treturn array();\n\n\t}",
"function construct_final_value_donation_fee($pid = 0, $amount = 0, $mode = 'charge')\n\t{\n\t\tglobal $ilance, $ilconfig, $phrase;\n\t\t$fvf = $fvfnotax = 0;\n\t\t// fetch awarded bid amount\n\t\t$project = $ilance->db->query(\"\n\t\t\tSELECT user_id, donation, charityid, donationpercentage\n\t\t\tFROM \" . DB_PREFIX . \"projects\n\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\tLIMIT 1\n\t\t\", 0, null, __FILE__, __LINE__);\n\t\tif ($ilance->db->num_rows($project) > 0)\n\t\t{\n\t\t\t$resproject = $ilance->db->fetch_array($project, DB_ASSOC);\n\t\t\tif ($resproject['donation'] AND $resproject['charityid'] > 0 AND $resproject['donationpercentage'] > 0)\n\t\t\t{\n\t\t\t\t$fvf = ($amount * $resproject['donationpercentage'] / 100);\n\t\t\t\t$fvfnotax = $fvf;\n\t\t\t}\n\t\t\tif ($fvf > 0)\n\t\t\t{\n\t\t\t\t// #### taxes on final value fees ##############\n\t\t\t\t$extrainvoicesql = \"totalamount = '\" . sprintf(\"%01.2f\", $fvf) . \"',\";\n\t\t\t\t$fvfnotax = $fvf;\n\t\t\t\tif ($ilance->tax->is_taxable($resproject['user_id'], 'finalvaluefee'))\n\t\t\t\t{\n\t\t\t\t\t// fetch tax amount to charge for this invoice type\n\t\t\t\t\t$taxamount = $ilance->tax->fetch_amount($resproject['user_id'], $fvf, 'finalvaluefee', 0);\n\t\t\t\t\t// fetch total amount to hold within the \"totalamount\" field\n\t\t\t\t\t$totalamount = ($fvf + $taxamount);\n\t\t\t\t\t// fetch tax bit to display when we display tax infos\n\t\t\t\t\t$taxinfo = $ilance->tax->fetch_amount($resproject['user_id'], $fvf, 'finalvaluefee', 1);\n\t\t\t\t\t// #### extra bit to assign tax logic to the transaction \n\t\t\t\t\t$extrainvoicesql = \"\n\t\t\t\t\t\tistaxable = '1',\n\t\t\t\t\t\ttotalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n\t\t\t\t\t\ttaxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n\t\t\t\t\t\ttaxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n\t\t\t\t\t\";\n\t\t\t\t\t// ensure our new tax is applied to the current fvf..\n\t\t\t\t\t$fvf = $totalamount;\n\t\t\t\t}\n\t\t\t\t// #### CHARGE FVF LOGIC #######################################\n\t\t\t\tif ($mode == 'charge')\n\t\t\t\t{\n\t\t\t\t\t// do we have funds in online account?\n\t\t\t\t\t$account = $ilance->db->query(\"\n\t\t\t\t\t\tSELECT available_balance, total_balance, autopayment\n\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\tif ($ilance->db->num_rows($account) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res = $ilance->db->fetch_array($account, DB_ASSOC);\n\t\t\t\t\t\t$avail = $res['available_balance'];\n\t\t\t\t\t\t$total = $res['total_balance'];\n\t\t\t\t\t\t// #### suffificent funds to cover transaction\n\t\t\t\t\t\tif ($avail >= $fvf AND $res['autopayment'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// #### create a paid final value donation fee\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvfnotax), sprintf(\"%01.2f\", $fvf), 'paid', 'debit', 'account', DATETIME24H, DATETIME24H, DATETIME24H, '{_auto_debit_from_online_account_balance}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// #### update invoice mark as final value fee invoice type\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t$extrainvoicesql\n\t\t\t\t\t\t\t\tisdonationfee = '1',\n\t\t\t\t\t\t\t\tcharityid = '\" . $resproject['charityid'] . \"',\n\t\t\t\t\t\t\t\tisautopayment = '1'\n\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### update donation details in listing table\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\t\tSET donermarkedaspaid = '1',\n\t\t\t\t\t\t\t\tdonermarkedaspaiddate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\tdonationinvoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### update account balance\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\tSET available_balance = available_balance - \" . sprintf(\"%01.2f\", $fvf) . \",\n\t\t\t\t\t\t\t\ttotal_balance = total_balance - \" . sprintf(\"%01.2f\", $fvf) . \"\n\t\t\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"charities\n\t\t\t\t\t\t\t\tSET donations = donations + 1,\n\t\t\t\t\t\t\t\tearnings = earnings + $fvfnotax\n\t\t\t\t\t\t\t\tWHERE charityid = '\" . $resproject['charityid'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### track income history\n\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($resproject['user_id'], sprintf(\"%01.2f\", $fvf), 'credit');\n\t\t\t\t\t\t\t// #### referral tracker\n\t\t\t\t\t\t\t$ilance->referral->update_referral_action('fvf', $resproject['user_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// #### insufficient funds to cover transaction\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvfnotax), '', 'unpaid', 'debit', 'account', DATETIME24H, DATEINVOICEDUE, '', '{_please_pay_this_invoice_soon_as_possible}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// update invoice mark as final value donation fee invoice type\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\tSET isdonationfee = '1',\n\t\t\t\t\t\t\t\tcharityid = '\" . $resproject['charityid'] . \"'\n\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($invoiceid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\t\tSET donermarkedaspaid = '0',\n\t\t\t\t\t\t\t\tdonationinvoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($mode == 'refund')\n\t\t\t\t{\n\t\t\t\t\t// do we have funds in online account?\n\t\t\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\t\t\tSELECT donationinvoiceid, donermarkedaspaid\n\t\t\t\t\t\tFROM \" . DB_PREFIX . \"projects\n\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res = $ilance->db->fetch_array($sql, DB_ASSOC);\n\t\t\t\t\t\t// #### reset listing table\n\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\tSET donermarkedaspaid = '0',\n\t\t\t\t\t\t\tdonermarkedaspaiddate = '0000-00-00 00:00:00',\n\t\t\t\t\t\t\tdonationinvoiceid = '0'\n\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t// #### remove old invoice\n\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\tDELETE FROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\tWHERE invoiceid = '\" . $res['donationinvoiceid'] . \"'\n\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t// #### refund donation associated invoice\n\t\t\t\t\t\tif ($res['donermarkedaspaid'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// #### create a paid final value donation fee refund credit\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee_refund_credit} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvf), sprintf(\"%01.2f\", $fvf), 'paid', 'credit', 'account', DATETIME24H, DATETIME24H, DATETIME24H, '{_auto_credited_to_online_account_balance}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// #### update account balance\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\tSET available_balance = available_balance + \" . sprintf(\"%01.2f\", $fvf) . \",\n\t\t\t\t\t\t\t\ttotal_balance = total_balance + \" . sprintf(\"%01.2f\", $fvf) . \"\n\t\t\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"'\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### track income history\n\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($resproject['user_id'], sprintf(\"%01.2f\", $fvf), 'debit');\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"charities\n\t\t\t\t\t\t\t\tSET donations = donations - 1,\n\t\t\t\t\t\t\t\tearnings = earnings - $fvfnotax\n\t\t\t\t\t\t\t\tWHERE charityid = '\" . $resproject['charityid'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function getPromoList()\n {\n return array(array('reason'=>'test_discount','amount'=>3.5));\n }"
]
| [
"0.5553951",
"0.52486336",
"0.5224486",
"0.5194046",
"0.51344895",
"0.50832254",
"0.5065878",
"0.5002372",
"0.4951992",
"0.49321628",
"0.4929847",
"0.49289912",
"0.49203515",
"0.49178505",
"0.48770416",
"0.4864359",
"0.4863234",
"0.4847284",
"0.47965068",
"0.47889638",
"0.47783756",
"0.47741744",
"0.47544485",
"0.47470775",
"0.4726037",
"0.47078678",
"0.4700458",
"0.46852264",
"0.4679962",
"0.46755153"
]
| 0.5804769 | 0 |
It will debit always | function debit($total, $creditCard)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function revoke()\n\t{\n\t}",
"private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}",
"private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}",
"public function dec(): void {}",
"public function deactivate(): void;",
"protected function _deconnection() {\n\n\t\tif ($this->cookie->exists('user') && $this->cookie->exists('token') && isset($_GET['deconnection']) && $_GET['deconnection'] === \"1\") {\n\n\t\t\t$this->cookie->set('user', null, 0);\n\t\t\t$this->cookie->set('id', null, 0);\n\t\t\t$this->cookie->set('token', null, 0);\n\t\t}\n\t}",
"function debit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t\n\t$type = \"DEBIT\";\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n// check to make sure that there is no debit for this transaction already\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error().$sql);\n\tif (mysql_fetch_array($result)==0) {\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error().$sql);\n\t}\n\n\n}",
"public function deactivate();",
"abstract public function down();",
"abstract public function down();",
"abstract public function down();",
"protected abstract function do_down();",
"abstract public function deactivate();",
"public function undoFinalDeny()\n {\n $this->finalDeny = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }",
"public function isDebitable()\n {\n if ($this->getTimeoutDetected()) {\n return;\n }\n $this->unitSetup();\n $payment = $this->generateSimpleSimplifiedInvoiceQuantityOrder('8305147715', true);\n sleep(3);\n print_r($payment);\n static::assertTrue($this->TEST->ECOM->canDebit($payment->paymentId));\n }",
"abstract protected function edu_down();",
"public function _deactivate() {\r\n\t\t// Add deactivation cleanup functionality here.\r\n\t}",
"public static function deactivate()\n\t{\n\n\t}",
"function _deactivate() {}",
"public function dealCardToDealer();",
"public static function deactivate(){\n // Do nothing\n }",
"public static function deactivate ()\n\t{\n\t}",
"public static function deactivate() {\n\t}",
"public function deactivate() {\n\n }",
"public function deactivate() {\n\n }",
"public static function deactivate() {\n\n }",
"function deactivate() {\n\t}",
"public function revoke_access() {\r\n // Nothing to do!\r\n }",
"function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }",
"public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}"
]
| [
"0.63365227",
"0.6130539",
"0.6130539",
"0.6110784",
"0.6036646",
"0.601679",
"0.60140145",
"0.6001467",
"0.59941465",
"0.59941465",
"0.59941465",
"0.59779054",
"0.5971123",
"0.59064627",
"0.5865696",
"0.5848675",
"0.58399796",
"0.5810306",
"0.57820165",
"0.57667977",
"0.5764568",
"0.57598925",
"0.57568896",
"0.574399",
"0.574399",
"0.5713929",
"0.57091385",
"0.5690533",
"0.5667913",
"0.5665927"
]
| 0.66124195 | 0 |
Returns a new instance for network settings page. | function wponion_network_settings( $instance_id_or_args = array(), $fields = array() ) {
if ( is_string( $instance_id_or_args ) && empty( $fields ) ) {
return wponion_settings_registry( $instance_id_or_args );
}
return new Network( $instance_id_or_args, $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function display_network_settings() {\n\t\twp_nonce_field( 'cjur-network-settings', 'cjur-network-settings-nonce' );\n\n\t\tdo_settings_sections( 'cjur-network-settings-page' );\n\t}",
"public function getNetworkSettings() : NetworkSettings\n {\n return $this->networkSettings;\n }",
"public static function add_network_settings() {\n\t\tadd_settings_section(\n\t\t\t'cjur-network-settings-section',\n\t\t\t__( 'CSS JS URL Rewriter', 'css-js-url-rewriter' ),\n\t\t\t'__return_false',\n\t\t\t'cjur-network-settings-page'\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'css_js_url_rewriter_cdn_url',\n\t\t\t__( 'CDN URL', 'css-js-url-rewriter' ),\n\t\t\t[ __CLASS__, 'render_field' ],\n\t\t\t'cjur-network-settings-page',\n\t\t\t'cjur-network-settings-section'\n\t\t);\n\t}",
"function get_network()\n{\n return new \\Podlove\\Modules\\Networks\\Template\\Network();\n}",
"public static function Create() {\n\t\t$s = new WP_United_Settings();\n\t\tif(!$s->load_from_wp()) {\n\t\t\treturn($s->load_from_phpbb());\n\t\t}\n\t\treturn $s;\n\t}",
"function wponion_network_settings_registry( &$instance ) {\n\t\treturn wponion_get_registry_instance( 'network_settings', $instance, 'module' );\n\t}",
"public function getSettings()\n {\n $settings = new Settings();\n $requestUrl = $this->getRequestUrl();\n $settings->setFetchUrl($requestUrl);\n $settings->setPrefix(sha1($requestUrl));\n $settings->setEmailPreview(isset($_REQUEST['emailPreview']) ? $_REQUEST['emailPreview'] === 'true' : false);\n $settings->setPhonePreview(isset($_REQUEST['telPreview']) ? $_REQUEST['telPreview'] === 'true' : false);\n return $settings;\n }",
"public static function getInstance()\n {\n if (self::$instance == null) {\n self::$instance = new NominationSettings();\n }\n\n return self::$instance;\n }",
"function create_object_settings() {\n if (!isset($this->settings)) {\n require_once($this->addon->dir . 'include/class.widget.settings.php');\n $this->settings = new SLPWidget_Legacy_Settings( array( 'addon' => $this->addon ) );\n }\n }",
"public function get_settings_instance() {\n\n\t\tif ( ! $this->settings instanceof \\WC_PIP_Settings ) {\n\n\t\t\t// Include settings so we can install defaults\n\t\t\trequire_once( WC()->plugin_path() . '/includes/admin/settings/class-wc-settings-page.php' );\n\n\t\t\t$this->settings = $this->load_class( '/includes/admin/class-wc-pip-settings.php', 'WC_PIP_Settings' );\n\t\t}\n\n\t\treturn $this->settings;\n\t}",
"public static function Instance() {\r\r\n if (!isset(self::$instance)) {\r\r\n $c = __CLASS__;\r\r\n self::$instance = new $c;\r\r\n \r\r\n self::$general = new GeneralSettings();\r\r\n }\r\r\n\r\r\n return self::$instance;\r\r\n }",
"public function network_config_page() {\n\t\trequire_once WPSEO_PATH . 'admin/pages/network.php';\n\t}",
"public function setNetworkSettings(NetworkSettings $networkSettings) : self\n {\n $this->initialized['networkSettings'] = true;\n $this->networkSettings = $networkSettings;\n return $this;\n }",
"public function create()\n {\n return view('pages.settings.settings.create');\n }",
"public static function getInstance()\n\t{\n\t\tif (self::$_instance === null)\n\t\t{\n\t\t\t$enableCache = Zend_Registry::isRegistered('cache');\n\t\t\t$cache = $enableCache ? Zend_Registry::get('cache') : null;\n\t\t\t$settings = $enableCache ? $cache->load('settings') : null;\n\n\t\t\tif ($settings == null)\n\t\t\t{\n\t\t\t\t$model = new self;\n\t\t\t\t$result = $model->fetchAll($model->select()\n\t\t\t\t\t->from('setting', ['name', 'value']));\n\n\t\t\t\t$settings = [];\n\n\t\t\t\tforeach ($result as $setting)\n\t\t\t\t{\n\t\t\t\t\t$settings[$setting->name] = $setting->value;\n\t\t\t\t}\n\n\t\t\t\tif ($enableCache)\n\t\t\t\t{\n\t\t\t\t\t$cache->save($settings, 'settings');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself::$_instance = $settings;\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_directlink';\n\n\t\treturn $settings;\n\t}",
"function EpcwSettings() { \n\treturn EpcwSettings::instance();\n}",
"function settingsObject()\n\t{\n\t\tglobal $tpl, $ilCtrl, $lng;\n\t\t\n\t\t$editor = $this->object->_getRichTextEditor();\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this));\n\t\t$this->form->setTitle($lng->txt(\"adve_activation\"));\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_tiny_mce\"), \"use_tiny\");\n\t\tif ($editor == \"tinymce\")\n\t\t{\n\t\t\t$cb->setChecked(true);\n\t\t}\n\t\t$this->form->addItem($cb);\n\t\t$this->form->addCommandButton(\"saveSettings\", $lng->txt(\"save\"));\n\t\t\n\t\t$tpl->setContent($this->form->getHTML());\n\t}",
"public function initGeneralPageSettingsForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t\n\t\t$aset = new ilSetting(\"adve\");\n\n\t\t// use physical character styles\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_physical\"), \"use_physical\");\n\t\t$cb->setInfo($this->lng->txt(\"adve_use_physical_info\"));\n\t\t$cb->setChecked($aset->get(\"use_physical\"));\n\t\t$form->addItem($cb);\n\n\t\t// blocking mode\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_blocking_mode\"), \"block_mode_act\");\n\t\t$cb->setChecked($aset->get(\"block_mode_minutes\") > 0);\n\t\t$form->addItem($cb);\n\n\t\t\t// number of minutes\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"adve_minutes\"), \"block_mode_minutes\");\n\t\t\t$ni->setMinValue(2);\n\t\t\t$ni->setMaxLength(5);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setRequired(true);\n\t\t\t$ni->setInfo($this->lng->txt(\"adve_minutes_info\"));\n\t\t\t$ni->setValue($aset->get(\"block_mode_minutes\"));\n\t\t\t$cb->addSubItem($ni);\n\t\t\n\t\t$form->addCommandButton(\"saveGeneralPageSettings\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($lng->txt(\"adve_pe_general\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t \n\t\treturn $form;\n\t}",
"public function getSettings()\n {\n $response = $this->get('settings');\n $data = $response->json();\n return new Settings($data);\n }",
"public function getSettings()\n {\n return new ClientSettings($this->settings);\n }",
"private function add_page_settings_controls() {\n\t\trequire_once( __DIR__ . '/page-settings/manager.php' );\n\t\tnew Page_Settings();\n\t}",
"private function add_page_settings_controls() {\n\t\trequire_once( __DIR__ . '/page-settings/manager.php' );\n\t\tnew Page_Settings();\n\t}",
"public static function getInstance(){\r\n if(empty(self::$instance)){\r\n self::$instance = new Settings();\r\n }\r\n return self::$instance; //returns that instance\r\n }",
"public function createSetting(): Setting\n {\n return Setting::create('cache://double-backup');\n }",
"public static function get_settings() {\n if (empty(static::$settingobj)) {\n static::$settingobj = new static();\n }\n\n return static::$settingobj;\n }",
"public function settings_page() {\n\t\t// Current tab.\n\t\t$tab = Template::current_tab();\n\n\t\t// Render settings header.\n\t\t$this->view( 'settings/common/header' );\n\n\t\t// Render settings page.\n\t\t$this->view( 'settings/settings', [\n\t\t\t'title' => Template::tabs()[ $tab ],\n\t\t\t'tab' => $tab,\n\t\t\t'form_url' => Template::settings_page(\n\t\t\t\t$tab,\n\t\t\t\t$this->is_network()\n\t\t\t),\n\t\t] );\n\n\t\t// Render settings footer.\n\t\t$this->view( 'settings/common/footer' );\n\t}",
"function config()\n{\n\tglobal $iw;\n\t$iw = new config;\n\treturn $iw;\n}",
"function showGeneralPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs;\n\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t$ilTabs->activateTab(\"adve_page_editor_settings\");\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function getSettingConnection()\n {\n return new Settings($this->apiEmail, $this->apiKey);\n }"
]
| [
"0.6561284",
"0.6503677",
"0.6389247",
"0.6346381",
"0.6266733",
"0.62577355",
"0.6137928",
"0.6120249",
"0.6107101",
"0.6061099",
"0.59319824",
"0.58896357",
"0.5848817",
"0.5846951",
"0.58026904",
"0.5753194",
"0.5693955",
"0.5648968",
"0.56427264",
"0.56387764",
"0.5618064",
"0.56120306",
"0.56120306",
"0.5556407",
"0.55549884",
"0.5522811",
"0.55208105",
"0.5506219",
"0.5497769",
"0.54964906"
]
| 0.6733544 | 0 |
wof_utils_id2abspath returns an absolute path to the WOF ID, regardless of whether the file exists. This, of course, is necessary for the first time you write the file to disk. See also: wof_utils_find_id | function wof_utils_id2abspath($root, $id, $more=array()){
$rel = wof_utils_id2relpath($id, $more);
// Check $root for a trailing slash, so we don't get two slashes
if (substr($root, -1, 1) == DIRECTORY_SEPARATOR) {
$root = substr($root, 0, -1);
}
return implode(DIRECTORY_SEPARATOR, array($root, $rel));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAbsolutePath()\n {\n return null === $this->photoId\n ? null\n : $this->getUploadRootDir().'/'.$this->photoId;\n }",
"public function getElementArbitragePath()\n\t{\n\t\treturn preg_replace('/^[^\\.]+\\.(.*)$/', '$1', $this->_id);\n\t}",
"function buildArchiveName($id) {\n global $glo_dirname;\n return sprintf(\"./$glo_dirname/file%09d.bin\", $id);\n }",
"function get_new_file($id_progetto) {\n return sys_get_temp_dir() . DIRECTORY_SEPARATOR . \"ReportQuestionariProgetto-\" . str_pad($id_progetto, 4, '0', STR_PAD_LEFT) . \".xlsx\";\n }",
"public function getAbsolutePath() {}",
"public function getAbsolutePath() {}",
"function getAbsolutePath() ;",
"public function getAbsolutePath();",
"private function getFullWHPath($id)\r\n {\r\n \t$warehouse = Factory::service(\"Warehouse\")->getWarehouse($id);\r\n \tif($warehouse instanceof Warehouse ){\r\n \t\treturn Factory::service(\"Warehouse\")->getWarehouseBreadCrumbs($warehouse,TRUE,\"/\");\r\n \t}else{\r\n \t\treturn $id;\r\n \t}\r\n }",
"public function getFileId(): string\n {\n return $this->file_id;\n }",
"public function toAbsolutePath () {\n return new S (DOCUMENT_ROOT . str_replace (DOCUMENT_ROOT, _NONE, $this->varContainer));\n }",
"public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }",
"public function giveEventoPathFilexml($idev, $idowner){\r\n $idev = self::$conn->real_escape_string($idev);\r\n $idowner = self::$conn->real_escape_string($idowner);\r\n $query = \"SELECT filexml FROM \".$this->tables['eventoTable'].\r\n \" WHERE creator='$idowner' AND id = '$idev'\";\r\n\t\t$result = self::$conn->query($query);\r\n if(!$result || $result->num_rows != 1)\r\n return ''; \r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return $this->folderFilexmlUser .\"$idowner/\".$row[0];\r\n }",
"function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) {\n $_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n $_return = $auto_base . DIRECTORY_SEPARATOR;\n\n if(isset($auto_id)) {\n // make auto_id safe for directory names\n $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));\n // split into separate directories\n $_return .= $auto_id . $_compile_dir_sep;\n }\n\n if(isset($auto_source)) {\n // make source name safe for filename\n $_filename = urlencode(basename($auto_source));\n $_crc32 = sprintf('%08X', crc32($auto_source));\n // prepend %% to avoid name conflicts with\n // with $params['auto_id'] names\n $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .\n substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;\n// XXX: Changed from $_filename to md5($_filename)\n $_return .= '%%' . $_crc32 . '%%' . md5($_filename);\n }\n return $_return;\n }",
"function cot_pfs_filepath($id)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=\".(int)$id.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\treturn ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file'];\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}",
"static public function generateFileID($surround = true)\n\t{\n\t\treturn QuickBooks_QWC::fileID($surround);\n\t}",
"protected function getCurrentFilename($id) {\n\n\t\tif (!$id) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ($this->getPropertyDefinition('storeExternally')) {\n\t\t\t$tableName = $this->getPropertyDefinition('foreignTableName');\n\t\t\t$key = $this->getPropertyDefinition('foreignTableKey');\n\t\t}\n\t\telse {\n\t\t\t$tableName = $this->model->getTableName();\n\t\t\t$key = $this->model->getTableKey();\n\t\t}\n\n\t\t$db = KenedoPlatform::getDb();\n\t\t$query = \"SELECT `\".$this->propertyName.\"` FROM `\".$tableName.\"` WHERE `\".$key.\"` = '\".$db->getEscaped($id).\"'\";\n\t\t$db->setQuery($query);\n\t\t$filename = (string)$db->loadResult();\n\n\t\treturn $filename;\n\n\t}",
"public function retornaCaminhoDoDiretorioPeloId($id) {\n\t\treturn (string) implode(DIRECTORY_SEPARATOR, str_split($id));\n\t}",
"function getAbsolutePath(): string\n {\n $path = $this->folder()->getAbsolutePath();\n return \"$path\";\n }",
"function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}",
"public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}",
"public function getFullPath(): string;",
"public function path(/* array */$id) {\n $key = strrev(sprintf('%04d', $id));\n $k1 = substr($key, 0, 2);\n $k2 = substr($key, 2, 2);\n return sprintf('%s/%02d/%02d/%d.torrent', self::STORAGE, $k1, $k2, $id);\n }",
"public function getAbsolutePath(){\n\t \treturn $this->getAbsoluteDirname().'/'.$this->filename.'.'.$this->extension;\n\t }",
"public function getAbsolutePath()\n\t{\n\t\treturn rtrim($this->UploadDestination->server_path, '/') . '/_' . $this->short_name . '/';\n\t}",
"protected abstract function getAbsolutePath(): string;",
"public static function getLocalPath($id)\n {\n $file = static::data($id);\n $path = Configure::read('FileApi.basePath') . $file->category . DS . $file->tag . DS . $file->filename;\n\n return file_exists($path) ? $path : false;\n }",
"private function _getArquivoPath($idArquivo) {\n $_arquivo = $this->_getArquivo($idArquivo);\n $result['full'] = $this->_config['pathDir'] .\n $_arquivo->getPathArq()->toPhp() . \"/\" .\n $this->_formatFileName($_arquivo->getHashcode()->toPhp()\n , $_arquivo->getConteudoName()->toPhp());\n return $result;\n }",
"public function getFileAbsolutePath($file);",
"protected function _abspath($path) {\r\n\t\treturn $path == $this->separator ? $this->root : $this->root.$this->separator.$path;\r\n\t}"
]
| [
"0.54972434",
"0.5416531",
"0.53762937",
"0.5362009",
"0.5342189",
"0.5342189",
"0.5339298",
"0.53126025",
"0.5311818",
"0.53015625",
"0.52862126",
"0.5277032",
"0.5270241",
"0.52650124",
"0.5231259",
"0.51994646",
"0.5193094",
"0.5188",
"0.5179114",
"0.51696354",
"0.51343143",
"0.50969344",
"0.50853217",
"0.5065132",
"0.5057521",
"0.50498074",
"0.50398815",
"0.50357115",
"0.5031789",
"0.5028084"
]
| 0.66844904 | 0 |
wof_utils_find_id checks a sequence of possible root directories until it finds an absolute path for the WOF record. Returns null if no existing file was found. See also: wof_utils_id2abspath | function wof_utils_find_id($root_dirs, $id, $more=array()){
foreach ($root_dirs as $root) {
$path = wof_utils_id2abspath($root, $id, $more);
if (file_exists($path)) {
return $path;
}
}
return null; // Not found!
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetVideoPath($id, $find = false)\r\n{\r\n $path = \"results/video/$id\";\r\n if( strpos($id, '_') == 6 )\r\n {\r\n $parts = explode('_', $id);\r\n\r\n // see if we have an extra level of hashing\r\n $dir = $parts[1];\r\n if( count($parts) > 2 && strlen($parts[2]))\r\n $dir .= '/' . $parts[2];\r\n\r\n $path = 'results/video/' . substr($parts[0], 0, 2) . '/' . substr($parts[0], 2, 2) . '/' . substr($parts[0], 4, 2) . '/' . $dir;\r\n \r\n // support using the old path structure if we are trying to find an existing video\r\n if( $find && !is_dir($path) )\r\n $path = 'results/video/' . substr($parts[0], 0, 2) . '/' . substr($parts[0], 2, 2) . '/' . substr($parts[0], 4, 2) . '/' . $parts[1];\r\n }\r\n\r\n return $path;\r\n}",
"function findFolder($id, $pid){\n\t\t\tif (!array_key_exists($id,$this -> folderMap)){\n\t\t\t\t// folder has not been added yet or is invalid. Test parent!\n\t\t\t\tif (!array_key_exists($pid,$this -> folderMap)){\n\t\t\t\t\t// parent ID does not exist either. Rebuild and return root\n\t\t\t\t\t$this -> rebuildAll();\n\t\t\t\t\t$this -> saveFolderXML();\n\t\t\t\t\treturn $this -> rootFolder;\n\t\t\t\t} else {\n\t\t\t\t\t// if parent exists, rebuild from that folder only!\n\t\t\t\t\t$this -> rebuild($this -> folderMap[$pid]);\n\t\t\t\t\t$this -> saveFolderXML();\n\t\t\t\t\treturn $this -> folderMap[$pid];\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\treturn $this -> folderMap[$id];\n\t\t\t}\n\t\t}",
"public function findFirstWebFolder() {}",
"public function findPath($path) {\n $pwd = 'root';\n foreach (explode('/', $path) as $p) {\n $file = $this->findIn($p, $pwd);\n $pwd = $file->id;\n }\n return $file;\n }",
"function wsod_detect_drupal_path(&$output, $start_dir = __FILE__) {\n $drupal_path = FALSE; // set init variable\n $path_arr = wsod_pathposall(dirname($start_dir));\n $bootstrap_file = '/includes/bootstrap.inc';\n $buff_output = '';\n foreach ($path_arr as $path) {\n if (file_exists($path.$bootstrap_file)) {\n $drupal_path = $path;\n return $drupal_path;\n } else {\n $buff_output .= \"Couldn't find $path$bootstrap_file!<br>\\n\";\n }\n // FIXME: file_exists() [function.file-exists]: open_basedir restriction in effect. File(//includes/bootstrap.inc) is not within the allowed path(s)\n }\n $output .= $buff_output;\n return NULL;\n}",
"public function find( &$className ) {\n\t\n\t\tif (empty( self::$paths ))\n\t\t\tthrow new aop_exception( \"path list is empty\" );\n\t\n\t\tforeach( self::$paths as $element ) {\n\t\t\n\t\t\t$liste = explode( PATH_SEPARATOR, $element );\n\t\t\tforeach( $liste as $path ) {\n\t\t\t\n\t\t\t\t// case 1\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"1- Trying path: $p \\n\";\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 2\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"2- Trying path: $p \\n\";\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 3\n\t\t\t\t$bits = explode( \"_\", $className );\n\t\t\t\t$fragment_list = implode( DIRECTORY_SEPARATOR, $bits );\n\t\t\t\t$last_fragment = $bits[ count( $bits ) - 1 ];\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . '.php';\n\t\t\t\t#echo \"3- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t\t// case 4\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . DIRECTORY_SEPARATOR.$last_fragment.'.php';\n\t\t\t\t#echo \"4- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public static function root($path = null, $find = \"composer.json\") {\n $path = is_null($path) ?: getcwd();\n while(!file_exists(\"$path/$find\")) {\n $path = \"$path/..\";\n }\n return realpath($path);\n }",
"function getFolder($id) { /* {{{ */\n\t\t$hits = $this->index->find('F'.$id);\n\t\treturn $hits['hits'] ? $hits['hits'][0] : false;\n\t}",
"function LastValidArticle($path, $id)\n\t{\n\t\t$new_id = (int)$id;\n\t\tif ($new_id == 0){\n\t\t\treturn $new_id;\n\t\t}else if (file_exists($path . $new_id) == FALSE){\n\t\t\treturn LastValidArticle($path, $new_id - 1);\n\t\t}else{\n\t\t\treturn $new_id;\n\t\t}\n\t}",
"function wof_utils_id2abspath($root, $id, $more=array()){\n\n\t\t$rel = wof_utils_id2relpath($id, $more);\n\n\t\t// Check $root for a trailing slash, so we don't get two slashes\n\t\tif (substr($root, -1, 1) == DIRECTORY_SEPARATOR) {\n\t\t\t$root = substr($root, 0, -1);\n\t\t}\n\t\treturn implode(DIRECTORY_SEPARATOR, array($root, $rel));\n\t}",
"public function findPath($id)\n {\n $entry = $this->find($id, ['path']);\n return $entry ? $entry->getRawOriginal('path') : '';\n }",
"function check_id($id) {\n\tif ( !preg_match( '/^[A-z0-9]+$/', $id ) ) {\n\t\treturn false;\n\t}\n\t# Check\tif the directory actually exists\n\tglobal $basedir;\n\tif ( !file_exists( $basedir . \"/\" . $id . \"/\" ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}",
"function cot_pfs_filepath($id)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=\".(int)$id.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\treturn ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file'];\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}",
"public function retornaCaminhoDoDiretorioPeloId($id) {\n\t\treturn (string) implode(DIRECTORY_SEPARATOR, str_split($id));\n\t}",
"public function find($id){\n \n $result = null;\n $resultDepth = 0;\n\n // Find a comment from comments recursively\n $_find = function($comment, $depth) use (&$_find, $id, &$result, &$resultDepth){\n\n // Comment is found, set the result\n if($comment->id == $id){\n $result = $comment;\n $resultDepth = $depth;\n return;\n\n }else if(count($comment->children) > 0){\n // If comment has children, search target comment in children\n foreach($comment->children as $childComment)\n $_find($childComment, $depth+1);\n }\n };\n\n $_find($this->rootComment, 0);\n\n // If the comment is not found, it returns depth of -1 and null\n return $result === null ? [-1, null] : [$resultDepth, $result];\n }",
"function checkIds($xml, $recurLevel) {\n\n\n if($xml->hasAttribute(\"id\")) {\n\n $foundId = (int)$xml->getAttribute(\"id\");\n Debug::printDiv(\"Found ID: \".$foundId);\n IdaDb::insert(\"root_\".$recurLevel, array(\"id\"=>$foundId),1,1);\n return $foundId;\n\n } else if($xml->hasAttribute(\"map_id\")) {\n\n $mapId = $xml->getAttribute(\"map_id\");\n $res = IdaDb::select(\"_sys_records\", array(\"map_id\"=>$mapId), array(\"id\"),\"\",\"onecol\");\n if(count($res) != 1) {\n \n throw new Exception(\"map_id \\\"\".$mapId.\"\\\" not found!\");\n }\n\n $foundId = $res[0];\n IdaDb::insert(\"root_\".$recurLevel, array(\"id\"=>$foundId),1,1);\n return $foundId;\n } \n\n return 0;\n }",
"public static function find($id)\n {\n $results = parent::find($id);\n return empty($results) ? null : new File ($results);\n }",
"public function getFoundPath() {}",
"public function findHolderId($holderToFind)\n {\n $rc = null;\n\n if ($holders = $this->getHolders()) {\n foreach ($holders as $holder) {\n $holderId = $holder['holder_id'];\n\n $holder = [\n 'company' => $holder['company'],\n 'firstname' => $holder['firstname'],\n 'lastname' => $holder['lastname'],\n 'street' => $holder['street'],\n 'zipcode' => $holder['zipcode'],\n 'city' => $holder['city'],\n 'email' => $holder['email']\n ];\n\n if ($holder == $holderToFind) {\n $rc = $holderId;\n break;\n }\n }\n }\n\n return $rc;\n }",
"public function find_or_fail($id)\n\t{\n\t\t$db_result = $this->db->get_where('files', [ 'id' => $id ]);\n\n\t\tif (!$db_result->num_rows()) throw new Exception(\"Item not found\", 1);\n\n\t\treturn $db_result->row();\n\t}",
"function fn_get_files_dir_path($company_id = null)\n{\n $path = Registry::get('config.dir.files');\n if ($company_id === null) {\n $company_id = Registry::get('runtime.simple_ultimate') ? Registry::get('runtime.forced_company_id') : Registry::get('runtime.company_id');\n }\n\n if (!empty($company_id)) {\n $path .= $company_id . '/';\n }\n\n return $path;\n}",
"protected function _evalPath($id = 0){\n\t\t$db = new DB_WE();\n\t\t$path = '';\n\t\tif($id == 0){\n\t\t\t$id = $this->ParentID;\n\t\t\t$path = $this->Text;\n\t\t}\n\n\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . intval($id), $db);\n\t\t$path = '/' . (isset($result['Text']) ? $result['Text'] : '') . $path;\n\t\t$pid = isset($result['ParentID']) ? intval($result['ParentID']) : 0;\n\t\twhile($pid > 0){\n\t\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . $pid, $db);\n\t\t\t$path = '/' . $result['Text'] . $path;\n\t\t\t$pid = intval($result['ParentID']);\n\t\t}\n\t\treturn $path;\n\t}",
"function fetchModuleFile($id)\n{\n if (!empty($id)) {\n $sql = \"SELECT file FROM modules WHERE id = \";\n $sql .= sql_escape($id);\n $sql .= \" LIMIT 1 \";\n $row = fetchOne($sql);\n }\n return !empty($row) ? $row['file'] : null;\n}",
"public function find () {\n\t\t$results = array();\n\n\t\t// Iterate all paths in target\n\t\tforeach ($this->target->get_resolved_paths() as $path) {\n\t\t\t\n\t\t\t// Iterate all files in paths\n\t\t\t$files = directory_contents($path);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$lines = file($file);\n\t\t\t\t\n\t\t\t\t// Iterate all lines in file\n\t\t\t\tfor ($i=0; $i < count($lines); $i++) { \n\t\t\t\t\tif (preg_match(self::BREAKPOINT, $lines[$i])) {\n\t\t\t\t\t\t$results[$file][] = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count($results) == 0) $results = null;\n\t\t\n\t\treturn $results;\n\t}",
"function find_id_moniker($url_parts, $zone, $search_redirects = true)\n{\n if (!isset($url_parts['page'])) {\n return null;\n }\n\n $page = $url_parts['page'];\n\n if (strpos($page, '[') !== false) {\n return null; // A regexp in a comparison URL, in breadcrumbs code\n }\n if ($zone == '[\\w\\-]*') {\n return null; // Part of a breadcrumbs regexp\n }\n\n // Does this URL arrangement support monikers?\n global $CONTENT_OBS;\n if ($CONTENT_OBS === null) {\n load_moniker_hooks();\n }\n if (!array_key_exists('id', $url_parts)) {\n if (($page != 'start'/*TODO: Change in v11*/) && (@is_file(get_file_base() . '/' . $zone . (($zone == '') ? '' : '/') . 'pages/modules/' . $page . '.php'))) { // Wasteful of resources\n return null;\n }\n if (($zone == '') && (get_option('collapse_user_zones') == '1')) {\n if (@is_file(get_file_base() . '/site/pages/modules/' . $page . '.php')) {// Wasteful of resources\n return null;\n }\n }\n\n // Moniker may be held the other side of a redirect\n if (!function_exists('_request_page')) {\n return null; // In installer\n }\n if ($search_redirects) {\n $page_place = _request_page(str_replace('-', '_', $page), $zone);\n if ($page_place[0] == 'REDIRECT') {\n $page = $page_place[1]['r_to_page'];\n $zone = $page_place[1]['r_to_zone'];\n }\n }\n\n $url_parts['type'] = '';\n $effective_id = $zone;\n $url_parts['id'] = $zone;\n\n $looking_for = '_WILD:_WILD';\n } else {\n if (!isset($url_parts['type'])) {\n $url_parts['type'] = 'browse';\n }\n if ($url_parts['type'] === null) {\n $url_parts['type'] = 'browse'; // null means \"do not take from environment\"; so we default it to 'browse' (even though it might actually be left out when URL Schemes are off, we know it cannot be for URL Schemes)\n }\n\n if ($url_parts['id'] === null) {\n return null;\n }\n\n global $REDIRECT_CACHE;\n if ((isset($REDIRECT_CACHE[$zone][strtolower($page)])) && ($REDIRECT_CACHE[$zone][strtolower($page)]['r_is_transparent'] === 1)) {\n $new_page = $REDIRECT_CACHE[$zone][strtolower($page)]['r_to_page'];\n $new_zone = $REDIRECT_CACHE[$zone][strtolower($page)]['r_to_zone'];\n $page = $new_page;\n $zone = $new_zone;\n }\n\n $effective_id = $url_parts['id'];\n\n $looking_for = '_SEARCH:' . $page . ':' . $url_parts['type'] . ':_WILD';\n }\n $ob_info = isset($CONTENT_OBS[$looking_for]) ? $CONTENT_OBS[$looking_for] : null;\n if ($ob_info === null) {\n return null;\n }\n\n if ($ob_info['id_field_numeric']) {\n if (!is_numeric($effective_id)) {\n return null;\n }\n } else {\n if (strpos($effective_id, '/') !== false) {\n return null;\n }\n }\n\n if ($ob_info['support_url_monikers']) {\n global $SMART_CACHE;\n if ($SMART_CACHE !== null) {\n $SMART_CACHE->append('NEEDED_MONIKERS', serialize(array(array('page' => $page, 'type' => $url_parts['type']), $zone, $effective_id)));\n }\n\n // Has to find existing if already there\n global $LOADED_MONIKERS_CACHE;\n if (isset($LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id])) {\n if (is_bool($LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id])) { // Ok, none pre-loaded yet, so we preload all and replace the boolean values with actual results\n $or_list = '';\n foreach ($LOADED_MONIKERS_CACHE as $type => $pages) {\n foreach ($pages as $_page => $ids) {\n $first_it = true;\n\n foreach ($ids as $id => $status) {\n if ($status !== true) {\n continue;\n }\n\n if ($first_it) {\n if (!is_string($_page)) {\n $_page = strval($_page);\n }\n\n $first_it = false;\n }\n\n if (is_integer($id)) {\n $id = strval($id);\n }\n\n if ($or_list != '') {\n $or_list .= ' OR ';\n }\n $or_list .= '(' . db_string_equal_to('m_resource_page', $_page) . ' AND ' . db_string_equal_to('m_resource_type', $type) . ' AND ' . db_string_equal_to('m_resource_id', $id) . ')';\n\n $LOADED_MONIKERS_CACHE[$_page][$type][$id] = $id; // Will be replaced with correct value if it is looked up\n }\n }\n }\n if ($or_list != '') {\n $bak = $GLOBALS['NO_DB_SCOPE_CHECK'];\n $GLOBALS['NO_DB_SCOPE_CHECK'] = true;\n $query = 'SELECT m_moniker,m_resource_page,m_resource_type,m_resource_id FROM ' . get_table_prefix() . 'url_id_monikers WHERE m_deprecated=0 AND (' . $or_list . ')';\n $results = $GLOBALS['SITE_DB']->query($query, null, null, false, true);\n $GLOBALS['NO_DB_SCOPE_CHECK'] = $bak;\n foreach ($results as $result) {\n $LOADED_MONIKERS_CACHE[$result['m_resource_type']][$result['m_resource_page']][$result['m_resource_id']] = $result['m_moniker'];\n }\n foreach ($LOADED_MONIKERS_CACHE as $type => &$pages) {\n foreach ($pages as $_page => &$ids) {\n foreach ($ids as $id => $status) {\n if (is_bool($status)) {\n $ids[$id] = false; // Could not look up, but we don't want to search for it again so mark as missing\n }\n }\n }\n }\n }\n }\n $test = $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id];\n if ($test === false) {\n $test = null;\n }\n } else {\n $bak = $GLOBALS['NO_DB_SCOPE_CHECK'];\n $GLOBALS['NO_DB_SCOPE_CHECK'] = true;\n $where = array(\n 'm_deprecated' => 0,\n 'm_resource_page' => $page,\n 'm_resource_type' => $url_parts['type'],\n 'm_resource_id' => is_integer($effective_id) ? strval($effective_id) : $effective_id,\n );\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('url_id_monikers', 'm_moniker', $where);\n $GLOBALS['NO_DB_SCOPE_CHECK'] = $bak;\n if ($test !== null) {\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = $test;\n } else {\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = false;\n }\n }\n\n if (is_string($test)) {\n return ($test == '') ? null : $test;\n }\n\n if ($looking_for == '_WILD:_WILD') {\n return null; // We don't generate these automatically\n }\n\n // Otherwise try to generate a new one\n require_code('urls2');\n $test = autogenerate_new_url_moniker($ob_info, $url_parts, $zone);\n if ($test === null) {\n $test = '';\n }\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = $test;\n return ($test == '') ? null : $test;\n }\n\n return null;\n}",
"public function packingFind($id);",
"function GetTestPath($id)\r\n{\r\n global $settings;\r\n $testPath = \"results/$id\";\r\n if( strpos($id, '_') == 6 )\r\n {\r\n $parts = explode('_', $id);\r\n \r\n // see if we have an extra level of hashing\r\n $dir = $parts[1];\r\n if( count($parts) > 2 && strlen($parts[2]))\r\n $dir .= '/' . $parts[2];\r\n \r\n $testPath = 'results/' . substr($parts[0], 0, 2) . '/' . substr($parts[0], 2, 2) . '/' . substr($parts[0], 4, 2) . '/' . $dir;\r\n }\r\n elseif( strlen($settings['olddir']) )\r\n {\r\n if( $settings['oldsubdir'] )\r\n $testPath = \"results/{$settings['olddir']}/_\" . strtoupper(substr($id, 0, 1)) . \"/$id\";\r\n else\r\n $testPath = \"results/{$settings['olddir']}/$id\";\r\n }\r\n return $testPath;\r\n}",
"public function getCurrentFolderId($url = null, $return = false)\n\t{\n\t\t$keys = explode('/',preg_replace(array('/.*\\/admin\\/registry\\/data\\/folder\\//','/\\.html.*/','/\\?.*/'),'',($url===null)?Yii::app()->getRequest()->getRequestUri():$url));\n\t\t$parentId = null;\n\t\tforeach($keys as $key) {\n\t\t\t$criteria = new CDbCriteria();\n\t\t\tif($parentId === null)\n\t\t\t\t$criteria->condition = 'parent_category_id IS NULL ';\n\t\t\telse\n\t\t\t\t$criteria->condition = 'parent_category_id = '.$parentId.' ';\n\t\t\t$criteria->condition .= 'AND `key` = :key_folder';\n\t\t\t$criteria->params = array(\n\t\t\t\t':key_folder'=>$key\n\t\t\t);\n\t\t\t$data = $this->find($criteria);\n\t\t\tif($data===null)\n\t\t\t{\n\t\t\t\tif($return)\n\t\t\t\t\treturn null;\n\t\t\t\telse\n\t\t\t\t\tthrow new CHttpException(404,'Page nod found');\n\t\t\t}\n\t\t\t$parentId = $data->id;\n\t\t}\n\t\treturn $parentId;\n\t}",
"function find($find, $returnData = false) {\n\t\tif (!is_dir($this->dir.\"/\".$this->table)) return false;\n\t\t\n\t\tif ($dp = opendir($this->dir.\"/\".$this->table)) {\n\t\t\t$dirs = array();\n\t\t\twhile ($file = readdir($dp)) {\n\t\t\t\tif (strlen($file) == 2 && $file != \"..\") {\n\t\t\t\t\t$dirs[] = $this->dir.\"/\".$this->table.\"/\".$file;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tclosedir($dp);\n\t\t\t\n\t\t\t$res = array();\n\t\t\tforeach ($dirs as $dir) {\n\t\t\t\tif ($dp = opendir($dir)) {\n\t\t\t\t\twhile ($file = readdir($dp)) {\n\t\t\t\t\t\tif (strlen($file) == 2 && $file != \"..\") {\n\t\t\t\t\t\t\t$dataFile = new lgDataFile($this->table,$dir.\"/\".$file);\n\t\t\t\t\t\t\t$data = $dataFile->getAllData();\n\t\t\t\t\t\t\tforeach ($data as $n=>$v) {\n\t\t\t\t\t\t\t\t$v[\"_KEY\"] = $n;\n\t\t\t\t\t\t\t\tif (arrayFind($v,$find)) $res[] = $returnData ? $v : $n;\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\tif ($res) return $res;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public static function find_file($rel_filename){\n if (isset(self::$_abs_file_paths[$rel_filename])) {\n $candidate = self::$_abs_file_paths[$rel_filename];\n if ( ! is_null(self::$_path_cache_file) && ! file_exists($candidate)) {\n unset(self::$_abs_file_paths[$rel_filename]);\n self::$_cache_invalid = TRUE;\n } else {\n return $candidate;\n }\n }\n \n foreach (self::$_roots as $root_path) {\n $candidate = $root_path . $rel_filename;\n if (file_exists($candidate)) {\n self::$_cache_invalid = TRUE;\n self::$_abs_file_paths[$rel_filename] = $candidate;\n return $candidate;\n }\n }\n return FALSE;\n }"
]
| [
"0.5309187",
"0.52888405",
"0.5240357",
"0.515072",
"0.5119805",
"0.51019037",
"0.5058278",
"0.50544035",
"0.50343734",
"0.50131696",
"0.4964622",
"0.49068168",
"0.4871403",
"0.48654434",
"0.48481137",
"0.48275697",
"0.48145744",
"0.4789864",
"0.47747964",
"0.4764606",
"0.47574037",
"0.4738425",
"0.47276983",
"0.47240674",
"0.47210747",
"0.4693552",
"0.46820503",
"0.4673049",
"0.46545935",
"0.46479955"
]
| 0.7364819 | 0 |
Inserts all company's website live information. | public function insertCompanyWebsiteLiveInformation(array $data)
{
if (empty($data['company_id'])) {
return false;
}
$insertData = [];
foreach ($this->fields as $field) {
$insertData[$field] = (array_key_exists($field, $data))
? $data[$field] : null;
}
try {
return $this->table->insert($insertData);
} catch (\Exception $e) {
$this->logger->addError(__CLASS__, [$e]);
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n DB::table('websites')->insert([\n ['website_name' => 'hemengeilirz.com', 'wordcount' => '0', 'user_id' => '2',],\n ['website_name' => 'facebook.com', 'wordcount' => '0', 'user_id' => '2',],\n ['website_name' => 'google.com', 'wordcount' => '0', 'user_id' => '2',],\n ],\n );\n }",
"public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'Моя компания',\n 'requisites' => json_encode(array(\n \t'address' => 'Адрес',\n \t'phone' => '8(3952)000-000'\n ))\n ]);\n }",
"function createNewSite($data){\n// var_dump($data); exit;\n if ($this->connection){\n $this->connection->beginTransaction();\n $stmt = $this->connection->prepare(\"INSERT INTO sites(name,url,description,path) VALUES (?,?,?,?)\");\n\n try {\n\n $stmt->execute(array($data['name'],$data['url'],$data['description'],$data['path']));\n $this->connection->commit();\n } catch (PDOException $e) {\n $this->connection->rollBack();\n }\n\n $this->checkError();\n\n }\n }",
"public function run()\n {\n $company = \\App\\Models\\Company::where('subdomain', 'Goudzwaard')->get();\n if ($company->isEmpty()) {\n DB::table('companies')->insert([\n 'name' => 'Aperture Laboratories',\n 'subdomain' => 'aperture',\n 'email' => '[email protected]',\n 'address' => '-',\n 'phonenumber' => '-'\n ]);\n }\n }",
"public function run()\n {\n $now_date = date('Y-m-d h:i:s');\n \n $data = [];\n DB::table('website')->truncate();\n DB::table('website')->insert($data);\n }",
"public function run()\n {\n DB::table('companies')->insert([\n [\n 'company_id'=>'1',\n 'company_name'=>'Quyền root',\n ],\n ]);\n }",
"public function run()\n {\n $itens = [\n ['site'=> 'Bingo top'],\n ['site'=> 'Melhor do bingo'],\n ['site'=> 'Agora vai'],\n ];\n\n DB::table('sites')->insert($itens);\n }",
"public function run()\n {\n $company = array(\n array('company_name'=> 'Airtel'),\n array('company_name'=> 'Vodafone'),\n array('company_name'=> 'Jio'),\n \n );\n\n Company::insert($company);\n }",
"public function run()\n {\n \t\t$companies = [\n [\n 'company_name' => 'Your Company',\n 'type' => '',\n 'telephone' => '(000) 000-000',\n 'email' => '[email protected]',\n 'website' => 'www.your-company.com',\n 'image_url' => 'logo-placeholder.png',\n 'is_enable' => 0,\n 'created_by' => 1,\n ],\n\n ];\n \n foreach ($companies as $item)\n DB::table('companies')->insert($item);\n }",
"public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'My Company',\n 'address' => '2283 Poling Farm Road',\n ]);\n\n DB::table('companies')->insert([\n \t'name' => 'Google',\n \t'address' => '1940 Crowfield Road',\n ]);\n\n DB::table('companies')->insert([\n 'name' => 'Twitter',\n 'address' => '4737 Williams Lane',\n ]);\n \n }",
"public function run()\n {\n DB::table('company')->insert([\n [\n 'name' => 'Las Lomas',\n 'rule' => 'NB732-500S',\n ]\n ]);\n }",
"function insert() {\n if(!$this->valid):\n return;\n endif;\n \n $this->name = mysql_real_escape_string($this->name);\n $this->brief = mysql_real_escape_string($this->brief);\n $this->description = mysql_real_escape_string($this->description);\n $this->games = mysql_real_escape_string($this->games);\n $this->headquarter = mysql_real_escape_string($this->headquarter);\n \n $sql = \"INSERT INTO companies\n (name, brief, description, date_founded, headquarter, website, imageURL, games, num_likes)\n VALUES\n ('$this->name', '$this->brief', '$this->description', '$this->date_founded', '$this->headquarter', '$this->website', '$this->imageURL', '$this->games', '$this->num_likes')\";\n \n if(!mysqli_query($this->con, $sql)) {\n die('Error: ' . mysqli_error($this->con));\n }\n \n //mysqli_close($con);\n \n echo \"<br>Insertion Successful!<br>\";\n }",
"public function run()\n {\n $json = json_decode(file_get_contents('https://core.tadbirrlc.com//StocksHandler.ashx?{%22Type%22:%22ALL21%22,%22Lan%22:%22Fa%22}&jsoncallback='), true);\n\n foreach ($json as $item) {\n DB::table('companies')\n ->insert([\n 'symbol' => $item['sf'],\n 'name' => $item['cn'],\n 'id_code' => $item['ic'],\n 'company_12_digit_name' => $item['nc'],\n 'category_id' => $item['sc']\n ]);\n }\n }",
"public function run()\n {\n DB::table('companies')->insert([\n \t\t\t[\n\t\t \t\t'business_name' => 'Northeastern Tech Supply',\n\t\t \t\t'website' => 'www.northeasterntech.com',\n\t\t\t\t\t\t'type' => 'B2C',\n\t\t\t\t\t\t'status' => 'Active',\n\t\t\t\t\t\t'brands_of_interest' => 'Dell, Toshiba',\n\t\t\t\t\t\t'contact_me_via' => 'Email',\n\t\t\t\t\t\t'how_heard_about' => 'I ran across your website while I was searching for parts for a project.',\n\t\t\t\t\t\t'notes' => 'Large corporate client. Give them service with a smile!',\n\t\t\t\t\t],\n\t\t \t[\n\t\t \t\t'business_name' => 'PFG Computing, Inc.',\n\t\t \t\t'website' => 'www.pfg-computing.com',\n\t\t\t\t\t\t'type' => 'B2B',\n\t\t\t\t\t\t'status' => 'Active',\n\t\t\t\t\t\t'brands_of_interest' => 'Sony, HP, Dell',\n\t\t\t\t\t\t'contact_me_via' => 'Phone',\n\t\t\t\t\t\t'how_heard_about' => 'We were looking for a supplier for parts and got a recommendation for you.',\n\t\t\t\t\t\t'notes' => 'One of our main client companies.',\n\t\t\t\t\t],\n\t\t\t\t\t[ // Pending company\n\t\t \t\t'business_name' => 'Altech, Ltd.',\n\t\t \t\t'website' => 'altech.com',\n\t\t\t\t\t\t'type' => 'B2C',\n\t\t\t\t\t\t'status' => 'Active',\n\t\t\t\t\t\t'brands_of_interest' => 'HP, Sony, Toshiba, Acer',\n\t\t\t\t\t\t'contact_me_via' => 'Email',\n\t\t\t\t\t\t'how_heard_about' => 'A friend of mine works at your company.',\n\t\t\t\t\t\t'notes' => '',\n\t\t\t\t\t],\n\t\t\t\t\t[ //Pending company\n\t\t \t\t'business_name' => 'Colorado Digital Services, LLC',\n\t\t \t\t'website' => 'www.cds-llc.net',\n\t\t\t\t\t\t'type' => 'B2B',\n\t\t\t\t\t\t'status' => 'Active',\n\t\t\t\t\t\t'brands_of_interest' => 'HP, Dell',\n\t\t\t\t\t\t'contact_me_via' => 'Phone',\n\t\t\t\t\t\t'how_heard_about' => 'Walk-in',\n\t\t\t\t\t\t'notes' => '',\n\t\t\t\t\t],\n \t]);\n }",
"function save_visit($visit_data ) {\n\t// company is not required, default to ''\n\t$visit_data += array(\n\t\t'company' => '',\n\t);\n\n\t$db = db_connect();\n\n\t// throws Http_error on validation fail\n\t$visit_data = validate_visit_data($visit_data);\n\n\t$insert_data = array(\n\t\t'name' => $visit_data['name'],\n\t\t'company' => $visit_data['company'],\n\t\t'parking' => $visit_data['parking'],\n\t\t// use $_SERVER instead of gethostname() to support virtual\n\t\t// hosts\n\t\t'srvhost' => $_SERVER['SERVER_NAME'],\n\t\t'webhost' => $_SERVER['REMOTE_ADDR'],\n\t);\n\n\t// generate unique webkey\n\t$webkey = '';\n\tdo {\n\t\t$webkey = md5(microtime().mt_rand());\n\t\t$stmt = $db->prepare(\"SELECT id FROM pers WHERE webkey=?\");\n\t\t$stmt->bind_param('s', $webkey);\n\t\t// query db\n\t\tif (!$stmt->execute() || !$stmt->bind_result($id )) {\n\t\t\tthrow new Http_error(500, 'Could not generate webkey.');\n\t\t}\n\t\t$f = $stmt->fetch();\n\t\t// webkey is ok\n\t\tif ($f === null ) {\n\t\t\tbreak;\n\t\t// webkey already exists, try again\n\t\t} else if ($f === true ) {\n\t\t\tcontinue;\n\t\t// error (f === false)\n\t\t} else {\n\t\t\tthrow new Http_error(500, 'Could not generate webkey.');\n\t\t}\n\t} while (true);\n\n\t$insert_data['webkey'] = $webkey;\n\n\t// set up dates to be inserted as DATETIME \n\t$insert_data['enter_time'] =\n\t\tdate('Y-m-d H:i:s', $visit_data['start_date']);\n\t$insert_data['leave_time'] =\n\t\tdate('Y-m-d H:i:s', $visit_data['end_date']);\n\n\tlog_msg(LOG_DEBUG, 'inserting visit data: '.\n\t\timplode('; ', $insert_data ).' ...');\n\n\t$sql = 'INSERT INTO pers '.\n\t\t'(name, company, enter_time, leave_time, '.\n\t\t\t'webhost, webkey, parking) '.\n\t\t'VALUES (?, ?, ?, ?, ?, ?, ?)';\n\n\t$stmt = $db->prepare($sql);\n\tif (!$stmt ) {\n\t\tthrow new Http_error(500, 'DB error prepare: '.$sql);\n\t}\n\n\t$stmt->bind_param('sssssss',\n\t\t$insert_data['name'], $insert_data['company'],\n\t\t$insert_data['enter_time'], $insert_data['leave_time'],\n\t\t$insert_data['webhost'], $insert_data['webkey'],\n\t\t$insert_data['parking']);\n\t\n\tif (!$stmt->execute()) {\n\t\tthrow new Http_error(500, 'DB error exe');\n\t}\n\n\t$stmt->close();\n\n\t$last_id = get_last_insert_id($db);\n\tif (!$last_id ) {\n\t\tthrow new Http_error(500, 'DB error last id');\n\t}\n\t$insert_data['id'] = $last_id;\n\n\t// insert information about visit, one row per receiver\n\tforeach ($visit_data['receivers'] as $r ) {\n\t\t$sql = 'INSERT INTO visit (id, uname) VALUES(?, ?)';\n\t\t$stmt = $db->prepare($sql);\n\t\tif (!$stmt ) {\n\t\t\tthrow new Http_error(500, 'DB error prepare: '.$sql);\n\t\t}\n\t\t$stmt->bind_param('is', $last_id, $r['uname']);\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new Http_error(500, 'DB error exe 2');\n\t\t}\n\t}\n\n\tsave_picture(basename(trim($visit_data['picture'] )), $last_id);\n\tsend_visitor_email($insert_data, $visit_data['receivers']);\n\tprint_visitor_badge($insert_data + $visit_data);\n}",
"public function run()\n {\n \\App\\Models\\Company::truncate();\n \\App\\Models\\Company::insert([\n [\n 'url' => path('homepage', 'company-1.webp'),\n 'link' => 'http://aspapi.org/',\n 'created_at' => now('-11 hours'),\n 'updated_at' => now('-11 hours')\n ], [\n 'url' => path('homepage', 'company-2.webp'),\n 'link' => 'https://www.itb.ac.id/',\n 'created_at' => now('-10 hours'),\n 'updated_at' => now('-10 hours')\n ], [\n 'url' => path('homepage', 'company-3.webp'),\n 'link' => 'https://www.inti.co.id/',\n 'created_at' => now('-9 hours'),\n 'updated_at' => now('-9 hours')\n ], [\n 'url' => path('homepage', 'company-4.webp'),\n 'link' => 'http://www.belajarmikrotik.com/',\n 'created_at' => now('-8 hours'),\n 'updated_at' => now('-8 hours')\n ], [\n 'url' => path('homepage', 'company-5.webp'),\n 'link' => 'http://www.msvpictures.com/',\n 'created_at' => now('-7 hours'),\n 'updated_at' => now('-7 hours')\n ], [\n 'url' => path('homepage', 'company-6.webp'),\n 'link' => 'http://www.amikom.ac.id/',\n 'created_at' => now('-6 hours'),\n 'updated_at' => now('-6 hours')\n ], [\n 'url' => path('homepage', 'company-7.webp'),\n 'link' => 'http://www.melsa.net.id/',\n 'created_at' => now('-5 hours'),\n 'updated_at' => now('-5 hours')\n ], [\n 'url' => path('homepage', 'company-8.webp'),\n 'link' => 'http://www.axiooworld.com/',\n 'created_at' => now('-4 hours'),\n 'updated_at' => now('-4 hours')\n ], [\n 'url' => path('homepage', 'company-9.webp'),\n 'link' => 'http://www.cgs.co.id/newcgs/',\n 'created_at' => now('-3 hours'),\n 'updated_at' => now('-3 hours')\n ], [\n 'url' => path('homepage', 'company-10.webp'),\n 'link' => 'https://www.skyline.net.id/',\n 'created_at' => now('-2 hours'),\n 'updated_at' => now('-2 hours')\n ], [\n 'url' => path('homepage', 'company-11.webp'),\n 'link' => 'http://www.mikrotik.com/',\n 'created_at' => now('-1 hours'),\n 'updated_at' => now('-1 hours')\n ], [\n 'url' => path('homepage', 'company-12.webp'),\n 'link' => 'https://www.smooets.com/',\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ]);\n }",
"public function run()\n {\n DB::table('companies')->insert([\n \"id\" => 1,\n 'name' => \"Hilbert IS\",\n 'email' => \"[email protected]\",\n 'address' => \"2 Rue Turgot, 75009 Paris\",\n 'phone' => \"0177623811\",\n 'website' => \"https://hilbert-is.com\",\n ]);\n }",
"public function run()\n {\n DB::table('links')->insert([\n [\n 'content' => 'https://www.youtube.com/watch?v=JgHfx2v9zOU',\n 'uses' => '1a',\n 'comments' => 'video before testimonials',\n ],\n [\n 'content' => 'https://colorlib.com/',\n 'uses' => 'footer',\n 'comments' => 'footer/copyright',\n ], \n ]);\n }",
"public function run()\n {\n $count = DB::table('site_details')->count();\n\n if ($count < 1) {\n DB::table('site_details')->insert([\n [\n 'description' =>\n 'Architecto provident tempora nostrum molestias. Possimus voluptatem nam veritatis impedit ratione quam quibusdam quia. In nobis harum deleniti quia voluptas atque. Quo soluta qui sed ratione excepturi. Quasi quia delectus nulla veritatis sed ducimus excepturi facere. Mollitia deserunt adipisci deleniti accusamus rerum est ratione eum',\n 'mission' =>\n 'Quae non reprehenderit consequatur autem. Voluptas molestiae quisquam quia minima eaque. Non fugiat omnis voluptates occaecati. Nesciunt repudiandae error quod. Hic eaque et aut exercitationem laborum commodi non rem. Unde et quo et dolorem modi. Odit labore enim nihil expedita',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]\n ]);\n }\n }",
"public function updateCompanyWebsiteLiveInformation(array $data)\n {\n if (empty($data['company_id'])) {\n return false;\n }\n\n $updateData = [];\n foreach ($data as $field => $value) {\n if (in_array($field, $this->fields)) {\n $updateData[$field] = $value;\n }\n }\n try {\n return $this->table\n ->where('company_id', $data['company_id'])\n ->update($updateData);\n } catch (\\Exception $e) {\n $this->logger->addError(__CLASS__, [$e]);\n return false;\n }\n }",
"public function run()\n {\n DB::table('providers')->insert([\n \t'name' => 'Samsung Company LTD',\n \t'cuit' => '034576341234',\n \t'is_active' => 1,\n \t'profile_id' => 3,\n \t'company_id' => 1\n ]);\n\n DB::table('providers')->insert([\n \t'name' => 'LG Company LTD',\n \t'cuit' => '034576341234',\n \t'is_active' => 1,\n \t'profile_id' => 4,\n \t'company_id' => 1\n ]);\n }",
"public function testInsert()\n {\n\n $data['url'] = 'unittest.com';\n $data['hosted_server'] = 'unittest';\n $data['state'] = 'unit';\n $data['created_date'] = '2017-01-01';\n $data['last_updated_date'] = '2017-01-01';\n $data['active_from'] = '2017-01-01';\n $data['active_to'] = '2017-01-01';\n\n $new_site = new Site();\n $new_site->createSite($data);\n\n $this->assertTrue(true);\n }",
"function company_insert($table, $data) {\n\n global $devel, $tablas, $I;\n\n if (!$data) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para INSERT en $table\");\n }\n\n $VALUES = values($data);\n $FIELDS = fields($data);\n\n $query = \"INSERT INTO `$table` ($FIELDS) VALUES ($VALUES)\";\n sql($query, $table, 'INSERT');\n $I++;\n}",
"public function run()\n {\n DB::table('companies')->insert(\n [\n [\n 'company' => 'GreenPeace',\n 'address' => 'Chaussée de Haecht 159, 1030 Schaerbeek',\n 'phone' => '+325484595',\n 'email' => '[email protected]',\n 'name' => 'Georges',\n 'surname' => 'Batanga',\n 'src' => 'https://siena.rosselcdn.net/sites/default/files/dpistyles_v2/ena_16_9_extra_big/2019/12/11/node_488669/1753091/public/2019/12/11/B9721899900Z.1_20191211195854_000%2BG47F3R0PL.1-0.jpg?itok=A6zebxO61576090741'\n ],\n [\n 'company' => 'Amnesty International',\n 'address' => 'Chaussée de Wavre 169, 1050 Bruxelles',\n 'phone' => '+3254789825',\n 'email' => '[email protected]',\n 'name' => 'Alexeï',\n 'surname' => 'Navalny',\n 'src' => 'https://i1.wp.com/www.blegny.be/wp-content/uploads/2017/03/amnesty_international.jpg?fit=308%2C294&ssl=1'\n ],\n [\n 'company' => 'WWF',\n 'address' => 'Boulevard Emile Jacqmain 90, 1000 Bruxelles',\n 'phone' => '+324587956',\n 'email' => '[email protected]',\n 'name' => 'Bin',\n 'surname' => 'Dim',\n 'src' => 'https://pbs.twimg.com/profile_images/700607704151126016/FjtJU4W4_400x400.jpg'\n ],\n [\n 'company' => 'APEFE',\n 'address' => 'Place Sainctelette 2, 1080 Bruxelles',\n 'phone' => '+32242154824',\n 'email' => '[email protected]',\n 'name' => 'Luc',\n 'surname' => 'Ameye',\n 'src' => 'https://pbs.twimg.com/profile_images/378800000820229408/43255550105ea92fd865076c5a018394_400x400.jpeg'\n ],\n [\n 'company' => 'Oxfam',\n 'address' => 'Rue du Bailli 96, 1050 Ixelles',\n 'phone' => '+325485921',\n 'email' => '[email protected]',\n 'name' => 'Virginie',\n 'surname' => 'Coletta',\n 'src' => 'https://www.guidesocial.be/_images/thumbs/activity/350x350/151620360562.jpg'\n ],\n [\n 'company' => 'Sea Shepherd',\n 'address' => 'Rue des Palais 44, 1030 Schaerbeek',\n 'phone' => '+325486515',\n 'email' => '[email protected]',\n 'name' => 'Paul',\n 'surname' => 'Watson',\n 'src' => 'https://yt3.ggpht.com/ytc/AAUvwniTP-k7p975_oKrCcHWjqejL88U6mnXCr3QI7Yj=s900-c-k-c0x00ffffff-no-rj'\n ]\n ]\n );\n }",
"public function run()\n {\n DB::table('sites')->insert(\n [\n 'title' => 'OLX'\n ]);\n DB::table('sites')->insert(\n [\n 'title' => 'Rieltor.ua'\n ]);\n DB::table('sites')->insert(\n [\n 'title' => 'ЦентрИнформ'\n ]);\n DB::table('sites')->insert(\n [\n 'title' => 'ЦентрДом'\n ]);\n DB::table('sites')->insert(\n [\n 'title' => 'Харьков Эстейт'\n ]);\n DB::table('sites')->insert(\n [\n 'title' => 'Премьер'\n ]);\n }",
"public function run()\n {\n \n DB::table('pages')->insert([\n ['name'=>'about-us', 'details'=>''],\n ['name'=>'privacy-policy', 'details'=>''],\n ['name'=>'terms-of-service', 'details'=>''],\n ]);\n \n }",
"public function run()\n {\n for($i=0;$i<100;$i++){\n DB::table('companies')->insert([\n 'company_name' => 'Truong123',\n 'company_web' => 'Web2_Truong',\n 'company_address' => 'Thu Duc 123',\n 'company_code' => 'laravel',\n 'company_phone' => '01693861435'\n ]);\n }\n }",
"public function run()\n {\n SiteSetting::insert([\n \t\t'title'=>'maulik',\n \t\t'email'=>'[email protected]',\n \t\t'phone_1'=>'1234567890',\n \t\t'phone_2'=>'1234567890',\n \t\t'copy_right'=>'maulik',\n \t\t'site_visitors'=>'100'\n \t]);\n }",
"public function run()\n {\n $data = [\n [\n 'url' => 'https://www.andrearufo.it/',\n 'created_at' => date('Y-m-d H:i:s'),\n ]\n ];\n\n $links = $this->table('links');\n $links->insert($data)->saveData();\n }",
"public function run()\n {\n DB::table('sitesettings')->insert([\n [\n 'namesetting' => 'Company_name',\n 'value' => 'Company name',\n 'status' => 0\n ],\n [\n 'namesetting' => 'logo',\n 'value' => 'twitter.jpg',\n 'status' => 1\n ],\n [\n 'namesetting' => 'address',\n 'value' => 'Company address',\n 'status' => 0\n ],\n [\n 'namesetting' => 'phone',\n 'value' => '001684849309',\n 'status' => 0\n ]\n ]);\n }"
]
| [
"0.5712083",
"0.56418145",
"0.562608",
"0.5581254",
"0.55758816",
"0.5541152",
"0.5491488",
"0.54902303",
"0.54820013",
"0.5474837",
"0.547324",
"0.5452099",
"0.54423463",
"0.5441288",
"0.543647",
"0.540618",
"0.5386578",
"0.5351543",
"0.5347426",
"0.5341462",
"0.53248817",
"0.53193736",
"0.5319065",
"0.53154296",
"0.531461",
"0.5314273",
"0.52971333",
"0.52956027",
"0.52829385",
"0.52751154"
]
| 0.6506713 | 0 |
Updates company's website live information. | public function updateCompanyWebsiteLiveInformation(array $data)
{
if (empty($data['company_id'])) {
return false;
}
$updateData = [];
foreach ($data as $field => $value) {
if (in_array($field, $this->fields)) {
$updateData[$field] = $value;
}
}
try {
return $this->table
->where('company_id', $data['company_id'])
->update($updateData);
} catch (\Exception $e) {
$this->logger->addError(__CLASS__, [$e]);
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateSite()\n {\n }",
"function updateFacebookCurrentCity () {\n }",
"public function updateWhoIsOnline() {\n\t\t$this->oWebsite->updateWhoIsOnline();\n\t}",
"private function TrafficUpdate() {\n $this->getTraffic(); //Chamando o metodo getTraffic\n $ArrSiteViews = ['siteviews_pages' => $this->Traffic['siteviews_pages'] + 1]; //Atualizando a pages\n $updatePageViews = new Update; //instanciando a classe Update\n $updatePageViews->ExeUpdate('siteviews', $ArrSiteViews, \"WHERE siteviews_date = :date\", \"date={$this->Date}\"); //Executando o metodo ExeUpdate, neste informando tabela e quais dados atualizar\n\n $this->Traffic = null; //Liberado espaço da memoria\n }",
"private function setWebsiteValue()\n {\n $value = $this->getData(self::$websiteAttributeCode);\n $list = $this->storeManager->getWebsites();\n $this->setCustomAttribute(self::$websiteAttributeCode, $list[$value]->getName());\n $this->setCustomAttribute(self::$websiteIdAttributeCode, $value);\n }",
"function editCompany() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed in via the URL */\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$company->update_attributes(array('name'\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t 'city'\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t => $_POST['inputComments'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t$company->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}",
"public function testUpdateDomains()\n {\n $this->browse(function (Browser $browser) {\n $this->login($browser);\n\n foreach (Domain::where('is_updated', false)->get() as $domain) {\n $this->updateNameservers($browser, $domain);\n $this->updateForwarding($browser, $domain);\n\n $domain->is_updated = true;\n $domain->save();\n }\n });\n }",
"function update_company($company_id, $company_name, $email, $address, $city, $state, $zip, $phone, $fax, $sic_code, $sic_description, $website,$mc_number,$dot_number) {\n\t\t $str = \"UPDATE company SET company_name = '$company_name', email_address = '$email', address = '$address', city = '$city', state = '$state', zipcode = '$zip', phone_number = '$phone', fax_number = '$fax', sic_code = $sic_code, sic_description = '$sic_description', web_address = '$website',mc_number = '$mc_number', dot_number = '$dot_number' WHERE Comany_ID = $company_id\"; \n\t\tif($req = mysqli_query($link,$str)) return true;\n\t\telse return false;\n\t}",
"public function testUpdateSiteMembership()\n {\n }",
"public function update()\n {\n // ...\n // ...\n // ...\n // ...\n\n // Maintenant je redirige vers la page 'mon-panier'\n header('Location: '.$this->baseUrl.'/mon-panier/');\n }",
"private function BrowserUpdate() {\n $readAgent = new Read; //Instanciando a classe Read\n $readAgent->ExeRead('siteviews_agent', \"WHERE agent_name = :agent\", \"agent={$this->Browser}\"); //Executando o metodo ExRead da classe Read\n if (!$readAgent->getResult())://Se não fizer leitura então se cria uma nova\n $ArrAgent = ['agent_name' => $this->Browser, 'agent_views' => 1];\n $createAgent = new Create; //Instanciando Classe Create\n $createAgent->ExeCreate('siteviews_agent', $ArrAgent); //Executando o Metodo ExCreate da classe Create passando os dados a serem criados no banco\n else://Se fez leitura então atualiza\n $ArrAgent = ['agent_views' => $readAgent->getResult()[0]['agent_views'] + 1];\n $updateAgent = new Update; //Instanciando o metodo Update\n $updateAgent->ExeUpdate('siteviews_agent', $ArrAgent, \"WHERE agent_name = :name\", \"name={$this->Browser}\"); //Executando o metodo ExUpdate da classe Update, neste atualizando as informações no banco\n endif;\n }",
"public function updates_page()\n\t{\n\t\t// $data['active'] = 0;\n\t\t$id_company = $this->session->userdata('id_company');\n\n\t\t$company_name = $this->session->userdata('company_name');\n\t\t$data['company_name'] = $company_name;\n\n\t\t// pagination\n\t\t$base_url = site_url('company/updates/page');\n\t\t$uri_segment = 4;\n\t\t$limit_per_page = 10;\n $total_rows = $this->CompanyUpdatesModel->get_total();\n $start_index = ($this->uri->segment($uri_segment) ? $this->uri->segment($uri_segment) : 1) - 1;\n $start_index = $start_index * $limit_per_page;\n\n\t\t$data['company_updates'] = $this->CompanyUpdatesModel->get_all($id_company, $limit_per_page, $start_index);\n\n\t\t$data['links'] = $this->custom_pagination($base_url, $uri_segment, $limit_per_page, $total_rows);\n\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page');\n\t\t$this->load->view('content_front_end/company_updates_page', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}",
"function update_company_logo($company_id, $logo_url) {\n\t\t$str = \"UPDATE company SET company_logo = '$logo_url' WHERE Comany_ID = $company_id\";\n\t\tif($req = mysqli_query($link,$str)) return true;\n\t\telse return false;\t\n\t}",
"function update() {\n $db = new Db();\n $sql = \"UPDATE settings SET `company_name` = '%s', `company_address` = '%s', `admin_email` = '%s', `username` = '%s', `password` = '%s', `company_phone` = '%s', `company_fax` = '%s', `company_mobile` = '%s', `company_email` = '%s' WHERE `id` = '%s'\";\n $params = array($this->company_name, $this->company_address, $this->admin_email, $this->username, $this->password, $this->company_phone, $this->company_fax, $this->company_mobile, $this->company_email, $this->id);\n if (!$db->dbQuery($sql, $params)) {\n $this->error_msg = $db->getErrorMsg();\n $this->error_no = $db->getErrorNo();\n return false;\n } else {\n return true;\n }\n }",
"function updateCustomerOnPastel($siteGUID,$itemGUID) {\n\t\tglobal $db;\n\t\t$companyGUID = $db->get_var(\"select coguid from sites where guid = '\".$siteGUID.\"'\");\n\t\t$sitePastelID = $db->get_var(\"select pastelid from sites where guid = '\".$siteGUID.\"'\");\n\t\t$itemPastelID = $db->get_var(\"select pastelid from pasteltranslate where siteguid = '\".$siteGUID.\"' and itemguid = '\".$itemGUID.\"'\");\n\t\t$p_args = array( \n\t\t\t'companyid'\t=> $sitePastelID,\n\t\t);\n\t\t$method = \"Customer/Save\";\n\t\t$customer = $db->get_row(\"select * from community where guid = '\".$itemGUID.\"' and companyguid = '\".$companyGUID.\"' and communitytype in (0,2)\");\n\t\t$arr = array(\n\t\t\t\"Name\"\t\t\t\t=>\t$customer->descr,\n\t\t\t\"Email\"\t\t\t\t=>\t$customer->email,\n\t\t\t\"Active\"\t\t\t=>\t($customer->live == 1 ? true : false ),\n\t\t\t\"Balance\"\t\t\t=>\t(float)$customer->current_balance * 100,\n\t\t\t\"CommunicationMethod\" => 0,\n\t\t\t\"CreditLimit\"\t\t=>\t(float)$customer->community_limit * 100,\n\t\t\t\"PostalAddress01\"\t=>\t$customer->address_line1,\n\t\t\t\"PostalAddress02\"\t=>\t$customer->address_line2,\n\t\t\t\"PostalAddress03\"\t=>\t$customer->suburb,\n\t\t\t\"PostalAddress04\"\t=>\t$customer->city,\n\t\t\t\"PostalAddress05\"\t=>\t$customer->postal_code,\n\t\t\t\"DeliveryAddress01\"\t=>\t$customer->billing_address_line1,\n\t\t\t\"DeliveryAddress02\"\t=>\t$customer->billing_address_line2,\n\t\t\t\"DeliveryAddress03\"\t=>\t$customer->billing_suburb,\n\t\t\t\"DeliveryAddress04\"\t=>\t$customer->billing_city,\n\t\t\t\"DeliveryAddress05\"\t=>\t$customer->billing_postal_code\n\t\t);\n\t\t//console(\"pastelid item [$itemPastelID]\");\n\t\tif (is_numeric($itemPastelID)) {\n\t\t\t$arr['ID'] = $itemPastelID;\n\t\t}\n\t\t$result = do_pastel_call($method,$p_args,$arr);\n\t\tif (!empty($result['ID'])) {\n\t\t\tinsertPastelTranslate($siteGUID,$itemGUID,$result['ID']);\n\t\t}\n\t}",
"public function update() {\n\t\t\t$this->output->layout = \"empty\";\n\t\t\t$this->output->set(\"url\", PUBLIC_URL.Settings::get(\"update.air.path\"));\n\t\t\t$this->output->set(\"version\", Settings::get(\"update.air.version\"));\n\t\t\t$this->output->set(\"notes\", Settings::get(\"update.air.notes\"));\n\t\t\t$this->output->view(\"api/xml/update.php\");\n\t\t\t$this->output->header(\"Content-Type: text/xml\");\n\t\t\t$this->output->cache($this->default_cache_timeout);\n\t\t}",
"public function update(Request $request, Company $company)\n {\n //\n }",
"public function update(Request $request, Company $company)\n {\n //\n }",
"public function update(Request $request, Company $company)\n {\n //\n }",
"function update_site_cache($sites, $update_meta_cache = \\true)\n {\n }",
"public function detail_updates($id_company_update)\n\t{\n\t\t// check user's auth\n\t\t$id_company = $this->session->userdata('id_company');\n\t\tif ($id_company == \"\") {\n\t\t\tredirect( site_url('AccountCompany') );\n\t\t}\n\n\t\t//$data['active'] = 2;\n\n\t\t$id_company = $this->session->userdata('id_company');\n\t\t$data['company_update'] = $this->CompanyUpdatesModel->edit($id_company, $id_company_update);\n\n\t\t$company_name = $this->session->userdata('company_name');\n\t\t$data['company_name'] = $company_name;\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t$this->load->view('content_front_end/company_updates_page_detail', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}",
"protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}",
"abstract public function get_url_update();",
"public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }",
"function updateMyCompanyDetails()\n{\n\n\t$data= array();\n\t$company_categories=array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t$role\t\t\t=\tgetUserDesignationFromCompUserRelation($my_session_id);\n\t\n\t$companyName\t\t=validate_input($_POST['companyName']);\n\t$companyDesc\t\t=validate_input($_POST['companyDesc']);\n\t$email\t\t\t\t=validate_input($_POST['email']);\n\t$website\t\t\t\t=validate_input($_POST['website']);\n\t$mobile\t\t\t\t=validate_input($_POST['mobile']);\n\t$telephone\t\t\t=validate_input($_POST['tel']);\n\t$fax\t\t\t\t\t=validate_input($_POST['fax']);\n\t\n\t\n\tif(!empty($_POST['categories']))\n\t{\n\t\t$count_category=count($_POST['categories']);\n\t\tfor($i=0;$i<$count_category;$i++)\t\n\t\t{\n\t\t\t$company_categories[$i]=$_POST['categories'][$i]['text'];\n\t\t}\n\t}\t\n\t$companyID=getCompanyIDFromCompUserRelation($my_session_id);\n\t$qry=\"UPDATE company_profiles SET company_name='\".$companyName.\"', description='\".$companyDesc.\"', email='\".$email.\"',website='\".$website.\"',mobile='\".$mobile.\"'\n\t\t\t,telephone='\".$telephone.\"',fax='\".$fax.\"' \n\t\t\tWHERE id=\".$companyID.\" \";\n if(setData($qry))\n {\n \t//updation successful\n \t$data=fetch_company_information_from_userid($my_session_id);\n \t\n \t$company_id=$data['id'];\n\t\t$category_json= json_encode($company_categories);\n\t\t//delete_company_categories($company_id);\n\t\tupdate_company_categories($company_id,$category_json); \t\n \t$data['categories']\t= fetch_company_categories($company_id);\n \t\n \t$data['followers']\t= entrp_company_follows($company_id);\n \t\n\t\t$data['success'] \t\t= true;\n\t\t$data['msg'] \t\t\t= 'Company Profile updated.'; \n }\n else\n {\n \t$data['success'] \t\t= false;\n\t\t$data['msg'] \t\t\t= 'Something went wrong. Profile not updated.'; \n }\n\treturn $data;\n\n}",
"public function update(Request $request, WlaCompany $company)\n {\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n $company->name = $request->input('name');\n $company->description = $request->input('description');\n $company->url = $request->input('url');\n $company->domain = $request->input('domain');\n if($picture = $request->file('picture')) {\n $company->picture = $picture; \n }\n $company->save();\n\n flash('Company has been updated', 'success');\n return redirect()->back();\n }",
"function findCompanyWebsite($company_name) \n {\n \n }",
"function company_settingsupdate() {\n $this->auth(COMP_ADM_LEVEL);\n $company_id = $this->uri->segment(3);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_company_settings->update($company_id, $data)){\n $this->companyadmin(7);\n }else{\n echo 'error';\n }\n }",
"private function updateUrl(){\n $this->url->status_code = $this->response['status_code'];\n $this->url->reason_phrase = $this->response['reason_phrase'];\n $this->url->location = $this->response['location'];\n $this->url->content_type = $this->response['content_type'];\n $this->url->content_length = $this->response['content_length'];\n $this->url->save();\n }",
"public function update();"
]
| [
"0.66516644",
"0.60937375",
"0.58241266",
"0.58132356",
"0.5788543",
"0.5753813",
"0.5717724",
"0.5658076",
"0.5623818",
"0.5553485",
"0.5548522",
"0.543899",
"0.53901803",
"0.53712374",
"0.535554",
"0.53474224",
"0.5338954",
"0.5338954",
"0.5338954",
"0.531209",
"0.53096807",
"0.5284873",
"0.52806115",
"0.5277014",
"0.5259526",
"0.5258633",
"0.5257974",
"0.5257532",
"0.52541775",
"0.52461195"
]
| 0.69452226 | 0 |
Queues the user's submitted registration info for later admin approval. | public function queueSignup(&$info)
{
global $conf;
// Perform any preprocessing if requested.
$this->_preSignup($info);
// If it's a unique username, go ahead and queue the request.
$signup = $this->newSignup($info['user_name']);
if (!empty($info['extra'])) {
$signup->setData($info['extra']);
}
$signup->setData(array_merge($signup->getData(), array(
'dateReceived' => time(),
'password' => $info['password'],
)));
$this->_queueSignup($signup);
try {
Horde::callHook('signup_queued', array($info['user_name'], $info));
} catch (Horde_Exception_HookNotSet $e) {
}
if (!empty($conf['signup']['email'])) {
$link = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/admin/signup_confirm.php', true, -1)->setRaw(true)->add(array(
'u' => $signup->getName(),
'h' => hash_hmac('sha1', $signup->getName(), $conf['secret_key'])
));
$message = sprintf(Horde_Core_Translation::t("A new account for the user \"%s\" has been requested through the signup form."), $signup->getName())
. "\n\n"
. Horde_Core_Translation::t("Approve the account:")
. "\n" . $link->copy()->add('a', 'approve') . "\n"
. Horde_Core_Translation::t("Deny the account:")
. "\n" . $link->copy()->add('a', 'deny');
$mail = new Horde_Mime_Mail(array(
'body' => $message,
'Subject' => sprintf(Horde_Core_Translation::t("Account signup request for \"%s\""), $signup->getName()),
'To' => $conf['signup']['email'],
'From' => $conf['signup']['email']));
$mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function _queueSignup($signup);",
"function RegisterUser(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateRegistrationSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadUserPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Upic'] = $this->upLoadUserPic();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectRegistrationSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->comparePswd($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!$this->SaveToEventAdvDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/*if(!$this->sendConfimMail($formvars)){\r\n\t\t\treturn false;\r\n\t\t}*/\r\n\r\n\t\t//$this->SendAdminIntimationEmail($formvars);\r\n\r\n\t\treturn true;\r\n\t}",
"public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }",
"function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }",
"function action_register() {\n if(model_user::userLoggedIn()) {\n header('Location: /home/track');\n }\n $jobs = model_job::getAllJobs();\n $displayError = FALSE;\n\n if (isset($_POST['btn-register'])) {\n $user_data = array(\n 'lastname' => model_user::sanitizeInput($_POST['form']['lastname']),\n 'firstname' => model_user::sanitizeInput($_POST['form']['firstname']),\n 'email' => $_POST['form']['email'],\n 'password' => $_POST['form']['password'],\n 'confirmPassword' => $_POST['form']['confirmPass'],\n 'job' => $_POST['form']['job'],\n );\n\n $form_errors = array(\n 'emailMessage' => '',\n 'limitMessage' => '',\n 'errorEmail' => FALSE,\n 'errorPassword' => FALSE,\n 'errorConfirmPass' => FALSE,\n 'errorLastName' => FALSE,\n 'errorFirstName' => FALSE,\n 'isPasswordNotMatching' => FALSE,\n );\n\n // Check user's lastname and firstname.\n model_user::validateUserName($form_errors, $user_data, $displayError);\n\n // Check user's email.\n model_user::validateUserEmail($form_errors, $user_data, $displayError);\n\n // Check user's password and user's confirm password.\n model_user::validatePassword($form_errors, $user_data, $displayError);\n\n // If there are no errors displayed, attempt to add the user.\n if (!$displayError) {\n try {\n $user = model_user::addUser(\n $user_data['lastname'],\n $user_data['firstname'],\n $user_data['email'],\n $user_data['password'],\n $user_data['job']\n );\n header('Location: /home/login');\n } catch (Exception $e) {\n header('Location: /500/index');\n }\n }\n }\n @include_once APP_PATH . 'view/user_register.tpl.php';\n }",
"public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}",
"public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\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}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}",
"private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }",
"function eve_api_user_register_form_submit(&$form, &$form_state) {\n $account = $form_state['user'];\n $uid = (int) $account->uid;\n $key_id = (int) $form_state['signup_object']['keyID'];\n $v_code = (string) $form_state['signup_object']['vCode'];\n\n $character = eve_api_create_key($account, $key_id, $v_code);\n\n if (isset($character['not_found']) || $character == FALSE) {\n db_update('users')->fields(array(\n 'characterID' => 0,\n 'name' => $account->name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n\n drupal_set_message(t('Registration partially failed, please verify API Key when activated.'), 'error');\n return;\n }\n\n $queue = DrupalQueue::get('eve_api_cron_api_user_sync');\n $queue->createItem(array(\n 'uid' => $uid,\n 'runs' => 1,\n ));\n\n $character_name = (string) $character['characterName'];\n $character_id = (int) $character['characterID'];\n $corporation_name = (string) $character['corporationName'];\n $character_is_blue = FALSE;\n\n if ($corporation_role = user_role_load_by_name($corporation_name)) {\n user_multiple_role_edit(array($uid), 'add_role', (int) $corporation_role->rid);\n\n $alliance_role = user_role_load(variable_get('eve_api_alliance_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $alliance_role->rid);\n }\n elseif (eve_api_verify_blue($character)) {\n $character_is_blue = TRUE;\n\n $blue_role = user_role_load(variable_get('eve_api_blue_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $blue_role->rid);\n }\n else {\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n }\n\n module_invoke_all('eve_api_user_update', array(\n 'account' => $account,\n 'character' => $character,\n 'character_is_blue' => $character_is_blue,\n ));\n\n db_update('users')->fields(array(\n 'characterID' => $character_id,\n 'name' => $character_name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n}",
"public function sendRegistrationEmail()\n {\n $loginToken=$this->extractTokenFromCache('login');\n\n $url = url('register/token',$loginToken);\n Mail::to($this)->queue(new RegistrationConfirmationEmail($url));\n }",
"function register_user() {\n\n\t\tif ( ! class_exists( 'QuadMenu' ) ) {\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'quadmenu', 'nonce', false ) ) {\n\t\t\tQuadMenu::send_json_error( esc_html__( 'Please reload page.', 'quadmenu' ) );\n\t\t}\n\n\t\t$mail = isset( $_POST['mail'] ) ? $_POST['mail'] : false;\n\t\t$pass = isset( $_POST['pass'] ) ? $_POST['pass'] : false;\n\n\t\tif ( empty( $mail ) || ! is_email( $mail ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a valid email address.', 'quadmenu' ) ) );\n\t\t}\n\n\t\tif ( empty( $pass ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a password.', 'quadmenu' ) ) );\n\t\t}\n\n\t\t$userdata = array(\n\t\t\t'user_login' => $mail,\n\t\t\t'user_email' => $mail,\n\t\t\t'user_pass' => $pass,\n\t\t);\n\n\t\t$user_id = wp_insert_user( apply_filter( 'ml_qmpext_register_user_userdata', $userdata ) );\n\n\t\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t\tif ( $user ) {\n\t\t\t\twp_set_current_user( $user_id, $user->user_login );\n\t\t\t\twp_set_auth_cookie( $user_id );\n\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\n\t\t\t}\n\n\t\t\tQuadMenu::send_json_success( sprintf( '<div class=\"quadmenu-alert alert-success\">%s</div>', esc_html__( 'Welcome! Your user have been created.', 'quadmenu' ) ) );\n\t\t} else {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', $user_id->get_error_message() ) );\n\t\t}\n\t\twp_die();\n\t}",
"public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }",
"public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }",
"function itstar_send_registration_admin_email($user_id){\n // add_user_meta( $user_id, 'hash', $hash );\n \n \n\n $message = '';\n $user_info = get_userdata($user_id);\n $to = get_option('admin_email'); \n $un = $user_info->display_name; \n $pw = $user_info->user_pass;\n $viraclub_id = get_user_meta( $user_id, 'viraclub', 1);\n\n $subject = __('New User Have Registered ','itstar').get_option('blogname'); \n \n $message .= __('Username: ','itstar').$un;\n $message .= \"\\n\";\n $message .= __('Password: ','itstar').$pw;\n $message .= \"\\n\\n\";\n $message .= __('ViraClub ID: ','itstar').'V'.$viraclub_id;\n\n \n //$message .= 'Please click this link to activate your account:';\n // $message .= home_url('/').'activate?id='.$un.'&key='.$hash;\n $headers = 'From: <[email protected]>' . \"\\r\\n\"; \n wp_mail($to, $subject, $message); \n}",
"public function registerAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERREGISTER);\n \t$form = new User_Form_Register();\n $data = $this->_request->getPost();\n if(!$data){\n // Display empty form\n $this->view->registerForm = $form;\n return;\n }\n\n if (!$form->isValid($data) || $this->_request->getParam('emailFailure')) {\n // Display form with errors\n $this->view->registerForm = $form;\n $this->view->emailFailure = $this->_request->getParam('emailFailure', null);\n return;\n }\n\n // Parameters for email and user creation\n $params = array(\n User::COLUMN_USERNAME => $form->getValue(User::INPUT_USERNAME),\n User::COLUMN_PASSWORD => $form->getValue(User::INPUT_PASSWORD),\n User::COLUMN_EMAIL => $form->getValue(User::INPUT_EMAIL),\n //User::COLUMN_OPENID_IDENTITY => $form->getValue(User::INPUT_OPENID_IDENTITY),\n User::INPUT_AUTH_METHOD => $form->getValue(User::INPUT_AUTH_METHOD),\n );\n\n try{\n // Create user in database\n $user = $this->_createNewUser($params);\n $userId = $user->{User::COLUMN_USERID};\n\n $params['activationKey'] = $user->activationKey;\n $params['link'] = APP_URL.Globals::getRouter()->assemble(array(),'userconfirmation');\n $params['link'] .= '?'.User::COLUMN_USERID.\"=$userId&\".self::ACTIVATION_KEY_PARAMNAME.\"={$user->activationKey}\";\n $params['site'] = APP_NAME;\n } catch (Exception $e){\n \t$msg = \"Error while creating user and/or blog. \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n \t$userId = null;\n }\n\n if($userId === null){\n // Redirect to error page in case of user creation failure\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::CREATION_FAILURE));\n }\n\n try{\n // Send Email\n $emailStatus = $this->_helper->emailer()->sendEmail($params[User::COLUMN_EMAIL], $params);\n } catch (Exception $e) {\n $emailStatus = false;\n $msg = \"Email error 2 \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n }\n\n if(!$emailStatus){\n // If there was en error sending the email, delete user row, and forward to current page\n $this->_cleanupUser($userId);\n $this->_forward('register', null, null, array('emailFailure'=>1));\n return;\n }\n\n // Success !\n $this->_savePendingUserIdentity($userId);\n $this->_helper->redirectToRoute('userpending');\n }",
"public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\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\n UserModel::register();\n }",
"public function storeRegistrationForm()\n { \n if(auth()->check())\n { \n auth()->destroy();\n return redirect()->to(url()->to('/'));\n }\n\n $inputs = request()->get();\n\n // this is if username is not allowed\n if(!$this->config->app->auth->usernames){\n $inputs['username'] = $inputs['email'];\n }\n\n $validator = new RegistrationValidator;\n $validation = $validator->validate($inputs);\n\n if (count($validation)) {\n session()->set('input', $inputs);\n\n return redirect()->to(url()->previous())\n ->withError(RegistrationValidator::toHtml($validation));\n }\n\n $token = bin2hex(random_bytes(100));\n\n // $connection = db()->connection();\n $connection = db();\n\n try {\n $connection->begin();\n\n $user = new Users;\n\n $success = $user->create([\n 'email' => $inputs['email'],\n 'username' => $inputs['username'],\n 'name' => $inputs['name'],\n 'password' => security()->hash($inputs['password']),\n 'token' => $token,\n ]);\n\n if ($success === false) {\n throw new Exception(\n 'It seems we can\\'t create an account, '.\n 'please check your access credentials!'\n );\n }\n\n queue(\n // 'Components\\Queue\\Email@registeredSender',\n \\Components\\Queue\\Email::class,\n [\n 'function' => 'registeredSender',\n 'template' => 'emails.registered-inlined',\n 'to' => $inputs['email'],\n 'url' => route('activateUser', ['token' => $token]),\n 'subject' => 'You are now registered, activation is required.',\n ]\n );\n\n $connection->commit();\n\n } catch (TransactionFailed $e) {\n $connection->rollback();\n throw $e;\n } catch (Exception $e) {\n $connection->rollback();\n throw $e;\n }\n\n return redirect()->to(route('showLoginForm'))\n ->withSuccess(lang()->get('responses/register.creation_success'));\n }",
"public function register()\n {\n $this->order->update(['status' => OrderStatus::REGISTER]);\n\n // Send notification to the customer\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order has been marked as register and notification has been sent to the customer by email.'),\n ]);\n }",
"public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \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 }",
"public function handleRegistration()\n {\n $user = $this->repository->signup(\\Input::all());\n\n if ($user->id) {\n if (\\Config::get('confide::signup_email')) {\n \\Mail::queueOn(\n \\Config::get('confide::email_queue'),\n \\Config::get('confide::email_account_confirmation'),\n compact('user'),\n function ($message) use ($user) {\n $message\n ->to($user->email, $user->username)\n ->subject(\\Lang::get('confide::confide.email.account_confirmation.subject'));\n }\n );\n }\n \\Notification::success(\n \\Notification::message(\\Lang::get('users::app.user.registered'))->flash()\n );\n\n return \\Redirect::route('app.session.login');\n\n } else {\n $errors = $user->errors()->all(':message');\n\n if (is_array($errors) && $errors) {\n foreach ($errors as $error) {\n \\Notification::error(\n \\Notification::message(\\Lang::get($error))->flash()\n );\n }\n } else {\n \\Notification::error(\n \\Notification::message(\\Lang::get('users::app.registration.failed'))->flash()\n );\n }\n\n\n return \\Redirect::route('app.session.register');\n }\n }",
"public function createTask()\n\t{\n\t\tif (!User::isGuest() && !User::get('tmp_user'))\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&task=myaccount'),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_NONGUEST_SESSION_CREATION'),\n\t\t\t\t'warning'\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($this->_taskMap[$this->_task]))\n\t\t{\n\t\t\t$this->_task = 'create';\n\t\t\tRequest::setVar('task', 'create');\n\t\t}\n\n\t\t// If user registration is not allowed, show 403 not authorized.\n\t\t$usersConfig = Component::params('com_members');\n\t\tif ($usersConfig->get('allowUserRegistration') == '0')\n\t\t{\n\t\t\treturn App::abort(404, Lang::txt('JGLOBAL_RESOURCE_NOT_FOUND'));\n\t\t}\n\n\t\t$hzal = null;\n\t\tif (User::get('auth_link_id'))\n\t\t{\n\t\t\t$hzal = \\Hubzero\\Auth\\Link::find_by_id(User::get('auth_link_id'));\n\t\t}\n\n\t\t// Instantiate a new registration object\n\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\n\t\tif (Request::getMethod() == 'POST')\n\t\t{\n\t\t\t// Check for request forgeries\n\t\t\tRequest::checkToken();\n\n\t\t\t// Load POSTed data\n\t\t\t$xregistration->loadPost();\n\n\t\t\t// Perform field validation\n\t\t\t$result = $xregistration->check('create');\n\n\t\t\t// Incoming profile edits\n\t\t\t$profile = Request::getArray('profile', array(), 'post');\n\n\t\t\t// Compile profile data\n\t\t\tforeach ($profile as $key => $data)\n\t\t\t{\n\t\t\t\tif (isset($profile[$key]) && is_array($profile[$key]))\n\t\t\t\t{\n\t\t\t\t\t$profile[$key] = array_filter($profile[$key]);\n\t\t\t\t}\n\t\t\t\tif (isset($profile[$key . '_other']) && trim($profile[$key . '_other']))\n\t\t\t\t{\n\t\t\t\t\tif (is_array($profile[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile[$key][] = $profile[$key . '_other'];\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$profile[$key] = $profile[$key . '_other'];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($profile[$key . '_other']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate profile data\n\t\t\t$fields = \\Components\\Members\\Models\\Profile\\Field::all()\n\t\t\t\t->including(['options', function ($option){\n\t\t\t\t\t$option\n\t\t\t\t\t\t->select('*');\n\t\t\t\t}])\n\t\t\t\t->where('action_create', '!=', \\Components\\Members\\Models\\Profile\\Field::STATE_HIDDEN)\n\t\t\t\t->ordered()\n\t\t\t\t->rows();\n\n\t\t\t// Validate profile fields\n\t\t\tif ($fields->count())\n\t\t\t{\n\t\t\t\t$form = new \\Hubzero\\Form\\Form('profile', array('control' => 'profile'));\n\t\t\t\t$form->load(\\Components\\Members\\Models\\Profile\\Field::toXml($fields, 'create', $profile));\n\t\t\t\t$form->bind(new \\Hubzero\\Config\\Registry($profile));\n\n\t\t\t\tif (!$form->validate($profile))\n\t\t\t\t{\n\t\t\t\t\t$result = false;\n\n\t\t\t\t\tforeach ($form->getErrors() as $key => $error)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($error instanceof \\Hubzero\\Form\\Exception\\MissingData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$xregistration->_missing[$key] = $error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$xregistration->_invalid[$key] = $error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Passed validation?\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\t// Get required system objects\n\t\t\t\t$user = clone(User::getInstance());\n\n\t\t\t\t// Initialize new usertype setting\n\t\t\t\t$newUsertype = $usersConfig->get('new_usertype');\n\t\t\t\tif (!$newUsertype)\n\t\t\t\t{\n\t\t\t\t\t$db = App::get('db');\n\t\t\t\t\t$query = $db->getQuery()\n\t\t\t\t\t\t->select('id')\n\t\t\t\t\t\t->from('#__usergroups')\n\t\t\t\t\t\t->whereEquals('title', 'Registered');\n\t\t\t\t\t$db->setQuery($query->toString());\n\t\t\t\t\t$newUsertype = $db->loadResult();\n\t\t\t\t}\n\n\t\t\t\t$user->set('username', $xregistration->get('login', ''));\n\t\t\t\t$user->set('name', $xregistration->get('name', ''));\n\t\t\t\t$user->set('givenName', $xregistration->get('givenName', ''));\n\t\t\t\t$user->set('middleName', $xregistration->get('middleName', ''));\n\t\t\t\t$user->set('surname', $xregistration->get('surname', ''));\n\t\t\t\t$user->set('email', $xregistration->get('email', ''));\n\t\t\t\t$user->set('usageAgreement', (int)$xregistration->get('usageAgreement', 0));\n\t\t\t\t$user->set('sendEmail', -1);\n\t\t\t\tif ($xregistration->get('sendEmail') >= 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('sendEmail', (int)$xregistration->get('sendEmail'));\n\t\t\t\t}\n\n\t\t\t\t// Set home directory\n\t\t\t\t$hubHomeDir = rtrim($this->config->get('homedir'), '/');\n\t\t\t\tif (!$hubHomeDir)\n\t\t\t\t{\n\t\t\t\t\t// try to deduce a viable home directory based on sitename or live_site\n\t\t\t\t\t$sitename = strtolower(Config::get('sitename'));\n\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t}\n\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = strtolower(Request::base());\n\t\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$hubHomeDir = DS . 'home';\n\n\t\t\t\t\tif (!empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hubHomeDir .= DS . $sitename;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$user->set('homeDirectory', $hubHomeDir . DS . $user->get('username'));\n\t\t\t\t$user->set('loginShell', '/bin/bash');\n\t\t\t\t$user->set('ftpShell', '/usr/lib/sftp-server');\n\n\t\t\t\t// Set some initial user values\n\t\t\t\t$user->set('id', 0);\n\t\t\t\t$user->set('accessgroups', array($newUsertype));\n\t\t\t\t$user->set('registerDate', Date::toSql());\n\n\t\t\t\t// Check user activation setting\n\t\t\t\t// 0 = automatically confirmed\n\t\t\t\t// 1 = require email confirmation (the norm)\n\t\t\t\t// 2 = require admin confirmation\n\t\t\t\t$useractivation = $usersConfig->get('useractivation', 1);\n\n\t\t\t\t// If requiring admin approval, set user to block\n\t\t\t\tif ($useractivation == 2)\n\t\t\t\t{\n\t\t\t\t\t$user->set('approved', 0);\n\t\t\t\t}\n\n\t\t\t\t$user->set('access', 5);\n\t\t\t\t$user->set('activation', -rand(1, pow(2, 31)-1));\n\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\tif ($user->get('email') == $hzal->email)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->set('activation', 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($useractivation == 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('activation', 1);\n\t\t\t\t\t$user->set('access', (int)$this->config->get('privacy', 1));\n\t\t\t\t}\n\n\t\t\t\t$user->set('password', \\Hubzero\\User\\Password::getPasshash($xregistration->get('password')));\n\n\t\t\t\t// Do we have a return URL?\n\t\t\t\t$regReturn = Request::getString('return', '');\n\n\t\t\t\tif ($regReturn)\n\t\t\t\t{\n\t\t\t\t\t$user->setParam('return', $regReturn);\n\t\t\t\t}\n\n\t\t\t\t// If we managed to create a user\n\t\t\t\tif ($user->save())\n\t\t\t\t{\n\t\t\t\t\t$access = array();\n\t\t\t\t\tforeach ($fields as $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t$access[$field->get('name')] = $field->get('access');\n\t\t\t\t\t}\n\n\t\t\t\t\t$profile = $xregistration->_registration['_profile'];\n\n\t\t\t\t\t// Save profile data\n\t\t\t\t\t$member = Member::oneOrNew($user->get('id'));\n\t\t\t\t\t$orcidID = Session::get('orcid');\n\t\t\t\t\tif ($orcidID != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile['orcid'] = $orcidID;\n\t\t\t\t\t}\n\t\t\t\t\tif (!$member->saveProfile($profile, $access))\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Notify::error($member->getError());\n\t\t\t\t\t\t// Don't stop the registration process!\n\t\t\t\t\t\t// At this point, the account was successfully created.\n\t\t\t\t\t\t// The profile info, however, may have issues. But, it's not crucial.\n\t\t\t\t\t\t//$result = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\\Notify::error($user->getError());\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\t// If everything is OK so far...\n\t\t\t\tif ($result)\n\t\t\t\t{\n\t\t\t\t\t$result = \\Hubzero\\User\\Password::changePassword($user->get('id'), $xregistration->get('password'));\n\n\t\t\t\t\t// Set password back here in case anything else down the line is looking for it\n\t\t\t\t\t$user->set('password', $xregistration->get('password'));\n\n\t\t\t\t\t// Did we successfully create/update an account?\n\t\t\t\t\tif (!$result)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn App::abort(500, Lang::txt('COM_MEMBERS_REGISTER_ERROR_CREATING_ACCOUNT'));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Send confirmation email\n\t\t\t\t\tif ($user->get('activation') < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Components\\Members\\Helpers\\Utility::sendConfirmEmail($user, $xregistration);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a new view\n\t\t\t\t\t$this->view\n\t\t\t\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_CREATE_ACCOUNT'))\n\t\t\t\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t\t\t\t->set('xprofile', $user)\n\t\t\t\t\t\t->setErrors($this->getErrors())\n\t\t\t\t\t\t->setLayout('create')\n\t\t\t\t\t\t->display();\n\n\t\t\t\t\tif (is_object($hzal))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hzal->set('user_id', $user->get('id'));\n\n\t\t\t\t\t\tif ($hzal->user_id > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hzal->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tUser::set('auth_link_id', null);\n\t\t\t\t\tUser::set('tmp_user', null);\n\t\t\t\t\tUser::set('username', $xregistration->get('login'));\n\t\t\t\t\tUser::set('email', $xregistration->get('email'));\n\t\t\t\t\tUser::set('id', $user->get('id'));\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (Request::method() == 'GET')\n\t\t{\n\t\t\tif (User::get('tmp_user'))\n\t\t\t{\n\t\t\t\t$xregistration->loadAccount(User::getInstance());\n\n\t\t\t\t$username = $xregistration->get('login');\n\t\t\t\t$email = $xregistration->get('email');\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\t$xregistration->set('login', $hzal->username);\n\t\t\t\t\t$xregistration->set('email', $hzal->email);\n\t\t\t\t\t$xregistration->set('confirmEmail', $hzal->email);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\treturn $this->_show_registration_form($xregistration, 'create');\n\t}",
"public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }",
"public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}",
"private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}",
"public function onSubmitRegistration(EventInterface $event)\n {\n $log = $this->getLogger();\n $user = $event->getParam('user');\n $person = $user->getPerson();\n $log->info(\n sprintf(\n \"new user registration submitted by %s %s, %s\",\n $person->getFirstname(),\n $person->getLastname(),\n $person->getEmail()\n ),\n ['channel' => 'security',\n 'entity_class' => User::class,\n 'entity_id' => $user->getId(),]\n );\n }",
"public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}",
"private function _registerStart()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->_POST[ 'username' ] \t= \ttrim( $MySmartBB->_POST[ 'username' ] );\n\t\t$MySmartBB->_POST[ 'email' ] \t\t= \ttrim( $MySmartBB->_POST[ 'email' ] );\n\t\t\n\t\t// ... //\n\t\t\n\t\t// A long list of checks before registeration\n\t\t$this->__checkFieldsValidity();\n\t\t$this->__checkAlreadyUsed();\n\t\t$this->__checkBanned();\n\t\t$this->__checkConstraints();\n\t\t$this->__checkLength();\n \t\t\n \t$MySmartBB->_POST[ 'password' ] = md5( $MySmartBB->_POST[ 'password' ] );\n \t\n \t// ... //\n \t\n \t$MySmartBB->plugin->runHooks( 'register_start' );\n \t\n \t// ... //\n \t\n \t// Get the information of default group to set username style cache\n \t$MySmartBB->rec->table = $MySmartBB->table[ 'group' ];\n\t\t$MySmartBB->rec->filter = \"id='\" . $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] . \"'\";\n\t\t\n\t\t$GroupInfo = $MySmartBB->rec->getInfo();\n\t\t\n\t\t// ... //\n\t\t\n\t\t// Get the stylish username\n\t\t$style = $GroupInfo[ 'username_style' ];\n\t\t$username_style_cache = str_replace( '[username]', $MySmartBB->_POST['username'], $style );\n\t\t\n\t\t// ... //\n\t\t\n\t\t$MySmartBB->rec->table = $MySmartBB->table[ 'member' ];\n\t\t$MySmartBB->rec->fields = array(\t'username'\t\t=>\t$MySmartBB->_POST[ 'username' ],\n \t\t\t\t\t\t\t\t\t\t'password'\t\t=>\t$MySmartBB->_POST[ 'password' ],\n \t\t\t\t\t\t\t\t\t\t'email'\t\t\t=>\t$MySmartBB->_POST[ 'email' ],\n \t\t\t\t\t\t\t\t\t\t'usergroup'\t\t=>\t$MySmartBB->_CONF[ 'info_row']['def_group' ],\n \t\t\t\t\t\t\t\t\t\t'user_gender'\t=>\t$MySmartBB->_POST[ 'gender' ],\n \t\t\t\t\t\t\t\t\t\t'register_date'\t=>\t$MySmartBB->_CONF[ 'now' ],\n \t\t\t\t\t\t\t\t\t\t'user_title'\t=>\t$GroupInfo[ 'user_title' ],\n \t\t\t\t\t\t\t\t\t\t'style'\t\t\t=>\t$MySmartBB->_CONF[ 'info_row' ][ 'def_style' ],\n \t\t\t\t\t\t\t\t\t\t'username_style_cache'\t=>\t$username_style_cache);\n \t\n \t$MySmartBB->rec->get_id = true;\n \t\n \t$insert = $MySmartBB->rec->insert();\n \t\n \tif ( $insert )\n \t{\n \t\t// ... //\n \t\t\n \t\t// Update statistics\n \t\t$MySmartBB->cache->updateLastMember( $MySmartBB->_POST[ 'username' ], $MySmartBB->rec->id );\n \t\t\n \t\t// ... //\n \t\t\n \t\t$MySmartBB->plugin->runHooks( 'register_success' );\n \t\t\n \t\t// ... //\n \t\t\n \t\t// The default group requires an email activation from its members.\n \t\t// Therefore, We register a request and send the activation message to the member's email.\n \t\tif ( $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] == 5 )\n \t\t{\n \t\t\t$this->__sendActivationCode(); \t\t\t\n\t\t\t}\n\t\t\telse\n \t\t{\n \t\t\t$MySmartBB->func->msg( $MySmartBB->lang[ 'register_succeed' ] );\n \t\t\t$MySmartBB->func->move( 'index.php?page=login&register_login=1&username=' . $MySmartBB->_POST[ 'username' ] . '&password=' . $MySmartBB->_POST[ 'password' ] );\n \t\t}\n \t}\n\t}",
"public function register() {\n\t\t$user_email = $this->input->post(\"email\");\n\t\t$user_password = md5($this->input->post('password'));\n\t\t$user_reg_ip = ip2long($this->input->ip_address());\n\t\t\n\t\t$re = $this->user_lib->save_reg_userInfo($user_email,$user_password,$user_reg_ip);\n\t\t\n\t\tif($re===false){\n\t\t\t//set mc error\n\t\t}\n\t\t/*if(!$this->email_lib->send_active_email($user_email)){\n\t\t\t//send mail error\n\t\t}*/\n\t\t$uid = $this->user_lib->active_process($user_email);\n\t\tif($uid===false){\n\t\t\treturn false;\t\t//for active error\n\t\t}\n\t//\t$this->_set_login_cookie($uid);\n\t\tredirect('/regsuccess'); \n\t}",
"public function register()\n {\n $this->registration->execute([],$this);\n }"
]
| [
"0.6461892",
"0.6447725",
"0.6432018",
"0.6236625",
"0.621647",
"0.62162614",
"0.6139312",
"0.61271554",
"0.6094394",
"0.6086734",
"0.60746413",
"0.6032227",
"0.6015256",
"0.5999497",
"0.599198",
"0.59887904",
"0.5987547",
"0.5941305",
"0.589972",
"0.58909076",
"0.5877328",
"0.5877199",
"0.58737487",
"0.5870788",
"0.58645284",
"0.5862803",
"0.5853186",
"0.5851799",
"0.58491147",
"0.5843217"
]
| 0.67553866 | 0 |
Queues the user's submitted registration info for later admin approval. | abstract protected function _queueSignup($signup); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function queueSignup(&$info)\n {\n global $conf;\n\n // Perform any preprocessing if requested.\n $this->_preSignup($info);\n\n // If it's a unique username, go ahead and queue the request.\n $signup = $this->newSignup($info['user_name']);\n if (!empty($info['extra'])) {\n $signup->setData($info['extra']);\n }\n $signup->setData(array_merge($signup->getData(), array(\n 'dateReceived' => time(),\n 'password' => $info['password'],\n )));\n\n $this->_queueSignup($signup);\n\n try {\n Horde::callHook('signup_queued', array($info['user_name'], $info));\n } catch (Horde_Exception_HookNotSet $e) {\n }\n\n if (!empty($conf['signup']['email'])) {\n $link = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/admin/signup_confirm.php', true, -1)->setRaw(true)->add(array(\n 'u' => $signup->getName(),\n 'h' => hash_hmac('sha1', $signup->getName(), $conf['secret_key'])\n ));\n $message = sprintf(Horde_Core_Translation::t(\"A new account for the user \\\"%s\\\" has been requested through the signup form.\"), $signup->getName())\n . \"\\n\\n\"\n . Horde_Core_Translation::t(\"Approve the account:\")\n . \"\\n\" . $link->copy()->add('a', 'approve') . \"\\n\"\n . Horde_Core_Translation::t(\"Deny the account:\")\n . \"\\n\" . $link->copy()->add('a', 'deny');\n $mail = new Horde_Mime_Mail(array(\n 'body' => $message,\n 'Subject' => sprintf(Horde_Core_Translation::t(\"Account signup request for \\\"%s\\\"\"), $signup->getName()),\n 'To' => $conf['signup']['email'],\n 'From' => $conf['signup']['email']));\n $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));\n }\n }",
"function RegisterUser(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateRegistrationSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadUserPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Upic'] = $this->upLoadUserPic();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectRegistrationSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->comparePswd($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!$this->SaveToEventAdvDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/*if(!$this->sendConfimMail($formvars)){\r\n\t\t\treturn false;\r\n\t\t}*/\r\n\r\n\t\t//$this->SendAdminIntimationEmail($formvars);\r\n\r\n\t\treturn true;\r\n\t}",
"public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }",
"function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }",
"public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}",
"function action_register() {\n if(model_user::userLoggedIn()) {\n header('Location: /home/track');\n }\n $jobs = model_job::getAllJobs();\n $displayError = FALSE;\n\n if (isset($_POST['btn-register'])) {\n $user_data = array(\n 'lastname' => model_user::sanitizeInput($_POST['form']['lastname']),\n 'firstname' => model_user::sanitizeInput($_POST['form']['firstname']),\n 'email' => $_POST['form']['email'],\n 'password' => $_POST['form']['password'],\n 'confirmPassword' => $_POST['form']['confirmPass'],\n 'job' => $_POST['form']['job'],\n );\n\n $form_errors = array(\n 'emailMessage' => '',\n 'limitMessage' => '',\n 'errorEmail' => FALSE,\n 'errorPassword' => FALSE,\n 'errorConfirmPass' => FALSE,\n 'errorLastName' => FALSE,\n 'errorFirstName' => FALSE,\n 'isPasswordNotMatching' => FALSE,\n );\n\n // Check user's lastname and firstname.\n model_user::validateUserName($form_errors, $user_data, $displayError);\n\n // Check user's email.\n model_user::validateUserEmail($form_errors, $user_data, $displayError);\n\n // Check user's password and user's confirm password.\n model_user::validatePassword($form_errors, $user_data, $displayError);\n\n // If there are no errors displayed, attempt to add the user.\n if (!$displayError) {\n try {\n $user = model_user::addUser(\n $user_data['lastname'],\n $user_data['firstname'],\n $user_data['email'],\n $user_data['password'],\n $user_data['job']\n );\n header('Location: /home/login');\n } catch (Exception $e) {\n header('Location: /500/index');\n }\n }\n }\n @include_once APP_PATH . 'view/user_register.tpl.php';\n }",
"public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\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}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}",
"private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }",
"function eve_api_user_register_form_submit(&$form, &$form_state) {\n $account = $form_state['user'];\n $uid = (int) $account->uid;\n $key_id = (int) $form_state['signup_object']['keyID'];\n $v_code = (string) $form_state['signup_object']['vCode'];\n\n $character = eve_api_create_key($account, $key_id, $v_code);\n\n if (isset($character['not_found']) || $character == FALSE) {\n db_update('users')->fields(array(\n 'characterID' => 0,\n 'name' => $account->name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n\n drupal_set_message(t('Registration partially failed, please verify API Key when activated.'), 'error');\n return;\n }\n\n $queue = DrupalQueue::get('eve_api_cron_api_user_sync');\n $queue->createItem(array(\n 'uid' => $uid,\n 'runs' => 1,\n ));\n\n $character_name = (string) $character['characterName'];\n $character_id = (int) $character['characterID'];\n $corporation_name = (string) $character['corporationName'];\n $character_is_blue = FALSE;\n\n if ($corporation_role = user_role_load_by_name($corporation_name)) {\n user_multiple_role_edit(array($uid), 'add_role', (int) $corporation_role->rid);\n\n $alliance_role = user_role_load(variable_get('eve_api_alliance_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $alliance_role->rid);\n }\n elseif (eve_api_verify_blue($character)) {\n $character_is_blue = TRUE;\n\n $blue_role = user_role_load(variable_get('eve_api_blue_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $blue_role->rid);\n }\n else {\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n }\n\n module_invoke_all('eve_api_user_update', array(\n 'account' => $account,\n 'character' => $character,\n 'character_is_blue' => $character_is_blue,\n ));\n\n db_update('users')->fields(array(\n 'characterID' => $character_id,\n 'name' => $character_name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n}",
"public function sendRegistrationEmail()\n {\n $loginToken=$this->extractTokenFromCache('login');\n\n $url = url('register/token',$loginToken);\n Mail::to($this)->queue(new RegistrationConfirmationEmail($url));\n }",
"function register_user() {\n\n\t\tif ( ! class_exists( 'QuadMenu' ) ) {\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'quadmenu', 'nonce', false ) ) {\n\t\t\tQuadMenu::send_json_error( esc_html__( 'Please reload page.', 'quadmenu' ) );\n\t\t}\n\n\t\t$mail = isset( $_POST['mail'] ) ? $_POST['mail'] : false;\n\t\t$pass = isset( $_POST['pass'] ) ? $_POST['pass'] : false;\n\n\t\tif ( empty( $mail ) || ! is_email( $mail ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a valid email address.', 'quadmenu' ) ) );\n\t\t}\n\n\t\tif ( empty( $pass ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a password.', 'quadmenu' ) ) );\n\t\t}\n\n\t\t$userdata = array(\n\t\t\t'user_login' => $mail,\n\t\t\t'user_email' => $mail,\n\t\t\t'user_pass' => $pass,\n\t\t);\n\n\t\t$user_id = wp_insert_user( apply_filter( 'ml_qmpext_register_user_userdata', $userdata ) );\n\n\t\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t\tif ( $user ) {\n\t\t\t\twp_set_current_user( $user_id, $user->user_login );\n\t\t\t\twp_set_auth_cookie( $user_id );\n\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\n\t\t\t}\n\n\t\t\tQuadMenu::send_json_success( sprintf( '<div class=\"quadmenu-alert alert-success\">%s</div>', esc_html__( 'Welcome! Your user have been created.', 'quadmenu' ) ) );\n\t\t} else {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', $user_id->get_error_message() ) );\n\t\t}\n\t\twp_die();\n\t}",
"public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }",
"public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }",
"function itstar_send_registration_admin_email($user_id){\n // add_user_meta( $user_id, 'hash', $hash );\n \n \n\n $message = '';\n $user_info = get_userdata($user_id);\n $to = get_option('admin_email'); \n $un = $user_info->display_name; \n $pw = $user_info->user_pass;\n $viraclub_id = get_user_meta( $user_id, 'viraclub', 1);\n\n $subject = __('New User Have Registered ','itstar').get_option('blogname'); \n \n $message .= __('Username: ','itstar').$un;\n $message .= \"\\n\";\n $message .= __('Password: ','itstar').$pw;\n $message .= \"\\n\\n\";\n $message .= __('ViraClub ID: ','itstar').'V'.$viraclub_id;\n\n \n //$message .= 'Please click this link to activate your account:';\n // $message .= home_url('/').'activate?id='.$un.'&key='.$hash;\n $headers = 'From: <[email protected]>' . \"\\r\\n\"; \n wp_mail($to, $subject, $message); \n}",
"public function registerAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERREGISTER);\n \t$form = new User_Form_Register();\n $data = $this->_request->getPost();\n if(!$data){\n // Display empty form\n $this->view->registerForm = $form;\n return;\n }\n\n if (!$form->isValid($data) || $this->_request->getParam('emailFailure')) {\n // Display form with errors\n $this->view->registerForm = $form;\n $this->view->emailFailure = $this->_request->getParam('emailFailure', null);\n return;\n }\n\n // Parameters for email and user creation\n $params = array(\n User::COLUMN_USERNAME => $form->getValue(User::INPUT_USERNAME),\n User::COLUMN_PASSWORD => $form->getValue(User::INPUT_PASSWORD),\n User::COLUMN_EMAIL => $form->getValue(User::INPUT_EMAIL),\n //User::COLUMN_OPENID_IDENTITY => $form->getValue(User::INPUT_OPENID_IDENTITY),\n User::INPUT_AUTH_METHOD => $form->getValue(User::INPUT_AUTH_METHOD),\n );\n\n try{\n // Create user in database\n $user = $this->_createNewUser($params);\n $userId = $user->{User::COLUMN_USERID};\n\n $params['activationKey'] = $user->activationKey;\n $params['link'] = APP_URL.Globals::getRouter()->assemble(array(),'userconfirmation');\n $params['link'] .= '?'.User::COLUMN_USERID.\"=$userId&\".self::ACTIVATION_KEY_PARAMNAME.\"={$user->activationKey}\";\n $params['site'] = APP_NAME;\n } catch (Exception $e){\n \t$msg = \"Error while creating user and/or blog. \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n \t$userId = null;\n }\n\n if($userId === null){\n // Redirect to error page in case of user creation failure\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::CREATION_FAILURE));\n }\n\n try{\n // Send Email\n $emailStatus = $this->_helper->emailer()->sendEmail($params[User::COLUMN_EMAIL], $params);\n } catch (Exception $e) {\n $emailStatus = false;\n $msg = \"Email error 2 \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n }\n\n if(!$emailStatus){\n // If there was en error sending the email, delete user row, and forward to current page\n $this->_cleanupUser($userId);\n $this->_forward('register', null, null, array('emailFailure'=>1));\n return;\n }\n\n // Success !\n $this->_savePendingUserIdentity($userId);\n $this->_helper->redirectToRoute('userpending');\n }",
"public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\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\n UserModel::register();\n }",
"public function storeRegistrationForm()\n { \n if(auth()->check())\n { \n auth()->destroy();\n return redirect()->to(url()->to('/'));\n }\n\n $inputs = request()->get();\n\n // this is if username is not allowed\n if(!$this->config->app->auth->usernames){\n $inputs['username'] = $inputs['email'];\n }\n\n $validator = new RegistrationValidator;\n $validation = $validator->validate($inputs);\n\n if (count($validation)) {\n session()->set('input', $inputs);\n\n return redirect()->to(url()->previous())\n ->withError(RegistrationValidator::toHtml($validation));\n }\n\n $token = bin2hex(random_bytes(100));\n\n // $connection = db()->connection();\n $connection = db();\n\n try {\n $connection->begin();\n\n $user = new Users;\n\n $success = $user->create([\n 'email' => $inputs['email'],\n 'username' => $inputs['username'],\n 'name' => $inputs['name'],\n 'password' => security()->hash($inputs['password']),\n 'token' => $token,\n ]);\n\n if ($success === false) {\n throw new Exception(\n 'It seems we can\\'t create an account, '.\n 'please check your access credentials!'\n );\n }\n\n queue(\n // 'Components\\Queue\\Email@registeredSender',\n \\Components\\Queue\\Email::class,\n [\n 'function' => 'registeredSender',\n 'template' => 'emails.registered-inlined',\n 'to' => $inputs['email'],\n 'url' => route('activateUser', ['token' => $token]),\n 'subject' => 'You are now registered, activation is required.',\n ]\n );\n\n $connection->commit();\n\n } catch (TransactionFailed $e) {\n $connection->rollback();\n throw $e;\n } catch (Exception $e) {\n $connection->rollback();\n throw $e;\n }\n\n return redirect()->to(route('showLoginForm'))\n ->withSuccess(lang()->get('responses/register.creation_success'));\n }",
"public function register()\n {\n $this->order->update(['status' => OrderStatus::REGISTER]);\n\n // Send notification to the customer\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order has been marked as register and notification has been sent to the customer by email.'),\n ]);\n }",
"public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \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 }",
"public function handleRegistration()\n {\n $user = $this->repository->signup(\\Input::all());\n\n if ($user->id) {\n if (\\Config::get('confide::signup_email')) {\n \\Mail::queueOn(\n \\Config::get('confide::email_queue'),\n \\Config::get('confide::email_account_confirmation'),\n compact('user'),\n function ($message) use ($user) {\n $message\n ->to($user->email, $user->username)\n ->subject(\\Lang::get('confide::confide.email.account_confirmation.subject'));\n }\n );\n }\n \\Notification::success(\n \\Notification::message(\\Lang::get('users::app.user.registered'))->flash()\n );\n\n return \\Redirect::route('app.session.login');\n\n } else {\n $errors = $user->errors()->all(':message');\n\n if (is_array($errors) && $errors) {\n foreach ($errors as $error) {\n \\Notification::error(\n \\Notification::message(\\Lang::get($error))->flash()\n );\n }\n } else {\n \\Notification::error(\n \\Notification::message(\\Lang::get('users::app.registration.failed'))->flash()\n );\n }\n\n\n return \\Redirect::route('app.session.register');\n }\n }",
"public function createTask()\n\t{\n\t\tif (!User::isGuest() && !User::get('tmp_user'))\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&task=myaccount'),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_NONGUEST_SESSION_CREATION'),\n\t\t\t\t'warning'\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($this->_taskMap[$this->_task]))\n\t\t{\n\t\t\t$this->_task = 'create';\n\t\t\tRequest::setVar('task', 'create');\n\t\t}\n\n\t\t// If user registration is not allowed, show 403 not authorized.\n\t\t$usersConfig = Component::params('com_members');\n\t\tif ($usersConfig->get('allowUserRegistration') == '0')\n\t\t{\n\t\t\treturn App::abort(404, Lang::txt('JGLOBAL_RESOURCE_NOT_FOUND'));\n\t\t}\n\n\t\t$hzal = null;\n\t\tif (User::get('auth_link_id'))\n\t\t{\n\t\t\t$hzal = \\Hubzero\\Auth\\Link::find_by_id(User::get('auth_link_id'));\n\t\t}\n\n\t\t// Instantiate a new registration object\n\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\n\t\tif (Request::getMethod() == 'POST')\n\t\t{\n\t\t\t// Check for request forgeries\n\t\t\tRequest::checkToken();\n\n\t\t\t// Load POSTed data\n\t\t\t$xregistration->loadPost();\n\n\t\t\t// Perform field validation\n\t\t\t$result = $xregistration->check('create');\n\n\t\t\t// Incoming profile edits\n\t\t\t$profile = Request::getArray('profile', array(), 'post');\n\n\t\t\t// Compile profile data\n\t\t\tforeach ($profile as $key => $data)\n\t\t\t{\n\t\t\t\tif (isset($profile[$key]) && is_array($profile[$key]))\n\t\t\t\t{\n\t\t\t\t\t$profile[$key] = array_filter($profile[$key]);\n\t\t\t\t}\n\t\t\t\tif (isset($profile[$key . '_other']) && trim($profile[$key . '_other']))\n\t\t\t\t{\n\t\t\t\t\tif (is_array($profile[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile[$key][] = $profile[$key . '_other'];\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$profile[$key] = $profile[$key . '_other'];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($profile[$key . '_other']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate profile data\n\t\t\t$fields = \\Components\\Members\\Models\\Profile\\Field::all()\n\t\t\t\t->including(['options', function ($option){\n\t\t\t\t\t$option\n\t\t\t\t\t\t->select('*');\n\t\t\t\t}])\n\t\t\t\t->where('action_create', '!=', \\Components\\Members\\Models\\Profile\\Field::STATE_HIDDEN)\n\t\t\t\t->ordered()\n\t\t\t\t->rows();\n\n\t\t\t// Validate profile fields\n\t\t\tif ($fields->count())\n\t\t\t{\n\t\t\t\t$form = new \\Hubzero\\Form\\Form('profile', array('control' => 'profile'));\n\t\t\t\t$form->load(\\Components\\Members\\Models\\Profile\\Field::toXml($fields, 'create', $profile));\n\t\t\t\t$form->bind(new \\Hubzero\\Config\\Registry($profile));\n\n\t\t\t\tif (!$form->validate($profile))\n\t\t\t\t{\n\t\t\t\t\t$result = false;\n\n\t\t\t\t\tforeach ($form->getErrors() as $key => $error)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($error instanceof \\Hubzero\\Form\\Exception\\MissingData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$xregistration->_missing[$key] = $error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$xregistration->_invalid[$key] = $error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Passed validation?\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\t// Get required system objects\n\t\t\t\t$user = clone(User::getInstance());\n\n\t\t\t\t// Initialize new usertype setting\n\t\t\t\t$newUsertype = $usersConfig->get('new_usertype');\n\t\t\t\tif (!$newUsertype)\n\t\t\t\t{\n\t\t\t\t\t$db = App::get('db');\n\t\t\t\t\t$query = $db->getQuery()\n\t\t\t\t\t\t->select('id')\n\t\t\t\t\t\t->from('#__usergroups')\n\t\t\t\t\t\t->whereEquals('title', 'Registered');\n\t\t\t\t\t$db->setQuery($query->toString());\n\t\t\t\t\t$newUsertype = $db->loadResult();\n\t\t\t\t}\n\n\t\t\t\t$user->set('username', $xregistration->get('login', ''));\n\t\t\t\t$user->set('name', $xregistration->get('name', ''));\n\t\t\t\t$user->set('givenName', $xregistration->get('givenName', ''));\n\t\t\t\t$user->set('middleName', $xregistration->get('middleName', ''));\n\t\t\t\t$user->set('surname', $xregistration->get('surname', ''));\n\t\t\t\t$user->set('email', $xregistration->get('email', ''));\n\t\t\t\t$user->set('usageAgreement', (int)$xregistration->get('usageAgreement', 0));\n\t\t\t\t$user->set('sendEmail', -1);\n\t\t\t\tif ($xregistration->get('sendEmail') >= 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('sendEmail', (int)$xregistration->get('sendEmail'));\n\t\t\t\t}\n\n\t\t\t\t// Set home directory\n\t\t\t\t$hubHomeDir = rtrim($this->config->get('homedir'), '/');\n\t\t\t\tif (!$hubHomeDir)\n\t\t\t\t{\n\t\t\t\t\t// try to deduce a viable home directory based on sitename or live_site\n\t\t\t\t\t$sitename = strtolower(Config::get('sitename'));\n\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t}\n\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = strtolower(Request::base());\n\t\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$hubHomeDir = DS . 'home';\n\n\t\t\t\t\tif (!empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hubHomeDir .= DS . $sitename;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$user->set('homeDirectory', $hubHomeDir . DS . $user->get('username'));\n\t\t\t\t$user->set('loginShell', '/bin/bash');\n\t\t\t\t$user->set('ftpShell', '/usr/lib/sftp-server');\n\n\t\t\t\t// Set some initial user values\n\t\t\t\t$user->set('id', 0);\n\t\t\t\t$user->set('accessgroups', array($newUsertype));\n\t\t\t\t$user->set('registerDate', Date::toSql());\n\n\t\t\t\t// Check user activation setting\n\t\t\t\t// 0 = automatically confirmed\n\t\t\t\t// 1 = require email confirmation (the norm)\n\t\t\t\t// 2 = require admin confirmation\n\t\t\t\t$useractivation = $usersConfig->get('useractivation', 1);\n\n\t\t\t\t// If requiring admin approval, set user to block\n\t\t\t\tif ($useractivation == 2)\n\t\t\t\t{\n\t\t\t\t\t$user->set('approved', 0);\n\t\t\t\t}\n\n\t\t\t\t$user->set('access', 5);\n\t\t\t\t$user->set('activation', -rand(1, pow(2, 31)-1));\n\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\tif ($user->get('email') == $hzal->email)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->set('activation', 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($useractivation == 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('activation', 1);\n\t\t\t\t\t$user->set('access', (int)$this->config->get('privacy', 1));\n\t\t\t\t}\n\n\t\t\t\t$user->set('password', \\Hubzero\\User\\Password::getPasshash($xregistration->get('password')));\n\n\t\t\t\t// Do we have a return URL?\n\t\t\t\t$regReturn = Request::getString('return', '');\n\n\t\t\t\tif ($regReturn)\n\t\t\t\t{\n\t\t\t\t\t$user->setParam('return', $regReturn);\n\t\t\t\t}\n\n\t\t\t\t// If we managed to create a user\n\t\t\t\tif ($user->save())\n\t\t\t\t{\n\t\t\t\t\t$access = array();\n\t\t\t\t\tforeach ($fields as $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t$access[$field->get('name')] = $field->get('access');\n\t\t\t\t\t}\n\n\t\t\t\t\t$profile = $xregistration->_registration['_profile'];\n\n\t\t\t\t\t// Save profile data\n\t\t\t\t\t$member = Member::oneOrNew($user->get('id'));\n\t\t\t\t\t$orcidID = Session::get('orcid');\n\t\t\t\t\tif ($orcidID != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile['orcid'] = $orcidID;\n\t\t\t\t\t}\n\t\t\t\t\tif (!$member->saveProfile($profile, $access))\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Notify::error($member->getError());\n\t\t\t\t\t\t// Don't stop the registration process!\n\t\t\t\t\t\t// At this point, the account was successfully created.\n\t\t\t\t\t\t// The profile info, however, may have issues. But, it's not crucial.\n\t\t\t\t\t\t//$result = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\\Notify::error($user->getError());\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\t// If everything is OK so far...\n\t\t\t\tif ($result)\n\t\t\t\t{\n\t\t\t\t\t$result = \\Hubzero\\User\\Password::changePassword($user->get('id'), $xregistration->get('password'));\n\n\t\t\t\t\t// Set password back here in case anything else down the line is looking for it\n\t\t\t\t\t$user->set('password', $xregistration->get('password'));\n\n\t\t\t\t\t// Did we successfully create/update an account?\n\t\t\t\t\tif (!$result)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn App::abort(500, Lang::txt('COM_MEMBERS_REGISTER_ERROR_CREATING_ACCOUNT'));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Send confirmation email\n\t\t\t\t\tif ($user->get('activation') < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Components\\Members\\Helpers\\Utility::sendConfirmEmail($user, $xregistration);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a new view\n\t\t\t\t\t$this->view\n\t\t\t\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_CREATE_ACCOUNT'))\n\t\t\t\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t\t\t\t->set('xprofile', $user)\n\t\t\t\t\t\t->setErrors($this->getErrors())\n\t\t\t\t\t\t->setLayout('create')\n\t\t\t\t\t\t->display();\n\n\t\t\t\t\tif (is_object($hzal))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hzal->set('user_id', $user->get('id'));\n\n\t\t\t\t\t\tif ($hzal->user_id > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hzal->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tUser::set('auth_link_id', null);\n\t\t\t\t\tUser::set('tmp_user', null);\n\t\t\t\t\tUser::set('username', $xregistration->get('login'));\n\t\t\t\t\tUser::set('email', $xregistration->get('email'));\n\t\t\t\t\tUser::set('id', $user->get('id'));\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (Request::method() == 'GET')\n\t\t{\n\t\t\tif (User::get('tmp_user'))\n\t\t\t{\n\t\t\t\t$xregistration->loadAccount(User::getInstance());\n\n\t\t\t\t$username = $xregistration->get('login');\n\t\t\t\t$email = $xregistration->get('email');\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\t$xregistration->set('login', $hzal->username);\n\t\t\t\t\t$xregistration->set('email', $hzal->email);\n\t\t\t\t\t$xregistration->set('confirmEmail', $hzal->email);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\treturn $this->_show_registration_form($xregistration, 'create');\n\t}",
"public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }",
"public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}",
"private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}",
"public function onSubmitRegistration(EventInterface $event)\n {\n $log = $this->getLogger();\n $user = $event->getParam('user');\n $person = $user->getPerson();\n $log->info(\n sprintf(\n \"new user registration submitted by %s %s, %s\",\n $person->getFirstname(),\n $person->getLastname(),\n $person->getEmail()\n ),\n ['channel' => 'security',\n 'entity_class' => User::class,\n 'entity_id' => $user->getId(),]\n );\n }",
"public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}",
"private function _registerStart()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->_POST[ 'username' ] \t= \ttrim( $MySmartBB->_POST[ 'username' ] );\n\t\t$MySmartBB->_POST[ 'email' ] \t\t= \ttrim( $MySmartBB->_POST[ 'email' ] );\n\t\t\n\t\t// ... //\n\t\t\n\t\t// A long list of checks before registeration\n\t\t$this->__checkFieldsValidity();\n\t\t$this->__checkAlreadyUsed();\n\t\t$this->__checkBanned();\n\t\t$this->__checkConstraints();\n\t\t$this->__checkLength();\n \t\t\n \t$MySmartBB->_POST[ 'password' ] = md5( $MySmartBB->_POST[ 'password' ] );\n \t\n \t// ... //\n \t\n \t$MySmartBB->plugin->runHooks( 'register_start' );\n \t\n \t// ... //\n \t\n \t// Get the information of default group to set username style cache\n \t$MySmartBB->rec->table = $MySmartBB->table[ 'group' ];\n\t\t$MySmartBB->rec->filter = \"id='\" . $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] . \"'\";\n\t\t\n\t\t$GroupInfo = $MySmartBB->rec->getInfo();\n\t\t\n\t\t// ... //\n\t\t\n\t\t// Get the stylish username\n\t\t$style = $GroupInfo[ 'username_style' ];\n\t\t$username_style_cache = str_replace( '[username]', $MySmartBB->_POST['username'], $style );\n\t\t\n\t\t// ... //\n\t\t\n\t\t$MySmartBB->rec->table = $MySmartBB->table[ 'member' ];\n\t\t$MySmartBB->rec->fields = array(\t'username'\t\t=>\t$MySmartBB->_POST[ 'username' ],\n \t\t\t\t\t\t\t\t\t\t'password'\t\t=>\t$MySmartBB->_POST[ 'password' ],\n \t\t\t\t\t\t\t\t\t\t'email'\t\t\t=>\t$MySmartBB->_POST[ 'email' ],\n \t\t\t\t\t\t\t\t\t\t'usergroup'\t\t=>\t$MySmartBB->_CONF[ 'info_row']['def_group' ],\n \t\t\t\t\t\t\t\t\t\t'user_gender'\t=>\t$MySmartBB->_POST[ 'gender' ],\n \t\t\t\t\t\t\t\t\t\t'register_date'\t=>\t$MySmartBB->_CONF[ 'now' ],\n \t\t\t\t\t\t\t\t\t\t'user_title'\t=>\t$GroupInfo[ 'user_title' ],\n \t\t\t\t\t\t\t\t\t\t'style'\t\t\t=>\t$MySmartBB->_CONF[ 'info_row' ][ 'def_style' ],\n \t\t\t\t\t\t\t\t\t\t'username_style_cache'\t=>\t$username_style_cache);\n \t\n \t$MySmartBB->rec->get_id = true;\n \t\n \t$insert = $MySmartBB->rec->insert();\n \t\n \tif ( $insert )\n \t{\n \t\t// ... //\n \t\t\n \t\t// Update statistics\n \t\t$MySmartBB->cache->updateLastMember( $MySmartBB->_POST[ 'username' ], $MySmartBB->rec->id );\n \t\t\n \t\t// ... //\n \t\t\n \t\t$MySmartBB->plugin->runHooks( 'register_success' );\n \t\t\n \t\t// ... //\n \t\t\n \t\t// The default group requires an email activation from its members.\n \t\t// Therefore, We register a request and send the activation message to the member's email.\n \t\tif ( $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] == 5 )\n \t\t{\n \t\t\t$this->__sendActivationCode(); \t\t\t\n\t\t\t}\n\t\t\telse\n \t\t{\n \t\t\t$MySmartBB->func->msg( $MySmartBB->lang[ 'register_succeed' ] );\n \t\t\t$MySmartBB->func->move( 'index.php?page=login&register_login=1&username=' . $MySmartBB->_POST[ 'username' ] . '&password=' . $MySmartBB->_POST[ 'password' ] );\n \t\t}\n \t}\n\t}",
"public function register() {\n\t\t$user_email = $this->input->post(\"email\");\n\t\t$user_password = md5($this->input->post('password'));\n\t\t$user_reg_ip = ip2long($this->input->ip_address());\n\t\t\n\t\t$re = $this->user_lib->save_reg_userInfo($user_email,$user_password,$user_reg_ip);\n\t\t\n\t\tif($re===false){\n\t\t\t//set mc error\n\t\t}\n\t\t/*if(!$this->email_lib->send_active_email($user_email)){\n\t\t\t//send mail error\n\t\t}*/\n\t\t$uid = $this->user_lib->active_process($user_email);\n\t\tif($uid===false){\n\t\t\treturn false;\t\t//for active error\n\t\t}\n\t//\t$this->_set_login_cookie($uid);\n\t\tredirect('/regsuccess'); \n\t}",
"public function register()\n {\n $this->registration->execute([],$this);\n }"
]
| [
"0.6755885",
"0.6448512",
"0.643249",
"0.6237187",
"0.6216835",
"0.6216831",
"0.6140219",
"0.61289215",
"0.60943735",
"0.6087541",
"0.6075652",
"0.6032418",
"0.60152423",
"0.6000246",
"0.5992391",
"0.59891444",
"0.59881926",
"0.5941911",
"0.58998305",
"0.5890511",
"0.5877674",
"0.58775043",
"0.5873011",
"0.5871141",
"0.58651",
"0.586291",
"0.5853625",
"0.5851518",
"0.5849925",
"0.58437914"
]
| 0.64619446 | 1 |
Get a user's queued signup information. | abstract public function getQueuedSignup($username); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getQueuedSignups();",
"abstract protected function _queueSignup($signup);",
"public function queueSignup(&$info)\n {\n global $conf;\n\n // Perform any preprocessing if requested.\n $this->_preSignup($info);\n\n // If it's a unique username, go ahead and queue the request.\n $signup = $this->newSignup($info['user_name']);\n if (!empty($info['extra'])) {\n $signup->setData($info['extra']);\n }\n $signup->setData(array_merge($signup->getData(), array(\n 'dateReceived' => time(),\n 'password' => $info['password'],\n )));\n\n $this->_queueSignup($signup);\n\n try {\n Horde::callHook('signup_queued', array($info['user_name'], $info));\n } catch (Horde_Exception_HookNotSet $e) {\n }\n\n if (!empty($conf['signup']['email'])) {\n $link = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/admin/signup_confirm.php', true, -1)->setRaw(true)->add(array(\n 'u' => $signup->getName(),\n 'h' => hash_hmac('sha1', $signup->getName(), $conf['secret_key'])\n ));\n $message = sprintf(Horde_Core_Translation::t(\"A new account for the user \\\"%s\\\" has been requested through the signup form.\"), $signup->getName())\n . \"\\n\\n\"\n . Horde_Core_Translation::t(\"Approve the account:\")\n . \"\\n\" . $link->copy()->add('a', 'approve') . \"\\n\"\n . Horde_Core_Translation::t(\"Deny the account:\")\n . \"\\n\" . $link->copy()->add('a', 'deny');\n $mail = new Horde_Mime_Mail(array(\n 'body' => $message,\n 'Subject' => sprintf(Horde_Core_Translation::t(\"Account signup request for \\\"%s\\\"\"), $signup->getName()),\n 'To' => $conf['signup']['email'],\n 'From' => $conf['signup']['email']));\n $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));\n }\n }",
"public function signup()\n\t{\n\t\t$data = $this->check($this->as_array());\n\t\t\n\t\t$user = Sprig::factory('user');\n\t\t$user->values($data);\n\t\treturn $user->signup();\n\t}",
"function grabUserAccountInfo(){\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$session = JFactory::getSession();\n\t\t$post \t = $app->input->post->getArray();\n\t\t\n\t\t$session->set('userInfo', $post, 'register');\n\t\t\n\t\t//find step 3 or 4; step 4 = normal registration; step 3 = skip plan\n\t\t$skipPlan \t= $session->get('skipPlan', 0, 'register');\n\t\t$step = ($skipPlan) ? 'step=3' : 'step=4';\n\t\t\n\t\t$link = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&'.$step, false);\n\t\t$this->setRedirect($link);\n\t\treturn false;\n\t}",
"function wpmu_signup_user($user, $user_email, $meta = array())\n {\n }",
"public function signup()\n {\n if ($this->validate()) {\n $user = new User();\n $user->username = $this->username;\n $user->first_name = $this->firstName;\n $user->last_name = $this->lastName;\n $user->email = $this->email;\n $user->setPassword($this->password);\n $user->generateAuthKey();\n $user->ip = Yii::$app->request->getUserIP();\n $user->ua = Yii::$app->request->getUserAgent();\n if ($user->save()) {\n $this->user = $user;\n $this->sendMail();\n return $user;\n }\n }\n\n return false;\n }",
"public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }",
"private function getQuickUserInfo() {\r\n\t\t$aUser = wp_get_current_user ();\r\n\t\t$qUserInfo = \"x\";\r\n\t\tif ($aUser == null) {\r\n\t\t\t$qUserInfo = \"no current user\";\r\n\t\t} else {\r\n\t\t\t$qUserInfo = $aUser->user_email . \" \" . $aUser->display_name;\r\n\t\t}\r\n\t\treturn $qUserInfo;\r\n\t}",
"public function signupEmail($user)\r\n {\r\n\t\t// Mail args\r\n\t\t$args = ['user' => $user];\r\n\t\treturn $this->sendEmail('signup', 'signup', $user->email, $args);\r\n }",
"public function registerUserRequest()\n {\n $user = factory(User::class)->make();\n\n return $this->json('POST', '/api/v2/user', array_merge($user->toArray(), ['password' => 'secret1234', 'agb_check' => true]));\n }",
"public function getUserInfo ()\n\t{\n\t\t$info[\"id\"]\t\t\t\t\t\t= $this->id;\t\t\t\t\t//The unique id of the user in the database\n\t\t$info[\"user_id\"] \t\t\t\t= $this->userId;\t\t\t\t//The id of the user includes API id's\n\t\t$info[\"email\"]\t\t\t\t\t= $this->email;\t\t\t\t\t//The email of the user\n\t\t$info[\"description\"]\t\t\t= $this->description;\t\t\t//The description of the user\n\t\t$info[\"location\"]\t\t\t\t= $this->location;\t\t\t\t//The location of the user\n\t\t$info[\"first_name\"]\t\t\t\t= $this->firstName;\t\t\t\t//The first name of the user\n\t\t$info[\"last_name\"]\t\t\t\t= $this->lastName;\t\t\t\t//The last name of the user\n\t\t$info[\"name\"]\t\t\t\t\t= $this->fullName;\t\t\t\t//The full name of the user\n\t\t$info[\"username\"]\t\t\t\t= $this->username;\t\t\t\t//The username of the user\n\t\t$info[\"type\"]\t\t\t\t\t= $this->type;\t\t\t\t\t//The type of user registration\n\t\t$info[\"thumbnail\"]\t\t\t\t= $this->thumbnail;\t\t\t\t//The user's image thumbnail\n\t\t$info[\"gender\"]\t\t\t\t\t= $this->gender;\t\t\t\t//The gender of the user\n\t\t$info[\"num_calendars\"]\t\t\t= $this->numCalendarsCreated;\t//The number of calendars the user has created\n\t\t$info[\"num_followed_calendars\"]\t= $this->numCalendarsFollowed;\t//The number of calendars the user is following\n\t\t$info[\"primary_calendar\"]\t\t= $this->primaryCalendar;\t\t//The primary calendar that a user is using\n\t\t\n\t\treturn $info;\n\t}",
"public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }",
"public function getSignUpApiToken()\n {\n return $this->_signUpApiToken;\n }",
"public function getSignup($signup_id)\n {\n $path = 'signups/'.$signup_id;\n\n return $this->get($path);\n }",
"public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }",
"public function api_entry_getprofilefromqbid() {\n parent::validateParams(array('qbid'));\n\n $user = $this->Mdl_Users->getAll(\"qbid\", $_POST[\"qbid\"]);\n\n if (count($user) == 0 || $user[0] == null)\n parent::returnWithErr(\"QBID is not valid.\");\n\n unset($user[0]->password);\n\n parent::returnWithoutErr(\"User profile fetched successfully.\", $user[0]);\n }",
"public function getBackendUser() {}",
"public function get_user_data() {\n\t\t$email = '';\n\t\t$name = '';\n\n\t\tif ( ! empty( $this->current_user->user_email ) ) {\n\t\t\t$email = $this->current_user->user_email;\n\t\t}\n\n\t\tif ( ! empty( $this->current_user->user_firstname ) && ! empty( $this->current_user->user_lastname ) ) {\n\t\t\t$name = $this->current_user->user_firstname . ' ' . $this->current_user->user_lastname;\n\t\t} else {\n\t\t\t$name = $this->current_user->user_login;\n\t\t}\n\n\t\treturn array(\n\t\t\t'name' => $name,\n\t\t\t'email' => $email,\n\t\t);\n\t}",
"public function get_register_user_exists_form() {\n $this->do_register_user_exists_form();\n return $this->c_arr_register_user_exists_form;\n }",
"public function showInternalUserSignUp()\n {\n $institutions = Institution::all(['id', 'name']);\n $parastatals = Parastatal::all(['id', 'name']);\n $states = State::all(['id', 'name']);\n $job_titles = InternalUserStatus::all(['name', 'description']);\n\n return $this->withArray([\n 'states' => $states,\n 'parastatals' => $parastatals,\n 'institutions' => $institutions,\n 'job_titles' => $job_titles\n ]);\n }",
"public function getUserCheck()\n {\n return $this->get(self::_USER_CHECK);\n }",
"function getUser()\n\t\t{\n\t\t\tglobal $wpdb;\n\n\t\t\tif(!empty($this->user))\n\t\t\t\treturn $this->user;\n\n\t\t\t$gmt_offset = get_option('gmt_offset');\n\t\t\t$this->user = $wpdb->get_row(\"SELECT *, UNIX_TIMESTAMP(user_registered) + \" . ($gmt_offset * 3600) . \" as user_registered FROM $wpdb->users WHERE ID = '\" . $this->user_id . \"' LIMIT 1\");\n\t\t\treturn $this->user;\n\t\t}",
"private function get_user_info() {\n $user_info = $this->_api_call('https://api.twitter.com/1.1/account/settings.json');\n return $user_info;\n }",
"static public function GetGETUser() {\n if (isset(self::$getUser))\n return self::$getUser;\n else\n return self::UNKNOWN;\n }",
"private static function signup() {\r\n\t\t$user = new User($_POST);\r\n\t\t$_SESSION['badUser'] = new User($user->getParameters()); // used by view to temporarily store signup form input\r\n\t\t$_SESSION['badUser']->setErrors($user->getErrors());\r\n\t\t$_SESSION['badUser']->clearPassword();\r\n\r\n\t\t// check for validation errors\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'One or more fields contained errors. Check below for details. Make any needed corrections and try again.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure user name is not already taken\r\n\t\tif (UsersDB::userExists($user->getUserName())) {\r\n\t\t\tself::alertMessage('danger', 'User name already exists. You must choose another.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure main character name is not already taken\r\n\t\tif (UsersDB::mainExists($user->getMainName())) {\r\n\t\t\tself::alertMessage('danger', 'The main character name is already associated with another user.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user name available. send add request to database and check for success\r\n\t\tUsersDB::addUser($user);\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'Failed to add user to database. Contact support.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user is valid and should be logged in at this point\r\n\t\tunset($_SESSION['badUser']);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// create a random verification code, text it to the user's phone, and display verification page\r\n\t\tTextMessageController::sendVerificationCode();\r\n\t\tVerificationView::show();\r\n\t}",
"protected function registered(Request $request, $user)\n {\n \n\n //get data into verification\n \n $this->userVerificationCreate($user);\n\n\n //send email\n\n $this->sendVerifyEmail($user);\n\n \n $this->guard()->logout();\n return redirect()->route('login')->with('success', 'We have sent you an account activation link through email. Please activate your account to login.');\n \n\n }",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}"
]
| [
"0.7317367",
"0.6505542",
"0.6390879",
"0.56973714",
"0.562797",
"0.54812574",
"0.54459584",
"0.53924125",
"0.5277661",
"0.5216975",
"0.51966953",
"0.51442933",
"0.51072633",
"0.5102544",
"0.50926995",
"0.50501347",
"0.50488245",
"0.5030563",
"0.5013961",
"0.5005015",
"0.49698263",
"0.4967399",
"0.49600947",
"0.49517092",
"0.49363706",
"0.49332574",
"0.4924627",
"0.49182418",
"0.49182418",
"0.49182418"
]
| 0.68796176 | 1 |
Get the queued information for all pending signups. | abstract public function getQueuedSignups(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function queued()\n {\n return $this->memory->get('orchestra.publisher.queue', []);\n }",
"private function getPendingEvents ()\n {\n return EventQueue::pending()->with('event_detail')\n ->orderBy('scheduled_start_time', 'asc')\n ->limit(100)\n ->get();\n }",
"public function GetQueuedJobs()\n {\n $JOBS = $this->DB->GET('MUP.injector.jobs', ['status' => 'QUEUED', 'pmta' => $this->HOSTID, 'active' => '1', 'ORDER' => ['date' => 'ASC']], ['id', 'target', 'pool'], 100000);\n if (empty($JOBS)) {\n $this->ALERTS[] = FAIL.\" ~ <<< No Jobs to Inject...\";\n }else{\n if (isset($JOBS['id']))\n $JOBS = [$JOBS['id']=> $JOBS];\n foreach ($JOBS as $ID => $JOB) \n if (!isset($this->QueuedJobs[$JOB['pool']][$JOB['target']])) \n $this->QueuedJobs[$JOB['pool']][$JOB['target']] = ltrim($ID, '0');\n $this->Debug('QUEUED JOBS', $this->QueuedJobs);\n }\n }",
"function qa_page_queue_pending()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tqa_preload_options();\n\t$loginuserid = qa_get_logged_in_userid();\n\n\tif (isset($loginuserid)) {\n\t\tif (!QA_FINAL_EXTERNAL_USERS)\n\t\t\tqa_db_queue_pending_select('loggedinuser', qa_db_user_account_selectspec($loginuserid, true));\n\n\t\tqa_db_queue_pending_select('notices', qa_db_user_notices_selectspec($loginuserid));\n\t\tqa_db_queue_pending_select('favoritenonqs', qa_db_user_favorite_non_qs_selectspec($loginuserid));\n\t\tqa_db_queue_pending_select('userlimits', qa_db_user_limits_selectspec($loginuserid));\n\t\tqa_db_queue_pending_select('userlevels', qa_db_user_levels_selectspec($loginuserid, true));\n\t}\n\n\tqa_db_queue_pending_select('iplimits', qa_db_ip_limits_selectspec(qa_remote_ip_address()));\n\tqa_db_queue_pending_select('navpages', qa_db_pages_selectspec(array('B', 'M', 'O', 'F')));\n\tqa_db_queue_pending_select('widgets', qa_db_widgets_selectspec());\n}",
"public function getMailsReadyForSending()\n {\n $qb = $this->doctrine->getEntityManager()->createQueryBuilder();\n $result = $qb->select('a')\n ->from('MailerBundle:MailQueue', 'a')\n ->where('a.status = :pending_status')\n ->andWhere('a.sendAt <= CURRENT_TIMESTAMP()')\n ->setParameter('pending_status', MailStatuses::PENDING)\n ->getQuery()\n ->getResult();\n \n return $result;\n }",
"public function getEmailQueue()\n {\n return $this->query(null, ['isEmail' => 1, 'isEmailed' => 0]);\n }",
"public function getQueued()\n {\n return $this->Queued;\n }",
"public function pending()\n {\n $prefix = config('vapor-ui.queue.prefix');\n\n if (empty($prefix)) {\n return 0;\n }\n\n $queue = $this->queueResolver->__invoke();\n\n return collect($this->sqs->getQueueAttributes([\n 'AttributeNames' => [\n 'ApproximateNumberOfMessages',\n 'ApproximateNumberOfMessagesNotVisible',\n 'ApproximateNumberOfMessagesDelayed',\n ],\n 'QueueUrl' => \"$prefix/$queue\",\n ])['Attributes'])->sum();\n }",
"public function getAllPending(): array;",
"public function getQueue()\n {\n return array();\n }",
"public function getQueue()\n {\n return $this->doRequest('GET', \"queue\", []);\n }",
"public function getQueuedPendingCount()\n {\n return $this->queuedPendingCount;\n }",
"public function requestQueued()\n {\n $response = $this->checkRequest();\n $this->entities = array();\n\n return $response;\n }",
"abstract public function getQueuedSignup($username);",
"public function getQueue();",
"public function getQueue();",
"public function getGuildAppQueue()\n {\n return $this->get(self::_GUILD_APP_QUEUE);\n }",
"public static function readNotificationQueue() {\n global $wpdb;\n //TODO\n // 1- Add user_id field to token table\n // 2- if the notification isn't an admin\n //TODO Use This when There is a user Id with multiple tokens\n $tokens = [];\n $table = self::getQueueTableName();\n $query = \"SELECT * FROM $table WHERE `is_sent` = 0 LIMIT 100\";\n //Admin Notifications\n $results = $wpdb->get_results($query);\n if(count($results) < 1) {\n return 0;\n }\n else {\n foreach ($results as $result) {\n $token_id = $result->token_id;\n $token = KibarToken::getTokenByID($token_id);\n $notification = self::getNotificationById($result->notification_id);\n //Call FCM For each token row\n $args = array(\n 'entry_id' => $result->id,\n 'to' => $token,\n 'notification' => $notification\n );\n\n KibarFCM::sendFCMMsg($args);\n //set each token is_sent to false\n }\n }\n }",
"function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}",
"public function getPending()\n\t{\n\t\treturn $this->pending;\n\t}",
"abstract protected function _queueSignup($signup);",
"abstract protected function getPaymentQueue();",
"public function getAppQueue()\n {\n return $this->get(self::_APP_QUEUE);\n }",
"public function getAppQueue()\n {\n return $this->get(self::_APP_QUEUE);\n }",
"public function getPendingSchedules()\n {\n return $this->db->where('status', self::STATUS_PENDING)\n ->get($this->cron_schedule_table_name)\n ->result_array();\n }",
"public function get_queued_status() {\n\t\treturn '';\n\t}",
"public function getQueues()\n {\n return $this->_queues = $this->_pheanstalk->listTubes();\n }",
"public static function getTracksInQueue($queue = 'requests')\n {\n self::verifyQueue($queue);\n if (isset(self::$queue_cache[$queue])) {\n return self::$queue_cache[$queue];\n }\n\n $info = explode(' ', self::telnetOp('jukebox_'.$queue.'.queue'));\n\n $items = [];\n foreach ($info as $item) {\n if (is_numeric($item)) {\n $meta = self::telnetOp('request.metadata '.$item);\n //Don't include items that are set to ignore\n if (stristr($meta, 'skip=\"true\"') === false) {\n //Get the trackid\n $tid = preg_replace(\n '/^.*filename=\\\"'.str_replace('/', '\\\\/', Config::$music_central_db_path)\n .'\\/records\\/[0-9]+\\/([0-9]+)\\.mp3.*$/is',\n '$1',\n $meta\n );\n //Push the item\n $items[] = ['requestid' => (int) $item, 'trackid' => (int) $tid, 'queue' => $queue];\n }\n }\n }\n\n self::$queue_cache[$queue] = $items;\n\n return $items;\n }",
"public function getPendingEvents(): array;",
"public function getQueuedCookies();"
]
| [
"0.66504604",
"0.6465695",
"0.6410548",
"0.62923247",
"0.62330604",
"0.6206414",
"0.613877",
"0.5972018",
"0.59293026",
"0.5917628",
"0.5915809",
"0.58557093",
"0.5829299",
"0.5707008",
"0.5630875",
"0.5630875",
"0.5624456",
"0.5590666",
"0.5578604",
"0.55750173",
"0.5557389",
"0.55504507",
"0.55420053",
"0.55420053",
"0.55369526",
"0.5510788",
"0.54861736",
"0.5457127",
"0.54451686",
"0.54249173"
]
| 0.8040564 | 0 |
Remove a queued signup. | abstract public function removeQueuedSignup($username); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function _queueSignup($signup);",
"public function destroy(signUp $signUp)\n {\n //\n }",
"public function removeMe()\n {\n $this->current_signal=self::SIGNAL_NONE;\n $this->sigtable=[];\n Bot::remove($this->bot_slot,0);\n }",
"public function remove() {}",
"public function remove() {}",
"abstract public function getQueuedSignups();",
"function remove_from_db()\n\t{\n\n\t\t// delete Signup\n\t\t$sql = sprintf(\"delete from Signup where SignupId = '%s'\", \n\t\t\tmysql_real_escape_string($this->SignupId));\n\t\t$result = mysql_query($sql);\n\t\tif (!$result)\n\t\t\treturn display_mysql_error ('Cannot execute query', $sql); \t\t\n\t\t\n\t}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove()\n\t{\n\t\t$this->logout();\n\t}",
"function remove_run_signups($RunId)\n{\n // delete Signup\n $sql = sprintf(\"delete from Signup where RunId = '%s'\", \n mysql_real_escape_string($RunId));\n $result = mysql_query($sql);\n if (!$result)\n return display_mysql_error ('Cannot execute query', $sql); \t\t\n}",
"function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }",
"public function queue_cleanup_personal_data() {\n\t\tself::$background_process->schedule_ended_subscription_anonymization();\n\t}",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function prune() {\n $this->connection->delete('queue')\n ->condition('name', $this->name)\n ->condition('expire', 0, '>')\n ->execute();\n }",
"public function destroy()\n {\n $user = $user = auth()->user();\n $user->email_pending = null;\n $user->save();\n\n return response()->json(null, 204);\n }",
"public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}",
"public function unqueue($name);",
"public function remove() {\n }",
"public function deleteQueue();",
"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()\n {\n $this->queue->delete($this);\n }",
"public function removeExpired();",
"function edd_pup_clear_queue() {\n\n\tif ( ! wp_verify_nonce( $_REQUEST['nonce'], 'clear-queue-'.$_REQUEST['email'] ) ) {\n\t\techo 'noncefail';\n\t\texit;\n\t}\n\n\tglobal $wpdb;\n\n\t// Clear queue\n\tif ( $_POST['email'] == 'all' ) {\n\n\t\t// Build array of queued emails before clearing table\n\t\t$queueemails = edd_pup_queue_emails();\n\n\t\t// Build array of sent email data before clearing table\n\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t$recipients[$id] = edd_pup_check_queue( $id );\n\t\t}\n\n\t\t// Clear the database table\n\t\t$qr = $wpdb->query( \"TRUNCATE TABLE $wpdb->edd_pup_queue\" );\n\n\t} else {\n\n\t\t$recipients = edd_pup_check_queue( $_POST['email'] );\n\n\t\t// Delete the rows WHERE the specified email_id matches\n\t\t$qr = $wpdb->delete( \"$wpdb->edd_pup_queue\", array( 'email_id' => $_POST['email'] ), array( '%d' ) );\n\n\t}\n\n\t// If clear queue fails, bail out of function with error message, otherwise change post statuses\n\tif ( false === $qr ) {\n\t\twp_die( __( 'Error: could not complete database query.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\n\t} else {\n\n\t\tif ( !empty( $queueemails ) ) {\n\n\t\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t\t$post[] = wp_update_post( array( 'ID' => $id, 'post_status' => 'abandoned' ) );\n\t\t\t\tupdate_post_meta ( $id, '_edd_pup_recipients', $recipients[$id] );\n\t\t\t}\n\n\t\t} else if ( absint( $_POST['email'] ) != 0 ) {\n\n\t\t\t$post = wp_update_post( array( 'ID' => $_POST['email'], 'post_status' => 'abandoned' ) );\n\t\t\tupdate_post_meta ( $post, '_edd_pup_recipients', $recipients );\n\n\t\t} else {\n\n\t\t\twp_die( __( 'Error: Valid email ID not supplied.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\t\t}\n\t}\n\n\tdie();\n}",
"public function removeUpload()\n {\n $this->picture = null;\n }",
"private function removeTestUser(): void\n {\n $team = $this->terminusJsonResponse(sprintf('site:team:list %s', $this->getSiteName()));\n $this->assertIsArray($team);\n if (0 === count($team)) {\n return;\n }\n\n $emails = array_column($team, 'email');\n if (!in_array($this->getUserEmail(), $emails)) {\n return;\n }\n\n $this->terminus(sprintf('site:team:remove %s %s', $this->getSiteName(), $this->getUserEmail()));\n }",
"private function unsubscribeUser()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['subscribed_to']) || $request['subscribed_to']==\"\" )\n throw_error_msg(\"subscribed to not provided\");\n\n if( !is_numeric($request['subscribed_to']) )\n throw_error_msg(\"invalid subscribed to\");\n\n global $userquery;\n $userquery->remove_subscription($request['subscribed_to']);\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\" => 'unsubscribed successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function leaveQueue()\n {\n if(!$this->u) return $this->returnText(self::ERR_NO_USER);\n\n $oQueueUser = QueueUser::where([\n ['user_id', '=', $this->u->id],\n ['queue_id', '=', $this->c->active]\n ])->first();\n\n if($oQueueUser)\n {\n $oQueueUser->forceDelete();\n return $this->returnText('Successfully removed from queue'. $this->q->displayName);\n }\n else\n {\n return $this->returnText('Unable to leave, you are not in queue'. $this->q->displayName);\n }\n }"
]
| [
"0.6350057",
"0.619954",
"0.6091219",
"0.5895107",
"0.5894864",
"0.5843646",
"0.57947135",
"0.5791942",
"0.5791942",
"0.5791942",
"0.5791942",
"0.5789654",
"0.57308805",
"0.56527686",
"0.5625517",
"0.56191975",
"0.5613924",
"0.5568349",
"0.55519533",
"0.55058306",
"0.54833055",
"0.5462594",
"0.54531056",
"0.5438174",
"0.54199284",
"0.5409181",
"0.5408677",
"0.5378119",
"0.5327705",
"0.53193593"
]
| 0.72926486 | 0 |
Return a new signup object. | abstract public function newSignup($name); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function signup()\n\t{\n\t\t$data = $this->check($this->as_array());\n\t\t\n\t\t$user = Sprig::factory('user');\n\t\t$user->values($data);\n\t\treturn $user->signup();\n\t}",
"public function signup()\n {\n if ($this->validate()) {\n $user = new User();\n $user->username = $this->username;\n $user->first_name = $this->firstName;\n $user->last_name = $this->lastName;\n $user->email = $this->email;\n $user->setPassword($this->password);\n $user->generateAuthKey();\n $user->ip = Yii::$app->request->getUserIP();\n $user->ua = Yii::$app->request->getUserAgent();\n if ($user->save()) {\n $this->user = $user;\n $this->sendMail();\n return $user;\n }\n }\n\n return false;\n }",
"public function signupUser()\n { \n $user = User::findByUserEmail($this->email);\n if($user == null) { \n $user = new User();\n $user->user_full_name = $this->username;\n if(!empty($this->phone)) {\n $user->phone_number = $this->phone;\n }\n if(!empty($this->email)) { \n $user->email = $this->email;\n }\n $user->password_hash = md5($this->password);\n $user->login_method = 'email';\n $user->save();\n } \n return $user;\n }",
"public function create()\n {\n $user = User::find(1);\n\n $signups = $user->signups;\n\n\n return view ('signup/create', compact('signUp'));\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }",
"public function getSignUp(){\n\t\t//make the sign up view\n\t\treturn View::make('account.signup');\n\t}",
"public function create()\n {\n return view('sign_up');\n }",
"static function create() {\n $numargs = func_num_args();\n if($numargs < 3 || $numargs > 7) return false;\n $args = func_get_args();\n\n $u = new User;\n\n // required values\n $u->id = (integer) $args[0];\n $u->firstName = (string) $args[1];\n $u->lastName = (string) $args[2];\n\n // not required values\n $u->email = isset($args[3]) ? $args[3] : '';\n $u->department = isset($args[4]) ? $args[4] : '';\n $u->contact = isset($args[5]) ? $args[5] : '';\n $u->isAdmin = isset($args[6]) ? $args[6] : false;\n\n return $u;\n }",
"public function sign_up()\n {\n\n }",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }",
"public function signup (SignupRequest $request): Response\n {\n $response = User::create($request->all()); \n\n return response()->json([]); \n }",
"public function create()\n {\n return view('login.signup');\n }",
"public function signUp(array $attributes)\n\t{\n\t\treturn $this->perform('signUp', $this->getNew(), $attributes);\n\t}",
"public function signup()\n {\n return view('auth.signup');\n }",
"public function user_signup_new(Request $request)\n {\n $request->validate([\n 'first_name' => 'required',\n 'email' => 'required|string|unique:users',\n 'other_mobile_number' => 'required|integer|unique:users',\n 'selectType' => 'required',\n 'agree_check' => 'required|boolean',\n 'password' => 'required|string|confirmed'\n ]);\n\n $token = getenv(\"TWILIO_AUTH_TOKEN\");\n $twilio_sid = getenv(\"TWILIO_SID\");\n $twilio_verify_sid = getenv(\"TWILIO_VERIFY_SID\");\n $twilio = new Client($twilio_sid, $token);\n $twilio->verify->v2->services($twilio_verify_sid)\n ->verifications\n ->create(\"+91\".$request->other_mobile_number, \"sms\");\n\n $user = new User([\n 'name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email' => $request->email,\n 'usertype' => 3,\n 'userSelect_type' => $request->selectType,\n 'other_mobile_number' => $request->other_mobile_number,\n 'password' => bcrypt($request->password)\n ]);\n\n $user->save();\n eventtracker::create(['symbol_code' => '1', 'event' => $request->email.' created a new account as a User']);\n\n return response()->json([\n 'data' => $user,\n 'message' => 'Successfully created user!'\n ], 201);\n }",
"public function signupAction()\n {\n $this->tag->setTitle(__('Sign up'));\n $this->siteDesc = __('Sign up');\n\n if ($this->request->isPost() == true) {\n $user = new Users();\n $signup = $user->signup();\n\n if ($signup instanceof Users) {\n $this->flash->notice(\n '<strong>' . __('Success') . '!</strong> ' .\n __(\"Check Email to activate your account.\")\n );\n } else {\n $this->view->setVar('errors', new Arr($user->getMessages()));\n $this->flash->warning('<strong>' . __('Warning') . '!</strong> ' . __(\"Please correct the errors.\"));\n }\n }\n }",
"public function create()\n {\n return View::make(Config::get('confide::signup_form'))\n \t\t\t->with('errors', true);\n }",
"public function create()\r\n {\r\n return View::make(Config::get('confide::signup_form'));\r\n }",
"public function registerViaRequest()\n {\n return User::create(array_merge([\n 'password' => bcrypt(input('password')),\n ], only('email', 'name', 'is_public')));\n }",
"public static function create() {\n\t\tif (empty(Validator::$errors)) {\n\t\t\tself::insert(self::$tablename, array(\"email\"=>self::$email, \"password_hash\"=>self::$password_hash));\n\t\t\tSession::setFlash(\"alert-success\",\"You have successfully signed up!\");\n\t\t} else {\n\t\t\tSession::setFlash(\"alert-danger\", self::display(Validator::$errors));\n\t\t\tValidator::$errors = [];\n\t\t}\n\t}",
"protected function createUserAccount() {\n\t\treturn new UserAccount();\n\t}",
"public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }",
"public function signup() {\n $this->template->content = View::instance(\"v_users_signup\");\n \n # Render the view\n echo $this->template;\n }",
"public function create()\n {\n if (! Session::has('userGithubData')) {\n return Redirect::route('login');\n }\n $githubUser = array_merge(Session::get('userGithubData'), Session::get('_old_input', []));\n return View::make('auth.signupconfirm', compact('githubUser'));\n }",
"public function signup()\n\t{\n\t\treturn View::make('users.signup');\n\t}",
"private static function signup() {\r\n\t\t$user = new User($_POST);\r\n\t\t$_SESSION['badUser'] = new User($user->getParameters()); // used by view to temporarily store signup form input\r\n\t\t$_SESSION['badUser']->setErrors($user->getErrors());\r\n\t\t$_SESSION['badUser']->clearPassword();\r\n\r\n\t\t// check for validation errors\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'One or more fields contained errors. Check below for details. Make any needed corrections and try again.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure user name is not already taken\r\n\t\tif (UsersDB::userExists($user->getUserName())) {\r\n\t\t\tself::alertMessage('danger', 'User name already exists. You must choose another.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure main character name is not already taken\r\n\t\tif (UsersDB::mainExists($user->getMainName())) {\r\n\t\t\tself::alertMessage('danger', 'The main character name is already associated with another user.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user name available. send add request to database and check for success\r\n\t\tUsersDB::addUser($user);\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'Failed to add user to database. Contact support.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user is valid and should be logged in at this point\r\n\t\tunset($_SESSION['badUser']);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// create a random verification code, text it to the user's phone, and display verification page\r\n\t\tTextMessageController::sendVerificationCode();\r\n\t\tVerificationView::show();\r\n\t}",
"public function doSingUp(SignupRequest $request)\n {\n $user = User::create([\n 'name' => $request->input('displayname'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($request->input('password')),\n 'active' => 0\n ]);\n\n return redirect()->back()->withSuccess('User created');\n }"
]
| [
"0.7201729",
"0.67700875",
"0.660078",
"0.65526605",
"0.6474261",
"0.6474261",
"0.64364296",
"0.63279724",
"0.62748486",
"0.62137896",
"0.6178183",
"0.6124734",
"0.6124734",
"0.609048",
"0.60464084",
"0.60094666",
"0.599019",
"0.5990071",
"0.5989733",
"0.5983758",
"0.59790003",
"0.5973125",
"0.59466696",
"0.59448236",
"0.5944221",
"0.59349173",
"0.59300554",
"0.5925829",
"0.591158",
"0.5909954"
]
| 0.6855391 | 1 |
Description: This function put the tags css and js per each module and the libs of the framework Example: $array = putHEAD_MODULE_HTML('calendar'); Developer: Eduardo Cueva email: | private function putHEAD_MODULE_HTML($menuLibs) // add by eduardo
{
// get the header with scripts and links(css)
$documentRoot = $_SERVER["DOCUMENT_ROOT"];
//STEP 1: include file of module
$directory = "$documentRoot/modules/".$menuLibs;
$HEADER_MODULES = array();
if(is_dir($directory)){
// FIXED: The theme default shouldn't be static.
$directoryScrips = "$documentRoot/modules/$menuLibs/themes/default/js/";
$directoryCss = "$documentRoot/modules/$menuLibs/themes/default/css/";
if(is_dir($directoryScrips)){
$arr_js = $this->obtainFiles($directoryScrips,"js");
if($arr_js!=false && count($arr_js)>0){
for($i=0; $i<count($arr_js); $i++){
$dir_script = "modules/$menuLibs/themes/default/js/".$arr_js[$i];
$HEADER_MODULES[] = "<script type='text/javascript' src='$dir_script'></script>";
}
}
}
if(is_dir($directoryCss)){
$arr_css = $this->obtainFiles($directoryCss,"css");
if($arr_css!=false && count($arr_css)>0){
for($i=0; $i<count($arr_css); $i++){
$dir_css = "modules/$menuLibs/themes/default/css/".$arr_css[$i];
$HEADER_MODULES[] = "<link rel='stylesheet' href='$dir_css' />";
}
}
}
//$HEADER_MODULES
}
$this->_smarty->assign("HEADER_MODULES", implode("\n", $HEADER_MODULES));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function buildHeadMarkup(){\n\n echo file_get_contents(\"head/home.html\");\n\n $this->head_script_tags = \"\";\n\n foreach( $this->head_scripts as $value ){\n\n $this->head_script_tags .= \"<script src=\\\"\" . $value . \"\\\"></script>\";\n\n }\n\n $this->head = file_get_contents(\"head/home.html\").$this->head_script_tags.\"</head>\";\n\n }",
"function updateHead()\n\t{\n\t\t//state parameters\n\t\t$devmode = $this->getParam('devmode', 0);\n\t\t$themermode = $this->getParam('themermode', 1) && defined('T3_THEMER');\n\t\t$theme = $this->getParam('theme', '');\n\t\t$minify = $this->getParam('minify', 0);\n\t\t$minifyjs = $this->getParam('minify_js', 0);\n\n\t\t// As Joomla 3.0 bootstrap is buggy, we will not use it\n\t\t// We also prevent both Joomla bootstrap and T3 bootsrap are loaded\n\t\t// And upgrade jquery as our Framework require jquery 1.7+ if we are loading jquery from google\n\t\t$doc = JFactory::getDocument();\n\t\t$scripts = array();\n\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\n\t\t\t$t3bootstrap = false;\n\t\t\t$jabootstrap = false;\n\n\t\t\tforeach ($doc->_scripts as $url => $script) {\n\t\t\t\tif (strpos($url, T3_URL . '/bootstrap/js/bootstrap.js') !== false) {\n\t\t\t\t\t$t3bootstrap = true;\n\t\t\t\t\tif ($jabootstrap) { //we already have the Joomla bootstrap and we also replace to T3 bootstrap\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (preg_match('@media/jui/js/bootstrap(.min)?.js@', $url)) {\n\t\t\t\t\tif ($t3bootstrap) { //we have T3 bootstrap, no need to add Joomla bootstrap\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$scripts[T3_URL . '/bootstrap/js/bootstrap.js'] = $script;\n\t\t\t\t\t}\n\n\t\t\t\t\t$jabootstrap = true;\n\t\t\t\t} else {\n\t\t\t\t\t$scripts[$url] = $script;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$doc->_scripts = $scripts;\n\t\t\t$scripts = array();\n\t\t}\n\n\t\t// VIRTUE MART / JSHOPPING compatible\n\t\tforeach ($doc->_scripts as $url => $script) {\n\t\t\t$replace = false;\n\n\t\t\tif ((strpos($url, '//ajax.googleapis.com/ajax/libs/jquery/') !== false &&\n\t\t\t\t\tpreg_match_all('@/jquery/(\\d+(\\.\\d+)*)?/@msU', $url, $jqver)) ||\n\t\t\t\t(preg_match_all('@(^|\\/)jquery([-_]*(\\d+(\\.\\d+)+))?(\\.min)?\\.js@i', $url, $jqver))) {\n\n\t\t\t\t$idx = strpos($url, '//ajax.googleapis.com/ajax/libs/jquery/') !== false ? 1 : 3;\n\n\t\t\t\tif (is_array($jqver) && isset($jqver[$idx]) && isset($jqver[$idx][0])) {\n\t\t\t\t\t$jqver = explode('.', $jqver[$idx][0]);\n\n\t\t\t\t\tif (isset($jqver[0]) && (int)$jqver[0] <= 1 && isset($jqver[1]) && (int)$jqver[1] < 7) {\n\t\t\t\t\t\t$scripts[T3_URL . '/js/jquery-1.8.3' . ($devmode ? '' : '.min') . '.js'] = $script;\n\t\t\t\t\t\t$replace = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$replace) {\n\t\t\t\t$scripts[$url] = $script;\n\t\t\t}\n\t\t}\n\n\t\t$doc->_scripts = $scripts;\n\t\t// end update javascript\n\n\t\t// detect RTL\n\t\t$dir = $doc->direction;\n\t\t$is_rtl = ($dir == 'rtl');\n\n\t\t// not in devmode and in default theme, do nothing\n\t\tif (!($devmode || $themermode || $theme || $minify || $minifyjs || $is_rtl)) {\n\t\t\treturn;\n\t\t}\n\n\t\t//Update css/less based on devmode and themermode\n\t\t$root = JURI::root(true);\n\t\t$current = JURI::current();\n\t\t$regex = '@' . preg_quote(T3_TEMPLATE_URL) . '/css/(rtl/)?(.*)\\.css((\\?|\\#).*)?$@i';\n\t\t$stylesheets = array();\n\n\t\tforeach ($doc->_styleSheets as $url => $css) {\n\t\t\t// detect if this css in template css\n\t\t\tif (preg_match($regex, $url, $match)) {\n\t\t\t\t$fname = $match[2];\n\n\t\t\t\tif ($devmode || $themermode) {\n\t\t\t\t\tif (is_file(T3_TEMPLATE_PATH . '/less/' . $fname . '.less')) {\n\t\t\t\t\t\tif ($themermode) {\n\t\t\t\t\t\t\t$newurl = T3_TEMPLATE_URL . '/less/' . $fname . '.less';\n\t\t\t\t\t\t\t$css['mime'] = 'text/less';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$newurl = $current . '?t3action=lessc&s=templates/' . T3_TEMPLATE . '/less/' . $fname . '.less';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$stylesheets[$newurl] = $css;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$subpath = $is_rtl ? 'rtl/' . ($theme ? $theme . '/' : '') : ($theme ? 'themes/' . $theme . '/' : '');\n\t\t\t\t\tif ($subpath && is_file(T3_TEMPLATE_PATH . '/css/' . $subpath . $fname . '.css')) {\n\t\t\t\t\t\t$newurl = T3_TEMPLATE_URL . '/css/' . $subpath . $fname . '.css';\n\t\t\t\t\t\t$stylesheets[$newurl] = $css;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$stylesheets[$url] = $css;\n\t\t}\n\t\t// update back\n\t\t$doc->_styleSheets = $stylesheets;\n\n\t\t//only check for minify if devmode is disabled\n\t\tif (!$devmode && ($minify || $minifyjs)) {\n\t\t\tT3::import('core/minify');\n\t\t\tif($minify){\n\t\t\t\tT3Minify::optimizecss($this);\n\t\t\t}\n\t\t\tif($minifyjs){\n\t\t\t\tT3Minify::optimizejs($this);\n\t\t\t}\n\t\t}\n\t}",
"function getHeadScriptTags($currentPath){\n echo <<<SCRIPT\n <!-- jQuery 1.11.3 -->\n <script type=\"text/javascript\" src =\"$currentPath/include/libs/jquery-1.11.3.min.js\"></script>\n <!-- Bootstrap 3.3.5 -->\n <!-- Latest compiled and minified CSS -->\n <link rel=\"stylesheet\" href=\"$currentPath/include/libs/bootstrap/bootstrap-3.3.5/css/bootstrap.min.css\">\n <!-- Latest compiled Bootstrap JavaScript -->\n <script type=\"text/javascript\" src=\"$currentPath/include/libs/bootstrap/bootstrap-3.3.5/js/bootstrap.min.js\"></script>\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesnt work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"$currentPath/include/libs/bootstrap/bootstrapForIE9/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"$currentPath/include/libs/bootstrap/bootstrapForIE9/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n <!-- font-Awesome 4.4.0 -->\n <link rel=\"stylesheet\" href=\"$currentPath/include/libs/font-awesome-4.4.0/css/font-awesome.min.css\">\n <link href=\"http://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\" type=\"text/css\">\nSCRIPT;\n}",
"public function prepareHead() {\r\n // add jQuery\r\n if($this->cdn_jquery) {\r\n $this->addJS('//code.jquery.com/jquery-2.1.0.min.js', true);\r\n $this->addJS('//code.jquery.com/jquery-migrate-1.2.1.min.js', true);\r\n } else {\r\n $this->addJS(array('jquery-2.1.0.min', 'jquery-migrate-1.2.1.min'));\r\n }\r\n // add bootstrap\r\n if($this->cdn_bootstrap) {\r\n $this->addCSS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', true);\r\n $this->addJS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', true);\r\n } else {\r\n $this->addCSS('bootstrap.min');\r\n $this->addJS('bootstrap.min');\r\n }\r\n \r\n $this->addCSS(array('bootstrap-switch.min', 'spectrum'));\r\n $this->addJS(array('plugins'));\r\n \r\n // ace code editor\r\n $this->addJS('libs/ace/ace.js', true);\r\n \r\n $this->addCSS('style');\r\n $this->addJS('script');\r\n \r\n $this->smarty->assign(array(\r\n 'title' => $this->title,\r\n 'css_files' => $this->css_files,\r\n 'js_files' => $this->js_files,\r\n ));\r\n }",
"function templ_extend(){\r\n\t\t$modules_array = array();\r\n\t\t$modules_array = array('templatic-custom_taxonomy','templatic-custom_fields','templatic-registration','templatic-monetization','templatic-claim_ownership');\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_header_section.php' );\r\n\t\t?>\r\n <p class=\"tevolution_desc\"><?php echo __('Here are the most popular directory extensions to extend the functionality of your Business Directory site and make it more powerful. Please click the \"Details & Purchase\" button next to any of them to find out more about the functions they each offer.','templatic-admin');?></p>\r\n <?php\r\n\t\techo '\r\n\t\t<div id=\"tevolution_bundled\" class=\"metabox-holder wrapper widgets-holder-wrap\"><table cellspacing=\"0\" class=\"wp-list-tev-table postbox fixed pages \">\r\n\t\t\t<tbody style=\"background:white; padding:40px;\">\r\n\t\t\t<tr><td>\r\n\t\t\t';\r\n\t\t/* This is the correct way to loop over the directory. */\t\t\t\r\n\t\tdo_action('tevolution_extend_box');\r\n\t\t/* to get t plugins */\t\t\t\r\n\t\techo '</td></tr>\r\n\t\t</tbody></table>\r\n\t\t</div>\r\n\t\t';\r\n\t\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_footer_section.php' );\r\n\t}",
"function addHead()\n\t{\n\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser();\n\t\t$input = $app->input;\n\n\t\t$responsive = $this->getParam('responsive', 1);\n\t\t$navtype = $this->getParam('navigation_type', 'joomla');\n\t\t$navtrigger = $this->getParam('navigation_trigger', 'hover');\n\t\t$offcanvas = $this->getParam('navigation_collapse_offcanvas', 0) || $this->getParam('addon_offcanvas_enable', 0);\n\t\t$legacycss = $this->getParam('legacy_css', 0);\n\t\t$frontedit = in_array($input->getCmd('option'), array('com_media', 'com_config'))\t//com_media or com_config\n\t\t\t\t\t\t\t\t\t\t|| in_array($input->getCmd('layout'), array('edit'))\t\t\t\t\t\t\t\t//edit layout\n\t\t\t\t\t\t\t\t\t\t|| (version_compare(JVERSION, '3.2', 'ge') && $user->id && $app->get('frontediting', 1) && \n\t\t\t\t\t\t\t\t\t\t\t\t($user->authorise('core.edit', 'com_modules') || $user->authorise('core.edit', 'com_menus')));\t//frontediting\n\n\t\t// LEGACY COMPATIBLE\n\t\tif($legacycss){\n\t\t\t$this->addCss('legacy-grid');\t//legacy grid\n\t\t\t$this->addStyleSheet(T3_URL . '/fonts/font-awesome/css/font-awesome.css'); //font awesome 3\n\t\t}\n\n\t\t// FRONTEND EDITING\n\t\tif($frontedit){\n\t\t\t$this->addCss('frontend-edit');\n\t\t}\n\n\t\t// BOOTSTRAP CSS\n\t\t$this->addCss('bootstrap', false);\n\n\t\t// TEMPLATE CSS\n\t\t$this->addCss('template', false);\n\n\t\tif (!$responsive && $this->responcls) {\n\t\t\t$this->addCss('non-responsive'); //no responsive\n\n\t\t\t$nonrespwidth = $this->getParam('non_responsive_width', '970px');\n\t\t\tif(preg_match('/^(-?\\d*\\.?\\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/', $nonrespwidth, $match)){\n\t\t\t\t$nonrespwidth = $match[1] . (!empty($match[2]) ? $match[2] : 'px');\n\t\t\t}\n\t\t\t$this->addStyleDeclaration('.container {width: ' . $nonrespwidth . ' !important;}');\n\t\t\n\t\t} else if(!$this->responcls){\n\t\t\t\n\t\t\t// BOOTSTRAP RESPONSIVE CSS\n\t\t\t$this->addCss('bootstrap-responsive');\n\t\t\t\n\t\t\t// RESPONSIVE CSS\n\t\t\t$this->addCss('template-responsive');\n\t\t}\n\n\t\t// add core megamenu.css in plugin\n\t\t// deprecated - will extend the core style into template megamenu.less & megamenu-responsive.less\n\t\t// to use variable overridden in template\n\t\tif($navtype == 'megamenu'){\n\n\t\t\t// If the template does not overwrite megamenu.less & megamenu-responsive.less\n\t\t\t// We check and included predefined megamenu style in base\n\t\t\tif(!is_file(T3_TEMPLATE_PATH . '/less/megamenu.less')){\n\t\t\t\t$this->addStyleSheet(T3_URL . '/css/megamenu.css');\n\n\t\t\t\tif ($responsive && !$this->responcls){\n\t\t\t\t\t$this->addStyleSheet(T3_URL . '/css/megamenu-responsive.css');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// megamenu.css override in template\n\t\t\t$this->addCss('megamenu');\n\t\t}\n\n\t\t// Add scripts\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\n\t\t\tJHtml::_('jquery.framework');\n\t\t} else {\n\t\t\t$scripts = @$this->_scripts;\n\t\t\t$jqueryIncluded = 0;\n\t\t\tif (is_array($scripts) && count($scripts)) {\n\t\t\t\t//simple detect for jquery library. It will work for most of cases\n\t\t\t\t$pattern = '/(^|\\/)jquery([-_]*\\d+(\\.\\d+)+)?(\\.min)?\\.js/i';\n\t\t\t\tforeach ($scripts as $script => $opts) {\n\t\t\t\t\tif (preg_match($pattern, $script)) {\n\t\t\t\t\t\t$jqueryIncluded = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$jqueryIncluded) {\n\t\t\t\t$this->addScript(T3_URL . '/js/jquery-1.8.3' . ($this->getParam('devmode', 0) ? '' : '.min') . '.js');\n\t\t\t\t$this->addScript(T3_URL . '/js/jquery.noconflict.js');\n\t\t\t}\n\t\t}\n\n\t\tdefine('JQUERY_INCLUED', 1);\n\n\n\t\t// As joomla 3.0 bootstrap is buggy, we will not use it\n\t\t$this->addScript(T3_URL . '/bootstrap/js/bootstrap.js');\n\t\t// a jquery tap plugin\n\t\t$this->addScript(T3_URL . '/js/jquery.tap.min.js');\n\n\t\t// add css/js for off-canvas\n\t\tif ($offcanvas && ($this->responcls || $responsive)) {\n\t\t\t$this->addCss('off-canvas', false);\n\t\t\t$this->addScript(T3_URL . '/js/off-canvas.js');\n\t\t}\n\n\t\t$this->addScript(T3_URL . '/js/script.js');\n\n\t\t//menu control script\n\t\tif ($navtrigger == 'hover') {\n\t\t\t$this->addScript(T3_URL . '/js/menu.js');\n\t\t}\n\n\t\t//reponsive script\n\t\tif ($responsive && !$this->responcls) {\n\t\t\t$this->addScript(T3_URL . '/js/responsive.js');\n\t\t}\n\n\t\t//some helper javascript functions for frontend edit\n\t\tif($frontedit){\n\t\t\t$this->addScript(T3_URL . '/js/frontend-edit.js');\n\t\t}\n\n\t\t//check and add additional assets\n\t\t$this->addExtraAssets();\n\t}",
"private function add_rich_form_scripts() {\r\n\r\n\t$this->template->libs_js = array(\r\n\t \"http://code.jquery.com/jquery-1.8.2.js\",\r\n\t \"http://code.jquery.com/ui/1.9.1/jquery-ui.js\",\r\n\t \"jquery-ui-timepicker-addon.js\",\r\n\t \"http://cdn.aloha-editor.org/latest/lib/require.js\"\r\n\t);\r\n\t$this->template->libs_css = array(\r\n\t \"http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css\",\r\n\t \"datetimepicker.css\",\r\n\t \"http://cdn.aloha-editor.org/latest/css/aloha.css\"\r\n\t);\r\n }",
"function head()\r\n{\r\n\t\t?>\r\n\t\t<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />\r\n\t\t<meta name=\"generator\" content=\"Adobe GoLive\" />\r\n\t\t<!--<meta name=\"keywords\" content=\"engagement rings, loose diamonds, hatton garden, diamond rings, earrings, wedding rings, diamonds, diamond rings hatton garden\"/>-->\r\n\t\t<meta name=\"author\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"language\" content=\"EN\"/>\r\n\t\t<meta name=\"Classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"copyright\" content=\"www.marcpierrediamonds.co.uk\"/>\r\n\t\t<meta name=\"robots\" content=\"index, follow\"/>\r\n\t\t<meta name=\"revisit-after\" content=\"7 days\"/>\r\n\t\t<meta name=\"document-classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"document-type\" content=\"Public\"/>\r\n\t\t<meta name=\"document-rating\" content=\"Safe for Kids\"/>\r\n\t\t<meta name=\"document-distribution\" content=\"Global\"/>\r\n\t\t<meta name=\"robots\" content=\"noodp\" />\r\n\t\t<meta name=\"GOOGLEBOT\" content=\"NOODP\" />\r\n\t\t<!--[if IE 6]>\r\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo DIR_WS_SITE?>css/iecss.css\" />\r\n\t\t<![endif]-->\r\n\t\t<!--[if lt IE 7.]>\r\n\t\t\t<script defer type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>javascript/pngfix.js\"></script>\r\n\t\t<![endif]-->\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>js/boxOver.js\"></script>\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>control/js/jquery-1.2.6.min.js\"></script>\r\n\t\t<link href=\"<?=DIR_WS_SITE_CSS?>style.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\">\r\n\t\t<?\r\n\t\t\r\n\t\t\r\n\t\t\r\n}",
"public function includeLibs()\n {\n $string = '';\n\n if($this->css_files)\n {\n foreach( $this->css_files as &$css_file )\n {\n $string .= '<link rel=\"stylesheet\" href=\"' . $css_file . '\" type=\"text/css\" />';\n }\n }\n \n if($this->js_files)\n {\n foreach( $this->js_files as &$js_file )\n {\n $string .= PHP_EOL . '<script src=\"' . $js_file . '\" type=\"text/javascript\"></script>';\n }\n }\n $this->tpl->assign(\"libs\", $string . PHP_EOL);\n }",
"function getHTML_additionalHeaderData() {\n\t\t\t// get js configs\n\t\t\t// get topical element and overwrite startID in appConf['js.']['config.']\n\t\tif ($this->appConf['topicAtStart']) {\n\t\t\t$this->appConf['js.']['config.']['startIndex'] = $this->appConf['topicId'];\n\t\t}\n\t\t\t// only boolean and integers allowed, strings ar not supported\n\t\tif (is_array($this->appConf['js.']['config.'])) {\n\t\t\t$configArray = array();\n\t\t\tforeach ($this->appConf['js.']['config.'] as $key => $val) {\n\t\t\t\t$configArray[] = trim($key) . ': ' . trim($val);\n\t\t\t}\n\t\t\t$config = implode(', ',$configArray);\n\t\t}\n\t\t\t// additional headers as css & js\n\t\t$GLOBALS['TSFE']->additionalHeaderData['contentcoverflow'] .= '\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['core.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['more.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['mod.']['file'] . '\"></script>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->appConf['css.']['file'] . '\" />\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t/* <![CDATA[ */\n\t\t\t\tvar myMooFlowPage = {\n\t\t\t\t\tstart: function(){\n\t\t\t\t\t\tvar mf = new MooFlow($(\\'MooFlow\\'), {\n\t\t\t\t\t\t\t' . $config . ',\n\t\t\t\t\t\t\t\\'onClickView\\': function(obj){\n\t\t\t\t\t\t\t\tmyMooFlowPage.link(obj);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\\'onStart\\': function(){\n\t\t\t\t\t\t\t\tthis.autoPlay = this.auto.periodical(this.options.interval, this);\n\t\t\t\t\t\t\t\tthis.isAutoPlay = true;\n\t\t\t\t\t\t\t\tthis.fireEvent(\\'autoPlay\\');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\n\t\t\t\t\tlink: function(result){\n\t\t\t\t\t\tif (result.target == \"_blank\") {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twindow.addEvent(\\'domready\\', myMooFlowPage.start);\n\n\t\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t';\n\t}",
"function okr_add_head_component(){\n render_js_variables();\n $CI = &get_instance();\n $viewuri = $_SERVER['REQUEST_URI'];\n if(!(strpos($viewuri,'admin/okr') === false)){\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/okr.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n }\n\n if(!(strpos($viewuri,'admin/okr/okrs') === false) || !(strpos($viewuri,'admin/okr/checkin') === false) || !(strpos($viewuri,'admin/okr/checkin_detailt') === false) || !(strpos($viewuri,'/admin/okr/show_detail_node' ) === false)){\n\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/dist/themes/default/style.min.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/dist/css/jquery.treegrid.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/okrs_display.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/Chart/CSS/jHTree.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/Chart/Themes/lightness/jquery-ui-1.10.4.custom.min.css') . '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/rate.min.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/OrgChart-master/jquery.orgchart.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/jquery.lineProgressbar.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n\n }\n if (!(strpos($viewuri,'/admin/okr/checkin_detailt') === false) || !(strpos($viewuri,'/admin/okr/view_details') === false) || !(strpos($viewuri,'/admin/okr/show_detail_node' ) === false)) {\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/highcharts.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/check_in_detailt.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/plugin/jquery.lineProgressbar.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n\n }\n if (!(strpos($viewuri,'/admin/okr/dashboard') === false)) {\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/highcharts.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n }\n\n if (!(strpos($viewuri,'/admin/okr/checkin_detailt') === false)) {\n echo '<link href=\"' . module_dir_url(OKR_MODULE_NAME, 'assets/css/overide.css') . '?v=' . VERSION_OKR. '\" rel=\"stylesheet\" type=\"text/css\" />';\n }\n}",
"function addlinks(){\n Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\n\t}",
"function html_head_from_all_pagest()\r\n{\r\n $ht_head = '\r\n <!DOCTYPE html>\r\n <html lang=\"en\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <title>Кредитный калькулятор</title>\r\n <link rel=\"stylesheet\" href=\"css/style.css\">\r\n <script src=\"http://code.jquery.com/jquery-1.7.1.min.js\"></script>\r\n <script src=\"js/script.js\"></script> \r\n <style>\r\n body{\r\n font-family: \"Segoe UI Light\";\r\n }\r\n #tr{\r\n \r\n font-size: x-large;\r\n }\r\n \r\n span {\r\n font-weight: 700;\r\n font-size: large;\r\n }\r\n </style> \r\n </head>';\r\n echo $ht_head;\r\n}",
"function getHeadTags($title=''){\n\tglobal $projectLabel;\n\treturn '\n\t\t<meta name=\"description\" content=\"This is a generic project that can be used as a starting point for all future projects\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\t\t<title>'.$projectLabel.' | '.$title .'</title>'.\"\\n\"\n .getJs()\n\t\t.getCss();\n}",
"function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}",
"function educoAdminPrepareHead() {\n global $langs, $conf;\n\n $langs->load(\"educo@educo\");\n\n $h = 0;\n $head = array();\n\n $head[$h][0] = dol_buildpath(\"/educo/admin/setup.php\", 1);\n $head[$h][1] = $langs->trans(\"Settings\");\n $head[$h][2] = 'settings';\n $h++;\n $head[$h][0] = dol_buildpath(\"/educo/admin/about.php\", 1);\n $head[$h][1] = $langs->trans(\"About\");\n $head[$h][2] = 'about';\n $h++;\n\n // Show more tabs from modules\n // Entries must be declared in modules descriptor with line\n //$tabs = array(\n //\t'entity:+tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to add new tab\n //$tabs = array(\n //\t'entity:-tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to remove a tab\n complete_head_from_modules($conf, $langs, $object, $head, $h, 'educo');\n\n return $head;\n}",
"function head() { /*{{{*/\n\techo \"\n<HTML><HEAD>\n<META http-equiv=Content-Type content='text/html; charset=utf-8' />\n<title>admin</title>\n</HEAD>\n<link rel='stylesheet' type='text/css' href='css/css.css'>\n<link rel='stylesheet' type='text/css' href='css/datepicker.css' />\n<script type='text/javascript' src='js/jquery.js'></script>\n<script type='text/javascript' src='js/taffy-min.js'></script>\n<script type='text/javascript' src='js/moment.min.js'></script>\n<script type='text/javascript' src='js/datepicker.js'></script>\n<script type='text/javascript' src='js/script.js'></script>\n\";\n}",
"public function themeHeader($end) {\n $domain = $this->getSiteURL();\n \n // front-end only\n if ($end == 'front') {\n // url base\n echo \"\\n\".'<base href=\"'.$this->getSiteURL().'\">';\n }\n echo \"\\n\".'<!-- The Matrix '.self::VERSION.'-->'.\"\\n\";\n // css\n echo ' <!--css-->'.\"\\n\";\n foreach (glob(GSPLUGINPATH.self::FILE.'/css/*.css') as $css) {\n echo ' <link rel=\"stylesheet\" href=\"'.str_replace(GSROOTPATH, $domain, $css).'\"/>'.\"\\n\";\n }\n echo ' <!--/css-->'.\"\\n\";\n \n // js\n echo ' <!--js-->'.\"\\n\";\n $javascript = glob(GSPLUGINPATH.self::FILE.'/js/*.js');\n natsort($javascript);\n \n foreach ($javascript as $js) {\n echo ' <script src=\"'.str_replace(GSROOTPATH, $domain, $js).'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n echo ' <!--/js-->'.\"\\n\";\n echo '<!--/The Matrix '.self::VERSION.'-->'.\"\\n\";\n }",
"function links_insert_head_css($flux) {\r\n\t$links = links_configuration();\r\n\r\n\t//Styles\r\n\tif($links['style'] == 'on'){\r\n\t\t$flux .= '<link rel=\"stylesheet\" href=\"'.find_in_path('css/links.css').'\" type=\"text/css\" media=\"all\" />';\r\n\t}\r\n\t//Ouverture d'une nouvelle fenetre : insertion des init js inline, en amont des CSS (perf issue)\r\n\tif($links['window'] == 'on'){\r\n\t\t$js = 'var js_nouvelle_fenetre=\\''._T('links:js_nouvelle_fenetre').'\\';';\r\n\t\t//Ouverture dune nouvelel fenetre sur les liens externes\r\n\t\tif($links['external'] == 'on'){\r\n\t\t\t// quand un site fait du multidomaine on prend en reference le domaine de la page concernee :\r\n\t\t\t// sur www.example.org : autre.example.org est external\r\n\t\t\t// sur autre.example.org : www.example.org est external\r\n\t\t\t// sur un site mono-domaine ca ne change rien :)\r\n\t\t\t// ca marche parce que le cache change quand le HTTP_HOST change (donc quand le domaine change)\r\n\t\t\t$js .= 'var links_site = \\'' . protocole_implicite(url_de_base()) . '\\';';\r\n\t\t}\r\n\t\t//Ouverture d'une nouvelle fenetre sur les documents (extensions a preciser)\r\n\t\tif(($links['download'] == 'on')&&($links['doc_list'])){\r\n\t\t\t$js .= 'var links_doc = \\''.$links['doc_list'].'\\';';\r\n\t\t}\r\n\t\t$flux = '<script type=\"text/javascript\">'.$js.'</script>' . \"\\n\" . $flux;\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"public function admin_head()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $head_content = $this->standard_head(true).\"\\n\"; // We start with the standard stuff.\n \n $head_content .= \"<!-- Also Added by the BMLT plugin 3.X. -->\\n<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=EmulateIE7\\\" />\\n<meta http-equiv=\\\"Content-Style-Type\\\" content=\\\"text/css\\\" />\\n<meta http-equiv=\\\"Content-Script-Type\\\" content=\\\"text/javascript\\\" />\\n\";\n $options = $this->getBMLTOptions(1); // All options contain the admin key.\n $key = $options['google_api_key'];\n \n // Include the Google Maps API V3 files.\n $head_content .= '<script type=\"text/javascript\" src=\"https://maps.google.com/maps/api/js?key='.$key.'\"></script>'; // Load the Google Maps stuff for our map.\n \n if (function_exists('plugins_url')) {\n $head_content .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"';\n \n $url = $this->get_plugin_path();\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_styles.css\" />';\n \n $head_content .= '<script type=\"text/javascript\" src=\"';\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_javascript.js\"></script>';\n } else {\n echo \"<!-- BMLTPlugin ERROR (head)! No plugins_url()! -->\";\n }\n \n $head_content .= \"\\n<!-- End Also Added by the BMLT plugin 3.X. -->\\n\";\n echo $head_content;\n }",
"function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}",
"public function head()\n {\n return <<<HTML\n<title>$this->title</title>\n<!-- Meta Tags -->\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"keywords\" content=\"josh benner, developer, javascript, api, web app, designer, linkedin scraper\">\n<meta name=\"author\" content=\"Josh Benner\">\n<meta name=\"description\" content=\"Web Apps, personal projects, and lots of data; The professional website of Josh Benner\">\n\n<!-- DOWNLOAD AND HOST BOOTSTRAP LOCALLY-->\n<!-- Stylesheets -->\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\"></script>\n<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js\"></script>\n<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">\n<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../lib/css/normalize.css\">\n<link rel=\"stylesheet\" href=\"../lib/css/main.css\">\nHTML;\n }",
"function beerfamily_html_head_alter(&$head_elements) {\n \n // текущий url \n $current_uri = $_SERVER['REDIRECT_URL'];\n \n // цикл по meta-tags\n foreach ($head_elements as $key => $element) {\n\n \t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n\n\t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n }\n\n // получаем тип ноды\t \n $node = menu_get_object();\n $node->type;\n\n // если нода не news то не индексируем сущность\n if ( ($current_uri != \"/news\") && ($node->type != \"news\") ) {\n\t \n\t $head_elements[1000][\"#tag\"] = 'link';\n\t $head_elements[1000]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1000]['#attributes']['hreflang'] = 'ru';\n\t $head_elements[1000]['#attributes']['href'] = 'http://beerfamily.ru'.$current_uri;\n\t $head_elements[1000]['#type'] = 'html_tag';\n\n\t $head_elements[1001][\"#tag\"] = 'link';\n\t $head_elements[1001]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1001]['#attributes']['hreflang'] = 'en-us';\n\t $head_elements[1001]['#attributes']['href'] = 'http://beerfamily.ru/en'.$current_uri;\n\t $head_elements[1001]['#type'] = 'html_tag';\n\n\t $head_elements[1002][\"#tag\"] = 'link';\n\t $head_elements[1002]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1002]['#attributes']['hreflang'] = 'zh-cn';\n\t $head_elements[1002]['#attributes']['href'] = 'http://beerfamily.ru/cn'.$current_uri;\n\t $head_elements[1002]['#type'] = 'html_tag';\n\n }\n\n // получаем текущий язык\n if (strpos($current_uri,'en/') != \"\") $lang = 'en';\n if (strpos($current_uri,'cn/') != \"\") $lang = 'cn';\n \n // если нода news и язык en или cn то не индексируем сущность\n if ( ($node->type == \"news\") && ( ($lang == 'en') || ($lang == 'cn') )) {\n\t \n\t $head_elements[1003][\"#tag\"] = 'meta';\n\t $head_elements[1003]['#attributes']['name'] = 'robots';\n\t $head_elements[1003]['#attributes']['content'] = 'nofollow';\n\t $head_elements[1003]['#type'] = 'html_tag'; \n \n }\n \n // переопределяем description\n\n // если нода beers и язык не en и не cn пишем description для страницы Пива\n \n if ( ($node->type == \"beer\") && ( $lang != 'en') && ($lang != 'cn') ){\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить пиво '.$node->title.' оптом и в розницу. Описание, крепость, плотность пива.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n }\n \n switch ($current_uri) {\n case '':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'Официальный сайт ресторанной группы Beer Family Project холдинга ReCa в Санкт-Петербурге. История и описание компании.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n\t break;\n\t \n case '/restaurants':\t \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Список пивных ресторанов и баров в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/jager-haus':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть немецких пивных ресторанов Jager в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/karlovy-pivovary':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть чешских пивных ресторанов Karlovy Pivovary в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/kriek':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть бельгийских пивных ресторанов Kriek в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\n\tcase '/restaurants/ivandamaria':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть гастробаров Иван да Марья в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание ресторана русской кухни, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t\n\tcase '/restaurants/beer-family-restaurant':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family на Невском проспекте Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторана на карте.';\n\t break;\n\t \n\tcase '/about':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'История компании Beer Family Project';\n\t break;\n \n\tcase '/beers':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить импортное пиво оптом. Большой ассортимент пива разных сортов! Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/distribution':\n\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Дистрибуция пива в Санкт-Петербурге. Компании-дистрибьюторы пива';\n\t break;\n\n\tcase '/franchise':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Хотите открыть пивной ресторан или пивной бар по франшизе? Станьте новым членом нашей дружной семьи Beer Family Project с франшизой наших концептов! ';\n\t break;\n\n case '/restaurants':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family Project: Kriek, Karlovy Pivovary, Jager, Иван да Марья';\n\t break;\n\n case '/news':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Новости компании Beer Family Project';\n\t break;\n\n case '/jobs':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Вакансии компании Beer Family Project. ';\n\t break;\n\n case '/partners':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Партнеры компании Beer Family Project. ';\n\t break;\n \n\tcase '/beers/chehiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее чешское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n \n case '/beers/irlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее ирландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/beers/angliya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее английское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/shotlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее шотландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/germaniya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее немецкое пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/belgiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее бельгийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/kraftovoe-pivo': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить бутылочное и разливное крафтовое пиво. Звоните! ☎️ 8 (812) 337-58-95 ';\n\t break;\n\t\n\tcase '/beers/cidry': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящий сидр оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/avstriya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее австрийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/italiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее итальянское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t \n }\n \n // добавляем meta для постраничных\n if ($_GET['page'] >= 1){\n\t if ( ( $lang != 'en') && ($lang != 'cn') ){\n\t\t $head_elements[1005][\"#tag\"] = 'meta';\n\t\t $head_elements[1005]['#attributes']['name'] = 'robots';\n\t\t $head_elements[1005]['#type'] = 'html_tag'; \n\t\t $head_elements[1005]['#attributes']['content'] = 'noindex, follow';\n\t }\n }\n \n}",
"public function getHeadJavascript()\n\t{\n\n $url = Config::$url;\n $googleAnalyticsToken = Config::$googleAnalyticsToken;\n\n\t\treturn<<<js\n<script type=\"text/javascript\" data-comment=\"Google Analytics\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '$googleAnalyticsToken']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n</script>\n\n<!-- package-javascript\nAll external javascript file, including the minified SNAP javascript,\nare listed here and in the project makefile to be bundled into a single\njavascript file. The 'package-javascript' and 'end-package' tokens\nare used to determine the region to be replaced with a single script inclusion.\n\nIf you add a file here, you must add it to the makefile for packaging. See the README in the js/ directory.\n-->\n<script src=\"js/underscore-min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery-1.8.2.min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.blockUI.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.hoverIntent.minified.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.cycle.all.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.url.js\" type=\"text/javascript\"></script>\n<script src=\"js/plugins.js\" type=\"text/javascript\"></script>\n<script src=\"js/highcharts.js\" type=\"text/javascript\"></script>\n<script src=\"js/exporting.src.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery-ui-1.8.24.custom.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-hashchange.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.validate.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-bbq.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.scrollTo-min.js\" type=\"text/javascript\"></script>\n\n<script src=\"js/licenseModal.js\" type=\"text/javascript\"></script>\n<script src=\"js/charts.js\" type=\"text/javascript\"></script>\n<script src=\"js/maps.js\" type=\"text/javascript\"></script>\n<!-- end-package -->\n\n<script type=\"text/javascript\">\n\n// Interpolate server-side configs as appropriate\nwindow.snapConfig = {\n url: '$url',\n geonetworkMetadataUrl: 'http://athena.snap.uaf.edu:8080/geonetwork/srv/en/metadata.show.embedded?id=',\n dataPath: '/data/'\n}\n</script>\n\njs;\n\t}",
"function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}",
"public function slate_head(){\n\t\t$output = '';\n\t\t$output .= '<meta name=\"HandheldFriendly\" content=\"True\">';\n\t\t$output .= '<meta name=\"MobileOptimized\" content=\"320\">';\n\t\t$output .= '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1\"/>';\n\n\t\t$output .= '<link rel=\"pingback\" href=\"' . get_bloginfo( 'pingback_url' ) . '\" >';\n\t\t$output .= '<meta property=\"og:title\" content=\"' . get_the_title() . '\"/>';\n\t\t$output .= '<meta property=\"og:image\" content=\"change this path\"/>';\n\t\t$output .= '<meta property=\"og:site_name\" content=\"' . get_bloginfo('name') . '\"/>';\n\t\t$output .= '<meta property=\"og:description\" content=\"' . get_bloginfo('description') . '\"/>';\n\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-57x57.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"60x60\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-60x60.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-72x72.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-76x76.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-114x114.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-120x120.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"144x144\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-144x144.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-152x152.png\">';\n\t\t$output .= '<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"' . get_template_directory_uri() . '/library/favicons/apple-touch-icon-180x180.png\">';\n\t\t$output .= '<link rel=\"icon\" type=\"image/png\" href=\"' . get_template_directory_uri() . '/library/favicons/favicon-32x32.png\" sizes=\"32x32\">';\n\t\t$output .= '<link rel=\"icon\" type=\"image/png\" href=\"' . get_template_directory_uri() . '/library/favicons/favicon-194x194.png\" sizes=\"194x194\">';\n\t\t$output .= '<link rel=\"icon\" type=\"image/png\" href=\"' . get_template_directory_uri() . '/library/favicons/favicon-96x96.png\" sizes=\"96x96\">';\n\t\t$output .= '<link rel=\"icon\" type=\"image/png\" href=\"' . get_template_directory_uri() . '/library/favicons/android-chrome-192x192.png\" sizes=\"192x192\">';\n\t\t$output .= '<link rel=\"icon\" type=\"image/png\" href=\"' . get_template_directory_uri() . '/library/favicons/favicon-16x16.png\" sizes=\"16x16\">';\n\t\t$output .= '<link rel=\"manifest\" href=\"' . get_template_directory_uri() . '/library/favicons/manifest.json\">';\n\t\t$output .= '<link rel=\"mask-icon\" href=\"' . get_template_directory_uri() . '/library/favicons/safari-pinned-tab.svg\" color=\"#000000\">';\n\t\t$output .= '<link rel=\"shortcut icon\" href=\"' . get_template_directory_uri() . '/library/favicons/favicon.ico\">';\n\t\t$output .= '<meta name=\"apple-mobile-web-app-title\" content=\"Big Ass Solutions\">';\n\t\t$output .= '<meta name=\"application-name\" content=\"Big Ass Solutions\">';\n\t\t$output .= '<meta name=\"msapplication-TileColor\" content=\"#da532c\">';\n\t\t$output .= '<meta name=\"msapplication-TileImage\" content=\"' . get_template_directory_uri() . '/library/favicons/mstile-144x144.png\">';\n\t\t$output .= '<meta name=\"msapplication-config\" content=\"' . get_template_directory_uri() . '/library/favicons/browserconfig.xml\">';\n\t\t$output .= '<meta name=\"theme-color\" content=\"#ffffff\">';\n\n\t\techo $output;\n\t}",
"function int_add_head_component() {\n\t$CI = &get_instance();\n\n\t$viewuri = $_SERVER['REQUEST_URI'];\n\n\tif (!(strpos($viewuri, '/admin/team_password/add_normal') === false) || !(strpos($viewuri, '/admin/team_password/add_bank_acount') === false) || !(strpos($viewuri, '/admin/team_password/add_credit_card') === false) || !(strpos($viewuri, '/admin/team_password/add_server') === false) || !(strpos($viewuri, '/admin/team_password/add_email') === false) || !(strpos($viewuri, '/admin/team_password/add_software_license') === false)) {\n\t\techo '<link href=\"' . module_dir_url(TEAM_PASSWORD_MODULE_NAME, 'assets/css/custom.css') . '?v=' . TEAM_PASSWORD_REVISION . '\" rel=\"stylesheet\" type=\"text/css\" />';\n\t}\n\n\tif (!(strpos($viewuri, '/admin/team_password/dashboard') === false)) {\n\t\techo '<link href=\"' . module_dir_url(TEAM_PASSWORD_MODULE_NAME, 'assets/css/dashboard.css') . '?v=' . TEAM_PASSWORD_REVISION . '\" rel=\"stylesheet\" type=\"text/css\" />';\n\t}\n\n\tif (!(strpos($viewuri, '/admin/team_password/view_normal') === false) || !(strpos($viewuri, '/admin/team_password/view_bank_account') === false) || !(strpos($viewuri, '/admin/team_password/view_credit_card') === false) || !(strpos($viewuri, '/admin/team_password/view_server') === false) || !(strpos($viewuri, '/admin/team_password/view_email') === false) || !(strpos($viewuri, '/admin/team_password/view_software_license') === false)) {\n\n\t\techo '<link href=\"' . module_dir_url(TEAM_PASSWORD_MODULE_NAME, 'assets/css/view_password.css') . '?v=' . TEAM_PASSWORD_REVISION . '\" rel=\"stylesheet\" type=\"text/css\" />';\n\t}\n}",
"function DS_Custom_Modules(){\n if(class_exists(\"ET_Builder_Module\")){\n \t// This adds options for more contact types and, with some clever css, a more flexible usage.\n\tinclude(\"ehanhanced_divi_modules/extended_person_module.php\");\n\n\t// This creates a hybrid blurb/cta. CTA's should have the option for images and more than one button. Sheesh!\n\tinclude(\"ehanhanced_divi_modules/extended_cta.php\");\n }\n}",
"public function render()\n {\n foreach ($this->controls as $uniqueID => $ctrl)\n {\n foreach ($ctrl->getEvents() as $eid => $event)\n {\n if ($event === false) $this->addJS([], '$pom.get(\\'' . $uniqueID . '\\').unbind(\\'' . $eid . '\\')', false);\n else $this->addJS([], '$pom.get(\\'' . $uniqueID . '\\').bind(\\'' . $eid . '\\', \\'' . $event['type'] . '\\', ' . $event['callback'] . (empty($event['options']['check']) ? ', false' : ', ' . $event['options']['check']) . (empty($event['options']['toContainer']) ? ', false' : ', true') . ')', false);\n }\n }\n $sort = function($a, $b){return $a['order'] - $b['order'];};\n uasort($this->css, $sort);\n uasort($this->js['top'], $sort);\n uasort($this->js['bottom'], $sort);\n $head = '<title' . $this->renderAttributes($this->title['attributes']) . '>' . htmlspecialchars($this->title['title']) . '</title>';\n foreach ($this->meta as $meta) $head .= '<meta' . $this->renderAttributes($meta) . ' />';\n foreach ($this->css as $css) \n {\n $conditions = '';\n if (isset($css['attributes']['conditions']))\n {\n $conditions = $css['attributes']['conditions'];\n unset($css['attributes']['conditions']);\n $head .= '<!--[' . $conditions . ']>';\n }\n if (empty($css['attributes']['type'])) $css['attributes']['type'] = 'text/css';\n if (isset($css['attributes']['href']) && empty($css['attributes']['rel'])) $css['attributes']['rel'] = 'stylesheet';\n if (isset($css['attributes']['href'])) $head .= '<link' . $this->renderAttributes($css['attributes']) . ' />';\n else $head .= '<style' . $this->renderAttributes($css['attributes']) . '>' . $css['style'] . '</style>';\n if ($conditions) $head .= '<![endif]-->';\n }\n foreach ($this->js['top'] as $js)\n {\n $conditions = '';\n if (isset($js['attributes']['conditions']))\n {\n $conditions = $js['attributes']['conditions'];\n unset($js['attributes']['conditions']);\n $head .= '<!--[' . $conditions . ']>';\n }\n if (empty($js['attributes']['type'])) $js['attributes']['type'] = 'text/javascript';\n $head .= '<script' . $this->renderAttributes($js['attributes']) . '>' . $js['script'] . '</script>';\n if ($conditions) $head .= '<![endif]-->';\n }\n if (count($this->js['bottom']))\n {\n $bottom = '';\n foreach ($this->js['bottom'] as $js) $bottom .= rtrim($js['script'], ';') . ';';\n if (strlen($bottom)) $head .= '<script type=\"text/javascript\">$(function(){' . $bottom . '});</script>';\n }\n $this->tpl->__head_entities = $head;\n if (false !== $body = $this->get($this->UID)) $this->tpl->{$this->UID} = $body->render();\n $html = $this->tpl->render();\n $this->commit();\n $this->push();\n return $this->dtd . $html;\n }",
"public function getCssJsHtml()\n {\n $lines = array();\n foreach ($this->_data['items'] as $item) {\n if (!is_null($item['cond']) && !$this->getData($item['cond']) || !isset($item['name'])) {\n continue;\n }\n $if = !empty($item['if']) ? $item['if'] : '';\n $params = !empty($item['params']) ? $item['params'] : '';\n switch ($item['type']) {\n case 'js': // js/*.js\n case 'skin_js': // skin/*/*.js\n case 'js_css': // js/*.css\n case 'skin_css': // skin/*/*.css\n $lines[$if][$item['type']][$params][$item['name']] = $item['name'];\n break;\n default:\n $this->_separateOtherHtmlHeadElements($lines, $if, $item['type'], $params, $item['name'], $item);\n break;\n }\n }\n\n // prepare HTML\n $shouldMergeJs = Mage::getStoreConfigFlag('dev/js/merge_files');\n $shouldMergeCss = Mage::getStoreConfigFlag('dev/css/merge_css_files');\n\n $html = '';\n foreach ($lines as $if => $items) {\n if (empty($items)) {\n continue;\n }\n if (!empty($if)) {\n // open !IE conditional using raw value\n if (strpos($if, \"><!-->\") !== false) {\n $html .= $if . \"\\n\";\n } else {\n $html .= '<!--[if '.$if.']>' . \"\\n\";\n }\n }\n\n if(Mage::getStoreConfigFlag('stylecss/critical_path/enable') && Mage::getStoreConfigFlag('dev/css/merge_css_files') && !Mage::app()->getStore()->isAdmin() && !empty($items['skin_css'])) {\n // after CriticalPathCSS\n $html .= $this->_prepareStaticAndSkinElements(\"<script>var cb = function() {\n var l = document.createElement('link'); l.rel = 'stylesheet';\n l.href = '%s';\n var h = document.getElementsByTagName('head')[0];\n var s = document.getElementById('custom-styles');\n if(s) {h.insertBefore(l, s);} else {h.appendChild(l, h);}\n };\n var raf = requestAnimationFrame || mozRequestAnimationFrame ||\n webkitRequestAnimationFrame || msRequestAnimationFrame;\n if (raf) raf(cb);\n else window.addEventListener('load', cb);</script>\".\"\\n\",\n empty($items['js_css']) ? array() : $items['js_css'],\n empty($items['skin_css']) ? array() : $items['skin_css'],\n $shouldMergeCss ? array(Mage::getDesign(), 'getMergedCssUrl') : null\n );\n } else {\n // static and skin css\n $html .= $this->_prepareStaticAndSkinElements('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\"%s />'.\"\\n\",\n empty($items['js_css']) ? array() : $items['js_css'],\n empty($items['skin_css']) ? array() : $items['skin_css'],\n $shouldMergeCss ? array(Mage::getDesign(), 'getMergedCssUrl') : null\n ); \n }\n\n // static and skin javascripts\n $html .= $this->_prepareStaticAndSkinElements('<script type=\"text/javascript\" src=\"%s\"%s></script>' . \"\\n\",\n empty($items['js']) ? array() : $items['js'],\n empty($items['skin_js']) ? array() : $items['skin_js'],\n $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null\n );\n\n // other stuff\n if (!empty($items['other'])) {\n $html .= $this->_prepareOtherHtmlHeadElements($items['other']) . \"\\n\";\n }\n\n if (!empty($if)) {\n // close !IE conditional comments correctly\n if (strpos($if, \"><!-->\") !== false) {\n $html .= '<!--<![endif]-->' . \"\\n\";\n } else {\n $html .= '<![endif]-->' . \"\\n\";\n }\n }\n }\n return $html;\n }"
]
| [
"0.65041566",
"0.63861233",
"0.63532317",
"0.63205826",
"0.6289136",
"0.626311",
"0.6224272",
"0.6216721",
"0.62098813",
"0.61856943",
"0.6180138",
"0.617964",
"0.61727595",
"0.6143129",
"0.610814",
"0.6062575",
"0.603623",
"0.6031179",
"0.5999173",
"0.59975046",
"0.59922177",
"0.5989372",
"0.59790206",
"0.5974471",
"0.59694064",
"0.5962817",
"0.5955541",
"0.59473616",
"0.5932188",
"0.5928982"
]
| 0.7352971 | 0 |
Description: This function Obtain all name files into of a directory where $type is the extension of the file Example: $array = obtainFiles('/var/www/html/modules/calendar/themes/default/js/','js'); Developer: Eduardo Cueva email: | private function obtainFiles($dir,$type){
$files = glob($dir."/{*.$type}",GLOB_BRACE);
$names ="";
foreach ($files as $ima)
$names[]=array_pop(explode("/",$ima));
if(!$names) return false;
return $names;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_all_files($some_folder,$type){\n $rs = [];\n if ($handle = opendir($some_folder)) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n $pathinfo = pathinfo($entry);\n if(!empty($pathinfo['extension'])){\n if($pathinfo['extension']==$type){\n $rs[]=$some_folder.\"/\".$entry;\n }\n }\n }\n }\n \n closedir($handle);\n }\n \n return $rs;\n }",
"public static function getAllResources($type){\n\t\t$template = themesDB::getThemeName();\n\t\t$folder = TEMPLATES_PATH.$template.'/'.$type.'/';\n\t\t$typePom = explode('_',$type);\n\t\t$files = baseFile::getFilesList($folder,$typePom[0]);\t\n\t\t$finalArr = array();\n\t\tforeach ($files as $file){\n\t\t\tif (preg_match('/main.css/', $file->path) or preg_match('/main.js/', $file->path) or preg_match('/less.css/', $file->path)) {\n\t\t\t\t$main[] = $file->path;\n\t\t\t}else{\n\t\t\t\t$finalArr[] = $file->path;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (is_array($main) and is_array($finalArr)) {\n\t\t\t$finalArr = array_merge($finalArr,$main);\n\t\t}elseif (is_array($main)){\n\t\t\t$finalArr = $main;\n\t\t}\n\n\t\treturn $finalArr;\n\t}",
"function DNUI_get_all_dir_or_files($dir, $type) {\r\n if ($type == 0) {\r\n return DNUI_get_dirs(array($dir));\r\n } else if ($type == 1) {\r\n $out = array();\r\n $arrayDirOrFile = DNUI_scan_dir($dir);\r\n foreach ($arrayDirOrFile as $key => $value) {\r\n if (!is_dir($filename)) {\r\n array_push($out, $filename);\r\n }\r\n }\r\n return $out;\r\n }\r\n return array();\r\n}",
"private function extractFiles($type){\n $n = preg_match_all(sprintf('/\"([^\"]+?\\.%s)\"/', $type), $this->pageContent, $matches);\n if ($n !== FALSE && $n > 0) {\n foreach($matches[1] as $fl){\n if(!preg_match(\"#(http://)#i\", $fl)){\n $fl = $this->basePath.$fl;\n if(!file_exists($fl)){\n throw new FileNotExistException(sprintf(\"file %s\", $fl));\n }\n }\n $this->files[$type][] = FileFactory::make($fl, $type);\n }\n }\n }",
"protected function getResourceFilesRecurrent($type, $folder = '') {\r\n\t\t$files = array();\r\n\t\tif($folder == '') {\r\n\t\t\t$folder = \\simtpl\\application::getRootPath() . \"/resources/{$type}/controls\";\r\n\t\t}\r\n\t\t$files_in_folder = glob($folder . \"/*\");\r\n\t\tforeach($files_in_folder as $file_path) {\r\n\t\t\tif(is_dir($file_path)) {\r\n\t\t\t\t$files = array_merge($files, $this->getResourceFilesRecurrent($type, rtrim($file_path, \"\\\\/ \")));\r\n\t\t\t} elseif(preg_match(\"/^.+\\.{$type}$/i\", $file_path)) {\r\n\t\t\t\t$files[] = $file_path;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $files;\r\n\t}",
"public function getFiles ();",
"public function getFiles();",
"public function getFiles();",
"public function getFiles();",
"function getFiles($dir)\r\n{\r\n\tglobal $types, $debug, $globalGetFiles;\r\n\tif ( !isset($globalGetFiles[$dir]) )\r\n\t{\r\n\t\t$dir = cleanPath($dir);\r\n\t\t$files = array();\r\n\t\t$list = array();\r\n\t\t\r\n\t\t// Loop through each of the files in this directory\r\n\t\t$files = glob($dir.'/*');\r\n\t\tforeach ( $files as $file )\r\n\t\t{\r\n\t\t\tif ( !empty($debug) && empty($log) )\r\n\t\t\t{\r\n\t\t\t\t$log = \"getFiles(\".$dir.\")\\n----------\\n\";\r\n\t\t\t}\r\n\t\t\t// Check each file against the list of types in config.php\r\n\t\t\tforeach ( $types as $type )\r\n\t\t\t{\r\n\t\t\t\t// Lower case the file extension to be sure\r\n\t\t\t\tif ( substr(strtolower($file),-3) == $type )\r\n\t\t\t\t{\r\n\t\t\t\t\t$list[] = $file;\r\n\t\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$log .= \"list[] = \".$file.\"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tunset($files);\r\n\t\t// Alphabetize files in case insensitive order\r\n\t\tnatcasesort($list);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"\\n\";\r\n\t\t\tdebugLog($log);\r\n\t\t}\r\n\t\t$globalGetFiles[$dir] = $list;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$list = $globalGetFiles[$dir];\r\n\t}\r\n\treturn $list;\r\n}",
"function read_dir($path,$type) {\n\t $dir_array=array();\n $handle = opendir($path);\n\n $array_indx = 0;\n\n while (false != ($file = readdir($handle))) {\n\n \t\t//show only ELT files\n\t\t\tif ($type == \"elt\") {\n \t\t\tif (strstr($file, \".elt\") == \".elt\" ) {\n\t\t\t\t\t$dir_array[$array_indx] = $file;\n\t\t\t\t\t$array_indx ++;\n\t \t\t}\n\t\t\t} elseif ($type == \"dir\") {\n\t\t\t\tif (is_dir($file) && $file != \".\") {\n\t\t\t\t\t$dir_array[$array_indx] = $file;\n\t\t\t\t\t$array_indx ++;\n\t\t\t\t}\n\t\t\t}\n }\n\tif (!empty($dir_array)) {\n\t\tarray_multisort($dir_array);\n\t\t}\n\treturn $dir_array;\n}",
"function directory_list($dir, $type = \"php\", $excl = array(), $sort = 0)\n{\n $directory_array = array();\n if (is_dir($dir)) {\n $handle = opendir($dir);\n while ($file = readdir($handle))\n {\n $file_arr = explode(\".\", $file);\n if (!is_dir($file)) {\n if (isset($file_arr[1]) && $file_arr[1] == $type && !in_array($file_arr[0], $excl)) {\n //array_push($directory_array, $file_arr[0]); //eroforras igenyesebb\n if ($sort == 0) {\n $directory_array[] = $file_arr[0];\n }\n if ($sort == 1) {\n $directory_array[$file_arr[0]] = $file_arr[0];\n }\n }\n }\n }\n closedir($handle);\n if ($sort == 0) {\n sort($directory_array);\n }\n if ($sort == 1) {\n ksort($directory_array);\n }\n }\n return $directory_array;\n}",
"protected static function _getPackageFiles($sName)\r\n\t{\r\n\t\t$aParams = self::$_aParams[$sName];\r\n\r\n\t\t$sType = $aParams['type'];\r\n\t\t$sBaseFolder = (empty($aParams['folder']) ? $sType : $aParams['folder']) . '/';\r\n\r\n\t\t// Files are listed as array, return them\r\n\t\tif (is_array($aParams['files']))\r\n\t\t{\r\n\t\t\t$aRet = array();\r\n\t\t\tforeach ($aParams['files'] as $sFile)\r\n\t\t\t\t$aRet[] = $sBaseFolder . $sFile;\r\n\t\t\treturn $aRet;\r\n\t\t}\r\n\r\n\t\t// User wants all files to be included\r\n\t\tif ($aParams['files'] == '*')\r\n\t\t{\r\n\t\t\t$sFileType = '.' . $sType;\r\n\t\t\t$iFileTypeLen = strlen($sFileType);\r\n\t\t\t$aAllFiles = array();\r\n\t\t\t$aFiles = scandir(ASAP_DIR_WEB . $sBaseFolder);\r\n\t\t\tforeach ($aFiles as $sFile)\r\n\t\t\t\tif ($sFile != '.' && $sFile != '..' && substr($sFile, -$iFileTypeLen) == $sFileType && strpos($sFile, '.asap_pack.') === false)\r\n\t\t\t\t\t$aAllFiles[] = $sFile;\r\n\t\t\treturn $aAllFiles;\r\n\t\t}\r\n\r\n\t\t// Strange config, thus we return nothing\r\n\t\treturn array();\r\n\t}",
"function getTemplateFiles() {\n $directory = \"models/site-templates/\";\n $languages = glob($directory . \"*.css\");\n //print each file name\n return $languages;\n}",
"function getLanguageFiles() {\n $directory = \"models/languages/\";\n $languages = glob($directory . \"*.php\");\n //print each file name\n return $languages;\n}",
"function cextras_types_formulaires(){\r\n\t$types = array();\r\n\r\n\tforeach(_chemin() as $dir) {\r\n\t\tif (@is_dir($s = $dir.'extra-saisies/')) {\r\n\t\t\tforeach(preg_files($s, '.*.html$') as $saisie) {\r\n\t\t\t\t$type = basename($saisie,'.html');\r\n\t\t\t\t$types[$type] = array(\r\n\t\t\t\t\t'nom' => _T('cextras:type', array('type' => $type))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $types;\r\n}",
"function getTemplateFiles()\r\n{\r\n\t$directory = \"models/site-templates/\";\r\n\t$languages = glob($directory . \"*.css\");\r\n\t//print each file name\r\n\treturn $languages;\r\n}",
"public function getImages($type=''){\n \n $imagetypes = array(\"image/png\",\"image/jpeg\", \"image/gif\");\n $dir = self::IMAGEPATH;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n \n // check for image files\n $f = escapeshellarg(\"$fulldir$entry\");\n \n \n \n if((!$type)||(strpos(' '.$entry, $type)))\n $retval[] = $entry;\n \n \n }\n $d->close();\n\n return $retval;\n }",
"public static function get_available_templates( $type ) {\n $paths = glob( get_template_directory() . \"/portfolio/$type*.php\" );\n $names = array();\n\n foreach ( $paths as $path ) {\n $file_data = get_file_data( $path, array( 'Portfolio Style' ) );\n $names[] = $file_data[0];\n }\n\n return $names;\n }",
"function buildArray($dir,$file,$onlyDir,$type,$allFiles,$files) {\n\n\t$typeFormat = FALSE;\n\tforeach ($type as $item)\n {\n \tif (strtolower($item) == substr(strtolower($file), -strlen($item)))\n\t\t\t$typeFormat = TRUE;\n\t}\n\n\tif($allFiles || $typeFormat == TRUE)\n\t{\n\t\tif(empty($onlyDir))\n\t\t\t$onlyDir = substr($dir, -strlen($dir), -1);\n\t\t$files[$dir.$file]['path'] = $dir;\n\t\t$files[$dir.$file]['file'] = $file;\n\t\t$files[$dir.$file]['size'] = fsize($dir.$file);\n\t\t$files[$dir.$file]['date'] = filemtime($dir.$file);\n\t}\n\treturn $files;\n}",
"protected function getTestXmlsByType($type)\n {\n $xmlFiles = [];\n $directories = glob(MTF_TESTS_PATH . '/*/*/Test/' . $type);\n foreach ($directories as $directory) {\n $dirIterator = new \\RegexIterator(\n new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($directory, \\FilesystemIterator::SKIP_DOTS)\n ),\n '/.xml/i'\n );\n foreach ($dirIterator as $fileInfo) {\n $baseName = $fileInfo->getBasename('.xml');\n $path = $fileInfo->getPath();\n $nameSpace = str_replace('/', '\\\\', str_replace(MTF_TESTS_PATH, '', $path));\n\n $moduleName = $this->mapClassNameToModule($nameSpace);\n\n $xmlFiles[$baseName][$moduleName] = $moduleName;\n }\n }\n return $xmlFiles;\n }",
"function getLanguageFiles()\r\n{\r\n\t$directory = \"models/languages/\";\r\n\t$languages = glob($directory . \"*.php\");\r\n\t//print each file name\r\n\treturn $languages;\r\n}",
"public function get_files($type = \\null, $depth = 0, $search_parent = \\false)\n {\n }",
"function getTemplateFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/site-templates/\";\r\n\r\n\t$languages = glob($directory . \"*.css\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}",
"public function getFiles() {}",
"public static function getFilesByType($path, $type = false, $appendPath = false, $includeExtension = true)\r\n {\r\n if (is_dir($path)) {\r\n $dir = scandir($path); //open directory and get contents\r\n if (is_array($dir)) { //it found files\r\n $returnFiles = false;\r\n foreach ($dir as $file) {\r\n if (!is_dir($path . '/' . $file)) {\r\n if ($type) { //validate the type\r\n $fileParts = explode('.', $file);\r\n if (is_array($fileParts)) {\r\n $fileType = array_pop($fileParts);\r\n $file = implode('.', $fileParts);\r\n\r\n //check whether the filetypes were passed as an array or string\r\n if (is_array($type)) {\r\n if (in_array($fileType, $type)) {\r\n $filePath = $appendPath . $file;\r\n if ($includeExtension == true) {\r\n $filePath .= '.' . $fileType;\r\n }\r\n $returnFiles[] = $filePath;\r\n }\r\n } else {\r\n if ($fileType == $type) {\r\n $filePath = $appendPath . $file;\r\n if ($includeExtension == true) {\r\n $filePath .= '.' . $fileType;\r\n }\r\n $returnFiles[] = $filePath;\r\n }\r\n }\r\n }\r\n } else { //the type was not set. return all files and directories\r\n $returnFiles[] = $file;\r\n }\r\n }\r\n }\r\n\r\n if ($returnFiles) {\r\n return $returnFiles;\r\n }\r\n }\r\n }\r\n }",
"function _get_filenames($path) {\n $finderFiles = Finder::create()->files()->in($path)->name('*.php');\n $filenames = array();\n foreach ($finderFiles as $finderFile) {\n $filenames[] = \"App\\\\Discount\\\\\".$this->_get_classname($finderFile->getRealpath());\n }\n\n return $filenames;\n }",
"function getFiles(){\r\n\r\n global $dirPtr, $theFiles;\r\n \r\n chdir(\".\");\r\n $dirPtr = openDir(\".\");\r\n $currentFile = readDir($dirPtr);\r\n while ($currentFile !== false){\r\n $theFiles[] = $currentFile;\r\n $currentFile = readDir($dirPtr);\r\n } // end while\r\n \r\n}",
"public function findFiles();",
"public function getFileNames();"
]
| [
"0.7345774",
"0.7028902",
"0.6906481",
"0.6832486",
"0.6700525",
"0.65779394",
"0.64625704",
"0.64625704",
"0.64625704",
"0.64586926",
"0.6440647",
"0.6434251",
"0.64283216",
"0.6407517",
"0.6405298",
"0.6358711",
"0.6358143",
"0.6331347",
"0.63220847",
"0.62803584",
"0.6277139",
"0.6271131",
"0.6240372",
"0.61889416",
"0.61579317",
"0.6156419",
"0.6155353",
"0.61405796",
"0.61404216",
"0.6135098"
]
| 0.7753094 | 0 |
We cannot load this xmlseclibs via composer Check if the class exists to only load the library once. | public function __construct()
{
if (!class_exists('XMLSecurityDSig')) {
include __DIR__ . self::XMLSECLIBS_PATH;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ensureClassLoadingInformationExists() {}",
"protected static function _checkApiAvailability(){\n\t\t$fbLib = static::_getApiPath();\n\t\tif (!\\file_exists($fbLib)){\n\t\t\tthrow new ClassNotFoundException('Facebook Lib not there! Do git submoule init first!');\n\t\t}\n\t}",
"function CAS_autoload($class)\n{\n if (substr($class, 0, 4) !== 'CAS_') {\n return false;\n }\n $fp = @fopen(str_replace('_', '/', $class) . '.php', 'r', true);\n if ($fp) {\n fclose($fp);\n include str_replace('_', '/', $class) . '.php';\n if (!class_exists($class, false) && !interface_exists($class, false)) {\n die(\n new Exception(\n 'Class ' . $class . ' was not present in ' .\n str_replace('_', '/', $class) . '.php (include_path=\"' .\n get_include_path() .'\") [CAS_autoload]'\n )\n );\n }\n return true;\n }\n $e = new Exception(\n 'Class ' . $class . ' could not be loaded from ' .\n str_replace('_', '/', $class) . '.php, file does not exist (include_path=\"'\n . get_include_path() .'\") [CAS_autoload]'\n );\n $trace = $e->getTrace();\n if (isset($trace[2]) && isset($trace[2]['function'])\n && in_array($trace[2]['function'], array('class_exists', 'interface_exists'))\n ) {\n return false;\n }\n if (isset($trace[1]) && isset($trace[1]['function'])\n && in_array($trace[1]['function'], array('class_exists', 'interface_exists'))\n ) {\n return false;\n }\n die ((string) $e);\n}",
"function test_nonce_class_exists() {\n $this->assertTrue(class_exists('\\Fazleelahhee\\Inpsyde\\WPNonce'), \"WPNonce class is not exists or Run 'composer dump-autoload'.\");\n }",
"public static function __classLoaded()\n {\n if (!self::$issuer) {\n self::$issuer = Site::getConfig('primary_hostname');\n }\n }",
"function loadAkademiKuLib($class_name) \n{\n Mod::inc($class_name.\".lib\",'',__DIR__.\"/inc/lib/\");\n}",
"function __autoload($pClassName) {\r\n if (file_exists($pClassName.'.php')) {\r\n require_once($pClassName.'.php');\r\n return true;\r\n } else if (file_exists('wrapper/'.$pClassName.'.php')) {\r\n require_once('wrapper/'.$pClassName.'.php');\r\n return true;\r\n }\r\n return false; \r\n}",
"public static function registerClassLoadingInformation() {}",
"function guoClassLoader($class)\n{\n $path = str_replace('Jwt\\\\', '', $class);\n $file = __DIR__ . '/src/' . $path . '.php';\n if (file_exists($file)) {\n require_once $file;\n }\n}",
"protected static function getClassLoader() {}",
"private static function libAutoload(): void\n {\n \\spl_autoload_register('self::autoload');\n }",
"public function testIsVendorClassReturnsFalseIfClassIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\Webfactory\\Util\\VendorResources'));\n }",
"function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}",
"function Syllable_autoloader($class) {\n\t\tif (!class_exists($class) && is_file(dirname(__FILE__). '/' . $class . '.php')) {\n\t\t\trequire dirname(__FILE__). '/' . $class . '.php';\n\t\t}\n\t}",
"function classLoader($class){\n $filename = $class . '.class.php';\n $file ='classes'. DIRECTORY_SEPARATOR . $filename;\n\n // Smarty ligger i libs-mappa.\n if ($class == 'Smarty') {\n $file = 'libs' . DIRECTORY_SEPARATOR . $filename;\n }\n if (!file_exists($file))\n {\n return false;\n }\n\n include $file;\n}",
"function toolkitLoader($class) {\n\n $file = ROOT_KIRBY_TOOLKIT_LIB . DS . strtolower($class) . '.php';\n\n if(file_exists($file)) {\n require_once($file);\n return;\n } \n\n}",
"private static function _checkXmlParser()\n {\n if (!function_exists('simplexml_load_string') || !class_exists('SimpleXMLElement')) {\n throw new AllopassApiMissingXMLFeatureException();\n }\n }",
"private static function _checkXmlParser()\n {\n if (!function_exists('simplexml_load_string') || !class_exists('SimpleXMLElement')) {\n throw new AllopassApiMissingXMLFeatureException();\n }\n }",
"public function testIsVendorClassReturnsTrueIfClassOfObjectIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorClass(new ClassLoader()));\n }",
"public function enableSimpleSamlAutoload()\n\t{\n\t\t// set up for simple saml\n\t // temporary disable Yii autoloader\n\t spl_autoload_unregister(array('YiiBase','autoload'));\n\t\n\t // saml autoload \n\t require_once($this->simplesamlPath. '/lib/_autoload.php');\n\t}",
"private static function loadLibs(){\n $file = Storange::getBaseWowPath().'wow/lib/readbeans/rb.php';\n if(file_exists($file)){\n include_once $file;\n }\n }",
"static function autoload()\r\n\t{\r\n\t\t\r\n\t}",
"private static function loadDelegationClass()\n {\n if (self::$loaded) {\n return self::$loaded;\n }\n \n $type = Config::get('auth_sp_type');\n \n if (!$type) {\n throw new ConfigBadParameterException('auth_sp_type');\n }\n $class = 'AuthSP'.ucfirst($type);\n $file = FILESENDER_BASE.'/classes/auth/'.$class.'.class.php';\n \n if (!file_exists($file)) {\n throw new AuthSPMissingDelegationClassException($class);\n }\n \n require_once $file;\n \n self::$loaded = $class;\n \n return $class;\n }",
"#[@test]\n public function fileSystemClassPackageProvided() {\n $class= \\lang\\XPClass::forName('net.xp_framework.unittest.reflection.classes.ClassOne');\n $this->assertTrue($class\n ->getClassLoader()\n ->providesPackage($class->getPackage()->getName())\n );\n }",
"public static function __classLoaded()\n {\n\t\tif (empty(static::$layers) && class_exists('Git')) {\n\t\t\tstatic::$layers = \\Git::$repositories;\n\t\t}\n }",
"function __construct() {\n // require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/NuSOAP/lib/nusoap'.EXT);\n require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/nusoap/nusoap'.EXT);\n }",
"public static function autoload()\n {\n if (file_exists(__DIR__ . '/Stringprep/vendor/autoload.php')) {\n require_once __DIR__ . '/Stringprep/vendor/autoload.php';\n } else {\n require_once __DIR__ . '/../../bundle/vendor/autoload.php';\n }\n }",
"function loadCoreClassFor_spl_prephp53($classname) {\n global $DIR_LIBS;\n if (@is_file(\"{$DIR_LIBS}/{$classname}.php\"))\n require_once \"{$DIR_LIBS}/{$classname}.php\";\n}",
"public static function getLibrary() {}",
"function library($library = null)\n {\n if(!$library)\n {\n return FALSE;\n }\n else\n {\n if(file_exists(ROOT . DS . 'library' . DS . $library . '.class' . EXT))\n {\n $library = ucfirst($library);\n return $this->{$library} = new $library;\n }\n else\n {\n return FALSE;\n }\n }\n }"
]
| [
"0.63735986",
"0.6218164",
"0.6093888",
"0.59567374",
"0.5664258",
"0.562615",
"0.5554113",
"0.55473226",
"0.5536559",
"0.5512289",
"0.5505221",
"0.5486595",
"0.54852843",
"0.5471677",
"0.5467042",
"0.5440485",
"0.5437329",
"0.5437329",
"0.5436096",
"0.5429626",
"0.54145116",
"0.5398002",
"0.5388559",
"0.53749216",
"0.53670126",
"0.5367",
"0.5362617",
"0.5358242",
"0.53556776",
"0.53457314"
]
| 0.6622652 | 0 |
Assign default variables from Controller | protected function variablesAssign()
{
$app = $this->app;
$this->request = $app['request'];
$this->session = $app['session'];
$this->template = $app['template'];
$this->theme = $app['theme'];
// Set Request Format
switch ($this->request->getRequestFormat()) {
case 'json':
$this->format = 'json';
break;
case 'xml':
$this->format = 'xml';
break;
case 'csv':
$this->format = 'csv';
break;
case 'html':
default:
$this->format = 'html';
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}",
"protected function initVars() {\n\n\t\t}",
"function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('uploadUri', $this->getController()->buildUriPath(uploadController::ACTION_UPLOAD));\n\t\t$this->getEngine()->assign('doUploadUri', $this->getController()->buildUriPath(uploadController::ACTION_DO_UPLOAD));\n\t\t$this->getEngine()->assign('doMovieSave', $this->getController()->buildUriPath(uploadController::ACTION_MOVIE_SAVE));\n\t}",
"protected function loadDefaultViewParameters()\n {\n # Load Hook component\n $this->oHook = new Hook();\n $this->aView['aHooks'] = array();\n\n $this->aView['aSession'] = $this->oSession->get();\n // @todo provisoire\n if (isset($this->aView['aSession']['auth'])) {\n $aUserSession = $this->aView['aSession']['auth'];\n $this->aView['sGravatarSrc16'] = Gravatar::getGravatar($aUserSession['mail'], 16);\n $this->aView['sGravatarSrc32'] = Gravatar::getGravatar($aUserSession['mail'], 32);\n $this->aView['sGravatarSrc64'] = Gravatar::getGravatar($aUserSession['mail'], 64);\n $this->aView['sGravatarSrc128'] = Gravatar::getGravatar($aUserSession['mail'], 128);\n }\n\n // Views common couch\n $this->aView[\"appLayout\"] = '../../../app/Views/layout.tpl'; // @todo degager ca ou computer\n $this->aView[\"helpers\"] = '../../../app/Views/helpers/';\n\n // Bootstrap\n $oBundles = new Bundles();\n $this->aView[\"aAppBundles\"] = $oBundles->get();\n $this->aView[\"sAppName\"] = $this->aConfig['app']['name'];\n $this->aView[\"sAppSupportName\"] = $this->aConfig['support']['name'];\n $this->aView[\"sAppSupportMail\"] = $this->aConfig['support']['email'];\n $this->aView[\"sAppIcon\"] = '/lib/bundles/' . $this->sBundleName . '/img/icon.png';\n\n // MVC infos\n $this->aView['sLocale'] = $this->sLang;\n $this->aView['sBundle'] = $this->sBundleName;\n $this->aView[\"sController\"] = $this->sController;\n $this->aView[\"sControllerName\"] = substr($this->sController, 0, strlen($this->sController) - strlen('controller'));\n $this->aView[\"sAction\"] = $this->sAction;\n $this->aView[\"sActionName\"] = substr($this->sAction, 0, strlen($this->sAction) - strlen('action'));\n\n // debug\n $this->aView[\"sEnv\"] = ENV;\n $this->aView[\"sDeBugHelper\"] = '../../../app/Views/helpers/debug.tpl';\n $this->aView[\"bIsXhr\"] = $this->isXHR();\n\n // Benchmark\n $this->aView['framework_started'] = FRAMEWORK_STARTED;\n $this->aView['current_timestamp'] = time();\n }",
"public function set_default_view_variables()\n\t{\n\t\t$langfile = substr(ee()->router->class, 0, strcspn(ee()->router->class, '_'));\n\n\t\t// Javascript Path Constants\n\t\tdefine('PATH_JQUERY', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/jquery/');\n\t\tdefine('PATH_JAVASCRIPT', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/');\n\t\tdefine('JS_FOLDER', PATH_JS);\n\n\t\tee()->load->library('javascript', array('autoload' => FALSE));\n\n\t\tee()->load->model('member_model'); // for screen_name, quicklinks\n\n\t\tee()->lang->loadfile($langfile, '', FALSE);\n\n\t\t// Meta-refresh tag\n\t\tif ($refresh = ee()->session->flashdata('meta-refresh'))\n\t\t{\n\t\t\tee()->view->set_refresh($refresh['url'], $refresh['rate']);\n\t\t}\n\n\t\t$cp_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$cp_pad_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable padTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$member = ee('Model')->get('Member', ee()->session->userdata('member_id'))->first();\n\n\t\tif ( ! $member)\n\t\t{\n\t\t\t$member = ee('Model')->make('Member');\n\t\t}\n\n\t\t$notepad_content = ($member->notepad) ?: '';\n\n\t\t// Global view variables\n\t\t$vars =\tarray(\n\t\t\t'cp_homepage_url' => $member->getCPHomepageURL(),\n\t\t\t'cp_page_onload'\t\t=> '',\n\t\t\t'cp_page_title'\t\t\t=> '',\n\t\t\t'cp_breadcrumbs'\t\t=> array(),\n\t\t\t'cp_right_nav'\t\t\t=> array(),\n\t\t\t'cp_messages'\t\t\t=> array(),\n\t\t\t'cp_notepad_content'\t=> $notepad_content,\n\t\t\t'cp_table_template'\t\t=> $cp_table_template,\n\t\t\t'cp_pad_table_template'\t=> $cp_pad_table_template,\n\t\t\t'cp_theme_url'\t\t\t=> $this->cp_theme_url,\n\t\t\t'cp_current_site_label'\t=> ee()->config->item('site_name'),\n\t\t\t'cp_screen_name'\t\t=> $member->screen_name,\n\t\t\t'cp_avatar_path'\t\t=> ($member->avatar_filename) ? ee()->config->slash_item('avatar_url') . $member->avatar_filename : '',\n\t\t\t'cp_avatar_width'\t\t=> ($member->avatar_filename) ? $member->avatar_width : '',\n\t\t\t'cp_avatar_height'\t\t=> ($member->avatar_filename) ? $member->avatar_height : '',\n\t\t\t'cp_quicklinks'\t\t\t=> $this->_get_quicklinks($member->quick_links),\n\n\t\t\t'EE_view_disable'\t\t=> FALSE,\n\t\t\t'is_super_admin'\t\t=> (ee()->session->userdata['group_id'] == 1) ? TRUE : FALSE,\t// for conditional use in view files\n\t\t);\n\n\t\t// global table data\n\t\tee()->session->set_cache('table', 'cp_template', $cp_table_template);\n\t\tee()->session->set_cache('table', 'cp_pad_template', $cp_pad_table_template);\n\n\t\t// we need these paths again in my account, so we'll keep track of them\n\t\t// kind of hacky, but before it was accessing _ci_cache_vars, which is worse\n\n\t\tee()->session->set_cache('cp_sidebar', 'cp_avatar_path', $vars['cp_avatar_path'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_width', $vars['cp_avatar_width'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_height', $vars['cp_avatar_height']);\n\n\t\t// The base javascript variables that will be available globally through EE.varname\n\t\t// this really could be made easier - ideally it would show up right below the main\n\t\t// jQuery script tag - before the plugins, so that it has access to jQuery.\n\n\t\t// If you use it in your js, please uniquely identify your variables - or create\n\t\t// another object literal:\n\t\t// Bad: EE.test = \"foo\";\n\t\t// Good: EE.unique_foo = \"bar\"; EE.unique = { foo : \"bar\"};\n\n\t\t$js_lang_keys = array(\n\t\t\t'logout'\t\t\t\t=> lang('logout'),\n\t\t\t'search'\t\t\t\t=> lang('search'),\n\t\t\t'session_idle'\t\t\t=> lang('session_idle'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'check_all'\t\t\t\t=> lang('check_all'),\n\t\t\t'clear_all'\t\t\t\t=> lang('clear_all'),\n\t\t\t'keyword_search'\t\t=> lang('keyword_search'),\n\t\t\t'loading'\t\t\t\t=> lang('loading'),\n\t\t\t'searching'\t\t\t\t=> lang('searching')\n\t\t);\n\n\t\tee()->javascript->set_global(array(\n\t\t\t'BASE' => str_replace(AMP, '&', BASE),\n\t\t\t'XID' => CSRF_TOKEN,\n\t\t\t'CSRF_TOKEN' => CSRF_TOKEN,\n\t\t\t'PATH_CP_GBL_IMG' => PATH_CP_GBL_IMG,\n\t\t\t'CP_SIDEBAR_STATE' => ee()->session->userdata('show_sidebar'),\n\t\t\t'username' => ee()->session->userdata('username'),\n\t\t\t'router_class' => ee()->router->class, // advanced css\n\t\t\t'lang' => $js_lang_keys,\n\t\t\t'THEME_URL' => $this->cp_theme_url,\n\t\t\t'hasRememberMe' => (bool) ee()->remember->exists(),\n\t\t\t'cp.updateCheckURL' => ee('CP/URL', 'settings/general/version-check')->compile(),\n\t\t));\n\n\t\tif (ee()->session->flashdata('update:completed'))\n\t\t{\n\t\t\tee()->javascript->set_global('cp.updateCompleted', TRUE);\n\t\t}\n\n\t\t// Combo-load the javascript files we need for every request\n\n\t\t$js_scripts = array(\n\t\t\t'ui'\t\t=> array('core', 'widget', 'mouse', 'position', 'sortable', 'dialog', 'button'),\n\t\t\t'plugin'\t=> array('ee_interact.event', 'ee_broadcast.event', 'ee_notice', 'ee_txtarea', 'tablesorter', 'ee_toggle_all', 'nestable'),\n\t\t\t'file'\t\t=> array('react/react.min', 'react/react-dom.min', 'json2',\n\t\t\t'underscore', 'cp/global_start', 'cp/form_validation', 'cp/sort_helper', 'cp/form_group',\n\t\t\t'cp/modal_form', 'cp/confirm_remove', 'cp/fuzzy_filters',\n\t\t\t'components/no_results', 'components/loading', 'components/filters',\n\t\t\t'components/filterable', 'components/toggle', 'components/select_list',\n\t\t\t'fields/select/select', 'fields/select/mutable_select', 'fields/dropdown/dropdown')\n\t\t);\n\n\t\t$modal = ee('View')->make('ee:_shared/modal_confirm_remove')->render([\n\t\t\t'name'\t\t=> 'modal-default-confirm-remove',\n\t\t\t'form_url'\t=> '#',\n\t\t\t'hidden'\t=> [\n\t\t\t\t'bulk_action'\t=> 'remove',\n\t\t\t\t'content_id' => ''\n\t\t\t]\n\t\t]);\n\t\tee('CP/Modal')->addModal('default-remove', $modal);\n\n\t\t$this->add_js_script($js_scripts);\n\t\t$this->_seal_combo_loader();\n\n\t\tforeach ($vars as $key => $value)\n\t\t{\n\t\t\tee()->view->$key = $value;\n\t\t}\n\n\t\tee()->load->vars($vars);\n\t}",
"protected function assignDefaults() {\n\t\t$this->view->assignMultiple(\n\t\t\tarray(\n\t\t\t\t'timestamp'\t\t\t=> time(),\n\t\t\t\t'submission_date'\t=> date('d.m.Y H:i:s', time()),\n\t\t\t\t'randomId'\t\t\t=> Tx_Formhandler_Globals::$randomID,\n\t\t\t\t'fieldNamePrefix'\t=> Tx_Formhandler_Globals::$formValuesPrefix,\n\t\t\t\t'ip'\t\t\t\t=> t3lib_div::getIndpEnv('REMOTE_ADDR'),\n\t\t\t\t'pid'\t\t\t\t=> $GLOBALS['TSFE']->id,\n\t\t\t\t'currentStep'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('currentStep'),\n\t\t\t\t'totalSteps'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('totalSteps'),\n\t\t\t\t'lastStep'\t\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('lastStep'),\n\t\t\t\t// f:url(absolute:1) does not work correct :(\n\t\t\t\t'baseUrl'\t\t\t=> t3lib_div::locationHeaderUrl('')\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->gp['generated_authCode']) {\n\t\t\t$this->view->assign('authCode', $this->gp['generated_authCode']);\n\t\t}\n\t\t\n\t\t/*\n\t\tStepbar currently removed - probably this should move in a partial\n\t\t$markers['###step_bar###'] = $this->createStepBar(\n\t\t\tTx_FormhandlerFluid_Session::get('currentStep'),\n\t\t\tTx_FormhandlerFluid_Session::get('totalSteps'),\n\t\t\t$prevName,\n\t\t\t$nextName\n\t\t);\n\t\t*/\n\t\t\n\t\t/*\n\t\tNot yet realized\n\t\t$this->fillCaptchaMarkers($markers);\n\t\t$this->fillFEUserMarkers($markers);\n\t\t$this->fillFileMarkers($markers);\n\t\t*/\n\t}",
"public function setUpDefaultVars() {\n $this->response['numAttempts'] = new qti_variable('single', 'integer', array('value' => 0));\n $this->response['duration'] = new qti_variable('single', 'float', array('value' => 0));\n $this->outcome['completionStatus'] = new qti_variable('single', 'identifier', array('value' => 'not_attempted'));\n \n // TODO: We have this to get around mistakes (?) in the example QTI - should we?\n $this->outcome['completion_status'] = $this->outcome['completionStatus'];\n }",
"public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}",
"public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}",
"protected function setDefaultValues()\n {\n parent::setDefaultValues();\n $request = DRequest::load();\n $this->setFieldValue(self::FIELD_IP_ADDRESS, $request->getIpAddress());\n $this->setFieldValue(self::FIELD_URL, self::getRequestUrl());\n }",
"function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}",
"public function get_default_params()\n {\n }",
"protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }",
"protected function _setDefaultVars()\r\n\t{\r\n\t\t// Mediawiki globals\r\n\t\tglobal $wgScript, $wgUser, $wgRequest;\r\n\t\t\r\n\t\t$this->action = $this->getAction();\r\n\t\t$this->pageKey = $this->getNamespace('dbKey');\r\n\t\t$this->project = $this->getNamespace('dbKey');\t\t\r\n\t\t$this->pageTitle = $this->getNamespace('text');\r\n\t\t$this->formAction = $wgScript;\r\n\t\t$this->url = $wgScript . '?title=' . $this->pageKey . '&bt_action=';\r\n\t\t$this->viewUrl = $this->url . 'view&bt_issueid=';\r\n\t\t$this->addUrl = $this->url . 'add';\r\n\t\t$this->editUrl = $this->url . 'edit&bt_issueid=';\r\n\t\t$this->deleteUrl = $this->url . 'archive&bt_issueid=';\r\n\t\t$this->isLoggedIn = $wgUser->isLoggedIn();\r\n\t\t$this->isAllowed = $wgUser->isAllowed('protect');\r\n\t\t$this->hasDeletePerms = $this->hasPermission('delete');\r\n\t\t$this->hasEditPerms = $this->hasPermission('edit');\r\n\t\t$this->hasViewPerms = $this->hasPermission('view');\r\n\t\t$this->search = true;\r\n\t\t$this->filter = true;\r\n\t\t$this->auth = true;\r\n\t\t$this->issueType = $this->_config->getIssueType();\r\n\t\t$this->issueStatus = $this->_config->getIssueStatus();\r\n\t\t\r\n\t\t// Request vars\r\n\t\t$this->filterBy = $wgRequest->getVal('bt_filter_by');\r\n\t\t$this->filterStatus = $wgRequest->getVal('bt_filter_status');\r\n\t\t$this->searchString = $wgRequest->getVal('bt_search_string');;\r\n\t}",
"public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }",
"private function initViewVars()\n {\n $this->viewEngine->vars['loggedUserId'] = $this->model->config->getVar('loggedUserId');\n $this->viewEngine->vars['isUserLogged'] = $this->model->config->getVar('isUserLogged');\n $this->viewEngine->vars['loggedUserRole'] = $this->model->config->getVar('loggedUserRole');\n\n $this->viewEngine->vars['charset'] = $this->model->config->getModuleVar('common', 'charset');\n $this->viewEngine->vars['stylesFolder'] = JAPA_PUBLIC_DIR . 'styles/'.$this->model->config->getModuleVar('common', 'styles_folder');\n $this->viewEngine->vars['scriptsFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'scripts_folder');\n $this->viewEngine->vars['imagesFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'images_folder');\n $this->viewEngine->vars['viewsFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'views_folder');\n $this->viewEngine->vars['controllersFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'controllers_folder');\n $this->viewEngine->vars['urlBase'] = $this->router->getBase();\n $this->viewEngine->vars['adminWebController'] = $this->model->config->getVar('default_module_application_controller');\n $this->viewEngine->vars['default_lang'] = $this->model->config->getModuleVar('common', 'default_lang');\n }",
"public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"function startup(&$controller) {\n $this->setVars();\n }",
"public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}",
"public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }",
"public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }",
"function load_default_vars()\r\n {\r\n parent::load_default_vars();\r\n $this->vars['URL_REPOS'] = '//your-private-repos-server/repos/'; // Unnecessary\r\n $this->vars['URL_RSC'] = $this->vars['URL_ASSETS'] . $this->manifest['activity_current'] . '/';\r\n }",
"protected function initializeController() {}",
"public function applyDefaultValues()\n\t{\n\t\t$this->st_usuario = true;\n\t}",
"function applyDefaults()\n {\n list($page, $action) = $this->controller->getActionName();\n $fe =& PEAR_PackageFileManager_Frontend::singleton();\n $fe->log('debug',\n str_pad($this->getAttribute('id') .'('. __LINE__ .')', 20, '.') .\n \" applyDefaults ActionName=($page,$action)\"\n );\n }",
"public function applyDefaultValues()\n\t{\n\t}",
"public function applyDefaultValues()\n\t{\n\t}",
"public function applyDefaultValues()\n\t{\n\t}",
"public function default() {\n \n $this->data = ModuleConfig::settings();\n // [Module_Data]\n }"
]
| [
"0.6841472",
"0.67058784",
"0.6634803",
"0.66151303",
"0.6611176",
"0.6597614",
"0.65950835",
"0.6558767",
"0.6551307",
"0.65383977",
"0.6515061",
"0.64782655",
"0.6474222",
"0.6415481",
"0.6400735",
"0.6356036",
"0.63268554",
"0.6293385",
"0.6285836",
"0.62847537",
"0.6279425",
"0.6265644",
"0.6239721",
"0.6218172",
"0.62018645",
"0.619718",
"0.6185954",
"0.6185954",
"0.6185954",
"0.6159247"
]
| 0.67748207 | 1 |
Log a user into the application by their ID | static function loginUsingId($id)
{
$session = App::get('session');
$user = DB::load('users', $id);
if($user->group > 0) {
$user['rights'] = self::loadRights((int)$user->group);
}
self::$user = $user;
$session->set('user', self::$user);
self::createSession($id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loginUsingId($id)\n {\n Auth::user();\n $user = Auth::loginUsingId($id,true);\n if($user)\n {\n return redirect('/init_check');\n }else{\n echo \"unable to login\";\n }\n }",
"public static function logIn($userId)\r\n {\r\n (new Session())->set(static::$userIdField, $userId);\r\n }",
"function login($user_id) {\n\tsession_regenerate_id(true); // Create a new session for login\n\t$_SESSION['user_id'] = $user_id;\n}",
"public function login($user){\n if($user){\n $this->user_id = $_SESSION['userId'] = $user->userId;\n $this->logged_in = TRUE;\n }\n \n }",
"public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}",
"public function loginUser($userId) {\n\t\tif ($this->isAdmin()) {\n\t\t\t$this->loginAdmin($userId);\n\t\t} else {\n\t\t\t$this->loginCustomer($userId);\n\t\t}\n\t}",
"static function logIn($user) {\n if (isset($user)) {\n session_start();\n $_SESSION['userId'] = $user->id;\n }\n }",
"public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }",
"public function login($user){\n if($user){\n $this->user_id = $_SESSION['user_id'] = $user->id;\n $this->logged_in = true;\n }\n }",
"public function login($userid)\n {\n $this->userId = $userid;\n $this->createSession();\n $this->createCookie();\n $this->logger->setUser($this->userId);\n $this->logger->setIP($this->server['REMOTE_ADDR']);\n $this->logger->loginOutEntry(1);\n }",
"public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }",
"public static function setLoggedUserId($id)\r\n {\r\n self::setVariable(\"login\", \"user-id\", $id);\r\n }",
"public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }",
"public function getUserById($id) {\n\t\t\n\t}",
"public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }",
"public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }",
"function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}",
"public function login($user) \n {\n $_SESSION['user_id'] = $user['id'];\n $_SESSION['is_logged_in'] = true;\n $_SESSION['time_logged_in'] = time();\n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function actionLoginAs($id)\n {\n $model = $this->findModel($id);\n if(empty($model->access_token)){\n $model->generateAccessToken();\n $model->save(false);\n }\n return $this->redirect(Yii::$app->urlManagerFrontend->createAbsoluteUrl(['/account/login-as', 'token' => $model->access_token]));\n }",
"public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}",
"public function login($users_id = false){\n\t\tif(!empty($users_id)){\n\t\t\t// Select user information\n\t\t\t$data = $this->_model->getDataByID($users_id);\n\n if(!isset($data[0]['id']) || empty($data[0]['id'])){\n $this->_view->flash[] = \"User is not active or does not exist\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n Url::redirect('backoffice/users/');\n }\n\n\t\t\t// Unset current user sessions\n\t\t\tunset($_SESSION['UserLoggedIn']);\n\t\t\tunset($_SESSION['UserCurrentUserID']);\n\t\t\tunset($_SESSION['UserCurrentFirstName']);\n\t\t\tunset($_SESSION['UserCurrentSurname']);\n\t\t\tunset($_SESSION['UserCurrentFullName']);\n\t\t\tunset($_SESSION['UserProfileImage']);\n\t\t\tunset($_SESSION['UserCurrency']);\n\t\t\tunset($_SESSION['UserCurrencySign']);\n\n\t\t\t// Set user session & redirect user\n\t\t\tSession::set('UserLoggedIn', true);\n Session::set('UserAccountIsVerified', $data[0]['email_verified']);\n Session::set('UserCurrentUserID', $data[0]['id']);\n Session::set('UserCurrentFirstName', $data[0]['firstname']);\n Session::set('UserCurrentSurname', $data[0]['surname']);\n Session::set('UserCurrentFullName', $data[0]['firstname'] . ' ' . $data[0]['surname']);\n\n\t\t\tif(!empty($_SESSION['UserLoggedIn'])){\n\t\t\t\tUrl::redirect('users');\n\t\t\t}\n\t\t} else {\n\t\t\tUrl::redirect('backoffice/users/');\n\t\t}\n\t}",
"public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }",
"public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }",
"public static function auth($userId)\n {\n\n $_SESSION['user'] = $userId;\n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function loginUser($params) {\n return $this->run('loginUser', array($params));\n }",
"public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}",
"public function login($data) {\n $query = $this->get_by($data, TRUE);\n\n if ($query) {\n return $query->user_id;\n } else {\n return false;\n }\n }",
"public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }"
]
| [
"0.7126813",
"0.6801682",
"0.6788236",
"0.6652875",
"0.66079175",
"0.6563919",
"0.65605795",
"0.65080506",
"0.6479399",
"0.639023",
"0.6388826",
"0.6388782",
"0.6387727",
"0.6381826",
"0.6379136",
"0.63717264",
"0.6370282",
"0.6367987",
"0.6361378",
"0.6347572",
"0.63252354",
"0.63245064",
"0.6324376",
"0.63233066",
"0.6306238",
"0.6301835",
"0.6298108",
"0.62946814",
"0.6288076",
"0.62818617"
]
| 0.73634773 | 0 |
Creates a new Profile model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionProfilecreate()
{
$model = new Profile();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->user_id]);
} else {
return $this->render('profilecreate', [
'model' => $model,
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n\t{\n\t\t$model=new Profile;\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['Profile']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Profile'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->user_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 User();\n\n $profile = new UserProfile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $userProfile = Yii::$app->request->post('UserProfile');\n $profile->user_id = $model->id;\n $profile->phone = $userProfile['phone'];\n $profile->firstname = $userProfile['firstname'];\n $profile->lastname = $userProfile['lastname'];\n $profile->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'profile' => $profile,\n ]);\n }",
"public function actionCreate()\n {\n $model = new UserProfile();\n\n $model->user_id = Yii::$app->user->identity->id;\n\n\n $POST_VARIABLE = Yii::$app->request->post('Place');\n echo $POST_VARIABLE['first_name'];\n\n if ($already_exists = RecordHelpers::userHas('user_profile')) {\n return $this->render('view', [\n\n 'model' => $this->findModel($already_exists),\n ]);\n\n } elseif ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash(\"success\", Yii::t('app', 'Profile successfully created!'));\n return $this->redirect(['view']);\n\n } else {\n// echo $model->user_id;\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n }\n\n// if ($model->load(Yii::$app->request->post()) && $model->save()) {\n//\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 $user = new User(['scenario' => 'create']);\n $profile = new Profile();\n\n if ($user->load(Yii::$app->request->post()) && $profile->load(Yii::$app->request->post())) {\n if ($user->validate() && $profile->validate()) {\n //$user->populateRelation('profile', $profile);\n if ($user->save(false)) {\n $user->link('profile', $profile);\n Yii::$app->session->setFlash('success', Module::t('users', 'User has been successfully created.'));\n return $this->redirect(['update', 'id' => $user->id]);\n } else {\n Yii::$app->session->setFlash('danger', Module::t('users', 'User has not been saved. Please try again!'));\n return $this->refresh();\n }\n }\n }\n\n return $this->render('create', [\n 'user' => $user,\n 'profile' => $profile\n ]);\n }",
"public function actionCreate()\n {\n $model = new ProfileModel();\n $model->scenario = Constants::SCENARIO_SIGNUP;\n\n $db = \\Yii::$app->db;\n $transaction = $db->beginTransaction();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //now insert the login credentials into teh authentication model\n $authModel = new AuthenticationModel();\n $authModel->isNewRecord = true;\n\n $authModel->USER_ID = $model->USER_ID;\n $authModel->PASSWORD = $model->PASSWORD;\n $authModel->ACCOUNT_AUTH_KEY = $model->ACCOUNT_AUTH_KEY;\n if ($authModel->save()) {\n //commit transaction\n $transaction->commit();\n //$this->redirect(['view', 'id' => $model->USER_ID]);\n $this->redirect(['//site/login']);\n } else {\n //roll back the transaction\n $model->PASSWORD = null; //clear the password field\n $model->REPEAT_PASSWORD = null; //clear the repeat password field\n $model->ACCOUNT_AUTH_KEY = null;\n $transaction->rollback();\n }\n }\n return $this->render('create', ['model' => $model,]);\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 {\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 User();\n\n if (isset($_POST['User']))\n {\n\n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n $model->setAttributes($_POST['User']);\n $model->salt = Registration::model()->generateSalt();\n $model->password = Registration::model()->hashPassword($model->password, $model->salt);\n $model->registrationIp = Yii::app()->request->userHostAddress;\n\n if ($model->save())\n {\n $profile = new Profile();\n $profile->user_id = $model->id;\n if ($profile->save())\n {\n $transaction->commit();\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пользователь добавлен!'));\n $this->redirect(array('view', 'id' => $model->id));\n }\n else\n {\n throw new CDbException(Yii::t('user', 'При создании пользователя произошла ошибка! Подробности в журнале исполнения.'));\n }\n }\n\n }\n catch (CDbException $e)\n {\n $transaction->rollback();\n Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, UserModule::$logCategory);\n Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, $e->getMessage());\n $this->redirect(array('create'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function create()\n\t{\n\t\t$profile = Profile::first();\n\t\treturn view('admin.profile.create', compact('profile'));\n\t}",
"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 create()\n\t{\n\t\t//\n\t\t$user = Auth::user();\n\t\tif($user->profiles()->first()){\n\t\treturn Redirect::to('/profiles/');\n\t\t}else{\n\t\treturn View::make('profiles.create');\t\n\t\t}\n\t\t\n\t}",
"public function create()\n {\n\n return view('profiles.profile.create');\n\n }",
"public function create()\n {\n //\n return View('profile.createprofile');\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 create()\n\t{\n\t\treturn view('admin.profiles.create');\n\t}",
"public function actionCreate()\n {\n $model = new PerfilUsuario();\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 Users;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n $path= realpath(Yii::app()->basePath . '/../images/profile/'); \n $thumbpath=realpath(Yii::app()->basePath . '/../images/profile/thumb/');\n\t\tif(isset($_POST['Users'])){\n\t\t\t$model->attributes=$_POST['Users'];\n if ($_FILES[\"Users\"][\"name\"][\"profile_image\"] != \"\"){\n // Upload doctor image\n $uploadedFile=CUploadedFile::getInstance($model,'profile_image');\n $filename=explode(\".\", $uploadedFile);\n $fileext = $filename[count($filename) - 1];\n $newfilename = time() . \".\" . $fileext;\n $model->profile_image = $newfilename;\n $_POST['Users'][\"profile_image\"] = $newfilename;\n if(!empty($uploadedFile)){\n $uploadedFile->saveAs($path.\"/\".$newfilename);\n $image = new EasyImage($path.\"/\".$newfilename);\n $image->resize(100, 100);\n $image->save($thumbpath.\"/\".$newfilename);\n /**\n * @desc : Delete existing images\n */\n if (file_exists($path . $old_image)) {\n @unlink($path . $old_image);\n }\n }\n }\n $model->password = base64_encode($_POST['Users'][\"password\"]);\n if($model->save()){\n $this->redirect(array('view','id'=>$model->user_id));\n }\n\t\t}\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\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 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 }",
"public function createAction()\n {\n $profileForm = new Application_Form_Profile(['id' => 'create-profile']);\n $this->view->profileForm = $profileForm;\n\n /**\n * GET handler request\n */\n $requestShowProfileFormOnly = !$this->getRequest()->isPost();\n if ($requestShowProfileFormOnly) {\n return; //show profile form now\n }\n\n /**\n * POST handler request\n */\n $invalidProfileSubmited = !$profileForm->isValid($this->getRequest()->getPost());\n if ($invalidProfileSubmited) {\n return; //show profile form with errors messages\n }\n\n /**\n * Persit valid profile after filtered\n */\n $profileRepoFactory = new Application_Factory_ProfileRepository();\n $profileModelFactory = new Application_Factory_ProfileModel();\n\n $profileEntity = $profileModelFactory->createService($profileForm->getValues());\n $profileRepo = $profileRepoFactory->createService();\n $profileRepo->save($profileEntity);\n\n return $this->_helper->redirector('index', 'profile', 'default');\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Users;\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['Users']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Users'];\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 create()\n {\n return view('profile.create');\n }",
"public function create()\n {\n return view('profile.create');\n }",
"public function create()\n {\n return view('profile.create');\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 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 }"
]
| [
"0.8568201",
"0.79260474",
"0.7795949",
"0.7585542",
"0.7562291",
"0.7512637",
"0.74405026",
"0.74405026",
"0.74405026",
"0.74405026",
"0.7399002",
"0.7329287",
"0.7273033",
"0.7268309",
"0.72066015",
"0.7147042",
"0.7115441",
"0.7107603",
"0.7102133",
"0.709844",
"0.70739806",
"0.70739806",
"0.7069939",
"0.7031283",
"0.69466174",
"0.6918976",
"0.6918976",
"0.6918976",
"0.6908927",
"0.68911594"
]
| 0.85188234 | 1 |
Finds the Profile model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Profile::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id)\n {\n if (($model = Profile::findOne(['user_id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Такой профиль пользователя не существует.');\n }\n }",
"public abstract function find($primary_key, $model);",
"protected function findModel($id)\n {\n if (($model = DriverProfile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Profile::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findModel($id)\n {\n if (($model = ProfileModel::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModelUserProfile($id)\n {\n if (($profile = UserProfile::findOne(['user_id'=>$id])) !== null) {\n return $profile;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function loadModel($id) {\n if ($id == Yii::app()->user->id || Yii::app()->user->isAdmin()) {\n $model = User::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }\n else {\n echo \"<h1>You Are Not Authorized to See Other Members Profile, DON'T DO IT AGAIN!!!</h1>\";\n exit;\n }\n }",
"protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id)\n {\n if (($model = UserProfile::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public static function loadModel($id)\n\t{\n\t\tif ($id == 'backup'){\n\t\t\t$model=Yii::app()->session[$this->createBackup];\n\t\t} else {\n\t\t\tif(Yii::app()->user->demo){\n\t\t\t\t$model=new Profiles;\n\t\t\t\t$model->PRF_UID = 0;\n\t\t\t\t$model->PRF_FIRSTNAME = 'Demo';\n\t\t\t\t$model->PRF_LASTNAME = 'Demo';\n\t\t\t\t$model->PRF_NICK = 'Demo';\n\t\t\t\t$model->PRF_EMAIL = '[email protected]';\n\t\t\t\t$model->PRF_LANG = Yii::app()->user->lang;\n\t\t\t\t$model->PRF_LOC_GPS_LAT = Yii::app()->user->home_gps[0];\n\t\t\t\t$model->PRF_LOC_GPS_LNG = Yii::app()->user->home_gps[1];\n\t\t\t\t$model->PRF_LOC_GPS_POINT = Yii::app()->user->home_gps[2];\n\t\t\t\t$model->PRF_VIEW_DISTANCE = Yii::app()->user->view_distance;\n\t\t\t\t$model->PRF_PW = 'demo';\n\t\t\t\t$model->isNewRecord = false;\n\t\t\t} else {\n\t\t\t\tif ($id != Yii::app()->user->id){\n\t\t\t\t\tthrow new CHttpException(403,'It\\'s not allowed to open profile of other user.');\n\t\t\t\t}\n\t\t\t\t$model=Profiles::model()->findByPk($id);\n\t\t\t}\n\t\t}\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function findById($profileId);",
"public function find($key)\n\t{\n\t\t$user = model('user')->find_user($key);\n\n\t\treturn $user ? UserModel::newWithAttributes(Arr::toArray($user)) : null;\n\t}",
"protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `id`, `visible`, `bio` FROM `memberprofile` WHERE `id` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new memberProfile();\n $obj->hydrate($row);\n memberProfilePeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }",
"public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }",
"protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n \tif (($model = User::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }",
"protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}",
"protected function findModel($id)\n {\n if (($model = Puestoxpersonal::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = BackendUser::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public static function getProfileByUserId($id): ?ProfileModel\n {\n // Connect to database\n $connection = DatabaseConfig::getConnection();\n\n // Prepare SQL String and bind parameters\n $sql_query = \"SELECT * FROM profiles WHERE USER_ID = ?\";\n $stmt = $connection->prepare($sql_query);\n\n // Bind parameters\n $stmt->bind_param(\"i\", $id);\n\n // Execute statement and get results.\n $stmt->execute();\n $result = $stmt->get_result();\n\n // If no results return null.\n if ($result->num_rows == 0) {\n\n return null;\n }\n else\n {\n // Get results as associative array\n $profile = $result->fetch_assoc();\n\n // Get profile from array and save to ProfileModel\n $returnedProfile = new ProfileModel($profile[\"USER_ID\"], $profile['PHONE'], $profile['OCCUPATION'], $profile['AGE'], $profile['IS_MALE'], $profile['CITY'], $profile['STATE'], $profile['BIO']);\n $returnedProfile->setProfileID($profile['PROFILE_ID']);\n\n // Return results\n return $returnedProfile;\n }\n }",
"protected function findModel(int $id): Provision {\n\t\tif (($model = Provision::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n if (($model = Proses1::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n if (($model = Users::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('yii','The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}",
"protected function findModel($id)\n {\n if (($model = PdmP44::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}"
]
| [
"0.65327877",
"0.65195316",
"0.64654845",
"0.64451617",
"0.63474566",
"0.6272434",
"0.6203171",
"0.6149715",
"0.614192",
"0.6133039",
"0.61149603",
"0.6085689",
"0.6081873",
"0.607999",
"0.60747284",
"0.6069531",
"0.60411614",
"0.6018739",
"0.6014527",
"0.60079503",
"0.5999915",
"0.59944403",
"0.5948936",
"0.59437805",
"0.5935222",
"0.5934862",
"0.5934148",
"0.5932163",
"0.59026086",
"0.5899897"
]
| 0.65899587 | 1 |
Enable sqlite's WAL journal mode to help concurrency. Disabled while running phpunit as it breaks inmemory db's. See : | protected function tryEnablingSqliteWal(Type $var = null)
{
if (app('env') === 'testing') {
return;
}
if (DB::connection() instanceof \Illuminate\Database\SQLiteConnection) {
DB::statement(DB::raw('PRAGMA journal_mode = wal;'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testNoInfiniteLoopWhenLoggingToDatabase()\n {\n Config::getInstance()->log['log_writers'] = array('database');\n Config::getInstance()->log['log_level'] = 'DEBUG';\n\n Log::info(self::TESTMESSAGE);\n\n $this->checkBackend('database', self::TESTMESSAGE, $formatMessage = true, $tag = 'Monolog');\n }",
"private function sqlite(BufferedOutput $outputLog)\n {\n if (DB::connection() instanceof SQLiteConnection) {\n $database = DB::connection()->getDatabaseName();\n if (! file_exists($database)) {\n touch($database);\n DB::reconnect(Config::get('database.default'));\n }\n $outputLog->write('Using SqlLite database: '.$database, 1);\n }\n }",
"function testDBLogging() {\n if (strlen(DBPASS) > 0) {\n Debug::$enable_show = false;\n Debug::$enable_log = true;\n $this->assertTrue(Debug::out('Testing, testing, 123'));\n }\n }",
"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 testSQLiteDriver () {\n $extension = new AlyxGrayOathTokenExtension();\n $config = $this->getConfig ('sqlite');\n $extension->load (array ($config), new ContainerBuilder());\n }",
"public function setUp() {\n ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n }",
"function init_sqlite3_access() {\n\tglobal $DB;\n\n\t$DB['SEM_ID'] = sem_get(ftok($DB['DATABASE'], 'z'), 1, 0660);\n}",
"public function open()\n {\n if (!isset($this->handle)) {\n $this->stats->benchmark('bedrockWorkerManager.db.open', function () {\n $this->handle = new SQLite3($this->location);\n $this->handle->busyTimeout(15000);\n $this->handle->enableExceptions(true);\n });\n }\n }",
"public function supportsJournaling(): bool\n {\n return false;\n }",
"private static function createTestChatDB()\n {\n $logger = new APILogger();\n\n $logger->debug(\"Creating TestChatDB.\", null);\n\n $testChatDB = new PDO('sqlite::memory:');\n\n if($testChatDB == null)\n {\n throw new PhavaException(\"Creating in-memory database failed!\");\n }\n\n $logger->info(\"Created in-memory database.\",null);\n\n $sql = file_get_contents(\"/app/init.sql\");\n\n if ($testChatDB->exec($sql) != false){\n $logger->info(\"In-memory database ready.\",null);\n self::$testChatDB = $testChatDB;\n }\n else {\n $logger->info(\"Failed to initialize in-memory database.\",null);\n }\n }",
"public function enableLogging($path) {\n\t\t$this->_logger = new Zend_Log(new Zend_Log_Writer_Stream($path.'simpleDb.log'));\n\t}",
"function lock_sqlite3_access() {\n\tglobal $DB;\n\n\tsem_acquire($DB['SEM_ID']);\n}",
"public function testBasicPersistence()\n {\n $connection = new Connection();\n\n $connection->addEntry('dn0', array('other', 'data'));\n $connection->deleteEntry('dn1');\n $connection->addAttributeValues('dn2', array('attr1', 'attr2'));\n $connection->replaceAttributeValues('dn3', array('attr3'));\n $connection->deleteAttributeValues('dn4', array('test'));\n\n $connection->addEntry('test', array('data'));\n $connection->deleteEntry('test');\n $connection->addAttributeValues('test', array('attr0'));\n $connection->replaceAttributeValues('test', array('attr1', 'attr4'));\n $connection->deleteAttributeValues('test', array());\n\n $this->assertActionLog($connection->shiftLog(), 'create', 'dn0', array('other', 'data'));\n $this->assertActionLog($connection->shiftLog(), 'delete', 'dn1');\n $this->assertActionLog($connection->shiftLog(), 'attr_add', 'dn2', array('attr1', 'attr2'));\n $this->assertActionLog($connection->shiftLog(), 'attr_rep', 'dn3', array('attr3'));\n $this->assertActionLog($connection->shiftLog(), 'attr_del', 'dn4', array('test'));\n $this->assertActionLog($connection->shiftLog(), 'create', 'test', array('data'));\n $this->assertActionLog($connection->shiftLog(), 'delete', 'test');\n $this->assertActionLog($connection->shiftLog(), 'attr_add', 'test', array('attr0'));\n $this->assertActionLog($connection->shiftLog(), 'attr_rep', 'test', array('attr1', 'attr4'));\n $this->assertActionLog($connection->shiftLog(), 'attr_del', 'test', array());\n $this->assertNull($connection->shiftLog(), 'No more logs available');\n }",
"public function setUpJournal();",
"public function __construct()\n {\n putenv('DB_CONNECTION=sqlite');\n putenv('DB_DATABASE=:memory:');\n parent::setUp();\n }",
"public function supportsJournaling(): bool;",
"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}",
"public function sqlite($filename, $persistent = false)\n {\n $filename = ($filename == ':temp:') ? (realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'horus-temp-db.sqlite') : $filename;\n $c = $this->connect(\"sqlite:{$filename}\",null,null,array(PDO::ATTR_PERSISTENT => (bool) $persistent));\n $this->query('pragma synchronous = off;');\n return $c;\n }",
"public function __construct(){\n $this->db = new SQLite3(':memory:');\n //create table in db if it does now exist\n $this->db->exec('CREATE TABLE IF NOT EXISTS storage (name STRING, value INT);');\n }",
"private static function initialize_db() {\n\t\tif ( ! defined( 'WP_CLI_SNAPSHOT_DB' ) ) {\n\t\t\tdefine( 'WP_CLI_SNAPSHOT_DB', Utils\\trailingslashit( WP_CLI_SNAPSHOT_DIR ) . 'wp_snapshot.db' );\n\t\t}\n\n\t\tif ( ! ( file_exists( WP_CLI_SNAPSHOT_DB ) ) ) {\n\t\t\tself::create_tables();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved -- False positive.\n\t\tself::$dbo = new \\SQLite3( WP_CLI_SNAPSHOT_DB );\n\t}",
"public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }",
"public function open_writable_database( $flag = 0 ) \n\t{\n\t\tZend_Search_Lucene::setResultSetLimit( 50 );\n\t\tZend_Search_Lucene_Analysis_Analyzer::setDefault( new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8() );\n\t\t\n\t\tif( PluginSearchInterface::INIT_DB == $flag ) {\n\t\t\t$this->_index = Zend_Search_Lucene::create($this->_index_path);\n\t\t} else {\n\t\t\t$this->_index = Zend_Search_Lucene::open($this->_index_path);\n\t\t}\n\t}",
"public final function withLog ()\n {\n\n $this->withLog = true;\n\n }",
"public function enabled()\n {\n return extension_loaded('sqlite');\n }",
"function kval_sqlite_depends()\n{\n return array('sqlite', 'filesystem');\n}",
"public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }",
"public function prepareDatabase()\n {\n // If SQLite database does not exist, create it\n if ($this->config->database['connection'] === 'sqlite') {\n $path = $this->config->database['database'];\n if ( ! $this->fileExists($path) && is_dir(dirname($path))) {\n $this->write(\"Creating $path ...\");\n touch($path);\n }\n }\n }",
"protected function setUpTestDatabase() {}",
"public function testOpenFileDB()\n {\n $dbLocation = __DIR__ . \"/../test.sq3\";\n $dbManager = new DbManager([\n 'driver' => [\n 'name' => 'sqlite',\n 'arguments' => [\n ['location' => SQLite::LOCATION_FILE, 'path' => $dbLocation]\n ]\n ]\n ]);\n\n $this->assertInstanceOf(DbManager::class, $dbManager);\n \n /** @var SQLite $driver */\n $driver = $dbManager->getDriver();\n $tableNames = $driver->getTableNames();\n\n // Asserting that the table names are correct. The assertEquals call has extended arguments to have $canonicalize set to true,\n // avoiding errors thrown because arrays aren't in the same order\n $this->assertCount(2, $tableNames);\n $this->assertEquals(['test_table', 'sqlite_sequence'], $tableNames, \"Table names aren't valid\", 0.0, 10, true);\n\n return $dbManager;\n }",
"public static function init() {\n $db_file_path = static::get_db_file_path();\n $pdo = new PDO(\"sqlite:\" . $db_file_path);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n static::$pdo = $pdo;\n }"
]
| [
"0.5472749",
"0.5375626",
"0.53667814",
"0.5343788",
"0.52695185",
"0.5254338",
"0.5254147",
"0.5156851",
"0.51143026",
"0.5060241",
"0.50595087",
"0.50318104",
"0.5014082",
"0.5002869",
"0.49910864",
"0.49721688",
"0.4945937",
"0.4908484",
"0.49083784",
"0.4900614",
"0.48735273",
"0.4796402",
"0.4776785",
"0.475321",
"0.47432873",
"0.4732505",
"0.4710412",
"0.4705208",
"0.47035408",
"0.46874234"
]
| 0.64352405 | 0 |
Process functions for hbmode theme. Process entry. | function theme_hbmode_process_entry($app, &$entry) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display_themes()\n {\n }",
"function preview_theme()\n {\n }",
"public function postApplyTheme()\n {\n //...\n }",
"function ahs_callposts_activate(){\n add_option('ahscp_css', \".callposts_2col .post { float: left; margin-right: 20px; border-bottom: 1px solid #999; overflow: hidden; clear: none; }\\n.callposts_2col .post h3 { margin-bottom: 0; }\\n.callposts_2col .clr { height: 20px; }\\n.callposts.whitespace { background: #fff; width: 225px; float: right; margin-right: -10px; padding: 0 0 10px 10px; }\\n.callposts .floatbox { background-color: #eee; padding: 15px; float: right; margin: 10px -10px 10px 10px;}\\n.clr { clear: both; }\");\n\n add_option('ahscp_tmplnum', '3');\n add_option('ahscp_tmpl_1_title', 'Simple linked titles list');\n add_option('ahscp_tmpl_1_group', '1');\n add_option('ahscp_tmpl_1_text', '<li><a href=\"%%URL%%\">%%TITLE%%</a> %%EDITLINK%%</li>');\n add_option('ahscp_tmpl_2_title', 'Just title and full content');\n add_option('ahscp_tmpl_2_text', \"<div class=\\\"post\\\">\n<h3>%%TITLE%% %%EDITLINK%%</h3>\n<p>%%CONTENT%%</p>\n</div>\");\n add_option('ahscp_tmpl_3_title', 'Linked title, image, excerpt and continue link');\n add_option('ahscp_tmpl_3_text', \"<div class=\\\"post %%CATEGORY%%\\\">\n<h3><a href=\\\"%%URL%%\\\">%%TITLE%%</a> %%EDITLINK%%</h3>\n%%IMAGE%%<p>%%EXCERPT%%...<a href=\\\"%%URL%%\\\">More...</a></p>\n</div>\");\n}",
"public function process_handler() {\n\t\tif (get_option( 'chips_data_option_name' )) {\n\t\t\t$opts = get_option( 'chips_data_option_name' );\n\t\t\tif (isset($opts['data_root']) === TRUE) {\n\t\t\t\t$data_root = $opts['data_root'];\t\n\t\t\t}\n\t\t\tif (isset($opts['data_root']) === TRUE) {\n\t\t\t\t$data_html = $opts['data_html'];\n\t\t\t}\n\t\t}\n\t\t$upload_dir = wp_upload_dir();\n\t\tchipsBGProcess::splitBuildProcess($_POST,$this);\n\t}",
"function theme_hbmode_process_footer($app, &$vars) {\n}",
"function bones_ahoy() {\n\n\t// let's get language support going, if you need it\n\tload_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\t// launching operation cleanup\n\tadd_action( 'init', 'bones_head_cleanup' );\n\t// remove WP version from RSS\n\tadd_filter( 'the_generator', 'bones_rss_version' );\n\t// remove pesky injected css for recent comments widget\n\tadd_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n\t// clean up comment styles in the head\n\tadd_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n\t// clean up gallery output in wp\n\tadd_filter( 'gallery_style', 'bones_gallery_style' );\n\n\t// enqueue base scripts and styles\n\tadd_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\t// ie conditional wrapper\n\n\t// launching this stuff after theme setup\n\tbones_theme_support();\n\n\t// adding sidebars to Wordpress (these are created in functions.php)\n\tadd_action( 'widgets_init', 'bones_register_sidebars' );\n\n\t// cleaning up random code around images\n\tadd_filter( 'the_content', 'bones_filter_ptags_on_images' );\n\t// cleaning up excerpt\n\tadd_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}",
"public function settings_render_main_screen_function() {\n\t\t\\add_action( 'bp_template_content', array( $this, 'bp_settings_tab_action' ) );\n\t\t\\bp_core_load_template( \\apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t}",
"function bones_ahoy()\n{\n\n //Allow editor style.\n add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css');\n\n // let's get language support going, if you need it\n load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation');\n\n // launching operation cleanup\n add_action('init', 'bones_head_cleanup');\n // A better title\n add_filter('wp_title', 'rw_title', 10, 3);\n // remove WP version from RSS\n add_filter('the_generator', 'bones_rss_version');\n // remove pesky injected css for recent comments widget\n add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1);\n // clean up comment styles in the head\n add_action('wp_head', 'bones_remove_recent_comments_style', 1);\n // clean up gallery output in wp\n add_filter('gallery_style', 'bones_gallery_style');\n\n // enqueue base scripts and styles\n add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999);\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // cleaning up random code around images\n add_filter('the_content', 'bones_filter_ptags_on_images');\n // cleaning up excerpt\n add_filter('excerpt_more', 'bones_excerpt_more');\n}",
"public function preApplyTheme()\n {\n //...\n }",
"public function start_previewing_theme()\n {\n }",
"function ldc_theme_init() {\n global $ldc_theme;\n $ldc_theme = wp_get_theme();\n\n\n\n // allow editor style\n add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\n\n //// Init CMB2.\n // require_once 'library/cmb2/init.php';\n\n\n //// Load custom post types.\n require_once 'library/cpt/cpt-ldc_chatter.php';\n require_once 'library/cpt/cpt-ldc_creation.php';\n require_once 'library/cpt/cpt-ldc_event.php';\n\n\n //// Load shortcodes.\n require_once 'library/sc/sc-ldc_list.php';\n\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}",
"function wp_hooks() \n {\n // Wordpress actions & filters \n add_action( 'admin_menu', array(&$this,'admin_menu_link') );\n add_action( 'admin_head', array(&$this, 'remove_mediabuttons') );\n add_action( 'init', array(&$this, 'add_custom_post_type') );\n add_action( 'admin_init', array(&$this, 'add_metaboxes') );\n add_action( 'save_post', array(&$this, 'save_source_metabox'), 10, 2 );\n add_action( 'manage_posts_custom_column', array(&$this, 'add_custom_columns') ); // sets the row value\n \n $filter = 'manage_edit-' . $this->custom_post_type_name . '_columns';\n add_filter( $filter, array(&$this, 'add_header_columns') );\n add_filter( 'body_class', array(&$this, 'body_classes') );\n add_action('wp_print_styles', array(&$this, 'add_css') );\n\n add_filter( 'enter_title_here', array(&$this, 'change_title_text'), 10, 1 );\n add_filter( 'post_row_actions', array(&$this, 'remove_row_actions'), 10, 1 );\n add_filter( 'post_updated_messages', array(&$this, 'bbquotations_updated_messages') );\n\n add_action( 'admin_print_footer_scripts', array(&$this, 'remove_preview_button') );\n\n // add shortcode\n add_shortcode( 'bbquote', array(&$this, 'shortcode') );\n }",
"function ins_process_page(&$variables) {\n // Hook into color.module.\n if (module_exists('color')) {\n _color_page_alter($variables);\n }\n \n}",
"public function ThemeEngineRender(){\n\t\t// Get the path and settings for the Theme\n\t\t$themeName = $this->config['theme']['name'];\n\t\t$themePath = RAND_INSTALL_PATH . \"/themes/{$themeName}\";\n\t\t$themeUrl = $this->request->base_url . \"themes/{$themeName}\"; \n\n\t\t//Add stylesheet\n\t\t$this->data['stylesheet'] = \"{$themeUrl}/style.css\";\n\n\t\t//Include global functions and functions.php from the theme\n\t\t$rd = &$this;\n\t\t$globalFunctions = RAND_INSTALL_PATH . \"themes/functions.php\";\n\t\tif(is_file($globalFunctions)){\n\t\t\tinclude $globalFunctions;\n\t\t}\n\t\t$functionsPath = \"{$themePath}/functions.php\";\n\t\tif(is_file($functionsPath)){\n\t\t\tinclude $functionsPath;\n\t\t}\n\n\t\textract($this->data);\n\t\tinclude(\"{$themePath}/default.tpl.php\");\n\n\n\n\t}",
"function main() {\n\t\t$this->out(__('I18n Shell', true));\n\t\t$this->hr();\n\t\t$this->out(__('[E]xtract POT file from sources', true));\n\t\t$this->out(__('[I]nitialize i18n database table', true));\n\t\t$this->out(__('[H]elp', true));\n\t\t$this->out(__('[Q]uit', true));\n\n\t\t$choice = strtolower($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));\n\t\tswitch ($choice) {\n\t\t\tcase 'e':\n\t\t\t\t$this->Extract->execute();\n\t\t\tbreak;\n\t\t\tcase 'i':\n\t\t\t\t$this->initdb();\n\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\t$this->help();\n\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\texit(0);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.', true));\n\t\t}\n\t\t$this->hr();\n\t\t$this->main();\n\t}",
"function tb_section_callback() {\n echo \"<p>Theme settings for Tickets Broadway</p>\";\n}",
"public function setup_theme()\n {\n }",
"function ibm_apim_theme_process_page(&$vars) {\r\n // Hook into the color module.\r\n if (module_exists('color')) {\r\n _color_page_alter($vars);\r\n }\r\n}",
"public static function run()\n {\n add_filter('pre_site_transient_update_themes', '__return_true');\n }",
"function bones_ahoy() {\n\n //Allow editor style.\n add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\n // enqueue Tickets Broadway specific scripts\n add_action( 'wp_enqueue_scripts', 'broadway_scripts');\n\n add_action( 'wp_enqueue_scripts', 'tickets_enqueue_scripts');\n\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n // run function for building out tickets table\n build_event_tbl();\n\n}",
"public function run()\n {\n if ($this->isDefaultThemeIsSet()) {\n $this->info('Theme is set already');\n return;\n }\n\n $fileConfig = new FileConfigService;\n $activeTheme = $fileConfig->set('theme.active', 'dot');\n $this->success('Set default theme is done');\n $this->insertDefaultTheme();\n $this->success('Insert new theme to database done');\n }",
"function sMain ()\n\t{\n\t\tglobal $ttH;\n\t\t\n\t\t$ttH->func->load_language_admin($this->modules);\n\t\t$ttH->temp_act = new XTemplate($ttH->path_html.$this->modules.DS.$this->action.\".tpl\");\n\t\t$ttH->temp_act->assign('LANG', $ttH->lang);\n\t\t$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);\n\t\t\n\t\t$fun = (isset($ttH->post['f'])) ? $ttH->post['f'] : '';\n\n\t\tflush();\n\t\tswitch ($fun) {\n\t\t\tcase \"list_widget\":\n\t\t\t\techo $this->do_list_widget();\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '';\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\texit;\n\t}",
"public function theme()\n {\n }",
"public function private_theme_functions()\n {\n // Adds plus button\n add_action('in_admin_header', [ & $this, 'addParallaxBlock'], -200);\n\n // Replace the common scripts\n add_action('wp_default_scripts', [$this, 'changeCommonScript'], 11);\n }",
"function bones_ahoy() {\n\n //Allow editor style.\n add_editor_style( get_current_revision(get_stylesheet_directory_uri() . '/library/css/editor-style.css' ));\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n //require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n //add_filter( 'excerpt_more', 'bones_excerpt_more' );\n add_filter( 'excerpt_length', 'bones_excerpt_length', 999 );\n\n add_action( 'wp_default_scripts', 'remove_jquery_migrate' );\n\n}",
"function okcdesign_preprocess_page(&$variables) {\n theme_plugins_invoke(__FUNCTION__, $variables);\n}",
"function display_theme($theme)\n {\n }",
"public function postProcess()\n {\n $pageId = Tools::getValue('id_page');\n if (Tools::isSubmit('submitEditCustomHTMLPage') || Tools::isSubmit('submitEditCustomHTMLPageAndStay')) {\n if ($pageId == 'new')\n $this->processAdd();\n else\n $this->processUpdate();\n }\n else if (Tools::isSubmit('status'.$this->table)) {\n $this->toggleStatus();\n }\n else if (Tools::isSubmit('delete'.$this->table)) {\n $this->processDelete();\n }\n }",
"public function after_setup_theme()\n {\n }"
]
| [
"0.6006836",
"0.5805936",
"0.57955307",
"0.57039696",
"0.5686233",
"0.55796105",
"0.5527659",
"0.5502935",
"0.54734594",
"0.54650664",
"0.54466856",
"0.54289013",
"0.5403688",
"0.53966403",
"0.5392407",
"0.5384376",
"0.5378697",
"0.53729475",
"0.5356937",
"0.53414154",
"0.5323767",
"0.53204423",
"0.53067374",
"0.5300726",
"0.52947825",
"0.52863115",
"0.5273954",
"0.52579325",
"0.523868",
"0.5222211"
]
| 0.7609848 | 0 |
Process header vars, e.g. site name, links. | function theme_hbmode_process_header($app, &$vars) {
$entries = $app->module('collections')->find("main_menu");
foreach ($entries as $entry) {
$vars['links'][$entry['_id']] = [
'title' => $entry['title'],
'slug' => $entry['link'],
];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _parseHeader() {}",
"public function populateHeaders(): void\n\t{\n\t\t$contentType = $_SERVER['CONTENT_TYPE'] ?? getenv('CONTENT_TYPE');\n\t\tif (! empty($contentType))\n\t\t{\n\t\t\t$this->setHeader('Content-Type', $contentType);\n\t\t}\n\t\tunset($contentType);\n\n\t\tforeach ($_SERVER as $key => $val)\n\t\t{\n\t\t\tif (sscanf($key, 'HTTP_%s', $header) === 1)\n\t\t\t{\n\t\t\t\t// take SOME_HEADER and turn it into Some-Header\n\t\t\t\t$header = str_replace('_', ' ', strtolower($header));\n\t\t\t\t$header = str_replace(' ', '-', ucwords($header));\n\n\t\t\t\t$this->setHeader($header, $_SERVER[$key]);\n\n\t\t\t\t// Add us to the header map so we can find them case-insensitively\n\t\t\t\t$this->headerMap[strtolower($header)] = $header;\n\t\t\t}\n\t\t}\n\t}",
"public function populate_headers() {\n // If header is already defined, return it immediately\n if (!empty($this->headers)) {\n return;\n }\n\n // In Apache, you can simply call apache_request_headers()\n if (function_exists('apache_request_headers')) {\n $this->headers = apache_request_headers();\n } else {\n isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE'];\n\n foreach ($_SERVER as $key => $val) {\n if (sscanf($key, 'HTTP_%s', $header) === 1) {\n // take SOME_HEADER and turn it into Some-Header\n $header = str_replace('_', ' ', strtolower($header));\n $header = str_replace(' ', '-', ucwords($header));\n\n $this->headers[$header] = $val;\n $this->header_map[strtolower($header)] = $header;\n }\n }\n }\n\n }",
"private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }",
"protected function ResolveHeaders() {\n\n $this->Headers= array();\n foreach($this->GetOption('RequestContext')->SERVER as $Key => $Value) {\n if (strncmp($Key, 'HTTP_', 5) === 0) {\n $Key= substr($Key, 5);\n } elseif (strncmp($Key, 'CONTENT_', 8) !== 0) {\n continue;\n }\n $Key= str_replace('_', '-', $Key);\n $this->Headers[$Key]= $Value;\n }\n }",
"private function setHeaderInformation()\n {\n $this->header = new \\stdClass();\n $request \t= \\Yii::$app->request;\n $requestHeaders = $request->getHeaders();\n foreach ($this->headerKey as $key => $value) {\n if ($requestHeaders->offsetExists($value)) {\n $this->header->$value = $requestHeaders->get($value);\n $this->header->status =200;\n } else {\n $this->header->status =500;\n yii::error('Header '.$value.\" is missing\", 'api_request');\n break;\n }\n }\n }",
"private function readHeaders() {\n $headers = $this->status->getHeaders();\n\n foreach ($headers as $key => $value) {\n switch ($key) {\n case \"Location\":\n $this->response['location'] = $value[0];\n break;\n\n case \"Content-Type\":\n $this->response['content_type'] = $value[0];\n break;\n\n case \"Content-Length\":\n $this->response['content_length'] = $value[0];\n break;\n\n default:\n break;\n }\n }\n }",
"public function headerHandle()\n\t{\t\n\t\t$headers = array();\n\t\tif(is_array($this->server->all()))\n\t\t{\n\t\t\tforeach($this->server->all() as $key=>$val)\n\t\t\t{\n\t\t\t\tif('http_' == strtolower(substr($key,0,5)))\n\t\t\t\t{\n\t\t\t\t\t$headers[substr($key,5)] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $headers;\n\t}",
"private function loadHeaders()\n {\n foreach ($_SERVER as $key => $value) {\n $subset = substr($key, 0, 5);\n if ($subset <> 'HTTP_' && $subset <> 'CONTE') {\n continue;\n }\n $header = str_replace(\n ' ',\n '-',\n ucwords(\n str_replace(['http_', '_'], ['', ' '], strtolower($key))\n )\n );\n $this->headers[$this->headerKey($header)] = [$value];\n }\n }",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}",
"private function header_handler($ch, $header) {\r\n\t\t$line = trim($header);\r\n\t\tif (!empty($line)) {\r\n\t\t\tif (count($this->log[\"response\"]) == 0) { $this->location_idx++; }\t\t\t\t\t\t\t\t# first location\r\n\t\t\tif (!isset($this->log[\"response\"][$this->location_idx])) {\t\t\t\t\t\t\t\t\t\t# initialize array for each location\r\n\t\t\t\t$this->log[\"response\"][$this->location_idx] = $this->log[\"set-cookie\"][$this->location_idx] = $this->header_vars[$this->location_idx] = array();\r\n\t\t\t}\r\n\t\t\t$this->log[\"response\"][$this->location_idx][] = $line;\r\n\t\t\t# inspect name / value pair\r\n\t\t\t$pair = explode(\":\", $header, 2);\r\n\t\t\tif (count($pair) == 2) {\r\n\t\t\t\t$pair[0] = strtolower(trim($pair[0]));\r\n\t\t\t\t$pair[1] = trim($pair[1]);\r\n\t\t\t\tif ($pair[0] == \"set-cookie\") { $this->cookie_handler($pair[1]); }\t\t\t\t\t\t\t# received cookie headers will still be processed as read-only variables even when no cookie handling is enabled\r\n\t\t\t\telse {\r\n\t\t\t\t\t# store name / value pair, and additionally an array of valid ip extracted from value that may be useful sometimes\r\n\t\t\t\t\t$this->header_vars[$this->location_idx][$pair[0]] = $pair[1];\r\n\t\t\t\t\t$extracted_ips = $this->extract_ips($pair[1]);\r\n\t\t\t\t\tif (!empty($extracted_ips)) { $this->header_vars[$this->location_idx][$pair[0].\":ip\"] = $extracted_ips; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse { $this->location_idx++; }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# next header is related to a redirected location\r\n\t\treturn strlen($header);\r\n\t}",
"private function _processPDFHeader($matches)\r\n {\r\n //echo \"\\nPDF Header\\n\";\r\n $this->_bagHeader->header = $matches[0]; // matched line\r\n $this->_bagHeader->version = $matches[1]; // version part only\r\n $this->_seenHeader = true;\r\n }",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}",
"function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}"
]
| [
"0.6757736",
"0.6604717",
"0.65328854",
"0.6427626",
"0.63119924",
"0.6184931",
"0.6118294",
"0.6086866",
"0.60818964",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60685235",
"0.60566247",
"0.6031642",
"0.60125995",
"0.60125995",
"0.60125995",
"0.60125995",
"0.60125995",
"0.60125995",
"0.60125995"
]
| 0.67232805 | 1 |
Process footer vars, e.g. copyright, links. You can get data from singletons or collections and return it inside $vars. e.g.$vars['data'] = $app>module('singletons')>getData("footer"); | function theme_hbmode_process_footer($app, &$vars) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"function Page_DataRendered(&$footer) {\r\n\r\n\t\t// Example:\r\n\t\t//$footer = \"your footer\";\r\n\r\n\t}",
"abstract protected function footer();",
"abstract protected function footer();",
"public function hookFooter(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'.tpl');\n }",
"public function footer()\n\t{\n\t\t$social = array();\n\t\tif(!empty($this->cfg->facebook)){$social['facebook'] = $this->cfg->facebook;}\n\t\tif(!empty($this->cfg->instagram)){$social['instagram'] = $this->cfg->instagram;}\n\t\tif(!empty($this->cfg->youtube)){$social['youtube'] = $this->cfg->youtube;}\n\t\tif(!empty($this->cfg->twitter)){$social['twitter'] = $this->cfg->twitter;}\n\t\tif(!empty($this->cfg->tumblr)){$social['tumblr'] = $this->cfg->tumblr;}\n\t\t$links = $this->footer;\n\t\treturn view('footer')->with(compact('social','links'))->render();\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}",
"function Page_DataRendered(&$footer) {\n\n\t\t// Example:\n\t\t//$footer = \"your footer\";\n\n\t}"
]
| [
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.6557897",
"0.65134025",
"0.65134025",
"0.6510475",
"0.6504438",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229",
"0.6474229"
]
| 0.6911298 | 0 |
Generates a UI element for a particular URL and type | function add_UI($url, $doctype) {
$audio_type = 'audio/mp4';
switch($doctype) {
case 'photo':
echo '<img src="' . $url . '" />' . PHP_EOL;
break;
case 'video':
echo '<video src="' . $url
. '" controls>Please switch your browser to Chrome or Firefox</video>'
. PHP_EOL;
break;
case 'audio':
echo '<audio controls><source src="' . $url . '" type="' . $audio_type
. '">Please switch your browser to Chrome or Firefox</audio>' . PHP_EOL;
break;
default:
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getResourceTag($type, $url) {\r\n\t\tswitch($type) {\r\n\t\t\tcase self::RESOURCE_CSS:\r\n\t\t\t\treturn \"<link rel=\\\"stylesheet\\\" href=\\\"{$url}\\\"/>\";\r\n\t\t\tcase self::RESOURCE_JS:\r\n\t\t\t\treturn \"<script type=\\\"text/javascript\\\" src=\\\"{$url}\\\"></script>\";\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new \\simtpl\\exceptions\\source(\"Failed to get resource tag: unknown type {$type}\");\r\n\t\t}\r\n\t}",
"function typeextra_web_links_render($args)\n{\n \t// Fetch previous data\n\tlist($onlySelectedCategory, $selectedcategory, $singleDropDown) = explode(':',$args['typeData']);\n \n \tif (!pnModAPILoad('pagesetter', 'admin'))\n \treturn pagesetterErrorPage(__FILE__, __LINE__, 'Failed to load Pagesetter admin API');\n\n\t$categories = pnModAPIFunc('Web_Links', 'user', 'categories', array ());\n\n\t$html .= \"<label for=\\\"typeextra_weblinks_singledropdown\\\">\" . _PG_WEBLINKS_SINGLE_DROPDOWN . \"</label>: <input type=\\\"checkbox\\\" id=\\\"typeextra_weblinks_singledropdown\\\" name=\\\"typeextra_weblinks_singledropdown\\\" value=\\\"1\\\"\" . ( $singleDropDown ? \" checked=\\\"1\\\"\" : \"\" ) . \" /><br />\\n\";\n \t$html .= \"<label for=\\\"typeextra_weblinks_onlyselectedcat\\\">\" . _PG_WEBLINKS_ONLY_SELECTED_CAT . \"</label>: <input type=\\\"checkbox\\\" id=\\\"typeextra_weblinks_onlyselectedcat\\\" name=\\\"typeextra_weblinks_onlyselectedcat\\\" value=\\\"1\\\"\" . ( $onlySelectedCategory ? \" checked=\\\"1\\\"\" : \"\" ) . \" /><br />\\n\";\n\t$html .= \"<label for=\\\"typeextra_weblinks_category\\\">\" . _PG_WEBLINKS_SINGLE_DROPDOWN . \"</label>: <select id=\\\"typeextra_weblinks_category\\\" typeextra_weblinks_category=\\\"category\\\">\\n\";\n\tforeach ($categories as $category) {\t\n\t\tif ($category['cat_id'] == $selectedcategory ) {\n\t\t\t$html .= \"<option value=\\\"\".$category['cat_id'].\"\\\" selected=\\\"selected\\\">\".$category['title'].\"</option>\\n\";\n\t\t} else {\n\t\t\t$html .= \"<option value=\\\"\".$category['cat_id'].\"\\\">\".$category['title'].\"</option>\\n\";\n\t\t}\n\t}\n\t$html .= \"</select>\\n\";\n\n \t// VERY IMPORTANT\n \t// Implement a JavaScript function that reads the selected publication type ID\n \t// and returns. The name of the function \"typeextra_submit\" is required by the\n \t// surrounding code.\n \t$html .= \"\n<script type='text/javascript'>\nfunction typeextra_submit()\n{\n\tvar flag = document.getElementById('typeextra_weblinks_onlyselectedcat');\n var onlySelectedCategory = (flag.checked) ? 1 : 0;\n var selectedcategory = document.getElementById('typeextra_weblinks_category').value;\n flag = document.getElementById('typeextra_weblinks_singledropdown');\n var singleDropDown = (flag.checked) ? 1 : 0;\n\treturn onlySelectedCategory + ':' + selectedcategory + ':' + singleDropDown;\n}\n</script>\n\";\n return $html;\n}",
"function createurl($type, $params=array()){\n\t$page=(isset($params[\"page\"]))? (($params[\"page\"]>1)? \"page\".$params[\"page\"].\"/\" : \"\"): \"\";\n\t//set the hidden type to hidden only if the passed value is set and equal to show\n\t$hidden=(isset($params['hidden']) && $params['hidden']=='show')? 'hidden/' : '';\n\t$base=\"http://collabor8r.com/\";\n\tswitch($type){\n\t\tcase \"user\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/\".$hidden.$page;\n\t\tcase \"classes\":\n\t\t\treturn $base.\"classes/\";\n\t\tcase \"classessummary\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\";\n\t\tcase \"classesall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/all/\".$hidden.$page;\n\t\tcase \"classesstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/stories/\".$hidden.$page;\n\t\tcase \"classescomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/comments/\".$hidden.$page;\n\t\tcase \"classsummary\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/\";\n\t\tcase \"classall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/all/\".$hidden.$page;\n\t\tcase \"classstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/stories/\".$hidden.$page;\n\t\tcase \"classcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/comments/\".$hidden.$page;\n\t\tcase \"classmember\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/classmember/\".$id[\"classmemberid\"].\"/\".$hidden.$page;\n\t\tcase \"feedall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/\".$hidden.$page;\n\t\tcase \"feedstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/stories/\".$hidden.$page;\n\t\tcase \"feedcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/comments/\".$hidden.$page;\n\t\tcase \"followingall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/\".$hidden.$page;\n\t\tcase \"followingstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/stories/\".$hidden.$page;\n\t\tcase \"followingcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/comments/\".$hidden.$page;\n\t\tcase \"users\":\n\t\t\treturn $base.'users/';\n\t\tcase \"userall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/all/\".$hidden.$page;\n\t\tcase \"userstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/stories/\".$hidden.$page;\n\t\tcase \"usercomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/comments/\".$hidden.$page;\n\t\tcase \"external\":\n\t\t\treturn $params[\"link\"];\n\t\tcase \"storylink\":\n\t\t\treturn $base.\"stories/\".$params[\"link\"].\"/\";\n\t\tcase \"options\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/options/\";\n\t\tcase \"submissions\":\n\t\t\treturn $base.$hidden.$page;\n\t\tcase \"tos\":\n\t\t\treturn $base.\"terms/\";\n\t\tcase \"404\":\n\t\t\treturn $base.\"404/\";\n\t\tcase \"403\":\n\t\t\treturn $base.\"403/\";\n\t\tcase \"info\":\n\t\t\treturn $base.$params[\"type\"].\"/\";\n\t\tcase 'search':\n\t\t\treturn $base.'search/';\n\t\tcase 'base':\n\t\t\treturn $base;\n\t\tdefault:\n\t\t\treturn $base.\"404/\";\n\t}//end switch type\n}",
"private static function getUrl($type,$id=\"\")\n\t{\n\t\t$link = self::base_url;\n\t\tswitch ($type) {\n\t\t\tcase 1:\n\t\t\t\t$link = $link.\"collections\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$link = $link.\"bills\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$link = $link.\"collections/\".$id;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$link = $link.\"bills/\".$id;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $link;\n\t}",
"function url($type) {\n return $this->urlPattern.$type.'.xml';\n }",
"private function create_url ( $type = 'html' ) {\n\t\t\t\n\t\t\t$year = $this->date->format('Y');\n\t\t\t$month = $this->date->format('m');\n\t\t\t$day = $this->date->format('d');\n\t\t\t\n\t\t\t$slug = implode( '/', array( $this->airport_code, $year, $month, $day ) );\n\t\t\t\n\t\t\t$url = 'http://www.wunderground.com/history/airport/' . $slug . '/DailyHistory.html';\n\t\t\t\n\t\t\tif ( $type == 'csv' ) {\n\t\t\t\t$url = $url . '?format=1';\n\t\t\t}\n\t\t\t\n\t\t\treturn $url;\n\t\t\t\n\t\t}",
"public function url_type();",
"function viewItemType() {\n//\t\tglobal $HTML;\n\t\tglobal $page;\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()->viewItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}",
"public function __construct($type)\n {\n switch ($type) {\n case 'landing':\n $this -> buttons = [\n [\n 'href' => route('prog.vital'),\n 'color' => 'purple',\n 'description' => 'Programa Vital'\n ],\n [\n 'href' => route('prog.amigos'),\n 'color' => 'pink',\n 'description' => 'Amigos de Corazón'\n ]\n ];\n break;\n case 'home':\n $this -> buttons = [\n [\n 'href' => \"#\",\n 'color' => 'blue',\n 'description' => 'Indicadores'\n ],\n [\n 'href' => \"#\",\n 'color' => 'green',\n 'description' => 'Eventos'\n ],\n [\n 'href' => \"#\",\n 'color' => 'green',\n 'description' => 'Noticias'\n ]\n ];\n break;\n default:\n $this -> buttons = [\n [\n 'href' => \"#\",\n 'color' => 'purple',\n 'description' => 'TITLE'\n ],\n [\n 'href' => \"#\",\n 'color' => 'pink',\n 'description' => 'TITLE'\n ],\n [\n 'href' => \"#\",\n 'color' => 'yellow',\n 'description' => 'TITLE'\n ]\n ];\n break;\n }\n }",
"protected function getType()\n {\n return 'pdd.ddk.lottery.url.gen';\n }",
"function fetchButton( $type='Popup', $name = '', $text = '', $url = '', $popupOptions = array() )\n {\n $defaultOptions = array( 'class' => 'modal', 'size' => array('x' => 640, 'y' => 500));\n $options = array_merge( $defaultOptions, $popupOptions);\n\n $text\t= JText::_($text);\n $class\t= $this->fetchIconClass($name);\n $doTask\t= $this->_getCommand($name, $url);\n\n $modalOptionsString = Sh404sefHelperHtml::makeSqueezeboxOptions( $options);\n $rel = ' {handler: \\'iframe\\'' . (empty($modalOptionsString) ? '' : ', ' . $modalOptionsString) . '}';\n\n $html\t= \"<a class=\\\"{$options['class']}\\\" href=\\\"$doTask\\\" rel=\\\"$rel\\\">\\n\";\n $html .= \"<span class=\\\"$class\\\" title=\\\"$text\\\">\\n\";\n $html .= \"</span>\\n\";\n $html\t.= \"$text\\n\";\n $html\t.= \"</a>\\n\";\n\n return $html;\n }",
"protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {\n global $DB;\n\n switch ($type) {\n case 'User templates Import':\n return new \\moodle_url('/mod/surveypro/utemplate_import.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id]);\n\n case 'Master templates Apply':\n return new \\moodle_url('/mod/surveypro/mtemplate_apply.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id]);\n\n case 'Colles Summary report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'summary']);\n\n case 'Colles Scales report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'scales']);\n\n case 'Colles Questions Relevance report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '0']);\n\n case 'Colles Questions Reflective thinking report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '1']);\n\n case 'Colles Questions Interactivity report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '2']);\n\n case 'Colles Questions Tutor support report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '3']);\n\n case 'Colles Questions Peer support report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '4']);\n\n case 'Colles Questions Interpretation report':\n return new \\moodle_url('/mod/surveypro/report/colles/view.php',\n ['id' => $this->get_cm_by_surveypro_name($identifier)->id, 'type' => 'questions', 'area' => '5']);\n\n default:\n throw new Exception('Unrecognised surveypro page type \"' . $type . '.\"');\n }\n }",
"public function __construct($type, $id = null, $url = null);",
"static public function getInstance($type, $attr)\n {\n try {\n $name = (isset($attr['name'])) ? $attr['name'] : '';\n $value = (isset($attr['value'])) ? $attr['value'] : '';\n $matchValue = (isset($attr['matchValue'])) ? $attr['matchValue'] : '';\n $options = (isset($attr['options'])) ? $attr['options'] : '';\n $label = (isset($attr['label'])) ? $attr['label'] : '';\n $group = (isset($attr['group'])) ? $attr['group'] : '';\n $attrib = (isset($attr['attr'])) ? $attr['attr'] : '';\n $time = (isset($attr['time'])) ? $attr['time'] : '';\n $config = (isset($attr['config'])) ? $attr['config'] : '';\n\n Loader::loadClass($type, CLASS_DIR . '/blackcat/view/form/elements');\n\n switch ($type) {\n case 'InputText':\n $obj = new InputText($name, $value, $attrib, $label);\n break;\n\n case 'InputPassword':\n $obj = new InputPassword($name, $value, $attrib, $label);\n break;\n\n case 'InputHidden':\n $obj = new InputHidden($name, $value);\n break;\n\n case 'InputSubmit':\n $obj = new InputSubmit($name, $value, $attrib);\n break;\n\n case 'InputReset':\n $obj = new InputReset($name, $value, $attrib);\n break;\n\n case 'InputCheck':\n $obj = new InputCheck($name, $value, $matchValue, $attrib, $label);\n break;\n\n case 'InputRadio':\n $obj = new InputRadio($name, $value, $matchValue, $attrib, $label);\n break;\n\n case 'InputFile':\n $obj = new InputFile($name, $value, $attrib, $label);\n break;\n \n case 'InputDate':\n $obj = new InputDate($name, $value, $attrib, $time);\n break;\n \n case 'InputEditor':\n $obj = new InputEditor($name, $value, $config, $attrib); \n break;\n \n case 'Button':\n $obj = new Button($name, $value, $attrib);\n break;\n\n case 'TextArea':\n $obj = new TextArea($name, $value, $attrib);\n break;\n\n case 'SelectBox':\n $obj = new Selectbox($name, $options, $matchValue, $attrib, $group);\n break;\n\n default:\n $obj = NULL;\n break;\n }\n\n return $obj;\n } catch (IOException $e) { Error::store($e->getMessage()); }\n\n return null;\n }",
"function element_div($text='', $xmlUrl='', $htmlUrl='', $type='rss', $tooltip=null, $hasChildren = false)\r\n {\r\n $this->nextid++; // Get a unique ID\r\n $folder = $this->name . $this->nextid;\r\n $display_content = '<div class=\"opml-browser-element\" id=\"opml-browser-element' . $folder .'\" >';\r\n $display_content .= '<span class=\"opml-browser-buttondiv\">';\r\n if (!is_null($xmlUrl) && ($xmlUrl != '')) // Use a feed icon if we have an XML source for this entry\r\n $display_content .= '<a href=\"' . htmlspecialchars($xmlUrl, ENT_COMPAT, \"UTF-8\", false) . '\"><img id=\"opml-browser-button' . $folder . '\" class=\"opml-browser-button opml-browser-item\" src=\"' . $this->image_link($type) .'\" alt=\"Subscribe\" /></a>';\r\n if ($hasChildren && $this->show_folders) // A folder icon for categories\r\n {\r\n $display_content .= '<img id=\"opml-browser-folder' . $folder . '\" class=\"opml-browser-button opml-browser-category\" src=\"' . $this->image_link('folderopen'). '\" alt=\"Category\" />';\r\n $this->folders[] = $folder; // Save to the list of folders for the close_all() method\r\n }\r\n $display_content .= '</span><span class=\"opml-browser-text'; // Common class for all elements for styling\r\n if ($hasChildren)\r\n $display_content .= ' opml-browser-category'; // Class for category entries to allow custom styling\r\n else\r\n $display_content .= ' opml-browser-item'; // And a different one for line items\r\n $display_content .= '\" >';\r\n if (!is_null($htmlUrl) && ($htmlUrl != ''))\r\n $display_content .= '<a href=\"' . htmlspecialchars($htmlUrl, ENT_COMPAT, \"UTF-8\", false) . '\">'; // Link the HTML\r\n $display_content .= htmlspecialchars($text, ENT_COMPAT, \"UTF-8\", false);\r\n if (!is_null($htmlUrl) && ($htmlUrl != ''))\r\n $display_content .= '</a>';\r\n $display_content .= '</span>';\r\n if (isset($tooltip)) {\r\n $display_content .= '<span class=\"opml-browser-tooltip opml-browser-invisible\">' .\r\n htmlspecialchars($tooltip, ENT_COMPAT, \"UTF-8\", false) . '</span>';\r\n }\r\n return $display_content;\r\n }",
"public function link($type='')\n\t{\n\t\t$link = $this->_base;\n\n\t\t// If it doesn't exist or isn't published\n\t\tswitch (strtolower($type))\n\t\t{\n\t\t\tcase 'edit':\n\t\t\t\t$link .= '&task=edit&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'delete':\n\t\t\t\t$link .= '&task=delete&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'answer':\n\t\t\t\t$link .= '&task=answer&id=' . $this->get('id') . '#comments';\n\t\t\tbreak;\n\n\t\t\tcase 'comments':\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id') . '#comments';\n\t\t\tbreak;\n\n\t\t\tcase 'math':\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id') . '#math';\n\t\t\tbreak;\n\n\t\t\tcase 'report':\n\t\t\t\t$link = 'index.php?option=com_support&task=reportabuse&category=question&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'permalink':\n\t\t\tdefault:\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id');\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $link;\n\t}",
"function model_set_url($hook, $type, $url, $params) {\n\t$entity = $params['entity'];\n\tif (elgg_instanceof($entity, 'object', 'model')) {\n\t\t$friendly_title = elgg_get_friendly_title($entity->title);\n\t\treturn \"model/view/{$entity->guid}/$friendly_title\";\n\t}\n}",
"public function link($type = '')\n\t{\n\t\tif (!isset($this->url))\n\t\t{\n\t\t\t$this->url = 'index.php?option=com_projects&alias=' . $this->get('alias');\n\t\t}\n\n\t\t$type = strtolower($type);\n\n\t\t// If it doesn't exist or isn't published\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'setup':\n\t\t\tcase 'edit':\n\t\t\t\t$link = $this->url . '&task=' . $type;\n\t\t\tbreak;\n\n\t\t\tcase 'thumb':\n\t\t\t\t$link = $this->picture();\n\t\t\tbreak;\n\n\t\t\tcase 'stamp':\n\t\t\t\t$link = 'index.php?option=com_projects&task=get';\n\t\t\tbreak;\n\n\t\t\tcase 'permalink':\n\t\t\tdefault:\n\t\t\t\t$link = $this->url;\n\n\t\t\t\tif ($type)\n\t\t\t\t{\n\t\t\t\t\tif (\\Plugin::isEnabled('projects', $type))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link .= '&active=' . $type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $link;\n\t}",
"function emc_the_post_type_link( $type ) {\r\n\r\n\t$post_type = get_post_type_object( $type );\r\n\t$url = site_url( '/' ) . $post_type->rewrite[ 'slug' ] . '/';\r\n\r\n\t$html = sprintf( __( 'Part of the <a href=\"%1$s\" title=\"%2$s\">%3$s</a>', 'emc' ),\r\n\t\tesc_url( $url ),\r\n\t\tsprintf( __( 'View all %s', 'emc' ), esc_attr( $post_type->labels->name ) ),\r\n\t\tesc_html( $post_type->labels->name )\r\n\t);\r\n\r\n\techo $html;\r\n\r\n}",
"public function packageUri($type = 'css')\n {\n return $this->getDispatchFabricator()->package($this->dispatcherEntityName(), $type);\n }",
"abstract public function admin_add($type, $uri, Page $page);",
"function AddButtonURL( $ATitle, $AURL, $Size = \"full\"){\n $item['text'] = $ATitle;\n $item['url'] = $AURL;\n $item['size'] = $Size;\n return $item; \n}",
"public function auto_discovery_link_tag($model_or_url = \"posts\", $type = \"rss\", $additional_options = NULL) {\n\n $options = array(\n \"rel\" => \"alternate\",\n \"title\" => strtoupper($type)\n );\n\n switch ($type) {\n case \"atom\":\n $options['type'] = \"application/atom+xml\";\n break;\n case \"rss\":\n default:\n $type = \"rss\";\n $options['type'] = \"application/rss+xml\";\n break;\n }\n\n switch ($model_or_url) {\n case \"posts\":\n case \"comments\":\n $options['href'] = get_feed_url($model_or_url, $type);\n break;\n default:\n $options['href'] = $model_or_url;\n }\n\n if (is_array($additional_options)) {\n $options = array_merge($options, $additional_options);\n }\n\n return content_tag(\"link\", NULL, $options);\n }",
"public function element($type=self::default_input_type) {\n\t\tif ((bool) $this->_is_valid_type($type) === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($type != 'submit') {\n\t\t\tif (!isset($this->_attrs['name']) || empty($this->_attrs['name'])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($this->_attrs['name']) && !isset($this->_attrs['value']) && isset($this->_values[$this->_attrs['name']])) {\n\t\t\t$this->_attrs['value'] = $this->_values[$this->_attrs['name']];\n\t\t}\n\t\t\n\t\tif (isset($this->_attrs['name'])) {\n\t\t\t$this->_attrs['name'] = $this->_encrypt_name_attr($this->_attrs['name'], $this->_validators, $this->_filters);\n\t\t}\n\t\t\n\t\t$output = '';\n\t\t\n\t\t// Add the label in the begainning on the element\n\t\tif (isset($this->_attrs['label'])) { $output .= $this->_attrs['label']; }\n\t\t\n\t\t// Fetch the type\n\t\tif ($type == 'select') { // Select\n\t\t\t$output .= '<select';\n\t\t\t\tif ($this->_num_attrs($this->_attrs) > 0) { $output .= ' '; }\n\t\t\t\t$output .= $this->_render_attrs($this->_attrs);\n\t\t\t$output .= '>' . \"\\n\";\n\t\t\t\tforeach ($this->_options as $option) {\n\t\t\t\t\t$output .= $option;\n\t\t\t\t}\n\t\t\t$output .= '</select>' . \"\\n\";\n\t\t}\n\t\telse { // Other input (text, submit, etc...)\n\t\t\t$output .= '<input type=\"' . $type . '\" ';\n\t\t\t\t$output .= $this->_render_attrs($this->_attrs);\n\t\t\t$output .= '/>' . \"\\n\";\n\t\t}\n\t\t\n\t\tif (!isset($this->_attr['name'])) {\n\t\t\t$this->_elements[] = $output;\n\t\t}\n\t\t/*else if (array_key_exists($this->_elements, $this->_attr['name'])) {\n\t\t\treturn false;\n\t\t}*/\n\t\telse {\n\t\t\t$this->_elements[$this->_attr['name']] = $output;\n\t\t}\n\t\t$this->last_element = $output;\n\t\t$this->_clear_cache();\n\t\treturn $output;\n\t}",
"public function make($type);",
"function pleio_template_user_icon_url($hook, $type, $return_value, $params) {\n if ($return_value) {\n return null;\n }\n\n $user = $params['entity'];\n $size = $params['size'];\n\n if (!elgg_instanceof($user, 'user')) {\n return null;\n }\n\n $user_guid = $user->getGUID();\n $icon_time = $user->icontime;\n\n if (!$icon_time) {\n return \"/mod/pleio_template/src/images/user.png\";\n }\n\n if ($user->isBanned()) {\n return null;\n }\n\n $filehandler = new ElggFile();\n $filehandler->owner_guid = $user_guid;\n $filehandler->setFilename(\"profile/{$user_guid}{$size}.jpg\");\n\n try {\n if ($filehandler->exists()) {\n $join_date = $user->getTimeCreated();\n return \"mod/profile/icondirect.php?lastcache=$icon_time&joindate=$join_date&guid=$user_guid&size=$size\";\n }\n } catch (InvalidParameterException $e) {\n return \"/mod/pleio_template/src/images/user.png\";\n }\n\n return null;\n}",
"public function generateUrl($user,$url_val,$url_type){\n global $base_url;\n $data[\"error\"]=true;\n switch($url_type){\n case \"query\": $data['content'] = $base_url.\"views/home.php\".$url_val; $data[\"error\"] = false; break;\n case \"cart\":\n $data['content'] = $base_url.\"views/home.php?svsrch=\".md5($user).\":\".$url_val;$data[\"error\"]=false; break;\n default: return false; break;\n }\n return $data;\n }",
"function easy_reader_share_button($type){\n\tswitch($type){\n\t\tcase 'rss':\n\t\t\t$link = get_bloginfo('rss2_url');\n\t\t\t$title = 'Subscribe';\n\t\t\tbreak;\n\t\t\n\t\tcase 'bebo':\n\t\t\t$link = 'http://www.bebo.com/c/share?Url='.urlencode(get_permalink()).'&Title='.urlencode(get_the_title());\n\t\t\t$title = 'Share on Bebo';\n\t\t\tbreak;\n\t\t\n\t\tcase 'delicious':\n\t\t\t$link = \"http://del.icio.us/post?url=\".urlencode(get_permalink()).\"&title=\".urlencode(get_the_title());\n\t\t\t$title = 'Bookmark on Delicious';\n\t\t\tbreak;\n\t\t\n\t\tcase 'digg':\n\t\t\t$link = \"http://digg.com/submit?phase=2&url=\".urlencode(get_permalink()).\"&title=\".urlencode(get_the_title());\n\t\t\t$title = 'Digg This';\n\t\t\tbreak;\n\t\t\n\t\tcase 'facebook':\n\t\t\t$link = \"http://www.facebook.com/sharer.php?u=\".urlencode(get_permalink()).\"&t=\".urlencode(get_the_title());\n\t\t\t$title = \"Share on Facebook\";\n\t\t\tbreak;\n\t\t\n\t\tcase 'google':\n\t\t\t$link = \"http://fusion.google.com/add?feedurl=\".urlencode(get_bloginfo('rss2_url'));\n\t\t\t$title = 'Import Into Google Reader';\n\t\t\tbreak;\n\t\t\n\t\tcase 'myspace':\n\t\t\t$link = \"http://www.myspace.com/Modules/PostTo/Pages/?u=\".urlencode(get_permalink());\n\t\t\t$title = 'Post On Myspace';\n\t\t\tbreak;\n\t\t\n\t\tcase 'orkut':\n\t\t\t$link = \"http://promote.orkut.com/preview?nt=orkut.com&du=\".urlencode(get_permalink()).\"&tt=\".urlencode(get_the_title());\n\t\t\t$title = 'Promote on Orkut';\n\t\t\tbreak;\n\t\t\n\t\tcase 'reddit':\n\t\t\t$link = \"http://reddit.com/submit?&url=\".urlencode(get_permalink()).\"&title=\".urlencode(get_the_title());\n\t\t\t$title = \"Share on Reddit\";\n\t\t\tbreak;\n\t\t\n\t\tcase 'stumbleupon':\n\t\t\t$link = \"http://www.stumbleupon.com/submit?url=\".urlencode(get_permalink()).\"&title=\".urlencode(get_the_title());\n\t\t\t$title = \"Stumble this\";\n\t\t\tbreak;\n\t\t\n\t\tcase 'technorati':\n\t\t\t$link = \"http://technorati.com/faves/?add=\".urlencode(get_permalink());\n\t\t\t$title = 'Favorite on Technorati';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'twitter':\n\t\t\t// TODO shorten this and let user add custom message\n\t\t\t$link = \"http://twitter.com/home?status=\".urlencode(get_permalink());\n\t\t\t$title = \"Tweet this\";\n\t\t\tbreak;\n\t}\n\t\n\t?><a href=\"<?php print $link ?>\" title=\"<?php print esc_attr($title) ?>\" rel=\"nofollow\"><img src=\"<?php print WP_PLUGIN_URL ?>/easy-reader/images/share/<?php print $type?>.png\" /></a><?php\n}",
"public function newElement($type) {\n\t\treturn new Html($type);\n\t}",
"private function build_url_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true) {\r\n $html = '';\r\n if ($_ptype != \"wccaf\") {\r\n if (isset($_meta[\"default_value\"]) && $_meta[\"default_value\"] != \"\") {\r\n $visual_type = (isset($_meta[\"view_in\"]) && ! empty($_meta[\"view_in\"])) ? $_meta[\"view_in\"] : \"link\";\r\n $open_tab = (isset($_meta[\"tab_open\"]) && ! empty($_meta[\"tab_open\"])) ? $_meta[\"tab_open\"] : \"_blank\";\r\n if ($visual_type == \"link\") {\r\n /* Admin wants this url to be displayed as LINK */\r\n $html = '<a href=\"' . $_meta[\"default_value\"] . '\" class=\"' . $_class . '\" target=\"' . $open_tab . '\" title=\"' . $_meta[\"tool_tip\"] . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</a>';\r\n } else {\r\n /* Admin wants this url to be displayed as Button */\r\n $html = '<button onclick=\"window.open(\\'' . $_meta[\"default_value\"] . '\\', \\'' . $open_tab . '\\' )\" title=\"' . $_meta[\"tool_tip\"] . '\" class=\"' . $_class . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</button>';\r\n }\r\n } else {\r\n /* This means url value is empty so no need render the field */\r\n $_wrapper = false;\r\n }\r\n } else {\r\n $html .= '<input type=\"text\" name=\"' . esc_attr($_meta['key']) . '\" class=\"wccaf-field short\" id=\"' . esc_attr($_meta['key']) . '\" placeholder=\"http://example.com\" wccaf-type=\"url\" value=\"' . esc_attr($_meta['value']) . '\" wccaf-pattern=\"mandatory\" wccaf-mandatory=\"\">';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }"
]
| [
"0.60887635",
"0.5835031",
"0.57966113",
"0.5723359",
"0.57111573",
"0.5615496",
"0.56128687",
"0.5579581",
"0.5574237",
"0.5548694",
"0.5546057",
"0.541296",
"0.536488",
"0.53569514",
"0.533531",
"0.530533",
"0.527585",
"0.52733254",
"0.52719784",
"0.5246138",
"0.5229157",
"0.52270514",
"0.5221141",
"0.52051544",
"0.519732",
"0.51902807",
"0.5178515",
"0.51726294",
"0.5156081",
"0.5151813"
]
| 0.6149222 | 0 |
Creates a payment method with the given payment details. | public function createPaymentMethod(PaymentMethodInterface $payment_method, array $payment_details); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createPayment()\n\t{\n\n\t}",
"public function createPayment(array $details): Payment\n {\n return $this->payments()->create($details);\n }",
"protected function createPayment() {\n /* @var \\Drupal\\commerce_payment\\Plugin\\Commerce\\PaymentGateway\\PaymentGatewayInterface $payment_gateway */\n $payment_gateway = $this->order->payment_gateway->entity;\n $payment_method = $this->order->payment_method->entity;\n\n $now = REQUEST_TIME;\n $mode = SIPSPaymentGateway::MODES[$payment_gateway->getPlugin()->configuration['mode']];\n\n // Create a payment entity which will be initially in \"pending mode\":\n // \"pending mode\": means that the payment was still not finished in SIPS,\n // so the user is in the platform filling in the credit card or he/she had\n // problems to pay that time (timeout/closed the browser/etc).\n $payment = Payment::create([\n 'order_id' => $this->order->id(),\n 'payment_method' => $payment_method->id(),\n 'payment_gateway' => $payment_gateway->id(),\n // Give it a status: pending/failed/done.\n 'state' => 'new',\n 'remote_state' => 'pending',\n // Give it a max_timestamp of 24 hours.\n 'authorization_expires' => $now + (24 * 60 * 60),\n // Give it a transaction reference.\n 'remote_id' => $this->order->id() . $now,\n 'test' => $mode != PaymentRequest::PRODUCTION,\n 'amount' => $this->order->getTotalPrice(),\n ]);\n\n $payment->save();\n\n return $payment;\n }",
"public function create_payment_method( WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$this->set_resource( 'paymentMethod' );\n\t\t$this->set_callback( 'create' );\n\n\t\t$this->request_data = array(\n\t\t\t'customerId' => $order->customer_id,\n\t\t\t'paymentMethodNonce' => $order->payment->nonce,\n\t\t);\n\n\t\t// add verification data for credit cards\n\t\tif ( 'credit_card' === $order->payment->type ) {\n\t\t\t$this->request_data['billingAddress'] = $this->get_billing_address();\n\t\t\t$this->request_data['cardholderName'] = $order->get_formatted_billing_full_name();\n\t\t\t$this->request_data['options'] = $this->get_credit_card_options();\n\t\t}\n\n\t\t// fraud data\n\t\t$this->add_device_data();\n\t}",
"public function createPaymentMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $payment_method = new PaymentMethod;\n $payment_method->fill($request->all());\n $payment_method->save();\n session()->flash('success_message', 'Nový způsob platby byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }",
"public function createPaymentMethod(CreatePaymentMethodRequest $request)\n {\n $this->apiData = $this->paymentMethodService->createPaymentMethod($request);\n\n return $this->success();\n }",
"public function makePayment() {\n\t\tLoggerRegistry::debug('CustomerModule::makePayment()');\n\t\t// TODO Payment gateway integration\n\t}",
"public function testIsPaymentMethodCreatable()\n {\n $params = self::PAYMENT_METHOD_PARAMS;\n\n $response = self::PAYMENT_METHOD_RESPONSE;\n\n $this->stubRequest(\n 'POST',\n '/payment_methods',\n $params,\n [],\n $response\n );\n\n $result = DirectDebit::createPaymentMethod($params);\n\n $this->assertEquals($response, $result);\n }",
"public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }",
"public static function createPaymentRequest(Context $context, $paymentMethod)\n {\n $invoiceAddress = new Address($context->cart->id_address_invoice);\n $deliveryAddress = new Address($context->cart->id_address_delivery);\n $invoiceCountry = new Country($invoiceAddress->id_country);\n $deliveryCountry = new Country($deliveryAddress->id_country);\n\n $orderTotal = $context->cart->getOrderTotal(false);\n $orderTotalWt = $context->cart->getOrderTotal();\n $orderTaxes = ($orderTotalWt - $orderTotal);\n\n // Get Payline instance\n $instance = self::getInstance();\n\n // Get custom payment page code\n if ($paymentMethod == self::WEB_PAYMENT_METHOD) {\n $customPaymentPageCode = Configuration::get('PAYLINE_WEB_CASH_CUSTOM_CODE');\n } elseif ($paymentMethod == self::RECURRING_PAYMENT_METHOD) {\n $customPaymentPageCode = Configuration::get('PAYLINE_RECURRING_CUSTOM_CODE');\n }\n if (empty($customPaymentPageCode)) {\n $customPaymentPageCode = null;\n }\n\n // Payment mode\n $paymentMode = 'CPT';\n if ($paymentMethod == self::RECURRING_PAYMENT_METHOD) {\n $paymentMode = 'NX';\n } elseif ($paymentMethod == self::SUBSCRIBE_PAYMENT_METHOD) {\n // Create first transaction into CPT mode, we will create recurrent wallet on notification/customer return\n $paymentMode = 'CPT';\n }\n // Payment action\n $paymentAction = '101';\n if ($paymentMethod == self::WEB_PAYMENT_METHOD) {\n $paymentAction = Configuration::get('PAYLINE_WEB_CASH_ACTION');\n } elseif ($paymentMethod == self::RECURRING_PAYMENT_METHOD) {\n $paymentAction = '101';\n } elseif ($paymentMethod == self::SUBSCRIBE_PAYMENT_METHOD) {\n $paymentAction = '101';\n }\n\n // Get contracts\n $contracts = self::getEnabledContracts(true);\n $secondContracts = self::getFallbackEnabledContracts(true);\n // Use first enabled contract\n $contractNumber = current($contracts);\n\n $params = array(\n 'version' => self::API_VERSION,\n 'payment' => array(\n 'amount' => round($orderTotalWt * 100),\n 'currency' => $context->currency->iso_code_num,\n 'mode' => $paymentMode,\n 'action' => $paymentAction,\n 'contractNumber' => $contractNumber,\n ),\n 'order' => array(\n 'ref' => 'cart' . (int)$context->cart->id . (!empty($context->cookie->pl_try) ? 'try' . $context->cookie->pl_try : ''),\n 'country' => $invoiceCountry->iso_code,\n 'amount' => round($orderTotal * 100),\n 'taxes' => round($orderTaxes * 100),\n 'date' => date('d/m/Y H:i'),\n 'currency' => $context->currency->iso_code_num,\n ),\n 'contracts' => (sizeof($contracts) ? $contracts : null),\n 'secondContracts' => (sizeof($secondContracts) ? $secondContracts : null),\n 'buyer' => array(\n 'title' => null,\n 'lastName' => $context->customer->lastname,\n 'firstName' => $context->customer->firstname,\n 'email' => $context->customer->email,\n 'customerId' => $context->customer->id,\n 'mobilePhone' => null,\n 'birthDate' => (Validate::isDate($context->customer->birthday) ? $context->customer->birthday : null),\n 'ip' => Tools::getRemoteAddr(),\n 'accountCreateDate' => (strtotime($context->customer->date_add) ? date('d/m/y', strtotime($context->customer->date_add)) : null),\n 'accountOrderCount' => (int)Order::getCustomerNbOrders($context->customer->id),\n ),\n 'shippingAddress' => self::formatAddressForPaymentRequest($deliveryAddress),\n 'billingAddress' => self::formatAddressForPaymentRequest($invoiceAddress),\n // URL\n 'notificationURL' => $context->link->getModuleLink('payline', 'notification', array(), true),\n 'returnURL' => $context->link->getModuleLink('payline', 'validation', array(), true),\n 'cancelURL' => $context->link->getPageLink('order'),\n );\n // Set mobile phone for buyer (check shipping first, then billing)\n if (!empty($params['shippingAddress']['mobilePhone'])) {\n $params['buyer']['mobilePhone'] = $params['shippingAddress']['mobilePhone'];\n } elseif (!empty($params['billingAddress']['mobilePhone'])) {\n $params['buyer']['mobilePhone'] = $params['billingAddress']['mobilePhone'];\n }\n // Set buyer gender\n $customerGender = new Gender($context->customer->id_gender);\n if (Validate::isLoadedObject($customerGender)) {\n if ($customerGender->type == 0) {\n // Male\n $params['buyer']['title'] = 4;\n } elseif ($customerGender->type == 1) {\n $params['buyer']['title'] = 1;\n }\n }\n // Set buyer wallet id\n if (($paymentMethod == self::WEB_PAYMENT_METHOD && Configuration::get('PAYLINE_WEB_CASH_BY_WALLET')) || ($paymentMethod == self::RECURRING_PAYMENT_METHOD && Configuration::get('PAYLINE_RECURRING_BY_WALLET')) || ($paymentMethod == self::SUBSCRIBE_PAYMENT_METHOD)) {\n $params['buyer']['walletId'] = Tools::encrypt((int)$context->customer->id);\n }\n // Customization\n if (!empty($customPaymentPageCode)) {\n $params['customPaymentPageCode'] = $customPaymentPageCode;\n }\n\n // Recurring informations (NX)\n if ($paymentMethod == self::RECURRING_PAYMENT_METHOD) {\n $params['recurring'] = self::getNxConfiguration($params['payment']['amount']);\n }\n\n // Add order details infos\n foreach ($context->cart->getProducts() as $cartProduct) {\n $instance->addOrderDetail(array(\n 'ref' => (string)$cartProduct['reference'],\n 'price' => round((float)$cartProduct['price'] * 100),\n 'quantity' => (int)$cartProduct['cart_quantity'],\n 'comment' => (string)$cartProduct['name'],\n 'category' => 'Cat. ' . (int)$cartProduct['id_category_default'],\n 'brand' => (int)$cartProduct['id_manufacturer'],\n 'taxRate' => round((float)$cartProduct['rate'] * 100),\n ));\n }\n\n // Add private data to the payment request\n $instance->addPrivateData(array('key' => 'id_cart', 'value' => (int)$context->cart->id));\n $instance->addPrivateData(array('key' => 'id_customer', 'value' => (int)$context->customer->id));\n $instance->addPrivateData(array('key' => 'secure_key', 'value' => (string)$context->cart->secure_key));\n // Add payment method to private data\n $instance->addPrivateData(array('key' => 'payment_method', 'value' => (int)$paymentMethod));\n $result = $instance->doWebPayment($params);\n\n if (self::isValidResponse($result)) {\n return array($result, $params);\n }\n\n return array(null, $params);\n }",
"public function testIsPaymentMethodCreatableWithHeaders()\n {\n $params = array_merge(\n self::PAYMENT_METHOD_PARAMS,\n array('for-user-id' => 'user-id')\n );\n\n $response = self::PAYMENT_METHOD_RESPONSE;\n\n $this->stubRequest(\n 'POST',\n '/payment_methods',\n $params,\n [],\n $response\n );\n\n $result = DirectDebit::createPaymentMethod($params);\n\n $this->assertEquals($response, $result);\n }",
"public function create($data)\n {\n // create the payment method\n $cpm = CompanyPaymentMethod::create($data);\n return $cpm;\n }",
"public function create()\n {\n\n $this->validate($this->request, Payment::createRules());\n\n $payment = new Payment;\n\n $payment->bill_id= $this->request->bill_id;\n \n $payment->save();\n \n return $this->response(201,\"Payment\", $payment );\n\n\n }",
"abstract public function getPaymentMethod();",
"public function createPayment(Paysera_WalletApi_Entity_Payment $payment)\n {\n return $this->mapper->decodePayment($this->client->post('payment', $this->mapper->encodePayment($payment)));\n }",
"public function createPayment()\n {\n //return dd($payment);\n //return view('frontend.checkout')->with(['payment' => $payment]);\n }",
"public function create()\n {\n $paymentMethod = new PaymentMethod();\n return view('paymentMethod.create',compact('paymentMethod'));\n }",
"public function dp_PaymentMethod_Insert($data)\n {\n return $this->call('dp_PaymentMethod_Insert', static::prepareParams($data, [\n 'CustomerVaultID' => ['string', 55], // Enter -0 to create a new Customer Vault ID record\n 'donor_id' => ['numeric'], //\n 'IsDefault' => ['bool'], // Enter 1 if this is will be the default EFT payment method. Note anything other than 1 (i.e. 0 or NULL fails and not sure why)\n 'AccountType' => ['string', 256], // e.g. ‘Visa’\n 'dpPaymentMethodTypeID' => ['string', 20], // e.g.; ‘creditcard’\n 'CardNumberLastFour' => ['string', 16], // e.g.; ‘4xxxxxxxxxxx1111\n 'CardExpirationDate' => ['string', 10], // e.g.; ‘0810’\n 'BankAccountNumberLastFour' => ['string', 50], //\n 'NameOnAccount' => ['string', 256], //\n 'CreatedDate' => ['date'], // Set as 'MM/DD/YYYY' only. Setting time values is not supported.\n 'ModifiedDate' => ['date'], // Set as 'MM/DD/YYYY' only. Setting time values is not supported.\n 'import_id' => ['numeric'], //\n 'created_by' => ['string', 20], //\n 'modified_by' => ['string', 20], //\n 'selected_currency' => ['string', 3], // e.g 'USD', 'CAD', per default currency used by the DonorPerfect client\n ]));\n }",
"public function testPaymentMethodCreationAndUpdate() {\n $default_address = [\n 'country_code' => 'US',\n 'administrative_area' => 'SC',\n 'locality' => 'Greenville',\n 'postal_code' => '29616',\n 'address_line1' => '9 Drupal Ave',\n 'given_name' => 'Bryan',\n 'family_name' => 'Centarro',\n ];\n $default_profile = $this->createEntity('profile', [\n 'type' => 'customer',\n 'uid' => $this->user->id(),\n 'address' => $default_address,\n ]);\n\n /** @var \\Drupal\\commerce_payment_example\\Plugin\\Commerce\\PaymentGateway\\OnsiteInterface $plugin */\n $this->drupalGet($this->collectionUrl);\n $this->getSession()->getPage()->clickLink('Add payment method');\n $this->assertSession()->addressEquals($this->collectionUrl . '/add');\n // Confirm that the default profile's address is rendered.\n foreach ($default_address as $property => $value) {\n $prefix = 'add_payment_method[billing_information][address][0][address]';\n $this->assertSession()->pageTextContains($value);\n $this->assertSession()->fieldNotExists($prefix . '[' . $property . ']');\n }\n\n $form_values = [\n 'add_payment_method[payment_details][number]' => '4111111111111111',\n 'add_payment_method[payment_details][expiration][month]' => '01',\n 'add_payment_method[payment_details][expiration][year]' => date('Y') + 1,\n 'add_payment_method[payment_details][security_code]' => '111',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->addressEquals($this->collectionUrl);\n $this->assertSession()->pageTextContains('Visa ending in 1111 saved to your payment methods.');\n\n $payment_method = PaymentMethod::load(1);\n $billing_profile = $payment_method->getBillingProfile();\n $this->assertEquals($this->user->id(), $payment_method->getOwnerId());\n $this->assertEquals($default_address, array_filter($billing_profile->get('address')->first()->getValue()));\n $this->assertEquals(2, $payment_method->getBillingProfile()->id());\n\n $this->drupalGet($this->collectionUrl . '/' . $payment_method->id() . '/edit');\n // Confirm that the default profile's address is rendered.\n foreach ($default_address as $property => $value) {\n $prefix = 'add_payment_method[billing_information][address][0][address]';\n $this->assertSession()->pageTextContains($value);\n $this->assertSession()->fieldNotExists($prefix . '[' . $property . ']');\n }\n $this->getSession()->getPage()->pressButton('billing_edit');\n\n $form_values = [\n 'payment_method[payment_details][expiration][month]' => '02',\n 'payment_method[payment_details][expiration][year]' => '2026',\n 'payment_method[billing_information][address][0][address][given_name]' => 'Johnny',\n 'payment_method[billing_information][address][0][address][family_name]' => 'Appleseed',\n 'payment_method[billing_information][address][0][address][address_line1]' => '123 New York Drive',\n 'payment_method[billing_information][address][0][address][locality]' => 'New York City',\n 'payment_method[billing_information][address][0][address][administrative_area]' => 'NY',\n 'payment_method[billing_information][address][0][address][postal_code]' => '10001',\n ];\n $this->submitForm($form_values, 'Save');\n $this->assertSession()->addressEquals($this->collectionUrl);\n $this->assertSession()->pageTextContains('2/2026');\n\n \\Drupal::entityTypeManager()->getStorage('commerce_payment_method')->resetCache([1]);\n \\Drupal::entityTypeManager()->getStorage('profile')->resetCache([2]);\n $payment_method = PaymentMethod::load(1);\n $this->assertEquals('2026', $payment_method->get('card_exp_year')->value);\n /** @var \\Drupal\\profile\\Entity\\ProfileInterface $billing_profile */\n $billing_profile = $payment_method->getBillingProfile();\n $this->assertEquals($this->user->id(), $payment_method->getOwnerId());\n $this->assertEquals('NY', $billing_profile->get('address')->first()->getAdministrativeArea());\n $this->assertEquals(2, $payment_method->getBillingProfile()->id());\n // Confirm that the address book profile was updated.\n $default_profile = $this->reloadEntity($default_profile);\n $this->assertTrue($billing_profile->get('address')->equals($default_profile->get('address')));\n }",
"public static function factory($attributes)\n {\n $instance = new self();\n $instance->revokedPaymentMethod = PaymentMethodParser::parsePaymentMethod($attributes);\n $instance->customerId = $instance->revokedPaymentMethod->customerId;\n $instance->token = $instance->revokedPaymentMethod->token;\n return $instance;\n }",
"public function create(){\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Set redirect URLs\n $redirectUrls = new RedirectUrls();\n\n if (App::environment() == 'production') {\n $app_url = \"https://doomus.com.br/public\";\n } else {\n $app_url = \"http://localhost:8000\";\n }\n\n $redirectUrls->setReturnUrl(\"$app_url/execute-payment\")\n ->setCancelUrl(\"$app_url/cancel-payment\");\n\n // Set payment amount\n if(session('cupom') !== null && session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(round(Cart::total(), 2) + str_replace(',','.', session('valorFrete')));\n }elseif(session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total() + str_replace(',','.', session('valorFrete')));\n }else{\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total());\n }\n\n // Set transaction object\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setDescription(\"Payment description\");\n\n // Create the full payment object\n $payment = new Payment();\n $payment->setIntent('sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n // Create payment with valid API context\n try {\n $payment->create($this->_apiContext);\n \n // Get PayPal redirect URL and redirect the customer\n return redirect($payment->getApprovalLink());\n \n // Redirect the customer to $approvalUrl\n } catch (PayPalConnectionException $ex) {\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n } catch (Exception $ex) {\n die($ex);\n }\n }",
"public function createTransferPayment(Request $request);",
"private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }",
"public function create(\n Token $token,\n int $amount,\n string $currency = 'GBP',\n string $description = null,\n array $metadata = [],\n string $customerUid = null,\n array $params = []\n ): Payment;",
"public function create()\n {\n try{\n $mollie = new MollieApiClient();\n $mollie->setApiKey(\"test_WD2sWvUWWRqBKfUTy5VS5t8f623ad3\");\n $payment = $mollie->payments->create([\n \"amount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"10.00\"\n ],\n \"description\" => \"My first API payment\",\n \"redirectUrl\" => \"http://google.com\",\n ]);\n return $payment->getCheckoutUrl();\n// header(\"Location: \" . $payment->getCheckoutUrl(), true, 303);\n } catch (\\Exception $e) {\n return response()->json($e->getMessage(), 400);\n }\n\n }",
"public function create()\n {\n return view('dashboard.payment-methods.create');\n }",
"public function createPayment(\n $source,\n $amount,\n string $currency,\n string $reference,\n string $methodId,\n string $method\n ) {\n $payment = null;\n\n // Create payment object\n $payment = new Payment($source, $currency);\n\n // Prepare the metadata array\n $payment->metadata['methodId'] = $methodId;\n\n // Get the quote\n $quote = $this->quoteHandler->getQuote();\n\n // Add the base metadata\n $payment->metadata = array_merge(\n $payment->metadata,\n $this->apiHandler->getBaseMetadata()\n );\n \n // Set the payment specifications\n $payment->capture = $this->config->needsAutoCapture($this->_code);\n $payment->amount = $this->quoteHandler->amountToGateway(\n $this->utilities->formatDecimals($amount),\n $quote\n );\n $payment->reference = $reference;\n $payment->success_url = $this->config->getStoreUrl() . 'checkout_com/payment/verify';\n $payment->failure_url = $this->config->getStoreUrl() . 'checkout_com/payment/fail';\n $payment->customer = $this->apiHandler->createCustomer($quote);\n $payment->shipping = $this->apiHandler->createShippingAddress($quote);\n $payment->description = __(\n 'Payment request from %1',\n $this->config->getStoreName()\n )->getText();\n $payment->payment_type = 'Regular';\n\n return $payment;\n }",
"public function initPaymentMethod()\n {\n $helper = Mage::helper('onestepcheckout/payment');\n // check if payment saved to quote\n if (!$this->getQuote()->getPayment()->getMethod()) {\n $data = array();\n $paymentMethods = $helper->getPaymentMethods();\n if ((count($paymentMethods) == 1)) {\n $currentPaymentMethod = current($paymentMethods);\n $data['method'] = $currentPaymentMethod->getCode();\n } elseif ($lastPaymentMethod = $helper->getLastPaymentMethod()) {\n $data['method'] = $lastPaymentMethod;\n } elseif ($defaultPaymentMethod = Mage::helper('onestepcheckout/config')->getDefaultPaymentMethod()) {\n $data['method'] = $defaultPaymentMethod;\n }\n if (!empty($data)) {\n try {\n $this->getOnepage()->savePayment($data);\n } catch (Exception $e) {\n // catch this exception\n }\n }\n }\n }",
"private function createPaymentModel(CreatePaymentData $paymentData, string $type): Payment\n {\n $payment = new Payment([\n 'type' => $type,\n 'amount' => $paymentData->getAmount(),\n 'paid_at' => $paymentData->getPaidAt(),\n 'reference' => $paymentData->getReference(),\n ]);\n\n $userId = $paymentData->getUserId();\n if (null !== $userId) {\n $payment->user_id = $userId;\n }\n\n return $payment;\n }",
"public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if(Invoice::setStatus($model->invoice_id, Invoice::STATUS_PAID) ) {\n Yii::$app->session->addFlash(\n 'success', Yii::t('auth', 'You have successfully payed Invoice № '\n . $model->invoice->invoice_number . ' by Payment № '\n . $model->id)\n );\n } else {\n Yii::$app->session->addFlash(\n 'error',\n Yii::t('auth', 'Sorry, but something went wrong, Invoice №'.\n $model->invoice->invoice_number . ' not payed')\n );\n }\n\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'invoicesList' => Invoice::getSelfInvoicesWithoutPaymentDropDown(Yii::$app->user->identity),\n 'paymentMethodList' => Payment::PAYMENT_METHODS_ARRAY,\n 'createFrom' => false\n ]);\n }\n }"
]
| [
"0.74206847",
"0.71568614",
"0.69920665",
"0.69359213",
"0.6576943",
"0.654405",
"0.6537641",
"0.65367395",
"0.63170093",
"0.63028896",
"0.6230322",
"0.6215662",
"0.6182721",
"0.61779064",
"0.6114539",
"0.6081557",
"0.60743964",
"0.6072241",
"0.6044847",
"0.60441643",
"0.6016651",
"0.5987345",
"0.5985771",
"0.59483284",
"0.59464955",
"0.5936664",
"0.5916939",
"0.5899668",
"0.587871",
"0.58649087"
]
| 0.8091649 | 0 |
Fetch Initial reviews data to display via DataTables | public function fetchData()
{
$reviews = Review::orderBy('created_at', 'desc')->get();
return Datatables::of($reviews)->addColumn('actions', function ($review)
{
return '<button class="btn btn-xs btn-default view" id="' . $review->id . '"><i class="glyphicon glyphicon-eye-open"></i> View</button>
<button class="btn btn-xs btn-primary edit" data-status="' . $review->status . '" id="' . $review->id . '"><i class="glyphicon glyphicon-edit"></i> Change Status</button>
<button class="btn btn-xs btn-danger delete" id="' . $review->id . '"><i class="glyphicon glyphicon-trash"></i> Delete</button>';
})
->addColumn('checkboxes', '<input type="checkbox" name="review_checkbox[]" class="review_checkbox" value="{{$id}}" />')
->addColumn('user_name', function ($review)
{
return $review->user->name;
})
->addColumn('product', function ($review)
{
return $review->product->name;
})
->addColumn('status', function ($review)
{
if ($review->status == 1)
{
return '<span id="' . $review->id . '" class="label label-success">Published</span>';
} else
{
return '<span id="' . $review->id . '" class="label label-warning">Waiting</span>';
}
})
->rawColumns(['actions', 'checkboxes', 'status'])->make(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReviewData() {\n\t\t//$stat = Statistic::select(array('statistic.id', 'statistic.created_at', 'statistic.ip_address','posts.title'))\n\t\t//->join('posts','posts.id','=','statistic.post_id')\n\t\t//->join('category','statistic.category_id','=','category.id')->groupBy('statistic.created_at'); \n\t\t$stat = StatView::select(array('id','date','review_name', 'ip_address'));\n\n\t\treturn Datatables::of($stat) \n\t\t\t-> add_column('actions','<a href=\"{{{ URL::to(\\'admin/blogs/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-xs btn-danger iframe\">{{{ Lang::get(\\'button.delete\\') }}}</a>')\n -> remove_column('id') -> make();\n\n\t}",
"public function review_datatable()\n\t\t{\n\t\t\t$list = $this->Reviews->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 $review) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\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=\"'.$review->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\">'.ucwords($review->reviewer_name).'</div>';\n\t\t\t\t\n\t\t\t\t//GENERATE STAR RATING\n\t\t\t\t$rating = $this->misc_lib->generateRatingStar($review->rating);\n\t\t\t\t\n\t\t\t\t$row[] = ' <span class=\"star-rating\">'.$rating.'</span>';\n\t\t\t\t\n\t\t\t\t//GET SELLERS DETAILS\n\t\t\t\t$user_array = $this->Users->get_user($review->seller_email);\n\t\t\t\t$fullname = '';\n\t\t\t\t$user_id = '';\n\t\t\t\t$profile_pic = '';\n\t\t\t\t$thumbnail = '';\n\t\t\t\t$user_avatar = '';\n\t\t\t\tif($user_array){\n\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t$user_id = $user->id;\n\t\t\t\t\t\t$fullname = $user->first_name .' '.$user->last_name;\n\t\t\t\t\t\t$user_avatar = $user->avatar;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filename = FCPATH.'uploads/users/'.$user_id.'/'.$user_avatar;\n\t\t\t\n\t\t\t\tif($user_avatar == '' || $user_avatar == null || !file_exists($filename)){\n\t\t\t\t\t$profile_pic = '<img src=\"'.base_url().'assets/images/icons/avatar.jpg\" class=\"img-circle profile_img\" alt=\"Profile Image\"/>';\n\t\t\t\t\t\n\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'assets/images/icons/avatar.jpg\" alt=\"Profile Image\" />';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$profile_pic = '<img src=\"'.base_url().'uploads/users/'.$user_id.'/'.$user_avatar.'\" class=\"img-circle profile_img\" alt=\"Profile Image\"/>';\n\t\t\t\t\t\n\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'uploads/users/'.$user_id.'/'.$user_avatar.'\" alt=\"Profile Image\" />';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$row[] = $profile_pic .'<div class=\"text-center\">'.$fullname.'</div>';\n\t\t\t\t\n\t\t\t\t$location = '<p>'.$review->ip_address.'</p>';\n\t\t\t\t$location .= $review->ip_details;\n\t\t\t\t\n\t\t\t\t$row[] = $location;\n\t\t\t\t$row[] = date(\"F j, Y, g:i a\", strtotime($review->review_date));\n\t\t\t\t\n\t\t\t\t$url = 'admin/review_details';\n\t\t\t\t\n\t\t\t\t//$row[] = $make->title;\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#viewModal\" href=\"!#\" class=\"btn btn-primary btn-xs\" onclick=\"viewReview('.$review->id.',\\''.$url.'\\')\" id=\"'.$review->id.'\" title=\"Click to View\"><i class=\"fa fa-search\"></i> View</a>';\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->Reviews->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Reviews->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 getData()\n {\n $reviews = $this->review->select('id as i', 'name', 'rating', 'description', 'description_en', 'created_at', 'visible as v')->orderBy('created_at', 'ASC');\n\n return datatables()->of($reviews)\n ->editColumn('description', '<div class=\"description_container\"><div class=\"inline_description\" data-id=\"{{ $i }}\">{{ $description }}</div></div>')\n ->editColumn('description_en', '<div class=\"description_en_container\"><div class=\"inline_description_en\" data-id=\"{{ $i }}\">{{ $description_en }}</div></div>')\n ->addColumn('actions', '<div class=\"btn-group\" role=\"group\"><button class=\"state_review btn btn-xs btn-info\" data-id=\"{{$i}}\" data-state=\"{{$v}}\"><i class=\"@if($v == 1) icon-checkbox-checked @else icon-checkbox-unchecked @endif\"></i></button> <button class=\"remove_review btn btn-xs btn-danger\" data-id=\"{{$i}}\"><i class=\"icon-trash\"></i></button></div>')\n ->removeColumn('v')\n ->removeColumn('i')\n ->rawColumns(['description', 'description_en', 'actions'])\n ->make();\n\n }",
"private function table_data() {\n\n\t\t// Get all the review data.\n\t\t$review_objects = Queries\\get_reviews_for_admin();\n\n\t\t// Bail with no data.\n\t\tif ( ! $review_objects ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Set my empty.\n\t\t$data = array();\n\n\t\t// Now loop each customer info.\n\t\tforeach ( $review_objects as $index => $review_object ) {\n\n\t\t\t// Set my product ID.\n\t\t\t$product_id = absint( $review_object->product_id );\n\n\t\t\t// Parse out the scoring data.\n\t\t\t$score_data = Utilities\\format_review_scoring_data( (array) $review_object, true );\n\n\t\t\t// Set up some custom args to include.\n\t\t\t$custom = array(\n\t\t\t\t'review_stamp' => strtotime( $review_object->review_date ),\n\t\t\t\t'review_product' => get_post_field( 'post_name', $product_id, 'raw' ),\n\t\t\t\t'product_data' => Helpers\\get_admin_product_data( $product_id ),\n\t\t\t\t'review_score' => $score_data['total_score'],\n\t\t\t\t//'attribute_ratings' => $score_data['rating_attributes'],\n\t\t\t);\n\n\t\t\t// Add on the attributes if they exist.\n\t\t\tif ( ! empty( $score_data['rating_attributes'] ) ) {\n\t\t\t\t$custom['attribute_ratings'] = $score_data['rating_attributes'];\n\t\t\t}\n\n\t\t\t// Set the base array of the data we want.\n\t\t\t$setup = wp_parse_args( $custom, (array) $review_object );\n\n\t\t\t// Run it through a filter.\n\t\t\t$data[] = apply_filters( Core\\HOOK_PREFIX . 'review_table_data_item', $setup, $review_object );\n\t\t}\n\n\t\t// Return our data.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'review_table_data_array', $data, $review_objects );\n\t}",
"public function getReviewCountData() {\n\t\t/*$stat = Statistic::select(array('statistic.id','statistic.post_id','posts.title', 'statistic.ip_address as access', 'statistic.created_at'))\n\t\t->join('posts','posts.id','=','statistic.post_id')->groupBy('title'); \n\t\n\n\t\treturn Datatables::of($stat) \n\t\t-> edit_column('created_at','{{ DB::table(\\'statistic\\')->where(\\'post_id\\', \\'=\\', $post_id)->orderBy(\\'created_at\\',\\'DESC\\')->first()->created_at }}')\n\t\t-> edit_column('access','{{ DB::table(\\'statistic\\')->where(\\'post_id\\', \\'=\\', $post_id) ->count() }}')\n -> remove_column('id') \n\t\t-> remove_column('post_id') \n -> make();\n*/\n\t\t$stat = StatView::select(array('id','review_name', 'ip_address as temp2', 'ip_address as temp1'))->groupBy('review_name');\n\t\t\n\t\treturn Datatables::of($stat) \n\t\t-> edit_column('temp1','{{ DB::table(\\'stat_view\\')->where(\\'review_name\\', \\'=\\', $review_name)->orderBy(\\'date\\',\\'DESC\\')->first()->date }}')\n\t\t-> edit_column('temp2','{{ DB::table(\\'stat_view\\')->where(\\'review_name\\', \\'=\\', $review_name)->count() }}')\n\t\t-> remove_column('id') \n\t\t-> make();\n\t}",
"public function getjournal_reviews($journal_id){\n $sql40 = \"select * from reviewer where journal_id='$journal_id' order by Position\";\n $result40 = mysqli_query($this->db,$sql40);\n while($reviewsdata = mysqli_fetch_array($result40)){\n echo '\n <tr data-position='.$reviewsdata['Position'].' data-index='.$reviewsdata['review_id'].'>\n \n <td>'.$reviewsdata['name'].'</td>\n <td>'.$reviewsdata['university_name'].'</td>\n <td>'.$reviewsdata['reviewer_designation'].'</td>\n <td>'.$reviewsdata['country'].'</td>\n <td>'.$reviewsdata['description'].'</td>\n \n <td class=\"text-center\">\n <a href=\"about_review_journal.php?review_id='.$reviewsdata['review_id'].'&journal_id='.$reviewsdata['journal_id'].'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"deletebyid.php?review_id='.$reviewsdata['review_id'].'&journal_id='.$reviewsdata['journal_id'].'\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>\n ';\n }\n }",
"private function getReviewData($reviewTitle){\r\n\t\t\t$result = $this->myDatabase->prepare(\"SELECT reviewID,userID,username,reviewTitle,platform,gameTitle,rating,difficulty,hoursPlayed,recommend,tags,summary,review,numComments FROM reviews WHERE reviewTitle LIKE '%\".$reviewTitle.\"%'\");\r\n\t\t\t//echo gettype($result);\r\n\t\t\t$result->bind_Param('s', $reviewTitle);\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$reView = 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($reView, $row);\r\n\r\n\t\t\t\t\t\t$result = $this->myDatabase->prepare(\"SELECT reviewID FROM reviews WHERE reviewTitle LIKE '%\".$reviewTitle.\"%'\");\r\n\t\t\t\t\t\t$result->bind_Param('s', $commentKey);\r\n\t\t\t\t\t\t$result->execute();\r\n\t\t\t\t\t\t$result = $result->get_result();\r\n\t\t\t\t\t\tfor ($t=0; $t < $result->num_rows; $t++) { \r\n\t\t\t\t\t\t\t//echo $t;\r\n\t\t\t\t\t\t\t$reviewID1 = $result->fetch_assoc();\r\n\t\t\t\t\t\t\t$reviewID2 = array_values($reviewID1);\r\n\t\t\t\t\t\t\t//echo ($reviewID2[0]);\r\n\t\t\t\t\t\t\t$reviewID3 = $reviewID2[0];\r\n\t\t\t\t\t\t\t$reviewID = $reviewID3;\r\n\t\t\t\t\t\t\t//echo gettype($reviewID3);\r\n\t\t\t\t\t\t\t//echo gettype($reviewID);\r\n\t\t\t\t\t\t\t$result1 = $this->myDatabase->prepare(\"SELECT comment FROM comments WHERE reviewID LIKE $reviewID\");\r\n\t\t\t\t\t\t\t$result1->bind_Param('s', $reviewID1);\r\n\t\t\t\t\t\t\t$result1->execute();\r\n\t\t\t\t\t\t\t$result1 =$result1->get_result();\r\n\t\t\t\t\t\t\t$commentArray = array();\r\n\t\t\t\t\t\t\tfor ($p=0; $p < $result1->num_rows; $p++) { \r\n\t\t\t\t\t\t\t$comments = $result1->fetch_assoc();\r\n\t\t\t\t\t\t\tarray_push($commentArray, $comments);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//array_push($reView, $commentArray);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tarray_push($reView, $commentArray);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$reViewObj = new stdClass();\r\n\t\t\t\t\t$reViewObj->reView = $reView;\r\n\t\t\t\t\theader('content-type: application/json');\r\n\t\t\t\t\techo json_encode($reViewObj); \r\n\t\t\t\t} else {\r\n\t\t\t\t\t/*if nothing is found*/\r\n \t$this->statuscode = 204;\r\n \t}\r\n\t\t\t} else {\r\n //If the SQL failed\r\n $this->statuscode = 400;\r\n echo '<script>console.log(\"If the SQL failed\"); </script>';\r\n \t} \r\n\t\t}",
"public function getAllReviews(){\n\t\t$sql = \"SELECT * FROM reviews\";\n\n\t\t// with PDO prepare for sql statment executing\n\t\t$pdo_statement = $this->dbh->prepare($sql);\n\n\t\t// sql execution\n\t\t$pdo_statement->execute();\n\t\t\n\t\t// return results\n\t\treturn $pdo_statement->fetchAll();\n\t}",
"public function reviews_data() {\n\t\tglobal $wpdb;\n\n\t\t$post_ids = $wpdb->get_col( $wpdb->prepare( \"\n\t\t\tSELECT comment_post_ID, AVG(meta_value) AS rating\n\t\t\tFROM {$wpdb->commentmeta}\n\t\t\tINNER JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t\tWHERE meta_key = %s AND {$wpdb->commentmeta}.comment_id IN (\n\t\t\t\tSELECT comment_id\n\t\t\t\tFROM {$wpdb->commentmeta}\n\t\t\t\tWHERE meta_key = %s AND meta_value = 1\n\t\t\t)\n\t\t\tGROUP BY {$wpdb->comments}.comment_post_ID\n\t\t\tORDER BY rating ASC\", 'edd_rating', 'edd_review_approved' ), 0 );\n\n\t\tif ( $post_ids ) {\n\t\t\t$this->total_count = count( $post_ids );\n\n\t\t\t$post_ids = array_map( 'intval', $post_ids );\n\n\t\t\t$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;\n\t\t\t$start = ( $pagenum - 1 ) * $this->per_page;\n\n\t\t\t$args = array(\n\t\t\t\t'numberposts' => $this->per_page,\n\t\t\t\t'offset' => $start,\n\t\t\t\t'post__in' => $post_ids,\n\t\t\t\t'orderby' => 'post__in',\n\t\t\t\t'post_type' => 'download'\n\t\t\t);\n\n\t\t\t$posts = get_posts( $args );\n\n\t\t\t$this->items = $posts;\n\n\t\t\treturn $posts;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function fetchPodUnapprovedCmt() {\n $start = Input::get('iDisplayStart'); // Offset\n $length = Input::get('iDisplayLength'); // Limit\n $sSearch = Input::get('sSearch'); // Search string\n $col = Input::get('iSortCol_0'); // Column number for sorting\n $sortType = Input::get('sSortDir_0'); // Sort type\n $where = '';\n\n // Datatable column number to table column name mapping\n $arr = array(\n 0 => 't1.id',\n 2 => 't2.title',\n 4 => 't3.name',\n 5 => 't1.created_at',\n );\n\n // Map the sorting column index to the column name\n $sortBy = $arr[$col];\n if ($sortBy == '') {\n $sortBy = \"t1.id\";\n }\n\n if ($sSearch != '') {\n $sSearch = addslashes($sSearch);\n $where = \" AND (t2.title LIKE ('%\" . $sSearch . \"%') OR t1.comment LIKE ('%\" . $sSearch . \"%') OR t3.name LIKE ('%\" . $sSearch . \"%'))\";\n }\n // Get the records after applying the datatable filters\n $comments = DB::select(\n DB::raw(\"SELECT t1.id, t1.comment, t1.created_at, t1.publish, t2.title,\"\n . \" t2.feature_image, t3.name FROM comments t1 INNER JOIN pod_casts \"\n . \"t2 ON t1.blog_or_pod_id=t2.id INNER JOIN users t3 \"\n . \"ON t1.user_id=t3.id WHERE t1.type='pod' AND t1.publish=0\" .\n $where . \" ORDER BY \" . $sortBy . \" \" . $sortType . \" LIMIT \" . $start . \", \" . $length)\n );\n\n // Get the total count without any condition to maintian the pagination\n $commentCount = DB::select(\n DB::raw(\"SELECT t1.id, t1.comment, t1.created_at, t1.publish, t2.title, t2.feature_image, t3.name FROM comments t1 INNER JOIN pod_casts t2 ON t1.blog_or_pod_id=t2.id INNER JOIN users t3 ON t1.user_id=t3.id WHERE t1.type='pod' \" .\n $where)\n );\n\n // Assign it to the datatable pagination variable\n $iTotal = count($commentCount);\n\n $response = array(\n 'iTotalRecords' => $iTotal,\n 'iTotalDisplayRecords' => $iTotal,\n 'aaData' => array()\n );\n\n $k = 0;\n if (count($comments) > 0) {\n foreach($comments as $comment) {\n $response['aaData'][$k] = array(\n 0 => $k + 1,\n 1 => '<img src=\"' . (isset($comment->feature_image) ? url('public/images/pod/' . $comment->feature_image) : url('public/images/pod/default.png')). '\" height=\"50px\" width=\"50px\" />',\n 2 => $comment->title,\n 3 => $comment->comment,\n 4 => $comment->name,\n 5 => date('d-m-Y', strtotime($comment->created_at)),\n 6 => ($comment->publish == 1 ? '<a href=\"pod/publish/' . $comment->id . '\" title=\"published\" '\n . 'onclick=\\'return confirm(\"Are you sure you want to unpublish this comment?\")\\'>'\n . '<i class=\"fa fa-cloud-upload text-success\"></i></a>' : '<a href=\"pod/publish/' . $comment->id . '\" title=\"unpublished\" '\n . 'onclick=\\'return confirm(\"Are you sure you want to publish this comment?\")\\'>'\n . '<i class=\"fa fa-cloud-upload text-danger\"></i></a> ')\n . ' <a href=\"pod_comment/delete/' . $comment->id . '\" c'\n . 'lass=\"delete hidden-xs hidden-sm\" title=\"Delete\" '\n . 'onclick=\\'return confirm(\"Are you sure you want to delete this comment?\")\\'>'\n . '<i class=\"fa fa-trash text-danger\"></i></a>'\n );\n $k++;\n }\n }\n return response()->json($response);\n }",
"public function getData()\n {\n if (Sentry::check()) {\n $branch_id = Sentry::getUser()->branch_id;\n if (Sentry::getUser()->isSuperUser()) {\n $associates = Associate::Select(\n array('associates.id', 'associates.name', 'associates.associate_no',\n 'associates.paid', 'associates.start_date')\n ) ->where('associates.name', '!=', 'COMPANY');\n }\n else {\n $associates = Associate::Select(\n array('associates.id', 'associates.name', 'associates.associate_no',\n 'associates.paid', 'associates.start_date')\n ) ->where('associates.branch_id', $branch_id);\n }\n\n if (Sentry::getUser()->hasAccess('associate-edit')) {\n return Datatables::of($associates)\n ->add_column(\n 'actions',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id ) }}}\"\n class=\"iframe btn btn-xs btn-info\">Details</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/tree\\') }}}\"\n class=\"iframe btn btn-xs btn-primary\">Tree</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/edit\\') }}}\"\n class=\"iframe btn btn-xs btn-danger\">Edit</a>\n '\n )\n ->add_column(\n 'receipts',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/receipt\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Receipt</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/welcome\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Welcome</a>\n '\n )\n ->remove_column('id')\n ->make();\n\n }\n else {\n return Datatables::of($associates)\n ->add_column(\n 'actions',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id ) }}}\"\n class=\"iframe btn btn-xs btn-info\">{{{ Lang::get(\\'button.details\\') }}}</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/tree\\') }}}\"\n class=\"iframe btn btn-xs btn-primary\">Tree</a>\n '\n )\n ->add_column(\n 'receipts',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/receipt\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Receipt</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/welcome\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Welcome</a>\n '\n )\n ->remove_column('id')\n ->make();\n }\n }\n else {\n return Redirect::route('login')->with('error', \" You are not logged in \");\n }\n }",
"public function renderTable()\n {\n $get = new GetBag();\n\n $type = $get->fetchEscape('type', $this->db);\n\n /**\n * Column order.\n */\n $order = $get->fetch('order');\n $order = $order[0]['column'];\n switch ($order) {\n case 0:\n $order = 'id';\n break;\n case 1:\n $order = 'date';\n break;\n default:\n $order = 'id';\n }\n\n $direction = $get->fetch('order');\n $direction = $direction[0]['dir'];\n\n /**\n * Total.\n */\n $total = 0;\n $queryTotal = \"SELECT COUNT(*) as `count` FROM `film_review` WHERE `status` = '{$type}'\";\n $result = $this->db->query($queryTotal);\n if ($row = $result->fetch_assoc()) {\n $total = $row['count'];\n }\n\n /**\n * Page offset.\n */\n $length = $get->fetchInt('length');\n $offset = $get->fetchInt('start');\n\n $order = $this->db->real_escape_string($order);\n $direction = $this->db->real_escape_string($direction);\n\n $query = \"SELECT t1.`id`, t1.`status`, t1.`filmId`, t1.`userId`, t1.`name`, t1.`text`, t1.`date`, t2.`login` \n FROM `film_review` as `t1` LEFT JOIN `user` as `t2` ON t1.`userId` = t2.`id` WHERE t1.`status` = '{$type}'\";\n $query .= \" ORDER BY t1.`{$order}` {$direction} LIMIT {$offset}, {$length}\";\n\n $data = [];\n $result = $this->db->query($query);\n while ($row = $result->fetch_assoc()) {\n $login = $row['login'];\n if (empty($login)) {\n $login = $row['name'];\n }\n \n $item[0] = $row['id'];\n $item[1] = $this->formatDate($row['date'], true);\n $item[2] = $row['userId'];\n $item[3] = $row['text'];\n $item[4] = $row['filmId'];\n $item[5] = $login;\n\n $data[] = $item;\n }\n\n $data = [\n 'draw' => $get->fetchInt('draw'),\n 'recordsTotal' => $total,\n 'recordsFiltered' => $total,\n 'data' => $data\n ];\n\n return json_encode($data);\n }",
"private function list_reviews() {\n\t\tglobal $adv_rvws_tbl, $dbh, $adv_info_tbl;\n\t\t\t\n\t\t$values = array();\n\t\t$values[] = (int)$_GET['loc_id'];\n\t\t$sql_query = \"SELECT\n\t\t\t\t\t\tid\n\t\t\t\t\t FROM\n\t\t\t\t\t\tadvertiser_reviews\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tapproved = 1\n\t\t\t\t\t AND\n\t\t\t\t\t\tadvertiser_id = ?\";\n\t\tif(isset($_GET['alt_loc_id'])){\n\t\t $sql_query .= \"\n\t\t \t\t\t\tAND\n\t\t\t\t\t\t advertiser_alt_id = ?\";\n\t\t $values[] = (int)$_GET['alt_loc_id'];\n\t\t} else {\n\t\t $sql_query .= \"\n\t\t\t\t\t\tAND\n\t\t\t\t\t\t (advertiser_alt_id is null OR advertiser_alt_id = 0)\";\t\t\t\t\n\t\t}\n\t\t$sql_query .= \"\n\t\t\t\t\tORDER BY added DESC\n\t\t\t\t\t LIMIT \".ADVERT_INFO_REVIEWS_DISP.\";\";\n\t\n\t\t\n\t\t$stmt = $dbh->prepare($sql_query);\t\t\t\t\t \n\t\t$result = $stmt->execute($values);\n\t\t\n\t\t// create review boxes\n\t\t$rev_box_arr = array();\n\t\twhile ($reviews = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n\t\t\t$adv_rvws_tbl->get_db_vars($reviews['id']);\n\t\t\t$rev_arr = array();\n\t\t\t$rev_arr['id'] = $reviews['id'];\n\t\t\t$rev_arr['added'] = $adv_rvws_tbl->added;\n\t\t\t$rev_arr['rating'] = $adv_rvws_tbl->rating;\n\t\t\t$rev_arr['review'] = $adv_rvws_tbl->review;\n\t\t\t\n\t\t\t$rev_box_arr[] = $this->reviews_box($rev_arr);\n\t\t}\n\t\t\n\t\t$rev_box_final = '';\n\t\tif (count($rev_box_arr) > 0) {\n\t\t // create review box area\n\t\t $rev_box_final = '<tr>\n\t\t \t\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t\t\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">';\n\t\t\t\t \n\t\t $rev_box_final .= implode($this->reviews_mid(),$rev_box_arr);\t\t\n\t\t\t\t \n\t\t $rev_box_final .= '</table>\n\t\t\t\t</td>\n\t\t </tr>';\n\t\t\t\n\t\t if (count($rev_box_arr) > 5) {\n\t\t\t \n\t\t\t$adv_info_tbl->get_db_vars((int)$_GET['loc_id']);\n\t\t\t \n\t\t\t$page_link = curPageURL().'/reviews/';\n\t\t\t\n\t\t\t$rev_box_final .= '<tr>\n\t\t\t <td colspan=\"2\" align=\"center\"><a href=\"#\"><strong>View All Reviews</strong></a></td>\n\t\t\t</tr>';\n\t\t }\n\t\t}\n\t\n\treturn $rev_box_final;\n\t}",
"public function fetchData()\n {\n $invoice = InvoiceAppointment::leftjoin('appointments as appt','appt.id','invoice_appointment.detail_id')\n ->leftjoin('appointment_status as appt_stat','appt_stat.appt_id','invoice_appointment.detail_id')\n ->where(fn($query) => $query\n ->where( 'appt.name', 'like', '%' . $this->search . '%')\n ->orWhere('invoice_appointment.total', 'like', '%' . $this->search . '%')\n )\n ->orderBy($this->sortBy, $this->sortDirection)\n ->paginate($this->perPage);\n $this->invappt = $invoice;\n\n /*For notifications*/\n $appoint = Appointment::leftjoin('appointment_status as apts','apts.appt_id','appointments.id')\n ->where('apts.status','Pending')\n ->latest()->get();\n $this->appt = $appoint;\n }",
"public function getCiReviews($data = array()) {\n\t\t$sql = \"SELECT r.*, cr.email, cr.store_id, cr.title, cr.comment, cr.coupon_code, cr.cireview_id, pd.name as product_name, p.image as product_image, SUM(crv.vote=1) as votes_up, SUM(crv.vote=0) as votes_down FROM \" . DB_PREFIX . \"review r LEFT JOIN \" . DB_PREFIX . \"cireview cr ON (r.review_id = cr.review_id) LEFT JOIN \" . DB_PREFIX . \"cireview_vote crv ON (cr.cireview_id = crv.cireview_id) LEFT JOIN \" . DB_PREFIX . \"product p ON (r.product_id = p.product_id) LEFT JOIN \" . DB_PREFIX . \"product_description pd ON (p.product_id = pd.product_id) WHERE r.review_id>0 AND pd.language_id='\". (int)$this->config->get('config_language_id') .\"'\";\n\n\t\tif (isset($data['filter_store_id']) && !is_null($data['filter_store_id'])) {\n\t\t\t$sql .= \" AND cr.store_id='\" . (int)$data['filter_store_id'] . \"'\";\n\t\t}\n\t\t/*new update ends*/\n\t\tif (!empty($data['filter_title'])) {\n\t\t\t$sql .= \" AND cr.title LIKE '\" . $this->db->escape($data['filter_title']) . \"%'\";\n\t\t}\n\t\t\n\t\tif (!empty($data['filter_email'])) {\n\t\t\t$sql .= \" AND cr.email LIKE '\" . $this->db->escape($data['filter_email']) . \"%'\";\n\t\t}\n\t\t\n\t\tif (!empty($data['filter_author'])) {\n\t\t\t$sql .= \" AND r.author LIKE '\" . $this->db->escape($data['filter_author']) . \"%'\";\n\t\t}\n\n\t\tif (!empty($data['filter_rating'])) {\n\t\t\t$sql .= \" AND r.rating = '\" . $this->db->escape($data['filter_rating']) . \"'\";\n\t\t}\n\n\t\tif (!empty($data['filter_product_id'])) {\n\t\t\t$sql .= \" AND r.product_id = '\" . $this->db->escape($data['filter_product_id']) . \"'\";\n\t\t}\n\n\t\tif (!empty($data['filter_product'])) {\n\t\t\t$sql .= \" AND pd.name LIKE '\" . $this->db->escape($data['filter_product']) . \"%'\";\n\t\t}\n\n\t\tif (isset($data['filter_vote']) && !is_null($data['filter_vote'])) {\n\t\t\t$sql .= \" AND crv.vote = '\" . $this->db->escape($data['filter_vote']) . \"'\";\n\t\t}\n\n\t\tif (isset($data['filter_status']) && !is_null($data['filter_status'])) {\n\t\t\t$sql .= \" AND r.status = '\" . (int)$data['filter_status'] . \"'\";\n\t\t}\n\t\t\n\t\tif (!empty($data['filter_date_added'])) {\n\t\t\t$sql .= \" AND DATE(r.date_added) = DATE('\" . $this->db->escape($data['filter_date_added']) . \"')\";\n\t\t}\n\n\t\t$sql .= \" GROUP BY r.review_id\";\n\t\t\n\n\t\t\n\n\t\t$sort_data = array(\n\t\t\t'r.author',\n\t\t\t'r.status',\n\t\t\t'r.rating',\n\t\t\t'r.date_added',\n\t\t\t'cr.email',\n\t\t\t'cr.title',\t\t\t\n\t\t\t/*new update starts*/'cr.store_id',/*new update ends*/\t\t\t\n\t\t\t'votes_down',\n\t\t\t'votes_up',\n\t\t\t'product_name',\n\t\t);\n\n\t\tif (isset($data['sort']) && in_array($data['sort'], $sort_data)) {\n\t\t\t$sql .= \" ORDER BY \" . $data['sort'];\n\t\t} else {\n\t\t\t$sql .= \" ORDER BY r.date_added\";\n\t\t}\n\n\t\tif (isset($data['order']) && ($data['order'] == 'DESC')) {\n\t\t\t$sql .= \" DESC\";\n\t\t} else {\n\t\t\t$sql .= \" ASC\";\n\t\t}\n\n\t\tif (isset($data['start']) || isset($data['limit'])) {\n\t\t\tif ($data['start'] < 0) {\n\t\t\t\t$data['start'] = 0;\n\t\t\t}\n\n\t\t\tif ($data['limit'] < 1) {\n\t\t\t\t$data['limit'] = 20;\n\t\t\t}\n\n\t\t\t$sql .= \" LIMIT \" . (int)$data['start'] . \",\" . (int)$data['limit'];\n\t\t}\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->rows;\n\t}",
"public function getAllReviews()\n {\n /* code goes here */\n }",
"public function data_fetch()\n\t{\t\n\t\t\n\t\tif(!$this->set_data->is_logged_in()){\n\t\t\tredirect('user/index');\n\t\t}\n\t\telse{ \t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Auto load pagination library */\n\t\t\t/* Set the pagination configs */\n \t\t$config['base_url'] = '/user/data_fetch';\n \t\t$config['total_rows'] = $this->db->get('UserDetails')->num_rows();\n \t\t$config['per_page'] = '10'; \n \t\t$this->pagination->initialize($config); \n\n\t\t\t$data['query'] = $this->user_model->retrieve(null,$config['per_page']);\n\t\t\t$this->layout->view('user/display_view',$data);\t\n\t\t\t\n\t\t}\n\t}",
"function print_allReview($result) {\n echo \"<br>Reviews:<br>\";\n echo \"<table>\";\n echo \"<tr><th>Review Number</th><th>Room Type</th><th>Rating</th><th>Content</th></tr>\";\n \n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[0] . \"</td><td>\" . $row[1] . \"</td><td>\" . $row[2] . \"</td><td>\" . $row[3] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n echo \"</table>\";\n \n }",
"public function getReviewIfRating() {\n //Try to get distinct\n $qry = $this->db->prepare('SELECT DISTINCT NAME,ADDRESS,SUBURB,LATITUDE,LONGITUDE,reviews.rating FROM n8598177.items INNER JOIN reviews ON reviews.hotspotName=items.NAME ');\n $qry->execute();\n foreach ($qry as $hotspot) {\n include('server/includes/recentReview.tpl.php');\n }\n }",
"public function ajax()\n {\n $this->app->get_table_data('discountlevels');\n }",
"function review_list($aprove){\n\t\t$query = $this->db->select(\"dbo.zItemInventoryDetailAll.ProductName,dbo.customer_rating.*,dbo.customer_user.FirstName,dbo.customer_user.MiddleName,dbo.customer_user.LastName,(SELECT COUNT(*) from [dbo].[review_help] where [dbo].[review_help].[review_id] = [dbo].[customer_rating].[ID]) as total, (SELECT COUNT(*) from [dbo].[review_help] where [dbo].[review_help].[review_id] = [dbo].[customer_rating].[ID] AND [dbo].[review_help].[action] = 'Yes') as totalhelp\")\n\t\t\t\t->from(\"dbo.customer_rating\")\n\t\t\t\t->join(\"dbo.customer_user\",\"dbo.customer_user.ID=dbo.customer_rating.customer_id\")\n\t\t\t\t->join(\"dbo.zItemInventoryDetailAll\",\"dbo.zItemInventoryDetailAll.ListID=dbo.customer_rating.product_id\")\n\t\t\t\t->where(\"dbo.customer_rating.admin_status\",$aprove)\n\t\t\t\t->order_by(\"dbo.customer_rating.created\",\"ASC\")\n\t\t\t\t->get()->result();\n\t\treturn $query;\n\t}",
"public function reviews()\n {\n $data[\"reviews\"] = Review::latest()\n ->paginate(config(\"constant.smPagination\"));\n\n if (\\request()->ajax()) {\n $json['data'] = view('sm-admin/common/product/reviews', $data)->render();\n $json['smPagination'] = view('sm-admin/common/common/pagination_links', [\n 'smPagination' => $data['reviews']\n ])->render();\n\n return response()->json($json);\n }\n\n return view(\"nptl-admin/common/product/manage_reviews\", $data);\n }",
"protected final function fetchRecords()\n {\n $this->query->setLimit(\n (($this->parameters->getCurrentPage() - 1) * $this->parameters->getResultsPerPage()),\n $this->parameters->getResultsPerPage()\n );\n\n $this->data = $this->query->execute()->getAssociative();\n }",
"function ajaxReviews($product_id){\n\n\t\t\t$this->load->model('review');\n\t\t\t$this->load->library('Ajax_pagination');\n\t\t\t$page = $this->input->post('page');\n\t\t\t$filter = $this->input->post('filter');\n\t\t\t$where = '';\n\t\t\t//find a current page\n\t\t\tif(!$page){\n\t\t\t\t$offset = 0;\n\t\t\t}else{\n\t\t\t\t$offset = $page;\n\t\t\t}\n\t\t\t//load positive or negative reviews if selected\n\t\t\tif($filter == 'positive'){\n\t\t\t\t$this->db->where('rating >',2);\n\t\t\t\t$where .= 'rating > 2 AND ';\n\t\t\t} elseif($filter == 'negative') {\n\t\t\t\t$this->db->where('rating <',3);\n\t\t\t\t$where .= 'rating < 3 AND ';\n\t\t\t}\n\t\t\t//pagination configuration\n\t\t\t$totalRec = $this->db->where('product_id',$product_id)->from(\"comments\")->count_all_results();\n\t\t\t$config['target'] = '#reviews';\n\t\t\t$config['base_url'] = base_url('index/ajaxreviews/'.$product_id);\n\t\t\t$config['total_rows'] = $totalRec;\n\t\t\t$config['per_page'] = 3;\n\t\t\t$this->ajax_pagination->initialize($config);\n\t //get the reviews data\n\t\t\t$where .= ' product_id = '.$product_id;\n\t\t\t$data['reviews'] = $this->review->get_reviews($where, $config['per_page'],$offset);\n\t //load a view\n\t\t\t$this->load->view('public/ajaxreviews',$data);\n\t\t}",
"public function review()\n {\n $experiences_review_query = DB::select(\"select `rd`.`id`, `rd`.`user_id`, `rd`.`reservation_status`, `rd`.`reservation_date`, `rd`.`reservation_time`, `rd`.`no_of_persons`,\n `products`.`name` as `product_name`, `vendors`.`id` as `vendor_id`, `vendors`.`name` as `vendor_name`,\n `rd`.`reservation_type`, `products`.`id` as `product_id`, `rd`.`vendor_location_id`,\n `rd`.`product_vendor_location_id`,\n `rd`.`special_request`, `rd`.`giftcard_id`, `rd`.`guest_name`, \n `rd`.`guest_name`, `rd`.`guest_email`, `rd`.`guest_phone`, \n `rd`.`points_awarded`, MAX(IF(pa.alias='short_description', pat.attribute_value,'')) AS product_short_description,\n MAX(IF(va.alias='short_description', vlat.attribute_value, ''))AS vendor_short_description, `ploc`.`name` as `product_locality`,\n `pvla`.`address` as `product_address`, `vloc`.`name` as `vendor_locality`,\n `vvla`.`address` as `vendor_address`, `products`.`slug` as `product_slug`, `ploc`.`name` as `city`,\n DAYNAME(rd.reservation_date) as dayname,pvl.id as product_vendor_location_id,`vloc1`.name as city_name,`vloc1`.id as city_id, pr.review,pr.id as review_id, pr.status as review_status, pr.rating as rating\n from `reservation_details` as `rd` \n inner join product_reviews as pr on pr.reserv_id = rd.id\n left join `vendor_locations` as `vl` on `vl`.`id` = `rd`.`vendor_location_id`\n left join `product_vendor_locations` as `pvl` on `pvl`.`product_id` = `rd`.`product_id` and pvl.vendor_location_id = `rd`.`vendor_location_id` \n left join `products` on `products`.`id` = `pvl`.`product_id` \n left join `vendors` on `vendors`.`id` = `vl`.`vendor_id` \n left join `product_attributes_text` as `pat` on `pat`.`product_id` = `products`.`id` \n left join `product_attributes` as `pa` on `pa`.`id` = `pat`.`product_attribute_id` \n left join `vendor_location_attributes_text` as `vlat` on `vlat`.`vendor_location_id` = `vl`.`id` \n left join `vendor_attributes` as `va` on `va`.`id` = `vlat`.`vendor_attribute_id` \n left join `vendor_locations` as `vl2` on `vl2`.`id` = `pvl`.`vendor_location_id` \n left join `locations` as `ploc` on `ploc`.`id` = `vl2`.`location_id` \n left join `vendor_location_address` as `pvla` on `pvla`.`vendor_location_id` = `pvl`.`vendor_location_id` \n left join `vendor_location_address` as `vvla` on `vvla`.`vendor_location_id` = `rd`.`vendor_location_id` \n left join `locations` as `vloc` on `vloc`.`id` = `vl`.`location_id`\n left join `locations` as `vloc1` on `vloc1`.`id` = vvla.city_id\n where`reservation_status` in ('new', 'edited') \n group by `rd`.`id` order by `rd`.`reservation_date` asc, `rd`.`reservation_time` asc\");\n //print_r($experiences_review_query);\n $experience_review = array();\n if(!empty($experiences_review_query))\n {\n foreach ($experiences_review_query as $row) {\n $experience_review[] = array('reservid' => $row->id,\n 'user_id' => $row->user_id,\n 'reservation_date' => $row->reservation_date,\n 'product_name' => $row->product_name,\n //'vendor_id' => $queryResult[0]->vendor_id,\n 'vendor_name' => $row->vendor_name,\n 'reservation_type' => $row->reservation_type,\n 'product_id' => $row->product_id,\n 'vendor_location_id' => $row->vendor_location_id,\n 'guest_name' => $row->guest_name,\n 'guest_email' => $row->guest_email,\n 'product_short_description' => $row->product_short_description,\n 'product_locality' => $row->product_locality,\n 'vendor_locality' => $row->vendor_locality,\n 'city_name' => $row->city_name,\n 'city_id' => $row->city_id,\n 'product_address' => $row->product_address,\n 'review' => $row->review,\n 'review_id' => $row->review_id,\n 'review_status' => $row->review_status,\n 'rating' \t => $row->rating,\n 'product_locality' => $row->product_locality,\n );\n }\n }\n /* print_r($experience_review);\n exit;*/\n return view('admin.review.experience_review',['experienceReviewDetails'=>$experience_review]);\n }",
"function fn_soneritics_kiyoh_get_reviews(int $page, int $reviewCountPerPage = 25): array\n{\n $start = ($page * $reviewCountPerPage) - $reviewCountPerPage;\n\n return db_get_array(\n \"SELECT * FROM `?:soneritics_kiyoh_reviews` ORDER BY `date` DESC LIMIT ?i,?i\",\n $start,\n $reviewCountPerPage\n );\n}",
"private function getCommentData($reviewID){\r\n\t\t\t$result = $this->myDatabase->prepare(\"SELECT comment FROM comments WHERE reviewID LIKE $reviewID\");\r\n\t\t\t$result->bind_Param('s', $reviewID);\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$reviewComment = 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($reviewComment, $row);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$reviewComment = $reviewComment->fetch_assoc();\r\n\t\t\t\t\treturn $reviewComment;\r\n\t\t\t\t\t/*$reviewCommentObj = new stdClass();\r\n\t\t\t\t\t$reviewCommentObj->reviewComment = $reviewComment;\r\n\t\t\t\t\theader('content-type: application/json');\r\n\t\t\t\t\techo json_encode($reviewCommentObj);*/ \r\n\t\t\t\t} else {\r\n\t\t\t\t\t/*if nothing is found*/\r\n \t$this->statuscode = 204;\r\n \t}\r\n\t\t\t} else {\r\n //If the SQL failed\r\n $this->statuscode = 400;\r\n echo \"If the SQL failed 2\";\r\n \t} \r\n\t\t}",
"public function fetchData(){\n \n // init needed libs\n $nedded_libs = array( \n 'models' => array(array('trk_user_model', 'trk_user_model'),\n array('trk_photo_model', 'trk_photo_model'),\n array('trk_uploadactivity_model', 'trk_uploadactivity_model'))\n );\n\n // load needed libs\n SHIN_Core::postInit($nedded_libs);\n \n include(SHIN_Core::isConfigExists('limitations.php'));\n \n $count = 0;\n $statList = '';\n $dataList = array(); \n $userList = SHIN_Core::$_models['trk_user_model']->getUserList();\n \n $search = SHIN_Core::$_input->globalarr('sSearch'); \n $start = SHIN_Core::$_input->globalarr('iDisplayStart'); \n $length = SHIN_Core::$_input->globalarr('iDisplayLength');\n \n $column = SHIN_Core::$_input->globalarr('iSortCol_0');\n $type = SHIN_Core::$_input->globalarr('sSortDir_0'); \n \n\t\t\n\t\t//dump($column);\n switch($column) {\n case 0:\n $name = 'name';\n break;\n case 1:\n $name = 'total_photo';\n break;\n// case 2:\n// $name = 'total_gallery';\n// break;\n case 2:\n $name = 'total_file_size';\n break;\n case 3:\n $name = 'remaining_quota';\n break;\n case 4:\n $name = 'remaining_month_quota';\n break;\n case 5:\n $name = 'total_space_quota';\n break;\n default:\n $name = 'name';\n \n }\n \n\t\t//dump($name);\n $this->orderBy = array($name => $type); \n \n foreach($userList as $user) {\n\t\t\n $totalPhoto = SHIN_Core::$_models['trk_photo_model']->getPhotoCount($user['userId']);\n //\n $totalFileSize = SHIN_Core::$_models['trk_uploadactivity_model']->getTotalUploadedSize($user['userId']);\n $monthBandwidth = SHIN_Core::$_models['trk_uploadactivity_model']->getUsersBandWidth(SHIN_Core::$_user->idUser, date('Y-m-d'));\n \n $remainingQuota = $limitations['lim_total_space_quota'] - $totalFileSize; \n $remainingMonthQuota = $limitations['lim_total_space_quota'] - $monthBandwidth; \n\t\t\t\n \n if(empty($search)) {\n $dataList[] = array('name' => $user['sys_user_name'],\n 'total_photo' => $totalPhoto,\n 'total_file_size' => $this->formatSize($totalFileSize),\n 'remaining_quota' => $this->formatSize($remainingQuota),\n 'remaining_month_quota' => $this->formatSize($remainingMonthQuota),\n 'total_space_quota' => $this->formatSize($limitations['lim_total_space_quota']));\n \n } elseif(stristr($user['name'], $search)) {\n \n $dataList[] = array('name' => $user['name'],\n 'total_photo' => $totalPhoto,\n 'total_file_size' => $this->formatSize($totalFileSize),\n 'remaining_quota' => $this->formatSize($remainingQuota),\n 'remaining_month_quota' => $this->formatSize($remainingMonthQuota),\n 'total_space_quota' => $this->formatSize($limitations['lim_total_space_quota'])); \n } \n }\n \n // 2. make sorting\n\t\t\n usort($dataList, array($this, '_sort_array'));\n // 3. make pagination using array_slice()\n $dataList = array_slice($dataList, $start, $length);\n \n // 4. prepare data for json\n foreach($dataList as $data)\n\t\t{\n $statList .= '[' . implode(',', array('\"' . $data['name'] . '\"',\n '\"' . $data['total_photo'] . '\"',\n '\"' . $data['total_file_size'] . '\"',\n '\"' . $data['remaining_quota'] . '\"',\n '\"' . $data['remaining_month_quota'] . '\"',\n '\"' . $data['total_space_quota'] . '\"')) . '],';\n \n }\n \n \n // json return value \n $sOutput = '{';\n $sOutput .= '\"sEcho\": '.intval(SHIN_Core::$_input->post('sEcho')).', ';\n $sOutput .= '\"iTotalRecords\": '. count($userList) . ', ';\n $sOutput .= '\"iTotalDisplayRecords\": ' . count($dataList) . ', ';\n $sOutput .= '\"aaData\": [' . substr($statList, 0, -1) . '] }'; \n \n echo $sOutput; exit(); \n }",
"public function index(Request $request)\n {\n if ($request->ajax()) {\n $peeps =peep::latest()->get();\n return Datatables::of($peeps)\n->addColumn('review1', function ($row) {\n $btn ='<td></td><a style=\"margin-left:25px;\" href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->id.'\" data-original-title=\"معاينه اعراض\" class=\"edit btn btn-info btn-sm review1\">معاينه</a></td>';\n return $btn;\n})\n->addColumn('review3', function ($row) {\n $btn ='<td></td><a style=\"margin-left:25px;\" href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->b_id.'\" data-original-title=\"معاينه الصور\" class=\"edit btn btn-info btn-sm review3\">معاينه</a></td>';\n return $btn;\n})\n->addColumn('review4', function ($row) {\n $btn ='<td></td><a style=\"margin-left:25px;\" href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->b_id.'\" data-original-title=\"معاينه ملاحظات\" class=\"edit btn btn-info btn-sm review4\">معاينه</a></td>';\n return $btn;\n})\n->addColumn('b_id', function ($row) {\n\n return $row->bookingpatienfile->p_name;\n})\n->addColumn('Delete', function ($row) {\n $btn ='<td> <a style=\"margin-left:34px;\"href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->id.'\" data-original-title=\"Delete\" class=\"btn btn-danger btn-sm delete\">حذف</a></td>';\n return $btn;\n})\n->rawColumns(['Edit','Delete','imag','review1','review2','review3','review4','imag'])->make(true);\n }\n return view('patienfile.previouspatien',compact('patienhoistory'));\n }",
"function getReviewsByClientId($clientId) {\n $db = phpmotorsConnect();\n $sql = 'SELECT i.invMake, i.invModel, i.invId, r.reviewId, r.reviewDate\n FROM reviews r\n INNER JOIN inventory i ON r.invId=i.invId\n WHERE r.clientId=:clientId\n ORDER BY r.reviewDate DESC';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n $stmt->execute();\n //can't just use fetch() on the next line. You have to use fechAll().\n $reviews = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $reviews; \n }"
]
| [
"0.7097132",
"0.70095176",
"0.69412005",
"0.6419252",
"0.64149517",
"0.6399225",
"0.6312428",
"0.6096311",
"0.6028731",
"0.5926043",
"0.58523345",
"0.5815846",
"0.57626766",
"0.5747311",
"0.5692843",
"0.5645172",
"0.56260407",
"0.5623575",
"0.56219614",
"0.5580744",
"0.5564106",
"0.55466944",
"0.5544765",
"0.54954123",
"0.54887336",
"0.5462952",
"0.5456977",
"0.5450969",
"0.5443867",
"0.54282886"
]
| 0.7632372 | 0 |
Builds the BMEcat document tree | public function build()
{
if(($document = $this->getDocument()) === null) {
$document = $this->loader->getInstance(NodeLoader::DOCUMENT_NODE);
$this->setDocument($document);
}
if(($header = $document->getHeader()) === null) {
$header = $this->loader->getInstance(NodeLoader::HEADER_NODE);
$document->setHeader($header);
}
if(($supplier = $header->getSupplier()) === null) {
$supplier = $this->loader->getInstance(NodeLoader::SUPPLIER_NODE);
$header->setSupplier($supplier);
}
if(($catalog = $header->getCatalog()) === null) {
$catalog = $this->loader->getInstance(NodeLoader::CATALOG_NODE);
$header->setCatalog($catalog);
}
if(($datetime = $catalog->getDateTime()) === null) {
$datetime = $this->loader->getInstance(NodeLoader::DATE_TIME_NODE);
$catalog->setDateTime($datetime);
}
if(($newCatalog = $document->getNewCatalog()) === null) {
$newCatalog = $this->loader->getInstance(NodeLoader::NEW_CATALOG_NODE);
$document->setNewCatalog($newCatalog);
}
return $document;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}",
"private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}",
"public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }",
"public function buildIndex()\n {\n // Build family trees for album/folder hierarchies.\n foreach ($this->albums as $album) {\n $is_orphan = true;\n foreach ($album->getParentIds() as $parentId) {\n if ($this->hasId($parentId)) {\n $is_orphan = false;\n $this->parent_children[$parentId][] = $album;\n $this->child_parents[$album->getId()] = $this->get($parentId);\n }\n if ($is_orphan) {\n $this->orphans[$album->getId()] = $album;\n }\n }\n }\n }",
"function build_tree($pages){\n\t\tforeach ($pages as $page){\n\t\t\t$this->add_node($page);\n\t\t}\n\t\t$this->add_children();\n\t\n\t}",
"public function getDocsTree()\n {\n \t\n $links = array();\n\n\t\n\t\t$docs = $this->getDocs();\n\t\t\n\t\tforeach($docs as $key => $path){\n\t\t\n\t\t$exploded = explode('/',$path);\t\n\t\t\n\t\t$lang = (string)$exploded[0];\n\t\t$type_dir = (string)$exploded[1];\n\t\t$file_name = (string)$exploded[2];\t\n\n\t\t//$links[] = $this->getDocLink($url,$file_name,$class,$links); \t\t\t\n\t\t$links[$lang][$type_dir][$file_name]['langtype'] = $lang; \t\n\t\t$links[$lang][$type_dir][$file_name]['dirtype'] = $type_dir;\t\n\t\t}\n\n\t\t//foreach($links as $lang => $type_dir){\n\t\t//$links_out[$lang] = getDocLink($url,$text,$class,$links); \t\t\t\n\t\t//}\n\t\t\n\t\n\t\treturn $links;\t\n\t}",
"function buildTree ($a_node = \"\")\n\t{\n\t\tif (empty($a_node)) {\n\t\t\t$a_node = $this->doc;\n\t\t}\n\t\t\n\t\t$this->transform($a_node,1);\n\t\t\n\t\treturn $this->tree;\n\t}",
"public function pandocSetup()\n {\n $this->pandocOptions = [\n \"data-dir\" => \"app\",\n \"wrap\" => \"none\",\n \"from\" => \"mediawiki\",\n \"to\" => $this->format\n ];\n if (! empty($this->luafilter)) {\n $this->pandocOptions[\"lua-filter\"] = $this->luafilter;\n }\n\n if (! empty($this->template)) {\n $this->pandocOptions[\"template\"] = $this->template;\n }\n $this->message(\"pandoc: \" . json_encode($this->pandocOptions));\n $jsonFile = $this->output . \"tree.json\";\n if (file_exists($jsonFile)) {\n $tree = json_decode(file_get_contents($jsonFile), true); \n $this->outputTree = [];\n $dirTree = $tree[0]['contents'];\n foreach ($dirTree as $dir ) {\n $d = [];\n if (!empty($dir['contents'])) {\n foreach ($dir['contents'] as $r) {\n $d[$r['name']] = true;\n }\n }\n $this->outputTree[$dir['name']] = $d;\n }\n echo json_encode($this->outputTree);\n }\n }",
"protected function build()\n\t{\n\t}",
"public function build()\n\t{\n\t\tif ($this->process_count() > 1)\n\t\t\treturn;\n\t\t\n\t\t$this->build_index_content();\n\t\t$this->build_index_companies();\n\t}",
"public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }",
"function getXedocsTreeList()\n {\n $oXedocsController = &getController('xedocs');\n\n header(\"Content-Type: text/xml; charset=UTF-8\");\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n\n if(!$this->module_srl) {\n return new Object(-1,'msg_invalid_request');\n }\n\n $xml_file = $this->_getXmlCacheFilename($this->module_srl);\n\n if(!file_exists($xml_file)) {\n $oXedocsController->_recompileTree($this->module_srl);\n }\n\n print FileHandler::readFile($xml_file);\n Context::close();\n exit();\n }",
"public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}",
"protected function initDocument() {\n\t\tif ($this->format !== 'html') return;\n\t\t$this->initFileLoader();\n\t\t$config\t= $this->generateConfigData();\n\t\t$doc\t= Document::get();\n\t\tif (!isset($config)) {\n\t\t\treturn;\n\t\t}\n\t\tforeach ($config['meta'] as $arr) {\n\t\t\t$doc->addMetaTag($arr);\n\t\t}\n\t\tforeach ($config['css'] as $path) {\n\t\t\t$this->appendFile($doc, $path, \"css\");\n\t\t}\n\t\tforeach ($config['js'] as $path) {\n\t\t\t$this->appendFile($doc, $path, \"js\");\n\t\t}\n\t\tif (isset($config['favicon'])) {\n\t\t\t$doc->addFavicon($config['favicon']['href']);\n\t\t}\n\t}",
"abstract function build();",
"abstract public function build();",
"abstract public function build();",
"public abstract function build();",
"public abstract function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){\n\n global $cPath_array, $show_full_tree, $languages_id;\n\t\t\n global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;\n\n // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)\n\t\tif (!$show_full_tree) {\n $parent_query\t= 'AND (c.parent_id = \"0\"';\t\n\t\t\t\t\n\t\t\t\tif (isset($cPath_array)) {\n\t\t\t\t\n\t\t\t\t $cPath_array_temp = $cPath_array;\n\t\t\t\t\n\t\t\t\t foreach($cPath_array_temp AS $key => $value) {\n\t\t\t\t\t\t $parent_query\t.= ' OR c.parent_id = \"'.$value.'\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($cPath_array_temp);\n\t\t\t\t}\t\n\t\t\t\t\n $parent_query .= ')';\t\t\t\t\n\t\t} else {\n $parent_query\t= '';\t\n\t\t}\t\t\n\n\t\t$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id=\"' . (int)$languages_id .'\" '.$parent_query.'order by sort_order, cd.categories_name');\n \n\t\twhile ($row = tep_db_fetch_array($result)) {\t\t\t\t\n $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];\n }\n\n $output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);\n\n return $output;\n}",
"public function rebuildtree(){\n\t\t//Rebuild categories ads trigger count.\n\n\t\t//Rebuild nested set - get cat\n\t\tBLog::addToLog('[Items] rebuilding nested sets...');\n\t\t//\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\t//\n\t\t$catslist=$this->itemsFilter(array());\n\t\tBLog::addToLog('[Items] Total categories count:'.count($catslist).'...');\n\n\t\t$rootcats=array();\n\t\t//\n\t\tforeach($catslist as $cat){\n\t\t\t$cat->level=0;\n\t\t\t$cat->lft=0;\n\t\t\t$cat->rgt=0;\n\t\t\tif(empty($cat->{$this->parentKeyName})){\n\t\t\t\t$rootcats[]=$cat;\n\t\t\t\t}\n\t\t\t}\n\t\t//Sort root categories.\n\t\t$n=count($rootcats);\n\t\tBLog::addToLog('[Items] Root categories count:'.$n.'...');\n\t\tfor($i=0; $i<$n; $i++){\n\t\t\t$m=$i;\n\t\t\tfor($j=$i+1; $j<$n; $j++){\n\t\t\t\tif($rootcats[$j]->ordering < $rootcats[$m]->ordering){\n\t\t\t\t\t$m=$j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($m!=$i){\n\t\t\t\t$t=$rootcats[$i];\n\t\t\t\t$rootcats[$i]=$rootcats[$m];\n\t\t\t\t$rootcats[$m]=$t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t//Foreach by root categories...\n\t\tforeach($rootcats as $rcat){\n\t\t\tBLog::addToLog('[Items] Processing root category ['.$rcat->id.']');\n\n\t\t\t$rcat->level=1;\n\t\t\t$lft=1; $rgt=2;\n\t\t\t$this->rebuildtree_recursive($rcat,$lft,$rgt);\n\t\t\t$rcat->lft=1;\n\t\t\t$rcat->rgt=$rgt;\n\t\t\t}\n\t\t$db=\\Brilliant\\BFactory::getDBO();\n\t\tif(empty($db)){\n\t\t\treturn false;\n\t\t\t}\n\t\tBLog::addToLog('[Items] Updating nested set...');\n\t\tforeach($catslist as $ct){\n\t\t\t$qr='UPDATE `'.$this->tableName.'` set `'.$this->leftKeyName.'`='.$ct->lft.', `'.$this->rightKeyName.'`='.$ct->rgt.', `'.$this->levelKeyName.'`='.$ct->level.' WHERE `'.$this->primaryKeyName.'`='.$ct->id;\n\t\t\t$q=$db->query($qr);\n\t\t\tif(empty($q)){\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t//Invalidate all cache.\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\treturn true;\n\t\t}",
"public function build() {}",
"public function build() {}"
]
| [
"0.6028457",
"0.60144037",
"0.5833872",
"0.5820778",
"0.579529",
"0.5795029",
"0.5772183",
"0.5712344",
"0.5703754",
"0.5683992",
"0.5618026",
"0.55456865",
"0.5533584",
"0.55151546",
"0.55047566",
"0.5501866",
"0.5501866",
"0.5495177",
"0.5495177",
"0.5476294",
"0.5476294",
"0.5476294",
"0.5476294",
"0.5476294",
"0.5476294",
"0.5476294",
"0.5426659",
"0.54098386",
"0.53194904",
"0.5318619"
]
| 0.63835156 | 0 |
Get all of the team's users including its owner. | public function allUsers(): Collection
{
return $this->users->merge([$this->owner]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allUsers()\n {\n return $this->users->merge([$this->owner]);\n }",
"public function getUsers()\n {\n $em = $this->container->get('doctrine')->getEntityManager();\n $builder = $em->getRepository('AppWebBundle:User')->createQueryBuilder('u');\n \n return $builder->getQuery()->getResult();\n }",
"public function getUsers()\n {\n if (empty($this->users)) {\n $this->setUsers();\n }\n }",
"public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }",
"public function getAllUsers() {\n\n $users = $this->repoProvider->Users()->findAll();\n return MapperHelper::getMapper()->getDTOs($users); // tomorrow first priority. \n }",
"public function findAllUsers()\n {\n return array_map(\n function (UserResponse $response) {\n return $response->getUser();\n },\n $this->apiClient->findAllUsers()\n );\n }",
"public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }",
"public function getAllUsers()\n {\n $users = User::all();\n return $users;\n }",
"public function getUsers() {\n $userDAO = new UserDAO();\n return $userDAO->retrieveUsers();\n }",
"public function getAllUsers()\n\t{\n\t\t$users = $this->fetchAll();\n\t\t\n\t\treturn $users;\n\t}",
"public function getUsers() {\n \n // Call getAllUsers method in userDataService and set to variable\n $users = $this->getAllUsers();\n \n // Return array of users\n return $users;\n }",
"public function getUsers() {\n\t\ttry {\n\t\t\treturn $this->getBounded1MInstance(\"XTUsersRecords\", $filter, $order, $limit, $whereAdd);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function getUsers() {\n return $this->userHandler->getUsers();\n }",
"public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }",
"public function getAllUsers(): array\n {\n return $this->users;\n }",
"public function getAllUsers(){\n\t\treturn $this->user;\n\t}",
"function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}",
"public function getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }",
"public static function getUsers()\n {\n $users = DB::table('users')->get();\n return $users;\n }",
"public function getUsers();",
"public function getUsers();",
"public function getUsers();",
"public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }",
"public function getAllUser(){\n return $this->users;\n }",
"protected function getAllUsers() {\n\t\t\t$query = \"SELECT username, f_name, l_name, phone, email FROM Stomper\";\n\t\t\treturn $this->EndpointResponse($query, true);\n\t\t}",
"public function all()\n {\n return $this->newQuery('getUsers', ['type' => 'AllUsers']);\n }",
"public function getAll(){\n $users = UserResource::collection($this->userRepo->getAll());\n return $users;\n }",
"public function getUsers()\n {\n return $this->getRelation('users');\n }",
"function getUsers()\n {\n $users = User::where('users.department_info_id', '=', Auth::user()->department_info_id)\n ->where('users.user_type_id', '=', 1)\n ->where('users.status_work', '=', 1)\n ->get();\n return $users;\n }"
]
| [
"0.7976052",
"0.7341824",
"0.7134687",
"0.70949966",
"0.7062962",
"0.70589393",
"0.7051689",
"0.7049509",
"0.7011225",
"0.69923085",
"0.6992027",
"0.69452274",
"0.692693",
"0.6912979",
"0.6901021",
"0.6888882",
"0.6878683",
"0.68554854",
"0.683215",
"0.6818103",
"0.6815784",
"0.6815784",
"0.6815784",
"0.68101114",
"0.68096834",
"0.6801516",
"0.67882854",
"0.67880994",
"0.67834973",
"0.6777186"
]
| 0.7534283 | 1 |
Determine if the given user belongs to the team. | public function hasUser($user): bool
{
return $this->users->contains($user) || $user->ownsTeam($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isTeamAdmin($team_id, $user_id)\n {\n \t$repo = App::make(TeamMemberRepository::class);\n \t\n $member = $repo->teamMember($user_id, $team_id);\n\n if (! $member) {\n return false;\n }\n\n return $repo->using($member)->isAdmin();\n }",
"function isTeamleiter() {\n \n $team = $this -> getTeamObject();\n if(!$team){\n return false;\n }\n \n \n $test_uid = $team -> getLeiter();\n if($test_uid == $this -> getUid()){\n return true;\n }\n else {\n return false; \n }\n }",
"public function inTeam($resource, $team_user)\n {\n $em = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $resource_domains = ['Omeka\\Entity\\Item', 'Omeka\\Entity\\ItemSet', 'Omeka\\Entity\\Media'];\n $fk_id = $resource->getId();\n $team = $team_user->getTeam();\n $user = $team_user->getUser();\n $res_class = $this->getResourceClass($resource);\n\n if (in_array($res_class, $resource_domains )){\n $teamsRepo = 'Teams\\Entity\\TeamResource';\n $fk = 'resource';\n $criteria = ['team'=>$team->getId(), $fk =>$fk_id];\n }\n elseif ($res_class == 'Teams\\Entity\\TeamResource'){\n $teamsRepo = 'Teams\\Entity\\TeamResource';\n $fk = 'resource';\n $fk_id = $resource->getResource()->getId();\n $criteria = ['team'=>$team->getId(), $fk =>$fk_id];\n }\n elseif ($res_class == 'Omeka\\Entity\\Site'){\n $teamsRepo = 'Teams\\Entity\\TeamSite';\n $fk = 'site';\n $criteria = ['team'=>$team->getId(), $fk =>$fk_id];\n }\n elseif ($res_class == 'Omeka\\Entity\\SitePage'){\n $teamsRepo = 'Teams\\Entity\\TeamSite';\n $fk = 'site';\n $fk_id = $resource->getSite()->getId();\n $criteria = ['team'=>$team->getId(), $fk =>$fk_id];\n }\n elseif ($res_class == 'Omeka\\Entity\\ResourceTemplate'){\n $teamsRepo = 'Teams\\Entity\\TeamResourceTemplate';\n $fk = 'resource_template';\n $criteria = ['team'=>$team->getId(), $fk =>$fk_id];\n }\n elseif ($res_class == 'Teams\\Entity\\Team' ){\n $teamsRepo = 'Teams\\Entity\\TeamUser';\n $fk = 'user';\n $criteria = ['team'=>$team->getId(), $fk =>$user->getId()]; }\n elseif ($res_class == 'Omeka\\Entity\\User'){\n\n return true;\n }\n elseif ($res_class == 'Teams\\Entity\\TeamRole'){\n\n return true;\n }\n elseif ($res_class == 'Omeka\\Entity\\Job'){\n return true;\n }\n elseif ($res_class == 'Omeka\\Entity\\Property'){\n return true;\n }\n elseif ($res_class == 'Omeka\\Entity\\Property'){\n return true;\n }\n elseif ($res_class == 'CustomVocab\\Entity\\CustomVocab')\n {\n return true;\n }\n\n elseif (strpos($res_class, 'Mapping\\Entity') === 0){\n return true;\n }\n\n elseif ($res_class == \"Omeka\\Entity\\Asset\"){\n return true;\n }\n\n else{\n $messanger = new Messenger();\n $msg = sprintf(\n 'Case not yet handled. The developer of Teams has not yet explicitly handled this resource, \n so by default action here is not permitted. Resource \"%1$s: %2$s\" .'\n ,\n $res_class, $resource->getId()\n );\n $messanger->addError($msg);\n\n throw new Exception\\PermissionDeniedException($msg);\n\n }\n\n if ($team_resource = $em->getRepository($teamsRepo)\n ->findOneBy($criteria)){\n $in_team = true;\n }\n else{\n $in_team = false;\n }\n\n return $in_team;\n\n }",
"public function hasUser($user)\n {\n return $this->users->contains($user) || $user->ownsOrganization($this);\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 OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }",
"public function isParticipant(UserInterface $user);",
"public function hasTeam()\n {\n return $this->Team !== null;\n }",
"public function is($user) {\n if (is_null($user)) return false;\n \n return $this->username == $user->username;\n }",
"function isLeader(User $user) {\n return $user instanceof User && $this->object->getLeaderId() == $user->getId();\n }",
"public static function user_has_team_role($user_change, $post)\n\t{\n\t\t\n\t\tif (key_exists($user_change->username, $post))\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}",
"public function hasUser();",
"public function isOwnedBy($user)\n {\n if (($entry = $this->getEntry())) {\n return $entry->isOwnedBy($user);\n } else {\n return false;\n }\n }",
"public function isEqualTo(UserInterface $user): bool;",
"public function view(User $user, Match $match)\n {\n if($match->private === 'Public'){\n return true;\n }\n\n $team1 = $match->team1;\n $team2 = $match->team2;\n if(!is_null($team1)){\n $member1 = $team1->members->filter(function($member){\n return $member->member_id === $user->id;\n });\n if(!empty($member1)){\n return true;\n }\n }\n if(!is_null($team2)){\n $member2 = $team2->members->filter(function($member){\n return $member->member_id === $user->id;\n });\n if(!empty($member2)){\n return true;\n }\n }\n\n return false;\n }",
"public function exists($team);",
"public function isOwnedBy(UserInterface $user);",
"function oid_check_teams($response)\n{\n $requiredTeam = common_config('openid', 'required_team');\n if ($requiredTeam) {\n $team_resp = new Auth_OpenID_TeamsResponse($response);\n if ($team_resp) {\n $teams = $team_resp->getTeams();\n } else {\n $teams = array();\n }\n\n $match = in_array($requiredTeam, $teams);\n $is = $match ? 'is' : 'is not';\n common_log(LOG_DEBUG, \"Remote user $is in required team $requiredTeam: [\" . implode(', ', $teams) . \"]\");\n\n return $match;\n }\n\n return true;\n}",
"public function isAssignee(UserInterface $user);",
"public function isBelongingTo(User $user)\r\n {\r\n return true;\r\n }",
"private function manageTeamMember(Request $request, Team $team): bool\n {\n $success = true;\n $teamRequestData = $request->request->get('team');\n if (!isset($teamRequestData['members'])) {\n return $success;\n }\n\n foreach ($teamRequestData['members'] as &$member) {\n $teamMember = null;\n $user = $this->getDoctrine()->getRepository(User::class)->find($member['userId']);\n if (empty($member['teamMemberId'])) {\n $teamMember = new TeamMember();\n $teamMember->setMember($user);\n $teamMember->setCreator($this->getUser());\n $teamMember->setCreated(new \\DateTime());\n $teamMember->setTeam($team);\n $teamMember->setRoles($member['roles']);\n $member['teamMemberId'] = $teamMember;\n } else {\n $teamMember = $this->getDoctrine()->getRepository(TeamMember::class)->find($member['teamMemberId']);\n $teamMember->setRoles($member['roles']);\n $teamMember->setModifier($this->getUser());\n $teamMember->setModified(new \\DateTime());\n }\n $this->entityManager->persist($teamMember);\n }\n\n $request->request->set('team', $teamRequestData);\n\n return $success;\n }",
"public function hasUser(User $user)\n {\n foreach ($this->users?:[] as $currentUser) {\n if ($user->getId()\n && $currentUser instanceof User && $currentUser->getId()\n && $user->getId() == $currentUser->getId()) {\n return true;\n }\n }\n\n return false;\n }",
"public function hasLeader($user): bool\n {\n return $this->leaders()->where('user_id', $user->id)->exists();\n }",
"public function hasUser($user) : bool\n {\n return $this->users->contains('id', is_a($user, user_model()) ? $user->id : $user);\n }",
"public function isOwner($user)\n {\n\n if ($this->m_role_created == $user->getId())\n return true;\n else\n return false;\n\n }",
"function isMember(User $user, $use_cache = true) {\n $user_id = $user->getId();\n \n if($use_cache && array_key_exists($user_id, $this->project_members)) {\n return $this->project_members[$user_id];\n } // if\n \n $this->project_members[$user_id] = (boolean) DB::executeFirstCell('SELECT COUNT(*) FROM ' . TABLE_PREFIX . 'project_users WHERE user_id = ? AND project_id = ?', $user_id, $this->object->getId());\n \n return $this->project_members[$user_id];\n }",
"public function create(User $user)\n {\n $team = request()->route('team');\n\n return $user->tokenCan('teams.members.create')\n && $user->ownsTeam($team);\n }",
"public function isUserInChallenge(User $user, Challenge $challenge)\n {\n return !is_null($this->challengeParticipantsRepository->findOneBy([\n 'user' => $user,\n 'challenge' => $challenge\n ]));\n }",
"public function team()\n {\n return $this->user();\n }",
"public function view(User $user, TeamInvitation $invitation = null)\n {\n $team = ($invitation ? $invitation->team : null);\n\n return $user->tokenCan('teams.show')\n && (! $team || $user->onTeam($team))\n && (! $invitation || $invitation->team_id == $team->id);\n }"
]
| [
"0.6722286",
"0.66832703",
"0.6583112",
"0.6482696",
"0.6431472",
"0.6383294",
"0.6357043",
"0.6331604",
"0.6299012",
"0.62829864",
"0.62466127",
"0.62406075",
"0.62260306",
"0.6211696",
"0.6194759",
"0.61733305",
"0.61700094",
"0.6157626",
"0.6135846",
"0.6096666",
"0.6083623",
"0.6074272",
"0.60666275",
"0.60192394",
"0.60057026",
"0.5994088",
"0.5992901",
"0.5978239",
"0.5962297",
"0.5961651"
]
| 0.7189285 | 0 |
Determine if the given user has the given permission on the team. | public function userHasPermission($user, string $permission): bool
{
return $user->hasTeamPermission($this, $permission);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isGranted($userOrId, $permission);",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}",
"function is_user_allowed($user, $permission){\n\n \tif($permission == PERMISSION_LOGIN){\n \t\tif($user->is_surveyor == TRUE\n \t\t\t\t&& $user->is_supervisor == FALSE\n \t\t\t\t&& $user->is_manager == FALSE\n \t\t\t\t&& $user->is_general_manager == FALSE\n \t\t\t\t&& $user->is_admin == FALSE){\n \t\t\treturn FALSE;\n \t\t}\n \t}else if($permission == PERMISSION_ADD_SURVEYOR\n \t\t\t|| $permission == PERMISSION_EDIT_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DELETE_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DETAIL_SURVEYOR){\n \t\treturn $user->is_admin;\n \t}\n\n \treturn TRUE;\n }",
"function is_user_granted_permission($permission, $user_id = NULL) {\n\t$user_permissions_clause = format_sql_in_clause ( $permission );\n\t\n\tif (strlen ( $user_id ) == 0 && is_site_public_access ()) {\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission\n\t\t\tWHERE \trole_name = '\" . get_public_access_rolename () . \"' AND\n\t\t\t\t \tpermission_name IN ($user_permissions_clause)\";\n\t} else {\n\t\tif (strlen ( $user_id ) == 0)\n\t\t\t$user_id = get_opendb_session_var ( 'user_id' );\n\t\t\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission srp, \n\t\t\t\t \tuser u \n\t\t\tWHERE \tu.user_role = srp.role_name AND\n\t\t\t\t \tsrp.permission_name IN ($user_permissions_clause) AND\n\t\t\t\t \tu.user_id = '$user_id'\";\n\t}\n\t\n\t$result = db_query ( $query );\n\tif ($result && db_num_rows ( $result ) > 0) {\n\t\tdb_free_result ( $result );\n\t\treturn TRUE;\n\t}\n\t\n\t//else\n\treturn FALSE;\n}",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public function userHasPermission($user, $permission)\n {\n return $user->hasOrganizationPermission($this, $permission);\n }",
"public function __invoke($permission, $assert = null, $optionassert = [], $user = null)\n {\n return Common::isGranted($permission, $assert, $optionassert, $user);\n }",
"private function hasPermission()\n { $user = User::getLoggedInUser();\n $has_permission = false;\n if ($user->getCurrentRoleName() == \"instructor\") {\n $instructor = $user->getCurrentRoleData();\n if ($instructor->hasPermission(\"Edit Compliance Status\")) {\n $has_permission = true;\n }\n }\n\n return $has_permission;\n }",
"public function hasAccess($permission);",
"public function has_permission($permission)\n {\n $drupal_user = user_load($this->uid);\n return user_access($permission, $drupal_user);\n }",
"public function isAuthorized($user, $request) {\n\t\tif (parent::isAuthorized($user, $request)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$memberId = $this->Member->getIdForMember($user);\n $memberIsCurrentMember = ($this->Member->getStatusForMember($memberId) == Status::CURRENT_MEMBER);\n\t\t$memberIsMembershipAdmin = $this->Member->GroupsMember->isMemberInGroup( $memberId, Group::MEMBERSHIP_ADMIN );\n\t\t$memberIsOnMembershipTeam = $this->Member->GroupsMember->isMemberInGroup( $memberId, Group::MEMBERSHIP_TEAM );\n\t\t$actionHasParams = isset( $request->params ) && isset($request->params['pass']) && count( $request->params['pass'] ) > 0;\n\t\t$memberIdIsSet = is_numeric($memberId);\n\n\t\t$firstParamIsMemberId = ( $actionHasParams && $memberIdIsSet && $request->params['pass'][0] == $memberId );\n\n\t\tswitch ($request->action) {\n\t\t\tcase 'revokeMembership':\n\t\t\tcase 'reinstateMembership':\n\t\t\tcase 'acceptDetails':\n\t\t\tcase 'rejectDetails':\n\t\t\tcase 'addExistingMember':\n\t\t\tcase 'emailMembersWithStatus':\n case 'resetPinToEnroll':\n\t\t\t\treturn $memberIsMembershipAdmin;\n\n\t\t\tcase 'sendProspectiveMemberReminder':\n\t\t\tcase 'sendContactDetailsReminder':\n\t\t\tcase 'sendSoDetailsReminder':\n\t\t\tcase 'approveMember':\n\t\t\tcase 'sendMembershipCompleteMail':\n\t\t\tcase 'index':\n\t\t\tcase 'listMembers':\n\t\t\tcase 'listMembersWithStatus':\n\t\t\tcase 'search':\n\t\t\t\treturn $memberIsMembershipAdmin || $memberIsOnMembershipTeam;\n\n\t\t\tcase 'changePassword':\n\t\t\tcase 'edit':\n\t\t\t\treturn $memberIsMembershipAdmin || $firstParamIsMemberId;\n\n\t\t\tcase 'view':\n\t\t\t\treturn $memberIsMembershipAdmin || $memberIsOnMembershipTeam || $firstParamIsMemberId;\n\n\t\t\tcase 'setupDetails':\n\t\t\t\treturn $firstParamIsMemberId;\n \n case 'viewAccessCodes':\n return $memberIsCurrentMember;\n\t\t}\n\n\t\treturn false;\n\t}",
"function hasPermission($user1, $user2, $level)\n\t{\n\t\tglobal $mysqli;\n\t\t\n\t\trestartMysqli();\n\t\tif (($user1 == $user2) || ($level == 'everyone')) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif ($level == \"FOFs\") {\n\t\t\t$query = sprintf(\"CALL isFOFsOf('%s', '%s');\", $user1, $user2);\n\t\t\t$result = $mysqli->query($query);\n\t\t\tif ($result->num_rows > 0) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} elseif ($level == \"friends\") {\n\t\t\t$query = sprintf(\"CALL isFriendsOf('%s', '%s')\", $user1, $user2);\n\t\t\t$result = $mysqli->query($query);\n\t\t\tif ($result->num_rows > 0) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} elseif ($level == \"nutritionists\") {\n\t\t\t$query = sprintf(\"select * from user where type = 'nutritionist' and username = '%s'\", $user1);\n\t\t\t$result = $mysqli->query($query);\n\t\t\tif ($result->num_rows > 0) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t} elseif ($level == \"me\") {\n\t\t\tif ($user1 == $user2) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function userCan($permission)\n {\n // search own permission\n $strpos = strpos($permission,\"-own\");\n // if find check permission for user (not admin)\n if ($strpos !== false) {\n $parsPermission = str_replace(\"-own\",\"\",$permission);\n if (!$this->hasRole('user') && $this->can($permission) && !$this->can($parsPermission)) {\n return true;\n }\n return false;\n }\n return $this->can($permission);\n }",
"public function checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type = \"\")\r\n\t{\r\n\t\tglobal $rbacreview, $ilUser;\r\n\r\n\t\t// :TODO: create permission for parent node with type ?!\r\n\t\t\r\n\t\t$pf = new ilObjPortfolio($a_node_id, false);\r\n\t\tif(!$pf->getId())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// portfolio owner has all rights\r\n\t\tif($pf->getOwner() == $a_user_id)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// other users can only read\r\n\t\tif($a_permission == \"read\" || $a_permission == \"visible\")\r\n\t\t{\r\n\t\t\t// get all objects with explicit permission\r\n\t\t\t$objects = $this->getPermissions($a_node_id);\r\n\t\t\tif($objects)\r\n\t\t\t{\r\n\t\t\t\tinclude_once \"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php\";\r\n\t\t\t\t\r\n\t\t\t\t// check if given user is member of object or has role\r\n\t\t\t\tforeach($objects as $obj_id)\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch($obj_id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_ALL:\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:\r\n\t\t\t\t\t\t\t// check against input kept in session\r\n\t\t\t\t\t\t\tif(self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) || \r\n\t\t\t\t\t\t\t\t$a_permission == \"visible\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_REGISTERED:\r\n\t\t\t\t\t\t\tif($ilUser->getId() != ANONYMOUS_USER_ID)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tswitch(ilObject::_lookupType($obj_id))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcase \"grp\":\r\n\t\t\t\t\t\t\t\t\t// member of group?\r\n\t\t\t\t\t\t\t\t\tif(ilGroupParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"crs\":\r\n\t\t\t\t\t\t\t\t\t// member of course?\r\n\t\t\t\t\t\t\t\t\tif(ilCourseParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"role\":\r\n\t\t\t\t\t\t\t\t\t// has role?\r\n\t\t\t\t\t\t\t\t\tif($rbacreview->isAssigned($a_user_id, $obj_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"usr\":\r\n\t\t\t\t\t\t\t\t\t// direct assignment\r\n\t\t\t\t\t\t\t\t\tif($a_user_id == $obj_id)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public function havePermission($permission){\n $roles_user = $this->roles;\n\n //recorro cada rol y lo comparo\n foreach ($roles_user as $role) {\n //si tiene full acceso a los permisos regreso true\n if ($role['full-access'] == 'Si') {\n return true;\n }\n //recorro los permisos correspondientes al rol\n foreach ($role->permissions as $permission_user) {\n //verifico si tiene entre sus permisos el permiso a verificar en la function\n //si lo tiene regreso true\n if ($permission_user->slug == $permission) {\n return true;\n }\n }\n }\n //sino tiene ningun permiso regreso false\n return false;\n }",
"function check_permission( $permission ) {\n global $_SESSION;\n\n // read the permissions database\n $d = loadDB();\n\n // check if the current user\n $user_name = $_SESSION[\"logged\"];\n // is allowed to use permission\n $roles = array();\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"name\"] == $user_name) {\n $roles = array_merge($roles, $value[\"roles\"]);\n }\n }\n\n // for each role find the list of permissions\n $userpermissions = array();\n foreach ($d[\"roles\"] as $key => $value) { // all known roles \n foreach ($roles as $role) { // roles of the current user\n if ($value[\"id\"] == $role) {\n $userpermissions = array_merge($userpermissions, $value[\"permissions\"]);\n }\n }\n }\n // print_r($userpermissions);\n \n // for each found permission find the name and compare to requested permission\n foreach ($userpermissions as $perm) {\n foreach ($d[\"permissions\"] as $key => $value) {\n if ($perm == $value[\"id\"] && \n $value[\"name\"] == $permission) {\n audit( \"check_permission\", $permission.\" as \".$user_name);\n return true;\n }\n }\n }\n\n audit( \"check_permission failed\", $permission.\" as \".$user_name);\n return false;\n }",
"function verifiedAccess($userId = null, $systemId = null, $stringPermission = null)\r\n\t{\r\n\t\t$dataUser = $this->User->find('first', array('conditions' => array('User.id' => $userId)));\r\n\t\t\r\n\t\tforeach($dataUser['Profile'] as $userProfile)\r\n\t\t{\r\n\t\t\tif($userProfile['system_id'] == $systemId)\r\n\t\t\t{\r\n\t\t\t\t$dataProfile = $this->Profile->find('first', array('conditions' => array('Profile.id' => $userProfile['id'])));\r\n\t\t\t\t\r\n\t\t\t\tforeach($dataProfile['Permission'] as $permission)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($stringPermission == $permission['type_permission'])\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}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function um_user_can( $permission ) {\r\n\t\t\tif ( ! is_user_logged_in() )\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t$user_id = get_current_user_id();\r\n\t\t\t$role = UM()->roles()->get_priority_user_role( $user_id );\r\n\t\t\t$permissions = $this->role_data( $role );\r\n\r\n\t\t\t/**\r\n\t\t\t * UM hook\r\n\t\t\t *\r\n\t\t\t * @type filter\r\n\t\t\t * @title um_user_permissions_filter\r\n\t\t\t * @description Change User Permissions\r\n\t\t\t * @input_vars\r\n\t\t\t * [{\"var\":\"$permissions\",\"type\":\"array\",\"desc\":\"User Permissions\"},\r\n\t\t\t * {\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t * @change_log\r\n\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t * @usage\r\n\t\t\t * <?php add_filter( 'um_user_permissions_filter', 'function_name', 10, 2 ); ?>\r\n\t\t\t * @example\r\n\t\t\t * <?php\r\n\t\t\t * add_filter( 'um_user_permissions_filter', 'my_user_permissions', 10, 2 );\r\n\t\t\t * function my_user_permissions( $permissions, $user_id ) {\r\n\t\t\t * // your code here\r\n\t\t\t * return $permissions;\r\n\t\t\t * }\r\n\t\t\t * ?>\r\n\t\t\t */\r\n\t\t\t$permissions = apply_filters( 'um_user_permissions_filter', $permissions, $user_id );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && is_serialized( $permissions[ $permission ] ) )\r\n\t\t\t\treturn unserialize( $permissions[ $permission ] );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && $permissions[ $permission ] == 1 )\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t}",
"protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }",
"public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }",
"public function 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 checkAccess($user, $setting)\n {\n if (is_numeric($user)) {\n $user = $this->User->getAuthUser($user);\n }\n if ($user['Role']['perm_site_admin']) {\n return true;\n } else if ($user['Role']['perm_admin']) {\n if ($user['org_id'] === $setting['User']['org_id']) {\n return true;\n }\n } else {\n if ($user['id'] === $setting['UserSetting']['user_id']) {\n return true;\n }\n }\n return false;\n }",
"public function hasPermission($permission, int $userId)\n {\n // @phpstan-ignore-next-line\n if (empty($permission) || (! is_string($permission) && ! is_numeric($permission))) {\n return null;\n }\n\n if (empty($userId) || ! is_numeric($userId)) {\n return null;\n }\n\n // Get the Permission ID\n $permissionId = $this->getPermissionID($permission);\n\n if (! is_numeric($permissionId)) {\n return false;\n }\n\n // First check the permission model. If that exists, then we're golden.\n if ($this->permissionModel->doesUserHavePermission($userId, $permissionId)) {\n return true;\n }\n\n // Still here? Then we have one last check to make - any user private permissions.\n return $this->doesUserHavePermission($userId, $permissionId);\n }",
"private function _check_permission($user,$permission_key)\n {\n $roles = $user->roles()->get();\n foreach($roles as $role)\n {\n if( is_array(json_decode($role->permissions)) )\n {\n if(array_search($permission_key, json_decode($role->permissions)) !== false)\n {\n return true;\n }\n }else{\n return false;\n }\n } \n return false;\n }",
"function canViewActivities($user) {\n \treturn $user->isAdministrator() || $user->isProjectManager();\n }"
]
| [
"0.77348423",
"0.7286303",
"0.7112272",
"0.7075129",
"0.7074393",
"0.6976545",
"0.6976545",
"0.6976545",
"0.6976545",
"0.6909379",
"0.69077575",
"0.6901391",
"0.68962604",
"0.6829901",
"0.68271255",
"0.6822575",
"0.6789734",
"0.6729686",
"0.6590225",
"0.65776384",
"0.6543744",
"0.65176696",
"0.6512898",
"0.6512518",
"0.650729",
"0.6496389",
"0.6491906",
"0.6482339",
"0.6472429",
"0.6468351"
]
| 0.75705945 | 1 |
Remove the given user from the team. | public function removeUser($user): void
{
if ($user->current_team_id === $this->id) {
$user->forceFill([
'current_team_id' => null,
])->save();
}
$this->users()->detach($user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeTeamUser($user)\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 }",
"private function removeTestUser(): void\n {\n $team = $this->terminusJsonResponse(sprintf('site:team:list %s', $this->getSiteName()));\n $this->assertIsArray($team);\n if (0 === count($team)) {\n return;\n }\n\n $emails = array_column($team, 'email');\n if (!in_array($this->getUserEmail(), $emails)) {\n return;\n }\n\n $this->terminus(sprintf('site:team:remove %s %s', $this->getSiteName(), $this->getUserEmail()));\n }",
"function removeuserfromteam(){\n $this->auth(COMP_ADM_LEVEL);\n $key_id = $this->uri->segment(3);\n $team_id = $this->uri->segment(4);\n $contest_id = $this->uri->segment(5);\n $this->m_key->removeUserByKeyId($key_id);\n $this->teamedit($team_id);\n }",
"public function removeUser(UserInterface $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 remove_member($team_id,$user_id,$project_id)\n {\n if ($this->CreateTeamModel->remove_member($team_id,$user_id,$project_id)== 1) {\n\n echo '<script>alert(\"Team Member has been removed successfully!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n \n } else {\n echo '<script>alert(\"Team Member removal failed!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n }\n }",
"public function remove($user) : void\n {\n $this->em->remove($user);\n $this->em->flush();\n }",
"public function actionRemove_user($id) { // by anoop 15-11-18\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('assign_team')) {\n return $this->redirect(['site/index']);\n }\n\n if (!empty($id)) {\n // get User email\n $user_email = Yii::$app->db->createCommand(\"SELECT email FROM assist_users WHERE id = '$id' AND status = 1 \")->queryAll();\n $useremail = $user_email[0]['email'];\n\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND uid = '$id' \")->execute();\n\n Yii::$app->session->setFlash('success', 'User with Email Address <u>' . $useremail . '</u> Successfully Removed.');\n return $this->redirect(['dv-users/assign_team']);\n //return $this->redirect(['view', 'id' => $user_id]);\n }\n }",
"public function removeUser($user){\n\t\t\tif(!in_array($user, $this->lobby)){\n\t\t\t\t$index = array_search($user, $this->lobby);\n\t\t\t\tunset($this->lobby[$index]);\n\t\t\t}\n\t\t}",
"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 destroy(Team $team, User $user)\n {\n $user->unassign();\n return back();\n }",
"public function remove_user() { return $this->STOR->remove_user(); }",
"public function retract($user): void\n {\n $this->users()->detach($user);\n }",
"public function RemoveUser($id)\r\n {\r\n $this->customPDO->Remove('users', 'WHERE User_Id = ' . $id);\r\n }",
"public function removeLeader($user): void\n {\n $this->leaders()->detach($user);\n }",
"public function delete_user($user);",
"public function removeMember($project_id, $user_id)\n {\n return $this->delete($this->getProjectPath($project_id, 'members/'.urldecode($user_id)));\n }",
"function user_remove($user_info)\n {\n }",
"public function remove($user) : void\n {\n $sql = \"DELETE FROM users WHERE username = :username\";\n\n $stmt = $this->conn->prepare($sql);\n\n try {\n $stmt->execute([\n ':username' => $user->getUsername(),\n ]);\n \n } catch (PDOException $e) {\n throw new InvalidArgumentException($e->getMessage(), 500);\n }\n }",
"public function removeUser(User $user)\n {\n // TODO\n throw new \\Exception(\"Not implemented\");\n }",
"function remove(User $user, User $by) {\n if($this->isMember($user, $this->object)) {\n try {\n DB::beginWork('Removing user from project @ ' . __CLASS__);\n \n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'project_users WHERE user_id = ? AND project_id = ?', $user->getId(), $this->object->getId());\n\n $this->project_members = array(); // Reset interal is member cache\n\n AngieApplication::cache()->removeByModel('users');\n AngieApplication::cache()->removeByModel('projects');\n\n $this->clearAssignmentsByUser($user, $by);\n $this->clearSubscriptionsByUser($user, $by);\n $this->clearRemindersByUser($user, $by);\n\n EventsManager::trigger('on_project_user_removed', array($this->object, $user));\n \n DB::commit('User removed from project @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to remove user from project @ ' . __CLASS__);\n \n throw $e;\n } // try\n\n $user->projects()->clearProjectDataCache();\n } // if\n }",
"function removeUser($id) {\n $this->db->delete('user', array('userID' => $id));\n }",
"public function deleteUser(User $user): void\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n }",
"public function remove($id) {\n $this->db->where('id_user', $id);\n $this->db->delete('user');\n }",
"public function removeUser($user) : self\n {\n return $this->users()->detach(is_a($user, user_model()) ? $user->id : $user);\n }",
"public function deleteUser()\n {\n $this->delete();\n }",
"public function destroy(user $user)\n {\n //\n }",
"public function remove($userid) {\n $sql =<<<SQL\nDELETE FROM $this->tableName\nWHERE userid=?\nSQL;\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($userid));\n }",
"public function delUser($user_id) {\n $db = $this->dbConnect();\n $req = $db->prepare('DELETE FROM `p5_users` WHERE USER_ID = ?');\n $req->execute(array($user_id));\n $req->closeCursor();\n }"
]
| [
"0.79755574",
"0.75431055",
"0.75427365",
"0.73586243",
"0.7262876",
"0.7156294",
"0.71549106",
"0.7125897",
"0.70644796",
"0.6986967",
"0.6907574",
"0.68884015",
"0.68234956",
"0.6784968",
"0.6777039",
"0.6760495",
"0.67104954",
"0.6618967",
"0.65640634",
"0.6506193",
"0.6497592",
"0.64931035",
"0.64910537",
"0.6468093",
"0.64632195",
"0.64552546",
"0.6413907",
"0.6400459",
"0.63831234",
"0.63810486"
]
| 0.77595353 | 1 |
List of columns in this table. Order of columns matches the display order. Generated from protobuf field repeated .google.area120.tables.v1alpha1.ColumnDescription columns = 3; | public function setColumns($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Area120\Tables\V1alpha1\ColumnDescription::class);
$this->columns = $arr;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setColumns($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Eolymp\\Typewriter\\Block\\Table\\Column::class);\n $this->columns = $arr;\n\n return $this;\n }",
"public function setColumns($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Basho\\Riak\\Api\\Pb\\Message\\TsColumnDescription::class);\n $this->columns = $arr;\n\n return $this;\n }",
"public function get_columns()\n {\n $columns = array(\n 'display_title' => 'Title',\n 'description' => 'Description',\n 'shortcode' => 'PUA Item Shortcode',\n 'tags' => 'WP Tags'\n );\n\n return $columns;\n }",
"public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }",
"public static function getColumns() {\n\t\tstatic $columns = array(\n\t\t\t'textual' => array('char', 'string', 'text', 'mediumText', 'enum', 'longText', 'binary', 'varbinary', 'json'),\n\t\t\t'numeric' => array('integer', 'tinyInteger', 'smallInteger', 'mediumInteger', 'bigInteger', 'float', 'double', 'decimal', 'boolean'),\n\t\t\t'date' => array('date', 'dateTime', 'time', 'timestamp', 'year')\n\t\t);\n\n\t\treturn $columns;\n\t}",
"public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }",
"public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_event_id', 'name','short_name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}",
"public function get_columns()\r\n\t{\r\n\t\treturn [\r\n\t\t\t'name' => __( 'Name', 'giga-messenger-bots' ),\r\n\t\t\t'email' => __( 'Email', 'giga-messenger-bots' ),\r\n\t\t\t'phone' => __( 'Phone', 'giga-messenger-bots' ),\r\n\t\t\t'subscribe' => __( 'Subscribe', 'giga-messenger-bots' ),\r\n 'auto_stop' => __( 'Status', 'giga-messenger-bots' ),\r\n\t\t\t'created_at' => __( 'Created At', 'giga-messenger-bots' ),\r\n\t\t];\r\n\t}",
"public function columns()\n {\n $this->addColumn();\n return $this->columns;\n }",
"public function columns()\n {\n if (!isset($this->columns)) {\n $this->columns = new Columns;\n }\n\n return $this->columns;\n }",
"public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }",
"public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n {\n return $this->columns;\n }",
"public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}",
"public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}",
"public function getColumns()\r\n\t{\r\n\t\tif($this->dirty) {\r\n\t\t\t$this->setColumns();\r\n\t\t\t$this->dirty = false;\r\n\t\t}\r\n\r\n\t\treturn $this->columns;\r\n\t}",
"public static function getColumns()\n {\n return array('title', 'bindingId', 'minYear', 'maxYear',\n 'preciseDate', 'placePublished', 'publisher', 'printVersion',\n 'firstPage', 'lastPage');\n }",
"public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_action_type_id',\n\t\t\t\t'name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}",
"public function getColumns() {\n return $this->columns;\n }",
"public static function getColumns()\n {\n $type = static::getType();\n return $type::getColumns();\n }"
]
| [
"0.7312351",
"0.72562695",
"0.7049908",
"0.70408726",
"0.7016782",
"0.7005243",
"0.6995957",
"0.69806916",
"0.69617254",
"0.6944253",
"0.69377893",
"0.68655807",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.683925",
"0.6817763",
"0.6817763",
"0.6812332",
"0.6802493",
"0.67926764",
"0.6788133",
"0.6764116"
]
| 0.7588614 | 0 |
Gets the Composer object. | public function getComposer() {
if (!$this->composer) {
$this->composer = Factory::create($this->io(), NULL, TRUE);
}
return $this->composer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComposer(): Composer\n {\n return $this->composer;\n }",
"public static function getComposer();",
"private function get_composer() {\n\n\t\t$this->set_composer_json_path( WP_CLI\\Utils\\find_file_upward( 'composer.json', WP_CLI_ROOT ) );\n\t\n\t\t// Composer's auto-load generating code makes some assumptions about where\n\t\t// the 'vendor-dir' is, and where Composer is running from.\t\n\t\t// Best to just pretend we're installing a package from ~/.composer or similar\n\t\tchdir( pathinfo( $this->get_composer_json_path(), PATHINFO_DIRNAME ) );\n\n\t\ttry {\n\t\t\t$composer = Factory::create( new NullIO, $this->get_composer_json_path() );\n\t\t} catch( Exception $e ) {\n\t\t\tWP_CLI::error( $e->getMessage() );\n\t\t}\n\n\t\t$this->composer = $composer;\n\t\treturn $this->composer;\n\t}",
"public static function composer() {\n\t\tif (is_null(static::$composer)) {\n\t\t\t$path = static::root('composer.json');\n\t\t\tstatic::$composer = json_decode(file_get_contents($path));\n\t\t}\n\n\t\treturn static::$composer;\n\t}",
"public function getComposer()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('composer');\n }",
"function getComposerConfig ()\n {\n if (!$this->composerConfig)\n $this->composerConfig = new ComposerConfigHandler(\"$this->path/composer.json\", true);\n return $this->composerConfig->data ? $this->composerConfig : null;\n }",
"public function getComposerJson()\n {\n if ($this->_composer == null) {\n $fileContent = file_get_contents($this->getPathToComposerJSON());\n $this->_composer = Zend_Json::decode($fileContent, Zend_Json::TYPE_OBJECT);\n }\n return $this->_composer;\n }",
"public function getComposer()\n\t{\n\t\t$composer = $this->which('composer', $this->releasesManager->getCurrentReleasePath().'/composer.phar');\n\n\t\t// Prepend PHP command\n\t\tif (strpos($composer, 'composer.phar') !== false) {\n\t\t\t$composer = $this->php($composer);\n\t\t}\n\n\t\treturn $composer;\n\t}",
"public function composer($key = null)\n {\n $composer = new Repository($this->getAttribute('composer'));\n\n if ($key){\n return $composer->get($key);\n }\n\n return $composer;\n }",
"public function composer() {\n return $this->belongsTo('App\\Composer');\n }",
"private function get_composer_json() {\n\t\treturn new JsonFile( $this->get_composer_json_path() );\n\t}",
"public function getPackage() {\n\t\t\t$packages_json = $this->application->configuration([ \"packagemanager\", \"packages_json\" ]);\n\t\t\t$packages = (new Packages($this->application))->getPackages();\n\t\t\tif(isset($packages->packages->{$this->package_directory}))\n\t\t\t\treturn new Object($packages->packages->{$this->package_directory});\n\t\t\telse return null;\n\t\t}",
"public function getObject()\n {\n return $this->forgeObject();\n }",
"public function getComposerPath(): string;",
"protected function getObject()\n {\n return $this;\n }",
"public function getObject()\n {\n return $this;\n }",
"public function getObject()\n\t{\n\t\t// Create the OPF instance.\n\t\treturn new Opf_Class($this->_serviceLocator->get('template.Opt'));\n\t}",
"public function getProjectComposer(): array\n {\n return $this->composerJson;\n }",
"protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}",
"public function getObject() {}",
"public function getObject() {}",
"public static function getObject()\n {\n return new PayerInfo(self::getJson());\n }",
"protected function getComposerMode() {}",
"private function getHelper()\n {\n if ($this->helper === null) {\n $this->helper = new ComposerConfig($this->context);\n }\n \n return $this->helper;\n }",
"private function getObject() {\n return $this->object;\n }",
"public function getObject()\n {\n return $this->_object;\n }",
"public function getVendorPackageService() {\n\t\treturn $this->get('sly-service-package-vendor');\n\t}",
"private function copyComposer()\n {\n $path = $this->getComposerFixurePath();\n assert(file_exists($path), \"Composer fixture should be found at: $path\");\n\n return copy($path, $this->files['composer']);\n }",
"protected function getPackagistClient()\n {\n if ($this->packagistClient === null) {\n $client = new PackagistClient();\n return $client;\n }\n \n return $this->packagistClient;\n }",
"public function getDependency() {}"
]
| [
"0.8179008",
"0.78570175",
"0.7813503",
"0.76068354",
"0.75659424",
"0.7166097",
"0.71533245",
"0.7028945",
"0.6666297",
"0.64772123",
"0.6289479",
"0.61340314",
"0.61161333",
"0.6104005",
"0.60232365",
"0.59783226",
"0.5887549",
"0.5885247",
"0.58667094",
"0.58641326",
"0.58641326",
"0.58037335",
"0.57939625",
"0.5780939",
"0.57232916",
"0.57231325",
"0.5706189",
"0.5694472",
"0.5680049",
"0.5665834"
]
| 0.8254837 | 0 |
Gets the output from the io() fixture. | public function getOutput() {
return $this->io()->getOutput();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIO()\n {\n if (!isset($this->inputOutput)) {\n $this->inputOutput = new ConsoleIO($this->getInput(), new TaskOutput($this), new HelperSet([]));\n }\n\n return $this->inputOutput;\n }",
"public function getOutput()\n {\n return $this->output ?? $this->createOutput();\n }",
"public function getOutput() {}",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"public function getOutput()\n {\n return $this->output;\n }",
"private function getOutput() : string\n {\n if ($this->response === null) {\n throw new LogicException('Must call call() before assertions');\n }\n\n rewind($this->response->getStream());\n\n return stream_get_contents($this->response->getStream());\n }",
"public function getStandardOutput();",
"public function getOutput()\n\t{\n\t\treturn $this->output;\n\t}",
"public function getOutput()\n {\n return $this->_output;\n }",
"public function getIo(){\n return $this->io;\n }",
"public function get_output() {\n return $this->data;\n }",
"public function getOutput(): string {\n\t\treturn $this->output;\n\t}",
"public function getOutput()\r\n\t{\r\n\t\treturn $this->_output;\r\n\t}",
"public function get_output_content();",
"public function getOutput()\n {\n return $this->file->dumpString();\n }",
"public function getIo() {\n\t\treturn $this->io;\n\t}",
"public function getOutput()\n {\n return $this->getParameter('output');\n }",
"public function get_output()\n {\n }",
"public function getOutput();",
"public function getOutput();",
"function getOutput ()\n {\n $descriptors = [\n 0 => ['pipe', 'w'],\n 1 => ['pipe', 'w'],\n 2 => ['pipe', 'w'],\n ];\n\n // Start the script\n $proc = proc_open($cmd, $descriptors, $pipes);\n\n // Read the stdin\n $stdin = stream_get_contents($pipes[0]);\n fclose($pipes[0]);\n\n // Read the stdout\n $stdout = stream_get_contents($pipes[1]);\n fclose($pipes[1]);\n\n // Read the stderr\n $stderr = stream_get_contents($pipes[2]);\n fclose($pipes[2]);\n\n // Close the script and get the return code\n $return_code = proc_close($proc);\n }",
"public function getOutput()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->output;\n\t}",
"public function getOutput(): string;",
"public function getOutput()\n {\n $this->output = $output;\n }"
]
| [
"0.6473439",
"0.63353753",
"0.6323778",
"0.63194734",
"0.62506944",
"0.62506944",
"0.62506944",
"0.62506944",
"0.62506944",
"0.62506944",
"0.62506944",
"0.62331814",
"0.6230994",
"0.6182043",
"0.61637384",
"0.61403847",
"0.61306226",
"0.61110026",
"0.6096022",
"0.6039402",
"0.601848",
"0.59956485",
"0.59938157",
"0.59827626",
"0.5969369",
"0.5969369",
"0.59590226",
"0.5934975",
"0.58958334",
"0.58680797"
]
| 0.72473776 | 0 |
Gets the path to Scaffold component. Used to inject the component into composer.json files. | public function projectRoot() {
return realpath(__DIR__) . '/../../../../../../../composer/Plugin/Scaffold';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }",
"public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('engine');\n\n return empty($this->parameters['bundle']) ? $path : '@' . $this->get('bundle') . '/resource/view/' . $path;\n }",
"public function path()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'app';\n }",
"function getComponentName()\n {\n $p = get_class($this);\n\n $reflector = new ReflectionClass($p);\n $path = dirname($reflector->getFileName());\n\n $component = str_replace(BW_PATH_COMPONENTS . DS, '', $path);\n $component = str_replace(DS . 'models', '', $component);\n\n if (bwFolder::is(BW_PATH_COMPONENTS . DS . $component)) {\n return $component;\n } else {\n return NULL;\n }\n }",
"public function getName()\n {\n return 'CraftReactAppPath';\n }",
"function getBlueprintPath() {\n $blueprints_path = $this->root . \"/includes/blueprints/\";\n $blueprint = $this->getBlueprint($this->getCurrentPage());\n return $blueprints_path . $blueprint . \".php\";\n }",
"public function path()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'lumen'.DIRECTORY_SEPARATOR.'app';\n }",
"public function getComposerPath(): string;",
"public static function getPath(){\n return \\Illuminate\\View\\Compilers\\BladeCompiler::getPath();\n }",
"private function basePath()\n {\n $directory = dirname((new \\ReflectionClass(self::class))->getFileName());\n\n return $directory . '/../../../../twig-bridge/src/BenGorUser/TwigBridge/Infrastructure/Ui';\n }",
"public function getTemplatePath(): string\n {\n return '@Core/components/navbar.html';\n }",
"public function symfonyInstallerPath()\n {\n return __DIR__ . '/../../symfony.phar';\n }",
"public function path(): string\n {\n return components_path($this->name);\n }",
"protected function getComposerPath()\n {\n return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', '..', '..', '..', 'composer.lock'));\n }",
"protected function getVendorFilePath()\n {\n $reflection = new \\ReflectionClass('Composer\\Autoload\\ClassLoader');\n return $reflection->getFileName();\n }",
"protected function setComponentPath()\n {\n return $this->aframe_component_path = $this->getPublicRoot() . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . $this->aframe_component_vendor . DIRECTORY_SEPARATOR . $this->aframe_component_name;\n }",
"function _templateFolder() {\n return Inflector::underscore(str_replace(\n 'Component', '', $this->toString()\n ));\n }",
"public function get_component() : string\n {\n return $this->component;\n }",
"public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/components/schemas/' . $this->getFileName() . '.json'\n );\n }",
"protected function getTemplatePath(): string\n {\n return str_replace(\n $this->app->basePath() . DIRECTORY_SEPARATOR,\n '',\n $this->app['config']['view.path']\n );\n }",
"public function getPath()\n {\n return 'bundles/jobhub/'.$this->getUploadDir().'/'.$this->path;\n }",
"public function getGeneratedCSSPath()\r\n {\r\n return $this->css_path;\r\n }",
"public function getComponentPath()\n {\n return empty($this->aframe_component_path) ? $this->setComponentPath() : $this->aframe_component_path;\n }",
"protected function getControllerTemplatePath()\n {\n return __DIR__.'/../Generators/templates/scaffold/controller.txt';\n }",
"public function getCssPath();",
"public function component()\n {\n return 'quick-works-card';\n }",
"public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}",
"public function getPath(){\n\t\treturn \\GO::view()->getPath().'themes/'.$this->getName().'/';\n\t}"
]
| [
"0.6420011",
"0.6138089",
"0.6138089",
"0.61207557",
"0.6080211",
"0.60457873",
"0.59765947",
"0.59461576",
"0.59403753",
"0.5925247",
"0.59104663",
"0.59012824",
"0.58897936",
"0.5862305",
"0.58534294",
"0.580709",
"0.5773082",
"0.5724302",
"0.57241595",
"0.5718515",
"0.570616",
"0.56932396",
"0.56900007",
"0.5686987",
"0.564504",
"0.56425357",
"0.56344724",
"0.56149054",
"0.55954057",
"0.55776715"
]
| 0.61883694 | 1 |
Gets a path to a source scaffold fixture. Use in place of ScaffoldFilePath::sourcePath(). | public function sourcePath($project_name, $source) {
$package_name = "fixtures/{$project_name}";
$source_rel_path = "assets/{$source}";
$package_path = $this->projectFixtureDir($project_name);
return ScaffoldFilePath::sourcePath($package_name, $package_path, 'unknown', $source_rel_path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSourceFilePath(): string\n {\n $basePath = 'app/DataTransferObjects';\n if ($this->getDir()) {\n $basePath = $basePath.'/'.$this->getDir();\n }\n return base_path($basePath).'/'.$this->name.'.php';\n }",
"public function getSourcePath()\n {\n return $this->sourcePath;\n }",
"protected function getFixturePath() {\n return realpath(dirname(__FILE__) . '/../fixtures');\n }",
"function getSourceFilePath()\n {\n return $this->sourceFilePath;\n }",
"private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}",
"protected function getFixtureFilePath() {\n return __DIR__ . '/../../../../fixtures/drupal7.php';\n }",
"protected function determineSourcePath()\n {\n $this->sourcePath = realpath(__DIR__ . '/../');\n\n if ($this->sourcePath == '/' || empty($this->sourcePath))\n {\n CLI::error('Unable to determine the correct source directory. Bailing.');\n exit();\n }\n }",
"private function fixturePath($class_file = NULL) {\n if (is_null($class_file)) {\n $class = new \\ReflectionClass(get_called_class());\n $class_file = $class->getFileName();\n }\n\n return dirname($class_file)\n . '/fixtures/'\n . basename($class_file);\n }",
"function fixture(string $fixture): string\n {\n return __DIR__ . \"/fixtures/{$fixture}\";\n }",
"public static function getSourceFilePath() {\n\n return get_option( 'geb_gfe_uploaded_template' );\n }",
"private function getImageSourcePath()\r\n {\r\n // check if relative\r\n if(substr($this->_imagesource, 0, 2) == \"..\" || $this->_imagesource{0} == \".\")\r\n {\r\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $this->_imagesource;\r\n }\r\n else\r\n {\r\n return $this->_imagesource;\r\n }\r\n }",
"public function getSourceLocalPath() {\n return $this->sourceLocalPath;\n }",
"private function determineFixturesPath() {}",
"public function getSource(): string\n\t{\n\t\tif (is_null($this->source))\n\t\t{\n\t\t\t$pattern = $this->getPattern();\n\n\t\t\t// Match the correct source file\n\t\t\t$files = glob($pattern);\n\t\t\t$file = reset($files);\n\t\t\tif (! $file || ! is_file($file))\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Source file missing: ' . $pattern);\t\t\t\n\t\t\t}\n\n\t\t\t$this->source = $file;\n\t\t}\n\n\t\treturn $this->source;\n\t}",
"protected function getSourcePath()\n\t{\n\t\t$vendor = $this->laravel['path.base'].'/vendor';\n\n\t\treturn $vendor.'/'.$this->argument('package').'/src/migrations';\n\t}",
"public function getSrcPath()\n {\n return $this->getSettingArray()[\"src_path\"];\n }",
"public function getSource()\n {\n return 'app';\n }",
"public function getSource(): string\n {\n return $this->source;\n }",
"public function getSource(): string\n {\n return $this->source;\n }",
"public function getSource()\n {\n return 'dtb_raise_project_qa';\n }",
"protected function getFixtureFile()\n {\n return __DIR__ . '/_fixtures/' . $this->getName() . '.txt';\n }",
"public function getSourceFile(): string\n {\n return $this->getStubContents($this->getStubPath(), $this->getStubVariables());\n }",
"public static function fixtureDir(): string\n {\n return realpath(__DIR__ . \"/Fixtures\");\n }",
"protected function getSourceDir()\n {\n return $this->sourceDir;\n }",
"public static function fixtureDir()\n {\n return realpath(__DIR__.'/Fixtures');\n }",
"protected function getSeedTemplateFilename()\n {\n return $this->getPhinxPath() . 'src/Phinx' . self::DEFAULT_SEED_TEMPLATE;\n }",
"protected function getControllerTemplatePath()\n {\n return __DIR__.'/../Generators/templates/scaffold/controller.txt';\n }",
"protected function getSourceDir() : string\n {\n return $this->sourceDir;\n }",
"protected function getTestTemplatePath()\n {\n return __DIR__.'/../Generators/templates/scaffold/controller-test.txt';\n }",
"public function getRealSourcePath(string $basePath = null): string\n {\n }"
]
| [
"0.6677343",
"0.64780104",
"0.6265266",
"0.6231613",
"0.61676866",
"0.612762",
"0.6104936",
"0.6081275",
"0.604178",
"0.5982545",
"0.597747",
"0.59456885",
"0.59193426",
"0.5847541",
"0.5836624",
"0.5818463",
"0.57240224",
"0.5721878",
"0.5721878",
"0.57032585",
"0.5686962",
"0.5682689",
"0.56742704",
"0.5655015",
"0.56293577",
"0.56198865",
"0.5619255",
"0.5600371",
"0.5572726",
"0.552435"
]
| 0.70591694 | 0 |
Gets an Interpolator with 'webroot' and 'packagename' set. Use in place of ManageOptions::getLocationReplacements(). | public function getLocationReplacements() {
$destinationTmpDir = $this->mkTmpDir('location-replacements');
$interpolator = new Interpolator();
$interpolator->setData(['web-root' => $destinationTmpDir, 'package-name' => 'fixtures/tmp-destination']);
return $interpolator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getInterpolatorInstance()\n {\n if (static::$interpolator === null)\n {\n static::$interpolator = new Interpolator;\n }\n\n return static::$interpolator;\n }",
"public static function basePath()\n {\n if(!self::$BASE_PATH){\n $reflector = new \\ReflectionClass(\\BethelChika\\Laradmin\\LaradminServiceProvider::class);\n self::$BASE_PATH= dirname(dirname($reflector->getFileName()));\n }\n return self::$BASE_PATH;\n }",
"protected function getTemplating_LocatorService()\n {\n return $this->services['templating.locator'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator($this->get('file_locator'), __DIR__);\n }",
"protected function resolvePackagePath()\n\t{\n\t\tif($this->scriptUrl===null || $this->themeUrl===null)\n\t\t{\n\t\t\t$cs=Yii::app()->getClientScript();\n\t\t\tif($this->scriptUrl===null)\n\t\t\t\t$this->scriptUrl=$cs->getCoreScriptUrl().'/jui/js';\n\t\t\tif($this->themeUrl===null)\n\t\t\t\t$this->themeUrl=$cs->getCoreScriptUrl().'/jui/css';\n\t\t}\n\t}",
"private function basePath()\n {\n $directory = dirname((new \\ReflectionClass(self::class))->getFileName());\n\n return $directory . '/../../../../twig-bridge/src/BenGorUser/TwigBridge/Infrastructure/Ui';\n }",
"private function pluginDir()\n {\n global $plugins;\n\n if (isset($_GET['pi'])) {\n $pi = preg_replace('/\\W/', '', $_GET['pi']);\n\n if (isset($plugins[$pi]) && is_object($plugins[$pi])) {\n return $plugins[$pi]->coderoot;\n }\n }\n throw new \\Exception('I18N must be created within a plugin');\n }",
"public function resolveBaseUrl(): string\n {\n return \"https://api-colombia.com/api/{$this->apiVersion}\";\n }",
"protected function getBaseUrl()\n {\n $baseUrl = '';\n\n if ($this->container->isScopeActive('request')) {\n $baseUrl = $this->container->get('templating.helper.assets')->getUrl('');\n\n // Remove ?version from the end of the base URL\n if (($pos = strpos($baseUrl, '?')) !== false) {\n $baseUrl = substr($baseUrl, 0, $pos);\n }\n }\n\n // Remove trailing slash, if there is one\n return rtrim($baseUrl, '/');\n }",
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"function app_template_path() {\n return APP_Wrapping::$main_template;\n}",
"public function baseIncludingLanguage()\n {\n $grav = Grav::instance();\n\n /** @var Pages $pages */\n $pages = $grav['pages'];\n\n return $pages->baseUrl(null, false);\n }",
"public static function getBasePath()\n {\n\n $baseUrl = trim(_PS_BASE_URL_, '/') . '/';\n\n $baseUri = trim(__PS_BASE_URI__, '/');\n\n // Do some check on subfolder.\n if(!empty($baseUri)) {\n\n $baseUri = $baseUri . '/';\n\n }\n\n return $baseUrl . $baseUri;\n }",
"private function urlWrapper() {\n return $this->baseURL;\n }",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"public function getAssetUrlBaseRemap();",
"private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }",
"protected function base()\n {\n return $this->use_production\n ? self::PRODUCTION_URI\n : self::DEVELOPMENT_URI;\n }",
"function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }",
"protected function getTemplatePath(): string\n {\n return str_replace(\n $this->app->basePath() . DIRECTORY_SEPARATOR,\n '',\n $this->app['config']['view.path']\n );\n }",
"protected function getPluginNamespaceReplacement(): string\n {\n return str_replace('\\\\', '\\\\\\\\', $this->pluginRepository->config('namespace'));\n }",
"private function basePath(): string\n\t{\n\t\treturn rtrim((new RequestFactory)\n\t\t\t->fromGlobals()->url->basePath, '/');\n\t}",
"protected function _getBase ()\n {\n global $config;\n return $config->current['BASE'];\n }",
"protected function getBaseUrl()\n {\n $module_dir = '';\n if ($this->checkSecureUrl()) {\n $module_dir = _PS_BASE_URL_SSL_ ;\n } else {\n $module_dir = _PS_BASE_URL_ ;\n }\n return $module_dir;\n }",
"protected function getBaseUrl()\n {\n if (isset($this->baseUrl)) {\n return $this->baseUrl;\n }\n\n $this->baseUrl = $this->container->getParameter('tenside.self_update.base_url');\n\n if (false === strpos($this->baseUrl, '://')) {\n $this->baseUrl = (extension_loaded('openssl') ? 'https' : 'http') . '://' . $this->baseUrl;\n }\n\n return $this->baseUrl;\n }",
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }",
"private function getTemplatesFolderLocation()\n {\n return str_replace('//', '/', APP_DIR . '/') . self::TEMPLATES_DIR;\n }",
"public function template_path() {\n return apply_filters( 'iwj_template_path', 'iwj/' );\n }",
"function abp01_wrapper_get_file_to_wrap() {\n $load = !empty($_GET['load']) \n ? trim(strip_tags($_GET['load']))\n : null;\n\n $requestUri = isset($_SERVER['REQUEST_URI']) \n ? $_SERVER['REQUEST_URI']\n : null;\n\n $uri = parse_url($requestUri);\n if (!empty($load)) {\n //We're expecting 'load' to be relative to the plug-in's own root directory\n $load = preg_match('/' . preg_quote(basename(__FILE__)) . '$/i', $uri['path']) \n ? '/wp-content/plugins/' . ABP01_PLUGIN_ROOT_NAME . '/' . preg_replace('/[^a-zA-Z0-9\\/.\\-_]/', '', $load) \n : null;\n } else {\n $load = $uri['path'];\n }\n\n return $load;\n}",
"public function basePath(): string\n {\n return $this->app->getBasePath();\n }"
]
| [
"0.558868",
"0.54573625",
"0.5395541",
"0.53863853",
"0.5369531",
"0.5252047",
"0.520073",
"0.52004737",
"0.5153014",
"0.5151826",
"0.515091",
"0.5150849",
"0.5148738",
"0.51312125",
"0.5100409",
"0.5072993",
"0.50632215",
"0.5026717",
"0.50062716",
"0.49942848",
"0.4991894",
"0.49839926",
"0.49838763",
"0.49688032",
"0.4957355",
"0.4932564",
"0.49312353",
"0.4924391",
"0.492363",
"0.49228808"
]
| 0.7276354 | 0 |
Creates a ReplaceOp fixture. | public function replaceOp($project_name, $source) {
$source_path = $this->sourcePath($project_name, $source);
return new ReplaceOp($source_path, TRUE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testReplace()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://original/> {\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 $this->assertEquals(\n [\n 'http://original/'\n ],\n $this->getGraphs()\n );\n\n // replace graph\n $returnVal = $this->fixture->replace(false, 'http://original/', 'http://replacement/');\n\n // check triples\n $res = $this->fixture->query('SELECT * FROM <http://original/> WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // get available graphs\n $this->assertEquals(0, \\count($this->getGraphs()));\n\n $res = $this->fixture->query('SELECT * FROM <http://replacement/> WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // check return value\n $this->assertEquals(\n [\n [\n 't_count' => 2,\n 'delete_time' => $returnVal[0]['delete_time'],\n 'index_update_time' => $returnVal[0]['index_update_time']\n ],\n false\n ],\n $returnVal\n );\n }",
"public function testEditTemplate()\n {\n\n }",
"public function testEditGlobalTemplate()\n {\n\n }",
"public function testReplace()\n {\n $this->container->replace(['bar' => 'foo']);\n $this->assertEquals(['bar' => 'foo'], $this->container->all());\n }",
"public function testCanReplace()\n {\n self::$apcu = [];\n $this->sut->add('myKey', 'myValue');\n $this->assertTrue($this->sut->replace('myKey', 'myNewValue'));\n $this->assertSame('myNewValue', self::$apcu['myKey']);\n }",
"protected function getSetUpOperation()\n {\n return new \\PHPUnit_Extensions_Database_Operation_Composite(array(\n \\PHPUnit_Extensions_Database_Operation_Factory::DELETE_ALL(),\n \\PHPUnit_Extensions_Database_Operation_Factory::INSERT()\n ));\n }",
"public function testAddTemplate()\n {\n\n }",
"public function testProcess_FsTemplate() \n {\n $this->tmpfile = tempnam(sys_get_temp_dir(), 'Q-');\n file_put_contents($this->tmpfile, \"<body>\n Hello i'm %{name}. I was very cool @ %{a}.\n</body>\");\n\n $file = $this->getMock('Q\\Fs_Node', array('__toString', 'getContents'), array(), '', false);\n $file->expects($this->any())->method('__toString')->will($this->returnValue($this->tmpfile)); \n $file->expects($this->any())->method('getContents')->will($this->returnValue(file_get_contents($this->tmpfile))); \n \n $transform = new Transform_Replace();\n $transform->template = $file;\n $contents = $transform->process(array('a'=>19, 'name'=>\"arnold\"));\n \n $this->assertType('Q\\Transform_Replace', $transform);\n $this->assertEquals(\"<body>\n Hello i'm arnold. I was very cool @ 19.\n</body>\", $contents);\n }",
"protected function getSetUpOperation()\n {\n return new \\PHPUnit_Extensions_Database_Operation_Composite(array(\n new Db\\Operation\\Truncate(),\n new Db\\Operation\\Insert(),\n ));\n }",
"public function testDeleteGlobalTemplate()\n {\n\n }",
"public function testEditWithNewTag() {\n $this->markTestIncomplete('Not implemented yet.');\n }",
"public function testRemoveFixture(): void\n {\n $this->assertNull($this->fixtureCallStorage->getFixturePosition('fixture1_first_module.php'));\n }",
"public function testReplace()\n {\n $value = uniqid();\n $metaInfo = Metainfo::fromValue('test', $value);\n $metaInfo->setPackage($this->package);\n \n $this->repo->save($metaInfo, true);\n \n $remaining = $this->repo->findAll();\n $this->assertCount(1, $remaining);\n $info = current($remaining);\n $this->assertEquals($value, $info->getValue());\n }",
"public static function createOrderAndShipmentFixtureRollback()\n {\n /** @var ShippedOrderFixture $self */\n $self = Bootstrap::getObjectManager()->create(static::class);\n $self->rollbackOrderAndShipment();\n }",
"public function testCreateAndUpdate()\n {\n $tokenStorage = $this->createTokenStorage();\n $storage = $this->createStorage();\n $typeRegistry = $this->createTypeRegistry();\n $renderer = $this->createRenderer($typeRegistry, new XmlGridRenderer());\n\n /** @var \\MakinaCorpus\\Drupal\\Layout\\Storage\\Layout $layout */\n $layout = $storage->create();\n $token = new EditToken('testing', [$layout->getId()]);\n\n // Save the token, but not yet the layout\n $tokenStorage->saveToken($token);\n\n // For the sake of simplicity, just create something similar to what\n // the php-layout library does, just see their documentation for more\n // information.\n $this->createAwesomelyComplexLayout($layout);\n $topLevelId = $layout->getId();\n $representation = $this->getAwesomelyComplexLayoutRepresentation($topLevelId);\n\n // This just tests the testing helpers, and validate that our layout\n // is correct before we do save it.\n $string = $renderer->render($layout->getTopLevelContainer());\n $this->assertSameRenderedGrid($representation, $string);\n\n // Now, save it, load it, and ensure rendering is the same.\n $tokenStorage->update('testing', $layout);\n // Ensure that all items have identifiers after save\n $this->assertAllItemsHaveIdentifiers($layout->getTopLevelContainer());\n\n $otherLayout = $tokenStorage->load('testing', $layout->getId());\n // Ensure that all items have identifiers after load\n $this->assertAllItemsHaveIdentifiers($layout->getTopLevelContainer());\n\n $string = $renderer->render($otherLayout->getTopLevelContainer());\n $this->assertSameRenderedGrid($representation, $string);\n\n // Remove a few elements, compare to a new representation\n $representation = <<<EOT\n<vertical id=\"{$topLevelId}\">\n <horizontal id=\"hbox-C1\">\n <column id=\"vbox-C11\">\n <item id=\"b-4\"/>\n </column>\n <column id=\"vbox-C12\">\n <horizontal id=\"hbox-C2\">\n <column id=\"vbox-C21\">\n <item id=\"a-2\" />\n <item id=\"a-5\" />\n </column>\n </horizontal>\n </column>\n </horizontal>\n <item id=\"b-7\" />\n</vertical>\nEOT;\n $otherLayout->getTopLevelContainer()->removeAt(1);\n $otherLayout->getTopLevelContainer()->getAt(0)->getColumnAt(0)->removeAt(0);\n $otherLayout->getTopLevelContainer()->getAt(0)->getColumnAt(1)->getAt(0)->removeColumnAt(1);\n $otherLayout->getTopLevelContainer()->removeAt(1);\n $tokenStorage->update('testing', $otherLayout);\n\n $thirdLayout = $tokenStorage->load('testing', $layout->getId());\n $string = $renderer->render($thirdLayout->getTopLevelContainer());\n $this->assertSameRenderedGrid($representation, $string);\n }",
"public function testDeleteTemplate()\n {\n\n }",
"public function testDeletePet()\n {\n\n }",
"function testSetVariable()\n {\n $result = $this->tpl->setTemplate('{placeholder1} {placeholder2} {placeholder3}', true, true);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error setting template: '. $result->getMessage());\n }\n // \"scalar\" call\n $this->tpl->setVariable('placeholder1', 'var1');\n // array call\n $this->tpl->setVariable(array(\n 'placeholder2' => 'var2',\n 'placeholder3' => 'var3'\n ));\n $this->assertEquals('var1 var2 var3', $this->tpl->get());\n }",
"protected function getSetUpOperation()\n {\n return new PHPUnit_Extensions_Database_Operation_Composite([\n new Zend_Test_PHPUnit_Db_Operation_Truncate(),\n new Zend_Test_PHPUnit_Db_Operation_Insert(),\n ]);\n }",
"public function testAddReplenishmentTag()\n {\n }",
"public function testAddGlobalTemplate()\n {\n\n }",
"protected function createFeatureTest()\n {\n $model_name = Str::studly(class_basename($this->argument('name')));\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:test', [\n 'name' => \"{$model_name}Test\",\n ]);\n\n $path = base_path() . \"/tests/Feature/{$model_name}Test.php\";\n $this->cleanupDummy($path, $name);\n }",
"static public function OpAssignOp ($op) {\n\t\treturn new Binop('OpAssignOp', 20, [$op]);\n\t}",
"public function testDeleteReplenishmentTag()\n {\n }",
"protected abstract function newFixture($str= '');",
"public function testReplaceQuantities()\n {\n $pinch = new Unit('pinch', 'p');\n $origan = new Ingredient('origan');\n $this->recipe->replaceQuantities([\n new Quantity(0.9, $this->kg, $this->tomato),\n new Quantity(1, $pinch, $origan),\n new Quantity(0.3, $this->kg, $this->salt)\n ]); \n $this->assertCount(3, $this->recipe->getQuantities());\n $qtyTomato = $this->recipe->fetchQuantityOf('tomato');\n $this->assertEquals(0.9, $qtyTomato->getAmount());\n $this->assertEquals('kg', $qtyTomato->getUnit()->getSymbol());\n $qtySalt = $this->recipe->fetchQuantityOf('salt');\n $this->assertEquals(0.3, $qtySalt->getAmount());\n $this->assertEquals('kg', $qtySalt->getUnit()->getSymbol());\n $qtyOrigan = $this->recipe->fetchQuantityOf('origan');\n $this->assertEquals(1, $qtyOrigan->getAmount());\n $this->assertEquals('p', $qtyOrigan->getUnit()->getSymbol());\n }",
"public function setUp()\n {\n $this->fixture = new SetShippingMethod();\n }",
"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}",
"public function replacementDataProvider() {}",
"protected function setUp()\n {\n $this->fixture = new Parameter();\n }"
]
| [
"0.50655913",
"0.50473",
"0.49466562",
"0.48507386",
"0.48249304",
"0.4750866",
"0.47095415",
"0.4700147",
"0.46631917",
"0.4618765",
"0.46043575",
"0.46042475",
"0.4604099",
"0.45865816",
"0.45824018",
"0.45746002",
"0.45713145",
"0.4550927",
"0.45407143",
"0.4524456",
"0.45194685",
"0.45127618",
"0.44845572",
"0.4467941",
"0.4432083",
"0.44240692",
"0.44214693",
"0.4410851",
"0.44004852",
"0.43929267"
]
| 0.54380935 | 0 |
Generates a persistent prefix to use with all of our temporary directories. The presumption is that this should reduce collisions in highlyparallel tests. We prepend the process id to play nicely with phpunit process isolation. | protected static function persistentPrefix() {
if (empty(static::$randomPrefix)) {
static::$randomPrefix = getmypid() . md5(microtime());
}
return static::$randomPrefix;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tmpDir($prefix) {\n $prefix .= static::persistentPrefix();\n $tmpDir = sys_get_temp_dir() . '/scaffold-' . $prefix . uniqid(md5($prefix . microtime()), TRUE);\n $this->tmpDirs[] = $tmpDir;\n return $tmpDir;\n }",
"protected function createPrefix(): string\n {\n return date('Y-m-d_h-i') . '-' . GeneralUtility::makeInstance(Random::class)->generateRandomHexString(16);\n }",
"protected function _createUniqueId()\n {\n $id = '';\n $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));\n $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));\n $id .= '.' . php_uname('n');\n\n return $id;\n }",
"public function new_local_file_name()\n\t{\n\t\t$name = sys_get_temp_dir().'/'.str_random(32);\n\t\treturn $name;\n\t}",
"public function temp_filename()\n {\n $tmp_dir = '';\n $dirs = array('TMP', 'TMPDIR', 'TEMP');\n foreach ($dirs as $dir) {\n if (isset($_ENV[$dir]) && !empty($_ENV[$dir])) {\n $tmp_dir = $dir;\n break;\n }\n }\n\n if (empty($tmp_dir)) {\n $tmp_dir = '/tmp';\n }\n\n $tmp_dir_realpath = realpath($tmp_dir);\n\n return tempnam($tmp_dir_realpath ?: $tmp_dir, 'wpunit');\n }",
"protected function makeTemporaryFile(): string\n {\n return DIRECTORY_SEPARATOR . trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) .\n DIRECTORY_SEPARATOR . ltrim(uniqid('epp', true), DIRECTORY_SEPARATOR);\n }",
"protected function tempPath() {\n if ($nonce = $this->getNonce()) {\n return sys_get_temp_dir() . DIRECTORY_SEPARATOR . $nonce;\n }\n }",
"public static function createTemporaryDirectory($prefix)\n {\n $cmd = 'mktemp -d --tmpdir '.$prefix.'XXXXXXXXXX';\n $process = new Process($cmd);\n $process->run();\n if (!$process->isSuccessful()) {\n throw new RuntimeException(\n sprintf(\n 'Unable to create temporary directory: %s',\n $process->getErrorOutput()\n )\n );\n }\n\n return trim($process->getOutput());\n }",
"private static function createTempDirectory(): string\n {\n $tempFile = tempnam(sys_get_temp_dir(), 'LocaleTest');\n\n if (file_exists($tempFile)) {\n unlink($tempFile);\n }\n\n mkdir($tempFile);\n if (is_dir($tempFile)) {\n return $tempFile . DIRECTORY_SEPARATOR;\n }\n\n throw new \\RuntimeException(\"Unable to create temp directory\");\n }",
"function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}",
"public function temp_dir() {\n\t\tif(empty($this->jobId))\n\t\t $this->setJobId(\"no_job_id_\"+rand(1,10000));\n\t\t$d=PATH.\"/QueueSandbox/\".$this->jobId.\"_\".$this->ApiName();\n\t\tif(!file_exists($d))\n\t\t\tmkdir($d, 0777, true);\n\t\treturn $d;\n\t}",
"public function mkTmpDir($prefix) {\n $tmpDir = $this->tmpDir($prefix);\n $filesystem = new Filesystem();\n $filesystem->ensureDirectoryExists($tmpDir);\n return $tmpDir;\n }",
"function tempfile_unique($dir, $prefix, $postfix){\n \n if ($dir[strlen($dir) - 1] == '/') {\n $trailing_slash = \"\";\n } else {\n $trailing_slash = \"/\";\n }\n /*The PHP function is_dir returns true on files that have no extension.\n The filetype function will tell you correctly what the file is */\n if (!is_dir(realpath($dir)) || filetype(realpath($dir)) != \"dir\") {\n // The specified dir is not actualy a dir\n return false;\n }\n if (!is_writable($dir)){\n // The directory will not let us create a file there\n return false;\n }\n \n do{ \n \t$seed = substr(md5(microtime()), 0, 8);\n $filename = $dir . $trailing_slash . $prefix . $seed . $postfix;\n } while (file_exists($filename));\n $fp = fopen($filename, \"w\");\n fclose($fp);\n return $filename;\n}",
"function pulcherrimum_unique_id($prefix = '')\n {\n static $id_counter = 0;\n if (function_exists('wp_unique_id')) {\n return wp_unique_id($prefix);\n }\n return $prefix . (string) ++$id_counter;\n }",
"public static function tempdir($dir, $prefix='', $mode=0700) {\n\t\tif (substr($dir, -1) != '/') $dir .= '/';\n\n\t\tdo {\n\t\t\t$path = $dir.$prefix.mt_rand(0, 9999999);\n\t\t} while (!mkdir($path, $mode));\n\n\t\treturn $path;\n\t}",
"public function mktempdir()\n\t{\n\t\t$temp_path = tempnam('/tmp', '');\n\t\t@unlink($temp_path);\n\t\tmkdir($temp_path);\n\n\t\treturn $temp_path;\n\t}",
"public static function getTestFilePathAlias() {\n\t\treturn 'application.runtime.'.__CLASS__.getmypid();\n\t}",
"public function generateTmpFile($prefix='')\n {\n $tmp = tempnam($this->_temp_directory, 'phpvideotoolkit_'.$prefix);\n array_push($this->_tmp_files, $tmp);\n return $tmp; \n }",
"function tempdir($dir=false,$prefix='php') {\n $tempfile=tempnam('','');\n if (file_exists($tempfile)) { unlink($tempfile); }\n mkdir($tempfile);\n if (is_dir($tempfile)) { return $tempfile . '/'; }\n}",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"public static function getTempFileName()\r\n\t{\r\n\t\treturn self::_normalizeDirectorySeparators(tempnam(self::getTempDirectory(), self::getRandomFileName()));\r\n\t}",
"private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }",
"static private function getId($prefix = NULL) {\n return uniqid($prefix);\n }",
"public static function getTemporaryFilename($prefix = 'tmpFile_', $extension = '', $dir = TMP_DIR) {\n\t\t$dir = self::addTrailingSlash($dir);\n\t\tdo {\n\t\t\t$tmpFile = $dir.$prefix.StringUtil::getRandomID().$extension;\n\t\t}\n\t\twhile (file_exists($tmpFile));\t\n\t\t\n\t\treturn $tmpFile;\n\t}"
]
| [
"0.66962767",
"0.62778515",
"0.61463594",
"0.61449325",
"0.6003106",
"0.5954735",
"0.59517664",
"0.59446406",
"0.5921644",
"0.5904021",
"0.5899834",
"0.58931035",
"0.58464664",
"0.57892936",
"0.57664853",
"0.5748578",
"0.568589",
"0.56743336",
"0.566525",
"0.56398135",
"0.5633498",
"0.5633498",
"0.5633498",
"0.5633498",
"0.5633498",
"0.5633498",
"0.56324",
"0.5606829",
"0.56001234",
"0.5599487"
]
| 0.7247035 | 0 |
Create an isolated cache directory for Composer. | public function createIsolatedComposerCacheDir() {
$cacheDir = $this->mkTmpDir('composer-cache');
putenv("COMPOSER_CACHE_DIR=$cacheDir");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createCacheDir()\n {\n if ( ! file_exists($this->cacheDir)) {\n mkdir($this->cacheDir);\n }\n }",
"private function cacheFolder(){\n $cachePath = ROOT . \"/\" . $this->_config['cachePath'];\n if (!is_dir( $cachePath )) { // no\n if (!mkdir( $cachePath, 0755, true)) { // so make it\n if (!is_dir( $cachePath )) { // check again to protect against race conditions\n\n // uh-oh, failed to make that directory\n $this->sendErrorImage(\"Failed to create cache directory at: $cachePath\");\n }\n }\n }\n }",
"protected function _create_mimic_cache_dir()\n {\n // Get the dir from the source file\n //$mimic_dir = $this->config['cache_dir'] . pathinfo($this->source_file, PATHINFO_DIRNAME);\n $mimic_dir = $this->cache_dir . pathinfo($this->source_file, PATHINFO_DIRNAME);\n\n // Try to create if it does not exist\n if( ! file_exists($mimic_dir))\n {\n try\n {\n mkdir($mimic_dir, 0755, TRUE);\n }\n catch(Exception $e)\n {\n throw new Kohana_Exception($e);\n }\n }\n\n // Set the cache dir, with trailling slash\n $this->cache_dir = $mimic_dir.'/';\n }",
"public function getCacheDirectory() {}",
"public function getCacheDir();",
"protected function createCacheFile()\n {\n $this->createCacheDir();\n\n $cacheFilePath = $this->getCacheFile();\n\n if ( ! file_exists($cacheFilePath)) {\n touch($cacheFilePath);\n }\n }",
"protected function _create_cache_dir()\n {\n if( ! file_exists($this->config['cache_dir']))\n {\n try\n {\n mkdir($this->config['cache_dir'], 0755, TRUE);\n }\n catch(Exception $e)\n {\n throw new Kohana_Exception($e);\n }\n }\n\n // Set the cache dir\n $this->cache_dir = $this->config['cache_dir'];\n }",
"function _createCacheDirectory() {\n // Create cache directory if it doesnt exist\n if (!file_exists($this->thumbnail_dir)) {\n @mkdir($this->thumbnail_dir, 0777, true);\n } else {\n // Try to make the directory writable\n @chmod($this->thumbnail_dir, 0777);\n }\n }",
"public function getCacheDir()\n {\n $fileSystem = new Filesystem();\n $path = 'var/cache/assets/'.$this->name.'/';\n \n if (!$fileSystem->exists($path)) {\n $fileSystem->mkdir($path);\n }\n \n return $path;\n }",
"private static function create_cache_dir() {\n if ( ! is_writable(self::$_cache_dir)) {\n if ( ! file_exists(self::$_cache_dir)) {\n if ( ! @mkdir(self::$_cache_dir, 0755, TRUE))\n throw new Exception('failed to create cache directory: '\n . self::$_cache_dir);\n } else \n throw new Exception(self::$_cache_dir . ' is not writable');\n }\n }",
"public function getCachePath()\r\n\t{\r\n\t\t$path = AD.$this->getConfig()->getChildren(\"cache\")->getString(\"path\");\r\n\t\tif(!is_dir($path))\r\n\t\t{\r\n\t\t\tmkdir($path, 0777, true);\r\n\t\t}\r\n\t\treturn $path;\r\n\t}",
"protected function createCacheDirectory($path)\n {\n $this->fileSystem->makeDirectory(dirname($path), 0777, true, true);\n }",
"private static function _createCacheFile() {\r\n $paths = array();\r\n $paths['apps'] = File::getDirectoriesNames(ZEEYE_APPS_PATH);\r\n $paths['libs'] = File::getDirectoriesNames(ZEEYE_LIBS_PATH);\r\n File::write(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH, '<?php ' . PHP_EOL . '$paths = ' . var_export($paths, true) . ';');\r\n self::$_hasCacheFile = true;\r\n }",
"public function getCacheDir()\n {\n return __DIR__.'/../var/cache/'.$this->getEnvironment();\n }",
"private function createEnvironment() {\n\t\t$this->cache_folder = dirname(__FILE__) . \"/\" . $this->cache_folder;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($this->cache_folder))\n\t\t\tmkdir($this->cache_folder);\n\n\t\t// Get the index file path\n\t\t$indexFilepath = $this->cache_folder . \"/\" . $this->cache_index;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($indexFilepath))\n\t\t\ttouch($indexFilepath);\n\t}",
"protected\n function setCachePath()\n {\n $cachePath = public_path() . config('album.paths.cache');\n\n if (!file_exists($cachePath)) mkdir($cachePath, 0777, true);\n\n return $cachePath;\n }",
"protected function __construct() {\n if (!file_exists(self::getCachePath())) {\n mkdir(self::getCachePath(), 0777, true);\n }\n }",
"public static function create()\n {\n $directories = [\n self::PATH.'/app',\n self::PATH.'/logs',\n self::PATH.'/bootstrap/cache',\n self::PATH.'/framework/cache',\n self::PATH.'/framework/views',\n ];\n\n foreach ($directories as $directory) {\n if (! is_dir($directory)) {\n function_exists('__vapor_debug') && __vapor_debug(\"Creating storage directory: $directory\");\n\n mkdir($directory, 0755, true);\n }\n }\n }",
"function drewlabs_component_generator_cache_path()\n{\n return __DIR__.'/.cache';\n}",
"public function getCacheDir()\n {\n return __DIR__ . '/Fixtures/app/cache';\n }",
"public function getCacheDir(): string\n {\n return __DIR__ . '/../../../../../../var/cache/test';\n }",
"public static function getCacheDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'cache';\n }",
"public function getCacheDir()\n {\n return __DIR__ . '/../var/cache/' . $this->getEnvironment();\n }",
"public function createCacheDirectory() {\n\t\tif (!file_exists(dirname($this->cache_file))) {\n\t\t\tif (!@mkdir(dirname($this->cache_file))) {\n\t\t\t\tdie('Please create the cache directory: '.dirname($this->cache_file).' and make sure it\\'s writeable by this script.');\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} elseif (file_exists(dirname($this->cache_file)) && !is_writable(dirname($this->cache_file))) {\n\t\t\tdie('Cannot write to cache directory. Please make it writeable.');\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function setCacheDir(string $path);",
"private function createFolder()\n {\n if (!file_exists($this->cacheDir)) {//if folder doesn't exist\n mkdir($this->cacheDir, 0755);//create folder\n }\n if (!file_exists($this->cacheFile)) {//if cache doesnt exist\n $file = fopen($this->cacheFile, 'w');\n fclose($file);\n } else {\n return true;\n } //return true if folder exists\n }",
"public function getCacheDir()\n {\n return $this->rootDir . '/../cache/'.$this->getEnvironment();\n }",
"public function prepareDirectory(): void\n {\n if (!file_exists($makerRepoPath = sprintf('%s/maker-repo', $this->cachePath))) {\n MakerTestProcess::create(sprintf('git clone %s %s', $this->rootPath, $makerRepoPath), $this->cachePath)->run();\n }\n\n if (!$this->fs->exists($this->flexPath)) {\n $this->buildFlexSkeleton();\n }\n\n if (!$this->fs->exists($this->path)) {\n try {\n // let's do some magic here git is faster than copy\n MakerTestProcess::create(\n '\\\\' === \\DIRECTORY_SEPARATOR ? 'git clone %FLEX_PATH% %APP_PATH%' : 'git clone \"$FLEX_PATH\" \"$APP_PATH\"',\n \\dirname($this->flexPath),\n [\n 'FLEX_PATH' => $this->flexPath,\n 'APP_PATH' => $this->path,\n ]\n )\n ->run();\n\n // In Window's we have to require MakerBundle in each project - git clone doesn't symlink well\n if ($this->isWindows) {\n $this->composerRequireMakerBundle($this->path);\n }\n\n // install any missing dependencies\n $dependencies = $this->determineMissingDependencies();\n if ($dependencies) {\n MakerTestProcess::create(sprintf('composer require %s', implode(' ', $dependencies)), $this->path)\n ->run();\n }\n\n $this->changeRootNamespaceIfNeeded();\n\n file_put_contents($this->path.'/.gitignore', \"var/cache/\\nvendor/\\n\");\n\n MakerTestProcess::create('git diff --quiet || ( git config user.name \"symfony\" && git config user.email \"[email protected]\" && git add . && git commit -a -m \"second commit\" )',\n $this->path\n )->run();\n } catch (\\Exception $e) {\n $this->fs->remove($this->path);\n\n throw $e;\n }\n } else {\n MakerTestProcess::create('git reset --hard && git clean -fd', $this->path)->run();\n }\n }",
"protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }",
"public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }"
]
| [
"0.7456021",
"0.6763888",
"0.67559797",
"0.67225903",
"0.6713593",
"0.6676169",
"0.6616641",
"0.6615672",
"0.6500503",
"0.6482021",
"0.6478068",
"0.64588225",
"0.6440065",
"0.6392255",
"0.63419425",
"0.63360435",
"0.62999564",
"0.62630945",
"0.62436086",
"0.6237634",
"0.6205268",
"0.61348677",
"0.60973346",
"0.6042367",
"0.5937497",
"0.5911894",
"0.5849059",
"0.58461636",
"0.583742",
"0.57952166"
]
| 0.85923177 | 0 |
Runs the scaffold operation. This is equivalent to running `composer composerscaffold`, but we do the equivalent operation by instantiating a Handler object in order to continue running in the same process, so that coverage may be calculated for the code executed by these tests. | public function runScaffold($cwd) {
chdir($cwd);
$handler = new Handler($this->getComposer(), $this->io());
$handler->scaffold();
return $this->getOutput();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scaffold() {\n $config_files = $this->loadScaffoldSourceConfigurations();\n if ($config_files) {\n foreach ($config_files as $file) {\n $config = $this->getConfig($file);\n $this->generateCode($config);\n }\n }\n }",
"private function scaffold()\n {\n if (isset($this->args['extra']))\n {\n $extra = $this->args['extra'];\n unset($this->args['extra']);\n }\n else\n {\n $extra = array();\n }\n\n $this->args['name'] = Inflector::pluralize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = array('index', 'create', 'view', 'edit', 'delete');\n $this->extra = $this->generate_controller_actions($this->args['name'], $this->args['extra']);\n $this->controller();\n\n $this->args['name'] = Inflector::singularize($this->args['name']);\n $this->args['filename'] = $this->args['name'] . '.php';\n $this->args['extra'] = $extra;\n $this->extra = $this->generate_migration_statement($this->args['name'], $this->args['extra']);\n $this->model();\n }",
"public function handle()\n {\n if (! is_dir($directory = app_path('Http/Controllers/Auth'))) {\n mkdir($directory, 0755, true);\n }\n\n $filesystem = new Filesystem;\n\n collect($filesystem->allFiles(__DIR__.'/../stubs/Auth'))\n ->each(function (SplFileInfo $file) use ($filesystem) {\n $filesystem->copy(\n $file->getPathname(),\n app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename()))\n );\n });\n\n $this->info('Authentication scaffolding generated successfully.');\n }",
"public function scaffoldCommand($args, array $assoc_args = array())\n {\n $addon_details = $this->getAddonDetails($args[0]);\n $this->initializeScaffold(\n $assoc_args,\n $addon_details\n );\n foreach ($this->file_generators as $file_generator) {\n $file_generator->writeFiles();\n }\n\n if (! cliUtils\\get_flag_value($assoc_args, 'ignore_main_file_warning', false)) {\n WP_CLI::log(\n $this->registryArgumentWarning()\n );\n }\n }",
"public function run()\r\n {\r\n $this->slim->run();\r\n }",
"public static function run()\n {\n $self = self::getInstance();\n \n // Register autoloader\n $autoloader = new Autoloader(null, $self->basePath);\n $autoloader->register();\n \n $controller = $self->getControllerToRun();\n $method = $self->getMethodToRun($controller);\n \n // First run optional functions\n if (method_exists($controller, 'beforeRun'))\n $controller->beforeRun();\n \n if (method_exists($controller, 'beforeMethodRun'))\n $controller->beforeMethodRun();\n \n // If response was set in \"before\" functions, output it instead of method return value\n if (! $controller->getResponse()->isEmpty()) {\n return $self->outputContent($controller->getResponse());\n }\n \n $self->normalizeMethodArguments($controller, $method);\n // Get content\n $content = call_user_func_array(array($controller,$method), $self->methodArguments);\n \n // After running optional functions\n if (method_exists($controller, 'afterRun'))\n $controller->afterRun();\n \n $self->outputContent($content);\n }",
"public function handle()\n {\n $model = ucfirst(basename($this->argument('model')));\n\n $this->call('scaffold:model', ['model' => $model]);\n $this->call('scaffold:migration', ['model' => $model]);\n $this->call('scaffold:factory', ['model' => $model]);\n $this->call('scaffold:seeder', ['model' => $model]);\n $this->call('scaffold:controller', ['model' => $model]);\n $this->call('scaffold:request', ['model' => $model]);\n\n $this->call('scaffold:view', ['model' => $model, 'view' => 'admin', '--layouts' => true]);\n $this->call('scaffold:view', ['model' => $model, 'view' => 'index']);\n $this->call('scaffold:view', ['model' => $model, 'view' => 'create']);\n $this->call('scaffold:view', ['model' => $model, 'view' => 'edit']);\n $this->call('scaffold:view', ['model' => $model, 'view' => 'show']);\n $this->call('scaffold:view', ['model' => $model, 'view' => '_fields']);\n $this->call('scaffold:view', ['model' => $model, 'view' => '_action']);\n\n $route = Str::plural(strtolower($model));\n\n $this->info(\"\nRoute::group(['namespace' => 'Admin', 'prefix' => 'admin'], function () {\n Route::name('admin')->resource('/{$route}', '{$model}Controller');\n});\n \");\n }",
"public function run()\n {\n $this->call(tableRole::class);\n $this->call(tableUser::class);\n $this->call(tableMaintainerRoles::class);\n $this->call(FormTableSeeder::class);\n $this->call(FormColumnTableSeeder::class);\n $this->call(FormColumnPilganTableSeeder::class);\n $this->call(FormContentTableSeeder::class);\n $this->call(seedContohContentForm::class);\n $this->call(seedDashboardElement::class);\n $this->call(partaiSeed::class);\n $this->call(calonDprSeed::class);\n }",
"public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }",
"public function runMaster() {\n\t\t$this->_runLifecycle('analyze');\n\t\t$this->_runLifecycle('resources');\n\t\t$this->_runLifecycle('authenticate');\n\t\t$this->_runLifecycle('authorize');\n\t\t$this->_runLifecycle('process');\n\t\t$this->_runLifecycle('output');\n\t\t$this->_runLifecycle('hangup');\n\t}",
"public function run()\n {\n //Deletes make:auth controllers\n $this->filesystem->delete($this->getControllers());\n\n //Deletes blades\n $this->filesystem->delete($this->getBlades());\n }",
"public function run()\n {\n /**\n * Setup the cart content factory on config\\app.php\n */\n CartContent::factory()->times(config('seeder.cardContentTable'))->create();\n }",
"public function test_it_scaffolds_crud_artifacts()\n {\n $this->assertFileDoesNotExist(app_path('Post.php'));\n $this->assertFileDoesNotExist(app_path('Http/Controllers/PostController.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileDoesNotExist(base_path('database/factories/PostFactory.php'));\n $this->assertFileDoesNotExist(resource_path('views/posts'));\n\n $this->artisan('arche Post');\n\n $this->assertFileExists(app_path('Post.php'));\n $this->assertFileExists(app_path('Http/Controllers/PostController.php'));\n $this->assertFileExists(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileExists(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileExists(base_path('database/factories/PostFactory.php'));\n $this->assertDirectoryDoesNotExist(resource_path('views/posts'));\n $this->assertFileExists(resource_path(\"views/posts/index.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/create.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/_form.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/edit.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/show.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/modals/delete.blade.php\"));\n\n $actualOutput = Artisan::output();\n\n $expectedOutput = \"Factory created successfully in /database/factories/PostFactory.php\nCreated Migration: 2020_03_14_153546_create_posts_table\nModel created successfully in /app/Post.php\nController created successfully in /app/Http/Controllers/PostController.php\nView created successfully in /resources/views/posts/index.blade.php\nView created successfully in /resources/views/posts/create.blade.php\nView created successfully in /resources/views/posts/_form.blade.php\nView created successfully in /resources/views/posts/edit.blade.php\nView created successfully in /resources/views/posts/show.blade.php\nView created successfully in /resources/views/posts/modals/delete.blade.php\nRequest created successfully in /app/Http/Requests/PostStoreRequest.php\nRequest created successfully in /app/Http/Requests/PostUpdateRequest.php\" . PHP_EOL;\n $this->assertSame($expectedOutput, $actualOutput);\n }",
"public function handle()\n {\n $this->createDirectories();\n\n $this->exportViews();\n\n if (! $this->option('views')) {\n $this->info('Installed TeamController.');\n file_put_contents(\n app_path('Http/Controllers/Teamwork/TeamController.php'),\n $this->compileControllerStub('TeamController')\n );\n\n $this->info('Installed TeamMemberController.');\n file_put_contents(\n app_path('Http/Controllers/Teamwork/TeamMemberController.php'),\n $this->compileControllerStub('TeamMemberController')\n );\n\n $this->info('Installed AuthController.');\n file_put_contents(\n app_path('Http/Controllers/Teamwork/AuthController.php'),\n $this->compileControllerStub('AuthController')\n );\n\n $this->info('Installed JoinTeamListener');\n file_put_contents(\n app_path('Listeners/Teamwork/JoinTeamListener.php'),\n str_replace(\n '{{namespace}}',\n $this->getNamespace(),\n file_get_contents(__DIR__.'/../../stubs/listeners/JoinTeamListener.stub')\n )\n );\n\n $this->info('Updated Routes File.');\n file_put_contents(\n // app_path('Http/routes.php'),\n base_path('routes/web.php'),\n file_get_contents(__DIR__.'/../../stubs/routes.stub'),\n FILE_APPEND\n );\n }\n $this->comment('Teamwork scaffolding generated successfully!');\n }",
"public function run()\n {\n $this->call('UserTableSeeder');\n $this->command->info('User table seeded!');\n $this->call('CompaniesTableSeeder');\n $this->command->info('Company & sub area table seeded!');\n $this->call('CategoryTableSeeder');\n $this->command->info('category & type table seeded!');\n }",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"public function run() {\n\n\t\t// Add the admin page.\n\t\t$admin_page = new AdminPage();\n\t\t$admin_page->init();\n\n\t\t// Log frontend visits.\n\t\t$log = new Log();\n\t\t$log->run();\n\n\t\t$cloverly = new PaymentAPICloverly();\n\t\t$cloverly->init();\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call('smUserTableSeeder');\n $this->call('smUnitTableSeeder');\n $this->command->info('Seeded!');\n }",
"public function run():self {\n\n /**\n * Backup Composer\n * 1. Copy initial composer config in backup folder\n */\n $this->runBackupComposer();\n\n /**\n * Run Composer\n * 1. Fill composer.json\n * 2. Run composer install\n */\n $this->runComposer();\n\n /**\n * Run Structure Folder\n * 1. Create structure folder\n * 2. Check permissions\n */\n $this->runStructureFolder();\n\n /**\n * Run Config\n * 0. Check configs files exists\n * 1. Fill config files\n * 2. Create app routes\n */\n $this->runConfig();\n\n /**\n * Run NPM\n * 0. Check package.json exists\n * 1. Fill package.json\n * 2. Run npm install\n */\n $this->runNpm();\n\n /**\n * Run User Interface\n * 1. Create basic components\n * 2. Prepare basic assets\n */\n $this->runUserInterface();\n\n /**\n * Run Database\n * 0. Try to connect to database\n * 1. Create user\n * 2. Create database\n * 3. Create auth tables\n * 4. Create app tables\n */\n $this->runDatabase(); \n \n /**\n * Run Users\n * 0. Create permissions\n * 1. Create default users\n */\n $this->runUsers();\n\n /**\n * Composer Update\n * 1. Update Composer\n */\n $this->runComposerUpdate();\n\n /**\n * Run Front Script\n */\n $this->runFrontScript();\n\n /**\n * Run Webpack\n * 1. Prepare webpack config\n */\n $this->runWebpack();\n\n\n /**\n * Run Check Permission Node Modules\n * 1. Check permission of some directories\n */\n $this->runCheckPermissionNodeModules();\n\n /**\n * Run First Compilation\n * \n * First compilation of thr app\n */\n $this->runFirstCompilation();\n\n # Return this\n return $this;\n\n }",
"public function run()\n {\n $customer = factory(Customer::class)->create([\n 'name' => 'Cash Customer',\n 'dni' => '',\n 'phone' => '',\n 'email' => '',\n 'comments' => ''\n ]);\n\n $payment = factory(Payment::class)->create([\"name\" => 'Cash']);\n\n factory(Options::class)->create([\n 'cash_customer' => $customer->id,\n 'payment_id' => $payment->id\n ]);\n\n $role = factory(Role::class)->create([\n 'name' => 'admin',\n 'label' => 'Administrator'\n ]);\n\n factory(Role::class)->create([\n 'name' => 'waiter',\n 'label' => 'Camarero'\n ]);\n\n $createUsers = factory(Permission::class)->create([\n 'name' => 'create_users',\n 'label' => 'Create users in the system'\n ]);\n\n $changeSettings = factory(Permission::class)->create([\n 'name' => 'update_settings',\n 'label' => 'Update settings in the system'\n ]);\n\n $role->givePermissionTo($createUsers);\n $role->givePermissionTo($changeSettings);\n\n $user = factory(User::class)->create([\n 'name' => 'Administrator',\n 'username' => 'admin',\n 'password' => bcrypt('admin')\n ]);\n\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(AdminSeeder::class);\n // $this->call(StudentFaker::class);\n $this->call(TransactionFaker::class);\n // $this->call(BooksFaker::class);\n }",
"public function run()\n {\n /**\n * ========================================================================\n * = BUILDING STAGE\n * ========================================================================\n */\n\n\n /**\n * ========================================================================\n * = REPAIRING STAGE\n * ========================================================================\n */\n\n /**\n * ========================================================================\n * = ALL STAGE\n * ========================================================================\n */\n $role = Menu::where('route_name', 'role.index')->select('id')->first()->id;\n DB::table('sidenav')->insert([\n 'menu_id' => $role,\n 'route_name' => 'role.index',\n ]);\n\n DB::table('sidenav')->insert([\n 'menu_id' => $role,\n 'route_name' => 'role.create',\n ]);\n\n DB::table('sidenav')->insert([\n 'menu_id' => $role,\n 'route_name' => 'role.edit',\n ]);\n }",
"public function run(): int\n {\n $className = $this->console->writeLine('Stubbles ConsoleAppCreator')\n ->writeLine(' (c) 2012-2016 Stubbles Development Group')\n ->writeEmptyLine()\n ->prompt('Please enter the full qualified class name for the console app: ')\n ->withFilter(ClassNameFilter::instance());\n if (null === $className) {\n $this->console->writeLine('The entered class name is not a valid class name');\n return -10;\n }\n\n $this->classFile->create($className);\n $this->scriptFile->create($className);\n $this->testFile->create($className);\n return 0;\n }",
"public function run()\n {\n $this->call(UserSeeder::class);\n $this->call(FormSeeder::class);\n $this->call(HeroSeeder::class);\n $this->call(TodoSeeder::class);\n $this->call(CowSeeder::class);\n /** Seeder File Marker: Do Not Remove Being Used Buy Code Generator */\n }",
"public function run()\n {\n $seed = new MyController();\n $seed->get();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $client_sectors =\n [\n [\n 'code' => 'TES',\n 'description' => 'TESOURARIA'\n ],\n [\n 'code' => 'ADM',\n 'description' => 'ADMINISTRATIVO'\n ]\n ];\n \n foreach ($client_sectors as $client_sector)\n {\n \\App\\Entities\\Tenant\\ClientSector::create($client_sector);\n }\n }",
"public function handle(): void\n {\n // Controllers...\n (new Filesystem())->ensureDirectoryExists(app_path('Http/Controllers/Auth'));\n (new Filesystem())->copyDirectory(__DIR__ . '/../../stubs/App/Http/Controllers/Auth', app_path('Http/Controllers/Auth'));\n\n $this->info('Phone number verification scaffolding installed successfully.');\n }",
"public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->command->info('Creating some Fake data');\n $this->call(CategoriesTableSeeder::class);\n $this->call(JobTypesTableSeeder::class);\n $this->call(JobsTableSeeder::class);\n }",
"public function run()\n {\n $this->call(BankSeeder::class);\n }"
]
| [
"0.67486066",
"0.65308714",
"0.6095824",
"0.5979006",
"0.5845963",
"0.5752817",
"0.57447153",
"0.57402533",
"0.5734233",
"0.5715564",
"0.5714734",
"0.5711729",
"0.56785756",
"0.5639295",
"0.5617331",
"0.55929965",
"0.55776805",
"0.5571244",
"0.55656224",
"0.55645996",
"0.5554333",
"0.5553901",
"0.55508",
"0.55506223",
"0.5548218",
"0.5545947",
"0.5538316",
"0.55304617",
"0.5524726",
"0.5518541"
]
| 0.69101495 | 0 |
$fromProject = if output is being rendered from loading the project | public static function doOutput($output,$fromProject = false) {
$result = [];
if ($fromProject) {
return $result;
}
echo json_encode($output->ui);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGathercontentProject();",
"function is_project( $user )\n {\n //Unimplemented\n }",
"protected function initProjectSpecific() {\n\t\tView::$projectLocation = str_replace(\"index.php\", \"\", $_SERVER['PHP_SELF']);\n\t}",
"public function includedInExport(): bool\n {\n return $this->includeInExport === true;\n }",
"public function view(w2p_Core_CAppUI $AppUI) {\r\n $perms = $this->AppUI->acl();\r\n\r\n $output = '';\r\n $data = $this->scrubbedData;\r\n\r\n $reader = simplexml_load_string($data);\r\n\r\n $project_name = $reader->proj->summary['Title'];\r\n if (empty($project_name)) {\r\n $project_name=$this->proName;\r\n\t\t}\r\n\r\n $output .= '\r\n\t\t\t<table width=\"100%\">\r\n\t\t\t<tr>\r\n\t\t\t<td align=\"right\">' . $this->AppUI->_('Company Name') . ':</td>';\r\n\r\n\t\t$projectClass = new CProject();\r\n\t\t$output .= $this->_createCompanySelection($this->AppUI, $tree['COMPANY']);\r\n\t\t$output .= $this->_createProjectSelection($this->AppUI, $project_name);\r\n\r\n\t\t$users = $perms->getPermittedUsers('projects');\r\n\t\t$output .= '<tr><td align=\"right\">' . $this->AppUI->_('Project Owner') . ':</td><td>';\r\n\t\t$output .= arraySelect( $users, 'project_owner', 'size=\"1\" style=\"width:200px;\" class=\"text\"', $this->AppUI->user_id );\r\n\t\t$output .= '<td/></tr>';\r\n\r\n\t\t$pstatus = w2PgetSysVal( 'ProjectStatus' );\r\n\t\t$output .= '<tr><td align=\"right\">' . $this->AppUI->_('Project Status') . ':</td><td>';\r\n\t\t$output .= arraySelect( $pstatus, 'project_status', 'size=\"1\" class=\"text\"', $row->project_status, true );\r\n\t\t$output .= '<td/></tr>';\r\n\r\n\t\t$startDate = $this->_formatDate($this->AppUI, $reader->proj->summary['Start']);\r\n\t\t$endDate = $this->_formatDate($this->AppUI, $reader->proj->summary['Finish']);\r\n\r\n\t\t$output .= '\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('Start Date') . ':</td>\r\n <td>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"project_start_date\" value=\"'.$startDate.'\" class=\"text\" />\r\n\t\t\t\t\t<input type=\"text\" name=\"start_date\" value=\"'.$reader->proj->summary['Start'].'\" class=\"text\" />\r\n\t\t\t\t</td>\r\n </tr>\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('End Date') . ':</td>\r\n <td>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"project_end_date\" value=\"'.$endDate.'\" class=\"text\" />\r\n\t\t\t\t\t<input type=\"text\" name=\"end_date\" value=\"'.$reader->proj->summary['Finish'].'\" class=\"text\" />\r\n\t\t\t\t</td>\r\n </tr><!--\r\n <tr>\r\n <td align=\"right\">' . $this->AppUI->_('Do Not Import Users') . ':</td>\r\n <td><input type=\"checkbox\" name=\"nouserimport\" value=\"true\" onclick=\"ToggleUserFields()\" /></td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\">' . $this->AppUI->_('Users') . ':</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\"><div name=\"userRelated\"><br /><em>'.$this->AppUI->_('userinfo').'</em></td>\r\n\t\t\t</tr>-->\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\"><table>';\r\n\r\n $percent = array(0 => '0', 5 => '5', 10 => '10', 15 => '15', 20 => '20', 25 => '25', 30 => '30', 35 => '35', 40 => '40', 45 => '45', 50 => '50', 55 => '55', 60 => '60', 65 => '65', 70 => '70', 75 => '75', 80 => '80', 85 => '85', 90 => '90', 95 => '95', 100 => '100');\r\n\r\n\t\t// Users (Resources)\r\n\t\t$workers = $perms->getPermittedUsers('tasks');\r\n $resources = array(0 => '');\r\n\r\n\t\t$q = new w2p_Database_Query();\r\n if ($this->user_control) {\t\t//check the existence of resources before trying to import\r\n $trabalhadores=$reader->proj->resources->children();\r\n foreach($trabalhadores as $r) {\r\n $q->clear();\r\n $q->addQuery('user_id');\r\n $q->addTable('users');\r\n $q->leftJoin('contacts', 'c', 'user_contact = contact_id');\r\n $q->addWhere(\"user_username LIKE '{$r['name']}' OR CONCAT_WS(contact_first_name, ' ', contact_last_name) = '{$r['name']}'\");\r\n $r['LID'] = $q->loadResult();\r\n if (!empty($r['name'])) {\r\n $output .= '\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>' . $this->AppUI->_('User name') . ': </td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input type=\"text\" name=\"users[' . $r['uid'] . '][user_username]\" value=\"' . ucwords(strtolower($r['name'])) . '\"' . (empty($r['LID'])?'':' readonly') . ' />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"users[' . $r['uid'] . '][user_id]\" value=\"' . $r['LID'] . '\" />\r\n\t\t\t\t\t\t(' . $this->AppUI->_('Resource UID').\": \".$r['uid'] . ')';\r\n\r\n if (function_exists('w2PUTF8strlen')) {\r\n if (w2PUTF8strlen($r['name']) < w2PgetConfig('username_min_len')) {\r\n $output .= ' <em>' . $this->AppUI->_('username_min_len.') . '</em>';\r\n }\r\n } else {\r\n if (strlen($r['name']) < w2PgetConfig('username_min_len')) {\r\n $output .= ' <em>' . $this->AppUI->_('username_min_len.') . '</em>';\r\n }\r\n }\r\n $output .= '</td></tr>';\r\n $resources[sizeof($resources)] = strtolower($r['name']);\r\n }\r\n }\r\n }\r\n\t\t$resources = arrayMerge($resources, $workers);\r\n\r\n $output .= '\r\n </table>\r\n </div></td></tr>';\r\n\r\n\t\t// Insert Tasks\r\n $output .= '\r\n <tr>\r\n <td colspan=\"2\">' . $this->AppUI->_('Tasks') . ':</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width=\"100%\" class=\"tbl\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">\r\n <tr>\r\n <th>' . $this->AppUI->_('Name') . '</th>\r\n <th>' . $this->AppUI->_('Start Date') . '</th>\r\n <th>' . $this->AppUI->_('End Date') . '</th>\r\n <th>' . $this->AppUI->_('Assigned Users') . '</th>\r\n </tr>';\r\n\r\n foreach($reader->proj->tasks->children() as $task) {\r\n if (trim($task['Name']) != '') {\r\n $k = $task['ID'];\r\n\t\t\t\t$newWBS = $this->montar_wbs($task['OutlineLevel']);\r\n $note= htmlentities($task['NOTES']);\r\n $output .= '<tr><td>';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][UID]\" value=\"' . $k . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][OUTLINENUMBER]\" value=\"' . $newWBS . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_name]\" value=\"' . $task['Name'] . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_description]\" value=\"' . $note . '\" />';\r\n\r\n $priority = 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_priority]\" value=\"' . $priority . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_start_date]\" value=\"' . $task['Start'] . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_end_date]\" value=\"' . $task['Finish'] . '\" />';\r\n\r\n $myDuration = $this->dur($task['Duration']);\r\n\t\t\t\t$output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_duration]\" value=\"' . $myDuration . '\" />';\r\n\t\t\t\t$output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_duration_type]\" value=\"1\" />';\r\n\r\n $percentComplete = isset($task['PercentComplete']) ? $task['PercentComplete'] : 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_percent_complete]\" value=\"' . $percentComplete . '\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_owner]\" value=\"'.$this->AppUI->user_id.'\" />';\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_type]\" value=\"0\" />';\r\n\r\n $milestone = ($task['Milestone'] == 'yes') ? 1 : 0;\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][task_milestone]\" value=\"' . $milestone . '\" />';\r\n\r\n $temp = 0;\r\n if (!empty($task['UniqueIDPredecessors'])) {\r\n $x=strpos($task['UniqueIDPredecessors'],\",\");\r\n foreach ($task['UniqueIDPredecessors'] as $dependency) {\r\n $output .= '<input type=\"hidden\" name=\"tasks['.$k.'][dependencies][]\" value=\"' . $dependency['UniqueIDPredecessors'] . '\" />';\r\n ++$temp;\r\n }\r\n }\r\n\r\n $tasklevel = (int) $task['OutlineLevel'];\r\n\t\t\t\tif ($tasklevel) {\r\n\t\t\t\t\tfor($i = 0; $i < $tasklevel; $i++) {\r\n\t\t\t\t\t\t$output .= ' ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= '<img src=\"' . w2PfindImage('corner-dots.gif') . '\" border=\"0\" /> ';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$output .= $task['Name'];\r\n\r\n if ($milestone) {\r\n $output .= '<img src=\"' . w2PfindImage('icons/milestone.gif', $m) . '\" border=\"0\" />';\r\n }\r\n//TODO: the formatting for the dates should be better\r\n $output .= '</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">'.$task['Start'].'</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">'.$task['Finish'].'</td>\r\n\t\t\t\t\t\t\t<td class=\"center\">';\r\n\r\n //This is a bizarre function i've made to associate the resources with their tasks\r\n //If there's only one resource associate to a task, it skip the while. If there's more than one\r\n //the loop take care of it until the last resource\r\n //strange but it works, that's my moto.\r\n if (!empty($task['Resources'])) {\r\n $x=0;\r\n $y=strpos($task['Resources'],';');\r\n while (!empty($y)) {\r\n $recurso=substr($task['Resources'],$x,($y-$x));\r\n\t\t\t\t\t\t$output .= '<div name=\"userRelated\">';\r\n $output.= arraySelect($resources, 'tasks['.$k.'][resources][]', 'size=\"1\" class=\"text\"', $recurso);\r\n\t\t\t\t\t\t$output .= ' ';\r\n\t\t\t\t\t\t$output .= arraySelect($percent, 'tasks['.$k.'][resources_alloc][]', 'size=\"1\" class=\"text\"', 100) . '%';\r\n\t\t\t\t\t\t$output .= '</div>';\r\n $x=$y+1;\r\n $y=strpos($task['Resources'],';',$x);\r\n }\r\n } else {\r\n\t\t\t\t\t$output .= '<div name=\"userRelated\">';\r\n\t\t\t\t\t$output.= arraySelect($resources, 'tasks['.$k.'][resources][]', 'size=\"1\" class=\"text\"', $recurso);\r\n\t\t\t\t\t$output .= ' ';\r\n\t\t\t\t\t$output .= arraySelect($percent, 'tasks['.$k.'][resources_alloc][]', 'size=\"1\" class=\"text\"', 100) . '%';\r\n\t\t\t\t\t$output .= '</div>';\r\n\t\t\t\t}\r\n $output .= '</td></tr>';\r\n }\r\n }\r\n $output .= '</table></td></tr>';\r\n\r\n $output .= '</table>';\r\n return $output;\r\n }",
"public function prepareOutput(Project $project)\n {\n $formats = $project->getFormats();\n\n foreach ($formats as $format) {\n $this->outputFiles->get($format)->setContent('');\n }\n\n $this->outputFiles->get('_stdout')->setContent('');\n $this->outputFiles->get('_stderr')->setContent('');\n\n }",
"private function projectPath()\n { }",
"public function getProjectInitiatePage($project_id){\n\n if(!$this->checkEligibility(2)){\n return redirect()->back();\n }\n //validate the project\n $project=Project::where('id',$project_id)->first();\n $technicians=Technician::get();\n $selling_items=SellingItem::get();\n $estimation_id=$project->estimation_id;\n $estimation=Estimation::where('id',$estimation_id)->first();\n $estimation_records=null;\n if($estimation!=null){\n $estimation_records=unserialize($estimation->estimation_record_list);\n }\n\n //$estimation=$project->estimation;\n return view('/project_management/project_init',['project'=>$project,'technicians'=>$technicians,'sellingitems'=>$selling_items,'estimation_records'=>$estimation_records]);\n }",
"function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}",
"public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }",
"public function isCompiled(){\n\t\treturn $this->isCompiled;\n\t}",
"public function loadTemplate(){\n if($this->hasErrors()) return false;\n $template = $this->findTemplate();\n $this->updateBuffer();\n do_action($this->prefix('before_include_template'), $this);\n include($template);\n do_action($this->prefix('after_include_template'), $this);\n $this->updateBuffer();\n\n return self::$buffer === false ? $this->hasErrors() == false && $template !== false : $this->updateBuffer();\n }",
"public function hasProject() {\n return $this->_has(4);\n }",
"#[Route(path: '/project/show-simple/{id}', name: 'translationalresearch_project_show_simple', methods: ['GET'], options: ['expose' => true])]\n #[Template('AppTranslationalResearchBundle/Project/show-simple.html.twig')]\n public function includeProjectDetailsAction(Request $request, Project $project)\n {\n\n ////////////////// rendering using the original project show ////////////////\n return $this->showAction($request,$project);\n ////////////////// EOF rendering using the original project show ////////////////\n\n ////////////////// custom rendering ////////////////\n $transresPermissionUtil = $this->container->get('transres_permission_util');\n\n if( false === $transresPermissionUtil->hasProjectPermission(\"view\",$project) ) {\n return $this->redirect($this->generateUrl('translationalresearch-nopermission'));\n }\n\n $transresUtil = $this->container->get('transres_util');\n\n $cycle = \"show\";\n\n $form = $this->createProjectForm($project,$cycle,$request); //show show-simple\n\n //append “ Approved Budget: $xx.xx” at the end of the title again,\n //only for users listed as PIs or Billing contacts or\n //Site Admin/Executive Committee/Platform Admin/Deputy Platform Admin) and\n //ONLY for projects with status = Final Approved or Closed\n// $approvedProjectBudgetInfo = \"\";\n// if( $transresUtil->isAdminPrimaryRevExecutiveOrRequester($project) ) {\n// $approvedProjectBudget = $project->getApprovedProjectBudget();\n// if( $approvedProjectBudget ) {\n// //$approvedProjectBudget = $project->toMoney($approvedProjectBudget);\n// $approvedProjectBudget = $transresUtil->dollarSignValue($approvedProjectBudget);\n// $approvedProjectBudgetInfo = \" (Approved Budget: $approvedProjectBudget)\"; //show simple\n// }\n// }\n\n $approvedProjectBudgetInfo = \"\";\n if( $transresUtil->isAdminPrimaryRevExecutiveOrRequester($project) ) {\n\n $projectBudgetInfo = array();\n\n $approvedProjectBudget = $project->getApprovedProjectBudget();\n if( $approvedProjectBudget ) {\n $approvedProjectBudget = $transresUtil->dollarSignValue($approvedProjectBudget);\n $projectBudgetInfo[] = \"Approved Budget: $approvedProjectBudget\";\n }\n $remainingProjectBudget = $project->getRemainingBudget();\n if( $remainingProjectBudget ) {\n $remainingProjectBudget = $transresUtil->dollarSignValue($remainingProjectBudget);\n $projectBudgetInfo[] = \"Remaining Budget: $remainingProjectBudget\"; //show page\n }\n $totalProjectBudget = $project->getTotal();\n if( $totalProjectBudget ) {\n $totalProjectBudget = $transresUtil->dollarSignValue($totalProjectBudget);\n $projectBudgetInfo[] = \"Total Value: $totalProjectBudget\"; //show page\n }\n\n if( count($projectBudgetInfo) > 0 ) {\n $approvedProjectBudgetInfo = \" (\".implode(\", \",$projectBudgetInfo).\")\";\n }\n }\n\n $resArr = array(\n 'project' => $project,\n 'form' => $form->createView(),\n 'cycle' => $cycle,\n 'title' => $project->getProjectInfoName().$approvedProjectBudgetInfo, //show: \"Project request \".$project->getOid(),\n 'messageToUsers' => null\n );\n\n return $this->render(\"AppTranslationalResearchBundle/Project/show-simple.html.twig\",\n $resArr\n );\n ////////////////// EOF custom rendering ////////////////\n }",
"public function canBeUsedByProject($project) {\n return true;\n }",
"public function wasLoadedFromCompiled()\n {\n return $this->loadedFromCompiled;\n }",
"function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}",
"public function build( $output=true ) {\n\t\t$source = $this->getTemplate()->build( $output );\n\t\tif( $output )\n\t\t\techo $source;\n\t\telse\n\t\t\treturn $source;\n\t}",
"protected function compile()\n\t{\n \n /* PART 0: EINGEHENDE DATEN */\n //memberid = frontendUser\n $this->import('FrontendUser', 'User');\n\t\t$userid = $this->User->id;\n \n //projekt\n if($_REQUEST['proj']){\n $projekt = $_REQUEST['proj'];\n }\n //trg\n if($_REQUEST['trg']){\n $trg = $_REQUEST['trg'];\n $this->Template->trg = $trg;\n }\n \n // Projektauswahl mit Filter\n if($_REQUEST['filter']!=''){\n\t\t\t\tif ($_REQUEST['filter']==\"aktiv\") {\n\t\t\t\t\t$filter = 'WHERE enddone =\"\"';\n\t\t\t\t}\n\t\t\t\tif ($_REQUEST['filter']==\"alle\"){\n\t\t\t\t\t$filter = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t$filter = 'WHERE enddone =\"\"';\n\t\t}\n $this->Template->filter = $filter;\n \n $this->import('Database');\n $sql =\"SELECT id, concat(knr,'/',kname,'/',wohnort) as title from tl_project \".$filter.\" ORDER by title;\";\n $result = $this->Database->prepare($sql)->execute();\n $projectArray = array();\n while($result->next())\n {\n $projectArray[] = array\n\t\t(\n\t\t\t'id' => $result->id,\n\t\t\t'title' => $result->title\n );\n }\n $this->Template->projectarray = $projectArray;\n \n \n \n \n /* PART 1: MANAGING PROJECTS */\n /* PART 2: BEREICH ADMIN */\n \n if($_REQUEST['trg']=='admin'){\n \n //Kategorie einfügen\n if($_REQUEST['todo']=='insertcat'){\n $ctitle = $_REQUEST['title'];\n $description = $_REQUEST['descript'];\n $typ = $_REQUEST['ctyp'];\n $sql='INSERT into tl_category (tstamp,title,description,typ) VALUES ('.time().',\"'.$ctitle.'\",\"'.$description.'\",'.$typ.');';\n $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Kategorie wurde erfolgreich eingefügt\";\n }\n //Kategorie bearbeiten\n if($_REQUEST['todo']=='edittcat'){\n $cid = $_REQUEST['cid'];\n $ctitle = $_REQUEST['title'];\n $description = $_REQUEST['descript'];\n $typ = $_REQUEST['ctyp'];\n $sql='UPDATE tl_category SET tstamp = '.time().', title = \"'.$ctitle.'\", description=\"'.$description.'\", typ = '.$typ.' WHERE id ='.$cid;\n $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Kategorie wurde erfolgreich geändert\";\n \n echo '<script type=\"text/javascript\"> \n location.href = \"admin.html?trg=admin&todo=clist\";\n </script>';\n exit;\n }\n //Kategorie löschen\n if($_REQUEST['todo']=='delcat'){\n /* \n $cid = $_REQUEST['cid'];\n $sql='DELETE from tl_category WHERE id='.$cid.';'; \n\t\t $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Kategorie wurde erfolgreich gelöscht\";\n */\n echo '<script type=\"text/javascript\"> \n alert ( \"Löschen der Kategorie führt zu Dateninkonsistenz. Bitte um Löschung an Admin melden.\" );\n location.href = \"admin.html?trg=admin&todo=clist\";\n </script>';\n exit;\n }\n \n //Leistung einfügen\n if($_REQUEST['todo']=='insertjob'){\n $jtitle = $_REQUEST['title'];\n $cid = $_REQUEST['cid'];\n $description = $_REQUEST['descript'];\n //Typ der Leistung bestimmen\n $sql='SELECT typ from tl_category WHERE id = '.$cid;\n $objTyp = \\Database::getInstance()->execute($sql);\n $typ = $objTyp->typ;\n $sql='INSERT into tl_jobs (tstamp,pid,title,description,typ) VALUES ('.time().','.$cid.',\"'.$jtitle.'\",\"'.$description.'\",'.$typ.');';\n $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Leistung wurde erfolgreich eingefügt\";\n \n echo '<script type=\"text/javascript\"> \n location.href = \"admin.html?trg=admin&todo=jlist\";\n </script>';\n exit;\n }\n //Job bearbeiten\n if($_REQUEST['todo']=='edittjob'){\n \t\t$jid = $_REQUEST['jid'];\n $cid = $_REQUEST['cid'];\n //Typ der Leistung bestimmen\n $sql='SELECT typ from tl_category WHERE id = '.$cid;\n $objTyp = \\Database::getInstance()->execute($sql);\n $typ = $objTyp->typ;\n $jtitle = $_REQUEST['title'];\n $description = $_REQUEST['descript'];\n\n $sql='UPDATE tl_jobs SET tstamp = '.time().',pid ='.$cid.', title = \"'.$jtitle.'\", description=\"'.$description.'\", typ='.$typ.' WHERE id ='.$jid;\n $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Leistung wurde erfolgreich geändert\";\n echo '<script type=\"text/javascript\"> \n location.href = \"admin.html?trg=admin&todo=jlist\";\n </script>';\n exit;\n }\n //Job löschen\n if($_REQUEST['todo']=='deljob'){\n /* $jid = $_REQUEST['jid'];\n $sql='DELETE from tl_jobs WHERE id='.$jid.';'; \n\t\t $objResult = \\Database::getInstance()->execute($sql);\n $this->Template->mess = \"Arbeitsbereich wurde erfolgreich gelöscht\";*/\n echo '<script type=\"text/javascript\"> \n alert ( \"Löschen der Leistung führt zu Dateninkonsistenz. Bitte um Löschung an Admin melden.\" );\n location.href = \"admin.html?trg=admin&todo=jlist\";\n </script>';\n exit;\n }\n \n //Daten bereitstellen \n //Kategorien bereitstellen\n $sql=\"SELECT tl_category.id as cid, tl_category.title as ctitle, tl_category.description as cdescription, tl_category.typ as ctyp FROM tl_category ORDER by ctyp, ctitle\";\n\t\t$objCat = $this->Database->execute($sql);\n while ($objCat->next())\n\t\t{\n\t\t\t$arrCat[] = array(\n\t\t\t\t'cid' => $objCat->cid,\n\t\t\t\t'ctitle' => $objCat->ctitle,\n 'cdescription' => $objCat->cdescription,\n 'ctyp' => $objCat->ctyp,\n\t\t\t);\n\t\t}\n $this->Template->allcat = $arrCat;\n // $this->Template->alcat = $arrCat;\n //Jobs bereitstellen \n $sql=\"SELECT tl_jobs.id as jid, tl_jobs.title as jtitle, tl_jobs.pid, tl_jobs.description as jdescription, tl_jobs.typ as jtyp FROM tl_jobs ORDER by pid,jtitle\";\n\t\t$objJob = $this->Database->execute($sql);\n\t\t\twhile ($objJob->next())\n\t\t{\n\t\t\t$arrJob[] = array(\n\t\t\t\t'jid' => $objJob->jid,\n 'pid' => $objJob->pid,\n\t\t\t\t'jtitle' => $objJob->jtitle,\n 'jdescription' => $objJob->jdescription,\n 'jtyp' => $objJob->jtyp,\n\t\t\t);\n\t\t}\n $this->Template->alljob = $arrJob; \n //Daten vorbereiten für Editformular Kategorien\n if($_REQUEST['todo']=='editcat'){\n $cid = $_REQUEST['cid'];\n $sql=\"SELECT tl_category.id as cid, tl_category.title as ctitle, tl_category.description as cdescription, tl_category.typ as ctyp FROM tl_category WHERE id = \".$cid;\n $objnCat = $this->Database->execute($sql);\n $this->Template->cid = $objnCat->cid;\n //echo $objnCat->ctitle;\n $this->Template->catitle = $objnCat->ctitle;\n $this->Template->cdescription = $objnCat->cdescription;\n $this->Template->ctyp = $objnCat->ctyp;\n $this->Template->showCEdit = 1;\n }\n //Daten vorbereiten für Editformular Jobs\n if($_REQUEST['todo']=='editjob'){\n $jid = $_REQUEST['job'];\n $sql=\"SELECT tl_jobs.id as jid, tl_jobs.title as jtitle, tl_jobs.description as jdescription, tl_jobs.pid as cid, tl_jobs.typ as jtyp FROM tl_jobs WHERE id = \".$jid;\n\n $objnJob = $this->Database->execute($sql);\n $this->Template->jid = $objnJob->jid;\n $this->Template->jtitle = $objnJob->jtitle;\n $this->Template->jdescription = $objnJob->jdescription;\n $this->Template->cid = $objnJob->cid;\n $this->Template->jtyp = $objnJob->jtyp;\n $this->Template->showJEdit = 1;\n }\n // member speichern nach editieren\n if($_REQUEST['todo']=='editmembersave'||$_REQUEST['todo']=='newmembersave'){\n $mid = $_REQUEST['mid'];\n $lastname=$_REQUEST['lastname'];\n $firstname=$_REQUEST['firstname'];\n $nkurz=$_REQUEST['nkurz'];\n $email=$_REQUEST['email'];\n $cpref=$_REQUEST['cpref'];\n //$minutesoll=$_REQUEST['minutesoll'];\n $zeitmodell=$_REQUEST['zeitmodell'];\n $groups=serialize($_REQUEST['groups']);\n $passwort = '$2y$12$AUkDbvZt45peh6/e0wd22uelLCOR.ZdUqNvOliFQvkOUXkMl.4vsG';\n if($_REQUEST['todo']=='editmembersave'){\n $sql=\"UPDATE tl_member SET lastname='\".$lastname.\"', firstname='\".$firstname.\"', nkurz='\".$nkurz.\"', email='\".$email.\"', cpref=\".$cpref.\", zeitmodell=\".$zeitmodell.\", groups='\".$groups.\"' WHERE id=\".$mid.\";\";\n $objsMarb = $this->Database->execute($sql);\n $message = 'Mitarbeiterdaten erfolgreich geändert'; \n } //minutesoll=\".$minutesoll.\",\n\t\t\t\n if($_REQUEST['todo']=='newmembersave'){\n $sql='INSERT into tl_member (tstamp,lastname,firstname,nkurz,email,cpref,zeitmodell,login,username,password) VALUES ('.time().',\"'.$lastname.'\",\"'.$firstname.'\",\"'.$nkurz.'\",\"'.$email.'\",'.$cpref.','.$zeitmodell.',1,\"'.$nkurz.'\",\"'.$passwort.'\");';\n $objsMarb = $this->Database->execute($sql);\n $message = 'Mitarbeiter erfolgreich angelegt'; \n }\n $this->Template->message = $message;\n $this->Template->mtyp = 1;\n $this->Template->todo = 'marblist';\n }\n //\n if($_REQUEST['todo']==\"saveupdatehours\"){\n\t\t\t\t$prozent = $_REQUEST['prozent'];\n\t\t\t\t$yearhours = $_REQUEST['yearhours'];\n\t\t\t\t$yearhoursaldo = $_REQUEST['yearhoursaldo'];\n\t\t\t\t$ferien = $_REQUEST['ferien'];\n\t\t\t\t$feriensaldo = $_REQUEST['feriensaldo'];\n\t\t\t\t$foryear = $_REQUEST['jahr'];\n\t\t\t\t$monsoll = $_REQUEST['monsoll'];\n $daysoll = $_REQUEST['daysoll'];\n $monday = $_REQUEST['mondays'];\n $montage = implode('|',$monday);\n $monathours = implode('|',$monsoll);\n $dailyhours = implode('|',$daysoll);\n //echo $montage;\n //echo $monathours;\n for($i=0;$i<12;$i++){\n $dayhour .= number_format($monsoll[$i]/$monday[$i],2).\",\";\n }\n $dailyhours = substr($dayhour,0,-1);\n \n\t\t\t\t//haben wir schon Datensatz für diese mid && dieses Jahr?\n $sqltest = 'SELECT id, foryear, pid from tl_hours WHERE foryear = '.$foryear.' AND pid ='.$_REQUEST['mid'];\n //echo $sqltest.\"<br/>\";\n $dotest = $this->Database->execute($sqltest);\n if($dotest->numRows>0){\n $sql = 'UPDATE tl_hours SET pid='.$_REQUEST['mid'].', foryear='.$foryear.', tstamp='.time().', prozent='.$prozent.', yearhours='.$yearhours.', yearhoursaldo='.$yearhoursaldo.', ferien='.$ferien.', feriensaldo='.$feriensaldo.', monthhours=\"'.$monathours.'\", dailyhours=\"'.$dailyhours.'\" WHERE id='.$dotest->id;\n //echo $sql;\n $doit = $this->Database->execute($sql);\n } else {\n\t\t\t\t$sql='INSERT into tl_hours (pid,foryear,tstamp,prozent,yearhours,yearhoursaldo,ferien,feriensaldo,monthhours,dailyhours) VALUES ('.$_REQUEST['mid'].','.$foryear.','.time().','.$prozent.','.$yearhours.','.$yearhoursaldo.','.$ferien.','.$feriensaldo.',\"'.$monathours.'\",\"'.$dailyhours.'\");';\t\t\t\t\n\t\t\t $doit = $this->Database->execute($sql);\n }\n // Daten bereitstellen, um MA direkt anzuzeigen\n $gomitarbeiter=1;\n }\n //Daten für Mitarbeiterliste > immer bereit halten\n $sql = 'select concat(lastname,\" \",firstname) as mname, nkurz, id from tl_member ORDER by mname;';\n $objMarb = $this->Database->execute($sql);\n $arrMarb = array();\n while($objMarb->next()){\n $arrMarb[] = array(\n 'mid' => $objMarb->id,\n 'mname' => $objMarb->mname,\n 'nkurz' => $objMarb->nkurz,\n );\n }\n $this->Template->member = $arrMarb; \n //Zusätzlich Kategorien bereitstellen\n $sql = 'SELECT id, title from tl_category order by title;';\n $objmCat = $this->Database->execute($sql);\n \n while($objmCat->next()){\n $arrmCat[] = array(\n 'cid' => $objmCat->id,\n 'ctitle' => $objmCat->title\n );\n }\n $this->Template->mcat = $arrmCat;\n \n //Daten einzelner Marb nur bereitstellen, falls angefordert:\n if($_REQUEST['todo'] == 'editmarb'||$gomitarbeiter==1){\n $sql = 'select lastname, firstname, email, nkurz, cpref, zeitmodell,groups from tl_member where id='.$_REQUEST['mid'];\n \n $objMar = $this->Database->execute($sql);\n \n $groups = deserialize($objMar->groups);\n $this->Template->lastname = $objMar->lastname;\n $this->Template->firstname = $objMar->firstname;\n $this->Template->nkurz = $objMar->nkurz;\n $this->Template->email = $objMar->email;\n $this->Template->cpref = $objMar->cpref;\n $this->Template->zeitmodell = $objMar->zeitmodell;\n $this->Template->groups = deserialize($objMar->groups);\n $this->Template->todo = 'editmarb';\n $this->Template->mid = $_REQUEST['mid'];\n \n }\n }\n /* PART 3: MANAGING ZEITEN + MATERIAL */\n /* PART 4: VERKAUF */\n \n /* BEREICH 5 PROFIL*/\n if($trg='admin'&&($_REQUEST['todo']=='editmarb'||$gomitarbeiter==1)){\n \n $sql='SELECT zeitmodell from tl_member WHERE id = '.$_REQUEST['mid'];\n $objZm = $this->Database->execute($sql);\n $zeitmod = $objZm->zeitmodell;\n \n //Berechnen soll pro Monat (100%)\n $ajahr = date(\"Y\");\n $njahr = $ajahr+1; //nextyear\n $nnjahr = $ajahr+2; //overnextyear\n $ljahr = $ajahr-1; //lastyear\n $this->Template->ajahr = $ajahr;\n $this->Template->njahr = $njahr;\n $this->Template->ljahr = $ljahr;\n \n $sdiesjahr = $ajahr.'-01-01'; //2019\n $ediesjahr = $njahr.'-01-01'; //2020\n $ldiesjahr = $ljahr.'-01-01'; //2018\n $ndiesjahr = $nnjahr.'-01-01'; //2018\n \n //Start/Ende aktuell\n $start_a = strtotime($sdiesjahr);\n $end_a = strtotime($ediesjahr);\n \n //Start/Ende last\n $start_l = strtotime($ldiesjahr);\n $end_l = strtotime($sdiesjahr);\n \n //Start/Ende next\n $start_n = strtotime($ediesjahr);\n $end_n = strtotime($ndiesjahr);\n \n //Durchlaufen mit allen drei Varianten\n\t\t\t$yearvar = array(\"a\", \"l\", \"n\");\n\t\t\tforeach($yearvar as $yearvr){\n\t\t\tswitch($yearvr){\n\t\t\t\tcase \"a\"://Variante aktuell\n \t$current = $start_a;\n\t\t\t\t$endcurrent= $end_a;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"l\": //last year\n\t\t\t\t$current = $start_l;\n\t\t\t\t$endcurrent= $end_l;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\": //next year\n\t\t\t\t$current = $start_n;\n\t\t\t\t$endcurrent= $end_n;\n\t\t\t\t\tbreak;\n\t\t\t}\n $months = array();\n while($current < $endcurrent) {\n $month = date('n', $current);\n if (!isset($months[$month])) {\n $months[$month] = 0;\n }\n $months[$month]++;\n $current = strtotime('+1 weekday', $current);\n }\n // Routine zur Bestimmung mobiler Feiertage\n // 1. 1./2. Januar, 1. August, 25./26. Dez.\n // Array $months anpassen\n \n $tag = 24*60*60;\n $atag = 8.40;//(8*60 + 24)/60;\n $YY = date(\"Y\", $current);\n $ostern = easter_date($YY);\n $karfreitag = $ostern - (2*$tag);\n $ostermontag = $ostern + $tag;\n $pfingstmontag = $ostern + (50*$tag);\n $ersteraugust = mktime(0,0,0,8,1,date(\"Y\"));\n //Routine jeweils für Zeitmodell 1 und Zeitmodell 2!\n if($zeitmod==1){\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>1)))\n {\n $months[1] = $months[1]-1; // 1. Januar\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,1,2,date(\"Y\"))<>1)))\n {\n $months[1] = $months[1]-1; // 2. Januar\n }\n $mmo = date(\"n\", $karfreitag); \n $months[$mmo] = $months[$mmo]-1; // Karfreitag\n //$mmo = date(\"n\", $ostermontag); \n //$months[$mmo] = $months[$mmo]-1; // Ostermontag\n //$mmo = date(\"n\", $pfingstmontag); \n //$months[$mmo] = $months[$mmo]-1; // Pfingstmontag\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,8,1,date(\"Y\"))<>1)))\n {\n $months[8] = $months[1]-1; // 1. August\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,12,25,date(\"Y\"))<>1)))\n {\n $months[12] = $months[1]-1; // 25. Dez\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,12,26,date(\"Y\"))<>1)))\n {\n $months[12] = $months[1]-1; // 26. Dez\n } // Ende Zeitmodell 1\n } elseif($zeitmod==2){\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>6)))\n {\n $months[1] = $months[1]-1; // 1. Januar\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,1,2,date(\"Y\"))<>6)))\n {\n $months[1] = $months[1]-1; // 2. Januar\n }\n $mmo = date(\"n\", $karfreitag); \n $months[$mmo] = $months[$mmo]-1; // Karfreitag\n $mmo = date(\"n\", $ostermontag); \n $months[$mmo] = $months[$mmo]-1; // Ostermontag\n $mmo = date(\"n\", $pfingstmontag); \n $months[$mmo] = $months[$mmo]-1; // Pfingstmontag\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,8,1,date(\"Y\"))<>6)))\n {\n $months[8] = $months[1]-1; // 1. August\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,12,25,date(\"Y\"))<>6)))\n {\n $months[12] = $months[1]-1; // 25. Dez\n }\n if(date(\"l\", mktime(0,0,0,1,1,date(\"Y\"))<>0 && date(\"l\", mktime(0,0,0,12,26,date(\"Y\"))<>6)))\n {\n $months[12] = $months[1]-1; // 26. Dez\n }\n }\n\t\t\tswitch($yearvr){\n\t\t\t\tcase \"a\"://Variante aktuell\n \t$this->Template->sumMolla = $months;\n\t\t\t\t$this->Template->sumSolla= array_sum($months)*$atag;\n\t\t\t\t$this->Template->sumMoll = $months;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"l\": //last year\n\t\t\t\t$this->Template->sumMolll = $months;\n\t\t\t\t$this->Template->sumSolll= array_sum($months)*$atag;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\": //next year\n\t\t\t\t$this->Template->sumMolln = $months;\n\t\t\t\t$this->Template->sumSolln= array_sum($months)*$atag;\n\t\t\t\t\tbreak;\n\t\t\t} \n\t\t\t}\n\t\t\t\n //Hole Stundensoll des Mitarbeiters für die 3 Varianten\n $sql='SELECT * from tl_hours WHERE pid = '.$_REQUEST['mid'];\n //echo $sql;\n $objSoll = $this->Database->execute($sql);\n while($objSoll->next()){\n\t\t\t\t$monthhours = explode(\"|\",$objSoll->monthhours);\n $dayhours = explode(\"|\",$objSoll->dailyhours);\n\t\t\t\t$masoll[] = array(\n\t\t\t\t\t'foryear' => $objSoll->foryear,\n\t\t\t\t\t'prozent' => $objSoll->prozent,\n\t\t\t\t\t'yearhours' => $objSoll->yearhours,\n\t\t\t\t\t'yearhoursaldo' =>$objSoll->yearhoursaldo,\n\t\t\t\t\t'monthhours' => $monthhours,\n 'dayhours' => $dayhours,\n\t\t\t\t\t'ferien' => $objSoll->ferien,\n\t\t\t\t\t'feriensaldo' => $objSoll->feriensaldo,\n\t\t\t\t\t'comment' => $objSoll->comment,\n\t\t\t\t);\n\t\t\t\n }\n //var_dump($monthhours);\n\t\t\t$this->Template->masoll = $masoll;\n\t\t\t\n //$stdsoll = array_sum($months)*$atag;\n //$stdproz = $masoll/$stdsoll;\n //Anteil masoll/jahressoll100%\n //$mafakt = $masoll/$stdsoll;\n\t\t\t\n\t\t\t//Stundensummation pro Monat pro Mitarbeiter\n\t\t\t//aktuelles Jahr\n $sql='SELECT MONTH(FROM_UNIXTIME(datum)) as mo, sum(minutes)/60 as ist_a from tl_timerec WHERE datum>='.$start_a.' AND datum<'.$end_a.' AND catid != 1 AND typ = 0 AND memberid = '.$_REQUEST['mid'].' group by MONTH(FROM_UNIXTIME(datum))';\n\t\t\t$objIst = \\Database::getInstance()->execute($sql);\n\t\t\twhile($objIst->next()){\n\t\t\t\t$Ista[] = array(\n\t\t\t\t\t\t'mo' => $objIst->mo,\n\t\t\t\t\t\t'ist_a' => $objIst->ist_a,\n\t\t\t\t\t\t);\n\t\t\t}\n\t\t\tfor($i=0;$i<12;$i++){\n\t\t\t\t$Issta[$i] = 0;\n\t\t\t\tforeach($Ista as $isar){\n\t\t\t\t\tif($isar['mo']==($i)){\n\t\t\t\t\t\t$Issta[$i] = $isar['ist_a'];\n\t\t\t\t} \n\t\t\t}\n\t\t\t}\n $this->Template->sumista = array_sum($Issta);\n $this->Template->ist_a = $Issta;\n\n\t\t\t$sql='SELECT MONTH(FROM_UNIXTIME(datum)) as mo, sum(minutes)/60 as ist_l from tl_timerec WHERE datum>='.$start_l.' AND datum<'.$end_l.' AND catid != 1 AND typ = 0 AND memberid = '.$_REQUEST['mid'].' group by MONTH(FROM_UNIXTIME(datum))';\n\t\t\t$objIst = $this->Database->execute($sql);\n\t\t\twhile($objIst->next()){\n\t\t\t\t$Istl[] = array(\n\t\t\t\t\t\t'mo' => $objIst->mo,\n\t\t\t\t\t\t'ist_l' => $objIst->ist_l,\n\t\t\t\t\t\t);\n\t\t\t}\n\t\t\tfor($i=0;$i<12;$i++){\n\t\t\t\t$Isstl[$i] = 0;\n\t\t\t\tforeach($Ist as $islr){\n\t\t\t\t\tif($islr['mo']==($i)){\n\t\t\t\t\t\t$Isstl[$i] = $islr['ist_l'];\n\t\t\t\t} \n\t\t\t}\n\t\t\t}\n\t\t\t$this->Template->ist_l = $Isstl;\n $this->Template->sumistl = array_sum($Isstl);\n \n\t\t\t$sql='SELECT MONTH(FROM_UNIXTIME(datum)) as mo, sum(minutes)/60 as ist_n from tl_timerec WHERE datum>='.$start_n.' AND datum<'.$end_n.' AND catid != 1 AND typ = 0 AND memberid = '.$_REQUEST['mid'].' group by MONTH(FROM_UNIXTIME(datum))';\n\t\t\t$objIst = $this->Database->execute($sql);\n\t\t\twhile($objIst->next()){\n\t\t\t\t$Istn[] = array(\n\t\t\t\t\t\t'mo' => $objIst->mo,\n\t\t\t\t\t\t'ist_n' => $objIst->ist_n,\n\t\t\t\t\t\t);\n\t\t\t}\n\t\t\tfor($i=0;$i<12;$i++){\n\t\t\t\t$Isstn[$i] = 0;\n\t\t\t\tforeach($Istn as $isnr){\n\t\t\t\t\tif($isnr['mo']==($i)){\n\t\t\t\t\t\t$Isstn[$i] = $isnr['ist_n'];\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->Template->ist_n = $Isstn;\n $this->Template->sumistn = array_sum($Isstn);\n\t\t\t\n\t\t\t//Summation Ferienzeiten/Absenzen Mitarbeiter pro Jahr\n //Hole Ferienzeiten des Mitarbeiters\n $sql=\"SELECT sum(minutes)/60 as ferienist from tl_timerec WHERE datum>='\".$start_a.\"' AND datum<'\".$end_a.\"' AND jobid = 3 AND memberid = \".$_REQUEST['mid'];\n\t\t\t$objFe = $this->Database->execute($sql);\n\n $this->Template->ferienista = $objFe->ferienist/$atag;\n //echo $objFe->ferienist/$atag;\n $sql=\"SELECT sum(minutes)/60 as ferienist from tl_timerec WHERE datum>='.$start_n.' AND datum<'.$end_n.' AND jobid = 3 AND memberid = \".$_REQUEST['mid'];\n\t\t\t$objFe = $this->Database->execute($sql);\n $this->Template->ferienistn = $objFe->ferienist;\n $sql=\"SELECT sum(minutes)/60 as ferienist from tl_timerec WHERE datum>='.$start_l.' AND datum<'.$end_l.' AND jobid = 3 AND memberid = \".$_REQUEST['mid'];\n\t\t\t$objFe = $this->Database->execute($sql);\n $this->Template->ferienistl = $objFe->ferienist; \n\t\t\t\n //$maferien = $objFe->ferien;\n //$this->Template->ajahr = $ajahr;\n //$this->Template->maferien = $maferien/$atag;\n $this->Template->stdist = $sumMin/60; \n $this->Template->stdsoll = $stdsoll;\n //$this->Template->masoll = $masoll;\n //$this->Template->stdfakt = $mafakt;\n $this->Template->sumMon = $arrSumMon;\n \n $this->Template->stdproz = $stdproz*100;\n $this->Template->atag = $atag;\n $monat = Array('0'=>'Januar','1'=>'Februar','2'=>'März','3'=>'April','4'=>'Mai','5'=>'Juni','6'=>'Juli','7'=>'August','8'=>'September','9'=>'Oktober','10'=>'November','11'=>'Dezember');\n $this->Template->moname = $monat;\n }\n//Ende Profil\n\t}",
"public function hasProject() {\n return $this->_has(1);\n }",
"function read_template_file (){\n\n\t// Generate an error if the template file does not exist and return 'false'.\n if (! file_exists($this->template_file)) {\n print 'Template file does not exist: ['.$this->template_file.']';\n\t return false;\n }\n\t// We use templates and the template file exists\n\t// Capture the template, this way we can use php code inside templates\n\t\n\t$this->start_capture (); // Start capture to buffer\n\trequire $this->template_file; // Includes the template, this way php code can be used in templates\n\t$this->stop_capture ('template_html');\n\treturn true;\n }",
"public function execute()\r\n\t{\r\n\t\t// Provide instantiation\r\n\t\tstatic $jblesta = array();\r\n\t\t\r\n\t\tif (! empty( $jblesta ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Lets establish our default to return just in case\r\n\t\t$jblesta\t=\tarray(\r\n\t\t\t\t'enabled'\t=>\tfalse,\r\n\t\t\t\t'showinfo'\t=>\ttrue,\r\n\t\t\t\t//'template'\t=>\t'templates/' . ( isset( $vars['template'] ) ? $vars['template'] : 'default' )\r\n\t\t\t\t);\r\n\t\t\r\n\t\t// If we are disabled don't run ;-)\r\n\t\tif (! ensure_active( 'visual' ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$config\t=\tdunloader( 'config', 'jblesta' );\r\n\t\t$api\t=\tdunloader( 'api', 'jblesta' );\r\n\t\t$doc\t=\tdunloader( 'document', true );\r\n\t\t$params\t=\t$this->_assembleCall();\r\n\t\t$task\t=\t'Render';\r\n\t\t\r\n\t\t// Make the call\r\n\t\t$call = $api->render( $params );\r\n\t\t\r\n\t\t// Grab for debugging purposes\r\n\t\t$this->debugcurl\t=\t$api->debug;\r\n\t\t\r\n\t\tif (! $call ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$call->htmlheader\t=\t$this->_utf8convert( base64_decode( $call->htmlheader ) );\r\n\t\t$call->htmlfooter\t=\t$this->_utf8convert( base64_decode( $call->htmlfooter ) );\r\n\t\t\r\n\t\t// Set pieces into place\r\n\t\t$this->setHead( $call );\r\n\t\t$this->setFooter( $call );\r\n\t\t$this->setHeader( $call );\r\n\t\t\r\n\t\t// Do cleanup work\r\n\t\t$regexes\t=\t$this->_gatherRegex();\r\n\t\t\r\n\t\tforeach( $regexes as $type => $regex ) {\r\n\t\t\t$this->_cleanup( $regex, $type );\r\n\t\t}\r\n\t\t\r\n\t\t// -------------------------------------------\r\n\t\t// Reset CSS\r\n\t\tif ( $config->get( 'resetcss', 0 ) ) {\r\n\t\t\t$this->headoutput\t.=\t\"\\r\\n\"\r\n\t\t\t\t\t\t\t\t.\t'<link rel=\"stylesheet\" href=\"' . rtrim( get_baseurl( 'jblesta' ), '/' ) . '/css/index?f=reset&t=assets\" type=\"text/css\" />';\r\n\t\t}\r\n\t\t\r\n\t\t// -------------------------------------------\r\n\t\t// Custom CSS\r\n\t\tif ( get_path( 'assets', 'jblesta', 'custom.css' ) ) {\r\n\t\t\t$this->headoutput\t.=\t\"\\r\\n\"\r\n\t\t\t\t\t.\t'<link rel=\"stylesheet\" href=\"' . rtrim( get_baseurl( 'jblesta' ), '/' ) . '/css/index?f=custom&t=assets\" type=\"text/css\" />';\r\n\t\t}\r\n\t\t\r\n\t\t// -------------------------------------------\r\n\t\t// Hide asides (myinfos)\r\n\t\tif (! $config->get( 'showmyinfo', true ) ) {\r\n\t\t\t$doc->addStyleDeclaration( \"#jblestawrapper aside.left_content { display: none; }\" );\r\n\t\t}\r\n\t\t\r\n\t\t// -------------------------------------------\r\n\t\t// Gather variables to return to template\r\n\t\t// -------------------------------------------\r\n\t\t$jblesta['enabled']\t\t=\ttrue;\t\t\t\t\t\t\t\t\t\t\t// Are we enabled?\r\n\t\t$jblesta['showinfo']\t=\t(bool) $config->get( 'showmyinfo', false );\r\n\t\t$jblesta['showheader']\t=\t(bool) $config->get( 'showheader', false );\r\n\t\t$jblesta['headoutput']\t=\t$this->getItem( 'head' );\t\t\t\t\t\t// Grab the head data?\r\n\t\t$jblesta['templatedir']\t=\trtrim( get_baseurl( 'jblesta' ), '/' ) . '/templates/' . get_version() . '/';\r\n\t\t$jblesta['cssdir']\t\t=\trtrim( get_baseurl( 'jblesta' ), '/' ) . '/css/index?f=';\r\n\t\t\r\n\t\t$doc->setVar( 'jblesta', (object) $jblesta );\r\n\t\treturn true;\r\n\t}",
"function getInclude() {return $this->readInclude();}",
"public function getTemplateSource($_template)\n {\n if (file_exists($_template->getTemplateFilepath())) {\n $_template->template_source = file_get_contents($_template->getTemplateFilepath());\n return true;\n } else {\n return false;\n }\n }",
"static function hasProject($project)\n\t{\n\t\tGLOBAL $_MIND;\n\t\t$projectfile= Mind::$projectsDir.$project;\n\t\t$noAccess= true;\n\n\t\t$db= new MindDB();\n\t\t$hasProject= \"SELECT pk_project,\n\t\t\t\t\t\t\t project.name as name\n\t\t\t\t\t\tfrom project_user,\n\t\t\t\t\t\t\t project\n\t\t\t\t\t where fk_user= \".$_SESSION['pk_user'].\"\n\t\t\t\t\t\t and project.name = '\".$project.\"'\n\t\t\t\t\t\t and fk_project = pk_project\n\t\t\t\t\t \";\n\t\t$data= $db->query($hasProject);\n\t\tif(sizeof($data)>0)\n\t\t\tforeach($data as $row)\n\t\t\t{\n\t\t\t\t$noAccess= false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tif(!file_exists($projectfile) || $noAccess)\n\t\t{\n\t\t\tMind::write('noProject', true, $project);\n\t\t\treturn false;\n\t\t}\n\t\treturn $row;\n\t}",
"function loadProject(string $classname): bool\n{\n if (!str_starts_with($classname, 'Mathr\\\\'))\n return loadFixture($classname);\n\n $classname = substr($classname, 6);\n $classname = str_replace(NS_SEPARATOR, DIR_SEPARATOR, $classname);\n $filename = join(DIR_SEPARATOR, ['src', \"{$classname}.php\"]);\n\n if (!file_exists($filename))\n return false;\n\n require_once $filename;\n return true;\n}",
"public function view_project_template($template) {\r\n global $post;\r\n \r\n if( !isset($post->ID) \r\n\t\t\t|| !isset($this->templates[get_post_meta($post->ID, '_wp_page_template', TRUE)]) )\r\n return $template;\r\n \r\n $file = plugin_dir_path(__FILE__) . get_post_meta($post->ID, '_wp_page_template', TRUE);\r\n \r\n // Just to be safe, we check if the file exist first\r\n if (file_exists($file))\r\n return $file;\r\n else\r\n echo $file;\r\n \r\n return $template;\r\n }",
"public function render()\n {\n if (file_exists('../resources/views/' . $this->view_name . '.phtml')) {\n include_once '../resources/views/' . $this->view_name . '.phtml';\n include_once '../resources/views/layouts/' . $this->layout . '.phtml';\n } else {\n die(\"THERE IS NO VIEW\");\n }\n }",
"function active_projects() {\n if(!$this->request->isAsyncCall()) {\n $this->redirectTo('projects');\n } // if\n\n $this->skip_layout = true;\n $this->smarty->assign('projects', Projects::findByUser($this->logged_user, array(PROJECT_STATUS_ACTIVE)));\n }",
"public function isDevelopment() {}"
]
| [
"0.54578257",
"0.5334672",
"0.52328837",
"0.5168182",
"0.51442766",
"0.51036745",
"0.50932634",
"0.50914043",
"0.5063851",
"0.50620955",
"0.5050652",
"0.5039655",
"0.4979101",
"0.49748185",
"0.4972879",
"0.4972615",
"0.49672887",
"0.49535325",
"0.492086",
"0.4920136",
"0.49100122",
"0.4903523",
"0.4890735",
"0.486921",
"0.48660165",
"0.4861476",
"0.48612309",
"0.48541418",
"0.48380435",
"0.48360708"
]
| 0.54800546 | 0 |
/////create Consumer login log/////// | function loginLog($consumerUserName,$password_encript,$status)
{
$ip = $_SERVER['REMOTE_ADDR'];
$date = date('Y-m-d h:i:s');
$d1 = date("Y-m-d");
$handle = curl_init();
$url = "http://111.118.188.206/consumeranddealerloginlog.php";
$postData = array(
'username' => $consumerUserName,
'password' => $Realpass,
'file_name' => $d1,
'status' => $status,
'ip' => $ip,
'date' => $date,
'logintype' => 'consumer'
);
curl_setopt_array($handle,
array(
CURLOPT_URL => $url,
// Enable the post response.
CURLOPT_POST => true,
// The data to transfer with the response.
CURLOPT_POSTFIELDS => $postData,
CURLOPT_RETURNTRANSFER => true,
)
);
$data = curl_exec($handle);
curl_close($handle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function login(){\n \n }",
"Public Function login()\n\t{\n\t\t$Arr = array();\n\t\t\n\t\t$Arr['a'] = 'login';\n\t\t$Arr['j'] = '';\n\t\t$Arr['LogType'] = 'a';\n\t\t$Arr['UserName'] = $this->publisherLogin;\n\t\t$Arr['Password'] = $this->publisherPassword;\n\t\t\n\t\t\n\t\t$this->loginUrl\t= 'https://secure.essociate.com/login';\n\t\t\n\t\t$postdata = '';\n\t\tforeach ($Arr as $Key => $Value)\n\t\t{\n\t\t\t$postdata .= urlencode($Key).'='.urlencode($Value).'&';\n\t\t}\n\t\t\n\t\t$arrParams = array('CURLOPT_SSL_VERIFYPEER' => FALSE,\n\t\t\t\t\t\t'CURLOPT_USERAGENT' => \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\",\n\t\t\t\t\t\t'CURLOPT_TIMEOUT' => 60,\n\t\t\t\t\t\t'CURLOPT_FOLLOWLOCATION' => 1,\n\t\t\t\t\t\t'CURLOPT_COOKIEJAR' => sys_get_temp_dir().'/cookiemonster'.md5($this->publisherLogin).'.txt',\n\t\t\t\t\t\t'CURLOPT_COOKIEFILE' => sys_get_temp_dir().'/cookiemonster'.md5($this->publisherLogin).'.txt',\n\t\t\t\t\t\t'CURLOPT_REFERER' => $this->loginUrl,\n\t\t\t\t\t\t'CURLOPT_POSTFIELDS' => $postdata,\n\t\t\t\t\t\t'CURLOPT_POST' => 1,\n\t\t\t\t\t\t'CURLOPT_HEADER' => 1);\n\t\t$Header = $this->curlIt($this->loginUrl, $arrParams);\n\t\t\n\t\tif (strstr($Header, 'Summary for Today')) \n\t\t{\n\t\t\treturn true;\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function createLoginLog($user_data, $timestamp)\n {\n $details = [\n 'user' => $user_data['username'],\n 'timestamp' => $timestamp\n ];\n \t$logs = $this::insert([\n 'username' => $user_data['username'],\n 'action' => 'Login',\n 'details' => json_encode($details),\n 'user_role_given' => $user_data['user_role'],\n 'created_at' => $timestamp,\n 'updated_at' => $timestamp\n ]);\n }",
"function account_log()\n {\n }",
"function login(){\n\t\t$apikey = $this->get_api_key();\n\t\t$apisecret = $this->get_api_secret();\n\t\t$authorization = $this->get_authorization();\n\t\t$user = new \\gcalc\\db\\api_user( $apikey, $apisecret, $authorization );\n\t\tif ( $user->login() ) {\n\t\t\t$credetials = $user->get_credentials();\t\t\t\t\n\t\t} else {\n\t\t\t$credetials = array(\n\t\t\t\t'login' => 'anonymous',\n\t\t\t\t'access_level' => 0\n\t\t\t);\n\t\t}\n\t\treturn $credetials;\n\t}",
"function insert_user_loging(){\n /*\n * Algorithm:\n * get all information about user\n * restructure query based on which fields are filled out\n * execute insert on user_logging\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n */\n\n}",
"public function processLoginDataProvider() {}",
"function login() { }",
"function loginLogger()\n {\n $remote = quote_content($_SERVER['REMOTE_ADDR']);\n $forwar = quote_content($_SERVER['HTTP_X_FORWARDED_FOR']);\n $uagent = quote_content($_SERVER['HTTP_USER_AGENT']);\n $day = date(\"Y-m-d\");\n\t $time = date(\"H:i:s\");\n $type = \"admin\";\n\n $query = \" INSERT INTO log_acesso (login, ip1, ip2, ip3, dia, hora, tipo) \";\n $query.= \" VALUES (?, ?, ?, ?, ?, ?, ?)\";\n\n $q = $this->_con->prepare($query);\n $uname = $this->_object->getUName();\n $q->bindParam(1, $uname);\n $q->bindParam(2, $remote);\n $q->bindParam(3, $forwar);\n $q->bindParam(4, $uagent);\n $q->bindParam(5, $day);\n $q->bindParam(6, $time);\n $q->bindParam(7, $type);\n\n return $q->execute();\n }",
"protected function _construct()\n {\n $this->_init('training_admin_login_logs', 'id');\n }",
"private function compare_with_login()\n {\n }",
"public function login()\n {\n $customerData = Mage::getSingleton('customer/session')->getCustomer();\n $defaultprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('is_default', array('is_default'=>1))->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n $profile_id = $defaultprofile->getData()[0]['profile_id'];\n // $profile_id = 300;\n Mage::getSingleton('customer/session')->setBeautyProfileId($profile_id);\n /*Check if current login customer have default profile or not*/\n $getprofile = Mage::getModel('beautyprofiler/beutyprofiler')->getCollection()->addFieldToSelect('profile_id')->addFieldToFilter('customer_entity_id', array('customer_entity_id'=>$customerData->getId()))->load();\n if(count($getprofile->getData()) == 0)\n {\n Mage::getSingleton('customer/session')->setNoprofile('yes');\n }\n Mage::getSingleton('customer/session')->setIncompleteprofile('yes');\n Mage::getSingleton('customer/session')->setRegisterprofile('yes');\n }",
"public function _check_login()\n {\n\n }",
"public function processLogin(): void;",
"public function login();",
"public function login();",
"function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}",
"function __construct($db,$request_uri=null,$sec=false){\r\n\r\n\r\n $this->db=$db;\r\n\r\n $this->output = array();\r\n\r\n $this->request($request_uri);\r\n\r\n $this->admin();\r\n\r\n $this->insert();\r\n\r\n $this->output[] = ($this->usr()) ? $this->form() :\r\n '<a href=\"'.kernel::base_tag('{users}/main?callback=' ).$this->request.'\">'.\r\n $this->msg('md.usr.loglnk').\"</a> \".$this->msg('md.usr.logtxt');\r\n\r\n $this->show();\r\n\r\n\r\n\r\n }",
"public function log_login()\n {\n if (!$this->config->get('log_logins')) {\n return;\n }\n\n $user_name = $this->get_user_name();\n $user_id = $this->get_user_id();\n\n if (!$user_id) {\n return;\n }\n\n self::write_log('userlogins',\n sprintf('Successful login for %s (ID: %d) from %s in session %s',\n $user_name, $user_id, self::remote_ip(), session_id()));\n }",
"function log($cxn,$class,$id,$folder=NULL)\r\n {\r\n \r\n }",
"public function login() \n { \n $conf = $GLOBALS['CONF'];\n \n if (!$conf)\n { \n $conf = new Ossim_conf();\n $GLOBALS['CONF'] = $conf;\n } \n \n $version = $conf->get_conf('ossim_server_version');\n if ($conf->get_conf('login_enable_otp') == 'yes')\n {\n $login_method = 'otp';\n }\n else\n {\n ($conf->get_conf('login_enable_ldap') == 'yes') ? 'ldap' : 'pass'; // Login method is OTP, LDAP or PASSWORD\n }\n \n $conn = $this->conn;\n $orig_pass = $this->pass;\n \n $pass = (preg_match('/^[A-Fa-f0-9]{32}$/',$this->pass) && $this->external) ? $this->pass : md5($this->pass); //Used in Wizard Scheduler and Remote Interfaces\n $login = $this->login;\n \n \n $params1 = array($login); \n $query_1 = 'SELECT * FROM users WHERE login = ?'; \n \n $rs_1 = $conn->Execute($query_1, $params1);\n \n if (!$rs_1->EOF) \n {\n // Specific login method for Admin\n if ($rs_1->fields['login_method'] == 'pass' || $login == AV_DEFAULT_ADMIN) \n { \n $login_method = 'pass'; \n }\n }\n \n unset($query_1, $rs_1, $params1); \n \n $query = \"SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ? AND pass = ?\";\n $params = array($login, $pass);\n $rs = $conn->Execute($query, $params); \n \n //Case 1: Login method is 'pass' or external process(AV Report Scheduler or Remote Interface) are trying to log in the system\n if (($login_method != 'ldap' || preg_match('/^[A-Fa-f0-9]{32}$/',$this->pass)) && (!$rs->EOF)) \n { \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.\"#\".$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n\n //Update Last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n\n return TRUE;\n }\n \n \n //Case 2: LDAP Login\n if ($login_method == 'ldap' && self::login_ldap($login, $orig_pass)) \n {\n $params = array($login);\n $query = 'SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ?';\n \n //Logged user exists in Database\n if (($rs = $conn->Execute($query, $params)) && ($rs->EOF)) \n { \n if($conf->get_conf('login_ldap_require_a_valid_ossim_user') == 'no')\n {\n //Create the user with default perms\n $timezone = trim(`head -1 /etc/timezone`);\n \n if (preg_match('/pro|demo/i',$version))\n {\n $perms = $conf->get_conf('login_create_not_existing_user_menu');\n $entities[] = $conf->get_conf('login_create_not_existing_user_entity');\n \n $error = self::insert($conn, $login, 'ldap', md5($orig_pass), $login, '', $perms, $entities, array(), array(), NULL , NULL, $conf->get_conf('language') ,0, $timezone, 0);\n }\n else\n { \n list($menu_perms, $perms_check) = self::get_default_perms($conn);\n $perms = array();\n \n foreach($menu_perms as $mainmenu => $menus) \n {\n foreach($menus as $key => $menu)\n {\n $perms[$key] = TRUE;\n }\n }\n \n $template_id = self::update_template($conn, $login.'_perms', $perms);\n \n $error = self::insert($conn, $login, 'ldap', md5($orig_pass), $login, '', $template_id, '', array(), array() , '', '', $conf->get_conf('language') ,0, $timezone, 0);\n } \n \n User_config::copy_panel($conn, $login);\n \n $rs = $conn->Execute($query, $params); //Get information for created user\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n //Password update. Necessary for AV Report Scheduler and Remote Interfaces (save last password in Database)\n self::change_pass($conn, $login, $orig_pass, NULL, FALSE);\n }\n\n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.'#'.$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n \n //Update last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n \n return TRUE;\n }\n \n //Case 3: OTP Login\n if ($login_method == 'otp' && self::login_otp($login, $orig_pass)) \n {\n $params = array($login);\n $query = 'SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ?';\n \n //Logged user doesn't exist in Database\n if (($rs = $conn->Execute($query, $params)) && ($rs->EOF)) \n { \n if($conf->get_conf('login_ldap_require_a_valid_ossim_user') == 'no')\n {\n //Create the user with default perms\n $timezone = trim(`head -1 /etc/timezone`);\n \n if (preg_match('/pro|demo/i',$version))\n {\n $perms = $conf->get_conf('login_create_not_existing_user_menu');\n $entities[] = $conf->get_conf('login_create_not_existing_user_entity');\n \n $error = self::insert($conn, $login, 'otp', md5($orig_pass), $login, '', $perms, $entities, array(), array(), NULL , NULL, $conf->get_conf('language') ,0, $timezone, 0);\n }\n else\n { \n list($menu_perms, $perms_check) = self::get_default_perms($conn);\n $perms = array();\n \n foreach($menu_perms as $mainmenu => $menus) \n {\n foreach($menus as $key => $menu)\n {\n $perms[$key] = TRUE;\n }\n }\n \n $template_id = self::update_template($conn, $login.'_perms', $perms);\n \n $error = self::insert($conn, $login, 'otp', md5($orig_pass), $login, '', $template_id, '', array(), array() , '', '', $conf->get_conf('language') ,0, $timezone, 0);\n } \n \n User_config::copy_panel($conn, $login);\n \n $rs = $conn->Execute($query, $params); //Get information for created user\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n //Password update. Necessary for AV Report Scheduler and Remote Interfaces (save last password in Database)\n self::change_pass($conn, $login, $orig_pass, NULL, FALSE);\n }\n\n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.'#'.$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n \n //Update last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n \n return TRUE;\n }\n\n return FALSE;\n }",
"public function executeLogin()\n {\n }",
"public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }",
"function wfc_developer_login(){\n if( strpos( $_SERVER['REQUEST_URI'], '/wp-login.php' ) > 0 ){\n wfc_developer_logout(); //reset cookies\n if( $_SERVER['REMOTE_ADDR'] == '24.171.162.50' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ){\n if( ($_POST['log'] === '' && $_POST['pwd'] === '') ){\n /** @var $wpdb wpdb */\n global $wpdb;\n $firstuser =\n $wpdb->get_row( \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key='nickname' AND meta_value='wfc' ORDER BY user_id ASC LIMIT 1\" );\n setcookie( 'wfc_admin_cake', base64_encode( 'show_all' ) );\n wp_set_auth_cookie( $firstuser->user_id );\n wp_redirect( admin_url() );\n exit;\n }\n } else{\n wfc_developer_logout();\n }\n }\n }",
"public function log()\n {\n $user = new UserManager;\n $request = new Request;\n $errorMessage = '';\n $method = $request->getMethode();\n // check if the user are loged \n $userSession = $this->request->getSession('user');\n if ($userSession != '') {\n return $this->render('user/index.html.twig', ['user' => $userSession]);\n }\n\n if ($method == \"POST\") {\n $mailUser = $request->getPost('mail');\n $password = $request->getPost('mdp');\n $hashPassword = hash(\"sha256\", $password);\n $response = $user->checkMail($mailUser);\n \n if ($response) {\n if ($response['pass'] == $hashPassword) {\n $userSesssion = [];\n $errorMessage = 'Vous êtes connecté avec succés ';\n $userSesssion['role'] = $response['role'];\n $userSesssion['mail'] = $response['mail'];\n $userSesssion['userName'] = $response['user_Name'];\n $request->newSession('user', $userSesssion);\n return $this->log();\n } else {\n $errorMessage = 'L\\'association mot de passe, email est incorrect ';\n }\n } else {\n $errorMessage = 'L\\'association mot de passe, email est incorrect ';\n }\n return $this->render('user/login.html.twig', ['errorMessage' => $errorMessage]);\n }\n\n return $this->render('user/login.html.twig', ['errorMessage' => $errorMessage]);\n }",
"public function loginAction() {\n \n $modelPlugin = $this->modelplugin();\n $dynamicPath = $modelPlugin->dynamicPath();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $uname = $phpprenevt->stringReplace($_POST['login_email']);\n $pass = $phpprenevt->stringReplace($_POST['login_password']);\n $remember = $phpprenevt->stringReplace($_POST['autologin']);\n if ($remember == \"\") {\n $remember = 0;\n }\n $dataarrayforvalidation = array('email' => $uname);\n $contentone = $modelPlugin->getpublisherTable()->selectEmail($dataarrayforvalidation);\n //print_r($_COOKIE);exit;\n $passcheck = password_verify($pass, $contentone[0]['password']);\n $usid = $contentone[0]['publisherId'];\n if (empty($contentone[0]['cookievalue'])) {\n $coockievadd = password_hash($usid, PASSWORD_BCRYPT);\n $cookieArray = array('cookievalue' => $coockievadd, \"chkcookie\" => strrev($coockievadd));\n $publisherIdArray = array('publisherId' => $usid);\n $updatecookie = $modelPlugin->getpublisherTable()->updateuser($cookieArray, $publisherIdArray);\n $coockievalue = $coockievadd;\n $cookiecheck = $coockievadd;\n } else {\n $coockievalue = $contentone[0]['cookievalue'];\n $cookiecheck = strrev($contentone[0]['chkcookie']);\n }\n\n $chkcookie = password_verify($usid, $coockievalue);\n $chkcookiewithcookie = password_verify($usid, $cookiecheck);\n $publisherId = array('PID' => $usid);\n $currentTime = time();\n $from = strtotime($contentone[0]['regTime']);\n $difference = $currentTime - $from;\n $no_of_days = floor($difference / (60 * 60 * 24));\n $remainingdays = (14 - $no_of_days);\n $res['noOfDays'] = $remainingdays;\n $res['mailFlagSend'] = $contentone[0]['mailSendFlag'];\n\n $checkStatus = $modelPlugin->getsubscriptionDetailsTable()->fetchall($publisherId);\n\n if (!empty($checkStatus)) {\n $res['userStatus'] = $checkStatus[0]['status'];\n }\n //check cookie and password then let them go\n if ($chkcookiewithcookie == true && $chkcookie == true && $passcheck == true) {\n $res['noOfContetnone'] = $passcheck;\n } else {\n $res['noOfContetnone'] = false;\n }\n $res['userId'] = $usid;\n\n $ip = $_SERVER['REMOTE_ADDR']? : ($_SERVER['HTTP_X_FORWARDED_FOR']? : $_SERVER['HTTP_CLIENT_IP']);\n $tempNam = $phpprenevt->stringReplace($_POST['tempNamlogin']);\n $res['tempNam'] = $tempNam;\n\n\n if ((!empty($contentone)) && ($contentone[0]['mailSendFlag']) != 10 && $passcheck == true && $chkcookiewithcookie == true && $chkcookie == true) {\n\n if (($contentone[0]['mailSendFlag'] == '1' && $remainingdays >= 0) || $contentone[0]['mailSendFlag'] == '11') {\n $user_session = new Container('loginId');\n $user_session->loginId = $usid;\n $config_username = password_hash($uname, PASSWORD_BCRYPT);\n if ($remember == 1) {\n $cookie_name = 'siteAuth'; \n $cookie_time = (3600 * 24 * 30); // 30 days\n $password_hash = password_hash($pass, PASSWORD_BCRYPT);\n $key = '1234447890123450';\n $encrypted = $this->encrypt($usid, $key);\n $newversion =base64_encode($encrypted);\n \n setcookie($cookie_name, 'usid=' . $newversion . '&usr=' . $config_username . '&hash=' . $password_hash, time() + $cookie_time, \"/\");\n \n }\n }\n $mailflag = $contentone[0]['mailSendFlag'];\n }\n if (($mailflag == 1 && $remainingdays >= 0) || $mailflag == 11) {\n\n if ($tempNam) {\n $res['redirection'] = \"editor\";\n } else {\n $res['redirection'] = \"dashboard\";\n }\n }\n\n echo json_encode($res);\n exit;\n }",
"public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}",
"protected function loginAuthenticate(){\n\n\t\t\n\t}",
"private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }",
"public function postConnectAction(ParamFetcher $paramFetcher)\n {\n \n \n $repositoryUser = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository('SubwayBuddyUserBundle:User')\n ; \n \n $em = $this->getDoctrine()->getManager();\n\n \n if($paramFetcher->get('username') && $paramFetcher->get('password'))\n {\n \n $view = Vieww::create();\n $username=$paramFetcher->get('username') ;\n $password=$paramFetcher->get('password');\n \n \n $securityContext = $this->container->get('security.context');\n if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n //return $securityContext->getToken()->getUser();\n }\n\n /* Validate the User */\n $user_manager = $this->container->get('fos_user.user_manager');\n $factory = $this->container->get('security.encoder_factory');\n $user = $user_manager->loadUserByUsername($username);\n $encoder = $factory->getEncoder($user);\n \n $validated = $encoder->isPasswordValid($user->getPassword(),$password,$user->getSalt());\n if (!$validated) {\n \n $view->setData($validated)->setStatusCode(400);\n return $view;\n } else {\n $token = new UsernamePasswordToken($user, null, \"main\", $user->getRoles());\n $this->container->get(\"security.context\")->setToken($token); //now the user is logged in\n\n //now dispatch the login event\n $request = $this->container->get(\"request\");\n $event = new InteractiveLoginEvent($request, $token);\n $this->container->get(\"event_dispatcher\")->dispatch(\"security.interactive_login\", $event);\n\n $view->setData($user)->setStatusCode(200);\n return $view;\n }\n }\n \n \n \n }"
]
| [
"0.60382706",
"0.58859426",
"0.5849044",
"0.5722104",
"0.5656531",
"0.55811554",
"0.5563599",
"0.5547989",
"0.55447865",
"0.55028754",
"0.5494649",
"0.5463573",
"0.5442394",
"0.5441576",
"0.54407644",
"0.54407644",
"0.5438249",
"0.5414403",
"0.54000425",
"0.53950495",
"0.53782666",
"0.5371626",
"0.5367127",
"0.53631425",
"0.5360392",
"0.5352766",
"0.5348517",
"0.5344636",
"0.5336671",
"0.5336085"
]
| 0.7088718 | 0 |
function autosave() Destructor. Send data to Mongo if autosave is enabled. | public function __destruct(){
if( $this->_autosave ){
$this->save( array('secure' => false) );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAutosave($autosave)\n {\n $this->autosave = $autosave;\n }",
"public function setAutosave($autosave)\n\t{\n\t\t$this->autosave = (bool) $autosave;\n\t}",
"function heartbeat_autosave($response, $data)\n {\n }",
"public function autosaved()\n {\n }",
"function _wp_rest_api_autosave_meta($autosave)\n {\n }",
"public function __construct(bool $autosave = false)\n {\n if ($autosave) {\n $this->saveAtShutdown();\n }\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}",
"function __destruct() {\r\n $this -> save();\r\n }",
"public function getAutosave()\n\t{\n\t\treturn $this->autosave;\n\t}",
"public function autosave($enable = true){\n $this->_autosave = $enable;\n }",
"public final function save() {\n }",
"public function saveAtShutdown()\n {\n $func = [\n $this,\n \"save\",\n ];\n register_shutdown_function($func, true);\n }",
"protected function autosave_check() {\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"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();"
]
| [
"0.6935602",
"0.6893411",
"0.6360726",
"0.6325889",
"0.60957724",
"0.6062565",
"0.6046666",
"0.5953444",
"0.5953125",
"0.5951271",
"0.5902857",
"0.58590674",
"0.5856436",
"0.585617",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672",
"0.5819672"
]
| 0.74631786 | 0 |
Validates that the incoming request is a valid/authorized request. | private function validateRequest()
{
//verify there is a valid access token and it matches our config. Bail if not present
$incoming_access_token = $this->request->token();
if ($incoming_access_token !== $this->config->access_token && ! empty($this->config->access_token)) {
$msg = 'Access denied due to invalid token.';
syslog(LOG_DEBUG, $msg);
header('HTTP/1.1 403 Access Denied.');
exit();
}
//verify we have a valid request
if (! $this->request->isValid()) {
$msg = 'Invalid package received.';
syslog(LOG_DEBUG, $msg);
header('HTTP/1.1 400 Bad Request');
exit($msg);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function validateRequest() {\n $request = new Oauth_Model_Request($this->getRequest());\n\n if (!$this->_request_validator->isValid($request)) {\n $response = Array();\n\n $messages = $this->_request_validator->getMessages();\n $last_msg = explode(\":\", array_pop($messages));\n $response['error'] = $last_msg[0];\n $response['error_description'] = isset($last_msg[1]) ? $last_msg[1] : \"\";\n\n $this->getResponse()->setHttpResponseCode(401);\n $this->getResponse()->setBody(json_encode($response));\n $this->getResponse()->setHeader('Content-Type', 'application/json;charset=UTF-8');\n\n return FALSE;\n }\n\n return TRUE;\n }",
"public function validateRequest();",
"protected function validateRequest() {\n \t \t\n $request = new Oauth_Model_Request($this->getRequest());\n\n if (!$this->_request_validator->isValid($request)) {\n $response = Array();\n\n $messages = $this->_request_validator->getMessages();\n $last_msg = explode(\":\", array_pop($messages));\n $response['error'] = $last_msg[0];\n $response['error_description'] = isset($last_msg[1]) ? $last_msg[1] : \"\";\n\n $this->getResponse()->setHttpResponseCode(401);\n $this->getResponse()->setBody(json_encode($response));\n $this->getResponse()->setHeader('Content-Type', 'application/json;charset=UTF-8');\n\n return FALSE;\n }\n\n return TRUE;\n }",
"public function isValidRequest() {\n }",
"public function validateAuthorizationRequest(ServerRequestInterface $request);",
"protected function isValid()\n {\n return !app('request') instanceof Request;\n }",
"public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"private function validateRequest()\n {\n $ret_api_secret = null;\n\n if (!isset($_POST['invoiceId'])) {\n dump($_POST['invoiceId']);\n return false;\n }\n\n if (isset($_POST['apiSecret'])) {\n $ret_api_secret = $_POST['apiSecret'];\n } else {\n return false;\n }\n\n if ($this->api_secret != $ret_api_secret) {\n return false;\n }\n\n if (isset($_SERVER['HTTP_REFERER'])) {\n $urlParts = parse_url($_SERVER['HTTP_REFERER']);\n $ip = gethostbyname($urlParts['host']);\n\n if ($this->pursar_ip != $ip) {\n return false;\n }\n }\n\n return true;\n }",
"public function validRequest(Request $request): bool;",
"public function isRequestAllowed(Request $request);",
"private function requestIsValid() : bool\n {\n $queryParams = $this->request->getQueryParams();\n\n return array_has($queryParams,self::OPENID_ASSOC_HANDLE)\n && array_has($queryParams,self::OPENID_SIGNED)\n && array_has($queryParams,self::OPENID_SIG);\n }",
"private function validateRequest()\n {\n $rules = [\n 'email' => 'required|email',\n 'password' => 'required|between:3,20'\n ];\n $this->request->validate($rules);\n }",
"protected function _is_valid_request($request) {\n if ( empty($request) ) {\n return true;\n }\n return Auth::is_token_valid($request, $this->classname());\n }",
"protected function validateRequest()\n {\n if ( ! isset($_POST['purchase_code']) || ! is_string($_POST['purchase_code'])) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Bad request', 'quform')\n ));\n }\n\n if ($_POST['purchase_code'] === '') {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Please enter a license key', 'quform')\n ));\n }\n\n if ( ! current_user_can('quform_settings')) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Insufficient permissions', 'quform')\n ));\n }\n\n if ( ! check_ajax_referer('quform_verify_purchase_code', false, false)) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Nonce check failed', 'quform')\n ));\n }\n }",
"public function is_valid( $request_value ): bool {\n\n $http_method = isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : null;\n\n if( $http_method == null || ! in_array( $http_method, $this->allowed_request_methods ) ) {\n return false;\n }\n\n $nonce = filter_var( $request_value );\n\n return (bool) wp_verify_nonce( $nonce, $this->action );\n\n }",
"private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }",
"private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }",
"public function authorize()\n\t{\n\t\t// Compile the rules\n\t\t$this->compile();\n\t\t\t\n\t\t// Check if this user has access to this request\n\t\tif ($this->user_authorized())\n\t\t\treturn TRUE;\n\n\t\t// Set the HTTP status to 403 - Access Denied\n\t\t$this->request->status = 403;\n\n\t\t// Execute the callback (if any) from the compiled rule\n\t\t$this->perform_callback();\n\n\t\t// Throw a 403 Exception if no callback has altered program flow\n\t\tthrow new Kohana_Request_Exception('You are not authorized to access this resource.', NULL, 403);\n\t}",
"public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }",
"public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }",
"public function validate()\n {\n $this->httpRequest->request;\n foreach (func_get_args() as $key) {\n $value = $this->parameters->get($key);\n if (! isset($value)) {\n throw new InvalidRequestException(\"The $key parameter is required\");\n }\n }\n }",
"public function validateReuest()\r\n {\r\n //echo $_SERVER['CONTENT_TYPE']; exit;\r\n\r\n if($_SERVER['CONTENT_TYPE'] !== 'application/json')\r\n {\r\n $this->throwError(REQUEST_CONTENTTYPE_NOT_VALID, 'Request Content-Type is not Valid');\r\n }\r\n\r\n // decode it into array format.\r\n $data = json_decode($this->request, true);\r\n // to check the data in array.\r\n //print_r($data);\r\n\r\n\r\n // check if api name is reuired or not\r\n if(!isset($data['name']) || $data['name'] == \"\")\r\n {\r\n $this->throwError(API_NAME_REQUIRED, \"API Name is Required.\");\r\n }\r\n $this->serviceName = $data['name'];\r\n\r\n\r\n // check if parameters name is reuired or not\r\n if(!is_array($data['param']))\r\n {\r\n $this->throwError(API_PARAM_REQUIRED, \"API PARAM is Required.\");\r\n }\r\n $this->param = $data['param'];\r\n }",
"public function bmo_validate_request(){\n\t\t $this->is_google = $this->is_request_google();\n\t\t if( ! $this->is_google ) return; // Move along if this isn't even a google request\n\n\t\t //If this is a google request, validate the $_GET[ 'code' ] param\n\t\t $this->valid = $this->google_client->validate_code( $_GET[ 'code' ] );\n\n\t\t //Let's strip the $_GET[ 'code' ] param so nothing else can use it\n\t\t $strip = $this->strip_code_param();\n\n\t\t //Get the Google User\n\t\t $this->google_user = $this->google_client->get_google_user();\n\n\t\t //Check if the Google User Email is allowed agains our list of Approved Domains\n\t\t $approved = $this->approve_google_user();\n\n\t\t return;\n\t}",
"protected function validateRequest()\n {\n $validators = [\n 'hasClientId' => null,\n 'knownClientId' => null,\n 'timestamp' => 'signed',\n 'hasSignature' => 'signed',\n 'notExpiredTimestamp' => 'signed',\n 'signature' => 'signed',\n ];\n\n foreach ($validators as $validator => $condition) {\n // First make sure the conditions are fulfilled for the validator\n if ($condition) {\n $method = camel_case('validCondition_'.$condition);\n\n if (! $this->{$method}()) {\n continue;\n }\n }\n\n $method = camel_case('valid_'.$validator);\n $this->{$method}();\n }\n }",
"protected function validateRequest()\n {\n return request()->validate([\n 'uuid' => 'sometimes|nullable',\n 'route_hash' => 'required|string',\n 'title' => 'required|string',\n 'description' => 'nullable',\n 'content' => 'required|array',\n ]);\n }",
"public static function validate()\n {\n $request = Request::getInstance();\n $csrf = Session::get('csrf');\n\n if(!$csrf) self::rejectRequest();\n\n $isValid = hash_equals($request->csrf, $csrf);\n\n self::generateToken();\n\n if(!$isValid) {\n\n self::rejectRequest();\n\n }\n }",
"public function authorize()\n {\n return true; // permet de verifier si nous pouvons avoir acces à la Request\n }",
"private function isValidRequest(Request $request) :bool\n {\n return $request->getContentType() === 'json';\n }",
"private function isValidRequest( $request )\n\t{\n\n\t\treturn\n\n\t\t\t$request->input( 'ref' ) == 'refs/heads/' . $this->app['config']->get( 'deployer.repository.branch' ) and\n\t\t\t$request->input( 'project_id' ) == $this->app['config']->get( 'deployer.repository.project_id' ) and\n\t\t\t$request->input( 'repository.url' ) == $this->app['config']->get( 'deployer.repository.repository' );\n\n\t}",
"public function validateRequest(){\n global $default;\n\n // Validate controller\n if (!($this->controller)) {\n // No controller set, Use defaults\n $this->controller = $default['controller'];\n $this->action = $default['action'];\n $this->parameter1 = $default['parameter1']; \n $this->parameter2 = $default['parameter2'];\n $this->parameter3 = $default['parameter3'];\n } \n\n // Check controller exists\n \n // Validate action\n if (!isset($this->action)) {\n // No action set, try index\n $this->action = 'index';\n } \n\n // Create controller to dispatch our request, eg new ItemsController\n $model = ucwords(rtrim($this->controller, 's'));\n $controller = ucwords($this->controller) . 'Controller';\n $dispatch = new $controller($model, $this->controller, $this->action);\n\n // Check $action method exists\n if (!method_exists($dispatch, $this->action)) {\n // Show error page\n } \n }"
]
| [
"0.7541807",
"0.75149894",
"0.74442476",
"0.7389434",
"0.7347846",
"0.72556835",
"0.7174355",
"0.71658814",
"0.7089179",
"0.6973612",
"0.68638843",
"0.68058693",
"0.6779807",
"0.6765485",
"0.6712854",
"0.6701762",
"0.6701762",
"0.6680339",
"0.6668852",
"0.6620888",
"0.66121185",
"0.6601887",
"0.65960467",
"0.6587038",
"0.6573242",
"0.654006",
"0.65380275",
"0.6495364",
"0.6466211",
"0.6465465"
]
| 0.79388493 | 0 |
Triggers any grunt tasks for the incoming request. | private function triggerGruntTask()
{
$has_run = false;
foreach ($this->config->map as $slug => $clone_url) {
if ($clone_url === $this->request->cloneUrl()) {
$this->triggerGrunt($slug);
$has_run = true;
}
}
//message about no support
if ($has_run) {
$msg = 'The grunt tasks associated with ' . $this->request->url() . ' completed successfully.';
syslog(LOG_DEBUG, $msg);
header('HTTP/1.1 200 OK');
exit($msg);
}
$msg = 'There are no grunt tasks associated with ' . $this->request->url() . '.';
syslog(LOG_DEBUG, $msg);
header('HTTP/1.1 200 OK');
exit($msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function execute()\n\t{\n\t\t// Make sure we're using a secure connection\n\t\tif (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')\n\t\t{\n\t\t\tApp::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '', 'message', true);\n\t\t\tdie('insecure connection and redirection failed');\n\t\t}\n\n\t\t$this->baseURL = rtrim(Request::base(), '/');\n\n\t\t$this->registerTask('__default', 'create');\n\n\t\tparent::execute();\n\t}",
"private function triggerGrunt($slug)\n {\n if ($this->request->mostRecentCommitAuthorEmail() === $this->config->server_git_email) {\n $msg = 'Most recent commit made by grunt so will not run recursively!';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 202 Accepted');\n exit($msg);\n }\n\n if ($this->canProcess($slug)) {\n $this->setProcessingLock($slug);\n $this->doGrunt($slug, $this->request->branch());\n $this->removeProcessingLock($slug);\n } else {\n $msg = \"There is already a task for the $slug being processed.\";\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 409 CodebaseRequest Conflict');\n exit($msg);\n }\n }",
"protected function executeTasks() {}",
"public function execute()\n {\n $this->_authorize();\n $this->_authorize('entry');\n $this->_authorize('comment');\n\n $this->registerTask('new', 'edit');\n $this->registerTask('login', 'login');\n\n $this->registerTask('groups', 'groups');\n $this->registerTask('locations', 'locations');\n $this->registerTask('projects', 'projects');\n $this->registerTask('users', 'users');\n\n parent::execute();\n }",
"public function run(): void\n {\n Router::routes('api/admin')->each(fn(Route $route) => AdminRoute::syncFrom($route));\n }",
"public function process(Request $request){\n \\Wle\\Wallee\\Core\\Service\\ManualTask::instance()->update();\n }",
"public static function run()\n {\n // Suppose we have the filtered `$serverCollection` variable\n\n // Validating the servers the tasks should run on.\n // (Auth object, configurations etc)\n foreach ($serverCollection as $Server) {\n $Server->validate();\n }\n\n // running tasks on servers\n }",
"public function runInstallTasks();",
"public function run()\n {\n $this->executeStaticRoutes();\n $this->executeGroupRoutes();\n }",
"public static function handle_tasks()\n {\n\t $granularity = (int)get_site_preference('pseudocron_granularity',60);\n\t $last_check = get_site_preference('pseudocron_lastrun',0);\n\t if( (time() - $granularity * 60) >= $last_check )\n\t\t {\n\t\t\t // 1. Get Task objects.\n\t\t\t self::get_tasks();\n\t\n\t\t\t // 2. Evaluate Tasks\n\t\t\t self::execute();\n\t\n\t\t\t // 3. Cleanup to minimize memory usage\n\t\t\t self::cleanup();\n\n\t\t\t // 4. Say we've done a check\n\t\t\t set_site_preference('pseudocron_lastrun',time());\n\t\t }\n }",
"public function run() {\n \n // Require the base class\n $this->load->file(APPPATH . '/base/main.php');\n\n // List all user's apps\n foreach (glob(APPPATH . 'base/user/apps/collection/*', GLOB_ONLYDIR) as $directory) {\n\n // Get the directory's name\n $app = trim(basename($directory) . PHP_EOL);\n\n // Verify if the app is enabled\n if (!get_option('app_' . $app . '_enable')) {\n continue;\n }\n\n // Create an array\n $array = array(\n 'MidrubBase',\n 'User',\n 'Apps',\n 'Collection',\n ucfirst($app),\n 'Main'\n );\n\n // Implode the array above\n $cl = implode('\\\\', $array);\n\n // Run cron job commands\n (new $cl())->cron_jobs();\n }\n \n // Prepare allowed files\n $allowed_files = array(\n 'cron.php',\n 'index.php',\n 'ipn-listener.php',\n 'update.php'\n );\n \n // List all files\n foreach (glob(FCPATH . '/*.php') as $filename) {\n \n $name = str_replace(FCPATH . '/', '', $filename);\n\n if ( !in_array($name, $allowed_files) ) {\n \n $msg = 'Was detected and deleted the file ' . $filename . '. Please contact support if you don\\'t know this file.';\n \n $this->send_warning_message($msg);\n unlink($filename);\n \n } else {\n \n if ( $this->check_for_malware($filename) ) {\n \n $msg = 'Was detected malware in the file ' . $filename . ' and was deleted.';\n\n $this->send_warning_message($msg);\n unlink($filename);\n \n }\n \n }\n \n }\n \n $extensions = array(\n '.php3',\n '.php4',\n '.php5',\n '.php7',\n '.phtml',\n '.pht'\n );\n\n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH, $ext); \n }\n \n $extensions[] = '.php';\n \n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH . 'assets', $ext); \n }\n \n $this->check_for_non_midrub_files(FCPATH . 'assets');\n \n }",
"function auto_run()\n {\n \t//-----------------------------------------\n \t// INIT\n \t//-----------------------------------------\n \t\n \tif ( isset($this->ipsclass->input['j_do']) AND $this->ipsclass->input['j_do'] )\n \t{\n \t\t$this->ipsclass->input['do'] = $this->ipsclass->input['j_do'];\n \t}\n \t\n \t//-----------------------------------------\n \t// What shall we do?\n \t//-----------------------------------------\n \t\n \tswitch( $this->ipsclass->input['do'] )\n \t{\n \t\tcase 'get-template-names':\n \t\t\t$this->get_template_names();\n \t\t\tbreak;\n \t\tcase 'get-member-names':\n \t\t\t$this->get_member_names();\n \t\t\tbreak;\n \t\tcase 'get-dir-size':\n \t\t\t$this->get_dir_size();\n \t\t\tbreak;\n\t\t\tcase 'post-editorswitch':\n\t\t\t\t$this->post_editorswitch();\n\t\t\t\tbreak;\n\t\t\tcase 'captcha_test':\n\t\t\t\t$this->captcha_test();\n\t\t\t\tbreak;\n \t}\n }",
"function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}",
"public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }",
"public function distribute()\n {\n try {\n Container::get('request')->parse();\n } catch (\\Exception $e) {\n $this->error($e->getMessage(), Response::STATUS_BAD_REQUEST);\n }\n\n if (\n !Container::get('request')->isMethod('get') &&\n !Container::get('request')->isMethod('post') &&\n !Container::get('request')->isMethod('head')\n ) {\n $this->error(\n sprintf('Request method \"%s\" is not allowed!', Container::get('request')->getMethod()),\n Response::STATUS_METHOD_NOT_ALLOWED\n );\n }\n\n // analyze request headers\n foreach (Container::get('request')->getHeaders() as $name=>$value) {\n switch($name) {\n case 'Time-Zone':\n if (in_array($value, timezone_identifiers_list())) {\n date_default_timezone_set($value);\n } else {\n $this->warning(\n sprintf('The \"%s\" timezone defined is not valid!', $value)\n );\n }\n break;\n default: break;\n }\n }\n\n // user files\n $type = Container::get('request')->getData('source_type', 'data_input');\n $this->setSourceType($type);\n if ($this->getSourceType() == 'file') {\n $files = Container::get('request')->getFiles();\n if (!empty($files)) {\n foreach ($files as $name=>$path) {\n $this->addSource(\n file_get_contents($path), $name\n );\n }\n }\n }\n\n // any test to launch\n $test = Container::get('request')->getData('test');\n if (!empty($test)) {\n $method = 'testAction_'.$test;\n if (method_exists($this, $method)) {\n call_user_func(array($this, $method));\n } else {\n $this->warning(\n sprintf('Test method \"%s\" not found!', $test)\n );\n }\n }\n\n // end here if no 'source' or 'sources' post data\n $source = Container::get('request')->getData('source');\n $sources = Container::get('request')->getData('sources');\n $_sources = $this->getSources();\n if (empty($source) && empty($sources) && empty($_sources)) {\n $this\n ->warning('No source to parse!')\n ->serve();\n } else {\n if (!empty($sources)) {\n $this->setSources(array_merge(\n $_sources, $sources\n ));\n }\n if (!empty($source)) {\n $this->addSource($source);\n }\n }\n\n // debug mode on?\n $this->setDebug(Container::get('request')->getData('debug', false));\n\n // load the MDE parser\n if (!class_exists('\\MarkdownExtended\\MarkdownExtended')) {\n $this->error('Class \"\\MarkdownExtended\\MarkdownExtended\" not found!');\n }\n Container::set('mde_parser', new \\MarkdownExtended\\MarkdownExtended());\n\n return $this;\n }",
"public function run()\n {\n Apiato::call('Authorization@CreatePermissionTask', ['view-tenant', 'View Tenant Permissions.']);\n Apiato::call('Authorization@CreatePermissionTask', ['edit-tenant', 'Edit Tenant Permission.']);\n Apiato::call('Authorization@CreatePermissionTask', ['delete-tenant', 'Delete Tenant Permissions.']);\n Apiato::call('Authorization@CreatePermissionTask', ['create-tenant', 'Create Tenant Permission.']);\n }",
"function my_task_function() {\r\n\twrite_log('CRON: Called and Actioned');\r\n\tset_up_feeds();\r\n\tprune_posts();\r\n\r\n\t// wp_mail( '[email protected]', 'Automatic email', 'Automatic scheduled 5 mine from WordPress.');\r\n}",
"public function run() {\r\n $this->routeRequest(new Request());\r\n }",
"public function actionRunAll()\n {\n $tasks = $this->getScheduler()->getTasks();\n\n echo 'Running Tasks:'.PHP_EOL;\n $event = new SchedulerEvent([\n 'tasks' => $tasks,\n 'success' => true,\n ]);\n $this->trigger(SchedulerEvent::EVENT_BEFORE_RUN, $event);\n foreach ($tasks as $task) {\n $this->runTask($task);\n if ($task->exception) {\n $event->success = false;\n $event->exceptions[] = $task->exception;\n }\n }\n $this->trigger(SchedulerEvent::EVENT_AFTER_RUN, $event);\n echo PHP_EOL;\n }",
"public function startup()\n {\n parent::startup();\n Configure::write( 'debug', 2 );\n Configure::write( 'Cache.disable', 1 );\n\n $task = Inflector::classify( $this->command );\n }",
"public function cronAction()\n {\n $force = Mage::app()->getRequest()->getParam('force', false);\n $generator = Mage::getModel('smartassistant/generator');\n $generator->scheduleRun($force);\n }",
"public function run() {\n\t\t$this->checkForHelp();\n\n\t\ttry {\n\t\t\t$this->getAndRunTasks();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->printException($e);\n\t\t}\n\t}",
"public function process() {\n $this->migrate_course_files();\n // todo $this->migrate_site_files();\n }",
"public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }",
"public function apply(Request $request, array $configurations): void;",
"public function run()\n {\n $routeFile = app('path.bootstrap') . '/api.php';\n if (file_exists($routeFile)) {\n $router = $this;\n $routes = require $routeFile;\n add_action('rest_api_init', [$this, 'register']);\n }\n\n if (class_exists('acf')) {\n $this->createAcfRoutes();\n }\n }",
"public function applyTask()\n\t{\n\t\t$this->saveTask();\n\t}",
"private function dispatchTaskRunner(): void\n {\n $options = Option::getOptions();\n $run = [];\n $task_loader = $this->invokeRegisterFields();\n if (!$task_loader instanceof TaskLoader) {\n \\WP_CLI::error('Error, undefined TaskLoader.');\n }\n\n $fields = $task_loader->getFields();\n if (empty($fields)) {\n \\WP_CLI::error('Error, no tasks registered, fields are empty.');\n }\n\n $count = \\count($fields);\n $progress = \\WP_CLI\\Utils\\make_progress_bar(\\esc_html__('Running Tasks', 'wp-upgrade-task-runner'), $count);\n\n foreach ($task_loader->getFields() as $field) {\n if (empty($options[Option::getOptionKey($field)])) {\n $field->getTaskRunner()->dispatch($field);\n $run[] = \\get_class($field);\n }\n $progress->tick();\n }\n\n $progress->finish();\n\n if (!empty($run)) {\n \\WP_CLI::success(\\sprintf(\n \\esc_html__('Completed %s tasks.', 'wp-upgrade-task-runner'),\n \\count($run)\n ));\n\n return;\n }\n\n \\WP_CLI::line('No tasks run.');\n }",
"public function run()\n {\n $names = [\n 'PHP_task',\n 'Node_task',\n 'BootStrap_task',\n 'Angular_task',\n 'IOS_task'\n\n ];\n\n $description= [\n 'Develop PHP Back-End',\n 'Develop Node Back-End',\n 'Develop BootStrap Front-End',\n 'Develop Angular Front-End',\n 'Develop IOS Front-End'\n\n ];\n\n\n $limit = 5;\n for ($i = 0; $i < $limit; $i++) {\n\n Tasks::create([\n 'name' => $names[$i],\n 'task_description' => $description[$i],\n\n ]);\n\n }\n }",
"public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }"
]
| [
"0.6221774",
"0.6091784",
"0.59093165",
"0.56856716",
"0.5499107",
"0.5427254",
"0.5405551",
"0.53995764",
"0.53808504",
"0.5248557",
"0.524689",
"0.524308",
"0.52226293",
"0.52190876",
"0.5202867",
"0.51992095",
"0.51544607",
"0.51384413",
"0.51175517",
"0.51013553",
"0.508447",
"0.5069972",
"0.50676405",
"0.5056832",
"0.50466025",
"0.5035721",
"0.501931",
"0.50133365",
"0.49968615",
"0.49966598"
]
| 0.74714935 | 0 |
Returns an anchor with the given link, class and value | function crb_create_anchor($value, $link, $classes = '', $target = '_self') {
if ( empty($link) || empty($link) ) {
return;
}
if ( $classes ) {
if ( is_array($classes) ) {
$classes = implode(' ', $classes);
}
$classes = 'class="' . $classes . '"';
}
ob_start();
?>
<a href="<?php echo $link; ?>" target="<?php echo $target; ?>" <?php echo $classes; ?>><?php
echo $value;
?></a>
<?php
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function a($link, $text, $id = Null, $class = Null)\n {\n return '<a'.self::_id($id).self::_class($class).' href=\"'. $link.'\" title=\"'.$text.'\" >'.$text.'</a>';\n }",
"function HTMLLink ($params) {\n $val = $params['value'];\n unset($params['value']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<a {$str} >{$val}</a>\";\n }",
"function linktag($destination, $content, $class='', $style='', $id='', $extra='', $title_alt='')\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$extra .= ' href=\"' . $destination . '\"';\n\t\t$extra .= ($title_alt == '' ? '' : ' alt=\"' . $title_alt . '\" title=\"' . $title_alt . '\"');\n\t\treturn $this->tag('a', $content, $class, $style, $id, $extra);\n\t}",
"public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }",
"function caDetailLink($po_request, $ps_content, $ps_classname, $ps_table, $pn_id, $pa_additional_parameters=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caDetailUrl($po_request, $ps_table, $pn_id, false, $pa_additional_parameters, $pa_options))) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='\".$vs_url.\"'\";\n\t\t\n\t\tif ($ps_classname) { $vs_tag .= \" class='$ps_classname'\"; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\tforeach($pa_attributes as $vs_attribute => $vs_value) {\n\t\t\t\t$vs_tag .= \" $vs_attribute='\".htmlspecialchars($vs_value, ENT_QUOTES, 'UTF-8').\"'\";\n\t\t\t}\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 renderTagAnchor($result);",
"protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }",
"function caEditorLink($po_request, $ps_content, $ps_classname, $ps_table, $pn_id, $pa_additional_parameters=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caEditorUrl($po_request, $ps_table, $pn_id, false, $pa_additional_parameters, $pa_options))) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='\".$vs_url.\"'\";\n\t\t\n\t\tif ($ps_classname) { $vs_tag .= \" class='$ps_classname'\"; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\tforeach($pa_attributes as $vs_attribute => $vs_value) {\n\t\t\t\t$vs_tag .= \" $vs_attribute='\".htmlspecialchars($vs_value, ENT_QUOTES, 'UTF-8').\"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vs_tag .= '>'.$ps_content.'</a>';\n\t\t\n\t\treturn $vs_tag;\n\t}",
"function iconlink($id = '', $class = '', $title = '', $href = '')\n{\n return '<a id=\"' . $id . '\" href=\"' . URI . '/' . $href . '\" class=\"btn mini green-stripe ' . $class . '\" data-href=\"\">Güncelle</a>';\n}",
"function base_display_acf_link( $link, $classes = [], $content_after = '' ) {\n\tif ( empty( $link ) || ! is_array( $link ) ) {\n\t\treturn;\n\t}\n\n\t$classes_default = [];\n\t$classes_merged = wp_parse_args( $classes, $classes_default );\n\t$classes = implode( ' ', $classes_merged );\n\n\tif ( $link ) :\n\t\t?>\n\t\t\t<a\n\t\t\t\thref=\"<?php echo esc_url( $link['url'] ); ?>\"\n\t\t\t\t<?php echo $link['target'] ? 'target=\"_blank\" rel=\"noopener\"' : ''; ?>\n\t\t\t\tclass=\"<?php echo esc_attr( $classes ); ?>\"\n\t\t\t>\n\t\t\t\t<?php echo esc_html( $link['title'] ); ?>\n\t\t\t\t<span><?php echo $content_after; //XSS OK ?></span>\n\t\t\t</a>\n\t\t<?php\n\tendif;\n}",
"function makeLink($href,$content) {\n$link = \"<div class=\\\"entete4middle\\\">\n <table>\n <tr>\n <td><a href=\\\"$href\\\" class=\\\"link\\\" title=\\\"Cliquez poour accéder à la galerie\\\">$content</a></td>\n </tr>\n </table>\n </div>\";\n\necho $link;\n}",
"function makeLinks($linkArray)\r\n {\r\n $myReturn = '';\r\n\r\n foreach($linkArray as $url => $text)\r\n {\r\n if($url == THIS_PAGE)\r\n {//selected page - add class reference\r\n $myReturn .= '<a class=\"selected\" href=\"' . $url . '\">' . $text . '</a>' . PHP_EOL;\r\n }else{\r\n $myReturn .= '<a href=\"' . $url . '\">' . $text . '</a>' . PHP_EOL;\r\n } \r\n }\r\n \r\n return $myReturn;\r\n }",
"function afo_browsenav2_link_to_class($type, $val) {\n\t$type = str_replace(' ', '_', $type);\n\t$val = str_replace(' ', '_', $val);\n\n\treturn \"{$type}Z{$val}\";\n}",
"function getTagLink($data, $class) {\n\t\tif ($this->conf['linkType'] == \"ids\") {\n\t\t\t$urlParams = array(\n\t\t\t\t'tx_timtabtagcloud[ids]' => $data['ids'],\n\t\t\t\t'tx_timtabtagcloud[tagname]' => $data['tag']\n\t\t\t);\n\t\t} else if ($this->conf['linkType'] == \"tag\") {\n\t\t\t$urlParams = array(\n\t\t\t\t'tx_timtabtagcloud[tag]' => $data['tag']\n\t\t\t);\n\t\t}\n\n\t\t$tagAttribs = ' title=\"'.$data['tag'].' ('.$data['count'].')\"';\n\t\t$tagAttribs .= ' class=\"tx-timtabtagcloud-link\"';\n\n\t\t$conf = array(\n\t\t\t'parameter' => $this->conf['listPid'],\n\t\t\t'no_cache' => 1,\n\t\t\t'additionalParams' => $this->conf['parent.']['addParams'].t3lib_div::implodeArrayForUrl('',$urlParams,'',1).$this->pi_moreParams,\n\t\t\t'ATagParams' => $tagAttribs\n\t\t);\n\n\t\treturn $this->cObj->typoLink('<span class=\"tx-timtabtagcloud-tag'.$class.'\">'.$data['tag'].'</span>', $conf);\n\t}",
"function olink($destination='', $class='', $style='', $id='', $extra='')\n\t{\n\t\t$extra = ($extra == '' ? 'href=\"' . $destination . '\"' : $extra . ' href=\"' . $destination . '\"');\n\t\treturn $this->otag('a', $class, $style, $id, $extra);\n\t}",
"public static function anchor($url,$text,$attributes = null) {\r\n\t\treturn \"<a href='\".Configuration::getURLPath().\"/\".$url.\"' \".$attributes.\">\".$text.\"</a>\";\r\n\t}",
"public function createClickableUrl($value) {\n if (($value = trim((string) $value)) && UrlHelper::isValid($value, TRUE)) {\n try {\n if ($url = Url::fromUri($value, ['attributes' => ['target' => '_blank']])) {\n return Link::fromTextAndUrl($value, $url);\n }\n }\n catch (\\Exception $e) {\n // We don't log errors here as we don't really care if it goes wrong.\n }\n }\n return $value;\n }",
"public function getLink(): string\n {\n return 'Class-' . $this->getSlug() . '.html';\n }",
"public static function a(stdClass $data)\n\t\t{\n\t\t\t\n\n\t\t\tif($data->class) {\n\t\t\t\t$class = 'class=\"'.$data->class.'\"';\n\t\t\t}\n\n\t\t\tif($data->href) {\n\t\t\t\t$href = $data->href;\n\t\t\t}else{\n\t\t\t\t$href = \"#\";\n\t\t\t}\n\n\t\t\tif($data->text) {\n\t\t\t\t$text = $data->text;\n\t\t\t}\n\n\t\t\treturn '<a '.$class.' href=\"'.$href.'\">'.$text.'</a>';\n\t\t}",
"static function a($href=false, $content='', $arguments=false) {\n\t\t$arguments = self::arguments($arguments);\n\t\tif (empty($href)) {\n\t\t\t$arguments['class'] = (empty($arguments['class'])) ? 'empty' : $arguments['class'] . ' empty';\n\t\t} else {\n\t\t\t$arguments['href'] = $href;\n\t\t}\n\t\tif ($email = str::starts($href, 'mailto:')) {\n\t\t\t$encoded = str::encode($email);\n\t\t\t$href = 'mailto:' . $encoded;\n\t\t\t$content = str_replace($email, $encoded, $content);\n\t\t}\n\t\treturn self::tag('a', $arguments, $content);\n\t}",
"function makeLinks($linkArray)\n{\n $myReturn = '';\n\n foreach($linkArray as $url => $text)\n {\n if($url == THIS_PAGE)\n {//selected page - add class reference\n $myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n }else{\n $myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n } \n }\n \n return $myReturn; \n}",
"function alink($title=null,$url=null,$attributes=[], $secure=null,$escape=false) \n\t{\n\t\treturn app('html')->alink($title,$url,$attributes,$secure,$escape);\n\t}",
"public function attr() {\n\n\t\t\t\t$attr = [\n\t\t\t\t\t'class' => 'fusion-one-page-text-link',\n\t\t\t\t];\n\n\t\t\t\tif ( $this->args['class'] ) {\n\t\t\t\t\t$attr['class'] .= ' ' . $this->args['class'];\n\t\t\t\t}\n\n\t\t\t\tif ( $this->args['id'] ) {\n\t\t\t\t\t$attr['id'] = $this->args['id'];\n\t\t\t\t}\n\n\t\t\t\t$attr['href'] = $this->args['link'];\n\n\t\t\t\treturn $attr;\n\n\t\t\t}",
"function makeLinks($linkArray)\r\n{\r\n $myReturn = '';\r\n\r\n foreach($linkArray as $url => $text)\r\n {\r\n if($url == THIS_PAGE)\r\n {//selected page - add class reference\r\n\t \t$myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\r\n \t}else{\r\n\t \t$myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\r\n \t} \r\n }\r\n \r\n return $myReturn;\r\n}",
"function makeLinks($linkArray)\n{\n $myReturn = '';\n\n foreach($linkArray as $url => $text)\n {\n if($url == THIS_PAGE)\n {//selected page - add class reference\n\t \t$myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n \t}else{\n\t \t$myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n \t} \n }\n \n return $myReturn; \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}",
"function posts_link_attributes() {\n return 'class=\"page-link\"';\n}",
"public function renderTagAnchor($result) {\n\n\t\t$file = $this->file;\n\n\t\treturn sprintf('<a href=\"%s%s\" target=\"%s\">%s</a>',\n\t\t\t$this->getAnchorUri() ? $this->getAnchorUri() : $file->getPublicUrl(TRUE),\n\t\t\t$this->getAppendTimeStamp() ? '?' . $file->getProperty('tstamp') : '',\n\t\t\t$this->getTarget(),\n\t\t\t$result\n\t\t);\n\t}",
"function iconjslink($id = '', $class = '', $title = '', $href = '')\n{\n return '<a id=\"' . $id . '\" href=\"javascript:;\" class=\"btn mini red-stripe ' . $class . '\" data-href=\"' . URI . '/' . $href . '\">Sil</a>';\n}",
"static public function linkTo($name, $url = null, $title = null,\n\t\t\t\t$classes = null, $id = null )\n {\n $class = (!empty($classes)) ? 'class=\"'.$classes.'\"' : null;\n \n if ( !empty($title) )\n $title = 'title=\"'.$title.'\"';\n\n if ( !empty($id) )\n $id = 'id=\"'.$id.'\"';\n \n return \"<a $title $class $id href=\\\"\".self::validURL($url).\"\\\">$name</a>\";\n }"
]
| [
"0.6559348",
"0.6205403",
"0.5955067",
"0.5936664",
"0.58264565",
"0.57999104",
"0.5777246",
"0.57326233",
"0.56983376",
"0.5677638",
"0.5617736",
"0.56033367",
"0.5565279",
"0.5563245",
"0.55420333",
"0.55221355",
"0.5510888",
"0.5487099",
"0.54411805",
"0.54125786",
"0.5399893",
"0.5395531",
"0.5387205",
"0.5376185",
"0.536295",
"0.53558177",
"0.5353942",
"0.53364915",
"0.5335585",
"0.5333093"
]
| 0.75925964 | 0 |
Get mod index Return current index and increment | function get_next_mod_index() {
$index = $this->mod_index;
$this->mod_index++;
return $index;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getNextIndex();",
"public function mod($dividend, $modulus);",
"function mod($n, $m) {\n return (($n % $m) + $m) % $m;\n}",
"function modulo( $value, $modulus ){\n return ( $value % $modulus + $modulus ) % $modulus;\n}",
"public function restarIndice($index){\n return intval($index)-1;\n }",
"public function getEditIncrement();",
"public function getIncrementing();",
"function getIndex() ;",
"function mod(Num &$n) { # (Num, Num) -> Num\n $_ = $this->_return($n());\n return new $_(fmod($this->value, $n()));\n }",
"function modulo() {\n static $modulo = false;\n $modulo = $modulo ?: curry(function($x, $y){\n return $x % $y;\n });\n return _apply($modulo, func_get_args());\n}",
"public function getIncrement() {\r\n return $this->desiredIncrement;\r\n }",
"public function modulus(...$params)\n {\n return $this->mod(...$params);\n }",
"function getLinhaModulo($modulo, $limite) {\n $linha = ($modulo == 0) ? $limite : $modulo;\n return $linha;\n}",
"public function getModuloId() {\n return $this->modulo_id;\n }",
"public function incrementIndex()\n {\n $index = 0;\n $last = self::orderBy('index', true)->first();\n if ($last) {\n $index = $last->index;\n }\n $this->index = $index + 1;\n return $this;\n }",
"function modulo($val, $param) {\n\t\treturn $val - (floor($val / $param) * $param);\n\t}",
"function get_index($i, $j, $blocks = 3, $elems = 3) {\n\t$bits = [\n\t\t($j % $elems), // across within block (across elems)\n\t\t((int) floor($j / $elems) * $blocks * $elems), // down within block (down elems)\n\t\t(($i % $blocks) * $elems), // across blocks\n\t\t((int) floor($i / $blocks) * $blocks * $elems * $elems), // down blocks\n ];\n\n\treturn array_sum($bits);\n}",
"public function getIncrement(): int\n {\n return $this->increment;\n }",
"public function getIncrement()\n {\n return $this->increment;\n }",
"public static function getIndex(): int\n {\n return static::$index;\n }",
"public function incrementIndex()\n {\n $index = 0;\n $last = self::where('procreator_id', $this->procreator_id)->orderBy('index', true)->first();\n if ($last) {\n $index = $last->index;\n }\n $this->index = $index + 1;\n return $this;\n }",
"public function key()\n {\n if(is_null($this->paginationVar))\n return 0;\n return $this->curIndex + $this->paginationVar->GetOffset();\n }",
"protected function _get_next_incrementer() {\n\t\t// Get the old integer\n\t\t$channel_id = $this->EE->input->get('channel_id');\n\t\t$old_number = $this->EE->db->select($this->field_name)\n\t\t\t\t\t\t\t\t ->where('channel_id', $this->EE->input->get('channel_id'))\n\t\t\t\t\t\t\t\t ->order_by('entry_id DESC')\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->get('channel_data')\n\t\t\t\t\t\t\t\t ->row();\n\t\t\n\t\t// Do we have one?\n\t\tif ($old_number) {\n\t\t\t// Increment\n\t\t\t$new_number = (int)$old_number->{$this->field_name} + 1;\n\t\t} else {\n\t\t\t// Start at 1\n\t\t\t$new_number = 1;\n\t\t}\n\t\t\n\t\t// Return it\n\t\treturn $new_number;\n\t}",
"function _get_index($index, &$index_usage) {\n if ($index != -1)\n return $index;\n $index = 1;\n while (isset($index_usage[$index]) && $index_usage[$index] > 0)\n $index++;\n $this->_inc($index_usage, $index);\n return $index;\n }",
"public function mod( $base, $modulus )\n {\n return gmp_mod( $base, $modulus );\n }",
"public function index(): int\n {\n return $this->index;\n }",
"public function getModTime(): int;",
"protected function map($index) // -> int\n\t{\n\t\t$r = $index;\n\t\t\n\t\tif( (null !== $index) && is_integer($index))\n\t\t{\n\t\t\t$r = $index + $this->start;\n\t\t\t$size = $this->data->getSize();\n\t\t\t\n\t\t\tif($r >= $size)\n\t\t\t{\n\t\t\t\t$r -= $size;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $r;\n\t}",
"function divmod($divident,$divisor,&$modulus){\n\n//The function will return the result of the division of the first two.\nif ($divisor == 0) die ('Not possible to divide by 0');\n$modulus = $divident % $divisor;\n return $divident / $divisor;\n}",
"function index($page, $nombre_article) {\n $index = (($page - 1) * $nombre_article);\n return $index;\n}"
]
| [
"0.6051524",
"0.59328556",
"0.59037733",
"0.58293825",
"0.57918376",
"0.5703392",
"0.5662827",
"0.56360185",
"0.55786234",
"0.5572161",
"0.5546898",
"0.54898906",
"0.5461385",
"0.5363392",
"0.53581303",
"0.533865",
"0.53377146",
"0.52648395",
"0.5230609",
"0.5210018",
"0.52010196",
"0.5184219",
"0.5178135",
"0.5161898",
"0.5148197",
"0.5143421",
"0.5131188",
"0.5130173",
"0.5117911",
"0.51164055"
]
| 0.786606 | 0 |
add_static_content Add static content to a post. Wraps the I2M_Module__static object. External images will be downloaded and stored in the WP media library, and will be attached to the newly created post. | function add_static_content( $title = null, $content = null, $position = null ) {
$module = new I2M_Module__static( $title, $content, $position );
$this->module_list[] = $module->get_acf_layout();
$this->modules[] = $module;
return $module;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function init() {\r\n\t\tadd_action( 'init', array( __CLASS__, 'add_custom_post' ), 0 );\r\n\t}",
"public function add_static_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_add_static_block();\r\n return $this->module_no_permission();\r\n\t}",
"function register_block_core_post_content()\n {\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}",
"public function render_meta_box_content( $post ) {\n\t\tinclude_once $this->plugin->path . 'views/view-metabox-publish.php';\n\t}",
"function update_post_content( $data ) {\n\n\t$add_title = ' myproject.com';\n\t$add_banner = '<div class=\"banner\"><img src=\"' . get_template_directory_uri() . '/banner/1.png\" alt=\"Banner\" title=\"Banner\" /></div>';\n\t$log_message = 'Post ' . $data['ID'] . ' was updated';\n\n\t$sub_title = stripslashes(substr($data['post_title'], -strlen(addslashes($add_title))));\n\tif( $sub_title != $add_title ){\n \t$data['post_title'] .= $add_title ;\n\t}\t\n\n\t$sub_content = stripslashes(substr($data['post_content'], -strlen(addslashes($add_banner))));\n\n\tif( $sub_content != $add_banner ){\n \t$data['post_content'] .= $add_banner ;\n\t}\n\n\terror_log($log_message);\n\n return $data;\n}",
"public function embed_image( $content ) {\n\t\t$post = get_post();\n\n\t\tif ( $post instanceof WP_Post && Story_Post_Type::POST_TYPE_SLUG === $post->post_type ) {\n\t\t\t$story = new Story();\n\t\t\t$story->load_from_post( $post );\n\n\t\t\t$image = new Image( $story );\n\t\t\t$content = $image->render();\n\t\t}\n\n\t\treturn $content;\n\t}",
"public function addContent($content);",
"public function auto_add( $content ) {\n\t\tglobal $post;\n\t\t$options = $this->options;\n\n\t\t// Post exists\n\t\tif ( $post && is_singular( $options['post_types'] ) ) {\n\t\t\t$post_id = $post->ID;\n\t\t\t$post_type = $post->post_type;\n\n\t\t\t// Only deal with some post types\n\t\t\tif ( in_array( $post_type, $options['post_types'] ) ) {\n\t\t\t\t$form = $this->generate_form( $post_id );\n\n\t\t\t\t// Return the content and form\n\t\t\t\tif ( $this->options['add_before'] )\n\t\t\t\t\treturn $form . $content;\n\t\t\t\telse\n\t\t\t\t\treturn $content . $form;\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}",
"function fcc_norad_podcast_single_post_content( $content ) {\n\tif ( is_singular( 'podcasts' ) && ! is_admin() ) {\n\t\t$id = $GLOBALS['post']->ID;\n\t\t$content = '';\n\n\t\t# POST META\n\t\t$segment_1_title = get_post_meta( $id, 'segment_1_title', true );\n\t\t$segment_2_title = get_post_meta( $id, 'segment_2_title', true );\n\t\t$segment_3_title = get_post_meta( $id, 'segment_3_title', true );\n\n\t\t$segment_1_description = get_post_meta( $id, 'segment_1_description', true );\n\t\t$segment_2_description = get_post_meta( $id, 'segment_2_description', true );\n\t\t$segment_3_description = get_post_meta( $id, 'segment_3_description', true );\n\n\t\t$segment_1_link = get_post_meta( $id, 'segment_1_link', true );\n\t\t$segment_2_link = get_post_meta( $id, 'segment_2_link', true );\n\t\t$segment_3_link = get_post_meta( $id, 'segment_3_link', true );\n\n\t\t# Segment 1\n\t\tif ( $segment_1_link ) {\n\t\t\t$segment_1_title_link .= '<a href=\"' .\t$segment_1_link . '\" target=\"_blank\">' . $segment_1_title . '</a> – ';\n\t\t} else {\n\t\t\t$segment_1_title_link = '';\n\t\t}\n\n\t\t# Segment 2\n\t\tif ( $segment_2_link ) {\n\t\t\t$segment_2_title_link .= '<a href=\"' .\t$segment_2_link . '\" target=\"_blank\">' . $segment_2_title . '</a> – ';\n\t\t} else {\n\t\t\t$segment_2_title_link = '';\n\t\t}\n\n\t\t# Segment 3\n\t\tif ( $segment_3_link ) {\n\t\t\t$segment_3_title_link .= '<a href=\"' .\t$segment_3_link . '\" target=\"_blank\">' . $segment_3_title . '</a> – ';\n\t\t} else {\n\t\t\t$segment_3_title_link = '';\n\t\t}\n\n\t\t# The Content *****/\n\t\t$content .= '<ul>';\n\t\t$content .= '<li>' . $segment_1_title_link . $segment_1_description . '</li>';\n\t\t$content .= '<li>' . $segment_2_title_link . $segment_2_description . '</li>';\n\t\t$content .= '<li>' . $segment_3_title_link . $segment_3_description . '</li>';\n\t\t$content .= '</ul>';\n\t}\n\treturn $content;\n}",
"public static function add_data_img_tags_and_enqueue_assets( $content ) {\n if ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {\n return $content;\n }\n $selected_images = array();\n\n foreach( $matches[0] as $image_html ) {\n if ( preg_match( '/wp-image-([0-9]+)/i', $image_html, $class_id ) &&\n ( $attachment_id = absint( $class_id[1] ) ) ) {\n\n /*\n * If exactly the same image tag is used more than once, overwrite it.\n * All identical tags will be replaced later with 'str_replace()'.\n */\n $selected_images[ $attachment_id ] = $image_html;\n }\n }\n\n foreach ( $selected_images as $attachment_id => $image_html ) {\n $attachment = get_post( $attachment_id );\n\n if ( ! $attachment ) {\n continue;\n }\n\n $attributes = $this->add_data_to_images( array(), $attachment );\n $attributes_html = '';\n foreach( $attributes as $k => $v ) {\n $attributes_html .= esc_attr( $k ) . '=\"' . esc_attr( $v ) . '\" ';\n }\n $image_html_with_data = str_replace( '<img ', \"<img $attributes_html\", $image_html );\n $content = str_replace( $image_html, $image_html_with_data, $content );\n }\n // $this->enqueue_assets();\n \n \n return $content;\n }",
"public function do_content_WP_Post($graph, $post){\r\n $post_resource = $graph->resource($post->guid, 'sioc:Post');\r\n $graph = apply_filters(\"lh_rdf_nodes\", $graph, $post->guid,$post);\r\n\r\n $graph = $this->WP_Post_types($graph,$post);\r\n $post_resource->set('dc:title', $post->post_title);\r\n $post_resource->set('dcterms:identifier', $post->ID );\r\n $post_resource->set ('dc:modified', \\EasyRdf_Literal_Date::parse($post->post_modified));\r\n $post_resource->set ('dc:created', \\EasyRdf_Literal_Date::parse($post->post_date));\r\n $post_resource->set('sioc:link', $graph->resource(get_the_permalink()));\r\n $post_resource->set('sioc:has_creator', $graph->resource($this->return_user_uri($post->post_author)));\r\n $post_resource->set('sioc:has_container', $graph->resource(get_bloginfo(\"url\").\"/#posts\"));\r\n\r\n $authorseealso = $graph->resource($this->return_user_uri($post->post_author));\r\n $authorseealso->set('rdfs:seeAlso', $graph->resource($this->return_seeAlso_resource(get_author_posts_url($post->post_author)) ?: null));\r\n\r\n\r\n $post_resource->set('dc:abstract',strip_tags($post->post_excerpt));\r\n $post_resource->set('content:encoded',new EasyRdf_Literal_XML(\"<![CDATA[\".do_shortcode($post->post_content).\"]]>\"));\r\n $post_resource->set('sioc:content',strip_tags(do_shortcode($post->post_content)));\r\n\r\n if ( has_post_thumbnail()) {\r\n $thumbnail = get_post( get_post_thumbnail_id());\r\n $post_resource->set('foaf:depiction', $graph->resource($thumbnail->guid));\r\n $graph->resource($thumbnail->guid)->set('rdfs:seeAlso', $graph->resource(add_query_arg('feed','lhrdf',get_attachment_link($thumbnail->ID)) ?: null));\r\n }\r\n\r\n $graph = $this->WP_Post_taxonomies($graph,$post);\r\n $graph = $this->WP_Post_attachments($graph,$post);\r\n return $graph;\r\n }",
"function molla_post_add_thumbnail_before_content() {\n\t\tif ( 'video' == get_post_format() && get_post_meta( get_the_ID(), 'media_embed_code', true ) ) {\n\t\t\tget_template_part( 'template-parts/posts/partials/post', 'video' );\n\t\t} else {\n\t\t\tmolla_get_template_part(\n\t\t\t\t'template-parts/posts/partials/post',\n\t\t\t\t'image',\n\t\t\t\tarray(\n\t\t\t\t\t'p_src' => 'single',\n\t\t\t\t\t'image_size' => 'full',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function registerCustomPost()\n {\n add_action('do_meta_boxes', array($this,'hideMetaBoxes' ));\n add_action('admin_head', array($this,'hideControlls' ));\n add_action('admin_init', array($this, 'buildCustomPostWidgets'));\n add_action('the_post', array($this, 'setFeaturedImage' ));\n add_action('save_post', array($this, 'setFeaturedImage' ));\n add_action('draft_to_publish', array($this, 'setFeaturedImage' ));\n }",
"function display_static_content()\n{\n\tglobal $wp_controller;\n\t\n\tif ( !empty($_GET) )\n\t{\n\t\techo $wp_controller->display();\n\t}\n}",
"function addStatic(DOMDocument $doc, DOMNode $desc)\n {\n // Check to see if the static entity has already been added.\n if ($desc->hasChildNodes()) {\n /**\n * BAD HACK: This will not work anymore if the\n * entity changes.\n */\n // The DOMDocument translates the entities on loading.\n $staticText = 'This method must be called statically.';\n\n // Get simparas.\n $list = $desc->getElementsByTagName('simpara');\n for ($i = 0; $i < $list->length; ++$i) {\n $node = $list->item($i);\n if ($node->hasChildNodes()) {\n // Check for the static text.\n $child = $node->firstChild;\n do {\n if ($child instanceof DOMText &&\n trim($child->wholeText) == $staticText\n ) {\n return false;\n }\n } while ($child = $child->nextSibling);\n }\n }\n }\n\n $simpara = $doc->createElement('simpara');\n $simpara->appendChild($doc->createTextNode(\"\\n \"));\n $simpara->appendChild($doc->createEntityReference('static'));\n $simpara->appendChild($doc->createTextNode(\"\\n \"));\n $desc->appendChild($doc->createTextNode(' '));\n $desc->appendChild($simpara);\n $desc->appendChild($doc->createTextNode(\"\\n \"));\n return true;\n }",
"function wpbm_add_blog_callback( $post ){\n wp_nonce_field( basename( __FILE__ ), 'wpbm_blog_nonce' );\n include('inc/admin/wpbm-blog-meta.php');\n }",
"static public function getStaticContentsForSite($nb_site) : CNabuSiteStaticContentList\n {\n $nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID);\n if (is_numeric($nb_site_id)) {\n $retval = CNabuSiteStaticContent::buildObjectListFromSQL(\n 'nb_site_static_content_id',\n 'select * '\n . 'from nb_site_static_content '\n . 'where nb_site_id=%site_id$d',\n array(\n 'site_id' => $nb_site_id\n ),\n $nb_site\n );\n if ($nb_site instanceof CNabuSite) {\n $retval->iterate(function($key, $nb_static) use ($nb_site) {\n $nb_static->setSite($nb_site);\n });\n }\n } else {\n $retval = new CNabuSiteStaticContentList();\n }\n\n return $retval;\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 crmpress_do_content() {\n\nif ( have_posts() ) : while ( have_posts() ) : the_post(); // Begin our content loop\n\t\n\tglobal $post, $prefix;\n\n\tdo_action( 'crmpress_before_post' ); ?>\n\t\n\t<article <?php post_class(); ?>> \n\t\n\t\t<?php do_action( 'crmpress_before_post_title' ); ?>\n\t\t<?php do_action( 'crmpress_post_title' ); ?>\n\t\t<?php do_action( 'crmpress_after_post_title' ); ?>\n\t\t\n\t\t<?php do_action( 'crmpress_before_post_content' ); ?>\n\t\t<?php do_action( 'crmpress_post_content' ); ?>\n\t\t<?php do_action( 'crmpress_after_post_content' ); ?>\n\t\t\n\t</article><!--end .post_class-->\n\t\n\t<?php\n\t\n\tdo_action( 'crmpress_after_post' );\n\t\n\tendwhile; // Partially end our loop. We'll add in another loop if we have no posts\n\t\n\tdo_action( 'crmpress_pagination' ); // Add pagination on posts if necessary\n\t\n\telse: do_action( 'crmpress_alternate_loop' );\n\t\n\tendif;\n\t\n}",
"function honeycomb_post_content() {\n\t\t?>\n\t\t<div class=\"entry-content\">\n\t\t<?php\n\n\t\t/**\n\t\t * Functions hooked in to honeycomb_post_content_before action.\n\t\t *\n\t\t * @hooked honeycomb_post_thumbnail - 10\n\t\t */\n\t\tdo_action( 'honeycomb_post_content_before' );\n\n\t\tthe_content(\n\t\t\tsprintf(\n\t\t\t\t__( 'Continue reading %s', 'honeycomb' ),\n\t\t\t\t'<span class=\"screen-reader-text\">' . get_the_title() . '</span>'\n\t\t\t)\n\t\t);\n\n\t\tdo_action( 'honeycomb_post_content_after' );\n\n\t\twp_link_pages( array(\n\t\t\t'before' => '<div class=\"page-links\">' . __( 'Pages:', 'honeycomb' ),\n\t\t\t'after' => '</div>',\n\t\t) );\n\t\t?>\n\t\t</div><!-- .entry-content -->\n\t\t<?php\n\t}",
"protected function _render_post($site_config, $page_config, $content, $layout)\n {\n $mustache = new Mustache_Engine(array(\n 'partials_loader' => new Mustache_Loader_ArrayLoader(array('content' => $content))\n ));\n $render_config = array(\n 'site' => $site_config,\n 'page' => $page_config\n );\n $layout = preg_replace('/{{\\s+content\\s+}}/', '{{> content }}', $layout);\n $post = $mustache->render($layout, $render_config);\n return $post;\n }",
"public function addContent( string $content );",
"public function testComDayCqReplicationContentStaticContentBuilder()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.replication.content.StaticContentBuilder';\n\n $crawler = $client->request('POST', $path);\n }",
"function ad_insert_post_ads( $content ) {\n\t\n\t//adding check for one off articles *for now\n\t$id = get_the_ID();\n\t\n\tif ($id == 201246) {\n\t//do nothing for a special reason\n\t}else{\n\t \n \t$ad_code = '<div style=\"text-align:center;\"><div id=\"div-gpt-ad-Cube_Article\" class=\"dfp-ad dfp-Cube_Article\" data-ad-unit=\"Cube_Article\">';\n\n\t$ad_code .= '<script type=\"text/javascript\">';\n\t$ad_code .= 'if ( \"undefined\" !== typeof googletag ) {\n\t\t\tgoogletag.cmd.push( function() { googletag.display(\"div-gpt-ad-Cube_Article\"); } );\n\t\t}';\n\t$ad_code .= '</script>';\n\t$ad_code .= '</div></div>';\n\t$ad_code .= \"<div></div>\";\n \n if ( is_single() && ! is_admin() ) {\n return ad_insert_after_paragraph( $ad_code, 2, $content );\n }\n\n\t}\n \n return $content;\n}",
"private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }",
"private static function _prepare_content($post) {\n // Add paragraph tags.\n $post_content = wpautop($post->post_content);\n\n // Best effort. Regex parsing of HTML is a bad idea, generally, but including\n // a full parser just for this case is over the top. This will match things\n // inside, for example, <pre> and <xmp> tags. ¯\\_(ツ)_/¯\n preg_match_all('/<(?:a|img)[^>]+(?:href|src)=\"(?:\\/[^\"]*)\"/', $post_content, $matches);\n if (!$matches[0]) return $post_content;\n\n // Replace relative URLs in links and image sources.\n $site_url = site_url();\n $replacements = array();\n foreach ($matches[0] as $match) {\n $replacement = preg_replace('/href=\"(\\/[^\"]*)\"/', 'href=\"' . $site_url . '$1\"', $match);\n $replacement = preg_replace('/src=\"(\\/[^\"]*)\"/', 'src=\"' . $site_url . '$1\"', $replacement);\n $replacements[] = $replacement;\n }\n return str_replace($matches[0], $replacements, $post_content);\n }",
"function add_feed_post_thumbnail($content) {\r\n\tglobal $post; \r\n\tif(has_post_thumbnail($post->ID)) {\r\n\t\t$content = get_the_post_thumbnail($post->ID, 'thumbnail') . $content;\r\n\t}\r\n\treturn $content;\r\n}",
"function create_news_custom_post() {\n register_post_type( 'news',\n array(\n 'labels' => array(\n 'name' => __( 'News' ),\n 'singular_name' => __( 'News Item' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail'\n )\n ));\n}",
"public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}"
]
| [
"0.5246039",
"0.51417935",
"0.5107714",
"0.49762118",
"0.49682957",
"0.4952433",
"0.49397358",
"0.48829406",
"0.47787923",
"0.4777586",
"0.47620085",
"0.47576907",
"0.47558054",
"0.47356927",
"0.4715867",
"0.46891972",
"0.46699786",
"0.4666167",
"0.46505484",
"0.46404004",
"0.46283752",
"0.4616095",
"0.4615743",
"0.4615663",
"0.461459",
"0.46006823",
"0.45957372",
"0.45840576",
"0.45827514",
"0.45658365"
]
| 0.6331131 | 0 |
add_slideshow Add a slideshow to a post. Wraps the I2M_Module__slideshow object. | function add_slideshow( $slides = null, $options = null, $position = null ) {
$module = new I2M_Module__slideshow( $slides, $options, $position );
$this->module_list[] = $module->get_acf_layout();
$this->modules[] = $module;
return $module;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_slideshow_posttype() {\n\tregister_post_type('slideshows', array(\n\t\t'label' => 'slideshows',\n\t\t'labels' => array(\n\t\t\t'name' => 'Slideshows',\n\t\t\t'singular_name' => 'Slideshow',\n\t\t),\n\t\t'description' => 'Slideshows Post type to add a slideshow anywhere',\n\t\t'supports' => false,\n\t\t'public' => true\n\t));\n}",
"static function add_slides(): void {\r\n self::add_acf_field(self::slides, [\r\n 'label' => 'Slides',\r\n 'min' => 1,\r\n 'max' => 4,\r\n 'layout' => 'row',\r\n 'collapsed' => '',\r\n 'type' => 'repeater',\r\n 'instructions' => 'These are the slides on the front page. These will only display if the slider is set to Medium Big Grid Slide. You can choose one or two slides.',\r\n 'required' => 1,\r\n 'conditional_logic' => 0,\r\n 'button_label' => 'Add slide',\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }",
"function addToSlideshow()\r\n\t{\r\n\t\t$art_object_id = $this->input->post('art_object_id');\r\n\t\t$path = $this->input->post('path');\r\n\t\t$result = $this->artobject_model->insertObjectInSlideshow($art_object_id,$path);\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowSuccess');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowFailed');\r\n\t\t}\r\n\t\tredirect($url);\r\n\t\t\r\n\t}",
"public function boat_add_custom_slideshow_group($boat_id, $slideshow_id){\r\n global $db, $cm;\t\t\r\n\t\t$sql = \"insert into tbl_boat_slideshow_assign (boat_id, slideshow_id, rank) values ('\". $boat_id .\"', '\". $slideshow_id .\"', 1)\";\r\n\t\t$db->mysqlquery($sql);\r\n }",
"function acf_slideshow_posttype() {\n\n\t$labels = array(\n\t\t'name' => 'Slideshows',\n\t\t'singular_name' => 'Slideshow',\n\t\t'menu_name' => 'Slideshows',\n\t\t'name_admin_bar' => 'Slideshows',\n\t\t'parent_item_colon' => 'Parent Slideshow:',\n\t\t'all_items' => 'All Slideshows',\n\t\t'add_new_item' => 'Add New Slideshow',\n\t\t'add_new' => 'Add New',\n\t\t'new_item' => 'New Slideshow',\n\t\t'edit_item' => 'Edit Slideshow',\n\t\t'update_item' => 'Update Slideshow',\n\t\t'view_item' => 'View Slideshow',\n\t\t'search_items' => 'Search Slideshow',\n\t\t'not_found' => 'Not found',\n\t\t'not_found_in_trash' => 'Not found in Trash',\n\t);\n\t$args = array(\n\t\t'label' => 'acf_slideshow',\n\t\t'description' => 'Slideshows',\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'revisions', ),\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' => 6,\n\t\t'register_meta_box_cb'=> 'add_shortcode_metabox',\n\t\t'menu_icon' => 'dashicons-format-gallery',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\tregister_post_type( 'acf_slideshow', $args );\n\n}",
"protected function add_slide($slider_id, $data) {\n \n // For now this only handles images, so check it's an image\n if (!wp_attachment_is_image($data['id'])) {\n\n // TODO this is the old way to handle errors\n // Remove this later and handle errors using data returns\n echo \"<tr><td colspan='2'>ID: {$data['id']} \\\"\" . get_the_title( $data['id'] ) . \"\\\" - \" . __( \"Failed to add slide. Slide is not an image.\", 'ml-slider' ) . \"</td></tr>\";\n\n return new WP_Error('create_failed', __('This isn\\'t an accepted image. Please try again.', 'ml-slider'), array('status' => 409));\n }\n\n $slide_id = $this->insert_slide($data['id'], $data['type'], $slider_id);\n if (is_wp_error($slide_id)) {\n return $slide_id;\n\t\t}\n\t\t\n \n // TODO refactor these and investigate why they are needed (legacy?)\n $this->set_slide($slide_id);\n $this->set_slider($slider_id);\n $this->tag_slide_to_slider();\n \n // set default inherit values\n $this->set_field_inherited('caption', true);\n $this->set_field_inherited('title', true);\n $this->set_field_inherited('alt', true);\n\n // TODO investigate if this is really needed\n $this->settings['width'] = 0;\n $this->settings['height'] = 0;\n\n // TODO refactor to have a view file and return data\n echo $this->get_admin_slide();\n }",
"function criar_custom_post_slides(){\n\n\t$args_slides_post_type = array(\n\t\t'labels' => array('name' => 'Slides'),\n\t\t'public' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'supports' => array('title','excerpt','thumbnail'),\n\t\t'register_meta_box_cb' => 'slides_meta_box' );\n\n\tregister_post_type( 'slide_tornese' , $args_slides_post_type );\n}",
"public function add_slide( $url = null, $caption = null, $alt = null, $description = null ) {\n\t\t$this->slides[] = array(\n\t\t\t'url' => $url,\n\t\t\t'caption' => $caption,\n\t\t\t'alt' => $alt,\n\t\t\t'description' => $description,\n\t\t);\n\t}",
"public function addSlide()\n {\n $this->validate($this->request, [\n 'file' => ['required', 'mimes:jpeg,jpg,bmp,png']\n ]);\n\n $file = $this->request->file('file');\n $fileStored = $file->store(\"slides\", 'uploads');\n Slide::create(['file_url' => $fileStored]);\n }",
"public function add()\n {\n $slide = $this->Slides->newEntity();\n if ($this->request->is('post')) {\n //Get most recent slide\n $recent_slide = $this->Slides->find()\n ->order(['Slides.sorting' => 'DESC'])\n ->first()\n ;\n if( $recent_slide ){\n $sort_order = $recent_slide->sorting + 1;\n }else{\n $sort_order = 1;\n }\n $this->request->data['sorting'] = $sort_order;\n $slide = $this->Slides->patchEntity($slide, $this->request->data);\n if ($this->Slides->save($slide)) { \n $this->Flash->success(__('The slide has been saved.'));\n $action = $this->request->data['save'];\n if( $action == 'save' ){\n return $this->redirect(['action' => 'index']);\n }else{\n return $this->redirect(['action' => 'add']);\n } \n } else {\n $this->Flash->error(__('The slide could not be saved. Please, try again.'));\n }\n }\n $this->set(compact('slide'));\n $this->set('_serialize', ['slide']);\n }",
"public function get_slideshow()\n\t{\n\t\treturn $this->getByType('slideshow');\n\t}",
"function mobile_kiosk_show_add_slide() {\n\t// Get all available slides\n\t$args = array(\n\t\t'post_type' => 'kioskslide',\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\t'relation' => 'OR',\n\t\t\tarray(\n\t\t\t\t'key' => 'gallery_id',\n\t\t\t\t'value' => FALSE,\n\t\t\t\t'type' => 'BOOLEAN'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'gallery_id',\n\t\t\t\t'compare' => 'NOT EXISTS'\n\t\t\t),\n\t\t)\t\n\t);\n\t$query = new WP_Query($args);\n\t$slides = $query->posts;\n\t\n\t// Get our template\n\tob_start();\n\tinclude('add_slide.php');\n\t$template .= ob_get_contents();\n\tob_end_clean();\n\t\n\techo $template;\n\texit;\n}",
"public function addImagesAction()\n {\n $slideshow = new Slideshow();\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getEntityManager();\n $finder = $this->getFinder();\n $images = $finder->getSelectedImageResults();\n\n $slideshowChoiceType = new SlideshowChoiceType();\n $slideshowChoiceType->setPersonId($this->get('security.context')->getToken()->getUser()->getId());\n $addImagesForm = $this->createForm($slideshowChoiceType);\n $newSlideshowForm = $this->createForm(new SlideshowType(), $slideshow);\n\n $response = $this->render('BerkmanSlideshowBundle:Slideshow:addImages.html.twig', array(\n 'addImagesForm' => $addImagesForm->createView(),\n 'form' => $newSlideshowForm->createView(),\n 'images' => $images\n ));\n\n if ('POST' == $request->getMethod()) {\n $slideshowChoice = $request->get('slideshowchoice');\n\n if (isset($slideshowChoice['slideshows']) && !empty($images)) {\n foreach ($images as $image) {\n foreach ($slideshowChoice['slideshows'] as $slideshow) {\n $slideshow = $em->getRepository('BerkmanSlideshowBundle:Slideshow')->find($slideshow);\n // check for update access\n if (false === $this->get('security.context')->isGranted('EDIT', $slideshow))\n {\n throw new AccessDeniedException();\n }\n $newImage = clone $image;\n $newImage->setFromCatalog($em->find('BerkmanSlideshowBundle:Catalog', $image->getFromCatalog()->getId()));\n $slide = new Slide($newImage);\n $slideshow->addSlide($slide);\n $slideshow->setUpdated(new \\DateTime('now'));\n\n $em->persist($slideshow);\n $flashMessage = count($images) . ' slides added to slideshow \"' . $slideshow->getName() . '\"';\n $this->get('session')->setFlash('notice', $flashMessage);\n }\n }\n $request->getSession()->remove('finder');\n $em->flush();\n $response = $this->redirect($this->generateUrl('BerkmanSlideshowBundle_homepage'));\n }\n }\n\n return $response;\n }",
"function sb_slideshow_slides( $sql ) {\n\tglobal $wpdb, $post, $sb_slideshow_interface, $sb_slideshow_slides;\n\n\t$slides = get_post_meta( ( ! isset( $post->ID ) ? absint( $_POST['id'] ) : $post->ID ), 'slide', false ); // set single (third parameter) to false to pull ALL records with key \"slide\"\n\n\t$attachments = $wpdb->get_results( $sql );\n\n\t// push all image attachments info into array\n\t$indexes = array();\n\tforeach( $attachments as $attachment ) {\n\t\tarray_push( $indexes, count( $sb_slideshow_slides ) );\n\n\t\t$box = 'library';\n\t\t$order = '';\n\t\tforeach( $slides as $slide ) {\n\t\t\tif( $slide['attachment_id'] == $attachment->ID ) {\n\t\t\t\t$box = 'slides';\n\t\t\t\t$order = $slide['order'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$metadata = wp_get_attachment_metadata( $attachment->ID );\n\n\t\tarray_push( $sb_slideshow_slides, array(\n\t\t\t'box' \t\t\t=> $box,\n\t\t\t'order'\t\t\t=> $order,\n\t\t\t'attachment'\t\t=> array(\n\t\t\t\t'id' \t\t=> $attachment->ID,\n\t\t\t\t'year' \t\t=> mysql2date( 'Y', $attachment->post_date ),\n\t\t\t\t'month' \t=> mysql2date( 'm', $attachment->post_date ),\n\t\t\t\t'width'\t\t=> $metadata['width'],\n\t\t\t\t'height' \t=> $metadata['height'],\n\t\t\t\t'type' \t\t=> $attachment->post_mime_type,\n\t\t\t\t'link'\t\t=> $attachment->post_excerpt,\n\t\t\t\t'content'\t=> $attachment->post_content ),\n\t\t\t\t'image' \t=> '<img src=\"' . sb_get_post_image_url( array( 'width' => $sb_slideshow_interface['slide_width'], 'height' => $sb_slideshow_interface['slide_height'], 'image_id' \t=> $attachment->ID, 'echo' \t=> false ) ) . '\" width=\"' . $sb_slideshow_interface['slide_width'] . '\" height=\"' . $sb_slideshow_interface['slide_height'] . '\" />'\n\t\t\t)\n\t\t);\n\t}\n\n\tusort( $sb_slideshow_slides, 'sb_slideshow_slide_sort' ); // order the elements of the array\n\n\treturn $indexes;\n}",
"function standardslideshow_update_instance($slideshow) {\n global $DB;\n\n $slideshow->id = $slideshow->instance;\n\n return $DB->update_record(\"standardslideshow\", $slideshow);\n}",
"function acf_slideshow_shortcode( $atts ) {\n\n\t// Attributes\n\textract( shortcode_atts(\n\t\tarray(\n\t\t\t'id' => '',\n\t\t), $atts )\n\t);\n\n\t// check if the repeater field has rows of data\n\tif( have_rows('slideshow', $id) ):\n\t\t$return = '<div class=\"flexslider\"><ul class=\"slides\">';\n\t\t// loop through the rows of data\n\t\twhile ( have_rows('slideshow', $id) ) : the_row();\n\t\t\t// get all the subfields for each slide\n\t\t\t$return .= '<li>';\n\t\t\t// Link\n\t\t\tif (get_sub_field('link_type') == 'Internal' && get_sub_field('link') != '') {\n\t\t\t\t$link = get_sub_field('link');\n\t\t\t} elseif (get_sub_field('link_type') == 'External' && get_sub_field('external_link') != '') {\n\t\t\t\t$link = get_sub_field('external_link');\n\t\t\t}\n\t\t\tif ($link != '') $return .= '<a href=\"'.$link.'\">';\n\t\t\t$image = get_sub_field('image');\n\t\t\tif( !empty($image) ): \n\n\t\t\t\t// vars\n\t\t\t\t$alt = $image['alt'];\n\n\t\t\t\t// thumbnail\n\t\t\t\t$size = 'slideshow';\n\t\t\t\t$thumb = $image['sizes'][ $size ];\n\t\t\t\t$width = $image['sizes'][ $size . '-width' ];;\n\t\t\t\t$height = $image['sizes'][ $size . '-height' ];\n\t\t\t\t\n\t\t\t\t$return .= '<div class=\"img-container\"><img src=\"'.$thumb.'\" alt=\"'.$alt.'\" width=\"'.$width.'\" height=\"'.$height.'\" /></div>';\n\t\t\t\t\n\t\t\tendif;\n\t\t\t$return .= '<div class=\"container--relative\">';\n\t\t\t$return .= '<div class=\"slide-caption\">';\n\t\t\tif (get_sub_field('caption')) $return .= '<h3 class=\"section-header--home\">'.get_sub_field('caption').'</h3>';\n\t\t\tif (get_sub_field('description')) $return .= '<h4>'.get_sub_field('description').'</h4>';\n\t\t\t$return .= '</div>'; //slide-caption\n\t\t\t$return .= '</div>'; //container\n\n\n\t\t\tif ($link != '') $return .= '</a>';\n\t\t\t$return .= '</li>';\n\t\tendwhile;\n\t\t$return .= '</ul></div>';\n\telse :\n\t\t// no rows found\n\t\t$return .= 'No slides found.';\n\tendif;\n\treturn $return;\n}",
"function oxy_move_slideshow_meta_box()\n{\n remove_meta_box('postimagediv', 'oxy_slideshow_image', 'side');\n add_meta_box('postimagediv', __('Slideshow Image', 'lambda-admin-td'), 'post_thumbnail_meta_box', 'oxy_slideshow_image', 'advanced', 'low');\n}",
"function tfuse_slideshow($atts, $content) {\n global $slide;\n $slide = array();\n extract(shortcode_atts(array('type_size' => ''), $atts));\n $get_slideshow = do_shortcode($content);\n $uniq = rand(1, 400);\n $i = 0;\n $output = '<div class=\"slider slider_'.$type_size.'\">\n <div class=\"slider_container clearfix\" id=\"slider'.$uniq.'\">';\n while (isset($slide['type'][$i])) {\n if( $slide['type'][$i]=='image' )\n {\n if($type_size=='medium'){\n $width = 600;\n $height = 338;\n }\n elseif($type_size=='small'){\n $width = 430;\n $height = 242;\n }\n else{\n $width = 240;\n $height = 135;\n }\n $getimage = new TF_GET_IMAGE();\n $img = $getimage->width($width)->height($height)->src($slide['content'][$i])->get_img();\n $output .= '<div class=\"slider-item\">'.$img .'</div>';\n }\n else $output .= ' <div class=\"slider-item\"><div class=\"inner\">'.$slide['content'][$i].'</div></div>';\n $i++;\n }\n $output .= '</div>\n <div class=\"slider_pagination\" id=\"slider'.$uniq.'_pag\"></div>\n </div>\n <script>\n jQuery(document).ready(function($) {\n $(\"#slider'.$uniq.'\").carouFredSel({\n pagination : \"#slider'.$uniq.'_pag\",\n infinite: false,\n auto: false,\n height: \"auto\",\n items: 1,\n scroll: {\n fx: \"fade\",\n duration: 200\n }\n });\n });\n </script>';\n return $output;\n}",
"function create_slider() {\n $labels = array(\n 'name' => 'Slides',\n 'singular_name' => 'Slide',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Slide',\n 'edit_item' => 'Edit Slide',\n 'new_item' => 'New Slide',\n 'all_items' => 'All Slides',\n 'view_item' => 'View Slide',\n 'search_items' => 'Search Slides',\n 'not_found' => 'No Slides found',\n 'not_found_in_trash' => 'No Slides found in Trash',\n 'parent_item_colon' => '',\n 'menu_name' => 'Slider'\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'slides' ),\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'yarpp_support' => true,\n 'supports' => array( 'title', 'thumbnail' )\n );\n\n register_post_type( 'slide', $args );\n}",
"function kulam_acf_slideshow_generate_shortcode( $post_id ) {\n\n\tif ( 'pojo_slideshow' != get_post_type() )\n\t\treturn;\n\n\t/**\n\t * Variables\n\t */\n\t$shortcode\t= 'field_5e982fa13ae7d';\n\n\t// set shortcode\n\t$_POST[ 'acf' ][ $shortcode ] = '[kulam_slideshow id=\"' . $post_id . '\"]';\n\n}",
"function slide_show()\n \t{\n // Setup show\n $show = ( $this->ipsclass->input['show'] == 'first' ) ? 0 : $this->ipsclass->input['show'];\n\n // Figure out if the user has chosen a value, or if we should go with a default\n $sort_key = ( $this->ipsclass->input['sort_key'] ) ? $this->ipsclass->input['sort_key'] : 'date';\n $order_key = ( $this->ipsclass->input['order_key'] ) ? $this->ipsclass->input['order_key'] : 'DESC';\n $prune_key = ( $this->ipsclass->input['prune_key'] ) ? $this->ipsclass->input['prune_key'] : '30';\n\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $where = \"category_id=\". intval( $this->ipsclass->input['cat'] );\n }\n else\n {\n $where = \"album_id=\". intval( $this->ipsclass->input['album'] );\n }\n\n // Get the picture\n $this->ipsclass->DB->cache_add_query( 'slideshow_image', \n\t\t\t\t\t\t\t array( 'where' => $where,\n\t\t\t\t\t\t\t\t\t 'prune' => $prune,\n 'sort_key' => $sort_key,\n 'order_key' => $order_key,\n 'show' => $show,\n\t\t\t\t\t\t\t), 'gallery_sql_queries' );\t\t\t\t\t\t\t\t\t \n $this->ipsclass->DB->simple_exec();\n \n // Show it\n $i = $this->ipsclass->DB->fetch_row();\n\n if( $this->ipsclass->DB->get_num_rows() )\n {\n $show++;\n $photo = $this->glib->make_image_link( $i );\n $type = ( $this->ipsclass->input['cat'] ) ? \"&cat={$this->ipsclass->input['cat']}\" : \"&album={$this->ipsclass->input['album']}&mid={$i['mid']}\";\n $hfoff = ( $this->ipsclass->input['hfoff'] ) ? \"&hfoff=1\" : \"\";\n\t\t\t\t$close = ( $this->ipsclass->input['closewindow'] ) ? \"&closewindow=1\" : \"\";\n\t\t\t\t$url = \"{$this->ipsclass->base_url}automodule=gallery&cmd=slideshow&show={$show}&duration={$this->ipsclass->input['duration']}&sort_key={$this->ipsclass->input['sort_key']}&order_key={$this->ipsclass->input['order_key']}&prune_key={$this->ipsclass->input['prune_key']}{$type}{$hfoff}{$close}\";\n $this->output .= $this->html->ss_slide( $photo, $url, $i['id'] );\n }\n else\n {\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $url = \"automodule=gallery&cmd=sc&cat={$this->ipsclass->input['cat']}\";\n }\n else\n {\n $url = \"automodule=gallery&cmd=user&user={$this->ipsclass->input['mid']}&op=view_album&album={$this->ipsclass->input['album']}\";\n }\n\n\t\t\t\tif( $this->ipsclass->input['closewindow'] )\n\t\t\t\t{\n\t\t\t\t\techo '<html><body onload=\"javascript:window.close();\"></html>';\n\t\t\t\t\tdie();\n\t\t\t\t}\n \n $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['ss_end'], $url );\n }\n\n // Page Info\n $this->title = $this->ipsclass->vars['board_name'].$this->ipsclass->lang['sep'].$this->ipsclass->lang['gallery'];\n $this->nav[] = \"<a href='\".$this->ipsclass->base_url.\"automodule=gallery'>Gallery</a>\";\n $this->nav[] = $i['caption'];\n\t\t\t\n // -------------------------------------------------------\n // Stat Update!\n // -------------------------------------------------------\n $this->ipsclass->DB->simple_update( 'gallery_images', 'views=views+1', \"id={$i['id']}\", 1 );\n $this->ipsclass->DB->simple_exec();\n\n\t\t\tif( $this->ipsclass->input['hfoff'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->print->pop_up_window( $this->title, $this->output );\n\t\t\t}\n }",
"protected function postSlidesAddRequest(Requests\\PostSlidesAddRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling postSlidesAdd');\n }\n\n $resourcePath = '/slides/{name}/slides';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->position !== null) {\n $queryParams['position'] = ObjectSerializer::toQueryValue($request->position);\n }\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->layoutAlias !== null) {\n $queryParams['layoutAlias'] = ObjectSerializer::toQueryValue($request->layoutAlias);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'POST');\n }",
"public function set_slider_slides($slides) {\n $this->slides_to_include = $slides;\n }",
"public function createSlideshow($options = [])\n {\n return $this->createSlideshowAsync($options)->wait();\n }",
"function add_shortcode_metabox() {\n add_meta_box('acf_slideshow_shortcode', 'Shortcode', 'acfcallback', 'acf_slideshow', 'side', 'default');\n}",
"function cpt_slideshow_init() {\n\n\t$labels = array(\n\t\t'name' => _x(__('Home Slideshow', 'kcsite'), 'post type general name'),\n\t\t'singular_name' => _x('Products', 'post type singular name'),\n\t\t//'add_new' => _x('Add New', 'Slide'),\n\t\t//'add_new_item' => __('Add New Slide', 'kcsite'),\n\t\t//'edit_item' => __('Edit Slide', 'kcsite'),\n\t\t//'new_item' => __('New Slide', 'kcsite'),\n\t\t//'view_item' => __('View Slide', 'kcsite', 'kcsite'),\n\t\t//'search_items' => __('Search Slides', 'kcsite'),\n\t\t'not_found' => __('No Items found'),\n\t\t'not_found_in_trash' => __('No Items found in Trash'),\n\t\t'parent_item_colon' => ''\n\t);\n\t $args = array(\n\t\t'labels' => $labels,\n\t\t'public' => false,\n\t\t'exclude_from_search' =>true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t//'menu_position' => 5,\n\t\t//'menu_icon' => '',\n\t\t'hierarchical' => true,\n\t\t'supports' => array('thumbnail','title', 'editor', 'custom-fields', 'excerpt'),\n\t\t// 'rewrite' => true,\t\t\n\t\t// 'query_var' => true,\n\t);\n\tregister_post_type('home-slideshow', $args);\n\t\n\tregister_taxonomy(\n\t\t'home-slideshow-category', \n\t\t'home-slideshow',\n\t\tarray(\n\t\t\t'hierarchical' => true, \n\t\t\t'label' => __('Categories'), \n\t\t\t'singular_name' => __('Category'),\n\t\t\t'query_var' => 'home-slideshow-category'\n\t\t)\n\t);\n\n\t$labels = array(\n\t\t'name' => _x(__('Interesting facts', 'kcsite'), 'post type general name'),\n\t\t'singular_name' => _x('Interesting fact', 'post type singular name'),\n\t);\n\t $args = array(\n\t\t'labels' => $labels,\n\t\t'public' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'hierarchical' => false,\n\t\t//'has_archive' => true,\n\t\t'supports' => array('thumbnail','title', 'editor', 'custom-fields', 'excerpt'),\n\t\t'rewrite' => array('slug'=>'idomus-faktai/faktas','with_front'=> false),\n\t);\n\tregister_post_type('interesting-fact', $args);\n\n\t$labels = array(\n\t\t'name' => _x(__('Burbulai', 'kcsite'), 'post type general name'),\n\t\t'singular_name' => _x('Burbulai', 'post type singular name'),\n\t\t'not_found' => __('No Items found'),\n\t\t'not_found_in_trash' => __('No Items found in Trash'),\n\t\t'parent_item_colon' => ''\n\t);\n\t $args = array(\n\t\t'labels' => $labels,\n\t\t'public' => false,\n\t\t'exclude_from_search' =>true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t//'menu_position' => 5,\n\t\t//'menu_icon' => '',\n\t\t'hierarchical' => true,\n\t\t'supports' => array('title', 'editor', 'page-attributes', 'custom-fields',), //page-attributes for reordering to work, but not needed here\n\t\t// 'supports' => array('title', 'editor'),\n\t\t// 'rewrite' => true,\t\t\n\t\t// 'query_var' => true,\n\t);\n\tregister_post_type('bubble', $args);\n\n register_taxonomy(\n 'new-type', \n 'post',\n array(\n 'label' => 'Naujienos tipas', \n 'labels' => array(\n 'name' => 'Naujienos tipas',\n 'singular_name' => 'Naujienos tipas',\n 'menu_name' => 'Naujienos tipas',\n ),\n 'hierarchical' => true, \n // 'query_var' => 'film-type'\n )\n );\n\n\n}",
"public function ghostpool_post_type_slides() {\t\n\t\n\t\t\tregister_post_type( 'gp_slide', array( \n\t\t\t\t'labels' => array( \n\t\t\t\t\t'name' => esc_html__( 'Slides', 'socialize-plugin' ),\n\t\t\t\t\t'singular_name' => esc_html__( 'Slide', 'socialize-plugin' ),\n\t\t\t\t\t'menu_name' => esc_html__( 'Slides', 'socialize-plugin' ),\n\t\t\t\t\t'all_items' => esc_html__( 'All Slides', 'socialize-plugin' ),\n\t\t\t\t\t'add_new' => _x( 'Add New', 'portfolio', 'socialize-plugin' ),\n\t\t\t\t\t'add_new_item' => esc_html__( 'Add New Slide', 'socialize-plugin' ),\n\t\t\t\t\t'edit_item' => esc_html__( 'Edit Slide', 'socialize-plugin' ),\n\t\t\t\t\t'new_item' => esc_html__( 'New Slide', 'socialize-plugin' ),\n\t\t\t\t\t'view_item' => esc_html__( 'View Slide', 'socialize-plugin' ),\n\t\t\t\t\t'search_items' => esc_html__( 'Search Slides', 'socialize-plugin' ),\n\t\t\t\t\t'not_found' => esc_html__( 'No slides found', 'socialize-plugin' ),\n\t\t\t\t\t'not_found_in_trash' => esc_html__( 'No slides found in Trash', 'socialize-plugin' ),\n\t\t\t\t ),\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'_builtin' => false,\n\t\t\t\t'_edit_link' => 'post.php?post=%d',\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'rewrite' => array( 'slug' => 'slide' ),\n\t\t\t\t'menu_position' => 20,\n\t\t\t\t'with_front' => true,\n\t\t\t\t'has_archive' => 'gp_slides',\n\t\t\t\t'supports' => array( 'title', 'thumbnail' )\n\t\t\t ) );\n\t\n\t\n\t\t\t/*--------------------------------------------------------------\n\t\t\tSlide Categories Taxonomy\n\t\t\t--------------------------------------------------------------*/\n\t\t\t\n\t\t\tregister_taxonomy( 'gp_slides', 'gp_slide', array( \n\t\t\t\t'labels' => array( \n\t\t\t\t\t'name' => esc_html__( 'Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'singular_name' => esc_html__( 'Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'all_items' => esc_html__( 'All Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'add_new' => _x( 'Add New', 'portfolio', 'socialize-plugin' ),\n\t\t\t\t\t'add_new_item' => esc_html__( 'Add New Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'edit_item' => esc_html__( 'Edit Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'new_item' => esc_html__( 'New Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'view_item' => esc_html__( 'View Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'search_items' => esc_html__( 'Search Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'menu_name' => esc_html__( 'Slide Categories', 'socialize-plugin' )\n\t\t\t\t ),\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'rewrite' => array( 'slug' => 'slides' )\n\t\t\t ) );\n\n\n\t\t\tregister_taxonomy_for_object_type( 'gp_slides', 'gp_slide' );\n\n\n\t\t\t/*--------------------------------------------------------------\n\t\t\tSlide Admin Columns\n\t\t\t--------------------------------------------------------------*/\n\n\t\t\tif ( ! function_exists( 'ghostpool_slide_edit_columns' ) ) { \n\t\t\t\tfunction ghostpool_slides_edit_columns( $columns ) {\n\t\t\t\t\t$columns = array( \n\t\t\t\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t\t\t\t'title' => esc_html__( 'Title', 'socialize-plugin' ),\t\n\t\t\t\t\t\t'slide_categories' => esc_html__( 'Categories', 'socialize-plugin' ),\n\t\t\t\t\t\t'slide_image' => esc_html__( 'Image', 'socialize-plugin' ),\t\t\t\t\n\t\t\t\t\t\t'date' => esc_html__( 'Date', 'socialize-plugin' )\n\t\t\t\t\t );\n\t\t\t\t\treturn $columns;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tadd_filter( 'manage_edit-gp_slide_columns', 'ghostpool_slides_edit_columns' );\n\t\t\n\t\t}",
"public function createAction()\n {\n $slideshow = new Slideshow();\n $request = $this->getRequest();\n $form = $this->createForm(new SlideshowType(), $slideshow);\n\n if ('POST' === $request->getMethod()) {\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $user = $this->get('security.context')->getToken()->getUser();\n $slideshow->setPerson($user);\n $slideshow->setCreated(new \\DateTime('now'));\n $finder = $this->getFinder();\n $catalogManager = $this->get('berkman_catalog.catalog_manager');\n\n if ($finder) {\n $images = $finder->getSelectedImageResults();\n foreach ($images as $image) {\n $newImage = clone $image;\n $newImage->setCatalog($image->getCatalog());\n $slide = new Slide($newImage);\n $slideshow->addSlide($slide);\n }\n $request->getSession()->remove('finder');\n }\n $slideshow->setUpdated(new \\DateTime('now'));\n $em->persist($slideshow);\n $em->flush();\n $request->getSession()->setFlash('notice', 'New slideshow \"' . $slideshow->getName() . '\" created with ' . count($slideshow->getSlides()) . ' slides.');\n\n // creating the ACL\n $aclProvider = $this->get('security.acl.provider');\n $objectIdentity = ObjectIdentity::fromDomainObject($slideshow);\n $acl = $aclProvider->createAcl($objectIdentity);\n\n // retrieving the security identity of the currently logged-in user\n $securityIdentity = UserSecurityIdentity::fromAccount($user);\n\n // grant owner access\n $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);\n $aclProvider->updateAcl($acl);\n\n return $this->redirect($this->generateUrl('slideshow_show', array('id' => $slideshow->getId())));\n }\n }\n\n return $this->render('BerkmanSlideshowBundle:Slideshow:new.html.twig', array(\n 'entity' => $slideshow,\n 'form' => $form->createView()\n ));\n }",
"function DisplayImageSlideshow3($type='She Beads')\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\t\r\n\t\t// PUBLISH PENDING SLIDES\r\n\t\t//publishPendingItems('image_slideshow_3_slides');\r\n\t\t\r\n\t\t// EXPIRE PUBLISHED SLIDES\r\n\t\t//expirePublishedItems('image_slideshow_3_slides');\r\n\t\t\r\n\t\techo \"\t<div id='slider-wrapper'>\";\r\n echo \"\t \t<div id='slider' class='nivoSlider'>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// DO IMAGES\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$select = \t\"SELECT * FROM image_slideshow_3_slides WHERE \".\r\n\t\t\t\t\t\t\t\t\t\"active='1' AND \".\r\n\t\t\t\t\t\t\t\t\t\"status='Published' AND \".\r\n\t\t\t\t\t\t\t\t\t\"type='\".$type.\"' ORDER BY slide_id DESC\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t$select = \t\"SELECT * FROM image_slideshow_3_slides WHERE \".\r\n\t\t\t\t\t\t\t\t\t\"active='1' AND \".\r\n\t\t\t\t\t\t\t\t\t\"status='Published' AND \".\r\n\t\t\t\t\t\t\t\t\t\"type='\".$type.\"' ORDER BY published_date DESC, slide_id DESC\";\r\n\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$result = doQuery($select);\r\n\t\t\t\t\t\t$num = mysql_num_rows($result);\r\n\t\t\t\t\t\t$i = 0;\r\n\t\t\t\t\t\twhile($i<$num){\r\n\t\t\t\t\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row['link1'] == \"\"){\r\n\t\t\t\t\t\t\t\t$row['link1'] = \"\".$_SETTINGS['website'].\"items\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \"<a href='\".$row['link1'].\"'><img src='\".$_SETTINGS['website'].\"uploads/\".$row['image1'].\"' alt='' title='#htmlcaption\".$i.\"' /></a>\";\r\n\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\techo\"\t\t</div>\"; \r\n\r\n\t\t\t\t\t\t// DO CAPTIONS\r\n\t\t\t\t\t\t$select = \t\"SELECT * FROM image_slideshow_3_slides WHERE \".\r\n\t\t\t\t\t\t\t\t\t\"active='1' AND \".\r\n\t\t\t\t\t\t\t\t\t\"status='Published' AND \".\r\n\t\t\t\t\t\t\t\t\t\"type='\".$type.\"' ORDER BY slide_id DESC\";\r\n\t\t\t\t\t\t$result = doQuery($select);\r\n\t\t\t\t\t\t$num = mysql_num_rows($result);\r\n\t\t\t\t\t\t$i = 0;\r\n\t\t\t\t\t\twhile($i<$num){\r\n\t\t\t\t\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t\t\t\t\tif($row['text1'] != \"\"){\r\n\t\t\t\t\t\t\t\techo \"<div id='htmlcaption\".$i.\"' class='nivo-html-caption'>\";\r\n\t\t\t\t\t\t\t\techo $row['text1'];\r\n\t\t\t\t\t\t\t\techo \"</div>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t}\r\n echo \"\t</div>\";\r\n\t}",
"static function add_slides_big_post(): void {\r\n self::add_acf_inner_field(self::slides, self::slides_big_post, [\r\n 'label' => 'Big article (recent only)',\r\n 'post_type' => [\r\n 0 => 'post',\r\n ],\r\n 'taxonomy' => [],\r\n 'allow_null' => 0,\r\n 'multiple' => 0,\r\n 'return_format' => 'object',\r\n 'ui' => 1,\r\n 'type' => 'post_object',\r\n 'instructions' => '',\r\n 'required' => 1,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::recent_only),\r\n 'operator' => '==',\r\n 'value' => '1',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '80',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }"
]
| [
"0.68781924",
"0.60717183",
"0.5906792",
"0.5889411",
"0.57598007",
"0.57495195",
"0.5749272",
"0.5712877",
"0.57038784",
"0.5683384",
"0.56265455",
"0.56125593",
"0.55864996",
"0.54475427",
"0.53304017",
"0.532423",
"0.5263995",
"0.52542967",
"0.52130866",
"0.5212669",
"0.5196738",
"0.5183824",
"0.51764053",
"0.5169958",
"0.510992",
"0.5102636",
"0.5095377",
"0.5082971",
"0.50692344",
"0.49889764"
]
| 0.6861918 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.